function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length*chrsz))}function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length*chrsz))}function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length*chrsz))}function hex_hmac_sha1(key,data){return binb2hex(core_hmac_sha1(key,data))}function b64_hmac_sha1(key,data){return binb2b64(core_hmac_sha1(key,data))}function str_hmac_sha1(key,data){return binb2str(core_hmac_sha1(key,data))}function sha1_vm_test(){return"a9993e364706816aba3e25717850c26c9cd0d89d"==hex_sha1("abc")}function core_sha1(x,len){x[len>>5]|=128<<24-len%32,x[(len+64>>9<<4)+15]=len;for(var w=Array(80),a=1732584193,b=-271733879,c=-1732584194,d=271733878,e=-1009589776,i=0;ij;j++){16>j?w[j]=x[i+j]:w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));e=d,d=c,c=rol(b,30),b=a,a=t}a=safe_add(a,olda),b=safe_add(b,oldb),c=safe_add(c,oldc),d=safe_add(d,oldd),e=safe_add(e,olde)}return Array(a,b,c,d,e)}function sha1_ft(t,b,c,d){return 20>t?b&c|~b&d:40>t?b^c^d:60>t?b&c|b&d|c&d:b^c^d}function sha1_kt(t){return 20>t?1518500249:40>t?1859775393:60>t?-1894007588:-899497514}function core_hmac_sha1(key,data){var bkey=str2binb(key);bkey.length>16&&(bkey=core_sha1(bkey,key.length*chrsz));for(var ipad=Array(16),opad=Array(16),i=0;16>i;i++)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];var hash=core_sha1(ipad.concat(str2binb(data)),512+data.length*chrsz);return core_sha1(opad.concat(hash),672)}function safe_add(x,y){var lsw=(65535&x)+(65535&y),msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|65535&lsw}function rol(num,cnt){return num<>>32-cnt}function str2binb(str){for(var bin=Array(),mask=(1<>5]|=(str.charCodeAt(i/chrsz)&mask)<<32-chrsz-i%32;return bin}function binb2str(bin){for(var str="",mask=(1<>5]>>>32-chrsz-i%32&mask);return str}function binb2hex(binarray){for(var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef",str="",i=0;i<4*binarray.length;i++)str+=hex_tab.charAt(binarray[i>>2]>>8*(3-i%4)+4&15)+hex_tab.charAt(binarray[i>>2]>>8*(3-i%4)&15);return str}function binb2b64(binarray){for(var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",str="",i=0;i<4*binarray.length;i+=3)for(var triplet=(binarray[i>>2]>>8*(3-i%4)&255)<<16|(binarray[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|binarray[i+2>>2]>>8*(3-(i+2)%4)&255,j=0;4>j;j++)str+=8*i+6*j>32*binarray.length?b64pad:tab.charAt(triplet>>6*(3-j)&63);return str}!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof _dereq_&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof _dereq_&&_dereq_,o=0;o0},Async.prototype.throwLater=function(fn,arg){if(1===arguments.length&&(arg=fn,fn=function(){throw arg}),"undefined"!=typeof setTimeout)setTimeout(function(){fn(arg)},0);else try{this._schedule(function(){fn(arg)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},util.hasDevTools?(schedule.isStatic&&(schedule=function(fn){setTimeout(fn,0)}),Async.prototype.invokeLater=function(fn,receiver,arg){this._trampolineEnabled?AsyncInvokeLater.call(this,fn,receiver,arg):this._schedule(function(){setTimeout(function(){fn.call(receiver,arg)},100)})},Async.prototype.invoke=function(fn,receiver,arg){this._trampolineEnabled?AsyncInvoke.call(this,fn,receiver,arg):this._schedule(function(){fn.call(receiver,arg)})},Async.prototype.settlePromises=function(promise){this._trampolineEnabled?AsyncSettlePromises.call(this,promise):this._schedule(function(){promise._settlePromises()})}):(Async.prototype.invokeLater=AsyncInvokeLater,Async.prototype.invoke=AsyncInvoke,Async.prototype.settlePromises=AsyncSettlePromises),Async.prototype.invokeFirst=function(fn,receiver,arg){this._normalQueue.unshift(fn,receiver,arg),this._queueTick()},Async.prototype._drainQueue=function(queue){for(;queue.length()>0;){var fn=queue.shift();if("function"==typeof fn){var receiver=queue.shift(),arg=queue.shift();fn.call(receiver,arg)}else fn._settlePromises()}},Async.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},Async.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},Async.prototype._reset=function(){this._isTickUsed=!1},module.exports=new Async,module.exports.firstLineError=firstLineError},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise){var rejectThis=function(_,e){this._reject(e)},targetRejected=function(e,context){context.promiseRejectionQueued=!0,context.bindingPromise._then(rejectThis,rejectThis,null,this,e)},bindingResolved=function(thisArg,context){this._isPending()&&this._resolveCallback(context.target)},bindingRejected=function(e,context){context.promiseRejectionQueued||this._reject(e)};Promise.prototype.bind=function(thisArg){var maybePromise=tryConvertToPromise(thisArg),ret=new Promise(INTERNAL);ret._propagateFrom(this,1);var target=this._target();if(ret._setBoundTo(maybePromise),maybePromise instanceof Promise){var context={promiseRejectionQueued:!1,promise:ret,target:target,bindingPromise:maybePromise};target._then(INTERNAL,targetRejected,ret._progress,ret,context),maybePromise._then(bindingResolved,bindingRejected,ret._progress,ret,context)}else ret._resolveCallback(target);return ret},Promise.prototype._setBoundTo=function(obj){void 0!==obj?(this._bitField=131072|this._bitField,this._boundTo=obj):this._bitField=-131073&this._bitField},Promise.prototype._isBound=function(){return 131072===(131072&this._bitField)},Promise.bind=function(thisArg,value){var maybePromise=tryConvertToPromise(thisArg),ret=new Promise(INTERNAL);return ret._setBoundTo(maybePromise),maybePromise instanceof Promise?maybePromise._then(function(){ret._resolveCallback(value)},ret._reject,ret._progress,ret,null):ret._resolveCallback(value),ret}}},{}],4:[function(_dereq_,module,exports){"use strict";function noConflict(){try{Promise===bluebird&&(Promise=old)}catch(e){}return bluebird}var old;"undefined"!=typeof Promise&&(old=Promise);var bluebird=_dereq_("./promise.js")();bluebird.noConflict=noConflict,module.exports=bluebird},{"./promise.js":23}],5:[function(_dereq_,module,exports){"use strict";var cr=Object.create;if(cr){var callerCache=cr(null),getterCache=cr(null);callerCache[" size"]=getterCache[" size"]=0}module.exports=function(Promise){function ensureMethod(obj,methodName){var fn;if(null!=obj&&(fn=obj[methodName]),"function"!=typeof fn){var message="Object "+util.classString(obj)+" has no method '"+util.toString(methodName)+"'";throw new Promise.TypeError(message)}return fn}function caller(obj){var methodName=this.pop(),fn=ensureMethod(obj,methodName);return fn.apply(obj,this)}function namedGetter(obj){return obj[this]}function indexedGetter(obj){var index=+this;return 0>index&&(index=Math.max(0,index+obj.length)),obj[index]}var getGetter,util=_dereq_("./util.js"),canEvaluate=util.canEvaluate;util.isIdentifier;Promise.prototype.call=function(methodName){for(var $_len=arguments.length,args=new Array($_len-1),$_i=1;$_len>$_i;++$_i)args[$_i-1]=arguments[$_i];return args.push(methodName),this._then(caller,void 0,void 0,args,void 0)},Promise.prototype.get=function(propertyName){var getter,isIndex="number"==typeof propertyName;if(isIndex)getter=indexedGetter;else if(canEvaluate){var maybeGetter=getGetter(propertyName);getter=null!==maybeGetter?maybeGetter:namedGetter}else getter=namedGetter;return this._then(getter,void 0,void 0,propertyName,void 0)}}},{"./util.js":38}],6:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise){var errors=_dereq_("./errors.js"),async=_dereq_("./async.js"),CancellationError=errors.CancellationError;Promise.prototype._cancel=function(reason){if(!this.isCancellable())return this;for(var parent,promiseToReject=this;void 0!==(parent=promiseToReject._cancellationParent)&&parent.isCancellable();)promiseToReject=parent;this._unsetCancellable(),promiseToReject._target()._rejectCallback(reason,!1,!0)},Promise.prototype.cancel=function(reason){return this.isCancellable()?(void 0===reason&&(reason=new CancellationError),async.invokeLater(this._cancel,this,reason),this):this},Promise.prototype.cancellable=function(){return this._cancellable()?this:(async.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},Promise.prototype.uncancellable=function(){var ret=this.then();return ret._unsetCancellable(),ret},Promise.prototype.fork=function(didFulfill,didReject,didProgress){var ret=this._then(didFulfill,didReject,didProgress,void 0,void 0);return ret._setCancellable(),ret._cancellationParent=void 0,ret}}},{"./async.js":2,"./errors.js":13}],7:[function(_dereq_,module,exports){"use strict";module.exports=function(){function CapturedTrace(parent){this._parent=parent;var length=this._length=1+(void 0===parent?0:parent._length);captureStackTrace(this,CapturedTrace),length>32&&this.uncycle()}function reconstructStack(message,stacks){for(var i=0;i=0;--j)if(prev[j]===currentLastLine){commonRootMeetPoint=j;break}for(var j=commonRootMeetPoint;j>=0;--j){var line=prev[j];if(current[currentLastIndex]!==line)break;current.pop(),currentLastIndex--}current=prev}}function cleanStack(stack){for(var ret=[],i=0;i0&&(stack=stack.slice(i)),stack}function formatNonError(obj){var str;if("function"==typeof obj)str="[function "+(obj.name||"anonymous")+"]";else{str=obj.toString();var ruselessToString=/\[object [a-zA-Z0-9$_]+\]/;if(ruselessToString.test(str))try{var newStr=JSON.stringify(obj);str=newStr}catch(e){}0===str.length&&(str="(empty array)")}return"(<"+snip(str)+">, no stack trace)"}function snip(str){var maxChars=41;return str.lengthlength)){for(var nodes=[],stackToIndex={},i=0,node=this;void 0!==node;++i)nodes.push(node),node=node._parent;length=this._length=i;for(var i=length-1;i>=0;--i){var stack=nodes[i].stack;void 0===stackToIndex[stack]&&(stackToIndex[stack]=i)}for(var i=0;length>i;++i){var currentStack=nodes[i].stack,index=stackToIndex[currentStack];if(void 0!==index&&index!==i){index>0&&(nodes[index-1]._parent=void 0,nodes[index-1]._length=1),nodes[i]._parent=void 0,nodes[i]._length=1;var cycleEdgeNode=i>0?nodes[i-1]:this;length-1>index?(cycleEdgeNode._parent=nodes[index+1],cycleEdgeNode._parent.uncycle(),cycleEdgeNode._length=cycleEdgeNode._parent._length+1):(cycleEdgeNode._parent=void 0,cycleEdgeNode._length=1);for(var currentChildLength=cycleEdgeNode._length+1,j=i-2;j>=0;--j)nodes[j]._length=currentChildLength,currentChildLength++;return}}}},CapturedTrace.prototype.parent=function(){return this._parent},CapturedTrace.prototype.hasParent=function(){return void 0!==this._parent},CapturedTrace.prototype.attachExtraTrace=function(error){if(!error.__stackCleaned__){this.uncycle();for(var parsed=CapturedTrace.parseStackAndMessage(error),message=parsed.message,stacks=[parsed.stack],trace=this;void 0!==trace;)stacks.push(cleanStack(trace.stack.split("\n"))),trace=trace._parent;removeCommonRoots(stacks),removeDuplicateOrEmptyJumps(stacks),util.notEnumerableProp(error,"stack",reconstructStack(message,stacks)),util.notEnumerableProp(error,"__stackCleaned__",!0)}},CapturedTrace.parseStackAndMessage=function(error){var stack=error.stack,message=error.toString();return stack="string"==typeof stack&&stack.length>0?stackFramesAsArray(error):[" (No stack trace)"],{message:message,stack:cleanStack(stack)}},CapturedTrace.formatAndLogError=function(error,title){if("undefined"!=typeof console){var message;if("object"==typeof error||"function"==typeof error){var stack=error.stack;message=title+formatStack(stack,error)}else message=title+String(error);"function"==typeof warn?warn(message):("function"==typeof console.log||"object"==typeof console.log)&&console.log(message)}},CapturedTrace.unhandledRejection=function(reason){CapturedTrace.formatAndLogError(reason,"^--- With additional stack trace: ")},CapturedTrace.isSupported=function(){return"function"==typeof captureStackTrace},CapturedTrace.fireRejectionEvent=function(name,localHandler,reason,promise){var localEventFired=!1;try{"function"==typeof localHandler&&(localEventFired=!0,"rejectionHandled"===name?localHandler(promise):localHandler(reason,promise))}catch(e){async.throwLater(e)}var globalEventFired=!1;try{globalEventFired=fireGlobalEvent(name,reason,promise)}catch(e){globalEventFired=!0,async.throwLater(e)}var domEventFired=!1;if(fireDomEvent)try{domEventFired=fireDomEvent(name.toLowerCase(),{reason:reason,promise:promise})}catch(e){domEventFired=!0,async.throwLater(e)}globalEventFired||localEventFired||domEventFired||"unhandledRejection"!==name||CapturedTrace.formatAndLogError(reason,"Unhandled rejection ")};var shouldIgnore=function(){return!1},parseLineInfoRegex=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;CapturedTrace.setBounds=function(firstLineError,lastLineError){if(CapturedTrace.isSupported()){for(var firstFileName,lastFileName,firstStackLines=firstLineError.stack.split("\n"),lastStackLines=lastLineError.stack.split("\n"),firstIndex=-1,lastIndex=-1,i=0;ifirstIndex||0>lastIndex||!firstFileName||!lastFileName||firstFileName!==lastFileName||firstIndex>=lastIndex||(shouldIgnore=function(line){if(bluebirdFramePattern.test(line))return!0;var info=parseLineInfo(line);return info&&info.fileName===firstFileName&&firstIndex<=info.line&&info.line<=lastIndex?!0:!1})}};var fireDomEvent,captureStackTrace=function(){var v8stackFramePattern=/^\s*at\s*/,v8stackFormatter=function(stack,error){return"string"==typeof stack?stack:void 0!==error.name&&void 0!==error.message?error.toString():formatNonError(error)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,stackFramePattern=v8stackFramePattern,formatStack=v8stackFormatter;var captureStackTrace=Error.captureStackTrace;return shouldIgnore=function(line){return bluebirdFramePattern.test(line)},function(receiver,ignoreUntil){Error.stackTraceLimit=Error.stackTraceLimit+6,captureStackTrace(receiver,ignoreUntil),Error.stackTraceLimit=Error.stackTraceLimit-6}}var err=new Error;if("string"==typeof err.stack&&err.stack.split("\n")[0].indexOf("stackDetection@")>=0)return stackFramePattern=/@/,formatStack=v8stackFormatter,indentStackFrames=!0,function(o){o.stack=(new Error).stack};var hasStackAfterThrow;try{throw new Error}catch(e){hasStackAfterThrow="stack"in e}return"stack"in err||!hasStackAfterThrow||"number"!=typeof Error.stackTraceLimit?(formatStack=function(stack,error){return"string"==typeof stack?stack:"object"!=typeof error&&"function"!=typeof error||void 0===error.name||void 0===error.message?formatNonError(error):error.toString()},null):(stackFramePattern=v8stackFramePattern,formatStack=v8stackFormatter,function(o){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){o.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),fireGlobalEvent=function(){if(util.isNode)return function(name,reason,promise){return"rejectionHandled"===name?process.emit(name,promise):process.emit(name,reason,promise)};var customEventWorks=!1,anyEventWorks=!0;try{var ev=new self.CustomEvent("test");customEventWorks=ev instanceof CustomEvent}catch(e){}if(!customEventWorks)try{var event=document.createEvent("CustomEvent");event.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(event)}catch(e){anyEventWorks=!1}anyEventWorks&&(fireDomEvent=function(type,detail){var event;return customEventWorks?event=new self.CustomEvent(type,{detail:detail,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(event=document.createEvent("CustomEvent"),event.initCustomEvent(type,!1,!0,detail)),event?!self.dispatchEvent(event):!1});var toWindowMethodNameMap={};return toWindowMethodNameMap.unhandledRejection="onunhandledRejection".toLowerCase(),toWindowMethodNameMap.rejectionHandled="onrejectionHandled".toLowerCase(),function(name,reason,promise){var methodName=toWindowMethodNameMap[name],method=self[methodName];return method?("rejectionHandled"===name?method.call(self,promise):method.call(self,reason,promise),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(warn=function(message){console.warn(message)},util.isNode&&process.stderr.isTTY?warn=function(message){process.stderr.write(""+message+"\n")}:util.isNode||"string"!=typeof(new Error).stack||(warn=function(message){console.warn("%c"+message,"color: red")})),CapturedTrace}},{"./async.js":2,"./util.js":38}],8:[function(_dereq_,module,exports){"use strict";module.exports=function(NEXT_FILTER){function CatchFilter(instances,callback,promise){this._instances=instances,this._callback=callback,this._promise=promise}function safePredicate(predicate,e){var safeObject={},retfilter=tryCatch(predicate).call(safeObject,e);if(retfilter===errorObj)return retfilter;var safeKeys=keys(safeObject);return safeKeys.length?(errorObj.e=new TypeError("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),errorObj):retfilter}var util=_dereq_("./util.js"),errors=_dereq_("./errors.js"),tryCatch=util.tryCatch,errorObj=util.errorObj,keys=_dereq_("./es5.js").keys,TypeError=errors.TypeError;return CatchFilter.prototype.doFilter=function(e){for(var cb=this._callback,promise=this._promise,boundTo=promise._boundValue(),i=0,len=this._instances.length;len>i;++i){var item=this._instances[i],itemIsErrorType=item===Error||null!=item&&item.prototype instanceof Error;if(itemIsErrorType&&e instanceof item){var ret=tryCatch(cb).call(boundTo,e);return ret===errorObj?(NEXT_FILTER.e=ret.e,NEXT_FILTER):ret}if("function"==typeof item&&!itemIsErrorType){var shouldHandle=safePredicate(item,e);if(shouldHandle===errorObj){e=errorObj.e;break}if(shouldHandle){var ret=tryCatch(cb).call(boundTo,e);return ret===errorObj?(NEXT_FILTER.e=ret.e,NEXT_FILTER):ret}}}return NEXT_FILTER.e=e,NEXT_FILTER},CatchFilter}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,CapturedTrace,isDebugging){function Context(){this._trace=new CapturedTrace(peekContext())}function createContext(){return isDebugging()?new Context:void 0}function peekContext(){var lastIndex=contextStack.length-1;return lastIndex>=0?contextStack[lastIndex]:void 0}var contextStack=[];return Context.prototype._pushContext=function(){isDebugging()&&void 0!==this._trace&&contextStack.push(this._trace)},Context.prototype._popContext=function(){isDebugging()&&void 0!==this._trace&&contextStack.pop()},Promise.prototype._peekContext=peekContext,Promise.prototype._pushContext=Context.prototype._pushContext,Promise.prototype._popContext=Context.prototype._popContext,createContext}},{}],10:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,CapturedTrace){var unhandledRejectionHandled,possiblyUnhandledRejection,getDomain=Promise._getDomain,async=_dereq_("./async.js"),Warning=_dereq_("./errors.js").Warning,util=_dereq_("./util.js"),canAttachTrace=util.canAttachTrace,debugging=util.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return util.isNode&&0==process.env.BLUEBIRD_DEBUG&&(debugging=!1),debugging&&async.disableTrampolineIfNecessary(),Promise.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},Promise.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),async.invokeLater(this._notifyUnhandledRejection,this,void 0))},Promise.prototype._notifyUnhandledRejectionIsHandled=function(){CapturedTrace.fireRejectionEvent("rejectionHandled",unhandledRejectionHandled,void 0,this)},Promise.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var reason=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),CapturedTrace.fireRejectionEvent("unhandledRejection",possiblyUnhandledRejection,reason,this)}},Promise.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},Promise.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},Promise.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},Promise.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},Promise.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},Promise.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},Promise.prototype._setCarriedStackTrace=function(capturedTrace){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=capturedTrace},Promise.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},Promise.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},Promise.prototype._captureStackTrace=function(){return debugging&&(this._trace=new CapturedTrace(this._peekContext())),this},Promise.prototype._attachExtraTrace=function(error,ignoreSelf){if(debugging&&canAttachTrace(error)){var trace=this._trace;if(void 0!==trace&&ignoreSelf&&(trace=trace._parent),void 0!==trace)trace.attachExtraTrace(error);else if(!error.__stackCleaned__){var parsed=CapturedTrace.parseStackAndMessage(error);util.notEnumerableProp(error,"stack",parsed.message+"\n"+parsed.stack.join("\n")),util.notEnumerableProp(error,"__stackCleaned__",!0)}}},Promise.prototype._warn=function(message){var warning=new Warning(message),ctx=this._peekContext();if(ctx)ctx.attachExtraTrace(warning);else{var parsed=CapturedTrace.parseStackAndMessage(warning);warning.stack=parsed.message+"\n"+parsed.stack.join("\n")}CapturedTrace.formatAndLogError(warning,"")},Promise.onPossiblyUnhandledRejection=function(fn){var domain=getDomain();possiblyUnhandledRejection="function"==typeof fn?null===domain?fn:domain.bind(fn):void 0},Promise.onUnhandledRejectionHandled=function(fn){var domain=getDomain();unhandledRejectionHandled="function"==typeof fn?null===domain?fn:domain.bind(fn):void 0},Promise.longStackTraces=function(){if(async.haveItemsQueued()&&debugging===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");debugging=CapturedTrace.isSupported(),debugging&&async.disableTrampolineIfNecessary()},Promise.hasLongStackTraces=function(){return debugging&&CapturedTrace.isSupported()},CapturedTrace.isSupported()||(Promise.longStackTraces=function(){},debugging=!1),function(){return debugging}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(_dereq_,module,exports){"use strict";var util=_dereq_("./util.js"),isPrimitive=util.isPrimitive;module.exports=function(Promise){var returner=function(){return this},thrower=function(){throw this},returnUndefined=function(){},throwUndefined=function(){throw void 0},wrapper=function(value,action){return 1===action?function(){throw value}:2===action?function(){return value}:void 0};Promise.prototype["return"]=Promise.prototype.thenReturn=function(value){return void 0===value?this.then(returnUndefined):isPrimitive(value)?this._then(wrapper(value,2),void 0,void 0,void 0,void 0):(value instanceof Promise&&value._ignoreRejections(),this._then(returner,void 0,void 0,value,void 0))},Promise.prototype["throw"]=Promise.prototype.thenThrow=function(reason){return void 0===reason?this.then(throwUndefined):isPrimitive(reason)?this._then(wrapper(reason,1),void 0,void 0,void 0,void 0):this._then(thrower,void 0,void 0,reason,void 0)}}},{"./util.js":38}],12:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){var PromiseReduce=Promise.reduce;Promise.prototype.each=function(fn){return PromiseReduce(this,fn,null,INTERNAL)},Promise.each=function(promises,fn){return PromiseReduce(promises,fn,null,INTERNAL)}}},{}],13:[function(_dereq_,module,exports){"use strict";function subError(nameProperty,defaultMessage){function SubError(message){return this instanceof SubError?(notEnumerableProp(this,"message","string"==typeof message?message:defaultMessage),notEnumerableProp(this,"name",nameProperty),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new SubError(message)}return inherits(SubError,Error),SubError}function OperationalError(message){return this instanceof OperationalError?(notEnumerableProp(this,"name","OperationalError"),notEnumerableProp(this,"message",message),this.cause=message,this.isOperational=!0,void(message instanceof Error?(notEnumerableProp(this,"message",message.message),notEnumerableProp(this,"stack",message.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new OperationalError(message)}var _TypeError,_RangeError,es5=_dereq_("./es5.js"),Objectfreeze=es5.freeze,util=_dereq_("./util.js"),inherits=util.inherits,notEnumerableProp=util.notEnumerableProp,Warning=subError("Warning","warning"),CancellationError=subError("CancellationError","cancellation error"),TimeoutError=subError("TimeoutError","timeout error"),AggregateError=subError("AggregateError","aggregate error");try{_TypeError=TypeError,_RangeError=RangeError}catch(e){_TypeError=subError("TypeError","type error"),_RangeError=subError("RangeError","range error")}for(var methods="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),i=0;i0&&"function"==typeof arguments[last]){fn=arguments[last];var ret}for(var $_len=arguments.length,args=new Array($_len),$_i=0;$_len>$_i;++$_i)args[$_i]=arguments[$_i];fn&&args.pop();var ret=new PromiseArray(args).promise();return void 0!==fn?ret.spread(fn):ret}}},{"./util.js":38}],19:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL){function MappingPromiseArray(promises,fn,limit,_filter){this.constructor$(promises),this._promise._captureStackTrace();var domain=getDomain();this._callback=null===domain?fn:domain.bind(fn),this._preservedValues=_filter===INTERNAL?new Array(this.length()):null,this._limit=limit,this._inFlight=0,this._queue=limit>=1?[]:EMPTY_ARRAY,async.invoke(init,this,void 0)}function init(){this._init$(void 0,-2)}function map(promises,fn,options,_filter){var limit="object"==typeof options&&null!==options?options.concurrency:0;return limit="number"==typeof limit&&isFinite(limit)&&limit>=1?limit:0,new MappingPromiseArray(promises,fn,limit,_filter)}var getDomain=Promise._getDomain,async=_dereq_("./async.js"),util=_dereq_("./util.js"),tryCatch=util.tryCatch,errorObj=util.errorObj,PENDING={},EMPTY_ARRAY=[];util.inherits(MappingPromiseArray,PromiseArray),MappingPromiseArray.prototype._init=function(){},MappingPromiseArray.prototype._promiseFulfilled=function(value,index){var values=this._values,length=this.length(),preservedValues=this._preservedValues,limit=this._limit;if(values[index]===PENDING){if(values[index]=value,limit>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(limit>=1&&this._inFlight>=limit)return values[index]=value,void this._queue.push(index);null!==preservedValues&&(preservedValues[index]=value);var callback=this._callback,receiver=this._promise._boundValue();this._promise._pushContext();var ret=tryCatch(callback).call(receiver,value,index,length);if(this._promise._popContext(),ret===errorObj)return this._reject(ret.e);var maybePromise=tryConvertToPromise(ret,this._promise);if(maybePromise instanceof Promise){if(maybePromise=maybePromise._target(),maybePromise._isPending())return limit>=1&&this._inFlight++,values[index]=PENDING,maybePromise._proxyPromiseArray(this,index);if(!maybePromise._isFulfilled())return this._reject(maybePromise._reason());ret=maybePromise._value()}values[index]=ret}var totalResolved=++this._totalResolved;totalResolved>=length&&(null!==preservedValues?this._filter(values,preservedValues):this._resolve(values))},MappingPromiseArray.prototype._drainQueue=function(){for(var queue=this._queue,limit=this._limit,values=this._values;queue.length>0&&this._inFlighti;++i)booleans[i]&&(ret[j++]=values[i]);ret.length=j,this._resolve(ret)},MappingPromiseArray.prototype.preservedValues=function(){return this._preservedValues},Promise.prototype.map=function(fn,options){return"function"!=typeof fn?apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n"):map(this,fn,options,null).promise()},Promise.map=function(promises,fn,options,_filter){return"function"!=typeof fn?apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n"):map(promises,fn,options,_filter).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise,apiRejection){var util=_dereq_("./util.js"),tryCatch=util.tryCatch;Promise.method=function(fn){if("function"!=typeof fn)throw new Promise.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var ret=new Promise(INTERNAL);ret._captureStackTrace(),ret._pushContext();var value=tryCatch(fn).apply(this,arguments);return ret._popContext(),ret._resolveFromSyncValue(value),ret}},Promise.attempt=Promise["try"]=function(fn,args,ctx){if("function"!=typeof fn)return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");var ret=new Promise(INTERNAL);ret._captureStackTrace(),ret._pushContext();var value=util.isArray(args)?tryCatch(fn).apply(ctx,args):tryCatch(fn).call(ctx,args);return ret._popContext(),ret._resolveFromSyncValue(value),ret},Promise.prototype._resolveFromSyncValue=function(value){value===util.errorObj?this._rejectCallback(value.e,!1,!0):this._resolveCallback(value,!0)}}},{"./util.js":38}],21:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise){function spreadAdapter(val,nodeback){var promise=this;if(!util.isArray(val))return successAdapter.call(promise,val,nodeback);var ret=tryCatch(nodeback).apply(promise._boundValue(),[null].concat(val));ret===errorObj&&async.throwLater(ret.e)}function successAdapter(val,nodeback){var promise=this,receiver=promise._boundValue(),ret=void 0===val?tryCatch(nodeback).call(receiver,null):tryCatch(nodeback).call(receiver,null,val);ret===errorObj&&async.throwLater(ret.e)}function errorAdapter(reason,nodeback){var promise=this;if(!reason){var target=promise._target(),newReason=target._getCarriedStackTrace();newReason.cause=reason,reason=newReason}var ret=tryCatch(nodeback).call(promise._boundValue(),reason);ret===errorObj&&async.throwLater(ret.e)}var util=_dereq_("./util.js"),async=_dereq_("./async.js"),tryCatch=util.tryCatch,errorObj=util.errorObj;Promise.prototype.asCallback=Promise.prototype.nodeify=function(nodeback,options){if("function"==typeof nodeback){var adapter=successAdapter;void 0!==options&&Object(options).spread&&(adapter=spreadAdapter),this._then(adapter,errorAdapter,void 0,this,nodeback)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray){var util=_dereq_("./util.js"),async=_dereq_("./async.js"),tryCatch=util.tryCatch,errorObj=util.errorObj;Promise.prototype.progressed=function(handler){return this._then(void 0,void 0,handler,void 0,void 0)},Promise.prototype._progress=function(progressValue){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(progressValue)},Promise.prototype._progressHandlerAt=function(index){return 0===index?this._progressHandler0:this[(index<<2)+index-5+2]},Promise.prototype._doProgressWith=function(progression){var progressValue=progression.value,handler=progression.handler,promise=progression.promise,receiver=progression.receiver,ret=tryCatch(handler).call(receiver,progressValue);if(ret===errorObj){if(null!=ret.e&&"StopProgressPropagation"!==ret.e.name){var trace=util.canAttachTrace(ret.e)?ret.e:new Error(util.toString(ret.e));promise._attachExtraTrace(trace),promise._progress(ret.e)}}else ret instanceof Promise?ret._then(promise._progress,null,null,promise,void 0):promise._progress(ret)},Promise.prototype._progressUnchecked=function(progressValue){for(var len=this._length(),progress=this._progress,i=0;len>i;i++){var handler=this._progressHandlerAt(i),promise=this._promiseAt(i);if(promise instanceof Promise)"function"==typeof handler?async.invoke(this._doProgressWith,this,{handler:handler,promise:promise,receiver:this._receiverAt(i),value:progressValue}):async.invoke(progress,promise,progressValue);else{var receiver=this._receiverAt(i);"function"==typeof handler?handler.call(receiver,progressValue,promise):receiver instanceof PromiseArray&&!receiver._isResolved()&&receiver._promiseProgressed(progressValue,promise)}}}}},{"./async.js":2,"./util.js":38}],23:[function(_dereq_,module,exports){"use strict";module.exports=function(){function Promise(resolver){if("function"!=typeof resolver)throw new TypeError("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==Promise)throw new TypeError("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,resolver!==INTERNAL&&this._resolveFromResolver(resolver)}function fillTypes(value){var p=new Promise(INTERNAL);p._fulfillmentHandler0=value,p._rejectionHandler0=value,p._progressHandler0=value,p._promise0=value,p._receiver0=value,p._settledValue=value}var getDomain,makeSelfResolutionError=function(){return new TypeError("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},reflect=function(){return new Promise.PromiseInspection(this._target())},apiRejection=function(msg){return Promise.reject(new TypeError(msg))},util=_dereq_("./util.js");getDomain=util.isNode?function(){var ret=process.domain;return void 0===ret&&(ret=null),ret}:function(){return null},util.notEnumerableProp(Promise,"_getDomain",getDomain);var UNDEFINED_BINDING={},async=_dereq_("./async.js"),errors=_dereq_("./errors.js"),TypeError=Promise.TypeError=errors.TypeError;Promise.RangeError=errors.RangeError,Promise.CancellationError=errors.CancellationError,Promise.TimeoutError=errors.TimeoutError,Promise.OperationalError=errors.OperationalError,Promise.RejectionError=errors.OperationalError,Promise.AggregateError=errors.AggregateError;var INTERNAL=function(){},APPLY={},NEXT_FILTER={e:null},tryConvertToPromise=_dereq_("./thenables.js")(Promise,INTERNAL),PromiseArray=_dereq_("./promise_array.js")(Promise,INTERNAL,tryConvertToPromise,apiRejection),CapturedTrace=_dereq_("./captured_trace.js")(),isDebugging=_dereq_("./debuggability.js")(Promise,CapturedTrace),createContext=_dereq_("./context.js")(Promise,CapturedTrace,isDebugging),CatchFilter=_dereq_("./catch_filter.js")(NEXT_FILTER),PromiseResolver=_dereq_("./promise_resolver.js"),nodebackForPromise=PromiseResolver._nodebackForPromise,errorObj=util.errorObj,tryCatch=util.tryCatch;return Promise.prototype.toString=function(){return"[object Promise]"},Promise.prototype.caught=Promise.prototype["catch"]=function(fn){var len=arguments.length;if(len>1){var i,catchInstances=new Array(len-1),j=0;for(i=0;len-1>i;++i){var item=arguments[i];if("function"!=typeof item)return Promise.reject(new TypeError("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));catchInstances[j++]=item}catchInstances.length=j,fn=arguments[i];var catchFilter=new CatchFilter(catchInstances,fn,this);return this._then(void 0,catchFilter.doFilter,void 0,catchFilter,void 0)}return this._then(void 0,fn,void 0,void 0,void 0)},Promise.prototype.reflect=function(){return this._then(reflect,reflect,void 0,this,void 0)},Promise.prototype.then=function(didFulfill,didReject,didProgress){if(isDebugging()&&arguments.length>0&&"function"!=typeof didFulfill&&"function"!=typeof didReject){var msg=".then() only accepts functions but was passed: "+util.classString(didFulfill);arguments.length>1&&(msg+=", "+util.classString(didReject)),this._warn(msg)}return this._then(didFulfill,didReject,didProgress,void 0,void 0)},Promise.prototype.done=function(didFulfill,didReject,didProgress){var promise=this._then(didFulfill,didReject,didProgress,void 0,void 0);promise._setIsFinal()},Promise.prototype.spread=function(didFulfill,didReject){return this.all()._then(didFulfill,didReject,void 0,APPLY,void 0)},Promise.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},Promise.prototype.toJSON=function(){var ret={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(ret.fulfillmentValue=this.value(),ret.isFulfilled=!0):this.isRejected()&&(ret.rejectionReason=this.reason(),ret.isRejected=!0),ret},Promise.prototype.all=function(){return new PromiseArray(this).promise()},Promise.prototype.error=function(fn){return this.caught(util.originatesFromRejection,fn)},Promise.is=function(val){return val instanceof Promise},Promise.fromNode=function(fn){var ret=new Promise(INTERNAL),result=tryCatch(fn)(nodebackForPromise(ret));return result===errorObj&&ret._rejectCallback(result.e,!0,!0),ret},Promise.all=function(promises){return new PromiseArray(promises).promise()},Promise.defer=Promise.pending=function(){var promise=new Promise(INTERNAL);return new PromiseResolver(promise)},Promise.cast=function(obj){var ret=tryConvertToPromise(obj);if(!(ret instanceof Promise)){var val=ret;ret=new Promise(INTERNAL),ret._fulfillUnchecked(val)}return ret},Promise.resolve=Promise.fulfilled=Promise.cast,Promise.reject=Promise.rejected=function(reason){var ret=new Promise(INTERNAL);return ret._captureStackTrace(),ret._rejectCallback(reason,!0),ret},Promise.setScheduler=function(fn){if("function"!=typeof fn)throw new TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");var prev=async._schedule;return async._schedule=fn,prev},Promise.prototype._then=function(didFulfill,didReject,didProgress,receiver,internalData){var haveInternalData=void 0!==internalData,ret=haveInternalData?internalData:new Promise(INTERNAL);haveInternalData||(ret._propagateFrom(this,5),ret._captureStackTrace());var target=this._target();target!==this&&(void 0===receiver&&(receiver=this._boundTo),haveInternalData||ret._setIsMigrated());var callbackIndex=target._addCallbacks(didFulfill,didReject,didProgress,ret,receiver,getDomain());return target._isResolved()&&!target._isSettlePromisesQueued()&&async.invoke(target._settlePromiseAtPostResolution,target,callbackIndex),ret},Promise.prototype._settlePromiseAtPostResolution=function(index){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(index)},Promise.prototype._length=function(){return 131071&this._bitField},Promise.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},Promise.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},Promise.prototype._setLength=function(len){this._bitField=-131072&this._bitField|131071&len},Promise.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},Promise.prototype._setRejected=function(){this._bitField=134217728|this._bitField},Promise.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},Promise.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},Promise.prototype._isFinal=function(){return(33554432&this._bitField)>0},Promise.prototype._cancellable=function(){return(67108864&this._bitField)>0},Promise.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},Promise.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},Promise.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},Promise.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},Promise.prototype._isMigrated=function(){return(4194304&this._bitField)>0},Promise.prototype._receiverAt=function(index){var ret=0===index?this._receiver0:this[5*index-5+4];return ret===UNDEFINED_BINDING?void 0:void 0===ret&&this._isBound()?this._boundValue():ret},Promise.prototype._promiseAt=function(index){return 0===index?this._promise0:this[5*index-5+3]},Promise.prototype._fulfillmentHandlerAt=function(index){return 0===index?this._fulfillmentHandler0:this[5*index-5+0]},Promise.prototype._rejectionHandlerAt=function(index){return 0===index?this._rejectionHandler0:this[5*index-5+1]},Promise.prototype._boundValue=function(){var ret=this._boundTo;return void 0!==ret&&ret instanceof Promise?ret.isFulfilled()?ret.value():void 0:ret},Promise.prototype._migrateCallbacks=function(follower,index){var fulfill=follower._fulfillmentHandlerAt(index),reject=follower._rejectionHandlerAt(index),progress=follower._progressHandlerAt(index),promise=follower._promiseAt(index),receiver=follower._receiverAt(index);promise instanceof Promise&&promise._setIsMigrated(),void 0===receiver&&(receiver=UNDEFINED_BINDING),this._addCallbacks(fulfill,reject,progress,promise,receiver,null)},Promise.prototype._addCallbacks=function(fulfill,reject,progress,promise,receiver,domain){var index=this._length();if(index>=131066&&(index=0,this._setLength(0)),0===index)this._promise0=promise,void 0!==receiver&&(this._receiver0=receiver),"function"!=typeof fulfill||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===domain?fulfill:domain.bind(fulfill)),"function"==typeof reject&&(this._rejectionHandler0=null===domain?reject:domain.bind(reject)),"function"==typeof progress&&(this._progressHandler0=null===domain?progress:domain.bind(progress));else{var base=5*index-5;this[base+3]=promise,this[base+4]=receiver,"function"==typeof fulfill&&(this[base+0]=null===domain?fulfill:domain.bind(fulfill)),"function"==typeof reject&&(this[base+1]=null===domain?reject:domain.bind(reject)),"function"==typeof progress&&(this[base+2]=null===domain?progress:domain.bind(progress))}return this._setLength(index+1),index},Promise.prototype._setProxyHandlers=function(receiver,promiseSlotValue){var index=this._length();if(index>=131066&&(index=0,this._setLength(0)),0===index)this._promise0=promiseSlotValue,this._receiver0=receiver;else{var base=5*index-5;this[base+3]=promiseSlotValue,this[base+4]=receiver}this._setLength(index+1)},Promise.prototype._proxyPromiseArray=function(promiseArray,index){this._setProxyHandlers(promiseArray,index)},Promise.prototype._resolveCallback=function(value,shouldBind){if(!this._isFollowingOrFulfilledOrRejected()){if(value===this)return this._rejectCallback(makeSelfResolutionError(),!1,!0);var maybePromise=tryConvertToPromise(value,this);if(!(maybePromise instanceof Promise))return this._fulfill(value);var propagationFlags=1|(shouldBind?4:0);this._propagateFrom(maybePromise,propagationFlags);var promise=maybePromise._target();if(promise._isPending()){for(var len=this._length(),i=0;len>i;++i)promise._migrateCallbacks(this,i);this._setFollowing(),this._setLength(0),this._setFollowee(promise)}else promise._isFulfilled()?this._fulfillUnchecked(promise._value()):this._rejectUnchecked(promise._reason(),promise._getCarriedStackTrace())}},Promise.prototype._rejectCallback=function(reason,synchronous,shouldNotMarkOriginatingFromRejection){shouldNotMarkOriginatingFromRejection||util.markAsOriginatingFromRejection(reason);var trace=util.ensureErrorObject(reason),hasStack=trace===reason;this._attachExtraTrace(trace,synchronous?hasStack:!1),this._reject(reason,hasStack?void 0:trace)},Promise.prototype._resolveFromResolver=function(resolver){var promise=this;this._captureStackTrace(),this._pushContext();var synchronous=!0,r=tryCatch(resolver)(function(value){null!==promise&&(promise._resolveCallback(value),promise=null)},function(reason){null!==promise&&(promise._rejectCallback(reason,synchronous),promise=null)});synchronous=!1,this._popContext(),void 0!==r&&r===errorObj&&null!==promise&&(promise._rejectCallback(r.e,!0,!0),promise=null)},Promise.prototype._settlePromiseFromHandler=function(handler,receiver,value,promise){if(!promise._isRejected()){promise._pushContext();var x;if(x=receiver!==APPLY||this._isRejected()?tryCatch(handler).call(receiver,value):tryCatch(handler).apply(this._boundValue(),value),promise._popContext(),x===errorObj||x===promise||x===NEXT_FILTER){var err=x===promise?makeSelfResolutionError():x.e;promise._rejectCallback(err,!1,!0)}else promise._resolveCallback(x)}},Promise.prototype._target=function(){for(var ret=this;ret._isFollowing();)ret=ret._followee();return ret},Promise.prototype._followee=function(){return this._rejectionHandler0},Promise.prototype._setFollowee=function(promise){this._rejectionHandler0=promise},Promise.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},Promise.prototype._propagateFrom=function(parent,flags){(1&flags)>0&&parent._cancellable()&&(this._setCancellable(),this._cancellationParent=parent),(4&flags)>0&&parent._isBound()&&this._setBoundTo(parent._boundTo)},Promise.prototype._fulfill=function(value){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(value)},Promise.prototype._reject=function(reason,carriedStackTrace){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(reason,carriedStackTrace)},Promise.prototype._settlePromiseAt=function(index){var promise=this._promiseAt(index),isPromise=promise instanceof Promise;if(isPromise&&promise._isMigrated())return promise._unsetIsMigrated(),async.invoke(this._settlePromiseAt,this,index);var handler=this._isFulfilled()?this._fulfillmentHandlerAt(index):this._rejectionHandlerAt(index),carriedStackTrace=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,value=this._settledValue,receiver=this._receiverAt(index);this._clearCallbackDataAtIndex(index),"function"==typeof handler?isPromise?this._settlePromiseFromHandler(handler,receiver,value,promise):handler.call(receiver,value,promise):receiver instanceof PromiseArray?receiver._isResolved()||(this._isFulfilled()?receiver._promiseFulfilled(value,promise):receiver._promiseRejected(value,promise)):isPromise&&(this._isFulfilled()?promise._fulfill(value):promise._reject(value,carriedStackTrace)),index>=4&&4===(31&index)&&async.invokeLater(this._setLength,this,0)},Promise.prototype._clearCallbackDataAtIndex=function(index){if(0===index)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var base=5*index-5;this[base+3]=this[base+4]=this[base+0]=this[base+1]=this[base+2]=void 0}},Promise.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},Promise.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},Promise.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},Promise.prototype._queueSettlePromises=function(){async.settlePromises(this),this._setSettlePromisesQueued()},Promise.prototype._fulfillUnchecked=function(value){if(value===this){var err=makeSelfResolutionError();return this._attachExtraTrace(err),this._rejectUnchecked(err,void 0)}this._setFulfilled(),this._settledValue=value,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},Promise.prototype._rejectUncheckedCheckError=function(reason){var trace=util.ensureErrorObject(reason);this._rejectUnchecked(reason,trace===reason?void 0:trace)},Promise.prototype._rejectUnchecked=function(reason,trace){if(reason===this){var err=makeSelfResolutionError();return this._attachExtraTrace(err),this._rejectUnchecked(err)}return this._setRejected(),this._settledValue=reason,this._cleanValues(),this._isFinal()?void async.throwLater(function(e){throw"stack"in e&&async.invokeFirst(CapturedTrace.unhandledRejection,void 0,e),e},void 0===trace?reason:trace):(void 0!==trace&&trace!==reason&&this._setCarriedStackTrace(trace),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},Promise.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var len=this._length(),i=0;len>i;i++)this._settlePromiseAt(i)},util.notEnumerableProp(Promise,"_makeSelfResolutionError",makeSelfResolutionError),_dereq_("./progress.js")(Promise,PromiseArray),_dereq_("./method.js")(Promise,INTERNAL,tryConvertToPromise,apiRejection),_dereq_("./bind.js")(Promise,INTERNAL,tryConvertToPromise),_dereq_("./finally.js")(Promise,NEXT_FILTER,tryConvertToPromise),_dereq_("./direct_resolve.js")(Promise),_dereq_("./synchronous_inspection.js")(Promise),_dereq_("./join.js")(Promise,PromiseArray,tryConvertToPromise,INTERNAL),Promise.Promise=Promise,_dereq_("./map.js")(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL),_dereq_("./cancel.js")(Promise),_dereq_("./using.js")(Promise,apiRejection,tryConvertToPromise,createContext),_dereq_("./generators.js")(Promise,apiRejection,INTERNAL,tryConvertToPromise),_dereq_("./nodeify.js")(Promise),_dereq_("./call_get.js")(Promise),_dereq_("./props.js")(Promise,PromiseArray,tryConvertToPromise,apiRejection),_dereq_("./race.js")(Promise,INTERNAL,tryConvertToPromise,apiRejection),_dereq_("./reduce.js")(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL),_dereq_("./settle.js")(Promise,PromiseArray),_dereq_("./some.js")(Promise,PromiseArray,apiRejection),_dereq_("./promisify.js")(Promise,INTERNAL),_dereq_("./any.js")(Promise),_dereq_("./each.js")(Promise,INTERNAL),_dereq_("./timers.js")(Promise,INTERNAL),_dereq_("./filter.js")(Promise,INTERNAL),util.toFastProperties(Promise),util.toFastProperties(Promise.prototype),fillTypes({a:1}),fillTypes({b:2}),fillTypes({c:3}),fillTypes(1),fillTypes(function(){}),fillTypes(void 0),fillTypes(!1),fillTypes(new Promise(INTERNAL)),CapturedTrace.setBounds(async.firstLineError,util.lastLineError),Promise}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise,apiRejection){function toResolutionValue(val){switch(val){case-2:return[];case-3:return{}}}function PromiseArray(values){var parent,promise=this._promise=new Promise(INTERNAL);values instanceof Promise&&(parent=values,promise._propagateFrom(parent,5)),this._values=values,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var util=_dereq_("./util.js"),isArray=util.isArray; return PromiseArray.prototype.length=function(){return this._length},PromiseArray.prototype.promise=function(){return this._promise},PromiseArray.prototype._init=function init(_,resolveValueIfEmpty){var values=tryConvertToPromise(this._values,this._promise);if(values instanceof Promise){if(values=values._target(),this._values=values,!values._isFulfilled())return values._isPending()?void values._then(init,this._reject,void 0,this,resolveValueIfEmpty):void this._reject(values._reason());if(values=values._value(),!isArray(values)){var err=new Promise.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(err)}}else if(!isArray(values))return void this._promise._reject(apiRejection("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===values.length)return void(-5===resolveValueIfEmpty?this._resolveEmptyArray():this._resolve(toResolutionValue(resolveValueIfEmpty)));var len=this.getActualLength(values.length);this._length=len,this._values=this.shouldCopyValues()?new Array(len):this._values;for(var promise=this._promise,i=0;len>i;++i){var isResolved=this._isResolved(),maybePromise=tryConvertToPromise(values[i],promise);maybePromise instanceof Promise?(maybePromise=maybePromise._target(),isResolved?maybePromise._ignoreRejections():maybePromise._isPending()?maybePromise._proxyPromiseArray(this,i):maybePromise._isFulfilled()?this._promiseFulfilled(maybePromise._value(),i):this._promiseRejected(maybePromise._reason(),i)):isResolved||this._promiseFulfilled(maybePromise,i)}},PromiseArray.prototype._isResolved=function(){return null===this._values},PromiseArray.prototype._resolve=function(value){this._values=null,this._promise._fulfill(value)},PromiseArray.prototype.__hardReject__=PromiseArray.prototype._reject=function(reason){this._values=null,this._promise._rejectCallback(reason,!1,!0)},PromiseArray.prototype._promiseProgressed=function(progressValue,index){this._promise._progress({index:index,value:progressValue})},PromiseArray.prototype._promiseFulfilled=function(value,index){this._values[index]=value;var totalResolved=++this._totalResolved;totalResolved>=this._length&&this._resolve(this._values)},PromiseArray.prototype._promiseRejected=function(reason,index){this._totalResolved++,this._reject(reason)},PromiseArray.prototype.shouldCopyValues=function(){return!0},PromiseArray.prototype.getActualLength=function(len){return len},PromiseArray}},{"./util.js":38}],25:[function(_dereq_,module,exports){"use strict";function isUntypedError(obj){return obj instanceof Error&&es5.getPrototypeOf(obj)===Error.prototype}function wrapAsOperationalError(obj){var ret;if(isUntypedError(obj)){ret=new OperationalError(obj),ret.name=obj.name,ret.message=obj.message,ret.stack=obj.stack;for(var keys=es5.keys(obj),i=0;i2){for(var $_len=arguments.length,args=new Array($_len-1),$_i=1;$_len>$_i;++$_i)args[$_i-1]=arguments[$_i];promise._fulfill(args)}else promise._fulfill(value);promise=null}}}var PromiseResolver,util=_dereq_("./util.js"),maybeWrapAsError=util.maybeWrapAsError,errors=_dereq_("./errors.js"),TimeoutError=errors.TimeoutError,OperationalError=errors.OperationalError,haveGetters=util.haveGetters,es5=_dereq_("./es5.js"),rErrorKey=/^(?:name|message|stack|cause)$/;if(PromiseResolver=haveGetters?function(promise){this.promise=promise}:function(promise){this.promise=promise,this.asCallback=nodebackForPromise(promise),this.callback=this.asCallback},haveGetters){var prop={get:function(){return nodebackForPromise(this.promise)}};es5.defineProperty(PromiseResolver.prototype,"asCallback",prop),es5.defineProperty(PromiseResolver.prototype,"callback",prop)}PromiseResolver._nodebackForPromise=nodebackForPromise,PromiseResolver.prototype.toString=function(){return"[object PromiseResolver]"},PromiseResolver.prototype.resolve=PromiseResolver.prototype.fulfill=function(value){if(!(this instanceof PromiseResolver))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(value)},PromiseResolver.prototype.reject=function(reason){if(!(this instanceof PromiseResolver))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(reason)},PromiseResolver.prototype.progress=function(value){if(!(this instanceof PromiseResolver))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(value)},PromiseResolver.prototype.cancel=function(err){this.promise.cancel(err)},PromiseResolver.prototype.timeout=function(){this.reject(new TimeoutError("timeout"))},PromiseResolver.prototype.isResolved=function(){return this.promise.isResolved()},PromiseResolver.prototype.toJSON=function(){return this.promise.toJSON()},module.exports=PromiseResolver},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){function propsFilter(key){return!noCopyPropsPattern.test(key)}function isPromisified(fn){try{return fn.__isPromisified__===!0}catch(e){return!1}}function hasPromisified(obj,key,suffix){var val=util.getDataPropertyOrDefault(obj,key+suffix,defaultPromisified);return val?isPromisified(val):!1}function checkValid(ret,suffix,suffixRegexp){for(var i=0;ii;i+=2){var key=methods[i],fn=methods[i+1],promisifiedKey=key+suffix;if(promisifier===makeNodePromisified)obj[promisifiedKey]=makeNodePromisified(key,THIS,key,fn,suffix);else{var promisified=promisifier(fn,function(){return makeNodePromisified(key,THIS,key,fn,suffix)});util.notEnumerableProp(promisified,"__isPromisified__",!0),obj[promisifiedKey]=promisified}}return util.toFastProperties(obj),obj}function promisify(callback,receiver){return makeNodePromisified(callback,receiver,void 0,callback)}var makeNodePromisifiedEval,THIS={},util=_dereq_("./util.js"),nodebackForPromise=_dereq_("./promise_resolver.js")._nodebackForPromise,withAppended=util.withAppended,maybeWrapAsError=util.maybeWrapAsError,canEvaluate=util.canEvaluate,TypeError=_dereq_("./errors").TypeError,defaultSuffix="Async",defaultPromisified={__isPromisified__:!0},noCopyProps=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],noCopyPropsPattern=new RegExp("^(?:"+noCopyProps.join("|")+")$"),defaultFilter=function(name){return util.isIdentifier(name)&&"_"!==name.charAt(0)&&"constructor"!==name},escapeIdentRegex=function(str){return str.replace(/([$])/,"\\$")},makeNodePromisified=canEvaluate?makeNodePromisifiedEval:makeNodePromisifiedClosure;Promise.promisify=function(fn,receiver){if("function"!=typeof fn)throw new TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(isPromisified(fn))return fn;var ret=promisify(fn,arguments.length<2?THIS:receiver);return util.copyDescriptors(fn,ret,propsFilter),ret},Promise.promisifyAll=function(target,options){if("function"!=typeof target&&"object"!=typeof target)throw new TypeError("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");options=Object(options);var suffix=options.suffix;"string"!=typeof suffix&&(suffix=defaultSuffix);var filter=options.filter;"function"!=typeof filter&&(filter=defaultFilter);var promisifier=options.promisifier;if("function"!=typeof promisifier&&(promisifier=makeNodePromisified),!util.isIdentifier(suffix))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var keys=util.inheritedDataKeys(target),i=0;ii;++i){var key=keys[i];values[i]=obj[key],values[i+len]=key}this.constructor$(values)}function props(promises){var ret,castValue=tryConvertToPromise(promises);return isObject(castValue)?(ret=castValue instanceof Promise?castValue._then(Promise.props,void 0,void 0,void 0,void 0):new PropertiesPromiseArray(castValue).promise(),castValue instanceof Promise&&ret._propagateFrom(castValue,4),ret):apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var util=_dereq_("./util.js"),isObject=util.isObject,es5=_dereq_("./es5.js");util.inherits(PropertiesPromiseArray,PromiseArray),PropertiesPromiseArray.prototype._init=function(){this._init$(void 0,-3)},PropertiesPromiseArray.prototype._promiseFulfilled=function(value,index){this._values[index]=value;var totalResolved=++this._totalResolved;if(totalResolved>=this._length){for(var val={},keyOffset=this.length(),i=0,len=this.length();len>i;++i)val[this._values[i+keyOffset]]=this._values[i];this._resolve(val)}},PropertiesPromiseArray.prototype._promiseProgressed=function(value,index){this._promise._progress({key:this._values[index+this.length()],value:value})},PropertiesPromiseArray.prototype.shouldCopyValues=function(){return!1},PropertiesPromiseArray.prototype.getActualLength=function(len){return len>>1},Promise.prototype.props=function(){return props(this)},Promise.props=function(promises){return props(promises)}}},{"./es5.js":14,"./util.js":38}],28:[function(_dereq_,module,exports){"use strict";function arrayMove(src,srcIndex,dst,dstIndex,len){for(var j=0;len>j;++j)dst[j+dstIndex]=src[j+srcIndex],src[j+srcIndex]=void 0}function Queue(capacity){this._capacity=capacity,this._length=0,this._front=0}Queue.prototype._willBeOverCapacity=function(size){return this._capacityi;++i){var val=promises[i];(void 0!==val||i in promises)&&Promise.cast(val)._then(fulfill,reject,void 0,ret,null)}return ret}var isArray=_dereq_("./util.js").isArray,raceLater=function(promise){return promise.then(function(array){return race(array,promise)})};Promise.race=function(promises){return race(promises,void 0)},Promise.prototype.race=function(){return race(this,void 0)}}},{"./util.js":38}],30:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL){function ReductionPromiseArray(promises,fn,accum,_each){this.constructor$(promises),this._promise._captureStackTrace(),this._preservedValues=_each===INTERNAL?[]:null,this._zerothIsAccum=void 0===accum,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var maybePromise=tryConvertToPromise(accum,this._promise),rejected=!1,isPromise=maybePromise instanceof Promise;isPromise&&(maybePromise=maybePromise._target(),maybePromise._isPending()?maybePromise._proxyPromiseArray(this,-1):maybePromise._isFulfilled()?(accum=maybePromise._value(),this._gotAccum=!0):(this._reject(maybePromise._reason()),rejected=!0)),isPromise||this._zerothIsAccum||(this._gotAccum=!0);var domain=getDomain();this._callback=null===domain?fn:domain.bind(fn),this._accum=accum,rejected||async.invoke(init,this,void 0)}function init(){this._init$(void 0,-5)}function reduce(promises,fn,initialValue,_each){if("function"!=typeof fn)return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");var array=new ReductionPromiseArray(promises,fn,initialValue,_each);return array.promise()}var getDomain=Promise._getDomain,async=_dereq_("./async.js"),util=_dereq_("./util.js"),tryCatch=util.tryCatch,errorObj=util.errorObj;util.inherits(ReductionPromiseArray,PromiseArray),ReductionPromiseArray.prototype._init=function(){},ReductionPromiseArray.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},ReductionPromiseArray.prototype._promiseFulfilled=function(value,index){var values=this._values;values[index]=value;var valuesPhaseIndex,length=this.length(),preservedValues=this._preservedValues,isEach=null!==preservedValues,gotAccum=this._gotAccum,valuesPhase=this._valuesPhase;if(!valuesPhase)for(valuesPhase=this._valuesPhase=new Array(length),valuesPhaseIndex=0;length>valuesPhaseIndex;++valuesPhaseIndex)valuesPhase[valuesPhaseIndex]=0;if(valuesPhaseIndex=valuesPhase[index],0===index&&this._zerothIsAccum?(this._accum=value,this._gotAccum=gotAccum=!0,valuesPhase[index]=0===valuesPhaseIndex?1:2):-1===index?(this._accum=value,this._gotAccum=gotAccum=!0):0===valuesPhaseIndex?valuesPhase[index]=1:(valuesPhase[index]=2,this._accum=value),gotAccum){for(var ret,callback=this._callback,receiver=this._promise._boundValue(),i=this._reducingIndex;length>i;++i)if(valuesPhaseIndex=valuesPhase[i],2!==valuesPhaseIndex){if(1!==valuesPhaseIndex)return;if(value=values[i],this._promise._pushContext(),isEach?(preservedValues.push(value),ret=tryCatch(callback).call(receiver,value,i,length)):ret=tryCatch(callback).call(receiver,this._accum,value,i,length),this._promise._popContext(),ret===errorObj)return this._reject(ret.e);var maybePromise=tryConvertToPromise(ret,this._promise);if(maybePromise instanceof Promise){if(maybePromise=maybePromise._target(),maybePromise._isPending())return valuesPhase[i]=4,maybePromise._proxyPromiseArray(this,i);if(!maybePromise._isFulfilled())return this._reject(maybePromise._reason());ret=maybePromise._value()}this._reducingIndex=i+1,this._accum=ret}else this._reducingIndex=i+1;this._resolve(isEach?preservedValues:this._accum)}},Promise.prototype.reduce=function(fn,initialValue){return reduce(this,fn,initialValue,null)},Promise.reduce=function(promises,fn,initialValue,_each){return reduce(promises,fn,initialValue,_each)}}},{"./async.js":2,"./util.js":38}],31:[function(_dereq_,module,exports){"use strict";var schedule,util=_dereq_("./util"),noAsyncScheduler=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(util.isNode&&"undefined"==typeof MutationObserver){var GlobalSetImmediate=global.setImmediate,ProcessNextTick=process.nextTick;schedule=util.isRecentNode?function(fn){GlobalSetImmediate.call(global,fn)}:function(fn){ProcessNextTick.call(process,fn)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?schedule="undefined"!=typeof setImmediate?function(fn){setImmediate(fn)}:"undefined"!=typeof setTimeout?function(fn){setTimeout(fn,0)}:noAsyncScheduler:(schedule=function(fn){var div=document.createElement("div"),observer=new MutationObserver(fn);return observer.observe(div,{attributes:!0}),function(){div.classList.toggle("foo")}},schedule.isStatic=!0);module.exports=schedule},{"./util":38}],32:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray){function SettledPromiseArray(values){this.constructor$(values)}var PromiseInspection=Promise.PromiseInspection,util=_dereq_("./util.js");util.inherits(SettledPromiseArray,PromiseArray),SettledPromiseArray.prototype._promiseResolved=function(index,inspection){this._values[index]=inspection;var totalResolved=++this._totalResolved;totalResolved>=this._length&&this._resolve(this._values)},SettledPromiseArray.prototype._promiseFulfilled=function(value,index){var ret=new PromiseInspection;ret._bitField=268435456,ret._settledValue=value,this._promiseResolved(index,ret)},SettledPromiseArray.prototype._promiseRejected=function(reason,index){var ret=new PromiseInspection;ret._bitField=134217728,ret._settledValue=reason,this._promiseResolved(index,ret)},Promise.settle=function(promises){return new SettledPromiseArray(promises).promise()},Promise.prototype.settle=function(){return new SettledPromiseArray(this).promise()}}},{"./util.js":38}],33:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,PromiseArray,apiRejection){function SomePromiseArray(values){this.constructor$(values),this._howMany=0,this._unwrap=!1,this._initialized=!1}function some(promises,howMany){if((0|howMany)!==howMany||0>howMany)return apiRejection("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var ret=new SomePromiseArray(promises),promise=ret.promise();return ret.setHowMany(howMany),ret.init(),promise}var util=_dereq_("./util.js"),RangeError=_dereq_("./errors.js").RangeError,AggregateError=_dereq_("./errors.js").AggregateError,isArray=util.isArray;util.inherits(SomePromiseArray,PromiseArray),SomePromiseArray.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var isArrayResolved=isArray(this._values);!this._isResolved()&&isArrayResolved&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},SomePromiseArray.prototype.init=function(){this._initialized=!0,this._init()},SomePromiseArray.prototype.setUnwrap=function(){this._unwrap=!0},SomePromiseArray.prototype.howMany=function(){return this._howMany},SomePromiseArray.prototype.setHowMany=function(count){this._howMany=count},SomePromiseArray.prototype._promiseFulfilled=function(value){this._addFulfilled(value),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values))},SomePromiseArray.prototype._promiseRejected=function(reason){if(this._addRejected(reason),this.howMany()>this._canPossiblyFulfill()){for(var e=new AggregateError,i=this.length();i0},PromiseInspection.prototype.isRejected=Promise.prototype._isRejected=function(){return(134217728&this._bitField)>0},PromiseInspection.prototype.isPending=Promise.prototype._isPending=function(){return 0===(402653184&this._bitField)},PromiseInspection.prototype.isResolved=Promise.prototype._isResolved=function(){return(402653184&this._bitField)>0},Promise.prototype.isPending=function(){return this._target()._isPending()},Promise.prototype.isRejected=function(){return this._target()._isRejected()},Promise.prototype.isFulfilled=function(){return this._target()._isFulfilled()},Promise.prototype.isResolved=function(){return this._target()._isResolved()},Promise.prototype._value=function(){return this._settledValue},Promise.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},Promise.prototype.value=function(){var target=this._target();if(!target.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return target._settledValue},Promise.prototype.reason=function(){var target=this._target();if(!target.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return target._unsetRejectionIsUnhandled(),target._settledValue},Promise.PromiseInspection=PromiseInspection}},{}],35:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){function tryConvertToPromise(obj,context){if(isObject(obj)){if(obj instanceof Promise)return obj;if(isAnyBluebirdPromise(obj)){var ret=new Promise(INTERNAL);return obj._then(ret._fulfillUnchecked,ret._rejectUncheckedCheckError,ret._progressUnchecked,ret,null),ret}var then=util.tryCatch(getThen)(obj);if(then===errorObj){context&&context._pushContext();var ret=Promise.reject(then.e);return context&&context._popContext(),ret}if("function"==typeof then)return doThenable(obj,then,context)}return obj}function getThen(obj){return obj.then}function isAnyBluebirdPromise(obj){return hasProp.call(obj,"_promise0")}function doThenable(x,then,context){function resolveFromThenable(value){promise&&(promise._resolveCallback(value),promise=null)}function rejectFromThenable(reason){promise&&(promise._rejectCallback(reason,synchronous,!0),promise=null)}function progressFromThenable(value){promise&&"function"==typeof promise._progress&&promise._progress(value)}var promise=new Promise(INTERNAL),ret=promise;context&&context._pushContext(),promise._captureStackTrace(),context&&context._popContext();var synchronous=!0,result=util.tryCatch(then).call(x,resolveFromThenable,rejectFromThenable,progressFromThenable);return synchronous=!1,promise&&result===errorObj&&(promise._rejectCallback(result.e,!0,!0),promise=null),ret}var util=_dereq_("./util.js"),errorObj=util.errorObj,isObject=util.isObject,hasProp={}.hasOwnProperty;return tryConvertToPromise}},{"./util.js":38}],36:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,INTERNAL){function successClear(value){var handle=this;return handle instanceof Number&&(handle=+handle),clearTimeout(handle),value}function failureClear(reason){var handle=this;throw handle instanceof Number&&(handle=+handle),clearTimeout(handle),reason}var util=_dereq_("./util.js"),TimeoutError=Promise.TimeoutError,afterTimeout=function(promise,message){if(promise.isPending()){var err;!util.isPrimitive(message)&&message instanceof Error?err=message:("string"!=typeof message&&(message="operation timed out"),err=new TimeoutError(message)),util.markAsOriginatingFromRejection(err),promise._attachExtraTrace(err),promise._cancel(err)}},afterValue=function(value){return delay(+this).thenReturn(value)},delay=Promise.delay=function(value,ms){if(void 0===ms){ms=value,value=void 0;var ret=new Promise(INTERNAL);return setTimeout(function(){ret._fulfill()},ms),ret}return ms=+ms,Promise.resolve(value)._then(afterValue,null,null,ms,void 0)};Promise.prototype.delay=function(ms){return delay(this,ms)},Promise.prototype.timeout=function(ms,message){ms=+ms;var ret=this.then().cancellable();ret._cancellationParent=this;var handle=setTimeout(function(){afterTimeout(ret,message)},ms);return ret._then(successClear,failureClear,void 0,handle,void 0)}}},{"./util.js":38}],37:[function(_dereq_,module,exports){"use strict";module.exports=function(Promise,apiRejection,tryConvertToPromise,createContext){function inspectionMapper(inspections){for(var len=inspections.length,i=0;len>i;++i){var inspection=inspections[i];if(inspection.isRejected())return Promise.reject(inspection.error());inspections[i]=inspection._settledValue}return inspections}function thrower(e){setTimeout(function(){throw e},0)}function castPreservingDisposable(thenable){var maybePromise=tryConvertToPromise(thenable);return maybePromise!==thenable&&"function"==typeof thenable._isDisposable&&"function"==typeof thenable._getDisposer&&thenable._isDisposable()&&maybePromise._setDisposable(thenable._getDisposer()),maybePromise}function dispose(resources,inspection){function iterator(){if(i>=len)return ret.resolve();var maybePromise=castPreservingDisposable(resources[i++]);if(maybePromise instanceof Promise&&maybePromise._isDisposable()){try{maybePromise=tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection),resources.promise)}catch(e){return thrower(e)}if(maybePromise instanceof Promise)return maybePromise._then(iterator,thrower,null,null,null)}iterator()}var i=0,len=resources.length,ret=Promise.defer();return iterator(),ret.promise}function disposerSuccess(value){var inspection=new PromiseInspection;return inspection._settledValue=value,inspection._bitField=268435456,dispose(this,inspection).thenReturn(value)}function disposerFail(reason){var inspection=new PromiseInspection;return inspection._settledValue=reason,inspection._bitField=134217728,dispose(this,inspection).thenThrow(reason)}function Disposer(data,promise,context){this._data=data,this._promise=promise,this._context=context}function FunctionDisposer(fn,promise,context){this.constructor$(fn,promise,context)}function maybeUnwrapDisposer(value){return Disposer.isDisposer(value)?(this.resources[this.index]._setDisposable(value),value.promise()):value}var TypeError=_dereq_("./errors.js").TypeError,inherits=_dereq_("./util.js").inherits,PromiseInspection=Promise.PromiseInspection;Disposer.prototype.data=function(){return this._data},Disposer.prototype.promise=function(){return this._promise},Disposer.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},Disposer.prototype.tryDispose=function(inspection){var resource=this.resource(),context=this._context;void 0!==context&&context._pushContext();var ret=null!==resource?this.doDispose(resource,inspection):null;return void 0!==context&&context._popContext(),this._promise._unsetDisposable(),this._data=null,ret},Disposer.isDisposer=function(d){return null!=d&&"function"==typeof d.resource&&"function"==typeof d.tryDispose},inherits(FunctionDisposer,Disposer),FunctionDisposer.prototype.doDispose=function(resource,inspection){var fn=this.data();return fn.call(resource,resource,inspection)},Promise.using=function(){var len=arguments.length;if(2>len)return apiRejection("you must pass at least 2 arguments to Promise.using");var fn=arguments[len-1];if("function"!=typeof fn)return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");var input,spreadArgs=!0;2===len&&Array.isArray(arguments[0])?(input=arguments[0],len=input.length,spreadArgs=!1):(input=arguments,len--);for(var resources=new Array(len),i=0;len>i;++i){var resource=input[i];if(Disposer.isDisposer(resource)){var disposer=resource;resource=resource.promise(),resource._setDisposable(disposer)}else{var maybePromise=tryConvertToPromise(resource);maybePromise instanceof Promise&&(resource=maybePromise._then(maybeUnwrapDisposer,null,null,{resources:resources,index:i},void 0))}resources[i]=resource}var promise=Promise.settle(resources).then(inspectionMapper).then(function(vals){promise._pushContext();var ret;try{ret=spreadArgs?fn.apply(void 0,vals):fn.call(void 0,vals)}finally{promise._popContext()}return ret})._then(disposerSuccess,disposerFail,void 0,resources,void 0);return resources.promise=promise,promise},Promise.prototype._setDisposable=function(disposer){this._bitField=262144|this._bitField,this._disposer=disposer; },Promise.prototype._isDisposable=function(){return(262144&this._bitField)>0},Promise.prototype._getDisposer=function(){return this._disposer},Promise.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},Promise.prototype.disposer=function(fn){if("function"==typeof fn)return new FunctionDisposer(fn,this,createContext());throw new TypeError}}},{"./errors.js":13,"./util.js":38}],38:[function(_dereq_,module,exports){"use strict";function tryCatcher(){try{var target=tryCatchTarget;return tryCatchTarget=null,target.apply(this,arguments)}catch(e){return errorObj.e=e,errorObj}}function tryCatch(fn){return tryCatchTarget=fn,tryCatcher}function isPrimitive(val){return null==val||val===!0||val===!1||"string"==typeof val||"number"==typeof val}function isObject(value){return!isPrimitive(value)}function maybeWrapAsError(maybeError){return isPrimitive(maybeError)?new Error(safeToString(maybeError)):maybeError}function withAppended(target,appendee){var i,len=target.length,ret=new Array(len+1);for(i=0;len>i;++i)ret[i]=target[i];return ret[i]=appendee,ret}function getDataPropertyOrDefault(obj,key,defaultValue){if(!es5.isES5)return{}.hasOwnProperty.call(obj,key)?obj[key]:void 0;var desc=Object.getOwnPropertyDescriptor(obj,key);return null!=desc?null==desc.get&&null==desc.set?desc.value:defaultValue:void 0}function notEnumerableProp(obj,name,value){if(isPrimitive(obj))return obj;var descriptor={value:value,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(obj,name,descriptor),obj}function thrower(r){throw r}function isClass(fn){try{if("function"==typeof fn){var keys=es5.names(fn.prototype),hasMethods=es5.isES5&&keys.length>1,hasMethodsOtherThanConstructor=keys.length>0&&!(1===keys.length&&"constructor"===keys[0]),hasThisAssignmentAndStaticMethods=thisAssignmentPattern.test(fn+"")&&es5.names(fn).length>0;if(hasMethods||hasMethodsOtherThanConstructor||hasThisAssignmentAndStaticMethods)return!0}return!1}catch(e){return!1}}function toFastProperties(obj){function f(){}f.prototype=obj;for(var l=8;l--;)new f;return obj}function isIdentifier(str){return rident.test(str)}function filledRange(count,prefix,suffix){for(var ret=new Array(count),i=0;count>i;++i)ret[i]=prefix+i+suffix;return ret}function safeToString(obj){try{return obj+""}catch(e){return"[no string representation]"}}function markAsOriginatingFromRejection(e){try{notEnumerableProp(e,"isOperational",!0)}catch(ignore){}}function originatesFromRejection(e){return null==e?!1:e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0}function canAttachTrace(obj){return obj instanceof Error&&es5.propertyIsWritable(obj,"stack")}function classString(obj){return{}.toString.call(obj)}function copyDescriptors(from,to,filter){for(var keys=es5.names(from),i=0;i10||version[0]>0}(),ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret},{"./es5.js":14}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise),function(global,factory){"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){function isArraylike(obj){var length="length"in obj&&obj.length,type=jQuery.type(obj);return"function"===type||jQuery.isWindow(obj)?!1:1===obj.nodeType&&length?!0:"array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj}function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier))return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not});if(qualifier.nodeType)return jQuery.grep(elements,function(elem){return elem===qualifier!==not});if("string"==typeof qualifier){if(risSimple.test(qualifier))return jQuery.filter(qualifier,elements,not);qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>=0!==not})}function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function completed(){document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1),jQuery.ready()}function Data(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=jQuery.expando+Data.uid++}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$1").toLowerCase(),data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}data_user.set(elem,key,data)}else data=void 0;return data}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(11!==content.nodeType?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var i=0,l=elems.length;l>i;i++)data_priv.set(elems[i],"globalEval",!refElements||data_priv.get(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(1===dest.nodeType){if(data_priv.hasData(src)&&(pdataOld=data_priv.access(src),pdataCur=data_priv.set(dest,pdataOld),events=pdataOld.events)){delete pdataCur.handle,pdataCur.events={};for(type in events)for(i=0,l=events[type].length;l>i;i++)jQuery.event.add(dest,type,events[type][i])}data_user.hasData(src)&&(udataOld=data_user.access(src),udataCur=jQuery.extend({},udataOld),data_user.set(dest,udataCur))}}function getAll(context,tag){var ret=context.getElementsByTagName?context.getElementsByTagName(tag||"*"):context.querySelectorAll?context.querySelectorAll(tag||"*"):[];return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();"input"===nodeName&&rcheckableType.test(src.type)?dest.checked=src.checked:("input"===nodeName||"textarea"===nodeName)&&(dest.defaultValue=src.defaultValue)}function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");return elem.detach(),display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];return display||(display=actualDisplay(nodeName,doc),"none"!==display&&display||(iframe=(iframe||jQuery("'),"after"==options.previewPosition?iFrame.insertAfter(footer):iFrame.insertBefore(header),previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]):altKey===!0&&(iFrame?iFrame.remove():previewWindow.close(),previewWindow=iFrame=!1),options.previewAutoRefresh||refreshPreview(),options.previewInWindow&&previewWindow.focus()}function refreshPreview(){renderPreview()}function renderPreview(){if(options.previewHandler&&"function"==typeof options.previewHandler)options.previewHandler($$.val());else if(options.previewParser&&"function"==typeof options.previewParser){var data=options.previewParser($$.val());writeInPreview(localize(data,1))}else""!==options.previewParserPath?$.ajax({type:"POST",dataType:"text",global:!1,url:options.previewParserPath,data:options.previewParserVar+"="+encodeURIComponent($$.val()),success:function(data){writeInPreview(localize(data,1))}}):template||$.ajax({url:options.previewTemplatePath,dataType:"text",global:!1,success:function(data){writeInPreview(localize(data,1).replace(//g,$$.val()))}});return!1}function writeInPreview(data){if(options.previewInElement)$(options.previewInElement).html(data);else if(previewWindow&&previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(e){sp=0}previewWindow.document.open(),previewWindow.document.write(data),previewWindow.document.close(),previewWindow.document.documentElement.scrollTop=sp}}function keyPressed(e){if(shiftKey=e.shiftKey,altKey=e.altKey,ctrlKey=e.altKey&&e.ctrlKey?!1:e.ctrlKey||e.metaKey,"keydown"===e.type){if(ctrlKey===!0&&(li=$('a[accesskey="'+(13==e.keyCode?"\\n":String.fromCharCode(e.keyCode))+'"]',header).parent("li"),0!==li.length))return ctrlKey=!1,setTimeout(function(){li.triggerHandler("mouseup")},1),!1;if(13===e.keyCode||10===e.keyCode)return ctrlKey===!0?(ctrlKey=!1,markup(options.onCtrlEnter),options.onCtrlEnter.keepDefault):shiftKey===!0?(shiftKey=!1,markup(options.onShiftEnter),options.onShiftEnter.keepDefault):(markup(options.onEnter),options.onEnter.keepDefault);if(9===e.keyCode)return 1==shiftKey||1==ctrlKey||1==altKey?!1:-1!==caretOffset?(get(),caretOffset=$$.val().length-caretOffset,set(caretOffset,0),caretOffset=-1,!1):(markup(options.onTab),options.onTab.keepDefault)}}function remove(){$$.unbind(".markItUp").removeClass("markItUpEditor"),$$.parent("div").parent("div.markItUp").parent("div").replaceWith($$),$$.data("markItUp",null)}var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;if($$=$(this),textarea=this,levels=[],abort=!1,scrollPosition=caretPosition=0,caretOffset=-1,options.previewParserPath=localize(options.previewParserPath),options.previewTemplatePath=localize(options.previewTemplatePath),method)switch(method){case"remove":remove();break;case"insert":markup(params);break;default:$.error("Method "+method+" does not exist on jQuery.markItUp")}else init()})},$.fn.markItUpRemove=function(){return this.each(function(){$(this).markItUp("remove")})},$.markItUp=function(settings){var options={target:!1};return $.extend(options,settings),options.target?$(options.target).each(function(){$(this).focus(),$(this).trigger("insertion",[options])}):void $("textarea").trigger("insertion",[options])}}(jQuery),!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&N(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(V(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&V(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(V(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&V(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),j.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=q.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=Y.call(this,c[0],"y"),c[1]=Y.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",V(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",V(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&N(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);o.data(a)&&(o.data(a),j.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3]))})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),j.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),K(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),K(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["
","
"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"
":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("
");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("
").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=ee(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["","","",""],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(N(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),V(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),V(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),E.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),R.call(this),i.mouseWheel.enable){var r;t()}z.call(this),P.call(this),i.advanced.autoScrollOnFocus&&A.call(this),i.scrollButtons.enable&&H.call(this),i.keyboard.enable&&U.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),o.bindEvents&&(e(document).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),K(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),K(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),K(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return e.target.ownerDocument!==document?[e.originalEvent.screenY,e.originalEvent.screenX,!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[o.screenY,o.screenX,a>1]:[o.pageY,o.pageX,a>1];default:return[e.pageY,e.pageX,!1]}},I=function(){function t(e){var t=m.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}}function o(e,t,o,a){if(m[0].idleTimer=u.scrollInertia<233?250:0,n.attr("id")===h[1])var i="x",r=(n[0].offsetLeft-t+a)*d.scrollRatio.x;else var i="y",r=(n[0].offsetTop-e+o)*d.scrollRatio.y;V(l,r.toString(),{dir:i,drag:!0})}var n,i,r,l=e(this),d=l.data(a),u=d.opt,f=a+"_"+d.idx,h=["mCSB_"+d.idx+"_dragger_vertical","mCSB_"+d.idx+"_dragger_horizontal"],m=e("#mCSB_"+d.idx+"_container"),p=e("#"+h[0]+",#"+h[1]),g=u.advanced.releaseDraggableSelectors?p.add(e(u.advanced.releaseDraggableSelectors)):p;p.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(o){if(o.stopImmediatePropagation(),o.preventDefault(),Z(o)){c=!0,s&&(document.onselectstart=function(){return!1}),t(!1),N(l),n=e(this);var a=n.offset(),d=O(o)[0]-a.top,f=O(o)[1]-a.left,h=n.height()+a.top,m=n.width()+a.left;h>d&&d>0&&m>f&&f>0&&(i=d,r=f),C(n,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=n.offset(),a=O(e)[0]-t.top,l=O(e)[1]-t.left;o(i,r,a,l)}),e(document).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(n){var t=n.offset(),a=O(e)[0]-t.top,l=O(e)[1]-t.left;if(i===a&&r===l)return;o(i,r,a,l)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(e){n&&(C(n,"active",u.autoExpandScrollbar),n=null),c=!1,s&&(document.onselectstart=null),t(!0)})},D=function(){function o(e){if(!$(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,A=[O(e)[0],O(e)[1]]}function n(e){if($(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=G();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(R.push(o),E.push(a),A[2]=Math.abs(O(e)[0]-A[0]),A[3]=Math.abs(O(e)[1]-A[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*A[3]0&&a-f>-(l*B.scrollRatio.x)&&(2*A[2]30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[R[R.length-2],E[E.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",z,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",z,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&V(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],R=[],E=[],L=0,z="yx"===T.axis?"none":"all",A=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},R=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,F(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(e){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r0&&cr?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(e){t||(i&&(i=0,n("off",null)),c=!1)})},E=function(){function t(t,a){if(N(o),!L(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v=t.deltaX||t.deltaY||a;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<2&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor, d=17),V(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},W=function(e){var t=null;try{var o=e.contentDocument||e.contentWindow.document;t=o.body.innerHTML}catch(a){}return null!==t},L=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},z=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(e){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){N(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-.9*u*l.width()}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-.9*u*l.height()}V(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},A=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(o){var a=e(document.activeElement),i=r.find(".mCustomScrollBox").length,s=0;a.is(n.advanced.autoScrollOnFocus)&&(N(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=i?(s+17)*i:0,t[0]._focusTimeout=setTimeout(function(){var e=[te(a)[0],te(a)[1]],o=[r[0].offsetTop,r[0].offsetLeft],i=[o[0]+e[0]>=0&&o[0]+e[0]=0&&o[0]+e[1]a");s.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.snapAmount||n.scrollButtons.scrollAmount,F(t,e,o)}if(a.preventDefault(),Z(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},U=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.snapAmount||i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||F(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){N(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var h="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();V(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;V(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},F=function(t,o,n,i,r){function l(e){var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],u="x"===f.dir[0]?s[1]+f.dir[1]*d[1]*n:s[0]+f.dir[1]*d[0]*n,m="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),v="auto"!==f.scrollAmount?m:u,x=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",_=e?!0:!1;return e&&17>a&&(v="x"===f.dir[0]?s[1]:s[0]),V(t,v.toString(),{dir:f.dir[0],scrollEasing:x,dur:a,onComplete:_}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),K(f,"step"),N(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type?!0:!1,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],N(t),ee(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},q=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},Y=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1):l.outerHeight(!1),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?te(m)[1]:te(m)[0];case"string":case"number":if(ee(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&ee(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?te(m)[1]:te(m)[0]}return e(t).length?"x"===o?te(e(t))[1]:te(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},j=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void K(f[0],"autoUpdate")):void o()},X=function(e,t,o){return Math.round(e/t)*t-o},N=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){J.call(this)})},V=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||_>=w[0]+b,c.callbacks.alwaysTriggerOffsets||-y>=_]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[v[0].offsetTop,v[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?q.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?q.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,(0!==m.scrollTop()||0!==m.scrollLeft())&&(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){switch(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount&&(o=X(o,c.snapAmount,c.snapOffset)),n.dir){case"x":var v=e("#mCSB_"+s.idx+"_dragger_horizontal"),x="left",_=h[0].offsetLeft,w=[f.width()-h.outerWidth(!1),v.parent().width()-v.width()],S=[o,0===o?0:o/s.scrollRatio.x],b=p[1],y=g[1],B=b>0?b/s.scrollRatio.x:0,T=y>0?y/s.scrollRatio.x:0;break;case"y":var v=e("#mCSB_"+s.idx+"_dragger_vertical"),x="top",_=h[0].offsetTop,w=[f.height()-h.outerHeight(!1),v.parent().height()-v.height()],S=[o,0===o?0:o/s.scrollRatio.y],b=p[0],y=g[0],B=b>0?b/s.scrollRatio.y:0,T=y>0?y/s.scrollRatio.y:0}S[1]<0||0===S[0]&&0===S[1]?S=[0,0]:S[1]>=w[1]?S=[w[0],w[1]]:S[0]=-S[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),(s.tweenRunning||!(0===_&&S[0]>=0||_===w[0]&&S[0]<=w[0]))&&(Q(v[0],x,Math.round(S[1]),u[1],n.scrollEasing),Q(h[0],x,Math.round(S[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(v),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&S[1]>=w[1]-B&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&S[1]<=T&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(v,"hide")},e)}}}))}},Q=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=G()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=G(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},G=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},J=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o=0&&a[0]+te(n)[0]=0&&a[1]+te(n)[1]i;i++)callback.call(null,i,obj[i])}function handleStackInfo(stackInfo,options){var frames=[];stackInfo.stack&&stackInfo.stack.length&&each(stackInfo.stack,function(i,stack){var frame=normalizeFrame(stack);frame&&frames.push(frame)}),triggerEvent("handle",{stackInfo:stackInfo,options:options}),processException(stackInfo.name,stackInfo.message,stackInfo.url,stackInfo.lineno,frames,options)}function normalizeFrame(frame){if(frame.url){var i,normalized={filename:frame.url,lineno:frame.line,colno:frame.column,"function":frame.func||"?"},context=extractContextFromFrame(frame);if(context){var keys=["pre_context","context_line","post_context"];for(i=3;i--;)normalized[keys[i]]=context[i]}return normalized.in_app=!(globalOptions.includePaths.test&&!globalOptions.includePaths.test(normalized.filename)||/(Raven|TraceKit)\./.test(normalized["function"])||/raven\.(min\.)?js$/.test(normalized.filename)),normalized}}function extractContextFromFrame(frame){if(frame.context&&globalOptions.fetchContext){for(var context=frame.context,pivot=~~(context.length/2),i=context.length,isMinified=!1;i--;)if(context[i].length>300){isMinified=!0;break}if(isMinified){if(isUndefined(frame.column))return;return[[],context[pivot].substr(frame.column,50),[]]}return[context.slice(0,pivot),context[pivot],context.slice(pivot+1)]}}function processException(type,message,fileurl,lineno,frames,options){var stacktrace,fullMessage;globalOptions.ignoreErrors.test&&globalOptions.ignoreErrors.test(message)||(message+="",message=truncate(message,globalOptions.maxMessageLength),fullMessage=type+": "+message,fullMessage=truncate(fullMessage,globalOptions.maxMessageLength),frames&&frames.length?(fileurl=frames[0].filename||fileurl,frames.reverse(),stacktrace={frames:frames}):fileurl&&(stacktrace={frames:[{filename:fileurl,lineno:lineno,in_app:!0}]}),globalOptions.ignoreUrls.test&&globalOptions.ignoreUrls.test(fileurl)||(!globalOptions.whitelistUrls.test||globalOptions.whitelistUrls.test(fileurl))&&send(objectMerge({exception:{type:type,value:message},stacktrace:stacktrace,culprit:fileurl,message:fullMessage},options)))}function objectMerge(obj1,obj2){return obj2?(each(obj2,function(key,value){obj1[key]=value}),obj1):obj1}function truncate(str,max){return str.length<=max?str:str.substr(0,max)+"…"}function now(){return+new Date}function getHttpData(){if(document.location&&document.location.href){var http={headers:{"User-Agent":navigator.userAgent}};return http.url=document.location.href,document.referrer&&(http.headers.Referer=document.referrer),http}}function send(data){var baseData={project:globalProject,logger:globalOptions.logger,platform:"javascript"},http=getHttpData();http&&(baseData.request=http),data=objectMerge(baseData,data),data.tags=objectMerge(objectMerge({},globalOptions.tags),data.tags),data.extra=objectMerge(objectMerge({},globalOptions.extra),data.extra),data.extra=objectMerge({"session:duration":now()-startTime},data.extra),isEmptyObject(data.tags)&&delete data.tags,globalUser&&(data.user=globalUser),globalOptions.release&&(data.release=globalOptions.release),isFunction(globalOptions.dataCallback)&&(data=globalOptions.dataCallback(data)||data),data&&!isEmptyObject(data)&&(!isFunction(globalOptions.shouldSendCallback)||globalOptions.shouldSendCallback(data))&&(lastEventId=data.event_id||(data.event_id=uuid4()),logDebug("debug","Raven about to send:",data),isSetup()&&(globalOptions.transport||makeRequest)({url:globalServer,auth:{sentry_version:"4",sentry_client:"raven-js/"+Raven.VERSION,sentry_key:globalKey},data:data,options:globalOptions,onSuccess:function(){triggerEvent("success",{data:data,src:globalServer})},onError:function(){triggerEvent("failure",{data:data,src:globalServer})}}))}function makeRequest(opts){opts.auth.sentry_data=JSON.stringify(opts.data);var img=newImage(),src=opts.url+"?"+urlencode(opts.auth);(opts.options.crossOrigin||""===opts.options.crossOrigin)&&(img.crossOrigin=opts.options.crossOrigin),img.onload=opts.onSuccess,img.onerror=img.onabort=opts.onError,img.src=src}function newImage(){return document.createElement("img")}function isSetup(){return hasJSON?globalServer?!0:(ravenNotConfiguredError||logDebug("error","Error: Raven has not been configured."),ravenNotConfiguredError=!0,!1):!1}function joinRegExp(patterns){for(var pattern,sources=[],i=0,len=patterns.length;len>i;i++)pattern=patterns[i],isString(pattern)?sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):pattern&&pattern.source&&sources.push(pattern.source);return new RegExp(sources.join("|"),"i")}function uuid4(){var crypto=window.crypto||window.msCrypto;if(!isUndefined(crypto)&&crypto.getRandomValues){var arr=new Uint16Array(8);crypto.getRandomValues(arr),arr[3]=4095&arr[3]|16384,arr[4]=16383&arr[4]|32768;var pad=function(num){for(var v=num.toString(16);v.length<4;)v="0"+v;return v};return pad(arr[0])+pad(arr[1])+pad(arr[2])+pad(arr[3])+pad(arr[4])+pad(arr[5])+pad(arr[6])+pad(arr[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=16*Math.random()|0,v="x"==c?r:3&r|8;return v.toString(16)})}function logDebug(level){originalConsoleMethods[level]&&Raven.debug&&originalConsoleMethods[level].apply(originalConsole,_slice.call(arguments,1))}function afterLoad(){var RavenConfig=window.RavenConfig;RavenConfig&&Raven.config(RavenConfig.dsn,RavenConfig.config).install()}function urlencode(o){var pairs=[];return each(o,function(key,value){pairs.push(encodeURIComponent(key)+"="+encodeURIComponent(value))}),pairs.join("&")}var TraceKit={remoteFetching:!1,collectWindowErrors:!0,linesOfContext:7,debug:!1},_slice=[].slice,UNKNOWN_FUNCTION="?";TraceKit.wrap=function(func){function wrapped(){try{return func.apply(this,arguments)}catch(e){throw TraceKit.report(e),e}}return wrapped},TraceKit.report=function(){function subscribe(handler){installGlobalHandler(),handlers.push(handler)}function unsubscribe(handler){for(var i=handlers.length-1;i>=0;--i)handlers[i]===handler&&handlers.splice(i,1)}function unsubscribeAll(){uninstallGlobalHandler(),handlers=[]}function notifyHandlers(stack,isWindowError){var exception=null;if(!isWindowError||TraceKit.collectWindowErrors){for(var i in handlers)if(hasKey(handlers,i))try{handlers[i].apply(null,[stack].concat(_slice.call(arguments,2)))}catch(inner){exception=inner}if(exception)throw exception}}function traceKitWindowOnError(message,url,lineNo,colNo,ex){var stack=null;if(lastExceptionStack)TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack,url,lineNo,message),processLastException();else if(ex)stack=TraceKit.computeStackTrace(ex),notifyHandlers(stack,!0);else{var location={url:url,line:lineNo,column:colNo};location.func=TraceKit.computeStackTrace.guessFunctionName(location.url,location.line),location.context=TraceKit.computeStackTrace.gatherContext(location.url,location.line),stack={message:message,url:document.location.href,stack:[location]},notifyHandlers(stack,!0)}return _oldOnerrorHandler?_oldOnerrorHandler.apply(this,arguments):!1}function installGlobalHandler(){_onErrorHandlerInstalled||(_oldOnerrorHandler=window.onerror,window.onerror=traceKitWindowOnError,_onErrorHandlerInstalled=!0)}function uninstallGlobalHandler(){_onErrorHandlerInstalled&&(window.onerror=_oldOnerrorHandler,_onErrorHandlerInstalled=!1,_oldOnerrorHandler=undefined)}function processLastException(){var _lastExceptionStack=lastExceptionStack,_lastArgs=lastArgs;lastArgs=null,lastExceptionStack=null,lastException=null,notifyHandlers.apply(null,[_lastExceptionStack,!1].concat(_lastArgs))}function report(ex,rethrow){var args=_slice.call(arguments,1);if(lastExceptionStack){if(lastException===ex)return;processLastException()}var stack=TraceKit.computeStackTrace(ex);if(lastExceptionStack=stack,lastException=ex,lastArgs=args,window.setTimeout(function(){lastException===ex&&processLastException()},stack.incomplete?2e3:0),rethrow!==!1)throw ex}var _oldOnerrorHandler,_onErrorHandlerInstalled,handlers=[],lastArgs=null,lastException=null,lastExceptionStack=null;return report.subscribe=subscribe,report.unsubscribe=unsubscribe,report.uninstall=unsubscribeAll,report}(),TraceKit.computeStackTrace=function(){function loadSource(url){if(!TraceKit.remoteFetching)return"";try{var getXHR=function(){try{return new window.XMLHttpRequest}catch(e){return new window.ActiveXObject("Microsoft.XMLHTTP")}},request=getXHR();return request.open("GET",url,!1),request.send(""),request.responseText}catch(e){return""}}function getSource(url){if(!isString(url))return[];if(!hasKey(sourceCache,url)){var source="",domain="";try{domain=document.domain}catch(e){}-1!==url.indexOf(domain)&&(source=loadSource(url)),sourceCache[url]=source?source.split("\n"):[]}return sourceCache[url]}function guessFunctionName(url,lineNo){var m,reFunctionArgNames=/function ([^(]*)\(([^)]*)\)/,reGuessFunction=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,line="",maxLines=10,source=getSource(url);if(!source.length)return UNKNOWN_FUNCTION;for(var i=0;maxLines>i;++i)if(line=source[lineNo-i]+line,!isUndefined(line)){if(m=reGuessFunction.exec(line))return m[1];if(m=reFunctionArgNames.exec(line))return m[1]}return UNKNOWN_FUNCTION}function gatherContext(url,line){var source=getSource(url);if(!source.length)return null;var context=[],linesBefore=Math.floor(TraceKit.linesOfContext/2),linesAfter=linesBefore+TraceKit.linesOfContext%2,start=Math.max(0,line-linesBefore-1),end=Math.min(source.length,line+linesAfter-1);line-=1;for(var i=start;end>i;++i)isUndefined(source[i])||context.push(source[i]);return context.length>0?context:null}function escapeRegExp(text){return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function escapeCodeAsRegExpForMatchingInsideHTML(body){return escapeRegExp(body).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function findSourceInUrls(re,urls){for(var source,m,i=0,j=urls.length;j>i;++i)if((source=getSource(urls[i])).length&&(source=source.join("\n"),m=re.exec(source)))return{url:urls[i],line:source.substring(0,m.index).split("\n").length,column:m.index-source.lastIndexOf("\n",m.index)-1};return null}function findSourceInLine(fragment,url,line){var m,source=getSource(url),re=new RegExp("\\b"+escapeRegExp(fragment)+"\\b");return line-=1,source&&source.length>line&&(m=re.exec(source[line]))?m.index:null}function findSourceByFunctionBody(func){for(var body,re,parts,result,urls=[window.location.href],scripts=document.getElementsByTagName("script"),code=""+func,codeRE=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,eventRE=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,i=0;i):(\d+)(?::(\d+))?\)?\s*$/i,gecko=/^\s*(.*?)(?:\((.*?)\))?@((?:file|https?|chrome).*?):(\d+)(?::(\d+))?\s*$/i,winjs=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,lines=ex.stack.split("\n"),stack=[],reference=/^(.*) is undefined$/.exec(ex.message),i=0,j=lines.length;j>i;++i){if(parts=gecko.exec(lines[i]))element={url:parts[3],func:parts[1]||UNKNOWN_FUNCTION,args:parts[2]?parts[2].split(","):"",line:+parts[4],column:parts[5]?+parts[5]:null};else if(parts=chrome.exec(lines[i]))element={url:parts[2],func:parts[1]||UNKNOWN_FUNCTION,line:+parts[3],column:parts[4]?+parts[4]:null};else{if(!(parts=winjs.exec(lines[i])))continue;element={url:parts[2],func:parts[1]||UNKNOWN_FUNCTION,line:+parts[3],column:parts[4]?+parts[4]:null}}!element.func&&element.line&&(element.func=guessFunctionName(element.url,element.line)),element.line&&(element.context=gatherContext(element.url,element.line)),stack.push(element)}return stack.length?(stack[0].line&&!stack[0].column&&reference?stack[0].column=findSourceInLine(reference[1],stack[0].url,stack[0].line):stack[0].column||isUndefined(ex.columnNumber)||(stack[0].column=ex.columnNumber+1),{name:ex.name,message:ex.message,url:document.location.href,stack:stack}):null}}function computeStackTraceFromStacktraceProp(ex){var stacktrace=ex.stacktrace;if(!isUndefined(ex.stacktrace)&&ex.stacktrace){for(var parts,testRE=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,lines=stacktrace.split("\n"),stack=[],i=0,j=lines.length;j>i;i+=2)if(parts=testRE.exec(lines[i])){var element={line:+parts[1],column:+parts[2],func:parts[3]||parts[4],args:parts[5]?parts[5].split(","):[],url:parts[6]};if(!element.func&&element.line&&(element.func=guessFunctionName(element.url,element.line)),element.line)try{element.context=gatherContext(element.url,element.line)}catch(exc){}element.context||(element.context=[lines[i+1]]),stack.push(element)}return stack.length?{name:ex.name,message:ex.message,url:document.location.href,stack:stack}:null}}function computeStackTraceFromOperaMultiLineMessage(ex){var lines=ex.message.split("\n");if(lines.length<4)return null;var parts,i,len,source,lineRE1=/^\s*Line (\d+) of linked script ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,lineRE2=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,lineRE3=/^\s*Line (\d+) of function script\s*$/i,stack=[],scripts=document.getElementsByTagName("script"),inlineScriptBlocks=[];for(i in scripts)hasKey(scripts,i)&&!scripts[i].src&&inlineScriptBlocks.push(scripts[i]);for(i=2,len=lines.length;len>i;i+=2){var item=null;if(parts=lineRE1.exec(lines[i]))item={url:parts[2], func:parts[3],line:+parts[1]};else if(parts=lineRE2.exec(lines[i])){item={url:parts[3],func:parts[4]};var relativeLine=+parts[1],script=inlineScriptBlocks[parts[2]-1];if(script&&(source=getSource(item.url))){source=source.join("\n");var pos=source.indexOf(script.innerText);pos>=0&&(item.line=relativeLine+source.substring(0,pos).split("\n").length)}}else if(parts=lineRE3.exec(lines[i])){var url=window.location.href.replace(/#.*$/,""),line=parts[1],re=new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[i+1]));source=findSourceInUrls(re,[url]),item={url:url,line:source?source.line:line,func:""}}if(item){item.func||(item.func=guessFunctionName(item.url,item.line));var context=gatherContext(item.url,item.line),midline=context?context[Math.floor(context.length/2)]:null;context&&midline.replace(/^\s*/,"")===lines[i+1].replace(/^\s*/,"")?item.context=context:item.context=[lines[i+1]],stack.push(item)}}return stack.length?{name:ex.name,message:lines[0],url:document.location.href,stack:stack}:null}function augmentStackTraceWithInitialElement(stackInfo,url,lineNo,message){var initial={url:url,line:lineNo};if(initial.url&&initial.line){stackInfo.incomplete=!1,initial.func||(initial.func=guessFunctionName(initial.url,initial.line)),initial.context||(initial.context=gatherContext(initial.url,initial.line));var reference=/ '([^']+)' /.exec(message);if(reference&&(initial.column=findSourceInLine(reference[1],initial.url,initial.line)),stackInfo.stack.length>0&&stackInfo.stack[0].url===initial.url){if(stackInfo.stack[0].line===initial.line)return!1;if(!stackInfo.stack[0].line&&stackInfo.stack[0].func===initial.func)return stackInfo.stack[0].line=initial.line,stackInfo.stack[0].context=initial.context,!1}return stackInfo.stack.unshift(initial),stackInfo.partial=!0,!0}return stackInfo.incomplete=!0,!1}function computeStackTraceByWalkingCallerChain(ex,depth){for(var parts,item,source,functionName=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,stack=[],funcs={},recursion=!1,curr=computeStackTraceByWalkingCallerChain.caller;curr&&!recursion;curr=curr.caller)if(curr!==computeStackTrace&&curr!==TraceKit.report){if(item={url:null,func:UNKNOWN_FUNCTION,line:null,column:null},curr.name?item.func=curr.name:(parts=functionName.exec(curr.toString()))&&(item.func=parts[1]),"undefined"==typeof item.func)try{item.func=parts.input.substring(0,parts.input.indexOf("{"))}catch(e){}if(source=findSourceByFunctionBody(curr)){item.url=source.url,item.line=source.line,item.func===UNKNOWN_FUNCTION&&(item.func=guessFunctionName(item.url,item.line));var reference=/ '([^']+)' /.exec(ex.message||ex.description);reference&&(item.column=findSourceInLine(reference[1],source.url,source.line))}funcs[""+curr]?recursion=!0:funcs[""+curr]=!0,stack.push(item)}depth&&stack.splice(0,depth);var result={name:ex.name,message:ex.message,url:document.location.href,stack:stack};return augmentStackTraceWithInitialElement(result,ex.sourceURL||ex.fileName,ex.line||ex.lineNumber,ex.message||ex.description),result}function computeStackTrace(ex,depth){var stack=null;depth=null==depth?0:+depth;try{if(stack=computeStackTraceFromStacktraceProp(ex))return stack}catch(e){if(TraceKit.debug)throw e}try{if(stack=computeStackTraceFromStackProp(ex))return stack}catch(e){if(TraceKit.debug)throw e}try{if(stack=computeStackTraceFromOperaMultiLineMessage(ex))return stack}catch(e){if(TraceKit.debug)throw e}try{if(stack=computeStackTraceByWalkingCallerChain(ex,depth+1))return stack}catch(e){if(TraceKit.debug)throw e}return{name:ex.name,message:ex.message,url:document.location.href}}var sourceCache={};return computeStackTrace.augmentStackTraceWithInitialElement=augmentStackTraceWithInitialElement,computeStackTrace.computeStackTraceFromStackProp=computeStackTraceFromStackProp,computeStackTrace.guessFunctionName=guessFunctionName,computeStackTrace.gatherContext=gatherContext,computeStackTrace}();var lastCapturedException,lastEventId,globalServer,globalUser,globalKey,globalProject,_Raven=window.Raven,hasJSON=!("object"!=typeof JSON||!JSON.stringify),globalOptions={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],crossOrigin:"anonymous",collectWindowErrors:!0,tags:{},maxMessageLength:100,extra:{}},isRavenInstalled=!1,objectPrototype=Object.prototype,originalConsole=window.console||{},originalConsoleMethods={},startTime=now();for(var method in originalConsole)originalConsoleMethods[method]=originalConsole[method];var Raven={VERSION:"1.1.22",debug:!0,noConflict:function(){return window.Raven=_Raven,Raven},config:function(dsn,options){if(globalServer)return logDebug("error","Error: Raven has already been configured"),Raven;if(!dsn)return Raven;var uri=parseDSN(dsn),lastSlash=uri.path.lastIndexOf("/"),path=uri.path.substr(1,lastSlash);return options&&each(options,function(key,value){globalOptions[key]=value}),globalOptions.ignoreErrors.push(/^Script error\.?$/),globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),globalOptions.ignoreErrors=joinRegExp(globalOptions.ignoreErrors),globalOptions.ignoreUrls=globalOptions.ignoreUrls.length?joinRegExp(globalOptions.ignoreUrls):!1,globalOptions.whitelistUrls=globalOptions.whitelistUrls.length?joinRegExp(globalOptions.whitelistUrls):!1,globalOptions.includePaths=joinRegExp(globalOptions.includePaths),globalKey=uri.user,globalProject=uri.path.substr(lastSlash+1),globalServer="//"+uri.host+(uri.port?":"+uri.port:"")+"/"+path+"api/"+globalProject+"/store/",uri.protocol&&(globalServer=uri.protocol+":"+globalServer),globalOptions.fetchContext&&(TraceKit.remoteFetching=!0),globalOptions.linesOfContext&&(TraceKit.linesOfContext=globalOptions.linesOfContext),TraceKit.collectWindowErrors=!!globalOptions.collectWindowErrors,Raven},install:function(){return isSetup()&&!isRavenInstalled&&(TraceKit.report.subscribe(handleStackInfo),isRavenInstalled=!0),Raven},context:function(options,func,args){return isFunction(options)&&(args=func||[],func=options,options=undefined),Raven.wrap(options,func).apply(this,args)},wrap:function(options,func){function wrapped(){for(var args=[],i=arguments.length,deep=!options||options&&options.deep!==!1;i--;)args[i]=deep?Raven.wrap(options,arguments[i]):arguments[i];try{return func.apply(this,args)}catch(e){throw Raven.captureException(e,options),e}}if(isUndefined(func)&&!isFunction(options))return options;if(isFunction(options)&&(func=options,options=undefined),!isFunction(func))return func;if(func.__raven__)return func;for(var property in func)hasKey(func,property)&&(wrapped[property]=func[property]);return wrapped.__raven__=!0,wrapped.__inner__=func,wrapped},uninstall:function(){return TraceKit.report.uninstall(),isRavenInstalled=!1,Raven},captureException:function(ex,options){if(!isError(ex))return Raven.captureMessage(ex,options);lastCapturedException=ex;try{var stack=TraceKit.computeStackTrace(ex);handleStackInfo(stack,options)}catch(ex1){if(ex!==ex1)throw ex1}return Raven},captureMessage:function(msg,options){return globalOptions.ignoreErrors.test&&globalOptions.ignoreErrors.test(msg)?void 0:(send(objectMerge({message:msg+""},options)),Raven)},setUserContext:function(user){return globalUser=user,Raven},setExtraContext:function(extra){return globalOptions.extra=extra||{},Raven},setTagsContext:function(tags){return globalOptions.tags=tags||{},Raven},setReleaseContext:function(release){return globalOptions.release=release,Raven},setDataCallback:function(callback){return globalOptions.dataCallback=callback,Raven},setShouldSendCallback:function(callback){return globalOptions.shouldSendCallback=callback,Raven},lastException:function(){return lastCapturedException},lastEventId:function(){return lastEventId},isSetup:function(){return isSetup()}};Raven.setUser=Raven.setUserContext;var dsnKeys="source protocol user pass host port path".split(" "),dsnPattern=/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;RavenConfigError.prototype=new Error,RavenConfigError.prototype.constructor=RavenConfigError;var ravenNotConfiguredError;afterLoad(),"function"==typeof define&&define.amd?(window.Raven=Raven,define("raven",[],function(){return Raven})):"object"==typeof module?module.exports=Raven:"object"==typeof exports?exports=Raven:window.Raven=Raven}("undefined"!=typeof window?window:this),function(window,undefined){var gEval=function(js){(window.execScript||function(js){window.eval.call(window,js)})(js)},isA=function(a,b){return a instanceof(b||Array)},D=document,getElementsByTagName="getElementsByTagName",length="length",readyState="readyState",onreadystatechange="onreadystatechange",scripts=D[getElementsByTagName]("script"),scriptTag=scripts[scripts[length]-1],script=scriptTag.innerHTML.replace(/^\s+|\s+$/g,"");if(!window.ljs){var checkLoaded=scriptTag.src.match(/checkLoaded/)?1:0,header=D[getElementsByTagName]("head")[0]||D.documentElement,urlParse=function(url){var parts={};return parts.u=url.replace(/#(=)?([^#]*)?/g,function(m,a,b){return parts[a?"f":"i"]=b,""}),parts},appendElmt=function(type,attrs,cb){var i,e=D.createElement(type);cb&&(e[readyState]?e[onreadystatechange]=function(){("loaded"===e[readyState]||"complete"===e[readyState])&&(e[onreadystatechange]=null,cb())}:e.onload=cb);for(i in attrs)attrs[i]&&(e[i]=attrs[i]);header.appendChild(e)},load=function(url,cb){if(this.aliases&&this.aliases[url]){var args=this.aliases[url].slice(0);return isA(args)||(args=[args]),cb&&args.push(cb),this.load.apply(this,args)}if(isA(url)){for(var l=url[length];l--;)this.load(url[l]);return cb&&url.push(cb),this.load.apply(this,url)}return url.match(/\.css\b/)?this.loadcss(url,cb):this.loadjs(url,cb)},loaded={},loader={aliases:{},loadjs:function(url,cb){var parts=urlParse(url);return url=parts.u,loaded[url]===!0?(cb&&cb(),this):loaded[url]!==undefined?(cb&&(loaded[url]=function(ocb,cb){return function(){ocb&&ocb(),cb&&cb()}}(loaded[url],cb)),this):(loaded[url]=function(cb){return function(){loaded[url]=!0,cb&&cb()}}(cb),cb=function(){loaded[url]()},appendElmt("script",{type:"text/javascript",src:url,id:parts.i,onerror:function(error){if(parts.f){var c=error.currentTarget;c.parentNode.removeChild(c),appendElmt("script",{type:"text/javascript",src:parts.f,id:parts.i},cb)}}},cb),this)},loadcss:function(url,cb){var parts=urlParse(url);return url=parts.u,loaded[url]||appendElmt("link",{type:"text/css",rel:"stylesheet",href:url,id:parts.i}),loaded[url]=!0,cb&&cb(),this},load:function(){var argv=arguments,argc=argv[length];return 1===argc&&isA(argv[0],Function)?(argv[0](),this):(load.call(this,argv[0],1>=argc?undefined:function(){loader.load.apply(loader,[].slice.call(argv,1))}),this)},addAliases:function(aliases){for(var i in aliases)this.aliases[i]=isA(aliases[i])?aliases[i].slice(0):aliases[i];return this}};if(checkLoaded){var i,l,links,url;for(i=0,l=scripts[length];l>i;i++)(url=scripts[i].getAttribute("src"))&&(loaded[url.replace(/#.*$/,"")]=!0);for(links=D[getElementsByTagName]("link"),i=0,l=links[length];l>i;i++)("stylesheet"===links[i].rel||"text/css"===links[i].type)&&(loaded[links[i].getAttribute("href").replace(/#.*$/,"")]=!0)}window.ljs=loader}script&&gEval(script)}(window),MessageFormat.locale.af=function(n){return 1===n?"one":"other"},MessageFormat.locale.am=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.ar=function(n){return 0===n?"zero":1==n?"one":2==n?"two":n%100>=3&&10>=n%100&&n==Math.floor(n)?"few":n%100>=11&&99>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.bg=function(n){return 1===n?"one":"other"},MessageFormat.locale.bn=function(n){return 1===n?"one":"other"},MessageFormat.locale.br=function(n){return 0===n?"zero":1==n?"one":2==n?"two":3==n?"few":6==n?"many":"other"},MessageFormat.locale.ca=function(n){return 1===n?"one":"other"},MessageFormat.locale.cs=function(n){return 1==n?"one":2==n||3==n||4==n?"few":"other"},MessageFormat.locale.cy=function(n){return 0===n?"zero":1==n?"one":2==n?"two":3==n?"few":6==n?"many":"other"},MessageFormat.locale.da=function(n){return 1===n?"one":"other"},MessageFormat.locale.de=function(n){return 1===n?"one":"other"},MessageFormat.locale.el=function(n){return 1===n?"one":"other"},MessageFormat.locale.en=function(n){return 1===n?"one":"other"},MessageFormat.locale.es=function(n){return 1===n?"one":"other"},MessageFormat.locale.et=function(n){return 1===n?"one":"other"},MessageFormat.locale.eu=function(n){return 1===n?"one":"other"},MessageFormat.locale.fa=function(n){return"other"},MessageFormat.locale.fi=function(n){return 1===n?"one":"other"},MessageFormat.locale.fil=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.fr=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.ga=function(n){return 1==n?"one":2==n?"two":"other"},MessageFormat.locale.gl=function(n){return 1===n?"one":"other"},MessageFormat.locale.gsw=function(n){return 1===n?"one":"other"},MessageFormat.locale.gu=function(n){return 1===n?"one":"other"},MessageFormat.locale.he=function(n){return 1===n?"one":"other"},MessageFormat.locale.hi=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.hr=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.hu=function(n){return"other"},MessageFormat.locale.id=function(n){return"other"},MessageFormat.locale["in"]=function(n){return"other"},MessageFormat.locale.is=function(n){return 1===n?"one":"other"},MessageFormat.locale.it=function(n){return 1===n?"one":"other"},MessageFormat.locale.iw=function(n){return 1===n?"one":"other"},MessageFormat.locale.ja=function(n){return"other"},MessageFormat.locale.kn=function(n){return"other"},MessageFormat.locale.ko=function(n){return"other"},MessageFormat.locale.lag=function(n){return 0===n?"zero":n>0&&2>n?"one":"other"},MessageFormat.locale.ln=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.lt=function(n){return n%10==1&&(11>n%100||n%100>19)?"one":n%10>=2&&9>=n%10&&(11>n%100||n%100>19)&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.lv=function(n){return 0===n?"zero":n%10==1&&n%100!=11?"one":"other"},MessageFormat.locale.mk=function(n){return n%10==1&&11!=n?"one":"other"},MessageFormat.locale.ml=function(n){return 1===n?"one":"other"},MessageFormat.locale.mo=function(n){return 1==n?"one":0===n||1!=n&&n%100>=1&&19>=n%100&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.mr=function(n){return 1===n?"one":"other"},MessageFormat.locale.ms=function(n){return"other"},MessageFormat.locale.mt=function(n){return 1==n?"one":0===n||n%100>=2&&4>=n%100&&n==Math.floor(n)?"few":n%100>=11&&19>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.nl=function(n){return 1===n?"one":"other"},MessageFormat.locale.no=function(n){return 1===n?"one":"other"},MessageFormat.locale.or=function(n){return 1===n?"one":"other"},MessageFormat.locale.pl=function(n){return 1==n?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||1!=n&&n%10==1||(n%10>=5&&9>=n%10||n%100>=12&&14>=n%100)&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.pt=function(n){return 1===n?"one":"other"},MessageFormat.locale.ro=function(n){return 1==n?"one":0===n||1!=n&&n%100>=1&&19>=n%100&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.ru=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.shi=function(n){return n>=0&&1>=n?"one":n>=2&&10>=n&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.sk=function(n){return 1==n?"one":2==n||3==n||4==n?"few":"other"},MessageFormat.locale.sl=function(n){return n%100==1?"one":n%100==2?"two":n%100==3||n%100==4?"few":"other"},MessageFormat.locale.sq=function(n){return 1===n?"one":"other"},MessageFormat.locale.sr=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.sv=function(n){return 1===n?"one":"other"},MessageFormat.locale.sw=function(n){return 1===n?"one":"other"},MessageFormat.locale.ta=function(n){return 1===n?"one":"other"},MessageFormat.locale.te=function(n){return 1===n?"one":"other"},MessageFormat.locale.th=function(n){return"other"},MessageFormat.locale.tl=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.tr=function(n){return"other"},MessageFormat.locale.uk=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.ur=function(n){return 1===n?"one":"other"},MessageFormat.locale.vi=function(n){return"other"},MessageFormat.locale.zh=function(n){return"other"};var mod;mod=angular.module("infinite-scroll",[]),mod.value("THROTTLE_MILLISECONDS",null),mod.directive("infiniteScroll",["$rootScope","$window","$interval","THROTTLE_MILLISECONDS",function($rootScope,$window,$interval,THROTTLE_MILLISECONDS){return{scope:{infiniteScroll:"&",infiniteScrollContainer:"=",infiniteScrollDistance:"=",infiniteScrollDisabled:"=",infiniteScrollUseDocumentBottom:"=",infiniteScrollListenForEvent:"@"},link:function(scope,elem,attrs){var changeContainer,checkWhenEnabled,container,handleInfiniteScrollContainer,handleInfiniteScrollDisabled,handleInfiniteScrollDistance,handleInfiniteScrollUseDocumentBottom,handler,height,immediateCheck,offsetTop,pageYOffset,scrollDistance,scrollEnabled,throttle,unregisterEventListener,useDocumentBottom,windowElement;return windowElement=angular.element($window),scrollDistance=null,scrollEnabled=null,checkWhenEnabled=null,container=null,immediateCheck=!0,useDocumentBottom=!1,unregisterEventListener=null,height=function(elem){return elem=elem[0]||elem,isNaN(elem.offsetHeight)?elem.document.documentElement.clientHeight:elem.offsetHeight},offsetTop=function(elem){return elem[0].getBoundingClientRect&&!elem.css("none")?elem[0].getBoundingClientRect().top+pageYOffset(elem):void 0},pageYOffset=function(elem){return elem=elem[0]||elem,isNaN(window.pageYOffset)?elem.document.documentElement.scrollTop:elem.ownerDocument.defaultView.pageYOffset},handler=function(){var containerBottom,containerTopOffset,elementBottom,remaining,shouldScroll;return container===windowElement?(containerBottom=height(container)+pageYOffset(container[0].document.documentElement),elementBottom=offsetTop(elem)+height(elem)):(containerBottom=height(container),containerTopOffset=0,void 0!==offsetTop(container)&&(containerTopOffset=offsetTop(container)),elementBottom=offsetTop(elem)-containerTopOffset+height(elem)),useDocumentBottom&&(elementBottom=height((elem[0].ownerDocument||elem[0].document).documentElement)),remaining=elementBottom-containerBottom,shouldScroll=remaining<=height(container)*scrollDistance+1,shouldScroll?(checkWhenEnabled=!0,scrollEnabled?scope.$$phase||$rootScope.$$phase?scope.infiniteScroll():scope.$apply(scope.infiniteScroll):void 0):checkWhenEnabled=!1},throttle=function(func,wait){var later,previous,timeout;return timeout=null,previous=0,later=function(){var context;return previous=(new Date).getTime(),$interval.cancel(timeout),timeout=null,func.call(),context=null},function(){var now,remaining;return now=(new Date).getTime(),remaining=wait-(now-previous),0>=remaining?(clearTimeout(timeout),$interval.cancel(timeout),timeout=null,previous=now,func.call()):timeout?void 0:timeout=$interval(later,remaining,1)}},null!=THROTTLE_MILLISECONDS&&(handler=throttle(handler,THROTTLE_MILLISECONDS)),scope.$on("$destroy",function(){return container.unbind("scroll",handler),null!=unregisterEventListener?(unregisterEventListener(),unregisterEventListener=null):void 0}),handleInfiniteScrollDistance=function(v){return scrollDistance=parseFloat(v)||0},scope.$watch("infiniteScrollDistance",handleInfiniteScrollDistance),handleInfiniteScrollDistance(scope.infiniteScrollDistance),handleInfiniteScrollDisabled=function(v){return scrollEnabled=!v,scrollEnabled&&checkWhenEnabled?(checkWhenEnabled=!1,handler()):void 0},scope.$watch("infiniteScrollDisabled",handleInfiniteScrollDisabled),handleInfiniteScrollDisabled(scope.infiniteScrollDisabled),handleInfiniteScrollUseDocumentBottom=function(v){return useDocumentBottom=v},scope.$watch("infiniteScrollUseDocumentBottom",handleInfiniteScrollUseDocumentBottom),handleInfiniteScrollUseDocumentBottom(scope.infiniteScrollUseDocumentBottom),changeContainer=function(newContainer){return null!=container&&container.unbind("scroll",handler),container=newContainer,null!=newContainer?container.bind("scroll",handler):void 0},changeContainer(windowElement),scope.infiniteScrollListenForEvent&&(unregisterEventListener=$rootScope.$on(scope.infiniteScrollListenForEvent,handler)),handleInfiniteScrollContainer=function(newContainer){if(null!=newContainer&&0!==newContainer.length){if(newContainer instanceof HTMLElement?newContainer=angular.element(newContainer):"function"==typeof newContainer.append?newContainer=angular.element(newContainer[newContainer.length-1]):"string"==typeof newContainer&&(newContainer=angular.element(document.querySelector(newContainer))),null!=newContainer)return changeContainer(newContainer);throw new Exception("invalid infinite-scroll-container attribute.")}},scope.$watch("infiniteScrollContainer",handleInfiniteScrollContainer),handleInfiniteScrollContainer(scope.infiniteScrollContainer||[]),null!=attrs.infiniteScrollParent&&changeContainer(angular.element(elem.parent())),null!=attrs.infiniteScrollImmediateCheck&&(immediateCheck=scope.$eval(attrs.infiniteScrollImmediateCheck)),$interval(function(){return immediateCheck?handler():void 0},0,1)}}}]),!function(undefined){function init(){this._events={},this._conf&&configure.call(this,this._conf)}function configure(conf){conf&&(this._conf=conf,conf.delimiter&&(this.delimiter=conf.delimiter),conf.maxListeners&&(this._events.maxListeners=conf.maxListeners),conf.wildcard&&(this.wildcard=conf.wildcard),conf.newListener&&(this.newListener=conf.newListener),this.wildcard&&(this.listenerTree={}))}function EventEmitter(conf){this._events={},this.newListener=!1,configure.call(this,conf)}function searchListenerTree(handlers,type,tree,i){if(!tree)return[];var leaf,len,branch,xTree,xxTree,isolatedBranch,endReached,listeners=[],typeLength=type.length,currentType=type[i],nextType=type[i+1];if(i===typeLength&&tree._listeners){if("function"==typeof tree._listeners)return handlers&&handlers.push(tree._listeners),[tree];for(leaf=0,len=tree._listeners.length;len>leaf;leaf++)handlers&&handlers.push(tree._listeners[leaf]);return[tree]}if("*"===currentType||"**"===currentType||tree[currentType]){if("*"===currentType){for(branch in tree)"_listeners"!==branch&&tree.hasOwnProperty(branch)&&(listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i+1)));return listeners}if("**"===currentType){endReached=i+1===typeLength||i+2===typeLength&&"*"===nextType,endReached&&tree._listeners&&(listeners=listeners.concat(searchListenerTree(handlers,type,tree,typeLength)));for(branch in tree)"_listeners"!==branch&&tree.hasOwnProperty(branch)&&("*"===branch||"**"===branch?(tree[branch]._listeners&&!endReached&&(listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],typeLength))),listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i))):listeners=branch===nextType?listeners.concat(searchListenerTree(handlers,type,tree[branch],i+2)):listeners.concat(searchListenerTree(handlers,type,tree[branch],i)));return listeners}listeners=listeners.concat(searchListenerTree(handlers,type,tree[currentType],i+1))}if(xTree=tree["*"],xTree&&searchListenerTree(handlers,type,xTree,i+1),xxTree=tree["**"])if(typeLength>i){xxTree._listeners&&searchListenerTree(handlers,type,xxTree,typeLength);for(branch in xxTree)"_listeners"!==branch&&xxTree.hasOwnProperty(branch)&&(branch===nextType?searchListenerTree(handlers,type,xxTree[branch],i+2):branch===currentType?searchListenerTree(handlers,type,xxTree[branch],i+1):(isolatedBranch={},isolatedBranch[branch]=xxTree[branch],searchListenerTree(handlers,type,{"**":isolatedBranch},i+1)))}else xxTree._listeners?searchListenerTree(handlers,type,xxTree,typeLength):xxTree["*"]&&xxTree["*"]._listeners&&searchListenerTree(handlers,type,xxTree["*"],typeLength);return listeners}function growListenerTree(type,listener){type="string"==typeof type?type.split(this.delimiter):type.slice();for(var i=0,len=type.length;len>i+1;i++)if("**"===type[i]&&"**"===type[i+1])return;for(var tree=this.listenerTree,name=type.shift();name;){if(tree[name]||(tree[name]={}),tree=tree[name],0===type.length){if(tree._listeners){if("function"==typeof tree._listeners)tree._listeners=[tree._listeners,listener];else if(isArray(tree._listeners)&&(tree._listeners.push(listener),!tree._listeners.warned)){var m=defaultMaxListeners;"undefined"!=typeof this._events.maxListeners&&(m=this._events.maxListeners),m>0&&tree._listeners.length>m&&(tree._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",tree._listeners.length),console.trace())}}else tree._listeners=listener;return!0}name=type.shift()}return!0}var isArray=Array.isArray?Array.isArray:function(obj){return"[object Array]"===Object.prototype.toString.call(obj)},defaultMaxListeners=10;EventEmitter.prototype.delimiter=".",EventEmitter.prototype.setMaxListeners=function(n){this._events||init.call(this),this._events.maxListeners=n,this._conf||(this._conf={}),this._conf.maxListeners=n},EventEmitter.prototype.event="",EventEmitter.prototype.once=function(event,fn){return this.many(event,1,fn),this},EventEmitter.prototype.many=function(event,ttl,fn){function listener(){0===--ttl&&self.off(event,listener),fn.apply(this,arguments)}var self=this;if("function"!=typeof fn)throw new Error("many only accepts instances of Function");return listener._origin=fn,this.on(event,listener),self},EventEmitter.prototype.emit=function(){this._events||init.call(this);var type=arguments[0];if("newListener"===type&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var l=arguments.length,args=new Array(l-1),i=1;l>i;i++)args[i-1]=arguments[i];for(i=0,l=this._all.length;l>i;i++)this.event=type,this._all[i].apply(this,args)}if("error"===type&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var handler;if(this.wildcard){handler=[];var ns="string"==typeof type?type.split(this.delimiter):type.slice();searchListenerTree.call(this,handler,ns,this.listenerTree,0)}else handler=this._events[type];if("function"==typeof handler){if(this.event=type,1===arguments.length)handler.call(this);else if(arguments.length>1)switch(arguments.length){case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:for(var l=arguments.length,args=new Array(l-1),i=1;l>i;i++)args[i-1]=arguments[i];handler.apply(this,args)}return!0}if(handler){for(var l=arguments.length,args=new Array(l-1),i=1;l>i;i++)args[i-1]=arguments[i];for(var listeners=handler.slice(),i=0,l=listeners.length;l>i;i++)this.event=type,listeners[i].apply(this,args);return listeners.length>0||!!this._all}return!!this._all},EventEmitter.prototype.on=function(type,listener){if("function"==typeof type)return this.onAny(type),this;if("function"!=typeof listener)throw new Error("on only accepts instances of Function");if(this._events||init.call(this),this.emit("newListener",type,listener),this.wildcard)return growListenerTree.call(this,type,listener),this;if(this._events[type]){if("function"==typeof this._events[type])this._events[type]=[this._events[type],listener];else if(isArray(this._events[type])&&(this._events[type].push(listener),!this._events[type].warned)){var m=defaultMaxListeners;"undefined"!=typeof this._events.maxListeners&&(m=this._events.maxListeners),m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),console.trace())}}else this._events[type]=listener;return this},EventEmitter.prototype.onAny=function(fn){if("function"!=typeof fn)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(fn),this},EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype.off=function(type,listener){if("function"!=typeof listener)throw new Error("removeListener only takes instances of Function");var handlers,leafs=[];if(this.wildcard){var ns="string"==typeof type?type.split(this.delimiter):type.slice();leafs=searchListenerTree.call(this,null,ns,this.listenerTree,0)}else{if(!this._events[type])return this;handlers=this._events[type],leafs.push({_listeners:handlers})}for(var iLeaf=0;iLeafi;i++)if(handlers[i]===listener||handlers[i].listener&&handlers[i].listener===listener||handlers[i]._origin&&handlers[i]._origin===listener){position=i;break}if(0>position)continue;return this.wildcard?leaf._listeners.splice(position,1):this._events[type].splice(position,1),0===handlers.length&&(this.wildcard?delete leaf._listeners:delete this._events[type]),this}(handlers===listener||handlers.listener&&handlers.listener===listener||handlers._origin&&handlers._origin===listener)&&(this.wildcard?delete leaf._listeners:delete this._events[type])}return this},EventEmitter.prototype.offAny=function(fn){var fns,i=0,l=0;if(fn&&this._all&&this._all.length>0){for(fns=this._all,i=0,l=fns.length;l>i;i++)if(fn===fns[i])return fns.splice(i,1),this}else this._all=[];return this},EventEmitter.prototype.removeListener=EventEmitter.prototype.off,EventEmitter.prototype.removeAllListeners=function(type){if(0===arguments.length)return!this._events||init.call(this),this;if(this.wildcard)for(var ns="string"==typeof type?type.split(this.delimiter):type.slice(),leafs=searchListenerTree.call(this,null,ns,this.listenerTree,0),iLeaf=0;iLeafii;ii++)newArr[ii]=arr[ii+offset];return newArr}function ensureSize(iter){return void 0===iter.size&&(iter.size=iter.__iterate(returnTrue)),iter.size}function wrapIndex(iter,index){if("number"!=typeof index){var numIndex=+index;if(""+numIndex!==index)return NaN; index=numIndex}return 0>index?ensureSize(iter)+index:index}function returnTrue(){return!0}function wholeSlice(begin,end,size){return(0===begin||void 0!==size&&-size>=begin)&&(void 0===end||void 0!==size&&end>=size)}function resolveBegin(begin,size){return resolveIndex(begin,size,0)}function resolveEnd(end,size){return resolveIndex(end,size,size)}function resolveIndex(index,size,defaultIndex){return void 0===index?defaultIndex:0>index?Math.max(0,size+index):void 0===size?index:Math.min(size,index)}function Iterable(value){return isIterable(value)?value:Seq(value)}function KeyedIterable(value){return isKeyed(value)?value:KeyedSeq(value)}function IndexedIterable(value){return isIndexed(value)?value:IndexedSeq(value)}function SetIterable(value){return isIterable(value)&&!isAssociative(value)?value:SetSeq(value)}function isIterable(maybeIterable){return!(!maybeIterable||!maybeIterable[IS_ITERABLE_SENTINEL])}function isKeyed(maybeKeyed){return!(!maybeKeyed||!maybeKeyed[IS_KEYED_SENTINEL])}function isIndexed(maybeIndexed){return!(!maybeIndexed||!maybeIndexed[IS_INDEXED_SENTINEL])}function isAssociative(maybeAssociative){return isKeyed(maybeAssociative)||isIndexed(maybeAssociative)}function isOrdered(maybeOrdered){return!(!maybeOrdered||!maybeOrdered[IS_ORDERED_SENTINEL])}function src_Iterator__Iterator(next){this.next=next}function iteratorValue(type,k,v,iteratorResult){var value=0===type?k:1===type?v:[k,v];return iteratorResult?iteratorResult.value=value:iteratorResult={value:value,done:!1},iteratorResult}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(maybeIterable){return!!getIteratorFn(maybeIterable)}function isIterator(maybeIterator){return maybeIterator&&"function"==typeof maybeIterator.next}function getIterator(iterable){var iteratorFn=getIteratorFn(iterable);return iteratorFn&&iteratorFn.call(iterable)}function getIteratorFn(iterable){var iteratorFn=iterable&&(REAL_ITERATOR_SYMBOL&&iterable[REAL_ITERATOR_SYMBOL]||iterable[FAUX_ITERATOR_SYMBOL]);return"function"==typeof iteratorFn?iteratorFn:void 0}function isArrayLike(value){return value&&"number"==typeof value.length}function Seq(value){return null===value||void 0===value?emptySequence():isIterable(value)?value.toSeq():seqFromValue(value)}function KeyedSeq(value){return null===value||void 0===value?emptySequence().toKeyedSeq():isIterable(value)?isKeyed(value)?value.toSeq():value.fromEntrySeq():keyedSeqFromValue(value)}function IndexedSeq(value){return null===value||void 0===value?emptySequence():isIterable(value)?isKeyed(value)?value.entrySeq():value.toIndexedSeq():indexedSeqFromValue(value)}function SetSeq(value){return(null===value||void 0===value?emptySequence():isIterable(value)?isKeyed(value)?value.entrySeq():value:indexedSeqFromValue(value)).toSetSeq()}function ArraySeq(array){this._array=array,this.size=array.length}function ObjectSeq(object){var keys=Object.keys(object);this._object=object,this._keys=keys,this.size=keys.length}function IterableSeq(iterable){this._iterable=iterable,this.size=iterable.length||iterable.size}function IteratorSeq(iterator){this._iterator=iterator,this._iteratorCache=[]}function isSeq(maybeSeq){return!(!maybeSeq||!maybeSeq[IS_SEQ_SENTINEL])}function emptySequence(){return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]))}function keyedSeqFromValue(value){var seq=Array.isArray(value)?new ArraySeq(value).fromEntrySeq():isIterator(value)?new IteratorSeq(value).fromEntrySeq():hasIterator(value)?new IterableSeq(value).fromEntrySeq():"object"==typeof value?new ObjectSeq(value):void 0;if(!seq)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+value);return seq}function indexedSeqFromValue(value){var seq=maybeIndexedSeqFromValue(value);if(!seq)throw new TypeError("Expected Array or iterable object of values: "+value);return seq}function seqFromValue(value){var seq=maybeIndexedSeqFromValue(value)||"object"==typeof value&&new ObjectSeq(value);if(!seq)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+value);return seq}function maybeIndexedSeqFromValue(value){return isArrayLike(value)?new ArraySeq(value):isIterator(value)?new IteratorSeq(value):hasIterator(value)?new IterableSeq(value):void 0}function seqIterate(seq,fn,reverse,useKeys){var cache=seq._cache;if(cache){for(var maxIndex=cache.length-1,ii=0;maxIndex>=ii;ii++){var entry=cache[reverse?maxIndex-ii:ii];if(fn(entry[1],useKeys?entry[0]:ii,seq)===!1)return ii+1}return ii}return seq.__iterateUncached(fn,reverse)}function seqIterator(seq,type,reverse,useKeys){var cache=seq._cache;if(cache){var maxIndex=cache.length-1,ii=0;return new src_Iterator__Iterator(function(){var entry=cache[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,useKeys?entry[0]:ii-1,entry[1])})}return seq.__iteratorUncached(type,reverse)}function Collection(){throw TypeError("Abstract")}function KeyedCollection(){}function IndexedCollection(){}function SetCollection(){}function is(valueA,valueB){if(valueA===valueB||valueA!==valueA&&valueB!==valueB)return!0;if(!valueA||!valueB)return!1;if("function"==typeof valueA.valueOf&&"function"==typeof valueB.valueOf){if(valueA=valueA.valueOf(),valueB=valueB.valueOf(),valueA===valueB||valueA!==valueA&&valueB!==valueB)return!0;if(!valueA||!valueB)return!1}return"function"==typeof valueA.equals&&"function"==typeof valueB.equals&&valueA.equals(valueB)?!0:!1}function fromJS(json,converter){return converter?fromJSWith(converter,json,"",{"":json}):fromJSDefault(json)}function fromJSWith(converter,json,key,parentJSON){return Array.isArray(json)?converter.call(parentJSON,key,IndexedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)})):isPlainObj(json)?converter.call(parentJSON,key,KeyedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)})):json}function fromJSDefault(json){return Array.isArray(json)?IndexedSeq(json).map(fromJSDefault).toList():isPlainObj(json)?KeyedSeq(json).map(fromJSDefault).toMap():json}function isPlainObj(value){return value&&(value.constructor===Object||void 0===value.constructor)}function smi(i32){return i32>>>1&1073741824|3221225471&i32}function hash(o){if(o===!1||null===o||void 0===o)return 0;if("function"==typeof o.valueOf&&(o=o.valueOf(),o===!1||null===o||void 0===o))return 0;if(o===!0)return 1;var type=typeof o;if("number"===type){var h=0|o;for(h!==o&&(h^=4294967295*o);o>4294967295;)o/=4294967295,h^=o;return smi(h)}return"string"===type?o.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(o):hashString(o):"function"==typeof o.hashCode?o.hashCode():hashJSObj(o)}function cachedHashString(string){var hash=stringHashCache[string];return void 0===hash&&(hash=hashString(string),STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE&&(STRING_HASH_CACHE_SIZE=0,stringHashCache={}),STRING_HASH_CACHE_SIZE++,stringHashCache[string]=hash),hash}function hashString(string){for(var hash=0,ii=0;ii0)switch(node.nodeType){case 1:return node.uniqueID;case 9:return node.documentElement&&node.documentElement.uniqueID}}function invariant(condition,error){if(!condition)throw new Error(error)}function assertNotInfinite(size){invariant(size!==1/0,"Cannot perform this action with an infinite size.")}function ToKeyedSequence(indexed,useKeys){this._iter=indexed,this._useKeys=useKeys,this.size=indexed.size}function ToIndexedSequence(iter){this._iter=iter,this.size=iter.size}function ToSetSequence(iter){this._iter=iter,this.size=iter.size}function FromEntriesSequence(entries){this._iter=entries,this.size=entries.size}function flipFactory(iterable){var flipSequence=makeSequence(iterable);return flipSequence._iter=iterable,flipSequence.size=iterable.size,flipSequence.flip=function(){return iterable},flipSequence.reverse=function(){var reversedSequence=iterable.reverse.apply(this);return reversedSequence.flip=function(){return iterable.reverse()},reversedSequence},flipSequence.has=function(key){return iterable.includes(key)},flipSequence.includes=function(key){return iterable.has(key)},flipSequence.cacheResult=cacheResultThrough,flipSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(k,v,this$0)!==!1},reverse)},flipSequence.__iteratorUncached=function(type,reverse){if(type===ITERATE_ENTRIES){var iterator=iterable.__iterator(type,reverse);return new src_Iterator__Iterator(function(){var step=iterator.next();if(!step.done){var k=step.value[0];step.value[0]=step.value[1],step.value[1]=k}return step})}return iterable.__iterator(type===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES,reverse)},flipSequence}function mapFactory(iterable,mapper,context){var mappedSequence=makeSequence(iterable);return mappedSequence.size=iterable.size,mappedSequence.has=function(key){return iterable.has(key)},mappedSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v===NOT_SET?notSetValue:mapper.call(context,v,key,iterable)},mappedSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k,c){return fn(mapper.call(context,v,k,c),k,this$0)!==!1},reverse)},mappedSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);return new src_Iterator__Iterator(function(){var step=iterator.next();if(step.done)return step;var entry=step.value,key=entry[0];return iteratorValue(type,key,mapper.call(context,entry[1],key,iterable),step)})},mappedSequence}function reverseFactory(iterable,useKeys){var reversedSequence=makeSequence(iterable);return reversedSequence._iter=iterable,reversedSequence.size=iterable.size,reversedSequence.reverse=function(){return iterable},iterable.flip&&(reversedSequence.flip=function(){var flipSequence=flipFactory(iterable);return flipSequence.reverse=function(){return iterable.flip()},flipSequence}),reversedSequence.get=function(key,notSetValue){return iterable.get(useKeys?key:-1-key,notSetValue)},reversedSequence.has=function(key){return iterable.has(useKeys?key:-1-key)},reversedSequence.includes=function(value){return iterable.includes(value)},reversedSequence.cacheResult=cacheResultThrough,reversedSequence.__iterate=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(v,k,this$0)},!reverse)},reversedSequence.__iterator=function(type,reverse){return iterable.__iterator(type,!reverse)},reversedSequence}function filterFactory(iterable,predicate,context,useKeys){var filterSequence=makeSequence(iterable);return useKeys&&(filterSequence.has=function(key){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&!!predicate.call(context,v,key,iterable)},filterSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&predicate.call(context,v,key,iterable)?v:notSetValue}),filterSequence.__iterateUncached=function(fn,reverse){var this$0=this,iterations=0;return iterable.__iterate(function(v,k,c){return predicate.call(context,v,k,c)?(iterations++,fn(v,useKeys?k:iterations-1,this$0)):void 0},reverse),iterations},filterSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse),iterations=0;return new src_Iterator__Iterator(function(){for(;;){var step=iterator.next();if(step.done)return step;var entry=step.value,key=entry[0],value=entry[1];if(predicate.call(context,value,key,iterable))return iteratorValue(type,useKeys?key:iterations++,value,step)}})},filterSequence}function countByFactory(iterable,grouper,context){var groups=src_Map__Map().asMutable();return iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),0,function(a){return a+1})}),groups.asImmutable()}function groupByFactory(iterable,grouper,context){var isKeyedIter=isKeyed(iterable),groups=(isOrdered(iterable)?OrderedMap():src_Map__Map()).asMutable();iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),function(a){return a=a||[],a.push(isKeyedIter?[k,v]:v),a})});var coerce=iterableClass(iterable);return groups.map(function(arr){return reify(iterable,coerce(arr))})}function sliceFactory(iterable,begin,end,useKeys){var originalSize=iterable.size;if(void 0!==begin&&(begin=0|begin),void 0!==end&&(end=0|end),wholeSlice(begin,end,originalSize))return iterable;var resolvedBegin=resolveBegin(begin,originalSize),resolvedEnd=resolveEnd(end,originalSize);if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd)return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys);var sliceSize,resolvedSize=resolvedEnd-resolvedBegin;resolvedSize===resolvedSize&&(sliceSize=0>resolvedSize?0:resolvedSize);var sliceSeq=makeSequence(iterable);return sliceSeq.size=0===sliceSize?sliceSize:iterable.size&&sliceSize||void 0,!useKeys&&isSeq(iterable)&&sliceSize>=0&&(sliceSeq.get=function(index,notSetValue){return index=wrapIndex(this,index),index>=0&&sliceSize>index?iterable.get(index+resolvedBegin,notSetValue):notSetValue}),sliceSeq.__iterateUncached=function(fn,reverse){var this$0=this;if(0===sliceSize)return 0;if(reverse)return this.cacheResult().__iterate(fn,reverse);var skipped=0,isSkipping=!0,iterations=0;return iterable.__iterate(function(v,k){return isSkipping&&(isSkipping=skipped++sliceSize)return iteratorDone();var step=iterator.next();return useKeys||type===ITERATE_VALUES?step:type===ITERATE_KEYS?iteratorValue(type,iterations-1,void 0,step):iteratorValue(type,iterations-1,step.value[1],step)})},sliceSeq}function takeWhileFactory(iterable,predicate,context){var takeSequence=makeSequence(iterable);return takeSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterate(fn,reverse);var iterations=0;return iterable.__iterate(function(v,k,c){return predicate.call(context,v,k,c)&&++iterations&&fn(v,k,this$0)}),iterations},takeSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterator(type,reverse);var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse),iterating=!0;return new src_Iterator__Iterator(function(){if(!iterating)return iteratorDone();var step=iterator.next();if(step.done)return step;var entry=step.value,k=entry[0],v=entry[1];return predicate.call(context,v,k,this$0)?type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step):(iterating=!1,iteratorDone())})},takeSequence}function skipWhileFactory(iterable,predicate,context,useKeys){var skipSequence=makeSequence(iterable);return skipSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterate(fn,reverse);var isSkipping=!0,iterations=0;return iterable.__iterate(function(v,k,c){return isSkipping&&(isSkipping=predicate.call(context,v,k,c))?void 0:(iterations++,fn(v,useKeys?k:iterations-1,this$0))}),iterations},skipSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterator(type,reverse);var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse),skipping=!0,iterations=0;return new src_Iterator__Iterator(function(){var step,k,v;do{if(step=iterator.next(),step.done)return useKeys||type===ITERATE_VALUES?step:type===ITERATE_KEYS?iteratorValue(type,iterations++,void 0,step):iteratorValue(type,iterations++,step.value[1],step);var entry=step.value;k=entry[0],v=entry[1],skipping&&(skipping=predicate.call(context,v,k,this$0))}while(skipping);return type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step)})},skipSequence}function concatFactory(iterable,values){var isKeyedIterable=isKeyed(iterable),iters=[iterable].concat(values).map(function(v){return isIterable(v)?isKeyedIterable&&(v=KeyedIterable(v)):v=isKeyedIterable?keyedSeqFromValue(v):indexedSeqFromValue(Array.isArray(v)?v:[v]),v}).filter(function(v){return 0!==v.size});if(0===iters.length)return iterable;if(1===iters.length){var singleton=iters[0];if(singleton===iterable||isKeyedIterable&&isKeyed(singleton)||isIndexed(iterable)&&isIndexed(singleton))return singleton}var concatSeq=new ArraySeq(iters);return isKeyedIterable?concatSeq=concatSeq.toKeyedSeq():isIndexed(iterable)||(concatSeq=concatSeq.toSetSeq()),concatSeq=concatSeq.flatten(!0),concatSeq.size=iters.reduce(function(sum,seq){if(void 0!==sum){var size=seq.size;if(void 0!==size)return sum+size}},0),concatSeq}function flattenFactory(iterable,depth,useKeys){var flatSequence=makeSequence(iterable);return flatSequence.__iterateUncached=function(fn,reverse){function flatDeep(iter,currentDepth){var this$0=this;iter.__iterate(function(v,k){return(!depth||depth>currentDepth)&&isIterable(v)?flatDeep(v,currentDepth+1):fn(v,useKeys?k:iterations++,this$0)===!1&&(stopped=!0),!stopped},reverse)}var iterations=0,stopped=!1;return flatDeep(iterable,0),iterations},flatSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(type,reverse),stack=[],iterations=0;return new src_Iterator__Iterator(function(){for(;iterator;){var step=iterator.next();if(step.done===!1){var v=step.value;if(type===ITERATE_ENTRIES&&(v=v[1]),depth&&!(stack.length0}function zipWithFactory(keyIter,zipper,iters){var zipSequence=makeSequence(keyIter);return zipSequence.size=new ArraySeq(iters).map(function(i){return i.size}).min(),zipSequence.__iterate=function(fn,reverse){for(var step,iterator=this.__iterator(ITERATE_VALUES,reverse),iterations=0;!(step=iterator.next()).done&&fn(step.value,iterations++,this)!==!1;);return iterations},zipSequence.__iteratorUncached=function(type,reverse){var iterators=iters.map(function(i){return i=Iterable(i),getIterator(reverse?i.reverse():i)}),iterations=0,isDone=!1;return new src_Iterator__Iterator(function(){var steps;return isDone||(steps=iterators.map(function(i){return i.next()}),isDone=steps.some(function(s){return s.done})),isDone?iteratorDone():iteratorValue(type,iterations++,zipper.apply(null,steps.map(function(s){return s.value})))})},zipSequence}function reify(iter,seq){return isSeq(iter)?seq:iter.constructor(seq)}function validateEntry(entry){if(entry!==Object(entry))throw new TypeError("Expected [K, V] tuple: "+entry)}function resolveSize(iter){return assertNotInfinite(iter.size),ensureSize(iter)}function iterableClass(iterable){return isKeyed(iterable)?KeyedIterable:isIndexed(iterable)?IndexedIterable:SetIterable}function makeSequence(iterable){return Object.create((isKeyed(iterable)?KeyedSeq:isIndexed(iterable)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(a,b){return a>b?1:b>a?-1:0}function forceIterator(keyPath){var iter=getIterator(keyPath);if(!iter){if(!isArrayLike(keyPath))throw new TypeError("Expected iterable or array-like: "+keyPath);iter=getIterator(Iterable(keyPath))}return iter}function src_Map__Map(value){return null===value||void 0===value?emptyMap():isMap(value)&&!isOrdered(value)?value:emptyMap().withMutations(function(map){var iter=KeyedIterable(value);assertNotInfinite(iter.size),iter.forEach(function(v,k){return map.set(k,v)})})}function isMap(maybeMap){return!(!maybeMap||!maybeMap[IS_MAP_SENTINEL])}function ArrayMapNode(ownerID,entries){this.ownerID=ownerID,this.entries=entries}function BitmapIndexedNode(ownerID,bitmap,nodes){this.ownerID=ownerID,this.bitmap=bitmap,this.nodes=nodes}function HashArrayMapNode(ownerID,count,nodes){this.ownerID=ownerID,this.count=count,this.nodes=nodes}function HashCollisionNode(ownerID,keyHash,entries){this.ownerID=ownerID,this.keyHash=keyHash,this.entries=entries}function ValueNode(ownerID,keyHash,entry){this.ownerID=ownerID,this.keyHash=keyHash,this.entry=entry}function MapIterator(map,type,reverse){this._type=type,this._reverse=reverse,this._stack=map._root&&mapIteratorFrame(map._root)}function mapIteratorValue(type,entry){return iteratorValue(type,entry[0],entry[1])}function mapIteratorFrame(node,prev){return{node:node,index:0,__prev:prev}}function makeMap(size,root,ownerID,hash){var map=Object.create(MapPrototype);return map.size=size,map._root=root,map.__ownerID=ownerID,map.__hash=hash,map.__altered=!1,map}function emptyMap(){return EMPTY_MAP||(EMPTY_MAP=makeMap(0))}function updateMap(map,k,v){var newRoot,newSize;if(map._root){var didChangeSize=MakeRef(CHANGE_LENGTH),didAlter=MakeRef(DID_ALTER);if(newRoot=updateNode(map._root,map.__ownerID,0,void 0,k,v,didChangeSize,didAlter),!didAlter.value)return map;newSize=map.size+(didChangeSize.value?v===NOT_SET?-1:1:0)}else{if(v===NOT_SET)return map;newSize=1,newRoot=new ArrayMapNode(map.__ownerID,[[k,v]])}return map.__ownerID?(map.size=newSize,map._root=newRoot,map.__hash=void 0,map.__altered=!0,map):newRoot?makeMap(newSize,newRoot):emptyMap()}function updateNode(node,ownerID,shift,keyHash,key,value,didChangeSize,didAlter){return node?node.update(ownerID,shift,keyHash,key,value,didChangeSize,didAlter):value===NOT_SET?node:(SetRef(didAlter),SetRef(didChangeSize),new ValueNode(ownerID,keyHash,[key,value]))}function isLeafNode(node){return node.constructor===ValueNode||node.constructor===HashCollisionNode}function mergeIntoNode(node,ownerID,shift,keyHash,entry){if(node.keyHash===keyHash)return new HashCollisionNode(ownerID,keyHash,[node.entry,entry]);var newNode,idx1=(0===shift?node.keyHash:node.keyHash>>>shift)&MASK,idx2=(0===shift?keyHash:keyHash>>>shift)&MASK,nodes=idx1===idx2?[mergeIntoNode(node,ownerID,shift+SHIFT,keyHash,entry)]:(newNode=new ValueNode(ownerID,keyHash,entry),idx2>idx1?[node,newNode]:[newNode,node]);return new BitmapIndexedNode(ownerID,1<ii;ii++,bit<<=1){var node=nodes[ii];void 0!==node&&ii!==excluding&&(bitmap|=bit,packedNodes[packedII++]=node)}return new BitmapIndexedNode(ownerID,bitmap,packedNodes)}function expandNodes(ownerID,nodes,bitmap,including,node){for(var count=0,expandedNodes=new Array(SIZE),ii=0;0!==bitmap;ii++,bitmap>>>=1)expandedNodes[ii]=1&bitmap?nodes[count++]:void 0;return expandedNodes[including]=node,new HashArrayMapNode(ownerID,count+1,expandedNodes)}function mergeIntoMapWith(map,merger,iterables){for(var iters=[],ii=0;ii>1&1431655765,x=(858993459&x)+(x>>2&858993459),x=x+(x>>4)&252645135,x+=x>>8,x+=x>>16,127&x}function setIn(array,idx,val,canEdit){var newArray=canEdit?array:arrCopy(array);return newArray[idx]=val,newArray}function spliceIn(array,idx,val,canEdit){var newLen=array.length+1;if(canEdit&&idx+1===newLen)return array[idx]=val,array;for(var newArray=new Array(newLen),after=0,ii=0;newLen>ii;ii++)ii===idx?(newArray[ii]=val,after=-1):newArray[ii]=array[ii+after];return newArray}function spliceOut(array,idx,canEdit){var newLen=array.length-1;if(canEdit&&idx===newLen)return array.pop(),array;for(var newArray=new Array(newLen),after=0,ii=0;newLen>ii;ii++)ii===idx&&(after=1),newArray[ii]=array[ii+after];return newArray}function List(value){var empty=emptyList();if(null===value||void 0===value)return empty;if(isList(value))return value;var iter=IndexedIterable(value),size=iter.size;return 0===size?empty:(assertNotInfinite(size),size>0&&SIZE>size?makeList(0,size,SHIFT,null,new VNode(iter.toArray())):empty.withMutations(function(list){list.setSize(size),iter.forEach(function(v,i){return list.set(i,v)})}))}function isList(maybeList){return!(!maybeList||!maybeList[IS_LIST_SENTINEL])}function VNode(array,ownerID){this.array=array,this.ownerID=ownerID}function iterateList(list,reverse){function iterateNodeOrLeaf(node,level,offset){return 0===level?iterateLeaf(node,offset):iterateNode(node,level,offset)}function iterateLeaf(node,offset){var array=offset===tailPos?tail&&tail.array:node&&node.array,from=offset>left?0:left-offset,to=right-offset;return to>SIZE&&(to=SIZE),function(){if(from===to)return DONE;var idx=reverse?--to:from++;return array&&array[idx]}}function iterateNode(node,level,offset){var values,array=node&&node.array,from=offset>left?0:left-offset>>level,to=(right-offset>>level)+1;return to>SIZE&&(to=SIZE),function(){for(;;){if(values){var value=values();if(value!==DONE)return value;values=null}if(from===to)return DONE;var idx=reverse?--to:from++;values=iterateNodeOrLeaf(array&&array[idx],level-SHIFT,offset+(idx<=list.size||0>index)return list.withMutations(function(list){0>index?setListBounds(list,index).set(0,value):setListBounds(list,0,index+1).set(index,value)});index+=list._origin;var newTail=list._tail,newRoot=list._root,didAlter=MakeRef(DID_ALTER);return index>=getTailOffset(list._capacity)?newTail=updateVNode(newTail,list.__ownerID,0,index,value,didAlter):newRoot=updateVNode(newRoot,list.__ownerID,list._level,index,value,didAlter),didAlter.value?list.__ownerID?(list._root=newRoot,list._tail=newTail,list.__hash=void 0,list.__altered=!0,list):makeList(list._origin,list._capacity,list._level,newRoot,newTail):list}function updateVNode(node,ownerID,level,index,value,didAlter){var idx=index>>>level&MASK,nodeHas=node&&idx0){var lowerNode=node&&node.array[idx],newLowerNode=updateVNode(lowerNode,ownerID,level-SHIFT,index,value,didAlter);return newLowerNode===lowerNode?node:(newNode=editableVNode(node,ownerID),newNode.array[idx]=newLowerNode,newNode)}return nodeHas&&node.array[idx]===value?node:(SetRef(didAlter),newNode=editableVNode(node,ownerID),void 0===value&&idx===newNode.array.length-1?newNode.array.pop():newNode.array[idx]=value,newNode)}function editableVNode(node,ownerID){return ownerID&&node&&ownerID===node.ownerID?node:new VNode(node?node.array.slice():[],ownerID)}function listNodeFor(list,rawIndex){if(rawIndex>=getTailOffset(list._capacity))return list._tail;if(rawIndex<1<0;)node=node.array[rawIndex>>>level&MASK],level-=SHIFT; return node}}function setListBounds(list,begin,end){void 0!==begin&&(begin=0|begin),void 0!==end&&(end=0|end);var owner=list.__ownerID||new OwnerID,oldOrigin=list._origin,oldCapacity=list._capacity,newOrigin=oldOrigin+begin,newCapacity=void 0===end?oldCapacity:0>end?oldCapacity+end:oldOrigin+end;if(newOrigin===oldOrigin&&newCapacity===oldCapacity)return list;if(newOrigin>=newCapacity)return list.clear();for(var newLevel=list._level,newRoot=list._root,offsetShift=0;0>newOrigin+offsetShift;)newRoot=new VNode(newRoot&&newRoot.array.length?[void 0,newRoot]:[],owner),newLevel+=SHIFT,offsetShift+=1<=1<newTailOffset?listNodeFor(list,newCapacity-1):newTailOffset>oldTailOffset?new VNode([],owner):oldTail;if(oldTail&&newTailOffset>oldTailOffset&&oldCapacity>newOrigin&&oldTail.array.length){newRoot=editableVNode(newRoot,owner);for(var node=newRoot,level=newLevel;level>SHIFT;level-=SHIFT){var idx=oldTailOffset>>>level&MASK;node=node.array[idx]=editableVNode(node.array[idx],owner)}node.array[oldTailOffset>>>SHIFT&MASK]=oldTail}if(oldCapacity>newCapacity&&(newTail=newTail&&newTail.removeAfter(owner,0,newCapacity)),newOrigin>=newTailOffset)newOrigin-=newTailOffset,newCapacity-=newTailOffset,newLevel=SHIFT,newRoot=null,newTail=newTail&&newTail.removeBefore(owner,0,newOrigin);else if(newOrigin>oldOrigin||oldTailOffset>newTailOffset){for(offsetShift=0;newRoot;){var beginIndex=newOrigin>>>newLevel&MASK;if(beginIndex!==newTailOffset>>>newLevel&MASK)break;beginIndex&&(offsetShift+=(1<oldOrigin&&(newRoot=newRoot.removeBefore(owner,newLevel,newOrigin-offsetShift)),newRoot&&oldTailOffset>newTailOffset&&(newRoot=newRoot.removeAfter(owner,newLevel,newTailOffset-offsetShift)),offsetShift&&(newOrigin-=offsetShift,newCapacity-=offsetShift)}return list.__ownerID?(list.size=newCapacity-newOrigin,list._origin=newOrigin,list._capacity=newCapacity,list._level=newLevel,list._root=newRoot,list._tail=newTail,list.__hash=void 0,list.__altered=!0,list):makeList(newOrigin,newCapacity,newLevel,newRoot,newTail)}function mergeIntoListWith(list,merger,iterables){for(var iters=[],maxSize=0,ii=0;iimaxSize&&(maxSize=iter.size),isIterable(value)||(iter=iter.map(function(v){return fromJS(v)})),iters.push(iter)}return maxSize>list.size&&(list=list.setSize(maxSize)),mergeIntoCollectionWith(list,merger,iters)}function getTailOffset(size){return SIZE>size?0:size-1>>>SHIFT<=SIZE&&list.size>=2*map.size?(newList=list.filter(function(entry,idx){return void 0!==entry&&i!==idx}),newMap=newList.toKeyedSeq().map(function(entry){return entry[0]}).flip().toMap(),omap.__ownerID&&(newMap.__ownerID=newList.__ownerID=omap.__ownerID)):(newMap=map.remove(k),newList=i===list.size-1?list.pop():list.set(i,void 0))}else if(has){if(v===list.get(i)[1])return omap;newMap=map,newList=list.set(i,[k,v])}else newMap=map.set(k,list.size),newList=list.set(list.size,[k,v]);return omap.__ownerID?(omap.size=newMap.size,omap._map=newMap,omap._list=newList,omap.__hash=void 0,omap):makeOrderedMap(newMap,newList)}function Stack(value){return null===value||void 0===value?emptyStack():isStack(value)?value:emptyStack().unshiftAll(value)}function isStack(maybeStack){return!(!maybeStack||!maybeStack[IS_STACK_SENTINEL])}function makeStack(size,head,ownerID,hash){var map=Object.create(StackPrototype);return map.size=size,map._head=head,map.__ownerID=ownerID,map.__hash=hash,map.__altered=!1,map}function emptyStack(){return EMPTY_STACK||(EMPTY_STACK=makeStack(0))}function src_Set__Set(value){return null===value||void 0===value?emptySet():isSet(value)&&!isOrdered(value)?value:emptySet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size),iter.forEach(function(v){return set.add(v)})})}function isSet(maybeSet){return!(!maybeSet||!maybeSet[IS_SET_SENTINEL])}function updateSet(set,newMap){return set.__ownerID?(set.size=newMap.size,set._map=newMap,set):newMap===set._map?set:0===newMap.size?set.__empty():set.__make(newMap)}function makeSet(map,ownerID){var set=Object.create(SetPrototype);return set.size=map?map.size:0,set._map=map,set.__ownerID=ownerID,set}function emptySet(){return EMPTY_SET||(EMPTY_SET=makeSet(emptyMap()))}function OrderedSet(value){return null===value||void 0===value?emptyOrderedSet():isOrderedSet(value)?value:emptyOrderedSet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size),iter.forEach(function(v){return set.add(v)})})}function isOrderedSet(maybeOrderedSet){return isSet(maybeOrderedSet)&&isOrdered(maybeOrderedSet)}function makeOrderedSet(map,ownerID){var set=Object.create(OrderedSetPrototype);return set.size=map?map.size:0,set._map=map,set.__ownerID=ownerID,set}function emptyOrderedSet(){return EMPTY_ORDERED_SET||(EMPTY_ORDERED_SET=makeOrderedSet(emptyOrderedMap()))}function Record(defaultValues,name){var hasInitialized,RecordType=function(values){if(values instanceof RecordType)return values;if(!(this instanceof RecordType))return new RecordType(values);if(!hasInitialized){hasInitialized=!0;var keys=Object.keys(defaultValues);setProps(RecordTypePrototype,keys),RecordTypePrototype.size=keys.length,RecordTypePrototype._name=name,RecordTypePrototype._keys=keys,RecordTypePrototype._defaultValues=defaultValues}this._map=src_Map__Map(values)},RecordTypePrototype=RecordType.prototype=Object.create(RecordPrototype);return RecordTypePrototype.constructor=RecordType,RecordType}function makeRecord(likeRecord,map,ownerID){var record=Object.create(Object.getPrototypeOf(likeRecord));return record._map=map,record.__ownerID=ownerID,record}function recordName(record){return record._name||record.constructor.name||"Record"}function setProps(prototype,names){try{names.forEach(setProp.bind(void 0,prototype))}catch(error){}}function setProp(prototype,name){Object.defineProperty(prototype,name,{get:function(){return this.get(name)},set:function(value){invariant(this.__ownerID,"Cannot set on an immutable record."),this.set(name,value)}})}function deepEqual(a,b){if(a===b)return!0;if(!isIterable(b)||void 0!==a.size&&void 0!==b.size&&a.size!==b.size||void 0!==a.__hash&&void 0!==b.__hash&&a.__hash!==b.__hash||isKeyed(a)!==isKeyed(b)||isIndexed(a)!==isIndexed(b)||isOrdered(a)!==isOrdered(b))return!1;if(0===a.size&&0===b.size)return!0;var notAssociative=!isAssociative(a);if(isOrdered(a)){var entries=a.entries();return b.every(function(v,k){var entry=entries.next().value;return entry&&is(entry[1],v)&&(notAssociative||is(entry[0],k))})&&entries.next().done}var flipped=!1;if(void 0===a.size)if(void 0===b.size)"function"==typeof a.cacheResult&&a.cacheResult();else{flipped=!0;var _=a;a=b,b=_}var allEqual=!0,bSize=b.__iterate(function(v,k){return(notAssociative?a.has(v):flipped?is(v,a.get(k,NOT_SET)):is(a.get(k,NOT_SET),v))?void 0:(allEqual=!1,!1)});return allEqual&&a.size===bSize}function Range(start,end,step){if(!(this instanceof Range))return new Range(start,end,step);if(invariant(0!==step,"Cannot step a Range by 0"),start=start||0,void 0===end&&(end=1/0),step=void 0===step?1:Math.abs(step),start>end&&(step=-step),this._start=start,this._end=end,this._step=step,this.size=Math.max(0,Math.ceil((end-start)/step-1)+1),0===this.size){if(EMPTY_RANGE)return EMPTY_RANGE;EMPTY_RANGE=this}}function Repeat(value,times){if(!(this instanceof Repeat))return new Repeat(value,times);if(this._value=value,this.size=void 0===times?1/0:Math.max(0,times),0===this.size){if(EMPTY_REPEAT)return EMPTY_REPEAT;EMPTY_REPEAT=this}}function mixin(ctor,methods){var keyCopier=function(key){ctor.prototype[key]=methods[key]};return Object.keys(methods).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier),ctor}function keyMapper(v,k){return k}function entryMapper(v,k){return[k,v]}function not(predicate){return function(){return!predicate.apply(this,arguments)}}function neg(predicate){return function(){return-predicate.apply(this,arguments)}}function quoteString(value){return"string"==typeof value?JSON.stringify(value):value}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(a,b){return b>a?1:a>b?-1:0}function hashIterable(iterable){if(iterable.size===1/0)return 0;var ordered=isOrdered(iterable),keyed=isKeyed(iterable),h=ordered?1:0,size=iterable.__iterate(keyed?ordered?function(v,k){h=31*h+hashMerge(hash(v),hash(k))|0}:function(v,k){h=h+hashMerge(hash(v),hash(k))|0}:ordered?function(v){h=31*h+hash(v)|0}:function(v){h=h+hash(v)|0});return murmurHashOfSize(size,h)}function murmurHashOfSize(size,h){return h=src_Math__imul(h,3432918353),h=src_Math__imul(h<<15|h>>>-15,461845907),h=src_Math__imul(h<<13|h>>>-13,5),h=(h+3864292196|0)^size,h=src_Math__imul(h^h>>>16,2246822507),h=src_Math__imul(h^h>>>13,3266489909),h=smi(h^h>>>16)}function hashMerge(a,b){return a^b+2654435769+(a<<6)+(a>>2)|0}var SLICE$0=Array.prototype.slice,DELETE="delete",SHIFT=5,SIZE=1<=ii;ii++)if(fn(array[reverse?maxIndex-ii:ii],ii,this)===!1)return ii+1;return ii},ArraySeq.prototype.__iterator=function(type,reverse){var array=this._array,maxIndex=array.length-1,ii=0;return new src_Iterator__Iterator(function(){return ii>maxIndex?iteratorDone():iteratorValue(type,ii,array[reverse?maxIndex-ii++:ii++])})},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(key,notSetValue){return void 0===notSetValue||this.has(key)?this._object[key]:notSetValue},ObjectSeq.prototype.has=function(key){return this._object.hasOwnProperty(key)},ObjectSeq.prototype.__iterate=function(fn,reverse){for(var object=this._object,keys=this._keys,maxIndex=keys.length-1,ii=0;maxIndex>=ii;ii++){var key=keys[reverse?maxIndex-ii:ii];if(fn(object[key],key,this)===!1)return ii+1}return ii},ObjectSeq.prototype.__iterator=function(type,reverse){var object=this._object,keys=this._keys,maxIndex=keys.length-1,ii=0;return new src_Iterator__Iterator(function(){var key=keys[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,key,object[key])})},ObjectSeq.prototype[IS_ORDERED_SENTINEL]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse)return this.cacheResult().__iterate(fn,reverse);var iterable=this._iterable,iterator=getIterator(iterable),iterations=0;if(isIterator(iterator))for(var step;!(step=iterator.next()).done&&fn(step.value,iterations++,this)!==!1;);return iterations},IterableSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse)return this.cacheResult().__iterator(type,reverse);var iterable=this._iterable,iterator=getIterator(iterable);if(!isIterator(iterator))return new src_Iterator__Iterator(iteratorDone);var iterations=0;return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value)})},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse)return this.cacheResult().__iterate(fn,reverse);for(var iterator=this._iterator,cache=this._iteratorCache,iterations=0;iterations=cache.length){var step=iterator.next();if(step.done)return step;cache[iterations]=step.value}return iteratorValue(type,iterations,cache[iterations++])})};var EMPTY_SEQ;createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var weakMap,src_Math__imul="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(a,b){a=0|a,b=0|b;var c=65535&a,d=65535&b;return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0},isExtensible=Object.isExtensible,canDefineProperty=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),usingWeakMap="function"==typeof WeakMap;usingWeakMap&&(weakMap=new WeakMap);var objHashUID=0,UID_HASH_KEY="__immutablehash__";"function"==typeof Symbol&&(UID_HASH_KEY=Symbol(UID_HASH_KEY));var STRING_HASH_CACHE_MIN_STRLEN=16,STRING_HASH_CACHE_MAX_SIZE=255,STRING_HASH_CACHE_SIZE=0,stringHashCache={};createClass(ToKeyedSequence,KeyedSeq),ToKeyedSequence.prototype.get=function(key,notSetValue){return this._iter.get(key,notSetValue)},ToKeyedSequence.prototype.has=function(key){return this._iter.has(key)},ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function(){var this$0=this,reversedSequence=reverseFactory(this,!0);return this._useKeys||(reversedSequence.valueSeq=function(){return this$0._iter.toSeq().reverse()}),reversedSequence},ToKeyedSequence.prototype.map=function(mapper,context){var this$0=this,mappedSequence=mapFactory(this,mapper,context);return this._useKeys||(mappedSequence.valueSeq=function(){return this$0._iter.toSeq().map(mapper,context)}),mappedSequence},ToKeyedSequence.prototype.__iterate=function(fn,reverse){var ii,this$0=this;return this._iter.__iterate(this._useKeys?function(v,k){return fn(v,k,this$0)}:(ii=reverse?resolveSize(this):0,function(v){return fn(v,reverse?--ii:ii++,this$0)}),reverse)},ToKeyedSequence.prototype.__iterator=function(type,reverse){if(this._useKeys)return this._iter.__iterator(type,reverse);var iterator=this._iter.__iterator(ITERATE_VALUES,reverse),ii=reverse?resolveSize(this):0;return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,reverse?--ii:ii++,step.value,step)})},ToKeyedSequence.prototype[IS_ORDERED_SENTINEL]=!0,createClass(ToIndexedSequence,IndexedSeq),ToIndexedSequence.prototype.includes=function(value){return this._iter.includes(value)},ToIndexedSequence.prototype.__iterate=function(fn,reverse){var this$0=this,iterations=0;return this._iter.__iterate(function(v){return fn(v,iterations++,this$0)},reverse)},ToIndexedSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse),iterations=0;return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value,step)})},createClass(ToSetSequence,SetSeq),ToSetSequence.prototype.has=function(key){return this._iter.includes(key)},ToSetSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(v){return fn(v,v,this$0)},reverse)},ToSetSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,step.value,step.value,step)})},createClass(FromEntriesSequence,KeyedSeq),FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(entry){if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return fn(indexedIterable?entry.get(1):entry[1],indexedIterable?entry.get(0):entry[0],this$0)}},reverse)},FromEntriesSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new src_Iterator__Iterator(function(){for(;;){var step=iterator.next();if(step.done)return step;var entry=step.value;if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return iteratorValue(type,indexedIterable?entry.get(0):entry[0],indexedIterable?entry.get(1):entry[1],step)}}})},ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough,createClass(src_Map__Map,KeyedCollection),src_Map__Map.prototype.toString=function(){return this.__toString("Map {","}")},src_Map__Map.prototype.get=function(k,notSetValue){return this._root?this._root.get(0,void 0,k,notSetValue):notSetValue},src_Map__Map.prototype.set=function(k,v){return updateMap(this,k,v)},src_Map__Map.prototype.setIn=function(keyPath,v){return this.updateIn(keyPath,NOT_SET,function(){return v})},src_Map__Map.prototype.remove=function(k){return updateMap(this,k,NOT_SET)},src_Map__Map.prototype.deleteIn=function(keyPath){return this.updateIn(keyPath,function(){return NOT_SET})},src_Map__Map.prototype.update=function(k,notSetValue,updater){return 1===arguments.length?k(this):this.updateIn([k],notSetValue,updater)},src_Map__Map.prototype.updateIn=function(keyPath,notSetValue,updater){updater||(updater=notSetValue,notSetValue=void 0);var updatedValue=updateInDeepMap(this,forceIterator(keyPath),notSetValue,updater);return updatedValue===NOT_SET?void 0:updatedValue},src_Map__Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},src_Map__Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},src_Map__Map.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,merger,iters)},src_Map__Map.prototype.mergeIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return"function"==typeof m.merge?m.merge.apply(m,iters):iters[iters.length-1]})},src_Map__Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger(void 0),arguments)},src_Map__Map.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,deepMerger(merger),iters)},src_Map__Map.prototype.mergeDeepIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return"function"==typeof m.mergeDeep?m.mergeDeep.apply(m,iters):iters[iters.length-1]})},src_Map__Map.prototype.sort=function(comparator){return OrderedMap(sortFactory(this,comparator))},src_Map__Map.prototype.sortBy=function(mapper,comparator){return OrderedMap(sortFactory(this,comparator,mapper))},src_Map__Map.prototype.withMutations=function(fn){var mutable=this.asMutable();return fn(mutable),mutable.wasAltered()?mutable.__ensureOwner(this.__ownerID):this},src_Map__Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},src_Map__Map.prototype.asImmutable=function(){return this.__ensureOwner()},src_Map__Map.prototype.wasAltered=function(){return this.__altered},src_Map__Map.prototype.__iterator=function(type,reverse){return new MapIterator(this,type,reverse)},src_Map__Map.prototype.__iterate=function(fn,reverse){var this$0=this,iterations=0;return this._root&&this._root.iterate(function(entry){return iterations++,fn(entry[1],entry[0],this$0)},reverse),iterations},src_Map__Map.prototype.__ensureOwner=function(ownerID){return ownerID===this.__ownerID?this:ownerID?makeMap(this.size,this._root,ownerID,this.__hash):(this.__ownerID=ownerID,this.__altered=!1,this)},src_Map__Map.isMap=isMap;var IS_MAP_SENTINEL="@@__IMMUTABLE_MAP__@@",MapPrototype=src_Map__Map.prototype;MapPrototype[IS_MAP_SENTINEL]=!0,MapPrototype[DELETE]=MapPrototype.remove,MapPrototype.removeIn=MapPrototype.deleteIn,ArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){for(var entries=this.entries,ii=0,len=entries.length;len>ii;ii++)if(is(key,entries[ii][0]))return entries[ii][1];return notSetValue},ArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){for(var removed=value===NOT_SET,entries=this.entries,idx=0,len=entries.length;len>idx&&!is(key,entries[idx][0]);idx++);var exists=len>idx;if(exists?entries[idx][1]===value:removed)return this;if(SetRef(didAlter),(removed||!exists)&&SetRef(didChangeSize),!removed||1!==entries.length){if(!exists&&!removed&&entries.length>=MAX_ARRAY_MAP_SIZE)return createNodes(ownerID,entries,key,value);var isEditable=ownerID&&ownerID===this.ownerID,newEntries=isEditable?entries:arrCopy(entries);return exists?removed?idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop():newEntries[idx]=[key,value]:newEntries.push([key,value]),isEditable?(this.entries=newEntries,this):new ArrayMapNode(ownerID,newEntries)}},BitmapIndexedNode.prototype.get=function(shift,keyHash,key,notSetValue){void 0===keyHash&&(keyHash=hash(key));var bit=1<<((0===shift?keyHash:keyHash>>>shift)&MASK),bitmap=this.bitmap;return 0===(bitmap&bit)?notSetValue:this.nodes[popCount(bitmap&bit-1)].get(shift+SHIFT,keyHash,key,notSetValue)},BitmapIndexedNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){void 0===keyHash&&(keyHash=hash(key));var keyHashFrag=(0===shift?keyHash:keyHash>>>shift)&MASK,bit=1<=MAX_BITMAP_INDEXED_SIZE)return expandNodes(ownerID,nodes,bitmap,keyHashFrag,newNode);if(exists&&!newNode&&2===nodes.length&&isLeafNode(nodes[1^idx]))return nodes[1^idx];if(exists&&newNode&&1===nodes.length&&isLeafNode(newNode))return newNode;var isEditable=ownerID&&ownerID===this.ownerID,newBitmap=exists?newNode?bitmap:bitmap^bit:bitmap|bit,newNodes=exists?newNode?setIn(nodes,idx,newNode,isEditable):spliceOut(nodes,idx,isEditable):spliceIn(nodes,idx,newNode,isEditable);return isEditable?(this.bitmap=newBitmap,this.nodes=newNodes,this):new BitmapIndexedNode(ownerID,newBitmap,newNodes)},HashArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){void 0===keyHash&&(keyHash=hash(key));var idx=(0===shift?keyHash:keyHash>>>shift)&MASK,node=this.nodes[idx];return node?node.get(shift+SHIFT,keyHash,key,notSetValue):notSetValue},HashArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){void 0===keyHash&&(keyHash=hash(key));var idx=(0===shift?keyHash:keyHash>>>shift)&MASK,removed=value===NOT_SET,nodes=this.nodes,node=nodes[idx];if(removed&&!node)return this;var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter);if(newNode===node)return this;var newCount=this.count;if(node){if(!newNode&&(newCount--,MIN_HASH_ARRAY_MAP_SIZE>newCount))return packNodes(ownerID,nodes,newCount,idx)}else newCount++;var isEditable=ownerID&&ownerID===this.ownerID,newNodes=setIn(nodes,idx,newNode,isEditable);return isEditable?(this.count=newCount,this.nodes=newNodes,this):new HashArrayMapNode(ownerID,newCount,newNodes)},HashCollisionNode.prototype.get=function(shift,keyHash,key,notSetValue){for(var entries=this.entries,ii=0,len=entries.length;len>ii;ii++)if(is(key,entries[ii][0]))return entries[ii][1];return notSetValue},HashCollisionNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){void 0===keyHash&&(keyHash=hash(key));var removed=value===NOT_SET;if(keyHash!==this.keyHash)return removed?this:(SetRef(didAlter),SetRef(didChangeSize),mergeIntoNode(this,ownerID,shift,keyHash,[key,value]));for(var entries=this.entries,idx=0,len=entries.length;len>idx&&!is(key,entries[idx][0]);idx++);var exists=len>idx;if(exists?entries[idx][1]===value:removed)return this;if(SetRef(didAlter),(removed||!exists)&&SetRef(didChangeSize),removed&&2===len)return new ValueNode(ownerID,this.keyHash,entries[1^idx]);var isEditable=ownerID&&ownerID===this.ownerID,newEntries=isEditable?entries:arrCopy(entries);return exists?removed?idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop():newEntries[idx]=[key,value]:newEntries.push([key,value]),isEditable?(this.entries=newEntries,this):new HashCollisionNode(ownerID,this.keyHash,newEntries)},ValueNode.prototype.get=function(shift,keyHash,key,notSetValue){return is(key,this.entry[0])?this.entry[1]:notSetValue},ValueNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){var removed=value===NOT_SET,keyMatch=is(key,this.entry[0]);return(keyMatch?value===this.entry[1]:removed)?this:(SetRef(didAlter),removed?void SetRef(didChangeSize):keyMatch?ownerID&&ownerID===this.ownerID?(this.entry[1]=value,this):new ValueNode(ownerID,this.keyHash,[key,value]):(SetRef(didChangeSize),mergeIntoNode(this,ownerID,shift,hash(key),[key,value])))},ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(fn,reverse){for(var entries=this.entries,ii=0,maxIndex=entries.length-1;maxIndex>=ii;ii++)if(fn(entries[reverse?maxIndex-ii:ii])===!1)return!1},BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(fn,reverse){for(var nodes=this.nodes,ii=0,maxIndex=nodes.length-1;maxIndex>=ii;ii++){var node=nodes[reverse?maxIndex-ii:ii];if(node&&node.iterate(fn,reverse)===!1)return!1}},ValueNode.prototype.iterate=function(fn,reverse){return fn(this.entry)},createClass(MapIterator,src_Iterator__Iterator),MapIterator.prototype.next=function(){for(var type=this._type,stack=this._stack;stack;){var maxIndex,node=stack.node,index=stack.index++;if(node.entry){if(0===index)return mapIteratorValue(type,node.entry)}else if(node.entries){if(maxIndex=node.entries.length-1,maxIndex>=index)return mapIteratorValue(type,node.entries[this._reverse?maxIndex-index:index])}else if(maxIndex=node.nodes.length-1,maxIndex>=index){var subNode=node.nodes[this._reverse?maxIndex-index:index];if(subNode){if(subNode.entry)return mapIteratorValue(type,subNode.entry);stack=this._stack=mapIteratorFrame(subNode,stack)}continue}stack=this._stack=this._stack.__prev}return iteratorDone()};var EMPTY_MAP,MAX_ARRAY_MAP_SIZE=SIZE/4,MAX_BITMAP_INDEXED_SIZE=SIZE/2,MIN_HASH_ARRAY_MAP_SIZE=SIZE/4;createClass(List,IndexedCollection),List.of=function(){return this(arguments)},List.prototype.toString=function(){return this.__toString("List [","]")},List.prototype.get=function(index,notSetValue){if(index=wrapIndex(this,index),index>=0&&index>>level&MASK;if(originIndex>=this.array.length)return new VNode([],ownerID);var newChild,removingFirst=0===originIndex;if(level>0){var oldChild=this.array[originIndex];if(newChild=oldChild&&oldChild.removeBefore(ownerID,level-SHIFT,index),newChild===oldChild&&removingFirst)return this}if(removingFirst&&!newChild)return this;var editable=editableVNode(this,ownerID);if(!removingFirst)for(var ii=0;originIndex>ii;ii++)editable.array[ii]=void 0;return newChild&&(editable.array[originIndex]=newChild),editable},VNode.prototype.removeAfter=function(ownerID,level,index){if(index===(level?1<>>level&MASK;if(sizeIndex>=this.array.length)return this;var newChild;if(level>0){var oldChild=this.array[sizeIndex];if(newChild=oldChild&&oldChild.removeAfter(ownerID,level-SHIFT,index),newChild===oldChild&&sizeIndex===this.array.length-1)return this}var editable=editableVNode(this,ownerID);return editable.array.splice(sizeIndex+1),newChild&&(editable.array[sizeIndex]=newChild),editable};var EMPTY_LIST,DONE={};createClass(OrderedMap,src_Map__Map),OrderedMap.of=function(){return this(arguments)},OrderedMap.prototype.toString=function(){return this.__toString("OrderedMap {","}")},OrderedMap.prototype.get=function(k,notSetValue){var index=this._map.get(k);return void 0!==index?this._list.get(index)[1]:notSetValue},OrderedMap.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):emptyOrderedMap()},OrderedMap.prototype.set=function(k,v){return updateOrderedMap(this,k,v)},OrderedMap.prototype.remove=function(k){return updateOrderedMap(this,k,NOT_SET)},OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},OrderedMap.prototype.__iterate=function(fn,reverse){var this$0=this;return this._list.__iterate(function(entry){return entry&&fn(entry[1],entry[0],this$0)},reverse)},OrderedMap.prototype.__iterator=function(type,reverse){return this._list.fromEntrySeq().__iterator(type,reverse)},OrderedMap.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID)return this;var newMap=this._map.__ensureOwner(ownerID),newList=this._list.__ensureOwner(ownerID);return ownerID?makeOrderedMap(newMap,newList,ownerID,this.__hash):(this.__ownerID=ownerID,this._map=newMap,this._list=newList,this)},OrderedMap.isOrderedMap=isOrderedMap,OrderedMap.prototype[IS_ORDERED_SENTINEL]=!0,OrderedMap.prototype[DELETE]=OrderedMap.prototype.remove;var EMPTY_ORDERED_MAP;createClass(Stack,IndexedCollection),Stack.of=function(){return this(arguments)},Stack.prototype.toString=function(){return this.__toString("Stack [","]")},Stack.prototype.get=function(index,notSetValue){var head=this._head;for(index=wrapIndex(this,index);head&&index--;)head=head.next;return head?head.value:notSetValue},Stack.prototype.peek=function(){return this._head&&this._head.value},Stack.prototype.push=function(){if(0===arguments.length)return this;for(var newSize=this.size+arguments.length,head=this._head,ii=arguments.length-1;ii>=0;ii--)head={value:arguments[ii],next:head};return this.__ownerID?(this.size=newSize,this._head=head,this.__hash=void 0,this.__altered=!0,this):makeStack(newSize,head)},Stack.prototype.pushAll=function(iter){if(iter=IndexedIterable(iter),0===iter.size)return this;assertNotInfinite(iter.size);var newSize=this.size,head=this._head;return iter.reverse().forEach(function(value){newSize++,head={value:value,next:head}}),this.__ownerID?(this.size=newSize,this._head=head,this.__hash=void 0,this.__altered=!0,this):makeStack(newSize,head)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(iter){return this.pushAll(iter)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(begin,end){if(wholeSlice(begin,end,this.size))return this;var resolvedBegin=resolveBegin(begin,this.size),resolvedEnd=resolveEnd(end,this.size);if(resolvedEnd!==this.size)return IndexedCollection.prototype.slice.call(this,begin,end);for(var newSize=this.size-resolvedBegin,head=this._head;resolvedBegin--;)head=head.next;return this.__ownerID?(this.size=newSize,this._head=head,this.__hash=void 0,this.__altered=!0,this):makeStack(newSize,head)},Stack.prototype.__ensureOwner=function(ownerID){return ownerID===this.__ownerID?this:ownerID?makeStack(this.size,this._head,ownerID,this.__hash):(this.__ownerID=ownerID,this.__altered=!1,this)},Stack.prototype.__iterate=function(fn,reverse){if(reverse)return this.reverse().__iterate(fn);for(var iterations=0,node=this._head;node&&fn(node.value,iterations++,this)!==!1;)node=node.next;return iterations},Stack.prototype.__iterator=function(type,reverse){if(reverse)return this.reverse().__iterator(type);var iterations=0,node=this._head;return new src_Iterator__Iterator(function(){if(node){var value=node.value;return node=node.next,iteratorValue(type,iterations++,value)}return iteratorDone()})},Stack.isStack=isStack;var IS_STACK_SENTINEL="@@__IMMUTABLE_STACK__@@",StackPrototype=Stack.prototype;StackPrototype[IS_STACK_SENTINEL]=!0,StackPrototype.withMutations=MapPrototype.withMutations,StackPrototype.asMutable=MapPrototype.asMutable,StackPrototype.asImmutable=MapPrototype.asImmutable,StackPrototype.wasAltered=MapPrototype.wasAltered;var EMPTY_STACK;createClass(src_Set__Set,SetCollection),src_Set__Set.of=function(){return this(arguments)},src_Set__Set.fromKeys=function(value){return this(KeyedIterable(value).keySeq())},src_Set__Set.prototype.toString=function(){return this.__toString("Set {","}")},src_Set__Set.prototype.has=function(value){return this._map.has(value)},src_Set__Set.prototype.add=function(value){return updateSet(this,this._map.set(value,!0))},src_Set__Set.prototype.remove=function(value){return updateSet(this,this._map.remove(value))},src_Set__Set.prototype.clear=function(){return updateSet(this,this._map.clear())},src_Set__Set.prototype.union=function(){var iters=SLICE$0.call(arguments,0);return iters=iters.filter(function(x){return 0!==x.size}),0===iters.length?this:0!==this.size||this.__ownerID||1!==iters.length?this.withMutations(function(set){for(var ii=0;ii1?" by "+this._step:"")+" ]"},Range.prototype.get=function(index,notSetValue){return this.has(index)?this._start+wrapIndex(this,index)*this._step:notSetValue},Range.prototype.includes=function(searchValue){var possibleIndex=(searchValue-this._start)/this._step;return possibleIndex>=0&&possibleIndex=end?new Range(0,0):new Range(this.get(begin,this._end),this.get(end,this._end),this._step))},Range.prototype.indexOf=function(searchValue){var offsetValue=searchValue-this._start;if(offsetValue%this._step===0){var index=offsetValue/this._step;if(index>=0&&index=ii;ii++){if(fn(value,ii,this)===!1)return ii+1;value+=reverse?-step:step}return ii},Range.prototype.__iterator=function(type,reverse){var maxIndex=this.size-1,step=this._step,value=reverse?this._start+maxIndex*step:this._start,ii=0;return new src_Iterator__Iterator(function(){var v=value;return value+=reverse?-step:step,ii>maxIndex?iteratorDone():iteratorValue(type,ii++,v)})},Range.prototype.equals=function(other){return other instanceof Range?this._start===other._start&&this._end===other._end&&this._step===other._step:deepEqual(this,other)};var EMPTY_RANGE;createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Repeat.prototype.get=function(index,notSetValue){return this.has(index)?this._value:notSetValue},Repeat.prototype.includes=function(searchValue){return is(this._value,searchValue)},Repeat.prototype.slice=function(begin,end){var size=this.size;return wholeSlice(begin,end,size)?this:new Repeat(this._value,resolveEnd(end,size)-resolveBegin(begin,size))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(searchValue){return is(this._value,searchValue)?0:-1},Repeat.prototype.lastIndexOf=function(searchValue){return is(this._value,searchValue)?this.size:-1},Repeat.prototype.__iterate=function(fn,reverse){for(var ii=0;iiindex?this.count():this.size);var spliced=this.slice(0,index);return reify(this,1===numArgs?spliced:spliced.concat(arrCopy(arguments,2),this.slice(index+removeNum)))},findLastIndex:function(predicate,context){var key=this.toKeyedSeq().findLastKey(predicate,context);return void 0===key?-1:key},first:function(){return this.get(0)},flatten:function(depth){return reify(this,flattenFactory(this,depth,!1))},get:function(index,notSetValue){return index=wrapIndex(this,index),0>index||this.size===1/0||void 0!==this.size&&index>this.size?notSetValue:this.find(function(_,key){return key===index},void 0,notSetValue)},has:function(index){return index=wrapIndex(this,index),index>=0&&(void 0!==this.size?this.size===1/0||indexi;i++){var currentItem=_cloneObject(this._options.steps[i]);if(currentItem.step=introItems.length+1,"string"==typeof currentItem.element&&(currentItem.element=document.querySelector(currentItem.element)),"undefined"==typeof currentItem.element||null==currentItem.element){var floatingElementQuery=document.querySelector(".introjsFloatingElement");null==floatingElementQuery&&(floatingElementQuery=document.createElement("div"),floatingElementQuery.className="introjsFloatingElement",document.body.appendChild(floatingElementQuery)),currentItem.element=floatingElementQuery,currentItem.position="floating"}null!=currentItem.element&&introItems.push(currentItem)}else{var allIntroSteps=targetElm.querySelectorAll("*[data-intro]");if(allIntroSteps.length<1)return!1;for(var i=0,elmsLength=allIntroSteps.length;elmsLength>i;i++){var currentElement=allIntroSteps[i],step=parseInt(currentElement.getAttribute("data-step"),10);step>0&&(introItems[step-1]={element:currentElement,intro:currentElement.getAttribute("data-intro"),step:parseInt(currentElement.getAttribute("data-step"),10),tooltipClass:currentElement.getAttribute("data-tooltipClass"),highlightClass:currentElement.getAttribute("data-highlightClass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition})}for(var nextStep=0,i=0,elmsLength=allIntroSteps.length;elmsLength>i;i++){var currentElement=allIntroSteps[i];if(null==currentElement.getAttribute("data-step")){for(;;){if("undefined"==typeof introItems[nextStep])break;nextStep++}introItems[nextStep]={element:currentElement,intro:currentElement.getAttribute("data-intro"),step:nextStep+1,tooltipClass:currentElement.getAttribute("data-tooltipClass"),highlightClass:currentElement.getAttribute("data-highlightClass"),position:currentElement.getAttribute("data-position")||this._options.tooltipPosition}}}}for(var tempIntroItems=[],z=0;z0?_previousStep.call(self):target&&target.className.indexOf("introjs-skipbutton")>0?(self._introItems.length-1==self._currentStep&&"function"==typeof self._introCompleteCallback&&self._introCompleteCallback.call(self),void 0!=self._introExitCallback&&self._introExitCallback.call(self),_exitIntro.call(self,targetElm)):_nextStep.call(self),e.preventDefault?e.preventDefault():e.returnValue=!1}},self._onResize=function(e){_setHelperLayerPosition.call(self,document.querySelector(".introjs-helperLayer")), _setHelperLayerPosition.call(self,document.querySelector(".introjs-tooltipReferenceLayer"))},window.addEventListener?(this._options.keyboardNavigation&&window.addEventListener("keydown",self._onKeyDown,!0),window.addEventListener("resize",self._onResize,!0)):document.attachEvent&&(this._options.keyboardNavigation&&document.attachEvent("onkeydown",self._onKeyDown),document.attachEvent("onresize",self._onResize))}return!1}function _cloneObject(object){if(null==object||"object"!=typeof object||"undefined"!=typeof object.nodeType)return object;var temp={};for(var key in object)"undefined"!=typeof jQuery&&object[key]instanceof jQuery?temp[key]=object[key]:temp[key]=_cloneObject(object[key]);return temp}function _goToStep(step){this._currentStep=step-2,"undefined"!=typeof this._introItems&&_nextStep.call(this)}function _nextStep(){if(this._direction="forward","undefined"==typeof this._currentStep?this._currentStep=0:++this._currentStep,this._introItems.length<=this._currentStep)return"function"==typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),void _exitIntro.call(this,this._targetElement);var nextStep=this._introItems[this._currentStep];"undefined"!=typeof this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,nextStep.element),_showElement.call(this,nextStep)}function _previousStep(){if(this._direction="backward",0===this._currentStep)return!1;var nextStep=this._introItems[--this._currentStep];"undefined"!=typeof this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,nextStep.element),_showElement.call(this,nextStep)}function _exitIntro(targetElement){var overlayLayer=targetElement.querySelector(".introjs-overlay");if(null!=overlayLayer){overlayLayer.style.opacity=0,setTimeout(function(){overlayLayer.parentNode&&overlayLayer.parentNode.removeChild(overlayLayer)},500);var helperLayer=targetElement.querySelector(".introjs-helperLayer");helperLayer&&helperLayer.parentNode.removeChild(helperLayer);var referenceLayer=targetElement.querySelector(".introjs-tooltipReferenceLayer");referenceLayer&&referenceLayer.parentNode.removeChild(referenceLayer);var disableInteractionLayer=targetElement.querySelector(".introjs-disableInteraction");disableInteractionLayer&&disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);var floatingElement=document.querySelector(".introjsFloatingElement");floatingElement&&floatingElement.parentNode.removeChild(floatingElement);var showElement=document.querySelector(".introjs-showElement");showElement&&(showElement.className=showElement.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,""));var fixParents=document.querySelectorAll(".introjs-fixParent");if(fixParents&&fixParents.length>0)for(var i=fixParents.length-1;i>=0;i--)fixParents[i].className=fixParents[i].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");window.removeEventListener?window.removeEventListener("keydown",this._onKeyDown,!0):document.detachEvent&&document.detachEvent("onkeydown",this._onKeyDown),this._currentStep=void 0}}function _placeTooltip(targetElement,tooltipLayer,arrowLayer,helperNumberLayer){var currentStepObj,tooltipOffset,targetOffset,windowSize,currentTooltipPosition,tooltipCssClass="";if(tooltipLayer.style.top=null,tooltipLayer.style.right=null,tooltipLayer.style.bottom=null,tooltipLayer.style.left=null,tooltipLayer.style.marginLeft=null,tooltipLayer.style.marginTop=null,arrowLayer.style.display="inherit","undefined"!=typeof helperNumberLayer&&null!=helperNumberLayer&&(helperNumberLayer.style.top=null,helperNumberLayer.style.left=null),this._introItems[this._currentStep])switch(currentStepObj=this._introItems[this._currentStep],tooltipCssClass="string"==typeof currentStepObj.tooltipClass?currentStepObj.tooltipClass:this._options.tooltipClass,tooltipLayer.className=("introjs-tooltip "+tooltipCssClass).replace(/^\s+|\s+$/g,""),currentTooltipPosition=this._introItems[this._currentStep].position,("auto"==currentTooltipPosition||"auto"==this._options.tooltipPosition)&&"floating"!=currentTooltipPosition&&(currentTooltipPosition=_determineAutoPosition.call(this,targetElement,tooltipLayer,currentTooltipPosition)),targetOffset=_getOffset(targetElement),tooltipOffset=_getOffset(tooltipLayer),windowSize=_getWinSize(),currentTooltipPosition){case"top":arrowLayer.className="introjs-arrow bottom";var tooltipLayerStyleLeft=15;_checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer),tooltipLayer.style.bottom=targetOffset.height+20+"px";break;case"right":tooltipLayer.style.left=targetOffset.width+20+"px",targetOffset.top+tooltipOffset.height>windowSize.height?(arrowLayer.className="introjs-arrow left-bottom",tooltipLayer.style.top="-"+(tooltipOffset.height-targetOffset.height-20)+"px"):arrowLayer.className="introjs-arrow left";break;case"left":1==this._options.showStepNumbers&&(tooltipLayer.style.top="15px"),targetOffset.top+tooltipOffset.height>windowSize.height?(tooltipLayer.style.top="-"+(tooltipOffset.height-targetOffset.height-20)+"px",arrowLayer.className="introjs-arrow right-bottom"):arrowLayer.className="introjs-arrow right",tooltipLayer.style.right=targetOffset.width+20+"px";break;case"floating":arrowLayer.style.display="none",tooltipLayer.style.left="50%",tooltipLayer.style.top="50%",tooltipLayer.style.marginLeft="-"+tooltipOffset.width/2+"px",tooltipLayer.style.marginTop="-"+tooltipOffset.height/2+"px","undefined"!=typeof helperNumberLayer&&null!=helperNumberLayer&&(helperNumberLayer.style.left="-"+(tooltipOffset.width/2+18)+"px",helperNumberLayer.style.top="-"+(tooltipOffset.height/2+18)+"px");break;case"bottom-right-aligned":arrowLayer.className="introjs-arrow top-right";var tooltipLayerStyleRight=0;_checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer),tooltipLayer.style.top=targetOffset.height+20+"px";break;case"bottom-middle-aligned":arrowLayer.className="introjs-arrow top-middle";var tooltipLayerStyleLeftRight=targetOffset.width/2-tooltipOffset.width/2;_checkLeft(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,tooltipLayer)&&(tooltipLayer.style.right=null,_checkRight(targetOffset,tooltipLayerStyleLeftRight,tooltipOffset,windowSize,tooltipLayer)),tooltipLayer.style.top=targetOffset.height+20+"px";break;case"bottom-left-aligned":case"bottom":default:arrowLayer.className="introjs-arrow top";var tooltipLayerStyleLeft=0;_checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer),tooltipLayer.style.top=targetOffset.height+20+"px"}}function _checkRight(targetOffset,tooltipLayerStyleLeft,tooltipOffset,windowSize,tooltipLayer){return targetOffset.left+tooltipLayerStyleLeft+tooltipOffset.width>windowSize.width?(tooltipLayer.style.left=windowSize.width-tooltipOffset.width-targetOffset.left+"px",!1):(tooltipLayer.style.left=tooltipLayerStyleLeft+"px",!0)}function _checkLeft(targetOffset,tooltipLayerStyleRight,tooltipOffset,tooltipLayer){return targetOffset.left+targetOffset.width-tooltipLayerStyleRight-tooltipOffset.width<0?(tooltipLayer.style.left=-targetOffset.left+"px",!1):(tooltipLayer.style.right=tooltipLayerStyleRight+"px",!0)}function _determineAutoPosition(targetElement,tooltipLayer,desiredTooltipPosition){var possiblePositions=this._options.positionPrecedence.slice(),windowSize=_getWinSize(),tooltipHeight=_getOffset(tooltipLayer).height+10,tooltipWidth=_getOffset(tooltipLayer).width+20,targetOffset=_getOffset(targetElement),calculatedPosition="floating";return targetOffset.left+tooltipWidth>windowSize.width||targetOffset.left+targetOffset.width/2-tooltipWidth<0?(_removeEntry(possiblePositions,"bottom"),_removeEntry(possiblePositions,"top")):(targetOffset.height+targetOffset.top+tooltipHeight>windowSize.height&&_removeEntry(possiblePositions,"bottom"),targetOffset.top-tooltipHeight<0&&_removeEntry(possiblePositions,"top")),targetOffset.width+targetOffset.left+tooltipWidth>windowSize.width&&_removeEntry(possiblePositions,"right"),targetOffset.left-tooltipWidth<0&&_removeEntry(possiblePositions,"left"),possiblePositions.length>0&&(calculatedPosition=possiblePositions[0]),desiredTooltipPosition&&"auto"!=desiredTooltipPosition&&possiblePositions.indexOf(desiredTooltipPosition)>-1&&(calculatedPosition=desiredTooltipPosition),calculatedPosition}function _removeEntry(stringArray,stringToRemove){stringArray.indexOf(stringToRemove)>-1&&stringArray.splice(stringArray.indexOf(stringToRemove),1)}function _setHelperLayerPosition(helperLayer){if(helperLayer){if(!this._introItems[this._currentStep])return;var currentElement=this._introItems[this._currentStep],elementPosition=_getOffset(currentElement.element),widthHeightPadding=10;"floating"==currentElement.position&&(widthHeightPadding=0),helperLayer.setAttribute("style","width: "+(elementPosition.width+widthHeightPadding)+"px; height:"+(elementPosition.height+widthHeightPadding)+"px; top:"+(elementPosition.top-5)+"px;left: "+(elementPosition.left-5)+"px;")}}function _disableInteraction(){var disableInteractionLayer=document.querySelector(".introjs-disableInteraction");null===disableInteractionLayer&&(disableInteractionLayer=document.createElement("div"),disableInteractionLayer.className="introjs-disableInteraction",this._targetElement.appendChild(disableInteractionLayer)),_setHelperLayerPosition.call(this,disableInteractionLayer)}function _showElement(targetElement){"undefined"!=typeof this._introChangeCallback&&this._introChangeCallback.call(this,targetElement.element);var self=this,oldHelperLayer=document.querySelector(".introjs-helperLayer"),oldReferenceLayer=document.querySelector(".introjs-tooltipReferenceLayer"),highlightClass="introjs-helperLayer";_getOffset(targetElement.element);if("string"==typeof targetElement.highlightClass&&(highlightClass+=" "+targetElement.highlightClass),"string"==typeof this._options.highlightClass&&(highlightClass+=" "+this._options.highlightClass),null!=oldHelperLayer){var oldHelperNumberLayer=oldReferenceLayer.querySelector(".introjs-helperNumberLayer"),oldtooltipLayer=oldReferenceLayer.querySelector(".introjs-tooltiptext"),oldArrowLayer=oldReferenceLayer.querySelector(".introjs-arrow"),oldtooltipContainer=oldReferenceLayer.querySelector(".introjs-tooltip"),skipTooltipButton=oldReferenceLayer.querySelector(".introjs-skipbutton"),prevTooltipButton=oldReferenceLayer.querySelector(".introjs-prevbutton"),nextTooltipButton=oldReferenceLayer.querySelector(".introjs-nextbutton");if(oldHelperLayer.className=highlightClass,oldtooltipContainer.style.opacity=0,oldtooltipContainer.style.display="none",null!=oldHelperNumberLayer){var lastIntroItem=this._introItems[targetElement.step-2>=0?targetElement.step-2:0];(null!=lastIntroItem&&"forward"==this._direction&&"floating"==lastIntroItem.position||"backward"==this._direction&&"floating"==targetElement.position)&&(oldHelperNumberLayer.style.opacity=0)}_setHelperLayerPosition.call(self,oldHelperLayer),_setHelperLayerPosition.call(self,oldReferenceLayer);var fixParents=document.querySelectorAll(".introjs-fixParent");if(fixParents&&fixParents.length>0)for(var i=fixParents.length-1;i>=0;i--)fixParents[i].className=fixParents[i].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");var oldShowElement=document.querySelector(".introjs-showElement");oldShowElement.className=oldShowElement.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,""),self._lastShowElementTimer&&clearTimeout(self._lastShowElementTimer),self._lastShowElementTimer=setTimeout(function(){null!=oldHelperNumberLayer&&(oldHelperNumberLayer.innerHTML=targetElement.step),oldtooltipLayer.innerHTML=targetElement.intro,oldtooltipContainer.style.display="block",_placeTooltip.call(self,targetElement.element,oldtooltipContainer,oldArrowLayer,oldHelperNumberLayer),oldReferenceLayer.querySelector(".introjs-bullets li > a.active").className="",oldReferenceLayer.querySelector('.introjs-bullets li > a[data-stepnumber="'+targetElement.step+'"]').className="active",oldReferenceLayer.querySelector(".introjs-progress .introjs-progressbar").setAttribute("style","width:"+_getProgress.call(self)+"%;"),oldtooltipContainer.style.opacity=1,oldHelperNumberLayer&&(oldHelperNumberLayer.style.opacity=1),-1===nextTooltipButton.tabIndex?skipTooltipButton.focus():nextTooltipButton.focus()},350)}else{var helperLayer=document.createElement("div"),referenceLayer=document.createElement("div"),arrowLayer=document.createElement("div"),tooltipLayer=document.createElement("div"),tooltipTextLayer=document.createElement("div"),bulletsLayer=document.createElement("div"),progressLayer=document.createElement("div"),buttonsLayer=document.createElement("div");helperLayer.className=highlightClass,referenceLayer.className="introjs-tooltipReferenceLayer",_setHelperLayerPosition.call(self,helperLayer),_setHelperLayerPosition.call(self,referenceLayer),this._targetElement.appendChild(helperLayer),this._targetElement.appendChild(referenceLayer),arrowLayer.className="introjs-arrow",tooltipTextLayer.className="introjs-tooltiptext",tooltipTextLayer.innerHTML=targetElement.intro,bulletsLayer.className="introjs-bullets",this._options.showBullets===!1&&(bulletsLayer.style.display="none");for(var ulContainer=document.createElement("ul"),i=0,stepsLength=this._introItems.length;stepsLength>i;i++){var innerLi=document.createElement("li"),anchorLink=document.createElement("a");anchorLink.onclick=function(){self.goToStep(this.getAttribute("data-stepnumber"))},i===targetElement.step-1&&(anchorLink.className="active"),anchorLink.href="javascript:void(0);",anchorLink.innerHTML=" ",anchorLink.setAttribute("data-stepnumber",this._introItems[i].step),innerLi.appendChild(anchorLink),ulContainer.appendChild(innerLi)}bulletsLayer.appendChild(ulContainer),progressLayer.className="introjs-progress",this._options.showProgress===!1&&(progressLayer.style.display="none");var progressBar=document.createElement("div");if(progressBar.className="introjs-progressbar",progressBar.setAttribute("style","width:"+_getProgress.call(this)+"%;"),progressLayer.appendChild(progressBar),buttonsLayer.className="introjs-tooltipbuttons",this._options.showButtons===!1&&(buttonsLayer.style.display="none"),tooltipLayer.className="introjs-tooltip",tooltipLayer.appendChild(tooltipTextLayer),tooltipLayer.appendChild(bulletsLayer),tooltipLayer.appendChild(progressLayer),1==this._options.showStepNumbers){var helperNumberLayer=document.createElement("span");helperNumberLayer.className="introjs-helperNumberLayer",helperNumberLayer.innerHTML=targetElement.step,referenceLayer.appendChild(helperNumberLayer)}tooltipLayer.appendChild(arrowLayer),referenceLayer.appendChild(tooltipLayer);var nextTooltipButton=document.createElement("a");nextTooltipButton.onclick=function(){self._introItems.length-1!=self._currentStep&&_nextStep.call(self)},nextTooltipButton.href="javascript:void(0);",nextTooltipButton.innerHTML=this._options.nextLabel;var prevTooltipButton=document.createElement("a");prevTooltipButton.onclick=function(){0!=self._currentStep&&_previousStep.call(self)},prevTooltipButton.href="javascript:void(0);",prevTooltipButton.innerHTML=this._options.prevLabel;var skipTooltipButton=document.createElement("a");skipTooltipButton.className="introjs-button introjs-skipbutton",skipTooltipButton.href="javascript:void(0);",skipTooltipButton.innerHTML=this._options.skipLabel,skipTooltipButton.onclick=function(){self._introItems.length-1==self._currentStep&&"function"==typeof self._introCompleteCallback&&self._introCompleteCallback.call(self),self._introItems.length-1!=self._currentStep&&"function"==typeof self._introExitCallback&&self._introExitCallback.call(self),_exitIntro.call(self,self._targetElement)},buttonsLayer.appendChild(skipTooltipButton),this._introItems.length>1&&(buttonsLayer.appendChild(prevTooltipButton),buttonsLayer.appendChild(nextTooltipButton)),tooltipLayer.appendChild(buttonsLayer),_placeTooltip.call(self,targetElement.element,tooltipLayer,arrowLayer,helperNumberLayer)}this._options.disableInteraction===!0&&_disableInteraction.call(self),prevTooltipButton.removeAttribute("tabIndex"),nextTooltipButton.removeAttribute("tabIndex"),0==this._currentStep&&this._introItems.length>1?(prevTooltipButton.className="introjs-button introjs-prevbutton introjs-disabled",prevTooltipButton.tabIndex="-1",nextTooltipButton.className="introjs-button introjs-nextbutton",skipTooltipButton.innerHTML=this._options.skipLabel):this._introItems.length-1==this._currentStep||1==this._introItems.length?(skipTooltipButton.innerHTML=this._options.doneLabel,prevTooltipButton.className="introjs-button introjs-prevbutton",nextTooltipButton.className="introjs-button introjs-nextbutton introjs-disabled",nextTooltipButton.tabIndex="-1"):(prevTooltipButton.className="introjs-button introjs-prevbutton",nextTooltipButton.className="introjs-button introjs-nextbutton",skipTooltipButton.innerHTML=this._options.skipLabel),nextTooltipButton.focus(),targetElement.element.className+=" introjs-showElement";var currentElementPosition=_getPropValue(targetElement.element,"position");"absolute"!==currentElementPosition&&"relative"!==currentElementPosition&&(targetElement.element.className+=" introjs-relativePosition");for(var parentElm=targetElement.element.parentNode;null!=parentElm&&"body"!==parentElm.tagName.toLowerCase();){var zIndex=_getPropValue(parentElm,"z-index"),opacity=parseFloat(_getPropValue(parentElm,"opacity")),transform=_getPropValue(parentElm,"transform")||_getPropValue(parentElm,"-webkit-transform")||_getPropValue(parentElm,"-moz-transform")||_getPropValue(parentElm,"-ms-transform")||_getPropValue(parentElm,"-o-transform");(/[0-9]+/.test(zIndex)||1>opacity||"none"!==transform&&void 0!==transform)&&(parentElm.className+=" introjs-fixParent"),parentElm=parentElm.parentNode}if(!_elementInViewport(targetElement.element)&&this._options.scrollToElement===!0){var rect=targetElement.element.getBoundingClientRect(),winHeight=_getWinSize().height,top=rect.bottom-(rect.bottom-rect.top),bottom=rect.bottom-winHeight;0>top||targetElement.element.clientHeight>winHeight?window.scrollBy(0,top-30):window.scrollBy(0,bottom+100)}"undefined"!=typeof this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,targetElement.element)}function _getPropValue(element,propName){var propValue="";return element.currentStyle?propValue=element.currentStyle[propName]:document.defaultView&&document.defaultView.getComputedStyle&&(propValue=document.defaultView.getComputedStyle(element,null).getPropertyValue(propName)),propValue&&propValue.toLowerCase?propValue.toLowerCase():propValue}function _getWinSize(){if(void 0!=window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var D=document.documentElement;return{width:D.clientWidth,height:D.clientHeight}}function _elementInViewport(el){var rect=el.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom+80<=window.innerHeight&&rect.right<=window.innerWidth}function _addOverlayLayer(targetElm){var overlayLayer=document.createElement("div"),styleText="",self=this;if(overlayLayer.className="introjs-overlay","body"===targetElm.tagName.toLowerCase())styleText+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",overlayLayer.setAttribute("style",styleText);else{var elementPosition=_getOffset(targetElm);elementPosition&&(styleText+="width: "+elementPosition.width+"px; height:"+elementPosition.height+"px; top:"+elementPosition.top+"px;left: "+elementPosition.left+"px;",overlayLayer.setAttribute("style",styleText))}return targetElm.appendChild(overlayLayer),overlayLayer.onclick=function(){1==self._options.exitOnOverlayClick&&(void 0!=self._introExitCallback&&self._introExitCallback.call(self),_exitIntro.call(self,targetElm))},setTimeout(function(){styleText+="opacity: "+self._options.overlayOpacity.toString()+";",overlayLayer.setAttribute("style",styleText)},10),!0}function _getOffset(element){var elementPosition={};elementPosition.width=element.offsetWidth,elementPosition.height=element.offsetHeight;for(var _x=0,_y=0;element&&!isNaN(element.offsetLeft)&&!isNaN(element.offsetTop);)_x+=element.offsetLeft,_y+=element.offsetTop,element=element.offsetParent;return elementPosition.top=_y,elementPosition.left=_x,elementPosition}function _getProgress(){var currentStep=parseInt(this._currentStep+1,10);return currentStep/this._introItems.length*100}function _mergeOptions(obj1,obj2){var obj3={};for(var attrname in obj1)obj3[attrname]=obj1[attrname];for(var attrname in obj2)obj3[attrname]=obj2[attrname];return obj3}var VERSION="1.1.1",introJs=function(targetElm){if("object"==typeof targetElm)return new IntroJs(targetElm);if("string"==typeof targetElm){var targetElement=document.querySelector(targetElm);if(targetElement)return new IntroJs(targetElement);throw new Error("There is no element with given selector.")}return new IntroJs(document.body)};return introJs.version=VERSION,introJs.fn=IntroJs.prototype={clone:function(){return new IntroJs(this)},setOption:function(option,value){return this._options[option]=value,this},setOptions:function(options){return this._options=_mergeOptions(this._options,options),this},start:function(){return _introForElement.call(this,this._targetElement),this},goToStep:function(step){return _goToStep.call(this,step),this},nextStep:function(){return _nextStep.call(this),this},previousStep:function(){return _previousStep.call(this),this},exit:function(){return _exitIntro.call(this,this._targetElement),this},refresh:function(){return _setHelperLayerPosition.call(this,document.querySelector(".introjs-helperLayer")),_setHelperLayerPosition.call(this,document.querySelector(".introjs-tooltipReferenceLayer")),this},onbeforechange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onbeforechange was not a function");return this._introBeforeChangeCallback=providedCallback,this},onchange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onchange was not a function.");return this._introChangeCallback=providedCallback,this},onafterchange:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onafterchange was not a function");return this._introAfterChangeCallback=providedCallback,this},oncomplete:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for oncomplete was not a function.");return this._introCompleteCallback=providedCallback,this},onexit:function(providedCallback){if("function"!=typeof providedCallback)throw new Error("Provided callback for onexit was not a function.");return this._introExitCallback=providedCallback,this}},exports.introJs=introJs,introJs}),function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):factory(jQuery)}(function($){function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();return"area"===nodeName?(map=element.parentNode,mapName=map.name,element.href&&mapName&&"map"===map.nodeName.toLowerCase()?(img=$("img[usemap='#"+mapName+"']")[0],!!img&&visible(img)):!1):(/^(input|select|textarea|button|object)$/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element)}function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return"hidden"===$.css(this,"visibility")}).length}$.ui=$.ui||{},$.extend($.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),$.fn.extend({scrollParent:function(includeHidden){var position=this.css("position"),excludeStaticParent="absolute"===position,overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);return excludeStaticParent&&"static"===parent.css("position")?!1:overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"))}).eq(0);return"fixed"!==position&&scrollParent.length?scrollParent:$(this[0].ownerDocument||document)},uniqueId:function(){var uuid=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++uuid)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&$(this).removeAttr("id")})}}),$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")))},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN)}}),$("").outerWidth(1).jquery||$.each(["Width","Height"],function(i,name){function reduce(elem,size,border,margin){return $.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0,border&&(size-=parseFloat($.css(elem,"border"+this+"Width"))||0),margin&&(size-=parseFloat($.css(elem,"margin"+this))||0)}),size}var side="Width"===name?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};$.fn["inner"+name]=function(size){return void 0===size?orig["inner"+name].call(this):this.each(function(){$(this).css(type,reduce(this,size)+"px")})},$.fn["outer"+name]=function(size,margin){return"number"!=typeof size?orig["outer"+name].call(this,size):this.each(function(){$(this).css(type,reduce(this,size,!0,margin)+"px")})}}),$.fn.addBack||($.fn.addBack=function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}),$("").data("a-b","a").removeData("a-b").data("a-b")&&($.fn.removeData=function(removeData){return function(key){return arguments.length?removeData.call(this,$.camelCase(key)):removeData.call(this)}}($.fn.removeData)),$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),$.fn.extend({focus:function(orig){return function(delay,fn){return"number"==typeof delay?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus(),fn&&fn.call(elem)},delay)}):orig.apply(this,arguments)}}($.fn.focus),disableSelection:function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(eventType+".ui-disableSelection",function(event){event.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(zIndex){if(void 0!==zIndex)return this.css("zIndex",zIndex);if(this.length)for(var position,value,elem=$(this[0]);elem.length&&elem[0]!==document;){if(position=elem.css("position"),("absolute"===position||"relative"===position||"fixed"===position)&&(value=parseInt(elem.css("zIndex"),10),!isNaN(value)&&0!==value))return value;elem=elem.parent()}return 0}}),$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set)proto.plugins[i]=proto.plugins[i]||[],proto.plugins[i].push([option,set[i]])},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(set&&(allowDisconnected||instance.element[0].parentNode&&11!==instance.element[0].parentNode.nodeType))for(i=0;iinputIndex;inputIndex++)for(key in input[inputIndex])value=input[inputIndex][key],input[inputIndex].hasOwnProperty(key)&&void 0!==value&&($.isPlainObject(value)?target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value):target[key]=value);return target},$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall="string"==typeof options,args=widget_slice.call(arguments,1),returnValue=this;return isMethodCall?this.each(function(){var methodValue,instance=$.data(this,fullName);return"instance"===options?(returnValue=instance,!1):instance?$.isFunction(instance[options])&&"_"!==options.charAt(0)?(methodValue=instance[options].apply(instance,args),methodValue!==instance&&void 0!==methodValue?(returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue,!1):void 0):$.error("no such method '"+options+"' for "+name+" widget instance"):$.error("cannot call methods on "+name+" prior to initialization; attempted to call method '"+options+"'")}):(args.length&&(options=$.widget.extend.apply(null,[options].concat(args))),this.each(function(){var instance=$.data(this,fullName);instance?(instance.option(options||{}),instance._init&&instance._init()):$.data(this,fullName,new object(options,this))})),returnValue}},$.Widget=function(){},$.Widget._childConstructors=[],$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=widget_uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=$(),this.hoverable=$(),this.focusable=$(),element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this._create(),this._trigger("create",null,this._getCreateEventData()), this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},parts=key.split("."),key=parts.shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});!function(){function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(element,property){return parseInt($.css(element,property),10)||0}function getDimensions(elem){var raw=elem[0];return 9===raw.nodeType?{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}:$.isWindow(raw)?{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}:raw.preventDefault?{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}:{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()}}$.ui=$.ui||{};var cachedScrollbarWidth,supportsOffsetFractions,max=Math.max,abs=Math.abs,round=Math.round,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;$.position={scrollbarWidth:function(){if(void 0!==cachedScrollbarWidth)return cachedScrollbarWidth;var w1,w2,div=$("
"),innerDiv=div.children()[0];return $("body").append(div),w1=innerDiv.offsetWidth,div.css("overflow","scroll"),w2=innerDiv.offsetWidth,w1===w2&&(w2=div[0].clientWidth),div.remove(),cachedScrollbarWidth=w1-w2},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX="scroll"===overflowX||"auto"===overflowX&&within.widthright?"left":left>0?"right":"center",vertical:0>bottom?"top":top>0?"bottom":"middle"};elemWidth>targetWidth&&abs(left+right)targetHeight&&abs(top+bottom)max(abs(top),abs(bottom))?feedback.important="horizontal":feedback.important="vertical",options.using.call(this,props,feedback)}),elem.offset($.extend(position,{using:using}))})},$.ui.position={fit:{left:function(position,data){var newOverRight,within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset;data.collisionWidth>outerWidth?overLeft>0&&0>=overRight?(newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset,position.left+=overLeft-newOverRight):overRight>0&&0>=overLeft?position.left=withinOffset:overLeft>overRight?position.left=withinOffset+outerWidth-data.collisionWidth:position.left=withinOffset:overLeft>0?position.left+=overLeft:overRight>0?position.left-=overRight:position.left=max(position.left-collisionPosLeft,position.left)},top:function(position,data){var newOverBottom,within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset;data.collisionHeight>outerHeight?overTop>0&&0>=overBottom?(newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset,position.top+=overTop-newOverBottom):overBottom>0&&0>=overTop?position.top=withinOffset:overTop>overBottom?position.top=withinOffset+outerHeight-data.collisionHeight:position.top=withinOffset:overTop>0?position.top+=overTop:overBottom>0?position.top-=overBottom:position.top=max(position.top-collisionPosTop,position.top)}},flip:{left:function(position,data){var newOverRight,newOverLeft,within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset="left"===data.my[0]?-data.elemWidth:"right"===data.my[0]?data.elemWidth:0,atOffset="left"===data.at[0]?data.targetWidth:"right"===data.at[0]?-data.targetWidth:0,offset=-2*data.offset[0];0>overLeft?(newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset,(0>newOverRight||newOverRight0&&(newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft,(newOverLeft>0||abs(newOverLeft)overTop?(newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset,(0>newOverBottom||newOverBottom0&&(newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop,(newOverTop>0||abs(newOverTop)10&&11>offsetLeft,testElement.innerHTML="",testElementParent.removeChild(testElement)}()}();$.ui.position;$.widget("ui.draggable",$.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(key,value){this._super(key,value),"handle"===key&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(event){var o=this.options;return this._blurActiveElement(event),this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(event),this.handle?(this._blockFrames(o.iframeFix===!0?"iframe":o.iframeFix),!0):!1)},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("
").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(event){var document=this.document[0];if(this.handleElement.is(event.target))try{document.activeElement&&"body"!==document.activeElement.nodeName.toLowerCase()&&$(document.activeElement).blur()}catch(error){}},_mouseStart:function(event){var o=this.options;return this.helper=this._createHelper(event),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),$.ui.ddmanager&&($.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===$(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(event),this.originalPosition=this.position=this._generatePosition(event,!1),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this._setContainment(),this._trigger("start",event)===!1?(this._clear(),!1):(this._cacheHelperProportions(),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this._normalizeRightBottom(),this._mouseDrag(event,!0),$.ui.ddmanager&&$.ui.ddmanager.dragStart(this,event),!0)},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(event,!0),this.positionAbs=this._convertPositionTo("absolute"),!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===!1)return this._mouseUp({}),!1;this.position=ui.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),!1},_mouseStop:function(event){var that=this,dropped=!1;return $.ui.ddmanager&&!this.options.dropBehaviour&&(dropped=$.ui.ddmanager.drop(this,event)),this.dropped&&(dropped=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!dropped||"valid"===this.options.revert&&dropped||this.options.revert===!0||$.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped)?$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){that._trigger("stop",event)!==!1&&that._clear()}):this._trigger("stop",event)!==!1&&this._clear(),!1},_mouseUp:function(event){return this._unblockFrames(),$.ui.ddmanager&&$.ui.ddmanager.dragStop(this,event),this.handleElement.is(event.target)&&this.element.focus(),$.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):"clone"===o.helper?this.element.clone().removeAttr("id"):this.element;return helper.parents("body").length||helper.appendTo("parent"===o.appendTo?this.element[0].parentNode:o.appendTo),helperIsFunction&&helper[0]===this.element[0]&&this._setPositionRelative(),helper[0]===this.element[0]||/(fixed|absolute)/.test(helper.css("position"))||helper.css("position","absolute"),helper},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_isRootNode:function(element){return/(html|body)/i.test(element.tagName)||element===this.document[0]},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollTop()),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];return this.relativeContainer=null,o.containment?"window"===o.containment?void(this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===o.containment?void(this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):o.containment.constructor===Array?void(this.containment=o.containment):("parent"===o.containment&&(o.containment=this.helper[0].parentNode),c=$(o.containment),ce=c[0],void(ce&&(isUserScrollable=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null)},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)*mod}},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;return scrollIsRootNode&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),constrainPosition&&(this.containment&&(this.relativeContainer?(co=this.relativeContainer.offset(),containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]):containment=this.containment,event.pageX-this.offset.click.leftcontainment[2]&&(pageX=containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>containment[3]&&(pageY=containment[3]+this.offset.click.top)),o.grid&&(top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,pageX=containment?left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0]?left-o.grid[0]:left+o.grid[0]:left),"y"===o.axis&&(pageX=this.originalPageX),"x"===o.axis&&(pageY=this.originalPageY)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(type,event,ui){return ui=ui||this._uiHash(),$.ui.plugin.call(this,type,[event,ui,this],!0),/^(drag|start|stop)/.test(type)&&(this.positionAbs=this._convertPositionTo("absolute"),ui.offset=this.positionAbs),$.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[],$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");sortable&&!sortable.options.disabled&&(draggable.sortables.push(sortable),sortable.refreshPositions(),sortable._trigger("activate",event,uiSortable))})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{ item:draggable.element});draggable.cancelHelperRemoval=!1,$.each(draggable.sortables,function(){var sortable=this;sortable.isOver?(sortable.isOver=0,draggable.cancelHelperRemoval=!0,sortable.cancelHelperRemoval=!1,sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")},sortable._mouseStop(event),sortable.options.helper=sortable.options._helper):(sortable.cancelHelperRemoval=!0,sortable._trigger("deactivate",event,uiSortable))})},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=!1,sortable=this;sortable.positionAbs=draggable.positionAbs,sortable.helperProportions=draggable.helperProportions,sortable.offset.click=draggable.offset.click,sortable._intersectsWith(sortable.containerCache)&&(innermostIntersecting=!0,$.each(draggable.sortables,function(){return this.positionAbs=draggable.positionAbs,this.helperProportions=draggable.helperProportions,this.offset.click=draggable.offset.click,this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])&&(innermostIntersecting=!1),innermostIntersecting})),innermostIntersecting?(sortable.isOver||(sortable.isOver=1,draggable._parent=ui.helper.parent(),sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",!0),sortable.options._helper=sortable.options.helper,sortable.options.helper=function(){return ui.helper[0]},event.target=sortable.currentItem[0],sortable._mouseCapture(event,!0),sortable._mouseStart(event,!0,!0),sortable.offset.click.top=draggable.offset.click.top,sortable.offset.click.left=draggable.offset.click.left,sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left,sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top,draggable._trigger("toSortable",event),draggable.dropped=sortable.element,$.each(draggable.sortables,function(){this.refreshPositions()}),draggable.currentItem=draggable.element,sortable.fromOutside=draggable),sortable.currentItem&&(sortable._mouseDrag(event),ui.position=sortable.position)):sortable.isOver&&(sortable.isOver=0,sortable.cancelHelperRemoval=!0,sortable.options._revert=sortable.options.revert,sortable.options.revert=!1,sortable._trigger("out",event,sortable._uiHash(sortable)),sortable._mouseStop(event,!0),sortable.options.revert=sortable.options._revert,sortable.options.helper=sortable.options._helper,sortable.placeholder&&sortable.placeholder.remove(),ui.helper.appendTo(draggable._parent),draggable._refreshOffsets(event),ui.position=draggable._generatePosition(event,!0),draggable._trigger("fromSortable",event),draggable.dropped=!1,$.each(draggable.sortables,function(){this.refreshPositions()}))})}}),$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;t.css("cursor")&&(o._cursor=t.css("cursor")),t.css("cursor",o.cursor)},stop:function(event,ui,instance){var o=instance.options;o._cursor&&$("body").css("cursor",o._cursor)}}),$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("opacity")&&(o._opacity=t.css("opacity")),t.css("opacity",o.opacity)},stop:function(event,ui,instance){var o=instance.options;o._opacity&&$(ui.helper).css("opacity",o._opacity)}}),$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(event,ui,i){var o=i.options,scrolled=!1,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];scrollParent!==document&&"HTML"!==scrollParent.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+scrollParent.offsetHeight-event.pageY=0;i--)l=inst.snapElements[i].left-inst.margins.left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top-inst.margins.top,b=t+inst.snapElements[i].height,l-d>x2||x1>r+d||t-d>y2||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)?(inst.snapElements[i].snapping&&inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=!1):("inner"!==o.snapMode&&(ts=Math.abs(t-y2)<=d,bs=Math.abs(b-y1)<=d,ls=Math.abs(l-x2)<=d,rs=Math.abs(r-x1)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left)),first=ts||bs||ls||rs,"outer"!==o.snapMode&&(ts=Math.abs(t-y1)<=d,bs=Math.abs(b-y2)<=d,ls=Math.abs(l-x1)<=d,rs=Math.abs(r-x2)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left)),!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)&&inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=ts||bs||ls||rs||first)}}),$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});group.length&&(min=parseInt($(group[0]).css("zIndex"),10)||0,$(group).each(function(i){$(this).css("zIndex",min+i)}),this.css("zIndex",min+group.length))}}),$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("zIndex")&&(o._zIndex=t.css("zIndex")),t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){var o=instance.options;o._zIndex&&$(ui.helper).css("zIndex",o._zIndex)}});$.ui.draggable;$.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=!1,this.isout=!0,this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept)},this.proportions=function(){return arguments.length?void(proportions=arguments[0]):proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(o.scope),o.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[],$.ui.ddmanager.droppables[scope].push(this)},_splice:function(drop){for(var i=0;i=reference&&reference+size>x}return function(draggable,droppable,toleranceMode,event){if(!droppable.offset)return!1;var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return x1>=l&&r>=x2&&y1>=t&&b>=y2;case"intersect":return l=t&&b>=y1||y2>=t&&b>=y2||t>y1&&y2>b)&&(x1>=l&&r>=x1||x2>=l&&r>=x2||l>x1&&x2>r);default:return!1}}}(),$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i0?!0:(el[scroll]=1,has=el[scroll]>0,el[scroll]=0,has)},_create:function(){var n,i,handle,axis,hname,that=this,o=this.options;if(this.element.addClass("ui-resizable"),$.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap($("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=o.handles||($(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=$(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i
"),axis.css({zIndex:o.zIndex}),"se"===handle&&axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[handle]=".ui-resizable-"+handle,this.element.append(axis);this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=$(this.handles[i]),this._on(this.handles[i],{mousedown:that._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(axis=$(this.handles[i],this.element),padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth(),padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),target.css(padPos,padWrapper),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){that.resizing||(this.className&&(axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),that.axis=axis&&axis[1]?axis[1]:"se")}),o.autoHide&&(this._handles.hide(),$(this.element).addClass("ui-resizable-autohide").mouseenter(function(){o.disabled||($(this).removeClass("ui-resizable-autohide"),that._handles.show())}).mouseleave(function(){o.disabled||that.resizing||($(this).addClass("ui-resizable-autohide"),that._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(_destroy(this.element),wrapper=this.element,this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper),wrapper.remove()),this.originalElement.css("resize",this.originalResizeStyle),_destroy(this.originalElement),this},_mouseCapture:function(event){var i,handle,capture=!1;for(i in this.handles)handle=$(this.handles[i])[0],(handle===event.target||$.contains(handle,event.target))&&(capture=!0);return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;return this.resizing=!0,this._renderProxy(),curleft=this._num(this.helper.css("left")),curtop=this._num(this.helper.css("top")),o.containment&&(curleft+=$(o.containment).scrollLeft()||0,curtop+=$(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:curleft,top:curtop},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()},this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()},this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()},this.originalPosition={left:curleft,top:curtop},this.originalMousePosition={left:event.pageX,top:event.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,cursor=$(".ui-resizable-"+this.axis).css("cursor"),$("body").css("cursor","auto"===cursor?this.axis+"-resize":cursor),el.addClass("ui-resizable-resizing"),this._propagate("start",event),!0},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=event.pageX-smp.left||0,dy=event.pageY-smp.top||0,trigger=this._change[a];return this._updatePrevProperties(),trigger?(data=trigger.apply(this,[event,dx,dy]),this._updateVirtualBoundaries(event.shiftKey),(this._aspectRatio||event.shiftKey)&&(data=this._updateRatio(data,event)),data=this._respectSize(data,event),this._updateCache(data),this._propagate("resize",event),props=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),$.isEmptyObject(props)||(this._updatePrevProperties(),this._trigger("resize",event,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(event){this.resizing=!1;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;return this._helper&&(pr=this._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,s={width:that.helper.width()-soffsetw,height:that.helper.height()-soffseth},left=parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left)||null,top=parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top)||null,o.animate||this.element.css($.extend(s,{top:top,left:left})),that.helper.height(that.size.height),that.helper.width(that.size.width),this._helper&&!o.animate&&this._proportionallyResize()),$("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",event),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};return this.position.top!==this.prevPosition.top&&(props.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(props.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(props.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(props.height=this.size.height+"px"),this.helper.css(props),props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||forceAspectRatio)&&(pMinWidth=b.minHeight*this.aspectRatio,pMinHeight=b.minWidth/this.aspectRatio,pMaxWidth=b.maxHeight*this.aspectRatio,pMaxHeight=b.maxWidth/this.aspectRatio,pMinWidth>b.minWidth&&(b.minWidth=pMinWidth),pMinHeight>b.minHeight&&(b.minHeight=pMinHeight),pMaxWidthdata.width,isminh=this._isNumber(data.height)&&o.minHeight&&o.minHeight>data.height,dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);return isminw&&(data.width=o.minWidth),isminh&&(data.height=o.minHeight),ismaxw&&(data.width=o.maxWidth),ismaxh&&(data.height=o.maxHeight),isminw&&cw&&(data.left=dw-o.minWidth),ismaxw&&cw&&(data.left=dw-o.maxWidth),isminh&&ch&&(data.top=dh-o.minHeight),ismaxh&&ch&&(data.top=dh-o.maxHeight),data.width||data.height||data.left||!data.top?data.width||data.height||data.top||!data.left||(data.left=null):data.top=null,data},_getPaddingPlusBorderDimensions:function(element){for(var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];4>i;i++)widths[i]=parseInt(borders[i],10)||0,widths[i]+=parseInt(paddings[i],10)||0;return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var prel,i=0,element=this.helper||this.element;i
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(event,dx){return{width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]),"resize"!==n&&this._trigger(n,event,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:that.size.width-soffsetw,height:that.size.height-soffseth},left=parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left)||null,top=parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top)||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(that.element.css("width"),10),height:parseInt(that.element.css("height"),10),top:parseInt(that.element.css("top"),10),left:parseInt(that.element.css("left"),10)};pr&&pr.length&&$(pr[0]).css({width:data.width,height:data.height}),that._updateCache(data),that._propagate("resize",event)}})}}),$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=oc instanceof $?oc.get(0):/parent/.test(oc)?el.parent().get(0):oc;ce&&(that.containerElement=$(ce),/document/.test(oc)||oc===document?(that.containerOffset={left:0,top:0},that.containerPosition={left:0,top:0},that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}):(element=$(ce),p=[],$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name))}),that.containerOffset=element.offset(),that.containerPosition=element.position(),that.containerSize={height:element.innerHeight()-p[3],width:element.innerWidth()-p[1]},co=that.containerOffset,ch=that.containerSize.height,cw=that.containerSize.width,width=that._hasScroll(ce,"left")?ce.scrollWidth:cw,height=that._hasScroll(ce)?ce.scrollHeight:ch,that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}))},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=!0;ce[0]!==document&&/static/.test(ce.css("position"))&&(cop=co),cp.left<(that._helper?co.left:0)&&(that.size.width=that.size.width+(that._helper?that.position.left-co.left:that.position.left-cop.left),pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1),that.position.left=o.helper?co.left:0),cp.top<(that._helper?co.top:0)&&(that.size.height=that.size.height+(that._helper?that.position.top-co.top:that.position.top),pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1),that.position.top=that._helper?co.top:0),isParent=that.containerElement.get(0)===that.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position")),isParent&&isOffsetRelative?(that.offset.left=that.parentData.left+that.position.left,that.offset.top=that.parentData.top+that.position.top):(that.offset.left=that.element.offset().left,that.offset.top=that.element.offset().top),woset=Math.abs(that.sizeDiff.width+(that._helper?that.offset.left-cop.left:that.offset.left-co.left)),hoset=Math.abs(that.sizeDiff.height+(that._helper?that.offset.top-cop.top:that.offset.top-co.top)), woset+that.size.width>=that.parentData.width&&(that.size.width=that.parentData.width-woset,pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1)),hoset+that.size.height>=that.parentData.height&&(that.size.height=that.parentData.height-hoset,pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1)),continueResize||(that.position.left=that.prevPosition.left,that.position.top=that.prevPosition.top,that.size.width=that.prevSize.width,that.size.height=that.prevSize.height)},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;that._helper&&!o.animate&&/relative/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h}),that._helper&&!o.animate&&/static/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}),$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseInt(el.width(),10),height:parseInt(el.height(),10),left:parseInt(el.css("left"),10),top:parseInt(el.css("top"),10)})})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:that.size.height-os.height||0,width:that.size.width-os.width||0,top:that.position.top-op.top||0,left:that.position.left-op.left||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);sum&&sum>=0&&(style[prop]=sum||null)}),el.css(style)})},stop:function(){$(this).removeData("resizable-alsoresize")}}),$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),o=that.options,cs=that.size;that.ghost=that.originalElement.clone(),that.ghost.css({opacity:.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof o.ghost?o.ghost:""),that.ghost.appendTo(that.helper)},resize:function(){var that=$(this).resizable("instance");that.ghost&&that.ghost.css({position:"relative",height:that.size.height,width:that.size.width})},stop:function(){var that=$(this).resizable("instance");that.ghost&&that.helper&&that.helper.get(0).removeChild(that.ghost.get(0))}}),$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid="number"==typeof o.grid?[o.grid,o.grid]:o.grid,gridX=grid[0]||1,gridY=grid[1]||1,ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&o.maxWidthnewWidth,isMinHeight=o.minHeight&&o.minHeight>newHeight;o.grid=grid,isMinWidth&&(newWidth+=gridX),isMinHeight&&(newHeight+=gridY),isMaxWidth&&(newWidth-=gridX),isMaxHeight&&(newHeight-=gridY),/^(se|s|e)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight):/^(ne)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.top=op.top-oy):/^(sw)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.left=op.left-ox):((0>=newHeight-gridY||0>=newWidth-gridX)&&(outerDimensions=that._getPaddingPlusBorderDimensions(this)),newHeight-gridY>0?(that.size.height=newHeight,that.position.top=op.top-oy):(newHeight=gridY-outerDimensions.height,that.size.height=newHeight,that.position.top=op.top+os.height-newHeight),newWidth-gridX>0?(that.size.width=newWidth,that.position.left=op.left-ox):(newWidth=gridX-outerDimensions.width,that.size.width=newWidth,that.position.left=op.left+os.width-newWidth))}});$.ui.resizable,$.widget("ui.selectable",$.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var selectees,that=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){selectees=$(that.options.filter,that.element[0]),selectees.addClass("ui-selectee"),selectees.each(function(){var $this=$(this),pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:!1,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=selectees.addClass("ui-selectee"),this._mouseInit(),this.helper=$("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY],this.options.disabled||(this.selectees=$(options.filter,this.element[0]),this._trigger("start",event),$(options.appendTo).append(this.helper),this.helper.css({left:event.pageX,top:event.pageY,width:0,height:0}),options.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=!0,event.metaKey||event.ctrlKey||(selectee.$element.removeClass("ui-selected"),selectee.selected=!1,selectee.$element.addClass("ui-unselecting"),selectee.unselecting=!0,that._trigger("unselecting",event,{unselecting:selectee.element}))}),$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");return selectee?(doSelect=!event.metaKey&&!event.ctrlKey||!selectee.$element.hasClass("ui-selected"),selectee.$element.removeClass(doSelect?"ui-unselecting":"ui-selected").addClass(doSelect?"ui-selecting":"ui-unselecting"),selectee.unselecting=!doSelect,selectee.selecting=doSelect,selectee.selected=doSelect,doSelect?that._trigger("selecting",event,{selecting:selectee.element}):that._trigger("unselecting",event,{unselecting:selectee.element}),!1):void 0}))},_mouseDrag:function(event){if(this.dragged=!0,!this.options.disabled){var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;return x1>x2&&(tmp=x2,x2=x1,x1=tmp),y1>y2&&(tmp=y2,y2=y1,y1=tmp),this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1}),this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=!1;selectee&&selectee.element!==that.element[0]&&("touch"===options.tolerance?hit=!(selectee.left>x2||selectee.righty2||selectee.bottomx1&&selectee.righty1&&selectee.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,disableHorizontalScroll:!1,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return x>=reference&&reference+size>x},_isFloating:function(item){return/left|right/.test(item.css("float"))||/inline|table-cell/.test(item.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(key,value){this._super(key,value),"handle"===key&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),$.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)this.items[i].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=!1,that=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(event),$(event.target).parents().each(function(){return $.data(this,that.widgetName+"-item")===that?(currentItem=$(this),!1):void 0}),$.data(event.target,that.widgetName+"-item")===that&&(currentItem=$(event.target)),currentItem&&(!this.options.handle||overrideHandle||($(this.options.handle,currentItem).find("*").addBack().each(function(){this===event.target&&(validHandle=!0)}),validHandle))?(this.currentItem=currentItem,this._removeCurrentsFromItems(),!0):!1)},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(event),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(event),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(body=this.document.find("body"),this.storedCursor=body.css("cursor"),body.css("cursor",o.cursor),this.storedStylesheet=$("").appendTo(body)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",event,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!noActivation)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",event,this._uiHash(this));return $.ui.ddmanager&&($.ui.ddmanager.current=this),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(event),!0},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=!1;for(this.position=this._generatePosition(event),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-event.pageY=0;i--)if(item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item),intersection&&!(item.item.data("dragMultipleActive")||item.instance!==this.currentContainer||itemElement===this.currentItem[0]||this.placeholder[1===intersection?"next":"prev"]()[0]===itemElement||$.contains(this.placeholder[0],itemElement)||("semi-dynamic"===this.options.type?$.contains(this.element[0],itemElement):0))){if(this.direction=1===intersection?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(item))break;this._rearrange(event,item),this._trigger("change",event,this._uiHash());break}return this._contactContainers(event),$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),this._trigger("sort",event,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(event,noPropagation){if(event){if($.ui.ddmanager&&!this.options.dropBehaviour&&$.ui.ddmanager.drop(this,event),this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};axis&&"x"!==axis||(animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),axis&&"y"!==axis||(animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event)})}else this._clear(event,noPropagation);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("deactivate",null,this._uiHash(this)),this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",null,this._uiHash(this)),this.containers[i].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),$.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?$(this.domPosition.prev).after(this.currentItem):$(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];return o=o||{},$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||/(.+)[\-=_](.+)/);res&&str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}),!str.length&&o.key&&str.push(o.key+"="),str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];return o=o||{},items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")}),ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight="x"===this.options.axis||y1+dyClick>t&&b>y1+dyClick,isOverElementWidth="y"===this.options.axis||x1+dxClick>l&&r>x1+dxClick,isOverElement=isOverElementHeight&&isOverElementWidth;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"]?isOverElement:l0?"down":"up")},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return 0!==delta&&(delta>0?"right":"left")},refresh:function(event){return this._refreshItems(event),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith},_getItemsAsjQuery:function(connected){function addItems(){items.push(this)}var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected)for(i=connectWith.length-1;i>=0;i--)for(cur=$(connectWith[i],this.document[0]),j=cur.length-1;j>=0;j--)inst=$.data(cur[j],this.widgetFullName),inst&&inst!==this&&!inst.options.disabled&&queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);for(queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=queries.length-1;i>=0;i--)queries[i][0].each(addItems);return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j=0;i--)for(cur=$(connectWith[i],this.document[0]),j=cur.length-1;j>=0;j--)inst=$.data(cur[j],this.widgetFullName),inst&&inst!==this&&!inst.options.disabled&&(queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]),this.containers.push(inst));for(i=queries.length-1;i>=0;i--)for(targetData=queries[i][1],_queries=queries[i][0],j=0,queriesLength=_queries.length;queriesLength>j;j++)item=$(_queries[j]),item.data(this.widgetName+"-item",targetData),items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0})},refreshPositions:function(fast){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,item,t,p;for(i=this.items.length-1;i>=0;i--)item=this.items[i],$(item.item).data("dragMultipleActive")||item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]||(t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item,fast||(item.width=t.outerWidth(),item.height=t.outerHeight()),p=t.offset(),item.left=p.left,item.top=p.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)p=this.containers[i].element.offset(),this.containers[i].containerCache.left=p.left,this.containers[i].containerCache.top=p.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(that){that=that||this;var className,o=that.options;o.placeholder&&o.placeholder.constructor!==String||(className=o.placeholder,o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===nodeName?that._createTrPlaceholder(that.currentItem.find("tr").eq(0),$("",that.document[0]).appendTo(element)):"tr"===nodeName?that._createTrPlaceholder(that.currentItem,element):"img"===nodeName&&element.attr("src",that.currentItem.attr("src")),className||element.css("visibility","hidden"),element},update:function(container,p){(!className||o.forcePlaceholderSize)&&(p.height()||p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10)),p.width()||p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10)))}}),that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem)),that.currentItem.after(that.placeholder),o.placeholder.update(that,that.placeholder)},_createTrPlaceholder:function(sourceTr,targetTr){var that=this;sourceTr.children().each(function(){$(" ",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(targetTr)})},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--)if(!$.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0]))continue;innermostContainer=this.containers[i],innermostIndex=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",event,this._uiHash(this)),this.containers[i].containerCache.over=0);if(innermostContainer)if(1===this.containers.length)this.containers[innermostIndex].containerCache.over||(this.containers[innermostIndex]._trigger("over",event,this._uiHash(this)),this.containers[innermostIndex].containerCache.over=1);else{for(dist=1e4,itemWithLeastDistance=null,floating=innermostContainer.floating||this._isFloating(this.currentItem),posProperty=floating?"left":"top",sizeProperty=floating?"width":"height",axis=floating?"clientX":"clientY",j=this.items.length-1;j>=0;j--)$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])&&this.items[j].item[0]!==this.currentItem[0]&&(cur=this.items[j].item.offset()[posProperty],nearBottom=!1,event[axis]-cur>this.items[j][sizeProperty]/2&&(nearBottom=!0),Math.abs(event[axis]-cur)this.containment[2]&&(pageX=this.containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>this.containment[3]&&(pageY=this.containment[3]+this.offset.click.top)),o.grid&&(top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1],pageY=this.containment?top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3]?top:top-this.offset.click.top>=this.containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0],pageX=this.containment?left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2]?left:left-this.offset.click.left>=this.containment[0]?left-o.grid[0]:left+o.grid[0]:left)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop()),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())}},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?i.item[0]:i.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){counter===this.counter&&this.refreshPositions(!hardRefresh)})},_clear:function(event,noPropagation){function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance))}}this.reverting=!1;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!noPropagation&&delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||noPropagation||delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash())}),this!==this.currentContainer&&(noPropagation||(delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())}),delayedTriggers.push(function(c){return function(event){c._trigger("receive",event,this._uiHash(this))}}.call(this,this.currentContainer)),delayedTriggers.push(function(c){return function(event){c._trigger("update",event,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)noPropagation||delayedTriggers.push(delayEvent("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(delayedTriggers.push(delayEvent("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,noPropagation||this._trigger("beforeStop",event,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!noPropagation){for(i=0;i",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(event){event.preventDefault()},"click .ui-menu-item":function(event){var target=$(event.target);!this.mouseHandled&&target.not(".ui-state-disabled").length&&(this.select(event),event.isPropagationStopped()||(this.mouseHandled=!0),target.has(".ui-menu").length?this.expand(event):!this.element.is(":focus")&&$(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(event){if(!this.previousFilter){var target=$(event.currentTarget);target.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(event,target)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this.element.find(this.options.items).eq(0);keepActiveItem||this.focus(event,item)},blur:function(event){this._delay(function(){$.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(event)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(event){this._closeOnDocumentClick(event)&&this.collapseAll(event),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var elem=$(this);elem.data("ui-menu-submenu-carat")&&elem.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(event){var match,prev,character,skip,preventDefault=!0;switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(event);break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=!1,prev=this.previousFilter||"",character=String.fromCharCode(event.keyCode),skip=!1,clearTimeout(this.filterTimer),character===prev?skip=!0:character=prev+character,match=this._filterMenuItems(character),match=skip&&-1!==match.index(this.active.next())?this.active.nextAll(".ui-menu-item"):match,match.length||(character=String.fromCharCode(event.keyCode),match=this._filterMenuItems(character)),match.length?(this.focus(event,match),this.previousFilter=character,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}preventDefault&&event.preventDefault()},_activate:function(event){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(event):this.select(event))},refresh:function(){var menus,items,that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.parent(),submenuCarat=$("").addClass("ui-menu-icon ui-icon "+icon).data("ui-menu-submenu-carat",!0);item.attr("aria-haspopup","true").prepend(submenuCarat),menu.attr("aria-labelledby",item.attr("id"))}),menus=submenus.add(this.element),items=menus.find(this.options.items),items.not(".ui-menu-item").each(function(){var item=$(this);that._isDivider(item)&&item.addClass("ui-widget-content ui-menu-divider")}),items.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),items.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!$.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(key,value){"icons"===key&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu),"disabled"===key&&this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value),this._super(key,value)},focus:function(event,item){var nested,focused;this.blur(event,event&&"focus"===event.type),this._scrollIntoView(item),this.active=item.first(),focused=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",focused.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),event&&"keydown"===event.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),nested=item.children(".ui-menu"),nested.length&&event&&/^mouse/.test(event.type)&&this._startOpening(nested),this.activeMenu=item.parent(),this._trigger("focus",event,{item:item})},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;this._hasScroll()&&(borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0,paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0,offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop,scroll=this.activeMenu.scrollTop(),elementHeight=this.activeMenu.height(),itemHeight=item.outerHeight(),0>offset?this.activeMenu.scrollTop(scroll+offset):offset+itemHeight>elementHeight&&this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight))},blur:function(event,fromFocus){fromFocus||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",event,{item:this.active}))},_startOpening:function(submenu){clearTimeout(this.timer),"true"===submenu.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(submenu)},this.delay))},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true"),submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position)},collapseAll:function(event,all){clearTimeout(this.timer),this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));currentMenu.length||(currentMenu=this.element),this._close(currentMenu),this.blur(event),this.activeMenu=currentMenu},this.delay)},_close:function(startMenu){startMenu||(startMenu=this.active?this.active.parent():this.element),startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(event){return!$(event.target).closest(".ui-menu").length},_isDivider:function(item){return!/[^\-\u2014\u2013\s]/.test(item.text())},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);newItem&&newItem.length&&(this._close(),this.focus(event,newItem))},expand:function(event){var newItem=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();newItem&&newItem.length&&(this._open(newItem.parent()),this._delay(function(){this.focus(event,newItem)}))},next:function(event){this._move("next","first",event)},previous:function(event){this._move("prev","last",event)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(direction,filter,event){var next;this.active&&(next="first"===direction||"last"===direction?this.active["first"===direction?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[direction+"All"](".ui-menu-item").eq(0)),next&&next.length&&this.active||(next=this.activeMenu.find(this.options.items)[filter]()),this.focus(event,next)},nextPage:function(event){var item,base,height;return this.active?void(this.isLastItem()||(this._hasScroll()?(base=this.active.offset().top,height=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return item=$(this),item.offset().top-base-height<0}),this.focus(event,item)):this.focus(event,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))):void this.next(event)},previousPage:function(event){var item,base,height;return this.active?void(this.isFirstItem()||(this._hasScroll()?(base=this.active.offset().top,height=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return item=$(this),item.offset().top-base+height>0}),this.focus(event,item)):this.focus(event,this.activeMenu.find(this.options.items).first()))):void this.next(event)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea="textarea"===nodeName,isInput="input"===nodeName;this.isMultiLine=isTextarea?!0:isInput?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[isTextarea||isInput?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly"))return suppressKeyPress=!0,suppressInput=!0,void(suppressKeyPressRepeat=!0);suppressKeyPress=!1,suppressInput=!1,suppressKeyPressRepeat=!1;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=!0,this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=!0,this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=!0,this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=!0,this._keyEvent("next",event);break;case keyCode.ENTER:this.menu.active&&(suppressKeyPress=!0,event.preventDefault(),this.menu.select(event));break;case keyCode.TAB:this.menu.active&&this.menu.select(event);break;case keyCode.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(event),event.preventDefault());break;default:suppressKeyPressRepeat=!0,this._searchTimeout(event)}},keypress:function(event){if(suppressKeyPress)return suppressKeyPress=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&event.preventDefault());if(!suppressKeyPressRepeat){var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event)}}},input:function(event){return suppressInput?(suppressInput=!1,void event.preventDefault()):void this._searchTimeout(event)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(event){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(event),void this._change(event))}}),this._initSource(),this.menu=$("
    ").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(event){event.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var menuElement=this.menu.element[0];$(event.target).closest(".ui-menu-item").length||this._delay(function(){var that=this;this.document.one("mousedown",function(event){event.target===that.element[0]||event.target===menuElement||$.contains(menuElement,event.target)||that.close()})})},menufocus:function(event,ui){var label,item;return this.isNewMenu&&(this.isNewMenu=!1,event.originalEvent&&/^mouse/.test(event.originalEvent.type))?(this.menu.blur(),void this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent)})):(item=ui.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",event,{item:item})&&event.originalEvent&&/^key/.test(event.originalEvent.type)&&this._value(item.value),label=ui.item.attr("aria-label")||item.value,void(label&&$.trim(label).length&&(this.liveRegion.children().hide(),$("
    ").text(label).appendTo(this.liveRegion))))},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=previous,this._delay(function(){this.previous=previous,this.selectedItem=item})),!1!==this._trigger("select",event,{item:item})&&this._value(item.value),this.term=this._value(),this.close(event),this.selectedItem=item}}),this.liveRegion=$("",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(key,value){this._super(key,value),"source"===key&&this._initSource(),"appendTo"===key&&this.menu.element.appendTo(this._appendTo()),"disabled"===key&&value&&this.xhr&&this.xhr.abort()},_appendTo:function(){var element=this.options.appendTo;return element&&(element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0)),element&&element[0]||(element=this.element.closest(".ui-front")),element.length||(element=this.document[0].body),element},_initSource:function(){var array,url,that=this;$.isArray(this.options.source)?(array=this.options.source,this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term))}):"string"==typeof this.options.source?(url=this.options.source,this.source=function(request,response){that.xhr&&that.xhr.abort(),that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data)},error:function(){response([])}})}):this.source=this.options.source},_searchTimeout:function(event){clearTimeout(this.searching),this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;(!equalValues||equalValues&&!menuVisible&&!modifierKey)&&(this.selectedItem=null,this.search(null,event))},this.options.delay)},search:function(value,event){return value=null!=value?value:this._value(),this.term=this._value(),value.length").text(item.label).appendTo(ul)},_move:function(direction,event){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[direction](event):void this.search(null,event)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(keyEvent,event){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(keyEvent,event),event.preventDefault())}}),$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value)})}}),$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(content){var message;this._superApply(arguments),this.options.disabled||this.cancelSearch||(message=content&&content.length?this.options.messages.results(content.length):this.options.messages.noResults,this.liveRegion.children().hide(),$("
    ").text(message).appendTo(this.liveRegion))}});$.ui.autocomplete}),function($){var multipleSortableClass="ui-multisortable-multiple",dragStarted=!1,multiSort={};multiSort.isBelow=function(elm,compare){var elmOriginalPosition=elm.data("dragmultiple:originalPosition"),compareOriginalPosition=compare.data("dragmultiple:originalPosition");return elmOriginalPosition.top>compareOriginalPosition.top},multiSort.reset=function(elm){$(elm).removeClass("ui-sortable-helper").removeAttr("style").data("dragMultipleActive",!1)},multiSort.sort=function(current,positions){positions.after.reverse(),$.each(positions.after,function(){multiSort.reset(this),current.after(this)}),$.each(positions.before,function(){multiSort.reset(this),current.before(this)})},multiSort.sortPositions=function(elm,current){var insertAfter=[],insertBefore=[];return $(elm).find("."+multipleSortableClass).each(function(){var elm=$(this);elm[0]!==current[0]&¤t.hasClass(multipleSortableClass)&&(multiSort.isBelow(elm,current)?insertAfter.push(elm):insertBefore.push(elm))}),{after:insertAfter,before:insertBefore}},$.widget("ui.sortable",$.ui.sortable,{_mouseStart:function(){dragStarted=!1,this._superApply(arguments)},_createHelper:function(){var helper=this._superApply(arguments);return $(helper).hasClass(multipleSortableClass)&&$(this.element).find("."+multipleSortableClass).each(function(){$(this).data("dragmultiple:originalPosition",$(this).position()).data("dragMultipleActive",!0)}),helper},_mouseStop:function(event,ui){var current=this.helper,elms=[];current.hasClass(multipleSortableClass)&&(elms=$(this.element).find("."+multipleSortableClass)),elms.length||(elms=[current]);var positions=multiSort.sortPositions(this.element,current);this._superApply(arguments),this.element!==this.currentContainer.element?(multiSort.sort(current,positions),$(this.currentContainer.element).trigger("multiplesortreceive",{item:current,items:elms,source:this.element})):current.hasClass(multipleSortableClass)&&multiSort.sort(current,positions),$(this.element).trigger("multiplesortstop",{item:current,items:elms})},_mouseDrag:function(key,value){this._super(key,value);var current=this.helper;if(current.hasClass(multipleSortableClass)){var currentLeft=current.position().left,currentTop=current.position().top,currentZIndex=current.css("z-index"),currentPosition=current.css("position"),positions=multiSort.sortPositions(this.element,current);positions.before.reverse(),[{positions:positions.after,type:"after"},{positions:positions.before,type:"before"}].forEach(function(item){$.each(item.positions,function(index,elm){var top;top="after"===item.type?currentTop+(index+1)*current.outerHeight():currentTop-(index+1)*current.outerHeight(),elm.addClass("ui-sortable-helper").css({width:elm.outerWidth(),height:elm.outerHeight(),position:currentPosition,zIndex:currentZIndex,top:top,left:currentLeft})})}),dragStarted||(dragStarted=!0,this.refreshPositions())}}})}(jQuery),!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery),function(){function nextUid(){return++uid}function hashKey(obj,nextUidFn){var key=obj&&obj.$$hashKey;if(key)return"function"==typeof key&&(key=obj.$$hashKey()),key;var objType=typeof obj;return key="function"==objType||"object"==objType&&null!==obj?obj.$$hashKey=objType+":"+(nextUidFn||nextUid)():objType+":"+obj}function createMap(){return Object.create(null)}function isArrayLike(obj){if(null==obj||isWindow(obj))return!1;var length=obj.length;return obj.nodeType===NODE_TYPE_ELEMENT&&length?!0:angular.isString(obj)||angular.isArray(obj)||0===length||"number"==typeof length&&length>0&&length-1 in obj}function isWindow(obj){return obj&&obj.window===obj}function getBlockNodes(nodes){var node=nodes[0],endNode=nodes[nodes.length-1],blockNodes=[node];do{if(node=node.nextSibling,!node)break;blockNodes.push(node)}while(node!==endNode);return jqLite(blockNodes)}var NODE_TYPE_ELEMENT=1,uid=0,jqLite=(Array.isArray,$),ngRepeatDirective=["$parse","$animate",function($parse,$animate){var NG_REMOVED="$$NG_REMOVED",ngRepeatMinErr=angular.$$minErr("ngRepeat"),updateScope=function(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){scope[valueIdentifier]=value,keyIdentifier&&(scope[keyIdentifier]=key),scope.$index=index,scope.$first=0===index,scope.$last=index===arrayLength-1,scope.$middle=!(scope.$first||scope.$last),scope.$odd=!(scope.$even=0===(1&index))},getBlockStart=function(block){return block.clone[0]},getBlockEnd=function(block){return block.clone[block.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function($element,$attr){var expression=$attr.tgRepeat,ngRepeatEndComment=document.createComment(" end ngRepeat: "+expression+" "),match=expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!match)throw ngRepeatMinErr("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",expression);var lhs=match[1],rhs=match[2],aliasAs=match[3],trackByExp=match[4];if(match=lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!match)throw ngRepeatMinErr("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",lhs);var valueIdentifier=match[3]||match[1],keyIdentifier=match[2];if(aliasAs&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs)))throw ngRepeatMinErr("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",aliasAs);var trackByExpGetter,trackByIdExpFn,trackByIdArrayFn,trackByIdObjFn,hashFnLocals={$id:hashKey};return trackByExp?trackByExpGetter=$parse(trackByExp):(trackByIdArrayFn=function(key,value){return hashKey(value)},trackByIdObjFn=function(key){return key}),function($scope,$element,$attr,ctrl,$transclude){ trackByExpGetter&&(trackByIdExpFn=function(key,value,index){return keyIdentifier&&(hashFnLocals[keyIdentifier]=key),hashFnLocals[valueIdentifier]=value,hashFnLocals.$index=index,trackByExpGetter($scope,hashFnLocals)});var lastBlockMap=createMap();$scope.$watch(rhs,function(immutable_collection){var collection=[];immutable_collection&&immutable_collection.toJS&&(collection=immutable_collection.toJS());var index,length,nextNode,collectionLength,key,value,trackById,trackByIdFn,collectionKeys,block,nextBlockOrder,elementsToRemove,previousNode=$element[0],nextBlockMap=createMap();if(aliasAs&&($scope[aliasAs]=immutable_collection),isArrayLike(collection))collectionKeys=collection,trackByIdFn=trackByIdExpFn||trackByIdArrayFn;else{trackByIdFn=trackByIdExpFn||trackByIdObjFn,collectionKeys=[];for(var itemKey in collection)collection.hasOwnProperty(itemKey)&&"$"!==itemKey.charAt(0)&&collectionKeys.push(itemKey)}for(collectionLength=collectionKeys.length,nextBlockOrder=new Array(collectionLength),index=0;collectionLength>index;index++)if(key=collection===collectionKeys?index:collectionKeys[index],value=collection[key],immutable_value=immutable_collection.get(key),trackById=trackByIdFn(key,immutable_value,index),lastBlockMap[trackById])block=lastBlockMap[trackById],delete lastBlockMap[trackById],nextBlockMap[trackById]=block,nextBlockOrder[index]=block;else{if(nextBlockMap[trackById])throw nextBlockOrder.forEach(function(block){block&&block.scope&&(lastBlockMap[block.id]=block)}),ngRepeatMinErr("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",expression,trackById,value);nextBlockOrder[index]={id:trackById,scope:void 0,clone:void 0},nextBlockMap[trackById]=!0}for(var blockKey in lastBlockMap){if(block=lastBlockMap[blockKey],elementsToRemove=getBlockNodes(block.clone),$animate.leave(elementsToRemove),elementsToRemove[0].parentNode)for(index=0,length=elementsToRemove.length;length>index;index++)elementsToRemove[index][NG_REMOVED]=!0;block.scope.$destroy()}for(index=0;collectionLength>index;index++)if(key=collection===collectionKeys?index:collectionKeys[index],value=collection[key],immutable_value=immutable_collection.get(key),block=nextBlockOrder[index],block.scope){nextNode=previousNode;do nextNode=nextNode.nextSibling;while(nextNode&&nextNode[NG_REMOVED]);getBlockStart(block)!=nextNode&&$animate.move(getBlockNodes(block.clone),null,jqLite(previousNode)),previousNode=getBlockEnd(block),updateScope(block.scope,index,valueIdentifier,immutable_value,keyIdentifier,key,collectionLength)}else $transclude(function(clone,scope){block.scope=scope;var endNode=ngRepeatEndComment.cloneNode(!1);clone[clone.length++]=endNode,$animate.enter(clone,null,jqLite(previousNode)),previousNode=endNode,block.clone=clone,nextBlockMap[block.id]=block,updateScope(block.scope,index,valueIdentifier,immutable_value,keyIdentifier,key,collectionLength)});lastBlockMap=nextBlockMap})}}}}];angular.module("tgRepeat",[]).directive("tgRepeat",ngRepeatDirective)}();var hexcase=0,b64pad="",chrsz=8; //# sourceMappingURL=maps/libs.js.map