UNPKG

351 kBJavaScriptView Raw
1/*! onsenui v2.0.4 - 2016-11-04 */
2window.CustomEvent||!function(){var CustomEvent;CustomEvent=function(event,params){var evt;return params=params||{bubbles:!1,cancelable:!1,detail:void 0},evt=document.createEvent("CustomEvent"),evt.initCustomEvent(event,params.bubbles,params.cancelable,params.detail),evt},CustomEvent.prototype=window.Event.prototype,window.CustomEvent=CustomEvent}(),"undefined"==typeof WeakMap&&!function(){var defineProperty=Object.defineProperty,counter=Date.now()%1e9,WeakMap=function(){this.name="__st"+(1e9*Math.random()>>>0)+(counter++ +"__")};WeakMap.prototype={set:function(key,value){var entry=key[this.name];return entry&&entry[0]===key?entry[1]=value:defineProperty(key,this.name,{value:[key,value],writable:!0}),this},get:function(key){var entry;return(entry=key[this.name])&&entry[0]===key?entry[1]:void 0},"delete":function(key){var entry=key[this.name];return!(!entry||entry[0]!==key)&&(entry[0]=entry[1]=void 0,!0)},has:function(key){var entry=key[this.name];return!!entry&&entry[0]===key}},window.WeakMap=WeakMap}(),function(global){function scheduleCallback(observer){scheduledObservers.push(observer),isScheduled||(isScheduled=!0,setImmediate(dispatchCallbacks))}function wrapIfNeeded(node){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(node)||node}function dispatchCallbacks(){isScheduled=!1;var observers=scheduledObservers;scheduledObservers=[],observers.sort(function(o1,o2){return o1.uid_-o2.uid_});var anyNonEmpty=!1;observers.forEach(function(observer){var queue=observer.takeRecords();removeTransientObserversFor(observer),queue.length&&(observer.callback_(queue,observer),anyNonEmpty=!0)}),anyNonEmpty&&dispatchCallbacks()}function removeTransientObserversFor(observer){observer.nodes_.forEach(function(node){var registrations=registrationsTable.get(node);registrations&&registrations.forEach(function(registration){registration.observer===observer&&registration.removeTransientObservers()})})}function forEachAncestorAndObserverEnqueueRecord(target,callback){for(var node=target;node;node=node.parentNode){var registrations=registrationsTable.get(node);if(registrations)for(var j=0;j<registrations.length;j++){var registration=registrations[j],options=registration.options;if(node===target||options.subtree){var record=callback(options);record&&registration.enqueue(record)}}}}function JsMutationObserver(callback){this.callback_=callback,this.nodes_=[],this.records_=[],this.uid_=++uidCounter}function MutationRecord(type,target){this.type=type,this.target=target,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function copyMutationRecord(original){var record=new MutationRecord(original.type,original.target);return record.addedNodes=original.addedNodes.slice(),record.removedNodes=original.removedNodes.slice(),record.previousSibling=original.previousSibling,record.nextSibling=original.nextSibling,record.attributeName=original.attributeName,record.attributeNamespace=original.attributeNamespace,record.oldValue=original.oldValue,record}function getRecord(type,target){return currentRecord=new MutationRecord(type,target)}function getRecordWithOldValue(oldValue){return recordWithOldValue?recordWithOldValue:(recordWithOldValue=copyMutationRecord(currentRecord),recordWithOldValue.oldValue=oldValue,recordWithOldValue)}function clearRecords(){currentRecord=recordWithOldValue=void 0}function recordRepresentsCurrentMutation(record){return record===recordWithOldValue||record===currentRecord}function selectRecord(lastRecord,newRecord){return lastRecord===newRecord?lastRecord:recordWithOldValue&&recordRepresentsCurrentMutation(lastRecord)?recordWithOldValue:null}function Registration(observer,target,options){this.observer=observer,this.target=target,this.options=options,this.transientObservedNodes=[]}if(!global.JsMutationObserver){var setImmediate,registrationsTable=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))setImmediate=setTimeout;else if(window.setImmediate)setImmediate=window.setImmediate;else{var setImmediateQueue=[],sentinel=String(Math.random());window.addEventListener("message",function(e){if(e.data===sentinel){var queue=setImmediateQueue;setImmediateQueue=[],queue.forEach(function(func){func()})}}),setImmediate=function(func){setImmediateQueue.push(func),window.postMessage(sentinel,"*")}}var isScheduled=!1,scheduledObservers=[],uidCounter=0;JsMutationObserver.prototype={observe:function(target,options){if(target=wrapIfNeeded(target),!options.childList&&!options.attributes&&!options.characterData||options.attributeOldValue&&!options.attributes||options.attributeFilter&&options.attributeFilter.length&&!options.attributes||options.characterDataOldValue&&!options.characterData)throw new SyntaxError;var registrations=registrationsTable.get(target);registrations||registrationsTable.set(target,registrations=[]);for(var registration,i=0;i<registrations.length;i++)if(registrations[i].observer===this){registration=registrations[i],registration.removeListeners(),registration.options=options;break}registration||(registration=new Registration(this,target,options),registrations.push(registration),this.nodes_.push(target)),registration.addListeners()},disconnect:function(){this.nodes_.forEach(function(node){for(var registrations=registrationsTable.get(node),i=0;i<registrations.length;i++){var registration=registrations[i];if(registration.observer===this){registration.removeListeners(),registrations.splice(i,1);break}}},this),this.records_=[]},takeRecords:function(){var copyOfRecords=this.records_;return this.records_=[],copyOfRecords}};var currentRecord,recordWithOldValue;Registration.prototype={enqueue:function(record){var records=this.observer.records_,length=records.length;if(records.length>0){var lastRecord=records[length-1],recordToReplaceLast=selectRecord(lastRecord,record);if(recordToReplaceLast)return void(records[length-1]=recordToReplaceLast)}else scheduleCallback(this.observer);records[length]=record},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(node){var options=this.options;options.attributes&&node.addEventListener("DOMAttrModified",this,!0),options.characterData&&node.addEventListener("DOMCharacterDataModified",this,!0),options.childList&&node.addEventListener("DOMNodeInserted",this,!0),(options.childList||options.subtree)&&node.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(node){var options=this.options;options.attributes&&node.removeEventListener("DOMAttrModified",this,!0),options.characterData&&node.removeEventListener("DOMCharacterDataModified",this,!0),options.childList&&node.removeEventListener("DOMNodeInserted",this,!0),(options.childList||options.subtree)&&node.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(node){if(node!==this.target){this.addListeners_(node),this.transientObservedNodes.push(node);var registrations=registrationsTable.get(node);registrations||registrationsTable.set(node,registrations=[]),registrations.push(this)}},removeTransientObservers:function(){var transientObservedNodes=this.transientObservedNodes;this.transientObservedNodes=[],transientObservedNodes.forEach(function(node){this.removeListeners_(node);for(var registrations=registrationsTable.get(node),i=0;i<registrations.length;i++)if(registrations[i]===this){registrations.splice(i,1);break}},this)},handleEvent:function(e){switch(e.stopImmediatePropagation(),e.type){case"DOMAttrModified":var name=e.attrName,namespace=e.relatedNode.namespaceURI,target=e.target,record=new getRecord("attributes",target);record.attributeName=name,record.attributeNamespace=namespace;var oldValue=e.attrChange===MutationEvent.ADDITION?null:e.prevValue;forEachAncestorAndObserverEnqueueRecord(target,function(options){if(options.attributes&&(!options.attributeFilter||!options.attributeFilter.length||options.attributeFilter.indexOf(name)!==-1||options.attributeFilter.indexOf(namespace)!==-1))return options.attributeOldValue?getRecordWithOldValue(oldValue):record});break;case"DOMCharacterDataModified":var target=e.target,record=getRecord("characterData",target),oldValue=e.prevValue;forEachAncestorAndObserverEnqueueRecord(target,function(options){if(options.characterData)return options.characterDataOldValue?getRecordWithOldValue(oldValue):record});break;case"DOMNodeRemoved":this.addTransientObserver(e.target);case"DOMNodeInserted":var addedNodes,removedNodes,changedNode=e.target;"DOMNodeInserted"===e.type?(addedNodes=[changedNode],removedNodes=[]):(addedNodes=[],removedNodes=[changedNode]);var previousSibling=changedNode.previousSibling,nextSibling=changedNode.nextSibling,record=getRecord("childList",e.target.parentNode);record.addedNodes=addedNodes,record.removedNodes=removedNodes,record.previousSibling=previousSibling,record.nextSibling=nextSibling,forEachAncestorAndObserverEnqueueRecord(e.relatedNode,function(options){if(options.childList)return record})}clearRecords()}},global.JsMutationObserver=JsMutationObserver,global.MutationObserver||(global.MutationObserver=JsMutationObserver,JsMutationObserver._isPolyfilled=!0)}}(self),window.animit=function(){"use strict";var TIMEOUT_RATIO=1.4,util={};util.capitalize=function(str){return str.charAt(0).toUpperCase()+str.slice(1)},util.buildTransitionValue=function(params){params.property=params.property||"all",params.duration=params.duration||.4,params.timing=params.timing||"linear";var props=params.property.split(/ +/);return props.map(function(prop){return prop+" "+params.duration+"s "+params.timing}).join(", ")},util.onceOnTransitionEnd=function(element,callback){if(!element)return function(){};var fn=function(event){element==event.target&&(event.stopPropagation(),removeListeners(),callback())},removeListeners=function(){util._transitionEndEvents.forEach(function(eventName){element.removeEventListener(eventName,fn,!1)})};return util._transitionEndEvents.forEach(function(eventName){element.addEventListener(eventName,fn,!1)}),removeListeners},util._transitionEndEvents=function(){return"ontransitionend"in window?["transitionend"]:"onwebkittransitionend"in window?["webkitTransitionEnd"]:"webkit"===util.vendorPrefix||"o"===util.vendorPrefix||"moz"===util.vendorPrefix||"ms"===util.vendorPrefix?[util.vendorPrefix+"TransitionEnd","transitionend"]:[]}(),util._cssPropertyDict=function(){for(var styles=window.getComputedStyle(document.documentElement,""),dict={},a="A".charCodeAt(0),z="z".charCodeAt(0),upper=function(s){return s.substr(1).toUpperCase()},i=0;i<styles.length;i++){var key=styles[i].replace(/^[\-]+/,"").replace(/[\-][a-z]/g,upper).replace(/^moz/,"Moz");a<=key.charCodeAt(0)&&z>=key.charCodeAt(0)&&"cssText"!==key&&"parentText"!==key&&(dict[key]=!0)}return dict}(),util.hasCssProperty=function(name){return name in util._cssPropertyDict},util.vendorPrefix=function(){var styles=window.getComputedStyle(document.documentElement,""),pre=(Array.prototype.slice.call(styles).join("").match(/-(moz|webkit|ms)-/)||""===styles.OLink&&["","o"])[1];return pre}(),util.forceLayoutAtOnce=function(elements,callback){this.batchImmediate(function(){elements.forEach(function(element){element.offsetHeight}),callback()})},util.batchImmediate=function(){var callbacks=[];return function(callback){0===callbacks.length&&setImmediate(function(){var concreateCallbacks=callbacks.slice(0);callbacks=[],concreateCallbacks.forEach(function(callback){callback()})}),callbacks.push(callback)}}(),util.batchAnimationFrame=function(){var callbacks=[],raf=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){setTimeout(callback,1e3/60)};return function(callback){0===callbacks.length&&raf(function(){var concreateCallbacks=callbacks.slice(0);callbacks=[],concreateCallbacks.forEach(function(callback){callback()})}),callbacks.push(callback)}}(),util.transitionPropertyName=function(){if(util.hasCssProperty("transitionDuration"))return"transition";if(util.hasCssProperty(util.vendorPrefix+"TransitionDuration"))return util.vendorPrefix+"Transition";throw new Error("Invalid state")}();var Animit=function(element){if(!(this instanceof Animit))return new Animit(element);if(element instanceof HTMLElement)this.elements=[element];else{if("[object Array]"!==Object.prototype.toString.call(element))throw new Error("First argument must be an array or an instance of HTMLElement.");this.elements=element}this.transitionQueue=[],this.lastStyleAttributeDict=[]};return Animit.prototype={transitionQueue:void 0,elements:void 0,play:function(callback){return"function"==typeof callback&&this.transitionQueue.push(function(done){callback(),done()}),this.startAnimation(),this},queue:function(transition,options){var queue=this.transitionQueue;if(transition&&options&&(options.css=transition,transition=new Animit.Transition(options)),transition instanceof Function||transition instanceof Animit.Transition||(transition=transition.css?new Animit.Transition(transition):new Animit.Transition({css:transition})),transition instanceof Function)queue.push(transition);else{if(!(transition instanceof Animit.Transition))throw new Error("Invalid arguments");queue.push(transition.build())}return this},wait:function(seconds){return seconds>0&&this.transitionQueue.push(function(done){setTimeout(done,1e3*seconds)}),this},saveStyle:function(){return this.transitionQueue.push(function(done){this.elements.forEach(function(element,index){for(var css=this.lastStyleAttributeDict[index]={},i=0;i<element.style.length;i++)css[element.style[i]]=element.style[element.style[i]]}.bind(this)),done()}.bind(this)),this},restoreStyle:function(options){function reset(){self.elements.forEach(function(element,index){element.style[transitionName]="none";var css=self.lastStyleAttributeDict[index];if(!css)throw new Error("restoreStyle(): The style is not saved. Invoke saveStyle() before.");self.lastStyleAttributeDict[index]=void 0;for(var i=0,name="";i<element.style.length;i++)name=element.style[i],"undefined"==typeof css[element.style[i]]&&(css[element.style[i]]="");Object.keys(css).forEach(function(key){element.style[key]=css[key]})})}options=options||{};var self=this;if(options.transition&&!options.duration)throw new Error('"options.duration" is required when "options.transition" is enabled.');var transitionName=util.transitionPropertyName;if(options.transition||options.duration&&options.duration>0){var transitionValue=options.transition||"all "+options.duration+"s "+(options.timing||"linear");this.transitionQueue.push(function(done){var timeoutId,elements=this.elements,clearTransition=function(){elements.forEach(function(element){element.style[transitionName]=""})},removeListeners=util.onceOnTransitionEnd(elements[0],function(){clearTimeout(timeoutId),clearTransition(),done()});timeoutId=setTimeout(function(){removeListeners(),clearTransition(),done()},1e3*options.duration*TIMEOUT_RATIO),elements.forEach(function(element,index){var css=self.lastStyleAttributeDict[index];if(!css)throw new Error("restoreStyle(): The style is not saved. Invoke saveStyle() before.");self.lastStyleAttributeDict[index]=void 0;for(var name,i=0,len=element.style.length;i<len;i++)name=element.style[i],void 0===css[name]&&(css[name]="");element.style[transitionName]=transitionValue,Object.keys(css).forEach(function(key){key!==transitionName&&(element.style[key]=css[key])}),element.style[transitionName]=transitionValue})})}else this.transitionQueue.push(function(done){reset(),done()});return this},startAnimation:function(){return this._dequeueTransition(),this},_dequeueTransition:function(){var transition=this.transitionQueue.shift();if(this._currentTransition)throw new Error("Current transition exists.");this._currentTransition=transition;var self=this,called=!1,done=function(){if(called)throw new Error("Invalid state: This callback is called twice.");called=!0,self._currentTransition=void 0,self._dequeueTransition()};transition&&transition.call(this,done)}},Animit.runAll=function(){for(var i=0;i<arguments.length;i++)arguments[i].play()},Animit.Transition=function(options){this.options=options||{},this.options.duration=this.options.duration||0,this.options.timing=this.options.timing||"linear",this.options.css=this.options.css||{},this.options.property=this.options.property||"all"},Animit.Transition.prototype={build:function(){function createActualCssProps(css){var result={};return Object.keys(css).forEach(function(name){var value=css[name];if(util.hasCssProperty(name))return void(result[name]=value);var prefixed=util.vendorPrefix+util.capitalize(name);util.hasCssProperty(prefixed)?result[prefixed]=value:(result[prefixed]=value,result[name]=value)}),result}if(0===Object.keys(this.options.css).length)throw new Error("options.css is required.");var css=createActualCssProps(this.options.css);if(this.options.duration>0){var transitionValue=util.buildTransitionValue(this.options),self=this;return function(callback){var timeoutId,elements=this.elements,timeout=1e3*self.options.duration*TIMEOUT_RATIO,removeListeners=util.onceOnTransitionEnd(elements[0],function(){clearTimeout(timeoutId),callback()});timeoutId=setTimeout(function(){removeListeners(),callback()},timeout),elements.forEach(function(element){element.style[util.transitionPropertyName]=transitionValue,Object.keys(css).forEach(function(name){element.style[name]=css[name]})})}}if(this.options.duration<=0)return function(callback){var elements=this.elements;elements.forEach(function(element){element.style[util.transitionPropertyName]="",Object.keys(css).forEach(function(name){element.style[name]=css[name]})}),elements.length>0?util.forceLayoutAtOnce(elements,function(){util.batchAnimationFrame(callback)}):util.batchAnimationFrame(callback)}}},Animit}(),function(){"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}(),"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))?!function(){"use strict";var testElement=document.createElement("_");if(testElement.classList.add("c1","c2"),!testElement.classList.contains("c2")){var createMethod=function(method){var original=DOMTokenList.prototype[method];DOMTokenList.prototype[method]=function(token){var i,len=arguments.length;for(i=0;i<len;i++)token=arguments[i],original.call(this,token)}};createMethod("add"),createMethod("remove")}if(testElement.classList.toggle("c3",!1),testElement.classList.contains("c3")){var _toggle=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(token,force){return 1 in arguments&&!this.contains(token)==!force?force:_toggle.call(this,token)}}testElement=null}():!function(view){"use strict";if("Element"in view){var classListProp="classList",protoProp="prototype",elemCtrProto=view.Element[protoProp],objCtr=Object,strTrim=String[protoProp].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[protoProp].indexOf||function(item){for(var i=0,len=this.length;i<len;i++)if(i in this&&this[i]===item)return i;return-1},DOMEx=function(type,message){this.name=type,this.code=DOMException[type],this.message=message},checkTokenAndGetIndex=function(classList,token){if(""===token)throw new DOMEx("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(token))throw new DOMEx("INVALID_CHARACTER_ERR","String contains an invalid character");return arrIndexOf.call(classList,token)},ClassList=function(elem){for(var trimmedClasses=strTrim.call(elem.getAttribute("class")||""),classes=trimmedClasses?trimmedClasses.split(/\s+/):[],i=0,len=classes.length;i<len;i++)this.push(classes[i]);this._updateClassName=function(){elem.setAttribute("class",this.toString())}},classListProto=ClassList[protoProp]=[],classListGetter=function(){return new ClassList(this)};if(DOMEx[protoProp]=Error[protoProp],classListProto.item=function(i){return this[i]||null},classListProto.contains=function(token){return token+="",checkTokenAndGetIndex(this,token)!==-1},classListProto.add=function(){var token,tokens=arguments,i=0,l=tokens.length,updated=!1;do token=tokens[i]+"",checkTokenAndGetIndex(this,token)===-1&&(this.push(token),updated=!0);while(++i<l);updated&&this._updateClassName()},classListProto.remove=function(){var token,index,tokens=arguments,i=0,l=tokens.length,updated=!1;do for(token=tokens[i]+"",index=checkTokenAndGetIndex(this,token);index!==-1;)this.splice(index,1),updated=!0,index=checkTokenAndGetIndex(this,token);while(++i<l);updated&&this._updateClassName()},classListProto.toggle=function(token,force){token+="";var result=this.contains(token),method=result?force!==!0&&"remove":force!==!1&&"add";return method&&this[method](token),force===!0||force===!1?force:!result},classListProto.toString=function(){return this.join(" ")},objCtr.defineProperty){var classListPropDesc={get:classListGetter,enumerable:!0,configurable:!0};try{objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}catch(ex){ex.number===-2146823252&&(classListPropDesc.enumerable=!1,objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc))}}else objCtr[protoProp].__defineGetter__&&elemCtrProto.__defineGetter__(classListProp,classListGetter)}}(self)),"customElements"in window&&(window.customElements.define=void 0),function(window){"use strict";function ASAP(){var queue=asapQueue.splice(0,asapQueue.length);for(asapTimer=0;queue.length;)queue.shift().call(null,queue.shift())}function loopAndVerify(list,action){for(var i=0,length=list.length;i<length;i++)verifyAndSetupAndAction(list[i],action)}function loopAndSetup(list){for(var node,i=0,length=list.length;i<length;i++)node=list[i],patch(node,protos[getTypeIndex(node)])}function executeAction(action){return function(node){isValidNode(node)&&(verifyAndSetupAndAction(node,action),loopAndVerify(node.querySelectorAll(query),action))}}function getTypeIndex(target){var is=getAttribute.call(target,"is"),nodeName=target.nodeName.toUpperCase(),i=indexOf.call(types,is?PREFIX_IS+is.toUpperCase():PREFIX_TAG+nodeName);return is&&-1<i&&!isInQSA(nodeName,is)?-1:i}function isInQSA(name,type){return-1<query.indexOf(name+'[is="'+type+'"]')}function onDOMAttrModified(e){var node=e.currentTarget,attrChange=e.attrChange,attrName=e.attrName,target=e.target,addition=e[ADDITION]||2,removal=e[REMOVAL]||3;!notFromInnerHTMLHelper||target&&target!==node||!node[ATTRIBUTE_CHANGED_CALLBACK]||"style"===attrName||e.prevValue===e.newValue&&(""!==e.newValue||attrChange!==addition&&attrChange!==removal)||node[ATTRIBUTE_CHANGED_CALLBACK](attrName,attrChange===addition?null:e.prevValue,attrChange===removal?null:e.newValue)}function onDOMNode(action){var executor=executeAction(action);return function(e){asapQueue.push(executor,e.target),asapTimer&&clearTimeout(asapTimer),asapTimer=setTimeout(ASAP,1)}}function onReadyStateChange(e){dropDomContentLoaded&&(dropDomContentLoaded=!1,e.currentTarget.removeEventListener(DOM_CONTENT_LOADED,onReadyStateChange)),loopAndVerify((e.target||document).querySelectorAll(query),e.detail===DETACHED?DETACHED:ATTACHED),IE8&&purge()}function patchedSetAttribute(name,value){var self=this;setAttribute.call(self,name,value),onSubtreeModified.call(self,{target:self})}function setupNode(node,proto){setPrototype(node,proto),observer?observer.observe(node,attributesObserver):(doesNotSupportDOMAttrModified&&(node.setAttribute=patchedSetAttribute,node[EXPANDO_UID]=getAttributesMirror(node),node[ADD_EVENT_LISTENER](DOM_SUBTREE_MODIFIED,onSubtreeModified)),node[ADD_EVENT_LISTENER](DOM_ATTR_MODIFIED,onDOMAttrModified)),node[CREATED_CALLBACK]&&notFromInnerHTMLHelper&&(node.created=!0,node[CREATED_CALLBACK](),node.created=!1)}function purge(){for(var node,i=0,length=targets.length;i<length;i++)node=targets[i],documentElement.contains(node)||(length--,targets.splice(i--,1),verifyAndSetupAndAction(node,DETACHED))}function throwTypeError(type){throw new Error("A "+type+" type is already registered")}function verifyAndSetupAndAction(node,action){var fn,i=getTypeIndex(node);-1<i&&(patchIfNotAlready(node,protos[i]),i=0,action!==ATTACHED||node[ATTACHED]?action!==DETACHED||node[DETACHED]||(node[ATTACHED]=!1,node[DETACHED]=!0,i=1):(node[DETACHED]=!1,node[ATTACHED]=!0,i=1,IE8&&indexOf.call(targets,node)<0&&targets.push(node)),i&&(fn=node[action+CALLBACK])&&fn.call(node))}function CustomElementRegistry(){}function CERDefine(name,Class,options){var is=options&&options[EXTENDS]||"",CProto=Class.prototype,proto=create(CProto),attributes=Class.observedAttributes||empty,definition={prototype:proto};safeProperty(proto,CREATED_CALLBACK,{value:function(){if(justCreated)justCreated=!1;else if(!this[DRECEV1]){this[DRECEV1]=!0,new Class(this),CProto[CREATED_CALLBACK]&&CProto[CREATED_CALLBACK].call(this);var info=constructors[nodeNames.get(Class)];(!usableCustomElements||info.create.length>1)&&notifyAttributes(this)}}}),safeProperty(proto,ATTRIBUTE_CHANGED_CALLBACK,{value:function(name){-1<indexOf.call(attributes,name)&&CProto[ATTRIBUTE_CHANGED_CALLBACK].apply(this,arguments)}}),CProto[CONNECTED_CALLBACK]&&safeProperty(proto,ATTACHED_CALLBACK,{value:CProto[CONNECTED_CALLBACK]}),CProto[DISCONNECTED_CALLBACK]&&safeProperty(proto,DETACHED_CALLBACK,{value:CProto[DISCONNECTED_CALLBACK]}),is&&(definition[EXTENDS]=is),name=name.toUpperCase(),constructors[name]={constructor:Class,create:is?[is,secondArgument(name)]:[name]},nodeNames.set(Class,name),document[REGISTER_ELEMENT](name.toLowerCase(),definition),whenDefined(name),waitingList[name].r()}function get(name){var info=constructors[name.toUpperCase()];return info&&info.constructor}function getIs(options){return"string"==typeof options?options:options&&options.is||""}function notifyAttributes(self){for(var attribute,callback=self[ATTRIBUTE_CHANGED_CALLBACK],attributes=callback?self.attributes:empty,i=attributes.length;i--;)attribute=attributes[i],callback.call(self,attribute.name||attribute.nodeName,null,attribute.value||attribute.nodeValue)}function whenDefined(name){return name=name.toUpperCase(),name in waitingList||(waitingList[name]={},waitingList[name].p=new Promise(function(resolve){waitingList[name].r=resolve})),waitingList[name].p}function polyfillV1(){customElements&&delete window.customElements,defineProperty(window,"customElements",{configurable:!0,value:new CustomElementRegistry}),defineProperty(window,"CustomElementRegistry",{configurable:!0,value:CustomElementRegistry});for(var patchClass=function(name){var Class=window[name];if(Class){window[name]=function(self){var info,isNative;return self||(self=this),self[DRECEV1]||(justCreated=!0,info=constructors[nodeNames.get(self.constructor)],isNative=usableCustomElements&&1===info.create.length,self=isNative?Reflect.construct(Class,empty,info.constructor):document.createElement.apply(document,info.create),self[DRECEV1]=!0,justCreated=!1,isNative||notifyAttributes(self)),self},window[name].prototype=Class.prototype;try{Class.prototype.constructor=window[name]}catch(WebKit){fixGetClass=!0,defineProperty(Class,DRECEV1,{value:window[name]})}}},Classes=htmlClass.get(/^HTML[A-Z]*[a-z]/),i=Classes.length;i--;patchClass(Classes[i]));document.createElement=function(name,options){var is=getIs(options);return is?patchedCreateElement.call(this,name,secondArgument(is)):patchedCreateElement.call(this,name)}}var asapQueue,onSubtreeModified,callDOMAttrModified,getAttributesMirror,observer,observe,patchIfNotAlready,patch,document=window.document,Object=window.Object,htmlClass=function(info){var i,section,tags,Class,catchClass=/^[A-Z]+[a-z]/,filterBy=function(re){var tag,arr=[];for(tag in register)re.test(tag)&&arr.push(tag);return arr},add=function(Class,tag){tag=tag.toLowerCase(),tag in register||(register[Class]=(register[Class]||[]).concat(tag),register[tag]=register[tag.toUpperCase()]=Class)},register=(Object.create||Object)(null),htmlClass={};for(section in info)for(Class in info[section])for(tags=info[section][Class],register[Class]=tags,i=0;i<tags.length;i++)register[tags[i].toLowerCase()]=register[tags[i].toUpperCase()]=Class;return htmlClass.get=function(tagOrClass){return"string"==typeof tagOrClass?register[tagOrClass]||(catchClass.test(tagOrClass)?[]:""):filterBy(tagOrClass)},htmlClass.set=function(tag,Class){return catchClass.test(tag)?add(tag,Class):add(Class,tag),htmlClass},htmlClass}({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}}),REGISTER_ELEMENT="registerElement",EXPANDO_UID="__"+REGISTER_ELEMENT+(1e5*window.Math.random()>>0),ADD_EVENT_LISTENER="addEventListener",ATTACHED="attached",CALLBACK="Callback",DETACHED="detached",EXTENDS="extends",ATTRIBUTE_CHANGED_CALLBACK="attributeChanged"+CALLBACK,ATTACHED_CALLBACK=ATTACHED+CALLBACK,CONNECTED_CALLBACK="connected"+CALLBACK,DISCONNECTED_CALLBACK="disconnected"+CALLBACK,CREATED_CALLBACK="created"+CALLBACK,DETACHED_CALLBACK=DETACHED+CALLBACK,ADDITION="ADDITION",MODIFICATION="MODIFICATION",REMOVAL="REMOVAL",DOM_ATTR_MODIFIED="DOMAttrModified",DOM_CONTENT_LOADED="DOMContentLoaded",DOM_SUBTREE_MODIFIED="DOMSubtreeModified",PREFIX_TAG="<",PREFIX_IS="=",validName=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,invalidNames=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],types=[],protos=[],query="",documentElement=document.documentElement,indexOf=types.indexOf||function(v){
3for(var i=this.length;i--&&this[i]!==v;);return i},OP=Object.prototype,hOP=OP.hasOwnProperty,iPO=OP.isPrototypeOf,defineProperty=Object.defineProperty,empty=[],gOPD=Object.getOwnPropertyDescriptor,gOPN=Object.getOwnPropertyNames,gPO=Object.getPrototypeOf,sPO=Object.setPrototypeOf,hasProto=!!Object.__proto__,fixGetClass=!1,DRECEV1="__dreCEv1",customElements=window.customElements,usableCustomElements=!!(customElements&&customElements.define&&customElements.get&&customElements.whenDefined),Dict=Object.create||Object,Map=window.Map||function(){var i,K=[],V=[];return{get:function(k){return V[indexOf.call(K,k)]},set:function(k,v){i=indexOf.call(K,k),i<0?V[K.push(k)-1]=v:V[i]=v}}},Promise=window.Promise||function(fn){function resolve(value){for(done=!0;notify.length;)notify.shift()(value)}var notify=[],done=!1,p={"catch":function(){return p},then:function(cb){return notify.push(cb),done&&setTimeout(resolve,1),p}};return fn(resolve),p},justCreated=!1,constructors=Dict(null),waitingList=Dict(null),nodeNames=new Map,secondArgument=String,create=Object.create||function Bridge(proto){return proto?(Bridge.prototype=proto,new Bridge):this},setPrototype=sPO||(hasProto?function(o,p){return o.__proto__=p,o}:gOPN&&gOPD?function(){function setProperties(o,p){for(var key,names=gOPN(p),i=0,length=names.length;i<length;i++)key=names[i],hOP.call(o,key)||defineProperty(o,key,gOPD(p,key))}return function(o,p){do setProperties(o,p);while((p=gPO(p))&&!iPO.call(p,o));return o}}():function(o,p){for(var key in p)o[key]=p[key];return o}),MutationObserver=window.MutationObserver||window.WebKitMutationObserver,HTMLElementPrototype=(window.HTMLElement||window.Element||window.Node).prototype,IE8=!iPO.call(HTMLElementPrototype,documentElement),safeProperty=IE8?function(o,k,d){return o[k]=d.value,o}:defineProperty,isValidNode=IE8?function(node){return 1===node.nodeType}:function(node){return iPO.call(HTMLElementPrototype,node)},targets=IE8&&[],attachShadow=HTMLElementPrototype.attachShadow,cloneNode=HTMLElementPrototype.cloneNode,dispatchEvent=HTMLElementPrototype.dispatchEvent,getAttribute=HTMLElementPrototype.getAttribute,hasAttribute=HTMLElementPrototype.hasAttribute,removeAttribute=HTMLElementPrototype.removeAttribute,setAttribute=HTMLElementPrototype.setAttribute,createElement=document.createElement,patchedCreateElement=createElement,attributesObserver=MutationObserver&&{attributes:!0,characterData:!0,attributeOldValue:!0},DOMAttrModified=MutationObserver||function(e){doesNotSupportDOMAttrModified=!1,documentElement.removeEventListener(DOM_ATTR_MODIFIED,DOMAttrModified)},asapTimer=0,setListener=!1,doesNotSupportDOMAttrModified=!0,dropDomContentLoaded=!0,notFromInnerHTMLHelper=!0;if(REGISTER_ELEMENT in document||(sPO||hasProto?(patchIfNotAlready=function(node,proto){iPO.call(proto,node)||setupNode(node,proto)},patch=setupNode):(patchIfNotAlready=function(node,proto){node[EXPANDO_UID]||(node[EXPANDO_UID]=Object(!0),setupNode(node,proto))},patch=patchIfNotAlready),IE8?(doesNotSupportDOMAttrModified=!1,function(){var descriptor=gOPD(HTMLElementPrototype,ADD_EVENT_LISTENER),addEventListener=descriptor.value,patchedRemoveAttribute=function(name){var e=new CustomEvent(DOM_ATTR_MODIFIED,{bubbles:!0});e.attrName=name,e.prevValue=getAttribute.call(this,name),e.newValue=null,e[REMOVAL]=e.attrChange=2,removeAttribute.call(this,name),dispatchEvent.call(this,e)},patchedSetAttribute=function(name,value){var had=hasAttribute.call(this,name),old=had&&getAttribute.call(this,name),e=new CustomEvent(DOM_ATTR_MODIFIED,{bubbles:!0});setAttribute.call(this,name,value),e.attrName=name,e.prevValue=had?old:null,e.newValue=value,had?e[MODIFICATION]=e.attrChange=1:e[ADDITION]=e.attrChange=0,dispatchEvent.call(this,e)},onPropertyChange=function(e){var event,node=e.currentTarget,superSecret=node[EXPANDO_UID],propertyName=e.propertyName;superSecret.hasOwnProperty(propertyName)&&(superSecret=superSecret[propertyName],event=new CustomEvent(DOM_ATTR_MODIFIED,{bubbles:!0}),event.attrName=superSecret.name,event.prevValue=superSecret.value||null,event.newValue=superSecret.value=node[propertyName]||null,null==event.prevValue?event[ADDITION]=event.attrChange=0:event[MODIFICATION]=event.attrChange=1,dispatchEvent.call(node,event))};descriptor.value=function(type,handler,capture){type===DOM_ATTR_MODIFIED&&this[ATTRIBUTE_CHANGED_CALLBACK]&&this.setAttribute!==patchedSetAttribute&&(this[EXPANDO_UID]={className:{name:"class",value:this.className}},this.setAttribute=patchedSetAttribute,this.removeAttribute=patchedRemoveAttribute,addEventListener.call(this,"propertychange",onPropertyChange)),addEventListener.call(this,type,handler,capture)},defineProperty(HTMLElementPrototype,ADD_EVENT_LISTENER,descriptor)}()):MutationObserver||(documentElement[ADD_EVENT_LISTENER](DOM_ATTR_MODIFIED,DOMAttrModified),documentElement.setAttribute(EXPANDO_UID,1),documentElement.removeAttribute(EXPANDO_UID),doesNotSupportDOMAttrModified&&(onSubtreeModified=function(e){var oldAttributes,newAttributes,key,node=this;if(node===e.target){oldAttributes=node[EXPANDO_UID],node[EXPANDO_UID]=newAttributes=getAttributesMirror(node);for(key in newAttributes){if(!(key in oldAttributes))return callDOMAttrModified(0,node,key,oldAttributes[key],newAttributes[key],ADDITION);if(newAttributes[key]!==oldAttributes[key])return callDOMAttrModified(1,node,key,oldAttributes[key],newAttributes[key],MODIFICATION)}for(key in oldAttributes)if(!(key in newAttributes))return callDOMAttrModified(2,node,key,oldAttributes[key],newAttributes[key],REMOVAL)}},callDOMAttrModified=function(attrChange,currentTarget,attrName,prevValue,newValue,action){var e={attrChange:attrChange,currentTarget:currentTarget,attrName:attrName,prevValue:prevValue,newValue:newValue};e[action]=attrChange,onDOMAttrModified(e)},getAttributesMirror=function(node){for(var attr,name,result={},attributes=node.attributes,i=0,length=attributes.length;i<length;i++)attr=attributes[i],name=attr.name,"setAttribute"!==name&&(result[name]=attr.value);return result})),document[REGISTER_ELEMENT]=function(type,options){if(upperType=type.toUpperCase(),setListener||(setListener=!0,MutationObserver?(observer=function(attached,detached){function checkEmAll(list,callback){for(var i=0,length=list.length;i<length;callback(list[i++]));}return new MutationObserver(function(records){for(var current,node,newValue,i=0,length=records.length;i<length;i++)current=records[i],"childList"===current.type?(checkEmAll(current.addedNodes,attached),checkEmAll(current.removedNodes,detached)):(node=current.target,notFromInnerHTMLHelper&&node[ATTRIBUTE_CHANGED_CALLBACK]&&"style"!==current.attributeName&&(newValue=getAttribute.call(node,current.attributeName),newValue!==current.oldValue&&node[ATTRIBUTE_CHANGED_CALLBACK](current.attributeName,current.oldValue,newValue)))})}(executeAction(ATTACHED),executeAction(DETACHED)),observe=function(node){return observer.observe(node,{childList:!0,subtree:!0}),node},observe(document),attachShadow&&(HTMLElementPrototype.attachShadow=function(){return observe(attachShadow.apply(this,arguments))})):(asapQueue=[],document[ADD_EVENT_LISTENER]("DOMNodeInserted",onDOMNode(ATTACHED)),document[ADD_EVENT_LISTENER]("DOMNodeRemoved",onDOMNode(DETACHED))),document[ADD_EVENT_LISTENER](DOM_CONTENT_LOADED,onReadyStateChange),document[ADD_EVENT_LISTENER]("readystatechange",onReadyStateChange),HTMLElementPrototype.cloneNode=function(deep){var node=cloneNode.call(this,!!deep),i=getTypeIndex(node);return-1<i&&patch(node,protos[i]),deep&&loopAndSetup(node.querySelectorAll(query)),node}),-2<indexOf.call(types,PREFIX_IS+upperType)+indexOf.call(types,PREFIX_TAG+upperType)&&throwTypeError(type),!validName.test(upperType)||-1<indexOf.call(invalidNames,upperType))throw new Error("The type "+type+" is invalid");var upperType,i,constructor=function(){return extending?document.createElement(nodeName,upperType):document.createElement(nodeName)},opt=options||OP,extending=hOP.call(opt,EXTENDS),nodeName=extending?options[EXTENDS].toUpperCase():upperType;return extending&&-1<indexOf.call(types,PREFIX_TAG+nodeName)&&throwTypeError(nodeName),i=types.push((extending?PREFIX_IS:PREFIX_TAG)+upperType)-1,query=query.concat(query.length?",":"",extending?nodeName+'[is="'+type.toLowerCase()+'"]':nodeName),constructor.prototype=protos[i]=hOP.call(opt,"prototype")?opt.prototype:create(HTMLElementPrototype),loopAndVerify(document.querySelectorAll(query),ATTACHED),constructor},document.createElement=patchedCreateElement=function(localName,typeExtension){var is=getIs(typeExtension),node=is?createElement.call(document,localName,secondArgument(is)):createElement.call(document,localName),name=""+localName,i=indexOf.call(types,(is?PREFIX_IS:PREFIX_TAG)+(is||name).toUpperCase()),setup=-1<i;return is&&(node.setAttribute("is",is=is.toLowerCase()),setup&&(setup=isInQSA(name.toUpperCase(),is))),notFromInnerHTMLHelper=!document.createElement.innerHTMLHelper,setup&&patch(node,protos[i]),node}),CustomElementRegistry.prototype={constructor:CustomElementRegistry,define:usableCustomElements?function(name,Class,options){if(options)CERDefine(name,Class,options);else{var NAME=name.toUpperCase();constructors[NAME]={constructor:Class,create:[NAME]},nodeNames.set(Class,NAME),customElements.define(name,Class)}}:CERDefine,get:usableCustomElements?function(name){return customElements.get(name)||get(name)}:get,whenDefined:usableCustomElements?function(name){return Promise.race([customElements.whenDefined(name),whenDefined(name)])}:whenDefined},customElements)try{!function(DRE,options,name){if(options[EXTENDS]="a",DRE.prototype=create(HTMLAnchorElement.prototype),DRE.prototype.constructor=DRE,window.customElements.define(name,DRE,options),getAttribute.call(document.createElement("a",{is:name}),"is")!==name||usableCustomElements&&getAttribute.call(new DRE,"is")!==name)throw options}(function DRE(){return Reflect.construct(HTMLAnchorElement,[],DRE)},{},"document-register-element-a")}catch(o_O){polyfillV1()}else polyfillV1();try{createElement.call(document,"a","a")}catch(FireFox){secondArgument=function(is){return{is:is}}}}(window),function(){"use strict";function FastClick(layer,options){function bind(method,context){return function(){return method.apply(context,arguments)}}var oldOnClick;if(options=options||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=options.touchBoundary||10,this.layer=layer,this.tapDelay=options.tapDelay||200,this.tapTimeout=options.tapTimeout||700,!FastClick.notNeeded(layer)){for(var methods=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],context=this,i=0,l=methods.length;i<l;i++)context[methods[i]]=bind(context[methods[i]],context);deviceIsAndroid&&(layer.addEventListener("mouseover",this.onMouse,!0),layer.addEventListener("mousedown",this.onMouse,!0),layer.addEventListener("mouseup",this.onMouse,!0)),layer.addEventListener("click",this.onClick,!0),layer.addEventListener("touchstart",this.onTouchStart,!1),layer.addEventListener("touchmove",this.onTouchMove,!1),layer.addEventListener("touchend",this.onTouchEnd,!1),layer.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;"click"===type?rmv.call(layer,type,callback.hijacked||callback,capture):rmv.call(layer,type,callback,capture)},layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;"click"===type?adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){event.propagationStopped||callback(event)}),capture):adv.call(layer,type,callback,capture)}),"function"==typeof layer.onclick&&(oldOnClick=layer.onclick,layer.addEventListener("click",function(event){oldOnClick(event)},!1),layer.onclick=null)}}var deviceIsWindowsPhone=navigator.userAgent.indexOf("Windows Phone")>=0,deviceIsAndroid=navigator.userAgent.indexOf("Android")>0&&!deviceIsWindowsPhone,deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent)&&!deviceIsWindowsPhone,deviceIsIOS4=deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),deviceIsIOSWithBadTarget=deviceIsIOS&&/OS [6-7]_\d/.test(navigator.userAgent),deviceIsBlackBerry10=navigator.userAgent.indexOf("BB10")>0;FastClick.prototype.needsClick=function(target){switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled)return!0;break;case"input":if(deviceIsIOS&&"file"===target.type||target.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(target.className)},FastClick.prototype.needsFocus=function(target){switch(target.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!deviceIsAndroid;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}},FastClick.prototype.sendClick=function(targetElement,event){var clickEvent,touch;document.activeElement&&document.activeElement!==targetElement&&document.activeElement.blur(),touch=event.changedTouches[0],clickEvent=document.createEvent("MouseEvents"),clickEvent.initMouseEvent(this.determineEventType(targetElement),!0,!0,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,!1,!1,!1,!1,0,null),clickEvent.forwardedTouchEvent=!0,targetElement.dispatchEvent(clickEvent)},FastClick.prototype.determineEventType=function(targetElement){return deviceIsAndroid&&"select"===targetElement.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(targetElement){var length;deviceIsIOS&&targetElement.setSelectionRange&&0!==targetElement.type.indexOf("date")&&"time"!==targetElement.type&&"month"!==targetElement.type?(length=targetElement.value.length,targetElement.setSelectionRange(length,length)):targetElement.focus()},FastClick.prototype.updateScrollParent=function(targetElement){var scrollParent,parentElement;if(scrollParent=targetElement.fastClickScrollParent,!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement,targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}scrollParent&&(scrollParent.fastClickLastScrollTop=scrollParent.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){return eventTarget.nodeType===Node.TEXT_NODE?eventTarget.parentNode:eventTarget},FastClick.prototype.onTouchStart=function(event){var targetElement,touch,selection;if(event.targetTouches.length>1)return!0;if(targetElement=this.getTargetElementFromEventTarget(event.target),touch=event.targetTouches[0],targetElement.isContentEditable)return!0;if(deviceIsIOS){if(selection=window.getSelection(),selection.rangeCount&&!selection.isCollapsed)return!0;if(!deviceIsIOS4){if(touch.identifier&&touch.identifier===this.lastTouchIdentifier)return event.preventDefault(),!1;this.lastTouchIdentifier=touch.identifier,this.updateScrollParent(targetElement)}}return this.trackingClick=!0,this.trackingClickStart=event.timeStamp,this.targetElement=targetElement,this.touchStartX=touch.pageX,this.touchStartY=touch.pageY,event.timeStamp-this.lastClickTime<this.tapDelay&&event.timeStamp-this.lastClickTime>-1&&event.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(event){var touch=event.changedTouches[0],boundary=this.touchBoundary;return Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary},FastClick.prototype.onTouchMove=function(event){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(event.target)||this.touchHasMoved(event))&&(this.trackingClick=!1,this.targetElement=null),!0)},FastClick.prototype.findControl=function(labelElement){return void 0!==labelElement.control?labelElement.control:labelElement.htmlFor?document.getElementById(labelElement.htmlFor):labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(event){var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(!this.trackingClick)return!0;if(event.timeStamp-this.lastClickTime<this.tapDelay&&event.timeStamp-this.lastClickTime>-1)return this.cancelNextClick=!0,!0;if(event.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=event.timeStamp,trackingClickStart=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,deviceIsIOSWithBadTarget&&(touch=event.changedTouches[0],targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement,targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent),targetTagName=targetElement.tagName.toLowerCase(),"label"===targetTagName){if(forElement=this.findControl(targetElement)){if(this.focus(targetElement),deviceIsAndroid)return!1;targetElement=forElement}}else if(this.needsFocus(targetElement))return event.timeStamp-trackingClickStart>100||deviceIsIOS&&window.top!==window&&"input"===targetTagName?(this.targetElement=null,!1):(this.focus(targetElement),this.sendClick(targetElement,event),deviceIsIOS&&"select"===targetTagName||(this.targetElement=null,event.preventDefault()),!1);return!(!deviceIsIOS||deviceIsIOS4||(scrollParent=targetElement.fastClickScrollParent,!scrollParent||scrollParent.fastClickLastScrollTop===scrollParent.scrollTop))||(this.needsClick(targetElement)||(event.preventDefault(),this.sendClick(targetElement,event)),!1)},FastClick.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(event){return!this.targetElement||(!!event.forwardedTouchEvent||(!event.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(event.stopImmediatePropagation?event.stopImmediatePropagation():event.propagationStopped=!0,event.stopPropagation(),event.preventDefault(),!1))))},FastClick.prototype.onClick=function(event){var permitted;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===event.target.type&&0===event.detail||(permitted=this.onMouse(event),permitted||(this.targetElement=null),permitted)},FastClick.prototype.destroy=function(){var layer=this.layer;deviceIsAndroid&&(layer.removeEventListener("mouseover",this.onMouse,!0),layer.removeEventListener("mousedown",this.onMouse,!0),layer.removeEventListener("mouseup",this.onMouse,!0)),layer.removeEventListener("click",this.onClick,!0),layer.removeEventListener("touchstart",this.onTouchStart,!1),layer.removeEventListener("touchmove",this.onTouchMove,!1),layer.removeEventListener("touchend",this.onTouchEnd,!1),layer.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(layer){var metaViewport,chromeVersion,blackberryVersion,firefoxVersion;if("undefined"==typeof window.ontouchstart)return!0;if(chromeVersion=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!deviceIsAndroid)return!0;if(metaViewport=document.querySelector("meta[name=viewport]")){if(metaViewport.content.indexOf("user-scalable=no")!==-1)return!0;if(chromeVersion>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(deviceIsBlackBerry10&&(blackberryVersion=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),blackberryVersion[1]>=10&&blackberryVersion[2]>=3&&(metaViewport=document.querySelector("meta[name=viewport]")))){if(metaViewport.content.indexOf("user-scalable=no")!==-1)return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===layer.style.msTouchAction||"manipulation"===layer.style.touchAction||(firefoxVersion=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],!!(firefoxVersion>=27&&(metaViewport=document.querySelector("meta[name=viewport]"),metaViewport&&(metaViewport.content.indexOf("user-scalable=no")!==-1||document.documentElement.scrollWidth<=window.outerWidth)))||("none"===layer.style.touchAction||"manipulation"===layer.style.touchAction))},FastClick.attach=function(layer,options){return new FastClick(layer,options)},window.FastClick=FastClick}();var innerHTML=function(document){var initialize,registered,EXTENDS="extends",register=document.registerElement,div=document.createElement("div"),dre="document-register-element",innerHTML=register.innerHTML;if(innerHTML)return innerHTML;try{if(register.call(document,dre,{prototype:Object.create(HTMLElement.prototype,{createdCallback:{value:Object}})}),div.innerHTML="<"+dre+"></"+dre+">","createdCallback"in div.querySelector(dre))return register.innerHTML=function(el,html){return el.innerHTML=html,el}}catch(meh){}return registered=[],initialize=function(el){if(!("createdCallback"in el||"attachedCallback"in el||"detachedCallback"in el||"attributeChangedCallback"in el)){document.createElement.innerHTMLHelper=!0;for(var attr,fc,parentNode=el.parentNode,type=el.getAttribute("is"),name=el.nodeName,node=document.createElement.apply(document,type?[name,type]:[name]),attributes=el.attributes,i=0,length=attributes.length;i<length;i++)attr=attributes[i],node.setAttribute(attr.name,attr.value);for(node.createdCallback&&(node.created=!0,node.createdCallback(),node.created=!1);fc=el.firstChild;)node.appendChild(fc);document.createElement.innerHTMLHelper=!1,parentNode&&parentNode.replaceChild(node,el)}},(document.registerElement=function(type,options){var name=(options[EXTENDS]?options[EXTENDS]+'[is="'+type+'"]':type).toLowerCase();return registered.indexOf(name)<0&&registered.push(name),register.apply(document,arguments)}).innerHTML=function(el,html){el.innerHTML=html;for(var nodes=el.querySelectorAll(registered.join(",")),i=nodes.length;i--;initialize(nodes[i]));return el}}(document),MicroEvent=function(){};MicroEvent.prototype={on:function(event,fct){this._events=this._events||{},this._events[event]=this._events[event]||[],this._events[event].push(fct)},once:function(event,fct){var self=this,wrapper=function(){return self.off(event,wrapper),fct.apply(null,arguments)};this.on(event,wrapper)},off:function(event,fct){this._events=this._events||{},event in this._events!=!1&&(this._events[event]=this._events[event].filter(function(_fct){return!!fct&&fct!==_fct}))},emit:function(event){if(this._events=this._events||{},event in this._events!=!1)for(var i=0;i<this._events[event].length;i++)this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}},MicroEvent.mixin=function(destObject){for(var props=["on","once","off","emit"],i=0;i<props.length;i++)"function"==typeof destObject?destObject.prototype[props[i]]=MicroEvent.prototype[props[i]]:destObject[props[i]]=MicroEvent.prototype[props[i]]},"undefined"!=typeof module&&"exports"in module&&(module.exports=MicroEvent),window.MicroEvent=MicroEvent,function(root){function noop(){}function bind(fn,thisArg){return function(){fn.apply(thisArg,arguments)}}function Promise(fn){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof fn)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(fn,this)}function handle(self,deferred){for(;3===self._state;)self=self._value;return 0===self._state?void self._deferreds.push(deferred):(self._handled=!0,void Promise._immediateFn(function(){var cb=1===self._state?deferred.onFulfilled:deferred.onRejected;if(null===cb)return void(1===self._state?resolve:reject)(deferred.promise,self._value);var ret;try{ret=cb(self._value)}catch(e){return void reject(deferred.promise,e)}resolve(deferred.promise,ret)}))}function resolve(self,newValue){try{if(newValue===self)throw new TypeError("A promise cannot be resolved with itself.");if(newValue&&("object"==typeof newValue||"function"==typeof newValue)){var then=newValue.then;if(newValue instanceof Promise)return self._state=3,self._value=newValue,void finale(self);if("function"==typeof then)return void doResolve(bind(then,newValue),self)}self._state=1,self._value=newValue,finale(self)}catch(e){reject(self,e)}}function reject(self,newValue){self._state=2,self._value=newValue,finale(self)}function finale(self){2===self._state&&0===self._deferreds.length&&Promise._immediateFn(function(){self._handled||Promise._unhandledRejectionFn(self._value)});for(var i=0,len=self._deferreds.length;i<len;i++)handle(self,self._deferreds[i]);self._deferreds=null}function Handler(onFulfilled,onRejected,promise){this.onFulfilled="function"==typeof onFulfilled?onFulfilled:null,this.onRejected="function"==typeof onRejected?onRejected:null,this.promise=promise}function doResolve(fn,self){var done=!1;try{fn(function(value){done||(done=!0,resolve(self,value))},function(reason){done||(done=!0,reject(self,reason))})}catch(ex){if(done)return;done=!0,reject(self,ex)}}var setTimeoutFunc=setTimeout;Promise.prototype["catch"]=function(onRejected){return this.then(null,onRejected)},Promise.prototype.then=function(onFulfilled,onRejected){var prom=new this.constructor(noop);return handle(this,new Handler(onFulfilled,onRejected,prom)),prom},Promise.all=function(arr){var args=Array.prototype.slice.call(arr);return new Promise(function(resolve,reject){function res(i,val){try{if(val&&("object"==typeof val||"function"==typeof val)){var then=val.then;if("function"==typeof then)return void then.call(val,function(val){res(i,val)},reject)}args[i]=val,0===--remaining&&resolve(args)}catch(ex){reject(ex)}}if(0===args.length)return resolve([]);for(var remaining=args.length,i=0;i<args.length;i++)res(i,args[i])})},Promise.resolve=function(value){return value&&"object"==typeof value&&value.constructor===Promise?value:new Promise(function(resolve){resolve(value)})},Promise.reject=function(value){return new Promise(function(resolve,reject){reject(value)})},Promise.race=function(values){return new Promise(function(resolve,reject){for(var i=0,len=values.length;i<len;i++)values[i].then(resolve,reject)})},Promise._immediateFn="function"==typeof setImmediate&&function(fn){setImmediate(fn)}||function(fn){setTimeoutFunc(fn,0)},Promise._unhandledRejectionFn=function(err){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",err)},Promise._setImmediateFn=function(fn){Promise._immediateFn=fn},Promise._setUnhandledRejectionFn=function(fn){Promise._unhandledRejectionFn=fn},window.Promise||(window.Promise=Promise)}(this),function(global,undefined){"use strict";function addFromSetImmediateArguments(args){return tasksByHandle[nextHandle]=partiallyApplied.apply(undefined,args),nextHandle++}function partiallyApplied(handler){var args=[].slice.call(arguments,1);return function(){"function"==typeof handler?handler.apply(undefined,args):new Function(""+handler)()}}function runIfPresent(handle){if(currentlyRunningATask)setTimeout(partiallyApplied(runIfPresent,handle),0);else{var task=tasksByHandle[handle];if(task){currentlyRunningATask=!0;try{task()}finally{clearImmediate(handle),currentlyRunningATask=!1}}}}function clearImmediate(handle){delete tasksByHandle[handle]}function installNextTickImplementation(){setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return process.nextTick(partiallyApplied(runIfPresent,handle)),handle}}function canUsePostMessage(){if(global.postMessage&&!global.importScripts){var postMessageIsAsynchronous=!0,oldOnMessage=global.onmessage;return global.onmessage=function(){postMessageIsAsynchronous=!1},global.postMessage("","*"),global.onmessage=oldOnMessage,postMessageIsAsynchronous}}function installPostMessageImplementation(){var messagePrefix="setImmediate$"+Math.random()+"$",onGlobalMessage=function(event){event.source===global&&"string"==typeof event.data&&0===event.data.indexOf(messagePrefix)&&runIfPresent(+event.data.slice(messagePrefix.length))};global.addEventListener?global.addEventListener("message",onGlobalMessage,!1):global.attachEvent("onmessage",onGlobalMessage),setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return global.postMessage(messagePrefix+handle,"*"),handle}}function installMessageChannelImplementation(){var channel=new MessageChannel;channel.port1.onmessage=function(event){var handle=event.data;runIfPresent(handle)},setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return channel.port2.postMessage(handle),handle}}function installReadyStateChangeImplementation(){var html=doc.documentElement;setImmediate=function(){var handle=addFromSetImmediateArguments(arguments),script=doc.createElement("script");return script.onreadystatechange=function(){runIfPresent(handle),script.onreadystatechange=null,html.removeChild(script),script=null},html.appendChild(script),handle}}function installSetTimeoutImplementation(){setImmediate=function(){var handle=addFromSetImmediateArguments(arguments);return setTimeout(partiallyApplied(runIfPresent,handle),0),handle}}if(!global.setImmediate){var setImmediate,nextHandle=1,tasksByHandle={},currentlyRunningATask=!1,doc=global.document,attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);attachTo=attachTo&&attachTo.setTimeout?attachTo:global,"[object process]"==={}.toString.call(global.process)?installNextTickImplementation():canUsePostMessage()?installPostMessageImplementation():global.MessageChannel?installMessageChannelImplementation():doc&&"onreadystatechange"in doc.createElement("script")?installReadyStateChangeImplementation():installSetTimeoutImplementation(),attachTo.setImmediate=setImmediate,attachTo.clearImmediate=clearImmediate}}(function(){return this}()),function(){function Viewport(){return this.PRE_IOS7_VIEWPORT="initial-scale=1, maximum-scale=1, user-scalable=no",this.IOS7_VIEWPORT="initial-scale=1, maximum-scale=1, user-scalable=no",this.DEFAULT_VIEWPORT="initial-scale=1, maximum-scale=1, user-scalable=no",this.ensureViewportElement(),this.platform={},this.platform.name=this.getPlatformName(),this.platform.version=this.getPlatformVersion(),this}Viewport.prototype.ensureViewportElement=function(){this.viewportElement=document.querySelector("meta[name=viewport]"),this.viewportElement||(this.viewportElement=document.createElement("meta"),this.viewportElement.name="viewport",document.head.appendChild(this.viewportElement))},Viewport.prototype.setup=function(){function isWebView(){return!!(window.cordova||window.phonegap||window.PhoneGap)}this.viewportElement&&"true"!=this.viewportElement.getAttribute("data-no-adjust")&&(this.viewportElement.getAttribute("content")||("ios"==this.platform.name?this.platform.version>=7&&isWebView()?this.viewportElement.setAttribute("content",this.IOS7_VIEWPORT):this.viewportElement.setAttribute("content",this.PRE_IOS7_VIEWPORT):this.viewportElement.setAttribute("content",this.DEFAULT_VIEWPORT)))},Viewport.prototype.getPlatformName=function(){return navigator.userAgent.match(/Android/i)?"android":navigator.userAgent.match(/iPhone|iPad|iPod/i)?"ios":void 0},Viewport.prototype.getPlatformVersion=function(){var start=window.navigator.userAgent.indexOf("OS ");return window.Number(window.navigator.userAgent.substr(start+3,3).replace("_","."))},window.Viewport=Viewport}(),function(){function getAttributes(element){return Node_get_attributes.call(element)}function setAttribute(element,attribute,value){try{Element_setAttribute.call(element,attribute,value)}catch(e){}}function removeAttribute(element,attribute){Element_removeAttribute.call(element,attribute)}function childNodes(element){return Node_get_childNodes.call(element)}function empty(element){for(;element.childNodes.length;)element.removeChild(element.lastChild)}function insertAdjacentHTML(element,position,html){HTMLElement_insertAdjacentHTMLPropertyDescriptor.value.call(element,position,html)}function inUnsafeMode(){var isUnsafe=!0;try{detectionDiv.innerHTML="<test/>";
4}catch(ex){isUnsafe=!1}return isUnsafe}function cleanse(html,targetElement){function cleanseAttributes(element){var attributes=getAttributes(element);if(attributes&&attributes.length){for(var events,i=0,len=attributes.length;i<len;i++){var attribute=attributes[i],name=attribute.name;"o"!==name[0]&&"O"!==name[0]||"n"!==name[1]&&"N"!==name[1]||(events=events||[],events.push({name:attribute.name,value:attribute.value}))}if(events)for(var i=0,len=events.length;i<len;i++){var attribute=events[i];removeAttribute(element,attribute.name),setAttribute(element,"x-"+attribute.name,attribute.value)}}for(var children=childNodes(element),i=0,len=children.length;i<len;i++)cleanseAttributes(children[i])}var cleaner=document.implementation.createHTMLDocument("cleaner");empty(cleaner.documentElement),MSApp.execUnsafeLocalFunction(function(){insertAdjacentHTML(cleaner.documentElement,"afterbegin",html)});var scripts=cleaner.documentElement.querySelectorAll("script");Array.prototype.forEach.call(scripts,function(script){switch(script.type.toLowerCase()){case"":script.type="text/inert";break;case"text/javascript":case"text/ecmascript":case"text/x-javascript":case"text/jscript":case"text/livescript":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":script.type="text/inert-"+script.type.slice("text/".length);break;case"application/javascript":case"application/ecmascript":case"application/x-javascript":script.type="application/inert-"+script.type.slice("application/".length)}}),cleanseAttributes(cleaner.documentElement);var cleanedNodes=[];return"HTML"===targetElement.tagName?cleanedNodes=Array.prototype.slice.call(document.adoptNode(cleaner.documentElement).childNodes):(cleaner.head&&(cleanedNodes=cleanedNodes.concat(Array.prototype.slice.call(document.adoptNode(cleaner.head).childNodes))),cleaner.body&&(cleanedNodes=cleanedNodes.concat(Array.prototype.slice.call(document.adoptNode(cleaner.body).childNodes)))),cleanedNodes}function cleansePropertySetter(property,setter){var propertyDescriptor=Object.getOwnPropertyDescriptor(HTMLElement.prototype,property),originalSetter=propertyDescriptor.set;Object.defineProperty(HTMLElement.prototype,property,{get:propertyDescriptor.get,set:function(value){if(window.WinJS&&window.WinJS._execUnsafe&&inUnsafeMode())originalSetter.call(this,value);else{var that=this,nodes=cleanse(value,that);MSApp.execUnsafeLocalFunction(function(){setter(propertyDescriptor,that,nodes)})}},enumerable:propertyDescriptor.enumerable,configurable:propertyDescriptor.configurable})}if(window.MSApp&&MSApp.execUnsafeLocalFunction){var Element_setAttribute=Object.getOwnPropertyDescriptor(Element.prototype,"setAttribute").value,Element_removeAttribute=Object.getOwnPropertyDescriptor(Element.prototype,"removeAttribute").value,HTMLElement_insertAdjacentHTMLPropertyDescriptor=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"insertAdjacentHTML"),Node_get_attributes=Object.getOwnPropertyDescriptor(Node.prototype,"attributes").get,Node_get_childNodes=Object.getOwnPropertyDescriptor(Node.prototype,"childNodes").get,detectionDiv=document.createElement("div");cleansePropertySetter("innerHTML",function(propertyDescriptor,target,elements){empty(target);for(var i=0,len=elements.length;i<len;i++)target.appendChild(elements[i])}),cleansePropertySetter("outerHTML",function(propertyDescriptor,target,elements){for(var i=0,len=elements.length;i<len;i++)target.insertAdjacentElement("afterend",elements[i]);target.parentNode.removeChild(target)})}}(),function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.ons=factory()}(this,function(){"use strict";function setup(){GestureDetector.READY||(Event$1.determineEventTypes(),Utils.each(GestureDetector.gestures,function(gesture){Detection.register(gesture)}),Event$1.onTouch(GestureDetector.DOCUMENT,EVENT_MOVE,Detection.detect),Event$1.onTouch(GestureDetector.DOCUMENT,EVENT_END,Detection.detect),GestureDetector.READY=!0)}function isContentReady(element){return element.childNodes.length>0&&setContentReady(element),readyMap.has(element)}function setContentReady(element){readyMap.set(element,!0)}function addCallback(element,fn){queueMap.has(element)||queueMap.set(element,[]),queueMap.get(element).push(fn)}function consumeQueue(element){var callbacks=queueMap.get(element,[])||[];queueMap["delete"](element),callbacks.forEach(function(callback){return callback()})}function contentReady(element){var fn=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(addCallback(element,fn),isContentReady(element))return void consumeQueue(element);var observer=new MutationObserver(function(changes){setContentReady(element),consumeQueue(element)});observer.observe(element,{childList:!0,characterData:!0}),setImmediate(function(){setContentReady(element),consumeQueue(element)})}function loadPage$1(_ref,done){var page=_ref.page,parent=_ref.parent,replace=(_ref.params,_ref.replace);internal$1.getPageHTMLAsync(page).then(function(html){replace&&(util.propagateAction(parent,"_destroy"),parent.innerHTML="");var element=util.createElement(html.trim());parent.appendChild(element),done({element:element,unload:function(){return element.remove()}})})}function waitDeviceReady(){var unlockDeviceReady=ons$1._readyLock.lock();window.addEventListener("DOMContentLoaded",function(){ons$1.isWebView()?window.document.addEventListener("deviceready",unlockDeviceReady,!1):unlockDeviceReady()},!1)}function getElementClass(){if("function"!=typeof HTMLElement){var _BaseElement=function(){};return _BaseElement.prototype=document.createElement("div"),_BaseElement}return HTMLElement}var unwrap=function(string){return string.slice(1,-1)},isObjectString=function(string){return string.startsWith("{")&&string.endsWith("}")},isArrayString=function(string){return string.startsWith("[")&&string.endsWith("]")},isQuotedString=function(string){return string.startsWith("'")&&string.endsWith("'")||string.startsWith('"')&&string.endsWith('"')},error$1=function(token,string,originalString){throw new Error("Unexpected token '"+token+"' at position "+(originalString.length-string.length-1)+" in string: '"+originalString+"'")},processToken=function(token,string,originalString){return"true"===token||"false"===token?"true"===token:isQuotedString(token)?unwrap(token):isNaN(token)?isObjectString(token)?parseObject(unwrap(token)):isArrayString(token)?parseArray(unwrap(token)):void error$1(token,string,originalString):+token},nextToken=function(string){string=string.trimLeft();var limit=string.length;if(":"===string[0]||","===string[0])limit=1;else if("{"===string[0]||"["===string[0]){for(var c=string.charCodeAt(0),nestedObject=1,i=1;i<string.length;i++)if(string.charCodeAt(i)===c)nestedObject++;else if(string.charCodeAt(i)===c+2&&(nestedObject--,0===nestedObject)){limit=i+1;break}}else if("'"===string[0]||'"'===string[0]){for(var _i=1;_i<string.length;_i++)if(string[_i]===string[0]){limit=_i+1;break}}else for(var _i2=1;_i2<string.length;_i2++)if([" ",",",":"].indexOf(string[_i2])!==-1){limit=_i2;break}return string.slice(0,limit)},parseObject=function(string){var isValidKey=function(key){return/^[A-Z_\$][A-Z0-9_\$]*$/i.test(key)};string=string.trim();for(var originalString=string,object={},readingKey=!0,key=void 0,previousToken=void 0,token=void 0;string.length>0;)if(previousToken=token,token=nextToken(string),string=string.slice(token.length,string.length).trimLeft(),":"===token&&(!readingKey||!previousToken||","===previousToken)||","===token&&readingKey||":"!==token&&","!==token&&previousToken&&","!==previousToken&&":"!==previousToken)error$1(token,string,originalString);else if(":"===token&&readingKey&&previousToken){if(!isValidKey(previousToken))throw new Error("Invalid key token '"+previousToken+"' at position 0 in string: '"+originalString+"'");key=previousToken,readingKey=!1}else","===token&&!readingKey&&previousToken&&(object[key]=processToken(previousToken,string,originalString),readingKey=!0);return token&&(object[key]=processToken(token,string,originalString)),object},parseArray=function(string){string=string.trim();for(var originalString=string,array=[],previousToken=void 0,token=void 0;string.length>0;)previousToken=token,token=nextToken(string),string=string.slice(token.length,string.length).trimLeft(),","!==token||previousToken&&","!==previousToken?","===token&&array.push(processToken(previousToken,string,originalString)):error$1(token,string,originalString);return token&&(","!==token?array.push(processToken(token,string,originalString)):error$1(token,string,originalString)),array},parse=function(string){if(string=string.trim(),isObjectString(string))return parseObject(unwrap(string));if(isArrayString(string))return parseArray(unwrap(string));throw new Error("Provided string must be object or array like: "+string)},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},classCallCheck=(function(){function AwaitValue(value){this.value=value}function AsyncGenerator(gen){function send(key,arg){return new Promise(function(resolve,reject){var request={key:key,arg:arg,resolve:resolve,reject:reject,next:null};back?back=back.next=request:(front=back=request,resume(key,arg))})}function resume(key,arg){try{var result=gen[key](arg),value=result.value;value instanceof AwaitValue?Promise.resolve(value.value).then(function(arg){resume("next",arg)},function(arg){resume("throw",arg)}):settle(result.done?"return":"normal",result.value)}catch(err){settle("throw",err)}}function settle(type,value){switch(type){case"return":front.resolve({value:value,done:!0});break;case"throw":front.reject(value);break;default:front.resolve({value:value,done:!1})}front=front.next,front?resume(front.key,front.arg):back=null}var front,back;this._invoke=send,"function"!=typeof gen["return"]&&(this["return"]=void 0)}return"function"==typeof Symbol&&Symbol.asyncIterator&&(AsyncGenerator.prototype[Symbol.asyncIterator]=function(){return this}),AsyncGenerator.prototype.next=function(arg){return this._invoke("next",arg)},AsyncGenerator.prototype["throw"]=function(arg){return this._invoke("throw",arg)},AsyncGenerator.prototype["return"]=function(arg){return this._invoke("return",arg)},{wrap:function(fn){return function(){return new AsyncGenerator(fn.apply(this,arguments))}},await:function(value){return new AwaitValue(value)}}}(),function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}),createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}(),_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},inherits=function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass)},possibleConstructorReturn=function(self,call){if(!self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeof call&&"function"!=typeof call?self:call},util={};util.prepareQuery=function(query){return query instanceof Function?query:function(element){return util.match(element,query)}},util.match=function(element,query){return"."===query[0]?element.classList.contains(query.slice(1)):element.nodeName.toLowerCase()===query},util.findChild=function(element,query){for(var match=util.prepareQuery(query),i=0;i<element.children.length;i++){var node=element.children[i];if(match(node))return node}return null},util.findParent=function(element,query){for(var match=util.prepareQuery(query),parent=element.parentNode;;){if(!parent||parent===document)return null;if(match(parent))return parent;parent=parent.parentNode}},util.isAttached=function(element){for(;document.documentElement!==element;){if(!element)return!1;element=element.parentNode}return!0},util.hasAnyComponentAsParent=function(element){for(;element&&document.documentElement!==element;)if(element=element.parentNode,element&&element.nodeName.toLowerCase().match(/(ons-navigator|ons-tabbar|ons-sliding-menu|ons-split-view)/))return!0;return!1},util.propagateAction=function(element,action){for(var i=0;i<element.childNodes.length;i++){var child=element.childNodes[i];child[action]instanceof Function?child[action]():util.propagateAction(child,action)}},util.create=function(){var selector=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",style=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},classList=selector.split("."),element=document.createElement(classList.shift()||"div");return classList.length&&(element.className=classList.join(" ")),util.extend(element.style,style),element},util.createElement=function(html){var wrapper=document.createElement("div");if(innerHTML(wrapper,html),wrapper.children.length>1)throw new Error('"html" must be one wrapper element.');return wrapper.children[0]},util.createFragment=function(html){var wrapper=document.createElement("div");innerHTML(wrapper,html);for(var fragment=document.createDocumentFragment();wrapper.firstChild;)fragment.appendChild(wrapper.firstChild);return fragment},util.extend=function(dst){for(var _len=arguments.length,args=Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];for(var i=0;i<args.length;i++)if(args[i])for(var keys=Object.keys(args[i]),j=0;j<keys.length;j++){var key=keys[j];dst[key]=args[i][key]}return dst},util.arrayFrom=function(arrayLike){return Array.prototype.slice.apply(arrayLike)},util.parseJSONObjectSafely=function(jsonString){var failSafe=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{var result=JSON.parse(""+jsonString);if("object"===("undefined"==typeof result?"undefined":_typeof(result))&&null!==result)return result}catch(e){return failSafe}return failSafe},util.findFromPath=function(path){path=path.split(".");for(var key,el=window;key=path.shift();)el=el[key];return el},util.triggerElementEvent=function(target,eventName){var detail=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},event=new CustomEvent(eventName,{bubbles:!0,cancelable:!0,detail:detail});return Object.keys(detail).forEach(function(key){event[key]=detail[key]}),target.dispatchEvent(event),event},util.hasModifier=function(target,modifierName){return!!target.hasAttribute("modifier")&&target.getAttribute("modifier").split(/\s+/).some(function(e){return e===modifierName})},util.addModifier=function(target,modifierName){if(util.hasModifier(target,modifierName))return!1;modifierName=modifierName.trim();var modifierAttribute=target.getAttribute("modifier")||"";return target.setAttribute("modifier",(modifierAttribute+" "+modifierName).trim()),!0},util.removeModifier=function(target,modifierName){if(!target.getAttribute("modifier"))return!1;var modifiers=target.getAttribute("modifier").split(/\s+/),newModifiers=modifiers.filter(function(item){return item&&item!==modifierName});return target.setAttribute("modifier",newModifiers.join(" ")),modifiers.length!==newModifiers.length},util.updateParentPosition=function(el){!el._parentUpdated&&el.parentElement&&("static"===window.getComputedStyle(el.parentElement).getPropertyValue("position")&&(el.parentElement.style.position="relative"),el._parentUpdated=!0)},util.toggleAttribute=function(element,name,enable){enable?element.setAttribute(name,""):element.removeAttribute(name)},util.bindListeners=function(element,listenerNames){listenerNames.forEach(function(name){var boundName=name.replace(/^_[a-z]/,"_bound"+name[1].toUpperCase());element[boundName]=element[boundName]||element[name].bind(element)})},util.each=function(obj,f){return Object.keys(obj).forEach(function(key){return f(key,obj[key])})},util.updateRipple=function(target){var rippleElement=util.findChild(target,"ons-ripple");target.hasAttribute("ripple")?rippleElement||target.insertBefore(document.createElement("ons-ripple"),target.firstChild):rippleElement&&rippleElement.remove()},util.animationOptionsParse=parse,util.isInteger=function(value){return"number"==typeof value&&isFinite(value)&&Math.floor(value)===value},util.defer=function(){var deferred={};return deferred.promise=new Promise(function(resolve,reject){deferred.resolve=resolve,deferred.reject=reject}),deferred};var Event$1,Utils,Detection,PointerEvent,GestureDetector=function GestureDetector(element,options){return new GestureDetector.Instance(element,options||{})};GestureDetector.defaults={behavior:{touchAction:"pan-y",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},GestureDetector.DOCUMENT=document,GestureDetector.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled,GestureDetector.HAS_TOUCHEVENTS="ontouchstart"in window,GestureDetector.IS_MOBILE=/mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent),GestureDetector.NO_MOUSEEVENTS=GestureDetector.HAS_TOUCHEVENTS&&GestureDetector.IS_MOBILE||GestureDetector.HAS_POINTEREVENTS,GestureDetector.CALCULATE_INTERVAL=25;var EVENT_TYPES={},DIRECTION_DOWN=GestureDetector.DIRECTION_DOWN="down",DIRECTION_LEFT=GestureDetector.DIRECTION_LEFT="left",DIRECTION_UP=GestureDetector.DIRECTION_UP="up",DIRECTION_RIGHT=GestureDetector.DIRECTION_RIGHT="right",POINTER_MOUSE=GestureDetector.POINTER_MOUSE="mouse",POINTER_TOUCH=GestureDetector.POINTER_TOUCH="touch",POINTER_PEN=GestureDetector.POINTER_PEN="pen",EVENT_START=GestureDetector.EVENT_START="start",EVENT_MOVE=GestureDetector.EVENT_MOVE="move",EVENT_END=GestureDetector.EVENT_END="end",EVENT_RELEASE=GestureDetector.EVENT_RELEASE="release",EVENT_TOUCH=GestureDetector.EVENT_TOUCH="touch";GestureDetector.READY=!1,GestureDetector.plugins=GestureDetector.plugins||{},GestureDetector.gestures=GestureDetector.gestures||{},Utils=GestureDetector.utils={extend:function(dest,src,merge){for(var key in src)!src.hasOwnProperty(key)||void 0!==dest[key]&&merge||(dest[key]=src[key]);return dest},on:function(element,type,handler){element.addEventListener(type,handler,!1)},off:function(element,type,handler){element.removeEventListener(type,handler,!1)},each:function(obj,iterator,context){var i,len;if("forEach"in obj)obj.forEach(iterator,context);else if(void 0!==obj.length){for(i=0,len=obj.length;i<len;i++)if(iterator.call(context,obj[i],i,obj)===!1)return}else for(i in obj)if(obj.hasOwnProperty(i)&&iterator.call(context,obj[i],i,obj)===!1)return},inStr:function(src,find){return src.indexOf(find)>-1},inArray:function(src,find){if(src.indexOf){var index=src.indexOf(find);return index!==-1&&index}for(var i=0,len=src.length;i<len;i++)if(src[i]===find)return i;return!1},toArray:function(obj){return Array.prototype.slice.call(obj,0)},hasParent:function(node,parent){for(;node;){if(node==parent)return!0;node=node.parentNode}return!1},getCenter:function(touches){var pageX=[],pageY=[],clientX=[],clientY=[],min=Math.min,max=Math.max;return 1===touches.length?{pageX:touches[0].pageX,pageY:touches[0].pageY,clientX:touches[0].clientX,clientY:touches[0].clientY}:(Utils.each(touches,function(touch){pageX.push(touch.pageX),pageY.push(touch.pageY),clientX.push(touch.clientX),clientY.push(touch.clientY)}),{pageX:(min.apply(Math,pageX)+max.apply(Math,pageX))/2,pageY:(min.apply(Math,pageY)+max.apply(Math,pageY))/2,clientX:(min.apply(Math,clientX)+max.apply(Math,clientX))/2,clientY:(min.apply(Math,clientY)+max.apply(Math,clientY))/2})},getVelocity:function(deltaTime,deltaX,deltaY){return{x:Math.abs(deltaX/deltaTime)||0,y:Math.abs(deltaY/deltaTime)||0}},getAngle:function(touch1,touch2){var x=touch2.clientX-touch1.clientX,y=touch2.clientY-touch1.clientY;return 180*Math.atan2(y,x)/Math.PI},getDirection:function(touch1,touch2){var x=Math.abs(touch1.clientX-touch2.clientX),y=Math.abs(touch1.clientY-touch2.clientY);return x>=y?touch1.clientX-touch2.clientX>0?DIRECTION_LEFT:DIRECTION_RIGHT:touch1.clientY-touch2.clientY>0?DIRECTION_UP:DIRECTION_DOWN},getDistance:function(touch1,touch2){var x=touch2.clientX-touch1.clientX,y=touch2.clientY-touch1.clientY;return Math.sqrt(x*x+y*y)},getScale:function(start,end){return start.length>=2&&end.length>=2?this.getDistance(end[0],end[1])/this.getDistance(start[0],start[1]):1},getRotation:function(start,end){return start.length>=2&&end.length>=2?this.getAngle(end[1],end[0])-this.getAngle(start[1],start[0]):0},isVertical:function(direction){return direction==DIRECTION_UP||direction==DIRECTION_DOWN},setPrefixedCss:function(element,prop,value,toggle){var prefixes=["","Webkit","Moz","O","ms"];prop=Utils.toCamelCase(prop);for(var i=0;i<prefixes.length;i++){var p=prop;if(prefixes[i]&&(p=prefixes[i]+p.slice(0,1).toUpperCase()+p.slice(1)),p in element.style){element.style[p]=(null===toggle||toggle)&&value||"";break}}},toggleBehavior:function(element,props,toggle){if(props&&element&&element.style){Utils.each(props,function(value,prop){Utils.setPrefixedCss(element,prop,value,toggle)});var falseFn=toggle&&function(){return!1};"none"==props.userSelect&&(element.onselectstart=falseFn),"none"==props.userDrag&&(element.ondragstart=falseFn)}},toCamelCase:function(str){return str.replace(/[_-]([a-z])/g,function(s){return s[1].toUpperCase()})}},Event$1=GestureDetector.event={preventMouseEvents:!1,started:!1,shouldDetect:!1,on:function(element,type,handler,hook){var types=type.split(" ");Utils.each(types,function(type){Utils.on(element,type,handler),hook&&hook(type)})},off:function(element,type,handler,hook){var types=type.split(" ");Utils.each(types,function(type){Utils.off(element,type,handler),hook&&hook(type)})},onTouch:function(element,eventType,handler){var self=this,onTouchHandler=function(ev){var triggerType,srcType=ev.type.toLowerCase(),isPointer=GestureDetector.HAS_POINTEREVENTS,isMouse=Utils.inStr(srcType,"mouse");isMouse&&self.preventMouseEvents||(isMouse&&eventType==EVENT_START&&0===ev.button?(self.preventMouseEvents=!1,self.shouldDetect=!0):isPointer&&eventType==EVENT_START?self.shouldDetect=1===ev.buttons||PointerEvent.matchType(POINTER_TOUCH,ev):isMouse||eventType!=EVENT_START||(self.preventMouseEvents=!0,self.shouldDetect=!0),isPointer&&eventType!=EVENT_END&&PointerEvent.updatePointer(eventType,ev),self.shouldDetect&&(triggerType=self.doDetect.call(self,ev,eventType,element,handler)),triggerType==EVENT_END&&(self.preventMouseEvents=!1,self.shouldDetect=!1,PointerEvent.reset()),isPointer&&eventType==EVENT_END&&PointerEvent.updatePointer(eventType,ev))};return this.on(element,EVENT_TYPES[eventType],onTouchHandler),onTouchHandler},doDetect:function(ev,eventType,element,handler){var touchList=this.getTouchList(ev,eventType),touchListLength=touchList.length,triggerType=eventType,triggerChange=touchList.trigger,changedLength=touchListLength;eventType==EVENT_START?triggerChange=EVENT_TOUCH:eventType==EVENT_END&&(triggerChange=EVENT_RELEASE,changedLength=touchList.length-(ev.changedTouches?ev.changedTouches.length:1)),changedLength>0&&this.started&&(triggerType=EVENT_MOVE),this.started=!0;var evData=this.collectEventData(element,triggerType,touchList,ev);return eventType!=EVENT_END&&handler.call(Detection,evData),triggerChange&&(evData.changedLength=changedLength,evData.eventType=triggerChange,handler.call(Detection,evData),evData.eventType=triggerType,delete evData.changedLength),triggerType==EVENT_END&&(handler.call(Detection,evData),this.started=!1),triggerType},determineEventTypes:function(){var types;return types=GestureDetector.HAS_POINTEREVENTS?window.PointerEvent?["pointerdown","pointermove","pointerup pointercancel lostpointercapture"]:["MSPointerDown","MSPointerMove","MSPointerUp MSPointerCancel MSLostPointerCapture"]:GestureDetector.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],EVENT_TYPES[EVENT_START]=types[0],EVENT_TYPES[EVENT_MOVE]=types[1],EVENT_TYPES[EVENT_END]=types[2],EVENT_TYPES},getTouchList:function(ev,eventType){if(GestureDetector.HAS_POINTEREVENTS)return PointerEvent.getTouchList();if(ev.touches){if(eventType==EVENT_MOVE)return ev.touches;var identifiers=[],concat=[].concat(Utils.toArray(ev.touches),Utils.toArray(ev.changedTouches)),touchList=[];return Utils.each(concat,function(touch){Utils.inArray(identifiers,touch.identifier)===!1&&touchList.push(touch),identifiers.push(touch.identifier)}),touchList}return ev.identifier=1,[ev]},collectEventData:function(element,eventType,touches,ev){var pointerType=POINTER_TOUCH;return Utils.inStr(ev.type,"mouse")||PointerEvent.matchType(POINTER_MOUSE,ev)?pointerType=POINTER_MOUSE:PointerEvent.matchType(POINTER_PEN,ev)&&(pointerType=POINTER_PEN),{center:Utils.getCenter(touches),timeStamp:Date.now(),target:ev.target,touches:touches,eventType:eventType,pointerType:pointerType,srcEvent:ev,preventDefault:function(){var srcEvent=this.srcEvent;srcEvent.preventManipulation&&srcEvent.preventManipulation(),srcEvent.preventDefault&&srcEvent.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return Detection.stopDetect()}}}},PointerEvent=GestureDetector.PointerEvent={pointers:{},getTouchList:function(){var touchlist=[];return Utils.each(this.pointers,function(pointer){touchlist.push(pointer)}),touchlist},updatePointer:function(eventType,pointerEvent){eventType==EVENT_END||eventType!=EVENT_END&&1!==pointerEvent.buttons?delete this.pointers[pointerEvent.pointerId]:(pointerEvent.identifier=pointerEvent.pointerId,this.pointers[pointerEvent.pointerId]=pointerEvent)},matchType:function(pointerType,ev){if(!ev.pointerType)return!1;var pt=ev.pointerType,types={};return types[POINTER_MOUSE]=pt===(ev.MSPOINTER_TYPE_MOUSE||POINTER_MOUSE),types[POINTER_TOUCH]=pt===(ev.MSPOINTER_TYPE_TOUCH||POINTER_TOUCH),types[POINTER_PEN]=pt===(ev.MSPOINTER_TYPE_PEN||POINTER_PEN),types[pointerType]},reset:function(){this.pointers={}}},Detection=GestureDetector.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(inst,eventData){this.current||(this.stopped=!1,this.current={inst:inst,startEvent:Utils.extend({},eventData),lastEvent:!1,lastCalcEvent:!1,futureCalcEvent:!1,lastCalcData:{},name:""},this.detect(eventData))},detect:function(eventData){if(this.current&&!this.stopped){eventData=this.extendEventData(eventData);var inst=this.current.inst,instOptions=inst.options;return Utils.each(this.gestures,function(gesture){!this.stopped&&inst.enabled&&instOptions[gesture.name]&&gesture.handler.call(gesture,eventData,inst)},this),this.current&&(this.current.lastEvent=eventData),eventData.eventType==EVENT_END&&this.stopDetect(),eventData}},stopDetect:function(){this.previous=Utils.extend({},this.current),this.current=null,this.stopped=!0},getCalculatedData:function(ev,center,deltaTime,deltaX,deltaY){var cur=this.current,recalc=!1,calcEv=cur.lastCalcEvent,calcData=cur.lastCalcData;calcEv&&ev.timeStamp-calcEv.timeStamp>GestureDetector.CALCULATE_INTERVAL&&(center=calcEv.center,deltaTime=ev.timeStamp-calcEv.timeStamp,deltaX=ev.center.clientX-calcEv.center.clientX,deltaY=ev.center.clientY-calcEv.center.clientY,recalc=!0),ev.eventType!=EVENT_TOUCH&&ev.eventType!=EVENT_RELEASE||(cur.futureCalcEvent=ev),cur.lastCalcEvent&&!recalc||(calcData.velocity=Utils.getVelocity(deltaTime,deltaX,deltaY),calcData.angle=Utils.getAngle(center,ev.center),calcData.direction=Utils.getDirection(center,ev.center),cur.lastCalcEvent=cur.futureCalcEvent||ev,cur.futureCalcEvent=ev),ev.velocityX=calcData.velocity.x,ev.velocityY=calcData.velocity.y,ev.interimAngle=calcData.angle,ev.interimDirection=calcData.direction},extendEventData:function(ev){var cur=this.current,startEv=cur.startEvent,lastEv=cur.lastEvent||startEv;ev.eventType!=EVENT_TOUCH&&ev.eventType!=EVENT_RELEASE||(startEv.touches=[],Utils.each(ev.touches,function(touch){startEv.touches.push({clientX:touch.clientX,clientY:touch.clientY})}));var deltaTime=ev.timeStamp-startEv.timeStamp,deltaX=ev.center.clientX-startEv.center.clientX,deltaY=ev.center.clientY-startEv.center.clientY;return this.getCalculatedData(ev,lastEv.center,deltaTime,deltaX,deltaY),Utils.extend(ev,{startEvent:startEv,deltaTime:deltaTime,deltaX:deltaX,deltaY:deltaY,distance:Utils.getDistance(startEv.center,ev.center),angle:Utils.getAngle(startEv.center,ev.center),direction:Utils.getDirection(startEv.center,ev.center),scale:Utils.getScale(startEv.touches,ev.touches),rotation:Utils.getRotation(startEv.touches,ev.touches)}),ev},register:function(gesture){var options=gesture.defaults||{};return void 0===options[gesture.name]&&(options[gesture.name]=!0),Utils.extend(GestureDetector.defaults,options,!0),gesture.index=gesture.index||1e3,this.gestures.push(gesture),this.gestures.sort(function(a,b){return a.index<b.index?-1:a.index>b.index?1:0}),this.gestures}},GestureDetector.Instance=function(element,options){var self=this;setup(),this.element=element,this.enabled=!0,Utils.each(options,function(value,name){delete options[name],options[Utils.toCamelCase(name)]=value}),this.options=Utils.extend(Utils.extend({},GestureDetector.defaults),options||{}),this.options.behavior&&Utils.toggleBehavior(this.element,this.options.behavior,!0),this.eventStartHandler=Event$1.onTouch(element,EVENT_START,function(ev){self.enabled&&ev.eventType==EVENT_START?Detection.startDetect(self,ev):ev.eventType==EVENT_TOUCH&&Detection.detect(ev)}),this.eventHandlers=[]},GestureDetector.Instance.prototype={on:function(gestures,handler){var self=this;return Event$1.on(self.element,gestures,handler,function(type){self.eventHandlers.push({gesture:type,handler:handler})}),self},off:function(gestures,handler){var self=this;return Event$1.off(self.element,gestures,handler,function(type){var index=Utils.inArray({gesture:type,handler:handler});index!==!1&&self.eventHandlers.splice(index,1)}),self},trigger:function(gesture,eventData){eventData||(eventData={});var event=GestureDetector.DOCUMENT.createEvent("Event");event.initEvent(gesture,!0,!0),event.gesture=eventData;var element=this.element;return Utils.hasParent(eventData.target,element)&&(element=eventData.target),element.dispatchEvent(event),this},enable:function(state){return this.enabled=state,this},dispose:function(){var i,eh;for(Utils.toggleBehavior(this.element,this.options.behavior,!1),i=-1;eh=this.eventHandlers[++i];)Utils.off(this.element,eh.gesture,eh.handler);return this.eventHandlers=[],Event$1.off(this.element,EVENT_TYPES[EVENT_START],this.eventStartHandler),null}},function(name){function dragGesture(ev,inst){var cur=Detection.current;if(!(inst.options.dragMaxTouches>0&&ev.touches.length>inst.options.dragMaxTouches))switch(ev.eventType){case EVENT_START:triggered=!1;break;case EVENT_MOVE:if(ev.distance<inst.options.dragMinDistance&&cur.name!=name)return;var startCenter=cur.startEvent.center;if(cur.name!=name&&(cur.name=name,inst.options.dragDistanceCorrection&&ev.distance>0)){var factor=Math.abs(inst.options.dragMinDistance/ev.distance);startCenter.pageX+=ev.deltaX*factor,startCenter.pageY+=ev.deltaY*factor,startCenter.clientX+=ev.deltaX*factor,startCenter.clientY+=ev.deltaY*factor,ev=Detection.extendEventData(ev)}(cur.lastEvent.dragLockToAxis||inst.options.dragLockToAxis&&inst.options.dragLockMinDistance<=ev.distance)&&(ev.dragLockToAxis=!0);
5var lastDirection=cur.lastEvent.direction;ev.dragLockToAxis&&lastDirection!==ev.direction&&(Utils.isVertical(lastDirection)?ev.direction=ev.deltaY<0?DIRECTION_UP:DIRECTION_DOWN:ev.direction=ev.deltaX<0?DIRECTION_LEFT:DIRECTION_RIGHT),triggered||(inst.trigger(name+"start",ev),triggered=!0),inst.trigger(name,ev),inst.trigger(name+ev.direction,ev);var isVertical=Utils.isVertical(ev.direction);(inst.options.dragBlockVertical&&isVertical||inst.options.dragBlockHorizontal&&!isVertical)&&ev.preventDefault();break;case EVENT_RELEASE:triggered&&ev.changedLength<=inst.options.dragMaxTouches&&(inst.trigger(name+"end",ev),triggered=!1);break;case EVENT_END:triggered=!1}}var triggered=!1;GestureDetector.gestures.Drag={name:name,index:50,handler:dragGesture,defaults:{dragMinDistance:10,dragDistanceCorrection:!0,dragMaxTouches:1,dragBlockHorizontal:!1,dragBlockVertical:!1,dragLockToAxis:!1,dragLockMinDistance:25}}}("drag"),GestureDetector.gestures.Gesture={name:"gesture",index:1337,handler:function(ev,inst){inst.trigger(this.name,ev)}},function(name){function holdGesture(ev,inst){var options=inst.options,current=Detection.current;switch(ev.eventType){case EVENT_START:clearTimeout(timer),current.name=name,timer=setTimeout(function(){current&&current.name==name&&inst.trigger(name,ev)},options.holdTimeout);break;case EVENT_MOVE:ev.distance>options.holdThreshold&&clearTimeout(timer);break;case EVENT_RELEASE:clearTimeout(timer)}}var timer;GestureDetector.gestures.Hold={name:name,index:10,defaults:{holdTimeout:500,holdThreshold:2},handler:holdGesture}}("hold"),GestureDetector.gestures.Release={name:"release",index:1/0,handler:function(ev,inst){ev.eventType==EVENT_RELEASE&&inst.trigger(this.name,ev)}},GestureDetector.gestures.Swipe={name:"swipe",index:40,defaults:{swipeMinTouches:1,swipeMaxTouches:1,swipeVelocityX:.6,swipeVelocityY:.6},handler:function(ev,inst){if(ev.eventType==EVENT_RELEASE){var touches=ev.touches.length,options=inst.options;if(touches<options.swipeMinTouches||touches>options.swipeMaxTouches)return;(ev.velocityX>options.swipeVelocityX||ev.velocityY>options.swipeVelocityY)&&(inst.trigger(this.name,ev),inst.trigger(this.name+ev.direction,ev))}}},function(name){function tapGesture(ev,inst){var sincePrev,didDoubleTap,options=inst.options,current=Detection.current,prev=Detection.previous;switch(ev.eventType){case EVENT_START:hasMoved=!1;break;case EVENT_MOVE:hasMoved=hasMoved||ev.distance>options.tapMaxDistance;break;case EVENT_END:!Utils.inStr(ev.srcEvent.type,"cancel")&&ev.deltaTime<options.tapMaxTime&&!hasMoved&&(sincePrev=prev&&prev.lastEvent&&ev.timeStamp-prev.lastEvent.timeStamp,didDoubleTap=!1,prev&&prev.name==name&&sincePrev&&sincePrev<options.doubleTapInterval&&ev.distance<options.doubleTapDistance&&(inst.trigger("doubletap",ev),didDoubleTap=!0),didDoubleTap&&!options.tapAlways||(current.name=name,inst.trigger(current.name,ev)))}}var hasMoved=!1;GestureDetector.gestures.Tap={name:name,index:100,handler:tapGesture,defaults:{tapMaxTime:250,tapMaxDistance:10,tapAlways:!0,doubleTapDistance:20,doubleTapInterval:300}}}("tap"),GestureDetector.gestures.Touch={name:"touch",index:-(1/0),defaults:{preventDefault:!1,preventMouse:!1},handler:function(ev,inst){return inst.options.preventMouse&&ev.pointerType==POINTER_MOUSE?void ev.stopDetect():(inst.options.preventDefault&&ev.preventDefault(),void(ev.eventType==EVENT_TOUCH&&inst.trigger("touch",ev)))}},function(name){function transformGesture(ev,inst){switch(ev.eventType){case EVENT_START:triggered=!1;break;case EVENT_MOVE:if(ev.touches.length<2)return;var scaleThreshold=Math.abs(1-ev.scale),rotationThreshold=Math.abs(ev.rotation);if(scaleThreshold<inst.options.transformMinScale&&rotationThreshold<inst.options.transformMinRotation)return;Detection.current.name=name,triggered||(inst.trigger(name+"start",ev),triggered=!0),inst.trigger(name,ev),rotationThreshold>inst.options.transformMinRotation&&inst.trigger("rotate",ev),scaleThreshold>inst.options.transformMinScale&&(inst.trigger("pinch",ev),inst.trigger("pinch"+(ev.scale<1?"in":"out"),ev));break;case EVENT_RELEASE:triggered&&ev.changedLength<2&&(inst.trigger(name+"end",ev),triggered=!1)}}var triggered=!1;GestureDetector.gestures.Transform={name:name,index:45,defaults:{transformMinScale:.01,transformMinRotation:1},handler:transformGesture}}("transform");var Platform=function(){function Platform(){classCallCheck(this,Platform),this._renderPlatform=null}return createClass(Platform,[{key:"select",value:function(platform){"string"==typeof platform&&(this._renderPlatform=platform.trim().toLowerCase())}},{key:"isWebView",value:function(){if("loading"===document.readyState||"uninitialized"==document.readyState)throw new Error("isWebView() method is available after dom contents loaded.");return!!(window.cordova||window.phonegap||window.PhoneGap)}},{key:"isIOS",value:function(){return this._renderPlatform?"ios"===this._renderPlatform:"object"!==("undefined"==typeof device?"undefined":_typeof(device))||/browser/i.test(device.platform)?/iPhone|iPad|iPod/i.test(navigator.userAgent):/iOS/i.test(device.platform)}},{key:"isAndroid",value:function(){return this._renderPlatform?"android"===this._renderPlatform:"object"!==("undefined"==typeof device?"undefined":_typeof(device))||/browser/i.test(device.platform)?/Android/i.test(navigator.userAgent):/Android/i.test(device.platform)}},{key:"isAndroidPhone",value:function(){return/Android/i.test(navigator.userAgent)&&/Mobile/i.test(navigator.userAgent)}},{key:"isAndroidTablet",value:function(){return/Android/i.test(navigator.userAgent)&&!/Mobile/i.test(navigator.userAgent)}},{key:"isWP",value:function(){return this._renderPlatform?"wp"===this._renderPlatform:"object"!==("undefined"==typeof device?"undefined":_typeof(device))||/browser/i.test(device.platform)?/Windows Phone|IEMobile|WPDesktop/i.test(navigator.userAgent):/Win32NT|WinCE/i.test(device.platform)}},{key:"isIPhone",value:function(){return/iPhone/i.test(navigator.userAgent)}},{key:"isIPad",value:function(){return/iPad/i.test(navigator.userAgent)}},{key:"isIPod",value:function(){return/iPod/i.test(navigator.userAgent)}},{key:"isBlackBerry",value:function(){return this._renderPlatform?"blackberry"===this._renderPlatform:"object"!==("undefined"==typeof device?"undefined":_typeof(device))||/browser/i.test(device.platform)?/BlackBerry|RIM Tablet OS|BB10/i.test(navigator.userAgent):/BlackBerry/i.test(device.platform)}},{key:"isOpera",value:function(){return this._renderPlatform?"opera"===this._renderPlatform:!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0}},{key:"isFirefox",value:function(){return this._renderPlatform?"firefox"===this._renderPlatform:"undefined"!=typeof InstallTrigger}},{key:"isSafari",value:function(){return this._renderPlatform?"safari"===this._renderPlatform:Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0}},{key:"isChrome",value:function(){return this._renderPlatform?"chrome"===this._renderPlatform:!(!window.chrome||window.opera||navigator.userAgent.indexOf(" OPR/")>=0||navigator.userAgent.indexOf(" Edge/")>=0)}},{key:"isIE",value:function(){return this._renderPlatform?"ie"===this._renderPlatform:!!document.documentMode}},{key:"isEdge",value:function(){return this._renderPlatform?"edge"===this._renderPlatform:navigator.userAgent.indexOf(" Edge/")>=0}},{key:"isIOS7above",value:function(){if("object"===("undefined"==typeof device?"undefined":_typeof(device))&&!/browser/i.test(device.platform))return/iOS/i.test(device.platform)&&parseInt(device.version.split(".")[0])>=7;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){var ver=(navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/)||[""])[0].replace(/_/g,".");return parseInt(ver.split(".")[0])>=7}return!1}},{key:"getMobileOS",value:function(){return this.isAndroid()?"android":this.isIOS()?"ios":this.isWP()?"wp":"other"}},{key:"getIOSDevice",value:function(){return this.isIPhone()?"iphone":this.isIPad()?"ipad":this.isIPod()?"ipod":"na"}}]),Platform}(),platform=new Platform,readyMap=new WeakMap,queueMap=new WeakMap,notification={};notification._createAlertDialog=function(options){var inputString="";options.isPrompt&&(inputString='\n <input\n class="text-input text-input--underbar"\n type="'+(options.inputType||"text")+'"\n placeholder="'+(options.placeholder||"")+'"\n value="'+(options.defaultValue||"")+'"\n style="width: 100%; margin-top: 10px;"\n />\n ');var buttons="";options.buttonLabels.forEach(function(label,index){buttons+='\n <button class="\n alert-dialog-button\n '+(index===options.primaryButtonIndex?" alert-dialog-button--primal":"")+"\n "+(options.buttonLabels.length<=2?" alert-dialog-button--one":"")+'\n ">\n '+label+"\n </button>\n "});var el={},_destroyDialog=function(){el.dialog.onDialogCancel&&el.dialog.removeEventListener("dialog-cancel",el.dialog.onDialogCancel),Object.keys(el).forEach(function(key){return delete el[key]}),el=null,options.destroy instanceof Function&&options.destroy()};el.dialog=document.createElement("ons-alert-dialog"),innerHTML(el.dialog,'\n <div class="alert-dialog-mask"></div>\n <div class="alert-dialog">\n <div class="alert-dialog-container">\n <div class="alert-dialog-title">\n '+(options.title||"")+'\n </div>\n <div class="alert-dialog-content">\n '+(options.message||options.messageHTML)+"\n "+inputString+'\n </div>\n <div class="\n alert-dialog-footer\n '+(options.buttonLabels.length<=2?" alert-dialog-footer--one":"")+'\n ">\n '+buttons+"\n </div>\n </div>\n </div>\n "),contentReady(el.dialog),["id","class","animation"].forEach(function(a){return options.hasOwnProperty(a)&&el.dialog.setAttribute(a,options[a])}),options.modifier&&util.addModifier(el.dialog,options.modifier);var deferred=util.defer();return options.isPrompt&&options.submitOnEnter&&(el.input=el.dialog.querySelector(".text-input"),el.input.onkeypress=function(event){13===event.keyCode&&el.dialog.hide().then(function(){var resolveValue=el.input.value;_destroyDialog(),options.callback(resolveValue),deferred.resolve(resolveValue)})}),el.footer=el.dialog.querySelector(".alert-dialog-footer"),util.arrayFrom(el.dialog.querySelectorAll(".alert-dialog-button")).forEach(function(buttonElement,index){buttonElement.onclick=function(){el.dialog.hide().then(function(){var resolveValue=options.isPrompt?el.input.value:index;el.dialog.remove(),_destroyDialog(),options.callback(resolveValue),deferred.resolve(resolveValue)})},el.footer.appendChild(buttonElement)}),options.cancelable&&(el.dialog.cancelable=!0,el.dialog.onDialogCancel=function(){setImmediate(function(){el.dialog.remove(),_destroyDialog()});var resolveValue=options.isPrompt?null:-1;options.callback(resolveValue),deferred.reject(resolveValue)},el.dialog.addEventListener("dialog-cancel",el.dialog.onDialogCancel,!1)),document.body.appendChild(el.dialog),options.compile(el.dialog),setImmediate(function(){el.dialog.show().then(function(){el.input&&options.isPrompt&&options.autofocus&&el.input.focus()})}),deferred.promise};var _normalizeArguments=function(message){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},defaults=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof message?options.message=message:options=message,!options.message&&!options.messageHTML)throw new Error("Alert dialog must contain a message.");return(options.hasOwnProperty("buttonLabels")||options.hasOwnProperty("buttonLabel"))&&(options.buttonLabels=options.buttonLabels||options.buttonLabel,Array.isArray(options.buttonLabels)||(options.buttonLabels=[options.buttonLabels||""])),util.extend({compile:function(param){return param},callback:function(param){return param},buttonLabels:["OK"],primaryButtonIndex:0,animation:"default",cancelable:!1},defaults,options)};notification.alert=function(message,options){return options=_normalizeArguments(message,options,{title:"Alert"}),notification._createAlertDialog(options)},notification.confirm=function(message,options){return options=_normalizeArguments(message,options,{buttonLabels:["Cancel","OK"],primaryButtonIndex:1,title:"Confirm"}),notification._createAlertDialog(options)},notification.prompt=function(message,options){return options=_normalizeArguments(message,options,{title:"Alert",isPrompt:!0,autofocus:!0,submitOnEnter:!0}),notification._createAlertDialog(options)};var pageAttributeExpression={_variables:{},defineVariable:function(name,value){var overwrite=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof name)throw new Error("Variable name must be a string.");if("string"!=typeof value&&"function"!=typeof value)throw new Error("Variable value must be a string or a function.");if(this._variables.hasOwnProperty(name)&&!overwrite)throw new Error('"'+name+'" is already defined.');this._variables[name]=value},getVariable:function(name){return this._variables.hasOwnProperty(name)?this._variables[name]:null},removeVariable:function(name){delete this._variables[name]},getAllVariables:function(){return this._variables},_parsePart:function(part){var c=void 0,inInterpolation=!1,currentIndex=0,tokens=[];if(0===part.length)throw new Error("Unable to parse empty string.");for(var i=0;i<part.length;i++)if(c=part.charAt(i),"$"===c&&"{"===part.charAt(i+1)){if(inInterpolation)throw new Error("Nested interpolation not supported.");var token=part.substring(currentIndex,i);token.length>0&&tokens.push(part.substring(currentIndex,i)),currentIndex=i,inInterpolation=!0}else if("}"===c){if(!inInterpolation)throw new Error("} must be preceeded by ${");var _token=part.substring(currentIndex,i+1);_token.length>0&&tokens.push(part.substring(currentIndex,i+1)),currentIndex=i+1,inInterpolation=!1}if(inInterpolation)throw new Error("Unterminated interpolation.");return tokens.push(part.substring(currentIndex,part.length)),tokens},_replaceToken:function(token){var re=/^\${(.*?)}$/,match=token.match(re);if(match){var name=match[1].trim(),variable=this.getVariable(name);if(null===variable)throw new Error('Variable "'+name+'" does not exist.');if("string"==typeof variable)return variable;var rv=variable();if("string"!=typeof rv)throw new Error("Must return a string.");return rv}return token},_replaceTokens:function(tokens){return tokens.map(this._replaceToken.bind(this))},_parseExpression:function(expression){return expression.split(",").map(function(part){return part.trim()}).map(this._parsePart.bind(this)).map(this._replaceTokens.bind(this)).map(function(part){return part.join("")})},evaluate:function(expression){return expression?this._parseExpression(expression):[]}};pageAttributeExpression.defineVariable("mobileOS",platform.getMobileOS()),pageAttributeExpression.defineVariable("iOSDevice",platform.getIOSDevice()),pageAttributeExpression.defineVariable("runtime",function(){return platform.isWebView()?"cordova":"browser"});var internal$1={};internal$1.config={autoStatusBarFill:!0,animationsDisabled:!1},internal$1.nullElement=window.document.createElement("div"),internal$1.isEnabledAutoStatusBarFill=function(){return!!internal$1.config.autoStatusBarFill},internal$1.normalizePageHTML=function(html){return html=(""+html).trim(),html.match(/^<ons-page/)||(html="<ons-page _muted>"+html+"</ons-page>"),html},internal$1.waitDOMContentLoaded=function(callback){"loading"===window.document.readyState||"uninitialized"==window.document.readyState?window.document.addEventListener("DOMContentLoaded",callback):setImmediate(callback)},internal$1.autoStatusBarFill=function(action){var onReady=function onReady(){internal$1.shouldFillStatusBar()&&action(),document.removeEventListener("deviceready",onReady),document.removeEventListener("DOMContentLoaded",onReady)};"object"===("undefined"==typeof device?"undefined":_typeof(device))?document.addEventListener("deviceready",onReady):["complete","interactive"].indexOf(document.readyState)===-1?document.addEventListener("DOMContentLoaded",function(){onReady()}):onReady()},internal$1.shouldFillStatusBar=function(){return internal$1.isEnabledAutoStatusBarFill()&&platform.isWebView()&&platform.isIOS7above()},internal$1.templateStore={_storage:{},get:function(key){return internal$1.templateStore._storage[key]||null},set:function(key,template){internal$1.templateStore._storage[key]=template}},window.document.addEventListener("_templateloaded",function(e){"ons-template"===e.target.nodeName.toLowerCase()&&internal$1.templateStore.set(e.templateId,e.template)},!1),window.document.addEventListener("DOMContentLoaded",function(){function register(query){for(var templates=window.document.querySelectorAll(query),i=0;i<templates.length;i++)internal$1.templateStore.set(templates[i].getAttribute("id"),templates[i].textContent)}register('script[type="text/ons-template"]'),register('script[type="text/template"]'),register('script[type="text/ng-template"]')},!1),internal$1.getTemplateHTMLAsync=function(page){return new Promise(function(resolve,reject){setImmediate(function(){var cache=internal$1.templateStore.get(page);if(cache){var html="string"==typeof cache?cache:cache[1];resolve(html)}else!function(){var xhr=new XMLHttpRequest;xhr.open("GET",page,!0),xhr.onload=function(response){var html=xhr.responseText;xhr.status>=400&&xhr.status<600?reject(html):resolve(html)},xhr.onerror=function(){throw new Error("The page is not found: "+page)},xhr.send(null)}()})})},internal$1.getPageHTMLAsync=function(page){var pages=pageAttributeExpression.evaluate(page),getPage=function getPage(page){return"string"!=typeof page?Promise.reject("Must specify a page."):internal$1.getTemplateHTMLAsync(page).then(function(html){return internal$1.normalizePageHTML(html)},function(error){return 0===pages.length?Promise.reject(error):getPage(pages.shift())}).then(function(html){return internal$1.normalizePageHTML(html)})};return getPage(pages.shift())};var AnimatorFactory=function(){function AnimatorFactory(opts){if(classCallCheck(this,AnimatorFactory),this._animators=opts.animators,this._baseClass=opts.baseClass,this._baseClassName=opts.baseClassName||opts.baseClass.name,this._animation=opts.defaultAnimation||"default",this._animationOptions=opts.defaultAnimationOptions||{},!this._animators[this._animation])throw new Error("No such animation: "+this._animation)}return createClass(AnimatorFactory,[{key:"setAnimationOptions",value:function(options){this._animationOptions=options}},{key:"newAnimator",value:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},defaultAnimator=arguments[1],animator=null;if(options.animation instanceof this._baseClass)return options.animation;var Animator=null;if("string"==typeof options.animation&&(Animator=this._animators[options.animation]),!Animator&&defaultAnimator)animator=defaultAnimator;else{Animator=Animator||this._animators[this._animation];var animationOpts=util.extend({},this._animationOptions,options.animationOptions||{},internal$1.config.animationsDisabled?{duration:0,delay:0}:{});animator=new Animator(animationOpts),"function"==typeof animator&&(animator=new animator(animationOpts))}if(!(animator instanceof this._baseClass))throw new Error('"animator" is not an instance of '+this._baseClassName+".");return animator}}],[{key:"parseAnimationOptionsString",value:function(jsonString){try{if("string"==typeof jsonString){var result=util.animationOptionsParse(jsonString);if("object"===("undefined"==typeof result?"undefined":_typeof(result))&&null!==result)return result;console.error('"animation-options" attribute must be a JSON object string: '+jsonString)}return{}}catch(e){return console.error('"animation-options" attribute must be a JSON object string: '+jsonString),{}}}}]),AnimatorFactory}(),ModifierUtil=function(){function ModifierUtil(){classCallCheck(this,ModifierUtil)}return createClass(ModifierUtil,null,[{key:"diff",value:function(last,current){function makeDict(modifier){var dict={};return ModifierUtil.split(modifier).forEach(function(token){return dict[token]=token}),dict}last=makeDict((""+last).trim()),current=makeDict((""+current).trim());var removed=Object.keys(last).reduce(function(result,token){return current[token]||result.push(token),result},[]),added=Object.keys(current).reduce(function(result,token){return last[token]||result.push(token),result},[]);return{added:added,removed:removed}}},{key:"applyDiffToClassList",value:function(diff,classList,template){diff.added.map(function(modifier){return template.replace(/\*/g,modifier)}).forEach(function(klass){return classList.add(klass)}),diff.removed.map(function(modifier){return template.replace(/\*/g,modifier)}).forEach(function(klass){return classList.remove(klass)})}},{key:"applyDiffToElement",value:function(diff,element,scheme){var matches=function(e,s){return(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector).call(e,s)};for(var selector in scheme)if(scheme.hasOwnProperty(selector))for(var targetElements=!selector||matches(element,selector)?[element]:element.querySelectorAll(selector),i=0;i<targetElements.length;i++)ModifierUtil.applyDiffToClassList(diff,targetElements[i].classList,scheme[selector])}},{key:"onModifierChanged",value:function(last,current,element,scheme){return ModifierUtil.applyDiffToElement(ModifierUtil.diff(last,current),element,scheme)}},{key:"initModifier",value:function(element,scheme){var modifier=element.getAttribute("modifier");"string"==typeof modifier&&ModifierUtil.applyDiffToElement({removed:[],added:ModifierUtil.split(modifier)},element,scheme)}},{key:"split",value:function(modifier){return"string"!=typeof modifier?[]:modifier.trim().split(/ +/).filter(function(token){return""!==token})}}]),ModifierUtil}(),LazyRepeatDelegate=function(){function LazyRepeatDelegate(userDelegate){var templateElement=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(classCallCheck(this,LazyRepeatDelegate),"object"!==("undefined"==typeof userDelegate?"undefined":_typeof(userDelegate))||null===userDelegate)throw Error('"delegate" parameter must be an object.');if(this._userDelegate=userDelegate,!(templateElement instanceof Element)&&null!==templateElement)throw Error('"templateElement" parameter must be an instance of Element or null.');this._templateElement=templateElement}return createClass(LazyRepeatDelegate,[{key:"hasRenderFunction",value:function(){return this._userDelegate._render instanceof Function}},{key:"_render",value:function(items,height){this._userDelegate._render(items,height)}},{key:"loadItemElement",value:function(index,parent,done){if(this._userDelegate.loadItemElement instanceof Function)this._userDelegate.loadItemElement(index,parent,function(element){return done({element:element})});else{var element=this._userDelegate.createItemContent(index,this._templateElement);if(!(element instanceof Element))throw Error("createItemContent() must return an instance of Element.");parent.appendChild(element),done({element:element})}}},{key:"countItems",value:function(){var count=this._userDelegate.countItems();if("number"!=typeof count)throw Error("countItems() must return a number.");return count}},{key:"updateItem",value:function(index,item){this._userDelegate.updateItemContent instanceof Function&&this._userDelegate.updateItemContent(index,item)}},{key:"calculateItemHeight",value:function(index){if(this._userDelegate.calculateItemHeight instanceof Function){var height=this._userDelegate.calculateItemHeight(index);if("number"!=typeof height)throw Error("calculateItemHeight() must return a number.");return height}return 0}},{key:"destroyItem",value:function(index,item){this._userDelegate.destroyItem instanceof Function&&this._userDelegate.destroyItem(index,item)}},{key:"destroy",value:function(){this._userDelegate.destroy instanceof Function&&this._userDelegate.destroy(),this._userDelegate=this._templateElement=null}},{key:"itemHeight",get:function(){return this._userDelegate.itemHeight}}]),LazyRepeatDelegate}(),LazyRepeatProvider=function(){function LazyRepeatProvider(wrapperElement,delegate){if(classCallCheck(this,LazyRepeatProvider),!(delegate instanceof LazyRepeatDelegate))throw Error('"delegate" parameter must be an instance of LazyRepeatDelegate.');if(this._wrapperElement=wrapperElement,this._delegate=delegate,"ons-list"===wrapperElement.tagName.toLowerCase()&&wrapperElement.classList.add("lazy-list"),this._pageContent=this._findPageContentElement(wrapperElement),!this._pageContent)throw new Error("ons-lazy-repeat must be a descendant of an <ons-page> or an element.");this._topPositions=[],this._renderedItems={},this._delegate.itemHeight||this._delegate.calculateItemHeight(0)||(this._unknownItemHeight=!0),this._addEventListeners(),this._onChange()}return createClass(LazyRepeatProvider,[{key:"_findPageContentElement",value:function(wrapperElement){var pageContent=util.findParent(wrapperElement,".page__content");if(pageContent)return pageContent;var page=util.findParent(wrapperElement,"ons-page");if(page){var content=util.findChild(page,".content");if(content)return content}return null}},{key:"_checkItemHeight",value:function(callback){var _this=this;this._delegate.loadItemElement(0,this._wrapperElement,function(item){if(!_this._unknownItemHeight)throw Error("Invalid state");var done=function(){_this._wrapperElement.removeChild(item.element),delete _this._unknownItemHeight,callback()};if(_this._itemHeight=item.element.offsetHeight,_this._itemHeight>0)return void done();var lastVisibility=_this._wrapperElement.style.visibility;_this._wrapperElement.style.visibility="hidden",item.element.style.visibility="hidden",setImmediate(function(){if(_this._itemHeight=item.element.offsetHeight,0==_this._itemHeight)throw Error("Invalid state: this._itemHeight must be greater than zero.");_this._wrapperElement.style.visibility=lastVisibility,done()})})}},{key:"_countItems",value:function(){return this._delegate.countItems()}},{key:"_getItemHeight",value:function(i){return this.staticItemHeight||this._delegate.calculateItemHeight(i)}},{key:"_onChange",value:function(){this._render()}},{key:"refresh",value:function(){this._removeAllElements(),this._onChange()}},{key:"_render",value:function(){var _this2=this;if(this._unknownItemHeight)return this._checkItemHeight(this._render.bind(this));var items=this._getItemsInView();if(this._delegate.hasRenderFunction&&this._delegate.hasRenderFunction())return this._delegate._render(items,this._listHeight),null;var keep={};items.forEach(function(item){_this2._renderElement(item),keep[item.index]=!0}),Object.keys(this._renderedItems).forEach(function(key){return keep[key]||_this2._removeElement(key)}),this._wrapperElement.style.height=this._listHeight+"px"}},{key:"_renderElement",value:function(_ref){var _this3=this,index=_ref.index,top=_ref.top,item=this._renderedItems[index];return item?(this._delegate.updateItem(index,item),void(item.element.style.top=top+"px")):void this._delegate.loadItemElement(index,this._wrapperElement,function(item){util.extend(item.element.style,{position:"absolute",top:top+"px",left:0,right:0}),_this3._renderedItems[index]=item})}},{key:"_removeElement",value:function(index){var item=this._renderedItems[index];this._delegate.destroyItem(index,item),item.element.parentElement&&item.element.parentElement.removeChild(item.element),delete this._renderedItems[index]}},{key:"_removeAllElements",value:function(){var _this4=this;Object.keys(this._renderedItems).forEach(function(key){return _this4._removeElement(key)})}},{key:"_calculateStartIndex",value:function(current){var start=0,end=this._itemCount-1;if(this.staticItemHeight)return parseInt(-current/this.staticItemHeight);for(;;){var middle=Math.floor((start+end)/2),value=current+this._topPositions[middle];if(end<start)return 0;if(value<=0&&value+this._getItemHeight(middle)>0)return middle;isNaN(value)||value>=0?end=middle-1:start=middle+1}}},{key:"_recalculateTopPositions",value:function(){Math.min(this._topPositions.length,this._itemCount);this._topPositions[0]=0;for(var _l,i=1;i<_l;i++)this._topPositions[i]=this._topPositions[i-1]+this._getItemHeight(i)}},{key:"_getItemsInView",value:function(){var offset=this._wrapperElement.getBoundingClientRect().top,limit=4*window.innerHeight-offset,count=this._countItems();count!==this._itemCount&&(this._itemCount=count,this._recalculateTopPositions());for(var i=Math.max(0,this._calculateStartIndex(offset)-30),items=[],top=this._topPositions[i];i<count&&top<limit;i++)i>=this._topPositions.length&&(this._topPositions.length+=100),this._topPositions[i]=top,items.push({top:top,index:i}),top+=this._getItemHeight(i);return this._listHeight=top,items}},{key:"_debounce",value:function(func,wait,immediate){var timeout=void 0;return function(){var _this5=this,_arguments=arguments,callNow=immediate&&!timeout;clearTimeout(timeout),callNow?func.apply(this,arguments):timeout=setTimeout(function(){timeout=null,func.apply(_this5,_arguments)},wait)}}},{key:"_doubleFireOnTouchend",value:function(){this._render(),this._debounce(this._render.bind(this),100)}},{key:"_addEventListeners",value:function(){util.bindListeners(this,["_onChange","_doubleFireOnTouchend"]),platform.isIOS()&&(this._boundOnChange=this._debounce(this._boundOnChange,30)),this._pageContent.addEventListener("scroll",this._boundOnChange,!0),platform.isIOS()&&(this._pageContent.addEventListener("touchmove",this._boundOnChange,!0),this._pageContent.addEventListener("touchend",this._boundDoubleFireOnTouchend,!0)),window.document.addEventListener("resize",this._boundOnChange,!0)}},{key:"_removeEventListeners",value:function(){this._pageContent.removeEventListener("scroll",this._boundOnChange,!0),platform.isIOS()&&(this._pageContent.removeEventListener("touchmove",this._boundOnChange,!0),this._pageContent.removeEventListener("touchend",this._boundDoubleFireOnTouchend,!0)),window.document.removeEventListener("resize",this._boundOnChange,!0)}},{key:"destroy",value:function(){this._removeAllElements(),this._delegate.destroy(),this._parentElement=this._delegate=this._renderedItems=null,this._removeEventListeners()}},{key:"staticItemHeight",get:function(){return this._delegate.itemHeight||this._itemHeight}}]),LazyRepeatProvider}();internal$1.AnimatorFactory=AnimatorFactory,internal$1.ModifierUtil=ModifierUtil,internal$1.LazyRepeatProvider=LazyRepeatProvider,internal$1.LazyRepeatDelegate=LazyRepeatDelegate;var create=function(){var obj={_isPortrait:!1,isPortrait:function(){return this._isPortrait()},isLandscape:function(){return!this.isPortrait()},_init:function(){return document.addEventListener("DOMContentLoaded",this._onDOMContentLoaded.bind(this),!1),"orientation"in window?window.addEventListener("orientationchange",this._onOrientationChange.bind(this),!1):window.addEventListener("resize",this._onResize.bind(this),!1),this._isPortrait=function(){return window.innerHeight>window.innerWidth},this},_onDOMContentLoaded:function(){this._installIsPortraitImplementation(),this.emit("change",{isPortrait:this.isPortrait()})},_installIsPortraitImplementation:function(){var isPortrait=window.innerWidth<window.innerHeight;"orientation"in window?window.orientation%180===0?this._isPortrait=function(){return 0===Math.abs(window.orientation%180)?isPortrait:!isPortrait}:this._isPortrait=function(){return 90===Math.abs(window.orientation%180)?isPortrait:!isPortrait}:this._isPortrait=function(){return window.innerHeight>window.innerWidth}},_onOrientationChange:function(){var _this=this,isPortrait=this._isPortrait(),nIter=0,interval=setInterval(function(){nIter++;var w=window.innerWidth,h=window.innerHeight;isPortrait&&w<=h||!isPortrait&&w>=h?(_this.emit("change",{isPortrait:isPortrait}),clearInterval(interval)):50===nIter&&(_this.emit("change",{isPortrait:isPortrait}),clearInterval(interval))},20)},_onResize:function(){this.emit("change",{isPortrait:this.isPortrait()})}};return MicroEvent.mixin(obj),obj},orientation=create()._init(),softwareKeyboard=new MicroEvent;softwareKeyboard._visible=!1;
6var onShow=function(){softwareKeyboard._visible=!0,softwareKeyboard.emit("show")},onHide=function(){softwareKeyboard._visible=!1,softwareKeyboard.emit("hide")},bindEvents=function(){return"undefined"!=typeof Keyboard?(Keyboard.onshow=onShow,Keyboard.onhide=onHide,softwareKeyboard.emit("init",{visible:Keyboard.isVisible}),!0):"undefined"!=typeof cordova.plugins&&"undefined"!=typeof cordova.plugins.Keyboard&&(window.addEventListener("native.keyboardshow",onShow),window.addEventListener("native.keyboardhide",onHide),softwareKeyboard.emit("init",{visible:cordova.plugins.Keyboard.isVisible}),!0)},noPluginError=function(){console.warn("ons-keyboard: Cordova Keyboard plugin is not present.")};document.addEventListener("deviceready",function(){bindEvents()||((document.querySelector("[ons-keyboard-active]")||document.querySelector("[ons-keyboard-inactive]"))&&noPluginError(),softwareKeyboard.on=noPluginError)});var util$2={_ready:!1,_domContentLoaded:!1,_onDOMContentLoaded:function(){util$2._domContentLoaded=!0,platform.isWebView()?window.document.addEventListener("deviceready",function(){util$2._ready=!0},!1):util$2._ready=!0},addBackButtonListener:function(fn){if(!this._domContentLoaded)throw new Error("This method is available after DOMContentLoaded");this._ready?window.document.addEventListener("backbutton",fn,!1):window.document.addEventListener("deviceready",function(){window.document.addEventListener("backbutton",fn,!1)})},removeBackButtonListener:function(fn){if(!this._domContentLoaded)throw new Error("This method is available after DOMContentLoaded");this._ready?window.document.removeEventListener("backbutton",fn,!1):window.document.addEventListener("deviceready",function(){window.document.removeEventListener("backbutton",fn,!1)})}};window.addEventListener("DOMContentLoaded",function(){return util$2._onDOMContentLoaded()},!1);var HandlerRepository={_store:{},_genId:function(){var i=0;return function(){return i++}}(),set:function(element,handler){element.dataset.deviceBackButtonHandlerId&&this.remove(element);var id=element.dataset.deviceBackButtonHandlerId=HandlerRepository._genId();this._store[id]=handler},remove:function(element){element.dataset.deviceBackButtonHandlerId&&(delete this._store[element.dataset.deviceBackButtonHandlerId],delete element.dataset.deviceBackButtonHandlerId)},get:function(element){if(element.dataset.deviceBackButtonHandlerId){var id=element.dataset.deviceBackButtonHandlerId;if(!this._store[id])throw new Error;return this._store[id]}},has:function(element){if(!element.dataset)return!1;var id=element.dataset.deviceBackButtonHandlerId;return!!this._store[id]}},DeviceBackButtonDispatcher=function(){function DeviceBackButtonDispatcher(){classCallCheck(this,DeviceBackButtonDispatcher),this._isEnabled=!1,this._boundCallback=this._callback.bind(this)}return createClass(DeviceBackButtonDispatcher,[{key:"enable",value:function(){this._isEnabled||(util$2.addBackButtonListener(this._boundCallback),this._isEnabled=!0)}},{key:"disable",value:function(){this._isEnabled&&(util$2.removeBackButtonListener(this._boundCallback),this._isEnabled=!1)}},{key:"fireDeviceBackButtonEvent",value:function(){var event=document.createEvent("Event");event.initEvent("backbutton",!0,!0),document.dispatchEvent(event)}},{key:"_callback",value:function(){this._dispatchDeviceBackButtonEvent()}},{key:"createHandler",value:function(element,callback){if(!(element instanceof HTMLElement))throw new Error("element must be an instance of HTMLElement");if(!(callback instanceof Function))throw new Error("callback must be an instance of Function");var handler={_callback:callback,_element:element,disable:function(){HandlerRepository.remove(element)},setListener:function(callback){this._callback=callback},enable:function(){HandlerRepository.set(element,this)},isEnabled:function(){return HandlerRepository.get(element)===this},destroy:function(){HandlerRepository.remove(element),this._callback=this._element=null}};return handler.enable(),handler}},{key:"_dispatchDeviceBackButtonEvent",value:function(){function createEvent(element){return{_element:element,callParentHandler:function(){for(var parent=this._element.parentNode;parent;){if(handler=HandlerRepository.get(parent))return handler._callback(createEvent(parent));parent=parent.parentNode}}}}var tree=this._captureTree(),element=this._findHandlerLeafElement(tree),handler=HandlerRepository.get(element);handler._callback(createEvent(element))}},{key:"_captureTree",value:function(){function createTree(element){return{element:element,children:Array.prototype.concat.apply([],arrayOf(element.children).map(function(childElement){if("none"===childElement.style.display)return[];if(0===childElement.children.length&&!HandlerRepository.has(childElement))return[];var result=createTree(childElement);return 0!==result.children.length||HandlerRepository.has(result.element)?[result]:[]}))}}function arrayOf(target){for(var result=[],i=0;i<target.length;i++)result.push(target[i]);return result}return createTree(document.body)}},{key:"_findHandlerLeafElement",value:function(tree){function find(node){return 0===node.children.length?node.element:1===node.children.length?find(node.children[0]):node.children.map(function(childNode){return childNode.element}).reduce(function(left,right){if(!left)return right;var leftZ=parseInt(window.getComputedStyle(left,"").zIndex,10),rightZ=parseInt(window.getComputedStyle(right,"").zIndex,10);if(!isNaN(leftZ)&&!isNaN(rightZ))return leftZ>rightZ?left:right;throw new Error("Capturing backbutton-handler is failure.")},null)}return find(tree)}}]),DeviceBackButtonDispatcher}(),deviceBackButtonDispatcher=new DeviceBackButtonDispatcher,autoStyleEnabled=!0,modifiersMap={quiet:"material--flat",light:"material--flat",outline:"material--flat",cta:"","large--quiet":"material--flat large","large--cta":"large",noborder:"",chevron:"",tappable:""},platforms={};platforms.android=function(element){if(!/ons-fab|ons-speed-dial|ons-progress/.test(element.tagName.toLowerCase())&&!/material/.test(element.getAttribute("modifier"))){var oldModifier=element.getAttribute("modifier")||"",newModifier=oldModifier.trim().split(/\s+/).map(function(e){return modifiersMap.hasOwnProperty(e)?modifiersMap[e]:e});newModifier.unshift("material"),element.setAttribute("modifier",newModifier.join(" ").trim())}!/ons-button|ons-list-item|ons-fab|ons-speed-dial|ons-tab$/.test(element.tagName.toLowerCase())||element.hasAttribute("ripple")||util.findChild(element,"ons-ripple")||("ons-list-item"===element.tagName.toLowerCase()?element.hasAttribute("tappable")&&(element.setAttribute("ripple",""),element.removeAttribute("tappable")):element.setAttribute("ripple",""))},platforms.ios=function(element){/material/.test(element.getAttribute("modifier"))&&(util.removeModifier(element,"material"),util.removeModifier(element,"material--flat")&&util.addModifier(element,util.removeModifier(element,"large")?"large--quiet":"quiet"),element.getAttribute("modifier")||element.removeAttribute("modifier")),element.hasAttribute("ripple")&&("ons-list-item"===element.tagName.toLowerCase()&&element.setAttribute("tappable",""),element.removeAttribute("ripple"))};var unlocked={android:!0},prepareAutoStyle=function(element,force){if(autoStyleEnabled&&!element.hasAttribute("disable-auto-styling")){var mobileOS=platform.getMobileOS();platforms.hasOwnProperty(mobileOS)&&(unlocked.hasOwnProperty(mobileOS)||force)&&platforms[mobileOS](element)}},autoStyle={isEnabled:function(){return autoStyleEnabled},enable:function(){return autoStyleEnabled=!0},disable:function(){return autoStyleEnabled=!1},prepare:prepareAutoStyle},generateId=function(){var i=0;return function(){return i++}}(),DoorLock=function(){function DoorLock(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,DoorLock),this._lockList=[],this._waitList=[],this._log=options.log||function(){}}return createClass(DoorLock,[{key:"lock",value:function(){var _this=this,unlock=function unlock(){_this._unlock(unlock)};return unlock.id=generateId(),this._lockList.push(unlock),this._log("lock: "+unlock.id),unlock}},{key:"_unlock",value:function(fn){var index=this._lockList.indexOf(fn);if(index===-1)throw new Error("This function is not registered in the lock list.");this._lockList.splice(index,1),this._log("unlock: "+fn.id),this._tryToFreeWaitList()}},{key:"_tryToFreeWaitList",value:function(){for(;!this.isLocked()&&this._waitList.length>0;)this._waitList.shift()()}},{key:"waitUnlock",value:function(callback){if(!(callback instanceof Function))throw new Error("The callback param must be a function.");this.isLocked()?this._waitList.push(callback):callback()}},{key:"isLocked",value:function(){return this._lockList.length>0}}]),DoorLock}(),PageLoader=function(){function PageLoader(fn){classCallCheck(this,PageLoader),this._loader=fn instanceof Function?fn:loadPage$1}return createClass(PageLoader,[{key:"load",value:function(_ref2,done){var page=_ref2.page,parent=_ref2.parent,_ref2$params=_ref2.params,params=void 0===_ref2$params?{}:_ref2$params,replace=_ref2.replace;this._loader({page:page,parent:parent,params:params,replace:replace},function(result){if(!(result.element instanceof Element))throw Error("target.element must be an instance of Element.");if(!(result.unload instanceof Function))throw Error("target.unload must be an instance of Function.");done(result)},params)}},{key:"internalLoader",set:function(fn){if(!(fn instanceof Function))throw Error("First parameter must be an instance of Function");this._loader=fn},get:function(){return this._loader}}]),PageLoader}(),defaultPageLoader=new PageLoader,instantPageLoader=new PageLoader(function(_ref3,done){var page=_ref3.page,parent=_ref3.parent,replace=(_ref3.params,_ref3.replace);replace&&(util.propagateAction(parent,"_destroy"),parent.innerHTML="");var element=util.createElement(page.trim());parent.appendChild(element),done({element:element,unload:function(){return element.remove()}})}),ons$1={};ons$1._util=util,ons$1._deviceBackButtonDispatcher=deviceBackButtonDispatcher,ons$1._internal=internal$1,ons$1.GestureDetector=GestureDetector,ons$1.platform=platform,ons$1.softwareKeyboard=softwareKeyboard,ons$1.pageAttributeExpression=pageAttributeExpression,ons$1.orientation=orientation,ons$1.notification=notification,ons$1._animationOptionsParser=parse,ons$1._autoStyle=autoStyle,ons$1._DoorLock=DoorLock,ons$1._contentReady=contentReady,ons$1.defaultPageLoader=defaultPageLoader,ons$1.PageLoader=PageLoader,ons$1._readyLock=new DoorLock,ons$1.platform.select((window.location.search.match(/platform=([\w-]+)/)||[])[1]),waitDeviceReady(),ons$1.isReady=function(){return!ons$1._readyLock.isLocked()},ons$1.isWebView=ons$1.platform.isWebView,ons$1.ready=function(callback){ons$1.isReady()?callback():ons$1._readyLock.waitUnlock(callback)},ons$1.setDefaultDeviceBackButtonListener=function(listener){ons$1._defaultDeviceBackButtonHandler.setListener(listener)},ons$1.disableDeviceBackButtonHandler=function(){ons$1._deviceBackButtonDispatcher.disable()},ons$1.enableDeviceBackButtonHandler=function(){ons$1._deviceBackButtonDispatcher.enable()},ons$1.enableAutoStatusBarFill=function(){if(ons$1.isReady())throw new Error("This method must be called before ons.isReady() is true.");ons$1._internal.config.autoStatusBarFill=!0},ons$1.disableAutoStatusBarFill=function(){if(ons$1.isReady())throw new Error("This method must be called before ons.isReady() is true.");ons$1._internal.config.autoStatusBarFill=!1},ons$1.disableAnimations=function(){ons$1._internal.config.animationsDisabled=!0},ons$1.enableAnimations=function(){ons$1._internal.config.animationsDisabled=!1},ons$1.disableAutoStyling=ons$1._autoStyle.disable,ons$1.enableAutoStyling=ons$1._autoStyle.enable,ons$1.forcePlatformStyling=function(newPlatform){ons$1.enableAutoStyling(),ons$1.platform.select(newPlatform||"ios"),ons$1._util.arrayFrom(document.querySelectorAll("*")).forEach(function(element){"ons-if"===element.tagName.toLowerCase()?element._platformUpdate():element.tagName.match(/^ons-/i)&&(ons$1._autoStyle.prepare(element,!0),"ons-tabbar"===element.tagName.toLowerCase()&&element._updatePosition())})},ons$1._createPopoverOriginal=function(page){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!page)throw new Error("Page url must be defined.");return ons$1._internal.getPageHTMLAsync(page).then(function(html){html=html.match(/<ons-popover/gi)?"<div>"+html+"</div>":"<ons-popover>"+html+"</ons-popover>";var div=ons$1._util.createElement("<div>"+html+"</div>"),popover=div.querySelector("ons-popover");return document.body.appendChild(popover),options.link instanceof Function&&options.link(popover),popover})},ons$1.createPopover=ons$1._createPopoverOriginal,ons$1._createDialogOriginal=function(page){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!page)throw new Error("Page url must be defined.");return ons$1._internal.getPageHTMLAsync(page).then(function(html){html=html.match(/<ons-dialog/gi)?"<div>"+html+"</div>":"<ons-dialog>"+html+"</ons-dialog>";var div=ons$1._util.createElement("<div>"+html+"</div>"),dialog=div.querySelector("ons-dialog");return document.body.appendChild(dialog),options.link instanceof Function&&options.link(dialog),dialog})},ons$1.createDialog=ons$1._createDialogOriginal,ons$1._createAlertDialogOriginal=function(page){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!page)throw new Error("Page url must be defined.");return ons$1._internal.getPageHTMLAsync(page).then(function(html){html=html.match(/<ons-alert-dialog/gi)?"<div>"+html+"</div>":"<ons-alert-dialog>"+html+"</ons-alert-dialog>";var div=ons$1._util.createElement("<div>"+html+"</div>"),alertDialog=div.querySelector("ons-alert-dialog");return document.body.appendChild(alertDialog),options.link instanceof Function&&options.link(alertDialog),alertDialog})},ons$1.createAlertDialog=ons$1._createAlertDialogOriginal,ons$1._resolveLoadingPlaceholderOriginal=function(page,link){var elements=ons$1._util.arrayFrom(window.document.querySelectorAll("[ons-loading-placeholder]"));if(!(elements.length>0))throw new Error("No ons-loading-placeholder exists.");elements.filter(function(element){return!element.getAttribute("page")}).forEach(function(element){element.setAttribute("ons-loading-placeholder",page),ons$1._resolveLoadingPlaceholder(element,page,link)})},ons$1.resolveLoadingPlaceholder=ons$1._resolveLoadingPlaceholderOriginal,ons$1._setupLoadingPlaceHolders=function(){ons$1.ready(function(){var elements=ons$1._util.arrayFrom(window.document.querySelectorAll("[ons-loading-placeholder]"));elements.forEach(function(element){var page=element.getAttribute("ons-loading-placeholder");"string"==typeof page&&ons$1._resolveLoadingPlaceholder(element,page)})})},ons$1._resolveLoadingPlaceholder=function(element,page,link){link=link||function(element,done){done()},ons$1._internal.getPageHTMLAsync(page).then(function(html){for(;element.firstChild;)element.removeChild(element.firstChild);var contentElement=ons$1._util.createElement("<div>"+html+"</div>");contentElement.style.display="none",element.appendChild(contentElement),link(contentElement,function(){contentElement.style.display=""})})["catch"](function(error){throw new Error("Unabled to resolve placeholder: "+error)})},window._superSecretOns=ons$1;var BaseElement=function(_getElementClass){function BaseElement(self){var _this,_ret;return classCallCheck(this,BaseElement),self=_this=possibleConstructorReturn(this,(BaseElement.__proto__||Object.getPrototypeOf(BaseElement)).call(this,self)),self.init(),_ret=self,possibleConstructorReturn(_this,_ret)}return inherits(BaseElement,_getElementClass),createClass(BaseElement,[{key:"init",value:function(){}}]),BaseElement}(getElementClass()),TemplateElement=function(_BaseElement){function TemplateElement(){return classCallCheck(this,TemplateElement),possibleConstructorReturn(this,(TemplateElement.__proto__||Object.getPrototypeOf(TemplateElement)).apply(this,arguments))}return inherits(TemplateElement,_BaseElement),createClass(TemplateElement,[{key:"init",value:function(){for(this.template=this.innerHTML;this.firstChild;)this.removeChild(this.firstChild)}},{key:"connectedCallback",value:function(){var event=new CustomEvent("_templateloaded",{bubbles:!0,cancelable:!0});event.template=this.template,event.templateId=this.getAttribute("id"),this.dispatchEvent(event)}}]),TemplateElement}(BaseElement);customElements.define("ons-template",TemplateElement);var IfElement=function(_BaseElement){function IfElement(){return classCallCheck(this,IfElement),possibleConstructorReturn(this,(IfElement.__proto__||Object.getPrototypeOf(IfElement)).apply(this,arguments))}return inherits(IfElement,_BaseElement),createClass(IfElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){if(null!==platform._renderPlatform)_this2._platformUpdate();else if(!_this2._isAllowedPlatform()){for(;_this2.childNodes[0];)_this2.childNodes[0].remove();_this2._platformUpdate()}}),this._onOrientationChange()}},{key:"connectedCallback",value:function(){orientation.on("change",this._onOrientationChange.bind(this))}},{key:"attributeChangedCallback",value:function(name){"orientation"===name&&this._onOrientationChange()}},{key:"disconnectedCallback",value:function(){orientation.off("change",this._onOrientationChange)}},{key:"_platformUpdate",value:function(){this.style.display=this._isAllowedPlatform()?"":"none"}},{key:"_isAllowedPlatform",value:function(){return!this.getAttribute("platform")||this.getAttribute("platform").split(/\s+/).indexOf(platform.getMobileOS())>=0}},{key:"_onOrientationChange",value:function(){if(this.hasAttribute("orientation")&&this._isAllowedPlatform()){var conditionalOrientation=this.getAttribute("orientation").toLowerCase(),currentOrientation=orientation.isPortrait()?"portrait":"landscape";this.style.display=conditionalOrientation===currentOrientation?"":"none"}}}],[{key:"observedAttributes",get:function(){return["orientation"]}}]),IfElement}(BaseElement);customElements.define("ons-if",IfElement);var AlertDialogAnimator=function(){function AlertDialogAnimator(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$timing=_ref.timing,timing=void 0===_ref$timing?"linear":_ref$timing,_ref$delay=_ref.delay,delay=void 0===_ref$delay?0:_ref$delay,_ref$duration=_ref.duration,duration=void 0===_ref$duration?.2:_ref$duration;classCallCheck(this,AlertDialogAnimator),this.timing=timing,this.delay=delay,this.duration=duration}return createClass(AlertDialogAnimator,[{key:"show",value:function(dialog,done){done()}},{key:"hide",value:function(dialog,done){done()}}]),AlertDialogAnimator}(),AndroidAlertDialogAnimator=function(_AlertDialogAnimator){function AndroidAlertDialogAnimator(){var _ref2=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref2$timing=_ref2.timing,timing=void 0===_ref2$timing?"cubic-bezier(.1, .7, .4, 1)":_ref2$timing,_ref2$duration=_ref2.duration,duration=void 0===_ref2$duration?.2:_ref2$duration,_ref2$delay=_ref2.delay,delay=void 0===_ref2$delay?0:_ref2$delay;return classCallCheck(this,AndroidAlertDialogAnimator),possibleConstructorReturn(this,(AndroidAlertDialogAnimator.__proto__||Object.getPrototypeOf(AndroidAlertDialogAnimator)).call(this,{duration:duration,timing:timing,delay:delay}))}return inherits(AndroidAlertDialogAnimator,_AlertDialogAnimator),createClass(AndroidAlertDialogAnimator,[{key:"show",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(0.9, 0.9, 1.0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}},{key:"hide",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(0.9, 0.9, 1.0)",opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}}]),AndroidAlertDialogAnimator}(AlertDialogAnimator),IOSAlertDialogAnimator=function(_AlertDialogAnimator2){function IOSAlertDialogAnimator(){var _ref3=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref3$timing=_ref3.timing,timing=void 0===_ref3$timing?"cubic-bezier(.1, .7, .4, 1)":_ref3$timing,_ref3$duration=_ref3.duration,duration=void 0===_ref3$duration?.2:_ref3$duration,_ref3$delay=_ref3.delay,delay=void 0===_ref3$delay?0:_ref3$delay;return classCallCheck(this,IOSAlertDialogAnimator),possibleConstructorReturn(this,(IOSAlertDialogAnimator.__proto__||Object.getPrototypeOf(IOSAlertDialogAnimator)).call(this,{duration:duration,timing:timing,delay:delay}))}return inherits(IOSAlertDialogAnimator,_AlertDialogAnimator2),createClass(IOSAlertDialogAnimator,[{key:"show",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.3, 1.3, 1.0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}},{key:"hide",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{opacity:1},duration:0}).wait(this.delay).queue({css:{opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}}]),IOSAlertDialogAnimator}(AlertDialogAnimator),scheme={".alert-dialog":"alert-dialog--*",".alert-dialog-container":"alert-dialog-container--*",".alert-dialog-title":"alert-dialog-title--*",".alert-dialog-content":"alert-dialog-content--*",".alert-dialog-footer":"alert-dialog-footer--*",".alert-dialog-button":"alert-dialog-button--*",".alert-dialog-footer--one":"alert-dialog-footer--one--*",".alert-dialog-button--one":"alert-dialog-button--one--*",".alert-dialog-button--primal":"alert-dialog-button--primal--*",".alert-dialog-mask":"alert-dialog-mask--*",".text-input":"text-input--*"},_animatorDict={none:AlertDialogAnimator,"default":function(){return platform.isAndroid()?AndroidAlertDialogAnimator:IOSAlertDialogAnimator},fade:function(){return platform.isAndroid()?AndroidAlertDialogAnimator:IOSAlertDialogAnimator}},AlertDialogElement=function(_BaseElement){function AlertDialogElement(){return classCallCheck(this,AlertDialogElement),possibleConstructorReturn(this,(AlertDialogElement.__proto__||Object.getPrototypeOf(AlertDialogElement)).apply(this,arguments))}return inherits(AlertDialogElement,_BaseElement),createClass(AlertDialogElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){return _this2._compile()}),this._visible=!1,this._doorLock=new DoorLock,this._boundCancel=this._cancel.bind(this),this._updateAnimatorFactory()}},{key:"_updateAnimatorFactory",value:function(){this._animatorFactory=new AnimatorFactory({animators:_animatorDict,baseClass:AlertDialogAnimator,baseClassName:"AlertDialogAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){autoStyle.prepare(this),this.style.display="none";var content=document.createDocumentFragment();if(!this._mask&&!this._dialog)for(;this.firstChild;)content.appendChild(this.firstChild);if(!this._mask){var mask=document.createElement("div");mask.classList.add("alert-dialog-mask"),this.insertBefore(mask,this.children[0])}if(!this._dialog){var dialog=document.createElement("div");dialog.classList.add("alert-dialog"),this.insertBefore(dialog,null)}if(!util.findChild(this._dialog,".alert-dialog-container")){var container=document.createElement("div");container.classList.add("alert-dialog-container"),this._dialog.appendChild(container)}this._dialog.children[0].appendChild(content),this._dialog.style.zIndex=20001,this._mask.style.zIndex=2e4,this.getAttribute("mask-color")&&(this._mask.style.backgroundColor=this.getAttribute("mask-color")),ModifierUtil.initModifier(this,scheme)}},{key:"show",value:function(){var _this3=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_cancel2=!1,callback=options.callback||function(){};if(options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options"))),util.triggerElementEvent(this,"preshow",{alertDialog:this,cancel:function(){_cancel2=!0}}),_cancel2)return Promise.reject("Canceled in preshow event.");var _ret=function(){var tryShow=function(){var unlock=_this3._doorLock.lock(),animator=_this3._animatorFactory.newAnimator(options);return _this3.style.display="block",_this3._mask.style.opacity="1",new Promise(function(resolve){contentReady(_this3,function(){animator.show(_this3,function(){_this3._visible=!0,unlock(),util.triggerElementEvent(_this3,"postshow",{alertDialog:_this3}),callback(),resolve(_this3)})})})};return{v:new Promise(function(resolve){_this3._doorLock.waitUnlock(function(){return resolve(tryShow())})})}}();return"object"===("undefined"==typeof _ret?"undefined":_typeof(_ret))?_ret.v:void 0}},{key:"hide",value:function(){var _this4=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_cancel3=!1,callback=options.callback||function(){};if(options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options"))),util.triggerElementEvent(this,"prehide",{alertDialog:this,cancel:function(){_cancel3=!0}}),_cancel3)return Promise.reject("Canceled in prehide event.");var _ret2=function(){var tryHide=function(){var unlock=_this4._doorLock.lock(),animator=_this4._animatorFactory.newAnimator(options);return new Promise(function(resolve){contentReady(_this4,function(){animator.hide(_this4,function(){_this4.style.display="none",_this4._visible=!1,unlock(),util.triggerElementEvent(_this4,"posthide",{alertDialog:_this4}),callback(),resolve(_this4)})})})};return{v:new Promise(function(resolve){_this4._doorLock.waitUnlock(function(){return resolve(tryHide())})})}}();return"object"===("undefined"==typeof _ret2?"undefined":_typeof(_ret2))?_ret2.v:void 0}},{key:"_cancel",value:function(){var _this5=this;this.cancelable&&!this._running&&(this._running=!0,this.hide().then(function(){_this5._running=!1,util.triggerElementEvent(_this5,"dialog-cancel")},function(){return _this5._running=!1}))}},{key:"connectedCallback",value:function(){var _this6=this;this.onDeviceBackButton=function(e){return _this6.cancelable?_this6._cancel():e.callParentHandler()},contentReady(this,function(){_this6._mask.addEventListener("click",_this6._boundCancel,!1)})}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null,this._mask.removeEventListener("click",this._boundCancel.bind(this),!1)}},{key:"attributeChangedCallback",value:function(name,last,current){return"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme):void("animation"===name&&this._updateAnimatorFactory())}},{key:"_mask",get:function(){return util.findChild(this,".alert-dialog-mask")}},{key:"_dialog",get:function(){return util.findChild(this,".alert-dialog")}},{key:"_titleElement",get:function(){return util.findChild(this._dialog.children[0],".alert-dialog-title")}},{key:"_contentElement",get:function(){return util.findChild(this._dialog.children[0],".alert-dialog-content")}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}},{key:"cancelable",set:function(value){return util.toggleAttribute(this,"cancelable",value)},get:function(){return this.hasAttribute("cancelable")}},{key:"visible",get:function(){return this._visible}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(callback){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,callback)}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator.prototype instanceof AlertDialogAnimator))throw new Error('"Animator" param must inherit OnsAlertDialogElement.AlertDialogAnimator');_animatorDict[name]=Animator}},{key:"observedAttributes",get:function(){return["modifier","animation"]}},{key:"AlertDialogAnimator",get:function(){return AlertDialogAnimator}}]),AlertDialogElement}(BaseElement);customElements.define("ons-alert-dialog",AlertDialogElement);var scheme$1={"":"back-button--*",".back-button__icon":"back-button--*__icon",".back-button__label":"back-button--*__label"},BackButtonElement=function(_BaseElement){function BackButtonElement(){return classCallCheck(this,BackButtonElement),possibleConstructorReturn(this,(BackButtonElement.__proto__||Object.getPrototypeOf(BackButtonElement)).apply(this,arguments))}return inherits(BackButtonElement,_BaseElement),createClass(BackButtonElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile()}),this._options={},this._boundOnClick=this._onClick.bind(this)}},{key:"_compile",value:function(){if(autoStyle.prepare(this),this.classList.add("back-button"),!util.findChild(this,".back-button__label")){for(var label=util.create("span.back-button__label");this.childNodes[0];)label.appendChild(this.childNodes[0]);this.appendChild(label)}if(!util.findChild(this,".back-button__icon")){var icon=util.create("span.back-button__icon");this.insertBefore(icon,this.children[0])}ModifierUtil.initModifier(this,scheme$1)}},{key:"_onClick",value:function(){if(this.onClick)this.onClick.apply(this);else{var navigator=util.findParent(this,"ons-navigator");navigator&&navigator.popPage(this.options)}}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick,!1)}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$1)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1)}},{key:"show",value:function(){this.style.display="inline-block"}},{key:"hide",value:function(){this.style.display="none"}},{key:"options",get:function(){return this._options},set:function(object){this._options=object}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),BackButtonElement}(BaseElement);customElements.define("ons-back-button",BackButtonElement);var scheme$2={"":"bottom-bar--*"},BottomToolbarElement=function(_BaseElement){function BottomToolbarElement(){return classCallCheck(this,BottomToolbarElement),possibleConstructorReturn(this,(BottomToolbarElement.__proto__||Object.getPrototypeOf(BottomToolbarElement)).apply(this,arguments))}return inherits(BottomToolbarElement,_BaseElement),createClass(BottomToolbarElement,[{key:"init",value:function(){this.classList.add("bottom-bar"),ModifierUtil.initModifier(this,scheme$2)}},{key:"connectedCallback",value:function(){util.match(this.parentNode,"ons-page")&&this.parentNode.classList.add("page-with-bottom-toolbar")}},{key:"attributeChangedCallback",value:function(name,last,current){"modifier"===name&&ModifierUtil.onModifierChanged(last,current,this,scheme$2);
7}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),BottomToolbarElement}(BaseElement);customElements.define("ons-bottom-toolbar",BottomToolbarElement);var scheme$3={"":"button--*"},ButtonElement=function(_BaseElement){function ButtonElement(){return classCallCheck(this,ButtonElement),possibleConstructorReturn(this,(ButtonElement.__proto__||Object.getPrototypeOf(ButtonElement)).apply(this,arguments))}return inherits(ButtonElement,_BaseElement),createClass(ButtonElement,[{key:"init",value:function(){this._compile()}},{key:"attributeChangedCallback",value:function(name,last,current){switch(name){case"modifier":ModifierUtil.onModifierChanged(last,current,this,scheme$3);break;case"ripple":this._updateRipple()}}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("button"),this._updateRipple(),ModifierUtil.initModifier(this,scheme$3)}},{key:"_updateRipple",value:function(){util.updateRipple(this)}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["modifier","ripple"]}}]),ButtonElement}(BaseElement);customElements.define("ons-button",ButtonElement);var scheme$4={"":"carousel-item--*"},CarouselItemElement=function(_BaseElement){function CarouselItemElement(){return classCallCheck(this,CarouselItemElement),possibleConstructorReturn(this,(CarouselItemElement.__proto__||Object.getPrototypeOf(CarouselItemElement)).apply(this,arguments))}return inherits(CarouselItemElement,_BaseElement),createClass(CarouselItemElement,[{key:"init",value:function(){this.style.width="100%",ModifierUtil.initModifier(this,scheme$4)}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$4)}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),CarouselItemElement}(BaseElement);customElements.define("ons-carousel-item",CarouselItemElement);var VerticalModeTrait={_getScrollDelta:function(event){return event.gesture.deltaY},_getScrollVelocity:function(event){return event.gesture.velocityY},_getElementSize:function(){return this._currentElementSize||(this._currentElementSize=this.getBoundingClientRect().height),this._currentElementSize},_generateScrollTransform:function(scroll){return"translate3d(0px, "+-scroll+"px, 0px)"},_updateDimensionData:function(){this._style=window.getComputedStyle(this),this._dimensions=this.getBoundingClientRect()},_updateOffset:function(){if(this.centered){var height=(this._dimensions.height||0)-parseInt(this._style.paddingTop,10)-parseInt(this._style.paddingBottom,10);this._offset=-(height-this._getCarouselItemSize())/2}},_layoutCarouselItems:function(){for(var children=this._getCarouselItemElements(),sizeAttr=this._getCarouselItemSizeAttr(),sizeInfo=this._decomposeSizeString(sizeAttr),i=0;i<children.length;i++)children[i].style.position="absolute",children[i].style.height=sizeAttr,children[i].style.visibility="visible",children[i].style.top=i*sizeInfo.number+sizeInfo.unit},_setup:function(){this._updateDimensionData(),this._updateOffset(),this._layoutCarouselItems()}},HorizontalModeTrait={_getScrollDelta:function(event){return event.gesture.deltaX},_getScrollVelocity:function(event){return event.gesture.velocityX},_getElementSize:function(){return this._currentElementSize||(this._currentElementSize=this.getBoundingClientRect().width),this._currentElementSize},_generateScrollTransform:function(scroll){return"translate3d("+-scroll+"px, 0px, 0px)"},_updateDimensionData:function(){this._style=window.getComputedStyle(this),this._dimensions=this.getBoundingClientRect()},_updateOffset:function(){if(this.centered){var width=(this._dimensions.width||0)-parseInt(this._style.paddingLeft,10)-parseInt(this._style.paddingRight,10);this._offset=-(width-this._getCarouselItemSize())/2}},_layoutCarouselItems:function(){for(var children=this._getCarouselItemElements(),sizeAttr=this._getCarouselItemSizeAttr(),sizeInfo=this._decomposeSizeString(sizeAttr),i=0;i<children.length;i++)children[i].style.position="absolute",children[i].style.width=sizeAttr,children[i].style.visibility="visible",children[i].style.left=i*sizeInfo.number+sizeInfo.unit},_setup:function(){this._updateDimensionData(),this._updateOffset(),this._layoutCarouselItems()}},CarouselElement=function(_BaseElement){function CarouselElement(){return classCallCheck(this,CarouselElement),possibleConstructorReturn(this,(CarouselElement.__proto__||Object.getPrototypeOf(CarouselElement)).apply(this,arguments))}return inherits(CarouselElement,_BaseElement),createClass(CarouselElement,[{key:"init",value:function(){this._doorLock=new DoorLock,this._scroll=0,this._offset=0,this._lastActiveIndex=0,this._boundOnDrag=this._onDrag.bind(this),this._boundOnDragEnd=this._onDragEnd.bind(this),this._boundOnResize=this._onResize.bind(this),this._mixin(this._isVertical()?VerticalModeTrait:HorizontalModeTrait)}},{key:"_onResize",value:function(){var i=this._scroll/this._currentElementSize;delete this._currentElementSize,this.setActiveIndex(i)}},{key:"_onDirectionChange",value:function(){this._isVertical()?(this.style.overflowX="auto",this.style.overflowY=""):(this.style.overflowX="",this.style.overflowY="auto"),this.refresh()}},{key:"_saveLastState",value:function(){this._lastState={elementSize:this._getCarouselItemSize(),carouselElementCount:this.itemCount,width:this._getCarouselItemSize()*this.itemCount}}},{key:"_getCarouselItemSize",value:function(){var sizeAttr=this._getCarouselItemSizeAttr(),sizeInfo=this._decomposeSizeString(sizeAttr),elementSize=this._getElementSize();if("%"===sizeInfo.unit)return Math.round(sizeInfo.number/100*elementSize);if("px"===sizeInfo.unit)return sizeInfo.number;throw new Error("Invalid state")}},{key:"_getInitialIndex",value:function(){var index=parseInt(this.getAttribute("initial-index"),10);return"number"!=typeof index||isNaN(index)?0:Math.max(Math.min(index,this.itemCount-1),0)}},{key:"_getCarouselItemSizeAttr",value:function(){var attrName="item-"+(this._isVertical()?"height":"width"),itemSizeAttr=(""+this.getAttribute(attrName)).trim();return itemSizeAttr.match(/^\d+(px|%)$/)?itemSizeAttr:"100%"}},{key:"_decomposeSizeString",value:function(size){var matches=size.match(/^(\d+)(px|%)/);return{number:parseInt(matches[1],10),unit:matches[2]}}},{key:"_setupInitialIndex",value:function(){this._scroll=(this._offset||0)+this._getCarouselItemSize()*this._getInitialIndex(),this._lastActiveIndex=this._getInitialIndex(),this._scrollTo(this._scroll)}},{key:"setActiveIndex",value:function(index){var _this2=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(options&&"object"!=("undefined"==typeof options?"undefined":_typeof(options)))throw new Error("options must be an object. You supplied "+options);options.animationOptions=util.extend({duration:.3,timing:"cubic-bezier(.1, .7, .1, 1)"},options.animationOptions||{},this.hasAttribute("animation-options")?util.animationOptionsParse(this.getAttribute("animation-options")):{}),index=Math.max(0,Math.min(index,this.itemCount-1));var scroll=(this._offset||0)+this._getCarouselItemSize()*index,max=this._calculateMaxScroll();return this._scroll=Math.max(0,Math.min(max,scroll)),this._scrollTo(this._scroll,options).then(function(){return _this2._tryFirePostChangeEvent(),_this2})}},{key:"getActiveIndex",value:function(){var scroll=this._scroll-(this._offset||0),count=this.itemCount,size=this._getCarouselItemSize();if(scroll<0)return 0;var i=void 0;for(i=0;i<count;i++)if(size*i<=scroll&&size*(i+1)>scroll)return i;return i}},{key:"next",value:function(options){return this.setActiveIndex(this.getActiveIndex()+1,options)}},{key:"prev",value:function(options){return this.setActiveIndex(this.getActiveIndex()-1,options)}},{key:"_isEnabledChangeEvent",value:function(){var elementSize=this._getElementSize(),carouselItemSize=this._getCarouselItemSize();return this.autoScroll&&Math.abs(elementSize-carouselItemSize)<.5}},{key:"_isVertical",value:function(){return"vertical"===this.getAttribute("direction")}},{key:"_prepareEventListeners",value:function(){var _this3=this;this._gestureDetector=new GestureDetector(this,{dragMinDistance:1,dragLockToAxis:!0}),this._mutationObserver=new MutationObserver(function(){return _this3.refresh()}),this._updateSwipeable(),this._updateAutoRefresh(),window.addEventListener("resize",this._boundOnResize,!0)}},{key:"_removeEventListeners",value:function(){this._gestureDetector.dispose(),this._gestureDetector=null,this._mutationObserver.disconnect(),this._mutationObserver=null,window.removeEventListener("resize",this._boundOnResize,!0)}},{key:"_updateSwipeable",value:function(){this._gestureDetector&&(this.swipeable?(this._gestureDetector.on("drag dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown",this._boundOnDrag),this._gestureDetector.on("dragend",this._boundOnDragEnd)):(this._gestureDetector.off("drag dragleft dragright dragup dragdown swipe swipeleft swiperight swipeup swipedown",this._boundOnDrag),this._gestureDetector.off("dragend",this._boundOnDragEnd)))}},{key:"_updateAutoRefresh",value:function(){this._mutationObserver&&(this.hasAttribute("auto-refresh")?this._mutationObserver.observe(this,{childList:!0}):this._mutationObserver.disconnect())}},{key:"_tryFirePostChangeEvent",value:function(){var currentIndex=this.getActiveIndex();if(this._lastActiveIndex!==currentIndex){var lastActiveIndex=this._lastActiveIndex;this._lastActiveIndex=currentIndex,util.triggerElementEvent(this,"postchange",{carousel:this,activeIndex:currentIndex,lastActiveIndex:lastActiveIndex})}}},{key:"_isWrongDirection",value:function(d){return this._isVertical()?"left"===d||"right"===d:"up"===d||"down"===d}},{key:"_onDrag",value:function(event){if(!this._isWrongDirection(event.gesture.direction)){event.stopPropagation(),this._lastDragEvent=event;var scroll=this._scroll-this._getScrollDelta(event);this._scrollTo(scroll),event.gesture.preventDefault(),this._tryFirePostChangeEvent()}}},{key:"_onDragEnd",value:function(event){var _this4=this;if(this._lastDragEvent){if(this._currentElementSize=void 0,this._scroll=this._scroll-this._getScrollDelta(event),this._isOverScroll(this._scroll)){var waitForAction=!1;util.triggerElementEvent(this,"overscroll",{carousel:this,activeIndex:this.getActiveIndex(),direction:this._getOverScrollDirection(),waitToReturn:function(promise){waitForAction=!0,promise.then(function(){return _this4._scrollToKillOverScroll()})}}),waitForAction||this._scrollToKillOverScroll()}else this._startMomentumScroll();this._lastDragEvent=null,event.gesture.preventDefault()}}},{key:"_mixin",value:function(trait){Object.keys(trait).forEach(function(key){this[key]=trait[key]}.bind(this))}},{key:"_startMomentumScroll",value:function(){if(this._lastDragEvent){var velocity=this._getScrollVelocity(this._lastDragEvent),duration=.3,scrollDelta=100*duration*velocity,scroll=this._normalizeScrollPosition(this._scroll+(this._getScrollDelta(this._lastDragEvent)>0?-scrollDelta:scrollDelta));this._scroll=scroll,animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(this._scroll)},{duration:duration,timing:"cubic-bezier(.1, .7, .1, 1)"}).queue(function(done){done(),this._tryFirePostChangeEvent()}.bind(this)).play()}}},{key:"_normalizeScrollPosition",value:function(scroll){var max=this._calculateMaxScroll();if(!this.autoScroll)return Math.max(0,Math.min(max,scroll));for(var arr=[],size=this._getCarouselItemSize(),nbrOfItems=this.itemCount,i=0;i<nbrOfItems;i++)i*size+this._offset<max&&arr.push(i*size+this._offset);arr.push(max),arr.sort(function(left,right){return left=Math.abs(left-scroll),right=Math.abs(right-scroll),left-right}),arr=arr.filter(function(item,pos){return!pos||item!=arr[pos-1]});var lastScroll=this._lastActiveIndex*size+this._offset,scrollRatio=Math.abs(scroll-lastScroll)/size,result=arr[0];return scrollRatio<=this.autoScrollRatio?result=lastScroll:scrollRatio<1&&arr[0]===lastScroll&&arr.length>1&&(result=arr[1]),Math.max(0,Math.min(max,result))}},{key:"_getCarouselItemElements",value:function(){return util.arrayFrom(this.children).filter(function(child){return"ons-carousel-item"===child.nodeName.toLowerCase()})}},{key:"_scrollTo",value:function(scroll){var _this5=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},isOverscrollable=this.overscrollable,normalizeScroll=function(scroll){var ratio=.35;if(scroll<0)return isOverscrollable?Math.round(scroll*ratio):0;var maxScroll=_this5._calculateMaxScroll();return maxScroll<scroll?isOverscrollable?maxScroll+Math.round((scroll-maxScroll)*ratio):maxScroll:scroll};return new Promise(function(resolve){animit(_this5._getCarouselItemElements()).queue({transform:_this5._generateScrollTransform(normalizeScroll(scroll))},"none"!==options.animation?options.animationOptions:{}).play(function(){options.callback instanceof Function&&options.callback(),resolve()})})}},{key:"_calculateMaxScroll",value:function(){var max=this.itemCount*this._getCarouselItemSize()-this._getElementSize();return Math.ceil(max<0?0:max)}},{key:"_isOverScroll",value:function(scroll){return scroll<0||scroll>this._calculateMaxScroll()}},{key:"_getOverScrollDirection",value:function(){return this._isVertical()?this._scroll<=0?"up":"down":this._scroll<=0?"left":"right"}},{key:"_scrollToKillOverScroll",value:function(){var duration=.4;if(this._scroll<0)return animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(0)},{duration:duration,timing:"cubic-bezier(.1, .4, .1, 1)"}).queue(function(done){done(),this._tryFirePostChangeEvent()}.bind(this)).play(),void(this._scroll=0);var maxScroll=this._calculateMaxScroll();return maxScroll<this._scroll?(animit(this._getCarouselItemElements()).queue({transform:this._generateScrollTransform(maxScroll)},{duration:duration,timing:"cubic-bezier(.1, .4, .1, 1)"}).queue(function(done){done(),this._tryFirePostChangeEvent()}.bind(this)).play(),void(this._scroll=maxScroll)):void 0}},{key:"refresh",value:function(){if(0!==this._getCarouselItemSize()){if(this._mixin(this._isVertical()?VerticalModeTrait:HorizontalModeTrait),this._setup(),this._lastState&&this._lastState.width>0){var scroll=this._scroll;this._isOverScroll(scroll)?this._scrollToKillOverScroll():(this.autoScroll&&(scroll=this._normalizeScrollPosition(scroll)),this._scrollTo(scroll))}this._saveLastState(),util.triggerElementEvent(this,"refresh",{carousel:this})}}},{key:"first",value:function(options){return this.setActiveIndex(0,options)}},{key:"last",value:function(options){this.setActiveIndex(Math.max(this.itemCount-1,0),options)}},{key:"connectedCallback",value:function(){var _this6=this;this._prepareEventListeners(),this._setup(),this._setupInitialIndex(),this._saveLastState(),0===this.offsetHeight&&setImmediate(function(){return _this6.refresh()})}},{key:"attributeChangedCallback",value:function(name,last,current){switch(name){case"swipeable":this._updateSwipeable();break;case"auto-refresh":this._updateAutoRefresh();break;case"direction":this._onDirectionChange()}}},{key:"disconnectedCallback",value:function(){this._removeEventListeners()}},{key:"itemCount",get:function(){return this._getCarouselItemElements().length}},{key:"autoScrollRatio",get:function(){var attr=this.getAttribute("auto-scroll-ratio");if(!attr)return.5;var scrollRatio=parseFloat(attr);if(scrollRatio<0||scrollRatio>1)throw new Error("Invalid ratio.");return isNaN(scrollRatio)?.5:scrollRatio},set:function(ratio){if(ratio<0||ratio>1)throw new Error("Invalid ratio.");this.setAttribute("auto-scroll-ratio",ratio)}},{key:"swipeable",get:function(){return this.hasAttribute("swipeable")},set:function(value){return util.toggleAttribute(this,"swipeable",value)}},{key:"autoScroll",get:function(){return this.hasAttribute("auto-scroll")},set:function(value){return util.toggleAttribute(this,"auto-scroll",value)}},{key:"disabled",get:function(){return this.hasAttribute("disabled")},set:function(value){return util.toggleAttribute(this,"disabled",value)}},{key:"overscrollable",get:function(){return this.hasAttribute("overscrollable")},set:function(value){return util.toggleAttribute(this,"overscrollable",value)}},{key:"centered",get:function(){return this.hasAttribute("centered")},set:function(value){return util.toggleAttribute(this,"centered",value)}}],[{key:"observedAttributes",get:function(){return["swipeable","auto-refresh","direction"]}}]),CarouselElement}(BaseElement);customElements.define("ons-carousel",CarouselElement);var ColElement=function(_BaseElement){function ColElement(){return classCallCheck(this,ColElement),possibleConstructorReturn(this,(ColElement.__proto__||Object.getPrototypeOf(ColElement)).apply(this,arguments))}return inherits(ColElement,_BaseElement),createClass(ColElement,[{key:"init",value:function(){this.getAttribute("width")&&this._updateWidth()}},{key:"attributeChangedCallback",value:function(name,last,current){"width"===name&&this._updateWidth()}},{key:"_updateWidth",value:function(){var width=this.getAttribute("width");"string"==typeof width&&(width=(""+width).trim(),width=width.match(/^\d+$/)?width+"%":width,this.style.webkitBoxFlex="0",this.style.webkitFlex="0 0 "+width,this.style.mozBoxFlex="0",this.style.mozFlex="0 0 "+width,this.style.msFlex="0 0 "+width,this.style.flex="0 0 "+width,this.style.maxWidth=width)}}],[{key:"observedAttributes",get:function(){return["width"]}}]),ColElement}(BaseElement);customElements.define("ons-col",ColElement);var DialogAnimator=function(){function DialogAnimator(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref$timing=_ref.timing,timing=void 0===_ref$timing?"linear":_ref$timing,_ref$delay=_ref.delay,delay=void 0===_ref$delay?0:_ref$delay,_ref$duration=_ref.duration,duration=void 0===_ref$duration?.2:_ref$duration;classCallCheck(this,DialogAnimator),this.timing=timing,this.delay=delay,this.duration=duration}return createClass(DialogAnimator,[{key:"show",value:function(dialog,done){done()}},{key:"hide",value:function(dialog,done){done()}}]),DialogAnimator}(),AndroidDialogAnimator=function(_DialogAnimator){function AndroidDialogAnimator(){var _ref2=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref2$timing=_ref2.timing,timing=void 0===_ref2$timing?"ease-in-out":_ref2$timing,_ref2$delay=_ref2.delay,delay=void 0===_ref2$delay?0:_ref2$delay,_ref2$duration=_ref2.duration,duration=void 0===_ref2$duration?.3:_ref2$duration;return classCallCheck(this,AndroidDialogAnimator),possibleConstructorReturn(this,(AndroidDialogAnimator.__proto__||Object.getPrototypeOf(AndroidDialogAnimator)).call(this,{timing:timing,delay:delay,duration:duration}))}return inherits(AndroidDialogAnimator,_DialogAnimator),createClass(AndroidDialogAnimator,[{key:"show",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -60%, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}},{key:"hide",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -60%, 0)",opacity:0},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}}]),AndroidDialogAnimator}(DialogAnimator),IOSDialogAnimator=function(_DialogAnimator2){function IOSDialogAnimator(){var _ref3=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref3$timing=_ref3.timing,timing=void 0===_ref3$timing?"ease-in-out":_ref3$timing,_ref3$delay=_ref3.delay,delay=void 0===_ref3$delay?0:_ref3$delay,_ref3$duration=_ref3.duration,duration=void 0===_ref3$duration?.3:_ref3$duration;return classCallCheck(this,IOSDialogAnimator),possibleConstructorReturn(this,(IOSDialogAnimator.__proto__||Object.getPrototypeOf(IOSDialogAnimator)).call(this,{timing:timing,delay:delay,duration:duration}))}return inherits(IOSDialogAnimator,_DialogAnimator2),createClass(IOSDialogAnimator,[{key:"show",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, 300%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, -50%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}},{key:"hide",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3d(-50%, -50%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(-50%, 300%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}}]),IOSDialogAnimator}(DialogAnimator),SlideDialogAnimator=function(_DialogAnimator3){function SlideDialogAnimator(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_ref4$timing=_ref4.timing,timing=void 0===_ref4$timing?"cubic-bezier(.1, .7, .4, 1)":_ref4$timing,_ref4$delay=_ref4.delay,delay=void 0===_ref4$delay?0:_ref4$delay,_ref4$duration=_ref4.duration,duration=void 0===_ref4$duration?.2:_ref4$duration;return classCallCheck(this,SlideDialogAnimator),possibleConstructorReturn(this,(SlideDialogAnimator.__proto__||Object.getPrototypeOf(SlideDialogAnimator)).call(this,{timing:timing,delay:delay,duration:duration}))}return inherits(SlideDialogAnimator,_DialogAnimator3),createClass(SlideDialogAnimator,[{key:"show",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3D(-50%, -350%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(-50%, -50%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}},{key:"hide",value:function(dialog,callback){callback=callback?callback:function(){},animit.runAll(animit(dialog._mask).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}),animit(dialog._dialog).saveStyle().queue({css:{transform:"translate3D(-50%, -50%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(-50%, -350%, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}}]),SlideDialogAnimator}(DialogAnimator),scheme$5={".dialog":"dialog--*",".dialog-container":"dialog-container--*",".dialog-mask":"dialog-mask--*"},_animatorDict$1={"default":function(){return platform.isAndroid()?AndroidDialogAnimator:IOSDialogAnimator},slide:SlideDialogAnimator,none:DialogAnimator},DialogElement=function(_BaseElement){function DialogElement(){return classCallCheck(this,DialogElement),possibleConstructorReturn(this,(DialogElement.__proto__||Object.getPrototypeOf(DialogElement)).apply(this,arguments))}return inherits(DialogElement,_BaseElement),createClass(DialogElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){return _this2._compile()}),this._visible=!1,this._doorLock=new DoorLock,this._boundCancel=this._cancel.bind(this),this._updateAnimatorFactory()}},{key:"_updateAnimatorFactory",value:function(){this._animatorFactory=new AnimatorFactory({animators:_animatorDict$1,baseClass:DialogAnimator,baseClassName:"DialogAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){if(autoStyle.prepare(this),this.style.display="none",!this._dialog){var dialog=document.createElement("div");dialog.classList.add("dialog");var container=document.createElement("div");for(dialog.classList.add("dialog-container"),dialog.appendChild(container);this.firstChild;)container.appendChild(this.firstChild);this.appendChild(dialog)}if(!this._mask){var mask=document.createElement("div");mask.classList.add("dialog-mask"),this.insertBefore(mask,this.firstChild)}this._dialog.style.zIndex=20001,this._mask.style.zIndex=2e4,this.setAttribute("status-bar-fill",""),ModifierUtil.initModifier(this,scheme$5)}},{key:"_cancel",value:function(){var _this3=this;this.cancelable&&!this._running&&(this._running=!0,this.hide().then(function(){_this3._running=!1,util.triggerElementEvent(_this3,"dialog-cancel")},function(){return _this3._running=!1}))}},{key:"show",value:function(){var _this4=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_cancel2=!1,callback=options.callback||function(){};if(options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options"))),util.triggerElementEvent(this,"preshow",{dialog:this,cancel:function(){_cancel2=!0}}),_cancel2)return Promise.reject("Canceled in preshow event.");var _ret=function(){var tryShow=function(){var unlock=_this4._doorLock.lock(),animator=_this4._animatorFactory.newAnimator(options);return _this4.style.display="block",_this4._mask.style.opacity="1",new Promise(function(resolve){contentReady(_this4,function(){animator.show(_this4,function(){_this4._visible=!0,unlock(),util.triggerElementEvent(_this4,"postshow",{dialog:_this4}),callback(),resolve(_this4)})})})};return{v:new Promise(function(resolve){_this4._doorLock.waitUnlock(function(){return resolve(tryShow())})})}}();return"object"===("undefined"==typeof _ret?"undefined":_typeof(_ret))?_ret.v:void 0}},{key:"hide",value:function(){var _this5=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_cancel3=!1,callback=options.callback||function(){};if(options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options"))),util.triggerElementEvent(this,"prehide",{dialog:this,cancel:function(){_cancel3=!0}}),_cancel3)return Promise.reject("Canceled in prehide event.");var _ret2=function(){var tryHide=function(){var unlock=_this5._doorLock.lock(),animator=_this5._animatorFactory.newAnimator(options);return new Promise(function(resolve){contentReady(_this5,function(){animator.hide(_this5,function(){_this5.style.display="none",_this5._visible=!1,unlock(),util.triggerElementEvent(_this5,"posthide",{dialog:_this5}),callback(),resolve(_this5)})})})};return{v:new Promise(function(resolve){_this5._doorLock.waitUnlock(function(){return resolve(tryHide())})})}}();return"object"===("undefined"==typeof _ret2?"undefined":_typeof(_ret2))?_ret2.v:void 0}},{key:"connectedCallback",value:function(){var _this6=this;this.onDeviceBackButton=function(e){return _this6.cancelable?_this6._cancel():e.callParentHandler()},contentReady(this,function(){_this6._mask.addEventListener("click",_this6._boundCancel,!1)})}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null,this._mask.removeEventListener("click",this._boundCancel.bind(this),!1)}},{key:"attributeChangedCallback",value:function(name,last,current){return"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme$5):void("animation"===name&&this._updateAnimatorFactory())}},{key:"_mask",get:function(){return util.findChild(this,".dialog-mask")}},{key:"_dialog",get:function(){return util.findChild(this,".dialog")}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(callback){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,callback)}},{key:"visible",get:function(){return this._visible}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}},{key:"cancelable",set:function(value){return util.toggleAttribute(this,"cancelable",value)},get:function(){return this.hasAttribute("cancelable")}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator.prototype instanceof DialogAnimator))throw new Error('"Animator" param must inherit OnsDialogElement.DialogAnimator');_animatorDict$1[name]=Animator}},{key:"observedAttributes",get:function(){return["modifier","animation"]}},{key:"DialogAnimator",get:function(){return DialogAnimator}}]),DialogElement}(BaseElement);customElements.define("ons-dialog",DialogElement);var scheme$6={"":"fab--*"},FabElement=function(_BaseElement){function FabElement(){return classCallCheck(this,FabElement),possibleConstructorReturn(this,(FabElement.__proto__||Object.getPrototypeOf(FabElement)).apply(this,arguments))}return inherits(FabElement,_BaseElement),createClass(FabElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile()})}},{key:"_compile",value:function(){var _this3=this;autoStyle.prepare(this),this.classList.add("fab"),util.findChild(this,".fab__icon")||!function(){var content=document.createElement("span");content.classList.add("fab__icon"),util.arrayFrom(_this3.childNodes).forEach(function(element){element.tagName&&"ons-ripple"===element.tagName.toLowerCase()||content.appendChild(element)}),_this3.appendChild(content)}(),this._updateRipple(),ModifierUtil.initModifier(this,scheme$6),this._updatePosition(),this.show()}},{key:"attributeChangedCallback",value:function(name,last,current){switch(name){case"modifier":ModifierUtil.onModifierChanged(last,current,this,scheme$6);break;case"ripple":this._updateRipple();break;case"position":this._updatePosition()}}},{key:"_show",value:function(){this.show()}},{key:"_hide",value:function(){this.hide()}},{key:"_updateRipple",value:function(){util.updateRipple(this)}},{key:"_updatePosition",value:function(){var position=this.getAttribute("position");switch(this.classList.remove("fab--top__left","fab--bottom__right","fab--bottom__left","fab--top__right","fab--top__center","fab--bottom__center"),position){case"top right":case"right top":this.classList.add("fab--top__right");break;case"top left":case"left top":this.classList.add("fab--top__left");break;case"bottom right":case"right bottom":this.classList.add("fab--bottom__right");break;case"bottom left":case"left bottom":this.classList.add("fab--bottom__left");break;case"center top":case"top center":this.classList.add("fab--top__center");break;case"center bottom":case"bottom center":this.classList.add("fab--bottom__center")}}},{key:"show",value:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.style.transform="scale(1)",this.style.webkitTransform="scale(1)"}},{key:"hide",value:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.style.transform="scale(0)",this.style.webkitTransform="scale(0)"}},{key:"toggle",value:function(){this.visible?this.hide():this.show()}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}},{key:"visible",get:function(){return"scale(1)"===this.style.transform&&"none"!==this.style.display}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","position"]}}]),FabElement}(BaseElement);customElements.define("ons-fab",FabElement);var GestureDetectorElement=function(_BaseElement){function GestureDetectorElement(){return classCallCheck(this,GestureDetectorElement),
8possibleConstructorReturn(this,(GestureDetectorElement.__proto__||Object.getPrototypeOf(GestureDetectorElement)).apply(this,arguments))}return inherits(GestureDetectorElement,_BaseElement),createClass(GestureDetectorElement,[{key:"init",value:function(){this._gestureDetector=new GestureDetector(this)}}]),GestureDetectorElement}(BaseElement);customElements.define("ons-gesture-detector",GestureDetectorElement);var IconElement=function(_BaseElement){function IconElement(){return classCallCheck(this,IconElement),possibleConstructorReturn(this,(IconElement.__proto__||Object.getPrototypeOf(IconElement)).apply(this,arguments))}return inherits(IconElement,_BaseElement),createClass(IconElement,[{key:"init",value:function(){this._compile()}},{key:"attributeChangedCallback",value:function(name,last,current){["icon","size","modifier"].indexOf(name)!==-1&&this._update()}},{key:"_compile",value:function(){autoStyle.prepare(this),this._update()}},{key:"_update",value:function(){var _this2=this;this._cleanClassAttribute();var _buildClassAndStyle2=this._buildClassAndStyle(this._getAttribute("icon"),this._getAttribute("size")),classList=_buildClassAndStyle2.classList,style=_buildClassAndStyle2.style;util.extend(this.style,style),classList.forEach(function(className){return _this2.classList.add(className)})}},{key:"_getAttribute",value:function(attr){var parts=(this.getAttribute(attr)||"").split(/\s*,\s*/),def=parts[0],md=parts[1];return md=(md||"").split(/\s*:\s*/),(util.hasModifier(this,md[0])?md[1]:def)||""}},{key:"_cleanClassAttribute",value:function(){var _this3=this;util.arrayFrom(this.classList).filter(function(className){return/^(fa$|fa-|ion-|zmdi-)/.test(className)}).forEach(function(className){return _this3.classList.remove(className)}),this.classList.remove("zmdi"),this.classList.remove("ons-icon--ion")}},{key:"_buildClassAndStyle",value:function(iconName,size){var classList=["ons-icon"],style={};return 0===iconName.indexOf("ion-")?(classList.push(iconName),classList.push("ons-icon--ion")):0===iconName.indexOf("fa-")?(classList.push(iconName),classList.push("fa")):0===iconName.indexOf("md-")?(classList.push("zmdi"),classList.push("zmdi-"+iconName.split(/\-(.+)?/)[1])):(classList.push("fa"),classList.push("fa-"+iconName)),size.match(/^[1-5]x|lg$/)?(classList.push("fa-"+size),this.style.removeProperty("font-size")):style.fontSize=size,{classList:classList,style:style}}}],[{key:"observedAttributes",get:function(){return["icon","size","modifier"]}}]),IconElement}(BaseElement);customElements.define("ons-icon",IconElement);var LazyRepeatElement=function(_BaseElement){function LazyRepeatElement(){return classCallCheck(this,LazyRepeatElement),possibleConstructorReturn(this,(LazyRepeatElement.__proto__||Object.getPrototypeOf(LazyRepeatElement)).apply(this,arguments))}return inherits(LazyRepeatElement,_BaseElement),createClass(LazyRepeatElement,[{key:"connectedCallback",value:function(){util.updateParentPosition(this),this.hasAttribute("delegate")&&(this.delegate=window[this.getAttribute("delegate")])}},{key:"refresh",value:function(){this._lazyRepeatProvider&&this._lazyRepeatProvider.refresh()}},{key:"attributeChangedCallback",value:function(name,last,current){}},{key:"disconnectedCallback",value:function(){this._lazyRepeatProvider&&(this._lazyRepeatProvider.destroy(),this._lazyRepeatProvider=null)}},{key:"delegate",set:function(userDelegate){this._lazyRepeatProvider&&this._lazyRepeatProvider.destroy(),!this._templateElement&&this.children[0]&&(this._templateElement=this.removeChild(this.children[0]));var delegate=new LazyRepeatDelegate(userDelegate,this._templateElement||null);this._lazyRepeatProvider=new LazyRepeatProvider(this.parentElement,delegate)},get:function(){throw new Error("This property can only be used to set the delegate object.")}}]),LazyRepeatElement}(BaseElement);customElements.define("ons-lazy-repeat",LazyRepeatElement);var scheme$7={"":"list__header--*"},ListHeaderElement=function(_BaseElement){function ListHeaderElement(){return classCallCheck(this,ListHeaderElement),possibleConstructorReturn(this,(ListHeaderElement.__proto__||Object.getPrototypeOf(ListHeaderElement)).apply(this,arguments))}return inherits(ListHeaderElement,_BaseElement),createClass(ListHeaderElement,[{key:"init",value:function(){this._compile()}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("list__header"),ModifierUtil.initModifier(this,scheme$7)}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$7)}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),ListHeaderElement}(BaseElement);customElements.define("ons-list-header",ListHeaderElement);var scheme$8={".list__item":"list__item--*",".list__item__left":"list__item--*__left",".list__item__center":"list__item--*__center",".list__item__right":"list__item--*__right",".list__item__label":"list__item--*__label",".list__item__title":"list__item--*__title",".list__item__subtitle":"list__item--*__subtitle",".list__item__thumbnail":"list__item--*__thumbnail",".list__item__icon":"list__item--*__icon"},ListItemElement=function(_BaseElement){function ListItemElement(){return classCallCheck(this,ListItemElement),possibleConstructorReturn(this,(ListItemElement.__proto__||Object.getPrototypeOf(ListItemElement)).apply(this,arguments))}return inherits(ListItemElement,_BaseElement),createClass(ListItemElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile()})}},{key:"_compile",value:function(){this.classList.add("list__item");for(var left=void 0,center=void 0,right=void 0,i=0;i<this.children.length;i++){var el=this.children[i];el.classList.contains("left")?(el.classList.add("list__item__left"),left=el):el.classList.contains("center")?center=el:el.classList.contains("right")&&(el.classList.add("list__item__right"),right=el)}if(!center){if(center=document.createElement("div"),left||right)for(var _i=this.childNodes.length-1;_i>=0;_i--){var _el=this.childNodes[_i];_el!==left&&_el!==right&&center.insertBefore(_el,center.firstChild)}else for(;this.childNodes[0];)center.appendChild(this.childNodes[0]);this.insertBefore(center,right||null)}center.classList.add("center"),center.classList.add("list__item__center"),this._updateRipple(),ModifierUtil.initModifier(this,scheme$8),autoStyle.prepare(this)}},{key:"attributeChangedCallback",value:function(name,last,current){switch(name){case"modifier":ModifierUtil.onModifierChanged(last,current,this,scheme$8);break;case"ripple":this._updateRipple()}}},{key:"connectedCallback",value:function(){this.addEventListener("drag",this._onDrag),this.addEventListener("touchstart",this._onTouch),this.addEventListener("mousedown",this._onTouch),this.addEventListener("touchend",this._onRelease),this.addEventListener("touchmove",this._onRelease),this.addEventListener("touchcancel",this._onRelease),this.addEventListener("mouseup",this._onRelease),this.addEventListener("mouseout",this._onRelease),this.addEventListener("touchleave",this._onRelease),this._originalBackgroundColor=this.style.backgroundColor,this.tapped=!1}},{key:"disconnectedCallback",value:function(){this.removeEventListener("drag",this._onDrag),this.removeEventListener("touchstart",this._onTouch),this.removeEventListener("mousedown",this._onTouch),this.removeEventListener("touchend",this._onRelease),this.removeEventListener("touchmove",this._onRelease),this.removeEventListener("touchcancel",this._onRelease),this.removeEventListener("mouseup",this._onRelease),this.removeEventListener("mouseout",this._onRelease),this.removeEventListener("touchleave",this._onRelease)}},{key:"_updateRipple",value:function(){util.updateRipple(this)}},{key:"_onDrag",value:function(event){var gesture=event.gesture;this._shouldLockOnDrag()&&["left","right"].indexOf(gesture.direction)>-1&&gesture.preventDefault()}},{key:"_onTouch",value:function(){this.tapped||(this.tapped=!0,this.style.transition=this._transition,this.style.webkitTransition=this._transition,this.style.MozTransition=this._transition,this._tappable&&(this.style.backgroundColor&&(this._originalBackgroundColor=this.style.backgroundColor),this.style.backgroundColor=this._tapBackgroundColor,this.style.boxShadow="0px -1px 0px 0px "+this._tapBackgroundColor))}},{key:"_onRelease",value:function(){this.tapped=!1,this.style.transition="",this.style.webkitTransition="",this.style.MozTransition="",this.style.backgroundColor=this._originalBackgroundColor||"",this.style.boxShadow=""}},{key:"_shouldLockOnDrag",value:function(){return this.hasAttribute("lock-on-drag")}},{key:"_transition",get:function(){return"background-color 0.0s linear 0.02s, box-shadow 0.0s linear 0.02s"}},{key:"_tappable",get:function(){return this.hasAttribute("tappable")}},{key:"_tapBackgroundColor",get:function(){return this.getAttribute("tap-background-color")||"#d9d9d9"}}],[{key:"observedAttributes",get:function(){return["modifier","ripple"]}}]),ListItemElement}(BaseElement);customElements.define("ons-list-item",ListItemElement);var scheme$9={"":"list--*"},ListElement=function(_BaseElement){function ListElement(){return classCallCheck(this,ListElement),possibleConstructorReturn(this,(ListElement.__proto__||Object.getPrototypeOf(ListElement)).apply(this,arguments))}return inherits(ListElement,_BaseElement),createClass(ListElement,[{key:"init",value:function(){this._compile()}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("list"),ModifierUtil.initModifier(this,scheme$9)}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$9)}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),ListElement}(BaseElement);customElements.define("ons-list",ListElement);var scheme$10={".text-input":"text-input--*",".text-input__label":"text-input--*__label",".radio-button":"radio-button--*",".radio-button__input":"radio-button--*__input",".radio-button__checkmark":"radio-button--*__checkmark",".checkbox":"checkbox--*",".checkbox__input":"checkbox--*__input",".checkbox__checkmark":"checkbox--*__checkmark"},INPUT_ATTRIBUTES=["autocapitalize","autocomplete","autocorrect","autofocus","disabled","inputmode","max","maxlength","min","minlength","name","pattern","placeholder","readonly","size","step","type","validator","value"],InputElement=function(_BaseElement){function InputElement(){return classCallCheck(this,InputElement),possibleConstructorReturn(this,(InputElement.__proto__||Object.getPrototypeOf(InputElement)).apply(this,arguments))}return inherits(InputElement,_BaseElement),createClass(InputElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile(),_this2.attributeChangedCallback("checked",null,_this2.getAttribute("checked"))}),this._boundOnInput=this._onInput.bind(this),this._boundOnFocusin=this._onFocusin.bind(this),this._boundDelegateEvent=this._delegateEvent.bind(this)}},{key:"_compile",value:function(){if(autoStyle.prepare(this),0===this.children.length){var helper=document.createElement("span");helper.classList.add("_helper");var container=document.createElement("label");container.appendChild(document.createElement("input")),container.appendChild(helper);var label=document.createElement("span");switch(label.classList.add("input-label"),util.arrayFrom(this.childNodes).forEach(function(element){return label.appendChild(element)}),this.hasAttribute("content-left")?container.insertBefore(label,container.firstChild):container.appendChild(label),this.appendChild(container),this.getAttribute("type")){case"checkbox":this.classList.add("checkbox"),this._input.classList.add("checkbox__input"),this._helper.classList.add("checkbox__checkmark"),this._updateBoundAttributes();break;case"radio":this.classList.add("radio-button"),this._input.classList.add("radio-button__input"),this._helper.classList.add("radio-button__checkmark"),this._updateBoundAttributes();break;default:this._input.classList.add("text-input"),this._helper.classList.add("text-input__label"),this._input.parentElement.classList.add("text-input__container"),this._updateLabel(),this._updateBoundAttributes(),this._updateLabelClass()}this.hasAttribute("input-id")&&(this._input.id=this.getAttribute("input-id")),ModifierUtil.initModifier(this,scheme$10)}}},{key:"attributeChangedCallback",value:function(name,last,current){var _this3=this;if("modifier"===name)return contentReady(this,function(){return ModifierUtil.onModifierChanged(last,current,_this3,scheme$10)});if("placeholder"===name)return contentReady(this,function(){return _this3._updateLabel()});if("input-id"===name&&contentReady(this,function(){return _this3._input.id=current}),"checked"===name)this.checked=null!==current;else if(INPUT_ATTRIBUTES.indexOf(name)>=0)return contentReady(this,function(){return _this3._updateBoundAttributes()})}},{key:"connectedCallback",value:function(){var _this4=this;contentReady(this,function(){"checkbox"!==_this4._input.type&&"radio"!==_this4._input.type&&(_this4._input.addEventListener("input",_this4._boundOnInput),_this4._input.addEventListener("focusin",_this4._boundOnFocusin),_this4._input.addEventListener("focusout",_this4._boundOnFocusout)),_this4._input.addEventListener("focus",_this4._boundDelegateEvent),_this4._input.addEventListener("blur",_this4._boundDelegateEvent)})}},{key:"disconnectedCallback",value:function(){var _this5=this;contentReady(this,function(){_this5._input.removeEventListener("input",_this5._boundOnInput),_this5._input.removeEventListener("focusin",_this5._boundOnFocusin),_this5._input.removeEventListener("focus",_this5._boundDelegateEvent),_this5._input.removeEventListener("blur",_this5._boundDelegateEvent)})}},{key:"_setLabel",value:function(value){"undefined"!=typeof this._helper.textContent?this._helper.textContent=value:this._helper.innerText=value}},{key:"_updateLabel",value:function(){this._setLabel(this.hasAttribute("placeholder")?this.getAttribute("placeholder"):"")}},{key:"_updateBoundAttributes",value:function(){var _this6=this;INPUT_ATTRIBUTES.forEach(function(attr){_this6.hasAttribute(attr)?_this6._input.setAttribute(attr,_this6.getAttribute(attr)):_this6._input.removeAttribute(attr)})}},{key:"_updateLabelClass",value:function(){""===this.value?this._helper.classList.remove("text-input--material__label--active"):["checkbox","radio"].indexOf(this.getAttribute("type"))===-1&&this._helper.classList.add("text-input--material__label--active")}},{key:"_delegateEvent",value:function(event){var e=new CustomEvent(event.type,{bubbles:!1,cancelable:!0});return this.dispatchEvent(e)}},{key:"_onInput",value:function(event){this._updateLabelClass()}},{key:"_onFocusin",value:function(event){this._updateLabelClass()}},{key:"_input",get:function(){return this.querySelector("input")}},{key:"_helper",get:function(){return this.querySelector("._helper")}},{key:"value",get:function(){return null===this._input?this.getAttribute("value"):this._input.value},set:function(val){var _this7=this;contentReady(this,function(){_this7._input.value=val,_this7._onInput()})}},{key:"checked",get:function(){return this._input.checked},set:function(val){var _this8=this;contentReady(this,function(){_this8._input.checked=val})}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}},{key:"_isTextInput",get:function(){return"radio"!==this.type&&"checkbox"!==this.type}},{key:"type",get:function(){return this.getAttribute("type")}}],[{key:"observedAttributes",get:function(){return["modifier","placeholder","input-id","checked"].concat(INPUT_ATTRIBUTES)}}]),InputElement}(BaseElement);customElements.define("ons-input",InputElement);var ModalAnimator=function(){function ModalAnimator(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,ModalAnimator),this.delay=0,this.duration=.2,this.timing=options.timing||this.timing,this.duration=void 0!==options.duration?options.duration:this.duration,this.delay=void 0!==options.delay?options.delay:this.delay}return createClass(ModalAnimator,[{key:"show",value:function(modal,callback){callback()}},{key:"hide",value:function(modal,callback){callback()}}]),ModalAnimator}(),FadeModalAnimator=function(_ModalAnimator){function FadeModalAnimator(options){return classCallCheck(this,FadeModalAnimator),options.timing=options.timing||"linear",options.duration=options.duration||"0.3",options.delay=options.delay||0,possibleConstructorReturn(this,(FadeModalAnimator.__proto__||Object.getPrototypeOf(FadeModalAnimator)).call(this,options))}return inherits(FadeModalAnimator,_ModalAnimator),createClass(FadeModalAnimator,[{key:"show",value:function(modal,callback){callback=callback?callback:function(){},animit(modal).queue({opacity:0}).wait(this.delay).queue({opacity:1},{duration:this.duration,timing:this.timing}).queue(function(done){callback(),done()}).play()}},{key:"hide",value:function(modal,callback){callback=callback?callback:function(){},animit(modal).queue({opacity:1}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).queue(function(done){callback(),done()}).play()}}]),FadeModalAnimator}(ModalAnimator),scheme$11={"":"modal--*",modal__content:"modal--*__content"},_animatorDict$2={"default":ModalAnimator,fade:FadeModalAnimator,none:ModalAnimator},ModalElement=function(_BaseElement){function ModalElement(){return classCallCheck(this,ModalElement),possibleConstructorReturn(this,(ModalElement.__proto__||Object.getPrototypeOf(ModalElement)).apply(this,arguments))}return inherits(ModalElement,_BaseElement),createClass(ModalElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile()}),this._doorLock=new DoorLock,this._animatorFactory=new AnimatorFactory({animators:_animatorDict$2,baseClass:ModalAnimator,baseClassName:"ModalAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"_compile",value:function(){if(this.style.display="none",this.style.zIndex=10001,this.classList.add("modal"),!util.findChild(this,".modal__content")){var content=document.createElement("div");for(content.classList.add("modal__content");this.childNodes[0];){var node=this.childNodes[0];this.removeChild(node),content.insertBefore(node,null)}this.appendChild(content)}ModifierUtil.initModifier(this,scheme$11)}},{key:"disconnectedCallback",value:function(){this._backButtonHandler&&this._backButtonHandler.destroy()}},{key:"connectedCallback",value:function(){this.onDeviceBackButton=function(){}}},{key:"show",value:function(){var _this3=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options")));var callback=options.callback||function(){},tryShow=function(){var unlock=_this3._doorLock.lock(),animator=_this3._animatorFactory.newAnimator(options);return new Promise(function(resolve){contentReady(_this3,function(){_this3.style.display="table",animator.show(_this3,function(){unlock(),callback(),resolve(_this3)})})})};return new Promise(function(resolve){_this3._doorLock.waitUnlock(function(){return resolve(tryShow())})})}},{key:"toggle",value:function(){return this.visible?this.hide.apply(this,arguments):this.show.apply(this,arguments)}},{key:"hide",value:function(){var _this4=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options")));var callback=options.callback||function(){},tryHide=function(){var unlock=_this4._doorLock.lock(),animator=_this4._animatorFactory.newAnimator(options);return new Promise(function(resolve){contentReady(_this4,function(){animator.hide(_this4,function(){_this4.style.display="none",unlock(),callback(),resolve(_this4)})})})};return new Promise(function(resolve){_this4._doorLock.waitUnlock(function(){return resolve(tryHide())})})}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$11)}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(handler){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,handler)}},{key:"visible",get:function(){return"none"!==this.style.display}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator.prototype instanceof ModalAnimator))throw new Error('"Animator" param must inherit OnsModalElement.ModalAnimator');_animatorDict$2[name]=Animator}},{key:"observedAttributes",get:function(){return["modifier"]}},{key:"ModalAnimator",get:function(){return ModalAnimator}}]),ModalElement}(BaseElement);customElements.define("ons-modal",ModalElement);var NavigatorTransitionAnimator=function(){function NavigatorTransitionAnimator(options){classCallCheck(this,NavigatorTransitionAnimator),options=util.extend({timing:"linear",duration:"0.4",delay:"0"},options||{}),this.timing=options.timing,this.duration=options.duration,this.delay=options.delay}return createClass(NavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){callback()}},{key:"pop",value:function(enterPage,leavePage,callback){callback()}}],[{key:"extend",value:function(){var properties=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},extendedAnimator=this,newAnimator=function(){extendedAnimator.apply(this,arguments),util.extend(this,properties)};return newAnimator.prototype=this.prototype,newAnimator}}]),NavigatorTransitionAnimator}(),IOSSlideNavigatorTransitionAnimator=function(_NavigatorTransitionA){function IOSSlideNavigatorTransitionAnimator(options){classCallCheck(this,IOSSlideNavigatorTransitionAnimator),options=util.extend({duration:.4,timing:"ease",delay:0},options||{});var _this=possibleConstructorReturn(this,(IOSSlideNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(IOSSlideNavigatorTransitionAnimator)).call(this,options));return _this.backgroundMask=util.createElement('\n <div style="position: absolute; width: 100%; height: 100%;\n background-color: black; opacity: 0; z-index: 2"></div>\n '),_this}return inherits(IOSSlideNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(IOSSlideNavigatorTransitionAnimator,[{key:"_decompose",value:function(page){var toolbar=page._getToolbarElement(),left=toolbar._getToolbarLeftItemsElement(),right=toolbar._getToolbarRightItemsElement(),excludeBackButton=function(elements){for(var result=[],i=0;i<elements.length;i++)"ons-back-button"!==elements[i].nodeName.toLowerCase()&&result.push(elements[i]);return result},other=[].concat(0===left.children.length?left:excludeBackButton(left.children)).concat(0===right.children.length?right:excludeBackButton(right.children));return{toolbarCenter:toolbar._getToolbarCenterItemsElement(),backButtonIcon:toolbar._getToolbarBackButtonIconElement(),backButtonLabel:toolbar._getToolbarBackButtonLabelElement(),other:other,content:page._getContentElement(),background:page._getBackgroundElement(),toolbar:toolbar,bottomToolbar:page._getBottomToolbarElement()}}},{key:"_shouldAnimateToolbar",value:function(enterPage,leavePage){var bothPageHasToolbar=enterPage._canAnimateToolbar()&&leavePage._canAnimateToolbar(),noMaterialToolbar=!enterPage._getToolbarElement().classList.contains("navigation-bar--material")&&!leavePage._getToolbarElement().classList.contains("navigation-bar--material");return bothPageHasToolbar&&noMaterialToolbar}},{key:"_calculateDelta",value:function(element,decomposition){var title=void 0,label=void 0,pageRect=element.getBoundingClientRect();if(decomposition.backButtonLabel.classList.contains("back-button__label")){var labelRect=decomposition.backButtonLabel.getBoundingClientRect();title=Math.round(pageRect.width/2-labelRect.width/2-labelRect.left)}else title=Math.round(pageRect.width/2*.6);return decomposition.backButtonIcon.classList.contains("back-button__icon")&&(label=decomposition.backButtonIcon.getBoundingClientRect().right-2),{title:title,label:label}}},{key:"push",value:function(enterPage,leavePage,callback){var _this2=this;this.backgroundMask.remove(),leavePage.parentNode.insertBefore(this.backgroundMask,leavePage.nextSibling),contentReady(enterPage,function(){var enterPageDecomposition=_this2._decompose(enterPage),leavePageDecomposition=_this2._decompose(leavePage),delta=_this2._calculateDelta(leavePage,enterPageDecomposition),maskClear=animit(_this2.backgroundMask).saveStyle().queue({opacity:0,transform:"translate3d(0, 0, 0)"}).wait(_this2.delay).queue({opacity:.05},{duration:_this2.duration,timing:_this2.timing}).restoreStyle().queue(function(done){_this2.backgroundMask.remove(),done()}),shouldAnimateToolbar=_this2._shouldAnimateToolbar(enterPage,leavePage);if(shouldAnimateToolbar){var enterPageToolbarHeight=enterPageDecomposition.toolbar.getBoundingClientRect().height+"px";_this2.backgroundMask.style.top=enterPageToolbarHeight,animit.runAll(maskClear,animit([enterPageDecomposition.content,enterPageDecomposition.bottomToolbar,enterPageDecomposition.background]).saveStyle().queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(enterPageDecomposition.toolbar).saveStyle().queue({css:{opacity:0},duration:0}).queue({css:{opacity:1},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(enterPageDecomposition.background).queue({css:{top:enterPageToolbarHeight},duration:0}),animit(enterPageDecomposition.toolbarCenter).saveStyle().queue({css:{transform:"translate3d(125%, 0, 0)",opacity:1},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(enterPageDecomposition.backButtonLabel).saveStyle().queue({css:{transform:"translate3d("+delta.title+"px, 0, 0)",opacity:0},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(enterPageDecomposition.other).saveStyle().queue({css:{opacity:0},duration:0}).wait(_this2.delay).queue({css:{opacity:1},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit([leavePageDecomposition.content,leavePageDecomposition.bottomToolbar,leavePageDecomposition.background]).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3D(-25%, 0px, 0px)"},duration:_this2.duration,timing:_this2.timing}).restoreStyle().queue(function(done){callback(),done()}),animit(leavePageDecomposition.toolbarCenter).saveStyle().queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3d(-"+delta.title+"px, 0, 0)",opacity:0},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(leavePageDecomposition.backButtonLabel).saveStyle().queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3d(-"+delta.label+"px, 0, 0)",opacity:0},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(leavePageDecomposition.other).saveStyle().queue({css:{opacity:1},duration:0}).wait(_this2.delay).queue({css:{opacity:0},duration:_this2.duration,timing:_this2.timing}).restoreStyle())}else animit.runAll(maskClear,animit(enterPage).saveStyle().queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:_this2.duration,timing:_this2.timing}).restoreStyle(),animit(leavePage).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(_this2.delay).queue({css:{transform:"translate3D(-25%, 0px, 0px)"},duration:_this2.duration,timing:_this2.timing}).restoreStyle().queue(function(done){callback(),done()}))})}},{key:"pop",value:function(enterPage,leavePage,done){this.backgroundMask.remove(),enterPage.parentNode.insertBefore(this.backgroundMask,enterPage.nextSibling);var enterPageDecomposition=this._decompose(enterPage),leavePageDecomposition=this._decompose(leavePage),delta=this._calculateDelta(leavePage,leavePageDecomposition),maskClear=animit(this.backgroundMask).saveStyle().queue({opacity:.1,transform:"translate3d(0, 0, 0)"}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){done()}),shouldAnimateToolbar=this._shouldAnimateToolbar(enterPage,leavePage);if(shouldAnimateToolbar){var enterPageToolbarHeight=enterPageDecomposition.toolbar.getBoundingClientRect().height+"px";this.backgroundMask.style.top=enterPageToolbarHeight,animit.runAll(maskClear,animit([enterPageDecomposition.content,enterPageDecomposition.bottomToolbar,enterPageDecomposition.background]).saveStyle().queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),animit(enterPageDecomposition.toolbarCenter).saveStyle().queue({css:{transform:"translate3d(-"+delta.title+"px, 0, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),animit(enterPageDecomposition.backButtonLabel).saveStyle().queue({css:{transform:"translate3d(-"+delta.label+"px, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle(),animit(enterPageDecomposition.other).saveStyle().queue({css:{opacity:0},duration:0}).wait(this.delay).queue({css:{opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),animit(leavePageDecomposition.background).queue({css:{top:enterPageToolbarHeight},duration:0}),animit([leavePageDecomposition.content,leavePageDecomposition.bottomToolbar,leavePageDecomposition.background]).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).wait(0).queue(function(finish){this.backgroundMask.remove(),done(),finish()}.bind(this)),animit(leavePageDecomposition.toolbar).queue({css:{opacity:1},duration:0}).queue({css:{opacity:0},duration:this.duration,timing:this.timing}),animit(leavePageDecomposition.toolbarCenter).queue({css:{transform:"translate3d(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3d(125%, 0, 0)"},duration:this.duration,timing:this.timing}),animit(leavePageDecomposition.backButtonLabel).queue({css:{transform:"translate3d(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3d("+delta.title+"px, 0, 0)",opacity:0},duration:this.duration,timing:this.timing}))}else animit.runAll(maskClear,animit(enterPage).saveStyle().queue({css:{transform:"translate3D(-25%, 0px, 0px)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),animit(leavePage).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).queue(function(finish){this.backgroundMask.remove(),done(),finish()}.bind(this)))}}]),IOSSlideNavigatorTransitionAnimator}(NavigatorTransitionAnimator),IOSLiftNavigatorTransitionAnimator=function(_NavigatorTransitionA){function IOSLiftNavigatorTransitionAnimator(options){classCallCheck(this,IOSLiftNavigatorTransitionAnimator),options=util.extend({duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)",delay:0
9},options||{});var _this=possibleConstructorReturn(this,(IOSLiftNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(IOSLiftNavigatorTransitionAnimator)).call(this,options));return _this.backgroundMask=util.createElement('\n <div style="position: absolute; width: 100%; height: 100%;\n background: linear-gradient(black, white);"></div>\n '),_this}return inherits(IOSLiftNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(IOSLiftNavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){var _this2=this;this.backgroundMask.remove(),leavePage.parentNode.insertBefore(this.backgroundMask,leavePage);var maskClear=animit(this.backgroundMask).wait(this.delay+this.duration).queue(function(done){_this2.backgroundMask.remove(),done()});animit.runAll(maskClear,animit(enterPage).saveStyle().queue({css:{transform:"translate3D(0, 100%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}),animit(leavePage).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, -10%, 0)",opacity:.9},duration:this.duration,timing:this.timing}))}},{key:"pop",value:function(enterPage,leavePage,callback){var _this3=this;this.backgroundMask.remove(),enterPage.parentNode.insertBefore(this.backgroundMask,enterPage),animit.runAll(animit(this.backgroundMask).wait(this.delay+this.duration).queue(function(done){_this3.backgroundMask.remove(),done()}),animit(enterPage).queue({css:{transform:"translate3D(0, -10%, 0)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).queue(function(done){callback(),done()}),animit(leavePage).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:this.duration,timing:this.timing}))}}]),IOSLiftNavigatorTransitionAnimator}(NavigatorTransitionAnimator),IOSFadeNavigatorTransitionAnimator=function(_NavigatorTransitionA){function IOSFadeNavigatorTransitionAnimator(options){return classCallCheck(this,IOSFadeNavigatorTransitionAnimator),options=util.extend({timing:"linear",duration:"0.4",delay:"0"},options||{}),possibleConstructorReturn(this,(IOSFadeNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(IOSFadeNavigatorTransitionAnimator)).call(this,options))}return inherits(IOSFadeNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(IOSFadeNavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){animit.runAll(animit([enterPage._getContentElement(),enterPage._getBackgroundElement()]).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}),animit(enterPage._getToolbarElement()).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle())}},{key:"pop",value:function(enterPage,leavePage,callback){animit.runAll(animit([leavePage._getContentElement(),leavePage._getBackgroundElement()]).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:this.duration,timing:this.timing}).queue(function(done){callback(),done()}),animit(leavePage._getToolbarElement()).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:0},duration:this.duration,timing:this.timing}))}}]),IOSFadeNavigatorTransitionAnimator}(NavigatorTransitionAnimator),MDSlideNavigatorTransitionAnimator=function(_NavigatorTransitionA){function MDSlideNavigatorTransitionAnimator(options){classCallCheck(this,MDSlideNavigatorTransitionAnimator),options=util.extend({duration:.3,timing:"cubic-bezier(.1, .7, .4, 1)",delay:0},options||{});var _this=possibleConstructorReturn(this,(MDSlideNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(MDSlideNavigatorTransitionAnimator)).call(this,options));return _this.backgroundMask=util.createElement('\n <div style="position: absolute; width: 100%; height: 100%; z-index: 2;\n background-color: black; opacity: 0;"></div>\n '),_this.blackMaskOpacity=.4,_this}return inherits(MDSlideNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(MDSlideNavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){var _this2=this;this.backgroundMask.remove(),leavePage.parentElement.insertBefore(this.backgroundMask,leavePage.nextSibling),animit.runAll(animit(this.backgroundMask).saveStyle().queue({opacity:0,transform:"translate3d(0, 0, 0)"}).wait(this.delay).queue({opacity:this.blackMaskOpacity},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){_this2.backgroundMask.remove(),done()}),animit(enterPage).saveStyle().queue({css:{transform:"translate3D(100%, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle(),animit(leavePage).saveStyle().queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(-45%, 0px, 0px)"},duration:this.duration,timing:this.timing}).restoreStyle().wait(.2).queue(function(done){callback(),done()}))}},{key:"pop",value:function(enterPage,leavePage,done){var _this3=this;this.backgroundMask.remove(),enterPage.parentNode.insertBefore(this.backgroundMask,enterPage.nextSibling),animit.runAll(animit(this.backgroundMask).saveStyle().queue({opacity:this.blackMaskOpacity,transform:"translate3d(0, 0, 0)"}).wait(this.delay).queue({opacity:0},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){_this3.backgroundMask.remove(),done()}),animit(enterPage).saveStyle().queue({css:{transform:"translate3D(-45%, 0px, 0px)",opacity:.9},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0px, 0px, 0px)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle(),animit(leavePage).queue({css:{transform:"translate3D(0px, 0px, 0px)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(100%, 0px, 0px)"},duration:this.duration,timing:this.timing}).wait(.2).queue(function(finish){done(),finish()}))}}]),MDSlideNavigatorTransitionAnimator}(NavigatorTransitionAnimator),MDLiftNavigatorTransitionAnimator=function(_NavigatorTransitionA){function MDLiftNavigatorTransitionAnimator(options){classCallCheck(this,MDLiftNavigatorTransitionAnimator),options=util.extend({duration:.4,timing:"cubic-bezier(.1, .7, .1, 1)",delay:.05},options||{});var _this=possibleConstructorReturn(this,(MDLiftNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(MDLiftNavigatorTransitionAnimator)).call(this,options));return _this.backgroundMask=util.createElement('\n <div style="position: absolute; width: 100%; height: 100%;\n background-color: black;"></div>\n '),_this}return inherits(MDLiftNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(MDLiftNavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){var _this2=this;this.backgroundMask.remove(),leavePage.parentNode.insertBefore(this.backgroundMask,leavePage);var maskClear=animit(this.backgroundMask).wait(this.delay+this.duration).queue(function(done){_this2.backgroundMask.remove(),done()});animit.runAll(maskClear,animit(enterPage).saveStyle().queue({css:{transform:"translate3D(0, 100%, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)"},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}),animit(leavePage).queue({css:{opacity:1},duration:0}).queue({css:{opacity:.4},duration:this.duration,timing:this.timing}))}},{key:"pop",value:function(enterPage,leavePage,callback){var _this3=this;this.backgroundMask.remove(),enterPage.parentNode.insertBefore(this.backgroundMask,enterPage),animit.runAll(animit(this.backgroundMask).wait(this.delay+this.duration).queue(function(done){_this3.backgroundMask.remove(),done()}),animit(enterPage).queue({css:{transform:"translate3D(0, 0, 0)",opacity:.4},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).queue(function(done){callback(),done()}),animit(leavePage).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 100%, 0)"},duration:this.duration,timing:this.timing}))}}]),MDLiftNavigatorTransitionAnimator}(NavigatorTransitionAnimator),MDFadeNavigatorTransitionAnimator=function(_NavigatorTransitionA){function MDFadeNavigatorTransitionAnimator(options){return classCallCheck(this,MDFadeNavigatorTransitionAnimator),options=util.extend({timing:"ease-out",duration:"0.25",delay:"0"},options||{}),possibleConstructorReturn(this,(MDFadeNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(MDFadeNavigatorTransitionAnimator)).call(this,options))}return inherits(MDFadeNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(MDFadeNavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){animit.runAll(animit(enterPage).saveStyle().queue({css:{transform:"translate3D(0, 42px, 0)",opacity:0},duration:0}).wait(this.delay).queue({css:{transform:"translate3D(0, 0, 0)",opacity:1},duration:this.duration,timing:this.timing}).restoreStyle().queue(function(done){callback(),done()}))}},{key:"pop",value:function(enterPage,leavePage,callback){animit.runAll(animit(leavePage).queue({css:{transform:"translate3D(0, 0, 0)"},duration:0}).wait(.15).queue({css:{transform:"translate3D(0, 38px, 0)"},duration:this.duration,timing:this.timing}).queue(function(done){callback(),done()}),animit(leavePage).queue({css:{opacity:1},duration:0}).wait(.04).queue({css:{opacity:0},duration:this.duration,timing:this.timing}))}}]),MDFadeNavigatorTransitionAnimator}(NavigatorTransitionAnimator),NoneNavigatorTransitionAnimator=function(_NavigatorTransitionA){function NoneNavigatorTransitionAnimator(options){return classCallCheck(this,NoneNavigatorTransitionAnimator),possibleConstructorReturn(this,(NoneNavigatorTransitionAnimator.__proto__||Object.getPrototypeOf(NoneNavigatorTransitionAnimator)).call(this,options))}return inherits(NoneNavigatorTransitionAnimator,_NavigatorTransitionA),createClass(NoneNavigatorTransitionAnimator,[{key:"push",value:function(enterPage,leavePage,callback){callback()}},{key:"pop",value:function(enterPage,leavePage,callback){callback()}}]),NoneNavigatorTransitionAnimator}(NavigatorTransitionAnimator),_animatorDict$3={"default":function(){return platform.isAndroid()?MDFadeNavigatorTransitionAnimator:IOSSlideNavigatorTransitionAnimator},slide:function(){return platform.isAndroid()?MDSlideNavigatorTransitionAnimator:IOSSlideNavigatorTransitionAnimator},lift:function(){return platform.isAndroid()?MDLiftNavigatorTransitionAnimator:IOSLiftNavigatorTransitionAnimator},fade:function(){return platform.isAndroid()?MDFadeNavigatorTransitionAnimator:IOSFadeNavigatorTransitionAnimator},"slide-ios":IOSSlideNavigatorTransitionAnimator,"slide-md":MDSlideNavigatorTransitionAnimator,"lift-ios":IOSLiftNavigatorTransitionAnimator,"lift-md":MDLiftNavigatorTransitionAnimator,"fade-ios":IOSFadeNavigatorTransitionAnimator,"fade-md":MDFadeNavigatorTransitionAnimator,none:NoneNavigatorTransitionAnimator},rewritables={ready:function(navigatorElement,callback){callback()},link:function(navigatorElement,target,options,callback){callback(target)}},NavigatorElement=function(_BaseElement){function NavigatorElement(){return classCallCheck(this,NavigatorElement),possibleConstructorReturn(this,(NavigatorElement.__proto__||Object.getPrototypeOf(NavigatorElement)).apply(this,arguments))}return inherits(NavigatorElement,_BaseElement),createClass(NavigatorElement,[{key:"init",value:function(){this._isRunning=!1,this._pageLoader=defaultPageLoader,this._updateAnimatorFactory()}},{key:"_getPageTarget",value:function(){return this._page||this.getAttribute("page")}},{key:"connectedCallback",value:function(){var _this2=this;this.onDeviceBackButton=this._onDeviceBackButton.bind(this),rewritables.ready(this,function(){if(0===_this2.pages.length&&_this2._getPageTarget())_this2.pushPage(_this2._getPageTarget(),{animation:"none"});else if(_this2.pages.length>0){for(var i=0;i<_this2.pages.length;i++)if("ONS-PAGE"!==_this2.pages[i].nodeName)throw new Error("The children of <ons-navigator> need to be of type <ons-page>");_this2.topPage&&contentReady(_this2.topPage,function(){return setTimeout(function(){_this2.topPage._show(),_this2._updateLastPageBackButton()},0)})}else contentReady(_this2,function(){0===_this2.pages.length&&_this2._getPageTarget()&&_this2.pushPage(_this2._getPageTarget(),{animation:"none"})})})}},{key:"_updateAnimatorFactory",value:function(){this._animatorFactory=new AnimatorFactory({animators:_animatorDict$3,baseClass:NavigatorTransitionAnimator,baseClassName:"NavigatorTransitionAnimator",defaultAnimation:this.getAttribute("animation")})}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null}},{key:"attributeChangedCallback",value:function(name,last,current){"animation"===name&&this._updateAnimatorFactory()}},{key:"popPage",value:function(){var _this3=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},_preparePageAndOption=this._preparePageAndOptions(null,options);options=_preparePageAndOption.options;var popUpdate=function(){return new Promise(function(resolve){_this3.pages[_this3.pages.length-1]._destroy(),resolve()})};if(!options.refresh)return this._popPage(options,popUpdate);var index=this.pages.length-2,oldPage=this.pages[index];if(!oldPage.name)throw new Error("Refresh option cannot be used with pages directly inside the Navigator. Use ons-template instead.");return new Promise(function(resolve){var options={page:oldPage.name,parent:_this3,params:oldPage.pushedOptions.data};_this3._pageLoader.load(options,function(_ref){var element=_ref.element,unload=_ref.unload;element=util.extend(element,{name:oldPage.name,data:oldPage.data,pushedOptions:oldPage.pushedOptions,unload:unload}),rewritables.link(_this3,element,oldPage.options,function(element){_this3.insertBefore(element,oldPage?oldPage:null),oldPage._destroy(),resolve()})})}).then(function(){return _this3._popPage(options,popUpdate)})}},{key:"_popPage",value:function(options){var _this4=this,update=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return Promise.resolve()};if(this._isRunning)return Promise.reject("popPage is already running.");if(this.pages.length<=1)return Promise.reject("ons-navigator's page stack is empty.");if(this._emitPrePopEvent())return Promise.reject("Canceled in prepop event.");var length=this.pages.length;return this._isRunning=!0,this.pages[length-2].updateBackButton(length-2>0),new Promise(function(resolve){var leavePage=_this4.pages[length-1],enterPage=_this4.pages[length-2];enterPage.style.display="block",options.animation=options.animation||leavePage.pushedOptions.animation,options.animationOptions=util.extend({},leavePage.pushedOptions.animationOptions,options.animationOptions||{}),options.data&&(enterPage.data=util.extend({},enterPage.data||{},options.data||{}));var callback=function(){update().then(function(){_this4._isRunning=!1,enterPage._show(),util.triggerElementEvent(_this4,"postpop",{leavePage:leavePage,enterPage:enterPage,navigator:_this4}),"function"==typeof options.callback&&options.callback(),resolve(enterPage)})};leavePage._hide();var animator=_this4._animatorFactory.newAnimator(options);animator.pop(_this4.pages[length-2],_this4.pages[length-1],callback)})["catch"](function(){return _this4._isRunning=!1})}},{key:"pushPage",value:function(page){var _this5=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_preparePageAndOption2=this._preparePageAndOptions(page,options);page=_preparePageAndOption2.page,options=_preparePageAndOption2.options;var prepare=function(element,unload){_this5._verifyPageElement(element),element=util.extend(element,{name:options.page,data:options.data,unload:unload}),element.style.display="none"};return options.pageHTML?this._pushPage(options,function(){return new Promise(function(resolve){instantPageLoader.load({page:options.pageHTML,parent:_this5,params:options.data},function(_ref2){var element=_ref2.element,unload=_ref2.unload;prepare(element,unload),resolve()})})}):this._pushPage(options,function(){return new Promise(function(resolve){_this5._pageLoader.load({page:page,parent:_this5,params:options.data},function(_ref3){var element=_ref3.element,unload=_ref3.unload;prepare(element,unload),resolve()})})})}},{key:"_pushPage",value:function(){var _this6=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},update=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return Promise.resolve()};if(this._isRunning)return Promise.reject("pushPage is already running.");if(this._emitPrePushEvent())return Promise.reject("Canceled in prepush event.");this._isRunning=!0;var animationOptions=AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options"));options=util.extend({},this.options||{},{animationOptions:animationOptions},options);var animator=this._animatorFactory.newAnimator(options);return update().then(function(){var pageLength=_this6.pages.length,enterPage=_this6.pages[pageLength-1],leavePage=_this6.pages[pageLength-2];if("ONS-PAGE"!==enterPage.nodeName)throw new Error("Only elements of type <ons-page> can be pushed to the navigator");return enterPage.updateBackButton(pageLength-1),enterPage.pushedOptions=util.extend({},enterPage.pushedOptions||{},options||{}),enterPage.data=util.extend({},enterPage.data||{},options.data||{}),enterPage.name=enterPage.name||options.page,enterPage.unload=enterPage.unload||options.unload,new Promise(function(resolve){var done=function(){_this6._isRunning=!1,leavePage&&(leavePage.style.display="none"),setImmediate(function(){return enterPage._show()}),util.triggerElementEvent(_this6,"postpush",{leavePage:leavePage,enterPage:enterPage,navigator:_this6}),"function"==typeof options.callback&&options.callback(),resolve(enterPage)};enterPage.style.display="none";var push=function(){enterPage.style.display="block",leavePage?(leavePage._hide(),animator.push(enterPage,leavePage,done)):done()};options._linked?push():rewritables.link(_this6,enterPage,options,push)})})["catch"](function(error){throw _this6._isRunning=!1,error})}},{key:"replacePage",value:function(page){var _this7=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.pushPage(page,options).then(function(resolvedValue){return _this7.pages.length>1&&_this7.pages[_this7.pages.length-2]._destroy(),_this7._updateLastPageBackButton(),Promise.resolve(resolvedValue)})}},{key:"insertPage",value:function(index,page){var _this8=this,options=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},_preparePageAndOption3=this._preparePageAndOptions(page,options);if(page=_preparePageAndOption3.page,options=_preparePageAndOption3.options,index=this._normalizeIndex(index),index>=this.pages.length)return this.pushPage(page,options);page="string"==typeof options.pageHTML?options.pageHTML:page;var loader="string"==typeof options.pageHTML?instantPageLoader:this._pageLoader;return new Promise(function(resolve){loader.load({page:page,parent:_this8},function(_ref4){var element=_ref4.element,unload=_ref4.unload;_this8._verifyPageElement(element),element=util.extend(element,{name:options.page,data:options.data,pushedOptions:options,unload:unload}),options.animationOptions=util.extend({},AnimatorFactory.parseAnimationOptionsString(_this8.getAttribute("animation-options")),options.animationOptions||{}),element.style.display="none",_this8.insertBefore(element,_this8.pages[index]),_this8.topPage.updateBackButton(!0),rewritables.link(_this8,element,options,function(element){setTimeout(function(){element=null,resolve(_this8.pages[index])},1e3/60)})})})}},{key:"resetToPage",value:function(page){var _this9=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_preparePageAndOption4=this._preparePageAndOptions(page,options);page=_preparePageAndOption4.page,options=_preparePageAndOption4.options,options.animator||options.animation||(options.animation="none");var callback=options.callback;return options.callback=function(){for(;_this9.pages.length>1;)_this9.pages[0]._destroy();_this9.pages[0].updateBackButton(!1),callback&&callback()},options.page||options.pageHTML||!this._getPageTarget()||(page=options.page=this._getPageTarget()),this.pushPage(page,options)}},{key:"bringPageTop",value:function(item){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(["number","string"].indexOf("undefined"==typeof item?"undefined":_typeof(item))===-1)throw new Error("First argument must be a page name or the index of an existing page. You supplied "+item);var index="number"==typeof item?this._normalizeIndex(item):this._lastIndexOfPage(item),page=this.pages[index];if(index<0)return this.pushPage(item,options);var _preparePageAndOption5=this._preparePageAndOptions(page,options);if(options=_preparePageAndOption5.options,index===this.pages.length-1)return Promise.resolve(page);if(!page)throw new Error("Failed to find item "+item);return this._isRunning?Promise.reject("pushPage is already running."):this._emitPrePushEvent()?Promise.reject("Canceled in prepush event."):(util.extend(options,{page:page.name,_linked:!0}),page.style.display="none",page.setAttribute("_skipinit",""),page.parentNode.appendChild(page),this._pushPage(options))}},{key:"_preparePageAndOptions",value:function(page){var options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=("undefined"==typeof options?"undefined":_typeof(options)))throw new Error("options must be an object. You supplied "+options);return null!==page&&void 0!==page||!options.page||(page=options.page),options=util.extend({},this.options||{},options,{page:page}),{page:page,options:options}}},{key:"_updateLastPageBackButton",value:function(){var index=this.pages.length-1;index>=0&&this.pages[index].updateBackButton(index>0)}},{key:"_normalizeIndex",value:function(index){return index>=0?index:Math.abs(this.pages.length+index)%this.pages.length}},{key:"_onDeviceBackButton",value:function(event){this.pages.length>1?this.popPage():event.callParentHandler()}},{key:"_lastIndexOfPage",value:function(pageName){var index=void 0;for(index=this.pages.length-1;index>=0&&this.pages[index].name!==pageName;index--);return index}},{key:"_emitPreEvent",value:function(name){var data=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},isCanceled=!1;return util.triggerElementEvent(this,"pre"+name,util.extend({navigator:this,currentPage:this.pages[this.pages.length-1],cancel:function(){return isCanceled=!0}},data)),isCanceled}},{key:"_emitPrePushEvent",value:function(){return this._emitPreEvent("push")}},{key:"_emitPrePopEvent",value:function(){var l=this.pages.length;return this._emitPreEvent("pop",{leavePage:this.pages[l-1],enterPage:this.pages[l-2]})}},{key:"_createPageElement",value:function(templateHTML){var pageElement=util.createElement(internal$1.normalizePageHTML(templateHTML));return this._verifyPageElement(pageElement),pageElement}},{key:"_verifyPageElement",value:function(element){if("ons-page"!==element.nodeName.toLowerCase())throw new Error('You must supply an "ons-page" element to "ons-navigator".')}},{key:"_show",value:function(){this.topPage&&this.topPage._show()}},{key:"_hide",value:function(){this.topPage&&this.topPage._hide()}},{key:"_destroy",value:function(){for(var i=this.pages.length-1;i>=0;i--)this.pages[i]._destroy();this.remove()}},{key:"animatorFactory",get:function(){return this._animatorFactory}},{key:"pageLoader",get:function(){return this._pageLoader},set:function(pageLoader){if(!(pageLoader instanceof PageLoader))throw Error("First parameter must be an instance of PageLoader.");this._pageLoader=pageLoader}},{key:"page",get:function(){return this._page},set:function(page){this._page=page}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(callback){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,callback)}},{key:"topPage",get:function(){return this.pages[this.pages.length-1]||null}},{key:"pages",get:function(){return util.arrayFrom(this.children).filter(function(n){return"ONS-PAGE"===n.tagName})}},{key:"options",get:function(){return this._options},set:function(object){this._options=object}},{key:"_isRunning",set:function(value){this.setAttribute("_is-running",value?"true":"false")},get:function(){return JSON.parse(this.getAttribute("_is-running"))}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator.prototype instanceof NavigatorTransitionAnimator))throw new Error('"Animator" param must inherit NavigatorElement.NavigatorTransitionAnimator');_animatorDict$3[name]=Animator}},{key:"observedAttributes",get:function(){return["animation"]}},{key:"animators",get:function(){return _animatorDict$3}},{key:"NavigatorTransitionAnimator",get:function(){return NavigatorTransitionAnimator}},{key:"rewritables",get:function(){return rewritables}}]),NavigatorElement}(BaseElement);customElements.define("ons-navigator",NavigatorElement);var scheme$13={"":"navigation-bar--*",".navigation-bar__left":"navigation-bar--*__left",".navigation-bar__center":"navigation-bar--*__center",".navigation-bar__right":"navigation-bar--*__right"},ToolbarElement=function(_BaseElement){function ToolbarElement(){return classCallCheck(this,ToolbarElement),possibleConstructorReturn(this,(ToolbarElement.__proto__||Object.getPrototypeOf(ToolbarElement)).apply(this,arguments))}return inherits(ToolbarElement,_BaseElement),createClass(ToolbarElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile()})}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$13)}},{key:"_getToolbarLeftItemsElement",value:function(){return this.querySelector(".left")||internal$1.nullElement}},{key:"_getToolbarCenterItemsElement",value:function(){return this.querySelector(".center")||internal$1.nullElement}},{key:"_getToolbarRightItemsElement",value:function(){return this.querySelector(".right")||internal$1.nullElement}},{key:"_getToolbarBackButtonLabelElement",value:function(){return this.querySelector("ons-back-button .back-button__label")||internal$1.nullElement}},{key:"_getToolbarBackButtonIconElement",value:function(){return this.querySelector("ons-back-button .back-button__icon")||internal$1.nullElement}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("navigation-bar"),this._ensureToolbarItemElements(),ModifierUtil.initModifier(this,scheme$13)}},{key:"_ensureToolbarItemElements",value:function(){for(var i=this.childNodes.length-1;i>=0;i--)1!=this.childNodes[i].nodeType&&this.removeChild(this.childNodes[i]);var center=this._ensureToolbarElement("center");if(center.classList.add("navigation-bar__title"),1!==this.children.length||!this.children[0].classList.contains("center")){var left=this._ensureToolbarElement("left"),right=this._ensureToolbarElement("right");this.children[0]===left&&this.children[1]===center&&this.children[2]===right||(this.appendChild(left),this.appendChild(center),this.appendChild(right))}}},{key:"_ensureToolbarElement",value:function(name){if(util.findChild(this,".navigation-bar__"+name)){var _element=util.findChild(this,".navigation-bar__"+name);return _element.classList.add(name),_element}var element=util.findChild(this,"."+name)||util.create("."+name);return element.classList.add("navigation-bar__"+name),element}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),ToolbarElement}(BaseElement);customElements.define("ons-toolbar",ToolbarElement);var scheme$12={"":"page--*",".page__content":"page--*__content",".page__background":"page--*__background"},nullToolbarElement=document.createElement("ons-toolbar"),PageElement=function(_BaseElement){function PageElement(){return classCallCheck(this,PageElement),possibleConstructorReturn(this,(PageElement.__proto__||Object.getPrototypeOf(PageElement)).apply(this,arguments))}return inherits(PageElement,_BaseElement),createClass(PageElement,[{key:"init",value:function(){var _this2=this;this.classList.add("page"),contentReady(this,function(){_this2._compile(),_this2._isShown=!1,_this2._contentElement=_this2._getContentElement(),_this2._isMuted=_this2.hasAttribute("_muted"),_this2._skipInit=_this2.hasAttribute("_skipinit"),_this2.pushedOptions={}})}},{key:"connectedCallback",value:function(){var _this3=this;contentReady(this,function(){_this3._isMuted||(_this3._skipInit?_this3.removeAttribute("_skipinit"):setImmediate(function(){return util.triggerElementEvent(_this3,"init")})),util.hasAnyComponentAsParent(_this3)||setImmediate(function(){return _this3._show()}),_this3._tryToFillStatusBar(),_this3.hasAttribute("on-infinite-scroll")&&_this3.attributeChangedCallback("on-infinite-scroll",null,_this3.getAttribute("on-infinite-scroll"))})}},{key:"updateBackButton",value:function(show){this.backButton&&(show?this.backButton.show():this.backButton.hide())}},{key:"_tryToFillStatusBar",value:function(){var _this4=this;internal$1.autoStatusBarFill(function(){var filled=util.findParent(_this4,function(e){return e.hasAttribute("status-bar-fill")});util.toggleAttribute(_this4,"status-bar-fill",!filled&&(_this4._canAnimateToolbar()||!_this4._hasAPageControlChild()))})}},{key:"_hasAPageControlChild",value:function(){return util.findChild(this._contentElement,function(e){return e.nodeName.match(/ons-(splitter|sliding-menu|navigator|tabbar)/i)})}},{key:"_onScroll",value:function(){var _this5=this,c=this._contentElement,overLimit=(c.scrollTop+c.clientHeight)/c.scrollHeight>=this._infiniteScrollLimit;this._onInfiniteScroll&&!this._loadingContent&&overLimit&&(this._loadingContent=!0,this._onInfiniteScroll(function(){return _this5._loadingContent=!1}))}},{key:"_getContentElement",value:function(){var result=util.findChild(this,".page__content");if(result)return result;throw Error('fail to get ".page__content" element.')}},{key:"_canAnimateToolbar",value:function(){return!!util.findChild(this,"ons-toolbar")||!!util.findChild(this._contentElement,function(el){return util.match(el,"ons-toolbar")&&!el.hasAttribute("inline")})}},{key:"_getBackgroundElement",value:function(){var result=util.findChild(this,".page__background");if(result)return result;throw Error('fail to get ".page__background" element.')}},{key:"_getBottomToolbarElement",value:function(){return util.findChild(this,"ons-bottom-toolbar")||internal$1.nullElement}},{key:"_getToolbarElement",value:function(){return util.findChild(this,"ons-toolbar")||nullToolbarElement}},{key:"attributeChangedCallback",value:function(name,last,current){var _this6=this;return"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme$12):void("_muted"===name?this._isMuted=this.hasAttribute("_muted"):"_skipinit"===name?this._skipInit=this.hasAttribute("_skipinit"):"on-infinite-scroll"===name&&(null===current?this.onInfiniteScroll=null:this.onInfiniteScroll=function(done){var f=util.findFromPath(current);_this6.onInfiniteScroll=f,f(done)}))}},{key:"_compile",value:function(){var _this7=this;if(autoStyle.prepare(this),util.findChild(this,".content")&&util.findChild(this,".content").classList.add("page__content"),
10util.findChild(this,".background")&&util.findChild(this,".background").classList.add("page__background"),util.findChild(this,".page__content")||!function(){var content=util.create(".page__content");util.arrayFrom(_this7.childNodes).forEach(function(node){(1!==node.nodeType||_this7._elementShouldBeMoved(node))&&content.appendChild(node)});var prevNode=util.findChild(_this7,".page__background")||util.findChild(_this7,"ons-toolbar");_this7.insertBefore(content,prevNode&&prevNode.nextSibling)}(),!util.findChild(this,".page__background")){var background=util.create(".page__background");this.insertBefore(background,util.findChild(this,".page__content"))}ModifierUtil.initModifier(this,scheme$12)}},{key:"_elementShouldBeMoved",value:function(el){if(el.classList.contains("page__background"))return!1;var tagName=el.tagName.toLowerCase();if("ons-fab"===tagName)return!el.hasAttribute("position");var fixedElements=["ons-toolbar","ons-bottom-toolbar","ons-modal","ons-speed-dial"];return el.hasAttribute("inline")||fixedElements.indexOf(tagName)===-1}},{key:"_show",value:function(){!this._isShown&&util.isAttached(this)&&(this._isShown=!0,this._isMuted||util.triggerElementEvent(this,"show"),util.propagateAction(this._contentElement,"_show"))}},{key:"_hide",value:function(){this._isShown&&(this._isShown=!1,this._isMuted||util.triggerElementEvent(this,"hide"),util.propagateAction(this._contentElement,"_hide"))}},{key:"_destroy",value:function(){this._hide(),this._isMuted||util.triggerElementEvent(this,"destroy"),this.onDeviceBackButton&&this.onDeviceBackButton.destroy(),util.propagateAction(this._contentElement,"_destroy"),this.unload instanceof Function&&this.unload(),this.remove()}},{key:"name",set:function(str){this.setAttribute("name",str)},get:function(){return this.getAttribute("name")}},{key:"backButton",get:function(){return this.querySelector("ons-back-button")}},{key:"onInfiniteScroll",set:function(value){if(null===value)return this._onInfiniteScroll=null,void this._contentElement.removeEventListener("scroll",this._boundOnScroll);if(!(value instanceof Function))throw new Error("onInfiniteScroll must be a function or null");this._onInfiniteScroll||(this._infiniteScrollLimit=.9,this._boundOnScroll=this._onScroll.bind(this),this._contentElement.addEventListener("scroll",this._boundOnScroll)),this._onInfiniteScroll=value},get:function(){return this._onInfiniteScroll}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(callback){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,callback)}}],[{key:"observedAttributes",get:function(){return["modifier","_muted","_skipinit","on-infinite-scroll"]}}]),PageElement}(BaseElement);customElements.define("ons-page",PageElement);var PopoverAnimator=function(){function PopoverAnimator(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,PopoverAnimator),this.options=util.extend({timing:"cubic-bezier(.1, .7, .4, 1)",duration:.2,delay:0},options)}return createClass(PopoverAnimator,[{key:"show",value:function(popover,callback){callback()}},{key:"hide",value:function(popover,callback){callback()}},{key:"_animate",value:function(element,_ref){var from=_ref.from,to=_ref.to,options=_ref.options,callback=_ref.callback,_ref$restore=_ref.restore,restore=void 0!==_ref$restore&&_ref$restore,animation=_ref.animation;return options=util.extend({},this.options,options),animation&&(from=animation.from,to=animation.to),animation=animit(element),restore&&(animation=animation.saveStyle()),animation=animation.queue(from).wait(options.delay).queue({css:to,duration:options.duration,timing:options.timing}),restore&&(animation=animation.restoreStyle()),callback&&(animation=animation.queue(function(done){callback(),done()})),animation}},{key:"_animateAll",value:function(element,animations){var _this=this;Object.keys(animations).forEach(function(key){return _this._animate(element[key],animations[key]).play()})}}]),PopoverAnimator}(),fade$1={out:{from:{opacity:1},to:{opacity:0}},"in":{from:{opacity:0},to:{opacity:1}}},MDFadePopoverAnimator=function(_PopoverAnimator){function MDFadePopoverAnimator(){return classCallCheck(this,MDFadePopoverAnimator),possibleConstructorReturn(this,(MDFadePopoverAnimator.__proto__||Object.getPrototypeOf(MDFadePopoverAnimator)).apply(this,arguments))}return inherits(MDFadePopoverAnimator,_PopoverAnimator),createClass(MDFadePopoverAnimator,[{key:"show",value:function(popover,callback){this._animateAll(popover,{_mask:fade$1["in"],_popover:{animation:fade$1["in"],restore:!0,callback:callback}})}},{key:"hide",value:function(popover,callback){this._animateAll(popover,{_mask:fade$1.out,_popover:{animation:fade$1.out,restore:!0,callback:callback}})}}]),MDFadePopoverAnimator}(PopoverAnimator),IOSFadePopoverAnimator=function(_MDFadePopoverAnimato){function IOSFadePopoverAnimator(){return classCallCheck(this,IOSFadePopoverAnimator),possibleConstructorReturn(this,(IOSFadePopoverAnimator.__proto__||Object.getPrototypeOf(IOSFadePopoverAnimator)).apply(this,arguments))}return inherits(IOSFadePopoverAnimator,_MDFadePopoverAnimato),createClass(IOSFadePopoverAnimator,[{key:"show",value:function(popover,callback){this._animateAll(popover,{_mask:fade$1["in"],_popover:{from:{transform:"scale3d(1.3, 1.3, 1.0)",opacity:0},to:{transform:"scale3d(1.0, 1.0, 1.0)",opacity:1},restore:!0,callback:callback}})}}]),IOSFadePopoverAnimator}(MDFadePopoverAnimator),scheme$14={".popover":"popover--*",".popover-mask":"popover-mask--*",".popover__container":"popover__container--*",".popover__content":"popover__content--*",".popover__arrow":"popover__arrow--*"},_animatorDict$4={"default":function(){return platform.isAndroid()?MDFadePopoverAnimator:IOSFadePopoverAnimator},none:PopoverAnimator,"fade-ios":IOSFadePopoverAnimator,"fade-md":MDFadePopoverAnimator},templateSource=util.createFragment('\n <div class="popover-mask"></div>\n <div class="popover__container">\n <div class="popover__content"></div>\n <div class="popover__arrow"></div>\n </div>\n'),positions={up:"bottom",left:"right",down:"top",right:"left"},PopoverElement=function(_BaseElement){function PopoverElement(){return classCallCheck(this,PopoverElement),possibleConstructorReturn(this,(PopoverElement.__proto__||Object.getPrototypeOf(PopoverElement)).apply(this,arguments))}return inherits(PopoverElement,_BaseElement),createClass(PopoverElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile(),_this2._initAnimatorFactory()}),this._doorLock=new DoorLock,this._boundOnChange=this._onChange.bind(this),this._boundCancel=this._cancel.bind(this)}},{key:"_initAnimatorFactory",value:function(){var factory=new AnimatorFactory({animators:_animatorDict$4,baseClass:PopoverAnimator,baseClassName:"PopoverAnimator",defaultAnimation:this.getAttribute("animation")||"default"});this._animator=function(options){return factory.newAnimator(options)}}},{key:"_positionPopover",value:function(target){var radius=this._radius,el=this._content,margin=this._margin,pos=target.getBoundingClientRect(),isMD=util.hasModifier(this,"material"),cover=isMD&&this.hasAttribute("cover-target"),distance={top:pos.top-margin,left:pos.left-margin,right:window.innerWidth-pos.right-margin,bottom:window.innerHeight-pos.bottom-margin},_calculateDirections2=this._calculateDirections(distance),vertical=_calculateDirections2.vertical,primary=_calculateDirections2.primary,secondary=_calculateDirections2.secondary;this._popover.classList.add("popover--"+primary);var offset=cover?0:(vertical?pos.height:pos.width)+(isMD?0:14);this.style[primary]=Math.max(0,distance[primary]+offset)+margin+"px",el.style[primary]=0;var l=vertical?"width":"height",sizes=function(style){return{width:parseInt(style.getPropertyValue("width")),height:parseInt(style.getPropertyValue("height"))}}(window.getComputedStyle(el));el.style[secondary]=Math.max(0,distance[secondary]-(sizes[l]-pos[l])/2)+"px",this._arrow.style[secondary]=Math.max(radius,distance[secondary]+pos[l]/2)+"px",this._setTransformOrigin(distance,sizes,pos,primary),el.removeAttribute("data-animit-orig-style")}},{key:"_setTransformOrigin",value:function(distance,sizes,pos,primary){var calc=function(a,o,l){return primary===a?sizes[l]/2:distance[a]+(primary===o?-sizes[l]:sizes[l]-pos[l])/2},x=calc("left","right","width")+"px",y=calc("top","bottom","height")+"px";util.extend(this._popover.style,{transformOrigin:x+" "+y,webkitTransformOriginX:x,webkitTransformOriginY:y})}},{key:"_calculateDirections",value:function(distance){var options=(this.getAttribute("direction")||"up down left right").split(/\s+/).map(function(e){return positions[e]}),primary=options.sort(function(a,b){return distance[a]-distance[b]})[0],vertical=["top","bottom"].indexOf(primary)!==-1,secondary=void 0;return secondary=vertical?distance.left<distance.right?"left":"right":distance.top<distance.bottom?"top":"bottom",{vertical:vertical,primary:primary,secondary:secondary}}},{key:"_clearStyles",value:function(){var _this3=this;["top","bottom","left","right"].forEach(function(e){_this3._arrow.style[e]=_this3._content.style[e]=_this3.style[e]="",_this3._popover.classList.remove("popover--"+e)})}},{key:"_onChange",value:function(){var _this4=this;setImmediate(function(){_this4._currentTarget&&_this4._positionPopover(_this4._currentTarget)})}},{key:"_compile",value:function(){if(autoStyle.prepare(this),!this.classList.contains("popover")){this.classList.add("popover");var hasDefaultContainer=this._popover&&this._content;if(hasDefaultContainer){if(!this._mask){var mask=document.createElement("div");mask.classList.add("popover-mask"),this.insertBefore(mask,this.firstChild)}if(!this._arrow){var arrow=document.createElement("div");arrow.classList.add("popover__arrow"),this._popover.appendChild(arrow)}}else{for(var template=templateSource.cloneNode(!0),content=template.querySelector(".popover__content");this.childNodes[0];)content.appendChild(this.childNodes[0]);this.appendChild(template)}this.hasAttribute("style")&&(this._popover.setAttribute("style",this.getAttribute("style")),this.removeAttribute("style")),this.hasAttribute("mask-color")&&(this._mask.style.backgroundColor=this.getAttribute("mask-color")),ModifierUtil.initModifier(this,scheme$14)}}},{key:"_prepareAnimationOptions",value:function(options){if(options.animation&&!(options.animation in _animatorDict$4))throw new Error("Animator "+options.animation+" is not registered.");options.animationOptions=util.extend(AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options")),options.animationOptions||{})}},{key:"_executeAction",value:function(actions){var _this5=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},callback=options.callback,action=actions.action,before=actions.before,after=actions.after;this._prepareAnimationOptions(options);var canceled=!1;return util.triggerElementEvent(this,"pre"+action,{popover:this,cancel:function(){return canceled=!0}}),canceled?Promise.reject("Canceled in pre"+action+" event."):new Promise(function(resolve){_this5._doorLock.waitUnlock(function(){var unlock=_this5._doorLock.lock();before&&before(),contentReady(_this5,function(){_this5._animator(options)[action](_this5,function(){after&&after(),unlock(),util.triggerElementEvent(_this5,"post"+action,{popover:_this5}),callback&&callback(),resolve(_this5)})})})})}},{key:"show",value:function(target){var _this6=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof target?target=document.querySelector(target):target instanceof Event&&(target=target.target),"undefined"==typeof target)throw new Error("A target argument must be defined for the popover.");if(!(target instanceof HTMLElement))throw new Error("Invalid target");return this._executeAction({action:"show",before:function(){_this6.style.display="block",_this6._currentTarget=target,_this6._positionPopover(target)}},options)}},{key:"hide",value:function(){var _this7=this,options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._executeAction({action:"hide",after:function(){_this7.style.display="none",_this7._clearStyles()}},options)}},{key:"_resetBackButtonHandler",value:function(){var _this8=this;this.onDeviceBackButton=function(e){return _this8.cancelable?_this8._cancel():e.callParentHandler()}}},{key:"connectedCallback",value:function(){var _this9=this;this._resetBackButtonHandler(),contentReady(this,function(){_this9._margin=_this9._margin||parseInt(window.getComputedStyle(_this9).getPropertyValue("top")),_this9._margin||(_this9._margin=6),_this9._radius=parseInt(window.getComputedStyle(_this9._content).getPropertyValue("border-top-left-radius")),_this9._mask.addEventListener("click",_this9._boundCancel,!1),_this9._resetBackButtonHandler(),window.addEventListener("resize",_this9._boundOnChange,!1)})}},{key:"disconnectedCallback",value:function(){var _this10=this;contentReady(this,function(){_this10._mask.removeEventListener("click",_this10._boundCancel,!1),_this10._backButtonHandler.destroy(),_this10._backButtonHandler=null,window.removeEventListener("resize",_this10._boundOnChange,!1)})}},{key:"attributeChangedCallback",value:function(name,last,current){return"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme$14):"direction"===name?this._boundOnChange():void("animation"===name&&this._initAnimatorFactory())}},{key:"_cancel",value:function(){var _this11=this;this.cancelable&&this.hide({callback:function(){util.triggerElementEvent(_this11,"dialog-cancel")}})}},{key:"_mask",get:function(){return util.findChild(this,".popover-mask")}},{key:"_popover",get:function(){return util.findChild(this,".popover__container")}},{key:"_content",get:function(){return util.findChild(this._popover,".popover__content")}},{key:"_arrow",get:function(){return util.findChild(this._popover,".popover__arrow")}},{key:"visible",get:function(){return"none"!==window.getComputedStyle(this).getPropertyValue("display")}},{key:"cancelable",set:function(value){return util.toggleAttribute(this,"cancelable",value)},get:function(){return this.hasAttribute("cancelable")}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(callback){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,callback)}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator.prototype instanceof PopoverAnimator))throw new Error('"Animator" param must inherit PopoverAnimator');_animatorDict$4[name]=Animator}},{key:"observedAttributes",get:function(){return["modifier","direction","animation"]}},{key:"PopoverAnimator",get:function(){return PopoverAnimator}}]),PopoverElement}(BaseElement);customElements.define("ons-popover",PopoverElement);var scheme$15={".progress-bar":"progress-bar--*",".progress-bar__primary":"progress-bar__primary--*",".progress-bar__secondary":"progress-bar__secondary--*"},template=util.createElement('\n <div class="progress-bar">\n <div class="progress-bar__secondary"></div>\n <div class="progress-bar__primary"></div>\n </div>\n'),ProgressBarElement=function(_BaseElement){function ProgressBarElement(){return classCallCheck(this,ProgressBarElement),possibleConstructorReturn(this,(ProgressBarElement.__proto__||Object.getPrototypeOf(ProgressBarElement)).apply(this,arguments))}return inherits(ProgressBarElement,_BaseElement),createClass(ProgressBarElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){return _this2._compile()})}},{key:"_compile",value:function(){this._isCompiled()?this._template=util.findChild(this,".progress-bar"):this._template=template.cloneNode(!0),this._primary=util.findChild(this._template,".progress-bar__primary"),this._secondary=util.findChild(this._template,".progress-bar__secondary"),this._updateDeterminate(),this._updateValue(),this.appendChild(this._template),ModifierUtil.initModifier(this,scheme$15)}},{key:"_isCompiled",value:function(){if(!util.findChild(this,".progress-bar"))return!1;var barElement=util.findChild(this,".progress-bar");return!!util.findChild(barElement,".progress-bar__secondary")&&!!util.findChild(barElement,".progress-bar__primary")}},{key:"attributeChangedCallback",value:function(name,last,current){return"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme$15):void("value"===name||"secondary-value"===name?this._updateValue():"indeterminate"===name&&this._updateDeterminate())}},{key:"_updateDeterminate",value:function(){var _this3=this;this.hasAttribute("indeterminate")?contentReady(this,function(){_this3._template.classList.add("progress-bar--indeterminate"),_this3._template.classList.remove("progress-bar--determinate")}):contentReady(this,function(){_this3._template.classList.add("progress-bar--determinate"),_this3._template.classList.remove("progress-bar--indeterminate")})}},{key:"_updateValue",value:function(){var _this4=this;contentReady(this,function(){_this4._primary.style.width=_this4.hasAttribute("value")?_this4.getAttribute("value")+"%":"0%",_this4._secondary.style.width=_this4.hasAttribute("secondary-value")?_this4.getAttribute("secondary-value")+"%":"0%"})}},{key:"value",set:function(value){if("number"!=typeof value||value<0||value>100)throw new Error("Invalid value");this.setAttribute("value",Math.floor(value))},get:function(){return parseInt(this.getAttribute("value")||"0")}},{key:"secondaryValue",set:function(value){if("number"!=typeof value||value<0||value>100)throw new Error("Invalid value");this.setAttribute("secondary-value",Math.floor(value))},get:function(){return parseInt(this.getAttribute("secondary-value")||"0")}},{key:"indeterminate",set:function(value){value?this.setAttribute("indeterminate",""):this.removeAttribute("indeterminate")},get:function(){return this.hasAttribute("indeterminate")}}],[{key:"observedAttributes",get:function(){return["modifier","value","secondary-value","indeterminate"]}}]),ProgressBarElement}(BaseElement);customElements.define("ons-progress-bar",ProgressBarElement);var scheme$16={".progress-circular":"progress-circular--*",".progress-circular__primary":"progress-circular__primary--*",".progress-circular__secondary":"progress-circular__secondary--*"},template$1=util.createElement('\n <svg class="progress-circular">\n <circle class="progress-circular__secondary" cx="50%" cy="50%" r="40%" fill="none" stroke-width="10%" stroke-miterlimit="10"/>\n <circle class="progress-circular__primary" cx="50%" cy="50%" r="40%" fill="none" stroke-width="10%" stroke-miterlimit="10"/>\n </svg>\n'),ProgressCircularElement=function(_BaseElement){function ProgressCircularElement(){return classCallCheck(this,ProgressCircularElement),possibleConstructorReturn(this,(ProgressCircularElement.__proto__||Object.getPrototypeOf(ProgressCircularElement)).apply(this,arguments))}return inherits(ProgressCircularElement,_BaseElement),createClass(ProgressCircularElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){return _this2._compile()})}},{key:"attributeChangedCallback",value:function(name,last,current){return"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme$16):void("value"===name||"secondary-value"===name?this._updateValue():"indeterminate"===name&&this._updateDeterminate())}},{key:"_updateDeterminate",value:function(){var _this3=this;this.hasAttribute("indeterminate")?contentReady(this,function(){_this3._template.classList.add("progress-circular--indeterminate"),_this3._template.classList.remove("progress-circular--determinate")}):contentReady(this,function(){_this3._template.classList.add("progress-circular--determinate"),_this3._template.classList.remove("progress-circular--indeterminate")})}},{key:"_updateValue",value:function(){var _this4=this;this.hasAttribute("value")&&contentReady(this,function(){var per=Math.ceil(251.32*_this4.getAttribute("value")*.01);_this4._primary.style["stroke-dasharray"]=per+"%, 251.32%"}),this.hasAttribute("secondary-value")&&contentReady(this,function(){var per=Math.ceil(251.32*_this4.getAttribute("secondary-value")*.01);_this4._secondary.style["stroke-dasharray"]=per+"%, 251.32%"})}},{key:"_compile",value:function(){this._isCompiled()?this._template=util.findChild(this,".progress-circular"):this._template=template$1.cloneNode(!0),this._primary=util.findChild(this._template,".progress-circular__primary"),this._secondary=util.findChild(this._template,".progress-circular__secondary"),this._updateDeterminate(),this._updateValue(),this.appendChild(this._template),ModifierUtil.initModifier(this,scheme$16)}},{key:"_isCompiled",value:function(){if(!util.findChild(this,".progress-circular"))return!1;var svg=util.findChild(this,".progress-circular");return!!util.findChild(svg,".progress-circular__secondary")&&!!util.findChild(svg,".progress-circular__primary")}},{key:"value",set:function(value){if("number"!=typeof value||value<0||value>100)throw new Error("Invalid value");this.setAttribute("value",Math.floor(value))},get:function(){return parseInt(this.getAttribute("value")||"0")}},{key:"secondaryValue",set:function(value){if("number"!=typeof value||value<0||value>100)throw new Error("Invalid value");this.setAttribute("secondary-value",Math.floor(value))},get:function(){return parseInt(this.getAttribute("secondary-value")||"0")}},{key:"indeterminate",set:function(value){value?this.setAttribute("indeterminate",""):this.removeAttribute("indeterminate")},get:function(){return this.hasAttribute("indeterminate")}}],[{key:"observedAttributes",get:function(){return["modifier","value","secondary-value","indeterminate"]}}]),ProgressCircularElement}(BaseElement);customElements.define("ons-progress-circular",ProgressCircularElement);var STATE_INITIAL="initial",STATE_PREACTION="preaction",STATE_ACTION="action",removeTransform=function(el){el.style.transform="",el.style.WebkitTransform="",el.style.transition="",el.style.WebkitTransition=""},PullHookElement=function(_BaseElement){function PullHookElement(){return classCallCheck(this,PullHookElement),possibleConstructorReturn(this,(PullHookElement.__proto__||Object.getPrototypeOf(PullHookElement)).apply(this,arguments))}return inherits(PullHookElement,_BaseElement),createClass(PullHookElement,[{key:"init",value:function(){this._boundOnDrag=this._onDrag.bind(this),this._boundOnDragStart=this._onDragStart.bind(this),this._boundOnDragEnd=this._onDragEnd.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._setState(STATE_INITIAL,!0)}},{key:"_setStyle",value:function(){var height=this.height;this.style.height=height+"px",this.style.lineHeight=height+"px",this.style.marginTop="-1px",this._pageElement.style.marginTop="-"+height+"px"}},{key:"_onScroll",value:function(event){var element=this._pageElement;element.scrollTop<0&&(element.scrollTop=0)}},{key:"_generateTranslationTransform",value:function(scroll){return"translate3d(0px, "+scroll+"px, 0px)"}},{key:"_onDrag",value:function(event){var _this2=this;if(!this.disabled){if(platform.isAndroid()){var element=this._pageElement;element.scrollTop=this._startScroll-event.gesture.deltaY,element.scrollTop<window.innerHeight&&"up"!==event.gesture.direction&&event.gesture.preventDefault()}if(0===this._currentTranslation&&0===this._getCurrentScroll()){this._transitionDragLength=event.gesture.deltaY;var direction=event.gesture.interimDirection;"down"===direction?this._transitionDragLength-=1:this._transitionDragLength+=1}var scroll=Math.max(event.gesture.deltaY-this._startScroll,0);this._thresholdHeightEnabled()&&scroll>=this.thresholdHeight?(event.gesture.stopDetect(),setImmediate(function(){return _this2._finish()})):scroll>=this.height?this._setState(STATE_PREACTION):this._setState(STATE_INITIAL),"up"!==event.gesture.direction&&"down"!==event.gesture.direction||event.stopPropagation(),this._translateTo(scroll)}}},{key:"_onDragStart",value:function(event){this.disabled||(this._startScroll=this._getCurrentScroll())}},{key:"_onDragEnd",value:function(event){if(!this.disabled&&this._currentTranslation>0){var scroll=this._currentTranslation;scroll>this.height?this._finish():this._translateTo(0,{animate:!0})}}},{key:"_finish",value:function(){var _this3=this;this._setState(STATE_ACTION),this._translateTo(this.height,{animate:!0});var action=this.onAction||function(done){return done()};action(function(){_this3._translateTo(0,{animate:!0}),_this3._setState(STATE_INITIAL)})}},{key:"_thresholdHeightEnabled",value:function(){var th=this.thresholdHeight;return th>0&&th>=this.height}},{key:"_setState",value:function(state,noEvent){var lastState=this._getState();this.setAttribute("state",state),noEvent||lastState===this._getState()||util.triggerElementEvent(this,"changestate",{pullHook:this,state:state,lastState:lastState})}},{key:"_getState",value:function(){return this.getAttribute("state")}},{key:"_getCurrentScroll",value:function(){return this._pageElement.scrollTop}},{key:"_isContentFixed",value:function(){return this.hasAttribute("fixed-content")}},{key:"_getScrollableElement",value:function(){return this._isContentFixed()?this:this._pageElement}},{key:"_translateTo",value:function(scroll){var _this4=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(0!=this._currentTranslation||0!=scroll){var done=function(){if(0===scroll){var el=_this4._getScrollableElement();removeTransform(el)}options.callback&&options.callback()};this._currentTranslation=scroll,options.animate?animit(this._getScrollableElement()).queue({transform:this._generateTranslationTransform(scroll)},{duration:.3,timing:"cubic-bezier(.1, .7, .1, 1)"}).play(done):animit(this._getScrollableElement()).queue({transform:this._generateTranslationTransform(scroll)}).play(done)}}},{key:"_disableDragLock",value:function(){this._dragLockDisabled=!0,this._destroyEventListeners(),this._createEventListeners()}},{key:"_createEventListeners",value:function(){this._gestureDetector=new GestureDetector(this._pageElement,{dragMinDistance:1,dragDistanceCorrection:!1,dragLockToAxis:!this._dragLockDisabled}),this._gestureDetector.on("dragup dragdown dragleft dragright",this._boundOnDrag),this._gestureDetector.on("dragstart",this._boundOnDragStart),this._gestureDetector.on("dragend",this._boundOnDragEnd),this._pageElement.addEventListener("scroll",this._boundOnScroll,!1)}},{key:"_destroyEventListeners",value:function(){this._gestureDetector&&(this._gestureDetector.off("dragup dragdown dragleft dragright",this._boundOnDrag),this._gestureDetector.off("dragstart",this._boundOnDragStart),this._gestureDetector.off("dragend",this._boundOnDragEnd),this._gestureDetector.dispose(),this._gestureDetector=null),this._pageElement.removeEventListener("scroll",this._boundOnScroll,!1)}},{key:"connectedCallback",value:function(){this._currentTranslation=0,this._pageElement=this.parentNode,this._createEventListeners(),this._setStyle()}},{key:"disconnectedCallback",value:function(){this._pageElement.style.marginTop="",this._destroyEventListeners()}},{key:"attributeChangedCallback",value:function(name,last,current){"height"===name&&this._setStyle()}},{key:"height",set:function(value){if(!util.isInteger(value))throw new Error("The height must be an integer");this.setAttribute("height",value+"px")},get:function(){return parseInt(this.getAttribute("height")||"64",10)}},{key:"thresholdHeight",set:function(value){if(!util.isInteger(value))throw new Error("The threshold height must be an integer");this.setAttribute("threshold-height",value+"px")},get:function(){return parseInt(this.getAttribute("threshold-height")||"96",10)}},{key:"state",get:function(){return this._getState()}},{key:"pullDistance",get:function(){return this._currentTranslation}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["height"]}},{key:"STATE_INITIAL",get:function(){return STATE_INITIAL}},{key:"STATE_PREACTION",get:function(){return STATE_PREACTION}},{key:"STATE_ACTION",get:function(){return STATE_ACTION}}]),PullHookElement}(BaseElement);customElements.define("ons-pull-hook",PullHookElement);var AnimatorCSS=function(){function AnimatorCSS(){classCallCheck(this,AnimatorCSS),this._queue=[],this._index=0}return createClass(AnimatorCSS,[{key:"animate",value:function(el,final){var duration=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,start=(new Date).getTime(),initial={},stopped=!1,next=!1,timeout=!1,properties=Object.keys(final),updateStyles=function(){var s=window.getComputedStyle(el);properties.forEach(s.getPropertyValue.bind(s)),s=el.offsetHeight},result={stop:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};timeout&&clearTimeout(timeout);var k=Math.min(1,((new Date).getTime()-start)/duration);return properties.forEach(function(i){el.style[i]=(1-k)*initial[i]+k*final[i]+("opacity"==i?"":"px")}),el.style.transitionDuration="0s",options.stopNext?next=!1:stopped||(stopped=!0,next&&next()),result},then:function(cb){return next=cb,stopped&&next&&next(),result},speed:function(newDuration){return internal$1.config.animationsDisabled&&(newDuration=0),stopped||!function(){timeout&&clearTimeout(timeout);var passed=(new Date).getTime()-start,k=passed/duration,remaining=newDuration*(1-k);properties.forEach(function(i){el.style[i]=(1-k)*initial[i]+k*final[i]+("opacity"==i?"":"px")}),updateStyles(),start=el.speedUpTime,duration=remaining,el.style.transitionDuration=duration/1e3+"s",properties.forEach(function(i){el.style[i]=final[i]+("opacity"==i?"":"px")}),timeout=setTimeout(result.stop,remaining)}(),result},finish:function(){var milliseconds=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,k=((new Date).getTime()-start)/duration;return result.speed(milliseconds/(1-k)),result}};if(el.hasAttribute("disabled")||stopped||internal$1.config.animationsDisabled)return result;var style=window.getComputedStyle(el);return properties.forEach(function(e){var v=parseFloat(style.getPropertyValue(e));initial[e]=isNaN(v)?0:v}),stopped||(el.style.transitionProperty=properties.join(","),el.style.transitionDuration=duration/1e3+"s",properties.forEach(function(e){el.style[e]=final[e]+("opacity"==e?"":"px")})),timeout=setTimeout(result.stop,duration),this._onStopAnimations(el,result.stop),result}}]),createClass(AnimatorCSS,[{key:"_onStopAnimations",value:function(el,listener){var queue=this._queue,i=this._index++;queue[el]=queue[el]||[],queue[el][i]=function(options){return delete queue[el][i],queue[el]&&0==queue[el].length&&delete queue[el],listener(options)}}},{key:"stopAnimations",value:function(el){var _this=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(el)?el.forEach(function(el){_this.stopAnimations(el,options)}):void(this._queue[el]||[]).forEach(function(e){e(options||{})})}},{key:"stopAll",value:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.stopAnimations(Object.keys(this._queue),options)}},{key:"fade",value:function(el){var duration=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return this.animate(el,{opacity:0},duration)}}]),AnimatorCSS}(),RippleElement=function(_BaseElement){function RippleElement(){return classCallCheck(this,RippleElement),possibleConstructorReturn(this,(RippleElement.__proto__||Object.getPrototypeOf(RippleElement)).apply(this,arguments))}return inherits(RippleElement,_BaseElement),createClass(RippleElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){return _this2._compile()}),this._animator=new AnimatorCSS,["color","center","start-radius","background"].forEach(function(e){_this2.attributeChangedCallback(e,null,_this2.getAttribute(e))})}},{key:"_compile",value:function(){this.classList.add("ripple"),this._wave=this.getElementsByClassName("ripple__wave")[0],this._background=this.getElementsByClassName("ripple__background")[0],
11this._background&&this._wave||(this._wave=util.create(".ripple__wave"),this._background=util.create(".ripple__background"),this.appendChild(this._wave),this.appendChild(this._background))}},{key:"_calculateCoords",value:function(e){var x,y,h,w,r,b=this.getBoundingClientRect();return this._center?(x=b.width/2,y=b.height/2,r=Math.sqrt(x*x+y*y)):(x=(e.clientX||e.changedTouches[0].clientX)-b.left,y=(e.clientY||e.changedTouches[0].clientY)-b.top,h=Math.max(y,b.height-y),w=Math.max(x,b.width-x),r=Math.sqrt(h*h+w*w)),{x:x,y:y,r:r}}},{key:"_rippleAnimation",value:function(e){var duration=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,_animator=this._animator,_wave=this._wave,_background=this._background,_minR=this._minR,_calculateCoords2=this._calculateCoords(e),x=_calculateCoords2.x,y=_calculateCoords2.y,r=_calculateCoords2.r;return _animator.stopAll({stopNext:1}),_animator.animate(_background,{opacity:1},duration),util.extend(_wave.style,{opacity:1,top:y-_minR+"px",left:x-_minR+"px",width:2*_minR+"px",height:2*_minR+"px"}),_animator.animate(_wave,{top:y-r,left:x-r,height:2*r,width:2*r},duration)}},{key:"_updateParent",value:function(){if(!this._parentUpdated&&this.parentNode){var computedStyle=window.getComputedStyle(this.parentNode);"static"===computedStyle.getPropertyValue("position")&&(this.parentNode.style.position="relative"),this._parentUpdated=!0}}},{key:"_onTap",value:function(e){var _this3=this;this.disabled||(this._updateParent(),this._rippleAnimation(e.gesture.srcEvent).then(function(){_this3._animator.fade(_this3._wave),_this3._animator.fade(_this3._background)}))}},{key:"_onHold",value:function(e){this.disabled||(this._updateParent(),this._holding=this._rippleAnimation(e.gesture.srcEvent,2e3),document.addEventListener("release",this._boundOnRelease))}},{key:"_onRelease",value:function(e){var _this4=this;this._holding&&(this._holding.speed(300).then(function(){_this4._animator.stopAll({stopNext:!0}),_this4._animator.fade(_this4._wave),_this4._animator.fade(_this4._background)}),this._holding=!1),document.removeEventListener("release",this._boundOnRelease)}},{key:"_onDragStart",value:function(e){return this._holding?this._onRelease(e):void(["left","right"].indexOf(e.gesture.direction)!=-1&&this._onTap(e))}},{key:"connectedCallback",value:function(){this._parentNode=this.parentNode,this._boundOnTap=this._onTap.bind(this),this._boundOnHold=this._onHold.bind(this),this._boundOnDragStart=this._onDragStart.bind(this),this._boundOnRelease=this._onRelease.bind(this),internal$1.config.animationsDisabled?this.disabled=!0:(this._parentNode.addEventListener("tap",this._boundOnTap),this._parentNode.addEventListener("hold",this._boundOnHold),this._parentNode.addEventListener("dragstart",this._boundOnDragStart))}},{key:"disconnectedCallback",value:function(){var pn=this._parentNode||this.parentNode;pn.removeEventListener("tap",this._boundOnTap),pn.removeEventListener("hold",this._boundOnHold),pn.removeEventListener("dragstart",this._boundOnDragStart)}},{key:"attributeChangedCallback",value:function(name,last,current){var _this5=this;"start-radius"===name&&(this._minR=Math.max(0,parseFloat(current)||0)),"color"===name&&current&&contentReady(this,function(){_this5._wave.style.background=current,_this5.hasAttribute("background")||(_this5._background.style.background=current)}),"background"===name&&(current||last)&&("none"===current?contentReady(this,function(){_this5._background.setAttribute("disabled","disabled"),_this5._background.style.background="transparent"}):contentReady(this,function(){_this5._background.hasAttribute("disabled")&&_this5._background.removeAttribute("disabled"),_this5._background.style.background=current})),"center"===name&&(this._center=null!=current&&"false"!=current)}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["start-radius","color","background","center"]}}]),RippleElement}(BaseElement);customElements.define("ons-ripple",RippleElement);var RowElement=function(_BaseElement){function RowElement(){return classCallCheck(this,RowElement),possibleConstructorReturn(this,(RowElement.__proto__||Object.getPrototypeOf(RowElement)).apply(this,arguments))}return inherits(RowElement,_BaseElement),RowElement}(BaseElement);customElements.define("ons-row",RowElement);var scheme$17={"":"speed-dial__item--*"},SpeedDialItemElement=function(_BaseElement){function SpeedDialItemElement(){return classCallCheck(this,SpeedDialItemElement),possibleConstructorReturn(this,(SpeedDialItemElement.__proto__||Object.getPrototypeOf(SpeedDialItemElement)).apply(this,arguments))}return inherits(SpeedDialItemElement,_BaseElement),createClass(SpeedDialItemElement,[{key:"init",value:function(){this._compile(),this._boundOnClick=this._onClick.bind(this)}},{key:"attributeChangedCallback",value:function(name,last,current){switch(name){case"modifier":ModifierUtil.onModifierChanged(last,current,this,scheme$17);break;case"ripple":this._updateRipple()}}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick,!1)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1)}},{key:"_updateRipple",value:function(){util.updateRipple(this)}},{key:"_onClick",value:function(e){e.stopPropagation()}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("fab"),this.classList.add("fab--mini"),this.classList.add("speed-dial__item"),this._updateRipple(),ModifierUtil.initModifier(this,scheme$17)}}],[{key:"observedAttributes",get:function(){return["modifier","ripple"]}}]),SpeedDialItemElement}(BaseElement);customElements.define("ons-speed-dial-item",SpeedDialItemElement);var styler=function styler(element,style){return styler.css.apply(styler,arguments)};styler.css=function(element,styles){var keys=Object.keys(styles);return keys.forEach(function(key){key in element.style?element.style[key]=styles[key]:styler._prefix(key)in element.style?element.style[styler._prefix(key)]=styles[key]:console.warn("No such style property: "+key)}),element},styler._prefix=function(){var styles=window.getComputedStyle(document.documentElement,""),prefix=(Array.prototype.slice.call(styles).join("").match(/-(moz|webkit|ms)-/)||""===styles.OLink&&["","o"])[1];return function(name){return prefix+name.substr(0,1).toUpperCase()+name.substr(1)}}(),styler.clear=function(element){styler._clear(element)},styler._clear=function(element){for(var len=element.style.length,style=element.style,keys=[],i=0;i<len;i++)keys.push(style[i]);keys.forEach(function(key){style[key]=""})};var scheme$18={"":"speed-dial--*"},SpeedDialElement=function(_BaseElement){function SpeedDialElement(){return classCallCheck(this,SpeedDialElement),possibleConstructorReturn(this,(SpeedDialElement.__proto__||Object.getPrototypeOf(SpeedDialElement)).apply(this,arguments))}return inherits(SpeedDialElement,_BaseElement),createClass(SpeedDialElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile()}),this._shown=!0,this._itemShown=!1,this._boundOnClick=this._onClick.bind(this)}},{key:"_compile",value:function(){this.classList.contains("speed__dial")||(this.classList.add("speed__dial"),autoStyle.prepare(this),this._updateRipple(),ModifierUtil.initModifier(this,scheme$18),this.hasAttribute("direction")?this._updateDirection(this.getAttribute("direction")):this._updateDirection("up")),this._updatePosition()}},{key:"attributeChangedCallback",value:function(name,last,current){var _this3=this;switch(name){case"modifier":ModifierUtil.onModifierChanged(last,current,this,scheme$18);break;case"ripple":contentReady(this,function(){return _this3._updateRipple()});break;case"direction":contentReady(this,function(){return _this3._updateDirection(current)});break;case"position":contentReady(this,function(){return _this3._updatePosition()})}}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick,!1)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1)}},{key:"_onClick",value:function(e){!this.disabled&&this._shown&&this.toggleItems()}},{key:"_show",value:function(){this.inline||this.show()}},{key:"_hide",value:function(){this.inline||this.hide()}},{key:"_updateRipple",value:function(){var fab=util.findChild(this,"ons-fab");fab&&(this.hasAttribute("ripple")?fab.setAttribute("ripple",""):fab.removeAttribute("ripple"))}},{key:"_updateDirection",value:function(direction){for(var children=this.items,i=0;i<children.length;i++)styler(children[i],{transitionDelay:25*i+"ms",bottom:"auto",right:"auto",top:"auto",left:"auto"});switch(direction){case"up":for(var _i=0;_i<children.length;_i++)children[_i].style.bottom=72+56*_i+"px",children[_i].style.right="8px";break;case"down":for(var _i2=0;_i2<children.length;_i2++)children[_i2].style.top=72+56*_i2+"px",children[_i2].style.left="8px";break;case"left":for(var _i3=0;_i3<children.length;_i3++)children[_i3].style.top="8px",children[_i3].style.right=72+56*_i3+"px";break;case"right":for(var _i4=0;_i4<children.length;_i4++)children[_i4].style.top="8px",children[_i4].style.left=72+56*_i4+"px";break;default:throw new Error("Argument must be one of up, down, left or right.")}}},{key:"_updatePosition",value:function(){var position=this.getAttribute("position");switch(this.classList.remove("fab--top__left","fab--bottom__right","fab--bottom__left","fab--top__right","fab--top__center","fab--bottom__center"),position){case"top right":case"right top":this.classList.add("fab--top__right");break;case"top left":case"left top":this.classList.add("fab--top__left");break;case"bottom right":case"right bottom":this.classList.add("fab--bottom__right");break;case"bottom left":case"left bottom":this.classList.add("fab--bottom__left");break;case"center top":case"top center":this.classList.add("fab--top__center");break;case"center bottom":case"bottom center":this.classList.add("fab--bottom__center")}}},{key:"show",value:function(){arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.querySelector("ons-fab").show(),this._shown=!0}},{key:"hide",value:function(){var _this4=this;arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.hideItems(),setTimeout(function(){_this4.querySelector("ons-fab").hide()},200),this._shown=!1}},{key:"showItems",value:function(){if(this.hasAttribute("direction")?this._updateDirection(this.getAttribute("direction")):this._updateDirection("up"),!this._itemShown)for(var children=this.items,i=0;i<children.length;i++)styler(children[i],{transform:"scale(1)",transitionDelay:25*i+"ms"});this._itemShown=!0,util.triggerElementEvent(this,"open")}},{key:"hideItems",value:function(){if(this._itemShown)for(var children=this.items,i=0;i<children.length;i++)styler(children[i],{transform:"scale(0)",transitionDelay:25*(children.length-i)+"ms"});this._itemShown=!1,util.triggerElementEvent(this,"close")}},{key:"isOpen",value:function(){return this._itemShown}},{key:"toggle",value:function(){this.visible?this.hide():this.show()}},{key:"toggleItems",value:function(){this.isOpen()?this.hideItems():this.showItems()}},{key:"items",get:function(){return util.arrayFrom(this.querySelectorAll("ons-speed-dial-item"))}},{key:"disabled",set:function(value){return value&&this.hideItems(),util.arrayFrom(this.children).forEach(function(e){util.match(e,".fab")&&util.toggleAttribute(e,"disabled",value)}),util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}},{key:"inline",get:function(){return this.hasAttribute("inline")}},{key:"visible",get:function(){return this._shown&&"none"!==this.style.display}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","direction","position"]}}]),SpeedDialElement}(BaseElement);customElements.define("ons-speed-dial",SpeedDialElement);var rewritables$1={ready:function(element,callback){setImmediate(callback)},link:function(element,target,options,callback){callback(target)}},SplitterContentElement=function(_BaseElement){function SplitterContentElement(){return classCallCheck(this,SplitterContentElement),possibleConstructorReturn(this,(SplitterContentElement.__proto__||Object.getPrototypeOf(SplitterContentElement)).apply(this,arguments))}return inherits(SplitterContentElement,_BaseElement),createClass(SplitterContentElement,[{key:"init",value:function(){var _this2=this;this._page=null,this._pageLoader=defaultPageLoader,contentReady(this,function(){var page=_this2._getPageTarget();page&&_this2.load(page)})}},{key:"connectedCallback",value:function(){if(!util.match(this.parentNode,"ons-splitter"))throw new Error('"ons-splitter-content" must have "ons-splitter" as parentNode.')}},{key:"_getPageTarget",value:function(){return this._page||this.getAttribute("page")}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(name,last,current){}},{key:"load",value:function(page){var _this3=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._page=page;var callback=options.callback||function(){};return new Promise(function(resolve){_this3._pageLoader.load({page:page,parent:_this3,replace:!0},function(_ref){var element=_ref.element;_ref.unload;rewritables$1.link(_this3,element,options,function(fragment){setImmediate(function(){return _this3._show()}),callback(),resolve(_this3.firstChild)})})})}},{key:"_show",value:function(){util.propagateAction(this,"_show")}},{key:"_hide",value:function(){util.propagateAction(this,"_hide")}},{key:"_destroy",value:function(){util.propagateAction(this,"_destroy"),this.remove()}},{key:"page",get:function(){return this._page},set:function(page){this._page=page}},{key:"pageLoader",get:function(){return this._pageLoader},set:function(loader){if(!(loader instanceof PageLoader))throw Error("First parameter must be an instance of PageLoader");this._pageLoader=loader}}],[{key:"observedAttributes",get:function(){return[]}},{key:"rewritables",get:function(){return rewritables$1}}]),SplitterContentElement}(BaseElement);customElements.define("ons-splitter-content",SplitterContentElement);var SplitterMaskElement=function(_BaseElement){function SplitterMaskElement(){return classCallCheck(this,SplitterMaskElement),possibleConstructorReturn(this,(SplitterMaskElement.__proto__||Object.getPrototypeOf(SplitterMaskElement)).apply(this,arguments))}return inherits(SplitterMaskElement,_BaseElement),createClass(SplitterMaskElement,[{key:"init",value:function(){this._boundOnClick=this._onClick.bind(this)}},{key:"_onClick",value:function(event){util.match(this.parentNode,"ons-splitter")&&this.parentNode._sides.forEach(function(side){return side.close("left")["catch"](function(){})}),event.stopPropagation()}},{key:"attributeChangedCallback",value:function(name,last,current){}},{key:"connectedCallback",value:function(){this.addEventListener("click",this._boundOnClick)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick)}}],[{key:"observedAttributes",get:function(){return[]}}]),SplitterMaskElement}(BaseElement);customElements.define("ons-splitter-mask",SplitterMaskElement);var SplitterAnimator=function(){function SplitterAnimator(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,SplitterAnimator),this._options={timing:"cubic-bezier(.1, .7, .1, 1)",duration:"0.3",delay:"0"},this.updateOptions(options)}return createClass(SplitterAnimator,[{key:"updateOptions",value:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};util.extend(this._options,options),this._timing=this._options.timing,this._duration=this._options.duration,this._delay=this._options.delay}},{key:"activate",value:function(sideElement){var _this=this,splitter=sideElement.parentNode;contentReady(splitter,function(){_this._side=sideElement,_this._content=splitter.content,_this._mask=splitter.mask})}},{key:"inactivate",value:function(){this._content=this._side=this._mask=null}},{key:"translate",value:function(distance){animit(this._side).queue({transform:"translate3d("+(this.minus+distance)+"px, 0px, 0px)"}).play()}},{key:"open",value:function(done){animit.runAll(animit(this._side).wait(this._delay).queue({transform:"translate3d("+this.minus+"100%, 0px, 0px)"},{duration:this._duration,timing:this._timing}).queue(function(callback){callback(),done&&done()}),animit(this._mask).wait(this._delay).queue({display:"block"}).queue({opacity:"1"},{duration:this._duration,timing:"linear"}))}},{key:"close",value:function(done){var _this2=this;animit.runAll(animit(this._side).wait(this._delay).queue({transform:"translate3d(0px, 0px, 0px)"},{duration:this._duration,timing:this._timing}).queue(function(callback){_this2._side.style.webkitTransition="",done&&done(),callback()}),animit(this._mask).wait(this._delay).queue({opacity:"0"},{duration:this._duration,timing:"linear"}).queue({display:"none"}))}},{key:"minus",get:function(){return"right"===this._side._side?"-":""}}]),SplitterAnimator}(),_animatorDict$5={"default":SplitterAnimator,overlay:SplitterAnimator},SplitterElement=function(_BaseElement){function SplitterElement(){return classCallCheck(this,SplitterElement),possibleConstructorReturn(this,(SplitterElement.__proto__||Object.getPrototypeOf(SplitterElement)).apply(this,arguments))}return inherits(SplitterElement,_BaseElement),createClass(SplitterElement,[{key:"_getSide",value:function(side){var element=util.findChild(this,function(e){return util.match(e,"ons-splitter-side")&&e.getAttribute("side")===side});return element}},{key:"_onDeviceBackButton",value:function(event){this._sides.some(function(s){return!!s.isOpen&&s.close()})||event.callParentHandler()}},{key:"_onModeChange",value:function(e){var _this2=this;e.target.parentNode&&contentReady(this,function(){_this2._layout()})}},{key:"_layout",value:function(){var _this3=this;this._sides.forEach(function(side){_this3.content.style[side.side]="split"===side.mode?side._width:0})}},{key:"init",value:function(){var _this4=this;this._boundOnModeChange=this._onModeChange.bind(this),contentReady(this,function(){_this4._compile(),_this4._layout()})}},{key:"_compile",value:function(){this.mask||this.appendChild(document.createElement("ons-splitter-mask"))}},{key:"connectedCallback",value:function(){this.onDeviceBackButton=this._onDeviceBackButton.bind(this),this.addEventListener("modechange",this._boundOnModeChange,!1)}},{key:"disconnectedCallback",value:function(){this._backButtonHandler.destroy(),this._backButtonHandler=null,this.removeEventListener("modechange",this._boundOnModeChange,!1)}},{key:"attributeChangedCallback",value:function(name,last,current){}},{key:"_show",value:function(){util.propagateAction(this,"_show")}},{key:"_hide",value:function(){util.propagateAction(this,"_hide")}},{key:"_destroy",value:function(){util.propagateAction(this,"_destroy"),this.remove()}},{key:"left",get:function(){return this._getSide("left")}},{key:"right",get:function(){return this._getSide("right")}},{key:"_sides",get:function(){return[this.left,this.right].filter(function(e){return e})}},{key:"content",get:function(){return util.findChild(this,"ons-splitter-content")}},{key:"mask",get:function(){return util.findChild(this,"ons-splitter-mask")}},{key:"onDeviceBackButton",get:function(){return this._backButtonHandler},set:function(callback){this._backButtonHandler&&this._backButtonHandler.destroy(),this._backButtonHandler=deviceBackButtonDispatcher.createHandler(this,callback)}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator instanceof SplitterAnimator))throw new Error("Animator parameter must be an instance of SplitterAnimator.");_animatorDict$5[name]=Animator}},{key:"SplitterAnimator",get:function(){return SplitterAnimator}},{key:"animators",get:function(){return _animatorDict$5}}]),SplitterElement}(BaseElement);customElements.define("ons-splitter",SplitterElement);var SPLIT_MODE="split",COLLAPSE_MODE="collapse",CLOSED_STATE="closed",OPEN_STATE="open",CHANGING_STATE="changing",WATCHED_ATTRIBUTES=["animation","width","side","collapse","swipeable","swipe-target-width","animation-options","open-threshold"],rewritables$2={ready:function(splitterSideElement,callback){setImmediate(callback)},link:function(splitterSideElement,target,options,callback){callback(target)}},CollapseDetection=function(){function CollapseDetection(element,target){classCallCheck(this,CollapseDetection),this._element=element,this._boundOnChange=this._onChange.bind(this),target&&this.changeTarget(target)}return createClass(CollapseDetection,[{key:"changeTarget",value:function(target){this.disable(),this._target=target,target&&(this._orientation=["portrait","landscape"].indexOf(target)!==-1,this.activate())}},{key:"_match",value:function(value){return this._orientation?this._target===(value.isPortrait?"portrait":"landscape"):value.matches}},{key:"_onChange",value:function(value){this._element._updateMode(this._match(value)?COLLAPSE_MODE:SPLIT_MODE)}},{key:"activate",value:function(){this._orientation?(orientation.on("change",this._boundOnChange),this._onChange({isPortrait:orientation.isPortrait()})):(this._queryResult=window.matchMedia(this._target),this._queryResult.addListener(this._boundOnChange),this._onChange(this._queryResult))}},{key:"disable",value:function(){this._orientation?orientation.off("change",this._boundOnChange):this._queryResult&&(this._queryResult.removeListener(this._boundOnChange),this._queryResult=null)}}]),CollapseDetection}(),widthToPx=function(width,parent){var _ref=[parseInt(width,10),/px/.test(width)],value=_ref[0],px=_ref[1];return px?value:Math.round(parent.offsetWidth*value/100)},CollapseMode=function(){function CollapseMode(element){classCallCheck(this,CollapseMode),this._active=!1,this._state=CLOSED_STATE,this._element=element,this._lock=new DoorLock}return createClass(CollapseMode,[{key:"_animator",get:function(){return this._element._animator}}]),createClass(CollapseMode,[{key:"isOpen",value:function(){return this._active&&this._state!==CLOSED_STATE}},{key:"handleGesture",value:function(e){!this._active||this._lock.isLocked()||this._isOpenOtherSideMenu()||("dragstart"===e.type?this._onDragStart(e):this._ignoreDrag||("dragend"===e.type?this._onDragEnd(e):this._onDrag(e)))}},{key:"_onDragStart",value:function(event){var scrolling=!/left|right/.test(event.gesture.direction),distance="left"===this._element._side?event.gesture.center.clientX:window.innerWidth-event.gesture.center.clientX,area=this._element._swipeTargetWidth,isOpen=this.isOpen();this._ignoreDrag=scrolling||area&&distance>area&&!isOpen,this._width=widthToPx(this._element._width,this._element.parentNode),this._startDistance=this._distance=isOpen?this._width:0}},{key:"_onDrag",value:function(event){event.gesture.preventDefault();var delta="left"===this._element._side?event.gesture.deltaX:-event.gesture.deltaX,distance=Math.max(0,Math.min(this._width,this._startDistance+delta));distance!==this._distance&&(this._animator.translate(distance),this._distance=distance,this._state=CHANGING_STATE)}},{key:"_onDragEnd",value:function(event){var distance=this._distance,width=this._width,el=this._element,direction=event.gesture.interimDirection,shouldOpen=el._side!==direction&&distance>width*el._threshold;this.executeAction(shouldOpen?"open":"close"),this._ignoreDrag=!0}},{key:"layout",value:function(){this._active&&this._state===OPEN_STATE&&this._animator.open()}},{key:"enterMode",value:function(){this._active||(this._active=!0,this.layout())}},{key:"exitMode",value:function(){this._active=!1}},{key:"_isOpenOtherSideMenu",value:function(){var _this=this;return util.arrayFrom(this._element.parentElement.children).some(function(e){return util.match(e,"ons-splitter-side")&&e!==_this._element&&e.isOpen})}},{key:"executeAction",value:function(name){var _this2=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},FINAL_STATE="open"===name?OPEN_STATE:CLOSED_STATE;if(!this._active)return Promise.resolve(!1);if(this._state===FINAL_STATE)return Promise.resolve(this._element);if(this._lock.isLocked())return Promise.reject("Splitter side is locked.");if("open"===name&&this._isOpenOtherSideMenu())return Promise.reject("Another menu is already open.");if(this._element._emitEvent("pre"+name))return Promise.reject("Canceled in pre"+name+" event.");var callback=options.callback,unlock=this._lock.lock(),done=function(){_this2._state=FINAL_STATE,_this2.layout(),unlock(),_this2._element._emitEvent("post"+name),callback&&callback()};return options.withoutAnimation?(done(),Promise.resolve(this._element)):(this._state=CHANGING_STATE,new Promise(function(resolve){_this2._animator[name](function(){done(),resolve(_this2._element)})}))}}]),CollapseMode}(),SplitterSideElement=function(_BaseElement){function SplitterSideElement(){return classCallCheck(this,SplitterSideElement),possibleConstructorReturn(this,(SplitterSideElement.__proto__||Object.getPrototypeOf(SplitterSideElement)).apply(this,arguments))}return inherits(SplitterSideElement,_BaseElement),createClass(SplitterSideElement,[{key:"init",value:function(){var _this4=this;this._page=null,this._pageLoader=defaultPageLoader,this._collapseMode=new CollapseMode(this),this._collapseDetection=new CollapseDetection(this),this._animatorFactory=new AnimatorFactory({animators:SplitterElement.animators,baseClass:SplitterAnimator,baseClassName:"SplitterAnimator",defaultAnimation:this.getAttribute("animation")}),this._boundHandleGesture=function(e){return _this4._collapseMode.handleGesture(e)},this._watchedAttributes=WATCHED_ATTRIBUTES,contentReady(this,function(){rewritables$2.ready(_this4,function(){var page=_this4._getPageTarget();page&&_this4.load(page)})})}},{key:"connectedCallback",value:function(){var _this5=this;if(!util.match(this.parentNode,"ons-splitter"))throw new Error("Parent must be an ons-splitter element.");this._gestureDetector=new GestureDetector(this.parentElement,{dragMinDistance:1}),contentReady(this,function(){_this5._watchedAttributes.forEach(function(e){return _this5._update(e)})}),this.hasAttribute("side")||this.setAttribute("side","left")}},{key:"_getPageTarget",value:function(){return this._page||this.getAttribute("page")}},{key:"disconnectedCallback",value:function(){this._collapseDetection.disable(),this._gestureDetector.dispose(),this._gestureDetector=null}},{key:"attributeChangedCallback",value:function(name,last,current){this._update(name,current)}},{key:"_update",value:function(name,value){return name="_update"+name.split("-").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(""),this[name](value)}},{key:"_emitEvent",value:function(name){if("pre"!==name.slice(0,3))return util.triggerElementEvent(this,name,{side:this});var isCanceled=!1;return util.triggerElementEvent(this,name,{side:this,cancel:function(){return isCanceled=!0}}),isCanceled}},{key:"_updateCollapse",value:function(){var value=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("collapse");return null===value||"split"===value?(this._collapseDetection.disable(),this._updateMode(SPLIT_MODE)):""===value||"collapse"===value?(this._collapseDetection.disable(),this._updateMode(COLLAPSE_MODE)):void this._collapseDetection.changeTarget(value)}},{key:"_updateMode",value:function(mode){mode!==this._mode&&(this._mode=mode,this._collapseMode[mode===COLLAPSE_MODE?"enterMode":"exitMode"](),this.setAttribute("mode",mode),util.triggerElementEvent(this,"modechange",{side:this,mode:mode}))}},{key:"_updateOpenThreshold",value:function(){var threshold=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("open-threshold");this._threshold=Math.max(0,Math.min(1,parseFloat(threshold)||.3))}},{key:"_updateSwipeable",value:function(){var swipeable=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("swipeable"),action=null===swipeable?"off":"on";this._gestureDetector&&this._gestureDetector[action]("dragstart dragleft dragright dragend",this._boundHandleGesture)}},{key:"_updateSwipeTargetWidth",value:function(){var value=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("swipe-target-width");this._swipeTargetWidth=Math.max(0,parseInt(value)||0)}},{key:"_updateWidth",value:function(){this.style.width=this._width}},{key:"_updateSide",value:function(){var side=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("side");this._side="right"===side?side:"left"}},{key:"_updateAnimation",value:function(){var animation=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("animation");this._animator=this._animatorFactory.newAnimator({animation:animation}),this._animator.activate(this)}},{key:"_updateAnimationOptions",value:function(){var value=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("animation-options");this._animator.updateOptions(AnimatorFactory.parseAnimationOptionsString(value))}},{key:"open",value:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._collapseMode.executeAction("open",options)}},{key:"close",value:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._collapseMode.executeAction("close",options)}},{key:"toggle",value:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.isOpen?this.close(options):this.open(options)}},{key:"load",value:function(page){var _this6=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._page=page;var callback=options.callback||function(){};return new Promise(function(resolve){_this6._pageLoader.load({page:page,parent:_this6,replace:!0},function(_ref2){var element=_ref2.element;_ref2.unload;rewritables$2.link(_this6,element,options,function(fragment){setImmediate(function(){return _this6._show()}),callback(),resolve(_this6.firstChild)})})})}},{key:"_show",value:function(){util.propagateAction(this,"_show")}},{key:"_hide",value:function(){util.propagateAction(this,"_hide")}},{key:"_destroy",value:function(){util.propagateAction(this,"_destroy"),this.remove()}},{key:"side",get:function(){return"right"===this.getAttribute("side")?"right":"left"}},{key:"_width",get:function(){var width=this.getAttribute("width");return/^\d+(px|%)$/.test(width)?width:"80%"},set:function(value){this.setAttribute("width",value)}},{key:"page",get:function(){return this._page},set:function(page){this._page=page}},{key:"pageLoader",get:function(){return this._pageLoader},set:function(loader){if(!(loader instanceof PageLoader))throw Error("First parameter must be an instance of PageLoader.");this._pageLoader=loader}},{key:"mode",get:function(){return this._mode}},{key:"isOpen",get:function(){return this._collapseMode.isOpen()}}],[{key:"observedAttributes",get:function(){return WATCHED_ATTRIBUTES}},{key:"rewritables",get:function(){return rewritables$2}}]),SplitterSideElement}(BaseElement);customElements.define("ons-splitter-side",SplitterSideElement);var scheme$19={"":"switch--*",".switch__input":"switch--*__input",".switch__handle":"switch--*__handle",".switch__toggle":"switch--*__toggle"},template$2=util.createFragment('\n <input type="checkbox" class="switch__input">\n <div class="switch__toggle">\n <div class="switch__handle">\n <div class="switch__touch"></div>\n </div>\n </div>\n'),locations={ios:[1,21],material:[0,16]},SwitchElement=function(_BaseElement){function SwitchElement(){return classCallCheck(this,SwitchElement),possibleConstructorReturn(this,(SwitchElement.__proto__||Object.getPrototypeOf(SwitchElement)).apply(this,arguments))}return inherits(SwitchElement,_BaseElement),createClass(SwitchElement,[{key:"init",value:function(){var _this2=this;this._checked=!1,this._disabled=!1,this._boundOnChange=this._onChange.bind(this),contentReady(this,function(){_this2._compile(),["checked","disabled","modifier","name","input-id"].forEach(function(e){_this2.attributeChangedCallback(e,null,_this2.getAttribute(e));
12})})}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("switch"),util.findChild(this,".switch__input")&&util.findChild(this,".switch__toggle")||this.appendChild(template$2.cloneNode(!0)),ModifierUtil.initModifier(this,scheme$19),this._checkbox=this.querySelector(".switch__input"),this._handle=this.querySelector(".switch__handle"),this._checkbox.checked=this._checked,this._checkbox.disbled=this._disabled}},{key:"disconnectedCallback",value:function(){var _this3=this;contentReady(this,function(){_this3._checkbox.removeEventListener("change",_this3._boundOnChange),_this3.removeEventListener("dragstart",_this3._onDragStart),_this3.removeEventListener("hold",_this3._onHold),_this3.removeEventListener("tap",_this3.click),_this3.removeEventListener("click",_this3._onClick),_this3._gestureDetector&&_this3._gestureDetector.dispose()})}},{key:"connectedCallback",value:function(){var _this4=this;contentReady(this,function(){_this4._checkbox.addEventListener("change",_this4._boundOnChange),_this4.addEventListener("dragstart",_this4._onDragStart),_this4.addEventListener("hold",_this4._onHold),_this4.addEventListener("tap",_this4.click),_this4.addEventListener("click",_this4._onClick),_this4._gestureDetector=new GestureDetector(_this4,{dragMinDistance:1,holdTimeout:251}),_this4._boundOnRelease=_this4._onRelease.bind(_this4)})}},{key:"_onChange",value:function(event){util.toggleAttribute(this,"checked",this.checkbox.checked)}},{key:"_onClick",value:function(ev){ev.target.classList.contains("switch__touch")&&ev.preventDefault()}},{key:"click",value:function(){this._disabled||(this.checked=!this.checked,util.triggerElementEvent(this,"change",{value:this.checked,"switch":this,isInteractive:!0}))}},{key:"_getPosition",value:function(e){var l=this._locations;return Math.min(l[1],Math.max(l[0],this._startX+e.gesture.deltaX))}},{key:"_onHold",value:function(e){this.disabled||(this.classList.add("switch--active"),document.addEventListener("release",this._boundOnRelease))}},{key:"_onDragStart",value:function(e){return this.disabled||["left","right"].indexOf(e.gesture.direction)===-1?void this.classList.remove("switch--active"):(e.stopPropagation(),this.classList.add("switch--active"),this._startX=this._locations[this.checked?1:0],this.addEventListener("drag",this._onDrag),void document.addEventListener("release",this._boundOnRelease))}},{key:"_onDrag",value:function(e){e.gesture.srcEvent.preventDefault(),this._handle.style.left=this._getPosition(e)+"px"}},{key:"_onRelease",value:function(e){var l=this._locations,position=this._getPosition(e),previousValue=this.checked;this.checked=position>=(l[0]+l[1])/2,this.checked!==previousValue&&util.triggerElementEvent(this,"change",{value:this.checked,"switch":this,isInteractive:!0}),this.removeEventListener("drag",this._onDrag),document.removeEventListener("release",this._boundOnRelease),this._handle.style.left="",this.classList.remove("switch--active")}},{key:"attributeChangedCallback",value:function(name,last,current){var _this5=this;contentReady(this,function(){switch(name){case"modifier":_this5._isMaterial=(current||"").indexOf("material")!==-1,_this5._locations=locations[_this5._isMaterial?"material":"ios"],ModifierUtil.onModifierChanged(last,current,_this5,scheme$19);break;case"input-id":_this5._checkbox.id=current;break;case"checked":_this5._checked=null!==current,_this5._checkbox.checked=null!==current,util.toggleAttribute(_this5._checkbox,name,null!==current);break;case"disabled":_this5._disabled=null!==current,_this5._checkbox.disabled=null!==current,util.toggleAttribute(_this5._checkbox,name,null!==current)}})}},{key:"checked",get:function(){return this._checked},set:function(value){this._checked=!!value,util.toggleAttribute(this,"checked",this._checked)}},{key:"disabled",get:function(){return this._disabled},set:function(value){this._disabled=!!value,util.toggleAttribute(this,"disabled",this._disabled),this._checkbox.disabled=this._disabled}},{key:"checkbox",get:function(){return this._checkbox}}],[{key:"observedAttributes",get:function(){return["modifier","input-id","checked","disabled"]}}]),SwitchElement}(BaseElement);customElements.define("ons-switch",SwitchElement);var TabbarAnimator=function(){function TabbarAnimator(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};classCallCheck(this,TabbarAnimator),this.timing=options.timing||"linear",this.duration=void 0!==options.duration?options.duration:"0.4",this.delay=void 0!==options.delay?options.delay:"0"}return createClass(TabbarAnimator,[{key:"apply",value:function(enterPage,leavePage,enterPageIndex,leavePageIndex,done){throw new Error("This method must be implemented.")}}]),TabbarAnimator}(),TabbarNoneAnimator=function(_TabbarAnimator){function TabbarNoneAnimator(){return classCallCheck(this,TabbarNoneAnimator),possibleConstructorReturn(this,(TabbarNoneAnimator.__proto__||Object.getPrototypeOf(TabbarNoneAnimator)).apply(this,arguments))}return inherits(TabbarNoneAnimator,_TabbarAnimator),createClass(TabbarNoneAnimator,[{key:"apply",value:function(enterPage,leavePage,enterIndex,leaveIndex,done){setTimeout(done,1e3/60)}}]),TabbarNoneAnimator}(TabbarAnimator),TabbarFadeAnimator=function(_TabbarAnimator2){function TabbarFadeAnimator(options){return classCallCheck(this,TabbarFadeAnimator),options.timing=void 0!==options.timing?options.timing:"linear",options.duration=void 0!==options.duration?options.duration:"0.4",options.delay=void 0!==options.delay?options.delay:"0",possibleConstructorReturn(this,(TabbarFadeAnimator.__proto__||Object.getPrototypeOf(TabbarFadeAnimator)).call(this,options))}return inherits(TabbarFadeAnimator,_TabbarAnimator2),createClass(TabbarFadeAnimator,[{key:"apply",value:function(enterPage,leavePage,enterPageIndex,leavePageIndex,done){animit.runAll(animit(enterPage).saveStyle().queue({transform:"translate3D(0, 0, 0)",opacity:0}).wait(this.delay).queue({transform:"translate3D(0, 0, 0)",opacity:1},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(callback){done(),callback()}),animit(leavePage).queue({transform:"translate3D(0, 0, 0)",opacity:1}).wait(this.delay).queue({transform:"translate3D(0, 0, 0)",opacity:0},{duration:this.duration,timing:this.timing}))}}]),TabbarFadeAnimator}(TabbarAnimator),TabbarSlideAnimator=function(_TabbarAnimator3){function TabbarSlideAnimator(options){return classCallCheck(this,TabbarSlideAnimator),options.timing=void 0!==options.timing?options.timing:"ease-in",options.duration=void 0!==options.duration?options.duration:"0.15",options.delay=void 0!==options.delay?options.delay:"0",possibleConstructorReturn(this,(TabbarSlideAnimator.__proto__||Object.getPrototypeOf(TabbarSlideAnimator)).call(this,options))}return inherits(TabbarSlideAnimator,_TabbarAnimator3),createClass(TabbarSlideAnimator,[{key:"apply",value:function(enterPage,leavePage,enterIndex,leaveIndex,done){var sgn=enterIndex>leaveIndex;animit.runAll(animit(enterPage).saveStyle().queue({transform:"translate3D("+(sgn?"":"-")+"100%, 0, 0)"}).wait(this.delay).queue({transform:"translate3D(0, 0, 0)"},{duration:this.duration,timing:this.timing}).restoreStyle().queue(function(callback){done(),callback()}),animit(leavePage).queue({transform:"translate3D(0, 0, 0)"}).wait(this.delay).queue({transform:"translate3D("+(sgn?"-":"")+"100%, 0, 0)"},{duration:this.duration,timing:this.timing}))}}]),TabbarSlideAnimator}(TabbarAnimator),scheme$21={".tab-bar__content":"tab-bar--*__content",".tab-bar":"tab-bar--*"},_animatorDict$6={"default":TabbarNoneAnimator,fade:TabbarFadeAnimator,slide:TabbarSlideAnimator,none:TabbarNoneAnimator},rewritables$3={ready:function(tabbarElement,callback){callback()},link:function(tabbarElement,target,options,callback){callback(target)},unlink:function(tabbarElement,target,callback){callback(target)}},generateId$1=function(){var i=0;return function(){return"ons-tabbar-gen-"+i++}}(),TabbarElement=function(_BaseElement){function TabbarElement(){return classCallCheck(this,TabbarElement),possibleConstructorReturn(this,(TabbarElement.__proto__||Object.getPrototypeOf(TabbarElement)).apply(this,arguments))}return inherits(TabbarElement,_BaseElement),createClass(TabbarElement,[{key:"init",value:function(){var _this2=this;this._tabbarId=generateId$1(),contentReady(this,function(){_this2._compile();for(var content=_this2._contentElement,i=0;i<content.children.length;i++)content.children[i].style.display="none";var activeIndex=_this2.getAttribute("activeIndex"),tabbar=_this2._tabbarElement;activeIndex&&tabbar.children.length>activeIndex&&tabbar.children[activeIndex].setAttribute("active","true"),autoStyle.prepare(_this2),ModifierUtil.initModifier(_this2,scheme$21),_this2._animatorFactory=new AnimatorFactory({animators:_animatorDict$6,baseClass:TabbarAnimator,baseClassName:"TabbarAnimator",defaultAnimation:_this2.getAttribute("animation")})})}},{key:"connectedCallback",value:function(){var _this3=this;contentReady(this,function(){return _this3._updatePosition()})}},{key:"_compile",value:function(){if(this._contentElement&&this._tabbarElement){var content=util.findChild(this,".tab-bar__content"),bar=util.findChild(this,".tab-bar");content.classList.add("ons-tab-bar__content"),bar.classList.add("ons-tab-bar__footer")}else{for(var _content=util.create(".ons-tab-bar__content.tab-bar__content"),tabbar=util.create(".tab-bar.ons-tab-bar__footer");this.firstChild;)tabbar.appendChild(this.firstChild);this.appendChild(_content),this.appendChild(tabbar)}}},{key:"_updatePosition",value:function(){var _this4=this,position=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAttribute("position"),top=this._top="top"===position||"auto"===position&&platform.isAndroid(),action=top?util.addModifier:util.removeModifier;action(this,"top");var page=util.findParent(this,"ons-page");page&&(this.style.top=top?window.getComputedStyle(page._getContentElement(),null).getPropertyValue("padding-top"):"",util.match(page.firstChild,"ons-toolbar")&&action(page.firstChild,"noshadow")),internal$1.autoStatusBarFill(function(){var filled=util.findParent(_this4,function(e){return e.hasAttribute("status-bar-fill")});util.toggleAttribute(_this4,"status-bar-fill",top&&!filled)})}},{key:"_getTabbarElement",value:function(){return util.findChild(this,".tab-bar")}},{key:"loadPage",value:function(page){var _this5=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return console.warn("The loadPage method has been deprecated and will be removed in the next minor version."),new Promise(function(resolve){var tab=_this5._tabbarElement.children[0]||new TabElement;tab._loadPage(page,_this5._contentElement,function(pageElement){resolve(_this5._loadPageDOMAsync(pageElement,options))})})}},{key:"_loadPageDOMAsync",value:function(pageElement){var _this6=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(resolve){rewritables$3.link(_this6,pageElement,options,function(pageElement){_this6._contentElement.appendChild(pageElement),_this6.getActiveTabIndex()!==-1?resolve(_this6._switchPage(pageElement,options)):(options.callback instanceof Function&&options.callback(),_this6._oldPageElement=pageElement,resolve(pageElement))})})}},{key:"getTabbarId",value:function(){return this._tabbarId}},{key:"_getCurrentPageElement",value:function(){for(var pages=this._contentElement.children,page=null,i=0;i<pages.length;i++)if("none"!==pages[i].style.display){page=pages[i];break}if(page&&"ons-page"!==page.nodeName.toLowerCase())throw new Error('Invalid state: page element must be a "ons-page" element.');return page}},{key:"_switchPage",value:function(element,options){var oldPageElement=this._oldPageElement||internal$1.nullElement;this._oldPageElement=element;var animator=this._animatorFactory.newAnimator(options);return new Promise(function(resolve){oldPageElement!==internal$1.nullElement&&oldPageElement._hide(),animator.apply(element,oldPageElement,options.selectedTabIndex,options.previousTabIndex,function(){oldPageElement!==internal$1.nullElement&&(oldPageElement.style.display="none"),element.style.display="block",element._show(),options.callback instanceof Function&&options.callback(),resolve(element)})})}},{key:"setActiveTab",value:function(index){var _this7=this,options=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(options&&"object"!=("undefined"==typeof options?"undefined":_typeof(options)))throw new Error("options must be an object. You supplied "+options);options.animationOptions=util.extend(options.animationOptions||{},AnimatorFactory.parseAnimationOptionsString(this.getAttribute("animation-options"))),!options.animation&&this.hasAttribute("animation")&&(options.animation=this.getAttribute("animation"));var previousTab=this._getActiveTabElement(),selectedTab=this._getTabElement(index),previousTabIndex=this.getActiveTabIndex(),selectedTabIndex=index,previousPageElement=this._getCurrentPageElement();if(!selectedTab)return Promise.reject("Specified index does not match any tab.");if(selectedTabIndex===previousTabIndex)return util.triggerElementEvent(this,"reactive",{index:selectedTabIndex,tabItem:selectedTab}),Promise.resolve(previousPageElement);var canceled=!1;if(util.triggerElementEvent(this,"prechange",{index:selectedTabIndex,tabItem:selectedTab,cancel:function(){return canceled=!0}}),canceled)return selectedTab.setInactive(),previousTab&&previousTab.setActive(),Promise.reject("Canceled in prechange event.");selectedTab.setActive();var params=_extends({},options,{previousTabIndex:previousTabIndex,selectedTabIndex:selectedTabIndex});previousTab?previousTab.setInactive():params.animation="none";var link=function(element,callback){rewritables$3.link(_this7,element,options,callback)};return new Promise(function(resolve){selectedTab._loadPageElement(_this7._contentElement,function(pageElement){pageElement.removeAttribute("style"),_this7._switchPage(pageElement,params).then(function(page){return util.triggerElementEvent(_this7,"postchange",{index:selectedTabIndex,tabItem:selectedTab}),resolve(page)})},link)})}},{key:"setTabbarVisibility",value:function(visible){this._contentElement.style[this._top?"top":"bottom"]=visible?"":"0px",this._getTabbarElement().style.display=visible?"":"none"}},{key:"getActiveTabIndex",value:function(){for(var tabs=this._getTabbarElement().children,i=0;i<tabs.length;i++)if(tabs[i]instanceof TabElement&&tabs[i].isActive&&tabs[i].isActive())return i;return-1}},{key:"_getActiveTabElement",value:function(){return this._getTabElement(this.getActiveTabIndex())}},{key:"_getTabElement",value:function(index){return this._getTabbarElement().children[index]}},{key:"disconnectedCallback",value:function(){}},{key:"_show",value:function(){var currentPageElement=this._getCurrentPageElement();currentPageElement&&currentPageElement._show()}},{key:"_hide",value:function(){var currentPageElement=this._getCurrentPageElement();currentPageElement&&currentPageElement._hide()}},{key:"_destroy",value:function(){for(var pages=this._contentElement.children,i=pages.length-1;i>=0;i--)pages[i]._destroy();this.remove()}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$21)}},{key:"_contentElement",get:function(){return util.findChild(this,".tab-bar__content")}},{key:"_tabbarElement",get:function(){return util.findChild(this,".tab-bar")}},{key:"pages",get:function(){return util.arrayFrom(this._contentElement.children)}}],[{key:"registerAnimator",value:function(name,Animator){if(!(Animator.prototype instanceof TabbarAnimator))throw new Error('"Animator" param must inherit TabbarElement.TabbarAnimator');_animatorDict$6[name]=Animator}},{key:"observedAttributes",get:function(){return["modifier"]}},{key:"rewritables",get:function(){return rewritables$3}},{key:"TabbarAnimator",get:function(){return TabbarAnimator}}]),TabbarElement}(BaseElement);customElements.define("ons-tabbar",TabbarElement);var scheme$20={"":"tab-bar--*__item",".tab-bar__button":"tab-bar--*__button"},templateSource$1=util.createElement('\n <div>\n <input type="radio" style="display: none">\n <button class="tab-bar__button"></button>\n </div>\n'),defaultInnerTemplateSource=util.createElement('\n <div>\n <div class="tab-bar__icon">\n <ons-icon icon="ion-cloud"></ons-icon>\n </div>\n <div class="tab-bar__label">label</div>\n <div class="tab-bar__badge notification">1</div>\n </div>\n'),TabElement=function(_BaseElement){function TabElement(){return classCallCheck(this,TabElement),possibleConstructorReturn(this,(TabElement.__proto__||Object.getPrototypeOf(TabElement)).apply(this,arguments))}return inherits(TabElement,_BaseElement),createClass(TabElement,[{key:"init",value:function(){var _this2=this;this._pageLoader=defaultPageLoader,this._page=null,this.hasAttribute("label")||this.hasAttribute("icon")||this.hasAttribute("badge")?this._compile():contentReady(this,function(){_this2._compile()}),this._boundOnClick=this._onClick.bind(this)}},{key:"_getPageTarget",value:function(){return this.page||this.getAttribute("page")}},{key:"_templateLoaded",value:function(){if(0==this.children.length)return!1;var hasInput="radio"===this.children[0].getAttribute("type"),hasButton=util.findChild(this,".tab-bar__button");return hasInput&&hasButton}},{key:"_compile",value:function(){if(autoStyle.prepare(this),this.classList.add("tab-bar__item"),!this._templateLoaded()){for(var fragment=document.createDocumentFragment(),hasChildren=!1;this.childNodes[0];){var node=this.childNodes[0];this.removeChild(node),fragment.appendChild(node),node.nodeType==Node.ELEMENT_NODE&&(hasChildren=!0)}for(var template=templateSource$1.cloneNode(!0);template.children[0];)this.appendChild(template.children[0]);var button=util.findChild(this,".tab-bar__button");hasChildren?(button.appendChild(fragment),this._hasDefaultTemplate=!1):(this._hasDefaultTemplate=!0,this._updateDefaultTemplate())}ModifierUtil.initModifier(this,scheme$20),this._updateRipple()}},{key:"_updateRipple",value:function(){}},{key:"_updateDefaultTemplate",value:function(){function getLabelElement(){return self.querySelector(".tab-bar__label")}function getIconElement(){return self.querySelector("ons-icon")}function getBadgeElement(){return self.querySelector(".tab-bar__badge")}if(this._hasDefaultTemplate){var button=util.findChild(this,".tab-bar__button"),template=defaultInnerTemplateSource.cloneNode(!0);if(0==button.children.length)for(;template.children[0];)button.appendChild(template.children[0]);button.querySelector(".tab-bar__icon")||button.insertBefore(template.querySelector(".tab-bar__icon"),button.firstChild),button.querySelector(".tab-bar__label")||button.appendChild(template.querySelector(".tab-bar__label")),button.querySelector(".tab-bar__badge")||button.appendChild(template.querySelector(".tab-bar__badge"));var self=this,icon=this.getAttribute("icon"),label=this.getAttribute("label"),badge=this.getAttribute("badge");if("string"==typeof icon)getIconElement().setAttribute("icon",icon);else{var wrapper=button.querySelector(".tab-bar__icon");wrapper&&wrapper.remove()}if("string"==typeof label)getLabelElement().textContent=label;else{var _label=getLabelElement();_label&&_label.remove()}if("string"==typeof badge)getBadgeElement().textContent=badge;else{var _badge=getBadgeElement();_badge&&_badge.remove()}}}},{key:"_onClick",value:function(){var tabbar=this._findTabbarElement();tabbar&&tabbar.setActiveTab(this._findTabIndex())}},{key:"setActive",value:function(){var radio=util.findChild(this,"input");radio.checked=!0,this.classList.add("active"),util.arrayFrom(this.querySelectorAll("[ons-tab-inactive], ons-tab-inactive")).forEach(function(element){return element.style.display="none"}),util.arrayFrom(this.querySelectorAll("[ons-tab-active], ons-tab-active")).forEach(function(element){return element.style.display="inherit"})}},{key:"setInactive",value:function(){var radio=util.findChild(this,"input");radio.checked=!1,this.classList.remove("active"),util.arrayFrom(this.querySelectorAll("[ons-tab-inactive], ons-tab-inactive")).forEach(function(element){return element.style.display="inherit"}),util.arrayFrom(this.querySelectorAll("[ons-tab-active], ons-tab-active")).forEach(function(element){return element.style.display="none"})}},{key:"_loadPageElement",value:function(parent,callback,link){var _this3=this;if(this._loadedPage||this._getPageTarget())this._loadingPage?this._loadingPage.then(function(page){callback(page.element)}):this._loadedPage?callback(this._loadedPage.element):!function(){var deferred=util.defer();_this3._loadingPage=deferred.promise,_this3._pageLoader.load({page:_this3._getPageTarget(),parent:parent},function(page){_this3._loadedPage=page,deferred.resolve(page),delete _this3._loadingPage,link(page.element,function(element){page.element=element,callback(page.element)})})}();else{var pages=this._findTabbarElement().pages,index=this._findTabIndex();callback(pages[index])}}},{key:"_loadPage",value:function(page,parent,callback){this._pageLoader.load({page:page,parent:parent},function(page){callback(page.element)})}},{key:"isActive",value:function(){return this.classList.contains("active")}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._boundOnClick,!1),this._loadedPage&&(this._loadedPage.unload(),this._loadedPage=null)}},{key:"connectedCallback",value:function(){var _this4=this;contentReady(this,function(){_this4._ensureElementPosition();var tabbar=_this4._findTabbarElement();if(tabbar.hasAttribute("modifier")){var prefix=_this4.hasAttribute("modifier")?_this4.getAttribute("modifier")+" ":"";_this4.setAttribute("modifier",prefix+tabbar.getAttribute("modifier"))}var onReady=function(){_this4._getPageTarget()&&!_this4.hasLoaded&&(_this4.hasLoaded=!0,_this4._loadPageElement(tabbar._contentElement,function(pageElement){pageElement.style.display="none",tabbar._contentElement.appendChild(pageElement),_this4.hasAttribute("active")&&tabbar.setActiveTab(_this4._findTabIndex())},function(pageElement,done){TabbarElement.rewritables.link(tabbar,pageElement,{},function(element){return done(element)})}))};TabbarElement.rewritables.ready(tabbar,onReady),_this4.addEventListener("click",_this4._boundOnClick,!1)})}},{key:"_findTabbarElement",value:function(){return this.parentNode&&"ons-tabbar"===this.parentNode.nodeName.toLowerCase()?this.parentNode:this.parentNode.parentNode&&"ons-tabbar"===this.parentNode.parentNode.nodeName.toLowerCase()?this.parentNode.parentNode:null}},{key:"_findTabIndex",value:function(){for(var elements=this.parentNode.children,i=0;i<elements.length;i++)if(this===elements[i])return i}},{key:"_ensureElementPosition",value:function(){if(!this._findTabbarElement())throw new Error("This ons-tab element is must be child of ons-tabbar element.")}},{key:"attributeChangedCallback",value:function(name,last,current){var _this5=this;switch(name){case"modifier":contentReady(this,function(){return ModifierUtil.onModifierChanged(last,current,_this5,scheme$20)});break;case"ripple":contentReady(this,function(){return _this5._updateRipple()});break;case"icon":case"label":case"badge":contentReady(this,function(){return _this5._updateDefaultTemplate()});break;case"page":"string"==typeof current&&(this._page=current)}}},{key:"page",set:function(page){this._page=page},get:function(){return this._page}},{key:"pageLoader",set:function(loader){if(!(loader instanceof PageLoader))throw Error("First parameter must be an instance of PageLoader.");this._pageLoader=loader},get:function(){return this._pageLoader}},{key:"pageElement",get:function(){if(this._loadedPage)return this._loadedPage.element;var tabbar=this._findTabbarElement(),index=this._findTabIndex();return tabbar._contentElement.children[index]}}],[{key:"observedAttributes",get:function(){return["modifier","ripple","icon","label","page","badge"]}}]),TabElement}(BaseElement);customElements.define("ons-tab",TabElement);var scheme$22={"":"toolbar-button--*"},ToolbarButtonElement=function(_BaseElement){function ToolbarButtonElement(){return classCallCheck(this,ToolbarButtonElement),possibleConstructorReturn(this,(ToolbarButtonElement.__proto__||Object.getPrototypeOf(ToolbarButtonElement)).apply(this,arguments))}return inherits(ToolbarButtonElement,_BaseElement),createClass(ToolbarButtonElement,[{key:"init",value:function(){this._compile()}},{key:"_compile",value:function(){autoStyle.prepare(this),this.classList.add("toolbar-button"),ModifierUtil.initModifier(this,scheme$22)}},{key:"attributeChangedCallback",value:function(name,last,current){if("modifier"===name)return ModifierUtil.onModifierChanged(last,current,this,scheme$22)}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}}],[{key:"observedAttributes",get:function(){return["modifier"]}}]),ToolbarButtonElement}(BaseElement);customElements.define("ons-toolbar-button",ToolbarButtonElement);var scheme$23={".range":"range--*",".range__left":"range--*__left"},templateSource$2=util.createElement('<div>\n <div class="range__left"></div>\n <input type="range" class="range">\n</div>'),INPUT_ATTRIBUTES$1=["autofocus","disabled","inputmode","max","min","name","placeholder","readonly","size","step","validator","value"],RangeElement=function(_BaseElement){function RangeElement(){return classCallCheck(this,RangeElement),possibleConstructorReturn(this,(RangeElement.__proto__||Object.getPrototypeOf(RangeElement)).apply(this,arguments))}return inherits(RangeElement,_BaseElement),createClass(RangeElement,[{key:"init",value:function(){var _this2=this;contentReady(this,function(){_this2._compile(),_this2._updateBoundAttributes(),_this2._onChange()})}},{key:"_compile",value:function(){if(autoStyle.prepare(this),!util.findChild(this,".range__left")||!util.findChild(this,"input"))for(var template=templateSource$2.cloneNode(!0);template.children[0];)this.appendChild(template.children[0]);ModifierUtil.initModifier(this,scheme$23)}},{key:"_onChange",value:function(){this._left.style.width=100*this._ratio+"%"}},{key:"_onDragstart",value:function(e){e.stopPropagation(),e.gesture.stopPropagation()}},{key:"attributeChangedCallback",value:function(name,last,current){var _this3=this;"modifier"===name?ModifierUtil.onModifierChanged(last,current,this,scheme$23):INPUT_ATTRIBUTES$1.indexOf(name)>=0&&contentReady(this,function(){_this3._updateBoundAttributes(),"min"!==name&&"max"!==name||_this3._onChange()})}},{key:"connectedCallback",value:function(){this.addEventListener("dragstart",this._onDragstart),this.addEventListener("input",this._onChange)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("dragstart",this._onDragstart),this.removeEventListener("input",this._onChange)}},{key:"_updateBoundAttributes",value:function(){var _this4=this;INPUT_ATTRIBUTES$1.forEach(function(attr){_this4.hasAttribute(attr)?_this4._input.setAttribute(attr,_this4.getAttribute(attr)):_this4._input.removeAttribute(attr)})}},{key:"_ratio",get:function(){var min=""===this._input.min?0:parseInt(this._input.min),max=""===this._input.max?100:parseInt(this._input.max);return(this.value-min)/(max-min)}},{key:"_input",get:function(){return this.querySelector("input")}},{key:"_left",get:function(){return this.querySelector(".range__left")}},{key:"disabled",set:function(value){return util.toggleAttribute(this,"disabled",value)},get:function(){return this.hasAttribute("disabled")}},{key:"value",get:function(){return null===this._input?this.getAttribute("value"):this._input.value},set:function(val){var _this5=this;contentReady(this,function(){_this5._input.value=val,_this5._onChange()})}}],[{key:"observedAttributes",get:function(){return["modifier"].concat(INPUT_ATTRIBUTES$1)}}]),RangeElement}(BaseElement);return customElements.define("ons-range",RangeElement),ons$1.TemplateElement=TemplateElement,ons$1.IfElement=IfElement,ons$1.AlertDialogElement=AlertDialogElement,ons$1.BackButtonElement=BackButtonElement,ons$1.BottomToolbarElement=BottomToolbarElement,ons$1.ButtonElement=ButtonElement,ons$1.CarouselItemElement=CarouselItemElement,ons$1.CarouselElement=CarouselElement,ons$1.ColElement=ColElement,ons$1.DialogElement=DialogElement,ons$1.FabElement=FabElement,ons$1.GestureDetectorElement=GestureDetectorElement,ons$1.IconElement=IconElement,ons$1.LazyRepeatElement=LazyRepeatElement,ons$1.ListHeaderElement=ListHeaderElement,ons$1.ListItemElement=ListItemElement,ons$1.ListElement=ListElement,ons$1.InputElement=InputElement,ons$1.ModalElement=ModalElement,ons$1.NavigatorElement=NavigatorElement,ons$1.PageElement=PageElement,ons$1.PopoverElement=PopoverElement,ons$1.ProgressBarElement=ProgressBarElement,ons$1.ProgressCircularElement=ProgressCircularElement,ons$1.PullHookElement=PullHookElement,ons$1.RippleElement=RippleElement,ons$1.RowElement=RowElement,ons$1.SpeedDialItemElement=SpeedDialItemElement,ons$1.SpeedDialElement=SpeedDialElement,ons$1.SplitterContentElement=SplitterContentElement,ons$1.SplitterMaskElement=SplitterMaskElement,ons$1.SplitterSideElement=SplitterSideElement,ons$1.SplitterElement=SplitterElement,ons$1.SwitchElement=SwitchElement,ons$1.TabElement=TabElement,ons$1.TabbarElement=TabbarElement,ons$1.ToolbarButtonElement=ToolbarButtonElement,ons$1.ToolbarElement=ToolbarElement,ons$1.RangeElement=RangeElement,window.addEventListener("load",function(){ons$1.fastClick=FastClick.attach(document.body)},!1),window.addEventListener("DOMContentLoaded",function(){ons$1._deviceBackButtonDispatcher.enable(),ons$1._defaultDeviceBackButtonHandler=ons$1._deviceBackButtonDispatcher.createHandler(window.document.body,function(){navigator.app.exitApp()}),document.body._gestureDetector=new ons$1.GestureDetector(document.body)},!1),ons$1.ready(function(){ons$1._setupLoadingPlaceHolders()}),(new Viewport).setup(),ons$1});
\No newline at end of file