").append(element).html();try{return element[0].nodeType===NODE_TYPE_TEXT?lowercase(elemHtml):elemHtml.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(match,nodeName){return"<"+lowercase(nodeName)})}catch(e){return lowercase(elemHtml)}}function tryDecodeURIComponent(value){try{return decodeURIComponent(value)}catch(e){}}function parseKeyValue(keyValue){var obj={};return forEach((keyValue||"").split("&"),function(keyValue){var splitPoint,key,val;keyValue&&(key=keyValue=keyValue.replace(/\+/g,"%20"),splitPoint=keyValue.indexOf("="),splitPoint!==-1&&(key=keyValue.substring(0,splitPoint),val=keyValue.substring(splitPoint+1)),key=tryDecodeURIComponent(key),isDefined(key)&&(val=!isDefined(val)||tryDecodeURIComponent(val),hasOwnProperty.call(obj,key)?isArray(obj[key])?obj[key].push(val):obj[key]=[obj[key],val]:obj[key]=val))}),obj}function toKeyValue(obj){var parts=[];return forEach(obj,function(value,key){isArray(value)?forEach(value,function(arrayValue){parts.push(encodeUriQuery(key,!0)+(arrayValue===!0?"":"="+encodeUriQuery(arrayValue,!0)))}):parts.push(encodeUriQuery(key,!0)+(value===!0?"":"="+encodeUriQuery(value,!0)))}),parts.length?parts.join("&"):""}function encodeUriSegment(val){return encodeUriQuery(val,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,pctEncodeSpaces?"%20":"+")}function getNgAttribute(element,ngAttr){var attr,i,ii=ngAttrPrefixes.length;for(i=0;i
/,">"))}modules=modules||[],modules.unshift(["$provide",function($provide){$provide.value("$rootElement",element)}]),config.debugInfoEnabled&&modules.push(["$compileProvider",function($compileProvider){$compileProvider.debugInfoEnabled(!0)}]),modules.unshift("ng");var injector=createInjector(modules,config.strictDi);return injector.invoke(["$rootScope","$rootElement","$compile","$injector",function(scope,element,compile,injector){scope.$apply(function(){element.data("$injector",injector),compile(element)(scope)})}]),injector},NG_ENABLE_DEBUG_INFO=/^NG_ENABLE_DEBUG_INFO!/,NG_DEFER_BOOTSTRAP=/^NG_DEFER_BOOTSTRAP!/;return window&&NG_ENABLE_DEBUG_INFO.test(window.name)&&(config.debugInfoEnabled=!0,window.name=window.name.replace(NG_ENABLE_DEBUG_INFO,"")),window&&!NG_DEFER_BOOTSTRAP.test(window.name)?doBootstrap():(window.name=window.name.replace(NG_DEFER_BOOTSTRAP,""),angular.resumeBootstrap=function(extraModules){return forEach(extraModules,function(module){modules.push(module)}),doBootstrap()},void(isFunction(angular.resumeDeferredBootstrap)&&angular.resumeDeferredBootstrap()))}function reloadWithDebugInfo(){window.name="NG_ENABLE_DEBUG_INFO!"+window.name,window.location.reload()}function getTestability(rootElement){var injector=angular.element(rootElement).injector();if(!injector)throw ngMinErr("test","no injector found for element argument to getTestability");return injector.get("$$testability")}function snake_case(name,separator){return separator=separator||"_",name.replace(SNAKE_CASE_REGEXP,function(letter,pos){return(pos?separator:"")+letter.toLowerCase()})}function bindJQuery(){var originalCleanData;if(!bindJQueryFired){var jqName=jq();jQuery=isUndefined(jqName)?window.jQuery:jqName?window[jqName]:void 0,jQuery&&jQuery.fn.on?(jqLite=jQuery,extend(jQuery.fn,{scope:JQLitePrototype.scope,isolateScope:JQLitePrototype.isolateScope,controller:JQLitePrototype.controller,injector:JQLitePrototype.injector,inheritedData:JQLitePrototype.inheritedData}),originalCleanData=jQuery.cleanData,jQuery.cleanData=function(elems){for(var events,elem,i=0;null!=(elem=elems[i]);i++)events=jQuery._data(elem,"events"),events&&events.$destroy&&jQuery(elem).triggerHandler("$destroy");originalCleanData(elems)}):jqLite=JQLite,angular.element=jqLite,bindJQueryFired=!0}}function assertArg(arg,name,reason){if(!arg)throw ngMinErr("areq","Argument '{0}' is {1}",name||"?",reason||"required");return arg}function assertArgFn(arg,name,acceptArrayAnnotation){return acceptArrayAnnotation&&isArray(arg)&&(arg=arg[arg.length-1]),assertArg(isFunction(arg),name,"not a function, got "+(arg&&"object"==typeof arg?arg.constructor.name||"Object":typeof arg)),arg}function assertNotHasOwnProperty(name,context){if("hasOwnProperty"===name)throw ngMinErr("badname","hasOwnProperty is not a valid {0} name",context)}function getter(obj,path,bindFnToScope){if(!path)return obj;for(var key,keys=path.split("."),lastInstance=obj,len=keys.length,i=0;i
=0)return"...";seen.push(val)}return val})}function toDebugString(obj){return"function"==typeof obj?obj.toString().replace(/ \{[\s\S]*$/,""):isUndefined(obj)?"undefined":"string"!=typeof obj?serializeObject(obj):obj}function publishExternalAPI(angular){extend(angular,{bootstrap:bootstrap,copy:copy,extend:extend,merge:merge,equals:equals,element:jqLite,forEach:forEach,injector:createInjector,noop:noop,bind:bind,toJson:toJson,fromJson:fromJson,identity:identity,isUndefined:isUndefined,isDefined:isDefined,isString:isString,isFunction:isFunction,isObject:isObject,isNumber:isNumber,isElement:isElement,isArray:isArray,version:version,isDate:isDate,lowercase:lowercase,uppercase:uppercase,callbacks:{$$counter:0},getTestability:getTestability,$$minErr:minErr,$$csp:csp,reloadWithDebugInfo:reloadWithDebugInfo}),(angularModule=setupModuleLoader(window))("ng",["ngLocale"],["$provide",function($provide){$provide.provider({$$sanitizeUri:$$SanitizeUriProvider}),$provide.provider("$compile",$CompileProvider).directive({a:htmlAnchorDirective,input:inputDirective,textarea:inputDirective,form:formDirective,script:scriptDirective,select:selectDirective,style:styleDirective,option:optionDirective,ngBind:ngBindDirective,ngBindHtml:ngBindHtmlDirective,ngBindTemplate:ngBindTemplateDirective,ngClass:ngClassDirective,ngClassEven:ngClassEvenDirective,ngClassOdd:ngClassOddDirective,ngCloak:ngCloakDirective,ngController:ngControllerDirective,ngForm:ngFormDirective,ngHide:ngHideDirective,ngIf:ngIfDirective,ngInclude:ngIncludeDirective,ngInit:ngInitDirective,ngNonBindable:ngNonBindableDirective,ngPluralize:ngPluralizeDirective,ngRepeat:ngRepeatDirective,ngShow:ngShowDirective,ngStyle:ngStyleDirective,ngSwitch:ngSwitchDirective,ngSwitchWhen:ngSwitchWhenDirective,ngSwitchDefault:ngSwitchDefaultDirective,ngOptions:ngOptionsDirective,ngTransclude:ngTranscludeDirective,ngModel:ngModelDirective,ngList:ngListDirective,ngChange:ngChangeDirective,pattern:patternDirective,ngPattern:patternDirective,required:requiredDirective,ngRequired:requiredDirective,minlength:minlengthDirective,ngMinlength:minlengthDirective,maxlength:maxlengthDirective,ngMaxlength:maxlengthDirective,ngValue:ngValueDirective,ngModelOptions:ngModelOptionsDirective}).directive({ngInclude:ngIncludeFillContentDirective}).directive(ngAttributeAliasDirectives).directive(ngEventDirectives),$provide.provider({$anchorScroll:$AnchorScrollProvider,$animate:$AnimateProvider,$animateCss:$CoreAnimateCssProvider,$$animateJs:$$CoreAnimateJsProvider,$$animateQueue:$$CoreAnimateQueueProvider,$$AnimateRunner:$$AnimateRunnerFactoryProvider,$$animateAsyncRun:$$AnimateAsyncRunFactoryProvider,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$$forceReflow:$$ForceReflowProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$http:$HttpProvider,$httpParamSerializer:$HttpParamSerializerProvider,$httpParamSerializerJQLike:$HttpParamSerializerJQLikeProvider,$httpBackend:$HttpBackendProvider,$xhrFactory:$xhrFactoryProvider,$jsonpCallbacks:$jsonpCallbacksProvider,$location:$LocationProvider,$log:$LogProvider,$parse:$ParseProvider,$rootScope:$RootScopeProvider,$q:$QProvider,$$q:$$QProvider,$sce:$SceProvider,$sceDelegate:$SceDelegateProvider,$sniffer:$SnifferProvider,$templateCache:$TemplateCacheProvider,$templateRequest:$TemplateRequestProvider,$$testability:$$TestabilityProvider,$timeout:$TimeoutProvider,$window:$WindowProvider,$$rAF:$$RAFProvider,$$jqLite:$$jqLiteProvider,$$HashMap:$$HashMapProvider,$$cookieReader:$$CookieReaderProvider})}])}function jqNextId(){return++jqId}function camelCase(name){return name.replace(SPECIAL_CHARS_REGEXP,function(_,separator,letter,offset){return offset?letter.toUpperCase():letter}).replace(MOZ_HACK_REGEXP,"Moz$1")}function jqLiteIsTextNode(html){return!HTML_REGEXP.test(html)}function jqLiteAcceptsData(node){var nodeType=node.nodeType;return nodeType===NODE_TYPE_ELEMENT||!nodeType||nodeType===NODE_TYPE_DOCUMENT}function jqLiteHasData(node){for(var key in jqCache[node.ng339])return!0;return!1}function jqLiteCleanData(nodes){for(var i=0,ii=nodes.length;i$2>")+wrap[2],i=wrap[0];i--;)tmp=tmp.lastChild;nodes=concat(nodes,tmp.childNodes),tmp=fragment.firstChild,tmp.textContent=""}return fragment.textContent="",fragment.innerHTML="",forEach(nodes,function(node){fragment.appendChild(node)}),fragment}function jqLiteParseHTML(html,context){context=context||window.document;var parsed;return(parsed=SINGLE_TAG_REGEXP.exec(html))?[context.createElement(parsed[1])]:(parsed=jqLiteBuildFragment(html,context))?parsed.childNodes:[]}function jqLiteWrapNode(node,wrapper){var parent=node.parentNode;parent&&parent.replaceChild(wrapper,node),wrapper.appendChild(node)}function JQLite(element){if(element instanceof JQLite)return element;var argIsString;if(isString(element)&&(element=trim(element),argIsString=!0),!(this instanceof JQLite)){if(argIsString&&"<"!=element.charAt(0))throw jqLiteMinErr("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new JQLite(element)}argIsString?jqLiteAddNodes(this,jqLiteParseHTML(element)):jqLiteAddNodes(this,element)}function jqLiteClone(element){return element.cloneNode(!0)}function jqLiteDealoc(element,onlyDescendants){if(onlyDescendants||jqLiteRemoveData(element),element.querySelectorAll)for(var descendants=element.querySelectorAll("*"),i=0,l=descendants.length;i0||(removeEventListenerFn(element,type,handle),delete events[type])};forEach(type.split(" "),function(type){removeHandler(type),MOUSE_EVENT_MAP[type]&&removeHandler(MOUSE_EVENT_MAP[type])})}else for(type in events)"$destroy"!==type&&removeEventListenerFn(element,type,handle),delete events[type]}function jqLiteRemoveData(element,name){var expandoId=element.ng339,expandoStore=expandoId&&jqCache[expandoId];if(expandoStore){if(name)return void delete expandoStore.data[name];expandoStore.handle&&(expandoStore.events.$destroy&&expandoStore.handle({},"$destroy"),jqLiteOff(element)),delete jqCache[expandoId],element.ng339=void 0}}function jqLiteExpandoStore(element,createIfNecessary){var expandoId=element.ng339,expandoStore=expandoId&&jqCache[expandoId];return createIfNecessary&&!expandoStore&&(element.ng339=expandoId=jqNextId(),expandoStore=jqCache[expandoId]={events:{},data:{},handle:void 0}),expandoStore}function jqLiteData(element,key,value){if(jqLiteAcceptsData(element)){var isSimpleSetter=isDefined(value),isSimpleGetter=!isSimpleSetter&&key&&!isObject(key),massGetter=!key,expandoStore=jqLiteExpandoStore(element,!isSimpleGetter),data=expandoStore&&expandoStore.data;if(isSimpleSetter)data[key]=value;else{if(massGetter)return data;if(isSimpleGetter)return data&&data[key];extend(data,key)}}}function jqLiteHasClass(element,selector){return!!element.getAttribute&&(" "+(element.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+selector+" ")>-1}function jqLiteRemoveClass(element,cssClasses){cssClasses&&element.setAttribute&&forEach(cssClasses.split(" "),function(cssClass){element.setAttribute("class",trim((" "+(element.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+trim(cssClass)+" "," ")))})}function jqLiteAddClass(element,cssClasses){if(cssClasses&&element.setAttribute){var existingClasses=(" "+(element.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");forEach(cssClasses.split(" "),function(cssClass){cssClass=trim(cssClass),existingClasses.indexOf(" "+cssClass+" ")===-1&&(existingClasses+=cssClass+" ")}),element.setAttribute("class",trim(existingClasses))}}function jqLiteAddNodes(root,elements){if(elements)if(elements.nodeType)root[root.length++]=elements;else{var length=elements.length;if("number"==typeof length&&elements.window!==elements){if(length)for(var i=0;i1&&(eventFns=shallowCopy(eventFns));for(var i=0;icapacity&&this.remove(staleEnd.key),value}},get:function(key){if(capacity";var attributes=specialAttrHolder.firstChild.attributes,attribute=attributes[0];attributes.removeNamedItem(attribute.name),attribute.value=value,element.attributes.setNamedItem(attribute)}function safeAddClass($element,className){try{$element.addClass(className)}catch(e){}}function compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext){$compileNodes instanceof jqLite||($compileNodes=jqLite($compileNodes));for(var NOT_EMPTY=/\S+/,i=0,len=$compileNodes.length;i").append($compileNodes).html())):cloneConnectFn?JQLitePrototype.clone.call($compileNodes):$compileNodes,transcludeControllers)for(var controllerName in transcludeControllers)$linkNode.data("$"+controllerName+"Controller",transcludeControllers[controllerName].instance);return compile.$$addScopeInfo($linkNode,scope),cloneConnectFn&&cloneConnectFn($linkNode,scope),compositeLinkFn&&compositeLinkFn(scope,$linkNode,$linkNode,parentBoundTranscludeFn),$linkNode}}function detectNamespaceForChildElements(parentElement){var node=parentElement&&parentElement[0];return node&&"foreignobject"!==nodeName_(node)&&toString.call(node).match(/SVG/)?"svg":"html"}function compileNodes(nodeList,transcludeFn,$rootElement,maxPriority,ignoreDirective,previousCompileContext){function compositeLinkFn(scope,nodeList,$rootElement,parentBoundTranscludeFn){var nodeLinkFn,childLinkFn,node,childScope,i,ii,idx,childBoundTranscludeFn,stableNodeList;if(nodeLinkFnFound){var nodeListLength=nodeList.length;for(stableNodeList=new Array(nodeListLength),i=0;i0)}else nodes.push(node);return jqLite(nodes)}function groupElementsLinkFnWrapper(linkFn,attrStart,attrEnd){return function(scope,element,attrs,controllers,transcludeFn){return element=groupScan(element[0],attrStart,attrEnd),linkFn(scope,element,attrs,controllers,transcludeFn)}}function compilationGenerator(eager,$compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext){var compiled;return eager?compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext):function(){return compiled||(compiled=compile($compileNodes,transcludeFn,maxPriority,ignoreDirective,previousCompileContext),$compileNodes=transcludeFn=previousCompileContext=null),compiled.apply(this,arguments)}}function applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){function addLinkFns(pre,post,attrStart,attrEnd){pre&&(attrStart&&(pre=groupElementsLinkFnWrapper(pre,attrStart,attrEnd)),pre.require=directive.require,pre.directiveName=directiveName,(newIsolateScopeDirective===directive||directive.$$isolateScope)&&(pre=cloneAndAnnotateFn(pre,{isolateScope:!0})),preLinkFns.push(pre)),post&&(attrStart&&(post=groupElementsLinkFnWrapper(post,attrStart,attrEnd)),post.require=directive.require,post.directiveName=directiveName,(newIsolateScopeDirective===directive||directive.$$isolateScope)&&(post=cloneAndAnnotateFn(post,{isolateScope:!0})),postLinkFns.push(post))}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn){function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement,slotName){var transcludeControllers;if(isScope(scope)||(slotName=futureParentElement,futureParentElement=cloneAttachFn,cloneAttachFn=scope,scope=void 0),hasElementTranscludeDirective&&(transcludeControllers=elementControllers),futureParentElement||(futureParentElement=hasElementTranscludeDirective?$element.parent():$element),!slotName)return boundTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);var slotTranscludeFn=boundTranscludeFn.$$slots[slotName];if(slotTranscludeFn)return slotTranscludeFn(scope,cloneAttachFn,transcludeControllers,futureParentElement,scopeToChild);if(isUndefined(slotTranscludeFn))throw $compileMinErr("noslot",'No parent directive that requires a transclusion with slot name "{0}". Element: {1}',slotName,startingTag($element))}var i,ii,linkFn,isolateScope,controllerScope,elementControllers,transcludeFn,$element,attrs,scopeBindingInfo;compileNode===linkNode?(attrs=templateAttrs,$element=templateAttrs.$$element):($element=jqLite(linkNode),attrs=new Attributes($element,templateAttrs)),controllerScope=scope,newIsolateScopeDirective?isolateScope=scope.$new(!0):newScopeDirective&&(controllerScope=scope.$parent),boundTranscludeFn&&(transcludeFn=controllersBoundTransclude,transcludeFn.$$boundTransclude=boundTranscludeFn,transcludeFn.isSlotFilled=function(slotName){return!!boundTranscludeFn.$$slots[slotName]}),controllerDirectives&&(elementControllers=setupControllers($element,attrs,transcludeFn,controllerDirectives,isolateScope,scope,newIsolateScopeDirective)),newIsolateScopeDirective&&(compile.$$addScopeInfo($element,isolateScope,!0,!(templateDirective&&(templateDirective===newIsolateScopeDirective||templateDirective===newIsolateScopeDirective.$$originalDirective))),compile.$$addScopeClass($element,!0),isolateScope.$$isolateBindings=newIsolateScopeDirective.$$isolateBindings,scopeBindingInfo=initializeDirectiveBindings(scope,attrs,isolateScope,isolateScope.$$isolateBindings,newIsolateScopeDirective),scopeBindingInfo.removeWatches&&isolateScope.$on("$destroy",scopeBindingInfo.removeWatches));for(var name in elementControllers){var controllerDirective=controllerDirectives[name],controller=elementControllers[name],bindings=controllerDirective.$$bindings.bindToController;controller.identifier&&bindings?controller.bindingInfo=initializeDirectiveBindings(controllerScope,attrs,controller.instance,bindings,controllerDirective):controller.bindingInfo={};var controllerResult=controller();controllerResult!==controller.instance&&(controller.instance=controllerResult,$element.data("$"+controllerDirective.name+"Controller",controllerResult),controller.bindingInfo.removeWatches&&controller.bindingInfo.removeWatches(),controller.bindingInfo=initializeDirectiveBindings(controllerScope,attrs,controller.instance,bindings,controllerDirective))}for(forEach(controllerDirectives,function(controllerDirective,name){var require=controllerDirective.require;controllerDirective.bindToController&&!isArray(require)&&isObject(require)&&extend(elementControllers[name].instance,getControllers(name,require,$element,elementControllers))}),forEach(elementControllers,function(controller){var controllerInstance=controller.instance;if(isFunction(controllerInstance.$onChanges))try{controllerInstance.$onChanges(controller.bindingInfo.initialChanges)}catch(e){$exceptionHandler(e)}if(isFunction(controllerInstance.$onInit))try{controllerInstance.$onInit()}catch(e){$exceptionHandler(e)}isFunction(controllerInstance.$doCheck)&&(controllerScope.$watch(function(){controllerInstance.$doCheck()}),controllerInstance.$doCheck()),isFunction(controllerInstance.$onDestroy)&&controllerScope.$on("$destroy",function(){controllerInstance.$onDestroy()})}),i=0,ii=preLinkFns.length;i=0;i--)linkFn=postLinkFns[i],invokeLinkFn(linkFn,linkFn.isolateScope?isolateScope:scope,$element,attrs,linkFn.require&&getControllers(linkFn.directiveName,linkFn.require,$element,elementControllers),transcludeFn);forEach(elementControllers,function(controller){var controllerInstance=controller.instance;isFunction(controllerInstance.$postLink)&&controllerInstance.$postLink()})}previousCompileContext=previousCompileContext||{};for(var directive,directiveName,$template,linkFn,directiveValue,terminalPriority=-Number.MAX_VALUE,newScopeDirective=previousCompileContext.newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,newIsolateScopeDirective=previousCompileContext.newIsolateScopeDirective,templateDirective=previousCompileContext.templateDirective,nonTlbTranscludeDirective=previousCompileContext.nonTlbTranscludeDirective,hasTranscludeDirective=!1,hasTemplate=!1,hasElementTranscludeDirective=previousCompileContext.hasElementTranscludeDirective,$compileNode=templateAttrs.$$element=jqLite(compileNode),replaceDirective=originalReplaceDirective,childTranscludeFn=transcludeFn,didScanForMultipleTransclusion=!1,mightHaveMultipleTransclusionError=!1,i=0,ii=directives.length;idirective.priority)break;if((directiveValue=directive.scope)&&(directive.templateUrl||(isObject(directiveValue)?(assertNoDuplicate("new/isolated scope",newIsolateScopeDirective||newScopeDirective,directive,$compileNode),newIsolateScopeDirective=directive):assertNoDuplicate("new/isolated scope",newIsolateScopeDirective,directive,$compileNode)),newScopeDirective=newScopeDirective||directive),directiveName=directive.name,!didScanForMultipleTransclusion&&(directive.replace&&(directive.templateUrl||directive.template)||directive.transclude&&!directive.$$tlb)){for(var candidateDirective,scanningIndex=i+1;candidateDirective=directives[scanningIndex++];)if(candidateDirective.transclude&&!candidateDirective.$$tlb||candidateDirective.replace&&(candidateDirective.templateUrl||candidateDirective.template)){mightHaveMultipleTransclusionError=!0;break}didScanForMultipleTransclusion=!0}if(!directive.templateUrl&&directive.controller&&(directiveValue=directive.controller,controllerDirectives=controllerDirectives||createMap(),assertNoDuplicate("'"+directiveName+"' controller",controllerDirectives[directiveName],directive,$compileNode),controllerDirectives[directiveName]=directive),directiveValue=directive.transclude)if(hasTranscludeDirective=!0,directive.$$tlb||(assertNoDuplicate("transclusion",nonTlbTranscludeDirective,directive,$compileNode),nonTlbTranscludeDirective=directive),"element"==directiveValue)hasElementTranscludeDirective=!0,terminalPriority=directive.priority,$template=$compileNode,$compileNode=templateAttrs.$$element=jqLite(compile.$$createComment(directiveName,templateAttrs[directiveName])),compileNode=$compileNode[0],replaceWith(jqCollection,sliceArgs($template),compileNode),$template[0].$$parentNode=$template[0].parentNode,childTranscludeFn=compilationGenerator(mightHaveMultipleTransclusionError,$template,transcludeFn,terminalPriority,replaceDirective&&replaceDirective.name,{nonTlbTranscludeDirective:nonTlbTranscludeDirective});else{var slots=createMap();if($template=jqLite(jqLiteClone(compileNode)).contents(),isObject(directiveValue)){$template=[];var slotMap=createMap(),filledSlots=createMap();forEach(directiveValue,function(elementSelector,slotName){var optional="?"===elementSelector.charAt(0);elementSelector=optional?elementSelector.substring(1):elementSelector,slotMap[elementSelector]=slotName,slots[slotName]=null,filledSlots[slotName]=optional}),forEach($compileNode.contents(),function(node){var slotName=slotMap[directiveNormalize(nodeName_(node))];slotName?(filledSlots[slotName]=!0,slots[slotName]=slots[slotName]||[],slots[slotName].push(node)):$template.push(node)}),forEach(filledSlots,function(filled,slotName){if(!filled)throw $compileMinErr("reqslot","Required transclusion slot `{0}` was not filled.",slotName)});for(var slotName in slots)slots[slotName]&&(slots[slotName]=compilationGenerator(mightHaveMultipleTransclusionError,slots[slotName],transcludeFn))}$compileNode.empty(),childTranscludeFn=compilationGenerator(mightHaveMultipleTransclusionError,$template,transcludeFn,void 0,void 0,{needsNewScope:directive.$$isolateScope||directive.$$newScope}),childTranscludeFn.$$slots=slots}if(directive.template)if(hasTemplate=!0,assertNoDuplicate("template",templateDirective,directive,$compileNode),templateDirective=directive,directiveValue=isFunction(directive.template)?directive.template($compileNode,templateAttrs):directive.template,directiveValue=denormalizeTemplate(directiveValue),directive.replace){if(replaceDirective=directive,$template=jqLiteIsTextNode(directiveValue)?[]:removeComments(wrapTemplate(directive.templateNamespace,trim(directiveValue))),compileNode=$template[0],1!=$template.length||compileNode.nodeType!==NODE_TYPE_ELEMENT)throw $compileMinErr("tplrt","Template for directive '{0}' must have exactly one root element. {1}",directiveName,"");replaceWith(jqCollection,$compileNode,compileNode);var newTemplateAttrs={$attr:{}},templateDirectives=collectDirectives(compileNode,[],newTemplateAttrs),unprocessedDirectives=directives.splice(i+1,directives.length-(i+1));(newIsolateScopeDirective||newScopeDirective)&&markDirectiveScope(templateDirectives,newIsolateScopeDirective,newScopeDirective),directives=directives.concat(templateDirectives).concat(unprocessedDirectives),mergeTemplateAttributes(templateAttrs,newTemplateAttrs),ii=directives.length}else $compileNode.html(directiveValue);if(directive.templateUrl)hasTemplate=!0,assertNoDuplicate("template",templateDirective,directive,$compileNode),templateDirective=directive,directive.replace&&(replaceDirective=directive),nodeLinkFn=compileTemplateUrl(directives.splice(i,directives.length-i),$compileNode,templateAttrs,jqCollection,hasTranscludeDirective&&childTranscludeFn,preLinkFns,postLinkFns,{controllerDirectives:controllerDirectives,newScopeDirective:newScopeDirective!==directive&&newScopeDirective,newIsolateScopeDirective:newIsolateScopeDirective,templateDirective:templateDirective,nonTlbTranscludeDirective:nonTlbTranscludeDirective}),ii=directives.length;else if(directive.compile)try{linkFn=directive.compile($compileNode,templateAttrs,childTranscludeFn);var context=directive.$$originalDirective||directive;isFunction(linkFn)?addLinkFns(null,bind(context,linkFn),attrStart,attrEnd):linkFn&&addLinkFns(bind(context,linkFn.pre),bind(context,linkFn.post),attrStart,attrEnd)}catch(e){$exceptionHandler(e,startingTag($compileNode))}directive.terminal&&(nodeLinkFn.terminal=!0,terminalPriority=Math.max(terminalPriority,directive.priority))}return nodeLinkFn.scope=newScopeDirective&&newScopeDirective.scope===!0,nodeLinkFn.transcludeOnThisElement=hasTranscludeDirective,nodeLinkFn.templateOnThisElement=hasTemplate,nodeLinkFn.transclude=childTranscludeFn,previousCompileContext.hasElementTranscludeDirective=hasElementTranscludeDirective,nodeLinkFn}function getControllers(directiveName,require,$element,elementControllers){var value;if(isString(require)){var match=require.match(REQUIRE_PREFIX_REGEXP),name=require.substring(match[0].length),inheritType=match[1]||match[3],optional="?"===match[2];if("^^"===inheritType?$element=$element.parent():(value=elementControllers&&elementControllers[name],value=value&&value.instance),!value){var dataName="$"+name+"Controller";value=inheritType?$element.inheritedData(dataName):$element.data(dataName)}if(!value&&!optional)throw $compileMinErr("ctreq","Controller '{0}', required by directive '{1}', can't be found!",name,directiveName)}else if(isArray(require)){value=[];for(var i=0,ii=require.length;idirective.priority)&&directive.restrict.indexOf(location)!=-1){if(startAttrName&&(directive=inherit(directive,{$$start:startAttrName,$$end:endAttrName})),!directive.$$bindings){var bindings=directive.$$bindings=parseDirectiveBindings(directive,directive.name);isObject(bindings.isolateScope)&&(directive.$$isolateBindings=bindings.isolateScope)}tDirectives.push(directive),match=directive}}catch(e){$exceptionHandler(e)}return match}function directiveIsMultiElement(name){if(hasDirectives.hasOwnProperty(name))for(var directive,directives=$injector.get(name+Suffix),i=0,ii=directives.length;i"+template+""+type+">",wrapper.childNodes[0].childNodes;default:return template}}function getTrustedContext(node,attrNormalizedName){if("srcdoc"==attrNormalizedName)return $sce.HTML;var tag=nodeName_(node);return"xlinkHref"==attrNormalizedName||"form"==tag&&"action"==attrNormalizedName||"img"!=tag&&("src"==attrNormalizedName||"ngSrc"==attrNormalizedName)?$sce.RESOURCE_URL:void 0}function addAttrInterpolateDirective(node,directives,value,name,allOrNothing){var trustedContext=getTrustedContext(node,name);allOrNothing=ALL_OR_NOTHING_ATTRS[name]||allOrNothing;var interpolateFn=$interpolate(value,!0,trustedContext,allOrNothing);if(interpolateFn){if("multiple"===name&&"select"===nodeName_(node))throw $compileMinErr("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",startingTag(node));directives.push({priority:100,compile:function(){return{pre:function(scope,element,attr){var $$observers=attr.$$observers||(attr.$$observers=createMap());if(EVENT_HANDLER_ATTR_REGEXP.test(name))throw $compileMinErr("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");var newValue=attr[name];newValue!==value&&(interpolateFn=newValue&&$interpolate(newValue,!0,trustedContext,allOrNothing),value=newValue),interpolateFn&&(attr[name]=interpolateFn(scope),($$observers[name]||($$observers[name]=[])).$$inter=!0,(attr.$$observers&&attr.$$observers[name].$$scope||scope).$watch(interpolateFn,function(newValue,oldValue){"class"===name&&newValue!=oldValue?attr.$updateClass(newValue,oldValue):attr.$set(name,newValue)}))}}}})}}function replaceWith($rootElement,elementsToRemove,newNode){var i,ii,firstElementToRemove=elementsToRemove[0],removeCount=elementsToRemove.length,parent=firstElementToRemove.parentNode;if($rootElement)for(i=0,ii=$rootElement.length;i0&&$animate.addClass(this.$$element,classVal)},$removeClass:function(classVal){classVal&&classVal.length>0&&$animate.removeClass(this.$$element,classVal)},$updateClass:function(newClasses,oldClasses){var toAdd=tokenDifference(newClasses,oldClasses);toAdd&&toAdd.length&&$animate.addClass(this.$$element,toAdd);var toRemove=tokenDifference(oldClasses,newClasses);toRemove&&toRemove.length&&$animate.removeClass(this.$$element,toRemove)},$set:function(key,value,writeAttr,attrName){var nodeName,node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(key),observer=key;if(booleanKey?(this.$$element.prop(key,value),attrName=booleanKey):aliasedKey&&(this[aliasedKey]=value,observer=aliasedKey),this[key]=value,attrName?this.$attr[key]=attrName:(attrName=this.$attr[key],attrName||(this.$attr[key]=attrName=snake_case(key,"-"))),nodeName=nodeName_(this.$$element),"a"===nodeName&&("href"===key||"xlinkHref"===key)||"img"===nodeName&&"src"===key)this[key]=value=$$sanitizeUri(value,"src"===key);else if("img"===nodeName&&"srcset"===key&&isDefined(value)){for(var result="",trimmedSrcset=trim(value),srcPattern=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,pattern=/\s/.test(trimmedSrcset)?srcPattern:/(,)/,rawUris=trimmedSrcset.split(pattern),nbrUrisWith2parts=Math.floor(rawUris.length/2),i=0;i0?" ":"")+token}return values}function removeComments(jqNodes){jqNodes=jqLite(jqNodes);var i=jqNodes.length;if(i<=1)return jqNodes;for(;i--;){var node=jqNodes[i];node.nodeType===NODE_TYPE_COMMENT&&splice.call(jqNodes,i,1)}return jqNodes}function identifierForController(controller,ident){if(ident&&isString(ident))return ident;if(isString(controller)){var match=CNTRL_REG.exec(controller);if(match)return match[3]}}function $ControllerProvider(){var controllers={},globals=!1;this.has=function(name){return controllers.hasOwnProperty(name)},this.register=function(name,constructor){assertNotHasOwnProperty(name,"controller"),isObject(name)?extend(controllers,name):controllers[name]=constructor},this.allowGlobals=function(){globals=!0},this.$get=["$injector","$window",function($injector,$window){function addIdentifier(locals,identifier,instance,name){if(!locals||!isObject(locals.$scope))throw minErr("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",name,identifier);locals.$scope[identifier]=instance}return function(expression,locals,later,ident){var instance,match,constructor,identifier;if(later=later===!0,ident&&isString(ident)&&(identifier=ident),isString(expression)){if(match=expression.match(CNTRL_REG),!match)throw $controllerMinErr("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",expression);constructor=match[1],identifier=identifier||match[3],expression=controllers.hasOwnProperty(constructor)?controllers[constructor]:getter(locals.$scope,constructor,!0)||(globals?getter($window,constructor,!0):void 0),assertArgFn(expression,constructor,!0)}if(later){var controllerPrototype=(isArray(expression)?expression[expression.length-1]:expression).prototype;instance=Object.create(controllerPrototype||null),identifier&&addIdentifier(locals,identifier,instance,constructor||expression.name);var instantiate;return instantiate=extend(function(){var result=$injector.invoke(expression,instance,locals,constructor);return result!==instance&&(isObject(result)||isFunction(result))&&(instance=result,identifier&&addIdentifier(locals,identifier,instance,constructor||expression.name)),instance},{instance:instance,identifier:identifier})}return instance=$injector.instantiate(expression,locals,constructor),identifier&&addIdentifier(locals,identifier,instance,constructor||expression.name),instance}}]}function $DocumentProvider(){this.$get=["$window",function(window){return jqLite(window.document)}]}function $ExceptionHandlerProvider(){this.$get=["$log",function($log){return function(exception,cause){$log.error.apply($log,arguments)}}]}function serializeValue(v){return isObject(v)?isDate(v)?v.toISOString():toJson(v):v}function $HttpParamSerializerProvider(){this.$get=function(){return function(params){if(!params)return"";var parts=[];return forEachSorted(params,function(value,key){null===value||isUndefined(value)||(isArray(value)?forEach(value,function(v){parts.push(encodeUriQuery(key)+"="+encodeUriQuery(serializeValue(v)))}):parts.push(encodeUriQuery(key)+"="+encodeUriQuery(serializeValue(value))))}),parts.join("&")}}}function $HttpParamSerializerJQLikeProvider(){this.$get=function(){return function(params){function serialize(toSerialize,prefix,topLevel){null===toSerialize||isUndefined(toSerialize)||(isArray(toSerialize)?forEach(toSerialize,function(value,index){serialize(value,prefix+"["+(isObject(value)?index:"")+"]")}):isObject(toSerialize)&&!isDate(toSerialize)?forEachSorted(toSerialize,function(value,key){serialize(value,prefix+(topLevel?"":"[")+key+(topLevel?"":"]"))}):parts.push(encodeUriQuery(prefix)+"="+encodeUriQuery(serializeValue(toSerialize))))}if(!params)return"";var parts=[];return serialize(params,"",!0),parts.join("&")}}}function defaultHttpResponseTransform(data,headers){if(isString(data)){var tempData=data.replace(JSON_PROTECTION_PREFIX,"").trim();if(tempData){var contentType=headers("Content-Type");(contentType&&0===contentType.indexOf(APPLICATION_JSON)||isJsonLike(tempData))&&(data=fromJson(tempData))}}return data}function isJsonLike(str){var jsonStart=str.match(JSON_START);return jsonStart&&JSON_ENDS[jsonStart[0]].test(str)}function parseHeaders(headers){function fillInParsed(key,val){key&&(parsed[key]=parsed[key]?parsed[key]+", "+val:val)}var i,parsed=createMap();return isString(headers)?forEach(headers.split("\n"),function(line){i=line.indexOf(":"),fillInParsed(lowercase(trim(line.substr(0,i))),trim(line.substr(i+1)))}):isObject(headers)&&forEach(headers,function(headerVal,headerKey){fillInParsed(lowercase(headerKey),trim(headerVal))}),parsed}function headersGetter(headers){var headersObj;return function(name){if(headersObj||(headersObj=parseHeaders(headers)),name){var value=headersObj[lowercase(name)];return void 0===value&&(value=null),value}return headersObj}}function transformData(data,headers,status,fns){return isFunction(fns)?fns(data,headers,status):(forEach(fns,function(fn){data=fn(data,headers,status)}),data)}function isSuccess(status){return 200<=status&&status<300}function $HttpProvider(){var defaults=this.defaults={transformResponse:[defaultHttpResponseTransform],transformRequest:[function(d){return!isObject(d)||isFile(d)||isBlob(d)||isFormData(d)?d:toJson(d)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:shallowCopy(CONTENT_TYPE_APPLICATION_JSON),put:shallowCopy(CONTENT_TYPE_APPLICATION_JSON),patch:shallowCopy(CONTENT_TYPE_APPLICATION_JSON)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},useApplyAsync=!1;this.useApplyAsync=function(value){return isDefined(value)?(useApplyAsync=!!value,this):useApplyAsync};var useLegacyPromise=!0;this.useLegacyPromiseExtensions=function(value){return isDefined(value)?(useLegacyPromise=!!value,this):useLegacyPromise};var interceptorFactories=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function($httpBackend,$$cookieReader,$cacheFactory,$rootScope,$q,$injector){function $http(requestConfig){function chainInterceptors(promise,interceptors){for(var i=0,ii=interceptors.length;i=-1?status:0,(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config,statusText:statusText})}function resolvePromiseWithResult(result){resolvePromise(result.data,result.status,shallowCopy(result.headers()),result.statusText)}function removePendingReq(){var idx=$http.pendingRequests.indexOf(config);idx!==-1&&$http.pendingRequests.splice(idx,1)}var cache,cachedResp,deferred=$q.defer(),promise=deferred.promise,reqHeaders=config.headers,url=buildUrl(config.url,config.paramSerializer(config.params));if($http.pendingRequests.push(config),promise.then(removePendingReq,removePendingReq),!config.cache&&!defaults.cache||config.cache===!1||"GET"!==config.method&&"JSONP"!==config.method||(cache=isObject(config.cache)?config.cache:isObject(defaults.cache)?defaults.cache:defaultCache),cache&&(cachedResp=cache.get(url),isDefined(cachedResp)?isPromiseLike(cachedResp)?cachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult):isArray(cachedResp)?resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]):resolvePromise(cachedResp,200,{},"OK"):cache.put(url,promise)),isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$$cookieReader()[config.xsrfCookieName||defaults.xsrfCookieName]:void 0;xsrfValue&&(reqHeaders[config.xsrfHeaderName||defaults.xsrfHeaderName]=xsrfValue),$httpBackend(config.method,url,reqData,done,reqHeaders,config.timeout,config.withCredentials,config.responseType,createApplyHandlers(config.eventHandlers),createApplyHandlers(config.uploadEventHandlers))}return promise}function buildUrl(url,serializedParams){return serializedParams.length>0&&(url+=(url.indexOf("?")==-1?"?":"&")+serializedParams),url}var defaultCache=$cacheFactory("$http");defaults.paramSerializer=isString(defaults.paramSerializer)?$injector.get(defaults.paramSerializer):defaults.paramSerializer;var reversedInterceptors=[];return forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory))}),$http.pendingRequests=[],createShortMethods("get","delete","head","jsonp"),createShortMethodsWithData("post","put","patch"),$http.defaults=defaults,$http}]}function $xhrFactoryProvider(){this.$get=function(){return function(){return new window.XMLHttpRequest}}}function $HttpBackendProvider(){this.$get=["$browser","$jsonpCallbacks","$document","$xhrFactory",function($browser,$jsonpCallbacks,$document,$xhrFactory){return createHttpBackend($browser,$xhrFactory,$browser.defer,$jsonpCallbacks,$document[0])}]}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){function jsonpReq(url,callbackPath,done){url=url.replace("JSON_CALLBACK",callbackPath);var script=rawDocument.createElement("script"),callback=null;return script.type="text/javascript",script.src=url,script.async=!0,callback=function(event){removeEventListenerFn(script,"load",callback),removeEventListenerFn(script,"error",callback),rawDocument.body.removeChild(script),script=null;var status=-1,text="unknown";event&&("load"!==event.type||callbacks.wasCalled(callbackPath)||(event={type:"error"}),text=event.type,status="error"===event.type?404:200),done&&done(status,text)},addEventListenerFn(script,"load",callback),addEventListenerFn(script,"error",callback),rawDocument.body.appendChild(script),callback}return function(method,url,post,callback,headers,timeout,withCredentials,responseType,eventHandlers,uploadEventHandlers){function timeoutRequest(){jsonpDone&&jsonpDone(),xhr&&xhr.abort()}function completeRequest(callback,status,response,headersString,statusText){isDefined(timeoutId)&&$browserDefer.cancel(timeoutId),jsonpDone=xhr=null,callback(status,response,headersString,statusText),$browser.$$completeOutstandingRequest(noop)}if($browser.$$incOutstandingRequestCount(),url=url||$browser.url(),"jsonp"===lowercase(method))var callbackPath=callbacks.createCallback(url),jsonpDone=jsonpReq(url,callbackPath,function(status,text){var response=200===status&&callbacks.getResponse(callbackPath);completeRequest(callback,status,response,"",text),callbacks.removeCallback(callbackPath)});else{var xhr=createXhr(method,url);xhr.open(method,url,!0),forEach(headers,function(value,key){isDefined(value)&&xhr.setRequestHeader(key,value)}),xhr.onload=function(){var statusText=xhr.statusText||"",response="response"in xhr?xhr.response:xhr.responseText,status=1223===xhr.status?204:xhr.status;0===status&&(status=response?200:"file"==urlResolve(url).protocol?404:0),completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText)};var requestError=function(){completeRequest(callback,-1,null,null,"")};if(xhr.onerror=requestError,xhr.onabort=requestError,forEach(eventHandlers,function(value,key){xhr.addEventListener(key,value)}),forEach(uploadEventHandlers,function(value,key){xhr.upload.addEventListener(key,value)}),withCredentials&&(xhr.withCredentials=!0),responseType)try{xhr.responseType=responseType}catch(e){if("json"!==responseType)throw e}xhr.send(isUndefined(post)?null:post)}if(timeout>0)var timeoutId=$browserDefer(timeoutRequest,timeout);else isPromiseLike(timeout)&&timeout.then(timeoutRequest)}}function $InterpolateProvider(){var startSymbol="{{",endSymbol="}}";this.startSymbol=function(value){return value?(startSymbol=value,this):startSymbol},this.endSymbol=function(value){return value?(endSymbol=value,this):endSymbol},this.$get=["$parse","$exceptionHandler","$sce",function($parse,$exceptionHandler,$sce){function escape(ch){return"\\\\\\"+ch}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol)}function stringify(value){if(null==value)return"";switch(typeof value){case"string":break;case"number":value=""+value;break;default:value=toJson(value)}return value}function constantWatchDelegate(scope,listener,objectEquality,constantInterp){var unwatch;return unwatch=scope.$watch(function(scope){return unwatch(),constantInterp(scope)},listener,objectEquality)}function $interpolate(text,mustHaveExpression,trustedContext,allOrNothing){function parseStringifyInterceptor(value){try{return value=getValue(value),allOrNothing&&!isDefined(value)?value:stringify(value)}catch(err){$exceptionHandler($interpolateMinErr.interr(text,err))}}if(!text.length||text.indexOf(startSymbol)===-1){var constantInterp;if(!mustHaveExpression){var unescapedText=unescapeText(text);constantInterp=valueFn(unescapedText),constantInterp.exp=text,constantInterp.expressions=[],constantInterp.$$watchDelegate=constantWatchDelegate}return constantInterp}allOrNothing=!!allOrNothing;for(var startIndex,endIndex,exp,index=0,expressions=[],parseFns=[],textLength=text.length,concat=[],expressionPositions=[];index1&&$interpolateMinErr.throwNoconcat(text),!mustHaveExpression||expressions.length){var compute=function(values){for(var i=0,ii=expressions.length;i4,args=hasParams?sliceArgs(arguments,4):[],setInterval=$window.setInterval,clearInterval=$window.clearInterval,iteration=0,skipApply=isDefined(invokeApply)&&!invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise;return count=isDefined(count)?count:0,promise.$$intervalId=setInterval(function(){skipApply?$browser.defer(callback):$rootScope.$evalAsync(callback),deferred.notify(iteration++),count>0&&iteration>=count&&(deferred.resolve(iteration),clearInterval(promise.$$intervalId),delete intervals[promise.$$intervalId]),skipApply||$rootScope.$apply()},delay),intervals[promise.$$intervalId]=deferred,promise}var intervals={};return interval.cancel=function(promise){return!!(promise&&promise.$$intervalId in intervals)&&(intervals[promise.$$intervalId].reject("canceled"),$window.clearInterval(promise.$$intervalId),delete intervals[promise.$$intervalId],!0)},interval}]}function encodePath(path){for(var segments=path.split("/"),i=segments.length;i--;)segments[i]=encodeUriSegment(segments[i]);return segments.join("/")}function parseAbsoluteUrl(absoluteUrl,locationObj){var parsedUrl=urlResolve(absoluteUrl);locationObj.$$protocol=parsedUrl.protocol,locationObj.$$host=parsedUrl.hostname,locationObj.$$port=toInt(parsedUrl.port)||DEFAULT_PORTS[parsedUrl.protocol]||null}function parseAppUrl(relativeUrl,locationObj){var prefixed="/"!==relativeUrl.charAt(0);prefixed&&(relativeUrl="/"+relativeUrl);var match=urlResolve(relativeUrl);locationObj.$$path=decodeURIComponent(prefixed&&"/"===match.pathname.charAt(0)?match.pathname.substring(1):match.pathname),locationObj.$$search=parseKeyValue(match.search),locationObj.$$hash=decodeURIComponent(match.hash),locationObj.$$path&&"/"!=locationObj.$$path.charAt(0)&&(locationObj.$$path="/"+locationObj.$$path)}function startsWith(haystack,needle){return 0===haystack.lastIndexOf(needle,0)}function stripBaseUrl(base,url){if(startsWith(url,base))return url.substr(base.length)}function stripHash(url){var index=url.indexOf("#");return index==-1?url:url.substr(0,index)}function trimEmptyHash(url){return url.replace(/(#.+)|#$/,"$1")}function stripFile(url){return url.substr(0,stripHash(url).lastIndexOf("/")+1)}function serverBase(url){return url.substring(0,url.indexOf("/",url.indexOf("//")+2))}function LocationHtml5Url(appBase,appBaseNoFile,basePrefix){this.$$html5=!0,basePrefix=basePrefix||"",parseAbsoluteUrl(appBase,this),this.$$parse=function(url){var pathUrl=stripBaseUrl(appBaseNoFile,url);if(!isString(pathUrl))throw $locationMinErr("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',url,appBaseNoFile);parseAppUrl(pathUrl,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var search=toKeyValue(this.$$search),hash=this.$$hash?"#"+encodeUriSegment(this.$$hash):"";this.$$url=encodePath(this.$$path)+(search?"?"+search:"")+hash,this.$$absUrl=appBaseNoFile+this.$$url.substr(1)},this.$$parseLinkUrl=function(url,relHref){if(relHref&&"#"===relHref[0])return this.hash(relHref.slice(1)),!0;var appUrl,prevAppUrl,rewrittenUrl;return isDefined(appUrl=stripBaseUrl(appBase,url))?(prevAppUrl=appUrl,rewrittenUrl=isDefined(appUrl=stripBaseUrl(basePrefix,appUrl))?appBaseNoFile+(stripBaseUrl("/",appUrl)||appUrl):appBase+prevAppUrl):isDefined(appUrl=stripBaseUrl(appBaseNoFile,url))?rewrittenUrl=appBaseNoFile+appUrl:appBaseNoFile==url+"/"&&(rewrittenUrl=appBaseNoFile),rewrittenUrl&&this.$$parse(rewrittenUrl),!!rewrittenUrl}}function LocationHashbangUrl(appBase,appBaseNoFile,hashPrefix){parseAbsoluteUrl(appBase,this),this.$$parse=function(url){function removeWindowsDriveName(path,url,base){var firstPathSegmentMatch,windowsFilePathExp=/^\/[A-Z]:(\/.*)/;return startsWith(url,base)&&(url=url.replace(base,"")),windowsFilePathExp.exec(url)?path:(firstPathSegmentMatch=windowsFilePathExp.exec(path),firstPathSegmentMatch?firstPathSegmentMatch[1]:path)}var withoutHashUrl,withoutBaseUrl=stripBaseUrl(appBase,url)||stripBaseUrl(appBaseNoFile,url);isUndefined(withoutBaseUrl)||"#"!==withoutBaseUrl.charAt(0)?this.$$html5?withoutHashUrl=withoutBaseUrl:(withoutHashUrl="",isUndefined(withoutBaseUrl)&&(appBase=url,this.replace())):(withoutHashUrl=stripBaseUrl(hashPrefix,withoutBaseUrl),isUndefined(withoutHashUrl)&&(withoutHashUrl=withoutBaseUrl)),parseAppUrl(withoutHashUrl,this),this.$$path=removeWindowsDriveName(this.$$path,withoutHashUrl,appBase),this.$$compose()},this.$$compose=function(){var search=toKeyValue(this.$$search),hash=this.$$hash?"#"+encodeUriSegment(this.$$hash):"";this.$$url=encodePath(this.$$path)+(search?"?"+search:"")+hash,this.$$absUrl=appBase+(this.$$url?hashPrefix+this.$$url:"")},this.$$parseLinkUrl=function(url,relHref){return stripHash(appBase)==stripHash(url)&&(this.$$parse(url),!0)}}function LocationHashbangInHtml5Url(appBase,appBaseNoFile,hashPrefix){this.$$html5=!0,LocationHashbangUrl.apply(this,arguments),this.$$parseLinkUrl=function(url,relHref){if(relHref&&"#"===relHref[0])return this.hash(relHref.slice(1)),!0;var rewrittenUrl,appUrl;return appBase==stripHash(url)?rewrittenUrl=url:(appUrl=stripBaseUrl(appBaseNoFile,url))?rewrittenUrl=appBase+hashPrefix+appUrl:appBaseNoFile===url+"/"&&(rewrittenUrl=appBaseNoFile),rewrittenUrl&&this.$$parse(rewrittenUrl),!!rewrittenUrl},this.$$compose=function(){var search=toKeyValue(this.$$search),hash=this.$$hash?"#"+encodeUriSegment(this.$$hash):"";this.$$url=encodePath(this.$$path)+(search?"?"+search:"")+hash,this.$$absUrl=appBase+hashPrefix+this.$$url}}function locationGetter(property){return function(){return this[property]}}function locationGetterSetter(property,preprocess){return function(value){return isUndefined(value)?this[property]:(this[property]=preprocess(value),this.$$compose(),this)}}function $LocationProvider(){var hashPrefix="",html5Mode={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(prefix){return isDefined(prefix)?(hashPrefix=prefix,this):hashPrefix},this.html5Mode=function(mode){return isBoolean(mode)?(html5Mode.enabled=mode,this):isObject(mode)?(isBoolean(mode.enabled)&&(html5Mode.enabled=mode.enabled),isBoolean(mode.requireBase)&&(html5Mode.requireBase=mode.requireBase),isBoolean(mode.rewriteLinks)&&(html5Mode.rewriteLinks=mode.rewriteLinks),this):html5Mode},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function($rootScope,$browser,$sniffer,$rootElement,$window){function setBrowserUrlWithFallback(url,replace,state){var oldUrl=$location.url(),oldState=$location.$$state;try{$browser.url(url,replace,state),$location.$$state=$browser.state()}catch(e){throw $location.url(oldUrl),$location.$$state=oldState,e}}function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast("$locationChangeSuccess",$location.absUrl(),oldUrl,$location.$$state,oldState)}var $location,LocationMode,appBase,baseHref=$browser.baseHref(),initialUrl=$browser.url();if(html5Mode.enabled){if(!baseHref&&html5Mode.requireBase)throw $locationMinErr("nobase","$location in HTML5 mode requires a tag to be present!");appBase=serverBase(initialUrl)+(baseHref||"/"),LocationMode=$sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url}else appBase=stripHash(initialUrl),LocationMode=LocationHashbangUrl;var appBaseNoFile=stripFile(appBase);$location=new LocationMode(appBase,appBaseNoFile,"#"+hashPrefix),$location.$$parseLinkUrl(initialUrl,initialUrl),$location.$$state=$browser.state();var IGNORE_URI_REGEXP=/^\s*(javascript|mailto):/i;$rootElement.on("click",function(event){if(html5Mode.rewriteLinks&&!event.ctrlKey&&!event.metaKey&&!event.shiftKey&&2!=event.which&&2!=event.button){for(var elm=jqLite(event.target);"a"!==nodeName_(elm[0]);)if(elm[0]===$rootElement[0]||!(elm=elm.parent())[0])return;var absHref=elm.prop("href"),relHref=elm.attr("href")||elm.attr("xlink:href");isObject(absHref)&&"[object SVGAnimatedString]"===absHref.toString()&&(absHref=urlResolve(absHref.animVal).href),IGNORE_URI_REGEXP.test(absHref)||!absHref||elm.attr("target")||event.isDefaultPrevented()||$location.$$parseLinkUrl(absHref,relHref)&&(event.preventDefault(),$location.absUrl()!=$browser.url()&&($rootScope.$apply(),$window.angular["ff-684208-preventDefault"]=!0))}}),trimEmptyHash($location.absUrl())!=trimEmptyHash(initialUrl)&&$browser.url($location.absUrl(),!0);var initializing=!0;return $browser.onUrlChange(function(newUrl,newState){return isUndefined(stripBaseUrl(appBaseNoFile,newUrl))?void($window.location.href=newUrl):($rootScope.$evalAsync(function(){var defaultPrevented,oldUrl=$location.absUrl(),oldState=$location.$$state;newUrl=trimEmptyHash(newUrl),$location.$$parse(newUrl),$location.$$state=newState,defaultPrevented=$rootScope.$broadcast("$locationChangeStart",newUrl,oldUrl,newState,oldState).defaultPrevented,$location.absUrl()===newUrl&&(defaultPrevented?($location.$$parse(oldUrl),$location.$$state=oldState,setBrowserUrlWithFallback(oldUrl,!1,oldState)):(initializing=!1,afterLocationChange(oldUrl,oldState)))}),void($rootScope.$$phase||$rootScope.$digest()))}),$rootScope.$watch(function(){var oldUrl=trimEmptyHash($browser.url()),newUrl=trimEmptyHash($location.absUrl()),oldState=$browser.state(),currentReplace=$location.$$replace,urlOrStateChanged=oldUrl!==newUrl||$location.$$html5&&$sniffer.history&&oldState!==$location.$$state;(initializing||urlOrStateChanged)&&(initializing=!1,$rootScope.$evalAsync(function(){var newUrl=$location.absUrl(),defaultPrevented=$rootScope.$broadcast("$locationChangeStart",newUrl,oldUrl,$location.$$state,oldState).defaultPrevented;$location.absUrl()===newUrl&&(defaultPrevented?($location.$$parse(oldUrl),$location.$$state=oldState):(urlOrStateChanged&&setBrowserUrlWithFallback(newUrl,currentReplace,oldState===$location.$$state?null:$location.$$state),afterLocationChange(oldUrl,oldState)))})),$location.$$replace=!1}),$location}]}function $LogProvider(){var debug=!0,self=this;this.debugEnabled=function(flag){return isDefined(flag)?(debug=flag,this):debug},this.$get=["$window",function($window){function formatError(arg){return arg instanceof Error&&(arg.stack?arg=arg.message&&arg.stack.indexOf(arg.message)===-1?"Error: "+arg.message+"\n"+arg.stack:arg.stack:arg.sourceURL&&(arg=arg.message+"\n"+arg.sourceURL+":"+arg.line)),arg}function consoleLog(type){var console=$window.console||{},logFn=console[type]||console.log||noop,hasApply=!1;try{hasApply=!!logFn.apply}catch(e){}return hasApply?function(){var args=[];return forEach(arguments,function(arg){args.push(formatError(arg))}),logFn.apply(console,args)}:function(arg1,arg2){logFn(arg1,null==arg2?"":arg2)}}return{log:consoleLog("log"),info:consoleLog("info"),warn:consoleLog("warn"),error:consoleLog("error"),debug:function(){var fn=consoleLog("debug");return function(){debug&&fn.apply(self,arguments)}}()}}]}function ensureSafeMemberName(name,fullExpression){if("__defineGetter__"===name||"__defineSetter__"===name||"__lookupGetter__"===name||"__lookupSetter__"===name||"__proto__"===name)throw $parseMinErr("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",fullExpression);return name}function getStringValue(name){return name+""}function ensureSafeObject(obj,fullExpression){if(obj){if(obj.constructor===obj)throw $parseMinErr("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj.window===obj)throw $parseMinErr("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj.children&&(obj.nodeName||obj.prop&&obj.attr&&obj.find))throw $parseMinErr("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj===Object)throw $parseMinErr("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",fullExpression)}return obj}function ensureSafeFunction(obj,fullExpression){if(obj){if(obj.constructor===obj)throw $parseMinErr("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",fullExpression);if(obj===CALL||obj===APPLY||obj===BIND)throw $parseMinErr("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",fullExpression)}}function ensureSafeAssignContext(obj,fullExpression){if(obj&&(obj===(0).constructor||obj===(!1).constructor||obj==="".constructor||obj==={}.constructor||obj===[].constructor||obj===Function.constructor))throw $parseMinErr("isecaf","Assigning to a constructor is disallowed! Expression: {0}",fullExpression)}function ifDefined(v,d){return"undefined"!=typeof v?v:d}function plusFn(l,r){return"undefined"==typeof l?r:"undefined"==typeof r?l:l+r}function isStateless($filter,filterName){var fn=$filter(filterName);return!fn.$stateful}function findConstantAndWatchExpressions(ast,$filter){var allConstants,argsToWatch;switch(ast.type){case AST.Program:allConstants=!0,forEach(ast.body,function(expr){findConstantAndWatchExpressions(expr.expression,$filter),allConstants=allConstants&&expr.expression.constant}),ast.constant=allConstants;break;case AST.Literal:ast.constant=!0,ast.toWatch=[];break;case AST.UnaryExpression:findConstantAndWatchExpressions(ast.argument,$filter),ast.constant=ast.argument.constant,ast.toWatch=ast.argument.toWatch;break;case AST.BinaryExpression:findConstantAndWatchExpressions(ast.left,$filter),findConstantAndWatchExpressions(ast.right,$filter),ast.constant=ast.left.constant&&ast.right.constant,ast.toWatch=ast.left.toWatch.concat(ast.right.toWatch);break;case AST.LogicalExpression:findConstantAndWatchExpressions(ast.left,$filter),findConstantAndWatchExpressions(ast.right,$filter),ast.constant=ast.left.constant&&ast.right.constant,ast.toWatch=ast.constant?[]:[ast];break;case AST.ConditionalExpression:findConstantAndWatchExpressions(ast.test,$filter),findConstantAndWatchExpressions(ast.alternate,$filter),findConstantAndWatchExpressions(ast.consequent,$filter),ast.constant=ast.test.constant&&ast.alternate.constant&&ast.consequent.constant,ast.toWatch=ast.constant?[]:[ast];break;case AST.Identifier:ast.constant=!1,ast.toWatch=[ast];break;case AST.MemberExpression:findConstantAndWatchExpressions(ast.object,$filter),ast.computed&&findConstantAndWatchExpressions(ast.property,$filter),ast.constant=ast.object.constant&&(!ast.computed||ast.property.constant),ast.toWatch=[ast];break;case AST.CallExpression:allConstants=!!ast.filter&&isStateless($filter,ast.callee.name),argsToWatch=[],forEach(ast.arguments,function(expr){findConstantAndWatchExpressions(expr,$filter),allConstants=allConstants&&expr.constant,expr.constant||argsToWatch.push.apply(argsToWatch,expr.toWatch)}),ast.constant=allConstants,ast.toWatch=ast.filter&&isStateless($filter,ast.callee.name)?argsToWatch:[ast];break;case AST.AssignmentExpression:findConstantAndWatchExpressions(ast.left,$filter),findConstantAndWatchExpressions(ast.right,$filter),ast.constant=ast.left.constant&&ast.right.constant,ast.toWatch=[ast];break;case AST.ArrayExpression:allConstants=!0,argsToWatch=[],forEach(ast.elements,function(expr){findConstantAndWatchExpressions(expr,$filter),allConstants=allConstants&&expr.constant,expr.constant||argsToWatch.push.apply(argsToWatch,expr.toWatch)}),ast.constant=allConstants,ast.toWatch=argsToWatch;break;case AST.ObjectExpression:allConstants=!0,argsToWatch=[],forEach(ast.properties,function(property){findConstantAndWatchExpressions(property.value,$filter),allConstants=allConstants&&property.value.constant&&!property.computed,property.value.constant||argsToWatch.push.apply(argsToWatch,property.value.toWatch)}),ast.constant=allConstants,ast.toWatch=argsToWatch;break;case AST.ThisExpression:ast.constant=!1,ast.toWatch=[];break;case AST.LocalsExpression:ast.constant=!1,ast.toWatch=[]}}function getInputs(body){if(1==body.length){var lastExpression=body[0].expression,candidate=lastExpression.toWatch;return 1!==candidate.length?candidate:candidate[0]!==lastExpression?candidate:void 0}}function isAssignable(ast){return ast.type===AST.Identifier||ast.type===AST.MemberExpression}function assignableAST(ast){if(1===ast.body.length&&isAssignable(ast.body[0].expression))return{type:AST.AssignmentExpression,left:ast.body[0].expression,right:{type:AST.NGValueParameter},operator:"="}}function isLiteral(ast){return 0===ast.body.length||1===ast.body.length&&(ast.body[0].expression.type===AST.Literal||ast.body[0].expression.type===AST.ArrayExpression||ast.body[0].expression.type===AST.ObjectExpression)}function isConstant(ast){return ast.constant}function ASTCompiler(astBuilder,$filter){this.astBuilder=astBuilder,this.$filter=$filter}function ASTInterpreter(astBuilder,$filter){this.astBuilder=astBuilder,this.$filter=$filter}function isPossiblyDangerousMemberName(name){return"constructor"==name}function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value)}function $ParseProvider(){var identStart,identContinue,cacheDefault=createMap(),cacheExpensive=createMap(),literals={"true":!0,"false":!1,"null":null,undefined:void 0};this.addLiteral=function(literalName,literalValue){literals[literalName]=literalValue},this.setIdentifierFns=function(identifierStart,identifierContinue){return identStart=identifierStart,identContinue=identifierContinue,this},this.$get=["$filter",function($filter){function $parse(exp,interceptorFn,expensiveChecks){var parsedExpression,oneTime,cacheKey;switch(expensiveChecks=expensiveChecks||runningChecksEnabled,typeof exp){case"string":exp=exp.trim(),cacheKey=exp;var cache=expensiveChecks?cacheExpensive:cacheDefault;if(parsedExpression=cache[cacheKey],!parsedExpression){":"===exp.charAt(0)&&":"===exp.charAt(1)&&(oneTime=!0,exp=exp.substring(2));var parseOptions=expensiveChecks?$parseOptionsExpensive:$parseOptions,lexer=new Lexer(parseOptions),parser=new Parser(lexer,$filter,parseOptions);parsedExpression=parser.parse(exp),parsedExpression.constant?parsedExpression.$$watchDelegate=constantWatchDelegate:oneTime?parsedExpression.$$watchDelegate=parsedExpression.literal?oneTimeLiteralWatchDelegate:oneTimeWatchDelegate:parsedExpression.inputs&&(parsedExpression.$$watchDelegate=inputsWatchDelegate),expensiveChecks&&(parsedExpression=expensiveChecksInterceptor(parsedExpression)),cache[cacheKey]=parsedExpression}return addInterceptor(parsedExpression,interceptorFn);case"function":return addInterceptor(exp,interceptorFn);default:return addInterceptor(noop,interceptorFn)}}function expensiveChecksInterceptor(fn){function expensiveCheckFn(scope,locals,assign,inputs){var expensiveCheckOldValue=runningChecksEnabled;runningChecksEnabled=!0;try{return fn(scope,locals,assign,inputs)}finally{runningChecksEnabled=expensiveCheckOldValue}}if(!fn)return fn;expensiveCheckFn.$$watchDelegate=fn.$$watchDelegate,expensiveCheckFn.assign=expensiveChecksInterceptor(fn.assign),
+expensiveCheckFn.constant=fn.constant,expensiveCheckFn.literal=fn.literal;for(var i=0;fn.inputs&&i0&&scheduleProcessQueue(this.$$state),result.promise},"catch":function(callback){return this.then(null,callback)},"finally":function(callback,progressBack){return this.then(function(value){return handleCallback(value,!0,callback)},function(error){return handleCallback(error,!1,callback)},progressBack)}}),extend(Deferred.prototype,{resolve:function(val){this.promise.$$state.status||(val===this.promise?this.$$reject($qMinErr("qcycle","Expected promise to be resolved with value other than itself '{0}'",val)):this.$$resolve(val))},$$resolve:function(val){function resolvePromise(val){done||(done=!0,that.$$resolve(val))}function rejectPromise(val){done||(done=!0,that.$$reject(val))}var then,that=this,done=!1;try{(isObject(val)||isFunction(val))&&(then=val&&val.then),isFunction(then)?(this.promise.$$state.status=-1,then.call(val,resolvePromise,rejectPromise,simpleBind(this,this.notify))):(this.promise.$$state.value=val,this.promise.$$state.status=1,scheduleProcessQueue(this.promise.$$state))}catch(e){rejectPromise(e),exceptionHandler(e)}},reject:function(reason){this.promise.$$state.status||this.$$reject(reason)},$$reject:function(reason){this.promise.$$state.value=reason,this.promise.$$state.status=2,scheduleProcessQueue(this.promise.$$state)},notify:function(progress){var callbacks=this.promise.$$state.pending;this.promise.$$state.status<=0&&callbacks&&callbacks.length&&nextTick(function(){for(var callback,result,i=0,ii=callbacks.length;i=0&&incrementWatchersCount(scope,-1),lastDirtyWatch=null}},$watchGroup:function(watchExpressions,listener){function watchGroupAction(){changeReactionScheduled=!1,firstRun?(firstRun=!1,listener(newValues,newValues,self)):listener(newValues,oldValues,self)}var oldValues=new Array(watchExpressions.length),newValues=new Array(watchExpressions.length),deregisterFns=[],self=this,changeReactionScheduled=!1,firstRun=!0;if(!watchExpressions.length){var shouldCall=!0;return self.$evalAsync(function(){shouldCall&&listener(newValues,newValues,self)}),function(){shouldCall=!1}}return 1===watchExpressions.length?this.$watch(watchExpressions[0],function(value,oldValue,scope){newValues[0]=value,oldValues[0]=oldValue,listener(newValues,value===oldValue?newValues:oldValues,scope)}):(forEach(watchExpressions,function(expr,i){var unwatchFn=self.$watch(expr,function(value,oldValue){newValues[i]=value,oldValues[i]=oldValue,changeReactionScheduled||(changeReactionScheduled=!0,self.$evalAsync(watchGroupAction))});deregisterFns.push(unwatchFn)}),function(){for(;deregisterFns.length;)deregisterFns.shift()()})},$watchCollection:function(obj,listener){function $watchCollectionInterceptor(_value){newValue=_value;var newLength,key,bothNaN,newItem,oldItem;if(!isUndefined(newValue)){if(isObject(newValue))if(isArrayLike(newValue)){oldValue!==internalArray&&(oldValue=internalArray,oldLength=oldValue.length=0,changeDetected++),newLength=newValue.length,oldLength!==newLength&&(changeDetected++,oldValue.length=oldLength=newLength);for(var i=0;inewLength){changeDetected++;for(key in oldValue)hasOwnProperty.call(newValue,key)||(oldLength--,delete oldValue[key])}}else oldValue!==newValue&&(oldValue=newValue,changeDetected++);return changeDetected}}function $watchCollectionAction(){if(initRun?(initRun=!1,listener(newValue,newValue,self)):listener(newValue,veryOldValue,self),trackVeryOldValue)if(isObject(newValue))if(isArrayLike(newValue)){veryOldValue=new Array(newValue.length);for(var i=0;i1,changeDetected=0,changeDetector=$parse(obj,$watchCollectionInterceptor),internalArray=[],internalObject={},initRun=!0,oldLength=0;return this.$watch(changeDetector,$watchCollectionAction)},$digest:function(){var watch,value,last,fn,get,watchers,length,dirty,next,current,logIdx,asyncTask,ttl=TTL,target=this,watchLog=[];beginPhase("$digest"),$browser.$$checkUrlChange(),this===$rootScope&&null!==applyAsyncId&&($browser.defer.cancel(applyAsyncId),flushApplyAsync()),lastDirtyWatch=null;do{dirty=!1,current=target;for(var asyncQueuePosition=0;asyncQueuePosition-1)throw $sceMinErr("iwcard","Illegal sequence *** in string matcher. String: {0}",matcher);return matcher=escapeForRegexp(matcher).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+matcher+"$")}if(isRegExp(matcher))return new RegExp("^"+matcher.source+"$");throw $sceMinErr("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function adjustMatchers(matchers){var adjustedMatchers=[];return isDefined(matchers)&&forEach(matchers,function(matcher){adjustedMatchers.push(adjustMatcher(matcher))}),adjustedMatchers}function $SceDelegateProvider(){this.SCE_CONTEXTS=SCE_CONTEXTS;var resourceUrlWhitelist=["self"],resourceUrlBlacklist=[];this.resourceUrlWhitelist=function(value){return arguments.length&&(resourceUrlWhitelist=adjustMatchers(value)),resourceUrlWhitelist},this.resourceUrlBlacklist=function(value){return arguments.length&&(resourceUrlBlacklist=adjustMatchers(value)),resourceUrlBlacklist},this.$get=["$injector",function($injector){function matchUrl(matcher,parsedUrl){return"self"===matcher?urlIsSameOrigin(parsedUrl):!!matcher.exec(parsedUrl.href)}function isResourceUrlAllowedByPolicy(url){var i,n,parsedUrl=urlResolve(url.toString()),allowed=!1;for(i=0,n=resourceUrlWhitelist.length;i to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var sce=shallowCopy(SCE_CONTEXTS);sce.isEnabled=function(){return enabled},sce.trustAs=$sceDelegate.trustAs,sce.getTrusted=$sceDelegate.getTrusted,sce.valueOf=$sceDelegate.valueOf,enabled||(sce.trustAs=sce.getTrusted=function(type,value){return value},sce.valueOf=identity),sce.parseAs=function(type,expr){var parsed=$parse(expr);return parsed.literal&&parsed.constant?parsed:$parse(expr,function(value){return sce.getTrusted(type,value)})};var parse=sce.parseAs,getTrusted=sce.getTrusted,trustAs=sce.trustAs;return forEach(SCE_CONTEXTS,function(enumValue,name){var lName=lowercase(name);sce[camelCase("parse_as_"+lName)]=function(expr){return parse(enumValue,expr)},sce[camelCase("get_trusted_"+lName)]=function(value){return getTrusted(enumValue,value)},sce[camelCase("trust_as_"+lName)]=function(value){return trustAs(enumValue,value)}}),sce}]}function $SnifferProvider(){this.$get=["$window","$document",function($window,$document){var vendorPrefix,match,eventSupport={},isChromePackagedApp=$window.chrome&&$window.chrome.app&&$window.chrome.app.runtime,hasHistoryPushState=!isChromePackagedApp&&$window.history&&$window.history.pushState,android=toInt((/android (\d+)/.exec(lowercase(($window.navigator||{}).userAgent))||[])[1]),boxee=/Boxee/i.test(($window.navigator||{}).userAgent),document=$document[0]||{},vendorRegex=/^(Moz|webkit|ms)(?=[A-Z])/,bodyStyle=document.body&&document.body.style,transitions=!1,animations=!1;if(bodyStyle){for(var prop in bodyStyle)if(match=vendorRegex.exec(prop)){vendorPrefix=match[0],vendorPrefix=vendorPrefix[0].toUpperCase()+vendorPrefix.substr(1);break}vendorPrefix||(vendorPrefix="WebkitOpacity"in bodyStyle&&"webkit"),transitions=!!("transition"in bodyStyle||vendorPrefix+"Transition"in bodyStyle),animations=!!("animation"in bodyStyle||vendorPrefix+"Animation"in bodyStyle),!android||transitions&&animations||(transitions=isString(bodyStyle.webkitTransition),animations=isString(bodyStyle.webkitAnimation))}return{history:!(!hasHistoryPushState||android<4||boxee),hasEvent:function(event){if("input"===event&&msie<=11)return!1;if(isUndefined(eventSupport[event])){var divElm=document.createElement("div");eventSupport[event]="on"+event in divElm}return eventSupport[event]},csp:csp(),vendorPrefix:vendorPrefix,transitions:transitions,animations:animations,android:android}}]}function $TemplateRequestProvider(){var httpOptions;this.httpOptions=function(val){return val?(httpOptions=val,this):httpOptions},this.$get=["$templateCache","$http","$q","$sce",function($templateCache,$http,$q,$sce){function handleRequestFn(tpl,ignoreRequestError){function handleError(resp){if(!ignoreRequestError)throw $templateRequestMinErr("tpload","Failed to load template: {0} (HTTP status: {1} {2})",tpl,resp.status,resp.statusText);return $q.reject(resp)}handleRequestFn.totalPendingRequests++,isString(tpl)&&!isUndefined($templateCache.get(tpl))||(tpl=$sce.getTrustedResourceUrl(tpl));var transformResponse=$http.defaults&&$http.defaults.transformResponse;return isArray(transformResponse)?transformResponse=transformResponse.filter(function(transformer){return transformer!==defaultHttpResponseTransform}):transformResponse===defaultHttpResponseTransform&&(transformResponse=null),$http.get(tpl,extend({cache:$templateCache,transformResponse:transformResponse},httpOptions))["finally"](function(){handleRequestFn.totalPendingRequests--}).then(function(response){return $templateCache.put(tpl,response.data),response.data},handleError)}return handleRequestFn.totalPendingRequests=0,handleRequestFn}]}function $$TestabilityProvider(){this.$get=["$rootScope","$browser","$location",function($rootScope,$browser,$location){var testability={};return testability.findBindings=function(element,expression,opt_exactMatch){var bindings=element.getElementsByClassName("ng-binding"),matches=[];return forEach(bindings,function(binding){var dataBinding=angular.element(binding).data("$binding");dataBinding&&forEach(dataBinding,function(bindingName){if(opt_exactMatch){var matcher=new RegExp("(^|\\s)"+escapeForRegexp(expression)+"(\\s|\\||$)");matcher.test(bindingName)&&matches.push(binding)}else bindingName.indexOf(expression)!=-1&&matches.push(binding)})}),matches},testability.findModels=function(element,expression,opt_exactMatch){for(var prefixes=["ng-","data-ng-","ng\\:"],p=0;p0&&(name=safeDecodeURIComponent(cookie.substring(0,index)),isUndefined(lastCookies[name])&&(lastCookies[name]=safeDecodeURIComponent(cookie.substring(index+1))));return lastCookies}}function $$CookieReaderProvider(){this.$get=$$CookieReader}function $FilterProvider($provide){function register(name,factory){if(isObject(name)){var filters={};return forEach(name,function(filter,key){filters[key]=register(key,filter)}),filters}return $provide.factory(name+suffix,factory)}var suffix="Filter";this.register=register,this.$get=["$injector",function($injector){return function(name){return $injector.get(name+suffix)}}],register("currency",currencyFilter),register("date",dateFilter),register("filter",filterFilter),register("json",jsonFilter),register("limitTo",limitToFilter),register("lowercase",lowercaseFilter),register("number",numberFilter),register("orderBy",orderByFilter),register("uppercase",uppercaseFilter)}function filterFilter(){return function(array,expression,comparator,anyPropertyKey){if(!isArrayLike(array)){if(null==array)return array;throw minErr("filter")("notarray","Expected array but received: {0}",array)}anyPropertyKey=anyPropertyKey||"$";var predicateFn,matchAgainstAnyProp,expressionType=getTypeForFilter(expression);switch(expressionType){case"function":predicateFn=expression;break;case"boolean":case"null":case"number":case"string":matchAgainstAnyProp=!0;case"object":predicateFn=createPredicateFn(expression,comparator,anyPropertyKey,matchAgainstAnyProp);break;default:return array}return Array.prototype.filter.call(array,predicateFn)}}function createPredicateFn(expression,comparator,anyPropertyKey,matchAgainstAnyProp){var predicateFn,shouldMatchPrimitives=isObject(expression)&&anyPropertyKey in expression;return comparator===!0?comparator=equals:isFunction(comparator)||(comparator=function(actual,expected){return!isUndefined(actual)&&(null===actual||null===expected?actual===expected:!(isObject(expected)||isObject(actual)&&!hasCustomToString(actual))&&(actual=lowercase(""+actual),expected=lowercase(""+expected),actual.indexOf(expected)!==-1))}),predicateFn=function(item){return shouldMatchPrimitives&&!isObject(item)?deepCompare(item,expression[anyPropertyKey],comparator,anyPropertyKey,!1):deepCompare(item,expression,comparator,anyPropertyKey,matchAgainstAnyProp)}}function deepCompare(actual,expected,comparator,anyPropertyKey,matchAgainstAnyProp,dontMatchWholeObject){var actualType=getTypeForFilter(actual),expectedType=getTypeForFilter(expected);if("string"===expectedType&&"!"===expected.charAt(0))return!deepCompare(actual,expected.substring(1),comparator,anyPropertyKey,matchAgainstAnyProp);if(isArray(actual))return actual.some(function(item){return deepCompare(item,expected,comparator,anyPropertyKey,matchAgainstAnyProp)});switch(actualType){case"object":var key;if(matchAgainstAnyProp){for(key in actual)if("$"!==key.charAt(0)&&deepCompare(actual[key],expected,comparator,anyPropertyKey,!0))return!0;return!dontMatchWholeObject&&deepCompare(actual,expected,comparator,anyPropertyKey,!1)}if("object"===expectedType){for(key in expected){var expectedVal=expected[key];if(!isFunction(expectedVal)&&!isUndefined(expectedVal)){var matchAnyProperty=key===anyPropertyKey,actualVal=matchAnyProperty?actual:actual[key];if(!deepCompare(actualVal,expectedVal,comparator,anyPropertyKey,matchAnyProperty,matchAnyProperty))return!1}}return!0}return comparator(actual,expected);case"function":return!1;default:return comparator(actual,expected)}}function getTypeForFilter(val){return null===val?"null":typeof val}function currencyFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(amount,currencySymbol,fractionSize){return isUndefined(currencySymbol)&&(currencySymbol=formats.CURRENCY_SYM),isUndefined(fractionSize)&&(fractionSize=formats.PATTERNS[1].maxFrac),null==amount?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(/\u00A4/g,currencySymbol)}}function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){return null==number?number:formatNumber(number,formats.PATTERNS[0],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize)}}function parse(numStr){var digits,numberOfIntegerDigits,i,j,zeros,exponent=0;for((numberOfIntegerDigits=numStr.indexOf(DECIMAL_SEP))>-1&&(numStr=numStr.replace(DECIMAL_SEP,"")),(i=numStr.search(/e/i))>0?(numberOfIntegerDigits<0&&(numberOfIntegerDigits=i),numberOfIntegerDigits+=+numStr.slice(i+1),numStr=numStr.substring(0,i)):numberOfIntegerDigits<0&&(numberOfIntegerDigits=numStr.length),i=0;numStr.charAt(i)==ZERO_CHAR;i++);if(i==(zeros=numStr.length))digits=[0],numberOfIntegerDigits=1;else{for(zeros--;numStr.charAt(zeros)==ZERO_CHAR;)zeros--;for(numberOfIntegerDigits-=i,digits=[],j=0;i<=zeros;i++,j++)digits[j]=+numStr.charAt(i)}return numberOfIntegerDigits>MAX_DIGITS&&(digits=digits.splice(0,MAX_DIGITS-1),exponent=numberOfIntegerDigits-1,numberOfIntegerDigits=1),{d:digits,e:exponent,i:numberOfIntegerDigits}}function roundNumber(parsedNumber,fractionSize,minFrac,maxFrac){var digits=parsedNumber.d,fractionLen=digits.length-parsedNumber.i;fractionSize=isUndefined(fractionSize)?Math.min(Math.max(minFrac,fractionLen),maxFrac):+fractionSize;var roundAt=fractionSize+parsedNumber.i,digit=digits[roundAt];if(roundAt>0){digits.splice(Math.max(parsedNumber.i,roundAt));for(var j=roundAt;j=5)if(roundAt-1<0){for(var k=0;k>roundAt;k--)digits.unshift(0),parsedNumber.i++;digits.unshift(1),parsedNumber.i++}else digits[roundAt-1]++;for(;fractionLen0?decimals=digits.splice(integerLen,digits.length):(decimals=digits,digits=[0]);var groups=[];for(digits.length>=pattern.lgSize&&groups.unshift(digits.splice(-pattern.lgSize,digits.length).join(""));digits.length>pattern.gSize;)groups.unshift(digits.splice(-pattern.gSize,digits.length).join(""));digits.length&&groups.unshift(digits.join("")),formattedText=groups.join(groupSep),decimals.length&&(formattedText+=decimalSep+decimals.join("")),exponent&&(formattedText+="e+"+exponent)}return number<0&&!isZero?pattern.negPre+formattedText+pattern.negSuf:pattern.posPre+formattedText+pattern.posSuf}function padNumber(num,digits,trim,negWrap){var neg="";for((num<0||negWrap&&num<=0)&&(negWrap?num=-num+1:(num=-num,neg="-")),num=""+num;num.length0||value>-offset)&&(value+=offset),0===value&&offset==-12&&(value=12),padNumber(value,size,trim,negWrap)}}function dateStrGetter(name,shortForm,standAlone){return function(date,formats){var value=date["get"+name](),propPrefix=(standAlone?"STANDALONE":"")+(shortForm?"SHORT":""),get=uppercase(propPrefix+name);return formats[get][value]}}function timeZoneGetter(date,formats,offset){var zone=-1*offset,paddedZone=zone>=0?"+":"";return paddedZone+=padNumber(Math[zone>0?"floor":"ceil"](zone/60),2)+padNumber(Math.abs(zone%60),2)}function getFirstThursdayOfYear(year){var dayOfWeekOnFirst=new Date(year,0,1).getDay();return new Date(year,0,(dayOfWeekOnFirst<=4?5:12)-dayOfWeekOnFirst)}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),datetime.getDate()+(4-datetime.getDay()))}function weekGetter(size){return function(date){var firstThurs=getFirstThursdayOfYear(date.getFullYear()),thisThurs=getThursdayThisWeek(date),diff=+thisThurs-+firstThurs,result=1+Math.round(diff/6048e5);return padNumber(result,size)}}function ampmGetter(date,formats){return date.getHours()<12?formats.AMPMS[0]:formats.AMPMS[1]}function eraGetter(date,formats){return date.getFullYear()<=0?formats.ERAS[0]:formats.ERAS[1]}function longEraGetter(date,formats){return date.getFullYear()<=0?formats.ERANAMES[0]:formats.ERANAMES[1]}function dateFilter($locale){function jsonStringToDate(string){var match;if(match=string.match(R_ISO8601_STR)){var date=new Date(0),tzHour=0,tzMin=0,dateSetter=match[8]?date.setUTCFullYear:date.setFullYear,timeSetter=match[8]?date.setUTCHours:date.setHours;match[9]&&(tzHour=toInt(match[9]+match[10]),tzMin=toInt(match[9]+match[11])),dateSetter.call(date,toInt(match[1]),toInt(match[2])-1,toInt(match[3]));var h=toInt(match[4]||0)-tzHour,m=toInt(match[5]||0)-tzMin,s=toInt(match[6]||0),ms=Math.round(1e3*parseFloat("0."+(match[7]||0)));return timeSetter.call(date,h,m,s,ms),date}return string}var R_ISO8601_STR=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(date,format,timezone){var fn,match,text="",parts=[];if(format=format||"mediumDate",format=$locale.DATETIME_FORMATS[format]||format,isString(date)&&(date=NUMBER_STRING.test(date)?toInt(date):jsonStringToDate(date)),isNumber(date)&&(date=new Date(date)),!isDate(date)||!isFinite(date.getTime()))return date;for(;format;)match=DATE_FORMATS_SPLIT.exec(format),match?(parts=concat(parts,match,1),format=parts.pop()):(parts.push(format),format=null);var dateTimezoneOffset=date.getTimezoneOffset();return timezone&&(dateTimezoneOffset=timezoneToOffset(timezone,dateTimezoneOffset),date=convertTimezoneToLocal(date,timezone,!0)),forEach(parts,function(value){fn=DATE_FORMATS[value],text+=fn?fn(date,$locale.DATETIME_FORMATS,dateTimezoneOffset):"''"===value?"'":value.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),text}}function jsonFilter(){return function(object,spacing){return isUndefined(spacing)&&(spacing=2),toJson(object,spacing)}}function limitToFilter(){return function(input,limit,begin){return limit=Math.abs(Number(limit))===1/0?Number(limit):toInt(limit),isNaN(limit)?input:(isNumber(input)&&(input=input.toString()),isArrayLike(input)?(begin=!begin||isNaN(begin)?0:toInt(begin),begin=begin<0?Math.max(0,input.length+begin):begin,limit>=0?sliceFn(input,begin,begin+limit):0===begin?sliceFn(input,limit,input.length):sliceFn(input,Math.max(0,begin+limit),begin)):input)}}function sliceFn(input,begin,end){return isString(input)?input.slice(begin,end):slice.call(input,begin,end)}function orderByFilter($parse){function processPredicates(sortPredicates){return sortPredicates.map(function(predicate){var descending=1,get=identity;if(isFunction(predicate))get=predicate;else if(isString(predicate)&&("+"!=predicate.charAt(0)&&"-"!=predicate.charAt(0)||(descending="-"==predicate.charAt(0)?-1:1,predicate=predicate.substring(1)),""!==predicate&&(get=$parse(predicate),get.constant))){var key=get();get=function(value){return value[key]}}return{get:get,descending:descending}})}function isPrimitive(value){switch(typeof value){case"number":case"boolean":case"string":return!0;default:return!1}}function objectValue(value){return isFunction(value.valueOf)&&(value=value.valueOf(),isPrimitive(value))?value:hasCustomToString(value)&&(value=value.toString(),isPrimitive(value))?value:value}function getPredicateValue(value,index){var type=typeof value;return null===value?(type="string",value="null"):"object"===type&&(value=objectValue(value)),{value:value,type:type,index:index}}function defaultCompare(v1,v2){var result=0,type1=v1.type,type2=v2.type;if(type1===type2){var value1=v1.value,value2=v2.value;"string"===type1?(value1=value1.toLowerCase(),value2=value2.toLowerCase()):"object"===type1&&(isObject(value1)&&(value1=v1.index),isObject(value2)&&(value2=v2.index)),value1!==value2&&(result=value1=minVal},attr.$observe("min",function(val){minVal=parseObservedDateValue(val),ctrl.$validate()})}if(isDefined(attr.max)||attr.ngMax){var maxVal;ctrl.$validators.max=function(value){return!isValidDate(value)||isUndefined(maxVal)||parseDate(value)<=maxVal},attr.$observe("max",function(val){maxVal=parseObservedDateValue(val),ctrl.$validate()})}}}function badInputChecker(scope,element,attr,ctrl){var node=element[0],nativeValidation=ctrl.$$hasNativeValidators=isObject(node.validity);nativeValidation&&ctrl.$parsers.push(function(value){var validity=element.prop(VALIDITY_STATE_PROPERTY)||{};return validity.badInput||validity.typeMismatch?void 0:value})}function numberInputType(scope,element,attr,ctrl,$sniffer,$browser){if(badInputChecker(scope,element,attr,ctrl),baseInputType(scope,element,attr,ctrl,$sniffer,$browser),ctrl.$$parserName="number",ctrl.$parsers.push(function(value){return ctrl.$isEmpty(value)?null:NUMBER_REGEXP.test(value)?parseFloat(value):void 0}),ctrl.$formatters.push(function(value){if(!ctrl.$isEmpty(value)){if(!isNumber(value))throw ngModelMinErr("numfmt","Expected `{0}` to be a number",value);value=value.toString()}return value}),isDefined(attr.min)||attr.ngMin){var minVal;ctrl.$validators.min=function(value){return ctrl.$isEmpty(value)||isUndefined(minVal)||value>=minVal},attr.$observe("min",function(val){isDefined(val)&&!isNumber(val)&&(val=parseFloat(val)),minVal=isNumber(val)&&!isNaN(val)?val:void 0,ctrl.$validate()})}if(isDefined(attr.max)||attr.ngMax){var maxVal;ctrl.$validators.max=function(value){return ctrl.$isEmpty(value)||isUndefined(maxVal)||value<=maxVal},attr.$observe("max",function(val){isDefined(val)&&!isNumber(val)&&(val=parseFloat(val)),maxVal=isNumber(val)&&!isNaN(val)?val:void 0,ctrl.$validate()})}}function urlInputType(scope,element,attr,ctrl,$sniffer,$browser){baseInputType(scope,element,attr,ctrl,$sniffer,$browser),stringBasedInputType(ctrl),ctrl.$$parserName="url",ctrl.$validators.url=function(modelValue,viewValue){var value=modelValue||viewValue;return ctrl.$isEmpty(value)||URL_REGEXP.test(value)}}function emailInputType(scope,element,attr,ctrl,$sniffer,$browser){baseInputType(scope,element,attr,ctrl,$sniffer,$browser),stringBasedInputType(ctrl),ctrl.$$parserName="email",ctrl.$validators.email=function(modelValue,viewValue){var value=modelValue||viewValue;return ctrl.$isEmpty(value)||EMAIL_REGEXP.test(value)}}function radioInputType(scope,element,attr,ctrl){isUndefined(attr.name)&&element.attr("name",nextUid());var listener=function(ev){element[0].checked&&ctrl.$setViewValue(attr.value,ev&&ev.type)};element.on("click",listener),ctrl.$render=function(){var value=attr.value;element[0].checked=value==ctrl.$viewValue},attr.$observe("value",ctrl.$render)}function parseConstantExpr($parse,context,name,expression,fallback){var parseFn;if(isDefined(expression)){if(parseFn=$parse(expression),!parseFn.constant)throw ngModelMinErr("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",name,expression);return parseFn(context)}return fallback}function checkboxInputType(scope,element,attr,ctrl,$sniffer,$browser,$filter,$parse){var trueValue=parseConstantExpr($parse,scope,"ngTrueValue",attr.ngTrueValue,!0),falseValue=parseConstantExpr($parse,scope,"ngFalseValue",attr.ngFalseValue,!1),listener=function(ev){ctrl.$setViewValue(element[0].checked,ev&&ev.type)};element.on("click",listener),ctrl.$render=function(){element[0].checked=ctrl.$viewValue},ctrl.$isEmpty=function(value){return value===!1},ctrl.$formatters.push(function(value){return equals(value,trueValue)}),ctrl.$parsers.push(function(value){return value?trueValue:falseValue})}function classDirective(name,selector){return name="ngClass"+name,["$animate",function($animate){function arrayDifference(tokens1,tokens2){var values=[];outer:for(var i=0;i0||classCounts[className])&&(classCounts[className]=(classCounts[className]||0)+count,classCounts[className]===+(count>0)&&classesToUpdate.push(className))}),element.data("$classCounts",classCounts),classesToUpdate.join(" ")}function updateClasses(oldClasses,newClasses){var toAdd=arrayDifference(newClasses,oldClasses),toRemove=arrayDifference(oldClasses,newClasses);toAdd=digestClassCounts(toAdd,1),toRemove=digestClassCounts(toRemove,-1),toAdd&&toAdd.length&&$animate.addClass(element,toAdd),toRemove&&toRemove.length&&$animate.removeClass(element,toRemove)}function ngClassWatchAction(newVal){if(selector===!0||(1&scope.$index)===selector){var newClasses=arrayClasses(newVal||[]);if(oldVal){if(!equals(newVal,oldVal)){var oldClasses=arrayClasses(oldVal);updateClasses(oldClasses,newClasses)}}else addClasses(newClasses)}oldVal=isArray(newVal)?newVal.map(function(v){return shallowCopy(v)}):shallowCopy(newVal)}var oldVal;scope.$watch(attr[name],ngClassWatchAction,!0),attr.$observe("class",function(value){ngClassWatchAction(scope.$eval(attr[name]))}),"ngClass"!==name&&scope.$watch("$index",function($index,old$index){var mod=1&$index;if(mod!==(1&old$index)){var classes=arrayClasses(scope.$eval(attr[name]));mod===selector?addClasses(classes):removeClasses(classes)}})}}}]}function addSetValidityMethod(context){function setValidity(validationErrorKey,state,controller){isUndefined(state)?createAndSet("$pending",validationErrorKey,controller):unsetAndCleanup("$pending",validationErrorKey,controller),isBoolean(state)?state?(unset(ctrl.$error,validationErrorKey,controller),set(ctrl.$$success,validationErrorKey,controller)):(set(ctrl.$error,validationErrorKey,controller),unset(ctrl.$$success,validationErrorKey,controller)):(unset(ctrl.$error,validationErrorKey,controller),unset(ctrl.$$success,validationErrorKey,controller)),ctrl.$pending?(cachedToggleClass(PENDING_CLASS,!0),ctrl.$valid=ctrl.$invalid=void 0,toggleValidationCss("",null)):(cachedToggleClass(PENDING_CLASS,!1),ctrl.$valid=isObjectEmpty(ctrl.$error),ctrl.$invalid=!ctrl.$valid,toggleValidationCss("",ctrl.$valid));var combinedState;combinedState=ctrl.$pending&&ctrl.$pending[validationErrorKey]?void 0:!ctrl.$error[validationErrorKey]&&(!!ctrl.$$success[validationErrorKey]||null),toggleValidationCss(validationErrorKey,combinedState),ctrl.$$parentForm.$setValidity(validationErrorKey,combinedState,ctrl)}function createAndSet(name,value,controller){ctrl[name]||(ctrl[name]={}),set(ctrl[name],value,controller)}function unsetAndCleanup(name,value,controller){ctrl[name]&&unset(ctrl[name],value,controller),isObjectEmpty(ctrl[name])&&(ctrl[name]=void 0)}function cachedToggleClass(className,switchValue){switchValue&&!classCache[className]?($animate.addClass($element,className),classCache[className]=!0):!switchValue&&classCache[className]&&($animate.removeClass($element,className),classCache[className]=!1)}function toggleValidationCss(validationErrorKey,isValid){validationErrorKey=validationErrorKey?"-"+snake_case(validationErrorKey,"-"):"",cachedToggleClass(VALID_CLASS+validationErrorKey,isValid===!0),cachedToggleClass(INVALID_CLASS+validationErrorKey,isValid===!1)}var ctrl=context.ctrl,$element=context.$element,classCache={},set=context.set,unset=context.unset,$animate=context.$animate;classCache[INVALID_CLASS]=!(classCache[VALID_CLASS]=$element.hasClass(VALID_CLASS)),ctrl.$setValidity=setValidity}function isObjectEmpty(obj){if(obj)for(var prop in obj)if(obj.hasOwnProperty(prop))return!1;return!0}function chromeHack(optionElement){optionElement[0].hasAttribute("selected")&&(optionElement[0].selected=!0)}var REGEX_STRING_REGEXP=/^\/(.+)\/([a-z]*)$/,VALIDITY_STATE_PROPERTY="validity",hasOwnProperty=Object.prototype.hasOwnProperty,lowercase=function(string){return isString(string)?string.toLowerCase():string},uppercase=function(string){return isString(string)?string.toUpperCase():string},manualLowercase=function(s){return isString(s)?s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(32|ch.charCodeAt(0))}):s},manualUppercase=function(s){return isString(s)?s.replace(/[a-z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0)&-33)}):s};"i"!=="I".toLowerCase()&&(lowercase=manualLowercase,uppercase=manualUppercase);var msie,jqLite,jQuery,angularModule,slice=[].slice,splice=[].splice,push=[].push,toString=Object.prototype.toString,getPrototypeOf=Object.getPrototypeOf,ngMinErr=minErr("ng"),angular=window.angular||(window.angular={}),uid=0;msie=window.document.documentMode,noop.$inject=[],identity.$inject=[];var isArray=Array.isArray,TYPED_ARRAY_REGEXP=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,trim=function(value){return isString(value)?value.trim():value},escapeForRegexp=function(s){return s.replace(/([-()\[\]{}+?*.$\^|,:#(?:<\/\1>|)$/,HTML_REGEXP=/<|?\w+;/,TAG_NAME_REGEXP=/<([\w:-]+)/,XHTML_TAG_REGEXP=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wrapMap={option:[1,'"],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var jqLiteContains=window.Node.prototype.contains||function(arg){return!!(16&this.compareDocumentPosition(arg))},JQLitePrototype=JQLite.prototype={ready:function(fn){function trigger(){fired||(fired=!0,fn())}var fired=!1;"complete"===window.document.readyState?window.setTimeout(trigger):(this.on("DOMContentLoaded",trigger),JQLite(window).on("load",trigger))},toString:function(){var value=[];return forEach(this,function(e){value.push(""+e)}),"["+value.join(", ")+"]"},eq:function(index){return jqLite(index>=0?this[index]:this[this.length+index])},length:0,push:push,sort:[].sort,splice:[].splice},BOOLEAN_ATTR={};forEach("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(value){BOOLEAN_ATTR[lowercase(value)]=value});var BOOLEAN_ELEMENTS={};forEach("input,select,option,textarea,button,form,details".split(","),function(value){BOOLEAN_ELEMENTS[value]=!0});var ALIASED_ATTR={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};forEach({data:jqLiteData,removeData:jqLiteRemoveData,hasData:jqLiteHasData,cleanData:jqLiteCleanData},function(fn,name){JQLite[name]=fn}),forEach({data:jqLiteData,inheritedData:jqLiteInheritedData,scope:function(element){return jqLite.data(element,"$scope")||jqLiteInheritedData(element.parentNode||element,["$isolateScope","$scope"])},isolateScope:function(element){return jqLite.data(element,"$isolateScope")||jqLite.data(element,"$isolateScopeNoTemplate")},controller:jqLiteController,injector:function(element){return jqLiteInheritedData(element,"$injector")},removeAttr:function(element,name){element.removeAttribute(name)},hasClass:jqLiteHasClass,css:function(element,name,value){return name=camelCase(name),isDefined(value)?void(element.style[name]=value):element.style[name]},attr:function(element,name,value){var nodeType=element.nodeType;if(nodeType!==NODE_TYPE_TEXT&&nodeType!==NODE_TYPE_ATTRIBUTE&&nodeType!==NODE_TYPE_COMMENT){var lowercasedName=lowercase(name);if(BOOLEAN_ATTR[lowercasedName]){if(!isDefined(value))return element[name]||(element.attributes.getNamedItem(name)||noop).specified?lowercasedName:void 0;value?(element[name]=!0,element.setAttribute(name,lowercasedName)):(element[name]=!1,element.removeAttribute(lowercasedName))}else if(isDefined(value))element.setAttribute(name,value);else if(element.getAttribute){var ret=element.getAttribute(name,2);return null===ret?void 0:ret}}},prop:function(element,name,value){return isDefined(value)?void(element[name]=value):element[name]},text:function(){function getText(element,value){if(isUndefined(value)){var nodeType=element.nodeType;return nodeType===NODE_TYPE_ELEMENT||nodeType===NODE_TYPE_TEXT?element.textContent:""}element.textContent=value}return getText.$dv="",getText}(),val:function(element,value){if(isUndefined(value)){if(element.multiple&&"select"===nodeName_(element)){var result=[];return forEach(element.options,function(option){option.selected&&result.push(option.value||option.text)}),0===result.length?null:result}return element.value}element.value=value},html:function(element,value){return isUndefined(value)?element.innerHTML:(jqLiteDealoc(element,!0),void(element.innerHTML=value))},empty:jqLiteEmpty},function(fn,name){JQLite.prototype[name]=function(arg1,arg2){var i,key,nodeCount=this.length;if(fn!==jqLiteEmpty&&isUndefined(2==fn.length&&fn!==jqLiteHasClass&&fn!==jqLiteController?arg1:arg2)){if(isObject(arg1)){for(i=0;i=0?type.split(" "):[type],i=types.length,addHandler=function(type,specialHandlerWrapper,noEventListener){var eventFns=events[type];eventFns||(eventFns=events[type]=[],eventFns.specialHandlerWrapper=specialHandlerWrapper,"$destroy"===type||noEventListener||addEventListenerFn(element,type,handle)),eventFns.push(fn)};i--;)type=types[i],MOUSE_EVENT_MAP[type]?(addHandler(MOUSE_EVENT_MAP[type],specialMouseHandlerWrapper),addHandler(type,void 0,!0)):addHandler(type)}},off:jqLiteOff,one:function(element,type,fn){element=jqLite(element),element.on(type,function onFn(){element.off(type,fn),element.off(type,onFn)}),element.on(type,fn)},replaceWith:function(element,replaceNode){var index,parent=element.parentNode;jqLiteDealoc(element),forEach(new JQLite(replaceNode),function(node){index?parent.insertBefore(node,index.nextSibling):parent.replaceChild(node,element),index=node})},children:function(element){var children=[];return forEach(element.childNodes,function(element){element.nodeType===NODE_TYPE_ELEMENT&&children.push(element)}),children},contents:function(element){return element.contentDocument||element.childNodes||[]},append:function(element,node){var nodeType=element.nodeType;if(nodeType===NODE_TYPE_ELEMENT||nodeType===NODE_TYPE_DOCUMENT_FRAGMENT){node=new JQLite(node);for(var i=0,ii=node.length;i/,FN_ARGS=/^[^\(]*\(\s*([^\)]*)\)/m,FN_ARG_SPLIT=/,/,FN_ARG=/^\s*(_?)(\S+?)\1\s*$/,STRIP_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,$injectorMinErr=minErr("$injector");createInjector.$$annotate=annotate;var $animateMinErr=minErr("$animate"),ELEMENT_NODE=1,NG_ANIMATE_CLASSNAME="ng-animate",$$CoreAnimateJsProvider=function(){this.$get=noop},$$CoreAnimateQueueProvider=function(){var postDigestQueue=new HashMap,postDigestElements=[];this.$get=["$$AnimateRunner","$rootScope",function($$AnimateRunner,$rootScope){function updateData(data,classes,value){var changed=!1;return classes&&(classes=isString(classes)?classes.split(" "):isArray(classes)?classes:[],forEach(classes,function(className){className&&(changed=!0,data[className]=value)})),changed}function handleCSSClassChanges(){forEach(postDigestElements,function(element){var data=postDigestQueue.get(element);if(data){var existing=splitClasses(element.attr("class")),toAdd="",toRemove="";forEach(data,function(status,className){var hasClass=!!existing[className];status!==hasClass&&(status?toAdd+=(toAdd.length?" ":"")+className:toRemove+=(toRemove.length?" ":"")+className)}),forEach(element,function(elm){toAdd&&jqLiteAddClass(elm,toAdd),toRemove&&jqLiteRemoveClass(elm,toRemove)}),postDigestQueue.remove(element)}}),postDigestElements.length=0}function addRemoveClassesPostDigest(element,add,remove){var data=postDigestQueue.get(element)||{},classesAdded=updateData(data,add,!0),classesRemoved=updateData(data,remove,!1);(classesAdded||classesRemoved)&&(postDigestQueue.put(element,data),postDigestElements.push(element),1===postDigestElements.length&&$rootScope.$$postDigest(handleCSSClassChanges))}return{enabled:noop,on:noop,off:noop,pin:noop,push:function(element,event,options,domOperation){domOperation&&domOperation(),options=options||{},options.from&&element.css(options.from),options.to&&element.css(options.to),(options.addClass||options.removeClass)&&addRemoveClassesPostDigest(element,options.addClass,options.removeClass);var runner=new $$AnimateRunner;return runner.complete(),runner}}}]},$AnimateProvider=["$provide",function($provide){var provider=this;this.$$registeredAnimations=Object.create(null),this.register=function(name,factory){if(name&&"."!==name.charAt(0))throw $animateMinErr("notcsel","Expecting class selector starting with '.' got '{0}'.",name);var key=name+"-animation";provider.$$registeredAnimations[name.substr(1)]=key,$provide.factory(key,factory)},this.classNameFilter=function(expression){if(1===arguments.length&&(this.$$classNameFilter=expression instanceof RegExp?expression:null,this.$$classNameFilter)){var reservedRegex=new RegExp("(\\s+|\\/)"+NG_ANIMATE_CLASSNAME+"(\\s+|\\/)");if(reservedRegex.test(this.$$classNameFilter.toString()))throw $animateMinErr("nongcls",'$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.',NG_ANIMATE_CLASSNAME)}return this.$$classNameFilter},this.$get=["$$animateQueue",function($$animateQueue){function domInsert(element,parentElement,afterElement){if(afterElement){var afterNode=extractElementNode(afterElement);!afterNode||afterNode.parentNode||afterNode.previousElementSibling||(afterElement=null)}afterElement?afterElement.after(element):parentElement.prepend(element)}return{on:$$animateQueue.on,off:$$animateQueue.off,pin:$$animateQueue.pin,enabled:$$animateQueue.enabled,cancel:function(runner){runner.end&&runner.end()},enter:function(element,parent,after,options){return parent=parent&&jqLite(parent),after=after&&jqLite(after),parent=parent||after.parent(),domInsert(element,parent,after),$$animateQueue.push(element,"enter",prepareAnimateOptions(options))},move:function(element,parent,after,options){return parent=parent&&jqLite(parent),after=after&&jqLite(after),parent=parent||after.parent(),domInsert(element,parent,after),$$animateQueue.push(element,"move",prepareAnimateOptions(options))},leave:function(element,options){return $$animateQueue.push(element,"leave",prepareAnimateOptions(options),function(){element.remove()})},addClass:function(element,className,options){return options=prepareAnimateOptions(options),options.addClass=mergeClasses(options.addclass,className),$$animateQueue.push(element,"addClass",options)},removeClass:function(element,className,options){return options=prepareAnimateOptions(options),options.removeClass=mergeClasses(options.removeClass,className),$$animateQueue.push(element,"removeClass",options)},setClass:function(element,add,remove,options){return options=prepareAnimateOptions(options),options.addClass=mergeClasses(options.addClass,add),options.removeClass=mergeClasses(options.removeClass,remove),$$animateQueue.push(element,"setClass",options)},animate:function(element,from,to,className,options){return options=prepareAnimateOptions(options),options.from=options.from?extend(options.from,from):from,options.to=options.to?extend(options.to,to):to,className=className||"ng-inline-animate",options.tempClasses=mergeClasses(options.tempClasses,className),$$animateQueue.push(element,"animate",options)}}}]}],$$AnimateAsyncRunFactoryProvider=function(){this.$get=["$$rAF",function($$rAF){function waitForTick(fn){waitQueue.push(fn),waitQueue.length>1||$$rAF(function(){for(var i=0;i <= >= && || ! = |".split(" "),function(operator){OPERATORS[operator]=!0});var ESCAPE={n:"\n",f:"\f",r:"\r",t:"\t",v:"\x0B","'":"'",'"':'"'},Lexer=function(options){this.options=options};Lexer.prototype={constructor:Lexer,lex:function(text){for(this.text=text,this.index=0,this.tokens=[];this.index=55296&&cp1<=56319&&cp2>=56320&&cp2<=57343?ch+peek:ch},isExpOperator:function(ch){return"-"===ch||"+"===ch||this.isNumber(ch)},throwError:function(error,start,end){end=end||this.index;var colStr=isDefined(start)?"s "+start+"-"+this.index+" ["+this.text.substring(start,end)+"]":" "+end;throw $parseMinErr("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",error,colStr,this.text)},readNumber:function(){for(var number="",start=this.index;this.index0&&!this.peek("}",")",";","]")&&body.push(this.expressionStatement()),!this.expect(";"))return{type:AST.Program,body:body}},expressionStatement:function(){return{type:AST.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var token,left=this.expression();token=this.expect("|");)left=this.filter(left);return left},expression:function(){return this.assignment()},assignment:function(){var result=this.ternary();return this.expect("=")&&(result={type:AST.AssignmentExpression,left:result,right:this.assignment(),operator:"="}),result},ternary:function(){var alternate,consequent,test=this.logicalOR();return this.expect("?")&&(alternate=this.expression(),this.consume(":"))?(consequent=this.expression(),{type:AST.ConditionalExpression,test:test,alternate:alternate,consequent:consequent}):test},logicalOR:function(){for(var left=this.logicalAND();this.expect("||");)left={type:AST.LogicalExpression,operator:"||",left:left,right:this.logicalAND()};return left},logicalAND:function(){for(var left=this.equality();this.expect("&&");)left={type:AST.LogicalExpression,operator:"&&",left:left,right:this.equality()};return left},equality:function(){for(var token,left=this.relational();token=this.expect("==","!=","===","!==");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.relational()};return left},relational:function(){for(var token,left=this.additive();token=this.expect("<",">","<=",">=");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.additive()};return left},additive:function(){for(var token,left=this.multiplicative();token=this.expect("+","-");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.multiplicative()};return left},multiplicative:function(){for(var token,left=this.unary();token=this.expect("*","/","%");)left={type:AST.BinaryExpression,operator:token.text,left:left,right:this.unary()};return left},unary:function(){var token;return(token=this.expect("+","-","!"))?{type:AST.UnaryExpression,operator:token.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var primary;this.expect("(")?(primary=this.filterChain(),this.consume(")")):this.expect("[")?primary=this.arrayDeclaration():this.expect("{")?primary=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?primary=copy(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?primary={type:AST.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?primary=this.identifier():this.peek().constant?primary=this.constant():this.throwError("not a primary expression",this.peek());for(var next;next=this.expect("(","[",".");)"("===next.text?(primary={type:AST.CallExpression,callee:primary,arguments:this.parseArguments()},this.consume(")")):"["===next.text?(primary={type:AST.MemberExpression,object:primary,property:this.expression(),computed:!0},this.consume("]")):"."===next.text?primary={type:AST.MemberExpression,object:primary,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return primary},filter:function(baseExpression){for(var args=[baseExpression],result={type:AST.CallExpression,callee:this.identifier(),arguments:args,filter:!0};this.expect(":");)args.push(this.expression());return result},parseArguments:function(){var args=[];if(")"!==this.peekToken().text)do args.push(this.filterChain());while(this.expect(","));return args},identifier:function(){var token=this.consume();return token.identifier||this.throwError("is not a valid identifier",token),{type:AST.Identifier,name:token.text}},constant:function(){return{type:AST.Literal,value:this.consume().value}},arrayDeclaration:function(){var elements=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;elements.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:AST.ArrayExpression,elements:elements}},object:function(){var property,properties=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;
+property={type:AST.Property,kind:"init"},this.peek().constant?(property.key=this.constant(),property.computed=!1,this.consume(":"),property.value=this.expression()):this.peek().identifier?(property.key=this.identifier(),property.computed=!1,this.peek(":")?(this.consume(":"),property.value=this.expression()):property.value=property.key):this.peek("[")?(this.consume("["),property.key=this.expression(),this.consume("]"),property.computed=!0,this.consume(":"),property.value=this.expression()):this.throwError("invalid key",this.peek()),properties.push(property)}while(this.expect(","));return this.consume("}"),{type:AST.ObjectExpression,properties:properties}},throwError:function(msg,token){throw $parseMinErr("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",token.text,msg,token.index+1,this.text,this.text.substring(token.index))},consume:function(e1){if(0===this.tokens.length)throw $parseMinErr("ueoe","Unexpected end of expression: {0}",this.text);var token=this.expect(e1);return token||this.throwError("is unexpected, expecting ["+e1+"]",this.peek()),token},peekToken:function(){if(0===this.tokens.length)throw $parseMinErr("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4)},peekAhead:function(i,e1,e2,e3,e4){if(this.tokens.length>i){var token=this.tokens[i],t=token.text;if(t===e1||t===e2||t===e3||t===e4||!e1&&!e2&&!e3&&!e4)return token}return!1},expect:function(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);return!!token&&(this.tokens.shift(),token)},selfReferential:{"this":{type:AST.ThisExpression},$locals:{type:AST.LocalsExpression}}},ASTCompiler.prototype={compile:function(expression,expensiveChecks){var self=this,ast=this.astBuilder.ast(expression);this.state={nextId:0,filters:{},expensiveChecks:expensiveChecks,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},findConstantAndWatchExpressions(ast,self.$filter);var assignable,extra="";if(this.stage="assign",assignable=assignableAST(ast)){this.state.computing="assign";var result=this.nextId();this.recurse(assignable,result),this.return_(result),extra="fn.assign="+this.generateFunction("assign","s,v,l")}var toWatch=getInputs(ast.body);self.stage="inputs",forEach(toWatch,function(watch,key){var fnKey="fn"+key;self.state[fnKey]={vars:[],body:[],own:{}},self.state.computing=fnKey;var intoId=self.nextId();self.recurse(watch,intoId),self.return_(intoId),self.state.inputs.push(fnKey),watch.watchId=key}),this.state.computing="fn",this.stage="main",this.recurse(ast);var fnString='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+extra+this.watchFns()+"return fn;",fn=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",fnString)(this.$filter,ensureSafeMemberName,ensureSafeObject,ensureSafeFunction,getStringValue,ensureSafeAssignContext,ifDefined,plusFn,expression);return this.state=this.stage=void 0,fn.literal=isLiteral(ast),fn.constant=isConstant(ast),fn},USE:"use",STRICT:"strict",watchFns:function(){var result=[],fns=this.state.inputs,self=this;return forEach(fns,function(name){result.push("var "+name+"="+self.generateFunction(name,"s"))}),fns.length&&result.push("fn.inputs=["+fns.join(",")+"];"),result.join("")},generateFunction:function(name,params){return"function("+params+"){"+this.varsPrefix(name)+this.body(name)+"};"},filterPrefix:function(){var parts=[],self=this;return forEach(this.state.filters,function(id,filter){parts.push(id+"=$filter("+self.escape(filter)+")")}),parts.length?"var "+parts.join(",")+";":""},varsPrefix:function(section){return this.state[section].vars.length?"var "+this.state[section].vars.join(",")+";":""},body:function(section){return this.state[section].body.join("")},recurse:function(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck){var left,right,args,expression,computed,self=this;if(recursionFn=recursionFn||noop,!skipWatchIdCheck&&isDefined(ast.watchId))return intoId=intoId||this.nextId(),void this.if_("i",this.lazyAssign(intoId,this.computedMember("i",ast.watchId)),this.lazyRecurse(ast,intoId,nameId,recursionFn,create,!0));switch(ast.type){case AST.Program:forEach(ast.body,function(expression,pos){self.recurse(expression.expression,void 0,void 0,function(expr){right=expr}),pos!==ast.body.length-1?self.current().body.push(right,";"):self.return_(right)});break;case AST.Literal:expression=this.escape(ast.value),this.assign(intoId,expression),recursionFn(expression);break;case AST.UnaryExpression:this.recurse(ast.argument,void 0,void 0,function(expr){right=expr}),expression=ast.operator+"("+this.ifDefined(right,0)+")",this.assign(intoId,expression),recursionFn(expression);break;case AST.BinaryExpression:this.recurse(ast.left,void 0,void 0,function(expr){left=expr}),this.recurse(ast.right,void 0,void 0,function(expr){right=expr}),expression="+"===ast.operator?this.plus(left,right):"-"===ast.operator?this.ifDefined(left,0)+ast.operator+this.ifDefined(right,0):"("+left+")"+ast.operator+"("+right+")",this.assign(intoId,expression),recursionFn(expression);break;case AST.LogicalExpression:intoId=intoId||this.nextId(),self.recurse(ast.left,intoId),self.if_("&&"===ast.operator?intoId:self.not(intoId),self.lazyRecurse(ast.right,intoId)),recursionFn(intoId);break;case AST.ConditionalExpression:intoId=intoId||this.nextId(),self.recurse(ast.test,intoId),self.if_(intoId,self.lazyRecurse(ast.alternate,intoId),self.lazyRecurse(ast.consequent,intoId)),recursionFn(intoId);break;case AST.Identifier:intoId=intoId||this.nextId(),nameId&&(nameId.context="inputs"===self.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",ast.name)+"?l:s"),nameId.computed=!1,nameId.name=ast.name),ensureSafeMemberName(ast.name),self.if_("inputs"===self.stage||self.not(self.getHasOwnProperty("l",ast.name)),function(){self.if_("inputs"===self.stage||"s",function(){create&&1!==create&&self.if_(self.not(self.nonComputedMember("s",ast.name)),self.lazyAssign(self.nonComputedMember("s",ast.name),"{}")),self.assign(intoId,self.nonComputedMember("s",ast.name))})},intoId&&self.lazyAssign(intoId,self.nonComputedMember("l",ast.name))),(self.state.expensiveChecks||isPossiblyDangerousMemberName(ast.name))&&self.addEnsureSafeObject(intoId),recursionFn(intoId);break;case AST.MemberExpression:left=nameId&&(nameId.context=this.nextId())||this.nextId(),intoId=intoId||this.nextId(),self.recurse(ast.object,left,void 0,function(){self.if_(self.notNull(left),function(){create&&1!==create&&self.addEnsureSafeAssignContext(left),ast.computed?(right=self.nextId(),self.recurse(ast.property,right),self.getStringValue(right),self.addEnsureSafeMemberName(right),create&&1!==create&&self.if_(self.not(self.computedMember(left,right)),self.lazyAssign(self.computedMember(left,right),"{}")),expression=self.ensureSafeObject(self.computedMember(left,right)),self.assign(intoId,expression),nameId&&(nameId.computed=!0,nameId.name=right)):(ensureSafeMemberName(ast.property.name),create&&1!==create&&self.if_(self.not(self.nonComputedMember(left,ast.property.name)),self.lazyAssign(self.nonComputedMember(left,ast.property.name),"{}")),expression=self.nonComputedMember(left,ast.property.name),(self.state.expensiveChecks||isPossiblyDangerousMemberName(ast.property.name))&&(expression=self.ensureSafeObject(expression)),self.assign(intoId,expression),nameId&&(nameId.computed=!1,nameId.name=ast.property.name))},function(){self.assign(intoId,"undefined")}),recursionFn(intoId)},!!create);break;case AST.CallExpression:intoId=intoId||this.nextId(),ast.filter?(right=self.filter(ast.callee.name),args=[],forEach(ast.arguments,function(expr){var argument=self.nextId();self.recurse(expr,argument),args.push(argument)}),expression=right+"("+args.join(",")+")",self.assign(intoId,expression),recursionFn(intoId)):(right=self.nextId(),left={},args=[],self.recurse(ast.callee,right,left,function(){self.if_(self.notNull(right),function(){self.addEnsureSafeFunction(right),forEach(ast.arguments,function(expr){self.recurse(expr,self.nextId(),void 0,function(argument){args.push(self.ensureSafeObject(argument))})}),left.name?(self.state.expensiveChecks||self.addEnsureSafeObject(left.context),expression=self.member(left.context,left.name,left.computed)+"("+args.join(",")+")"):expression=right+"("+args.join(",")+")",expression=self.ensureSafeObject(expression),self.assign(intoId,expression)},function(){self.assign(intoId,"undefined")}),recursionFn(intoId)}));break;case AST.AssignmentExpression:if(right=this.nextId(),left={},!isAssignable(ast.left))throw $parseMinErr("lval","Trying to assign a value to a non l-value");this.recurse(ast.left,void 0,left,function(){self.if_(self.notNull(left.context),function(){self.recurse(ast.right,right),self.addEnsureSafeObject(self.member(left.context,left.name,left.computed)),self.addEnsureSafeAssignContext(left.context),expression=self.member(left.context,left.name,left.computed)+ast.operator+right,self.assign(intoId,expression),recursionFn(intoId||expression)})},1);break;case AST.ArrayExpression:args=[],forEach(ast.elements,function(expr){self.recurse(expr,self.nextId(),void 0,function(argument){args.push(argument)})}),expression="["+args.join(",")+"]",this.assign(intoId,expression),recursionFn(expression);break;case AST.ObjectExpression:args=[],computed=!1,forEach(ast.properties,function(property){property.computed&&(computed=!0)}),computed?(intoId=intoId||this.nextId(),this.assign(intoId,"{}"),forEach(ast.properties,function(property){property.computed?(left=self.nextId(),self.recurse(property.key,left)):left=property.key.type===AST.Identifier?property.key.name:""+property.key.value,right=self.nextId(),self.recurse(property.value,right),self.assign(self.member(intoId,left,property.computed),right)})):(forEach(ast.properties,function(property){self.recurse(property.value,ast.constant?void 0:self.nextId(),void 0,function(expr){args.push(self.escape(property.key.type===AST.Identifier?property.key.name:""+property.key.value)+":"+expr)})}),expression="{"+args.join(",")+"}",this.assign(intoId,expression)),recursionFn(intoId||expression);break;case AST.ThisExpression:this.assign(intoId,"s"),recursionFn("s");break;case AST.LocalsExpression:this.assign(intoId,"l"),recursionFn("l");break;case AST.NGValueParameter:this.assign(intoId,"v"),recursionFn("v")}},getHasOwnProperty:function(element,property){var key=element+"."+property,own=this.current().own;return own.hasOwnProperty(key)||(own[key]=this.nextId(!1,element+"&&("+this.escape(property)+" in "+element+")")),own[key]},assign:function(id,value){if(id)return this.current().body.push(id,"=",value,";"),id},filter:function(filterName){return this.state.filters.hasOwnProperty(filterName)||(this.state.filters[filterName]=this.nextId(!0)),this.state.filters[filterName]},ifDefined:function(id,defaultValue){return"ifDefined("+id+","+this.escape(defaultValue)+")"},plus:function(left,right){return"plus("+left+","+right+")"},return_:function(id){this.current().body.push("return ",id,";")},if_:function(test,alternate,consequent){if(test===!0)alternate();else{var body=this.current().body;body.push("if(",test,"){"),alternate(),body.push("}"),consequent&&(body.push("else{"),consequent(),body.push("}"))}},not:function(expression){return"!("+expression+")"},notNull:function(expression){return expression+"!=null"},nonComputedMember:function(left,right){var SAFE_IDENTIFIER=/[$_a-zA-Z][$_a-zA-Z0-9]*/,UNSAFE_CHARACTERS=/[^$_a-zA-Z0-9]/g;return SAFE_IDENTIFIER.test(right)?left+"."+right:left+'["'+right.replace(UNSAFE_CHARACTERS,this.stringEscapeFn)+'"]'},computedMember:function(left,right){return left+"["+right+"]"},member:function(left,right,computed){return computed?this.computedMember(left,right):this.nonComputedMember(left,right)},addEnsureSafeObject:function(item){this.current().body.push(this.ensureSafeObject(item),";")},addEnsureSafeMemberName:function(item){this.current().body.push(this.ensureSafeMemberName(item),";")},addEnsureSafeFunction:function(item){this.current().body.push(this.ensureSafeFunction(item),";")},addEnsureSafeAssignContext:function(item){this.current().body.push(this.ensureSafeAssignContext(item),";")},ensureSafeObject:function(item){return"ensureSafeObject("+item+",text)"},ensureSafeMemberName:function(item){return"ensureSafeMemberName("+item+",text)"},ensureSafeFunction:function(item){return"ensureSafeFunction("+item+",text)"},getStringValue:function(item){this.assign(item,"getStringValue("+item+")")},ensureSafeAssignContext:function(item){return"ensureSafeAssignContext("+item+",text)"},lazyRecurse:function(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck){var self=this;return function(){self.recurse(ast,intoId,nameId,recursionFn,create,skipWatchIdCheck)}},lazyAssign:function(id,value){var self=this;return function(){self.assign(id,value)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)},escape:function(value){if(isString(value))return"'"+value.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(isNumber(value))return value.toString();if(value===!0)return"true";if(value===!1)return"false";if(null===value)return"null";if("undefined"==typeof value)return"undefined";throw $parseMinErr("esc","IMPOSSIBLE")},nextId:function(skip,init){var id="v"+this.state.nextId++;return skip||this.current().vars.push(id+(init?"="+init:"")),id},current:function(){return this.state[this.state.computing]}},ASTInterpreter.prototype={compile:function(expression,expensiveChecks){var self=this,ast=this.astBuilder.ast(expression);this.expression=expression,this.expensiveChecks=expensiveChecks,findConstantAndWatchExpressions(ast,self.$filter);var assignable,assign;(assignable=assignableAST(ast))&&(assign=this.recurse(assignable));var inputs,toWatch=getInputs(ast.body);toWatch&&(inputs=[],forEach(toWatch,function(watch,key){var input=self.recurse(watch);watch.input=input,inputs.push(input),watch.watchId=key}));var expressions=[];forEach(ast.body,function(expression){expressions.push(self.recurse(expression.expression))});var fn=0===ast.body.length?noop:1===ast.body.length?expressions[0]:function(scope,locals){var lastValue;return forEach(expressions,function(exp){lastValue=exp(scope,locals)}),lastValue};return assign&&(fn.assign=function(scope,value,locals){return assign(scope,locals,value)}),inputs&&(fn.inputs=inputs),fn.literal=isLiteral(ast),fn.constant=isConstant(ast),fn},recurse:function(ast,context,create){var left,right,args,self=this;if(ast.input)return this.inputs(ast.input,ast.watchId);switch(ast.type){case AST.Literal:return this.value(ast.value,context);case AST.UnaryExpression:return right=this.recurse(ast.argument),this["unary"+ast.operator](right,context);case AST.BinaryExpression:return left=this.recurse(ast.left),right=this.recurse(ast.right),this["binary"+ast.operator](left,right,context);case AST.LogicalExpression:return left=this.recurse(ast.left),right=this.recurse(ast.right),this["binary"+ast.operator](left,right,context);case AST.ConditionalExpression:return this["ternary?:"](this.recurse(ast.test),this.recurse(ast.alternate),this.recurse(ast.consequent),context);case AST.Identifier:return ensureSafeMemberName(ast.name,self.expression),self.identifier(ast.name,self.expensiveChecks||isPossiblyDangerousMemberName(ast.name),context,create,self.expression);case AST.MemberExpression:return left=this.recurse(ast.object,!1,!!create),ast.computed||(ensureSafeMemberName(ast.property.name,self.expression),right=ast.property.name),ast.computed&&(right=this.recurse(ast.property)),ast.computed?this.computedMember(left,right,context,create,self.expression):this.nonComputedMember(left,right,self.expensiveChecks,context,create,self.expression);case AST.CallExpression:return args=[],forEach(ast.arguments,function(expr){args.push(self.recurse(expr))}),ast.filter&&(right=this.$filter(ast.callee.name)),ast.filter||(right=this.recurse(ast.callee,!0)),ast.filter?function(scope,locals,assign,inputs){for(var values=[],i=0;i":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)>right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary<=":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)<=right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary>=":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)>=right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary&&":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)&&right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"binary||":function(left,right,context){return function(scope,locals,assign,inputs){var arg=left(scope,locals,assign,inputs)||right(scope,locals,assign,inputs);return context?{value:arg}:arg}},"ternary?:":function(test,alternate,consequent,context){return function(scope,locals,assign,inputs){var arg=test(scope,locals,assign,inputs)?alternate(scope,locals,assign,inputs):consequent(scope,locals,assign,inputs);return context?{value:arg}:arg}},value:function(value,context){return function(){return context?{context:void 0,name:void 0,value:value}:value}},identifier:function(name,expensiveChecks,context,create,expression){return function(scope,locals,assign,inputs){var base=locals&&name in locals?locals:scope;create&&1!==create&&base&&!base[name]&&(base[name]={});var value=base?base[name]:void 0;return expensiveChecks&&ensureSafeObject(value,expression),context?{context:base,name:name,value:value}:value}},computedMember:function(left,right,context,create,expression){return function(scope,locals,assign,inputs){var rhs,value,lhs=left(scope,locals,assign,inputs);return null!=lhs&&(rhs=right(scope,locals,assign,inputs),rhs=getStringValue(rhs),ensureSafeMemberName(rhs,expression),create&&1!==create&&(ensureSafeAssignContext(lhs),lhs&&!lhs[rhs]&&(lhs[rhs]={})),value=lhs[rhs],ensureSafeObject(value,expression)),context?{context:lhs,name:rhs,value:value}:value}},nonComputedMember:function(left,right,expensiveChecks,context,create,expression){return function(scope,locals,assign,inputs){var lhs=left(scope,locals,assign,inputs);create&&1!==create&&(ensureSafeAssignContext(lhs),lhs&&!lhs[right]&&(lhs[right]={}));var value=null!=lhs?lhs[right]:void 0;return(expensiveChecks||isPossiblyDangerousMemberName(right))&&ensureSafeObject(value,expression),context?{context:lhs,name:right,value:value}:value}},inputs:function(input,watchId){return function(scope,value,locals,inputs){return inputs?inputs[watchId]:input(scope,value,locals)}}};var Parser=function(lexer,$filter,options){this.lexer=lexer,this.$filter=$filter,this.options=options,this.ast=new AST(lexer,options),this.astCompiler=options.csp?new ASTInterpreter(this.ast,$filter):new ASTCompiler(this.ast,$filter)};Parser.prototype={constructor:Parser,parse:function(text){return this.astCompiler.compile(text,this.options.expensiveChecks)}};var objectValueOf=Object.prototype.valueOf,$sceMinErr=minErr("$sce"),SCE_CONTEXTS={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},$templateRequestMinErr=minErr("$compile"),urlParsingNode=window.document.createElement("a"),originUrl=urlResolve(window.location.href);$$CookieReader.$inject=["$document"],$FilterProvider.$inject=["$provide"];var MAX_DIGITS=22,DECIMAL_SEP=".",ZERO_CHAR="0";currencyFilter.$inject=["$locale"],numberFilter.$inject=["$locale"];var DATE_FORMATS={yyyy:dateGetter("FullYear",4,0,!1,!0),yy:dateGetter("FullYear",2,0,!0,!0),y:dateGetter("FullYear",1,0,!1,!0),MMMM:dateStrGetter("Month"),MMM:dateStrGetter("Month",!0),MM:dateGetter("Month",2,1),M:dateGetter("Month",1,1),LLLL:dateStrGetter("Month",!1,!0),dd:dateGetter("Date",2),d:dateGetter("Date",1),HH:dateGetter("Hours",2),H:dateGetter("Hours",1),hh:dateGetter("Hours",2,-12),h:dateGetter("Hours",1,-12),mm:dateGetter("Minutes",2),m:dateGetter("Minutes",1),ss:dateGetter("Seconds",2),s:dateGetter("Seconds",1),sss:dateGetter("Milliseconds",3),EEEE:dateStrGetter("Day"),EEE:dateStrGetter("Day",!0),a:ampmGetter,Z:timeZoneGetter,ww:weekGetter(2),w:weekGetter(1),G:eraGetter,GG:eraGetter,GGG:eraGetter,GGGG:longEraGetter},DATE_FORMATS_SPLIT=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,NUMBER_STRING=/^\-?\d+$/;dateFilter.$inject=["$locale"];var lowercaseFilter=valueFn(lowercase),uppercaseFilter=valueFn(uppercase);orderByFilter.$inject=["$parse"];var htmlAnchorDirective=valueFn({restrict:"E",compile:function(element,attr){if(!attr.href&&!attr.xlinkHref)return function(scope,element){if("a"===element[0].nodeName.toLowerCase()){var href="[object SVGAnimatedString]"===toString.call(element.prop("href"))?"xlink:href":"href";element.on("click",function(event){element.attr(href)||event.preventDefault()})}}}}),ngAttributeAliasDirectives={};forEach(BOOLEAN_ATTR,function(propName,attrName){function defaultLinkFn(scope,element,attr){scope.$watch(attr[normalized],function(value){attr.$set(attrName,!!value)})}if("multiple"!=propName){var normalized=directiveNormalize("ng-"+attrName),linkFn=defaultLinkFn;"checked"===propName&&(linkFn=function(scope,element,attr){attr.ngModel!==attr[normalized]&&defaultLinkFn(scope,element,attr)}),ngAttributeAliasDirectives[normalized]=function(){return{restrict:"A",priority:100,link:linkFn}}}}),forEach(ALIASED_ATTR,function(htmlAttr,ngAttr){ngAttributeAliasDirectives[ngAttr]=function(){return{priority:100,link:function(scope,element,attr){if("ngPattern"===ngAttr&&"/"==attr.ngPattern.charAt(0)){var match=attr.ngPattern.match(REGEX_STRING_REGEXP);if(match)return void attr.$set("ngPattern",new RegExp(match[1],match[2]))}scope.$watch(attr[ngAttr],function(value){attr.$set(ngAttr,value)})}}}}),forEach(["src","srcset","href"],function(attrName){var normalized=directiveNormalize("ng-"+attrName);ngAttributeAliasDirectives[normalized]=function(){return{priority:99,link:function(scope,element,attr){var propName=attrName,name=attrName;"href"===attrName&&"[object SVGAnimatedString]"===toString.call(element.prop("href"))&&(name="xlinkHref",attr.$attr[name]="xlink:href",propName=null),attr.$observe(normalized,function(value){return value?(attr.$set(name,value),void(msie&&propName&&element.prop(propName,attr[name]))):void("href"===attrName&&attr.$set(name,null))})}}}});var nullFormCtrl={$addControl:noop,$$renameControl:nullFormRenameControl,$removeControl:noop,$setValidity:noop,$setDirty:noop,$setPristine:noop,$setSubmitted:noop},SUBMITTED_CLASS="ng-submitted";FormController.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var formDirectiveFactory=function(isNgForm){return["$timeout","$parse",function($timeout,$parse){function getSetter(expression){return""===expression?$parse('this[""]').assign:$parse(expression).assign||noop}var formDirective={name:"form",restrict:isNgForm?"EAC":"E",require:["form","^^?form"],controller:FormController,compile:function(formElement,attr){formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);var nameAttr=attr.name?"name":!(!isNgForm||!attr.ngForm)&&"ngForm";return{pre:function(scope,formElement,attr,ctrls){var controller=ctrls[0];if(!("action"in attr)){var handleFormSubmission=function(event){scope.$apply(function(){controller.$commitViewValue(),controller.$setSubmitted()}),event.preventDefault()};addEventListenerFn(formElement[0],"submit",handleFormSubmission),formElement.on("$destroy",function(){$timeout(function(){removeEventListenerFn(formElement[0],"submit",handleFormSubmission)},0,!1)})}var parentFormCtrl=ctrls[1]||controller.$$parentForm;parentFormCtrl.$addControl(controller);var setter=nameAttr?getSetter(controller.$name):noop;nameAttr&&(setter(scope,controller),attr.$observe(nameAttr,function(newValue){controller.$name!==newValue&&(setter(scope,void 0),controller.$$parentForm.$$renameControl(controller,newValue),(setter=getSetter(controller.$name))(scope,controller))})),formElement.on("$destroy",function(){controller.$$parentForm.$removeControl(controller),setter(scope,void 0),extend(controller,nullFormCtrl)})}}}};return formDirective}]},formDirective=formDirectiveFactory(),ngFormDirective=formDirectiveFactory(!0),ISO_DATE_REGEXP=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,URL_REGEXP=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:\/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,EMAIL_REGEXP=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,NUMBER_REGEXP=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,DATE_REGEXP=/^(\d{4,})-(\d{2})-(\d{2})$/,DATETIMELOCAL_REGEXP=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,WEEK_REGEXP=/^(\d{4,})-W(\d\d)$/,MONTH_REGEXP=/^(\d{4,})-(\d\d)$/,TIME_REGEXP=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,PARTIAL_VALIDATION_EVENTS="keydown wheel mousedown",PARTIAL_VALIDATION_TYPES=createMap();forEach("date,datetime-local,month,time,week".split(","),function(type){PARTIAL_VALIDATION_TYPES[type]=!0});var inputType={text:textInputType,date:createDateInputType("date",DATE_REGEXP,createDateParser(DATE_REGEXP,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":createDateInputType("datetimelocal",DATETIMELOCAL_REGEXP,createDateParser(DATETIMELOCAL_REGEXP,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:createDateInputType("time",TIME_REGEXP,createDateParser(TIME_REGEXP,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:createDateInputType("week",WEEK_REGEXP,weekParser,"yyyy-Www"),month:createDateInputType("month",MONTH_REGEXP,createDateParser(MONTH_REGEXP,["yyyy","MM"]),"yyyy-MM"),number:numberInputType,url:urlInputType,email:emailInputType,radio:radioInputType,checkbox:checkboxInputType,hidden:noop,button:noop,submit:noop,reset:noop,file:noop},inputDirective=["$browser","$sniffer","$filter","$parse",function($browser,$sniffer,$filter,$parse){return{restrict:"E",require:["?ngModel"],link:{pre:function(scope,element,attr,ctrls){ctrls[0]&&(inputType[lowercase(attr.type)]||inputType.text)(scope,element,attr,ctrls[0],$sniffer,$browser,$filter,$parse)}}}}],CONSTANT_VALUE_REGEXP=/^(true|false|\d+)$/,ngValueDirective=function(){return{restrict:"A",priority:100,compile:function(tpl,tplAttr){return CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)?function(scope,elm,attr){attr.$set("value",scope.$eval(attr.ngValue))}:function(scope,elm,attr){scope.$watch(attr.ngValue,function(value){attr.$set("value",value)})}}}},ngBindDirective=["$compile",function($compile){return{restrict:"AC",compile:function(templateElement){return $compile.$$addBindingClass(templateElement),function(scope,element,attr){$compile.$$addBindingInfo(element,attr.ngBind),element=element[0],scope.$watch(attr.ngBind,function(value){element.textContent=isUndefined(value)?"":value})}}}}],ngBindTemplateDirective=["$interpolate","$compile",function($interpolate,$compile){return{compile:function(templateElement){return $compile.$$addBindingClass(templateElement),function(scope,element,attr){var interpolateFn=$interpolate(element.attr(attr.$attr.ngBindTemplate));
+$compile.$$addBindingInfo(element,interpolateFn.expressions),element=element[0],attr.$observe("ngBindTemplate",function(value){element.textContent=isUndefined(value)?"":value})}}}}],ngBindHtmlDirective=["$sce","$parse","$compile",function($sce,$parse,$compile){return{restrict:"A",compile:function(tElement,tAttrs){var ngBindHtmlGetter=$parse(tAttrs.ngBindHtml),ngBindHtmlWatch=$parse(tAttrs.ngBindHtml,function(val){return $sce.valueOf(val)});return $compile.$$addBindingClass(tElement),function(scope,element,attr){$compile.$$addBindingInfo(element,attr.ngBindHtml),scope.$watch(ngBindHtmlWatch,function(){var value=ngBindHtmlGetter(scope);element.html($sce.getTrustedHtml(value)||"")})}}}}],ngChangeDirective=valueFn({restrict:"A",require:"ngModel",link:function(scope,element,attr,ctrl){ctrl.$viewChangeListeners.push(function(){scope.$eval(attr.ngChange)})}}),ngClassDirective=classDirective("",!0),ngClassOddDirective=classDirective("Odd",0),ngClassEvenDirective=classDirective("Even",1),ngCloakDirective=ngDirective({compile:function(element,attr){attr.$set("ngCloak",void 0),element.removeClass("ng-cloak")}}),ngControllerDirective=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],ngEventDirectives={},forceAsyncEvents={blur:!0,focus:!0};forEach("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(eventName){var directiveName=directiveNormalize("ng-"+eventName);ngEventDirectives[directiveName]=["$parse","$rootScope",function($parse,$rootScope){return{restrict:"A",compile:function($element,attr){var fn=$parse(attr[directiveName],null,!0);return function(scope,element){element.on(eventName,function(event){var callback=function(){fn(scope,{$event:event})};forceAsyncEvents[eventName]&&$rootScope.$$phase?scope.$evalAsync(callback):scope.$apply(callback)})}}}}]});var ngIfDirective=["$animate","$compile",function($animate,$compile){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function($scope,$element,$attr,ctrl,$transclude){var block,childScope,previousElements;$scope.$watch($attr.ngIf,function(value){value?childScope||$transclude(function(clone,newScope){childScope=newScope,clone[clone.length++]=$compile.$$createComment("end ngIf",$attr.ngIf),block={clone:clone},$animate.enter(clone,$element.parent(),$element)}):(previousElements&&(previousElements.remove(),previousElements=null),childScope&&(childScope.$destroy(),childScope=null),block&&(previousElements=getBlockNodes(block.clone),$animate.leave(previousElements).then(function(){previousElements=null}),block=null))})}}}],ngIncludeDirective=["$templateRequest","$anchorScroll","$animate",function($templateRequest,$anchorScroll,$animate){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:angular.noop,compile:function(element,attr){var srcExp=attr.ngInclude||attr.src,onloadExp=attr.onload||"",autoScrollExp=attr.autoscroll;return function(scope,$element,$attr,ctrl,$transclude){var currentScope,previousElement,currentElement,changeCounter=0,cleanupLastIncludeContent=function(){previousElement&&(previousElement.remove(),previousElement=null),currentScope&&(currentScope.$destroy(),currentScope=null),currentElement&&($animate.leave(currentElement).then(function(){previousElement=null}),previousElement=currentElement,currentElement=null)};scope.$watch(srcExp,function(src){var afterAnimation=function(){!isDefined(autoScrollExp)||autoScrollExp&&!scope.$eval(autoScrollExp)||$anchorScroll()},thisChangeId=++changeCounter;src?($templateRequest(src,!0).then(function(response){if(!scope.$$destroyed&&thisChangeId===changeCounter){var newScope=scope.$new();ctrl.template=response;var clone=$transclude(newScope,function(clone){cleanupLastIncludeContent(),$animate.enter(clone,null,$element).then(afterAnimation)});currentScope=newScope,currentElement=clone,currentScope.$emit("$includeContentLoaded",src),scope.$eval(onloadExp)}},function(){scope.$$destroyed||thisChangeId===changeCounter&&(cleanupLastIncludeContent(),scope.$emit("$includeContentError",src))}),scope.$emit("$includeContentRequested",src)):(cleanupLastIncludeContent(),ctrl.template=null)})}}}}],ngIncludeFillContentDirective=["$compile",function($compile){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(scope,$element,$attr,ctrl){return toString.call($element[0]).match(/SVG/)?($element.empty(),void $compile(jqLiteBuildFragment(ctrl.template,window.document).childNodes)(scope,function(clone){$element.append(clone)},{futureParentElement:$element})):($element.html(ctrl.template),void $compile($element.contents())(scope))}}}],ngInitDirective=ngDirective({priority:450,compile:function(){return{pre:function(scope,element,attrs){scope.$eval(attrs.ngInit)}}}}),ngListDirective=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(scope,element,attr,ctrl){var ngList=element.attr(attr.$attr.ngList)||", ",trimValues="false"!==attr.ngTrim,separator=trimValues?trim(ngList):ngList,parse=function(viewValue){if(!isUndefined(viewValue)){var list=[];return viewValue&&forEach(viewValue.split(separator),function(value){value&&list.push(trimValues?trim(value):value)}),list}};ctrl.$parsers.push(parse),ctrl.$formatters.push(function(value){if(isArray(value))return value.join(ngList)}),ctrl.$isEmpty=function(value){return!value||!value.length}}}},VALID_CLASS="ng-valid",INVALID_CLASS="ng-invalid",PRISTINE_CLASS="ng-pristine",DIRTY_CLASS="ng-dirty",UNTOUCHED_CLASS="ng-untouched",TOUCHED_CLASS="ng-touched",PENDING_CLASS="ng-pending",EMPTY_CLASS="ng-empty",NOT_EMPTY_CLASS="ng-not-empty",ngModelMinErr=minErr("ngModel"),NgModelController=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function($scope,$exceptionHandler,$attr,$element,$parse,$animate,$timeout,$rootScope,$q,$interpolate){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=void 0,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=void 0,this.$name=$interpolate($attr.name||"",!1)($scope),this.$$parentForm=nullFormCtrl;var parserValid,parsedNgModel=$parse($attr.ngModel),parsedNgModelAssign=parsedNgModel.assign,ngModelGet=parsedNgModel,ngModelSet=parsedNgModelAssign,pendingDebounce=null,ctrl=this;this.$$setOptions=function(options){if(ctrl.$options=options,options&&options.getterSetter){var invokeModelGetter=$parse($attr.ngModel+"()"),invokeModelSetter=$parse($attr.ngModel+"($$$p)");ngModelGet=function($scope){var modelValue=parsedNgModel($scope);return isFunction(modelValue)&&(modelValue=invokeModelGetter($scope)),modelValue},ngModelSet=function($scope,newValue){isFunction(parsedNgModel($scope))?invokeModelSetter($scope,{$$$p:newValue}):parsedNgModelAssign($scope,newValue)}}else if(!parsedNgModel.assign)throw ngModelMinErr("nonassign","Expression '{0}' is non-assignable. Element: {1}",$attr.ngModel,startingTag($element))},this.$render=noop,this.$isEmpty=function(value){return isUndefined(value)||""===value||null===value||value!==value},this.$$updateEmptyClasses=function(value){ctrl.$isEmpty(value)?($animate.removeClass($element,NOT_EMPTY_CLASS),$animate.addClass($element,EMPTY_CLASS)):($animate.removeClass($element,EMPTY_CLASS),$animate.addClass($element,NOT_EMPTY_CLASS))};var currentValidationRunId=0;addSetValidityMethod({ctrl:this,$element:$element,set:function(object,property){object[property]=!0},unset:function(object,property){delete object[property]},$animate:$animate}),this.$setPristine=function(){ctrl.$dirty=!1,ctrl.$pristine=!0,$animate.removeClass($element,DIRTY_CLASS),$animate.addClass($element,PRISTINE_CLASS)},this.$setDirty=function(){ctrl.$dirty=!0,ctrl.$pristine=!1,$animate.removeClass($element,PRISTINE_CLASS),$animate.addClass($element,DIRTY_CLASS),ctrl.$$parentForm.$setDirty()},this.$setUntouched=function(){ctrl.$touched=!1,ctrl.$untouched=!0,$animate.setClass($element,UNTOUCHED_CLASS,TOUCHED_CLASS)},this.$setTouched=function(){ctrl.$touched=!0,ctrl.$untouched=!1,$animate.setClass($element,TOUCHED_CLASS,UNTOUCHED_CLASS)},this.$rollbackViewValue=function(){$timeout.cancel(pendingDebounce),ctrl.$viewValue=ctrl.$$lastCommittedViewValue,ctrl.$render()},this.$validate=function(){if(!isNumber(ctrl.$modelValue)||!isNaN(ctrl.$modelValue)){var viewValue=ctrl.$$lastCommittedViewValue,modelValue=ctrl.$$rawModelValue,prevValid=ctrl.$valid,prevModelValue=ctrl.$modelValue,allowInvalid=ctrl.$options&&ctrl.$options.allowInvalid;ctrl.$$runValidators(modelValue,viewValue,function(allValid){allowInvalid||prevValid===allValid||(ctrl.$modelValue=allValid?modelValue:void 0,ctrl.$modelValue!==prevModelValue&&ctrl.$$writeModelToScope())})}},this.$$runValidators=function(modelValue,viewValue,doneCallback){function processParseErrors(){var errorKey=ctrl.$$parserName||"parse";return isUndefined(parserValid)?(setValidity(errorKey,null),!0):(parserValid||(forEach(ctrl.$validators,function(v,name){setValidity(name,null)}),forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null)})),setValidity(errorKey,parserValid),parserValid)}function processSyncValidators(){var syncValidatorsValid=!0;return forEach(ctrl.$validators,function(validator,name){var result=validator(modelValue,viewValue);syncValidatorsValid=syncValidatorsValid&&result,setValidity(name,result)}),!!syncValidatorsValid||(forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null)}),!1)}function processAsyncValidators(){var validatorPromises=[],allValid=!0;forEach(ctrl.$asyncValidators,function(validator,name){var promise=validator(modelValue,viewValue);if(!isPromiseLike(promise))throw ngModelMinErr("nopromise","Expected asynchronous validator to return a promise but got '{0}' instead.",promise);setValidity(name,void 0),validatorPromises.push(promise.then(function(){setValidity(name,!0)},function(){allValid=!1,setValidity(name,!1)}))}),validatorPromises.length?$q.all(validatorPromises).then(function(){validationDone(allValid)},noop):validationDone(!0)}function setValidity(name,isValid){localValidationRunId===currentValidationRunId&&ctrl.$setValidity(name,isValid)}function validationDone(allValid){localValidationRunId===currentValidationRunId&&doneCallback(allValid)}currentValidationRunId++;var localValidationRunId=currentValidationRunId;return processParseErrors()&&processSyncValidators()?void processAsyncValidators():void validationDone(!1)},this.$commitViewValue=function(){var viewValue=ctrl.$viewValue;$timeout.cancel(pendingDebounce),(ctrl.$$lastCommittedViewValue!==viewValue||""===viewValue&&ctrl.$$hasNativeValidators)&&(ctrl.$$updateEmptyClasses(viewValue),ctrl.$$lastCommittedViewValue=viewValue,ctrl.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function writeToModelIfNeeded(){ctrl.$modelValue!==prevModelValue&&ctrl.$$writeModelToScope()}var viewValue=ctrl.$$lastCommittedViewValue,modelValue=viewValue;if(parserValid=!isUndefined(modelValue)||void 0)for(var i=0;i=0;i--){var option=options.items[i];jqLiteRemove(isDefined(option.group)?option.element.parentNode:option.element)}options=ngOptions.getOptions();var groupElementMap={};if(providedEmptyOption&&selectElement.prepend(emptyOption),options.items.forEach(function(option){var groupElement;isDefined(option.group)?(groupElement=groupElementMap[option.group],groupElement||(groupElement=optGroupTemplate.cloneNode(!1),listFragment.appendChild(groupElement),groupElement.label=null===option.group?"null":option.group,groupElementMap[option.group]=groupElement),addOptionElement(option,groupElement)):addOptionElement(option,listFragment)}),selectElement[0].appendChild(listFragment),ngModelCtrl.$render(),!ngModelCtrl.$isEmpty(previousValue)){var nextValue=selectCtrl.readValue(),isNotPrimitive=ngOptions.trackBy||multiple;(isNotPrimitive?equals(previousValue,nextValue):previousValue===nextValue)||(ngModelCtrl.$setViewValue(nextValue),ngModelCtrl.$render())}}for(var emptyOption,selectCtrl=ctrls[0],ngModelCtrl=ctrls[1],multiple=attr.multiple,i=0,children=selectElement.children(),ii=children.length;i0&&(regex=new RegExp("^"+regex+"$")),regex&&!regex.test)throw minErr("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",patternExp,regex,startingTag(elm));regexp=regex||void 0,ctrl.$validate()}),ctrl.$validators.pattern=function(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||isUndefined(regexp)||regexp.test(viewValue)}}}}},maxlengthDirective=function(){return{restrict:"A",require:"?ngModel",link:function(scope,elm,attr,ctrl){if(ctrl){var maxlength=-1;attr.$observe("maxlength",function(value){var intVal=toInt(value);maxlength=isNaN(intVal)?-1:intVal,ctrl.$validate()}),ctrl.$validators.maxlength=function(modelValue,viewValue){return maxlength<0||ctrl.$isEmpty(viewValue)||viewValue.length<=maxlength}}}}},minlengthDirective=function(){return{restrict:"A",require:"?ngModel",link:function(scope,elm,attr,ctrl){if(ctrl){var minlength=0;attr.$observe("minlength",function(value){minlength=toInt(value)||0,ctrl.$validate()}),ctrl.$validators.minlength=function(modelValue,viewValue){return ctrl.$isEmpty(viewValue)||viewValue.length>=minlength}}}}};return window.angular.bootstrap?void(window.console&&console.log("WARNING: Tried to load angular more than once.")):(bindJQuery(),publishExternalAPI(angular),angular.module("ngLocale",[],["$provide",function($provide){function getDecimals(n){n+="";var i=n.indexOf(".");return i==-1?0:n.length-i-1}function getVF(n,opt_precision){var v=opt_precision;void 0===v&&(v=Math.min(getDecimals(n),3));var base=Math.pow(10,v),f=(n*base|0)%base;return{v:v,f:f}}var PLURAL_CATEGORY={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};$provide.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(n,opt_precision){var i=0|n,vf=getVF(n,opt_precision);return 1==i&&0==vf.v?PLURAL_CATEGORY.ONE:PLURAL_CATEGORY.OTHER}})}]),void jqLite(window.document).ready(function(){angularInit(window.document,bootstrap)}))}(window),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''),function(){"use strict";function angularMoment(angular,moment){return angular.module("angularMoment",[]).constant("angularMomentConfig",{preprocess:null,timezone:"",format:null,statefulFilters:!0}).constant("moment",moment).constant("amTimeAgoConfig",{withoutSuffix:!1,serverTime:null,titleFormat:null,fullDateThreshold:null,fullDateFormat:null}).directive("amTimeAgo",["$window","moment","amMoment","amTimeAgoConfig","angularMomentConfig",function($window,moment,amMoment,amTimeAgoConfig,angularMomentConfig){return function(scope,element,attr){function getNow(){var now;if(currentFrom)now=currentFrom;else if(amTimeAgoConfig.serverTime){var localNow=(new Date).getTime(),nowMillis=localNow-localDate+amTimeAgoConfig.serverTime;now=moment(nowMillis)}else now=moment();return now}function cancelTimer(){activeTimeout&&($window.clearTimeout(activeTimeout),activeTimeout=null)}function updateTime(momentInstance){var daysAgo=getNow().diff(momentInstance,"day"),showFullDate=fullDateThreshold&&daysAgo>=fullDateThreshold;if(showFullDate?element.text(momentInstance.format(fullDateFormat)):element.text(momentInstance.from(getNow(),withoutSuffix)),titleFormat&&!element.attr("title")&&element.attr("title",momentInstance.local().format(titleFormat)),!showFullDate){var howOld=Math.abs(getNow().diff(momentInstance,"minute")),secondsUntilUpdate=3600;howOld<1?secondsUntilUpdate=1:howOld<60?secondsUntilUpdate=30:howOld<180&&(secondsUntilUpdate=300),activeTimeout=$window.setTimeout(function(){updateTime(momentInstance)},1e3*secondsUntilUpdate)}}function updateDateTimeAttr(value){isTimeElement&&element.attr("datetime",value)}function updateMoment(){if(cancelTimer(),currentValue){var momentValue=amMoment.preprocessDate(currentValue,preprocess,currentFormat);updateTime(momentValue),updateDateTimeAttr(momentValue.toISOString())}}var currentValue,currentFrom,activeTimeout=null,currentFormat=angularMomentConfig.format,withoutSuffix=amTimeAgoConfig.withoutSuffix,titleFormat=amTimeAgoConfig.titleFormat,fullDateThreshold=amTimeAgoConfig.fullDateThreshold,fullDateFormat=amTimeAgoConfig.fullDateFormat,localDate=(new Date).getTime(),preprocess=angularMomentConfig.preprocess,modelName=attr.amTimeAgo,isTimeElement="TIME"===element[0].nodeName.toUpperCase();scope.$watch(modelName,function(value){return"undefined"==typeof value||null===value||""===value?(cancelTimer(),void(currentValue&&(element.text(""),updateDateTimeAttr(""),currentValue=null))):(currentValue=value,void updateMoment())}),angular.isDefined(attr.amFrom)&&scope.$watch(attr.amFrom,function(value){currentFrom="undefined"==typeof value||null===value||""===value?null:moment(value),updateMoment()}),angular.isDefined(attr.amWithoutSuffix)&&scope.$watch(attr.amWithoutSuffix,function(value){"boolean"==typeof value?(withoutSuffix=value,updateMoment()):withoutSuffix=amTimeAgoConfig.withoutSuffix}),attr.$observe("amFormat",function(format){"undefined"!=typeof format&&(currentFormat=format,updateMoment())}),attr.$observe("amPreprocess",function(newValue){preprocess=newValue,updateMoment()}),attr.$observe("amFullDateThreshold",function(newValue){fullDateThreshold=newValue,updateMoment()}),attr.$observe("amFullDateFormat",function(newValue){fullDateFormat=newValue,updateMoment()}),scope.$on("$destroy",function(){cancelTimer()}),scope.$on("amMoment:localeChanged",function(){updateMoment()})}}]).service("amMoment",["moment","$rootScope","$log","angularMomentConfig",function(moment,$rootScope,$log,angularMomentConfig){this.preprocessors={utc:moment.utc,unix:moment.unix},this.changeLocale=function(locale,customization){var result=moment.locale(locale,customization);return angular.isDefined(locale)&&$rootScope.$broadcast("amMoment:localeChanged"),result},this.changeTimezone=function(timezone){angularMomentConfig.timezone=timezone,$rootScope.$broadcast("amMoment:timezoneChanged")},this.preprocessDate=function(value,preprocess,format){return angular.isUndefined(preprocess)&&(preprocess=angularMomentConfig.preprocess),this.preprocessors[preprocess]?this.preprocessors[preprocess](value,format):(preprocess&&$log.warn("angular-moment: Ignoring unsupported value for preprocess: "+preprocess),!isNaN(parseFloat(value))&&isFinite(value)?moment(parseInt(value,10)):moment(value,format))},this.applyTimezone=function(aMoment,timezone){return(timezone=timezone||angularMomentConfig.timezone)?(timezone.match(/^Z|[+-]\d\d:?\d\d$/i)?aMoment=aMoment.utcOffset(timezone):aMoment.tz?aMoment=aMoment.tz(timezone):$log.warn("angular-moment: named timezone specified but moment.tz() is undefined. Did you forget to include moment-timezone.js?"),aMoment):aMoment}}]).filter("amCalendar",["moment","amMoment","angularMomentConfig",function(moment,amMoment,angularMomentConfig){function amCalendarFilter(value,preprocess,timezone){if("undefined"==typeof value||null===value)return"";value=amMoment.preprocessDate(value,preprocess);var date=moment(value);return date.isValid()?amMoment.applyTimezone(date,timezone).calendar():""}return amCalendarFilter.$stateful=angularMomentConfig.statefulFilters,amCalendarFilter}]).filter("amDifference",["moment","amMoment","angularMomentConfig",function(moment,amMoment,angularMomentConfig){function amDifferenceFilter(value,otherValue,unit,usePrecision,preprocessValue,preprocessOtherValue){if("undefined"==typeof value||null===value)return"";value=amMoment.preprocessDate(value,preprocessValue);var date=moment(value);if(!date.isValid())return"";var date2;if("undefined"==typeof otherValue||null===otherValue)date2=moment();else if(otherValue=amMoment.preprocessDate(otherValue,preprocessOtherValue),date2=moment(otherValue),!date2.isValid())return"";return amMoment.applyTimezone(date).diff(amMoment.applyTimezone(date2),unit,usePrecision)}return amDifferenceFilter.$stateful=angularMomentConfig.statefulFilters,amDifferenceFilter}]).filter("amDateFormat",["moment","amMoment","angularMomentConfig",function(moment,amMoment,angularMomentConfig){function amDateFormatFilter(value,format,preprocess,timezone,inputFormat){var currentFormat=inputFormat||angularMomentConfig.format;if("undefined"==typeof value||null===value)return"";value=amMoment.preprocessDate(value,preprocess,currentFormat);var date=moment(value);return date.isValid()?amMoment.applyTimezone(date,timezone).format(format):""}return amDateFormatFilter.$stateful=angularMomentConfig.statefulFilters,amDateFormatFilter}]).filter("amDurationFormat",["moment","angularMomentConfig",function(moment,angularMomentConfig){function amDurationFormatFilter(value,format,suffix){return"undefined"==typeof value||null===value?"":moment.duration(value,format).humanize(suffix)}return amDurationFormatFilter.$stateful=angularMomentConfig.statefulFilters,amDurationFormatFilter}]).filter("amTimeAgo",["moment","amMoment","angularMomentConfig",function(moment,amMoment,angularMomentConfig){function amTimeAgoFilter(value,preprocess,suffix,from){var date,dateFrom;return"undefined"==typeof value||null===value?"":(value=amMoment.preprocessDate(value,preprocess),date=moment(value),date.isValid()?(dateFrom=moment(from),"undefined"!=typeof from&&dateFrom.isValid()?amMoment.applyTimezone(date).from(dateFrom,suffix):amMoment.applyTimezone(date).fromNow(suffix)):"")}return amTimeAgoFilter.$stateful=angularMomentConfig.statefulFilters,amTimeAgoFilter}]).filter("amSubtract",["moment","angularMomentConfig",function(moment,angularMomentConfig){function amSubtractFilter(value,amount,type){return"undefined"==typeof value||null===value?"":moment(value).subtract(parseInt(amount,10),type)}return amSubtractFilter.$stateful=angularMomentConfig.statefulFilters,amSubtractFilter}]).filter("amAdd",["moment","angularMomentConfig",function(moment,angularMomentConfig){function amAddFilter(value,amount,type){return"undefined"==typeof value||null===value?"":moment(value).add(parseInt(amount,10),type)}return amAddFilter.$stateful=angularMomentConfig.statefulFilters,amAddFilter}])}"function"==typeof define&&define.amd?define(["angular","moment"],angularMoment):"undefined"!=typeof module&&module&&module.exports?(angularMoment(angular,require("moment")),module.exports="angularMoment"):angularMoment(angular,("undefined"!=typeof global?global:window).moment)}(),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(window,angular,undefined){"use strict";function inherit(parent,extra){return extend(new(extend(function(){},{prototype:parent})),extra)}function merge(dst){return forEach(arguments,function(obj){obj!==dst&&forEach(obj,function(value,key){dst.hasOwnProperty(key)||(dst[key]=value)})}),dst}function ancestors(first,second){var path=[];for(var n in first.path){if(first.path[n]!==second.path[n])break;path.push(first.path[n])}return path}function objectKeys(object){if(Object.keys)return Object.keys(object);var result=[];return forEach(object,function(val,key){result.push(key)}),result}function indexOf(array,value){if(Array.prototype.indexOf)return array.indexOf(value,Number(arguments[2])||0);var len=array.length>>>0,from=Number(arguments[2])||0;for(from=from<0?Math.ceil(from):Math.floor(from),from<0&&(from+=len);from=0||(inheritList.push(parentParams[j]),inherited[parentParams[j]]=currentParams[parentParams[j]]);return extend({},inherited,newParams)}function equalForKeys(a,b,keys){if(!keys){keys=[];for(var n in a)keys.push(n)}for(var i=0;i "));if(visited[key]=VISIT_IN_PROGRESS,isString(value))plan.push(key,[function(){return $injector.get(value)}],NO_DEPENDENCIES);else{var params=$injector.annotate(value);forEach(params,function(param){param!==key&&invocables.hasOwnProperty(param)&&visit(invocables[param],param)}),plan.push(key,value,params)}cycle.pop(),visited[key]=VISIT_DONE}}function isResolve(value){return isObject(value)&&value.then&&value.$$promises}if(!isObject(invocables))throw new Error("'invocables' must be an object");var invocableKeys=objectKeys(invocables||{}),plan=[],cycle=[],visited={};return forEach(invocables,visit),invocables=cycle=visited=null,function(locals,parent,self){function done(){--wait||(merged||merge(values,parent.$$values),result.$$values=values,result.$$promises=result.$$promises||!0,delete result.$$inheritedValues,resolution.resolve(values))}function fail(reason){result.$$failure=reason,resolution.reject(reason)}function invoke(key,invocable,params){function onfailure(reason){invocation.reject(reason),fail(reason)}function proceed(){if(!isDefined(result.$$failure))try{invocation.resolve($injector.invoke(invocable,self,values)),invocation.promise.then(function(result){values[key]=result,done()},onfailure)}catch(e){onfailure(e)}}var invocation=$q.defer(),waitParams=0;forEach(params,function(dep){promises.hasOwnProperty(dep)&&!locals.hasOwnProperty(dep)&&(waitParams++,promises[dep].then(function(result){values[dep]=result,--waitParams||proceed()},onfailure))}),waitParams||proceed(),promises[key]=invocation.promise}if(isResolve(locals)&&self===undefined&&(self=parent,parent=locals,locals=null),locals){if(!isObject(locals))throw new Error("'locals' must be an object")}else locals=NO_LOCALS;if(parent){if(!isResolve(parent))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else parent=NO_PARENT;var resolution=$q.defer(),result=resolution.promise,promises=result.$$promises={},values=extend({},locals),wait=1+plan.length/3,merged=!1;if(isDefined(parent.$$failure))return fail(parent.$$failure),result;parent.$$inheritedValues&&merge(values,omit(parent.$$inheritedValues,invocableKeys)),extend(promises,parent.$$promises),parent.$$values?(merged=merge(values,omit(parent.$$values,invocableKeys)),result.$$inheritedValues=omit(parent.$$values,invocableKeys),done()):(parent.$$inheritedValues&&(result.$$inheritedValues=omit(parent.$$inheritedValues,invocableKeys)),parent.then(done,fail));for(var i=0,ii=plan.length;i=0));)param=addParameter(p.id,p.type,p.cfg,"path"),compiled+=quoteRegExp(p.segment,param.type.pattern.source,param.squash,param.isOptional),segments.push(p.segment),last=placeholder.lastIndex;segment=pattern.substring(last);var i=segment.indexOf("?");if(i>=0){var search=this.sourceSearch=segment.substring(i);if(segment=segment.substring(0,i),this.sourcePath=pattern.substring(0,last+i),search.length>0)for(last=0;m=searchPlaceholder.exec(search);)p=matchDetails(m,!0),param=addParameter(p.id,p.type,p.cfg,"search"),last=placeholder.lastIndex}else this.sourcePath=pattern,this.sourceSearch="";compiled+=quoteRegExp(segment)+(config.strict===!1?"/?":"")+"$",segments.push(segment),this.regexp=new RegExp(compiled,config.caseInsensitive?"i":undefined),this.prefix=segments[0],this.$$paramNames=paramNames}function Type(config){extend(this,config)}function $UrlMatcherFactory(){function valToString(val){return null!=val?val.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):val}function valFromString(val){return null!=val?val.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):val}function getDefaultConfig(){return{strict:isStrictMode,caseInsensitive:isCaseInsensitive}}function isInjectable(value){return isFunction(value)||isArray(value)&&isFunction(value[value.length-1])}function flushTypeQueue(){for(;typeQueue.length;){var type=typeQueue.shift();if(type.pattern)throw new Error("You cannot override a type's .pattern at runtime.");angular.extend($types[type.name],injector.invoke(type.def))}}function ParamSet(params){extend(this,params||{})}$$UMFP=this;var injector,isCaseInsensitive=!1,isStrictMode=!0,defaultSquashPolicy=!1,$types={},enqueue=!0,typeQueue=[],defaultTypes={string:{encode:valToString,decode:valFromString,is:function(val){return null==val||!isDefined(val)||"string"==typeof val},pattern:/[^\/]*/},"int":{encode:valToString,decode:function(val){return parseInt(val,10)},is:function(val){return isDefined(val)&&this.decode(val.toString())===val},pattern:/\d+/},bool:{encode:function(val){return val?1:0},decode:function(val){return 0!==parseInt(val,10)},is:function(val){return val===!0||val===!1},pattern:/0|1/},date:{encode:function(val){return this.is(val)?[val.getFullYear(),("0"+(val.getMonth()+1)).slice(-2),("0"+val.getDate()).slice(-2)].join("-"):undefined},decode:function(val){if(this.is(val))return val;var match=this.capture.exec(val);return match?new Date(match[1],match[2]-1,match[3]):undefined},is:function(val){return val instanceof Date&&!isNaN(val.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:angular.toJson,decode:angular.fromJson,is:angular.isObject,equals:angular.equals,pattern:/[^\/]*/},any:{encode:angular.identity,decode:angular.identity,equals:angular.equals,pattern:/.*/}};$UrlMatcherFactory.$$getDefaultValue=function(config){if(!isInjectable(config.value))return config.value;if(!injector)throw new Error("Injectable functions cannot be called at configuration time");return injector.invoke(config.value)},this.caseInsensitive=function(value){return isDefined(value)&&(isCaseInsensitive=value),isCaseInsensitive},this.strictMode=function(value){return isDefined(value)&&(isStrictMode=value),isStrictMode},this.defaultSquashPolicy=function(value){if(!isDefined(value))return defaultSquashPolicy;if(value!==!0&&value!==!1&&!isString(value))throw new Error("Invalid squash policy: "+value+". Valid policies: false, true, arbitrary-string");return defaultSquashPolicy=value,value},this.compile=function(pattern,config){return new UrlMatcher(pattern,extend(getDefaultConfig(),config))},this.isMatcher=function(o){if(!isObject(o))return!1;var result=!0;return forEach(UrlMatcher.prototype,function(val,name){isFunction(val)&&(result=result&&isDefined(o[name])&&isFunction(o[name]))}),result},this.type=function(name,definition,definitionFn){if(!isDefined(definition))return $types[name];if($types.hasOwnProperty(name))throw new Error("A type named '"+name+"' has already been defined.");return $types[name]=new Type(extend({name:name},definition)),definitionFn&&(typeQueue.push({name:name,def:definitionFn}),enqueue||flushTypeQueue()),this},forEach(defaultTypes,function(type,name){$types[name]=new Type(extend({name:name},type))}),$types=inherit($types,{}),this.$get=["$injector",function($injector){return injector=$injector,enqueue=!1,flushTypeQueue(),forEach(defaultTypes,function(type,name){$types[name]||($types[name]=new Type(type))}),this}],this.Param=function(id,type,config,location){function unwrapShorthand(config){var keys=isObject(config)?objectKeys(config):[],isShorthand=indexOf(keys,"value")===-1&&indexOf(keys,"type")===-1&&indexOf(keys,"squash")===-1&&indexOf(keys,"array")===-1;return isShorthand&&(config={value:config}),config.$$fn=isInjectable(config.value)?config.value:function(){return config.value},config}function getType(config,urlType,location){if(config.type&&urlType)throw new Error("Param '"+id+"' has two type configurations.");return urlType?urlType:config.type?angular.isString(config.type)?$types[config.type]:config.type instanceof Type?config.type:new Type(config.type):"config"===location?$types.any:$types.string}function getArrayMode(){var arrayDefaults={array:"search"===location&&"auto"},arrayParamNomenclature=id.match(/\[\]$/)?{array:!0}:{};return extend(arrayDefaults,arrayParamNomenclature,config).array}function getSquashPolicy(config,isOptional){var squash=config.squash;if(!isOptional||squash===!1)return!1;if(!isDefined(squash)||null==squash)return defaultSquashPolicy;if(squash===!0||isString(squash))return squash;throw new Error("Invalid squash policy: '"+squash+"'. Valid policies: false, true, or arbitrary string")}function getReplace(config,arrayMode,isOptional,squash){var replace,configuredKeys,defaultPolicy=[{from:"",to:isOptional||arrayMode?undefined:""},{from:null,to:isOptional||arrayMode?undefined:""}];return replace=isArray(config.replace)?config.replace:[],isString(squash)&&replace.push({from:squash,to:undefined}),configuredKeys=map(replace,function(item){return item.from}),filter(defaultPolicy,function(item){return indexOf(configuredKeys,item.from)===-1}).concat(replace)}function $$getDefaultValue(){if(!injector)throw new Error("Injectable functions cannot be called at configuration time");var defaultValue=injector.invoke(config.$$fn);if(null!==defaultValue&&defaultValue!==undefined&&!self.type.is(defaultValue))throw new Error("Default value ("+defaultValue+") for parameter '"+self.id+"' is not an instance of Type ("+self.type.name+")");return defaultValue;
+}function $value(value){function hasReplaceVal(val){return function(obj){return obj.from===val}}function $replace(value){var replacement=map(filter(self.replace,hasReplaceVal(value)),function(obj){return obj.to});return replacement.length?replacement[0]:value}return value=$replace(value),isDefined(value)?self.type.$normalize(value):$$getDefaultValue()}function toString(){return"{Param:"+id+" "+type+" squash: '"+squash+"' optional: "+isOptional+"}"}var self=this;config=unwrapShorthand(config),type=getType(config,type,location);var arrayMode=getArrayMode();type=arrayMode?type.$asArray(arrayMode,"search"===location):type,"string"!==type.name||arrayMode||"path"!==location||config.value!==undefined||(config.value="");var isOptional=config.value!==undefined,squash=getSquashPolicy(config,isOptional),replace=getReplace(config,arrayMode,isOptional,squash);extend(this,{id:id,type:type,location:location,array:arrayMode,squash:squash,replace:replace,isOptional:isOptional,value:$value,dynamic:undefined,config:config,toString:toString})},ParamSet.prototype={$$new:function(){return inherit(this,extend(new ParamSet,{$$parent:this}))},$$keys:function(){for(var keys=[],chain=[],parent=this,ignore=objectKeys(ParamSet.prototype);parent;)chain.push(parent),parent=parent.$$parent;return chain.reverse(),forEach(chain,function(paramset){forEach(objectKeys(paramset),function(key){indexOf(keys,key)===-1&&indexOf(ignore,key)===-1&&keys.push(key)})}),keys},$$values:function(paramValues){var values={},self=this;return forEach(self.$$keys(),function(key){values[key]=self[key].value(paramValues&¶mValues[key])}),values},$$equals:function(paramValues1,paramValues2){var equal=!0,self=this;return forEach(self.$$keys(),function(key){var left=paramValues1&¶mValues1[key],right=paramValues2&¶mValues2[key];self[key].type.equals(left,right)||(equal=!1)}),equal},$$validates:function(paramValues){var i,param,rawVal,normalized,encoded,keys=this.$$keys();for(i=0;i=0)throw new Error("State must have a valid name");if(states.hasOwnProperty(name))throw new Error("State '"+name+"' is already defined");var parentName=name.indexOf(".")!==-1?name.substring(0,name.lastIndexOf(".")):isString(state.parent)?state.parent:isObject(state.parent)&&isString(state.parent.name)?state.parent.name:"";if(parentName&&!states[parentName])return queueState(parentName,state.self);for(var key in stateBuilder)isFunction(stateBuilder[key])&&(state[key]=stateBuilder[key](state,stateBuilder.$delegates[key]));return states[name]=state,!state[abstractKey]&&state.url&&$urlRouterProvider.when(state.url,["$match","$stateParams",function($match,$stateParams){$state.$current.navigable==state&&equalForKeys($match,$stateParams)||$state.transitionTo(state,$match,{inherit:!0,location:!1})}]),flushQueuedChildren(name),state}function isGlob(text){return text.indexOf("*")>-1}function doesStateMatchGlob(glob){for(var globSegments=glob.split("."),segments=$state.$current.name.split("."),i=0,l=globSegments.length;i=keep;l--)exiting=fromPath[l],exiting.self.onExit&&$injector.invoke(exiting.self.onExit,exiting.self,exiting.locals.globals),exiting.locals=null;for(l=keep;l=4?!!$animate.enabled(element):1===ngMajorVer&&ngMinorVer>=2?!!$animate.enabled():!!$animator}var statics={enter:function(element,target,cb){target.after(element),cb()},leave:function(element,cb){element.remove(),cb()}};if(attrs.noanimation)return statics;if($animate)return{enter:function(element,target,cb){animEnabled(element)?angular.version.minor>2?$animate.enter(element,null,target).then(cb):$animate.enter(element,null,target,cb):statics.enter(element,target,cb)},leave:function(element,cb){animEnabled(element)?angular.version.minor>2?$animate.leave(element).then(cb):$animate.leave(element,cb):statics.leave(element,cb)}};if($animator){var animate=$animator&&$animator(scope,attrs);return{enter:function(element,target,cb){animate.enter(element,null,target),cb()},leave:function(element,cb){animate.leave(element),cb()}}}return statics}var service=getService(),$animator=service("$animator"),$animate=service("$animate"),directive={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(tElement,tAttrs,$transclude){return function(scope,$element,attrs){function cleanupLastView(){function cleanOld(){_previousEl&&_previousEl.remove(),_currentScope&&_currentScope.$destroy()}var _previousEl=previousEl,_currentScope=currentScope;_currentScope&&(_currentScope._willBeDestroyed=!0),currentEl?(renderer.leave(currentEl,function(){cleanOld(),previousEl=null}),previousEl=currentEl):(cleanOld(),previousEl=null),currentEl=null,currentScope=null}function updateView(firstTime){var newScope,name=getUiViewName(scope,attrs,$element,$interpolate),previousLocals=name&&$state.$current&&$state.$current.locals[name];if((firstTime||previousLocals!==latestLocals)&&!scope._willBeDestroyed){newScope=scope.$new(),latestLocals=$state.$current.locals[name],newScope.$emit("$viewContentLoading",name);var clone=$transclude(newScope,function(clone){renderer.enter(clone,$element,function(){currentScope&¤tScope.$emit("$viewContentAnimationEnded"),(angular.isDefined(autoScrollExp)&&!autoScrollExp||scope.$eval(autoScrollExp))&&$uiViewScroll(clone)}),cleanupLastView()});currentEl=clone,currentScope=newScope,currentScope.$emit("$viewContentLoaded",name),currentScope.$eval(onloadExp)}}var previousEl,currentEl,currentScope,latestLocals,onloadExp=attrs.onload||"",autoScrollExp=attrs.autoscroll,renderer=getRenderer(attrs,scope);scope.$on("$stateChangeSuccess",function(){updateView(!1)}),updateView(!0)}}};return directive}function $ViewDirectiveFill($compile,$controller,$state,$interpolate){return{restrict:"ECA",priority:-400,compile:function(tElement){var initial=tElement.html();return function(scope,$element,attrs){var current=$state.$current,name=getUiViewName(scope,attrs,$element,$interpolate),locals=current&¤t.locals[name];if(locals){$element.data("$uiView",{name:name,state:locals.$$state}),$element.html(locals.$template?locals.$template:initial);var link=$compile($element.contents());if(locals.$$controller){locals.$scope=scope,locals.$element=$element;var controller=$controller(locals.$$controller,locals);locals.$$controllerAs&&(scope[locals.$$controllerAs]=controller),$element.data("$ngControllerController",controller),$element.children().data("$ngControllerController",controller)}link(scope)}}}}}function getUiViewName(scope,attrs,element,$interpolate){var name=$interpolate(attrs.uiView||attrs.name||"")(scope),inherited=element.inheritedData("$uiView");return name.indexOf("@")>=0?name:name+"@"+(inherited?inherited.state.name:"")}function parseStateRef(ref,current){var parsed,preparsed=ref.match(/^\s*({[^}]*})\s*$/);if(preparsed&&(ref=current+"("+preparsed[1]+")"),parsed=ref.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!parsed||4!==parsed.length)throw new Error("Invalid state ref '"+ref+"'");return{state:parsed[1],paramExpr:parsed[3]||null}}function stateContext(el){var stateData=el.parent().inheritedData("$uiView");if(stateData&&stateData.state&&stateData.state.name)return stateData.state}function getTypeInfo(el){var isSvg="[object SVGAnimatedString]"===Object.prototype.toString.call(el.prop("href")),isForm="FORM"===el[0].nodeName;return{attr:isForm?"action":isSvg?"xlink:href":"href",isAnchor:"A"===el.prop("tagName").toUpperCase(),clickable:!isForm}}function clickHook(el,$state,$timeout,type,current){return function(e){var button=e.which||e.button,target=current();if(!(button>1||e.ctrlKey||e.metaKey||e.shiftKey||el.attr("target"))){var transition=$timeout(function(){$state.go(target.state,target.params,target.options)});e.preventDefault();var ignorePreventDefaultCount=type.isAnchor&&!target.href?1:0;e.preventDefault=function(){ignorePreventDefaultCount--<=0&&$timeout.cancel(transition)}}}}function defaultOpts(el,$state){return{relative:stateContext(el)||$state.$current,inherit:!0}}function $StateRefDirective($state,$timeout){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(scope,element,attrs,uiSrefActive){var ref=parseStateRef(attrs.uiSref,$state.current.name),def={state:ref.state,href:null,params:null},type=getTypeInfo(element),active=uiSrefActive[1]||uiSrefActive[0];def.options=extend(defaultOpts(element,$state),attrs.uiSrefOpts?scope.$eval(attrs.uiSrefOpts):{});var update=function(val){val&&(def.params=angular.copy(val)),def.href=$state.href(ref.state,def.params,def.options),active&&active.$$addStateInfo(ref.state,def.params),null!==def.href&&attrs.$set(type.attr,def.href)};ref.paramExpr&&(scope.$watch(ref.paramExpr,function(val){val!==def.params&&update(val)},!0),def.params=angular.copy(scope.$eval(ref.paramExpr))),update(),type.clickable&&element.bind("click",clickHook(element,$state,$timeout,type,function(){return def}))}}}function $StateRefDynamicDirective($state,$timeout){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(scope,element,attrs,uiSrefActive){function runStateRefLink(group){def.state=group[0],def.params=group[1],def.options=group[2],def.href=$state.href(def.state,def.params,def.options),active&&active.$$addStateInfo(def.state,def.params),def.href&&attrs.$set(type.attr,def.href)}var type=getTypeInfo(element),active=uiSrefActive[1]||uiSrefActive[0],group=[attrs.uiState,attrs.uiStateParams||null,attrs.uiStateOpts||null],watch="["+group.map(function(val){return val||"null"}).join(", ")+"]",def={state:null,params:null,options:null,href:null};scope.$watch(watch,runStateRefLink,!0),runStateRefLink(scope.$eval(watch)),type.clickable&&element.bind("click",clickHook(element,$state,$timeout,type,function(){return def}))}}}function $StateRefActiveDirective($state,$stateParams,$interpolate){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function($scope,$element,$attrs,$timeout){function addState(stateName,stateParams,activeClass){var state=$state.get(stateName,stateContext($element)),stateHash=createStateHash(stateName,stateParams);states.push({state:state||{name:stateName},params:stateParams,hash:stateHash}),activeClasses[stateHash]=activeClass}function createStateHash(state,params){if(!isString(state))throw new Error("state should be a string");return isObject(params)?state+toJson(params):(params=$scope.$eval(params),isObject(params)?state+toJson(params):state)}function update(){for(var i=0;i0||(addState(newState,newParams,uiSrefActive),update())},$scope.$on("$stateChangeSuccess",update),update()}]}}function $IsStateFilter($state){var isFilter=function(state,params){return $state.is(state,params)};return isFilter.$stateful=!0,isFilter}function $IncludedByStateFilter($state){var includesFilter=function(state,params,options){return $state.includes(state,params,options)};return includesFilter.$stateful=!0,includesFilter}var isDefined=angular.isDefined,isFunction=angular.isFunction,isString=angular.isString,isObject=angular.isObject,isArray=angular.isArray,forEach=angular.forEach,extend=angular.extend,copy=angular.copy,toJson=angular.toJson;angular.module("ui.router.util",["ng"]),angular.module("ui.router.router",["ui.router.util"]),angular.module("ui.router.state",["ui.router.router","ui.router.util"]),angular.module("ui.router",["ui.router.state"]),angular.module("ui.router.compat",["ui.router"]),$Resolve.$inject=["$q","$injector"],angular.module("ui.router.util").service("$resolve",$Resolve),$TemplateFactory.$inject=["$http","$templateCache","$injector"],angular.module("ui.router.util").service("$templateFactory",$TemplateFactory);var $$UMFP;UrlMatcher.prototype.concat=function(pattern,config){var defaultConfig={caseInsensitive:$$UMFP.caseInsensitive(),strict:$$UMFP.strictMode(),squash:$$UMFP.defaultSquashPolicy()};return new UrlMatcher(this.sourcePath+pattern+this.sourceSearch,extend(defaultConfig,config),this)},UrlMatcher.prototype.toString=function(){return this.source},UrlMatcher.prototype.exec=function(path,searchParams){function decodePathArray(string){function reverseString(str){return str.split("").reverse().join("")}function unquoteDashes(str){return str.replace(/\\-/g,"-")}var split=reverseString(string).split(/-(?!\\)/),allReversed=map(split,reverseString);return map(allReversed,unquoteDashes).reverse()}var m=this.regexp.exec(path);if(!m)return null;searchParams=searchParams||{};var i,j,paramName,paramNames=this.parameters(),nTotal=paramNames.length,nPath=this.segments.length-1,values={};if(nPath!==m.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var param,paramVal;for(i=0;i>>0,from=Number(arguments[2])||0;for(from=from<0?Math.ceil(from):Math.floor(from),from<0&&(from+=len);from=0||(inheritList.push(parentParams[j]),inherited[parentParams[j]]=currentParams[parentParams[j]]);return extend({},inherited,newParams)}function inherit(parent,extra){return extend(new(extend(function(){},{prototype:parent})),extra)}function onStateRegistered(callback){stateRegisteredCallbacks.push(callback)}var mod_core=angular.module("ct.ui.router.extras.core",["ui.router"]),internalStates={},stateRegisteredCallbacks=[];mod_core.config(["$stateProvider","$injector",function($stateProvider,$injector){$stateProvider.decorator("parent",function(state,parentFn){return internalStates[state.self.name]=state,state.self.$$state=function(){return internalStates[state.self.name]},angular.forEach(stateRegisteredCallbacks,function(callback){callback(state)}),parentFn(state)})}]);var forEach=angular.forEach,extend=angular.extend,isArray=angular.isArray,map=function(collection,callback){var result=[];return forEach(collection,function(item,index){result.push(callback(item,index))}),result},keys=function(collection){return map(collection,function(collection,key){return key})},filter=function(collection,callback){var result=[];return forEach(collection,function(item,index){callback(item,index)&&result.push(item)}),result},filterObj=function(collection,callback){var result={};return forEach(collection,function(item,index){callback(item,index)&&(result[index]=item)}),result};mod_core.provider("uirextras_core",function(){var core={internalStates:internalStates,onStateRegistered:onStateRegistered,forEach:forEach,extend:extend,isArray:isArray,map:map,keys:keys,filter:filter,filterObj:filterObj,ancestors:ancestors,objectKeys:objectKeys,protoKeys:protoKeys,arraySearch:arraySearch,inheritParams:inheritParams,inherit:inherit};angular.extend(this,core),this.$get=function(){return core}})}(angular),function(angular,undefined){"use strict";!function(angular,undefined){function _futureStateProvider($stateProvider,$urlRouterProvider,$urlMatcherFactory,uirextras_coreProvider){function findState(stateOrName,findFutureState){var statename=angular.isObject(stateOrName)?stateOrName.name:stateOrName;return findFutureState?futureStates[statename]:internalStates[statename]}function findFutureState($state,options){if(options.name){var nameComponents=options.name.split(/\./);for("."===options.name.charAt(0)&&(nameComponents[0]=$state.current.name);nameComponents.length;){var stateName=nameComponents.join(".");if($state.get(stateName,{relative:$state.current}))return null;if(futureStates[stateName])return futureStates[stateName];nameComponents.pop()}}if(options.url){var matches=[];for(var future in futureStates){var matcher=futureStates[future].urlMatcher;matcher&&matcher.exec(options.url)&&matches.push(futureStates[future])}for(var copy=matches.slice(0),i=matches.length-1;i>=0;i--)for(var j=0;j=7&&(weeks++,days-=7),weeks>46?"Error":weeks+" "+days+"/7")}};angular.module("midwifeEmr",["angularMoment","ui.router","ct.ui.router.extras.future","minPubSubNgModule","historyControlModule","historyServiceModule","changeRoutingServiceModule","templateServiceModule","loggingServiceModule","patientWellModule"]),angular.module("midwifeEmr").constant("DEBUG",!0),angular.module("midwifeEmr").run(["$rootScope",function($rootScope){console.log("Midwife-EMR running Angular v"+angular.version.full),$rootScope.$on("$stateChangeError",console.log.bind(console)),$rootScope.$on("$stateChangeStart",function(event,toState,toParams,fromState,fromParams){})}]),angular.module("midwifeEmr").filter("abs",function(){return function(val){return Math.abs(val)}}).filter("dohFormatted",function(){return function(val){return val?val.slice(0,2)+"-"+val.slice(2,4)+"-"+val.slice(4):""}}).filter("edd",["moment",function(moment){return function(lmp){return edd(lmp,moment)}}]).filter("onlyValidDate",["moment",function(moment){return function(theDate){var m=moment(theDate);return m.isValid()?theDate:""}}]).filter("sourcesHistorical",["moment",function(moment){return function(data,replacedAt,sortFld){var recs=[],tmp={},maxDate=moment(replacedAt);return angular.forEach(data,function(rec){moment(rec.replacedAt).isAfter(maxDate)||(tmp[rec.id]&&"D"===rec.op?delete tmp[rec.id]:tmp[rec.id]=rec)}),angular.forEach(Object.keys(tmp),function(key){recs.push(tmp[key])}),recs.sort(function(a,b){return a[sortFld]b[sortFld]?1:0}),recs}}]).filter("riskTypeHistorical",["moment",function(moment){return function(risks,type,replacedAt){var recs=[],tmp={};if(!risks||risks.length&&0===risks.length)return[];var maxDate=moment(replacedAt);return angular.forEach(risks,function(risk){moment(risk.replacedAt).isAfter(maxDate)||risk.riskType===type&&(tmp[risk.id]&&"D"===risk.op?delete tmp[risk.id]:tmp[risk.id]=risk)}),angular.forEach(Object.keys(tmp),function(key){recs.push(tmp[key])}),recs.sort(function(a,b){return a.nameb.name?1:0}),recs}}]).filter("showDetail",[function(){return function(recs,detId){var chosen=[];return detId?(detId=parseInt(detId,10),angular.forEach(recs,function(rec){rec.id===detId&&chosen.push(rec)}),chosen):[]}}]).filter("yesNo",[function(){return function(ans){var ansStr;return _.isNumber(ans)?1===ans?"Yes":0===ans?"No":"":_.isString(ans)&&ans?(ansStr=ans.toLowerCase(),"n"===ansStr||"no"===ansStr?"No":"y"===ansStr||"yes"===ansStr?"Yes":""):""}}]).filter("toArray",[function(){return function(objects){return _.toArray(objects)}}]).filter("getUserField",["historyService",function(historyService){return function(id,fld){var result=historyService.lookup("user","id",id);return result&&_.has(result,fld)?result[fld]:result&&_.has(result,"shortName")?result.shortName:""}}]).filter("getDateFromVaccination",["moment",function(moment){return function(vac){var vacDate="";return vac?(vac.vacDate&&moment(vac.vacDate).isValid()?vacDate=moment(vac.vacDate).format("MM-DD-YYYY"):vac.vacMonth&&vac.vacYear?vacDate=vac.vacMonth+" - "+vac.vacYear:vac.vacYear&&(vacDate=vac.vacYear),vacDate):vacDate}}]).filter("getGAFromLMP",["moment",function(moment){return function(lmp,rDate){var edDate=edd(lmp,moment);return edDate?getGA(edDate,rDate,moment):""}}])}(angular),function(angular){"use strict";angular.module("midwifeEmr").config(["$urlRouterProvider","$locationProvider","$futureStateProvider",function($urlRouterProvider,$locationProvider,$futureStateProvider){var prenatalState="pregnancy.prenatal",prenatalExamState="pregnancy.prenatalExam",labsState="pregnancy.labs",questionnaireState="pregnancy.questionnaire",midwifeState="pregnancy.midwife",pregHistoryState="pregnancy.pregnancyHistory",generalState="pregnancy.general";$urlRouterProvider.otherwise("/");var fsPregnancy={type:"templateService",stateName:"pregnancy",url:"/spa/history/pregnancy/:id",resolve:{pregId:["$stateParams",function($stateParams){return $stateParams.id}]},views:{historyControl:{template:""},tabs:{templateUrl:"/angular/views/pregnancy-tab.html"},patientWell:{templateUrl:"/angular/views/history-header.html",controller:function($scope,$stateParams){$scope.pregId=$stateParams.id}},content:{template:"Loading ...
"}}},fsPregnancyPrenatal={type:"templateService",stateName:"pregnancy.prenatal",parent:"pregnancy",url:"/prenatal",views:{"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Prenatal"}},"content@":{templateUrl:"/angular/views/prenatal.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId",commonController(prenatalState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(prenatalState)),pubSub.publish(retireExitState(prenatalState))}]},fsPregnancyPrenatalExam={type:"templateService",stateName:"pregnancy.prenatalExam",parent:"pregnancy",url:"/prenatalexam/:peid",resolve:{peId:["$stateParams",function($stateParams){return $stateParams.peid}]},views:{"tabs@":{template:""},"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Prenatal Exam"}},"content@":{templateUrl:"/angular/views/prenatalExam.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId","peId",commonController(prenatalExamState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(prenatalExamState)),pubSub.publish(retireExitState(prenatalExamState))}]},fsPregnancyLabs={type:"templateService",stateName:"pregnancy.labs",parent:"pregnancy",url:"/labs",views:{"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Labs"}},"content@":{templateUrl:"/angular/views/prenatalLabs.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId",commonController(labsState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(labsState)),pubSub.publish(retireExitState(labsState))}]},fsPregnancyQuestionnaire={type:"templateService",stateName:"pregnancy.questionnaire",parent:"pregnancy",url:"/quesEdit",views:{"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Questionnaire"}},"content@":{templateUrl:"/angular/views/prenatalQuestionnaire.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId",commonController(questionnaireState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(questionnaireState)),pubSub.publish(retireExitState(questionnaireState))}]},fsPregnancyMidwife={type:"templateService",stateName:"pregnancy.midwife",parent:"pregnancy",url:"/midwifeinterview",views:{"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Midwife"}},"content@":{templateUrl:"/angular/views/prenatalMidwifeInterview.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId",commonController(midwifeState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(midwifeState)),pubSub.publish(retireExitState(midwifeState))}]},fsPregnancyHistory={type:"templateService",stateName:"pregnancy.pregnancyHistory",parent:"pregnancy",url:"/preghistory/:phid",resolve:{phId:["$stateParams",function($stateParams){return $stateParams.phid}]},views:{"tabs@":{template:""},"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Hist Pregnancy"}},"content@":{templateUrl:"/angular/views/prenatalPregnancyHistory.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId","phId",commonController(pregHistoryState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(pregHistoryState)),pubSub.publish(retireExitState(pregHistoryState))}]},fsPregnancyGeneral={type:"templateService",stateName:"pregnancy.general",parent:"pregnancy",url:"/edit",views:{"title@":{template:"{{title}}
",controller:function($scope){$scope.title="Edit Client"}},"content@":{templateUrl:"/angular/views/prenatalGeneral.RES.html",controller:["$scope","$state","historyService","templateService","loggingService","pregId",commonController(generalState)]}},onExit:["historyService","minPubSubNg","loggingService",function(historyService,pubSub,log){log.log("Publishing: "+getExitState(generalState)),pubSub.publish(retireExitState(generalState))}]},allStates=[fsPregnancy,fsPregnancyPrenatal,fsPregnancyPrenatalExam,fsPregnancyLabs,fsPregnancyQuestionnaire,fsPregnancyMidwife,fsPregnancyHistory,fsPregnancyGeneral];_.each(allStates,function(state){$futureStateProvider.futureState(state)});var genericTemplatesRegistered=!1,genericTemplates=[];_.each(allStates,function(state){state.views&&state.views["content@"]&&state.views["content@"].templateUrl&&genericTemplates.push({stateName:state.name,templateUrl:state.views["content@"].templateUrl})}),$futureStateProvider.stateFactory("templateService",function($q,templateService,futureState){var d=$q.defer();return _.each(futureState.views,function(obj,name){_.has(obj,"templateUrl")&&templateService.loadTemplateToCache(obj.templateUrl)}),genericTemplatesRegistered||(_.each(genericTemplates,function(st){templateService.registerGenericTemplateUrl(st.templateUrl)}),genericTemplatesRegistered=!0),d.resolve(futureState),d.promise}),$locationProvider.html5Mode(!0)}]);var commonFuncs={contains:_.contains,gotoUrl:function(url){console.log(url)}},exitStates={},getExitState=function(state){return exitStates.state?exitStates.state:(exitStates.state="exit."+state+"."+99999999*Math.random(),exitStates.state)},retireExitState=function(state){var tmpState;return exitStates.state?(tmpState=exitStates.state,delete exitStates.state,tmpState):void console.log("WARNING: retireExitState() did not find "+state+".")},commonController=function(stateHandle){return function($scope,$state,historyService,templateService,log,pregId,detId){var currViewport=templateService.getViewportSize();historyService.loadAsNeeded(pregId),historyService.registerPubSub(getExitState(stateHandle),function(data){if($scope.ctrl=data,$scope.func=commonFuncs,log.dir(data),$scope&&$scope.$root&&($scope.$root.hsState=stateHandle),!detId)switch(stateHandle){case"pregnancy.prenatalExam":_.size($scope.ctrl.changed.prenatalExam)>0&&($scope.detId=_.keys($scope.ctrl.changed.prenatalExam)[0],$scope&&$scope.$root&&($scope.$root.detId=$scope.detId));break;case"pregnancy.pregnancyHistory":_.size($scope.ctrl.changed.pregnancyHistory)>0&&($scope.detId=_.keys($scope.ctrl.changed.pregnancyHistory)[0],$scope&&$scope.$root&&($scope.$root.detId=$scope.detId));break;default:$scope.detId=void 0,$scope&&$scope.$root&&($scope.$root.detId=void 0)}0===data.currentRecordNumber?$scope.chgd={}:$scope.chgd=historyService.getChangedFields(data.changed,detId)}),historyService.curr(),$scope.pregId=pregId,detId?($scope.detId=detId,$scope.$root.detId=$scope.detId):($scope.detId=void 0,$scope.$root.detId=void 0);$state.get(stateHandle);templateService.register(getExitState(stateHandle),function(viewPort){templateService.needTemplateChange(currViewport)&&(currViewport=templateService.getViewportSize(),$state.reload(stateHandle))})}}}(angular),function(angular){"use strict";var exports={};!function(context){var MinPubSub={},cache=context.c_||{};MinPubSub.publish=function(topic,args){for(var subs=cache[topic],len=subs?subs.length:0;len--;)subs[len].apply(context,args||[])},MinPubSub.subscribe=function(topic,callback){return cache[topic]||(cache[topic]=[]),cache[topic].push(callback),[topic,callback]},MinPubSub.unsubscribe=function(handle,callback){for(var subs=cache[callback?handle:handle[0]],cb=callback||handle[1],len=subs?subs.length:0;len--;)subs[len]===cb&&subs.splice(len,1)},"object"==typeof module&&module.exports?module.exports=exports=MinPubSub:"function"==typeof define&&define.amd?define(function(){return MinPubSub}):"object"==typeof context&&(context.publish=MinPubSub.publish,context.subscribe=MinPubSub.subscribe,context.unsubscribe=MinPubSub.unsubscribe)}(exports),angular.module("minPubSubNgModule",[]).provider("minPubSubNg",function(){var pubsub={};return["subscribe","unsubscribe"].forEach(function(func){pubsub[func]=exports[func]}),pubsub.publish=function(topic,args){setTimeout(function(){exports.publish(topic,args)},0)},{$get:function(){return pubsub}}})}(angular),function(angular,_){"use strict";angular.module("historyServiceModule",[]).factory("historyService",["$http","$cacheFactory","minPubSubNg","loggingService",function($http,$cacheFactory,pubSub,log){var pregnancyId,numRecs,currRecNum,historicalSources=["pregnancy","patient","prenatalExam","healthTeaching","labTestResult","medication","schedule","vaccination","referral","pregnancyHistory","risk","customField","pregnote"],baseUrl="/api/history",pregnancyPath="pregnancy/:pregId",PREGNANCY_CACHE="pregnancyCache",PREGNANCY_CACHE_KEY="all",pregnancyCache=$cacheFactory(PREGNANCY_CACHE),CHANGED_FIELDS_CACHE="changedFieldsCache",changedFieldsCache=$cacheFactory(CHANGED_FIELDS_CACHE),registeredCallbacks=[],load=function(pregId){var path;pregnancyId=pregId,pregnancyCache.removeAll(),path=baseUrl+"/"+pregnancyPath.replace(/:pregId/,pregId),$http.get(path,{responseType:"json"}).success(function(data,sts,headers,config){numRecs=data[2].length,currRecNum=0,pregnancyCache.put(PREGNANCY_CACHE_KEY,data),log.log("Loaded "+numRecs+" records."),log.dir(data),notifyCallbacks()}).error(function(data,sts,headers,config){log.error("Error: "+sts)})},loadAsNeeded=function(pregId){pregnancyId&&pregnancyId===pregId||load(pregId)},getRecBySource=function(data,src,recNum){var recs;return _.each(data[2][recNum].indexes[src],function(idx){var currRec=data[0][src][idx];currRec.pregnancy_id?(recs||(recs=[]),recs.push(currRec)):recs=data[0][src][idx]}),recs},getChangedBySource=function(data,src,recNum){return data[2][recNum][src]?data[2][recNum][src]:{}},getChangedBy=function(data,recNum){var changedBy={updatedBy:void 0,supervisor:void 0},tables=_.omit(data[2][recNum],["replacedAt","indexes"]);return tables&&_.size(tables)>0&&_.each(_.keys(tables),function(tbl){if(!changedBy.updatedBy){var chgIdx,recId=parseInt(_.keys(tables[tbl])[0],10);_.isNumber(recId)&&(chgIdx=data[2][recNum].indexes[tbl][recId],changedBy.updatedBy=data[0][tbl][chgIdx].updatedBy,changedBy.supervisor=data[0][tbl][chgIdx].supervisor)}}),changedBy},prepareRecord=function(data,recNum){var rec={};return _.each(historicalSources,function(src){rec[src]=getRecBySource(data,src,recNum)}),rec.replacedAt=data[2][recNum].replacedAt,rec.currentRecordNumber=recNum,rec.changed={},_.each(historicalSources,function(src){rec.changed[src]=getChangedBySource(data,src,recNum)}),rec.sources=data[0],rec.lookup=data[1],rec.changedBy=getChangedBy(data,recNum),rec},notifyCallbacks=function(recNum){recNum=recNum||currRecNum;var rec,json=pregnancyCache.get(PREGNANCY_CACHE_KEY);json&&(rec=prepareRecord(json,recNum),_.each(registeredCallbacks,function(cbObj){cbObj.func(rec)}))},getId=function(){return _.uniqueId();
+},register=function(func){var funcObj={id:getId(),func:func};if(func&&_.isFunction(func))return registeredCallbacks.push(funcObj),log.log("Register historyService: "+funcObj.id),funcObj.id},registerPubSub=function(key,func){var pubSubKey,id=register(func);id&&(pubSubKey=pubSub.subscribe(key,function(){unregister(id),pubSub.unsubscribe(pubSubKey)}))},unregister=function(id){log.log("Unregister historyService: "+id);var len=registeredCallbacks.length;return registeredCallbacks=_.reject(registeredCallbacks,function(c){return c.id===id}),registeredCallbacks.length-1},op=function(x){return x-1}}for("f"===dir&&(i=0),"l"===dir&&(i=numRecs-1),"p"===dir&&(i=currRecNum-1),"n"===dir&&(i=currRecNum+1),i;test(i)&&!found;i=op(i))currRec=data[2][i],_.each(srcInfo,function(flds,tbl){var dId,detRec;_.has(currRec,tbl)&&(found||(detId?_.has(currRec[tbl],detId)&&(detRec=currRec[tbl][detId]):(dId=_.keys(currRec[tbl])[0],_.isUndefined(dId)||(detRec=currRec[tbl][dId])),detRec&&detRec.fields&&_.each(detRec.fields,function(f){found||(_.contains(flds,f)?(newRecNum=i,found=!0):(_.contains(flds,"DEFAULT")||_.contains(flds,"SECONDARY"))&&(tentativeRecNum=i))})))}),!found&&tentativeRecNum&&(newRecNum=tentativeRecNum,found=!0);return newRecNum},next=function(srcInfo,detId){var origRecNum=currRecNum;return srcInfo?(currRecNum=findBySourceInfo(srcInfo,"n",detId),origRecNum!==currRecNum&¬ifyCallbacks(),info()):(currRecNum0&&currRecNum--,notifyCallbacks(),info())},first=function(srcInfo,detId){var origRecNum=currRecNum;return srcInfo?(currRecNum=findBySourceInfo(srcInfo,"f",detId),origRecNum!==currRecNum&¬ifyCallbacks(),info()):(currRecNum=0,notifyCallbacks(),info())},last=function(srcInfo,detId){var origRecNum=currRecNum;return srcInfo?(currRecNum=findBySourceInfo(srcInfo,"l",detId),origRecNum!==currRecNum&¬ifyCallbacks(),info()):(currRecNum=numRecs-1,notifyCallbacks(),info())},curr=function(){return notifyCallbacks(),info()},getChangedByNum=function(recNum){var json=pregnancyCache.get(PREGNANCY_CACHE_KEY),changed={};return isNaN(parseInt(recNum,10))?changed:recNum>numRecs?changed:recNum<1?changed:json?(_.each(historicalSources,function(src){changed[src]=getChangedBySource(json,src,recNum-1)}),changed):changed},info=function(){return{numberRecords:numRecs,currentRecord:currRecNum+1,pregnancyId:pregnancyId}},lookup=function(table,key,val){var lookups,json=pregnancyCache.get(PREGNANCY_CACHE_KEY),search={};if(json&&(lookups=json[1],_.has(lookups,table)))return search[key]=val,_.findWhere(lookups[table],search)},getChangedFields=function(changed,detId){var key=""+currRecNum,changedFields=changedFieldsCache.get(key);return changedFields?changedFields:(changedFields={},_.each(changed,function(obj,tbl){var flds=[];_.size(obj)>0&&(flds=detId&&obj[detId]&&obj[detId].fields?obj[detId].fields:obj[_.keys(obj)[0]].fields,_.each(flds,function(f){changedFields[f]=!0}))}),changedFieldsCache.put(key,changedFields),changedFields)};return{load:load,loadAsNeeded:loadAsNeeded,register:register,registerPubSub:registerPubSub,unregister:unregister,next:next,prev:prev,first:first,last:last,curr:curr,info:info,lookup:lookup,getChangedByNum:getChangedByNum,getChangedFields:getChangedFields}}])}(angular,_),function(angular){"use strict";angular.module("changeRoutingServiceModule",[]).factory("changeRoutingService",["loggingService",function(log){var DETAIL_ID_KEY_FIELD="detIdKey",DETAIL_ID_VAL_FIELD="detIdVal",fieldStateMap={pregnancyHistory:{DEFAULT:"pregnancy.pregnancyHistory",SECONDARY:"pregnancy.midwife",STATE_DETAIL_ID_NAME:"phid"},pregnote:{DEFAULT:"pregnancy.labs"},customField:{DEFAULT:"pregnancy.general"},healthTeaching:{DEFAULT:"pregnancy.labs"},labTestResult:{DEFAULT:"pregnancy.labs"},medication:{DEFAULT:"pregnancy.labs"},prenatalExam:{DEFAULT:"pregnancy.prenatalExam",SECONDARY:"pregnancy.prenatal",STATE_DETAIL_ID_NAME:"peid"},referral:{DEFAULT:"pregnancy.labs"},risk:{DEFAULT:"pregnancy.prenatal"},schedule:{DEFAULT:"pregnancy.general"},vaccination:{DEFAULT:"pregnancy.labs"},patient:{ageOfMenarche:"pregnancy.midwife",dohID:"pregnancy.general",dob:"pregnancy.general",generalInfo:"pregnancy.general"},pregnancy:{firstname:"pregnancy.general",lastname:"pregnancy.general",maidenname:"pregnancy.general",nickname:"pregnancy.general",religion:"pregnancy.general",maritalStatus:"pregnancy.general",telephone:"pregnancy.general",work:"pregnancy.general",education:"pregnancy.general",clientIncome:"pregnancy.general",clientIncomePeriod:"pregnancy.general",address1:"pregnancy.general",address2:"pregnancy.general",address3:"pregnancy.general",address4:"pregnancy.general",city:"pregnancy.general",state:"pregnancy.general",postalCode:"pregnancy.general",country:"pregnancy.general",gravidaNumber:"pregnancy.midwife",lmp:"pregnancy.prenatal",sureLMP:"pregnancy.prenatal",warning:"pregnancy.prenatal",riskNote:"pregnancy.prenatal",alternateEdd:"pregnancy.prenatal",useAlternateEdd:"pregnancy.prenatal",doctorConsultDate:"pregnancy.labs",dentistConsultDate:"pregnancy.labs",mbBook:"pregnancy.general",whereDeliver:"pregnancy.questionnaire",fetuses:"pregnancy.midwife",monozygotic:"pregnancy.midwife",pregnancyEndDate:"pregnancy.prenatal",pregnancyEndResult:"pregnancy.prenatal",iugr:"pregnancy.prenatal",note:"pregnancy.midwife",numberRequiredTetanus:"pregnancy.labs",invertedNipples:"pregnancy.midwife",hasUS:"pregnancy.midwife",wantsUS:"pregnancy.midwife",gravida:"pregnancy.midwife",stillBirths:"pregnancy.midwife",abortions:"pregnancy.midwife",living:"pregnancy.midwife",para:"pregnancy.midwife",term:"pregnancy.midwife",preterm:"pregnancy.midwife",philHealthMCP:"pregnancy.prenatal",philHealthNCP:"pregnancy.prenatal",philHealthID:"pregnancy.prenatal",philHealthApproved:"pregnancy.prenatal",transferOfCare:"pregnancy.prenatal",transferOfCareNote:"pregnancy.prenatal",currentlyVomiting:"pregnancy.questionnaire",currentlyDizzy:"pregnancy.questionnaire",currentlyFainting:"pregnancy.questionnaire",currentlyBleeding:"pregnancy.questionnaire",currentlyUrinationPain:"pregnancy.questionnaire",currentlyBlurryVision:"pregnancy.questionnaire",currentlySwelling:"pregnancy.questionnaire",currentlyVaginalPain:"pregnancy.questionnaire",currentlyVaginalItching:"pregnancy.questionnaire",currentlyNone:"pregnancy.questionnaire",useIodizedSalt:"pregnancy.questionnaire",takingMedication:"pregnancy.questionnaire",planToBreastFeed:"pregnancy.questionnaire",birthCompanion:"pregnancy.questionnaire",practiceFamilyPlanning:"pregnancy.questionnaire",practiceFamilyPlanningDetails:"pregnancy.questionnaire",familyHistoryTwins:"pregnancy.questionnaire",familyHistoryHighBloodPressure:"pregnancy.questionnaire",familyHistoryDiabetes:"pregnancy.questionnaire",familyHistoryHeartProblems:"pregnancy.questionnaire",familyHistoryTB:"pregnancy.questionnaire",familyHistorySmoking:"pregnancy.questionnaire",familyHistoryNone:"pregnancy.questionnaire",historyFoodAllergy:"pregnancy.questionnaire",historyMedicineAllergy:"pregnancy.questionnaire",historyAsthma:"pregnancy.questionnaire",historyHeartProblems:"pregnancy.questionnaire",historyKidneyProblems:"pregnancy.questionnaire",historyHepatitis:"pregnancy.questionnaire",historyGoiter:"pregnancy.questionnaire",historyHighBloodPressure:"pregnancy.questionnaire",historyHospitalOperation:"pregnancy.questionnaire",historyBloodTransfusion:"pregnancy.questionnaire",historySmoking:"pregnancy.questionnaire",historyDrinking:"pregnancy.questionnaire",historyNone:"pregnancy.questionnaire",questionnaireNote:"pregnancy.questionnaire",partnerFirstname:"pregnancy.general",partnerLastname:"pregnancy.general",partnerAge:"pregnancy.general",partnerWork:"pregnancy.general",partnerEducation:"pregnancy.general",partnerIncome:"pregnancy.general",partnerIncomePeriod:"pregnancy.general"}},stateSourceFieldMap=function(){var result={};return _.each(_.keys(fieldStateMap),function(source){var obj=fieldStateMap[source];_.each(_.keys(obj),function(fld){var state=obj[fld];_.has(result,state)||(result[state]={}),_.has(result[state],source)||(result[state][source]=[]),fld&&result[state][source].push(fld)})}),result}(),getState=function(changes){var changed={},state={},defaultState={stateName:"pregnancy.general"};return _.each(changes,function(val,key){val&&_.size(val)>0&&(changed[key]=val)}),_.each(changed,function(records,table){_.each(records,function(recObj,recId){!state.stateName&&fieldStateMap[table]&&(_.each(recObj.fields,function(f){!state.stateName&&fieldStateMap[table][f]&&(state.stateName=fieldStateMap[table][f])}),!state.stateName&&fieldStateMap[table].DEFAULT&&(state.stateName=fieldStateMap[table].DEFAULT),fieldStateMap[table].STATE_DETAIL_ID_NAME&&(state.detIdKey=fieldStateMap[table].STATE_DETAIL_ID_NAME,state.detIdVal=recId))})}),state.stateName||(log.log("Warning: no state found for following changelog."),log.dir(changes)),state.stateName?state:defaultState},getStateDetKey=function(stateObj){return stateObj[DETAIL_ID_KEY_FIELD]||""},getStateDetVal=function(stateObj){return stateObj[DETAIL_ID_VAL_FIELD]||""},getSourceFieldInfo=function(state){var result=stateSourceFieldMap[state]||{};return result};return{getState:getState,getSourceFieldInfo:getSourceFieldInfo,getStateDetKey:getStateDetKey,getStateDetVal:getStateDetVal}}])}(angular),function(angular,window){"use strict";var getViewportSize=function(w){if(w=w||window,null!==w.innerWidth)return{w:w.innerWidth,h:w.innerHeight};var d=w.document;return"CSS1Compat"==document.compatMode?{w:d.documentElement.clientWidth,h:d.documentElement.clientHeight}:{w:d.body.clientWidth,h:d.body.clientWidth}};angular.module("templateServiceModule",[]).factory("templateService",["$http","$templateCache","$cacheFactory","$q","moment","minPubSubNg","loggingService",function($http,$templateCache,$cacheFactory,$q,moment,pubSub,log){var viewPort=getViewportSize(window),registeredCallbacks=[],SMALL="480",MEDIUM="600",LARGE="992",genericTemplateUrls=[],getTemplateSize=function(width){return width$scope.ctrl.numberRecords?void log.error("Invalid record number: "+recNum+". Aborting navigation."):void($scope.ctrl.follow?(changed=historyService.getChangedByNum(recNum),newState=changeRoutingService.getState(changed),detKeyFld=changeRoutingService.getStateDetKey(newState),detKeyVal=changeRoutingService.getStateDetVal(newState),detKeyFld&&detKeyVal&&(newStateParams={},newStateParams[detKeyFld]=detKeyVal),newState.stateName!==$state.$current.name?$state.go(newState.stateName,newStateParams):detKeyFld&&detKeyVal&&$state.params[detKeyFld]&&parseInt($state.params[detKeyFld],10)!==parseInt(detKeyVal,10)?$state.go(newState.stateName,newStateParams):updateMeta($scope,navFunc())):(sourceInfo=changeRoutingService.getSourceFieldInfo($scope.$root.hsState),updateMeta($scope,navFunc(sourceInfo,$scope.$root.detId))))},updateMeta=function($scope,info){$scope.ctrl.currentRecord=info.currentRecord,$scope.ctrl.numberRecords=info.numberRecords,$scope.ctrl.pregnancyId=info.pregnancyId},resetMeta=function($scope){$scope.ctrl.currentRecord=0,$scope.ctrl.numberRecords=0,$scope.ctrl.pregnancyId=0};return{restrict:"E",replace:!0,controllerAs:"ctrl",scope:{hcPregId:"@",hcFollow:"@"},controller:function(){},link:function($scope,element,attrs,ctrl){var pregId,prevHandle,nextHandle,currViewport=templateService.getViewportSize(),hsUnregisterHdl=""+99999999*Math.random(),attachEvents=function($scope,element){var firstLink=element.find("#historyControl-first"),prevLink=element.find("#historyControl-prev"),nextLink=element.find("#historyControl-next"),lastLink=element.find("#historyControl-last");firstLink.on("click",function(evt){navigate($scope,1,historyService.first)});prevHandle=prevLink.on("click",function(evt){1!==$scope.ctrl.currentRecord&&navigate($scope,$scope.ctrl.currentRecord-1,historyService.prev)}),nextHandle=nextLink.on("click",function(evt){$scope.ctrl.currentRecord!==$scope.ctrl.numberRecords&&navigate($scope,$scope.ctrl.currentRecord+1,historyService.next)});lastLink.on("click",function(evt){navigate($scope,$scope.ctrl.numberRecords,historyService.last)})},loadTemplate=function(templateName){templateService.getTemplate(templateName).then(function(tmpl){element.html(tmpl).show(),$compile(element.contents())($scope),attachEvents($scope,element)})},templateName="/angular/components/historyControl/historyControl.RES.tmpl";loadTemplate(templateName),templateService.register("historyControl",function(viewPort){templateService.needTemplateChange(currViewport)&&(currViewport=templateService.getViewportSize(),loadTemplate(templateName))}),$scope.ctrl.currentRecord=0,$scope.ctrl.numberRecords=0,$scope.ctrl.pregnancyId=0,$scope.ctrl.updatedBy="",$scope.ctrl.follow=!(!attrs.hcFollow||"true"!==attrs.hcFollow),$scope.followChange=function(){},historyService.registerPubSub(hsUnregisterHdl,function(data){0===$scope.ctrl.currentRecord&&updateMeta($scope,historyService.info()),$scope.ctrl.replacedAt=data.replacedAt,$scope.$applyAsync("ctrl.replacedAt"),$scope.ctrl.updatedBy=void 0,$scope.ctrl.supervisor=void 0,data.changedBy.updatedBy&&($scope.ctrl.updatedBy=historyService.lookup("user","id",data.changedBy.updatedBy).username),data.changedBy.supervisor&&($scope.ctrl.supervisor=historyService.lookup("user","id",data.changedBy.supervisor).username)}),$scope.$on("$destroy",function(){var handles=[prevHandle,nextHandle];handles.forEach(function(h){angular.element(window).off("click",h)}),pubSub.publish(hsUnregisterHdl)}),$scope.hcPregId&&(pregId=parseInt($scope.hcPregId,10),_.isNumber(pregId)&&(resetMeta($scope),historyService.load(pregId)))}}}])}(angular),function(angular){"use strict";angular.module("patientWellModule",[]).directive("patientWell",["$compile","historyService","templateService","loggingService",function($compile,historyService,templateService,log){return{restrict:"A",replace:!1,controllerAs:"ctrl",scope:{},controller:function(){},link:function($scope,element,attrs,ctrl){var hsCallback,currViewport=templateService.getViewportSize(),loadTemplate=function(templateName){templateService.getTemplate(templateName).then(function(tmpl){element.html(tmpl).show(),$compile(element.contents())($scope)})},templateName="/angular/components/patientWell/patientWell.RES.tmpl";loadTemplate(templateName),templateService.register("patientWell",function(viewPort){templateService.needTemplateChange(currViewport)&&(currViewport=templateService.getViewportSize(),loadTemplate(templateName))}),hsCallback=historyService.register(function(data){$scope.ctrl=data}),$scope.$on("$destroy",function(){historyService.unregister(hsCallback)?log.log("Successfully unregistered history service callback."):log.log("Did not successfully unregister history service callback.")})}}}])}(angular);
\ No newline at end of file
diff --git a/build_odroid/roles/build_clients/files/elm_static/midwife-emr-footer.min.js b/build_odroid/roles/build_clients/files/elm_static/midwife-emr-footer.min.js
new file mode 100644
index 0000000..9839623
--- /dev/null
+++ b/build_odroid/roles/build_clients/files/elm_static/midwife-emr-footer.min.js
@@ -0,0 +1,12 @@
+if(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=!!obj&&"length"in obj&&obj.length,type=jQuery.type(obj);return"function"!==type&&!jQuery.isWindow(obj)&&("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 jQuery.inArray(elem,qualifier)>-1!==not})}function sibling(cur,dir){do cur=cur[dir];while(cur&&1!==cur.nodeType);return cur}function createOptions(options){var object={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function detach(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))}function completed(){(document.addEventListener||"load"===window.event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())}function dataAttr(elem,key,data){if(void 0===data&&1===elem.nodeType){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();if(data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data||"false"!==data&&("null"===data?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data)}catch(e){}jQuery.data(elem,key,data)}else data=void 0}return data}function isEmptyDataObject(obj){var name;for(name in obj)if(("data"!==name||!jQuery.isEmptyObject(obj[name]))&&"toJSON"!==name)return!1;return!0}function internalData(elem,name,data,pvt){if(acceptData(elem)){var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||void 0!==data||"string"!=typeof name)return id||(id=isNode?elem[internalKey]=deletedIds.pop()||jQuery.guid++:internalKey),cache[id]||(cache[id]=isNode?{}:{toJSON:jQuery.noop}),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),void 0!==data&&(thisCache[jQuery.camelCase(name)]=data),"string"==typeof name?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(acceptData(elem)){var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" ")),i=name.length;for(;i--;)delete thisCache[name[i]];if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache))return}(pvt||(delete cache[id].data,isEmptyDataObject(cache[id])))&&(isNode?jQuery.cleanData([elem],!0):support.deleteExpando||cache!=cache.window?delete cache[id]:cache[id]=void 0)}}}function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale=1,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=(jQuery.cssNumber[prop]||"px"!==unit&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){unit=unit||initialInUnit[3],valueParts=valueParts||[],initialInUnit=+initial||1;do scale=scale||".5",initialInUnit/=scale,jQuery.style(elem,prop,initialInUnit+unit);while(scale!==(scale=currentValue()/initial)&&1!==scale&&--maxIterations)}return valueParts&&(initialInUnit=+initialInUnit||+initial||0,adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2],tween&&(tween.unit=unit,tween.start=initialInUnit,tween.end=adjusted)),adjusted}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function getAll(context,tag){var elems,elem,i=0,found="undefined"!=typeof context.getElementsByTagName?context.getElementsByTagName(tag||"*"):"undefined"!=typeof context.querySelectorAll?context.querySelectorAll(tag||"*"):void 0;if(!found)for(found=[],elems=context.childNodes||context;null!=(elem=elems[i]);i++)!tag||jQuery.nodeName(elem,tag)?found.push(elem):jQuery.merge(found,getAll(elem,tag));return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],found):found}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function fixDefaultChecked(elem){rcheckableType.test(elem.type)&&(elem.defaultChecked=elem.checked)}function buildFragment(elems,context,scripts,selection,ignored){for(var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;i"!==wrap[1]||rtbody.test(elem)?0:tmp:tmp.firstChild,j=elem&&elem.childNodes.length;j--;)jQuery.nodeName(tbody=elem.childNodes[j],"tbody")&&!tbody.childNodes.length&&elem.removeChild(tbody);for(jQuery.merge(nodes,tmp.childNodes),tmp.textContent="";tmp.firstChild;)tmp.removeChild(tmp.firstChild);tmp=safe.lastChild}else nodes.push(context.createTextNode(elem));for(tmp&&safe.removeChild(tmp),support.appendChecked||jQuery.grep(getAll(nodes,"input"),fixDefaultChecked),i=0;elem=nodes[i++];)if(selection&&jQuery.inArray(elem,selection)>-1)ignored&&ignored.push(elem);else if(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(safe.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts)for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return tmp=null,safe}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,type;if("object"==typeof types){"string"!=typeof selector&&(data=data||selector,selector=void 0);for(type in types)on(elem,type,selector,data,types[type],one);return elem}if(null==data&&null==fn?(fn=selector,data=selector=void 0):null==fn&&("string"==typeof selector?(fn=data,data=void 0):(fn=data,data=selector,selector=void 0)),fn===!1)fn=returnFalse;else if(!fn)return elem;return 1===one&&(origFn=fn,fn=function(event){return jQuery().off(event),origFn.apply(this,arguments)},fn.guid=origFn.guid||(origFn.guid=jQuery.guid++)),elem.each(function(){jQuery.event.add(this,types,fn,data,selector)})}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!==jQuery.find.attr(elem,"type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;i1&&"string"==typeof value&&!support.checkClone&&rchecked.test(value))return collection.each(function(index){var self=collection.eq(index);isFunction&&(args[0]=value.call(this,index,self.html())),domManip(self,args,callback,ignored)});if(l&&(fragment=buildFragment(args,collection[0].ownerDocument,!1,collection,ignored),first=fragment.firstChild,1===fragment.childNodes.length&&(fragment=first),first||ignored)){for(scripts=jQuery.map(getAll(fragment,"script"),disableScript),hasScripts=scripts.length;i")).appendTo(doc.documentElement),doc=(iframe[0].contentWindow||iframe[0].contentDocument).document,doc.write(),doc.close(),display=actualDisplay(nodeName,doc),iframe.detach()),elemdisplay[nodeName]=display),display}function addGetHookIf(conditionFn,hookFn){return{get:function(){return conditionFn()?void delete this.get:(this.get=hookFn).apply(this,arguments)}}}function vendorPropName(name){if(name in emptyStyle)return name;for(var capName=name.charAt(0).toUpperCase()+name.slice(1),i=cssPrefixes.length;i--;)if(name=cssPrefixes[i]+capName,name in emptyStyle)return name}function showHide(elements,show){for(var display,elem,hidden,values=[],index=0,length=elements.length;index=0&&j=0},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},isPlainObject:function(obj){var key;if(!obj||"object"!==jQuery.type(obj)||obj.nodeType||jQuery.isWindow(obj))return!1;try{if(obj.constructor&&!hasOwn.call(obj,"constructor")&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(!support.ownFirst)for(key in obj)return hasOwn.call(obj,key);for(key in obj);return void 0===key||hasOwn.call(obj,key)},type:function(obj){return null==obj?obj+"":"object"==typeof obj||"function"==typeof obj?class2type[toString.call(obj)]||"object":typeof obj},globalEval:function(data){data&&jQuery.trim(data)&&(window.execScript||function(data){window.eval.call(window,data)})(data)},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback){var length,i=0;if(isArrayLike(obj))for(length=obj.length;iExpr.cacheLength&&delete cache[keys.shift()],cache[key+" "]=value}var keys=[];return cache}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return!!fn(div)}catch(e){return!1}finally{div.parentNode&&div.parentNode.removeChild(div),div=null}}function addHandle(attrs,handler){for(var arr=attrs.split("|"),i=arr.length;i--;)Expr.attrHandle[arr[i]]=handler}function siblingCheck(a,b){var cur=b&&a,diff=cur&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();
+return("input"===name||"button"===name)&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function testContext(context){return context&&"undefined"!=typeof context.getElementsByTagName&&context}function setFilters(){}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i