{"version":3,"sources":["scripts/vendor-98c4244edb.js"],"names":["global","factory","module","exports","document","w","Error","window","this","noGlobal","isArraylike","obj","length","type","jQuery","isWindow","nodeType","winnow","elements","qualifier","not","isFunction","grep","elem","i","call","risSimple","test","filter","indexOf","sibling","cur","dir","createOptions","options","object","optionsCache","each","match","rnotwhite","_","flag","completed","removeEventListener","ready","Data","Object","defineProperty","cache","get","expando","uid","dataAttr","key","data","name","undefined","replace","rmultiDash","toLowerCase","getAttribute","rbrace","parseJSON","e","data_user","set","returnTrue","returnFalse","safeActiveElement","activeElement","err","manipulationTarget","content","nodeName","firstChild","getElementsByTagName","appendChild","ownerDocument","createElement","disableScript","restoreScript","rscriptTypeMasked","exec","removeAttribute","setGlobalEval","elems","refElements","l","data_priv","cloneCopyEvent","src","dest","pdataOld","pdataCur","udataOld","udataCur","events","hasData","access","handle","event","add","extend","getAll","context","tag","ret","querySelectorAll","merge","fixInput","rcheckableType","checked","defaultValue","actualDisplay","doc","style","appendTo","body","display","getDefaultComputedStyle","css","detach","defaultDisplay","elemdisplay","iframe","documentElement","contentDocument","write","close","curCSS","computed","width","minWidth","maxWidth","getStyles","getPropertyValue","contains","rnumnonpx","rmargin","addGetHookIf","conditionFn","hookFn","apply","arguments","vendorPropName","capName","toUpperCase","slice","origName","cssPrefixes","setPositiveNumber","value","subtract","matches","rnumsplit","Math","max","augmentWidthOrHeight","extra","isBorderBox","styles","val","cssExpand","getWidthOrHeight","valueIsBorderBox","offsetWidth","offsetHeight","support","boxSizingReliable","parseFloat","showHide","show","hidden","values","index","isHidden","Tween","prop","end","easing","prototype","init","createFxNow","setTimeout","fxNow","now","genFx","includeWidth","which","attrs","height","opacity","createTween","animation","tween","collection","tweeners","concat","defaultPrefilter","props","opts","toggle","hooks","oldfire","checkDisplay","anim","orig","dataShow","queue","_queueHooks","unqueued","empty","fire","always","overflow","overflowX","overflowY","rfxtypes","isEmptyObject","done","hide","remove","start","propFilter","specialEasing","camelCase","isArray","cssHooks","expand","Animation","properties","result","stopped","animationPrefilters","deferred","Deferred","tick","currentTime","remaining","startTime","duration","temp","percent","tweens","run","notifyWith","resolveWith","promise","originalProperties","originalOptions","push","stop","gotoEnd","rejectWith","map","fx","timer","progress","complete","fail","addToPrefiltersOrTransports","structure","dataTypeExpression","func","dataType","dataTypes","unshift","inspectPrefiltersOrTransports","jqXHR","inspect","selected","inspected","prefilterOrFactory","dataTypeOrTransport","seekingTransport","transports","ajaxExtend","target","deep","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","contents","shift","mimeType","getResponseHeader","converters","ajaxConvert","response","isSuccess","conv2","current","conv","tmp","prev","responseFields","dataFilter","split","state","error","buildParams","prefix","traditional","v","rbracket","getWindow","defaultView","arr","class2type","toString","hasOwn","hasOwnProperty","version","selector","fn","rtrim","rmsPrefix","rdashAlpha","fcamelCase","all","letter","jquery","constructor","toArray","num","pushStack","prevObject","callback","args","first","eq","last","len","j","sort","splice","copy","copyIsArray","clone","isPlainObject","random","isReady","msg","noop","Array","isNumeric","globalEval","code","script","indirect","eval","trim","text","head","parentNode","removeChild","string","makeArray","results","inArray","second","invert","callbackInverse","callbackExpect","arg","guid","proxy","Date","Sizzle","seed","m","groups","old","nid","newContext","newSelector","preferredDoc","setDocument","documentIsHTML","rquickExpr","getElementById","id","getElementsByClassName","qsa","rbuggyQSA","tokenize","rescape","setAttribute","toSelector","rsibling","testContext","join","qsaError","select","createCache","keys","Expr","cacheLength","markFunction","assert","div","addHandle","handler","attrHandle","siblingCheck","a","b","diff","sourceIndex","MAX_NEGATIVE","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","setFilters","tokens","addCombinator","matcher","combinator","base","checkNonElements","doneName","xml","oldCache","outerCache","newCache","dirruns","elementMatcher","matchers","multipleContexts","contexts","condense","unmatched","newUnmatched","mapped","setMatcher","preFilter","postFilter","postFinder","postSelector","preMap","postMap","preexisting","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","find","dirrunsUnique","pop","uniqueSort","getText","isXML","compile","sortInput","hasDuplicate","docElem","rbuggyMatches","classCache","tokenCache","compilerCache","sortOrder","push_native","list","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","rwhitespace","RegExp","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","runescape","funescape","escaped","escapedWhitespace","high","String","fromCharCode","unloadHandler","childNodes","els","node","hasCompare","parent","top","addEventListener","attachEvent","className","createComment","getById","getElementsByName","attrId","getAttributeNode","innerHTML","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","expr","attr","specified","duplicates","detectDuplicates","sortStable","textContent","nodeValue","selectors","createPseudo",">"," ","+","~","excess","unquoted","nodeNameSelector","pattern","operator","check","what","simple","forward","ofType","nodeIndex","useCache","lastChild","pseudo","idx","matched","has","innerText","lang","elemLang","hash","location","root","focus","hasFocus","href","tabIndex","enabled","disabled","selectedIndex","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","soFar","preFilters","cached","token","compiled","div1","unique","isXMLDoc","rneedsContext","rsingleTag","self","is","rootjQuery","parseHTML","rparentsprev","guaranteedUnique","children","next","until","truncate","n","targets","closest","pos","prevAll","addBack","parents","parentsUntil","nextAll","nextUntil","prevUntil","siblings","reverse","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","stack","once","stopOnFalse","disable","lock","locked","fireWith","tuples","then","fns","newDefer","tuple","returned","resolve","reject","notify","pipe","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","updateFunc","readyList","readyWait","holdReady","hold","wait","triggerHandler","off","readyState","chainable","emptyGet","raw","bulk","acceptData","owner","accepts","descriptor","unlock","defineProperties","stored","camel","discard","removeData","_data","_removeData","camelKey","dequeue","startLength","setter","clearQueue","count","defer","pnum","source","el","fragment","createDocumentFragment","checkClone","cloneNode","noCloneChecked","strundefined","focusinBubbles","rkeyEvent","rmouseEvent","rfocusMorph","rtypenamespace","types","handleObjIn","eventHandle","t","handleObj","special","handlers","namespaces","origType","elemData","triggered","dispatch","delegateType","bindType","namespace","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","trigger","onlyHandlers","bubbleType","ontype","eventPath","Event","isTrigger","namespace_re","noBubble","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","fixHooks","keyHooks","original","charCode","keyCode","mouseHooks","eventDoc","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","originalEvent","fixHook","load","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","timeStamp","stopImmediatePropagation","mouseenter","mouseleave","pointerenter","pointerleave","related","relatedTarget","attaches","on","one","origFn","rxhtmlTag","rtagName","rhtml","rnoInnerhtml","rchecked","rscriptType","rcleanScript","wrapMap","option","thead","col","tr","td","optgroup","tbody","tfoot","colgroup","caption","th","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","buildFragment","scripts","selection","wrap","nodes","createTextNode","cleanData","append","domManip","prepend","insertBefore","before","after","keepData","html","replaceWith","replaceChild","hasScripts","iNoClone","_evalUrl","prependTo","insertAfter","replaceAll","insert","opener","getComputedStyle","computePixelPositionAndBoxSizingReliable","cssText","container","divStyle","pixelPositionVal","boxSizingReliableVal","backgroundClip","clearCloneStyle","pixelPosition","reliableMarginRight","marginDiv","marginRight","swap","rdisplayswap","rrelNum","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","cssNumber","columnCount","fillOpacity","flexGrow","flexShrink","lineHeight","order","orphans","widows","zIndex","zoom","cssProps","float","margin","padding","border","suffix","expanded","parts","unit","propHooks","eased","step","linear","p","swing","cos","PI","timerId","rfxnum","rrun","*","scale","maxIterations","tweener","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","interval","setInterval","clearInterval","slow","fast","delay","time","timeout","clearTimeout","checkOn","optSelected","optDisabled","radioValue","nodeHook","boolHook","removeAttr","nType","attrHooks","propName","attrNames","propFix","getter","rfocusable","removeProp","for","class","notxml","hasAttribute","rclass","addClass","classes","clazz","finalValue","proceed","removeClass","toggleClass","stateVal","classNames","hasClass","rreturn","valHooks","optionSet","hover","fnOver","fnOut","bind","unbind","delegate","undelegate","nonce","rquery","JSON","parse","parseXML","DOMParser","parseFromString","rhash","rts","rheaders","rlocalProtocol","rnoContent","rprotocol","rurl","prefilters","allTypes","ajaxLocation","ajaxLocParts","active","lastModified","etag","url","isLocal","processData","async","contentType","json","* text","text html","text json","text xml","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","status","nativeStatusText","headers","success","modified","statusText","timeoutTimer","transport","responseHeadersString","ifModified","cacheURL","callbackContext","statusCode","fireGlobals","globalEventContext","completeDeferred","responseHeaders","requestHeaders","requestHeadersNames","strAbort","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","abort","finalText","method","crossDomain","param","hasContent","beforeSend","send","getJSON","getScript","throws","wrapAll","firstElementChild","wrapInner","unwrap","visible","r20","rCRLF","rsubmitterTypes","rsubmittable","encodeURIComponent","serialize","serializeArray","xhr","XMLHttpRequest","xhrId","xhrCallbacks","xhrSuccessStatus","0","1223","xhrSupported","cors","open","username","xhrFields","onload","onerror","responseText","text script","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","keepScripts","parsed","_load","params","animated","offset","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","curElem","left","using","win","box","getBoundingClientRect","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","","defaultExtra","funcName","size","andSelf","define","amd","_jQuery","_$","$","noConflict","errorHandlingConfig","config","isObject","isDefined","objectMaxDepth","minErrConfig","isValidObjectMaxDepth","NaN","maxDepth","isNumber","minErr","ErrorConstructor","paramPrefix","template","message","templateArgs","sliceArgs","toDebugString","isArrayLike","isString","jqLite","item","forEach","iterator","isPrimitive","isBlankObject","forEachSorted","reverseParams","iteratorFn","nextUid","setHashKey","h","$$hashKey","baseExtend","dst","objs","ii","jj","isDate","valueOf","isRegExp","isElement","toInt","str","parseInt","inherit","create","identity","valueFn","hasCustomToString","isUndefined","getPrototypeOf","isError","isScope","$evalAsync","$watch","isFile","isFormData","isBlob","isBoolean","isPromiseLike","isTypedArray","TYPED_ARRAY_REGEXP","isArrayBuffer","makeMap","items","nodeName_","element","lowercase","includes","array","arrayRemove","destination","copyRecurse","copyElement","stackSource","stackDest","ngMinErr","needsRecurse","copyType","buffer","byteOffset","copied","ArrayBuffer","byteLength","Uint8Array","re","lastIndex","simpleCompare","equals","o1","o2","keySet","t1","t2","getTime","createMap","charAt","array1","array2","startIndex","curryArgs","toJsonReplacer","toJson","pretty","stringify","fromJson","timezoneToOffset","timezone","fallback","ALL_COLONS","requestedTimezoneOffset","isNumberNaN","addDateMinutes","date","minutes","setMinutes","getMinutes","convertTimezoneToLocal","dateTimezoneOffset","getTimezoneOffset","timezoneOffset","startingTag","elemHtml","NODE_TYPE_TEXT","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","arrayValue","encodeUriQuery","encodeUriSegment","pctEncodeSpaces","getNgAttribute","ngAttr","ngAttrPrefixes","allowAutoBootstrap","currentScript","HTMLScriptElement","SVGScriptElement","srcs","getNamedItem","every","link","origin","protocol","angularInit","bootstrap","appElement","candidate","querySelector","isAutoBootstrapAllowed","console","strictDi","modules","defaultConfig","doBootstrap","injector","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","scope","$apply","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","reload","getTestability","rootElement","snake_case","separator","SNAKE_CASE_REGEXP","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","JQLitePrototype","isolateScope","controller","inheritedData","$destroy","JQLite","assertArg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","path","bindFnToScope","lastInstance","getBlockNodes","blockNodes","endNode","setupModuleLoader","ensure","$injectorMinErr","$$minErr","requires","configFn","info","invokeLater","provider","insertMethod","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","directive","component","block","shallowCopy","serializeObject","seen","publishExternalAPI","uppercase","callbacks","$$counter","$$csp","csp","$$encodeUriSegment","$$encodeUriQuery","$$stringify","angularModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","htmlAnchorDirective","inputDirective","textarea","form","formDirective","scriptDirective","selectDirective","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","patternDirective","ngPattern","required","requiredDirective","ngRequired","minlength","minlengthDirective","ngMinlength","maxlength","maxlengthDirective","ngMaxlength","ngValue","ngValueDirective","ngModelOptions","ngModelOptionsDirective","ngIncludeFillContentDirective","ngAttributeAliasDirectives","ngEventDirectives","$anchorScroll","$AnchorScrollProvider","$animate","$AnimateProvider","$animateCss","$CoreAnimateCssProvider","$$animateJs","$$CoreAnimateJsProvider","$$animateQueue","$$CoreAnimateQueueProvider","$$AnimateRunner","$$AnimateRunnerFactoryProvider","$$animateAsyncRun","$$AnimateAsyncRunFactoryProvider","$browser","$BrowserProvider","$cacheFactory","$CacheFactoryProvider","$controller","$ControllerProvider","$document","$DocumentProvider","$$isDocumentHidden","$$IsDocumentHiddenProvider","$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","$$Map","$$MapProvider","$$cookieReader","$$CookieReaderProvider","angularVersion","jqNextId","jqId","cssKebabToCamel","kebabToCamel","MS_HACK_REGEXP","fnCamelCaseReplace","DASH_LOWERCASE_REGEXP","jqLiteIsTextNode","HTML_REGEXP","jqLiteAcceptsData","NODE_TYPE_ELEMENT","NODE_TYPE_DOCUMENT","jqLiteHasData","jqCache","ng339","jqLiteBuildFragment","TAG_NAME_REGEXP","XHTML_TAG_REGEXP","jqLiteParseHTML","SINGLE_TAG_REGEXP","jqLiteWrapNode","wrapper","argIsString","jqLiteMinErr","jqLiteAddNodes","jqLiteReady","jqLiteClone","jqLiteDealoc","onlyDescendants","jqLiteOff","unsupported","expandoStore","jqLiteExpandoStore","removeHandler","listenerFns","MOUSE_EVENT_MAP","jqLiteRemoveData","expandoId","createIfNecessary","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","jqLiteRemoveClass","cssClasses","cssClass","jqLiteAddClass","existingClasses","jqLiteController","jqLiteInheritedData","names","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","jqLiteRemove","jqLiteDocumentLoaded","action","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","getAliasedAttrName","ALIASED_ATTR","createEventHandler","eventHandler","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","handlerWrapper","specialHandlerWrapper","defaultHandlerWrapper","specialMouseHandlerWrapper","jqLiteContains","$get","hashKey","nextUidFn","objType","NgMapShim","_keys","_values","_lastKey","_lastIndex","stringifyFn","Function","extractArgs","fnText","STRIP_COMMENTS","ARROW_ARG","FN_ARGS","anonFn","annotate","$inject","argDecl","FN_ARG_SPLIT","FN_ARG","underscore","modulesToLoad","supportObject","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","instanceInjector","factoryFn","enforce","$injector","instanceCache","serviceName","decorFn","origProvider","orig$get","origInstance","$delegate","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","createInternalInjector","getService","caller","INSTANTIATING","injectionArgs","locals","$$annotate","isClass","msie","$$ngIsClass","Type","ctor","NgMap","protoInstanceInjector","autoScrollingEnabled","disableAutoScrolling","getFirstAnchor","some","getYOffset","scroll","yOffset","bottom","scrollIntoView","elemTop","scrollBy","elm","newVal","oldVal","mergeClasses","extractElementNode","ELEMENT_NODE","splitClasses","klass","prepareAnimateOptions","Browser","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","getHash","substr","cacheStateAndFireUrlChange","pendingLocation","fireStateOrUrlChange","cacheState","cachedState","getCurrentState","lastCachedState","lastHistoryState","prevLastHistoryState","lastBrowserUrl","urlChangeListeners","listener","history","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","baseElement","sameState","sameBase","stripHash","urlChangeInit","onUrlChange","$$applicationDestroyed","$$checkUrlChange","baseHref","timeoutId","cancel","deferId","cacheFactory","cacheId","refresh","entry","freshEnd","staleEnd","nextEntry","prevEntry","caches","stats","capacity","Number","MAX_VALUE","lruHash","put","lruEntry","removeAll","destroy","UNINITIALIZED_VALUE","$$sanitizeUriProvider","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","bindings","definition","scopeName","bindingCache","$compileMinErr","mode","optional","attrName","parseDirectiveBindings","bindToController","assertValidDirectiveName","getDirectiveRequire","require","REQUIRE_PREFIX_REGEXP","getDirectiveRestrict","restrict","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","EVENT_HANDLER_ATTR_REGEXP","registerDirective","directiveFactory","directives","priority","registerComponent","makeInjectable","tElement","tAttrs","$element","$attrs","templateUrl","ddo","controllerAs","identifierForController","transclude","aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","preAssignBindingsEnabled","strictComponentBindingsEnabled","TTL","onChangesTtl","commentDirectivesEnabledConfig","commentDirectivesEnabled","cssClassDirectivesEnabledConfig","cssClassDirectivesEnabled","flushOnChangesQueue","onChangesQueue","errors","Attributes","attributesToCopy","$attr","$$element","setSpecialAttr","specialAttrHolder","attribute","removeNamedItem","setNamedItem","safeAddClass","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","compositeLinkFn","compileNodes","$$addScopeClass","cloneConnectFn","needsNewScope","$parent","$new","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","detectNamespaceForChildElements","$linkNode","wrapTemplate","controllerName","instance","$$addScopeInfo","parentElement","nodeList","$rootElement","nodeLinkFn","childLinkFn","childScope","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","nodeListLength","linkFns","transcludeOnThisElement","createBoundTranscludeFn","templateOnThisElement","linkFnFound","notLiveList","mergeConsecutiveTextNodes","collectDirectives","applyDirectivesToNode","terminal","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","boundSlots","$$slots","slotName","attrsMap","addDirective","directiveNormalize","nName","ngAttrName","isNgAttr","nAttrs","attrStartName","attrEndName","NG_ATTR_BINDING","PREFIX_REGEXP","multiElementMatch","MULTI_ELEMENT_DIR_RE","directiveIsMultiElement","addAttrInterpolateDirective","animVal","addTextInterpolateDirective","NODE_TYPE_COMMENT","collectCommentDirectives","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","linkFn","compilationGenerator","eager","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","linkNode","controllersBoundTransclude","cloneAttachFn","hasElementTranscludeDirective","elementControllers","scopeToChild","slotTranscludeFn","controllerScope","scopeBindingInfo","newScopeDirective","isSlotFilled","controllerDirectives","setupControllers","templateDirective","$$originalDirective","$$isolateBindings","initializeDirectiveBindings","removeWatches","$on","controllerDirective","$$bindings","bindingInfo","controllerResult","getControllers","controllerInstance","$onChanges","initialChanges","$onInit","$doCheck","$onDestroy","invokeLinkFn","$postLink","$template","directiveValue","terminalPriority","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","replaceDirective","childTranscludeFn","didScanForMultipleTransclusion","mightHaveMultipleTransclusionError","$$start","$$end","assertNoDuplicate","$$tlb","candidateDirective","scanningIndex","$$createComment","$$parentNode","slots","slotMap","filledSlots","elementSelector","filled","$$newScope","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectiveScope","mergeTemplateAttributes","compileTemplateUrl","inheritType","dataName","property","controllerKey","$scope","$transclude","newScope","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","$set","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","linkQueue","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","ignoreChildLinkFn","previousDirective","wrapModuleNameIfDefined","moduleName","interpolateFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","$$addBindingInfo","expressions","getTrustedContext","attrNormalizedName","HTML","RESOURCE_URL","trustedContext","mustHaveExpression","allOrNothing","$$observers","newValue","$$inter","$$scope","oldValue","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","annotation","strictBindingsCheck","recordChanges","currentValue","previousValue","$$postDigest","changes","triggerOnChangesHook","SimpleChange","removeWatchCollection","lastValue","parentGet","parentSet","removeWatch","$observe","_UNINITIALIZED_VALUE","literal","assign","parentValueWatch","parentValue","$stateful","$watchCollection","deepWatch","initialValue","SIMPLE_ATTR_NAME","$normalize","$addClass","classVal","$removeClass","newClasses","toAdd","tokenDifference","toRemove","writeAttr","booleanKey","aliasedKey","observer","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","floor","innerIdx","lastTuple","listeners","startSymbol","endSymbol","binding","isolated","noTemplate","comment","previous","SPECIAL_CHARS_REGEXP","str1","str2","tokens1","tokens2","outer","jqNodes","ident","CNTRL_REG","globals","register","allowGlobals","addIdentifier","expression","later","$controllerMinErr","controllerPrototype","changeListener","exception","cause","serializeValue","toISOString","toSerialize","topLevel","defaultHttpResponseTransform","tempData","JSON_PROTECTION_PREFIX","hasJsonContentType","APPLICATION_JSON","isJsonLike","$httpMinErr","jsonStart","JSON_START","JSON_ENDS","parseHeaders","fillInParsed","line","headerVal","headerKey","headersGetter","headersObj","transformData","defaults","transformResponse","transformRequest","d","common","Accept","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","jsonpCallbackParam","useApplyAsync","interceptorFactories","interceptors","requestConfig","chainInterceptors","thenFn","rejectFn","executeHeaderFns","headerContent","processedHeaders","headerFn","mergeHeaders","defHeaderName","lowercaseDefHeaderName","reqHeaderName","defHeaders","reqHeaders","defaultHeadersIteration","serverRequest","reqData","withCredentials","sendReq","resp","requestInterceptors","responseInterceptors","reversedInterceptors","interceptor","request","requestError","responseError","createShortMethods","createShortMethodsWithData","createApplyHandlers","eventHandlers","applyHandlers","callEventHandler","$applyAsync","$$phase","headersString","xhrStatus","resolveHttpPromise","resolvePromise","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","isJsonp","getTrustedResourceUrl","buildUrl","sanitizeJsonpCallbackParam","defaultCache","xsrfValue","urlIsSameOrigin","responseType","uploadEventHandlers","serializedParams","callbackParamRegex","interceptorFactory","createHttpBackend","createXhr","$browserDefer","rawDocument","jsonpReq","callbackPath","wasCalled","timeoutRequest","jsonpDone","completeRequest","createCallback","getResponse","removeCallback","urlResolve","requestAborted","requestTimeout","onabort","ontimeout","upload","escape","ch","unescapeText","escapedStartRegexp","escapedEndRegexp","constantWatchDelegate","objectEquality","constantInterp","unwatch","parseStringifyInterceptor","getValue","$interpolateMinErr","interr","unescapedText","exp","$$watchDelegate","endIndex","parseFns","textLength","expressionPositions","startSymbolLength","endSymbolLength","throwNoconcat","compute","getTrusted","$watchGroup","oldValues","currValue","invokeApply","hasParams","iteration","skipApply","$$intervalId","intervals","markQExceptionHandled","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","DOUBLE_SLASH_REGEX","$locationMinErr","prefixed","$$path","pathname","$$search","search","$$hash","startsWith","stripBaseUrl","trimEmptyHash","stripFile","lastIndexOf","serverBase","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","pathUrl","$$compose","$$url","$$absUrl","$$urlUpdatedByLocation","$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","removeWindowsDriveName","firstPathSegmentMatch","windowsFilePathExp","withoutHashUrl","withoutBaseUrl","LocationHashbangInHtml5Url","locationGetter","locationGetterSetter","preprocess","html5Mode","requireBase","rewriteLinks","setBrowserUrlWithFallback","oldUrl","oldState","$$state","afterLocationChange","$broadcast","absUrl","LocationMode","initialUrl","IGNORE_URI_REGEXP","ctrlKey","metaKey","shiftKey","absHref","initializing","newUrl","newState","$digest","currentReplace","$$replace","urlOrStateChanged","debug","debugEnabled","formatError","formatStackTrace","sourceURL","consoleLog","logFn","log","navigator","userAgent","warn","getStringValue","ifDefined","plusFn","r","isStateless","filterName","isPure","parentIsPure","AST","MemberExpression","UnaryExpression","PURITY_ABSOLUTE","BinaryExpression","CallExpression","PURITY_RELATIVE","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","isStatelessFilter","astIsPure","Program","Literal","toWatch","right","LogicalExpression","ConditionalExpression","alternate","consequent","Identifier","callee","AssignmentExpression","ArrayExpression","ObjectExpression","ThisExpression","LocalsExpression","getInputs","lastExpression","isAssignable","assignableAST","NGValueParameter","isLiteral","isConstant","ASTCompiler","ASTInterpreter","Parser","lexer","astCompiler","getValueOf","objectValueOf","identStart","identContinue","literals","true","false","null","addLiteral","literalName","literalValue","setIdentifierFns","identifierStart","identifierContinue","interceptorFn","parsedExpression","oneTime","cacheKey","Lexer","$parseOptions","parser","oneTimeLiteralWatchDelegate","oneTimeWatchDelegate","inputs","inputsWatchDelegate","addInterceptor","expressionInputDirtyCheck","oldValueOfValue","compareObjectIdentity","prettyPrintExpression","lastResult","inputExpressions","oldInputValueOf","newInputValue","oldInputValueOfValues","oldInputValues","changed","oneTimeWatch","oneTimeListener","isAllDefined","allDefined","watchDelegate","useInputs","regularWatch","noUnsafeEval","isIdentifierStart","isIdentifierContinue","errorOnUnhandledRejections","qFactory","nextTick","exceptionHandler","Promise","rejectPromise","notifyPromise","processQueue","pending","processScheduled","markQStateExceptionHandled","queueSize","processChecks","checkQueue","toCheck","isStateExceptionHandled","errorMessage","scheduleProcessQueue","$$reject","$qMinErr","$$resolve","doResolve","doReject","doNotify","handleCallback","resolver","callbackOutput","errback","progressBack","promises","counter","race","$Q","resolveFn","TypeError","onFulfilled","onRejected","catch","finally","pur","q","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","supported","createChildScopeClass","ChildScope","$$watchers","$$nextSibling","$$childHead","$$childTail","$$listeners","$$listenerCount","$$watchersCount","$id","$$ChildScope","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","destroyChildScope","$event","currentScope","cleanUpScope","$$prevSibling","$root","Scope","beginPhase","phase","clearPhase","incrementWatchersCount","decrementListenerCount","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","child","watchExp","watcher","$$digestWatchIndex","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","unwatchFn","$watchCollectionInterceptor","_value","newLength","bothNaN","newItem","oldItem","internalArray","oldLength","changeDetected","internalObject","$watchCollectionAction","initRun","veryOldValue","trackVeryOldValue","changeDetector","watch","watchers","dirty","logIdx","asyncTask","ttl","watchLog","asyncQueuePosition","asyncQueue","traverseScopesLoop","postDigestQueuePosition","postDigestQueue","eventName","$eval","$applyAsyncExpression","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","uri","isImage","normalizedVal","regex","snakeToCamel","UNDERSCORE_LOWERCASE_REGEXP","adjustMatcher","$sceMinErr","escapeForRegexp","adjustMatchers","adjustedMatchers","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","matchUrl","isResourceUrlAllowedByPolicy","allowed","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","trustAs","Constructor","byType","maybeTrusted","trustedValueHolderBase","htmlSanitizer","CSS","URL","JS","sce","isEnabled","parseAs","enumValue","lName","eventSupport","isNw","nw","process","isChromePackagedApp","chrome","app","runtime","hasHistoryPushState","pushState","android","boxee","bodyStyle","transitions","animations","hasEvent","divElm","httpOptions","handleRequestFn","tpl","ignoreRequestError","handleError","$templateRequestMinErr","totalPendingRequests","transformer","testability","findBindings","opt_exactMatch","dataBinding","bindingName","findModels","prefixes","attributeEquals","getLocation","setLocation","whenStable","deferreds","$$timeoutId","urlParsingNode","requestUrl","originUrl","$$CookieReader","safeGetCookie","cookie","safeDecodeURIComponent","lastCookies","lastCookieString","cookieArray","currentCookieString","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","anyPropertyKey","predicateFn","matchAgainstAnyProp","expressionType","getTypeForFilter","createPredicateFn","shouldMatchPrimitives","actual","expected","deepCompare","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","actualVal","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","formatNumber","GROUP_SEP","DECIMAL_SEP","number","numStr","digits","numberOfIntegerDigits","zeros","exponent","ZERO_CHAR","MAX_DIGITS","roundNumber","parsedNumber","minFrac","fractionLen","min","roundAt","digit","k","carry","reduceRight","groupSep","decimalSep","isNaN","isInfinity","isFinite","isZero","abs","formattedText","integerLen","decimals","reduce","lgSize","gSize","negPre","negSuf","posPre","posSuf","padNumber","negWrap","neg","dateGetter","dateStrGetter","shortForm","standAlone","propPrefix","timeZoneGetter","zone","paddedZone","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","getThursdayThisWeek","datetime","getFullYear","getMonth","getDate","weekGetter","firstThurs","thisThurs","round","ampmGetter","getHours","AMPMS","eraGetter","ERAS","longEraGetter","ERANAMES","jsonStringToDate","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","ms","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","DATE_FORMATS","spacing","limit","begin","Infinity","sliceFn","processPredicates","sortPredicates","predicate","descending","objectValue","getPredicateValue","defaultCompare","v1","v2","type1","type2","value1","value2","sortPredicate","reverseOrder","compareFn","getComparisonObject","tieBreaker","predicateValues","predicates","doComparison","compareValues","ngDirective","nullFormRenameControl","control","$name","FormController","$$controls","$error","$$success","$pending","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","nullFormCtrl","$$animate","setupValidity","$$classCache","INVALID_CLASS","VALID_CLASS","addSetValidityMethod","createAndSet","ctrl","unsetAndCleanup","unset","isObjectEmpty","cachedToggleClass","switchValue","toggleValidationCss","validationErrorKey","isValid","$setValidity","PENDING_CLASS","combinedState","stringBasedInputType","$formatters","$isEmpty","textInputType","baseInputType","composing","ev","ngTrim","$viewValue","$$hasNativeValidators","$setViewValue","deferListener","origValue","PARTIAL_VALIDATION_TYPES","PARTIAL_VALIDATION_EVENTS","validity","VALIDITY_STATE_PROPERTY","origBadInput","badInput","origTypeMismatch","typeMismatch","$render","weekParser","isoWeek","existingDate","WEEK_REGEXP","week","hours","seconds","milliseconds","addDays","getSeconds","getMilliseconds","createDateParser","mapping","iso","ISO_DATE_REGEXP","yyyy","MM","dd","HH","mm","ss","sss","part","createDateInputType","parseDate","isValidDate","parseObservedDateValue","badInputChecker","previousDate","$options","getOption","$$parserName","$parsers","parsedDate","ngModelMinErr","ngMin","minVal","$validators","$validate","ngMax","maxVal","nativeValidation","numberFormatterParser","NUMBER_REGEXP","parseNumberAttrVal","isNumberInteger","countDecimals","numString","decimalSymbolIndex","isValidForStep","viewValue","stepBase","isNonIntegerValue","isNonIntegerStepBase","isNonIntegerStep","valueDecimals","stepBaseDecimals","stepDecimals","decimalCount","multiplier","pow","numberInputType","ngStep","stepVal","modelValue","rangeInputType","setInitialValueAndObserver","htmlAttrName","changeFn","minChange","$modelValue","supportsRange","elVal","maxChange","stepChange","hasMinAttr","hasMaxAttr","hasStepAttr","originalRender","rangeUnderflow","rangeOverflow","stepMismatch","urlInputType","URL_REGEXP","emailInputType","email","EMAIL_REGEXP","radioInputType","doTrim","parseConstantExpr","parseFn","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","classDirective","arrayDifference","classString","toClassString","classValue","toFlatValue","flatValue","hasUndefined","indexWatchExpression","addClasses","digestClassCounts","removeClasses","updateClasses","oldClassString","newClassString","oldClassArray","newClassArray","toRemoveArray","toAddArray","toRemoveString","toAddString","classArray","classesToUpdate","classCounts","ngClassIndexWatchAction","newModulo","oldModulo","ngClassOneTimeWatchAction","newClassValue","ngClassWatchAction","isOneTime","watchInterceptor","watchExpression","watchAction","$index","NgModelController","$$rawModelValue","$asyncValidators","$viewChangeListeners","$untouched","$touched","defaultModelOptions","$$parsedNgModel","$$parsedNgModelAssign","$$ngModelGet","$$ngModelSet","$$pendingDebounce","$$parserValid","$$currentValidationRunId","$$attr","$$timeout","$$exceptionHandler","setupModelWatcher","formatters","$$updateEmptyClasses","$$lastCommittedViewValue","$$runValidators","ModelOptions","$$options","setOptionSelectedStatus","optionEl","REGEX_STRING_REGEXP","manualLowercase","charCodeAt","manualUppercase","documentMode","rules","ngCspElement","ngCspAttribute","noInlineStyle","name_","NODE_TYPE_ATTRIBUTE","full","major","minor","dot","codeName","Node","lowercasedName","isBooleanAttr","$dv","multiple","arg1","arg2","nodeCount","addHandler","noEventListener","onFn","replaceNode","wrapNode","newElement","condition","classCondition","nextElementSibling","extraParameters","dummyEvent","eventFnsCopy","handlerArgs","arg3","nanKey","_idx","_transformKey","delete","$animateMinErr","NG_ANIMATE_CLASSNAME","postDigestElements","updateData","handleCSSClassChanges","existing","addRemoveClassesPostDigest","classesAdded","classesRemoved","pin","domOperation","from","runner","classNameFilter","customFilter","$$registeredAnimations","filterFn","reservedRegex","domInsert","afterElement","afterNode","previousElementSibling","enter","move","leave","addclass","setClass","tempClasses","waitForTick","waitQueue","passed","AnimateRunner","setHost","rafTick","timeoutTick","_doneCallbacks","_tick","_state","INITIAL_STATE","DONE_PENDING_STATE","DONE_COMPLETE_STATE","chain","runners","onProgress","getPromise","resolveHandler","rejectHandler","pause","resume","_resolve","initialOptions","applyAnimationContents","closed","$$prepared","cleanupStyles","isFirstChange","domNode","Content-Type","[","{","callbackId","called","callbackMap","PATH_MATCH","http","https","ftp","locationPrototype","paramValue","Location","$parseMinErr","OPERATORS","ESCAPE","f","'","\"","lex","readString","peek","readNumber","peekMultichar","readIdent","isWhitespace","ch2","ch3","op1","op2","op3","throwError","chars","codePointAt","isValidIdentifierStart","isValidIdentifierContinue","cp","cp1","cp2","isExpOperator","colStr","peekCh","quote","rawString","hex","rep","ExpressionStatement","Property","program","expressionStatement","expect","filterChain","assignment","ternary","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","primary","arrayDeclaration","selfReferential","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","$locals","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","getHasOwnProperty","isNull","nonComputedMember","notNull","member","SAFE_IDENTIFIER","UNSAFE_CHARACTERS","stringEscapeFn","stringEscapeRegex","c","skip","rhs","lhs","unary+","unary-","unary!","binary+","binary-","binary*","binary/","binary%","binary===","binary!==","binary==","binary!=","binary<","binary>","binary<=","binary>=","binary&&","binary||","ternary?:","yy","y","MMMM","MMM","M","LLLL","H","hh","EEEE","EEE","Z","ww","G","GG","GGG","GGGG","xlinkHref","defaultLinkFn","normalized","htmlAttr","$addControl","$$renameControl","$removeControl","$setDirty","$setPristine","$setSubmitted","SUBMITTED_CLASS","$rollbackViewValue","$commitViewValue","newName","oldName","PRISTINE_CLASS","DIRTY_CLASS","$setUntouched","formDirectiveFactory","isNgForm","getSetter","formElement","nameAttr","ctrls","handleFormSubmission","parentFormCtrl","DATE_REGEXP","DATETIMELOCAL_REGEXP","MONTH_REGEXP","TIME_REGEXP","inputType","datetime-local","month","range","CONSTANT_VALUE_REGEXP","updateElementValue","propValue","tplAttr","$compile","templateElement","ngBindHtmlGetter","ngBindHtmlWatch","getTrustedHtml","forceAsyncEvents","previousElements","srcExp","onloadExp","autoScrollExp","autoscroll","previousElement","currentElement","changeCounter","cleanupLastIncludeContent","afterAnimation","thisChangeId","trimValues","UNTOUCHED_CLASS","TOUCHED_CLASS","EMPTY_CLASS","NOT_EMPTY_CLASS","$$initGetterSetters","invokeModelGetter","invokeModelSetter","$$$p","$setTouched","prevValid","prevModelValue","allowInvalid","that","allValid","$$writeModelToScope","doneCallback","processParseErrors","errorKey","setValidity","processSyncValidators","syncValidatorsValid","validator","Boolean","processAsyncValidators","validatorPromises","validationDone","localValidationRunId","$$parseAndValidate","writeToModelIfNeeded","$$debounceViewValueCommit","debounceDelay","$overrideModelOptions","createChild","modelCtrl","formCtrl","optionsCtrl","setTouched","DEFAULT_REGEXP","inheritAll","updateOnDefault","updateOn","debounce","getterSetter","NgModelOptionsController","$$attrs","parentOptions","parentCtrl","modelOptionsDefinition","ngOptionsMinErr","NG_OPTIONS_REGEXP","parseOptionsExpression","optionsExp","selectElement","Option","selectValue","label","group","getOptionValuesKeys","optionValues","optionValuesKeys","keyName","itemKey","valueName","selectAs","trackBy","selectAsFn","viewValueFn","trackByFn","getTrackByValueFn","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","ngOptionsPostLink","addOptionElement","optionElement","optionTemplate","updateOptionElement","getAndUpdateSelectedOption","updateOptions","selectCtrl","readValue","groupElementMap","groupElement","optGroupTemplate","listFragment","ngModelCtrl","nextValue","isNotPrimitive","hasEmptyOption","emptyOption","providedEmptyOption","unknownOption","generateUnknownOptionValue","writeValue","selectedOptions","selectedValues","selections","selectedOption","removeUnknownOption","selectUnknownOrEmptyOption","unselectEmptyOption","registerOption","optionScope","needsRerender","$isEmptyOptionSelected","BRACE","IS_WHEN","updateElementText","newText","lastCount","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","attributeName","tmpMatch","whenKey","countIsNaN","pluralCat","whenExpFn","NG_REMOVED","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","getBlockStart","getBlockEnd","ngRepeatEndComment","aliasAs","trackByExp","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","hashFnLocals","lastBlockMap","nextNode","collectionLength","trackById","trackByIdFn","collectionKeys","nextBlockOrder","previousNode","nextBlockMap","blockKey","NG_HIDE_CLASS","NG_HIDE_IN_PROGRESS_CLASS","newStyles","oldStyles","cases","ngSwitchController","watchExpr","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","selectedTransclude","caseElement","selectedScope","anchor","ngSwitchWhenSeparator","whenCase","ngTranscludeMinErr","fallbackLinkFn","ngTranscludeCloneAttachFn","notWhitespace","useFallbackContent","ngTranscludeSlot","noopNgModelController","SelectController","scheduleRender","renderScheduled","scheduleViewValueUpdate","renderAfter","updateScheduled","optionsMap","renderUnknownOption","unknownVal","updateUnknownOption","selectEmptyOption","realVal","hasOption","currentlySelectedOption","hashedVal","addOption","removeOption","$hasEmptyOption","$isUnknownOptionSelected","optionAttrs","interpolateValueFn","interpolateTextFn","removal","previouslySelected","removeValue","selectPreLink","shouldBeSelected","currentlySelected","lastView","lastViewRef","selectPostLink","selectCtrlName","patternExp","intVal","getDecimals","getVF","opt_precision","PLURAL_CATEGORY","ZERO","ONE","TWO","FEW","MANY","OTHER","DAY","FIRSTDAYOFWEEK","MONTH","SHORTDAY","SHORTMONTH","STANDALONEMONTH","WEEKENDRANGE","fullDate","longDate","medium","mediumDate","mediumTime","short","shortDate","shortTime","minInt","localeID","vf","$RouteProvider","pathRegExp","insensitive","caseInsensitiveMatch","originalPath","slash","star","routes","route","routeCopy","reloadOnSearch","redirectPath","redirectTo","otherwise","isEagerInstantiationEnabled","eagerInstantiationEnabled","$routeParams","switchRouteMatcher","prepareRoute","$locationEvent","lastRoute","$route","preparedRoute","parseRoute","preparedRouteIsUpdateOnly","$$route","pathParams","forceReload","commitRoute","nextRoute","nextRoutePromise","getRedirectionData","handlePossibleRedirection","keepProcessingRoute","resolveLocals","hasRedirection","interpolate","oldPath","oldSearch","resolveRedirectTo","getTemplateFor","loadedTemplateUrl","segment","segmentMatch","fakeLocationEvent","updateParams","newParams","$routeMinErr","instantiateRoute","$RouteParamsProvider","ngViewFactory","cleanupLastView","previousLeaveAnimation","update","ngViewFillContentFactory","resolveAs","ngRouteModule","Module","R_ISO8061_STR","createHttpBackendMock","createResponse","prettyPrint","wrapResponse","wrapped","handleResponse","$$respHeaders","handleTimeout","MockXhr","expectation","expectations","wasExpected","matchData","matchHeaders","definitions","responsesPush","passThrough","MockHttpExpectation","respond","flush","digest","verifyNoOutstandingExpectation","verifyNoOutstandingRequest","resetExpectations","u","$$lastInstance","$$method","$$async","$$reqHeaders","$$data","headerName","lines","mock","$Browser","$$lastUrl","pollFns","$$lastState","deferredFns","deferredNextId","fnIndex","$$baseHref","poll","pollFn","logs","assertEmpty","logLevel","logItem","repeatFns","nextRepeatId","nextTime","millis","task","TzDate","timestamp","tsStr","origDate","localOffset","offsetDiff","toLocaleDateString","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","unimplementedMethods","methodName","reflowFn","totalReflows","queueFn","animateJsConstructor","animator","$closeAndFlush","animateCssConstructor","[object Object]","reflows","closeAndFlush","hideErrors","doNextRun","somethingFlushed","dump","out","o","serializeScope","$TimeoutDecorator","formatPendingTasksAsString","tasks","verifyNoPendingTasks","$RAFDecorator","rafFn","$RootElementProvider","$ControllerDecorator","$RootScopeDecorator","e2e","$httpBackendDecorator","countChildScopes","pendingChildHeads","countWatchers","$rootScopePrototype","$countChildScopes","$countWatchers","jasmine","mocha","currentSpec","annotatedFunctions","isSpecRunning","beforeEach","afterEach","$modules","fragments","workFn","moduleFns","ErrorAddingDeclarationLocationStack","errorForStack","sourceId","stackArray","inject","$injectorStrict","blockFns","ngMessageDirectiveFactory","ngMessagesCtrl","records","commentNode","staticExp","ngMessage","dynamicExp","ngMessageExp","assignRecords","reRender","messageCtrl","attach","$$attachId","getAttachId","deregister","isAttrTruthy","truthy","ACTIVE_CLASS","INACTIVE_CLASS","findPreviousMessage","prevNode","parentLookup","prevKey","$$ngMessageNode","messages","previousSibling","insertMessageNode","messageNode","removeMessageNode","latestKey","nextAttachId","renderLater","cachedCollection","render","ngMessagesMultiple","unmatchedMessages","matchedKeys","messageItem","messageFound","totalMessages","messageUsed","ngMessages","nextKey","replaceElementWithMarker","marker","ngMessagesInclude","$SanitizeProvider","buf","htmlParser","htmlSanitizeWriter","sanitizeText","writer","lowercaseKeys","parseStartTag","tagName","rest","blockElements","inlineElements","parseEndTag","optionalEndTagElements","voidElements","ATTR_REGEXP","doubleQuotedValue","singleQuotedValue","unquotedValue","decodeEntities","specialElements","COMMENT_REGEXP","CDATA_REGEXP","DOCTYPE_REGEXP","BEGING_END_TAGE_REGEXP","END_TAG_REGEXP","BEGIN_TAG_REGEXP","START_TAG_REGEXP","$sanitizeMinErr","hiddenPre","encodeEntities","SURROGATE_PAIR_REGEXP","hi","low","NON_ALPHANUMERIC_REGEXP","uriValidator","ignore","validElements","lkey","validAttrs","uriAttrs","optionalEndTagBlockElements","optionalEndTagInlineElements","svgElements","htmlAttrs","svgAttrs","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","addText","addLink","ancestors","objectKeys","ceil","inheritParams","currentParams","$current","$to","parentParams","inherited","inheritList","equalForKeys","filterByKeys","filtered","pick","omit","silenceUncaughtInPromise","$Resolve","VISIT_IN_PROGRESS","VISIT_DONE","NOTHING","NO_DEPENDENCIES","NO_LOCALS","NO_PARENT","$$promises","$$values","study","invocables","visit","visited","cycle","plan","isResolve","invocableKeys","merged","$$inheritedValues","resolution","$$failure","invocable","onfailure","invocation","waitParams","dep","TemplateFactoryProvider","shouldUnsafelyUseHttp","TemplateFactory","fromConfig","fromString","fromUrl","templateProvider","fromProvider","UrlMatcher","parentMatcher","addParameter","paramNames","$$UMFP","Param","quoteRegExp","squash","surroundPattern","matchDetails","isSearch","cfg","caseInsensitive","placeholder","searchPlaceholder","$$new","ParamSet","isOptional","sourceSearch","sourcePath","strict","$$paramNames","$UrlMatcherFactory","valToString","/","valFromString","~~","~2F","getDefaultConfig","isStrictMode","isCaseInsensitive","isInjectable","flushTypeQueue","typeQueue","$types","def","defaultSquashPolicy","enqueue","defaultTypes","encode","decode","int","capture","any","$$getDefaultValue","strictMode","isMatcher","definitionFn","unwrapShorthand","isShorthand","$$fn","getType","urlType","getArrayMode","arrayDefaults","arrayParamNomenclature","getSquashPolicy","getReplace","arrayMode","configuredKeys","defaultPolicy","$value","hasReplaceVal","$replace","replacement","$asArray","dynamic","$$parent","$$keys","paramset","paramValues","$$equals","paramValues1","paramValues2","equal","$$validates","rawVal","encoded","$UrlRouterProvider","$locationProvider","$urlMatcherFactory","regExpPrefix","handleIfMatch","$match","appendBasePath","isHtml5","absolute","rule","handled","lastPushedUrl","listen","interceptDeferred","sync","read","urlMatcher","$$avoidResync","validates","redirect","handlerIsString","strategies","sticky","deferIntercept","$StateProvider","$urlRouterProvider","isRelative","stateName","findState","stateOrName","isStr","rel","pathLength","states","queueState","parentName","flushQueuedChildren","queued","registerState","stateBuilder","$delegates","abstractKey","$stateParams","$state","navigable","transitionTo","isGlob","doesStateMatchGlob","glob","globSegments","$view","$resolve","$urlRouter","handleRedirect","TransitionAborted","retry","$retry","TransitionFailed","retryTransition","transition","toParams","TransitionSuperseded","resolveState","paramsAreFiltered","resolveViews","viewsPromises","views","view","injectables","controllerProvider","injectLocals","$$controller","$$controllerAs","$$resolveAs","TransitionSupersededError","TransitionPrevented","go","fromParams","fromPath","toState","redirectResult","toPath","keep","toLocals","reloadState","ownParams","shouldSkipReload","resolved","entering","exiting","onExit","onEnter","acc","paramDef","lossy","nav","nonSearchParamsEqual","fromAndToState","notSearchParam","nonQueryParamKeys","nonQueryParams","nonQueryParamSet","compositeName","abstract","$ViewProvider","$templateFactory","$ViewScrollProvider","useAnchorScroll","$ViewDirective","$uiViewScroll","getRenderer","statics","cb","$animator","previousEl","currentEl","$uiViewData","renderer","$$animLeave","updateView","firstTime","getUiViewName","previousLocals","latestLocals","animEnter","animLeave","viewAnimData","$animEnter","$animLeave","$ViewDirectiveFill","initial","resolveData","uiView","uiViewCreatedBy","parseStateRef","ref","preparsed","paramExpr","stateContext","stateData","getTypeInfo","isSvg","isForm","isAnchor","clickable","clickHook","ignorePreventDefaultCount","defaultOpts","$StateRefDirective","uiSrefActive","uiSref","unlinkInfoFn","uiSrefOpts","$$addStateInfo","$StateRefDynamicDirective","runStateRefLink","uiState","uiStateParams","uiStateOpts","$StateRefActiveDirective","addState","stateParams","activeClass","stateHash","createStateHash","stateInfo","activeClasses","anyMatch","exactMatch","activeEqClass","uiSrefActiveEq","$IsStateFilter","isFilter","$IncludedByStateFilter","includesFilter","searchParams","decodePathArray","reverseString","unquoteDashes","allReversed","paramName","parameters","nTotal","nPath","paramVal","encodeDashes","isPathParam","isDefaultValue","nextSegment","isFinalPathParam","$subPattern","sub","ArrayType","bindTo","arrayWrap","arrayUnwrap","falsey","arrayHandler","allTruthyMode","arrayEqualsHandler","val1","val2","$arrayMode","autoinject","packageStyles","pendClasses","isPrefix","removeFromArray","stripCommentsFromElement","$$addClass","$$removeClass","applyAnimationClassesFactory","prepareAnimationOptions","$$domOperationFired","applyAnimationStyles","applyAnimationFromStyles","applyAnimationToStyles","mergeAnimationDetails","oldAnimation","newAnimation","newOptions","resolveElementClasses","preparationClasses","concatWithSpace","realDomOperation","splitClassesToLookup","ADD_CLASS","REMOVE_CLASS","flags","allow","REMOVE_CLASS_SUFFIX","ADD_CLASS_SUFFIX","getDomNode","applyGeneratedPreparationClasses","EVENT_CLASS_PREFIX","clearGeneratedClasses","blockKeyframeAnimations","applyBlock","ANIMATION_PROP","ANIMATION_PLAYSTATE_KEY","applyInlineStyle","styleTuple","getCssKeyframeDurationStyle","ANIMATION_DURATION_PROP","getCssDelayStyle","isKeyframeAnimation","ANIMATION_DELAY_PROP","TRANSITION_DELAY_PROP","computeCssStyles","detectedStyles","formalStyleName","actualStyleName","parseMaxTime","maxValue","truthyTimingValue","getCssTransitionDurationStyle","applyOnlyDuration","TRANSITION_PROP","DURATION_KEY","registerRestorableStyles","backup","TRANSITIONEND_EVENT","ANIMATIONEND_EVENT","ACTIVE_CLASS_SUFFIX","PREPARE_CLASS_SUFFIX","NG_ANIMATE_CHILDREN_DATA","CSS_PREFIX","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","PROPERTY_KEY","DELAY_KEY","TIMING_KEY","ANIMATION_ITERATION_COUNT_KEY","SAFE_FAST_FORWARD_DURATION_VALUE","TRANSITION_DURATION_PROP","helpers","blockTransitions","$$rAFSchedulerFactory","scheduler","cancelFn","waitUntilQuiet","$$AnimateChildrenDirective","setData","ngAnimateChildren","ANIMATE_TIMER_KEY","ONE_SECOND","ELAPSED_TIME_MAX_DECIMAL_PLACES","CLOSING_TIME_BUFFER","DETECT_CSS_PROPERTIES","transitionDuration","transitionDelay","transitionProperty","animationDuration","animationDelay","animationIterationCount","DETECT_STAGGER_CSS_PROPERTIES","$AnimateCssProvider","$animateProvider","$$animateCache","$$rAFScheduler","computeCachedCssStyles","allowNoDuration","timings","hasDuration","computeCachedCssStaggerStyles","stagger","staggerCacheKey","staggerClassName","rafWaitQueue","pageWidth","computeTimings","aD","tD","maxDelay","maxDuration","applyAnimationClasses","endFn","rejected","animationClosed","animationCompleted","animationPaused","$$skipPreparationClasses","temporaryStyles","restoreStyles","setProperty","removeProperty","onDone","onAnimationProgress","animationTimerData","applyBlocking","blockTransition","blockKeyframeAnimation","closeAndReturnNoopAnimator","$$willAnimate","$manualTimeStamp","elapsedTime","toFixed","maxDelayTime","triggerAnimationStart","recalculateTimingStyles","fullClassName","relativeDelay","hasTransitions","hasAnimations","applyAnimationDelay","delayStyle","maxDurationTime","easeProp","easeVal","timerTime","endTime","animationsData","setupFallbackTimer","currentTimerData","expectedEndTime","onAnimationExpired","playPause","playAnimation","maxStagger","itemIndex","runnerHost","isStructural","structural","structuralClassName","addRemoveClassName","applyClassesEarly","hasToStyles","containsKeyframeAnimation","keyframeStyle","containsCachedAnimationWithoutDuration","staggerVal","transitionStyle","durationStyle","staggerIndex","isFirst","skipBlocking","hasTransitionAll","applyTransitionDuration","applyAnimationDuration","applyTransitionDelay","$$AnimateCssDriverProvider","$$animationProvider","isDocumentFragment","drivers","NG_ANIMATE_SHIM_CLASS_NAME","NG_ANIMATE_ANCHOR_CLASS_NAME","NG_OUT_ANCHOR_CLASS_NAME","NG_IN_ANCHOR_CLASS_NAME","filterCssClasses","getUniqueValues","prepareAnchoredAnimation","outAnchor","inAnchor","calculateAnchorStyles","coords","bodyNode","prepareOutAnimation","getClassVal","prepareInAnimation","endingClasses","startingClasses","rootBodyElement","animatorIn","animatorOut","startingAnimator","currentAnimation","prepareFromToAnchorAnimation","anchors","fromAnimation","prepareRegularAnimation","toAnimation","anchorAnimations","outElement","inElement","animationRunners","animationDetails","rootNode","$$AnimateJsProvider","lookupAnimations","flagMap","animationFactory","applyOptions","executeAnimationFn","classesToAdd","classesToRemove","groupEventedAnimations","fnName","operations","ani","endProgressCb","onAnimationComplete","cancelled","packageAnimations","animateFn","afterFn","beforeFn","onComplete","endAnimations","closeActiveAnimations","$$AnimateJsDriverProvider","prepareAnimation","endFnFactory","NG_ANIMATE_ATTR_NAME","NG_ANIMATE_PIN_DATA","$$AnimateQueueProvider","getEventData","makeTruthyCssClassMap","ONE_SPACE","hasMatchingClasses","currentClassString","currentClassMap","isAllowed","ruleType","previousAnimation","hasAnimationClasses","and","PRE_DIGEST_STATE","RUNNING_STATE","nA","nR","cA","cR","$$animation","removeFromDisabledElementsLookup","disabledElementsLookup","postDigestTaskFactory","postDigestCalled","normalizeAnimationDetails","findCallbacks","targetParentNode","targetNode","entries","callbackRegistry","filterFromRegistry","matchContainer","matchCallback","containerNode","isMatch","cleanupEventListeners","queueAnimation","originalElement","notifyProgress","runInNextPostDigestOrNow","animationsEnabled","isAnimatableByFilter","isAnimatableClassName","documentHidden","skipAnimations","existingAnimation","activeAnimationsLookup","hasExistingAnimation","areAnimationsAllowed","closeChildAnimations","skipAnimationFlag","cancelAnimationFlag","joinAnimationFlag","isValidAnimation","clearElementAnimationState","markElementAnimationState","animationCancelled","realRunner","animateChildren","bodyNodeDetected","rootNodeDetected","parentAnimationDetected","elementDisabled","parentHost","details","parentNodeDisabled","allowAnimation","deregisterWatch","isEmpty","eventType","argCount","hasElement","$$AnimateCacheProvider","KEY","parentCounter","parentID","total","$$AnimationProvider","setRunner","RUNNER_STORAGE_KEY","removeRunner","getRunner","NG_ANIMATE_REF_ATTR","PREPARE_CLASSES_KEY","sortAnimations","processNode","processed","elementNode","lookup","parentEntry","tree","flatten","remainingLevelEntries","nextLevelEntries","row","childEntry","animationQueue","getAnchorNodes","SELECTOR","groupAnimations","preparedAnimations","refLookup","enterOrMove","anchorNodes","direction","animationID","usedIndicesLookup","anchorGroups","indexKey","lookupKey","beforeStart","cssClassesIntersection","in","aa","invokeFirstDriver","driverName","driver","prepareClassName","updateAnimationRunners","newRunner","handleDestroyedElement","groupedAnimations","toBeSortedAnimations","animationEntry","extraClasses","startAnimationFn","closeFn","targetElement","operation","animationRunner","finalAnimations","innerArray","ngAnimateSwapDirective","previousScope","ngAnimateSwap","$AriaProvider","ariaAttr","nativeAriaNodeNames","negate","ARIA_DISABLE_ATTR","ariaCamelName","isNodeOneOf","boolVal","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","newConfig","$$watchExpr","ngAriaModule","nodeTypeArray","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","getShape","shape","ngAriaWatchModelValue","getRadioReaction","getCheckboxReaction","needsTabIndex","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","ngClick","ngKeydown","ngKeypress","ngKeyup","isContentEditable","DetectNgTouch","MdCoreConfigure","$mdThemingProvider","rAFDecorator","theme","primaryPalette","accentPalette","warnPalette","backgroundPalette","throttle","queuedArgs","alreadyQueued","queueCb","MdAutofocusDirective","postLink","mdAutoFocus","mdAutofocus","mdSidenavFocus","canAutofocus","MdConstantFactory","vendorProperty","webkit","vendorPrefix","KEY_CODE","COMMA","SEMICOLON","ENTER","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT_ARROW","UP_ARROW","RIGHT_ARROW","DOWN_ARROW","TAB","BACKSPACE","DELETE","TRANSITIONEND","ANIMATIONEND","TRANSFORM","TRANSFORM_ORIGIN","TRANSITION","TRANSITION_DURATION","ANIMATION_PLAY_STATE","ANIMATION_DURATION","ANIMATION_NAME","ANIMATION_TIMING","ANIMATION_DIRECTION","MEDIA","xs","gt-xs","sm","gt-sm","md","gt-md","lg","gt-lg","xl","print","MEDIA_PRIORITY","MdIterator","reloop","getItems","_items","inRange","hasNext","hasPrevious","itemAt","findBy","findSubsequentItem","backwards","validate","trueFn","curIndex","nextIndex","foundItem","mdMediaFactory","$mdConstant","$mdMedia","query","validated","queries","mqls","matchMedia","addListener","onQueryChange","media","getQuery","getResponsiveAttribute","mediaName","normalizedName","getNormalizedName","watchResponsiveAttributes","watchFn","unwatchFns","normalizeCache","UtilFactory","$$mdAnimate","getNode","usesStandardSymbols","hasComputedStyle","hasValue","computedStyles","$mdUtil","dom","performance","clientRect","isOffsetRect","nodeRect","offsetRect","nodesToArray","findFocusTarget","containerEl","attributeVal","scanForFocusable","elFound","it","isFocusable","elToFocus","AUTO_FOCUS","disableScrollAround","disableElementScroll","scrollMask","_enableScrolling","disableBodyScroll","htmlNode","restoreHtmlStyle","restoreBodyStyle","scrollOffset","clientWidth","scrollHeight","clientHeight","applyStyles","_count","restoreBody","restoreElement","enableScrolling","floatingScrollbars","tempNode","z-index","overflow-y","forceFocus","focusOnClick","$focus","newEvent","createEvent","initMouseEvent","$material","dispatchEvent","createBackdrop","supplant","fakeNgModel","$fake","recent","valueOnUse","nextUniqueId","disconnectScope","$$disconnected","reconnectScope","getClosest","onlyParent","elementContains","hasContains","findFn","extractElementByName","scanDeep","warnNotFound","scanTree","scanLevel","scanChildren","found","numChild","outerHTML","initOptionalProperties","attrIsDefined","processTemplate","getParentWithPointerEvents","getNearestContentElement","parseAttributeBoolean","negatedCheck","mdCompilerService","transformTemplate","compiledData","invokeCtrl","AriaService","childHasAttribute","expectAsync","defaultValueGetter","expectWithText","hasBinding","currentStyle","hasChildren","hasChildNodes","hasAttr","MdGestureProvider","MdGesture","$$MdGestureHandler","checkDistanceAndEmit","pointer","distance","maxDistance","handlerName","HANDLERS","registerElement","vendor","opera","isIos","isAndroid","hasJQuery","isHijackingClicks","forceSkipClickHijack","maxClickDistance","onEnd","canFocus","focusableElements","onStart","onCancel","registeredParent","x","onMove","dx","dy","sqrt","minDistance","horizontal","cancelMultiplier","shouldStartDrag","shouldCancel","dragPointer","dispatchDragMove","distanceX","distanceY","makeStartPointer","updatePointerState","isRunning","minVelocity","velocityX","directionX","velocityY","directionY","GestureHandler","MdGestureHandler","jQueryDispatchEvent","srcEvent","eventPointer","eventObj","screenX","screenY","altKey","nativeDispatchEvent","detail","initCustomEvent","parentTarget","getNearestParent","parentTargetOptions","$mdGesture","onDestroy","attachToDocument","mouseInputHijacker","isKeyClick","isIonicTap","isInputEventFromLabelClick","clickHijacker","lastLabelClickPos","runHandlers","handlerEvent","gestureStart","lastPointer","typesMatch","gestureMove","gestureEnd","isInitialized","START_EVENTS","MOVE_EVENTS","END_EVENTS","point","getEventPoint","startPointer","startX","startY","touches","changedTouches","skipClickHijack","InterimElementProvider","createInterimElementProvider","interimFactoryName","setDefaults","providerConfig","optionsFactory","methods","EXPOSED_METHODS","addMethod","customMethods","addPreset","presets","argOption","$$interimElement","showInterimElement","_options","interimElementService","defaultOptions","destroyInterimElement","invokeFactory","defaultVal","publicService","defaultMethods","Preset","presetDefaults","presetMethods","$type","InterimElementFactory","$mdCompiler","$mdTheming","interimElement","InterimElement","hideExisting","skipHide","closeElement","interim","closeAll","closeTo","cntr","currNode","SHOW_CANCELLED","createAndTransitionIn","rejectAll","fault","compileElement","linkElement","showAction","showElement","transitionOutAndRemove","isCancelled","resolveAll","cancelAutoHide","hideElement","configureScopeAndTransitions","preserveScope","onShow","onRemove","skipCompile","compileData","findParent","themable","startAutoHide","autoHideTimer","hideDelay","notifyShowing","onShowing","notifyComplete","announceRemoving","onRemoving","$injector_","registerLayoutAPI","BREAKPOINTS","API_WITH_VALUES","API_NO_VALUES","mqb","fullName","attributeWithObserve","attributeWithoutValue","disableLayoutDirective","buildCloakInterceptor","warnAttrNotSupported","translateWithValueToCssClass","updateFn","updateClassWithValue","getNormalizedAttrValue","_$mdUtil_","_$interpolate_","_$log_","validateAttributeUsage","validateAttributeValue","buildUpdateFn","translateToCssClass","lastClass","WHITESPACE","usage","SUFFIXES","needsInterpolation","findIn","LAYOUT_OPTIONS","FLEX_OPTIONS","axis","extractAlignAxis","attrValue","main","cross","ALIGNMENT_MAIN_AXIS","ALIGNMENT_CROSS_AXIS","breakpoints","ComponentRegistry","isValidID","instances","pendings","notFoundError","getInstances","$$mdHandle","resolveWhen","dfd","MdButtonInkRipple","$mdInkRipple","optionsForElement","isMenuItem","fitRipple","center","dimBackground","MdCheckboxInkRipple","MdListInkRipple","outline","rippleSize","InkRippleDirective","$mdButtonInkRipple","$mdCheckboxInkRipple","InkRippleService","InkRippleCtrl","rippleOptions","mousedown","ripples","lastRipple","createContainer","createRipple","setColor","color","bindEvents","autoCleanup","cleanupFn","attrNoDirective","DURATION","getElementColor","colorElement","_color","_parseColor","inkRipple","calculateColor","hexToRGBA","dig","red","green","blue","rgbToRGBA","handleMousedown","handleMouseup","handleTouchmove","srcElement","layerRect","layerX","layerY","offsetX","offsetY","clearRipples","deleteRipples","fadeInComplete","isRippleAllowed","rgbaToRGB","getSize","fit","ripple","background","backgroundColor","borderColor","removeRipple","fadeOutComplete","MdTabInkRipple","50","100","200","300","400","500","600","700","800","900","A100","A200","A400","A700","contrastDefaultColor","contrastDarkColors","contrastStrongLightColors","pink","purple","deep-purple","indigo","light-blue","contrastLightColors","cyan","teal","light-green","lime","yellow","amber","orange","deep-orange","brown","grey","1000","blue-grey","ThemingProvider","$mdColorPalette","definePalette","PALETTES","checkPaletteValid","themingProvider","extendPalette","missingColors","VALID_HUE_VALUES","field","registerTheme","inheritFrom","THEMES","parentTheme","Theme","colors","colorType","hues","setDark","isDark","foregroundPalette","LIGHT_FOREGROUND","DARK_FOREGROUND","foregroundShadow","DARK_SHADOW","LIGHT_SHADOW","newDefaultHues","DARK_DEFAULT_HUES","LIGHT_DEFAULT_HUES","oldDefaultHues","newDefaults","oldDefaults","hueName","dark","THEME_COLOR_TYPES","defaultHues","paletteName","hueValue","ThemingService","registered","themeName","applyTheme","inheritTheme","lookupThemeName","$mdTheme","defaultTheme","updateThemeClass","oldTheme","attrThemeValue","watchTheme","alwaysWatchTheme","generateTheme","setNonce","nonceValue","setDefaultTheme","alwaysWatch","generateThemesOnDemand","onDemand","generateOnDemand","_LIGHT_DEFAULT_HUES","_DARK_DEFAULT_HUES","_PALETTES","_THEMES","_parseRules","parseRules","_rgba","rgba","ThemingDirective","$setTheme","mdTheme","ThemableDirective","checkValidPalette","generatedRules","themeNameRegex","hueRegex","simpleVariableRegex","palette","hue","contrast","newRule","hueType","themeRuleRegex","generateAllThemes","sanitizePalette","defaultContrast","lightColors","strongLightColors","darkColors","getContrastColor","DARK_CONTRAST_COLOR","STRONG_LIGHT_CONTRAST_COLOR","LIGHT_CONTRAST_COLOR","rgbValue","colorToRgbaArray","themeCss","ruleMatchRegex","rulesByType","DEFAULT_COLOR_TYPE","GENERATED","styleStrings","styleContent","accent","clr","grn","blu","rgbArray","1","2","3","4","default","hue-1","hue-2","hue-3","defaultDefaultHues","AnimateDomUtils","translate3d","reverseTranslate","newFrom","transitionOutClass","transitionInClass","waitTransitionEnd","TIMEOUT","finished","calculateTransformValues","originator","currentBounds","bounds","originBnds","copyRect","dialogRect","dialogCenterPt","centerPointFor","originCenterPt","centerX","centerY","scaleX","scaleY","calculateZoomToOrigin","zoomTemplate","buildZoom","calculateSlideToOrigin","slideTemplate","buildSlide","toCss","convertToVendor","lookups","toTransformCss","transform","addTransition","isPositiveSizeClientRect","rect","targetRect","WEBKIT","WebkitAppearance","PREFIX","TRANSITION_EVENTS","ANIMATION_EVENTS","$$ForceReflowFactory","$$rAFMutexFactory","$$AnimateRunnerFactory","$$rAFMutex","_runInAnimationFrame","hasCompleteStyles","hasCompleteClasses","hasCompleteAnimation","eventFn","applyClasses","moreStyles","cs","tdr","adr","tdy","ady","cancelLastRAFRequest","hViewport","ERROR_CSS_POSITION","MdBottomSheetDirective","$mdBottomSheet","MdBottomSheetProvider","$$interimElementProvider","bottomSheetDefaults","disableBackdrop","backdrop","clickOutsideToClose","bottomSheet","BottomSheet","disableParentScroll","restoreScroll","focusable","escapeToClose","rootElementKeyupCallback","cleanup","onDragStart","onDrag","PADDING","onDragEnd","CLOSING_VELOCITY","distanceRemaining","MdButtonDirective","$mdAria","ngHref","ngLink","getTemplate","btnType","ngDisabled","isDisabled","mouseActive","mdCardDirective","MdCheckboxDirective","mdIndeterminateStateEnabled","valueOpts","keypressHandler","ngChecked","isIndeterminate","CHECKED_CSS","setIndeterminateState","mdIndeterminate","mdContentDirective","ContentController","iosScrollFix","$materialScrollFixed","calendarDirective","TBODY_SINGLE_ROW_HEIGHT","TBODY_HEIGHT","minDate","maxDate","CalendarCtrl","mdCalendarCtrl","configureNgModel","$$mdDateUtil","$mdDateLocale","numMonths","getMonthDistance","dateUtil","dateLocale","calendarElement","calendarScroller","today","createDateAtMidnight","firstRenderableDate","incrementMonths","selectedDate","displayDate","focusDate","isMonthTransitionInProgress","cellClickHandler","cellElement","setNgModelValue","attachCalendarEventListeners","SELECTED_DATE_CLASS","FOCUSED_DATE_CLASS","changeSelectedDate","buildInitialCalendarDisplay","buildWeekHeader","hideVerticalScrollbar","scroller","headerWidth","scrollbarWidth","paddingRight","handleKeyEvent","getFocusDateFromKeyEvent","boundDateByMinAndMax","changeDisplayDate","incrementDays","getFirstDateOfMonth","getLastDateOfMonth","getSelectedMonthIndex","scrollToMonth","monthDistance","opt_date","previousFocus","classList","cellId","getDateId","cell","boundDate","previousSelectedDate","prevDateCell","dateCell","animationPromise","animateDateChange","firstDayOfWeek","shortDays","mdCalendarMonthDirective","CalendarMonthCtrl","calendarCtrl","monthCtrl","generateContent","oldOffset","focusAfterAppend","TODAY_CLASS","buildCalendarForMonth","buildDateCell","longDateFormatter","isSameDay","cellText","dates","isDateEnabled","selectionIndicator","isDateWithinRange","buildDateRow","rowNumber","weekNumberFormatter","opt_dateInMonth","firstDayOfMonth","firstDayOfTheWeek","getLocaleDay_","numberOfDaysInMonth","getNumberOfDaysInMonth","monthBody","isFinalMonth","blankCellOffset","monthLabelCell","monthHeaderFormatter","monthLabelRow","dayOfWeek","iterationDate","setDate","whitespaceRow","DateLocaleProvider","months","shortMonths","days","formatDate","msgCalendar","msgOpenCalendar","defaultFormatDate","localeTime","toLocaleTimeString","defaultParseDate","dateString","defaultIsDateComplete","defaultMonthHeaderFormatter","defaultWeekNumberFormatter","defaultLongDateFormatter","defaultShortDays","day","defaultDates","defaultMsgCalendar","defaultMsgOpenCalendar","isDateComplete","datePickerDirective","DatePickerCtrl","mdDatePickerCtrl","mdInputContainer","inputElement","ngInputElement","inputContainer","calendarPane","calendarButton","inputMask","isFocused","setDisabled","isCalendarOpen","calendarPaneOpenedFrom","bodyClickHandler","handleBodyClick","windowResizeHandler","closeCalendarPane","installPropertyInterceptors","attachChangeListeners","attachInteractionListeners","detachCalendarPane","EXTRA_INPUT_SIZE","DEFAULT_DEBOUNCE_INTERVAL","CALENDAR_PANE_HEIGHT","CALENDAR_PANE_WIDTH","resizeInputElement","updateErrorState","handleInputEvent","keyCodes","openCalendarPane","clearErrorState","inputString","setDateTimeToMidnight","isValidInput","attachCalendarPane","elementRect","bodyRect","paneTop","paneLeft","viewportTop","viewportLeft","viewportBottom","innerHeight","viewportRight","innerWidth","focusCalendar","getCalendarCtrl","setFocused","isInCalendar","getDateInNextMonth","getDateInPreviousMonth","isSameMonthAndYear","d1","d2","isInNextMonth","startDate","endDate","nextMonth","isInPreviousMonth","previousMonth","getDateMidpoint","getWeekOfMonth","numberOfDays","numberOfMonths","dateInTargetMonth","opt_value","dateAtMidnight","minDateAtMidnight","maxDateAtMidnight","MdDialogDirective","$mdDialog","addOverflowClass","images","MdDialogProvider","advancedDialogOptions","keypress","dialogDefaultOptions","beforeShow","mdHtmlContent","htmlContent","mdTextContent","warnDeprecatedActions","badActions","focusOnOpen","findCloseButton","closeButton","actionButtons","captureParentAndFromToElements","configureAria","showBackdrop","dialogPopIn","activateListeners","lockScreenReader","animateRemoval","dialogPopOut","detachAndClean","deactivateListeners","unlockScreenReader","hideBackdrop","topFocusTrap","bottomFocusTrap","hasFn","getDomElement","defaultElement","simpleSelector","openFrom","targetEvent","onWindowResize","stretchDialogContainerToViewport","removeListeners","smartClose","keyHandlerFn","sourceElem","mousedownHandler","mouseupHandler","removeFn","hasBackdrop","dialogContent","existingDialogId","dialogContentId","ariaLabel","words","focusHandler","walkDOM","isFixed","dialogEl","buildTranslateToOrigin","translateOptions","fullscreen","animateReversal","reverseAnimate","autoWrap","validatedTemplate","MdDividerDirective","MdFabActionsDirective","hasNgRepeat","FabController","setupDefaults","vm","isOpen","resetActionIndex","setupListeners","eventTypes","parseEvents","disableKeyboard","handleItemClick","closeTimeout","currentActionIndex","setupWatchers","newDir","oldDir","actions","getTriggerElement","getActionsElement","enableKeyboard","fireInitialAnimations","initialAnimationAttempts","keyPressed","checkForOutsideClick","closestTrigger","closestActions","doKeyLeft","doKeyUp","doKeyRight","doKeyDown","doActionPrev","focusAction","doActionNext","resetActionTabIndexes","focusElement","isAction","MdFabSpeedDialDirective","FabSpeedDialLink","MdFabSpeedDialFlingAnimation","delayDone","cssAnimationDuration","runAnimation","triggerElement","variablesElement","startZIndex","webkitTransform","newPosition","triggerItemHeightOffset","triggerItemWidthOffset","scrollWidth","newTranslate","MdFabSpeedDialScaleAnimation","offsetDelay","MdFabToolbarDirective","MdFabToolbarAnimation","backgroundElement","toolbarElement","iconElement","borderRadius","pointerEvents","MdFabTriggerDirective","GridListDirective","$mdGridLayout","watchMedia","invalidateLayout","layoutIfMediaMatch","unwatchMedia","layoutDelegate","unwatchAttrs","removeListener","tilesInvalidated","tiles","getTileElements","tileSpans","getTileSpans","colCount","getColumnCount","rowMode","getRowMode","rowHeight","getRowHeight","gutter","getGutter","lastLayoutProps","tilePositions","rowCount","grid","getGridStyle","ps","getTileStyle","spans","reflow","mdOnLayout","exprStr","hShare","hGutterShare","hUnit","UNIT","share","gutterShare","POSITION","DIMENSION","span","paddingTop","marginTop","vShare","vUnit","vGutterShare","paddingBottom","ele","$$mdDestroyed","tileElements","applyDefaultUnit","whRatio","GridListController","layoutInvalidated","$timeout_","GridLayoutFactory","GridLayout","layoutInfo","gridStyles","layoutTime","mapTime","reflowTime","calculateGridFor","positioning","animatorFn","defaultAnimator","tileCount","totalTime","GridTileAnimator","reserveSpace","curCol","nextRow","spaceTracker","findEnd","adjustRow","curRow","cols","by","newSpaceTracker","tracker","animateWith","customAnimator","GridTileDirective","gridCtrl","invalidateTiles","newIdx","oldIdx","GridTileCaptionDirective","layout","mdInputContainerDirective","ContainerCtrl","isErrorGetter","mdIsError","delegateClick","setHasValue","setHasPlaceholder","hasPlaceholder","setInvalid","isInvalid","hasLabelAndInput","labelDirective","containerCtrl","mdNoFloat","inputTextareaDirective","ngModelPipelineCheckValue","inputCheckValue","setupTextarea","pipelineListener","onChangeTextarea","growTextarea","min_rows","getHeight","minHeight","rows","onScroll","handleHiddenChange","wasHidden","hasNgModel","isReadonly","readonly","errorsSpacer","isParentFormSubmitted","mdMaxlengthDirective","renderCharCount","charCountEl","mdMaxlength","placeholderDirective","hasNoFloat","placeholderText","mdSelectOnFocusDirective","onFocus","ngMessagesDirective","mdAutoHide","hasVisibiltyDirective","visibilityDirectives","ngMessageDirective","mdInputInvalidMessagesAnimation","getMessagesElement","showInputMessages","ngMessagesAnimation","hideInputMessages","ngMessageAnimation","showMessage","hideMessage","animators","margin-top","getInputElement","mdListDirective","tEl","mdListItemDirective","proxiedTypes","setupToggleAria","toggleType","toggleTypes","wrapIn","copyAttributes","wrapSecondary","secondaryItem","isButton","buttonWrapper","isProxiedElement","copiedAttrs","hasClickEvent","computeProxies","proxies","computeClickable","hasClick","attachRipple","proxyOnBlur","firstChildKeypressListener","parentButton","hasProxiedElement","proxyElement","ngAttrUiSref","MdListController","$mdListInkRipple","MdPanelService","_defaultConfigOptions","_wrapTemplate","trapFocus","defaultZIndex","_config","_$rootElement","_$rootScope","_$injector","_$window","MdPanelAnimation","xPosition","MdPanelPosition","yPosition","MdPanelRef","_$q","_$mdCompiler","_$mdConstant","_$mdUtil","_$animate","_$mdPanel","_$log","_$$rAF","isAttached","_panelContainer","_panelEl","_removeListeners","_topFocusTrap","_bottomFocusTrap","_backdropRef","_restoreScroll","_absolute","_relativeToEl","_top","_bottom","_left","_right","_translateX","_translateY","_positions","_actualPosition","_openFrom","_closeTo","_animationClass","getElement","queryResult","MD_PANEL_HIDDEN","FOCUS_TRAP_TEMPLATE","opt_config","configSettings","attachTo","instanceId","instanceConfig","panelRef","newPanelPosition","newPanelAnimation","origTemplate","_done","_simpleBind","onDomAdded","addListeners","_addEventListeners","_createBackdrop","_createPanel","onDomRemoved","detachFn","_removeEventListeners","animatePromise","_animateOpen","onOpenComplete","_focusOnOpen","focusOnOrigin","hidePanel","_animateClose","newClass","oldClass","mdPanelRef","_configureTrapFocus","_addStyles","hideAndResolve","positionConfig","_updatePosition","opt_init","_setPanelPosition","getTop","getBottom","getLeft","getRight","prefixedTransform","getTransform","backdropAnimation","withAnimation","backdropConfig","panelClass","_configureEscapeToClose","_configureClickOutsideToClose","_configureScrollListener","updatePosition","debouncedUpdatePosition","animationConfig","warnAndOpen","animateOpen","warnAndClose","animateClose","CENTER","ALIGN_START","ALIGN_END","OFFSET_START","OFFSET_END","ALIGN_TOPS","ALIGN_BOTTOMS","ABOVE","BELOW","opt_top","opt_bottom","opt_left","opt_right","centerHorizontally","centerVertically","relativeTo","addPanelPosition","_validateXPosition","_validateYPosition","positionKeys","positionValues","withOffsetX","withOffsetY","translateX","_reduceTranslateValues","translateY","_isOnscreen","panelEl","getActualPosition","translateFn","translation","_calculatePanelPosition","panelBounds","panelWidth","panelHeight","targetBounds","targetLeft","targetRight","targetWidth","targetTop","targetBottom","targetHeight","SLIDE","SCALE","FADE","_getPanelAnimationTarget","_getBoundingClientRect","_fixBounds","animationOptions","panelTransform","openTo","openSlide","openScale","reverseAnimationOptions","closeFrom","closeSlide","closeScale","MdProgressCircularDirective","watchAttributes","percentValue","clamp","MODE_DETERMINATE","animateIndicator","MODE_INDETERMINATE","spinnerWrapper","lastMode","updateScale","circle","getDiameterRatio","toVendorCSS","validateMode","mdMode","leftC","rightC","gap","gapStyles","removeEmptyValues","borderBottomColor","leftStyles","rightStyles","mdDiameter","DEFAULT_SCALING","DEFAULT_PROGRESS_SIZE","MdProgressLinearDirective","MODE_QUERY","bar2","bar1","MODE_BUFFER","mdRadioGroupDirective","linkRadioGroup","setFocus","keydownListener","rgCtrl","selectPrevious","selectNext","RadioGroupController","_radioButtonRenderFns","createRadioGroupControllerProto","_ngModelCtrl","rbRender","setViewValue","getViewValue","changeSelectedButton","setActiveDescendant","radioId","increment","buttons","mdRadioButtonDirective","initialize","markParentAsChecked","lastChecked","buildAriaID","ariaId","aria-checked","SelectDirective","$mdSelect","valueEl","mdOnOpen","autofillClone","ng-model","aria-hidden","newEl","selectTemplate","initAriaLabel","labelText","ariaLabelBase","syncLabelText","selectContainer","selectMenuCtrl","mdSelectCtrl","setLabelText","selectedLabels","syncAriaLabel","ariaLabels","findSelectContainer","selectScope","mdContainerClass","handleKeypress","allowedCodes","openSelect","optNodeForKeyboardSearch","optionCtrl","isMultiple","deselect","refreshViewValue","preserveElement","loadingAsync","untouched","selectEl","hasModelValue","setIsPlaceholder","mdSelectedText","tmpPlaceholder","isPlaceholder","triggerClose","mdOnClose","deregisterWatcher","prevVal","setMultiple","aria-disabled","ariaAttrs","aria-expanded","aria-multiselectable","ngMultiple","containerId","SelectMenuDirective","preLink","keyListener","clickListener","optionHashKey","hashGetter","isSelected","SelectMenuController","renderMultiple","newSelectedValues","oldSelected","newSelectedHashes","deselected","renderSingular","deregisterCollectionWatch","defaultIsEmpty","validateArray","modelBinding","clearSearchTimeout","optNodes","optText","searchStr","CLEAR_SEARCH_AFTER","trackByLocals","trackByParsed","valueScope","$$mdSelectId","selectNextId","selectedOptionEls","mapFn","rippleContainer","hashedValue","setSelected","usingTrackBy","OptionDirective","setOptionValue","prevAttempt","oldHashKey","newHashKey","aria-selected","CHECKBOX_SELECTION_INDICATOR","OptionController","OptgroupDirective","hasSelectHeader","setupLabelElement","labelElement","SelectHeaderDirective","SelectProvider","selectDefaultOptions","cleanElement","announceClosed","restoreFocus","cleanupInteraction","cleanupResizing","showDropDown","positionAndFocusMenu","isRemoved","calculateMenuPositions","dropDown","autoFocus","focusedNode","sanitizeAndConfigure","ERRROR_TARGET_EXPECTED","contentEl","optionNodes","activateResizing","debouncedOnResize","updates","watchAsyncLoad","$$loadingAsyncDone","progressMode","activateInteraction","onBackdropClick","onMenuKeyDown","focusPrevOption","focusNextOption","checkCloseMenu","optNode","focusOption","newOption","optionsArray","mouseOnScrollbar","clickOnScrollbar","hasScrollbar","relPosX","alreadyOpen","mdSelect","menuController","centeredNode","selectNode","contentNode","parentRect","shouldOpenAroundTarget","SELECT_EDGE_MARGIN","spaceAvailable","selectedNode","optgroupNodes","isScrollable","calculateScrollable","loading","selectMenuRect","centeredRect","getOffsetRect","centeredStyle","paddingLeft","scrollBuffer","transformOrigin","containerRect","min-width","offsetLeft","offsetTop","oldDisplay","createDirective","targetValue","unregister","SidenavService","$mdComponentRegistry","waitForInstance","errorMsg","isLockedOpen","callbackFn","SidenavFocusDirective","sidenavCtrl","SidenavDirective","updateIsLocked","isLocked","updateIsOpen","focusEl","onKeyDown","triggeringElement","lastParentOverFlow","toggleOpen","isEscape","isLockedOpenParsed","mdIsLockedOpen","$media","$toggleOpen","SidenavController","mdComponentId","SliderDirective","updateAll","refreshSliderDimensions","ngModelRender","redrawTicks","updateMin","updateMax","updateStep","updateAriaDisabled","mdDiscrete","numSteps","tickCanvas","tickContainer","trackTicksStyle","tickCtx","getContext","fillStyle","dimensions","getSliderDimensions","fillRect","sliderDimensions","trackContainer","throttledRefreshDimensions","changeAmount","setModelValue","minMaxValidator","stepValidator","setSliderPercent","thumbText","formattedValue","percentStr","activeTrack","thumbContainer","onPressDown","exactVal","percentToValue","positionToPercent","closestVal","valueToPercent","onPressUp","isDragging","setSliderFromEvent","isDiscrete","adjustThumbPosition","doSlide","thumb","debouncedUpdateAll","MdSticky","setupSticky","contentCtrl","stickyClone","debouncedRefreshElements","refreshElements","refreshPosition","currentScrollTop","setCurrentItem","isScrollingDown","prevScrollTop","translate","setStickyState","setupAugmentedScrollEvents","checkStickySupport","$el","stickyProp","testEl","stickyProps","loopScrollEvent","lastScrollTime","SCROLL_END_DELAY","isScrolling","browserStickySupport","$$sticky","cloneElement","MdSubheaderDirective","$mdSticky","getContent","wrapperHtml","getDirective","DirectiveFactory","MdSwitch","mdCheckboxDirective","mdSwitchCompile","checkboxLink","checkboxDirective","disabledGetter","drag","isChanged","applyModelValue","switchContainer","MdToastDirective","$mdToast","MdToastProvider","updateTextContent","newContent","activeToastContent","toastDefaultOptions","isSmScreen","onSwipe","gesture","swipe","openClass","toastOpenClass","SWIPE_EVENTS","shouldAddWrapper","templateRoot","ACTION_RESOLVE","mdToolbarDirective","setupScrollShrink","onChangeScrollShrink","shrinkWithScroll","closestContent","contentElement","onMdContentLoad","disableScrollShrink","enableScrollShrink","newContentEl","debouncedContentScroll","onContentScroll","debouncedUpdateHeight","toolbarHeight","shrinkSpeedFactor","hasWhiteFrame","updateToolbarHeight","margin-bottom","mdShrinkSpeedFactor","mdScrollShrink","MdTooltipDirective","mdDelay","TOOLTIP_SHOW_DELAY","updateContentOrigin","configureWatchers","isVisible","showTooltip","hideTooltip","addAriaLabel","manipulateElement","windowScrollHandler","setVisible","ngWindow","attributeObserver","MutationObserver","mutations","mutation","observe","windowBlurHandler","elementFocusedOnWindowBlur","disconnect","enterHandler","leaveHandler","autohide","tooltipParent","positionTooltip","fitInParent","tipRect","TOOLTIP_WINDOW_EDGE_SPACE","getPosition","VirtualRepeatContainerDirective","VirtualRepeatContainerController","virtualRepeatContainerTemplate","scrollSize","repeater","autoShrink","autoShrinkMin","mdAutoShrinkMin","originalSize","offsetSize","mdOffsetSize","oldElementSize","mdTopIndex","bindTopIndex","topIndex","newIndex","scrollToIndex","sizer","offsetter","boundUpdateSize","updateSize","debouncedUpdateSize","jWindow","VirtualRepeatDirective","VirtualRepeatController","mdVirtualRepeat","repeatName","repeatListExpression","extraName","mdExtraName","link_","browserCheckUrlChange","newStartIndex","newEndIndex","newVisibleEnd","itemSize","mdItemSize","isFirstRender","isVirtualRepeatUpdating_","itemsLength","unwatchItemSize_","blocks","pooledBlocks","cleanupBlocks_","VirtualRepeatModelArrayLike","model","getItemAtIndex","getLength","MAX_ELEMENT_SIZE","NUM_EXTRA","repeaterCtrl","handleScroll_","isHorizontal","setSize_","dimension","getDimensionName_","unsetSize_","containerUpdated","getScrollSize","sizeScroller_","crossDimension","numChildren","sizerChild","autoShrink_","shrinkSize","getItemSize","currentSize","setScrollSize","itemsSize","getScrollOffset","resetScroll","numItems","getItemCount","Block","rawRepeatListExpression","sized","repeatListExpression_","readItemSize_","getBlock_","poolBlock_","repeatList","virtualList","$$includeIndexes","oldItems","virtualRepeatUpdate_","updateIndexes_","lengthChanged","mdStartIndex","blockIndex","newStartBlocks","newEndBlocks","updateBlock_","maxIndex","domFragmentFromBlocks_","new","updateScope_","containerLength","MdWhiteframeDirective","elevation","mdWhiteframe","DEFAULT_DP","MAX_DP","MIN_DP","MdAutocompleteCtrl","searchText","selectedItem","gatherElements","moveDropdown","positionDropdown","getVerticalOffset","correctHorizontalAlignment","dropdown","scrollContainer","MENU_PADDING","hrect","vrect","snap","bot","mdFloatingLabel","INPUT_PADDING","MAX_HEIGHT","maxHeight","autofocus","isRequired","handleSearchText","selectedItemChange","ul","li","getSnapTarget","getAngularElements","oldHidden","onListEnter","noBlur","onListLeave","shouldHide","onMouseup","previousSelectedItem","getDisplayValue","handleSelectedItemChange","announceItemChange","itemChange","getItemAsNameVal","announceTextChange","textChange","selectedItemWatchers","registerSelectedItemWatcher","unregisterSelectedItemWatcher","previousSearchText","getDefaultIndex","isMinLengthMet","handleQuery","setLoading","updateMessages","doBlur","forceBlur","keydown","updateScroll","hasSelection","clearValue","getMinLength","minLength","getItemText","itemText","itemName","autoselect","hasMatches","shouldShow","notFoundVisible","loadingIsVisible","getCurrentDisplayValue","fetchResults","handleAsyncResults","fetchesInProgress","handleResults","term","selectOnMatch","selectItemOnMatch","itemExpr","isList","isPromise","getCountMessage","hgt","isPromiseFetching","hasNotFound","noCache","displayValue","isMatching","matchInsensitive","itemParts","itemsExpr","clear","listEnter","listLeave","mouseUp","ITEM_HEIGHT","MdAutocomplete","inputName","inputMinlength","inputMaxlength","floatingLabel","menuClass","inputId","getItemTemplate","templateTag","getNoItemsTemplate","mdNoAsterisk","mdSelectOnFocus","leftover","noItemsTemplate","itemTemplate","MdAutocompleteItemScopeDirective","tAttr","watchVariable","variable","alias","connectScopes","scopeDigesting","newScopeDigesting","$mdAutocompleteCtrl","MdHighlightCtrl","termExpr","unsafeTextExpr","mdHighlightFlags","unsafeText","prevState","getRegExp","sanitize","MdHighlight","mdHighlightText","MdChip","hintTemplate","resetSelectedChip","DELETE_HINT_TEMPLATE","MdChipRemove","removeChip","$$replacedScope","MdChipTransclude","$mdChipsCtrl","$chip","newHtml","mdChipTransclude","MdChipsCtrl","userInputNgModelCtrl","userInputElement","selectedChip","hasAutocomplete","enableChipEdit","mdEnableChipEdit","deleteHint","deleteButtonLabel","chipBuffer","useOnAppend","useTransformChip","useOnAdd","useOnRemove","useOnSelect","inputKeydown","getChipBuffer","selectAndFocusChipSafe","separatorKeys","requireMatch","hasMaxChipsReached","appendChip","resetChipBuffer","updateChipContents","chipIndex","chipContents","isEditingChip","chipKeydown","removeAndSelectAdjacentChip","getPlaceholder","useSecondary","secondaryPlaceholder","selIndex","getAdjacentChipIndex","newChip","transformChip","transformedChip","identical","validateModel","onAdd","useOnAppendExpression","onAppend","useTransformChipExpression","useOnAddExpression","useOnRemoveExpression","useOnSelectExpression","maxChips","removed","removeChipAndFocusInput","selectChip","focusChip","onSelect","selectAndFocusChip","onInputFocus","inputHasFocus","onInputBlur","configureUserInput","scopeApplyFn","configureAutocomplete","MdChips","getTemplateByQuery","userTemplate","chipRemoveTemplate","templates","chipContentsTemplate","chipInputTemplate","staticChips","mdChipsCtrl","mdTransformChip","mdOnAppend","mdOnAdd","mdOnRemove","mdOnSelect","compiledStaticChips","getTemplates","chips","MD_CHIPS_TEMPLATE","CHIP_INPUT_TEMPLATE","CHIP_DEFAULT_TEMPLATE","CHIP_REMOVE_TEMPLATE","MdContactChipsCtrl","queryContact","contactQuery","$query","filterSelected","filterSelectedContacts","contactName","contact","contacts","MdContactChips","MD_CONTACT_CHIPS_TEMPLATE","contactImage","contactEmail","highlightFlags","mdIconDirective","$mdIcon","parentsHaveText","prepareForFontIcon","mdSvgIcon","mdSvgSrc","mdFontIcon","fontSet","mdFontSet","alt","attrVal","svg","MdIconProvider","ConfigurationItem","viewBoxSize","defaultViewBoxSize","MdIconService","getIcon","iconCache","transformClone","urlRegex","dataUrlRegex","loadByURL","cacheIcon","loadByID","loadFromIconSet","findRegisteredFontSet","useDefault","defaultFontSet","fontSets","cacheElement","cacheSuffix","icon","isIcon","Icon","iconConfig","extractFromSet","iconName","iconSetConfig","announceIdNotFound","setName","loadByDataUrl","isBase64","atob","loadByHttpUrl","announceNotFound","prepare","prepareAndStyle","preserveAspectRatio","viewBox","cloneSVG","iconSet","defaultIconSet","defaultIconSize","iconSize","preloadIcons","iconProvider","svgRegistry","asset","MenuController","$mdMenu","menuContainer","nestLevel","mdNestLevel","setMenuContainer","isInMenuBar","nestedMenus","menuContainerId","aria-owns","aria-haspopup","disableHoverListener","openMenuTimeout","menuItems","deregisterScopeListeners","enableHoverListener","currentlyOpenMenu","isAlreadyOpening","registerContainerProxy","triggerContainerProxy","handleMenuItemHover","handleMenuItemMouseLeave","handleMenuMouseLeave","nestedMenu","focusableTarget","mdMenuCtrl","$mdOpenMenu","$mdMenuIsOpen","focusMenuContainer","focusTarget","containerProxy","skipFocus","closeOpts","eventDetails","restoreFocusTo","positionMode","attachment","mdPositionMode","offsets","mdOffset","MenuDirective","INVALID_PREFIX","nestingDepth","menuEl","menuContents","MenuProvider","menuDefaultOptions","detachElement","showMenu","calculateMenuPosition","menuContentEl","startRepositioningOnResize","repositionMenu","focusMenuItem","parentMenu","captureClickListener","hasAnyAttribute","rawAttr","altForms","closestMenu","didFocus","currentItem","currentIndex","attemptFocus","toNode","firstVisibleChild","openMenuNode","alignTarget","openMenuNodeRect","boundryNode","boundryNodeRect","menuStyle","originNode","originNodeRect","MENU_EDGE_MARGIN","alignTargetRect","existingOffsets","willFitRight","MenuBarController","BOUND_MENU_METHODS","handleKeyDown","parentToolbar","getMenus","enableOpenOnHover","rootMenus","disableOpenOnHover","setKeyboardMode","openOnHoverEnabled","dataset","mdRestoreStyle","handleMenuHover","scheduleOpenHoveredMenu","menuCtrl","scheduleOpenMenu","pendingMenuOpen","currentMenu","wasOpen","newMenu","newMenuCtrl","openFocusedMenu","focusMenu","menus","focusedIndex","getFocusedMenuIndex","getOpenMenuIndex","menu","getFocusedMenu","focusedEl","MenuBarDirective","templateEl","ariaRole","contentEls","MenuDividerDirective","MenuItemController","iconEl","buttonEl","initClickListeners","clearNgAria","clearAttrs","handleClick","MenuItemDirective","setDefault","moveAttrToButton","MdTab","getTabElementIndex","insertTab","getIndex","refreshIndex","updateTabOrder","removeTab","MdTabItem","MdTabLabel","MdTabScroll","mdTabScroll","MdTabsController","$mdTabInkRipple","compileTemplate","updateHeightFromContent","adjustOffset","updateInkBarStyles","tabs","loaded","updatePagination","$mdTabsTemplate","handleWindowResize","handleSelectedIndexChange","defineOneWayBinding","defineBooleanAttribute","updateValue","destroyed","handleStretchTabs","stretchTabs","shouldStretchTabs","handleCenterTabs","shouldCenterTabs","handleMaxTabWidth","newWidth","oldWidth","tab","handleShouldPaginate","maxTabWidth","getMaxTabWidth","handleHasContent","handleOffsetChange","paging","handleFocusIndexChange","oldIndex","redirectFocus","getNearestSafeIndex","lastSelectedIndex","tabEl","handleResizeWhenVisible","incrementIndex","focusIndex","lastClick","canSkipClick","noSelectClick","shouldPaginate","fixOffset","wheelDelta","nextPage","viewportWidth","canvas","totalWidth","previousPage","handleInkBar","inkBar","handleDynamicHeight","tabData","hasLoaded","proto","isActive","isLeft","isRight","shouldRender","noDisconnect","updateHasContent","getElements","dummies","contentsWrapper","canPageBack","canPageForward","lastTab","centerTabs","noPagination","canvasWidth","maxOffset","updatePagingWidth","focusItem","inc","dynamicHeight","tabContent","contentHeight","tabsHeight","newHeight","currentHeight","fromHeight","toHeight","tabWidth","updateInkBarClassName","ink","MdTabs","MdTabsTemplate","handleScope","reconnect","enableDisconnect","compileScope","connected","ngMaterial","isValidDottedPath","MEMBER_NAME_REGEX","lookupDottedPath","$resourceMinErr","shallowClearAndCopy","PROTOCOL_AND_DOMAIN_REGEX","stripTrailingSlashes","cancellable","save","Route","urlParams","resourceFactory","paramDefaults","extractParams","actionParams","ids","defaultResponseInterceptor","resource","Resource","toJSON","$promise","$resolved","$cancelRequest","hasBody","numericTimeout","a1","a2","a3","a4","timeoutDeferred","numericTimeoutPromise","isInstanceCall","httpConfig","responseInterceptor","responseErrorInterceptor","setUrlParams","additionalParamDefaults","extendedParamDefaults","actionUrl","encodedVal","protocolAndDomain","isQueryParamValue","paramInfo","urlParam","p1","leadingSlashes","tail","orgEvent","delta","deltaX","deltaY","absDelta","wheelDeltaY","wheelDeltaX","HORIZONTAL_AXIS","deltaMode","pageHeight","lowestDelta","shouldAdjustOldDeltas","normalizeOffset","boundingRect","deltaFactor","nullLowestDeltaTimeout","nullLowestDelta","adjustOldDeltas","toFix","toBind","mousewheel","onmousewheel","getLineHeight","getPageHeight","$elem","unmousewheel","_rjs","_njs","_dlp","_url","decodeURI","touchable","pluginNS","pluginPfx","defaultSelector","setTop","setLeft","scrollbarPosition","scrollInertia","autoDraggerLength","alwaysShowScrollbar","snapOffset","mouseWheel","enable","scrollAmount","disableOver","scrollButtons","scrollType","keyboard","contentTouchScroll","documentTouchScroll","advanced","autoScrollOnFocus","updateOnContentResize","updateOnImageLoad","autoUpdateTimeout","onTotalScrollOffset","onTotalScrollBackOffset","alwaysTriggerOffsets","totalInstances","liveTimers","oldIE","touchActive","_selector","live","liveSelector","$liveSelector","removeLiveTimers","mCustomScrollbar","setWidth","set_width","setHeight","set_height","_findAxis","normalizeDelta","mouseWheelPixels","normalizeMouseWheelDelta","_findScrollButtonsType","_theme","$this","scrollRatio","overflowed","contentReset","tweenRunning","sequential","langDir","cbOffsets","img","change","htmlDataAxis","htmlDataSbPos","htmlDataTheme","_pluginMarkup","onCreate","mCSB_container","mCustomScrollBox","mCSB_dragger","_stop","onBeforeUpdate","_expandContentHorizontally","autoExpandHorizontalScroll","_contentWidth","_overflowed","_scrollbarVisibility","_setDraggerLength","_scrollRatio","_bindEvents","_resetContentPosition","_scrollTo","dur","overwrite","_unbindEvents","onImageLoad","onSelectorChange","onUpdate","_autoUpdate","methodDefaults","scrollEasing","moveDragger","methodOptions","_arr","_to","_isTabHidden","scrollbar","_delete","fixedSizeScrollbarThemes","nonExpandedScrollbarThemes","disabledScrollButtonsThemes","enabledAutoHideScrollbarThemes","scrollbarPositionOutsideThemes","autoExpandScrollbar","autoHideScrollbar","expandClass","wrapperClass","scrollbars","contentWrapper","autoHideClass","scrollbarDirClass","_scrollButtons","outerWidth","overflow-x","mCSB_scrollTools","_isNumeric","btnHTML","btn","ratio","outerHeight","max-height","line-height","max-width","_onDragClasses","xpnd","_draggable","contentWidth","cx","_mwt","mousewheelTimeout","_mousewheel","_contentDraggable","_selectable","_draggerRail","_wrapperScroll","_focus","_buttons","_keyboard","sb","releaseDraggableSelectors","extraDraggableSelectors","_canAccessIFrame","_focusTimeout","onCompleteTimeout","_coordinates","frameElement","io","touch","_drag","dragY","dragX","idleTimer","draggable","draggerId","rds","eds","_mouseBtnLeft","onselectstart","_iframe","_onTouchstart","_pointerTouch","touchDrag","docDrag","touchIntent","_onTouchmove","runningTime","_getTime","touchMoveY","touchMoveX","prevent","limitX","preventX","touchAction","durA","_onTouchstart2","touchStartY","touchStartX","_onTouchend","absDistance","_m","durB","ds","contentWindow","_sel","getSelection","createRange","_seq","seq","_sequentialScroll","_onMousewheel","_disableMousewheel","px","contentPos","draggerPos","dlt","webkitDirectionInvertedFromDevice","_canAccessIFrameCache","tags","focusTags","mCSB_draggerContainer","clickDir","nested","_focusTimer","_childPos","btnClass","_onKeyboard","editables","keyboardDir","_on","snapAmount","steplessSpeed","steppedSpeed","_off","vals","contentLength","cssProp","rem","upd","autoUpdate","updateOnSelectorChange","sizesSum","doUpd","imgLoader","createDelegate","contextObject","delegateMethod","imgOnLoad","Image","_snapAmount","_stopTween","_cb","_cbOffsets","tso","tsbo","_mcs","dp","cl","pl","mcs","draggerTop","draggerLeft","topPct","leftPct","totalScrollOffsets","totalScrollBackOffsets","onOverflowYNone","onOverflowXNone","onOverflowY","onOverflowX","totalScrollOffset","totalScrollBackOffset","onInit","_tweenTo","onScrollStart","whileScrolling","onTotalScroll","onTotalScrollBack","_step","tobj","_tween","_delay","_request","currVal","_ease","elStyle","_startTween","_cancelTween","ts","tc","_mTween","webkitNow","pointerType","_getHiddenProp","pfx","mcsInView","cPos","mcsInSight","elD","wrapperView","wrapperViewPct","pctVals","mcsOverflow","ngScrollbarsConfig","ngScrollbarsUpdate","g","duScrollDefaultEasing","duScroll","cancelAnimation","requestAnimation","duScrollEasing","duScrollDuration","duScrollOffset","duScrollCancelOnEvents","isDocument","HTMLDocument","DOCUMENT_NODE","HTMLElement","duScrollTo","aliasFn","duScrollToElement","duScrollToAnimated","scrollAnimation","startLeft","duScrollLeft","startTop","duScrollTop","deltaLeft","deltaTop","cancelScrollAnimation","animationStep","scrollX","scrollY","duScrollToElementAnimated","duScrollTopAnimated","duScrollLeftAnimated","unprefixed","vendors","polyfill","lastTime","currTime","timeToCall","scrollContainerAPI","duScrollGreedy","duScrollSpyWait","duScrollSpyRefreshInterval","duScrollBottomSpy","duScrollActiveClass","createScrollHandler","bottomReached","containerOffset","documentScrollHeight","currentlyActive","toBeActive","spies","spy","compareProperty","getTargetPosition","getTargetElement","createContext","destroyContext","intervalPromise","defaultContextId","getContextForScope","getContextForSpy","contextId","isElementInDocument","addSpy","getContainer","removeSpy","containers","setContainer","getContainerId","removeContainer","duSmoothScroll","spyAPI","iElement","iAttrs","Spy","targetElementOrId","targetId","flushTargetCache","duScrollspy","timeoutPromise","deregisterOnStateChange","ourDebug","me","nemDebugProvider","LEVELS","Logger","_debugCache","_fns","_isValidLogObject","_maybeExecLevel","_wrapDebug","nemDebug","level","logObject","len1","debugInstance","newLogger","$log1","fn1","logFns","spawn","doLog","_this","currentLevel","newInternalLogger","useColors","firebug","table","$1","formatArgs","humanize","lastC","storage","removeItem","localstorage","localStorage","local","./debug","selectColor","prevColor","curr","prevTime","coerce","formatter","skips","long","plural","thisArg","arrayAggregator","iteratee","accumulator","arrayEach","arrayEachRight","arrayEvery","arrayFilter","resIndex","arrayIncludes","baseIndexOf","arrayIncludesWith","arrayMap","arrayPush","arrayReduce","initAccum","arrayReduceRight","arraySome","asciiToArray","asciiWords","reAsciiWord","baseFindKey","eachFunc","baseFindIndex","fromIndex","fromRight","strictIndexOf","baseIsNaN","baseIndexOfWith","baseMean","baseSum","NAN","baseProperty","basePropertyOf","baseReduce","baseSortBy","comparer","baseTimes","baseToPairs","baseUnary","baseValues","cacheHas","charsStartIndex","strSymbols","chrSymbols","charsEndIndex","countHolders","escapeStringChar","chr","stringEscapes","hasUnicode","reHasUnicode","hasUnicodeWord","reHasUnicodeWord","iteratorToArray","mapToArray","overArg","replaceHolders","PLACEHOLDER","setToArray","setToPairs","strictLastIndexOf","stringSize","unicodeSize","asciiSize","stringToArray","unicodeToArray","reUnicode","unicodeWords","reUnicodeWord","VERSION","LARGE_ARRAY_SIZE","CORE_ERROR_TEXT","FUNC_ERROR_TEXT","HASH_UNDEFINED","MAX_MEMOIZE_SIZE","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","WRAP_BIND_FLAG","WRAP_BIND_KEY_FLAG","WRAP_CURRY_BOUND_FLAG","WRAP_CURRY_FLAG","WRAP_CURRY_RIGHT_FLAG","WRAP_PARTIAL_FLAG","WRAP_PARTIAL_RIGHT_FLAG","WRAP_ARY_FLAG","WRAP_REARG_FLAG","WRAP_FLIP_FLAG","DEFAULT_TRUNC_LENGTH","DEFAULT_TRUNC_OMISSION","HOT_COUNT","HOT_SPAN","LAZY_FILTER_FLAG","LAZY_MAP_FLAG","LAZY_WHILE_FLAG","INFINITY","MAX_SAFE_INTEGER","MAX_INTEGER","MAX_ARRAY_LENGTH","MAX_ARRAY_INDEX","HALF_MAX_ARRAY_LENGTH","wrapFlags","argsTag","arrayTag","asyncTag","boolTag","dateTag","domExcTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","promiseTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","weakMapTag","weakSetTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reEscapedHtml","reUnescapedHtml","reHasEscapedHtml","reHasUnescapedHtml","reEscape","reEvaluate","reInterpolate","reIsDeepProp","reIsPlainProp","rePropName","reRegExpChar","reHasRegExpChar","reTrim","reTrimStart","reTrimEnd","reWrapComment","reWrapDetails","reSplitDetails","reEscapeChar","reEsTemplate","reFlags","reIsBadHex","reIsBinary","reIsHostCtor","reIsOctal","reIsUint","reLatin","reNoMatch","reUnescapedString","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsVarRange","rsBreakRange","rsApos","rsAstral","rsBreak","rsCombo","rsDigits","rsDingbat","rsLower","rsMisc","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsUpper","rsZWJ","rsMiscLower","rsMiscUpper","rsOptContrLower","rsOptContrUpper","reOptMod","rsOptVar","rsOptJoin","rsOrdLower","rsOrdUpper","rsSeq","rsEmoji","rsSymbol","reApos","reComboMark","contextProps","templateCounter","typedArrayTags","cloneableTags","deburredLetters","À","Ã","Â","Ã","Ä","Ã…","à ","á","â","ã","ä","Ã¥","Ç","ç","Ã","ð","È","É","Ê","Ë","è","é","ê","ë","ÃŒ","Ã","ÃŽ","Ã","ì","Ã","î","ï","Ñ","ñ","Ã’","Ó","Ô","Õ","Ö","Ø","ò","ó","ô","õ","ö","ø","Ù","Ú","Û","Ãœ","ù","ú","û","ü","Ã","ý","ÿ","Æ","æ","Þ","þ","ß","Ä€","Ä‚","Ä„","Ä","ă","Ä…","Ć","Ĉ","ÄŠ","ÄŒ","ć","ĉ","Ä‹","Ä","ÄŽ","Ä","Ä","Ä‘","Ä’","Ä”","Ä–","Ę","Äš","Ä“","Ä•","Ä—","Ä™","Ä›","Äœ","Äž","Ä ","Ä¢","Ä","ÄŸ","Ä¡","Ä£","Ĥ","Ħ","Ä¥","ħ","Ĩ","Ī","Ĭ","Ä®","Ä°","Ä©","Ä«","Ä","į","ı","Ä´","ĵ","Ķ","Ä·","ĸ","Ĺ","Ä»","Ľ","Ä¿","Å","ĺ","ļ","ľ","Å€","Å‚","Ń","Å…","Ň","ÅŠ","Å„","ņ","ň","Å‹","ÅŒ","ÅŽ","Å","Å","Å","Å‘","Å”","Å–","Ř","Å•","Å—","Å™","Åš","Åœ","Åž","Å ","Å›","Å","ÅŸ","Å¡","Å¢","Ť","Ŧ","Å£","Å¥","ŧ","Ũ","Ū","Ŭ","Å®","Å°","Ų","Å©","Å«","Å","ů","ű","ų","Å´","ŵ","Ŷ","Å·","Ÿ","Ź","Å»","Ž","ź","ż","ž","IJ","ij","Å’","Å“","ʼn","Å¿","htmlEscapes","&","<","htmlUnescapes","&","<",">",""","'","\\","\n","\r","
","
","freeParseFloat","freeParseInt","freeGlobal","freeSelf","freeExports","freeModule","moduleExports","freeProcess","nodeUtil","nodeIsArrayBuffer","nodeIsDate","nodeIsMap","isMap","nodeIsRegExp","nodeIsSet","isSet","nodeIsTypedArray","deburrLetter","escapeHtmlChar","unescapeHtmlChar","runInContext","lodash","isObjectLike","LazyWrapper","LodashWrapper","wrapperClone","baseLodash","chainAll","__wrapped__","__actions__","__chain__","__index__","__values__","__dir__","__filtered__","__iteratees__","__takeCount__","__views__","lazyClone","copyArray","lazyReverse","lazyValue","isArr","arrLength","getView","iteratees","iterLength","takeCount","nativeMin","baseWrapperValue","iterIndex","Hash","hashClear","__data__","nativeCreate","hashDelete","hashGet","hashHas","hashSet","ListCache","listCacheClear","listCacheDelete","assocIndexOf","listCacheGet","listCacheHas","listCacheSet","MapCache","mapCacheClear","Map","mapCacheDelete","getMapData","mapCacheGet","mapCacheHas","mapCacheSet","SetCache","setCacheAdd","setCacheHas","Stack","stackClear","stackDelete","stackGet","stackHas","stackSet","pairs","arrayLikeKeys","isArg","isArguments","isBuff","isBuffer","isType","skipIndexes","isIndex","arraySample","baseRandom","arraySampleSize","shuffleSelf","baseClamp","arrayShuffle","assignMergeValue","baseAssignValue","assignValue","objValue","baseAggregator","baseEach","baseAssign","copyObject","baseAssignIn","keysIn","configurable","enumerable","writable","baseAt","paths","lower","upper","baseClone","bitmask","customizer","isDeep","isFlat","isFull","initCloneArray","getTag","isFunc","cloneBuffer","initCloneObject","copySymbolsIn","copySymbols","initCloneByTag","stacked","subValue","keysFunc","getAllKeysIn","getAllKeys","baseConforms","baseConformsTo","baseDelay","baseDifference","isCommon","valuesLength","valuesIndex","baseEvery","baseExtremum","isSymbol","baseFill","toInteger","toLength","baseFilter","baseFlatten","isStrict","isFlattenable","baseForOwn","baseFor","baseForOwnRight","baseForRight","baseFunctions","baseGet","castPath","toKey","baseGetAllKeys","symbolsFunc","baseGetTag","symToStringTag","getRawTag","objectToString","baseGt","other","baseHas","baseHasIn","baseInRange","nativeMax","baseIntersection","arrays","othLength","othIndex","maxLength","baseInverter","baseInvoke","baseIsArguments","baseIsArrayBuffer","baseIsDate","baseIsEqual","baseIsEqualDeep","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects","baseIsMap","baseIsMatch","noCustomizer","srcValue","baseIsNative","isMasked","reIsNative","toSource","baseIsRegExp","baseIsSet","baseIsTypedArray","isLength","baseIteratee","baseMatchesProperty","baseMatches","baseKeys","isPrototype","nativeKeys","baseKeysIn","nativeKeysIn","isProto","baseLt","baseMap","getMatchData","matchesStrictComparable","isKey","isStrictComparable","hasIn","baseMerge","srcIndex","baseMergeDeep","safeGet","mergeFunc","isTyped","isArrayLikeObject","cloneTypedArray","toPlainObject","baseNth","baseOrderBy","orders","getIteratee","criteria","compareMultiple","basePick","basePickBy","baseSet","basePropertyDeep","basePullAll","basePullAt","indexes","baseUnset","nativeFloor","nativeRandom","baseRange","nativeCeil","baseRepeat","baseRest","setToString","overRest","baseSample","baseSampleSize","baseShuffle","baseSlice","baseSome","baseSortedIndex","retHighest","mid","baseSortedIndexBy","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","baseSortedUniq","baseToNumber","baseToString","symbolToString","baseUniq","createSet","seenIndex","baseUpdate","updater","baseWhile","isDrop","baseXor","baseZipObject","assignFunc","valsLength","castArrayLikeObject","castFunction","stringToPath","castSlice","allocUnsafe","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","cloneRegExp","cloneSymbol","symbol","symbolValueOf","typedArray","compareAscending","valIsDefined","valIsReflexive","objCriteria","othCriteria","ordersLength","composeArgs","partials","holders","isCurried","argsIndex","argsLength","holdersLength","leftIndex","leftLength","rangeLength","isUncurried","composeArgsRight","holdersIndex","rightIndex","rightLength","isNew","getSymbols","getSymbolsIn","createAggregator","initializer","createAssigner","assigner","sources","guard","isIterateeCall","createBaseEach","iterable","createBaseFor","createBind","Ctor","isBind","createCtor","createCaseFirst","trailing","createCompounder","deburr","thisBinding","baseCreate","createCurry","arity","getHolder","createRecurry","createHybrid","createFind","findIndexFunc","createFlow","flatRest","funcs","prereq","thru","getFuncName","getData","isLaziable","plant","partialsRight","holdersRight","argPos","ary","holdersCount","newHolders","isBindKey","reorder","isFlip","isAry","createInverter","toIteratee","createMathOperation","createOver","arrayFunc","createPadding","charsLength","createPartial","toFinite","createRelationalOperation","toNumber","wrapFunc","isCurry","newHoldersRight","newPartials","newPartialsRight","newData","setWrapToString","createRound","precision","nativeIsFinite","pair","createToPairs","createWrap","mergeData","baseSetData","customDefaultsAssignIn","objectProto","customDefaultsMerge","customOmitClone","isPartial","arrStacked","othStacked","arrValue","othValue","compared","convert","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","realNames","otherFunc","isKeyable","getNative","isOwn","unmasked","nativeObjectToString","transforms","getWrapDetails","hasPath","hasFunc","getPrototype","insertWrapDetails","spreadableSymbol","maskSrcKey","memoizeCapped","memoize","srcBitmask","newBitmask","isCombo","otherArgs","oldArray","reference","updateWrapDetails","shortOut","lastCalled","stamp","nativeNow","rand","funcToString","chunk","compact","drop","dropRight","dropRightWhile","dropWhile","fill","findIndex","findLastIndex","flattenDeep","flattenDepth","fromPairs","nativeJoin","nth","pullAll","pullAllBy","pullAllWith","nativeReverse","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","take","takeRight","takeRightWhile","takeWhile","uniq","uniqBy","uniqWith","unzip","unzipWith","zipObject","zipObjectDeep","tap","wrapperChain","wrapperCommit","wrapperNext","wrapperToIterator","wrapperPlant","wrapperReverse","wrapperValue","flatMap","flatMapDeep","flatMapDepth","forEachRight","baseEachRight","orderBy","sample","sampleSize","shuffle","curry","curryRight","invokeFunc","lastArgs","lastThis","lastInvokeTime","leadingEdge","timerExpired","leading","remainingWait","timeSinceLastCall","lastCallTime","timeSinceLastInvoke","timeWaiting","maxing","maxWait","shouldInvoke","trailingEdge","debounced","isInvoking","flip","memoized","Cache","spread","partial","castArray","cloneWith","cloneDeep","cloneDeepWith","conformsTo","isEqual","isEqualWith","isInteger","isMatchWith","isNative","isMaskable","isNil","objectCtorString","isSafeInteger","isWeakMap","isWeakSet","symIterator","sign","remainder","isBinary","toSafeInteger","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","functions","functionsIn","mapKeys","mapValues","omitBy","pickBy","setWith","isArrLike","updateWith","valuesIn","floating","capitalize","upperFirst","endsWith","escapeRegExp","pad","strLength","padEnd","padStart","radix","nativeParseInt","repeat","templateSettings","assignInWith","isEscaping","isEvaluating","imports","importsKeys","importsValues","reDelimiters","evaluate","escapeValue","interpolateValue","esTemplateValue","evaluateValue","attempt","toLower","toUpper","trimEnd","trimStart","omission","newEnd","unescape","cond","conforms","defaultTo","matchesProperty","mixin","methodNames","oldDash","nthArg","propertyOf","stubArray","stubFalse","stubObject","stubString","stubTrue","times","uniqueId","idCounter","maxBy","mean","meanBy","minBy","sum","sumBy","arrayProto","funcProto","coreJsData","IE_PROTO","Buffer","Symbol","objectCreate","propertyIsEnumerable","isConcatSpreadable","toStringTag","ctxClearTimeout","ctxNow","ctxSetTimeout","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","DataView","Set","WeakMap","metaMap","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","baseSetToString","castRest","ctorString","subString","difference","differenceBy","differenceWith","intersection","intersectionBy","intersectionWith","pull","pullAt","union","unionBy","unionWith","without","xor","xorBy","xorWith","zip","zipWith","wrapperAt","countBy","findLast","groupBy","invokeMap","keyBy","partition","sortBy","bindKey","overArgs","funcsLength","partialRight","rearg","gte","lte","assignIn","assignWith","at","propsIndex","propsLength","defaultsDeep","mergeWith","invertBy","toPairs","toPairsIn","word","kebabCase","lowerCase","lowerFirst","snakeCase","startCase","upperCase","bindAll","flow","flowRight","methodOf","over","overEvery","overSome","rangeRight","augend","addend","divide","dividend","divisor","multiply","multiplicand","minuend","subtrahend","entriesIn","extendWith","eachRight","takeName","dropName","checkIteratee","isTaker","lodashFunc","retUnwrapped","isLazy","useLazy","isHybrid","isUnwrapped","onlyLazy","chainName","commit","uuid","getScriptUrl","includeScript","isGoogleMapsLoaded","scriptId","usedConfiguration","china","omitOptions","scriptElem","isGoogleMapsForWork","generate","google","maps","randomizedFunctionName","connection","Connection","NONE","preventLoad","manualLoad","libraries","language","configure","loader","hasProp","__super__","uiGmapInfoBox","InfoWindow","_open","_close","_isOpen","InfoBox","superClass","getOrigCloseBoxImg_","getCloseBoxDiv_","closeBoxDiv","closeBoxDiv_","getCloseBoxImg_","closeBoxURL_","closeBoxMargin_","MarkerLabel_","setContent","marker_","oldContent","labelDiv_","eventDiv_","fixLodash","toObject","missingName","swapName","toMonkeyPatch","pathKey","intersectionObjects","comparison","res","obj1","obj2","containsObject","includeObject","differenceObjects","withoutObjects","indexOfObject","isSorted","isNullOrUndefined","thing","fakePromise","uiGmapPromise","uiGmapDataStructures","uiGmapGmapUtil","ExposedPromise","PromiseQueueManager","SniffedPromise","_getIterateeValue","_ignoreFields","defaultChunkSize","doChunk","doSkippPromise","errorObject","getArrayAndKeys","isInProgress","kickPromise","logTryCatch","managePromiseQueue","maybeCancelPromises","promiseStatus","promiseTypes","tryCatch","sniffedPromise","cancelCb","promiseType","lastPromise","existingPiecesObj","newPromise","existingPieces","_content","Queue","objectToLock","fnPromise","cancelLogger","ctx","error1","_isArray","valOrKey","bailOutCb","chunkSizeOrDontChunk","pauseMilli","chunkCb","pauseCb","overallD","cnt","keepGoing","promiseLock","chunkSizeFrom","fromSize","isFalse","BaseObject","baseObjectKeywords","extended","include","included","onChildCreation","CtrlHandle","getScope","mapPromise","mapScope","_getEventsObj","_hasEvents","setEvents","gObject","ignores","doIgnore","removeEvents","markersOrPoints","gMap","everSet","markerOrPoint","LatLngBounds","fitBounds","_isFalse","_isTruthy","getCoords","getLatitude","getLongitude","validateCoords","coordinates","latitude","longitude","LatLng","setCoordsFromEvent","prevValue","newLatLon","lat","lng","getLabelPositionPoint","xPos","yPos","Point","createWindowOptions","gMarker","buildContent","pixelOffset","boxClass","defaultDelay","isTrue","isFalsy","equalCoords","coord1","coord2","validatePath","polygon","trackMaxVertices","convertPathPoints","latlng","MVCArray","getPath","validateBoundPoints","sw","ne","convertBoundPoints","fitMapBounds","_checkIfReady","_ctr","_promises","_proms","expectedInstances","retriesLeft","numRetries","decrement","Linked","nemSimpleLogger","GmapUtil","_Class","scope1","_interface","scopeKeys","modelsLength","updateChild","setChildScope","getChanges","getProp","setIdKey","modelKeyComparison","defaultIdKey","idKey","evalModelHandle","modelKey","model1","model2","hasCoords","scopeOrModelVal","setVal","modelOrKey","whitelistedProps","doWrap","maybeWrap","modelProp","scopeProp","isScopeObj","manualOverride","needToManualDestroy","clean","updateModel","arrayOrObjModels","models","_async","didQueueInitPromise","figureOutState","childObjects","callBack","adds","mappedScopeModelIds","removals","clonedModel","isResolved","promiseStatuses","strPromiseStatuses","IN_PROGRESS","RESOLVED","REJECTED","cancelDeferred","combined","successes","fnToWrap","PropMap","stateChanged","dict","didValsStateChange","didKeysStateChange","allVals","allKeys","isSafe","valuesOrKeys","PropertyAction","setterFn","setIfChange","callingKey","sic","FitHelper","EventsHelper","ClustererMarkerManager","opt_markers","opt_options","opt_events","checkSync","getGMarkers","attachEvents","draw","removeMany","addMany","clusterer","NgMapMarkerClusterer","propMapGMarkers","setIgnoreHidden","noDrawOnSingleAddRemoves","checkKey","addMarker","gMarkers","exists","removeMarker","repaint","optionsName","clearEvents","getMap","getMarkers","_availableInstances","_usedInstances","createMapInstance","getDiv","setOptions","recycleMapInstance","MarkerManager","handleOptDraw","optDraw","deletes","isDrawn","doAdd","setMap","MarkerSpiderfier","SpiderfierMarkerManager","isSpiderfied","markerSpiderfier","clearListeners","_omsData","addEvent","addEvents","_handler","mapEvents","mapArray","pathEval","pathChangedFn","geojsonArray","geojsonHandlers","geojsonWatcher","isSetFromScope","legacyHandlers","legacyWatcher","mapArrayListener","scopePath","watchListener","set_at","getAt","insert_at","remove_at","newPath","setAt","maybeRepaint","_ignores","_iterators","_slapForEach","_slapMap","slapMap","slapForEach","slapAll","ModelKey","CommonOptionsBuilder","watchProps","buildOpts","isColl","getCorrectModel","customOpts","cachedEval","forEachOpts","stroke","DEFAULTS","strokeColor","strokeOpacity","strokeWeight","weight","editable","static","icons","setMyOptions","PolylineOptionsBuilder","pathPoints","geodesic","ShapeOptionsBuilder","fillColor","PolygonOptionsBuilder","RectangleOptionsBuilder","CircleOptionsBuilder","radius","isLabel","labelContent","labelAnchor","labelClass","labelStyle","labelVisible","arraySync","Builder","gFactory","BasePolyChildModel","gObjectChangeCb","isScopeModel","internalEvents","dragend","dragstart","maybeCachedEval","internalListeners","ref1","setEditable","setDraggable","drawFreeHand","freeHandMgr","polys","poly","Polyline","latLng","addListenerOnce","Polygon","map1","disableMap","enableMap","mapOptions","disableDefaultUI","scrollwheel","disableDoubleClickZoom","engage","polys1","addDomListener","MarkerOptions","IMarker","MarkerChildModel","setLabelOptions","setIcon","setCoords","isNotValid","maybeSetScopeValue","createMarker","setMyScope","handleModelChanges","ref2","ref3","ref4","doClick","gManager","doDrawSelf","trackModel","needRedraw","idKeyKey","getGMarker","calledKey","externalListeners","removeFromManager","ctr","doDraw","renderGMarker","validCb","spiderListener","thingThatChanged","oldModel","isInit","justCreated","gSetter","doCheckGmarker","hasIdenticalScopes","hasNoGmarker","newGValue","newModelVal","oldGValue","setPosition","MarkerWithLabel","RichMarker","Marker","fitKey","mousearg","modelToSet","newCoords","coordsKey","BaseGen","PolygonChildModel","PolylineChildModel","ChromeFixes","WindowChildModel","getLatestPosition","hideWindow","showWindow","watchOptions","watchCoords","createGWin","watchElement","watchAndDoShow","doShow","maybeMarker","isIconVisibleOnClick","markerScope","markerIsVisibleAfterWindowClose","getGmarker","ref5","setClickable","_opts","setAnimation","oldMarkerAnimation","closeClick","forceClick","initialMarkerVisibility","getVisible","getAnimation","templateScope","templateParameter","parameter","overridePos","ModelsWatcher","IPoly","PolyChildModel","gObjectName","BasePolysParentModel","gMap1","maybeFit","pieceMeal","createAllNew","watchIdKey","createChildScopes","watchDestroy","rebuildAll","doINeedToWipe","watchModels","plurals","doRebuildAll","newValueIsEmpty","doCreate","doDelete","cleanchunk","isCreatingFromScratch","maybeCanceled","canceledMsg","getArray","payload","modelToAdd","inProgress","CircleParentModel","_settingFromDirective","settingFromDirective","lastRadius","Circle","newVals","oldVals","getCircle","newRadius","work","getRadius","radius_changed","getCenter","DrawingManagerParentModel","drawing","DrawingManager","getDrawingManager","IMarkerParentModel","onWatch","validateScope","propNameToWatch","equalityCheck","IWindowParentModel","getItem","modelsPropToIterate","LayerParentModel","onLayerCreated","createGoogleLayer","MapTypeParentModel","hideOverlay","showOverlay","refreshMapType","createMapType","overlayMapTypesCount","different","mapTypeProps","mapType","getTile","getTileUrl","ImageMapType","mapTypes","layerId","overlayMapTypes","removeAt","MarkersParentModel","_setPlurals","objToSet","maybeExecMappedEvent","newChildMarker","bindToTypeEvents","pluralsUpdate","updateCtr","modelsRendered","modelsbyref","modelsNotDefined","typeEvents","internalHandles","origTypeEvents","typeOptions","clusterEvents","clusterOptions","doCluster","spiderfy","doRebuild","markerModels","mapTypeToPlurals","arrayToMap","cluster","ChildModel","RectangleParentModel","createBounds","dragging","myListeners","settingBoundsFromScope","updateBounds","getNorthEast","getSouthWest","Rectangle","getBounds","setBounds","SearchBoxParentModel","ctrlPosition","controlDiv","setVisibility","createSearchBox","addToParentDiv","addAsMapControl","autocomplete","parentdiv","places","getPlace","getPlaces","controls","ControlPosition","parentDiv","Autocomplete","SearchBox","IWindow","WindowsParentModel","markersScope","interpolateContent","createWindow","setContentKeys","watchOurScope","linked","contentKeys","firstWatchModels","parentScope","itemToWatch","doScratch","nameKey","isiconvisibleonclick","hasGMarker","fakeElement","optionsKey","interpModel","ICircle","mapCtrl","IControl","GoogleMapApi","Control","templateCtrl","keyboardkey","spec","ctrlType","enableKeyDragZoom","setKeyAction","setOptionsAction","IDrawingManager","DrawFreeHandChildModel","uiGmapLodash","FreeDrawPolygons","polygons","freeHand","Exception","IPolygon","IPolyline","ChildEvents","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapIsReady","uiGmapuuid","uiGmapExtendGWin","uiGmapExtendMarkerClusterer","uiGmapGoogleMapsUtilV3","uiGmapGoogleMapApi","uiGmapEventsHelper","uiGmapGoogleMapObjectManager","initializeItems","ctrlFn","ctrlObj","retCtrl","eventOpts","unbindCenterWatch","idleAndZoomChanged","_gMap","customListeners","disabledEvents","getEventHandler","maybeHookToEvent","resolveSpawned","spawned","updateCenter","zoomPromise","mapTypeId","MapTypeId","ROADMAP","blacklist","prefn","lazy","northeast","southwest","maybeCoords","pan","panTo","setCenter","getGMap","getMapOptions","getCustomEventListeners","yourListeners","getZoom","setZoom","zoomMs","Plural","_sync","Markers","modelsByRef","parentModel","getChildMarkers","_initControl","updateModels","newModels","getPlurals","getManager","hasManager","managerDraw","PolygonChild","getInstance","Interface","ParentModel","Polygons","PolylinesParentModel","Polylines","IRectangle","Window","childWindows","markerCtrl","childWindow","hasScopeCoords","child1","child2","getGWindows","getChildWindows","Windows","pieces","additionalScope","uiGmapMap","Layer","onCreated","DragZoom","MapType","uiGmapShow","uiGmapAfterShow","uiGmapAfterHide","angular_post_1_3_handle","angular_pre_1_3_handle","animateAction","focalcoord","povoptions","imagestatus","didCreateOptionsFromDirective","handleSettings","pano","povOpts","sv","perspectivePoint","focalPoint","heading","geometry","spherical","computeHeading","pitch","navigationControl","addressControl","linksControl","pov","StreetViewService","getPanoramaByLocation","streetViewPanoramaData","image_status_changed","StreetViewPanorama","getPovOptions","getGObject","getGPano","UUID","_gri","_ha","opt_opts","OverlayView","content_","disableAutoPan_","disableAutoPan","maxWidth_","pixelOffset_","Size","position_","zIndex_","boxClass_","boxStyle_","boxStyle","closeBoxMargin","closeBoxURL","infoBoxClearance_","infoBoxClearance","isHidden_","alignBottom_","alignBottom","pane_","pane","enableEventPropagation_","enableEventPropagation","div_","closeListener_","moveListener_","contextListener_","eventListeners_","fixedWidthSet_","ClusterIcon","getMarkerClusterer","cluster_","className_","getClusterClass","styles_","center_","sums_","visible_","Cluster","mc","markerClusterer_","map_","gridSize_","getGridSize","minClusterSize_","getMinimumClusterSize","averageCenter_","getAverageCenter","markers_","bounds_","clusterIcon_","MarkerClusterer","clusters_","listeners_","activeMap_","ready_","gridSize","minimumClusterSize","maxZoom_","maxZoom","title_","title","zoomOnClick_","zoomOnClick","averageCenter","ignoreHidden_","ignoreHidden","enableRetinaIcons_","enableRetinaIcons","imagePath_","imagePath","IMAGE_PATH","imageExtension_","imageExtension","IMAGE_EXTENSION","imageSizes_","imageSizes","IMAGE_SIZES","calculator_","calculator","CALCULATOR","batchSize_","batchSize","BATCH_SIZE","batchSizeIE_","batchSizeIE","BATCH_SIZE_IE","clusterClass_","clusterClass","setupStyles_","addMarkers","inherits","childCtor","parentCtor","tempCtor","superClass_","crossURL","handCursorURL","handCursorURL_","crossDiv_","getSharedCross","labelInBackground","raiseOnDrag","optimized","crossImage","handCursor","dragging_","RichMarkerPosition","setValues","createInfoBoxDiv_","bw","cancelHandler","cancelBubble","ignoreHandler","setBoxStyle_","getPanes","addClickHandler_","getBoxWidths_","panBox_","cursor","closeBox","getCloseClickHandler_","disablePan","xOffset","mapDiv","mapWidth","mapHeight","iwOffsetX","iwOffsetY","iwWidth","iwHeight","padX","padY","pixPosition","getProjection","fromLatLngToContainerPixel","panBy","WebkitTransform","MsFilter","computedStyle","borderTopWidth","borderBottomWidth","borderLeftWidth","borderRightWidth","fromLatLngToDivPixel","setZIndex","getZIndex","opt_zoomOpts","ov","init_","prjov_","toPixels","widthValue","getBorderWidths","getScrollValue","getMousePosition","posX","posY","getElementPosition","moffx","moffy","matrix","MozTransform","parms","setVals","setOpacity","op","key_","borderWidths_","veilDiv_","paneStyle","veilStyle","MozUserSelect","noZoom_","noZoom","visualEnabled_","visualEnabled","visualClass_","visualClass","visualPosition_","visualPosition","LEFT_TOP","visualPositionOffset_","visualPositionOffset","visualPositionIndex_","visualPositionIndex","visualSprite_","visualSprite","visualSize_","visualSize","visualTips_","visualTips","boxDiv_","boxBorderWidths_","onKeyDown_","onKeyUp_","onMouseDown_","onMouseDownDocument_","onMouseMove_","onMouseUp_","hotKeyDown_","mouseDown_","startPt_","endPt_","mapWidth_","mapHeight_","mousePosn_","mapPosn_","buttonDiv_","initControl_","controlIndex_","onclick","activatedByControl_","onmouseover","onmouseout","ondragstart","marginLeft","isHotKeyDown_","isHot","isMouseOnMap_","mousePosn","mapPosn","setVeilVisibility_","getMousePoint_","prj","fromContainerPixelToLatLng","boxWidth","boxHeight","z","kGoogleCenteringBug","bnds","swPt","nePt","dragZoom_","disableKeyDragZoom","keyDragZoomEnabled","getDragZoomObject","cMouseDownInCluster","cDraggingMapByCluster","cClusterIcon","overlayMouseTarget","boundsChangedListener_","theBounds","mz","getZoomOnClick","getMaxZoom","clearInstanceListeners","getPosFromLatLng_","backgroundPosition_","spriteH","spriteV","createCss","url_","width_","height_","anchorText_","textColor_","textSize_","fontFamily_","fontWeight_","fontStyle_","textDecoration_","getTitle","useStyle","sums","anchorText","anchorIcon_","anchorIcon","textColor","textSize","textDecoration","fontStyle","fontFamily","backgroundPosition","markers","mCount","isMarkerAlreadyAdded_","calculateBounds_","isAdded","updateIcon_","isMarkerInClusterBounds","getExtendedBounds","numStyles","getCalculator","cMarkerClusterer","resetViewport_","redraw_","fitMapToMarkers","setGridSize","setMinimumClusterSize","setMaxZoom","setStyles","setTitle","setZoomOnClick","setAverageCenter","getIgnoreHidden","getEnableRetinaIcons","setEnableRetinaIcons","getImageExtension","setImageExtension","getImagePath","setImagePath","getImageSizes","setImageSizes","setCalculator","getBatchSizeIE","setBatchSizeIE","setClusterClass","getTotalMarkers","getClusters","getTotalClusters","opt_nodraw","pushMarkerTo_","getDraggable","removeMarker_","removeMarkers","clearMarkers","oldClusters","projection","bl","trPix","blPix","fromDivPixelToLatLng","createClusters_","opt_hide","distanceBetweenPoints_","p2","R","dLat","dLon","sin","atan2","isMarkerInBounds_","addToClosestCluster_","clusterToAddTo","iFirst","mapBounds","timerRefStatic","iLast","dv","crossDiv","cSavedZIndex","cLatOffset","cLngOffset","cIgnoreClick","cRaiseEnabled","cStartPosition","cStartCenter","cMouseIsDown","cDraggingLabel","cRaiseOffset","cDraggingCursor","cAbortEvent","cStopBounce","overlayImage","getClickable","getCursor","mEvent","BOUNCE","setAnchor","setMandatoryStyles","zAdjust","theMap","visible_changed","markerWrapper_","setFlat","flat","getFlat","getWidth","setShadow","shadow","flat_changed","getShadow","zIndex_changed","draggable_changed","addDragging_","removeDragListeners_","position_changed","getAnchor","anchor_changed","htmlToDocumentFragment_","htmlString","tempDiv","removeChildren_","content_changed","markerContent_","setCursor_","whichCursor","startDrag","mapDraggable_","mouseX_","mouseY_","addDraggingListeners_","stopDrag","removeDraggingListeners_","getOffset_","draggableListener_","setCapture","draggingListeners_","releaseCapture","panes","TOP_LEFT","TOP","TOP_RIGHT","LEFT","MIDDLE","RIGHT","BOTTOM_LEFT","BOTTOM","BOTTOM_RIGHT","__webpack_require__","moduleId","installedModules","Graph","Heap","LinkedList","RedBlackTree","Trie","__hasProp","_nodes","nodeSize","edgeSize","addNode","_outEdges","_inEdges","removeNode","inEdgeId","nodeToRemove","outEdgeId","_ref","_ref1","removeEdge","addEdge","fromId","toId","edgeToAdd","fromNode","getEdge","edgeToDelete","getInEdgesOf","nodeId","inEdges","getOutEdgesOf","outEdges","getAllEdgesOf","selfEdge","_i","forEachNode","nodeObject","forEachEdge","edgeObject","_leftChild","_parent","_rightChild","dataToHeapify","_j","_len","_upHeap","removeMin","_downHeap","peekMin","valueHolder","smallerChildIndex","valuesToAdd","currentNode","_adjust","nodeToAdd","_ref2","valueToReturn","startingPosition","SPECIAL_TYPE_KEY_PREFIX","_extractDataType","_isSpecialType","objectToMap","_itemId","_id","_newMapId","_mapIdTracker","makeHash","propertyForMap","hashedKey","simpleHashableTypes","simpleType","initialArray","_dequeueIndex","itemToDequeue","BLACK","NODE_FOUND","NODE_TOO_BIG","NODE_TOO_SMALL","RED","STOP_SEARCHING","_findNode","_grandParentOf","_isLeft","_leftOrRight","_peekMaxNode","_peekMinNode","_siblingOf","_uncleOf","_root","foundNode","nodeToInsert","_rotateLeft","_rotateRight","peekMax","_removeNode","removeMax","successor","_ref3","_ref4","_ref5","_ref6","_ref7","isLeaf","startingNode","comparisonResult","WORD_END","_hasAtLeastNChildren","longestPrefixOf","wordsWithPrefix","accumulatedLetters","subNode","childCount","projHelper","ProjHelper","initMarkerArrays","ge","gm","lcH","lcU","mt","twoPi","usual","highlighted","HYBRID","SATELLITE","TERRAIN","markerListenerRefs","listenerRefs","markerChangeListener","positionChanged","spiderfying","unspiderfying","listenerRef","arrIndexOf","len2","generatePtsCircle","centerPt","angle","angleStep","circumference","legLength","generatePtsSpiral","pt","mPt","markerPt","markerSpiderfied","nDist","nearbyMarkerData","nonNearbyMarkers","pxSq","getStreetView","getMapTypeId","llToPt","ptDistanceSq","firstOnly","usualPosition","i1","i2","len3","m1","m1Data","m2","m2Data","mData","willSpiderfy","makeHighlightListenerFuncs","highlight","leg","unhighlight","markerData","bodyPt","footLl","footPt","footPts","highlightListenerFuncs","nearestMarkerDatum","numFeet","spiderfiedMarkers","ptAverage","ptToLl","minExtract","hightlightListeners","spiderfied","markerNotToMove","unspiderfiedMarkers","pt1","pt2","pts","numPts","sumX","sumY","ll","bestIndex","bestVal","OverlappingMarkerSpiderfier","initializeGoogleMaps","__extends","NgMapCluster","_super","oldMarker","lon","_ms","Slick","dataSettings","accessibility","adaptiveHeight","appendArrows","appendDots","arrows","asNavFor","prevArrow","nextArrow","autoplay","autoplaySpeed","centerMode","centerPadding","cssEase","customPaging","slider","dots","dotsClass","edgeFriction","fade","focusOnSelect","infinite","initialSlide","lazyLoad","mobileFirst","pauseOnHover","pauseOnFocus","pauseOnDotsHover","respondTo","responsive","rtl","slide","slidesPerRow","slidesToShow","slidesToScroll","swipeToSlide","touchMove","touchThreshold","useCSS","useTransform","variableWidth","vertical","verticalSwiping","waitForAnimate","initials","animating","autoPlayTimer","currentDirection","currentLeft","currentSlide","$dots","listWidth","listHeight","loadIndex","$nextArrow","$prevArrow","slideCount","slideWidth","$slideTrack","$slides","sliding","slideOffset","swipeLeft","$list","touchObject","transformsEnabled","unslicked","activeBreakpoint","animType","animProp","breakpointSettings","cssTransitions","focussed","interrupted","paused","positionProp","shouldClick","$slider","$slidesCache","transformType","transitionType","visibilityChange","windowWidth","windowTimer","mozHidden","webkitHidden","autoPlay","autoPlayClear","autoPlayIterator","changeSlide","clickHandler","selectHandler","swipeHandler","dragHandler","keyHandler","instanceUid","htmlExpr","registerBreakpoints","activateADA","addSlide","slickAdd","markup","addBefore","unload","reinit","animateHeight","animateSlide","animProps","animStart","applyTransition","disableTransition","getNavTarget","slick","slideHandler","slideTo","buildArrows","buildDots","getDotCount","buildOut","setupInfinite","updateDots","setSlideClasses","buildRows","newSlides","numOfSlides","originalSlides","slidesPerSection","checkResponsive","forceUpdate","breakpoint","targetBreakpoint","respondToWidth","triggerBreakpoint","sliderWidth","unslick","dontAnimate","indexOffset","unevenOffset","$target","checkNavigable","navigables","prevNavigable","getNavigableIndexes","cleanUpEvents","interrupt","cleanUpSlideEvents","orientationChange","resize","cleanUpRows","fadeSlide","slideIndex","fadeSlideOut","filterSlides","slickFilter","$sf","getCurrent","slickCurrentSlide","breakPoint","pagerQty","verticalHeight","targetSlide","verticalOffset","slickGetOption","getSlick","getSlideCount","slidesTraversed","swipedSlide","centerOffset","goTo","slickGoTo","creation","setProps","startLoad","loadSlider","initializeEvents","updateArrows","initADA","aria-describedby","aria-controls","initArrowEvents","initDotEvents","initSlideEvents","initUI","loadImages","imagesScope","imageSource","imageToLoad","loadRange","cloneRange","rangeStart","rangeEnd","progressiveLazyLoad","slickNext","slickPause","play","slickPlay","postSlide","slickPrev","tryCount","$imgsToLoad","lastVisibleIndex","currentBreakpoint","responsiveSettings","windowDelay","removeSlide","slickRemove","removeBefore","setCSS","positionProps","setDimensions","setFade","setOption","slickSetOption","WebkitTransition","MozTransition","msTransition","OTransform","perspectiveProperty","webkitPerspective","MozPerspective","msTransform","allSlides","infiniteCount","animSlide","oldSlide","slideLeft","navTarget","swipeDirection","xDist","yDist","swipeAngle","curX","curY","swipeEnd","swipeLength","edgeHit","minSwipe","fingerCount","swipeStart","swipeMove","positionOffset","unfilterSlides","slickUnfilter","fromBreakpoint","slickCarouselConfig","slickMethodList","slickEventList","initOptions","destroyAndInit","slickness","internalControl","afterChange","nextSlide","beforeChange","reInit","edge","lazyLoaded","lazyLoadError","storageType","expiry","setItem","setPrefix","setStorageType","setStorageCookie","setStorageCookieDomain","domain","setNotify","itemSet","itemRemove","webStorage","deriveQualifiedKey","browserSupportsLocalStorage","addToLocalStorage","newvalue","addToCookies","getFromLocalStorage","getFromCookies","removeFromLocalStorage","removeFromCookies","getKeysForLocalStorage","prefixLength","Description","clearAllFromLocalStorage","regularExpression","prefixRegex","testRegex","clearAllFromCookies","browserSupportsCookies","cookieEnabled","daysToExpiry","expiryDate","cookieDomain","setTime","toGMTString","cookiePath","cookies","thisCookie","storedValues","getStorageType","bindToScope","lsKey","lengthOfLocalStorage","isSupported","clearAll","deriveKey"],"mappings":";;;;;;;;;;;;;CAcC,SAAUA,EAAQC,GAEK,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAQhDD,OAAOC,QAAUH,EAAOI,SACvBH,EAASD,GAAQ,GACjB,SAAUK,GACT,IAAMA,EAAED,SACP,KAAM,IAAIE,OAAO,2CAElB,OAAOL,GAASI,IAGlBJ,EAASD,IAIS,mBAAXO,QAAyBA,OAASC,KAAM,SAAUD,EAAQE,GA+enE,QAASC,GAAaC,GAMrB,GAAIC,GAAS,UAAYD,IAAOA,EAAIC,OACnCC,EAAOC,EAAOD,KAAMF,EAErB,OAAc,aAATE,GAAuBC,EAAOC,SAAUJ,IACrC,EAGc,IAAjBA,EAAIK,UAAkBJ,GACnB,EAGQ,UAATC,GAA+B,IAAXD,GACR,gBAAXA,IAAuBA,EAAS,GAAOA,EAAS,IAAOD,GAmiEhE,QAASM,GAAQC,EAAUC,EAAWC,GACrC,GAAKN,EAAOO,WAAYF,GACvB,MAAOL,GAAOQ,KAAMJ,EAAU,SAAUK,EAAMC,GAE7C,QAASL,EAAUM,KAAMF,EAAMC,EAAGD,KAAWH,GAK/C,IAAKD,EAAUH,SACd,MAAOF,GAAOQ,KAAMJ,EAAU,SAAUK,GACvC,MAASA,KAASJ,IAAgBC,GAKpC,IAA0B,gBAAdD,GAAyB,CACpC,GAAKO,GAAUC,KAAMR,GACpB,MAAOL,GAAOc,OAAQT,EAAWD,EAAUE,EAG5CD,GAAYL,EAAOc,OAAQT,EAAWD,GAGvC,MAAOJ,GAAOQ,KAAMJ,EAAU,SAAUK,GACvC,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,EAAQurH,EACCxuF,EAAS/8B,IAAU+8B,EAASwuF,KACrCvrH,EAAQjD,EAAOiD,EAAOurH,IAGxBp3E,EAAOr6C,GAAKg8D,OAAO3uB,EAAOnnC,GAEnBmnC,EAAM/G,OAAOtmC,EAAK,SAAS0lD,GAChCu5Q,EAAkB4B,EAAOn7Q,IACxBziB,EAASoK,EAAMrtC,MAKhB8gU,EAAuB,WAGzB,IAAI,GAFAp4S,GAAQ,EACRimN,EAAUhzL,EAAQwiR,GACdhgU,EAAI,EAAGA,EAAIwwO,EAAQpxO,OAAQY,IACK,IAAnCwwO,EAAQ3uO,IAAI7B,GAAGK,QAAQqR,IACxB6Y,GAGJ,OAAOA,GAGT,QACEq4S,YAAa/B,EACb2B,eAAgBA,EAChB//T,IAAKq+T,EACLj8T,IAAKi8T,EACLr/T,IAAKw/T,EACLzpT,KAAM6pT,EACNh1T,OAAQ80T,EACR0B,SAAUrB,EACVrmS,KAAMsnS,EACNK,UAAWlC,EACXxhU,OAAQujU,EACR3/O,QACE4/O,YAAaf,EACbp/T,IAAKu+T,EACLn8T,IAAKm8T,EACLv/T,IAAKy/T,EACL70T,OAAQ+0T,EACRyB,SAAUjB,SAKnB7iU,OAAQA,OAAOuwC","file":"scripts/vendor-98c4244edb.js","sourcesContent":["/*!\n * jQuery JavaScript Library v2.1.4\n * http://jquery.com/\n *\n * Includes Sizzle.js\n * http://sizzlejs.com/\n *\n * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2015-04-28T16:01Z\n */\n\n(function( global, factory ) {\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n}(typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Support: Firefox 18+\n// Can't be in strict mode, several libs including ASP.NET trace\n// the stack via arguments.caller.callee and Firefox dies if\n// you try to trace through \"use strict\" call chains. (#13335)\n//\n\nvar arr = [];\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar support = {};\n\n\n\nvar\n\t// Use the correct document accordingly with window argument (sandbox)\n\tdocument = window.document,\n\n\tversion = \"2.1.4\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t},\n\n\t// Support: Android<4.1\n\t// Make sure we trim BOM and NBSP\n\trtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\n\n\t// Matches dashed string for camelizing\n\trmsPrefix = /^-ms-/,\n\trdashAlpha = /-([\\da-z])/gi,\n\n\t// Used by jQuery.camelCase as callback to replace()\n\tfcamelCase = function( all, letter ) {\n\t\treturn letter.toUpperCase();\n\t};\n\njQuery.fn = jQuery.prototype = {\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// Start with an empty selector\n\tselector: \"\",\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\t\treturn num != null ?\n\n\t\t\t// Return just the one element from the set\n\t\t\t( num < 0 ? this[ num + this.length ] : this[ num ] ) :\n\n\t\t\t// Return all the elements in a clean array\n\t\t\tslice.call( this );\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\t\tret.context = this.context;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\t// (You can seed the arguments with an array of args, but this is\n\t// only used internally.)\n\teach: function( callback, args ) {\n\t\treturn jQuery.each( this, callback, args );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map(this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t}));\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor(null);\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !jQuery.isFunction(target) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\t\t// Only deal with non-null/undefined values\n\t\tif ( (options = arguments[ i ]) != null ) {\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tsrc = target[ name ];\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {\n\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\tclone = src && jQuery.isArray(src) ? src : [];\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src && jQuery.isPlainObject(src) ? src : {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend({\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisFunction: function( obj ) {\n\t\treturn jQuery.type(obj) === \"function\";\n\t},\n\n\tisArray: Array.isArray,\n\n\tisWindow: function( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t},\n\n\tisNumeric: function( obj ) {\n\t\t// parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t// adding 1 corrects loss of precision from parseFloat (#15100)\n\t\treturn !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;\n\t},\n\n\tisPlainObject: function( obj ) {\n\t\t// Not plain objects:\n\t\t// - Any object or value whose internal [[Class]] property is not \"[object Object]\"\n\t\t// - DOM nodes\n\t\t// - window\n\t\tif ( jQuery.type( obj ) !== \"object\" || obj.nodeType || jQuery.isWindow( obj ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( obj.constructor &&\n\t\t\t\t!hasOwn.call( obj.constructor.prototype, \"isPrototypeOf\" ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the function hasn't returned already, we're confident that\n\t\t// |obj| is a plain object, created by {} or constructed with new Object\n\t\treturn true;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\ttype: function( obj ) {\n\t\tif ( obj == null ) {\n\t\t\treturn obj + \"\";\n\t\t}\n\t\t// Support: Android<4.0, iOS<6 (functionish RegExp)\n\t\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\t\tclass2type[ toString.call(obj) ] || \"object\" :\n\t\t\ttypeof obj;\n\t},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code ) {\n\t\tvar script,\n\t\t\tindirect = eval;\n\n\t\tcode = jQuery.trim( code );\n\n\t\tif ( code ) {\n\t\t\t// If the code includes a valid, prologue position\n\t\t\t// strict mode pragma, execute code by injecting a\n\t\t\t// script tag into the document.\n\t\t\tif ( code.indexOf(\"use strict\") === 1 ) {\n\t\t\t\tscript = document.createElement(\"script\");\n\t\t\t\tscript.text = code;\n\t\t\t\tdocument.head.appendChild( script ).parentNode.removeChild( script );\n\t\t\t} else {\n\t\t\t// Otherwise, avoid the DOM node creation, insertion\n\t\t\t// and removal by using an indirect global eval\n\t\t\t\tindirect( code );\n\t\t\t}\n\t\t}\n\t},\n\n\t// Convert dashed to camelCase; used by the css and data modules\n\t// Support: IE9-11+\n\t// Microsoft forgot to hump their vendor prefix (#9572)\n\tcamelCase: function( string ) {\n\t\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n\t},\n\n\tnodeName: function( elem, name ) {\n\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\t},\n\n\t// args is for internal usage only\n\teach: function( obj, callback, args ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = obj.length,\n\t\t\tisArray = isArraylike( obj );\n\n\t\tif ( args ) {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.apply( obj[ i ], args );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// A special, fast, case for the most common use of each\n\t\t} else {\n\t\t\tif ( isArray ) {\n\t\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( i in obj ) {\n\t\t\t\t\tvalue = callback.call( obj[ i ], i, obj[ i ] );\n\n\t\t\t\t\tif ( value === false ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// Support: Android<4.1\n\ttrim: function( text ) {\n\t\treturn text == null ?\n\t\t\t\"\" :\n\t\t\t( text + \"\" ).replace( rtrim, \"\" );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArraylike( Object(arr) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar value,\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tisArray = isArraylike( elems ),\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArray ) {\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// Bind a function to a context, optionally partially applying any\n\t// arguments.\n\tproxy: function( fn, context ) {\n\t\tvar tmp, args, proxy;\n\n\t\tif ( typeof context === \"string\" ) {\n\t\t\ttmp = fn[ context ];\n\t\t\tcontext = fn;\n\t\t\tfn = tmp;\n\t\t}\n\n\t\t// Quick check to determine if target is callable, in the spec\n\t\t// this throws a TypeError, but we will just return undefined.\n\t\tif ( !jQuery.isFunction( fn ) ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Simulated bind\n\t\targs = slice.call( arguments, 2 );\n\t\tproxy = function() {\n\t\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t\t};\n\n\t\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\t\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\t\treturn proxy;\n\t},\n\n\tnow: Date.now,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n});\n\n// Populate the class2type map\njQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function(i, name) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n});\n\nfunction isArraylike( obj ) {\n\n\t// Support: iOS 8.2 (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = \"length\" in obj && obj.length,\n\t\ttype = jQuery.type( obj );\n\n\tif ( type === \"function\" || jQuery.isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\tif ( obj.nodeType === 1 && length ) {\n\t\treturn true;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.2.0-pre\n * http://sizzlejs.com/\n *\n * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n *\n * Date: 2014-12-16\n */\n(function( window ) {\n\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// General-purpose constants\n\tMAX_NEGATIVE = 1 << 31,\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf as it's faster than native\n\t// http://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\t// http://www.w3.org/TR/css3-syntax/#characters\n\tcharacterEncoding = \"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",\n\n\t// Loosely modeled on CSS identifier characters\n\t// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors\n\t// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = characterEncoding.replace( \"w\", \"w#\" ),\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + characterEncoding + \")(?:\" + whitespace +\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n\t\t\"*\\\\]\",\n\n\tpseudos = \":(\" + characterEncoding + \")(?:\\\\((\" +\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\n\trattributeQuotes = new RegExp( \"=\" + whitespace + \"*([^\\\\]'\\\"]*?)\" + whitespace + \"*\\\\]\", \"g\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + characterEncoding + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + characterEncoding + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + characterEncoding.replace( \"w\", \"w*\" ) + \")\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\trescape = /'|\\\\/g,\n\n\t// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox<24\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\thigh < 0 ?\n\t\t\t\t// BMP codepoint\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t};\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar match, elem, m, nodeType,\n\t\t// QSA vars\n\t\ti, groups, old, nid, newContext, newSelector;\n\n\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\n\tcontext = context || document;\n\tresults = results || [];\n\tnodeType = context.nodeType;\n\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\tif ( !seed && documentIsHTML ) {\n\n\t\t// Try to shortcut find operations when possible (e.g., not under DocumentFragment)\n\t\tif ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\t\t\t// Speed-up: Sizzle(\"#ID\")\n\t\t\tif ( (m = match[1]) ) {\n\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\telem = context.getElementById( m );\n\t\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t\t// nodes that are no longer in the document (jQuery #6963)\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Handle the case where IE, Opera, and Webkit return items\n\t\t\t\t\t\t// by name instead of ID\n\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Context is not a document\n\t\t\t\t\tif ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\n\t\t\t\t\t\tcontains( context, elem ) && elem.id === m ) {\n\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Speed-up: Sizzle(\"TAG\")\n\t\t\t} else if ( match[2] ) {\n\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\treturn results;\n\n\t\t\t// Speed-up: Sizzle(\".CLASS\")\n\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName ) {\n\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\treturn results;\n\t\t\t}\n\t\t}\n\n\t\t// QSA path\n\t\tif ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\n\t\t\tnid = old = expando;\n\t\t\tnewContext = context;\n\t\t\tnewSelector = nodeType !== 1 && selector;\n\n\t\t\t// qSA works strangely on Element-rooted queries\n\t\t\t// We can work around this by specifying an extra ID on the root\n\t\t\t// and working up from there (Thanks to Andrew Dupont for the technique)\n\t\t\t// IE 8 doesn't work on object elements\n\t\t\tif ( nodeType === 1 && context.nodeName.toLowerCase() !== \"object\" ) {\n\t\t\t\tgroups = tokenize( selector );\n\n\t\t\t\tif ( (old = context.getAttribute(\"id\")) ) {\n\t\t\t\t\tnid = old.replace( rescape, \"\\\\$&\" );\n\t\t\t\t} else {\n\t\t\t\t\tcontext.setAttribute( \"id\", nid );\n\t\t\t\t}\n\t\t\t\tnid = \"[id='\" + nid + \"'] \";\n\n\t\t\t\ti = groups.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tgroups[i] = nid + toSelector( groups[i] );\n\t\t\t\t}\n\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;\n\t\t\t\tnewSelector = groups.join(\",\");\n\t\t\t}\n\n\t\t\tif ( newSelector ) {\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch(qsaError) {\n\t\t\t\t} finally {\n\t\t\t\t\tif ( !old ) {\n\t\t\t\t\t\tcontext.removeAttribute(\"id\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {Function(string, Object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key + \" \" ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created div and expects a boolean result\n */\nfunction assert( fn ) {\n\tvar div = document.createElement(\"div\");\n\n\ttry {\n\t\treturn !!fn( div );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( div.parentNode ) {\n\t\t\tdiv.parentNode.removeChild( div );\n\t\t}\n\t\t// release memory in IE\n\t\tdiv = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = attrs.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\t( ~b.sourceIndex || MAX_NEGATIVE ) -\n\t\t\t( ~a.sourceIndex || MAX_NEGATIVE );\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\t// documentElement is verified for cases where it doesn't yet exist\n\t// (such as loading iframes in IE - #4833)\n\tvar documentElement = elem && (elem.ownerDocument || elem).documentElement;\n\treturn documentElement ? documentElement.nodeName !== \"HTML\" : false;\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, parent,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// If no document and documentElement is available, return\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Set our document\n\tdocument = doc;\n\tdocElem = doc.documentElement;\n\tparent = doc.defaultView;\n\n\t// Support: IE>8\n\t// If iframe document is assigned to \"document\" variable and if iframe has been reloaded,\n\t// IE will throw \"permission denied\" error when accessing \"document\" variable, see jQuery #13936\n\t// IE6-8 do not support the defaultView property so parent will be undefined\n\tif ( parent && parent !== parent.top ) {\n\t\t// IE11 does not have attachEvent, so all must suffer\n\t\tif ( parent.addEventListener ) {\n\t\t\tparent.addEventListener( \"unload\", unloadHandler, false );\n\t\t} else if ( parent.attachEvent ) {\n\t\t\tparent.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t/* Support tests\n\t---------------------------------------------------------------------- */\n\tdocumentIsHTML = !isXML( doc );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert(function( div ) {\n\t\tdiv.className = \"i\";\n\t\treturn !div.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( div ) {\n\t\tdiv.appendChild( doc.createComment(\"\") );\n\t\treturn !div.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( doc.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( div ) {\n\t\tdocElem.appendChild( div ).id = expando;\n\t\treturn !doc.getElementsByName || !doc.getElementsByName( expando ).length;\n\t});\n\n\t// ID find and filter\n\tif ( support.getById ) {\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar m = context.getElementById( id );\n\t\t\t\t// Check parentNode to catch when Blackberry 4.6 returns\n\t\t\t\t// nodes that are no longer in the document #6963\n\t\t\t\treturn m && m.parentNode ? [ m ] : [];\n\t\t\t}\n\t\t};\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t} else {\n\t\t// Support: IE6/7\n\t\t// getElementById is not reliable as a find shortcut\n\t\tdelete Expr.find[\"ID\"];\n\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" && elem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See http://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( div ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// http://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( div ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\f]' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( div.querySelectorAll(\"[msallowcapture^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !div.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+\n\t\t\tif ( !div.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push(\"~=\");\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibing-combinator selector` fails\n\t\t\tif ( !div.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push(\".#.+[+~]\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( div ) {\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = doc.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tdiv.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( div.querySelectorAll(\"[name=d]\").length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !div.querySelectorAll(\":enabled\").length ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tdiv.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( div ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( div, \"div\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( div, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully does not implement inclusive descendent\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\tcompare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\tif ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\t\t\treturn a === doc ? -1 :\n\t\t\t\tb === doc ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn doc;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\t// Make sure that attribute selectors are quoted\n\texpr = expr.replace( rattributeQuotes, \"='$1']\" );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch (e) {}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( (node = elem[i++]) ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[3] || match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[6] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] ) {\n\t\t\t\tmatch[2] = match[4] || match[5] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, outerCache, node, diff, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\t\t\t\t\t\t\touterCache = parent[ expando ] || (parent[ expando ] = {});\n\t\t\t\t\t\t\tcache = outerCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[0] === dirruns && cache[1];\n\t\t\t\t\t\t\tdiff = cache[0] === dirruns && cache[2];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\touterCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {\n\t\t\t\t\t\t\tdiff = cache[1];\n\n\t\t\t\t\t\t// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\tif ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {\n\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[0] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": function( elem ) {\n\t\t\treturn elem.disabled === false;\n\t\t},\n\n\t\t\"disabled\": function( elem ) {\n\t\t\treturn elem.disabled === true;\n\t\t},\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( (tokens = []) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tcheckNonElements = base && dir === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\t\t\t\t\t\tif ( (oldCache = outerCache[ dir ]) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn (newCache[ 2 ] = oldCache[ 2 ]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\touterCache[ dir ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context !== document && context;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Keep `i` a string if there are no elements so `matchedCount` will be \"00\" below\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\tmatchedCount += i;\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( (selector = compiled.selector || selector) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is no seed and only one group\n\tif ( match.length === 1 ) {\n\n\t\t// Take a shortcut and set the context if the root selector is an ID\n\t\ttokens = match[0] = match[0].slice( 0 );\n\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\tsupport.getById && context.nodeType === 9 && documentIsHTML &&\n\t\t\t\tExpr.relative[ tokens[1].type ] ) {\n\n\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[i];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( (seed = find(\n\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n\t\t\t\t)) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\trsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( div1 ) {\n\t// Should return 1, but returns 4 (following)\n\treturn div1.compareDocumentPosition( document.createElement(\"div\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( div ) {\n\tdiv.innerHTML = \"<a href='#'></a>\";\n\treturn div.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( div ) {\n\tdiv.innerHTML = \"<input/>\";\n\tdiv.firstChild.setAttribute( \"value\", \"\" );\n\treturn div.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( div ) {\n\treturn div.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\tnull;\n\t\t}\n\t});\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\njQuery.expr[\":\"] = jQuery.expr.pseudos;\njQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\n\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\nvar rsingleTag = (/^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/);\n\n\n\nvar risSimple = /^.[^:#\\[\\.,]*$/;\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( jQuery.isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\t/* jshint -W018 */\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t});\n\n\t}\n\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t});\n\n\t}\n\n\tif ( typeof qualifier === \"string\" ) {\n\t\tif ( risSimple.test( qualifier ) ) {\n\t\t\treturn jQuery.filter( qualifier, elements, not );\n\t\t}\n\n\t\tqualifier = jQuery.filter( qualifier, elements );\n\t}\n\n\treturn jQuery.grep( elements, function( elem ) {\n\t\treturn ( indexOf.call( qualifier, elem ) >= 0 ) !== not;\n\t});\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\treturn elems.length === 1 && elem.nodeType === 1 ?\n\t\tjQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :\n\t\tjQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\t\treturn elem.nodeType === 1;\n\t\t}));\n};\n\njQuery.fn.extend({\n\tfind: function( selector ) {\n\t\tvar i,\n\t\t\tlen = this.length,\n\t\t\tret = [],\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter(function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}) );\n\t\t}\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\t// Needed because $( selector, context ) becomes $( context ).find( selector )\n\t\tret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );\n\t\tret.selector = this.selector ? this.selector + \" \" + selector : selector;\n\t\treturn ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], false) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow(this, selector || [], true) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n});\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\n\n\tinit = jQuery.fn.init = function( selector, context ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[0] === \"<\" && selector[ selector.length - 1 ] === \">\" && selector.length >= 3 ) {\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && (match[1] || !context) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[1] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[0] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[1],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( jQuery.isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[2] );\n\n\t\t\t\t\t// Support: Blackberry 4.6\n\t\t\t\t\t// gEBID returns nodes no longer in the document (#6963)\n\t\t\t\t\tif ( elem && elem.parentNode ) {\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t\tthis[0] = elem;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.context = document;\n\t\t\t\t\tthis.selector = selector;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || rootjQuery ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis.context = this[0] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( jQuery.isFunction( selector ) ) {\n\t\t\treturn typeof rootjQuery.ready !== \"undefined\" ?\n\t\t\t\trootjQuery.ready( selector ) :\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\tif ( selector.selector !== undefined ) {\n\t\t\tthis.selector = selector.selector;\n\t\t\tthis.context = selector.context;\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.extend({\n\tdir: function( elem, dir, until ) {\n\t\tvar matched = [],\n\t\t\ttruncate = until !== undefined;\n\n\t\twhile ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmatched.push( elem );\n\t\t\t}\n\t\t}\n\t\treturn matched;\n\t},\n\n\tsibling: function( n, elem ) {\n\t\tvar matched = [];\n\n\t\tfor ( ; n; n = n.nextSibling ) {\n\t\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\t\tmatched.push( n );\n\t\t\t}\n\t\t}\n\n\t\treturn matched;\n\t}\n});\n\njQuery.fn.extend({\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter(function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[i] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\tpos = rneedsContext.test( selectors ) || typeof selectors !== \"string\" ?\n\t\t\t\tjQuery( selectors, context || this.context ) :\n\t\t\t\t0;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tfor ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {\n\t\t\t\t// Always skip document fragments\n\t\t\t\tif ( cur.nodeType < 11 && (pos ?\n\t\t\t\t\tpos.index(cur) > -1 :\n\n\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\tjQuery.find.matchesSelector(cur, selectors)) ) {\n\n\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.unique(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter(selector)\n\t\t);\n\t}\n});\n\nfunction sibling( cur, dir ) {\n\twhile ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each({\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn jQuery.dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn jQuery.dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn jQuery.sibling( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\treturn elem.contentDocument || jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.unique( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n});\nvar rnotwhite = (/\\S+/g);\n\n\n\n// String to Object options format cache\nvar optionsCache = {};\n\n// Convert String-formatted options into Object-formatted ones and store in cache\nfunction createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tjQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\t( optionsCache[ options ] || createOptions( options ) ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Last fire value (for non-forgettable lists)\n\t\tmemory,\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\t\t// Flag to know if list is currently firing\n\t\tfiring,\n\t\t// First callback to fire (used internally by add and fireWith)\n\t\tfiringStart,\n\t\t// End of the loop when firing\n\t\tfiringLength,\n\t\t// Index of currently firing callback (modified by remove if needed)\n\t\tfiringIndex,\n\t\t// Actual callback list\n\t\tlist = [],\n\t\t// Stack of fire calls for repeatable lists\n\t\tstack = !options.once && [],\n\t\t// Fire callbacks\n\t\tfire = function( data ) {\n\t\t\tmemory = options.memory && data;\n\t\t\tfired = true;\n\t\t\tfiringIndex = firingStart || 0;\n\t\t\tfiringStart = 0;\n\t\t\tfiringLength = list.length;\n\t\t\tfiring = true;\n\t\t\tfor ( ; list && firingIndex < firingLength; firingIndex++ ) {\n\t\t\t\tif ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {\n\t\t\t\t\tmemory = false; // To prevent further calls using add\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiring = false;\n\t\t\tif ( list ) {\n\t\t\t\tif ( stack ) {\n\t\t\t\t\tif ( stack.length ) {\n\t\t\t\t\t\tfire( stack.shift() );\n\t\t\t\t\t}\n\t\t\t\t} else if ( memory ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t} else {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Actual Callbacks object\n\t\tself = {\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\t// First, we save the current length\n\t\t\t\t\tvar start = list.length;\n\t\t\t\t\t(function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tvar type = jQuery.type( arg );\n\t\t\t\t\t\t\tif ( type === \"function\" ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && type !== \"string\" ) {\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t})( arguments );\n\t\t\t\t\t// Do we need to add the callbacks to the\n\t\t\t\t\t// current firing batch?\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tfiringLength = list.length;\n\t\t\t\t\t// With memory, if we're not firing then\n\t\t\t\t\t// we should call right away\n\t\t\t\t\t} else if ( memory ) {\n\t\t\t\t\t\tfiringStart = start;\n\t\t\t\t\t\tfire( memory );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\t\tvar index;\n\t\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\t\tlist.splice( index, 1 );\n\t\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\t\t\tif ( index <= firingLength ) {\n\t\t\t\t\t\t\t\t\tfiringLength--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );\n\t\t\t},\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tlist = [];\n\t\t\t\tfiringLength = 0;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Have the list do nothing anymore\n\t\t\tdisable: function() {\n\t\t\t\tlist = stack = memory = undefined;\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it disabled?\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\t\t\t// Lock the list in its current state\n\t\t\tlock: function() {\n\t\t\t\tstack = undefined;\n\t\t\t\tif ( !memory ) {\n\t\t\t\t\tself.disable();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Is it locked?\n\t\t\tlocked: function() {\n\t\t\t\treturn !stack;\n\t\t\t},\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( list && ( !fired || stack ) ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tif ( firing ) {\n\t\t\t\t\t\tstack.push( args );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfire( args );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ]\n\t\t\tdeferred[ tuple[0] ] = function() {\n\t\t\t\tdeferred[ tuple[0] + \"With\" ]( this === deferred ? promise : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// Add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n\n\n// The deferred used on DOM ready\nvar readyList;\n\njQuery.fn.ready = function( fn ) {\n\t// Add the callback\n\tjQuery.ready.promise().done( fn );\n\n\treturn this;\n};\n\njQuery.extend({\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Hold (or release) the ready event\n\tholdReady: function( hold ) {\n\t\tif ( hold ) {\n\t\t\tjQuery.readyWait++;\n\t\t} else {\n\t\t\tjQuery.ready( true );\n\t\t}\n\t},\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\n\t\t// Trigger any bound ready events\n\t\tif ( jQuery.fn.triggerHandler ) {\n\t\t\tjQuery( document ).triggerHandler( \"ready\" );\n\t\t\tjQuery( document ).off( \"ready\" );\n\t\t}\n\t}\n});\n\n/**\n * The ready event handler and self cleanup method\n */\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n\twindow.removeEventListener( \"load\", completed, false );\n\tjQuery.ready();\n}\n\njQuery.ready.promise = function( obj ) {\n\tif ( !readyList ) {\n\n\t\treadyList = jQuery.Deferred();\n\n\t\t// Catch cases where $(document).ready() is called after the browser event has already occurred.\n\t\t// We once tried to use readyState \"interactive\" here, but it caused issues like the one\n\t\t// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\n\t\tif ( document.readyState === \"complete\" ) {\n\t\t\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\t\t\tsetTimeout( jQuery.ready );\n\n\t\t} else {\n\n\t\t\t// Use the handy event callback\n\t\t\tdocument.addEventListener( \"DOMContentLoaded\", completed, false );\n\n\t\t\t// A fallback to window.onload, that will always work\n\t\t\twindow.addEventListener( \"load\", completed, false );\n\t\t}\n\t}\n\treturn readyList.promise( obj );\n};\n\n// Kick off the DOM ready check even if the user does not\njQuery.ready.promise();\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( jQuery.type( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\tjQuery.access( elems, fn, i, key[i], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !jQuery.isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn chainable ?\n\t\telems :\n\n\t\t// Gets\n\t\tbulk ?\n\t\t\tfn.call( elems ) :\n\t\t\tlen ? fn( elems[0], key ) : emptyGet;\n};\n\n\n/**\n * Determines whether an object can have data\n */\njQuery.acceptData = function( owner ) {\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\t/* jshint -W018 */\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\nfunction Data() {\n\t// Support: Android<4,\n\t// Old WebKit does not have Object.preventExtensions/freeze method,\n\t// return new empty object instead with no [[set]] accessor\n\tObject.defineProperty( this.cache = {}, 0, {\n\t\tget: function() {\n\t\t\treturn {};\n\t\t}\n\t});\n\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\nData.accepts = jQuery.acceptData;\n\nData.prototype = {\n\tkey: function( owner ) {\n\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t// but we should not, see #8335.\n\t\t// Always return the key for a frozen object.\n\t\tif ( !Data.accepts( owner ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar descriptor = {},\n\t\t\t// Check if the owner object already has a cache key\n\t\t\tunlock = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !unlock ) {\n\t\t\tunlock = Data.uid++;\n\n\t\t\t// Secure it in a non-enumerable, non-writable property\n\t\t\ttry {\n\t\t\t\tdescriptor[ this.expando ] = { value: unlock };\n\t\t\t\tObject.defineProperties( owner, descriptor );\n\n\t\t\t// Support: Android<4\n\t\t\t// Fallback to a less secure definition\n\t\t\t} catch ( e ) {\n\t\t\t\tdescriptor[ this.expando ] = unlock;\n\t\t\t\tjQuery.extend( owner, descriptor );\n\t\t\t}\n\t\t}\n\n\t\t// Ensure the cache object\n\t\tif ( !this.cache[ unlock ] ) {\n\t\t\tthis.cache[ unlock ] = {};\n\t\t}\n\n\t\treturn unlock;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\t// There may be an unlock assigned to this node,\n\t\t\t// if there is no entry for this \"owner\", create one inline\n\t\t\t// and set the unlock as though an owner entry had always existed\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\t// Handle: [ owner, key, value ] args\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ data ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\t\t\t// Fresh assignments by object are shallow copied\n\t\t\tif ( jQuery.isEmptyObject( cache ) ) {\n\t\t\t\tjQuery.extend( this.cache[ unlock ], data );\n\t\t\t// Otherwise, copy the properties one-by-one to the cache object\n\t\t\t} else {\n\t\t\t\tfor ( prop in data ) {\n\t\t\t\t\tcache[ prop ] = data[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\t// Either a valid cache is found, or will be created.\n\t\t// New caches will be created and the unlock returned,\n\t\t// allowing direct access to the newly created\n\t\t// empty data object. A valid owner object must be provided.\n\t\tvar cache = this.cache[ this.key( owner ) ];\n\n\t\treturn key === undefined ?\n\t\t\tcache : cache[ key ];\n\t},\n\taccess: function( owner, key, value ) {\n\t\tvar stored;\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t((key && typeof key === \"string\") && value === undefined) ) {\n\n\t\t\tstored = this.get( owner, key );\n\n\t\t\treturn stored !== undefined ?\n\t\t\t\tstored : this.get( owner, jQuery.camelCase(key) );\n\t\t}\n\n\t\t// [*]When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i, name, camel,\n\t\t\tunlock = this.key( owner ),\n\t\t\tcache = this.cache[ unlock ];\n\n\t\tif ( key === undefined ) {\n\t\t\tthis.cache[ unlock ] = {};\n\n\t\t} else {\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( jQuery.isArray( key ) ) {\n\t\t\t\t// If \"name\" is an array of keys...\n\t\t\t\t// When data is initially created, via (\"key\", \"val\") signature,\n\t\t\t\t// keys will be converted to camelCase.\n\t\t\t\t// Since there is no way to tell _how_ a key was added, remove\n\t\t\t\t// both plain key and camelCase key. #12786\n\t\t\t\t// This will only penalize the array argument path.\n\t\t\t\tname = key.concat( key.map( jQuery.camelCase ) );\n\t\t\t} else {\n\t\t\t\tcamel = jQuery.camelCase( key );\n\t\t\t\t// Try the string as a key before any manipulation\n\t\t\t\tif ( key in cache ) {\n\t\t\t\t\tname = [ key, camel ];\n\t\t\t\t} else {\n\t\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\t\tname = camel;\n\t\t\t\t\tname = name in cache ?\n\t\t\t\t\t\t[ name ] : ( name.match( rnotwhite ) || [] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = name.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ name[ i ] ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\treturn !jQuery.isEmptyObject(\n\t\t\tthis.cache[ owner[ this.expando ] ] || {}\n\t\t);\n\t},\n\tdiscard: function( owner ) {\n\t\tif ( owner[ this.expando ] ) {\n\t\t\tdelete this.cache[ owner[ this.expando ] ];\n\t\t}\n\t}\n};\nvar data_priv = new Data();\n\nvar data_user = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /([A-Z])/g;\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$1\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = data === \"true\" ? true :\n\t\t\t\t\tdata === \"false\" ? false :\n\t\t\t\t\tdata === \"null\" ? null :\n\t\t\t\t\t// Only convert to a number if it doesn't change the string\n\t\t\t\t\t+data + \"\" === data ? +data :\n\t\t\t\t\trbrace.test( data ) ? jQuery.parseJSON( data ) :\n\t\t\t\t\tdata;\n\t\t\t} catch( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdata_user.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend({\n\thasData: function( elem ) {\n\t\treturn data_user.hasData( elem ) || data_priv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn data_user.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdata_user.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to data_priv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn data_priv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdata_priv.remove( elem, name );\n\t}\n});\n\njQuery.fn.extend({\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = data_user.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !data_priv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE11+\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = jQuery.camelCase( name.slice(5) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdata_priv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each(function() {\n\t\t\t\tdata_user.set( this, key );\n\t\t\t});\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data,\n\t\t\t\tcamelKey = jQuery.camelCase( key );\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key as-is\n\t\t\t\tdata = data_user.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// with the key camelized\n\t\t\t\tdata = data_user.get( elem, camelKey );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, camelKey, undefined );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each(function() {\n\t\t\t\t// First, attempt to store a copy or reference of any\n\t\t\t\t// data that might've been store with a camelCased key.\n\t\t\t\tvar data = data_user.get( this, camelKey );\n\n\t\t\t\t// For HTML5 data-* attribute interop, we have to\n\t\t\t\t// store property names with dashes in a camelCase form.\n\t\t\t\t// This might not apply to all properties...*\n\t\t\t\tdata_user.set( this, camelKey, value );\n\n\t\t\t\t// *... In the case of properties that might _actually_\n\t\t\t\t// have dashes, we need to also store a copy of that\n\t\t\t\t// unchanged property.\n\t\t\t\tif ( key.indexOf(\"-\") !== -1 && data !== undefined ) {\n\t\t\t\t\tdata_user.set( this, key, value );\n\t\t\t\t}\n\t\t\t});\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each(function() {\n\t\t\tdata_user.remove( this, key );\n\t\t});\n\t}\n});\n\n\njQuery.extend({\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = data_priv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || jQuery.isArray( data ) ) {\n\t\t\t\t\tqueue = data_priv.access( elem, type, jQuery.makeArray(data) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn data_priv.get( elem, key ) || data_priv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks(\"once memory\").add(function() {\n\t\t\t\tdata_priv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t})\n\t\t});\n\t}\n});\n\njQuery.fn.extend({\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[0], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each(function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[0] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t});\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t});\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = data_priv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n});\nvar pnum = (/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/).source;\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar isHidden = function( elem, el ) {\n\t\t// isHidden might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\t\treturn jQuery.css( elem, \"display\" ) === \"none\" || !jQuery.contains( elem.ownerDocument, elem );\n\t};\n\nvar rcheckableType = (/^(?:checkbox|radio)$/i);\n\n\n\n(function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Safari<=5.1\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Safari<=5.1, Android<4.2\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE<=11+\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n})();\nvar strundefined = typeof undefined;\n\n\n\nsupport.focusinBubbles = \"onfocusin\" in window;\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,\n\trfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !(events = elemData.events) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !(eventHandle = elemData.handle) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnotwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend({\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join(\".\")\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !(handlers = events[ type ]) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle, false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = data_priv.hasData( elem ) && data_priv.get( elem );\n\n\t\tif ( !elemData || !(events = elemData.events) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnotwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[t] ) || [];\n\t\t\ttype = origType = tmp[1];\n\t\t\tnamespaces = ( tmp[2] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[2] && new RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdelete elemData.handle;\n\t\t\tdata_priv.remove( elem, \"events\" );\n\t\t}\n\t},\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split(\".\") : [];\n\n\t\tcur = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf(\".\") >= 0 ) {\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split(\".\");\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf(\":\") < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join(\".\");\n\t\tevent.namespace_re = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === (elem.ownerDocument || document) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {\n\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( data_priv.get( cur, \"events\" ) || {} )[ event.type ] && data_priv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && jQuery.acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&\n\t\t\t\tjQuery.acceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\t\t\t\t\telem[ type ]();\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\tdispatch: function( event ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tevent = jQuery.event.fix( event );\n\n\t\tvar i, j, ret, matched, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\targs = slice.call( arguments ),\n\t\t\thandlers = ( data_priv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[0] = event;\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// Triggered event must either 1) have no namespace, or 2) have namespace(s)\n\t\t\t\t// a subset or equal to those in the bound event (both can have no namespace).\n\t\t\t\tif ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )\n\t\t\t\t\t\t\t.apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( (event.result = ret) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, matches, sel, handleObj,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\t// Black-hole SVG <use> instance trees (#13180)\n\t\t// Avoid non-left-click bubbling in Firefox (#3861)\n\t\tif ( delegateCount && cur.nodeType && (!event.button || event.type !== \"click\") ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.disabled !== true || event.type !== \"click\" ) {\n\t\t\t\t\tmatches = [];\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matches[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatches[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) >= 0 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matches[ sel ] ) {\n\t\t\t\t\t\t\tmatches.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matches.length ) {\n\t\t\t\t\t\thandlerQueue.push({ elem: cur, handlers: matches });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\t// Includes some event props shared by KeyEvent and MouseEvent\n\tprops: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\n\n\tfixHooks: {},\n\n\tkeyHooks: {\n\t\tprops: \"char charCode key keyCode\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\n\t\t\t// Add which for key events\n\t\t\tif ( event.which == null ) {\n\t\t\t\tevent.which = original.charCode != null ? original.charCode : original.keyCode;\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tmouseHooks: {\n\t\tprops: \"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\n\t\tfilter: function( event, original ) {\n\t\t\tvar eventDoc, doc, body,\n\t\t\t\tbutton = original.button;\n\n\t\t\t// Calculate pageX/Y if missing and clientX/Y available\n\t\t\tif ( event.pageX == null && original.clientX != null ) {\n\t\t\t\teventDoc = event.target.ownerDocument || document;\n\t\t\t\tdoc = eventDoc.documentElement;\n\t\t\t\tbody = eventDoc.body;\n\n\t\t\t\tevent.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\n\t\t\t\tevent.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );\n\t\t\t}\n\n\t\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\t\t// Note: button is not normalized, so don't use it\n\t\t\tif ( !event.which && button !== undefined ) {\n\t\t\t\tevent.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\n\t\t\t}\n\n\t\t\treturn event;\n\t\t}\n\t},\n\n\tfix: function( event ) {\n\t\tif ( event[ jQuery.expando ] ) {\n\t\t\treturn event;\n\t\t}\n\n\t\t// Create a writable copy of the event object and normalize some properties\n\t\tvar i, prop, copy,\n\t\t\ttype = event.type,\n\t\t\toriginalEvent = event,\n\t\t\tfixHook = this.fixHooks[ type ];\n\n\t\tif ( !fixHook ) {\n\t\t\tthis.fixHooks[ type ] = fixHook =\n\t\t\t\trmouseEvent.test( type ) ? this.mouseHooks :\n\t\t\t\trkeyEvent.test( type ) ? this.keyHooks :\n\t\t\t\t{};\n\t\t}\n\t\tcopy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;\n\n\t\tevent = new jQuery.Event( originalEvent );\n\n\t\ti = copy.length;\n\t\twhile ( i-- ) {\n\t\t\tprop = copy[ i ];\n\t\t\tevent[ prop ] = originalEvent[ prop ];\n\t\t}\n\n\t\t// Support: Cordova 2.5 (WebKit) (#13255)\n\t\t// All events should have a target; Cordova deviceready doesn't\n\t\tif ( !event.target ) {\n\t\t\tevent.target = document;\n\t\t}\n\n\t\t// Support: Safari 6.0+, Chrome<28\n\t\t// Target should not be a text node (#504, #13143)\n\t\tif ( event.target.nodeType === 3 ) {\n\t\t\tevent.target = event.target.parentNode;\n\t\t}\n\n\t\treturn fixHook.filter ? fixHook.filter( event, originalEvent ) : event;\n\t},\n\n\tspecial: {\n\t\tload: {\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tfocus: {\n\t\t\t// Fire native event if possible so blur/focus sequence is correct\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this !== safeActiveElement() && this.focus ) {\n\t\t\t\t\tthis.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusin\"\n\t\t},\n\t\tblur: {\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this === safeActiveElement() && this.blur ) {\n\t\t\t\t\tthis.blur();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelegateType: \"focusout\"\n\t\t},\n\t\tclick: {\n\t\t\t// For checkbox, fire native event so checked state will be right\n\t\t\ttrigger: function() {\n\t\t\t\tif ( this.type === \"checkbox\" && this.click && jQuery.nodeName( this, \"input\" ) ) {\n\t\t\t\t\tthis.click();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, don't fire native .click() on links\n\t\t\t_default: function( event ) {\n\t\t\t\treturn jQuery.nodeName( event.target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tsimulate: function( type, elem, event, bubble ) {\n\t\t// Piggyback on a donor event to simulate a different one.\n\t\t// Fake originalEvent to avoid donor's stopPropagation, but if the\n\t\t// simulated event prevents default then we do the same on the donor.\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true,\n\t\t\t\toriginalEvent: {}\n\t\t\t}\n\t\t);\n\t\tif ( bubble ) {\n\t\t\tjQuery.event.trigger( e, null, elem );\n\t\t} else {\n\t\t\tjQuery.event.dispatch.call( elem, e );\n\t\t}\n\t\tif ( e.isDefaultPrevented() ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n};\n\njQuery.removeEvent = function( elem, type, handle ) {\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle, false );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\t// Allow instantiation without the 'new' keyword\n\tif ( !(this instanceof jQuery.Event) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\t\t\t\t// Support: Android<4.0\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || jQuery.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && e.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && e.stopPropagation ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && e.stopImmediatePropagation ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// Support: Chrome 15+\njQuery.each({\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mousenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || (related !== target && !jQuery.contains( target, related )) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n});\n\n// Support: Firefox, Chrome, Safari\n// Create \"bubbling\" focus and blur events\nif ( !support.focusinBubbles ) {\n\tjQuery.each({ focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );\n\t\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = data_priv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdata_priv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = data_priv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdata_priv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdata_priv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n}\n\njQuery.fn.extend({\n\n\ton: function( types, selector, data, fn, /*INTERNAL*/ one ) {\n\t\tvar origFn, type;\n\n\t\t// Types can be a map of types/handlers\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-Object, selector, data )\n\t\t\tif ( typeof selector !== \"string\" ) {\n\t\t\t\t// ( types-Object, data )\n\t\t\t\tdata = data || selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.on( type, selector, data, types[ type ], one );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( data == null && fn == null ) {\n\t\t\t// ( types, fn )\n\t\t\tfn = selector;\n\t\t\tdata = selector = undefined;\n\t\t} else if ( fn == null ) {\n\t\t\tif ( typeof selector === \"string\" ) {\n\t\t\t\t// ( types, selector, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = undefined;\n\t\t\t} else {\n\t\t\t\t// ( types, data, fn )\n\t\t\t\tfn = data;\n\t\t\t\tdata = selector;\n\t\t\t\tselector = undefined;\n\t\t\t}\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t} else if ( !fn ) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif ( one === 1 ) {\n\t\t\torigFn = fn;\n\t\t\tfn = function( event ) {\n\t\t\t\t// Can use an empty set, since event contains the info\n\t\t\t\tjQuery().off( event );\n\t\t\t\treturn origFn.apply( this, arguments );\n\t\t\t};\n\t\t\t// Use same guid so caller can remove using origFn\n\t\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.add( this, types, fn, data, selector );\n\t\t});\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn this.on( types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t});\n\t},\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t});\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[0];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n});\n\n\nvar\n\trxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,\n\trtagName = /<([\\w:]+)/,\n\trhtml = /<|&#?\\w+;/,\n\trnoInnerhtml = /<(?:script|style|link)/i,\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trscriptType = /^$|\\/(?:java|ecma)script/i,\n\trscriptTypeMasked = /^true\\/(.*)/,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,\n\n\t// We have to close these tags to support XHTML (#13200)\n\twrapMap = {\n\n\t\t// Support: IE9\n\t\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t\tthead: [ 1, \"<table>\", \"</table>\" ],\n\t\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\t\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\t\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t\t_default: [ 0, \"\", \"\" ]\n\t};\n\n// Support: IE9\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: 1.x compatibility\n// Manipulating tables requires a tbody\nfunction manipulationTarget( elem, content ) {\n\treturn jQuery.nodeName( elem, \"table\" ) &&\n\t\tjQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ?\n\n\t\telem.getElementsByTagName(\"tbody\")[0] ||\n\t\t\telem.appendChild( elem.ownerDocument.createElement(\"tbody\") ) :\n\t\telem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = (elem.getAttribute(\"type\") !== null) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tvar match = rscriptTypeMasked.exec( elem.type );\n\n\tif ( match ) {\n\t\telem.type = match[ 1 ];\n\t} else {\n\t\telem.removeAttribute(\"type\");\n\t}\n\n\treturn elem;\n}\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdata_priv.set(\n\t\t\telems[ i ], \"globalEval\", !refElements || data_priv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( data_priv.hasData( src ) ) {\n\t\tpdataOld = data_priv.access( src );\n\t\tpdataCur = data_priv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( data_user.hasData( src ) ) {\n\t\tudataOld = data_user.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdata_user.set( dest, udataCur );\n\t}\n}\n\nfunction getAll( context, tag ) {\n\tvar ret = context.getElementsByTagName ? context.getElementsByTagName( tag || \"*\" ) :\n\t\t\tcontext.querySelectorAll ? context.querySelectorAll( tag || \"*\" ) :\n\t\t\t[];\n\n\treturn tag === undefined || tag && jQuery.nodeName( context, tag ) ?\n\t\tjQuery.merge( [ context ], ret ) :\n\t\tret;\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\njQuery.extend({\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tbuildFragment: function( elems, context, scripts, selection ) {\n\t\tvar elem, tmp, tag, wrap, contains, j,\n\t\t\tfragment = context.createDocumentFragment(),\n\t\t\tnodes = [],\n\t\t\ti = 0,\n\t\t\tl = elems.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\telem = elems[ i ];\n\n\t\t\tif ( elem || elem === 0 ) {\n\n\t\t\t\t// Add nodes directly\n\t\t\t\tif ( jQuery.type( elem ) === \"object\" ) {\n\t\t\t\t\t// Support: QtWebKit, PhantomJS\n\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t\t// Convert non-html into a text node\n\t\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t\t// Convert html into DOM nodes\n\t\t\t\t} else {\n\t\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement(\"div\") );\n\n\t\t\t\t\t// Deserialize a standard representation\n\t\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\t\ttmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, \"<$1></$2>\" ) + wrap[ 2 ];\n\n\t\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\t\tj = wrap[ 0 ];\n\t\t\t\t\twhile ( j-- ) {\n\t\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: QtWebKit, PhantomJS\n\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t\t// Remember the top-level container\n\t\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\t\ttmp.textContent = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove wrapper from fragment\n\t\tfragment.textContent = \"\";\n\n\t\ti = 0;\n\t\twhile ( (elem = nodes[ i++ ]) ) {\n\n\t\t\t// #4087 - If origin and destination elements are the same, and this is\n\t\t\t// that element, do not do anything\n\t\t\tif ( selection && jQuery.inArray( elem, selection ) !== -1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcontains = jQuery.contains( elem.ownerDocument, elem );\n\n\t\t\t// Append to fragment\n\t\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t\t// Preserve script evaluation history\n\t\t\tif ( contains ) {\n\t\t\t\tsetGlobalEval( tmp );\n\t\t\t}\n\n\t\t\t// Capture executables\n\t\t\tif ( scripts ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (elem = tmp[ j++ ]) ) {\n\t\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\t\tscripts.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn fragment;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type, key,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[ i ]) !== undefined; i++ ) {\n\t\t\tif ( jQuery.acceptData( elem ) ) {\n\t\t\t\tkey = elem[ data_priv.expando ];\n\n\t\t\t\tif ( key && (data = data_priv.cache[ key ]) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( data_priv.cache[ key ] ) {\n\t\t\t\t\t\t// Discard any remaining `private` data\n\t\t\t\t\t\tdelete data_priv.cache[ key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Discard any remaining `user` data\n\t\t\tdelete data_user.cache[ elem[ data_user.expando ] ];\n\t\t}\n\t}\n});\n\njQuery.fn.extend({\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each(function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t});\n\t},\n\n\tprepend: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t});\n\t},\n\n\tbefore: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t});\n\t},\n\n\tafter: function() {\n\t\treturn this.domManip( arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t});\n\t},\n\n\tremove: function( selector, keepData /* Internal Use Only */ ) {\n\t\tvar elem,\n\t\t\telems = selector ? jQuery.filter( selector, this ) : this,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = elems[i]) != null; i++ ) {\n\t\t\tif ( !keepData && elem.nodeType === 1 ) {\n\t\t\t\tjQuery.cleanData( getAll( elem ) );\n\t\t\t}\n\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\tif ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\t\t\tsetGlobalEval( getAll( elem, \"script\" ) );\n\t\t\t\t}\n\t\t\t\telem.parentNode.removeChild( elem );\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; (elem = this[i]) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map(function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t});\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = value.replace( rxhtmlTag, \"<$1></$2>\" );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar arg = arguments[ 0 ];\n\n\t\t// Make the changes, replacing each context element with the new content\n\t\tthis.domManip( arguments, function( elem ) {\n\t\t\targ = this.parentNode;\n\n\t\t\tjQuery.cleanData( getAll( this ) );\n\n\t\t\tif ( arg ) {\n\t\t\t\targ.replaceChild( elem, this );\n\t\t\t}\n\t\t});\n\n\t\t// Force removal if there was no new content (e.g., from empty arguments)\n\t\treturn arg && (arg.length || arg.nodeType) ? this : this.remove();\n\t},\n\n\tdetach: function( selector ) {\n\t\treturn this.remove( selector, true );\n\t},\n\n\tdomManip: function( args, callback ) {\n\n\t\t// Flatten any nested arrays\n\t\targs = concat.apply( [], args );\n\n\t\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tset = this,\n\t\t\tiNoClone = l - 1,\n\t\t\tvalue = args[ 0 ],\n\t\t\tisFunction = jQuery.isFunction( value );\n\n\t\t// We can't cloneNode fragments that contain checked, in WebKit\n\t\tif ( isFunction ||\n\t\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\t\treturn this.each(function( index ) {\n\t\t\t\tvar self = set.eq( index );\n\t\t\t\tif ( isFunction ) {\n\t\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t\t}\n\t\t\t\tself.domManip( args, callback );\n\t\t\t});\n\t\t}\n\n\t\tif ( l ) {\n\t\t\tfragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );\n\t\t\tfirst = fragment.firstChild;\n\n\t\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\t\tfragment = first;\n\t\t\t}\n\n\t\t\tif ( first ) {\n\t\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\t\thasScripts = scripts.length;\n\n\t\t\t\t// Use the original fragment for the last item instead of the first because it can end up\n\t\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\tnode = fragment;\n\n\t\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\t\t\t// Support: QtWebKit\n\t\t\t\t\t\t\t// jQuery.merge because push.apply(_, arraylike) throws\n\t\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcallback.call( this[ i ], node, i );\n\t\t\t\t}\n\n\t\t\t\tif ( hasScripts ) {\n\t\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t\t// Reenable scripts\n\t\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t\t!data_priv.access( node, \"globalEval\" ) && jQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\t\tif ( node.src ) {\n\t\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\t\tif ( jQuery._evalUrl ) {\n\t\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.globalEval( node.textContent.replace( rcleanScript, \"\" ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n});\n\njQuery.each({\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: QtWebKit\n\t\t\t// .get() because push.apply(_, arraylike) throws\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n});\n\n\nvar iframe,\n\telemdisplay = {};\n\n/**\n * Retrieve the actual display of a element\n * @param {String} name nodeName of the element\n * @param {Object} doc Document object\n */\n// Called only from within defaultDisplay\nfunction actualDisplay( name, doc ) {\n\tvar style,\n\t\telem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),\n\n\t\t// getDefaultComputedStyle might be reliably used only on attached element\n\t\tdisplay = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?\n\n\t\t\t// Use of this method is a temporary fix (more like optimization) until something better comes along,\n\t\t\t// since it was removed from specification and supported only in FF\n\t\t\tstyle.display : jQuery.css( elem[ 0 ], \"display\" );\n\n\t// We don't have any data stored on the element,\n\t// so use \"detach\" method as fast way to get rid of the element\n\telem.detach();\n\n\treturn display;\n}\n\n/**\n * Try to determine the default display value of an element\n * @param {String} nodeName\n */\nfunction defaultDisplay( nodeName ) {\n\tvar doc = document,\n\t\tdisplay = elemdisplay[ nodeName ];\n\n\tif ( !display ) {\n\t\tdisplay = actualDisplay( nodeName, doc );\n\n\t\t// If the simple way fails, read from inside an iframe\n\t\tif ( display === \"none\" || !display ) {\n\n\t\t\t// Use the already-created iframe if possible\n\t\t\tiframe = (iframe || jQuery( \"<iframe frameborder='0' width='0' height='0'/>\" )).appendTo( doc.documentElement );\n\n\t\t\t// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse\n\t\t\tdoc = iframe[ 0 ].contentDocument;\n\n\t\t\t// Support: IE\n\t\t\tdoc.write();\n\t\t\tdoc.close();\n\n\t\t\tdisplay = actualDisplay( nodeName, doc );\n\t\t\tiframe.detach();\n\t\t}\n\n\t\t// Store the correct default display\n\t\telemdisplay[ nodeName ] = display;\n\t}\n\n\treturn display;\n}\nvar rmargin = (/^margin/);\n\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\t\t// Support: IE<=11+, Firefox<=30+ (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tif ( elem.ownerDocument.defaultView.opener ) {\n\t\t\treturn elem.ownerDocument.defaultView.getComputedStyle( elem, null );\n\t\t}\n\n\t\treturn window.getComputedStyle( elem, null );\n\t};\n\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// Support: IE9\n\t// getPropertyValue is only needed for .css('filter') (#12537)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\t}\n\n\tif ( computed ) {\n\n\t\tif ( ret === \"\" && !jQuery.contains( elem.ownerDocument, elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// Support: iOS < 6\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels\n\t\t// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values\n\t\tif ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\t\t// Support: IE\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn (this.get = hookFn).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\n(function() {\n\tvar pixelPositionVal, boxSizingReliableVal,\n\t\tdocElem = document.documentElement,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE9-11+\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tcontainer.style.cssText = \"border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;\" +\n\t\t\"position:absolute\";\n\tcontainer.appendChild( div );\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computePixelPositionAndBoxSizingReliable() {\n\t\tdiv.style.cssText =\n\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t// Vendor-prefix box-sizing\n\t\t\t\"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;\" +\n\t\t\t\"box-sizing:border-box;display:block;margin-top:1%;top:1%;\" +\n\t\t\t\"border:1px;padding:1px;width:4px;position:absolute\";\n\t\tdiv.innerHTML = \"\";\n\t\tdocElem.appendChild( container );\n\n\t\tvar divStyle = window.getComputedStyle( div, null );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\t\tboxSizingReliableVal = divStyle.width === \"4px\";\n\n\t\tdocElem.removeChild( container );\n\t}\n\n\t// Support: node.js jsdom\n\t// Don't assume that getComputedStyle is a property of the global object\n\tif ( window.getComputedStyle ) {\n\t\tjQuery.extend( support, {\n\t\t\tpixelPosition: function() {\n\n\t\t\t\t// This test is executed only once but we still do memoizing\n\t\t\t\t// since we can use the boxSizingReliable pre-computing.\n\t\t\t\t// No need to check if the test was already performed, though.\n\t\t\t\tcomputePixelPositionAndBoxSizingReliable();\n\t\t\t\treturn pixelPositionVal;\n\t\t\t},\n\t\t\tboxSizingReliable: function() {\n\t\t\t\tif ( boxSizingReliableVal == null ) {\n\t\t\t\t\tcomputePixelPositionAndBoxSizingReliable();\n\t\t\t\t}\n\t\t\t\treturn boxSizingReliableVal;\n\t\t\t},\n\t\t\treliableMarginRight: function() {\n\n\t\t\t\t// Support: Android 2.3\n\t\t\t\t// Check if div with explicit width and no margin-right incorrectly\n\t\t\t\t// gets computed margin-right based on width of container. (#3333)\n\t\t\t\t// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right\n\t\t\t\t// This support function is only executed once so no memoizing is needed.\n\t\t\t\tvar ret,\n\t\t\t\t\tmarginDiv = div.appendChild( document.createElement( \"div\" ) );\n\n\t\t\t\t// Reset CSS: box-sizing; display; margin; border; padding\n\t\t\t\tmarginDiv.style.cssText = div.style.cssText =\n\t\t\t\t\t// Support: Firefox<29, Android 2.3\n\t\t\t\t\t// Vendor-prefix box-sizing\n\t\t\t\t\t\"-webkit-box-sizing:content-box;-moz-box-sizing:content-box;\" +\n\t\t\t\t\t\"box-sizing:content-box;display:block;margin:0;border:0;padding:0\";\n\t\t\t\tmarginDiv.style.marginRight = marginDiv.style.width = \"0\";\n\t\t\t\tdiv.style.width = \"1px\";\n\t\t\t\tdocElem.appendChild( container );\n\n\t\t\t\tret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );\n\n\t\t\t\tdocElem.removeChild( container );\n\t\t\t\tdiv.removeChild( marginDiv );\n\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t});\n\t}\n})();\n\n\n// A method for quickly swapping in/out CSS properties to get correct calculations.\njQuery.swap = function( elem, options, callback, args ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.apply( elem, args || [] );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar\n\t// Swappable if display is none or starts with table except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trnumsplit = new RegExp( \"^(\" + pnum + \")(.*)$\", \"i\" ),\n\trrelNum = new RegExp( \"^([+-])=(\" + pnum + \")\", \"i\" ),\n\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t},\n\n\tcssPrefixes = [ \"Webkit\", \"O\", \"Moz\", \"ms\" ];\n\n// Return a css property mapped to a potentially vendor prefixed property\nfunction vendorPropName( style, name ) {\n\n\t// Shortcut for names that are not vendor prefixed\n\tif ( name in style ) {\n\t\treturn name;\n\t}\n\n\t// Check for vendor prefixed names\n\tvar capName = name[0].toUpperCase() + name.slice(1),\n\t\torigName = name,\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in style ) {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\treturn origName;\n}\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\tvar matches = rnumsplit.exec( value );\n\treturn matches ?\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {\n\tvar i = extra === ( isBorderBox ? \"border\" : \"content\" ) ?\n\t\t// If we already have the right measurement, avoid augmentation\n\t\t4 :\n\t\t// Otherwise initialize for horizontal or vertical properties\n\t\tname === \"width\" ? 1 : 0,\n\n\t\tval = 0;\n\n\tfor ( ; i < 4; i += 2 ) {\n\t\t// Both box models exclude margin, so add it if we want it\n\t\tif ( extra === \"margin\" ) {\n\t\t\tval += jQuery.css( elem, extra + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\tif ( isBorderBox ) {\n\t\t\t// border-box includes padding, so remove it if we want content\n\t\t\tif ( extra === \"content\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// At this point, extra isn't border nor margin, so remove border\n\t\t\tif ( extra !== \"margin\" ) {\n\t\t\t\tval -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t} else {\n\t\t\t// At this point, extra isn't content, so add padding\n\t\t\tval += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// At this point, extra isn't content nor padding, so add border\n\t\t\tif ( extra !== \"padding\" ) {\n\t\t\t\tval += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn val;\n}\n\nfunction getWidthOrHeight( elem, name, extra ) {\n\n\t// Start with offset property, which is equivalent to the border-box value\n\tvar valueIsBorderBox = true,\n\t\tval = name === \"width\" ? elem.offsetWidth : elem.offsetHeight,\n\t\tstyles = getStyles( elem ),\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t// Some non-html elements return undefined for offsetWidth, so check for null/undefined\n\t// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285\n\t// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668\n\tif ( val <= 0 || val == null ) {\n\t\t// Fall back to computed then uncomputed css if necessary\n\t\tval = curCSS( elem, name, styles );\n\t\tif ( val < 0 || val == null ) {\n\t\t\tval = elem.style[ name ];\n\t\t}\n\n\t\t// Computed unit is not pixels. Stop here and return.\n\t\tif ( rnumnonpx.test(val) ) {\n\t\t\treturn val;\n\t\t}\n\n\t\t// Check for style in case a browser which returns unreliable values\n\t\t// for getComputedStyle silently falls back to the reliable elem.style\n\t\tvalueIsBorderBox = isBorderBox &&\n\t\t\t( support.boxSizingReliable() || val === elem.style[ name ] );\n\n\t\t// Normalize \"\", auto, and prepare for extra\n\t\tval = parseFloat( val ) || 0;\n\t}\n\n\t// Use the active box-sizing model to add/subtract irrelevant styles\n\treturn ( val +\n\t\taugmentWidthOrHeight(\n\t\t\telem,\n\t\t\tname,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles\n\t\t)\n\t) + \"px\";\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem, hidden,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvalues[ index ] = data_priv.get( elem, \"olddisplay\" );\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\t\t\t// Reset the inline display of this element to learn if it is\n\t\t\t// being hidden by cascaded rules or not\n\t\t\tif ( !values[ index ] && display === \"none\" ) {\n\t\t\t\telem.style.display = \"\";\n\t\t\t}\n\n\t\t\t// Set elements which have been overridden with display: none\n\t\t\t// in a stylesheet to whatever the default browser style is\n\t\t\t// for such an element\n\t\t\tif ( elem.style.display === \"\" && isHidden( elem ) ) {\n\t\t\t\tvalues[ index ] = data_priv.access( elem, \"olddisplay\", defaultDisplay(elem.nodeName) );\n\t\t\t}\n\t\t} else {\n\t\t\thidden = isHidden( elem );\n\n\t\t\tif ( display !== \"none\" || !hidden ) {\n\t\t\t\tdata_priv.set( elem, \"olddisplay\", hidden ? display : jQuery.css( elem, \"display\" ) );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of most of the elements in a second loop\n\t// to avoid the constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( !show || elem.style.display === \"none\" || elem.style.display === \"\" ) {\n\t\t\telem.style.display = show ? values[ index ] || \"\" : \"none\";\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.extend({\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {\n\t\t\"float\": \"cssFloat\"\n\t},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = jQuery.camelCase( name ),\n\t\t\tstyle = elem.style;\n\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && (ret = rrelNum.exec( value )) ) {\n\t\t\t\tvalue = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number, add 'px' to the (except for certain CSS properties)\n\t\t\tif ( type === \"number\" && !jQuery.cssNumber[ origName ] ) {\n\t\t\t\tvalue += \"px\";\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !(\"set\" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {\n\t\t\t\tstyle[ name ] = value;\n\t\t\t}\n\n\t\t} else {\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = jQuery.camelCase( name );\n\n\t\t// Make sure that we're working with the right name\n\t\tname = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || jQuery.isNumeric( num ) ? num || 0 : val;\n\t\t}\n\t\treturn val;\n\t}\n});\n\njQuery.each([ \"height\", \"width\" ], function( i, name ) {\n\tjQuery.cssHooks[ name ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) && elem.offsetWidth === 0 ?\n\t\t\t\t\tjQuery.swap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, name, extra );\n\t\t\t\t\t}) :\n\t\t\t\t\tgetWidthOrHeight( elem, name, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar styles = extra && getStyles( elem );\n\t\t\treturn setPositiveNumber( elem, value, extra ?\n\t\t\t\taugmentWidthOrHeight(\n\t\t\t\t\telem,\n\t\t\t\t\tname,\n\t\t\t\t\textra,\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\t\tstyles\n\t\t\t\t) : 0\n\t\t\t);\n\t\t}\n\t};\n});\n\n// Support: Android 2.3\njQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn jQuery.swap( elem, { \"display\": \"inline-block\" },\n\t\t\t\tcurCSS, [ elem, \"marginRight\" ] );\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each({\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split(\" \") : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( !rmargin.test( prefix ) ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n});\n\njQuery.fn.extend({\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( jQuery.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t},\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( isHidden( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t});\n\t}\n});\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || \"swing\";\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\tif ( tween.elem[ tween.prop ] != null &&\n\t\t\t\t(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE9\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t}\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back Compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, timerId,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trfxnum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" ),\n\trrun = /queueHooks$/,\n\tanimationPrefilters = [ defaultPrefilter ],\n\ttweeners = {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value ),\n\t\t\t\ttarget = tween.cur(),\n\t\t\t\tparts = rfxnum.exec( value ),\n\t\t\t\tunit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t\t\t// Starting value computation is required for potential unit mismatches\n\t\t\t\tstart = ( jQuery.cssNumber[ prop ] || unit !== \"px\" && +target ) &&\n\t\t\t\t\trfxnum.exec( jQuery.css( tween.elem, prop ) ),\n\t\t\t\tscale = 1,\n\t\t\t\tmaxIterations = 20;\n\n\t\t\tif ( start && start[ 3 ] !== unit ) {\n\t\t\t\t// Trust units reported by jQuery.css\n\t\t\t\tunit = unit || start[ 3 ];\n\n\t\t\t\t// Make sure we update the tween properties later on\n\t\t\t\tparts = parts || [];\n\n\t\t\t\t// Iteratively approximate from a nonzero starting point\n\t\t\t\tstart = +target || 1;\n\n\t\t\t\tdo {\n\t\t\t\t\t// If previous iteration zeroed out, double until we get *something*.\n\t\t\t\t\t// Use string for doubling so we don't accidentally see scale as unchanged below\n\t\t\t\t\tscale = scale || \".5\";\n\n\t\t\t\t\t// Adjust and apply\n\t\t\t\t\tstart = start / scale;\n\t\t\t\t\tjQuery.style( tween.elem, prop, start + unit );\n\n\t\t\t\t// Update scale, tolerating zero or NaN from tween.cur(),\n\t\t\t\t// break the loop if scale is unchanged or perfect, or if we've just had enough\n\t\t\t\t} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );\n\t\t\t}\n\n\t\t\t// Update tween properties\n\t\t\tif ( parts ) {\n\t\t\t\tstart = tween.start = +start || +target || 0;\n\t\t\t\ttween.unit = unit;\n\t\t\t\t// If a +=/-= token was provided, we're doing a relative animation\n\t\t\t\ttween.end = parts[ 1 ] ?\n\t\t\t\t\tstart + ( parts[ 1 ] + 1 ) * parts[ 2 ] :\n\t\t\t\t\t+parts[ 2 ];\n\t\t\t}\n\n\t\t\treturn tween;\n\t\t} ]\n\t};\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\tsetTimeout(function() {\n\t\tfxNow = undefined;\n\t});\n\treturn ( fxNow = jQuery.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4 ; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( tweeners[ prop ] || [] ).concat( tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( (tween = collection[ index ].call( animation, prop, value )) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\t/* jshint validthis: true */\n\tvar prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHidden( elem ),\n\t\tdataShow = data_priv.get( elem, \"fxshow\" );\n\n\t// Handle queue: false promises\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always(function() {\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always(function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t// Height/width overflow pass\n\tif ( elem.nodeType === 1 && ( \"height\" in props || \"width\" in props ) ) {\n\t\t// Make sure that nothing sneaks out\n\t\t// Record all 3 overflow attributes because IE9-10 do not\n\t\t// change the overflow attribute when overflowX and\n\t\t// overflowY are set to the same value\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Set display property to inline-block for height/width\n\t\t// animations on inline elements that are having width/height animated\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\n\t\t// Test default display if display is currently \"none\"\n\t\tcheckDisplay = display === \"none\" ?\n\t\t\tdata_priv.get( elem, \"olddisplay\" ) || defaultDisplay( elem.nodeName ) : display;\n\n\t\tif ( checkDisplay === \"inline\" && jQuery.css( elem, \"float\" ) === \"none\" ) {\n\t\t\tstyle.display = \"inline-block\";\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always(function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t});\n\t}\n\n\t// show/hide pass\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.exec( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\n\t\t// Any non-fx value stops us from restoring the original display value\n\t\t} else {\n\t\t\tdisplay = undefined;\n\t\t}\n\t}\n\n\tif ( !jQuery.isEmptyObject( orig ) ) {\n\t\tif ( dataShow ) {\n\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\thidden = dataShow.hidden;\n\t\t\t}\n\t\t} else {\n\t\t\tdataShow = data_priv.access( elem, \"fxshow\", {} );\n\t\t}\n\n\t\t// Store state if its toggle - enables .stop().toggle() to \"reverse\"\n\t\tif ( toggle ) {\n\t\t\tdataShow.hidden = !hidden;\n\t\t}\n\t\tif ( hidden ) {\n\t\t\tjQuery( elem ).show();\n\t\t} else {\n\t\t\tanim.done(function() {\n\t\t\t\tjQuery( elem ).hide();\n\t\t\t});\n\t\t}\n\t\tanim.done(function() {\n\t\t\tvar prop;\n\n\t\t\tdata_priv.remove( elem, \"fxshow\" );\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t}\n\t\t});\n\t\tfor ( prop in orig ) {\n\t\t\ttween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\n\t\t\tif ( !( prop in dataShow ) ) {\n\t\t\t\tdataShow[ prop ] = tween.start;\n\t\t\t\tif ( hidden ) {\n\t\t\t\t\ttween.end = tween.start;\n\t\t\t\t\ttween.start = prop === \"width\" || prop === \"height\" ? 1 : 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t// If this is a noop like .hide().hide(), restore an overwritten display value\n\t} else if ( (display === \"none\" ? defaultDisplay( elem.nodeName ) : display) === \"inline\" ) {\n\t\tstyle.display = display;\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = jQuery.camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( jQuery.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = animationPrefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t}),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\t\t\t\t// Support: Android 2.3\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ]);\n\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t} else {\n\t\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tanimation = deferred.promise({\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, { specialEasing: {} }, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length ; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length ; index++ ) {\n\t\tresult = animationPrefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( jQuery.isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t})\n\t);\n\n\t// attach callbacks from options\n\treturn animation.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweener: function( props, callback ) {\n\t\tif ( jQuery.isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.split(\" \");\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length ; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\ttweeners[ prop ] = tweeners[ prop ] || [];\n\t\t\ttweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tanimationPrefilters.unshift( callback );\n\t\t} else {\n\t\t\tanimationPrefilters.push( callback );\n\t\t}\n\t}\n});\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tjQuery.isFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !jQuery.isFunction( easing ) && easing\n\t};\n\n\topt.duration = jQuery.fx.off ? 0 : typeof opt.duration === \"number\" ? opt.duration :\n\t\topt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( jQuery.isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend({\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHidden ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate({ opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || data_priv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = data_priv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t});\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each(function() {\n\t\t\tvar index,\n\t\t\t\tdata = data_priv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t});\n\t}\n});\n\njQuery.each([ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n});\n\n// Generate shortcuts for custom animations\njQuery.each({\n\tslideDown: genFx(\"show\"),\n\tslideUp: genFx(\"hide\"),\n\tslideToggle: genFx(\"toggle\"),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n});\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = jQuery.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\t\t// Checks the timer has not already been removed\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tif ( timer() ) {\n\t\tjQuery.fx.start();\n\t} else {\n\t\tjQuery.timers.pop();\n\t}\n};\n\njQuery.fx.interval = 13;\n\njQuery.fx.start = function() {\n\tif ( !timerId ) {\n\t\ttimerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );\n\t}\n};\n\njQuery.fx.stop = function() {\n\tclearInterval( timerId );\n\ttimerId = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\tclearTimeout( timeout );\n\t\t};\n\t});\n};\n\n\n(function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: iOS<=5.1, Android<=4.2+\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE<=11+\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: Android<=2.3\n\t// Options inside disabled selects are incorrectly marked as disabled\n\tselect.disabled = true;\n\tsupport.optDisabled = !opt.disabled;\n\n\t// Support: IE<=11+\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n})();\n\n\nvar nodeHook, boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend({\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tattr: function( elem, name, value ) {\n\t\tvar hooks, ret,\n\t\t\tnType = elem.nodeType;\n\n\t\t// don't get/set attributes on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === strundefined ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// All attributes are lowercase\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\tname = name.toLowerCase();\n\t\t\thooks = jQuery.attrHooks[ name ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\n\t\t\t} else if ( hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {\n\t\t\t\treturn ret;\n\n\t\t\t} else {\n\t\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t} else if ( hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ) {\n\t\t\treturn ret;\n\n\t\t} else {\n\t\t\tret = jQuery.find.attr( elem, name );\n\n\t\t\t// Non-existent attributes return null, we normalize to undefined\n\t\t\treturn ret == null ?\n\t\t\t\tundefined :\n\t\t\t\tret;\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name, propName,\n\t\t\ti = 0,\n\t\t\tattrNames = value && value.match( rnotwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( (name = attrNames[i++]) ) {\n\t\t\t\tpropName = jQuery.propFix[ name ] || name;\n\n\t\t\t\t// Boolean attributes get special treatment (#10870)\n\t\t\t\tif ( jQuery.expr.match.bool.test( name ) ) {\n\t\t\t\t\t// Set corresponding property to false\n\t\t\t\t\telem[ propName ] = false;\n\t\t\t\t}\n\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tjQuery.nodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle;\n\t\tif ( !isXML ) {\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ name ];\n\t\t\tattrHandle[ name ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tname.toLowerCase() :\n\t\t\t\tnull;\n\t\t\tattrHandle[ name ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n});\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i;\n\njQuery.fn.extend({\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each(function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t},\n\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks, notxml,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( !elem || nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tnotxml = nType !== 1 || !jQuery.isXMLDoc( elem );\n\n\t\tif ( notxml ) {\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\treturn hooks && \"set\" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?\n\t\t\t\tret :\n\t\t\t\t( elem[ name ] = value );\n\n\t\t} else {\n\t\t\treturn hooks && \"get\" in hooks && (ret = hooks.get( elem, name )) !== null ?\n\t\t\t\tret :\n\t\t\t\telem[ name ];\n\t\t}\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\t\t\t\treturn elem.hasAttribute( \"tabindex\" ) || rfocusable.test( elem.nodeName ) || elem.href ?\n\t\t\t\t\telem.tabIndex :\n\t\t\t\t\t-1;\n\t\t\t}\n\t\t}\n\t}\n});\n\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t};\n}\n\njQuery.each([\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n});\n\n\n\n\nvar rclass = /[\\t\\r\\n\\f]/g;\n\njQuery.fn.extend({\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j, finalValue,\n\t\t\tproceed = typeof value === \"string\" && value,\n\t\t\ti = 0,\n\t\t\tlen = this.length;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\n\t\tif ( proceed ) {\n\t\t\t// The disjunction here is for better compressibility (see removeClass)\n\t\t\tclasses = ( value || \"\" ).match( rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\" \"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = jQuery.trim( cur );\n\t\t\t\t\tif ( elem.className !== finalValue ) {\n\t\t\t\t\t\telem.className = finalValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, clazz, j, finalValue,\n\t\t\tproceed = arguments.length === 0 || typeof value === \"string\" && value,\n\t\t\ti = 0,\n\t\t\tlen = this.length;\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, this.className ) );\n\t\t\t});\n\t\t}\n\t\tif ( proceed ) {\n\t\t\tclasses = ( value || \"\" ).match( rnotwhite ) || [];\n\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\telem = this[ i ];\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( elem.className ?\n\t\t\t\t\t( \" \" + elem.className + \" \" ).replace( rclass, \" \" ) :\n\t\t\t\t\t\"\"\n\t\t\t\t);\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( (clazz = classes[j++]) ) {\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) >= 0 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = value ? jQuery.trim( cur ) : \"\";\n\t\t\t\t\tif ( elem.className !== finalValue ) {\n\t\t\t\t\t\telem.className = finalValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value;\n\n\t\tif ( typeof stateVal === \"boolean\" && type === \"string\" ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( jQuery.isFunction( value ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tif ( type === \"string\" ) {\n\t\t\t\t// Toggle individual class names\n\t\t\t\tvar className,\n\t\t\t\t\ti = 0,\n\t\t\t\t\tself = jQuery( this ),\n\t\t\t\t\tclassNames = value.match( rnotwhite ) || [];\n\n\t\t\t\twhile ( (className = classNames[ i++ ]) ) {\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( type === strundefined || type === \"boolean\" ) {\n\t\t\t\tif ( this.className ) {\n\t\t\t\t\t// store className if set\n\t\t\t\t\tdata_priv.set( this, \"__className__\", this.className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tthis.className = this.className || value === false ? \"\" : data_priv.get( this, \"__className__\" ) || \"\";\n\t\t\t}\n\t\t});\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className = \" \" + selector + \" \",\n\t\t\ti = 0,\n\t\t\tl = this.length;\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( this[i].nodeType === 1 && (\" \" + this[i].className + \" \").replace(rclass, \" \").indexOf( className ) >= 0 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n});\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend({\n\tval: function( value ) {\n\t\tvar hooks, ret, isFunction,\n\t\t\telem = this[0];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks && \"get\" in hooks && (ret = hooks.get( elem, \"value\" )) !== undefined ) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\treturn typeof ret === \"string\" ?\n\t\t\t\t\t// Handle most common string cases\n\t\t\t\t\tret.replace(rreturn, \"\") :\n\t\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\t\tret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tisFunction = jQuery.isFunction( value );\n\n\t\treturn this.each(function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( jQuery.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t});\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !(\"set\" in hooks) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t});\n\t}\n});\n\njQuery.extend({\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\t\t\t\t\t// Support: IE10-11+\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\tjQuery.trim( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\" || index < 0,\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length,\n\t\t\t\t\ti = index < 0 ?\n\t\t\t\t\t\tmax :\n\t\t\t\t\t\tone ? index : 0;\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// IE6-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t( support.optDisabled ? !option.disabled : option.getAttribute( \"disabled\" ) === null ) &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\t\t\t\t\tif ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n});\n\n// Radios and checkboxes getter/setter\njQuery.each([ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( jQuery.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n\t\t};\n\t}\n});\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\njQuery.each( (\"blur focus focusin focusout load resize scroll unload click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup error contextmenu\").split(\" \"), function( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n});\n\njQuery.fn.extend({\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t},\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ? this.off( selector, \"**\" ) : this.off( types, selector || \"**\", fn );\n\t}\n});\n\n\nvar nonce = jQuery.now();\n\nvar rquery = (/\\?/);\n\n\n\n// Support: Android 2.3\n// Workaround failure to string-cast null input\njQuery.parseJSON = function( data ) {\n\treturn JSON.parse( data + \"\" );\n};\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml, tmp;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE9\n\ttry {\n\t\ttmp = new DOMParser();\n\t\txml = tmp.parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trhash = /#.*$/,\n\trts = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\trurl = /^([\\w.+-]+:)(?:\\/\\/(?:[^\\/?#]*@|)([^\\/?#:]*)(?::(\\d+)|)|)/,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Document location\n\tajaxLocation = window.location.href,\n\n\t// Segment location into parts\n\tajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];\n\n\t\tif ( jQuery.isFunction( func ) ) {\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( (dataType = dataTypes[i++]) ) {\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[0] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t(structure[ dataType ] = structure[ dataType ] || []).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t});\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s[ \"throws\" ] ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn { state: \"parsererror\", error: conv ? e : \"No conversion from \" + prev + \" to \" + current };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend({\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: ajaxLocation,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /xml/,\n\t\t\thtml: /html/,\n\t\t\tjson: /json/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": jQuery.parseJSON,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\t\t\t// Cross-domain detection vars\n\t\t\tparts,\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\t\t\t// Loop variable\n\t\t\ti,\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks(\"once memory\"),\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\t\t\t// The jqXHR state\n\t\t\tstate = 0,\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( state === 2 ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( (match = rheaders.exec( responseHeadersString )) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[1].toLowerCase() ] = match[ 2 ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match;\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn state === 2 ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tvar lname = name.toLowerCase();\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\tname = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( !state ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\t// Lazy-add the new callback in a way that preserves old ones\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR ).complete = completeDeferred.add;\n\t\tjqXHR.success = jqXHR.done;\n\t\tjqXHR.error = jqXHR.fail;\n\n\t\t// Remove hash character (#7531: and string promotion)\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace( rhash, \"\" )\n\t\t\t.replace( rprotocol, ajaxLocParts[ 1 ] + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = jQuery.trim( s.dataType || \"*\" ).toLowerCase().match( rnotwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when we have a protocol:host:port mismatch\n\t\tif ( s.crossDomain == null ) {\n\t\t\tparts = rurl.exec( s.url.toLowerCase() );\n\t\t\ts.crossDomain = !!( parts &&\n\t\t\t\t( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||\n\t\t\t\t\t( parts[ 3 ] || ( parts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) !==\n\t\t\t\t\t\t( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === \"http:\" ? \"80\" : \"443\" ) ) )\n\t\t\t);\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( state === 2 ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger(\"ajaxStart\");\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\tcacheURL = s.url;\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// If data is available, append data to url\n\t\t\tif ( s.data ) {\n\t\t\t\tcacheURL = ( s.url += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data );\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add anti-cache in url if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\ts.url = rts.test( cacheURL ) ?\n\n\t\t\t\t\t// If there is already a '_' parameter, set its value\n\t\t\t\t\tcacheURL.replace( rts, \"$1_=\" + nonce++ ) :\n\n\t\t\t\t\t// Otherwise add one to the end\n\t\t\t\t\tcacheURL + ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + nonce++;\n\t\t\t}\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tfor ( i in { success: 1, error: 1, complete: 1 } ) {\n\t\t\tjqXHR[ i ]( s[ i ] );\n\t\t}\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = setTimeout(function() {\n\t\t\t\t\tjqXHR.abort(\"timeout\");\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tstate = 1;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\t\t\t\t// Propagate exception as error if not done\n\t\t\t\tif ( state < 2 ) {\n\t\t\t\t\tdone( -1, e );\n\t\t\t\t// Simply rethrow otherwise\n\t\t\t\t} else {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Called once\n\t\t\tif ( state === 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// State is \"done\" now\n\t\t\tstate = 2;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\tclearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"Last-Modified\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader(\"etag\");\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger(\"ajaxStop\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n});\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( jQuery.isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\treturn jQuery.ajax({\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t});\n\t};\n});\n\n\njQuery._evalUrl = function( url ) {\n\treturn jQuery.ajax({\n\t\turl: url,\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tasync: false,\n\t\tglobal: false,\n\t\t\"throws\": true\n\t});\n};\n\n\njQuery.fn.extend({\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapAll( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\tif ( this[ 0 ] ) {\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map(function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t}).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( jQuery.isFunction( html ) ) {\n\t\t\treturn this.each(function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call(this, i) );\n\t\t\t});\n\t\t}\n\n\t\treturn this.each(function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t});\n\t},\n\n\twrap: function( html ) {\n\t\tvar isFunction = jQuery.isFunction( html );\n\n\t\treturn this.each(function( i ) {\n\t\t\tjQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );\n\t\t});\n\t},\n\n\tunwrap: function() {\n\t\treturn this.parent().each(function() {\n\t\t\tif ( !jQuery.nodeName( this, \"body\" ) ) {\n\t\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t\t}\n\t\t}).end();\n\t}\n});\n\n\njQuery.expr.filters.hidden = function( elem ) {\n\t// Support: Opera <= 12.12\n\t// Opera reports offsetWidths and offsetHeights less than zero on some elements\n\treturn elem.offsetWidth <= 0 && elem.offsetHeight <= 0;\n};\njQuery.expr.filters.visible = function( elem ) {\n\treturn !jQuery.expr.filters.hidden( elem );\n};\n\n\n\n\nvar r20 = /%20/g,\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( jQuery.isArray( obj ) ) {\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams( prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add );\n\t\t\t}\n\t\t});\n\n\t} else if ( !traditional && jQuery.type( obj ) === \"object\" ) {\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, value ) {\n\t\t\t// If value is a function, invoke it and return its value\n\t\t\tvalue = jQuery.isFunction( value ) ? value() : ( value == null ? \"\" : value );\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" + encodeURIComponent( value );\n\t\t};\n\n\t// Set traditional to true for jQuery <= 1.3.2 behavior.\n\tif ( traditional === undefined ) {\n\t\ttraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t});\n\n\t} else {\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" ).replace( r20, \"+\" );\n};\n\njQuery.fn.extend({\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map(function() {\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t})\n\t\t.filter(function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t})\n\t\t.map(function( i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\treturn val == null ?\n\t\t\t\tnull :\n\t\t\t\tjQuery.isArray( val ) ?\n\t\t\t\t\tjQuery.map( val, function( val ) {\n\t\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t\t}) :\n\t\t\t\t\t{ name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t}).get();\n\t}\n});\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new XMLHttpRequest();\n\t} catch( e ) {}\n};\n\nvar xhrId = 0,\n\txhrCallbacks = {},\n\txhrSuccessStatus = {\n\t\t// file protocol always yields status code 0, assume 200\n\t\t0: 200,\n\t\t// Support: IE9\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\n// Support: IE9\n// Open requests must be manually aborted on unload (#5280)\n// See https://support.microsoft.com/kb/2856746 for more info\nif ( window.attachEvent ) {\n\twindow.attachEvent( \"onunload\", function() {\n\t\tfor ( var key in xhrCallbacks ) {\n\t\t\txhrCallbacks[ key ]();\n\t\t}\n\t});\n}\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport(function( options ) {\n\tvar callback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr(),\n\t\t\t\t\tid = ++xhrId;\n\n\t\t\t\txhr.open( options.type, options.url, options.async, options.username, options.password );\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[\"X-Requested-With\"] ) {\n\t\t\t\t\theaders[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tdelete xhrCallbacks[ id ];\n\t\t\t\t\t\t\tcallback = xhr.onload = xhr.onerror = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\t// file: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\t\t\t\t\t\t\t\t\t// Support: IE9\n\t\t\t\t\t\t\t\t\t// Accessing binary-data responseText throws an exception\n\t\t\t\t\t\t\t\t\t// (#11426)\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText === \"string\" ? {\n\t\t\t\t\t\t\t\t\t\ttext: xhr.responseText\n\t\t\t\t\t\t\t\t\t} : undefined,\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\txhr.onerror = callback(\"error\");\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = xhrCallbacks[ id ] = callback(\"abort\");\n\n\t\t\t\ttry {\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\n\n\n\n\n// Install script dataType\njQuery.ajaxSetup({\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /(?:java|ecma)script/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n});\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n});\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\t// This transport only deals with cross domain requests\n\tif ( s.crossDomain ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery(\"<script>\").prop({\n\t\t\t\t\tasync: true,\n\t\t\t\t\tcharset: s.scriptCharset,\n\t\t\t\t\tsrc: s.url\n\t\t\t\t}).on(\n\t\t\t\t\t\"load error\",\n\t\t\t\t\tcallback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n});\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup({\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n});\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[\"script json\"] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always(function() {\n\t\t\t// Restore preexisting value\n\t\t\twindow[ callbackName ] = overwritten;\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\t\t\t\t// make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && jQuery.isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t});\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n});\n\n\n\n\n// data: string of html\n// context (optional): If specified, the fragment will be created in this context, defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\tcontext = context || document;\n\n\tvar parsed = rsingleTag.exec( data ),\n\t\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[1] ) ];\n\t}\n\n\tparsed = jQuery.buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n// Keep a copy of the old load method\nvar _load = jQuery.fn.load;\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tif ( typeof url !== \"string\" && _load ) {\n\t\treturn _load.apply( this, arguments );\n\t}\n\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf(\" \");\n\n\tif ( off >= 0 ) {\n\t\tselector = jQuery.trim( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( jQuery.isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax({\n\t\t\turl: url,\n\n\t\t\t// if \"type\" variable is undefined, then \"GET\" method will be used\n\t\t\ttype: type,\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t}).done(function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery(\"<div>\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t});\n\t}\n\n\treturn this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n});\n\n\n\n\njQuery.expr.filters.animated = function( elem ) {\n\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t}).length;\n};\n\n\n\n\nvar docElem = window.document.documentElement;\n\n/**\n * Gets a window from an element\n */\nfunction getWindow( elem ) {\n\treturn jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;\n}\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf(\"auto\") > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\toptions = options.call( elem, i, curOffset );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend({\n\toffset: function( options ) {\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each(function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t});\n\t\t}\n\n\t\tvar docElem, win,\n\t\t\telem = this[ 0 ],\n\t\t\tbox = { top: 0, left: 0 },\n\t\t\tdoc = elem && elem.ownerDocument;\n\n\t\tif ( !doc ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocElem = doc.documentElement;\n\n\t\t// Make sure it's not a disconnected DOM node\n\t\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\t\treturn box;\n\t\t}\n\n\t\t// Support: BlackBerry 5, iOS 3 (original iPhone)\n\t\t// If we don't have gBCR, just use 0,0 rather than error\n\t\tif ( typeof elem.getBoundingClientRect !== strundefined ) {\n\t\t\tbox = elem.getBoundingClientRect();\n\t\t}\n\t\twin = getWindow( doc );\n\t\treturn {\n\t\t\ttop: box.top + win.pageYOffset - docElem.clientTop,\n\t\t\tleft: box.left + win.pageXOffset - docElem.clientLeft\n\t\t};\n\t},\n\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t// Assume getBoundingClientRect is there when computed position is fixed\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\t// Get *real* offsetParent\n\t\t\toffsetParent = this.offsetParent();\n\n\t\t\t// Get correct offsets\n\t\t\toffset = this.offset();\n\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t}\n\n\t\t\t// Add offsetParent borders\n\t\t\tparentOffset.top += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\toffsetParent: function() {\n\t\treturn this.map(function() {\n\t\t\tvar offsetParent = this.offsetParent || docElem;\n\n\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\" ) === \"static\" ) ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || docElem;\n\t\t});\n\t}\n});\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\t\t\tvar win = getWindow( elem );\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : window.pageXOffset,\n\t\t\t\t\ttop ? val : window.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length, null );\n\t};\n});\n\n// Support: Safari<7+, Chrome<37+\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n});\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t};\n\t});\n});\n\n\n// The number of elements contained in the matched element set\njQuery.fn.size = function() {\n\treturn this.length;\n};\n\njQuery.fn.andSelf = jQuery.fn.addBack;\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t});\n}\n\n\n\n\nvar\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( typeof noGlobal === strundefined ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n\n}));\n\n/**\n * @license AngularJS v1.6.6\n * (c) 2010-2017 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window) {'use strict';\n\n/* exported\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth\n*/\n\nvar minErrConfig = {\n objectMaxDepth: 5\n};\n\n/**\n * @ngdoc function\n * @name angular.errorHandlingConfig\n * @module ng\n * @kind function\n *\n * @description\n * Configure several aspects of error handling in AngularJS if used as a setter or return the\n * current configuration if used as a getter. The following options are supported:\n *\n * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.\n *\n * Omitted or undefined options will leave the corresponding configuration values unchanged.\n *\n * @param {Object=} config - The configuration object. May only contain the options that need to be\n * updated. Supported keys:\n *\n * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a\n * non-positive or non-numeric value, removes the max depth limit.\n * Default: 5\n */\nfunction errorHandlingConfig(config) {\n if (isObject(config)) {\n if (isDefined(config.objectMaxDepth)) {\n minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;\n }\n } else {\n return minErrConfig;\n }\n}\n\n/**\n * @private\n * @param {Number} maxDepth\n * @return {boolean}\n */\nfunction isValidObjectMaxDepth(maxDepth) {\n return isNumber(maxDepth) && maxDepth > 0;\n}\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n ErrorConstructor = ErrorConstructor || Error;\n return function() {\n var code = arguments[0],\n template = arguments[1],\n message = '[' + (module ? module + ':' : '') + code + '] ',\n templateArgs = sliceArgs(arguments, 2).map(function(arg) {\n return toDebugString(arg, minErrConfig.objectMaxDepth);\n }),\n paramPrefix, i;\n\n message += template.replace(/\\{\\d+\\}/g, function(match) {\n var index = +match.slice(1, -1);\n\n if (index < templateArgs.length) {\n return templateArgs[index];\n }\n\n return match;\n });\n\n message += '\\nhttp://errors.angularjs.org/1.6.6/' +\n (module ? module + '/' : '') + code;\n\n for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {\n message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);\n }\n\n return new ErrorConstructor(message);\n };\n}\n\n/* We need to tell ESLint what variables are being exported */\n/* exported\n angular,\n msie,\n jqLite,\n jQuery,\n slice,\n splice,\n push,\n toString,\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth,\n ngMinErr,\n angularModule,\n uid,\n REGEX_STRING_REGEXP,\n VALIDITY_STATE_PROPERTY,\n\n lowercase,\n uppercase,\n manualLowercase,\n manualUppercase,\n nodeName_,\n isArrayLike,\n forEach,\n forEachSorted,\n reverseParams,\n nextUid,\n setHashKey,\n extend,\n toInt,\n inherit,\n merge,\n noop,\n identity,\n valueFn,\n isUndefined,\n isDefined,\n isObject,\n isBlankObject,\n isString,\n isNumber,\n isNumberNaN,\n isDate,\n isError,\n isArray,\n isFunction,\n isRegExp,\n isWindow,\n isScope,\n isFile,\n isFormData,\n isBlob,\n isBoolean,\n isPromiseLike,\n trim,\n escapeForRegexp,\n isElement,\n makeMap,\n includes,\n arrayRemove,\n copy,\n simpleCompare,\n equals,\n csp,\n jq,\n concat,\n sliceArgs,\n bind,\n toJsonReplacer,\n toJson,\n fromJson,\n convertTimezoneToLocal,\n timezoneToOffset,\n startingTag,\n tryDecodeURIComponent,\n parseKeyValue,\n toKeyValue,\n encodeUriSegment,\n encodeUriQuery,\n angularInit,\n bootstrap,\n getTestability,\n snake_case,\n bindJQuery,\n assertArg,\n assertArgFn,\n assertNotHasOwnProperty,\n getter,\n getBlockNodes,\n hasOwnProperty,\n createMap,\n stringify,\n\n NODE_TYPE_ELEMENT,\n NODE_TYPE_ATTRIBUTE,\n NODE_TYPE_TEXT,\n NODE_TYPE_COMMENT,\n NODE_TYPE_DOCUMENT,\n NODE_TYPE_DOCUMENT_FRAGMENT\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @installation\n * @description\n *\n * # ng (core module)\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n * <div doc-module-components=\"ng\"></div>\n */\n\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = 'validity';\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * @ngdoc function\n * @name angular.lowercase\n * @module ng\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.5.0\"\n * removeVersion=\"1.7.0\"\n * Use [String.prototype.toLowerCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase) instead.\n *\n * @description Converts the specified string to lowercase.\n * @param {string} string String to be converted to lowercase.\n * @returns {string} Lowercased string.\n */\nvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\n\n/**\n * @ngdoc function\n * @name angular.uppercase\n * @module ng\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.5.0\"\n * removeVersion=\"1.7.0\"\n * Use [String.prototype.toUpperCase](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase) instead.\n *\n * @description Converts the specified string to uppercase.\n * @param {string} string String to be converted to uppercase.\n * @returns {string} Uppercased string.\n */\nvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\n\nvar manualLowercase = function(s) {\n /* eslint-disable no-bitwise */\n return isString(s)\n ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})\n : s;\n /* eslint-enable */\n};\nvar manualUppercase = function(s) {\n /* eslint-disable no-bitwise */\n return isString(s)\n ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})\n : s;\n /* eslint-enable */\n};\n\n\n// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387\nif ('i' !== 'I'.toLowerCase()) {\n lowercase = manualLowercase;\n uppercase = manualUppercase;\n}\n\n\nvar\n msie, // holds major version number for IE, or NaN if UA is not IE.\n jqLite, // delay binding since jQuery could be loaded after us.\n jQuery, // delay binding\n slice = [].slice,\n splice = [].splice,\n push = [].push,\n toString = Object.prototype.toString,\n getPrototypeOf = Object.getPrototypeOf,\n ngMinErr = minErr('ng'),\n\n /** @name angular */\n angular = window.angular || (window.angular = {}),\n angularModule,\n uid = 0;\n\n// Support: IE 9-11 only\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = window.document.documentMode;\n\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n * String ...)\n */\nfunction isArrayLike(obj) {\n\n // `null`, `undefined` and `window` are not array-like\n if (obj == null || isWindow(obj)) return false;\n\n // arrays, strings and jQuery/jqLite objects are array like\n // * jqLite is either the jQuery or jqLite constructor function\n // * we have to check the existence of jqLite first as this method is called\n // via the forEach method when constructing the jqLite object in the first place\n if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;\n\n // Support: iOS 8.2 (not reproducible in simulator)\n // \"length\" in obj used to prevent JIT error (gh-11508)\n var length = 'length' in Object(obj) && obj.length;\n\n // NodeList objects (with `item` method) and\n // other objects with suitable length characteristics are array-like\n return isNumber(length) &&\n (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function');\n\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n ```js\n var values = {name: 'misko', gender: 'male'};\n var log = [];\n angular.forEach(values, function(value, key) {\n this.push(key + ': ' + value);\n }, log);\n expect(log).toEqual(['name: misko', 'gender: male']);\n ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj) || isArrayLike(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else if (isBlankObject(obj)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n } else if (typeof obj.hasOwnProperty === 'function') {\n // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else {\n // Slow path for objects which do not have a method `hasOwnProperty`\n for (key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n}\n\nfunction forEachSorted(obj, iterator, context) {\n var keys = Object.keys(obj).sort();\n for (var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n}\n\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n return function(value, key) {iteratorFn(key, value);};\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n return ++uid;\n}\n\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n } else {\n delete obj.$$hashKey;\n }\n}\n\n\nfunction baseExtend(dst, objs, deep) {\n var h = dst.$$hashKey;\n\n for (var i = 0, ii = objs.length; i < ii; ++i) {\n var obj = objs[i];\n if (!isObject(obj) && !isFunction(obj)) continue;\n var keys = Object.keys(obj);\n for (var j = 0, jj = keys.length; j < jj; j++) {\n var key = keys[j];\n var src = obj[key];\n\n if (deep && isObject(src)) {\n if (isDate(src)) {\n dst[key] = new Date(src.valueOf());\n } else if (isRegExp(src)) {\n dst[key] = new RegExp(src);\n } else if (src.nodeName) {\n dst[key] = src.cloneNode(true);\n } else if (isElement(src)) {\n dst[key] = src.clone();\n } else {\n if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};\n baseExtend(dst[key], [src], true);\n }\n } else {\n dst[key] = src;\n }\n }\n }\n\n setHashKey(dst, h);\n return dst;\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n *\n * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use\n * {@link angular.merge} for this.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n return baseExtend(dst, slice.call(arguments, 1), false);\n}\n\n\n/**\n* @ngdoc function\n* @name angular.merge\n* @module ng\n* @kind function\n*\n* @description\n* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n* by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.\n*\n* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source\n* objects, performing a deep copy.\n*\n* @deprecated\n* sinceVersion=\"1.6.5\"\n* This function is deprecated, but will not be removed in the 1.x lifecycle.\n* There are edge cases (see {@link angular.merge#known-issues known issues}) that are not\n* supported by this function. We suggest\n* using [lodash's merge()](https://lodash.com/docs/4.17.4#merge) instead.\n*\n* @knownIssue\n* This is a list of (known) object types that are not handled correctly by this function:\n* - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)\n* - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)\n* - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)\n* - AngularJS {@link $rootScope.Scope scopes};\n*\n* @param {Object} dst Destination object.\n* @param {...Object} src Source object(s).\n* @returns {Object} Reference to `dst`.\n*/\nfunction merge(dst) {\n return baseExtend(dst, slice.call(arguments, 1), true);\n}\n\n\n\nfunction toInt(str) {\n return parseInt(str, 10);\n}\n\nvar isNumberNaN = Number.isNaN || function isNumberNaN(num) {\n // eslint-disable-next-line no-self-compare\n return num !== num;\n};\n\n\nfunction inherit(parent, extra) {\n return extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n ```js\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n ```js\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n\n // E.g.\n function getResult(fn, input) {\n return (fn || angular.identity)(input);\n };\n\n getResult(function(n) { return n * 2; }, 21); // returns 42\n getResult(null, 21); // returns 21\n getResult(undefined, 21); // returns 21\n ```\n *\n * @param {*} value to be returned.\n * @returns {*} the value passed in.\n */\nfunction identity($) {return $;}\nidentity.$inject = [];\n\n\nfunction valueFn(value) {return function valueRef() {return value;};}\n\nfunction hasCustomToString(obj) {\n return isFunction(obj.toString) && obj.toString !== toString;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {return typeof value === 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {return typeof value !== 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n // http://jsperf.com/isobject4\n return value !== null && typeof value === 'object';\n}\n\n\n/**\n * Determine if a value is an object with a null prototype\n *\n * @returns {boolean} True if `value` is an `Object` with a null prototype\n */\nfunction isBlankObject(value) {\n return value !== null && typeof value === 'object' && !getPrototypeOf(value);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {return typeof value === 'string';}\n\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n *\n * If you wish to exclude these then you can use the native\n * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n * method.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {return typeof value === 'number';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n return toString.call(value) === '[object Date]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`. Alias of Array.isArray.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nvar isArray = Array.isArray;\n\n/**\n * @description\n * Determines if a reference is an `Error`.\n * Loosely based on https://www.npmjs.com/package/iserror\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Error`.\n */\nfunction isError(value) {\n var tag = toString.call(value);\n switch (tag) {\n case '[object Error]': return true;\n case '[object Exception]': return true;\n case '[object DOMException]': return true;\n default: return value instanceof Error;\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {return typeof value === 'function';}\n\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n return toString.call(value) === '[object RegExp]';\n}\n\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n return obj && obj.window === obj;\n}\n\n\nfunction isScope(obj) {\n return obj && obj.$evalAsync && obj.$watch;\n}\n\n\nfunction isFile(obj) {\n return toString.call(obj) === '[object File]';\n}\n\n\nfunction isFormData(obj) {\n return toString.call(obj) === '[object FormData]';\n}\n\n\nfunction isBlob(obj) {\n return toString.call(obj) === '[object Blob]';\n}\n\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\n\n\nfunction isPromiseLike(obj) {\n return obj && isFunction(obj.then);\n}\n\n\nvar TYPED_ARRAY_REGEXP = /^\\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;\nfunction isTypedArray(value) {\n return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));\n}\n\nfunction isArrayBuffer(obj) {\n return toString.call(obj) === '[object ArrayBuffer]';\n}\n\n\nvar trim = function(value) {\n return isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function(s) {\n return s\n .replace(/([-()[\\]{}+?*.$^|,:#<!\\\\])/g, '\\\\$1')\n // eslint-disable-next-line no-control-regex\n .replace(/\\x08/g, '\\\\x08');\n};\n\n\n/**\n * @ngdoc function\n * @name angular.isElement\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a DOM element (or wrapped jQuery element).\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).\n */\nfunction isElement(node) {\n return !!(node &&\n (node.nodeName // We are a direct element.\n || (node.prop && node.attr && node.find))); // We have an on and find method part of jQuery API.\n}\n\n/**\n * @param str 'key1,key2,...'\n * @returns {object} in the form of {key1:true, key2:true, ...}\n */\nfunction makeMap(str) {\n var obj = {}, items = str.split(','), i;\n for (i = 0; i < items.length; i++) {\n obj[items[i]] = true;\n }\n return obj;\n}\n\n\nfunction nodeName_(element) {\n return lowercase(element.nodeName || (element[0] && element[0].nodeName));\n}\n\nfunction includes(array, obj) {\n return Array.prototype.indexOf.call(array, obj) !== -1;\n}\n\nfunction arrayRemove(array, value) {\n var index = array.indexOf(value);\n if (index >= 0) {\n array.splice(index, 1);\n }\n return index;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array.\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n * are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to `destination` an exception will be thrown.\n *\n * <br />\n * <div class=\"alert alert-warning\">\n * Only enumerable properties are taken into account. Non-enumerable properties (both on `source`\n * and on `destination`) will be ignored.\n * </div>\n *\n * @param {*} source The source that will be used to make a copy.\n * Can be any type, including primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If\n * provided, must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n <example module=\"copyExample\" name=\"angular-copy\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate class=\"simple-form\">\n <label>Name: <input type=\"text\" ng-model=\"user.name\" /></label><br />\n <label>Age: <input type=\"number\" ng-model=\"user.age\" /></label><br />\n Gender: <label><input type=\"radio\" ng-model=\"user.gender\" value=\"male\" />male</label>\n <label><input type=\"radio\" ng-model=\"user.gender\" value=\"female\" />female</label><br />\n <button ng-click=\"reset()\">RESET</button>\n <button ng-click=\"update(user)\">SAVE</button>\n </form>\n <pre>form = {{user | json}}</pre>\n <pre>master = {{master | json}}</pre>\n </div>\n </file>\n <file name=\"script.js\">\n // Module: copyExample\n angular.\n module('copyExample', []).\n controller('ExampleController', ['$scope', function($scope) {\n $scope.master = {};\n\n $scope.reset = function() {\n // Example with 1 argument\n $scope.user = angular.copy($scope.master);\n };\n\n $scope.update = function(user) {\n // Example with 2 arguments\n angular.copy(user, $scope.master);\n };\n\n $scope.reset();\n }]);\n </file>\n </example>\n */\nfunction copy(source, destination, maxDepth) {\n var stackSource = [];\n var stackDest = [];\n maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;\n\n if (destination) {\n if (isTypedArray(destination) || isArrayBuffer(destination)) {\n throw ngMinErr('cpta', 'Can\\'t copy! TypedArray destination cannot be mutated.');\n }\n if (source === destination) {\n throw ngMinErr('cpi', 'Can\\'t copy! Source and destination are identical.');\n }\n\n // Empty the destination object\n if (isArray(destination)) {\n destination.length = 0;\n } else {\n forEach(destination, function(value, key) {\n if (key !== '$$hashKey') {\n delete destination[key];\n }\n });\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n return copyRecurse(source, destination, maxDepth);\n }\n\n return copyElement(source, maxDepth);\n\n function copyRecurse(source, destination, maxDepth) {\n maxDepth--;\n if (maxDepth < 0) {\n return '...';\n }\n var h = destination.$$hashKey;\n var key;\n if (isArray(source)) {\n for (var i = 0, ii = source.length; i < ii; i++) {\n destination.push(copyElement(source[i], maxDepth));\n }\n } else if (isBlankObject(source)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in source) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n } else if (source && typeof source.hasOwnProperty === 'function') {\n // Slow path, which must rely on hasOwnProperty\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n }\n } else {\n // Slowest path --- hasOwnProperty can't be called as a method\n for (key in source) {\n if (hasOwnProperty.call(source, key)) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n }\n }\n setHashKey(destination, h);\n return destination;\n }\n\n function copyElement(source, maxDepth) {\n // Simple values\n if (!isObject(source)) {\n return source;\n }\n\n // Already copied values\n var index = stackSource.indexOf(source);\n if (index !== -1) {\n return stackDest[index];\n }\n\n if (isWindow(source) || isScope(source)) {\n throw ngMinErr('cpws',\n 'Can\\'t copy! Making copies of Window or Scope instances is not supported.');\n }\n\n var needsRecurse = false;\n var destination = copyType(source);\n\n if (destination === undefined) {\n destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));\n needsRecurse = true;\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n\n return needsRecurse\n ? copyRecurse(source, destination, maxDepth)\n : destination;\n }\n\n function copyType(source) {\n switch (toString.call(source)) {\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object Int32Array]':\n case '[object Float32Array]':\n case '[object Float64Array]':\n case '[object Uint8Array]':\n case '[object Uint8ClampedArray]':\n case '[object Uint16Array]':\n case '[object Uint32Array]':\n return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length);\n\n case '[object ArrayBuffer]':\n // Support: IE10\n if (!source.slice) {\n // If we're in this case we know the environment supports ArrayBuffer\n /* eslint-disable no-undef */\n var copied = new ArrayBuffer(source.byteLength);\n new Uint8Array(copied).set(new Uint8Array(source));\n /* eslint-enable */\n return copied;\n }\n return source.slice(0);\n\n case '[object Boolean]':\n case '[object Number]':\n case '[object String]':\n case '[object Date]':\n return new source.constructor(source.valueOf());\n\n case '[object RegExp]':\n var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]);\n re.lastIndex = source.lastIndex;\n return re;\n\n case '[object Blob]':\n return new source.constructor([source], {type: source.type});\n }\n\n if (isFunction(source.cloneNode)) {\n return source.cloneNode(true);\n }\n }\n}\n\n\n// eslint-disable-next-line no-self-compare\nfunction simpleCompare(a, b) { return a === b || (a !== a && b !== b); }\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n * representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n *\n * @example\n <example module=\"equalsExample\" name=\"equalsExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate>\n <h3>User 1</h3>\n Name: <input type=\"text\" ng-model=\"user1.name\">\n Age: <input type=\"number\" ng-model=\"user1.age\">\n\n <h3>User 2</h3>\n Name: <input type=\"text\" ng-model=\"user2.name\">\n Age: <input type=\"number\" ng-model=\"user2.age\">\n\n <div>\n <br/>\n <input type=\"button\" value=\"Compare\" ng-click=\"compare()\">\n </div>\n User 1: <pre>{{user1 | json}}</pre>\n User 2: <pre>{{user2 | json}}</pre>\n Equal: <pre>{{result}}</pre>\n </form>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) {\n $scope.user1 = {};\n $scope.user2 = {};\n $scope.compare = function() {\n $scope.result = angular.equals($scope.user1, $scope.user2);\n };\n }]);\n </file>\n </example>\n */\nfunction equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n // eslint-disable-next-line no-self-compare\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 === t2 && t1 === 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) === o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n if (!isDate(o2)) return false;\n return simpleCompare(o1.getTime(), o2.getTime());\n } else if (isRegExp(o1)) {\n if (!isRegExp(o2)) return false;\n return o1.toString() === o2.toString();\n } else {\n if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||\n isArray(o2) || isDate(o2) || isRegExp(o2)) return false;\n keySet = createMap();\n for (key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) &&\n key.charAt(0) !== '$' &&\n isDefined(o2[key]) &&\n !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n return false;\n}\n\nvar csp = function() {\n if (!isDefined(csp.rules)) {\n\n\n var ngCspElement = (window.document.querySelector('[ng-csp]') ||\n window.document.querySelector('[data-ng-csp]'));\n\n if (ngCspElement) {\n var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||\n ngCspElement.getAttribute('data-ng-csp');\n csp.rules = {\n noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),\n noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)\n };\n } else {\n csp.rules = {\n noUnsafeEval: noUnsafeEval(),\n noInlineStyle: false\n };\n }\n }\n\n return csp.rules;\n\n function noUnsafeEval() {\n try {\n // eslint-disable-next-line no-new, no-new-func\n new Function('');\n return false;\n } catch (e) {\n return true;\n }\n }\n};\n\n/**\n * @ngdoc directive\n * @module ng\n * @name ngJq\n *\n * @element ANY\n * @param {string=} ngJq the name of the library available under `window`\n * to be used for angular.element\n * @description\n * Use this directive to force the angular.element library. This should be\n * used to force either jqLite by leaving ng-jq blank or setting the name of\n * the jquery variable under window (eg. jQuery).\n *\n * Since angular looks for this directive when it is loaded (doesn't wait for the\n * DOMContentLoaded event), it must be placed on an element that comes before the script\n * which loads angular. Also, only the first instance of `ng-jq` will be used and all\n * others ignored.\n *\n * @example\n * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.\n ```html\n <!doctype html>\n <html ng-app ng-jq>\n ...\n ...\n </html>\n ```\n * @example\n * This example shows how to use a jQuery based library of a different name.\n * The library name must be available at the top most 'window'.\n ```html\n <!doctype html>\n <html ng-app ng-jq=\"jQueryLib\">\n ...\n ...\n </html>\n ```\n */\nvar jq = function() {\n if (isDefined(jq.name_)) return jq.name_;\n var el;\n var i, ii = ngAttrPrefixes.length, prefix, name;\n for (i = 0; i < ii; ++i) {\n prefix = ngAttrPrefixes[i];\n el = window.document.querySelector('[' + prefix.replace(':', '\\\\:') + 'jq]');\n if (el) {\n name = el.getAttribute(prefix + 'jq');\n break;\n }\n }\n\n return (jq.name_ = name);\n};\n\nfunction concat(array1, array2, index) {\n return array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n return slice.call(args, startIndex || 0);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\nfunction bind(self, fn) {\n var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n if (isFunction(fn) && !(fn instanceof RegExp)) {\n return curryArgs.length\n ? function() {\n return arguments.length\n ? fn.apply(self, concat(curryArgs, arguments, 0))\n : fn.apply(self, curryArgs);\n }\n : function() {\n return arguments.length\n ? fn.apply(self, arguments)\n : fn.call(self);\n };\n } else {\n // In IE, native methods are not functions so they cannot be bound (note: they don't need to be).\n return fn;\n }\n}\n\n\nfunction toJsonReplacer(key, value) {\n var val = value;\n\n if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n val = undefined;\n } else if (isWindow(value)) {\n val = '$WINDOW';\n } else if (value && window.document === value) {\n val = '$DOCUMENT';\n } else if (isScope(value)) {\n val = '$SCOPE';\n }\n\n return val;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since angular uses this notation internally.\n *\n * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON.\n * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n * If set to an integer, the JSON output will contain that many spaces per indentation.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n * @knownIssue\n *\n * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`\n * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the\n * `Date.prototype.toJSON` method as follows:\n *\n * ```\n * var _DatetoJSON = Date.prototype.toJSON;\n * Date.prototype.toJSON = function() {\n * try {\n * return _DatetoJSON.call(this);\n * } catch(e) {\n * if (e instanceof RangeError) {\n * return null;\n * }\n * throw e;\n * }\n * };\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14221 for more information.\n */\nfunction toJson(obj, pretty) {\n if (isUndefined(obj)) return undefined;\n if (!isNumber(pretty)) {\n pretty = pretty ? 2 : null;\n }\n return JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n return isString(json)\n ? JSON.parse(json)\n : json;\n}\n\n\nvar ALL_COLONS = /:/g;\nfunction timezoneToOffset(timezone, fallback) {\n // Support: IE 9-11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(ALL_COLONS, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n\n\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n\n\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n}\n\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n element = jqLite(element).clone().empty();\n var elemHtml = jqLite('<div>').append(element).html();\n try {\n return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n elemHtml.\n match(/^(<[^>]+>)/)[1].\n replace(/^<([\\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});\n } catch (e) {\n return lowercase(elemHtml);\n }\n\n}\n\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n // Ignore any invalid uri component.\n }\n}\n\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.<string,boolean|Array>}\n */\nfunction parseKeyValue(/**string*/keyValue) {\n var obj = {};\n forEach((keyValue || '').split('&'), function(keyValue) {\n var splitPoint, key, val;\n if (keyValue) {\n key = keyValue = keyValue.replace(/\\+/g,'%20');\n splitPoint = keyValue.indexOf('=');\n if (splitPoint !== -1) {\n key = keyValue.substring(0, splitPoint);\n val = keyValue.substring(splitPoint + 1);\n }\n key = tryDecodeURIComponent(key);\n if (isDefined(key)) {\n val = isDefined(val) ? tryDecodeURIComponent(val) : true;\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n } else if (isArray(obj[key])) {\n obj[key].push(val);\n } else {\n obj[key] = [obj[key],val];\n }\n }\n }\n });\n return obj;\n}\n\nfunction toKeyValue(obj) {\n var parts = [];\n forEach(obj, function(value, key) {\n if (isArray(value)) {\n forEach(value, function(arrayValue) {\n parts.push(encodeUriQuery(key, true) +\n (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n });\n } else {\n parts.push(encodeUriQuery(key, true) +\n (value === true ? '' : '=' + encodeUriQuery(value, true)));\n }\n });\n return parts.length ? parts.join('&') : '';\n}\n\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n}\n\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\nvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\nfunction getNgAttribute(element, ngAttr) {\n var attr, i, ii = ngAttrPrefixes.length;\n for (i = 0; i < ii; ++i) {\n attr = ngAttrPrefixes[i] + ngAttr;\n if (isString(attr = element.getAttribute(attr))) {\n return attr;\n }\n }\n return null;\n}\n\nfunction allowAutoBootstrap(document) {\n var script = document.currentScript;\n\n if (!script) {\n // Support: IE 9-11 only\n // IE does not have `document.currentScript`\n return true;\n }\n\n // If the `currentScript` property has been clobbered just return false, since this indicates a probable attack\n if (!(script instanceof window.HTMLScriptElement || script instanceof window.SVGScriptElement)) {\n return false;\n }\n\n var attributes = script.attributes;\n var srcs = [attributes.getNamedItem('src'), attributes.getNamedItem('href'), attributes.getNamedItem('xlink:href')];\n\n return srcs.every(function(src) {\n if (!src) {\n return true;\n }\n if (!src.value) {\n return false;\n }\n\n var link = document.createElement('a');\n link.href = src.value;\n\n if (document.location.origin === link.origin) {\n // Same-origin resources are always allowed, even for non-whitelisted schemes.\n return true;\n }\n // Disabled bootstrapping unless angular.js was loaded from a known scheme used on the web.\n // This is to prevent angular.js bundled with browser extensions from being used to bypass the\n // content security policy in web pages and other browser extensions.\n switch (link.protocol) {\n case 'http:':\n case 'https:':\n case 'ftp:':\n case 'blob:':\n case 'file:':\n case 'data:':\n return true;\n default:\n return false;\n }\n });\n}\n\n// Cached as it has to run during loading so that document.currentScript is available.\nvar isAutoBootstrapAllowed = allowAutoBootstrap(window.document);\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n * do not use explicit function annotation (and are thus unsuitable for minification), as described\n * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n * tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `<body>` or `<html>` tags.\n *\n * There are a few things to keep in mind when using `ngApp`:\n * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead.\n * - AngularJS applications cannot be nested within each other.\n * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.\n * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and\n * {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application. This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n <example module=\"ngAppDemo\" name=\"ng-app\">\n <file name=\"index.html\">\n <div ng-controller=\"ngAppDemoController\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n });\n </file>\n </example>\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n <example ng-app-included=\"true\" name=\"strict-di\">\n <file name=\"index.html\">\n <div ng-app=\"ngAppStrictDemo\" ng-strict-di>\n <div ng-controller=\"GoodController1\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n\n <p>This renders because the controller does not fail to\n instantiate, by using explicit annotation style (see\n script.js for details)\n </p>\n </div>\n\n <div ng-controller=\"GoodController2\">\n Name: <input ng-model=\"name\"><br />\n Hello, {{name}}!\n\n <p>This renders because the controller does not fail to\n instantiate, by using explicit annotation style\n (see script.js for details)\n </p>\n </div>\n\n <div ng-controller=\"BadController\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n\n <p>The controller could not be instantiated, due to relying\n on automatic function annotations (which are disabled in\n strict mode). As such, the content of this section is not\n interpolated, and there should be an error in your web console.\n </p>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngAppStrictDemo', [])\n // BadController will fail to instantiate, due to relying on automatic function annotation,\n // rather than an explicit annotation\n .controller('BadController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n })\n // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n // due to using explicit annotations using the array style and $inject property, respectively.\n .controller('GoodController1', ['$scope', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n }])\n .controller('GoodController2', GoodController2);\n function GoodController2($scope) {\n $scope.name = 'World';\n }\n GoodController2.$inject = ['$scope'];\n </file>\n <file name=\"style.css\">\n div[ng-controller] {\n margin-bottom: 1em;\n -webkit-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid;\n padding: .5em;\n }\n div[ng-controller^=Good] {\n border-color: #d6e9c6;\n background-color: #dff0d8;\n color: #3c763d;\n }\n div[ng-controller^=Bad] {\n border-color: #ebccd1;\n background-color: #f2dede;\n color: #a94442;\n margin-bottom: 0;\n }\n </file>\n </example>\n */\nfunction angularInit(element, bootstrap) {\n var appElement,\n module,\n config = {};\n\n // The element `element` has priority over any other element.\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n\n if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n appElement = element;\n module = element.getAttribute(name);\n }\n });\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n var candidate;\n\n if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n appElement = candidate;\n module = candidate.getAttribute(name);\n }\n });\n if (appElement) {\n if (!isAutoBootstrapAllowed) {\n window.console.error('Angular: disabling automatic bootstrap. <script> protocol indicates ' +\n 'an extension, document.location.href does not match.');\n return;\n }\n config.strictDi = getNgAttribute(appElement, 'strict-di') !== null;\n bootstrap(appElement, module ? [module] : [], config);\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @module ng\n * @description\n * Use this function to manually start up angular application.\n *\n * For more information, see the {@link guide/bootstrap Bootstrap guide}.\n *\n * Angular will detect if it has been loaded into the browser more than once and only allow the\n * first loaded script to be bootstrapped and will report a warning to the browser console for\n * each of the subsequent scripts. This prevents strange results in applications, where otherwise\n * multiple instances of Angular try to work on the DOM.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link ng.directive:ngApp ngApp}.\n * </div>\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},\n * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n * </div>\n *\n * ```html\n * <!doctype html>\n * <html>\n * <body>\n * <div ng-controller=\"WelcomeController\">\n * {{greeting}}\n * </div>\n *\n * <script src=\"angular.js\"></script>\n * <script>\n * var app = angular.module('demo', [])\n * .controller('WelcomeController', function($scope) {\n * $scope.greeting = 'Welcome!';\n * });\n * angular.bootstrap(document, ['demo']);\n * </script>\n * </body>\n * </html>\n * ```\n *\n * @param {DOMElement} element DOM element which is the root of angular application.\n * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n * following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n * assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n if (!isObject(config)) config = {};\n var defaultConfig = {\n strictDi: false\n };\n config = extend(defaultConfig, config);\n var doBootstrap = function() {\n element = jqLite(element);\n\n if (element.injector()) {\n var tag = (element[0] === window.document) ? 'document' : startingTag(element);\n // Encode angle brackets to prevent input from being sanitized to empty string #8683.\n throw ngMinErr(\n 'btstrpd',\n 'App already bootstrapped with this element \\'{0}\\'',\n tag.replace(/</,'<').replace(/>/,'>'));\n }\n\n modules = modules || [];\n modules.unshift(['$provide', function($provide) {\n $provide.value('$rootElement', element);\n }]);\n\n if (config.debugInfoEnabled) {\n // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n modules.push(['$compileProvider', function($compileProvider) {\n $compileProvider.debugInfoEnabled(true);\n }]);\n }\n\n modules.unshift('ng');\n var injector = createInjector(modules, config.strictDi);\n injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',\n function bootstrapApply(scope, element, compile, injector) {\n scope.$apply(function() {\n element.data('$injector', injector);\n compile(element)(scope);\n });\n }]\n );\n return injector;\n };\n\n var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n config.debugInfoEnabled = true;\n window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n }\n\n if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n return doBootstrap();\n }\n\n window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n angular.resumeBootstrap = function(extraModules) {\n forEach(extraModules, function(module) {\n modules.push(module);\n });\n return doBootstrap();\n };\n\n if (isFunction(angular.resumeDeferredBootstrap)) {\n angular.resumeDeferredBootstrap();\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n window.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of Angular on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of angular application.\n */\nfunction getTestability(rootElement) {\n var injector = angular.element(rootElement).injector();\n if (!injector) {\n throw ngMinErr('test',\n 'no injector found for element argument to getTestability');\n }\n return injector.get('$$testability');\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n}\n\nvar bindJQueryFired = false;\nfunction bindJQuery() {\n var originalCleanData;\n\n if (bindJQueryFired) {\n return;\n }\n\n // bind to jQuery if present;\n var jqName = jq();\n jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present)\n !jqName ? undefined : // use jqLite\n window[jqName]; // use jQuery specified by `ngJq`\n\n // Use jQuery if it exists with proper functionality, otherwise default to us.\n // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.\n // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n // versions. It will not work for sure with jQuery <1.7, though.\n if (jQuery && jQuery.fn.on) {\n jqLite = jQuery;\n extend(jQuery.fn, {\n scope: JQLitePrototype.scope,\n isolateScope: JQLitePrototype.isolateScope,\n controller: /** @type {?} */ (JQLitePrototype).controller,\n injector: JQLitePrototype.injector,\n inheritedData: JQLitePrototype.inheritedData\n });\n\n // All nodes removed from the DOM via various jQuery APIs like .remove()\n // are passed through jQuery.cleanData. Monkey-patch this method to fire\n // the $destroy event on all removed nodes.\n originalCleanData = jQuery.cleanData;\n jQuery.cleanData = function(elems) {\n var events;\n for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n events = jQuery._data(elem, 'events');\n if (events && events.$destroy) {\n jQuery(elem).triggerHandler('$destroy');\n }\n }\n originalCleanData(elems);\n };\n } else {\n jqLite = JQLite;\n }\n\n angular.element = jqLite;\n\n // Prevent double-proxying.\n bindJQueryFired = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', 'Argument \\'{0}\\' is {1}', (name || '?'), (reason || 'required'));\n }\n return arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n if (acceptArrayAnnotation && isArray(arg)) {\n arg = arg[arg.length - 1];\n }\n\n assertArg(isFunction(arg), name, 'not a function, got ' +\n (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n return arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param {String} name the name to test\n * @param {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n if (!path) return obj;\n var keys = path.split('.');\n var key;\n var lastInstance = obj;\n var len = keys.length;\n\n for (var i = 0; i < len; i++) {\n key = keys[i];\n if (obj) {\n obj = (lastInstance = obj)[key];\n }\n }\n if (!bindFnToScope && isFunction(obj)) {\n return bind(lastInstance, obj);\n }\n return obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {Array} the inputted object or a jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n // TODO(perf): update `nodes` instead of creating a new object?\n var node = nodes[0];\n var endNode = nodes[nodes.length - 1];\n var blockNodes;\n\n for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {\n if (blockNodes || nodes[i] !== node) {\n if (!blockNodes) {\n blockNodes = jqLite(slice.call(nodes, 0, i));\n }\n blockNodes.push(node);\n }\n }\n\n return blockNodes || nodes;\n}\n\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n return Object.create(null);\n}\n\nfunction stringify(value) {\n if (value == null) { // null || undefined\n return '';\n }\n switch (typeof value) {\n case 'string':\n break;\n case 'number':\n value = '' + value;\n break;\n default:\n if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {\n value = value.toString();\n } else {\n value = toJson(value);\n }\n }\n\n return value;\n}\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_ATTRIBUTE = 2;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring angular {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n var $injectorMinErr = minErr('$injector');\n var ngMinErr = minErr('ng');\n\n function ensure(obj, name, factory) {\n return obj[name] || (obj[name] = factory());\n }\n\n var angular = ensure(window, 'angular', Object);\n\n // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n angular.$$minErr = angular.$$minErr || minErr;\n\n return ensure(angular, 'module', function() {\n /** @type {Object.<string, angular.Module>} */\n var modules = {};\n\n /**\n * @ngdoc function\n * @name angular.module\n * @module ng\n * @description\n *\n * The `angular.module` is a global place for creating, registering and retrieving Angular\n * modules.\n * All modules (angular core or 3rd party) that should be available to an application must be\n * registered using this mechanism.\n *\n * Passing one argument retrieves an existing {@link angular.Module},\n * whereas passing more than one argument creates a new {@link angular.Module}\n *\n *\n * # Module\n *\n * A module is a collection of services, directives, controllers, filters, and configuration information.\n * `angular.module` is used to configure the {@link auto.$injector $injector}.\n *\n * ```js\n * // Create a new module\n * var myModule = angular.module('myModule', []);\n *\n * // register a new service\n * myModule.value('appName', 'MyCoolApp');\n *\n * // configure existing services inside initialization blocks.\n * myModule.config(['$locationProvider', function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * }]);\n * ```\n *\n * Then you can create an injector and load your modules like this:\n *\n * ```js\n * var injector = angular.injector(['ng', 'myModule'])\n * ```\n *\n * However it's more likely that you'll just use\n * {@link ng.directive:ngApp ngApp} or\n * {@link angular.bootstrap} to simplify this process for you.\n *\n * @param {!string} name The name of the module to create or retrieve.\n * @param {!Array.<string>=} requires If specified then new module is being created. If\n * unspecified then the module is being retrieved for further configuration.\n * @param {Function=} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#config Module#config()}.\n * @returns {angular.Module} new module with the {@link angular.Module} api.\n */\n return function module(name, requires, configFn) {\n\n var info = {};\n\n var assertNotHasOwnProperty = function(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n };\n\n assertNotHasOwnProperty(name, 'module');\n if (requires && modules.hasOwnProperty(name)) {\n modules[name] = null;\n }\n return ensure(modules, name, function() {\n if (!requires) {\n throw $injectorMinErr('nomod', 'Module \\'{0}\\' is not available! You either misspelled ' +\n 'the module name or forgot to load it. If registering a module ensure that you ' +\n 'specify the dependencies as the second argument.', name);\n }\n\n /** @type {!Array.<Array.<*>>} */\n var invokeQueue = [];\n\n /** @type {!Array.<Function>} */\n var configBlocks = [];\n\n /** @type {!Array.<Function>} */\n var runBlocks = [];\n\n var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _configBlocks: configBlocks,\n _runBlocks: runBlocks,\n\n /**\n * @ngdoc method\n * @name angular.Module#info\n * @module ng\n *\n * @param {Object=} info Information about the module\n * @returns {Object|Module} The current info object for this module if called as a getter,\n * or `this` if called as a setter.\n *\n * @description\n * Read and write custom information about this module.\n * For example you could put the version of the module in here.\n *\n * ```js\n * angular.module('myModule', []).info({ version: '1.0.0' });\n * ```\n *\n * The version could then be read back out by accessing the module elsewhere:\n *\n * ```\n * var version = angular.module('myModule').info().version;\n * ```\n *\n * You can also retrieve this information during runtime via the\n * {@link $injector#modules `$injector.modules`} property:\n *\n * ```js\n * var version = $injector.modules['myModule'].info().version;\n * ```\n */\n info: function(value) {\n if (isDefined(value)) {\n if (!isObject(value)) throw ngMinErr('aobj', 'Argument \\'{0}\\' must be an object', 'value');\n info = value;\n return this;\n }\n return info;\n },\n\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @module ng\n *\n * @description\n * Holds the list of modules which the injector will load before the current module is\n * loaded.\n */\n requires: requires,\n\n /**\n * @ngdoc property\n * @name angular.Module#name\n * @module ng\n *\n * @description\n * Name of the module.\n */\n name: name,\n\n\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @module ng\n * @param {string} name service name\n * @param {Function} providerType Construction function for creating new instance of the\n * service.\n * @description\n * See {@link auto.$provide#provider $provide.provider()}.\n */\n provider: invokeLaterAndSetModuleName('$provide', 'provider'),\n\n /**\n * @ngdoc method\n * @name angular.Module#factory\n * @module ng\n * @param {string} name service name\n * @param {Function} providerFunction Function for creating new instance of the service.\n * @description\n * See {@link auto.$provide#factory $provide.factory()}.\n */\n factory: invokeLaterAndSetModuleName('$provide', 'factory'),\n\n /**\n * @ngdoc method\n * @name angular.Module#service\n * @module ng\n * @param {string} name service name\n * @param {Function} constructor A constructor function that will be instantiated.\n * @description\n * See {@link auto.$provide#service $provide.service()}.\n */\n service: invokeLaterAndSetModuleName('$provide', 'service'),\n\n /**\n * @ngdoc method\n * @name angular.Module#value\n * @module ng\n * @param {string} name service name\n * @param {*} object Service instance object.\n * @description\n * See {@link auto.$provide#value $provide.value()}.\n */\n value: invokeLater('$provide', 'value'),\n\n /**\n * @ngdoc method\n * @name angular.Module#constant\n * @module ng\n * @param {string} name constant name\n * @param {*} object Constant value.\n * @description\n * Because the constants are fixed, they get applied before other provide methods.\n * See {@link auto.$provide#constant $provide.constant()}.\n */\n constant: invokeLater('$provide', 'constant', 'unshift'),\n\n /**\n * @ngdoc method\n * @name angular.Module#decorator\n * @module ng\n * @param {string} name The name of the service to decorate.\n * @param {Function} decorFn This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance.\n * @description\n * See {@link auto.$provide#decorator $provide.decorator()}.\n */\n decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks),\n\n /**\n * @ngdoc method\n * @name angular.Module#animation\n * @module ng\n * @param {string} name animation name\n * @param {Function} animationFactory Factory function for creating new instance of an\n * animation.\n * @description\n *\n * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n *\n *\n * Defines an animation hook that can be later used with\n * {@link $animate $animate} service and directives that use this service.\n *\n * ```js\n * module.animation('.animation-name', function($inject1, $inject2) {\n * return {\n * eventName : function(element, done) {\n * //code to run the animation\n * //once complete, then run done()\n * return function cancellationFunction(element) {\n * //code to cancel the animation\n * }\n * }\n * }\n * })\n * ```\n *\n * See {@link ng.$animateProvider#register $animateProvider.register()} and\n * {@link ngAnimate ngAnimate module} for more information.\n */\n animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#filter\n * @module ng\n * @param {string} name Filter name - this must be a valid angular expression identifier\n * @param {Function} filterFactory Factory function for creating new instance of filter.\n * @description\n * See {@link ng.$filterProvider#register $filterProvider.register()}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n */\n filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#controller\n * @module ng\n * @param {string|Object} name Controller name, or an object map of controllers where the\n * keys are the names and the values are the constructors.\n * @param {Function} constructor Controller constructor function.\n * @description\n * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n */\n controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#directive\n * @module ng\n * @param {string|Object} name Directive name, or an object map of directives where the\n * keys are the names and the values are the factories.\n * @param {Function} directiveFactory Factory function for creating new instance of\n * directives.\n * @description\n * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),\n\n /**\n * @ngdoc method\n * @name angular.Module#component\n * @module ng\n * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object})\n *\n * @description\n * See {@link ng.$compileProvider#component $compileProvider.component()}.\n */\n component: invokeLaterAndSetModuleName('$compileProvider', 'component'),\n\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @module ng\n * @param {Function} configFn Execute this function on module load. Useful for service\n * configuration.\n * @description\n * Use this method to register work which needs to be performed on module loading.\n * For more about how to configure services, see\n * {@link providers#provider-recipe Provider Recipe}.\n */\n config: config,\n\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @module ng\n * @param {Function} initializationFn Execute this function after injector creation.\n * Useful for application initialization.\n * @description\n * Use this method to register work which should be performed when the injector is done\n * loading all modules.\n */\n run: function(block) {\n runBlocks.push(block);\n return this;\n }\n };\n\n if (configFn) {\n config(configFn);\n }\n\n return moduleInstance;\n\n /**\n * @param {string} provider\n * @param {string} method\n * @param {String=} insertMethod\n * @returns {angular.Module}\n */\n function invokeLater(provider, method, insertMethod, queue) {\n if (!queue) queue = invokeQueue;\n return function() {\n queue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n\n /**\n * @param {string} provider\n * @param {string} method\n * @returns {angular.Module}\n */\n function invokeLaterAndSetModuleName(provider, method, queue) {\n if (!queue) queue = invokeQueue;\n return function(recipeName, factoryFunction) {\n if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;\n queue.push([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n\n}\n\n/* global shallowCopy: true */\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}\n\n/* exported toDebugString */\n\nfunction serializeObject(obj, maxDepth) {\n var seen = [];\n\n // There is no direct way to stringify object until reaching a specific depth\n // and a very deep object can cause a performance issue, so we copy the object\n // based on this specific depth and then stringify it.\n if (isValidObjectMaxDepth(maxDepth)) {\n // This file is also included in `angular-loader`, so `copy()` might not always be available in\n // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.\n obj = angular.copy(obj, null, maxDepth);\n }\n return JSON.stringify(obj, function(key, val) {\n val = toJsonReplacer(key, val);\n if (isObject(val)) {\n\n if (seen.indexOf(val) >= 0) return '...';\n\n seen.push(val);\n }\n return val;\n });\n}\n\nfunction toDebugString(obj, maxDepth) {\n if (typeof obj === 'function') {\n return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n } else if (isUndefined(obj)) {\n return 'undefined';\n } else if (typeof obj !== 'string') {\n return serializeObject(obj, maxDepth);\n }\n return obj;\n}\n\n/* global angularModule: true,\n version: true,\n\n $CompileProvider,\n\n htmlAnchorDirective,\n inputDirective,\n inputDirective,\n formDirective,\n scriptDirective,\n selectDirective,\n optionDirective,\n ngBindDirective,\n ngBindHtmlDirective,\n ngBindTemplateDirective,\n ngClassDirective,\n ngClassEvenDirective,\n ngClassOddDirective,\n ngCloakDirective,\n ngControllerDirective,\n ngFormDirective,\n ngHideDirective,\n ngIfDirective,\n ngIncludeDirective,\n ngIncludeFillContentDirective,\n ngInitDirective,\n ngNonBindableDirective,\n ngPluralizeDirective,\n ngRepeatDirective,\n ngShowDirective,\n ngStyleDirective,\n ngSwitchDirective,\n ngSwitchWhenDirective,\n ngSwitchDefaultDirective,\n ngOptionsDirective,\n ngTranscludeDirective,\n ngModelDirective,\n ngListDirective,\n ngChangeDirective,\n patternDirective,\n patternDirective,\n requiredDirective,\n requiredDirective,\n minlengthDirective,\n minlengthDirective,\n maxlengthDirective,\n maxlengthDirective,\n ngValueDirective,\n ngModelOptionsDirective,\n ngAttributeAliasDirectives,\n ngEventDirectives,\n\n $AnchorScrollProvider,\n $AnimateProvider,\n $CoreAnimateCssProvider,\n $$CoreAnimateJsProvider,\n $$CoreAnimateQueueProvider,\n $$AnimateRunnerFactoryProvider,\n $$AnimateAsyncRunFactoryProvider,\n $BrowserProvider,\n $CacheFactoryProvider,\n $ControllerProvider,\n $DateProvider,\n $DocumentProvider,\n $$IsDocumentHiddenProvider,\n $ExceptionHandlerProvider,\n $FilterProvider,\n $$ForceReflowProvider,\n $InterpolateProvider,\n $IntervalProvider,\n $HttpProvider,\n $HttpParamSerializerProvider,\n $HttpParamSerializerJQLikeProvider,\n $HttpBackendProvider,\n $xhrFactoryProvider,\n $jsonpCallbacksProvider,\n $LocationProvider,\n $LogProvider,\n $$MapProvider,\n $ParseProvider,\n $RootScopeProvider,\n $QProvider,\n $$QProvider,\n $$SanitizeUriProvider,\n $SceProvider,\n $SceDelegateProvider,\n $SnifferProvider,\n $TemplateCacheProvider,\n $TemplateRequestProvider,\n $$TestabilityProvider,\n $TimeoutProvider,\n $$RAFProvider,\n $WindowProvider,\n $$jqLiteProvider,\n $$CookieReaderProvider\n*/\n\n\n/**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version.\n *\n * This object has the following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\nvar version = {\n // These placeholder strings will be replaced by grunt's `build` task.\n // They need to be double- or single-quoted.\n full: '1.6.6',\n major: 1,\n minor: 6,\n dot: 6,\n codeName: 'interdimensional-cable'\n};\n\n\nfunction publishExternalAPI(angular) {\n extend(angular, {\n 'errorHandlingConfig': errorHandlingConfig,\n 'bootstrap': bootstrap,\n 'copy': copy,\n 'extend': extend,\n 'merge': merge,\n 'equals': equals,\n 'element': jqLite,\n 'forEach': forEach,\n 'injector': createInjector,\n 'noop': noop,\n 'bind': bind,\n 'toJson': toJson,\n 'fromJson': fromJson,\n 'identity': identity,\n 'isUndefined': isUndefined,\n 'isDefined': isDefined,\n 'isString': isString,\n 'isFunction': isFunction,\n 'isObject': isObject,\n 'isNumber': isNumber,\n 'isElement': isElement,\n 'isArray': isArray,\n 'version': version,\n 'isDate': isDate,\n 'lowercase': lowercase,\n 'uppercase': uppercase,\n 'callbacks': {$$counter: 0},\n 'getTestability': getTestability,\n 'reloadWithDebugInfo': reloadWithDebugInfo,\n '$$minErr': minErr,\n '$$csp': csp,\n '$$encodeUriSegment': encodeUriSegment,\n '$$encodeUriQuery': encodeUriQuery,\n '$$stringify': stringify\n });\n\n angularModule = setupModuleLoader(window);\n\n angularModule('ng', ['ngLocale'], ['$provide',\n function ngModule($provide) {\n // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n $provide.provider({\n $$sanitizeUri: $$SanitizeUriProvider\n });\n $provide.provider('$compile', $CompileProvider).\n directive({\n a: htmlAnchorDirective,\n input: inputDirective,\n textarea: inputDirective,\n form: formDirective,\n script: scriptDirective,\n select: selectDirective,\n option: optionDirective,\n ngBind: ngBindDirective,\n ngBindHtml: ngBindHtmlDirective,\n ngBindTemplate: ngBindTemplateDirective,\n ngClass: ngClassDirective,\n ngClassEven: ngClassEvenDirective,\n ngClassOdd: ngClassOddDirective,\n ngCloak: ngCloakDirective,\n ngController: ngControllerDirective,\n ngForm: ngFormDirective,\n ngHide: ngHideDirective,\n ngIf: ngIfDirective,\n ngInclude: ngIncludeDirective,\n ngInit: ngInitDirective,\n ngNonBindable: ngNonBindableDirective,\n ngPluralize: ngPluralizeDirective,\n ngRepeat: ngRepeatDirective,\n ngShow: ngShowDirective,\n ngStyle: ngStyleDirective,\n ngSwitch: ngSwitchDirective,\n ngSwitchWhen: ngSwitchWhenDirective,\n ngSwitchDefault: ngSwitchDefaultDirective,\n ngOptions: ngOptionsDirective,\n ngTransclude: ngTranscludeDirective,\n ngModel: ngModelDirective,\n ngList: ngListDirective,\n ngChange: ngChangeDirective,\n pattern: patternDirective,\n ngPattern: patternDirective,\n required: requiredDirective,\n ngRequired: requiredDirective,\n minlength: minlengthDirective,\n ngMinlength: minlengthDirective,\n maxlength: maxlengthDirective,\n ngMaxlength: maxlengthDirective,\n ngValue: ngValueDirective,\n ngModelOptions: ngModelOptionsDirective\n }).\n directive({\n ngInclude: ngIncludeFillContentDirective\n }).\n directive(ngAttributeAliasDirectives).\n directive(ngEventDirectives);\n $provide.provider({\n $anchorScroll: $AnchorScrollProvider,\n $animate: $AnimateProvider,\n $animateCss: $CoreAnimateCssProvider,\n $$animateJs: $$CoreAnimateJsProvider,\n $$animateQueue: $$CoreAnimateQueueProvider,\n $$AnimateRunner: $$AnimateRunnerFactoryProvider,\n $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,\n $browser: $BrowserProvider,\n $cacheFactory: $CacheFactoryProvider,\n $controller: $ControllerProvider,\n $document: $DocumentProvider,\n $$isDocumentHidden: $$IsDocumentHiddenProvider,\n $exceptionHandler: $ExceptionHandlerProvider,\n $filter: $FilterProvider,\n $$forceReflow: $$ForceReflowProvider,\n $interpolate: $InterpolateProvider,\n $interval: $IntervalProvider,\n $http: $HttpProvider,\n $httpParamSerializer: $HttpParamSerializerProvider,\n $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,\n $httpBackend: $HttpBackendProvider,\n $xhrFactory: $xhrFactoryProvider,\n $jsonpCallbacks: $jsonpCallbacksProvider,\n $location: $LocationProvider,\n $log: $LogProvider,\n $parse: $ParseProvider,\n $rootScope: $RootScopeProvider,\n $q: $QProvider,\n $$q: $$QProvider,\n $sce: $SceProvider,\n $sceDelegate: $SceDelegateProvider,\n $sniffer: $SnifferProvider,\n $templateCache: $TemplateCacheProvider,\n $templateRequest: $TemplateRequestProvider,\n $$testability: $$TestabilityProvider,\n $timeout: $TimeoutProvider,\n $window: $WindowProvider,\n $$rAF: $$RAFProvider,\n $$jqLite: $$jqLiteProvider,\n $$Map: $$MapProvider,\n $$cookieReader: $$CookieReaderProvider\n });\n }\n ])\n .info({ angularVersion: '1.6.6' });\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* global\n JQLitePrototype: true,\n BOOLEAN_ATTR: true,\n ALIASED_ATTR: true\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to Angular's built-in subset of jQuery, called \"jQuery lite\" or **jqLite**.\n *\n * jqLite is a tiny, API-compatible subset of jQuery that allows\n * Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most\n * commonly needed functionality with the goal of having a very small footprint.\n *\n * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the\n * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a\n * specific version of jQuery if multiple versions exist on the page.\n *\n * <div class=\"alert alert-info\">**Note:** All element references in Angular are always wrapped with jQuery or\n * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.</div>\n *\n * <div class=\"alert alert-warning\">**Note:** Keep in mind that this function will not find elements\n * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`\n * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.</div>\n *\n * ## Angular's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/) - Does not support a function as first argument\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/)\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) (_deprecated_, use [`on()`](http://api.jquery.com/on/)) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`.\n * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing.\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/) (_deprecated_, use `angular.element(callback)` instead of `angular.element(document).ready(callback)`)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/) - Does not support multiple attributes\n * - [`removeClass()`](http://api.jquery.com/removeClass/) - Does not support a function as first argument\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers\n * - [`unbind()`](http://api.jquery.com/unbind/) (_deprecated_, use [`off()`](http://api.jquery.com/off/)) - Does not support namespaces or event object as parameter\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * ## jQuery/jqLite Extras\n * Angular also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM\n * element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n * retrieves controller associated with the `ngController` directive. If `name` is provided as\n * camelCase directive name, then the controller for this directive will be retrieved (e.g.\n * `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n * be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n * current element. This getter should be used only on elements that contain a directive which starts a new isolate\n * scope. Calling `scope()` on this element always returns the original non-isolate scope.\n * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n * parent element is reached.\n *\n * @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See\n * https://github.com/angular/angular.js/issues/14251 for more information.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\nJQLite.expando = 'ng339';\n\nvar jqCache = JQLite.cache = {},\n jqId = 1;\n\n/*\n * !!! This is an undocumented \"private\" function !!!\n */\nJQLite._data = function(node) {\n //jQuery always returns an object on cache miss\n return this.cache[node[this.expando]] || {};\n};\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar DASH_LOWERCASE_REGEXP = /-([a-z])/g;\nvar MS_HACK_REGEXP = /^-ms-/;\nvar MOUSE_EVENT_MAP = { mouseleave: 'mouseout', mouseenter: 'mouseover' };\nvar jqLiteMinErr = minErr('jqLite');\n\n/**\n * Converts kebab-case to camelCase.\n * There is also a special case for the ms prefix starting with a lowercase letter.\n * @param name Name to normalize\n */\nfunction cssKebabToCamel(name) {\n return kebabToCamel(name.replace(MS_HACK_REGEXP, 'ms-'));\n}\n\nfunction fnCamelCaseReplace(all, letter) {\n return letter.toUpperCase();\n}\n\n/**\n * Converts kebab-case to camelCase.\n * @param name Name to normalize\n */\nfunction kebabToCamel(name) {\n return name\n .replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace);\n}\n\nvar SINGLE_TAG_REGEXP = /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;\nvar HTML_REGEXP = /<|&#?\\w+;/;\nvar TAG_NAME_REGEXP = /<([\\w:-]+)/;\nvar XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi;\n\nvar wrapMap = {\n 'option': [1, '<select multiple=\"multiple\">', '</select>'],\n\n 'thead': [1, '<table>', '</table>'],\n 'col': [2, '<table><colgroup>', '</colgroup></table>'],\n 'tr': [2, '<table><tbody>', '</tbody></table>'],\n 'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],\n '_default': [0, '', '']\n};\n\nwrapMap.optgroup = wrapMap.option;\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction jqLiteIsTextNode(html) {\n return !HTML_REGEXP.test(html);\n}\n\nfunction jqLiteAcceptsData(node) {\n // The window object can accept data but has no nodeType\n // Otherwise we are only interested in elements (1) and documents (9)\n var nodeType = node.nodeType;\n return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n}\n\nfunction jqLiteHasData(node) {\n for (var key in jqCache[node.ng339]) {\n return true;\n }\n return false;\n}\n\nfunction jqLiteBuildFragment(html, context) {\n var tmp, tag, wrap,\n fragment = context.createDocumentFragment(),\n nodes = [], i;\n\n if (jqLiteIsTextNode(html)) {\n // Convert non-html into a text node\n nodes.push(context.createTextNode(html));\n } else {\n // Convert html into DOM nodes\n tmp = fragment.appendChild(context.createElement('div'));\n tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase();\n wrap = wrapMap[tag] || wrapMap._default;\n tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, '<$1></$2>') + wrap[2];\n\n // Descend through wrappers to the right content\n i = wrap[0];\n while (i--) {\n tmp = tmp.lastChild;\n }\n\n nodes = concat(nodes, tmp.childNodes);\n\n tmp = fragment.firstChild;\n tmp.textContent = '';\n }\n\n // Remove wrapper from fragment\n fragment.textContent = '';\n fragment.innerHTML = ''; // Clear inner HTML\n forEach(nodes, function(node) {\n fragment.appendChild(node);\n });\n\n return fragment;\n}\n\nfunction jqLiteParseHTML(html, context) {\n context = context || window.document;\n var parsed;\n\n if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {\n return [context.createElement(parsed[1])];\n }\n\n if ((parsed = jqLiteBuildFragment(html, context))) {\n return parsed.childNodes;\n }\n\n return [];\n}\n\nfunction jqLiteWrapNode(node, wrapper) {\n var parent = node.parentNode;\n\n if (parent) {\n parent.replaceChild(wrapper, node);\n }\n\n wrapper.appendChild(node);\n}\n\n\n// IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\nvar jqLiteContains = window.Node.prototype.contains || /** @this */ function(arg) {\n // eslint-disable-next-line no-bitwise\n return !!(this.compareDocumentPosition(arg) & 16);\n};\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n if (element instanceof JQLite) {\n return element;\n }\n\n var argIsString;\n\n if (isString(element)) {\n element = trim(element);\n argIsString = true;\n }\n if (!(this instanceof JQLite)) {\n if (argIsString && element.charAt(0) !== '<') {\n throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n }\n return new JQLite(element);\n }\n\n if (argIsString) {\n jqLiteAddNodes(this, jqLiteParseHTML(element));\n } else if (isFunction(element)) {\n jqLiteReady(element);\n } else {\n jqLiteAddNodes(this, element);\n }\n}\n\nfunction jqLiteClone(element) {\n return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element, onlyDescendants) {\n if (!onlyDescendants && jqLiteAcceptsData(element)) jqLite.cleanData([element]);\n\n if (element.querySelectorAll) {\n jqLite.cleanData(element.querySelectorAll('*'));\n }\n}\n\nfunction jqLiteOff(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var handle = expandoStore && expandoStore.handle;\n\n if (!handle) return; //no listeners registered\n\n if (!type) {\n for (type in events) {\n if (type !== '$destroy') {\n element.removeEventListener(type, handle);\n }\n delete events[type];\n }\n } else {\n\n var removeHandler = function(type) {\n var listenerFns = events[type];\n if (isDefined(fn)) {\n arrayRemove(listenerFns || [], fn);\n }\n if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {\n element.removeEventListener(type, handle);\n delete events[type];\n }\n };\n\n forEach(type.split(' '), function(type) {\n removeHandler(type);\n if (MOUSE_EVENT_MAP[type]) {\n removeHandler(MOUSE_EVENT_MAP[type]);\n }\n });\n }\n}\n\nfunction jqLiteRemoveData(element, name) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n\n if (expandoStore) {\n if (name) {\n delete expandoStore.data[name];\n return;\n }\n\n if (expandoStore.handle) {\n if (expandoStore.events.$destroy) {\n expandoStore.handle({}, '$destroy');\n }\n jqLiteOff(element);\n }\n delete jqCache[expandoId];\n element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n }\n}\n\n\nfunction jqLiteExpandoStore(element, createIfNecessary) {\n var expandoId = element.ng339,\n expandoStore = expandoId && jqCache[expandoId];\n\n if (createIfNecessary && !expandoStore) {\n element.ng339 = expandoId = jqNextId();\n expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};\n }\n\n return expandoStore;\n}\n\n\nfunction jqLiteData(element, key, value) {\n if (jqLiteAcceptsData(element)) {\n var prop;\n\n var isSimpleSetter = isDefined(value);\n var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n var massGetter = !key;\n var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n var data = expandoStore && expandoStore.data;\n\n if (isSimpleSetter) { // data('key', value)\n data[kebabToCamel(key)] = value;\n } else {\n if (massGetter) { // data()\n return data;\n } else {\n if (isSimpleGetter) { // data('key')\n // don't force creation of expandoStore if it doesn't exist yet\n return data && data[kebabToCamel(key)];\n } else { // mass-setter: data({key1: val1, key2: val2})\n for (prop in key) {\n data[kebabToCamel(prop)] = key[prop];\n }\n }\n }\n }\n }\n}\n\nfunction jqLiteHasClass(element, selector) {\n if (!element.getAttribute) return false;\n return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\\n\\t]/g, ' ').\n indexOf(' ' + selector + ' ') > -1);\n}\n\nfunction jqLiteRemoveClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n forEach(cssClasses.split(' '), function(cssClass) {\n element.setAttribute('class', trim(\n (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, ' ')\n .replace(' ' + trim(cssClass) + ' ', ' '))\n );\n });\n }\n}\n\nfunction jqLiteAddClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, ' ');\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n existingClasses += cssClass + ' ';\n }\n });\n\n element.setAttribute('class', trim(existingClasses));\n }\n}\n\n\nfunction jqLiteAddNodes(root, elements) {\n // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n if (elements) {\n\n // if a Node (the most common case)\n if (elements.nodeType) {\n root[root.length++] = elements;\n } else {\n var length = elements.length;\n\n // if an Array or NodeList and not a Window\n if (typeof length === 'number' && elements.window !== elements) {\n if (length) {\n for (var i = 0; i < length; i++) {\n root[root.length++] = elements[i];\n }\n }\n } else {\n root[root.length++] = elements;\n }\n }\n }\n}\n\n\nfunction jqLiteController(element, name) {\n return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n // if element is the document object work with the html element instead\n // this makes $(document).scope() possible\n if (element.nodeType === NODE_TYPE_DOCUMENT) {\n element = element.documentElement;\n }\n var names = isArray(name) ? name : [name];\n\n while (element) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n if (isDefined(value = jqLite.data(element, names[i]))) return value;\n }\n\n // If dealing with a document fragment node with a host element, and no parent, use the host\n // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n // to lookup parent controllers.\n element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);\n }\n}\n\nfunction jqLiteEmpty(element) {\n jqLiteDealoc(element, true);\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\n\nfunction jqLiteRemove(element, keepData) {\n if (!keepData) jqLiteDealoc(element);\n var parent = element.parentNode;\n if (parent) parent.removeChild(element);\n}\n\n\nfunction jqLiteDocumentLoaded(action, win) {\n win = win || window;\n if (win.document.readyState === 'complete') {\n // Force the action to be run async for consistent behavior\n // from the action's point of view\n // i.e. it will definitely not be in a $apply\n win.setTimeout(action);\n } else {\n // No need to unbind this handler as load is only ever called once\n jqLite(win).on('load', action);\n }\n}\n\nfunction jqLiteReady(fn) {\n function trigger() {\n window.document.removeEventListener('DOMContentLoaded', trigger);\n window.removeEventListener('load', trigger);\n fn();\n }\n\n // check if document is already loaded\n if (window.document.readyState === 'complete') {\n window.setTimeout(fn);\n } else {\n // We can not use jqLite since we are not done loading and jQuery could be loaded later.\n\n // Works for modern browsers and IE9\n window.document.addEventListener('DOMContentLoaded', trigger);\n\n // Fallback to window.onload for others\n window.addEventListener('load', trigger);\n }\n}\n\n//////////////////////////////////////////\n// Functions which are declared directly.\n//////////////////////////////////////////\nvar JQLitePrototype = JQLite.prototype = {\n ready: jqLiteReady,\n toString: function() {\n var value = [];\n forEach(this, function(e) { value.push('' + e);});\n return '[' + value.join(', ') + ']';\n },\n\n eq: function(index) {\n return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);\n },\n\n length: 0,\n push: push,\n sort: [].sort,\n splice: [].splice\n};\n\n//////////////////////////////////////////\n// Functions iterating getter/setters.\n// these functions return self on setter and\n// value on get.\n//////////////////////////////////////////\nvar BOOLEAN_ATTR = {};\nforEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {\n BOOLEAN_ATTR[lowercase(value)] = value;\n});\nvar BOOLEAN_ELEMENTS = {};\nforEach('input,select,option,textarea,button,form,details'.split(','), function(value) {\n BOOLEAN_ELEMENTS[value] = true;\n});\nvar ALIASED_ATTR = {\n 'ngMinlength': 'minlength',\n 'ngMaxlength': 'maxlength',\n 'ngMin': 'min',\n 'ngMax': 'max',\n 'ngPattern': 'pattern',\n 'ngStep': 'step'\n};\n\nfunction getBooleanAttrName(element, name) {\n // check dom last since we will most likely fail on name\n var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n // booleanAttr is here twice to minimize DOM access\n return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n}\n\nfunction getAliasedAttrName(name) {\n return ALIASED_ATTR[name];\n}\n\nforEach({\n data: jqLiteData,\n removeData: jqLiteRemoveData,\n hasData: jqLiteHasData,\n cleanData: function jqLiteCleanData(nodes) {\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n jqLiteRemoveData(nodes[i]);\n }\n }\n}, function(fn, name) {\n JQLite[name] = fn;\n});\n\nforEach({\n data: jqLiteData,\n inheritedData: jqLiteInheritedData,\n\n scope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n },\n\n isolateScope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n },\n\n controller: jqLiteController,\n\n injector: function(element) {\n return jqLiteInheritedData(element, '$injector');\n },\n\n removeAttr: function(element, name) {\n element.removeAttribute(name);\n },\n\n hasClass: jqLiteHasClass,\n\n css: function(element, name, value) {\n name = cssKebabToCamel(name);\n\n if (isDefined(value)) {\n element.style[name] = value;\n } else {\n return element.style[name];\n }\n },\n\n attr: function(element, name, value) {\n var ret;\n var nodeType = element.nodeType;\n if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT ||\n !element.getAttribute) {\n return;\n }\n\n var lowercasedName = lowercase(name);\n var isBooleanAttr = BOOLEAN_ATTR[lowercasedName];\n\n if (isDefined(value)) {\n // setter\n\n if (value === null || (value === false && isBooleanAttr)) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, isBooleanAttr ? lowercasedName : value);\n }\n } else {\n // getter\n\n ret = element.getAttribute(name);\n\n if (isBooleanAttr && ret !== null) {\n ret = lowercasedName;\n }\n // Normalize non-existing attributes to undefined (as jQuery).\n return ret === null ? undefined : ret;\n }\n },\n\n prop: function(element, name, value) {\n if (isDefined(value)) {\n element[name] = value;\n } else {\n return element[name];\n }\n },\n\n text: (function() {\n getText.$dv = '';\n return getText;\n\n function getText(element, value) {\n if (isUndefined(value)) {\n var nodeType = element.nodeType;\n return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';\n }\n element.textContent = value;\n }\n })(),\n\n val: function(element, value) {\n if (isUndefined(value)) {\n if (element.multiple && nodeName_(element) === 'select') {\n var result = [];\n forEach(element.options, function(option) {\n if (option.selected) {\n result.push(option.value || option.text);\n }\n });\n return result;\n }\n return element.value;\n }\n element.value = value;\n },\n\n html: function(element, value) {\n if (isUndefined(value)) {\n return element.innerHTML;\n }\n jqLiteDealoc(element, true);\n element.innerHTML = value;\n },\n\n empty: jqLiteEmpty\n}, function(fn, name) {\n /**\n * Properties: writes return selection, reads return first value\n */\n JQLite.prototype[name] = function(arg1, arg2) {\n var i, key;\n var nodeCount = this.length;\n\n // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n // in a way that survives minification.\n // jqLiteEmpty takes no arguments but is a setter.\n if (fn !== jqLiteEmpty &&\n (isUndefined((fn.length === 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {\n if (isObject(arg1)) {\n\n // we are a write, but the object properties are the key/values\n for (i = 0; i < nodeCount; i++) {\n if (fn === jqLiteData) {\n // data() takes the whole object in jQuery\n fn(this[i], arg1);\n } else {\n for (key in arg1) {\n fn(this[i], key, arg1[key]);\n }\n }\n }\n // return self for chaining\n return this;\n } else {\n // we are a read, so read the first child.\n // TODO: do we still need this?\n var value = fn.$dv;\n // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;\n for (var j = 0; j < jj; j++) {\n var nodeValue = fn(this[j], arg1, arg2);\n value = value ? value + nodeValue : nodeValue;\n }\n return value;\n }\n } else {\n // we are a write, so apply to all children\n for (i = 0; i < nodeCount; i++) {\n fn(this[i], arg1, arg2);\n }\n // return self for chaining\n return this;\n }\n };\n});\n\nfunction createEventHandler(element, events) {\n var eventHandler = function(event, type) {\n // jQuery specific api\n event.isDefaultPrevented = function() {\n return event.defaultPrevented;\n };\n\n var eventFns = events[type || event.type];\n var eventFnsLength = eventFns ? eventFns.length : 0;\n\n if (!eventFnsLength) return;\n\n if (isUndefined(event.immediatePropagationStopped)) {\n var originalStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function() {\n event.immediatePropagationStopped = true;\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (originalStopImmediatePropagation) {\n originalStopImmediatePropagation.call(event);\n }\n };\n }\n\n event.isImmediatePropagationStopped = function() {\n return event.immediatePropagationStopped === true;\n };\n\n // Some events have special handlers that wrap the real handler\n var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;\n\n // Copy event handlers in case event handlers array is modified during execution.\n if ((eventFnsLength > 1)) {\n eventFns = shallowCopy(eventFns);\n }\n\n for (var i = 0; i < eventFnsLength; i++) {\n if (!event.isImmediatePropagationStopped()) {\n handlerWrapper(element, event, eventFns[i]);\n }\n }\n };\n\n // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n // events on `element`\n eventHandler.elem = element;\n return eventHandler;\n}\n\nfunction defaultHandlerWrapper(element, event, handler) {\n handler.call(element, event);\n}\n\nfunction specialMouseHandlerWrapper(target, event, handler) {\n // Refer to jQuery's implementation of mouseenter & mouseleave\n // Read about mouseenter and mouseleave:\n // http://www.quirksmode.org/js/events_mouse.html#link8\n var related = event.relatedTarget;\n // For mousenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n if (!related || (related !== target && !jqLiteContains.call(target, related))) {\n handler.call(target, event);\n }\n}\n\n//////////////////////////////////////////\n// Functions iterating traversal.\n// These functions chain results into a single\n// selector.\n//////////////////////////////////////////\nforEach({\n removeData: jqLiteRemoveData,\n\n on: function jqLiteOn(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n // Do not add event handlers to non-elements because they will not be cleaned up.\n if (!jqLiteAcceptsData(element)) {\n return;\n }\n\n var expandoStore = jqLiteExpandoStore(element, true);\n var events = expandoStore.events;\n var handle = expandoStore.handle;\n\n if (!handle) {\n handle = expandoStore.handle = createEventHandler(element, events);\n }\n\n // http://jsperf.com/string-indexof-vs-split\n var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n var i = types.length;\n\n var addHandler = function(type, specialHandlerWrapper, noEventListener) {\n var eventFns = events[type];\n\n if (!eventFns) {\n eventFns = events[type] = [];\n eventFns.specialHandlerWrapper = specialHandlerWrapper;\n if (type !== '$destroy' && !noEventListener) {\n element.addEventListener(type, handle);\n }\n }\n\n eventFns.push(fn);\n };\n\n while (i--) {\n type = types[i];\n if (MOUSE_EVENT_MAP[type]) {\n addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);\n addHandler(type, undefined, true);\n } else {\n addHandler(type);\n }\n }\n },\n\n off: jqLiteOff,\n\n one: function(element, type, fn) {\n element = jqLite(element);\n\n //add the listener twice so that when it is called\n //you can remove the original function and still be\n //able to call element.off(ev, fn) normally\n element.on(type, function onFn() {\n element.off(type, fn);\n element.off(type, onFn);\n });\n element.on(type, fn);\n },\n\n replaceWith: function(element, replaceNode) {\n var index, parent = element.parentNode;\n jqLiteDealoc(element);\n forEach(new JQLite(replaceNode), function(node) {\n if (index) {\n parent.insertBefore(node, index.nextSibling);\n } else {\n parent.replaceChild(node, element);\n }\n index = node;\n });\n },\n\n children: function(element) {\n var children = [];\n forEach(element.childNodes, function(element) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n children.push(element);\n }\n });\n return children;\n },\n\n contents: function(element) {\n return element.contentDocument || element.childNodes || [];\n },\n\n append: function(element, node) {\n var nodeType = element.nodeType;\n if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n\n node = new JQLite(node);\n\n for (var i = 0, ii = node.length; i < ii; i++) {\n var child = node[i];\n element.appendChild(child);\n }\n },\n\n prepend: function(element, node) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n var index = element.firstChild;\n forEach(new JQLite(node), function(child) {\n element.insertBefore(child, index);\n });\n }\n },\n\n wrap: function(element, wrapNode) {\n jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);\n },\n\n remove: jqLiteRemove,\n\n detach: function(element) {\n jqLiteRemove(element, true);\n },\n\n after: function(element, newElement) {\n var index = element, parent = element.parentNode;\n\n if (parent) {\n newElement = new JQLite(newElement);\n\n for (var i = 0, ii = newElement.length; i < ii; i++) {\n var node = newElement[i];\n parent.insertBefore(node, index.nextSibling);\n index = node;\n }\n }\n },\n\n addClass: jqLiteAddClass,\n removeClass: jqLiteRemoveClass,\n\n toggleClass: function(element, selector, condition) {\n if (selector) {\n forEach(selector.split(' '), function(className) {\n var classCondition = condition;\n if (isUndefined(classCondition)) {\n classCondition = !jqLiteHasClass(element, className);\n }\n (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n });\n }\n },\n\n parent: function(element) {\n var parent = element.parentNode;\n return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n },\n\n next: function(element) {\n return element.nextElementSibling;\n },\n\n find: function(element, selector) {\n if (element.getElementsByTagName) {\n return element.getElementsByTagName(selector);\n } else {\n return [];\n }\n },\n\n clone: jqLiteClone,\n\n triggerHandler: function(element, event, extraParameters) {\n\n var dummyEvent, eventFnsCopy, handlerArgs;\n var eventName = event.type || event;\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var eventFns = events && events[eventName];\n\n if (eventFns) {\n // Create a dummy event to pass to the handlers\n dummyEvent = {\n preventDefault: function() { this.defaultPrevented = true; },\n isDefaultPrevented: function() { return this.defaultPrevented === true; },\n stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },\n isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },\n stopPropagation: noop,\n type: eventName,\n target: element\n };\n\n // If a custom event was provided then extend our dummy event with it\n if (event.type) {\n dummyEvent = extend(dummyEvent, event);\n }\n\n // Copy event handlers in case event handlers array is modified during execution.\n eventFnsCopy = shallowCopy(eventFns);\n handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n\n forEach(eventFnsCopy, function(fn) {\n if (!dummyEvent.isImmediatePropagationStopped()) {\n fn.apply(element, handlerArgs);\n }\n });\n }\n }\n}, function(fn, name) {\n /**\n * chaining functions\n */\n JQLite.prototype[name] = function(arg1, arg2, arg3) {\n var value;\n\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (isUndefined(value)) {\n value = fn(this[i], arg1, arg2, arg3);\n if (isDefined(value)) {\n // any function which returns a value needs to be wrapped\n value = jqLite(value);\n }\n } else {\n jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n }\n }\n return isDefined(value) ? value : this;\n };\n});\n\n// bind legacy bind/unbind to on/off\nJQLite.prototype.bind = JQLite.prototype.on;\nJQLite.prototype.unbind = JQLite.prototype.off;\n\n\n// Provider for private $$jqLite service\n/** @this */\nfunction $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}\n\n/**\n * Computes a hash of an 'obj'.\n * Hash of a:\n * string is string\n * number is number as string\n * object is either result of calling $$hashKey function on the object or uniquely generated id,\n * that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n * The resulting string key is in 'type:hashKey' format.\n */\nfunction hashKey(obj, nextUidFn) {\n var key = obj && obj.$$hashKey;\n\n if (key) {\n if (typeof key === 'function') {\n key = obj.$$hashKey();\n }\n return key;\n }\n\n var objType = typeof obj;\n if (objType === 'function' || (objType === 'object' && obj !== null)) {\n key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n } else {\n key = objType + ':' + obj;\n }\n\n return key;\n}\n\n// A minimal ES2015 Map implementation.\n// Should be bug/feature equivalent to the native implementations of supported browsers\n// (for the features required in Angular).\n// See https://kangax.github.io/compat-table/es6/#test-Map\nvar nanKey = Object.create(null);\nfunction NgMapShim() {\n this._keys = [];\n this._values = [];\n this._lastKey = NaN;\n this._lastIndex = -1;\n}\nNgMapShim.prototype = {\n _idx: function(key) {\n if (key === this._lastKey) {\n return this._lastIndex;\n }\n this._lastKey = key;\n this._lastIndex = this._keys.indexOf(key);\n return this._lastIndex;\n },\n _transformKey: function(key) {\n return isNumberNaN(key) ? nanKey : key;\n },\n get: function(key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx !== -1) {\n return this._values[idx];\n }\n },\n set: function(key, value) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx === -1) {\n idx = this._lastIndex = this._keys.length;\n }\n this._keys[idx] = key;\n this._values[idx] = value;\n\n // Support: IE11\n // Do not `return this` to simulate the partial IE11 implementation\n },\n delete: function(key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx === -1) {\n return false;\n }\n this._keys.splice(idx, 1);\n this._values.splice(idx, 1);\n this._lastKey = NaN;\n this._lastIndex = -1;\n return true;\n }\n};\n\n// For now, always use `NgMapShim`, even if `window.Map` is available. Some native implementations\n// are still buggy (often in subtle ways) and can cause hard-to-debug failures. When native `Map`\n// implementations get more stable, we can reconsider switching to `window.Map` (when available).\nvar NgMap = NgMapShim;\n\nvar $$MapProvider = [/** @this */function() {\n this.$get = [function() {\n return NgMap;\n }];\n}];\n\n/**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.<string|Function>} modules A list of module functions or their aliases. See\n * {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n * disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n * // create an injector\n * var $injector = angular.injector(['ng']);\n *\n * // use the injector to kick off your application\n * // use the type inference to auto inject arguments, or use implicit injection\n * $injector.invoke(function($rootScope, $compile, $document) {\n * $compile($document)($rootScope);\n * $rootScope.$digest();\n * });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running Angular app\n * from outside Angular. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('<div ng-controller=\"MyCtrl\">{{content.label}}</div>');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n * var scope = angular.element($div).scope();\n * $compile($div)(scope);\n * });\n * ```\n */\n\n\n/**\n * @ngdoc module\n * @name auto\n * @installation\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\nvar ARROW_ARG = /^([^(]+?)=>/;\nvar FN_ARGS = /^[^(]*\\(\\s*([^)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar $injectorMinErr = minErr('$injector');\n\nfunction stringifyFn(fn) {\n return Function.prototype.toString.call(fn);\n}\n\nfunction extractArgs(fn) {\n var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''),\n args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);\n return args;\n}\n\nfunction anonFn(fn) {\n // For anonymous functions, showing at the very least the function signature can help in\n // debugging.\n var args = extractArgs(fn);\n if (args) {\n return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n }\n return 'fn';\n}\n\nfunction annotate(fn, strictDi, name) {\n var $inject,\n argDecl,\n last;\n\n if (typeof fn === 'function') {\n if (!($inject = fn.$inject)) {\n $inject = [];\n if (fn.length) {\n if (strictDi) {\n if (!isString(name) || !name) {\n name = fn.name || anonFn(fn);\n }\n throw $injectorMinErr('strictdi',\n '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n }\n argDecl = extractArgs(fn);\n forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {\n arg.replace(FN_ARG, function(all, underscore, name) {\n $inject.push(name);\n });\n });\n }\n fn.$inject = $inject;\n }\n } else if (isArray(fn)) {\n last = fn.length - 1;\n assertArgFn(fn[last], 'fn');\n $inject = fn.slice(0, last);\n } else {\n assertArgFn(fn, 'fn', true);\n }\n return $inject;\n}\n\n///////////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n * var $injector = angular.injector();\n * expect($injector.get('$injector')).toBe($injector);\n * expect($injector.invoke(function($injector) {\n * return $injector;\n * })).toBe($injector);\n * ```\n *\n * # Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n * // inferred (only works if code not minified/obfuscated)\n * $injector.invoke(function(serviceA){});\n *\n * // annotated\n * function explicit(serviceA) {};\n * explicit.$inject = ['serviceA'];\n * $injector.invoke(explicit);\n *\n * // inline\n * $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ## Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ## `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ## Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n/**\n * @ngdoc property\n * @name $injector#modules\n * @type {Object}\n * @description\n * A hash containing all the modules that have been loaded into the\n * $injector.\n *\n * You can use this property to find out information about a module via the\n * {@link angular.Module#info `myModule.info(...)`} method.\n *\n * For example:\n *\n * ```\n * var info = $injector.modules['ngAnimate'].info();\n * ```\n *\n * **Do not use this property to attempt to modify the modules after the application\n * has been bootstrapped.**\n */\n\n\n/**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string=} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {Function|Array.<string|Function>} fn The injectable function to invoke. Function parameters are\n * injected according to the {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n/**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n/**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * # Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n * // Given\n * function MyController($scope, $route) {\n * // ...\n * }\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * # The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n * // Given\n * var MyController = function(obfuscatedScope, obfuscatedRoute) {\n * // ...\n * }\n * // Define function dependencies\n * MyController['$inject'] = ['$scope', '$route'];\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * # The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n * // We wish to write this (not minification / obfuscation safe)\n * injector.invoke(function($compile, $rootScope) {\n * // ...\n * });\n *\n * // We are forced to write break inlining\n * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n * // ...\n * };\n * tmpFn.$inject = ['$compile', '$rootScope'];\n * injector.invoke(tmpFn);\n *\n * // To better support inline function the inline annotation is supported\n * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n * // ...\n * }]);\n *\n * // Therefore\n * expect(injector.annotate(\n * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n * ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.<string>} The names of the services which the function requires.\n */\n\n\n\n/**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An Angular **service** is a singleton object created by a **service factory**. These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider. The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(name, provider)} - registers a **service provider** with the\n * {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(name, obj)} - registers a value/object that can be accessed by\n * providers and services.\n * * {@link auto.$provide#value value(name, obj)} - registers a value/object that can only be accessed by\n * services, not providers.\n * * {@link auto.$provide#factory factory(name, fn)} - registers a service **factory function**\n * that will be wrapped in a **service provider** object, whose `$get` property will contain the\n * given factory function.\n * * {@link auto.$provide#service service(name, Fn)} - registers a **constructor function**\n * that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n * a new object using the given constructor function.\n * * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function** that\n * will be able to modify or replace the implementation of another service.\n *\n * See the individual methods for more information and examples.\n */\n\n/**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n 'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n * - `Constructor`: a new instance of the provider will be created using\n * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n\n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n * // Define the eventTracker provider\n * function EventTrackerProvider() {\n * var trackingUrl = '/track';\n *\n * // A provider method for configuring where the tracked events should been saved\n * this.setTrackingUrl = function(url) {\n * trackingUrl = url;\n * };\n *\n * // The service factory function\n * this.$get = ['$http', function($http) {\n * var trackedEvents = {};\n * return {\n * // Call this to track an event\n * event: function(event) {\n * var count = trackedEvents[event] || 0;\n * count += 1;\n * trackedEvents[event] = count;\n * return count;\n * },\n * // Call this to save the tracked events to the trackingUrl\n * save: function() {\n * $http.post(trackingUrl, trackedEvents);\n * }\n * };\n * }];\n * }\n *\n * describe('eventTracker', function() {\n * var postSpy;\n *\n * beforeEach(module(function($provide) {\n * // Register the eventTracker provider\n * $provide.provider('eventTracker', EventTrackerProvider);\n * }));\n *\n * beforeEach(module(function(eventTrackerProvider) {\n * // Configure eventTracker provider\n * eventTrackerProvider.setTrackingUrl('/custom-track');\n * }));\n *\n * it('tracks events', inject(function(eventTracker) {\n * expect(eventTracker.event('login')).toEqual(1);\n * expect(eventTracker.event('login')).toEqual(2);\n * }));\n *\n * it('saves to the tracking url', inject(function(eventTracker, $http) {\n * postSpy = spyOn($http, 'post');\n * eventTracker.event('login');\n * eventTracker.save();\n * expect(postSpy).toHaveBeenCalled();\n * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n * }));\n * });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.<string|Function>} $getFn The injectable $getFn for the instance creation.\n * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n * $provide.factory('ping', ['$http', function($http) {\n * return function ping() {\n * return $http.send('/ping');\n * };\n * }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is a factory\n * function that returns an instance instantiated by the injector from the service constructor\n * function.\n *\n * Internally it looks a bit like this:\n *\n * ```\n * {\n * $get: function() {\n * return $injector.instantiate(constructor);\n * }\n * }\n * ```\n *\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.<string|Function>} constructor An injectable class (constructor function)\n * that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n * var Ping = function($http) {\n * this.$http = $http;\n * };\n *\n * Ping.$inject = ['$http'];\n *\n * Ping.prototype.send = function() {\n * return this.$http.get('/ping');\n * };\n * $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping.send();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function. This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**. That also means it is not possible to inject other services into a value service.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n * $provide.value('ADMIN_USER', 'admin');\n *\n * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n * $provide.value('halfOf', function(value) {\n * return value / 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service** with the {@link auto.$injector $injector}, such as a string,\n * a number, an array, an object or a function. Like the {@link auto.$provide#value value}, it is not\n * possible to inject other services into a constant.\n *\n * But unlike {@link auto.$provide#value value}, a constant can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n * $provide.constant('SHARD_HEIGHT', 306);\n *\n * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n * $provide.constant('double', function(value) {\n * return value * 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function\n * intercepts the creation of a service, allowing it to override or modify the behavior of the\n * service. The return value of the decorator function may be the original service, or a new service\n * that replaces (or wraps and delegates to) the original service.\n *\n * You can find out more about using decorators in the {@link guide/decorators} guide.\n *\n * @param {string} name The name of the service to decorate.\n * @param {Function|Array.<string|Function>} decorator This function will be invoked when the service needs to be\n * provided and should return the decorated service instance. The function is called using\n * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n * Local injection arguments:\n *\n * * `$delegate` - The original service instance, which can be replaced, monkey patched, configured,\n * decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n * $provide.decorator('$log', ['$delegate', function($delegate) {\n * $delegate.warn = $delegate.error;\n * return $delegate;\n * }]);\n * ```\n */\n\n\nfunction createInjector(modulesToLoad, strictDi) {\n strictDi = (strictDi === true);\n var INSTANTIATING = {},\n providerSuffix = 'Provider',\n path = [],\n loadedModules = new NgMap(),\n providerCache = {\n $provide: {\n provider: supportObject(provider),\n factory: supportObject(factory),\n service: supportObject(service),\n value: supportObject(value),\n constant: supportObject(constant),\n decorator: decorator\n }\n },\n providerInjector = (providerCache.$injector =\n createInternalInjector(providerCache, function(serviceName, caller) {\n if (angular.isString(caller)) {\n path.push(caller);\n }\n throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- '));\n })),\n instanceCache = {},\n protoInstanceInjector =\n createInternalInjector(instanceCache, function(serviceName, caller) {\n var provider = providerInjector.get(serviceName + providerSuffix, caller);\n return instanceInjector.invoke(\n provider.$get, provider, undefined, serviceName);\n }),\n instanceInjector = protoInstanceInjector;\n\n providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) };\n instanceInjector.modules = providerInjector.modules = createMap();\n var runBlocks = loadModules(modulesToLoad);\n instanceInjector = protoInstanceInjector.get('$injector');\n instanceInjector.strictDi = strictDi;\n forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });\n\n return instanceInjector;\n\n ////////////////////////////////////\n // $provider\n ////////////////////////////////////\n\n function supportObject(delegate) {\n return function(key, value) {\n if (isObject(key)) {\n forEach(key, reverseParams(delegate));\n } else {\n return delegate(key, value);\n }\n };\n }\n\n function provider(name, provider_) {\n assertNotHasOwnProperty(name, 'service');\n if (isFunction(provider_) || isArray(provider_)) {\n provider_ = providerInjector.instantiate(provider_);\n }\n if (!provider_.$get) {\n throw $injectorMinErr('pget', 'Provider \\'{0}\\' must define $get factory method.', name);\n }\n return (providerCache[name + providerSuffix] = provider_);\n }\n\n function enforceReturnValue(name, factory) {\n return /** @this */ function enforcedReturnValue() {\n var result = instanceInjector.invoke(factory, this);\n if (isUndefined(result)) {\n throw $injectorMinErr('undef', 'Provider \\'{0}\\' must return a value from $get factory method.', name);\n }\n return result;\n };\n }\n\n function factory(name, factoryFn, enforce) {\n return provider(name, {\n $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n });\n }\n\n function service(name, constructor) {\n return factory(name, ['$injector', function($injector) {\n return $injector.instantiate(constructor);\n }]);\n }\n\n function value(name, val) { return factory(name, valueFn(val), false); }\n\n function constant(name, value) {\n assertNotHasOwnProperty(name, 'constant');\n providerCache[name] = value;\n instanceCache[name] = value;\n }\n\n function decorator(serviceName, decorFn) {\n var origProvider = providerInjector.get(serviceName + providerSuffix),\n orig$get = origProvider.$get;\n\n origProvider.$get = function() {\n var origInstance = instanceInjector.invoke(orig$get, origProvider);\n return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});\n };\n }\n\n ////////////////////////////////////\n // Module Loading\n ////////////////////////////////////\n function loadModules(modulesToLoad) {\n assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');\n var runBlocks = [], moduleFn;\n forEach(modulesToLoad, function(module) {\n if (loadedModules.get(module)) return;\n loadedModules.set(module, true);\n\n function runInvokeQueue(queue) {\n var i, ii;\n for (i = 0, ii = queue.length; i < ii; i++) {\n var invokeArgs = queue[i],\n provider = providerInjector.get(invokeArgs[0]);\n\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n }\n }\n\n try {\n if (isString(module)) {\n moduleFn = angularModule(module);\n instanceInjector.modules[module] = moduleFn;\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n runInvokeQueue(moduleFn._invokeQueue);\n runInvokeQueue(moduleFn._configBlocks);\n } else if (isFunction(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else if (isArray(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else {\n assertArgFn(module, 'module');\n }\n } catch (e) {\n if (isArray(module)) {\n module = module[module.length - 1];\n }\n if (e.message && e.stack && e.stack.indexOf(e.message) === -1) {\n // Safari & FF's stack traces don't contain error.message content\n // unlike those of Chrome and IE\n // So if stack doesn't contain message, we create a new string that contains both.\n // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n // eslint-disable-next-line no-ex-assign\n e = e.message + '\\n' + e.stack;\n }\n throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\\n{1}',\n module, e.stack || e.message || e);\n }\n });\n return runBlocks;\n }\n\n ////////////////////////////////////\n // internal Injector\n ////////////////////////////////////\n\n function createInternalInjector(cache, factory) {\n\n function getService(serviceName, caller) {\n if (cache.hasOwnProperty(serviceName)) {\n if (cache[serviceName] === INSTANTIATING) {\n throw $injectorMinErr('cdep', 'Circular dependency found: {0}',\n serviceName + ' <- ' + path.join(' <- '));\n }\n return cache[serviceName];\n } else {\n try {\n path.unshift(serviceName);\n cache[serviceName] = INSTANTIATING;\n cache[serviceName] = factory(serviceName, caller);\n return cache[serviceName];\n } catch (err) {\n if (cache[serviceName] === INSTANTIATING) {\n delete cache[serviceName];\n }\n throw err;\n } finally {\n path.shift();\n }\n }\n }\n\n\n function injectionArgs(fn, locals, serviceName) {\n var args = [],\n $inject = createInjector.$$annotate(fn, strictDi, serviceName);\n\n for (var i = 0, length = $inject.length; i < length; i++) {\n var key = $inject[i];\n if (typeof key !== 'string') {\n throw $injectorMinErr('itkn',\n 'Incorrect injection token! Expected service name as string, got {0}', key);\n }\n args.push(locals && locals.hasOwnProperty(key) ? locals[key] :\n getService(key, serviceName));\n }\n return args;\n }\n\n function isClass(func) {\n // Support: IE 9-11 only\n // IE 9-11 do not support classes and IE9 leaks with the code below.\n if (msie || typeof func !== 'function') {\n return false;\n }\n var result = func.$$ngIsClass;\n if (!isBoolean(result)) {\n // Support: Edge 12-13 only\n // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6156135/\n result = func.$$ngIsClass = /^(?:class\\b|constructor\\()/.test(stringifyFn(func));\n }\n return result;\n }\n\n function invoke(fn, self, locals, serviceName) {\n if (typeof locals === 'string') {\n serviceName = locals;\n locals = null;\n }\n\n var args = injectionArgs(fn, locals, serviceName);\n if (isArray(fn)) {\n fn = fn[fn.length - 1];\n }\n\n if (!isClass(fn)) {\n // http://jsperf.com/angularjs-invoke-apply-vs-switch\n // #5388\n return fn.apply(self, args);\n } else {\n args.unshift(null);\n return new (Function.prototype.bind.apply(fn, args))();\n }\n }\n\n\n function instantiate(Type, locals, serviceName) {\n // Check if Type is annotated and use just the given function at n-1 as parameter\n // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);\n var args = injectionArgs(Type, locals, serviceName);\n // Empty object at position 0 is ignored for invocation with `new`, but required.\n args.unshift(null);\n return new (Function.prototype.bind.apply(ctor, args))();\n }\n\n\n return {\n invoke: invoke,\n instantiate: instantiate,\n get: getService,\n annotate: createInjector.$$annotate,\n has: function(name) {\n return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n }\n };\n }\n}\n\ncreateInjector.$$annotate = annotate;\n\n/**\n * @ngdoc provider\n * @name $anchorScrollProvider\n * @this\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\nfunction $AnchorScrollProvider() {\n\n var autoScrollingEnabled = true;\n\n /**\n * @ngdoc method\n * @name $anchorScrollProvider#disableAutoScrolling\n *\n * @description\n * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />\n * Use this method to disable automatic scrolling.\n *\n * If automatic scrolling is disabled, one must explicitly call\n * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n * current hash.\n */\n this.disableAutoScrolling = function() {\n autoScrollingEnabled = false;\n };\n\n /**\n * @ngdoc service\n * @name $anchorScroll\n * @kind function\n * @requires $window\n * @requires $location\n * @requires $rootScope\n *\n * @description\n * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the\n * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified\n * in the\n * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document).\n *\n * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n * match any anchor whenever it changes. This can be disabled by calling\n * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n *\n * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n * vertical scroll-offset (either fixed or dynamic).\n *\n * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of\n * {@link ng.$location#hash $location.hash()} will be used.\n *\n * @property {(number|function|jqLite)} yOffset\n * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n * positioned elements at the top of the page, such as navbars, headers etc.\n *\n * `yOffset` can be specified in various ways:\n * - **number**: A fixed number of pixels to be used as offset.<br /><br />\n * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n * a number representing the offset (in pixels).<br /><br />\n * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n * the top of the page to the element's bottom will be used as offset.<br />\n * **Note**: The element will be taken into account only as long as its `position` is set to\n * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n * their height and/or positioning according to the viewport's size.\n *\n * <br />\n * <div class=\"alert alert-warning\">\n * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n * not some child element.\n * </div>\n *\n * @example\n <example module=\"anchorScrollExample\" name=\"anchor-scroll\">\n <file name=\"index.html\">\n <div id=\"scrollArea\" ng-controller=\"ScrollController\">\n <a ng-click=\"gotoBottom()\">Go to bottom</a>\n <a id=\"bottom\"></a> You're at the bottom!\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('anchorScrollExample', [])\n .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n function($scope, $location, $anchorScroll) {\n $scope.gotoBottom = function() {\n // set the location.hash to the id of\n // the element you wish to scroll to.\n $location.hash('bottom');\n\n // call $anchorScroll()\n $anchorScroll();\n };\n }]);\n </file>\n <file name=\"style.css\">\n #scrollArea {\n height: 280px;\n overflow: auto;\n }\n\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n </file>\n </example>\n *\n * <hr />\n * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n *\n * @example\n <example module=\"anchorScrollOffsetExample\" name=\"anchor-scroll-offset\">\n <file name=\"index.html\">\n <div class=\"fixed-header\" ng-controller=\"headerCtrl\">\n <a href=\"\" ng-click=\"gotoAnchor(x)\" ng-repeat=\"x in [1,2,3,4,5]\">\n Go to anchor {{x}}\n </a>\n </div>\n <div id=\"anchor{{x}}\" class=\"anchor\" ng-repeat=\"x in [1,2,3,4,5]\">\n Anchor {{x}} of 5\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('anchorScrollOffsetExample', [])\n .run(['$anchorScroll', function($anchorScroll) {\n $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels\n }])\n .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n function($anchorScroll, $location, $scope) {\n $scope.gotoAnchor = function(x) {\n var newHash = 'anchor' + x;\n if ($location.hash() !== newHash) {\n // set the $location.hash to `newHash` and\n // $anchorScroll will automatically scroll to it\n $location.hash('anchor' + x);\n } else {\n // call $anchorScroll() explicitly,\n // since $location.hash hasn't changed\n $anchorScroll();\n }\n };\n }\n ]);\n </file>\n <file name=\"style.css\">\n body {\n padding-top: 50px;\n }\n\n .anchor {\n border: 2px dashed DarkOrchid;\n padding: 10px 10px 200px 10px;\n }\n\n .fixed-header {\n background-color: rgba(0, 0, 0, 0.2);\n height: 50px;\n position: fixed;\n top: 0; left: 0; right: 0;\n }\n\n .fixed-header > a {\n display: inline-block;\n margin: 5px 15px;\n }\n </file>\n </example>\n */\n this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {\n var document = $window.document;\n\n // Helper function to get first anchor from a NodeList\n // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n // and working in all supported browsers.)\n function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }\n\n function getYOffset() {\n\n var offset = scroll.yOffset;\n\n if (isFunction(offset)) {\n offset = offset();\n } else if (isElement(offset)) {\n var elem = offset[0];\n var style = $window.getComputedStyle(elem);\n if (style.position !== 'fixed') {\n offset = 0;\n } else {\n offset = elem.getBoundingClientRect().bottom;\n }\n } else if (!isNumber(offset)) {\n offset = 0;\n }\n\n return offset;\n }\n\n function scrollTo(elem) {\n if (elem) {\n elem.scrollIntoView();\n\n var offset = getYOffset();\n\n if (offset) {\n // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n // top of the viewport.\n //\n // IF the number of pixels from the top of `elem` to the end of the page's content is less\n // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n // way down the page.\n //\n // This is often the case for elements near the bottom of the page.\n //\n // In such cases we do not need to scroll the whole `offset` up, just the difference between\n // the top of the element and the offset, which is enough to align the top of `elem` at the\n // desired position.\n var elemTop = elem.getBoundingClientRect().top;\n $window.scrollBy(0, elemTop - offset);\n }\n } else {\n $window.scrollTo(0, 0);\n }\n }\n\n function scroll(hash) {\n // Allow numeric hashes\n hash = isString(hash) ? hash : isNumber(hash) ? hash.toString() : $location.hash();\n var elm;\n\n // empty hash, scroll to the top of the page\n if (!hash) scrollTo(null);\n\n // element with given id\n else if ((elm = document.getElementById(hash))) scrollTo(elm);\n\n // first anchor with given name :-D\n else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);\n\n // no element and hash === 'top', scroll to the top of the page\n else if (hash === 'top') scrollTo(null);\n }\n\n // does not scroll when user clicks on anchor link that is currently on\n // (no url change, no $location.hash() change), browser native does scroll\n if (autoScrollingEnabled) {\n $rootScope.$watch(function autoScrollWatch() {return $location.hash();},\n function autoScrollWatchAction(newVal, oldVal) {\n // skip the initial scroll if $location.hash is empty\n if (newVal === oldVal && newVal === '') return;\n\n jqLiteDocumentLoaded(function() {\n $rootScope.$evalAsync(scroll);\n });\n });\n }\n\n return scroll;\n }];\n}\n\nvar $animateMinErr = minErr('$animate');\nvar ELEMENT_NODE = 1;\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction extractElementNode(element) {\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction splitClasses(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n // Use createMap() to prevent class assumptions involving property names in\n // Object.prototype\n var obj = createMap();\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n}\n\n// if any other type of options value besides an Object value is\n// passed into the $animate.method() animation then this helper code\n// will be run which will ignore it. While this patch is not the\n// greatest solution to this, a lot of existing plugins depend on\n// $animate to either call the callback (< 1.2) or return a promise\n// that can be changed. This helper function ensures that the options\n// are wiped clean incase a callback function is provided.\nfunction prepareAnimateOptions(options) {\n return isObject(options)\n ? options\n : {};\n}\n\nvar $$CoreAnimateJsProvider = /** @this */ function() {\n this.$get = noop;\n};\n\n// this is prefixed with Core since it conflicts with\n// the animateQueueProvider defined in ngAnimate/animateQueue.js\nvar $$CoreAnimateQueueProvider = /** @this */ function() {\n var postDigestQueue = new NgMap();\n var postDigestElements = [];\n\n this.$get = ['$$AnimateRunner', '$rootScope',\n function($$AnimateRunner, $rootScope) {\n return {\n enabled: noop,\n on: noop,\n off: noop,\n pin: noop,\n\n push: function(element, event, options, domOperation) {\n if (domOperation) {\n domOperation();\n }\n\n options = options || {};\n if (options.from) {\n element.css(options.from);\n }\n if (options.to) {\n element.css(options.to);\n }\n\n if (options.addClass || options.removeClass) {\n addRemoveClassesPostDigest(element, options.addClass, options.removeClass);\n }\n\n var runner = new $$AnimateRunner();\n\n // since there are no animations to run the runner needs to be\n // notified that the animation call is complete.\n runner.complete();\n return runner;\n }\n };\n\n\n function updateData(data, classes, value) {\n var changed = false;\n if (classes) {\n classes = isString(classes) ? classes.split(' ') :\n isArray(classes) ? classes : [];\n forEach(classes, function(className) {\n if (className) {\n changed = true;\n data[className] = value;\n }\n });\n }\n return changed;\n }\n\n function handleCSSClassChanges() {\n forEach(postDigestElements, function(element) {\n var data = postDigestQueue.get(element);\n if (data) {\n var existing = splitClasses(element.attr('class'));\n var toAdd = '';\n var toRemove = '';\n forEach(data, function(status, className) {\n var hasClass = !!existing[className];\n if (status !== hasClass) {\n if (status) {\n toAdd += (toAdd.length ? ' ' : '') + className;\n } else {\n toRemove += (toRemove.length ? ' ' : '') + className;\n }\n }\n });\n\n forEach(element, function(elm) {\n if (toAdd) {\n jqLiteAddClass(elm, toAdd);\n }\n if (toRemove) {\n jqLiteRemoveClass(elm, toRemove);\n }\n });\n postDigestQueue.delete(element);\n }\n });\n postDigestElements.length = 0;\n }\n\n\n function addRemoveClassesPostDigest(element, add, remove) {\n var data = postDigestQueue.get(element) || {};\n\n var classesAdded = updateData(data, add, true);\n var classesRemoved = updateData(data, remove, false);\n\n if (classesAdded || classesRemoved) {\n\n postDigestQueue.set(element, data);\n postDigestElements.push(element);\n\n if (postDigestElements.length === 1) {\n $rootScope.$$postDigest(handleCSSClassChanges);\n }\n }\n }\n }];\n};\n\n/**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM updates and resolves the returned runner promise.\n *\n * In order to enable animations the `ngAnimate` module has to be loaded.\n *\n * To see the functional implementation check out `src/ngAnimate/animate.js`.\n */\nvar $AnimateProvider = ['$provide', /** @this */ function($provide) {\n var provider = this;\n var classNameFilter = null;\n var customFilter = null;\n\n this.$$registeredAnimations = Object.create(null);\n\n /**\n * @ngdoc method\n * @name $animateProvider#register\n *\n * @description\n * Registers a new injectable animation factory function. The factory function produces the\n * animation object which contains callback functions for each event that is expected to be\n * animated.\n *\n * * `eventFn`: `function(element, ... , doneFunction, options)`\n * The element to animate, the `doneFunction` and the options fed into the animation. Depending\n * on the type of animation additional arguments will be injected into the animation function. The\n * list below explains the function signatures for the different animation methods:\n *\n * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)\n * - addClass: function(element, addedClasses, doneFunction, options)\n * - removeClass: function(element, removedClasses, doneFunction, options)\n * - enter, leave, move: function(element, doneFunction, options)\n * - animate: function(element, fromStyles, toStyles, doneFunction, options)\n *\n * Make sure to trigger the `doneFunction` once the animation is fully complete.\n *\n * ```js\n * return {\n * //enter, leave, move signature\n * eventFn : function(element, done, options) {\n * //code to run the animation\n * //once complete, then run done()\n * return function endFunction(wasCancelled) {\n * //code to cancel the animation\n * }\n * }\n * }\n * ```\n *\n * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).\n * @param {Function} factory The factory function that will be executed to return the animation\n * object.\n */\n this.register = function(name, factory) {\n if (name && name.charAt(0) !== '.') {\n throw $animateMinErr('notcsel', 'Expecting class selector starting with \\'.\\' got \\'{0}\\'.', name);\n }\n\n var key = name + '-animation';\n provider.$$registeredAnimations[name.substr(1)] = key;\n $provide.factory(key, factory);\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#customFilter\n *\n * @description\n * Sets and/or returns the custom filter function that is used to \"filter\" animations, i.e.\n * determine if an animation is allowed or not. When no filter is specified (the default), no\n * animation will be blocked. Setting the `customFilter` value will only allow animations for\n * which the filter function's return value is truthy.\n *\n * This allows to easily create arbitrarily complex rules for filtering animations, such as\n * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc.\n * Filtering animations can also boost performance for low-powered devices, as well as\n * applications containing a lot of structural operations.\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:**\n * Keep the filtering function as lean as possible, because it will be called for each DOM\n * action (e.g. insertion, removal, class change) performed by \"animation-aware\" directives.\n * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in\n * directives that support animations.\n * Performing computationally expensive or time-consuming operations on each call of the\n * filtering function can make your animations sluggish.\n * </div>\n *\n * **Note:** If present, `customFilter` will be checked before\n * {@link $animateProvider#classNameFilter classNameFilter}.\n *\n * @param {Function=} filterFn - The filter function which will be used to filter all animations.\n * If a falsy value is returned, no animation will be performed. The function will be called\n * with the following arguments:\n * - **node** `{DOMElement}` - The DOM element to be animated.\n * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass`\n * etc).\n * - **options** `{Object}` - A collection of options/styles used for the animation.\n * @return {Function} The current filter function or `null` if there is none set.\n */\n this.customFilter = function(filterFn) {\n if (arguments.length === 1) {\n customFilter = isFunction(filterFn) ? filterFn : null;\n }\n\n return customFilter;\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#classNameFilter\n *\n * @description\n * Sets and/or returns the CSS class regular expression that is checked when performing\n * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n * therefore enable $animate to attempt to perform an animation on any element that is triggered.\n * When setting the `classNameFilter` value, animations will only be performed on elements\n * that successfully match the filter expression. This in turn can boost performance\n * for low-powered devices as well as applications containing a lot of structural operations.\n *\n * **Note:** If present, `classNameFilter` will be checked after\n * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns\n * false, `classNameFilter` will not be checked.\n *\n * @param {RegExp=} expression The className expression which will be checked against all animations\n * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n */\n this.classNameFilter = function(expression) {\n if (arguments.length === 1) {\n classNameFilter = (expression instanceof RegExp) ? expression : null;\n if (classNameFilter) {\n var reservedRegex = new RegExp('[(\\\\s|\\\\/)]' + NG_ANIMATE_CLASSNAME + '[(\\\\s|\\\\/)]');\n if (reservedRegex.test(classNameFilter.toString())) {\n classNameFilter = null;\n throw $animateMinErr('nongcls', '$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the \"{0}\" CSS class.', NG_ANIMATE_CLASSNAME);\n }\n }\n }\n return classNameFilter;\n };\n\n this.$get = ['$$animateQueue', function($$animateQueue) {\n function domInsert(element, parentElement, afterElement) {\n // if for some reason the previous element was removed\n // from the dom sometime before this code runs then let's\n // just stick to using the parent element as the anchor\n if (afterElement) {\n var afterNode = extractElementNode(afterElement);\n if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {\n afterElement = null;\n }\n }\n if (afterElement) {\n afterElement.after(element);\n } else {\n parentElement.prepend(element);\n }\n }\n\n /**\n * @ngdoc service\n * @name $animate\n * @description The $animate service exposes a series of DOM utility methods that provide support\n * for animation hooks. The default behavior is the application of DOM operations, however,\n * when an animation is detected (and animations are enabled), $animate will do the heavy lifting\n * to ensure that animation runs with the triggered DOM operation.\n *\n * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't\n * included and only when it is active then the animation hooks that `$animate` triggers will be\n * functional. Once active then all structural `ng-` directives will trigger animations as they perform\n * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,\n * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.\n *\n * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.\n *\n * To learn more about enabling animation support, click here to visit the\n * {@link ngAnimate ngAnimate module page}.\n */\n return {\n // we don't call it directly since non-existant arguments may\n // be interpreted as null within the sub enabled function\n\n /**\n *\n * @ngdoc method\n * @name $animate#on\n * @kind function\n * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)\n * has fired on the given element or among any of its children. Once the listener is fired, the provided callback\n * is fired with the following params:\n *\n * ```js\n * $animate.on('enter', container,\n * function callback(element, phase) {\n * // cool we detected an enter animation within the container\n * }\n * );\n * ```\n *\n * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)\n * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself\n * as well as among its children\n * @param {Function} callback the callback function that will be fired when the listener is triggered\n *\n * The arguments present in the callback function are:\n * * `element` - The captured DOM element that the animation was fired on.\n * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).\n */\n on: $$animateQueue.on,\n\n /**\n *\n * @ngdoc method\n * @name $animate#off\n * @kind function\n * @description Deregisters an event listener based on the event which has been associated with the provided element. This method\n * can be used in three different ways depending on the arguments:\n *\n * ```js\n * // remove all the animation event listeners listening for `enter`\n * $animate.off('enter');\n *\n * // remove listeners for all animation events from the container element\n * $animate.off(container);\n *\n * // remove all the animation event listeners listening for `enter` on the given element and its children\n * $animate.off('enter', container);\n *\n * // remove the event listener function provided by `callback` that is set\n * // to listen for `enter` on the given `container` as well as its children\n * $animate.off('enter', container, callback);\n * ```\n *\n * @param {string|DOMElement} event|container the animation event (e.g. enter, leave, move,\n * addClass, removeClass, etc...), or the container element. If it is the element, all other\n * arguments are ignored.\n * @param {DOMElement=} container the container element the event listener was placed on\n * @param {Function=} callback the callback function that was registered as the listener\n */\n off: $$animateQueue.off,\n\n /**\n * @ngdoc method\n * @name $animate#pin\n * @kind function\n * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists\n * outside of the DOM structure of the Angular application. By doing so, any animation triggered via `$animate` can be issued on the\n * element despite being outside the realm of the application or within another application. Say for example if the application\n * was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated\n * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind\n * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.\n *\n * Note that this feature is only active when the `ngAnimate` module is used.\n *\n * @param {DOMElement} element the external element that will be pinned\n * @param {DOMElement} parentElement the host parent element that will be associated with the external element\n */\n pin: $$animateQueue.pin,\n\n /**\n *\n * @ngdoc method\n * @name $animate#enabled\n * @kind function\n * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This\n * function can be called in four ways:\n *\n * ```js\n * // returns true or false\n * $animate.enabled();\n *\n * // changes the enabled state for all animations\n * $animate.enabled(false);\n * $animate.enabled(true);\n *\n * // returns true or false if animations are enabled for an element\n * $animate.enabled(element);\n *\n * // changes the enabled state for an element and its children\n * $animate.enabled(element, true);\n * $animate.enabled(element, false);\n * ```\n *\n * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state\n * @param {boolean=} enabled whether or not the animations will be enabled for the element\n *\n * @return {boolean} whether or not animations are enabled\n */\n enabled: $$animateQueue.enabled,\n\n /**\n * @ngdoc method\n * @name $animate#cancel\n * @kind function\n * @description Cancels the provided animation.\n *\n * @param {Promise} animationPromise The animation promise that is returned when an animation is started.\n */\n cancel: function(runner) {\n if (runner.end) {\n runner.end();\n }\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#enter\n * @kind function\n * @description Inserts the element into the DOM either after the `after` element (if provided) or\n * as the first child within the `parent` element and then triggers an animation.\n * A promise is returned that will be resolved during the next digest once the animation\n * has completed.\n *\n * @param {DOMElement} element the element which will be inserted into the DOM\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n enter: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#move\n * @kind function\n * @description Inserts (moves) the element into its new position in the DOM either after\n * the `after` element (if provided) or as the first child within the `parent` element\n * and then triggers an animation. A promise is returned that will be resolved\n * during the next digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be moved into the new DOM position\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n move: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $animate#leave\n * @kind function\n * @description Triggers an animation and then removes the element from the DOM.\n * When the function is called a promise is returned that will be resolved during the next\n * digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be removed from the DOM\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n leave: function(element, options) {\n return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {\n element.remove();\n });\n },\n\n /**\n * @ngdoc method\n * @name $animate#addClass\n * @kind function\n *\n * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon\n * execution, the addClass operation will only be handled after the next digest and it will not trigger an\n * animation if element already contains the CSS class or if the class is removed at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n addClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addclass, className);\n return $$animateQueue.push(element, 'addClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#removeClass\n * @kind function\n *\n * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon\n * execution, the removeClass operation will only be handled after the next digest and it will not trigger an\n * animation if element does not contain the CSS class or if the class is added at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n removeClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.removeClass = mergeClasses(options.removeClass, className);\n return $$animateQueue.push(element, 'removeClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#setClass\n * @kind function\n *\n * @description Performs both the addition and removal of a CSS classes on an element and (during the process)\n * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and\n * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has\n * passed. Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n setClass: function(element, add, remove, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addClass, add);\n options.removeClass = mergeClasses(options.removeClass, remove);\n return $$animateQueue.push(element, 'setClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#animate\n * @kind function\n *\n * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.\n * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take\n * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and\n * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding\n * style in `to`, the style in `from` is applied immediately, and no animation is run.\n * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`\n * method (or as part of the `options` parameter):\n *\n * ```js\n * ngModule.animation('.my-inline-animation', function() {\n * return {\n * animate : function(element, from, to, done, options) {\n * //animation\n * done();\n * }\n * }\n * });\n * ```\n *\n * @param {DOMElement} element the element which the CSS styles will be applied to\n * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.\n * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.\n * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If\n * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.\n * (Note that if no animation is detected then this value will not be applied to the element.)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n animate: function(element, from, to, className, options) {\n options = prepareAnimateOptions(options);\n options.from = options.from ? extend(options.from, from) : from;\n options.to = options.to ? extend(options.to, to) : to;\n\n className = className || 'ng-inline-animate';\n options.tempClasses = mergeClasses(options.tempClasses, className);\n return $$animateQueue.push(element, 'animate', options);\n }\n };\n }];\n}];\n\nvar $$AnimateAsyncRunFactoryProvider = /** @this */ function() {\n this.$get = ['$$rAF', function($$rAF) {\n var waitQueue = [];\n\n function waitForTick(fn) {\n waitQueue.push(fn);\n if (waitQueue.length > 1) return;\n $$rAF(function() {\n for (var i = 0; i < waitQueue.length; i++) {\n waitQueue[i]();\n }\n waitQueue = [];\n });\n }\n\n return function() {\n var passed = false;\n waitForTick(function() {\n passed = true;\n });\n return function(callback) {\n if (passed) {\n callback();\n } else {\n waitForTick(callback);\n }\n };\n };\n }];\n};\n\nvar $$AnimateRunnerFactoryProvider = /** @this */ function() {\n this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',\n function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {\n\n var INITIAL_STATE = 0;\n var DONE_PENDING_STATE = 1;\n var DONE_COMPLETE_STATE = 2;\n\n AnimateRunner.chain = function(chain, callback) {\n var index = 0;\n\n next();\n function next() {\n if (index === chain.length) {\n callback(true);\n return;\n }\n\n chain[index](function(response) {\n if (response === false) {\n callback(false);\n return;\n }\n index++;\n next();\n });\n }\n };\n\n AnimateRunner.all = function(runners, callback) {\n var count = 0;\n var status = true;\n forEach(runners, function(runner) {\n runner.done(onProgress);\n });\n\n function onProgress(response) {\n status = status && response;\n if (++count === runners.length) {\n callback(status);\n }\n }\n };\n\n function AnimateRunner(host) {\n this.setHost(host);\n\n var rafTick = $$animateAsyncRun();\n var timeoutTick = function(fn) {\n $timeout(fn, 0, false);\n };\n\n this._doneCallbacks = [];\n this._tick = function(fn) {\n if ($$isDocumentHidden()) {\n timeoutTick(fn);\n } else {\n rafTick(fn);\n }\n };\n this._state = 0;\n }\n\n AnimateRunner.prototype = {\n setHost: function(host) {\n this.host = host || {};\n },\n\n done: function(fn) {\n if (this._state === DONE_COMPLETE_STATE) {\n fn();\n } else {\n this._doneCallbacks.push(fn);\n }\n },\n\n progress: noop,\n\n getPromise: function() {\n if (!this.promise) {\n var self = this;\n this.promise = $q(function(resolve, reject) {\n self.done(function(status) {\n if (status === false) {\n reject();\n } else {\n resolve();\n }\n });\n });\n }\n return this.promise;\n },\n\n then: function(resolveHandler, rejectHandler) {\n return this.getPromise().then(resolveHandler, rejectHandler);\n },\n\n 'catch': function(handler) {\n return this.getPromise()['catch'](handler);\n },\n\n 'finally': function(handler) {\n return this.getPromise()['finally'](handler);\n },\n\n pause: function() {\n if (this.host.pause) {\n this.host.pause();\n }\n },\n\n resume: function() {\n if (this.host.resume) {\n this.host.resume();\n }\n },\n\n end: function() {\n if (this.host.end) {\n this.host.end();\n }\n this._resolve(true);\n },\n\n cancel: function() {\n if (this.host.cancel) {\n this.host.cancel();\n }\n this._resolve(false);\n },\n\n complete: function(response) {\n var self = this;\n if (self._state === INITIAL_STATE) {\n self._state = DONE_PENDING_STATE;\n self._tick(function() {\n self._resolve(response);\n });\n }\n },\n\n _resolve: function(response) {\n if (this._state !== DONE_COMPLETE_STATE) {\n forEach(this._doneCallbacks, function(fn) {\n fn(response);\n });\n this._doneCallbacks.length = 0;\n this._state = DONE_COMPLETE_STATE;\n }\n }\n };\n\n return AnimateRunner;\n }];\n};\n\n/* exported $CoreAnimateCssProvider */\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n * @this\n *\n * @description\n * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,\n * then the `$animateCss` service will actually perform animations.\n *\n * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.\n */\nvar $CoreAnimateCssProvider = function() {\n this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {\n\n return function(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = copy(options);\n }\n\n // there is no point in applying the styles since\n // there is no animation that goes on at all in\n // this version of $animateCss.\n if (options.cleanupStyles) {\n options.from = options.to = null;\n }\n\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n\n var closed, runner = new $$AnimateRunner();\n return {\n start: run,\n end: run\n };\n\n function run() {\n $$rAF(function() {\n applyAnimationContents();\n if (!closed) {\n runner.complete();\n }\n closed = true;\n });\n return runner;\n }\n\n function applyAnimationContents() {\n if (options.addClass) {\n element.addClass(options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n element.removeClass(options.removeClass);\n options.removeClass = null;\n }\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n }\n };\n }];\n};\n\n/* global stripHash: true */\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n/**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\nfunction Browser(window, document, $log, $sniffer) {\n var self = this,\n location = window.location,\n history = window.history,\n setTimeout = window.setTimeout,\n clearTimeout = window.clearTimeout,\n pendingDeferIds = {};\n\n self.isMock = false;\n\n var outstandingRequestCount = 0;\n var outstandingRequestCallbacks = [];\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = completeOutstandingRequest;\n self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };\n\n /**\n * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`\n * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.\n */\n function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while (outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }\n\n function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n }\n\n /**\n * @private\n * Note: this method is used only by scenario runner\n * TODO(vojta): prefix this method with $$ ?\n * @param {function()} callback Function that will be called when no outstanding request\n */\n self.notifyWhenNoOutstandingRequests = function(callback) {\n if (outstandingRequestCount === 0) {\n callback();\n } else {\n outstandingRequestCallbacks.push(callback);\n }\n };\n\n //////////////////////////////////////////////////////////////\n // URL API\n //////////////////////////////////////////////////////////////\n\n var cachedState, lastHistoryState,\n lastBrowserUrl = location.href,\n baseElement = document.find('base'),\n pendingLocation = null,\n getCurrentState = !$sniffer.history ? noop : function getCurrentState() {\n try {\n return history.state;\n } catch (e) {\n // MSIE can reportedly throw when there is no state (UNCONFIRMED).\n }\n };\n\n cacheState();\n\n /**\n * @name $browser#url\n *\n * @description\n * GETTER:\n * Without any argument, this method just returns current value of location.href.\n *\n * SETTER:\n * With at least one argument, this method sets url to new value.\n * If html5 history api supported, pushState/replaceState is used, otherwise\n * location.href/location.replace is used.\n * Returns its own instance to allow chaining\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to change url.\n *\n * @param {string} url New url (when used as setter)\n * @param {boolean=} replace Should new url replace current history record?\n * @param {object=} state object to use with pushState/replaceState\n */\n self.url = function(url, replace, state) {\n // In modern browsers `history.state` is `null` by default; treating it separately\n // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n if (isUndefined(state)) {\n state = null;\n }\n\n // Android Browser BFCache causes location, history reference to become stale.\n if (location !== window.location) location = window.location;\n if (history !== window.history) history = window.history;\n\n // setter\n if (url) {\n var sameState = lastHistoryState === state;\n\n // Don't change anything if previous and current URLs and states match. This also prevents\n // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n // See https://github.com/angular/angular.js/commit/ffb2701\n if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n return self;\n }\n var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n lastBrowserUrl = url;\n lastHistoryState = state;\n // Don't use history API if only the hash changed\n // due to a bug in IE10/IE11 which leads\n // to not firing a `hashchange` nor `popstate` event\n // in some cases (see #9143).\n if ($sniffer.history && (!sameBase || !sameState)) {\n history[replace ? 'replaceState' : 'pushState'](state, '', url);\n cacheState();\n } else {\n if (!sameBase) {\n pendingLocation = url;\n }\n if (replace) {\n location.replace(url);\n } else if (!sameBase) {\n location.href = url;\n } else {\n location.hash = getHash(url);\n }\n if (location.href !== url) {\n pendingLocation = url;\n }\n }\n if (pendingLocation) {\n pendingLocation = url;\n }\n return self;\n // getter\n } else {\n // - pendingLocation is needed as browsers don't allow to read out\n // the new location.href if a reload happened or if there is a bug like in iOS 9 (see\n // https://openradar.appspot.com/22186109).\n // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172\n return pendingLocation || location.href.replace(/%27/g,'\\'');\n }\n };\n\n /**\n * @name $browser#state\n *\n * @description\n * This method is a getter.\n *\n * Return history.state or null if history.state is undefined.\n *\n * @returns {object} state\n */\n self.state = function() {\n return cachedState;\n };\n\n var urlChangeListeners = [],\n urlChangeInit = false;\n\n function cacheStateAndFireUrlChange() {\n pendingLocation = null;\n fireStateOrUrlChange();\n }\n\n // This variable should be used *only* inside the cacheState function.\n var lastCachedState = null;\n function cacheState() {\n // This should be the only place in $browser where `history.state` is read.\n cachedState = getCurrentState();\n cachedState = isUndefined(cachedState) ? null : cachedState;\n\n // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n if (equals(cachedState, lastCachedState)) {\n cachedState = lastCachedState;\n }\n\n lastCachedState = cachedState;\n lastHistoryState = cachedState;\n }\n\n function fireStateOrUrlChange() {\n var prevLastHistoryState = lastHistoryState;\n cacheState();\n\n if (lastBrowserUrl === self.url() && prevLastHistoryState === cachedState) {\n return;\n }\n\n lastBrowserUrl = self.url();\n lastHistoryState = cachedState;\n forEach(urlChangeListeners, function(listener) {\n listener(self.url(), cachedState);\n });\n }\n\n /**\n * @name $browser#onUrlChange\n *\n * @description\n * Register callback function that will be called, when url changes.\n *\n * It's only called when the url is changed from outside of angular:\n * - user types different url into address bar\n * - user clicks on history (forward/back) button\n * - user clicks on a link\n *\n * It's not called when url is changed by $browser.url() method\n *\n * The listener gets called with new url as parameter.\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to monitor url changes in angular apps.\n *\n * @param {function(string)} listener Listener function to be called when url changes.\n * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n */\n self.onUrlChange = function(callback) {\n // TODO(vojta): refactor to use node's syntax for events\n if (!urlChangeInit) {\n // We listen on both (hashchange/popstate) when available, as some browsers don't\n // fire popstate when user changes the address bar and don't fire hashchange when url\n // changed by push/replaceState\n\n // html5 history api - popstate event\n if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n // hashchange event\n jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n\n urlChangeInit = true;\n }\n\n urlChangeListeners.push(callback);\n return callback;\n };\n\n /**\n * @private\n * Remove popstate and hashchange handler from window.\n *\n * NOTE: this api is intended for use only by $rootScope.\n */\n self.$$applicationDestroyed = function() {\n jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);\n };\n\n /**\n * Checks whether the url has changed outside of Angular.\n * Needs to be exported to be able to check for changes that have been done in sync,\n * as hashchange/popstate events fire in async.\n */\n self.$$checkUrlChange = fireStateOrUrlChange;\n\n //////////////////////////////////////////////////////////////\n // Misc API\n //////////////////////////////////////////////////////////////\n\n /**\n * @name $browser#baseHref\n *\n * @description\n * Returns current <base href>\n * (always relative - without domain)\n *\n * @returns {string} The current base href\n */\n self.baseHref = function() {\n var href = baseElement.attr('href');\n return href ? href.replace(/^(https?:)?\\/\\/[^/]*/, '') : '';\n };\n\n /**\n * @name $browser#defer\n * @param {function()} fn A function, who's execution should be deferred.\n * @param {number=} [delay=0] of milliseconds to defer the function execution.\n * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n *\n * @description\n * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n *\n * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n * via `$browser.defer.flush()`.\n *\n */\n self.defer = function(fn, delay) {\n var timeoutId;\n outstandingRequestCount++;\n timeoutId = setTimeout(function() {\n delete pendingDeferIds[timeoutId];\n completeOutstandingRequest(fn);\n }, delay || 0);\n pendingDeferIds[timeoutId] = true;\n return timeoutId;\n };\n\n\n /**\n * @name $browser#defer.cancel\n *\n * @description\n * Cancels a deferred task identified with `deferId`.\n *\n * @param {*} deferId Token returned by the `$browser.defer` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n self.defer.cancel = function(deferId) {\n if (pendingDeferIds[deferId]) {\n delete pendingDeferIds[deferId];\n clearTimeout(deferId);\n completeOutstandingRequest(noop);\n return true;\n }\n return false;\n };\n\n}\n\n/** @this */\nfunction $BrowserProvider() {\n this.$get = ['$window', '$log', '$sniffer', '$document',\n function($window, $log, $sniffer, $document) {\n return new Browser($window, $document, $log, $sniffer);\n }];\n}\n\n/**\n * @ngdoc service\n * @name $cacheFactory\n * @this\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n * var cache = $cacheFactory('cacheId');\n * expect($cacheFactory.get('cacheId')).toBe(cache);\n * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n * cache.put(\"key\", \"value\");\n * cache.put(\"another key\", \"another value\");\n *\n * // We've specified no options on creation\n * expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n * - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n * it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n <example module=\"cacheExampleApp\" name=\"cache-factory\">\n <file name=\"index.html\">\n <div ng-controller=\"CacheController\">\n <input ng-model=\"newCacheKey\" placeholder=\"Key\">\n <input ng-model=\"newCacheValue\" placeholder=\"Value\">\n <button ng-click=\"put(newCacheKey, newCacheValue)\">Cache</button>\n\n <p ng-if=\"keys.length\">Cached Values</p>\n <div ng-repeat=\"key in keys\">\n <span ng-bind=\"key\"></span>\n <span>: </span>\n <b ng-bind=\"cache.get(key)\"></b>\n </div>\n\n <p>Cache Info</p>\n <div ng-repeat=\"(key, value) in cache.info()\">\n <span ng-bind=\"key\"></span>\n <span>: </span>\n <b ng-bind=\"value\"></b>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('cacheExampleApp', []).\n controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n $scope.keys = [];\n $scope.cache = $cacheFactory('cacheId');\n $scope.put = function(key, value) {\n if (angular.isUndefined($scope.cache.get(key))) {\n $scope.keys.push(key);\n }\n $scope.cache.put(key, angular.isUndefined(value) ? null : value);\n };\n }]);\n </file>\n <file name=\"style.css\">\n p {\n margin: 10px 0 3px;\n }\n </file>\n </example>\n */\nfunction $CacheFactoryProvider() {\n\n this.$get = function() {\n var caches = {};\n\n function cacheFactory(cacheId, options) {\n if (cacheId in caches) {\n throw minErr('$cacheFactory')('iid', 'CacheId \\'{0}\\' is already taken!', cacheId);\n }\n\n var size = 0,\n stats = extend({}, options, {id: cacheId}),\n data = createMap(),\n capacity = (options && options.capacity) || Number.MAX_VALUE,\n lruHash = createMap(),\n freshEnd = null,\n staleEnd = null;\n\n /**\n * @ngdoc type\n * @name $cacheFactory.Cache\n *\n * @description\n * A cache object used to store and retrieve data, primarily used by\n * {@link $http $http} and the {@link ng.directive:script script} directive to cache\n * templates and other data.\n *\n * ```js\n * angular.module('superCache')\n * .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n * return $cacheFactory('super-cache');\n * }]);\n * ```\n *\n * Example test:\n *\n * ```js\n * it('should behave like a cache', inject(function(superCache) {\n * superCache.put('key', 'value');\n * superCache.put('another key', 'another value');\n *\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 2\n * });\n *\n * superCache.remove('another key');\n * expect(superCache.get('another key')).toBeUndefined();\n *\n * superCache.removeAll();\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 0\n * });\n * }));\n * ```\n */\n return (caches[cacheId] = {\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#put\n * @kind function\n *\n * @description\n * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n * retrieved later, and incrementing the size of the cache if the key was not already\n * present in the cache. If behaving like an LRU cache, it will also remove stale\n * entries from the set.\n *\n * It will not insert undefined values into the cache.\n *\n * @param {string} key the key under which the cached data is stored.\n * @param {*} value the value to store alongside the key. If it is undefined, the key\n * will not be stored.\n * @returns {*} the value stored.\n */\n put: function(key, value) {\n if (isUndefined(value)) return;\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n refresh(lruEntry);\n }\n\n if (!(key in data)) size++;\n data[key] = value;\n\n if (size > capacity) {\n this.remove(staleEnd.key);\n }\n\n return value;\n },\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#get\n * @kind function\n *\n * @description\n * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the data to be retrieved\n * @returns {*} the value stored.\n */\n get: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n refresh(lruEntry);\n }\n\n return data[key];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#remove\n * @kind function\n *\n * @description\n * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the entry to be removed\n */\n remove: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n if (lruEntry === freshEnd) freshEnd = lruEntry.p;\n if (lruEntry === staleEnd) staleEnd = lruEntry.n;\n link(lruEntry.n,lruEntry.p);\n\n delete lruHash[key];\n }\n\n if (!(key in data)) return;\n\n delete data[key];\n size--;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#removeAll\n * @kind function\n *\n * @description\n * Clears the cache object of any entries.\n */\n removeAll: function() {\n data = createMap();\n size = 0;\n lruHash = createMap();\n freshEnd = staleEnd = null;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#destroy\n * @kind function\n *\n * @description\n * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n * removing it from the {@link $cacheFactory $cacheFactory} set.\n */\n destroy: function() {\n data = null;\n stats = null;\n lruHash = null;\n delete caches[cacheId];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#info\n * @kind function\n *\n * @description\n * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n *\n * @returns {object} an object with the following properties:\n * <ul>\n * <li>**id**: the id of the cache instance</li>\n * <li>**size**: the number of entries kept in the cache instance</li>\n * <li>**...**: any additional properties from the options object when creating the\n * cache.</li>\n * </ul>\n */\n info: function() {\n return extend({}, stats, {size: size});\n }\n });\n\n\n /**\n * makes the `entry` the freshEnd of the LRU linked list\n */\n function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }\n\n\n /**\n * bidirectionally links two entries of the LRU linked list\n */\n function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#info\n *\n * @description\n * Get information about all the caches that have been created\n *\n * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n */\n cacheFactory.info = function() {\n var info = {};\n forEach(caches, function(cache, cacheId) {\n info[cacheId] = cache.info();\n });\n return info;\n };\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#get\n *\n * @description\n * Get access to a cache object by the `cacheId` used when it was created.\n *\n * @param {string} cacheId Name or id of a cache to access.\n * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n */\n cacheFactory.get = function(cacheId) {\n return caches[cacheId];\n };\n\n\n return cacheFactory;\n };\n}\n\n/**\n * @ngdoc service\n * @name $templateCache\n * @this\n *\n * @description\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, or by consuming the\n * `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n * <script type=\"text/ng-template\" id=\"templateId.html\">\n * <p>This is the content of the template</p>\n * </script>\n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,\n * element with ng-app attribute), otherwise the template will be ignored.\n *\n * Adding via the `$templateCache` service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n * $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your component:\n * ```js\n * myApp.component('myComponent', {\n * templateUrl: 'templateId.html'\n * });\n * ```\n *\n * or get it via the `$templateCache` service:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n * See {@link ng.$cacheFactory $cacheFactory}.\n *\n */\nfunction $TemplateCacheProvider() {\n this.$get = ['$cacheFactory', function($cacheFactory) {\n return $cacheFactory('templates');\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables like document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" - function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n\n/**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n * </div>\n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a {@link $compile#directive-definition-object Directive Definition Object (see below)}\n * that defines the directive properties, or just the `postLink` function (all other properties will have\n * the default values).\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n * </div>\n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * {@link $compile#-priority- priority}: 0,\n * {@link $compile#-template- template}: '<div></div>', // or // function(tElement, tAttrs) { ... },\n * // or\n * // {@link $compile#-templateurl- templateUrl}: 'directive.html', // or // function(tElement, tAttrs) { ... },\n * {@link $compile#-transclude- transclude}: false,\n * {@link $compile#-restrict- restrict}: 'A',\n * {@link $compile#-templatenamespace- templateNamespace}: 'html',\n * {@link $compile#-scope- scope}: false,\n * {@link $compile#-controller- controller}: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n * {@link $compile#-controlleras- controllerAs}: 'stringIdentifier',\n * {@link $compile#-bindtocontroller- bindToController}: false,\n * {@link $compile#-require- require}: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n * {@link $compile#-multielement- multiElement}: false,\n * {@link $compile#-compile- compile}: function compile(tElement, tAttrs, transclude) {\n * return {\n * {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... },\n * {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... }\n * }\n * // or\n * // return function postLink( ... ) { ... }\n * },\n * // or\n * // {@link $compile#-link- link}: {\n * // {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... },\n * // {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... }\n * // }\n * // or\n * // {@link $compile#-link- link}: function postLink( ... ) { ... }\n * };\n * return directiveDefinitionObject;\n * });\n * ```\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n * </div>\n *\n * Therefore the above can be simplified as:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * link: function postLink(scope, iElement, iAttrs) { ... }\n * };\n * return directiveDefinitionObject;\n * // or\n * // return function postLink(scope, iElement, iAttrs) { ... }\n * });\n * ```\n *\n * ### Life-cycle hooks\n * Directive controllers can provide the following methods that are called by Angular at points in the life-cycle of the\n * directive:\n * * `$onInit()` - Called on each controller after all the controllers on an element have been constructed and\n * had their bindings initialized (and before the pre & post linking functions for the directives on\n * this element). This is a good place to put initialization code for your controller.\n * * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The\n * `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an\n * object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a\n * component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will\n * also be called when your bindings are initialized.\n * * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on\n * changes. Any actions that you wish to take in response to the changes that you detect must be\n * invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook\n * could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not\n * be detected by Angular's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments;\n * if detecting changes, you must store the previous value(s) for comparison to the current values.\n * * `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing\n * external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in\n * the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent\n * components will have their `$onDestroy()` hook called before child components.\n * * `$postLink()` - Called after this controller's element and its children have been linked. Similar to the post-link\n * function this hook can be used to set up DOM event handlers and do direct DOM manipulation.\n * Note that child elements that contain `templateUrl` directives will not have been compiled and linked since\n * they are waiting for their template to load asynchronously and their own compilation and linking has been\n * suspended until that occurs.\n *\n * #### Comparison with Angular 2 life-cycle hooks\n * Angular 2 also uses life-cycle hooks for its components. While the Angular 1 life-cycle hooks are similar there are\n * some differences that you should be aware of, especially when it comes to moving your code from Angular 1 to Angular 2:\n *\n * * Angular 1 hooks are prefixed with `$`, such as `$onInit`. Angular 2 hooks are prefixed with `ng`, such as `ngOnInit`.\n * * Angular 1 hooks can be defined on the controller prototype or added to the controller inside its constructor.\n * In Angular 2 you can only define hooks on the prototype of the Component class.\n * * Due to the differences in change-detection, you may get many more calls to `$doCheck` in Angular 1 than you would to\n * `ngDoCheck` in Angular 2\n * * Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be\n * propagated throughout the application.\n * Angular 2 does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an\n * error or do nothing depending upon the state of `enableProdMode()`.\n *\n * #### Life-cycle hook examples\n *\n * This example shows how you can check for mutations to a Date object even though the identity of the object\n * has not changed.\n *\n * <example name=\"doCheckDateExample\" module=\"do-check-module\">\n * <file name=\"app.js\">\n * angular.module('do-check-module', [])\n * .component('app', {\n * template:\n * 'Month: <input ng-model=\"$ctrl.month\" ng-change=\"$ctrl.updateDate()\">' +\n * 'Date: {{ $ctrl.date }}' +\n * '<test date=\"$ctrl.date\"></test>',\n * controller: function() {\n * this.date = new Date();\n * this.month = this.date.getMonth();\n * this.updateDate = function() {\n * this.date.setMonth(this.month);\n * };\n * }\n * })\n * .component('test', {\n * bindings: { date: '<' },\n * template:\n * '<pre>{{ $ctrl.log | json }}</pre>',\n * controller: function() {\n * var previousValue;\n * this.log = [];\n * this.$doCheck = function() {\n * var currentValue = this.date && this.date.valueOf();\n * if (previousValue !== currentValue) {\n * this.log.push('doCheck: date mutated: ' + this.date);\n * previousValue = currentValue;\n * }\n * };\n * }\n * });\n * </file>\n * <file name=\"index.html\">\n * <app></app>\n * </file>\n * </example>\n *\n * This example show how you might use `$doCheck` to trigger changes in your component's inputs even if the\n * actual identity of the component doesn't change. (Be aware that cloning and deep equality checks on large\n * arrays or objects can have a negative impact on your application performance)\n *\n * <example name=\"doCheckArrayExample\" module=\"do-check-module\">\n * <file name=\"index.html\">\n * <div ng-init=\"items = []\">\n * <button ng-click=\"items.push(items.length)\">Add Item</button>\n * <button ng-click=\"items = []\">Reset Items</button>\n * <pre>{{ items }}</pre>\n * <test items=\"items\"></test>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('do-check-module', [])\n * .component('test', {\n * bindings: { items: '<' },\n * template:\n * '<pre>{{ $ctrl.log | json }}</pre>',\n * controller: function() {\n * this.log = [];\n *\n * this.$doCheck = function() {\n * if (this.items_ref !== this.items) {\n * this.log.push('doCheck: items changed');\n * this.items_ref = this.items;\n * }\n * if (!angular.equals(this.items_clone, this.items)) {\n * this.log.push('doCheck: items mutated');\n * this.items_clone = angular.copy(this.items);\n * }\n * };\n * }\n * });\n * </file>\n * </example>\n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true (default is `false`), the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioral (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * The scope property can be `false`, `true`, or an object:\n *\n * * **`false` (default):** No scope will be created for the directive. The directive will use its\n * parent's scope.\n *\n * * **`true`:** A new child scope that prototypically inherits from its parent will be created for\n * the directive's element. If multiple directives on the same element request a new scope,\n * only one new scope is created.\n *\n * * **`{...}` (an object hash):** A new \"isolate\" scope is created for the directive's template.\n * The 'isolate' scope differs from normal scope in that it does not prototypically\n * inherit from its parent scope. This is useful when creating reusable components, which should not\n * accidentally read or modify data in the parent scope. Note that an isolate scope\n * directive without a `template` or `templateUrl` will not apply the isolate scope\n * to its children elements.\n *\n * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the\n * directive's element. These local properties are useful for aliasing values for templates. The keys in\n * the object hash map to the name of the property on the isolate scope; the values define how the property\n * is bound to the parent scope, via matching attributes on the directive's element:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n * always a string since DOM attributes are strings. If no `attr` name is specified then the\n * attribute name is assumed to be the same as the local name. Given `<my-component\n * my-attr=\"hello {{name}}\">` and the isolate scope definition `scope: { localName:'@myAttr' }`,\n * the directive's scope property `localName` will reflect the interpolated value of `hello\n * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's\n * scope. The `name` is read from the parent scope (not the directive's scope).\n *\n * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression\n * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope.\n * If no `attr` name is specified then the attribute name is assumed to be the same as the local\n * name. Given `<my-component my-attr=\"parentModel\">` and the isolate scope definition `scope: {\n * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the\n * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in\n * `localModel` and vice versa. Optional attributes should be marked as such with a question mark:\n * `=?` or `=?attr`. If the binding expression is non-assignable, or if the attribute isn't\n * optional and doesn't exist, an exception ({@link error/$compile/nonassign `$compile:nonassign`})\n * will be thrown upon discovering changes to the local value, since it will be impossible to sync\n * them back to the parent scope. By default, the {@link ng.$rootScope.Scope#$watch `$watch`}\n * method is used for tracking changes, and the equality check is based on object identity.\n * However, if an object literal or an array literal is passed as the binding expression, the\n * equality check is done by value (using the {@link angular.equals} function). It's also possible\n * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection\n * `$watchCollection`}: use `=*` or `=*attr` (`=*?` or `=*?attr` if the attribute is optional).\n *\n * * `<` or `<attr` - set up a one-way (one-directional) binding between a local scope property and an\n * expression passed via the attribute `attr`. The expression is evaluated in the context of the\n * parent scope. If no `attr` name is specified then the attribute name is assumed to be the same as the\n * local name. You can also make the binding optional by adding `?`: `<?` or `<?attr`.\n *\n * For example, given `<my-component my-attr=\"parentModel\">` and directive definition of\n * `scope: { localModel:'<myAttr' }`, then the isolated scope property `localModel` will reflect the\n * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected\n * in `localModel`, but changes in `localModel` will not reflect in `parentModel`. There are however\n * two caveats:\n * 1. one-way binding does not copy the value from the parent to the isolate scope, it simply\n * sets the same value. That means if your bound value is an object, changes to its properties\n * in the isolated scope will be reflected in the parent scope (because both reference the same object).\n * 2. one-way binding watches changes to the **identity** of the parent value. That means the\n * {@link ng.$rootScope.Scope#$watch `$watch`} on the parent value only fires if the reference\n * to the value has changed. In most cases, this should not be of concern, but can be important\n * to know if you one-way bind to an object, and then replace that object in the isolated scope.\n * If you now change a property of the object in your parent scope, the change will not be\n * propagated to the isolated scope, because the identity of the object on the parent scope\n * has not changed. Instead you must assign a new object.\n *\n * One-way binding is useful if you do not plan to propagate changes to your isolated scope bindings\n * back to the parent. However, it does not make this completely impossible.\n *\n * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope. If\n * no `attr` name is specified then the attribute name is assumed to be the same as the local name.\n * Given `<my-component my-attr=\"count = count + value\">` and the isolate scope definition `scope: {\n * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for\n * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope\n * via an expression to the parent scope. This can be done by passing a map of local variable names\n * and values into the expression wrapper fn. For example, if the expression is `increment(amount)`\n * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`.\n *\n * In general it's possible to apply more than one directive to one element, but there might be limitations\n * depending on the type of scope required by the directives. The following points will help explain these limitations.\n * For simplicity only two directives are taken into account, but it is also applicable for several directives:\n *\n * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope\n * * **child scope** + **no scope** => Both directives will share one single child scope\n * * **child scope** + **child scope** => Both directives will share one single child scope\n * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use\n * its parent's scope\n * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot\n * be applied to the same element.\n * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives\n * cannot be applied to the same element.\n *\n *\n * #### `bindToController`\n * This property is used to bind scope properties directly to the controller. It can be either\n * `true` or an object hash with the same format as the `scope` property.\n *\n * When an isolate scope is used for a directive (see above), `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope.\n *\n * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller\n * properties. You can access these bindings once they have been initialized by providing a controller method called\n * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings\n * initialized.\n *\n * <div class=\"alert alert-warning\">\n * **Deprecation warning:** if `$compileProcvider.preAssignBindingsEnabled(true)` was called, bindings for non-ES6 class\n * controllers are bound to `this` before the controller constructor is called but this use is now deprecated. Please\n * place initialization code that relies upon bindings inside a `$onInit` method on the controller, instead.\n * </div>\n *\n * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.\n * This will set up the scope bindings to the controller directly. Note that `scope` can still be used\n * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate\n * scope (useful for component directives).\n *\n * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.\n *\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and can be accessed by other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n * `function([scope], cloneLinkingFn, futureParentElement, slotName)`:\n * * `scope`: (optional) override the scope.\n * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content.\n * * `futureParentElement` (optional):\n * * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n * and when the `cloneLinkingFn` is passed,\n * as those elements need to created and cloned in a special way when they are defined outside their\n * usual containers (e.g. like `<svg>`).\n * * See also the `directive.templateNamespace` property.\n * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`)\n * then the default transclusion is provided.\n * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns\n * `true` if the specified slot contains content (i.e. one or more DOM nodes).\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` property can be a string, an array or an object:\n * * a **string** containing the name of the directive to pass to the linking function\n * * an **array** containing the names of directives to pass to the linking function. The argument passed to the\n * linking function will be an array of controllers in the same order as the names in the `require` property\n * * an **object** whose property values are the names of the directives to pass to the linking function. The argument\n * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding\n * controllers.\n *\n * If the `require` property is an object and `bindToController` is truthy, then the required controllers are\n * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers\n * have been constructed but before `$onInit` is called.\n * If the name of the required controller is the same as the local name (the key), the name can be\n * omitted. For example, `{parentDir: '^^'}` is equivalent to `{parentDir: '^^parentDir'}`.\n * See the {@link $compileProvider#component} helper for an example of how this can be used.\n * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is\n * raised (unless no link function is specified and the required controllers are not being bound to the directive\n * controller, in which case error checking is skipped). The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n * `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n * `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Identifier name for a reference to the controller in the directive's scope.\n * This allows the controller to be referenced from the directive template. This is especially\n * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible\n * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the\n * `controllerAs` reference might overwrite a property that already exists on the parent scope.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): `<my-directive></my-directive>`\n * * `A` - Attribute (default): `<div my-directive=\"exp\"></div>`\n * * `C` - Class: `<div class=\"my-directive: exp;\"></div>`\n * * `M` - Comment: `<!-- directive: my-directive exp -->`\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n * top-level elements such as `<svg>` or `<math>`.\n * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`).\n * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n * function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved. In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url. In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)\n * specify what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n *\n * #### `compile`\n *\n * ```js\n * function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n * * `tElement` - template element - The element where the directive has been declared. It is\n * safe to do template transformation on the element and child elements only.\n *\n * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n * between all directive compile functions.\n *\n * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n * <div class=\"alert alert-warning\">\n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n * </div>\n\n * <div class=\"alert alert-warning\">\n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and\n * stack overflow errors.\n *\n * This can be avoided by manually using $compile in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n * </div>\n *\n * <div class=\"alert alert-danger\">\n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n * e.g. does not know about the right outer scope. Please use the transclude function that is passed\n * to the link function instead.\n * </div>\n\n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n * `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n * control when a linking function should be called during the linking phase. See info about\n * pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n * directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n * * `iElement` - instance element - The element where the directive is to be used. It is safe to\n * manipulate the children of the element only in `postLink` function since the children have\n * already been linked.\n *\n * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n * between all directive linking functions.\n *\n * * `controller` - the directive's required controller instance(s) - Instances are shared\n * among all directives, which allows the directives to use the controllers as a communication\n * channel. The exact value depends on the directive's `require` property:\n * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one\n * * `string`: the controller instance\n * * `array`: array of controller instances\n *\n * If a required controller cannot be found, and it is optional, the instance is `null`,\n * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.\n *\n * Note that you can also require the directive's own controller - it will be made available like\n * any other controller.\n *\n * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n * This is the same as the `$transclude` parameter of directive controllers,\n * see {@link ng.$compile#-controller- the controller section for details}.\n * `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n * </div>\n *\n * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element, the entire element or multiple parts of the element contents:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n * element that defined at a lower priority than this directive. When used, the `template`\n * property is ignored.\n * * **`{...}` (an object hash):** - map elements of the content onto transclusion \"slots\" in the template.\n *\n * **Mult-slot transclusion** is declared by providing an object for the `transclude` property.\n *\n * This object is a map where the keys are the name of the slot to fill and the value is an element selector\n * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`)\n * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc).\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * If the element selector is prefixed with a `?` then that slot is optional.\n *\n * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `<my-custom-element>` elements to\n * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive.\n *\n * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements\n * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call\n * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and\n * injectable into the directive's controller.\n *\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n * <div class=\"alert alert-info\">\n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n * </div>\n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, which the clone will be linked to.\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n * </div>\n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n * element.append(clone);\n * transcludedContent = clone;\n * transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n * <div class=\"alert alert-info\">\n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n * </div>\n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transcluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n * <div ng-app>\n * <div isolate>\n * <div transclusion>\n * </div>\n * </div>\n * </div>\n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n ```\n - $rootScope\n - isolate\n - transclusion\n ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n ```\n - $rootScope\n - transclusion\n - isolate\n ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * * *Accessing normalized attribute names:* Directives like 'ngBind' can be expressed in many ways:\n * 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. The attributes object allows for normalized access\n * to the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n * object which allows the directives to use the attributes object as inter directive\n * communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n * allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n * that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n * the only way to easily get the actual value because during the linking phase the interpolation\n * hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n * // get the attribute value\n * console.log(attrs.ngModel);\n *\n * // change the attribute\n * attrs.$set('ngModel', 'new value');\n *\n * // observe changes to interpolated attribute\n * attrs.$observe('ngModel', function(value) {\n * console.log('ngModel has changed value to ' + value);\n * });\n * }\n * ```\n *\n * ## Example\n *\n * <div class=\"alert alert-warning\">\n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n * </div>\n *\n <example module=\"compileExample\" name=\"compile\">\n <file name=\"index.html\">\n <script>\n angular.module('compileExample', [], function($compileProvider) {\n // configure new 'compile' directive by passing a directive\n // factory function. The factory function injects the '$compile'\n $compileProvider.directive('compile', function($compile) {\n // directive factory creates a link function\n return function(scope, element, attrs) {\n scope.$watch(\n function(scope) {\n // watch the 'compile' expression for changes\n return scope.$eval(attrs.compile);\n },\n function(value) {\n // when the 'compile' expression changes\n // assign it into the current DOM\n element.html(value);\n\n // compile the new DOM and link it to the current\n // scope.\n // NOTE: we only compile .childNodes so that\n // we don't get into infinite loop compiling ourselves\n $compile(element.contents())(scope);\n }\n );\n };\n });\n })\n .controller('GreeterController', ['$scope', function($scope) {\n $scope.name = 'Angular';\n $scope.html = 'Hello {{name}}';\n }]);\n </script>\n <div ng-controller=\"GreeterController\">\n <input ng-model=\"name\"> <br/>\n <textarea ng-model=\"html\"></textarea> <br/>\n <div compile=\"html\"></div>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should auto compile', function() {\n var textarea = $('textarea');\n var output = $('div[compile]');\n // The initial state reads 'Hello Angular'.\n expect(output.getText()).toBe('Hello Angular');\n textarea.clear();\n textarea.sendKeys('{{name}}!');\n expect(output.getText()).toBe('Angular!');\n });\n </file>\n </example>\n\n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n * <div class=\"alert alert-danger\">\n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n * e.g. will not use the right outer scope. Please pass the transclude function as a\n * `parentBoundTranscludeFn` to the link function instead.\n * </div>\n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n * root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n * `template` and call the `cloneAttachFn` function allowing the caller to attach the\n * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n * called as: <br/> `cloneAttachFn(clonedElement, scope)` where:\n *\n * * `clonedElement` - is a clone of the original `element` passed into the compiler.\n * * `scope` - is the current scope with which the linking function is working with.\n *\n * * `options` - An optional object hash with linking options. If `options` is provided, then the following\n * keys may be used to control linking behavior:\n *\n * * `parentBoundTranscludeFn` - the transclude function made available to\n * directives; if given, it will be passed through to the link functions of\n * directives found in `element` during compilation.\n * * `transcludeControllers` - an object hash with keys that map controller names\n * to a hash with the key `instance`, which maps to the controller instance;\n * if given, it will make the controllers available to directives on the compileNode:\n * ```\n * {\n * parent: {\n * instance: parentControllerInstance\n * }\n * }\n * ```\n * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n * the cloned elements; only needed for transcludes that are allowed to contain non html\n * elements (e.g. SVG elements). See also the directive.controller property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to $digest which typically is done by\n * Angular automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n * before you send them to the compiler and keep this reference around.\n * ```js\n * var element = $compile('<p>{{total}}</p>')(scope);\n * ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n * example would not point to the clone, but rather to the original template that was cloned. In\n * this case, you can access the clone via the cloneAttachFn:\n * ```js\n * var templateElement = angular.element('<p>{{total}}</p>'),\n * scope = ....;\n *\n * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n * //attach the clone to DOM document at the right place\n * });\n *\n * //now we have reference to the cloned DOM via `clonedElement`\n * ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.\n *\n * @knownIssue\n *\n * ### Double Compilation\n *\n Double compilation occurs when an already compiled part of the DOM gets\n compiled again. This is an undesired effect and can lead to misbehaving directives, performance issues,\n and memory leaks. Refer to the Compiler Guide {@link guide/compiler#double-compilation-and-how-to-avoid-it\n section on double compilation} for an in-depth explanation and ways to avoid it.\n *\n */\n\nvar $compileMinErr = minErr('$compile');\n\nfunction UNINITIALIZED_VALUE() {}\nvar _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();\n\n/**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\n/** @this */\nfunction $CompileProvider($provide, $$sanitizeUriProvider) {\n var hasDirectives = {},\n Suffix = 'Directive',\n COMMENT_DIRECTIVE_REGEXP = /^\\s*directive:\\s*([\\w-]+)\\s+(.*)$/,\n CLASS_DIRECTIVE_REGEXP = /(([\\w-]+)(?::([^;]+))?;?)/,\n ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n // The assumption is that future DOM event attribute names will begin with\n // 'on' and be composed of only English letters.\n var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n var bindingCache = createMap();\n\n function parseIsolateBindings(scope, directiveName, isController) {\n var LOCAL_REGEXP = /^\\s*([@&<]|=(\\*?))(\\??)\\s*([\\w$]*)\\s*$/;\n\n var bindings = createMap();\n\n forEach(scope, function(definition, scopeName) {\n if (definition in bindingCache) {\n bindings[scopeName] = bindingCache[definition];\n return;\n }\n var match = definition.match(LOCAL_REGEXP);\n\n if (!match) {\n throw $compileMinErr('iscp',\n 'Invalid {3} for directive \\'{0}\\'.' +\n ' Definition: {... {1}: \\'{2}\\' ...}',\n directiveName, scopeName, definition,\n (isController ? 'controller bindings definition' :\n 'isolate scope definition'));\n }\n\n bindings[scopeName] = {\n mode: match[1][0],\n collection: match[2] === '*',\n optional: match[3] === '?',\n attrName: match[4] || scopeName\n };\n if (match[4]) {\n bindingCache[definition] = bindings[scopeName];\n }\n });\n\n return bindings;\n }\n\n function parseDirectiveBindings(directive, directiveName) {\n var bindings = {\n isolateScope: null,\n bindToController: null\n };\n if (isObject(directive.scope)) {\n if (directive.bindToController === true) {\n bindings.bindToController = parseIsolateBindings(directive.scope,\n directiveName, true);\n bindings.isolateScope = {};\n } else {\n bindings.isolateScope = parseIsolateBindings(directive.scope,\n directiveName, false);\n }\n }\n if (isObject(directive.bindToController)) {\n bindings.bindToController =\n parseIsolateBindings(directive.bindToController, directiveName, true);\n }\n if (bindings.bindToController && !directive.controller) {\n // There is no controller\n throw $compileMinErr('noctrl',\n 'Cannot bind to controller without directive \\'{0}\\'s controller.',\n directiveName);\n }\n return bindings;\n }\n\n function assertValidDirectiveName(name) {\n var letter = name.charAt(0);\n if (!letter || letter !== lowercase(letter)) {\n throw $compileMinErr('baddir', 'Directive/Component name \\'{0}\\' is invalid. The first character must be a lowercase letter', name);\n }\n if (name !== name.trim()) {\n throw $compileMinErr('baddir',\n 'Directive/Component name \\'{0}\\' is invalid. The name should not contain leading or trailing whitespaces',\n name);\n }\n }\n\n function getDirectiveRequire(directive) {\n var require = directive.require || (directive.controller && directive.name);\n\n if (!isArray(require) && isObject(require)) {\n forEach(require, function(value, key) {\n var match = value.match(REQUIRE_PREFIX_REGEXP);\n var name = value.substring(match[0].length);\n if (!name) require[key] = match[0] + key;\n });\n }\n\n return require;\n }\n\n function getDirectiveRestrict(restrict, name) {\n if (restrict && !(isString(restrict) && /[EACM]/.test(restrict))) {\n throw $compileMinErr('badrestrict',\n 'Restrict property \\'{0}\\' of directive \\'{1}\\' is invalid',\n restrict,\n name);\n }\n\n return restrict || 'EA';\n }\n\n /**\n * @ngdoc method\n * @name $compileProvider#directive\n * @kind function\n *\n * @description\n * Register a new directive with the compiler.\n *\n * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which\n * will match as <code>ng-bind</code>), or an object map of directives where the keys are the\n * names and the values are the factories.\n * @param {Function|Array} directiveFactory An injectable directive factory function. See the\n * {@link guide/directive directive guide} and the {@link $compile compile API} for more info.\n * @returns {ng.$compileProvider} Self for chaining.\n */\n this.directive = function registerDirective(name, directiveFactory) {\n assertArg(name, 'name');\n assertNotHasOwnProperty(name, 'directive');\n if (isString(name)) {\n assertValidDirectiveName(name);\n assertArg(directiveFactory, 'directiveFactory');\n if (!hasDirectives.hasOwnProperty(name)) {\n hasDirectives[name] = [];\n $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',\n function($injector, $exceptionHandler) {\n var directives = [];\n forEach(hasDirectives[name], function(directiveFactory, index) {\n try {\n var directive = $injector.invoke(directiveFactory);\n if (isFunction(directive)) {\n directive = { compile: valueFn(directive) };\n } else if (!directive.compile && directive.link) {\n directive.compile = valueFn(directive.link);\n }\n directive.priority = directive.priority || 0;\n directive.index = index;\n directive.name = directive.name || name;\n directive.require = getDirectiveRequire(directive);\n directive.restrict = getDirectiveRestrict(directive.restrict, name);\n directive.$$moduleName = directiveFactory.$$moduleName;\n directives.push(directive);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n return directives;\n }]);\n }\n hasDirectives[name].push(directiveFactory);\n } else {\n forEach(name, reverseParams(registerDirective));\n }\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#component\n * @module ng\n * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`),\n * or an object map of components where the keys are the names and the values are the component definition objects.\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object}),\n * with the following properties (all optional):\n *\n * - `controller` – `{(string|function()=}` – controller constructor function that should be\n * associated with newly created scope or the name of a {@link ng.$compile#-controller-\n * registered controller} if passed as a string. An empty `noop` function by default.\n * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * If not present, this will default to be `$ctrl`.\n * - `template` – `{string=|function()=}` – html template as a string or a function that\n * returns an html template as a string which should be used as the contents of this component.\n * Empty string by default.\n *\n * If `template` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html\n * template that should be used as the contents of this component.\n *\n * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.\n * Component properties are always bound to the component controller and not to the scope.\n * See {@link ng.$compile#-bindtocontroller- `bindToController`}.\n * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.\n * Disabled by default.\n * - `require` - `{Object<string, string>=}` - requires the controllers of other directives and binds them to\n * this component's controller. The object keys specify the property names under which the required\n * controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}.\n * - `$...` – additional properties to attach to the directive factory function and the controller\n * constructor function. (This is used by the component router to annotate)\n *\n * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.\n * @description\n * Register a **component definition** with the compiler. This is a shorthand for registering a special\n * type of directive, which represents a self-contained UI component in your application. Such components\n * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).\n *\n * Component definitions are very simple and do not require as much configuration as defining general\n * directives. Component definitions usually consist only of a template and a controller backing it.\n *\n * In order to make the definition easier, components enforce best practices like use of `controllerAs`,\n * `bindToController`. They always have **isolate scope** and are restricted to elements.\n *\n * Here are a few examples of how you would usually define components:\n *\n * ```js\n * var myMod = angular.module(...);\n * myMod.component('myComp', {\n * template: '<div>My name is {{$ctrl.name}}</div>',\n * controller: function() {\n * this.name = 'shahar';\n * }\n * });\n *\n * myMod.component('myComp', {\n * template: '<div>My name is {{$ctrl.name}}</div>',\n * bindings: {name: '@'}\n * });\n *\n * myMod.component('myComp', {\n * templateUrl: 'views/my-comp.html',\n * controller: 'MyCtrl',\n * controllerAs: 'ctrl',\n * bindings: {name: '@'}\n * });\n *\n * ```\n * For more examples, and an in-depth guide, see the {@link guide/component component guide}.\n *\n * <br />\n * See also {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n this.component = function registerComponent(name, options) {\n if (!isString(name)) {\n forEach(name, reverseParams(bind(this, registerComponent)));\n return this;\n }\n\n var controller = options.controller || function() {};\n\n function factory($injector) {\n function makeInjectable(fn) {\n if (isFunction(fn) || isArray(fn)) {\n return /** @this */ function(tElement, tAttrs) {\n return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});\n };\n } else {\n return fn;\n }\n }\n\n var template = (!options.template && !options.templateUrl ? '' : options.template);\n var ddo = {\n controller: controller,\n controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',\n template: makeInjectable(template),\n templateUrl: makeInjectable(options.templateUrl),\n transclude: options.transclude,\n scope: {},\n bindToController: options.bindings || {},\n restrict: 'E',\n require: options.require\n };\n\n // Copy annotations (starting with $) over to the DDO\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') ddo[key] = val;\n });\n\n return ddo;\n }\n\n // TODO(pete) remove the following `forEach` before we release 1.6.0\n // The component-router@0.2.0 looks for the annotations on the controller constructor\n // Nothing in Angular looks for annotations on the factory function but we can't remove\n // it from 1.5.x yet.\n\n // Copy any annotation properties (starting with $) over to the factory and controller constructor functions\n // These could be used by libraries such as the new component router\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') {\n factory[key] = val;\n // Don't try to copy over annotations to named controller\n if (isFunction(controller)) controller[key] = val;\n }\n });\n\n factory.$inject = ['$injector'];\n\n return this.directive(name, factory);\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationWhitelist\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.aHrefSanitizationWhitelist();\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationWhitelist\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();\n }\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#debugInfoEnabled\n *\n * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n * current debugInfoEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable various debug runtime information in the compiler such as adding\n * binding information and a reference to the current scope on to DOM elements.\n * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n * * `ng-binding` CSS class\n * * `$binding` data property containing an array of the binding expressions\n *\n * You may want to disable this in production for a significant performance boost. See\n * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n *\n * The default value is true.\n */\n var debugInfoEnabled = true;\n this.debugInfoEnabled = function(enabled) {\n if (isDefined(enabled)) {\n debugInfoEnabled = enabled;\n return this;\n }\n return debugInfoEnabled;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#preAssignBindingsEnabled\n *\n * @param {boolean=} enabled update the preAssignBindingsEnabled state if provided, otherwise just return the\n * current preAssignBindingsEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable whether directive controllers are assigned bindings before\n * calling the controller's constructor.\n * If enabled (true), the compiler assigns the value of each of the bindings to the\n * properties of the controller object before the constructor of this object is called.\n *\n * If disabled (false), the compiler calls the constructor first before assigning bindings.\n *\n * The default value is false.\n *\n * @deprecated\n * sinceVersion=\"1.6.0\"\n * removeVersion=\"1.7.0\"\n *\n * This method and the option to assign the bindings before calling the controller's constructor\n * will be removed in v1.7.0.\n */\n var preAssignBindingsEnabled = false;\n this.preAssignBindingsEnabled = function(enabled) {\n if (isDefined(enabled)) {\n preAssignBindingsEnabled = enabled;\n return this;\n }\n return preAssignBindingsEnabled;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#strictComponentBindingsEnabled\n *\n * @param {boolean=} enabled update the strictComponentBindingsEnabled state if provided, otherwise just return the\n * current strictComponentBindingsEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable strict component bindings check. If enabled, the compiler will enforce that\n * for all bindings of a component that are not set as optional with `?`, an attribute needs to be provided\n * on the component's HTML tag.\n *\n * The default value is false.\n */\n var strictComponentBindingsEnabled = false;\n this.strictComponentBindingsEnabled = function(enabled) {\n if (isDefined(enabled)) {\n strictComponentBindingsEnabled = enabled;\n return this;\n }\n return strictComponentBindingsEnabled;\n };\n\n var TTL = 10;\n /**\n * @ngdoc method\n * @name $compileProvider#onChangesTtl\n * @description\n *\n * Sets the number of times `$onChanges` hooks can trigger new changes before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result\n * in several iterations of calls to these hooks. However if an application needs more than the default 10\n * iterations to stabilize then you should investigate what is causing the model to continuously change during\n * the `$onChanges` hook execution.\n *\n * Increasing the TTL could have performance implications, so you should not change it without proper justification.\n *\n * @param {number} limit The number of `$onChanges` hook iterations.\n * @returns {number|object} the current limit (or `this` if called as a setter for chaining)\n */\n this.onChangesTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n return this;\n }\n return TTL;\n };\n\n var commentDirectivesEnabledConfig = true;\n /**\n * @ngdoc method\n * @name $compileProvider#commentDirectivesEnabled\n * @description\n *\n * It indicates to the compiler\n * whether or not directives on comments should be compiled.\n * Defaults to `true`.\n *\n * Calling this function with false disables the compilation of directives\n * on comments for the whole application.\n * This results in a compilation performance gain,\n * as the compiler doesn't have to check comments when looking for directives.\n * This should however only be used if you are sure that no comment directives are used in\n * the application (including any 3rd party directives).\n *\n * @param {boolean} enabled `false` if the compiler may ignore directives on comments\n * @returns {boolean|object} the current value (or `this` if called as a setter for chaining)\n */\n this.commentDirectivesEnabled = function(value) {\n if (arguments.length) {\n commentDirectivesEnabledConfig = value;\n return this;\n }\n return commentDirectivesEnabledConfig;\n };\n\n\n var cssClassDirectivesEnabledConfig = true;\n /**\n * @ngdoc method\n * @name $compileProvider#cssClassDirectivesEnabled\n * @description\n *\n * It indicates to the compiler\n * whether or not directives on element classes should be compiled.\n * Defaults to `true`.\n *\n * Calling this function with false disables the compilation of directives\n * on element classes for the whole application.\n * This results in a compilation performance gain,\n * as the compiler doesn't have to check element classes when looking for directives.\n * This should however only be used if you are sure that no class directives are used in\n * the application (including any 3rd party directives).\n *\n * @param {boolean} enabled `false` if the compiler may ignore directives on element classes\n * @returns {boolean|object} the current value (or `this` if called as a setter for chaining)\n */\n this.cssClassDirectivesEnabled = function(value) {\n if (arguments.length) {\n cssClassDirectivesEnabledConfig = value;\n return this;\n }\n return cssClassDirectivesEnabledConfig;\n };\n\n this.$get = [\n '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',\n '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri',\n function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse,\n $controller, $rootScope, $sce, $animate, $$sanitizeUri) {\n\n var SIMPLE_ATTR_NAME = /^\\w/;\n var specialAttrHolder = window.document.createElement('div');\n\n\n var commentDirectivesEnabled = commentDirectivesEnabledConfig;\n var cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig;\n\n\n var onChangesTtl = TTL;\n // The onChanges hooks should all be run together in a single digest\n // When changes occur, the call to trigger their hooks will be added to this queue\n var onChangesQueue;\n\n // This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest\n function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }\n\n\n function Attributes(element, attributesToCopy) {\n if (attributesToCopy) {\n var keys = Object.keys(attributesToCopy);\n var i, l, key;\n\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n this[key] = attributesToCopy[key];\n }\n } else {\n this.$attr = {};\n }\n\n this.$$element = element;\n }\n\n Attributes.prototype = {\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$normalize\n * @kind function\n *\n * @description\n * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n * `data-`) to its normalized, camelCase form.\n *\n * Also there is special case for Moz prefix starting with upper case letter.\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * @param {string} name Name to normalize\n */\n $normalize: directiveNormalize,\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$addClass\n * @kind function\n *\n * @description\n * Adds the CSS class value specified by the classVal parameter to the element. If animations\n * are enabled then an animation will be triggered for the class addition.\n *\n * @param {string} classVal The className value that will be added to the element\n */\n $addClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.addClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$removeClass\n * @kind function\n *\n * @description\n * Removes the CSS class value specified by the classVal parameter from the element. If\n * animations are enabled then an animation will be triggered for the class removal.\n *\n * @param {string} classVal The className value that will be removed from the element\n */\n $removeClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.removeClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$updateClass\n * @kind function\n *\n * @description\n * Adds and removes the appropriate CSS class values to the element based on the difference\n * between the new and old CSS class values (specified as newClasses and oldClasses).\n *\n * @param {string} newClasses The current CSS className value\n * @param {string} oldClasses The former CSS className value\n */\n $updateClass: function(newClasses, oldClasses) {\n var toAdd = tokenDifference(newClasses, oldClasses);\n if (toAdd && toAdd.length) {\n $animate.addClass(this.$$element, toAdd);\n }\n\n var toRemove = tokenDifference(oldClasses, newClasses);\n if (toRemove && toRemove.length) {\n $animate.removeClass(this.$$element, toRemove);\n }\n },\n\n /**\n * Set a normalized attribute on the element in a way such that all directives\n * can share the attribute. This function properly handles boolean attributes.\n * @param {string} key Normalized key. (ie ngAttribute)\n * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n * Defaults to true.\n * @param {string=} attrName Optional none normalized name. Defaults to key.\n */\n $set: function(key, value, writeAttr, attrName) {\n // TODO: decide whether or not to throw an error if \"class\"\n //is set through this function since it may cause $updateClass to\n //become unstable.\n\n var node = this.$$element[0],\n booleanKey = getBooleanAttrName(node, key),\n aliasedKey = getAliasedAttrName(key),\n observer = key,\n nodeName;\n\n if (booleanKey) {\n this.$$element.prop(key, value);\n attrName = booleanKey;\n } else if (aliasedKey) {\n this[aliasedKey] = value;\n observer = aliasedKey;\n }\n\n this[key] = value;\n\n // translate normalized key to actual key\n if (attrName) {\n this.$attr[key] = attrName;\n } else {\n attrName = this.$attr[key];\n if (!attrName) {\n this.$attr[key] = attrName = snake_case(key, '-');\n }\n }\n\n nodeName = nodeName_(this.$$element);\n\n if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) ||\n (nodeName === 'img' && key === 'src')) {\n // sanitize a[href] and img[src] values\n this[key] = value = $$sanitizeUri(value, key === 'src');\n } else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) {\n // sanitize img[srcset] values\n var result = '';\n\n // first check if there are spaces because it's not the same pattern\n var trimmedSrcset = trim(value);\n // ( 999x ,| 999w ,| ,|, )\n var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n // split srcset into tuple of uri and descriptor except for the last item\n var rawUris = trimmedSrcset.split(pattern);\n\n // for each tuples\n var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n for (var i = 0; i < nbrUrisWith2parts; i++) {\n var innerIdx = i * 2;\n // sanitize the uri\n result += $$sanitizeUri(trim(rawUris[innerIdx]), true);\n // add the descriptor\n result += (' ' + trim(rawUris[innerIdx + 1]));\n }\n\n // split the last item into uri and descriptor\n var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n // sanitize the last uri\n result += $$sanitizeUri(trim(lastTuple[0]), true);\n\n // and add the last descriptor if any\n if (lastTuple.length === 2) {\n result += (' ' + trim(lastTuple[1]));\n }\n this[key] = value = result;\n }\n\n if (writeAttr !== false) {\n if (value === null || isUndefined(value)) {\n this.$$element.removeAttr(attrName);\n } else {\n if (SIMPLE_ATTR_NAME.test(attrName)) {\n this.$$element.attr(attrName, value);\n } else {\n setSpecialAttr(this.$$element[0], attrName, value);\n }\n }\n }\n\n // fire observers\n var $$observers = this.$$observers;\n if ($$observers) {\n forEach($$observers[observer], function(fn) {\n try {\n fn(value);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n }\n },\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$observe\n * @kind function\n *\n * @description\n * Observes an interpolated attribute.\n *\n * The observer function will be invoked once during the next `$digest` following\n * compilation. The observer is then invoked whenever the interpolated value\n * changes.\n *\n * @param {string} key Normalized key. (ie ngAttribute) .\n * @param {function(interpolatedValue)} fn Function that will be called whenever\n the interpolated value of the attribute changes.\n * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation\n * guide} for more info.\n * @returns {function()} Returns a deregistration function for this observer.\n */\n $observe: function(key, fn) {\n var attrs = this,\n $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),\n listeners = ($$observers[key] || ($$observers[key] = []));\n\n listeners.push(fn);\n $rootScope.$evalAsync(function() {\n if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {\n // no one registered attribute interpolation function, so lets call it manually\n fn(attrs[key]);\n }\n });\n\n return function() {\n arrayRemove(listeners, fn);\n };\n }\n };\n\n function setSpecialAttr(element, attrName, value) {\n // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`\n // so we have to jump through some hoops to get such an attribute\n // https://github.com/angular/angular.js/pull/13318\n specialAttrHolder.innerHTML = '<span ' + attrName + '>';\n var attributes = specialAttrHolder.firstChild.attributes;\n var attribute = attributes[0];\n // We have to remove the attribute from its container element before we can add it to the destination element\n attributes.removeNamedItem(attribute.name);\n attribute.value = value;\n element.attributes.setNamedItem(attribute);\n }\n\n function safeAddClass($element, className) {\n try {\n $element.addClass(className);\n } catch (e) {\n // ignore, since it means that we are trying to set class on\n // SVG element, where class name is read-only.\n }\n }\n\n\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n denormalizeTemplate = (startSymbol === '{{' && endSymbol === '}}')\n ? identity\n : function denormalizeTemplate(template) {\n return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n },\n NG_ATTR_BINDING = /^ngAttr[A-Z]/;\n var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/;\n\n compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n var bindings = $element.data('$binding') || [];\n\n if (isArray(binding)) {\n bindings = bindings.concat(binding);\n } else {\n bindings.push(binding);\n }\n\n $element.data('$binding', bindings);\n } : noop;\n\n compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n safeAddClass($element, 'ng-binding');\n } : noop;\n\n compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n $element.data(dataName, scope);\n } : noop;\n\n compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n } : noop;\n\n compile.$$createComment = function(directiveName, comment) {\n var content = '';\n if (debugInfoEnabled) {\n content = ' ' + (directiveName || '') + ': ';\n if (comment) content += comment + ' ';\n }\n return window.document.createComment(content);\n };\n\n return compile;\n\n //================================\n\n function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,\n previousCompileContext) {\n if (!($compileNodes instanceof jqLite)) {\n // jquery always rewraps, whereas we need to preserve the original selector so that we can\n // modify it.\n $compileNodes = jqLite($compileNodes);\n }\n var compositeLinkFn =\n compileNodes($compileNodes, transcludeFn, $compileNodes,\n maxPriority, ignoreDirective, previousCompileContext);\n compile.$$addScopeClass($compileNodes);\n var namespace = null;\n return function publicLinkFn(scope, cloneConnectFn, options) {\n if (!$compileNodes) {\n throw $compileMinErr('multilink', 'This element has already been linked.');\n }\n assertArg(scope, 'scope');\n\n if (previousCompileContext && previousCompileContext.needsNewScope) {\n // A parent directive did a replace and a directive on this element asked\n // for transclusion, which caused us to lose a layer of element on which\n // we could hold the new transclusion scope, so we will create it manually\n // here.\n scope = scope.$parent.$new();\n }\n\n options = options || {};\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n transcludeControllers = options.transcludeControllers,\n futureParentElement = options.futureParentElement;\n\n // When `parentBoundTranscludeFn` is passed, it is a\n // `controllersBoundTransclude` function (it was previously passed\n // as `transclude` to directive.link) so we must unwrap it to get\n // its `boundTranscludeFn`\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n }\n\n if (!namespace) {\n namespace = detectNamespaceForChildElements(futureParentElement);\n }\n var $linkNode;\n if (namespace !== 'html') {\n // When using a directive with replace:true and templateUrl the $compileNodes\n // (or a child element inside of them)\n // might change, so we need to recreate the namespace adapted compileNodes\n // for call to the link function.\n // Note: This will already clone the nodes...\n $linkNode = jqLite(\n wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())\n );\n } else if (cloneConnectFn) {\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n // and sometimes changes the structure of the DOM.\n $linkNode = JQLitePrototype.clone.call($compileNodes);\n } else {\n $linkNode = $compileNodes;\n }\n\n if (transcludeControllers) {\n for (var controllerName in transcludeControllers) {\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n }\n }\n\n compile.$$addScopeInfo($linkNode, scope);\n\n if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n\n if (!cloneConnectFn) {\n $compileNodes = compositeLinkFn = null;\n }\n return $linkNode;\n };\n }\n\n function detectNamespaceForChildElements(parentElement) {\n // TODO: Make this detect MathML as well...\n var node = parentElement && parentElement[0];\n if (!node) {\n return 'html';\n } else {\n return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';\n }\n }\n\n /**\n * Compile function matches each node in nodeList against the directives. Once all directives\n * for a particular node are collected their compile functions are executed. The compile\n * functions return values - the linking functions - are combined into a composite linking\n * function, which is the a linking function for the node.\n *\n * @param {NodeList} nodeList an array of nodes or NodeList to compile\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new child of the transcluded parent scope.\n * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n * the rootElement must be set the jqLite collection of the compile root. This is\n * needed so that the jqLite collection items can be replaced with widgets.\n * @param {number=} maxPriority Max directive priority.\n * @returns {Function} A composite linking function of all of the matched directives or null.\n */\n function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,\n previousCompileContext) {\n var linkFns = [],\n // `nodeList` can be either an element's `.childNodes` (live NodeList)\n // or a jqLite/jQuery collection or an array\n notLiveList = isArray(nodeList) || (nodeList instanceof jqLite),\n attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;\n\n\n for (var i = 0; i < nodeList.length; i++) {\n attrs = new Attributes();\n\n // Support: IE 11 only\n // Workaround for #11781 and #14924\n if (msie === 11) {\n mergeConsecutiveTextNodes(nodeList, i, notLiveList);\n }\n\n // We must always refer to `nodeList[i]` hereafter,\n // since the nodes can be replaced underneath us.\n directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,\n ignoreDirective);\n\n nodeLinkFn = (directives.length)\n ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,\n null, [], [], previousCompileContext)\n : null;\n\n if (nodeLinkFn && nodeLinkFn.scope) {\n compile.$$addScopeClass(attrs.$$element);\n }\n\n childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n !(childNodes = nodeList[i].childNodes) ||\n !childNodes.length)\n ? null\n : compileNodes(childNodes,\n nodeLinkFn ? (\n (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)\n && nodeLinkFn.transclude) : transcludeFn);\n\n if (nodeLinkFn || childLinkFn) {\n linkFns.push(i, nodeLinkFn, childLinkFn);\n linkFnFound = true;\n nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n }\n\n //use the previous context only for the first element in the virtual group\n previousCompileContext = null;\n }\n\n // return a linking function if we have found anything, null otherwise\n return linkFnFound ? compositeLinkFn : null;\n\n function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n var stableNodeList;\n\n\n if (nodeLinkFnFound) {\n // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n // offsets don't get screwed up\n var nodeListLength = nodeList.length;\n stableNodeList = new Array(nodeListLength);\n\n // create a sparse array by only copying the elements which have a linkFn\n for (i = 0; i < linkFns.length; i += 3) {\n idx = linkFns[i];\n stableNodeList[idx] = nodeList[idx];\n }\n } else {\n stableNodeList = nodeList;\n }\n\n for (i = 0, ii = linkFns.length; i < ii;) {\n node = stableNodeList[linkFns[i++]];\n nodeLinkFn = linkFns[i++];\n childLinkFn = linkFns[i++];\n\n if (nodeLinkFn) {\n if (nodeLinkFn.scope) {\n childScope = scope.$new();\n compile.$$addScopeInfo(jqLite(node), childScope);\n } else {\n childScope = scope;\n }\n\n if (nodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(\n scope, nodeLinkFn.transclude, parentBoundTranscludeFn);\n\n } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n childBoundTranscludeFn = parentBoundTranscludeFn;\n\n } else if (!parentBoundTranscludeFn && transcludeFn) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n\n } else {\n childBoundTranscludeFn = null;\n }\n\n nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n\n } else if (childLinkFn) {\n childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n }\n }\n }\n }\n\n function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) {\n var node = nodeList[idx];\n var parent = node.parentNode;\n var sibling;\n\n if (node.nodeType !== NODE_TYPE_TEXT) {\n return;\n }\n\n while (true) {\n sibling = parent ? node.nextSibling : nodeList[idx + 1];\n if (!sibling || sibling.nodeType !== NODE_TYPE_TEXT) {\n break;\n }\n\n node.nodeValue = node.nodeValue + sibling.nodeValue;\n\n if (sibling.parentNode) {\n sibling.parentNode.removeChild(sibling);\n }\n if (notLiveList && sibling === nodeList[idx + 1]) {\n nodeList.splice(idx + 1, 1);\n }\n }\n }\n\n function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {\n function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n\n if (!transcludedScope) {\n transcludedScope = scope.$new(false, containingScope);\n transcludedScope.$$transcluded = true;\n }\n\n return transcludeFn(transcludedScope, cloneFn, {\n parentBoundTranscludeFn: previousBoundTranscludeFn,\n transcludeControllers: controllers,\n futureParentElement: futureParentElement\n });\n }\n\n // We need to attach the transclusion slots onto the `boundTranscludeFn`\n // so that they are available inside the `controllersBoundTransclude` function\n var boundSlots = boundTranscludeFn.$$slots = createMap();\n for (var slotName in transcludeFn.$$slots) {\n if (transcludeFn.$$slots[slotName]) {\n boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);\n } else {\n boundSlots[slotName] = null;\n }\n }\n\n return boundTranscludeFn;\n }\n\n /**\n * Looks for directives on the given node and adds them to the directive collection which is\n * sorted.\n *\n * @param node Node to search.\n * @param directives An array to which the directives are added to. This array is sorted before\n * the function returns.\n * @param attrs The shared attrs object which is used to populate the normalized attributes.\n * @param {number=} maxPriority Max directive priority.\n */\n function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n var nodeType = node.nodeType,\n attrsMap = attrs.$attr,\n match,\n nodeName,\n className;\n\n switch (nodeType) {\n case NODE_TYPE_ELEMENT: /* Element */\n\n nodeName = nodeName_(node);\n\n // use the node name: <directive>\n addDirective(directives,\n directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective);\n\n // iterate over the attributes\n for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,\n j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n var attrStartName = false;\n var attrEndName = false;\n\n attr = nAttrs[j];\n name = attr.name;\n value = attr.value;\n\n // support ngAttr attribute binding\n ngAttrName = directiveNormalize(name);\n isNgAttr = NG_ATTR_BINDING.test(ngAttrName);\n if (isNgAttr) {\n name = name.replace(PREFIX_REGEXP, '')\n .substr(8).replace(/_(.)/g, function(match, letter) {\n return letter.toUpperCase();\n });\n }\n\n var multiElementMatch = ngAttrName.match(MULTI_ELEMENT_DIR_RE);\n if (multiElementMatch && directiveIsMultiElement(multiElementMatch[1])) {\n attrStartName = name;\n attrEndName = name.substr(0, name.length - 5) + 'end';\n name = name.substr(0, name.length - 6);\n }\n\n nName = directiveNormalize(name.toLowerCase());\n attrsMap[nName] = name;\n if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n attrs[nName] = value;\n if (getBooleanAttrName(node, nName)) {\n attrs[nName] = true; // presence means true\n }\n }\n addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n attrEndName);\n }\n\n if (nodeName === 'input' && node.getAttribute('type') === 'hidden') {\n // Hidden input elements can have strange behaviour when navigating back to the page\n // This tells the browser not to try to cache and reinstate previous values\n node.setAttribute('autocomplete', 'off');\n }\n\n // use class as directive\n if (!cssClassDirectivesEnabled) break;\n className = node.className;\n if (isObject(className)) {\n // Maybe SVGAnimatedString\n className = className.animVal;\n }\n if (isString(className) && className !== '') {\n while ((match = CLASS_DIRECTIVE_REGEXP.exec(className))) {\n nName = directiveNormalize(match[2]);\n if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[3]);\n }\n className = className.substr(match.index + match[0].length);\n }\n }\n break;\n case NODE_TYPE_TEXT: /* Text Node */\n addTextInterpolateDirective(directives, node.nodeValue);\n break;\n case NODE_TYPE_COMMENT: /* Comment */\n if (!commentDirectivesEnabled) break;\n collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective);\n break;\n }\n\n directives.sort(byPriority);\n return directives;\n }\n\n function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n // function created because of performance, try/catch disables\n // the optimization of the whole function #14848\n try {\n var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n if (match) {\n var nName = directiveNormalize(match[1]);\n if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[2]);\n }\n }\n } catch (e) {\n // turns out that under some circumstances IE9 throws errors when one attempts to read\n // comment's node value.\n // Just ignore it and continue. (Can't seem to reproduce in test case.)\n }\n }\n\n /**\n * Given a node with a directive-start it collects all of the siblings until it finds\n * directive-end.\n * @param node\n * @param attrStart\n * @param attrEnd\n * @returns {*}\n */\n function groupScan(node, attrStart, attrEnd) {\n var nodes = [];\n var depth = 0;\n if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n do {\n if (!node) {\n throw $compileMinErr('uterdir',\n 'Unterminated attribute, found \\'{0}\\' but no matching \\'{1}\\' found.',\n attrStart, attrEnd);\n }\n if (node.nodeType === NODE_TYPE_ELEMENT) {\n if (node.hasAttribute(attrStart)) depth++;\n if (node.hasAttribute(attrEnd)) depth--;\n }\n nodes.push(node);\n node = node.nextSibling;\n } while (depth > 0);\n } else {\n nodes.push(node);\n }\n\n return jqLite(nodes);\n }\n\n /**\n * Wrapper for linking function which converts normal linking function into a grouped\n * linking function.\n * @param linkFn\n * @param attrStart\n * @param attrEnd\n * @returns {Function}\n */\n function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {\n element = groupScan(element[0], attrStart, attrEnd);\n return linkFn(scope, element, attrs, controllers, transcludeFn);\n };\n }\n\n /**\n * A function generator that is used to support both eager and lazy compilation\n * linking function.\n * @param eager\n * @param $compileNodes\n * @param transcludeFn\n * @param maxPriority\n * @param ignoreDirective\n * @param previousCompileContext\n * @returns {Function}\n */\n function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {\n var compiled;\n\n if (eager) {\n return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n }\n return /** @this */ function lazyCompilation() {\n if (!compiled) {\n compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n\n // Null out all of these references in order to make them eligible for garbage collection\n // since this is a potentially long lived closure\n $compileNodes = transcludeFn = previousCompileContext = null;\n }\n return compiled.apply(this, arguments);\n };\n }\n\n /**\n * Once the directives have been collected, their compile functions are executed. This method\n * is responsible for inlining directive templates as well as terminating the application\n * of the directives if the terminal directive has been reached.\n *\n * @param {Array} directives Array of collected directives to execute their compile function.\n * this needs to be pre-sorted by priority order.\n * @param {Node} compileNode The raw DOM node to apply the compile functions to\n * @param {Object} templateAttrs The shared attribute function\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new\n * child of the transcluded parent scope.\n * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n * argument has the root jqLite array so that we can replace nodes\n * on it.\n * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n * compiling the transclusion.\n * @param {Array.<Function>} preLinkFns\n * @param {Array.<Function>} postLinkFns\n * @param {Object} previousCompileContext Context used for previous compilation of the current\n * node\n * @returns {Function} linkFn\n */\n function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,\n jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,\n previousCompileContext) {\n previousCompileContext = previousCompileContext || {};\n\n var terminalPriority = -Number.MAX_VALUE,\n newScopeDirective = previousCompileContext.newScopeDirective,\n controllerDirectives = previousCompileContext.controllerDirectives,\n newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n templateDirective = previousCompileContext.templateDirective,\n nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n hasTranscludeDirective = false,\n hasTemplate = false,\n hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n $compileNode = templateAttrs.$$element = jqLite(compileNode),\n directive,\n directiveName,\n $template,\n replaceDirective = originalReplaceDirective,\n childTranscludeFn = transcludeFn,\n linkFn,\n didScanForMultipleTransclusion = false,\n mightHaveMultipleTransclusionError = false,\n directiveValue;\n\n // executes all directives on the current element\n for (var i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n var attrStart = directive.$$start;\n var attrEnd = directive.$$end;\n\n // collect multiblock sections\n if (attrStart) {\n $compileNode = groupScan(compileNode, attrStart, attrEnd);\n }\n $template = undefined;\n\n if (terminalPriority > directive.priority) {\n break; // prevent further processing of directives\n }\n\n directiveValue = directive.scope;\n\n if (directiveValue) {\n\n // skip the check for directives with async templates, we'll check the derived sync\n // directive when the template arrives\n if (!directive.templateUrl) {\n if (isObject(directiveValue)) {\n // This directive is trying to add an isolated scope.\n // Check that there is no scope of any kind already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,\n directive, $compileNode);\n newIsolateScopeDirective = directive;\n } else {\n // This directive is trying to add a child scope.\n // Check that there is no isolated scope already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n $compileNode);\n }\n }\n\n newScopeDirective = newScopeDirective || directive;\n }\n\n directiveName = directive.name;\n\n // If we encounter a condition that can result in transclusion on the directive,\n // then scan ahead in the remaining directives for others that may cause a multiple\n // transclusion error to be thrown during the compilation process. If a matching directive\n // is found, then we know that when we encounter a transcluded directive, we need to eagerly\n // compile the `transclude` function rather than doing it lazily in order to throw\n // exceptions at the correct time\n if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))\n || (directive.transclude && !directive.$$tlb))) {\n var candidateDirective;\n\n for (var scanningIndex = i + 1; (candidateDirective = directives[scanningIndex++]);) {\n if ((candidateDirective.transclude && !candidateDirective.$$tlb)\n || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) {\n mightHaveMultipleTransclusionError = true;\n break;\n }\n }\n\n didScanForMultipleTransclusion = true;\n }\n\n if (!directive.templateUrl && directive.controller) {\n controllerDirectives = controllerDirectives || createMap();\n assertNoDuplicate('\\'' + directiveName + '\\' controller',\n controllerDirectives[directiveName], directive, $compileNode);\n controllerDirectives[directiveName] = directive;\n }\n\n directiveValue = directive.transclude;\n\n if (directiveValue) {\n hasTranscludeDirective = true;\n\n // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n // This option should only be used by directives that know how to safely handle element transclusion,\n // where the transcluded nodes are added or replaced after linking.\n if (!directive.$$tlb) {\n assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n nonTlbTranscludeDirective = directive;\n }\n\n if (directiveValue === 'element') {\n hasElementTranscludeDirective = true;\n terminalPriority = directive.priority;\n $template = $compileNode;\n $compileNode = templateAttrs.$$element =\n jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName]));\n compileNode = $compileNode[0];\n replaceWith(jqCollection, sliceArgs($template), compileNode);\n\n // Support: Chrome < 50\n // https://github.com/angular/angular.js/issues/14041\n\n // In the versions of V8 prior to Chrome 50, the document fragment that is created\n // in the `replaceWith` function is improperly garbage collected despite still\n // being referenced by the `parentNode` property of all of the child nodes. By adding\n // a reference to the fragment via a different property, we can avoid that incorrect\n // behavior.\n // TODO: remove this line after Chrome 50 has been released\n $template[0].$$parentNode = $template[0].parentNode;\n\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority,\n replaceDirective && replaceDirective.name, {\n // Don't pass in:\n // - controllerDirectives - otherwise we'll create duplicates controllers\n // - newIsolateScopeDirective or templateDirective - combining templates with\n // element transclusion doesn't make sense.\n //\n // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n // on the same element more than once.\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n } else {\n\n var slots = createMap();\n\n if (!isObject(directiveValue)) {\n $template = jqLite(jqLiteClone(compileNode)).contents();\n } else {\n\n // We have transclusion slots,\n // collect them up, compile them and store their transclusion functions\n $template = [];\n\n var slotMap = createMap();\n var filledSlots = createMap();\n\n // Parse the element selectors\n forEach(directiveValue, function(elementSelector, slotName) {\n // If an element selector starts with a ? then it is optional\n var optional = (elementSelector.charAt(0) === '?');\n elementSelector = optional ? elementSelector.substring(1) : elementSelector;\n\n slotMap[elementSelector] = slotName;\n\n // We explicitly assign `null` since this implies that a slot was defined but not filled.\n // Later when calling boundTransclusion functions with a slot name we only error if the\n // slot is `undefined`\n slots[slotName] = null;\n\n // filledSlots contains `true` for all slots that are either optional or have been\n // filled. This is used to check that we have not missed any required slots\n filledSlots[slotName] = optional;\n });\n\n // Add the matching elements into their slot\n forEach($compileNode.contents(), function(node) {\n var slotName = slotMap[directiveNormalize(nodeName_(node))];\n if (slotName) {\n filledSlots[slotName] = true;\n slots[slotName] = slots[slotName] || [];\n slots[slotName].push(node);\n } else {\n $template.push(node);\n }\n });\n\n // Check for required slots that were not filled\n forEach(filledSlots, function(filled, slotName) {\n if (!filled) {\n throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);\n }\n });\n\n for (var slotName in slots) {\n if (slots[slotName]) {\n // Only define a transclusion function if the slot was filled\n slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn);\n }\n }\n }\n\n $compileNode.empty(); // clear contents\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined,\n undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope});\n childTranscludeFn.$$slots = slots;\n }\n }\n\n if (directive.template) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n directiveValue = (isFunction(directive.template))\n ? directive.template($compileNode, templateAttrs)\n : directive.template;\n\n directiveValue = denormalizeTemplate(directiveValue);\n\n if (directive.replace) {\n replaceDirective = directive;\n if (jqLiteIsTextNode(directiveValue)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n }\n compileNode = $template[0];\n\n if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n 'Template for directive \\'{0}\\' must have exactly one root element. {1}',\n directiveName, '');\n }\n\n replaceWith(jqCollection, $compileNode, compileNode);\n\n var newTemplateAttrs = {$attr: {}};\n\n // combine directives from the original node and from the template:\n // - take the array of directives for this element\n // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n // - collect directives from the template and sort them by priority\n // - combine directives as: processed + template + unprocessed\n var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n\n if (newIsolateScopeDirective || newScopeDirective) {\n // The original directive caused the current element to be replaced but this element\n // also needs to have a new scope, so we need to tell the template directives\n // that they would need to get their scope from further up, if they require transclusion\n markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective);\n }\n directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n\n ii = directives.length;\n } else {\n $compileNode.html(directiveValue);\n }\n }\n\n if (directive.templateUrl) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n if (directive.replace) {\n replaceDirective = directive;\n }\n\n // eslint-disable-next-line no-func-assign\n nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,\n templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n controllerDirectives: controllerDirectives,\n newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,\n newIsolateScopeDirective: newIsolateScopeDirective,\n templateDirective: templateDirective,\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n ii = directives.length;\n } else if (directive.compile) {\n try {\n linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n var context = directive.$$originalDirective || directive;\n if (isFunction(linkFn)) {\n addLinkFns(null, bind(context, linkFn), attrStart, attrEnd);\n } else if (linkFn) {\n addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd);\n }\n } catch (e) {\n $exceptionHandler(e, startingTag($compileNode));\n }\n }\n\n if (directive.terminal) {\n nodeLinkFn.terminal = true;\n terminalPriority = Math.max(terminalPriority, directive.priority);\n }\n\n }\n\n nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n nodeLinkFn.templateOnThisElement = hasTemplate;\n nodeLinkFn.transclude = childTranscludeFn;\n\n previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n return nodeLinkFn;\n\n ////////////////////\n\n function addLinkFns(pre, post, attrStart, attrEnd) {\n if (pre) {\n if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n pre.require = directive.require;\n pre.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n pre = cloneAndAnnotateFn(pre, {isolateScope: true});\n }\n preLinkFns.push(pre);\n }\n if (post) {\n if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n post.require = directive.require;\n post.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n post = cloneAndAnnotateFn(post, {isolateScope: true});\n }\n postLinkFns.push(post);\n }\n }\n\n function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,\n attrs, scopeBindingInfo;\n\n if (compileNode === linkNode) {\n attrs = templateAttrs;\n $element = templateAttrs.$$element;\n } else {\n $element = jqLite(linkNode);\n attrs = new Attributes($element, templateAttrs);\n }\n\n controllerScope = scope;\n if (newIsolateScopeDirective) {\n isolateScope = scope.$new(true);\n } else if (newScopeDirective) {\n controllerScope = scope.$parent;\n }\n\n if (boundTranscludeFn) {\n // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n transcludeFn = controllersBoundTransclude;\n transcludeFn.$$boundTransclude = boundTranscludeFn;\n // expose the slots on the `$transclude` function\n transcludeFn.isSlotFilled = function(slotName) {\n return !!boundTranscludeFn.$$slots[slotName];\n };\n }\n\n if (controllerDirectives) {\n elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective);\n }\n\n if (newIsolateScopeDirective) {\n // Initialize isolate scope bindings for new isolate scope directive.\n compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||\n templateDirective === newIsolateScopeDirective.$$originalDirective)));\n compile.$$addScopeClass($element, true);\n isolateScope.$$isolateBindings =\n newIsolateScopeDirective.$$isolateBindings;\n scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope,\n isolateScope.$$isolateBindings,\n newIsolateScopeDirective);\n if (scopeBindingInfo.removeWatches) {\n isolateScope.$on('$destroy', scopeBindingInfo.removeWatches);\n }\n }\n\n // Initialize bindToController bindings\n for (var name in elementControllers) {\n var controllerDirective = controllerDirectives[name];\n var controller = elementControllers[name];\n var bindings = controllerDirective.$$bindings.bindToController;\n\n if (preAssignBindingsEnabled) {\n if (bindings) {\n controller.bindingInfo =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n } else {\n controller.bindingInfo = {};\n }\n\n var controllerResult = controller();\n if (controllerResult !== controller.instance) {\n // If the controller constructor has a return value, overwrite the instance\n // from setupControllers\n controller.instance = controllerResult;\n $element.data('$' + controllerDirective.name + 'Controller', controllerResult);\n if (controller.bindingInfo.removeWatches) {\n controller.bindingInfo.removeWatches();\n }\n controller.bindingInfo =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n } else {\n controller.instance = controller();\n $element.data('$' + controllerDirective.name + 'Controller', controller.instance);\n controller.bindingInfo =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n }\n\n // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy\n forEach(controllerDirectives, function(controllerDirective, name) {\n var require = controllerDirective.require;\n if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {\n extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));\n }\n });\n\n // Handle the init and destroy lifecycle hooks on all controllers that have them\n forEach(elementControllers, function(controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$onChanges)) {\n try {\n controllerInstance.$onChanges(controller.bindingInfo.initialChanges);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$onInit)) {\n try {\n controllerInstance.$onInit();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$doCheck)) {\n controllerScope.$watch(function() { controllerInstance.$doCheck(); });\n controllerInstance.$doCheck();\n }\n if (isFunction(controllerInstance.$onDestroy)) {\n controllerScope.$on('$destroy', function callOnDestroyHook() {\n controllerInstance.$onDestroy();\n });\n }\n });\n\n // PRELINKING\n for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n linkFn = preLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // RECURSION\n // We only pass the isolate scope, if the isolate directive has a template,\n // otherwise the child elements do not belong to the isolate directive.\n var scopeToChild = scope;\n if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n scopeToChild = isolateScope;\n }\n if (childLinkFn) {\n childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n }\n\n // POSTLINKING\n for (i = postLinkFns.length - 1; i >= 0; i--) {\n linkFn = postLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // Trigger $postLink lifecycle hooks\n forEach(elementControllers, function(controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$postLink)) {\n controllerInstance.$postLink();\n }\n });\n\n // This is the function that is injected as `$transclude`.\n // Note: all arguments are optional!\n function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n var transcludeControllers;\n // No scope passed in:\n if (!isScope(scope)) {\n slotName = futureParentElement;\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n if (slotName) {\n // slotTranscludeFn can be one of three things:\n // * a transclude function - a filled slot\n // * `null` - an optional slot that was not filled\n // * `undefined` - a slot that was not declared (i.e. invalid)\n var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n if (slotTranscludeFn) {\n return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n } else if (isUndefined(slotTranscludeFn)) {\n throw $compileMinErr('noslot',\n 'No parent directive that requires a transclusion with slot name \"{0}\". ' +\n 'Element: {1}',\n slotName, startingTag($element));\n }\n } else {\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }\n }\n }\n }\n\n function getControllers(directiveName, require, $element, elementControllers) {\n var value;\n\n if (isString(require)) {\n var match = require.match(REQUIRE_PREFIX_REGEXP);\n var name = require.substring(match[0].length);\n var inheritType = match[1] || match[3];\n var optional = match[2] === '?';\n\n //If only parents then start at the parent element\n if (inheritType === '^^') {\n $element = $element.parent();\n //Otherwise attempt getting the controller from elementControllers in case\n //the element is transcluded (and has no data) and to avoid .data if possible\n } else {\n value = elementControllers && elementControllers[name];\n value = value && value.instance;\n }\n\n if (!value) {\n var dataName = '$' + name + 'Controller';\n value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);\n }\n\n if (!value && !optional) {\n throw $compileMinErr('ctreq',\n 'Controller \\'{0}\\', required by directive \\'{1}\\', can\\'t be found!',\n name, directiveName);\n }\n } else if (isArray(require)) {\n value = [];\n for (var i = 0, ii = require.length; i < ii; i++) {\n value[i] = getControllers(directiveName, require[i], $element, elementControllers);\n }\n } else if (isObject(require)) {\n value = {};\n forEach(require, function(controller, property) {\n value[property] = getControllers(directiveName, controller, $element, elementControllers);\n });\n }\n\n return value || null;\n }\n\n function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {\n var elementControllers = createMap();\n for (var controllerKey in controllerDirectives) {\n var directive = controllerDirectives[controllerKey];\n var locals = {\n $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n $element: $element,\n $attrs: attrs,\n $transclude: transcludeFn\n };\n\n var controller = directive.controller;\n if (controller === '@') {\n controller = attrs[directive.name];\n }\n\n var controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n // For directives with element transclusion the element is a comment.\n // In this case .data will not attach any data.\n // Instead, we save the controllers for the element in a local hash and attach to .data\n // later, once we have the actual element.\n elementControllers[directive.name] = controllerInstance;\n $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n }\n return elementControllers;\n }\n\n // Depending upon the context in which a directive finds itself it might need to have a new isolated\n // or child scope created. For instance:\n // * if the directive has been pulled into a template because another directive with a higher priority\n // asked for element transclusion\n // * if the directive itself asks for transclusion but it is at the root of a template and the original\n // element was replaced. See https://github.com/angular/angular.js/issues/12936\n function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }\n\n /**\n * looks up the directive and decorates it with exception handling and proper parameters. We\n * call this the boundDirective.\n *\n * @param {string} name name of the directive to look up.\n * @param {string} location The directive must be found in specific format.\n * String containing any of theses characters:\n *\n * * `E`: element name\n * * `A': attribute\n * * `C`: class\n * * `M`: comment\n * @returns {boolean} true if directive was added.\n */\n function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,\n endAttrName) {\n if (name === ignoreDirective) return null;\n var match = null;\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&\n directive.restrict.indexOf(location) !== -1) {\n if (startAttrName) {\n directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});\n }\n if (!directive.$$bindings) {\n var bindings = directive.$$bindings =\n parseDirectiveBindings(directive, directive.name);\n if (isObject(bindings.isolateScope)) {\n directive.$$isolateBindings = bindings.isolateScope;\n }\n }\n tDirectives.push(directive);\n match = directive;\n }\n }\n }\n return match;\n }\n\n\n /**\n * looks up the directive and returns true if it is a multi-element directive,\n * and therefore requires DOM nodes between -start and -end markers to be grouped\n * together.\n *\n * @param {string} name name of the directive to look up.\n * @returns true if directive was registered as multi-element.\n */\n function directiveIsMultiElement(name) {\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if (directive.multiElement) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * When the element is replaced with HTML template then the new attributes\n * on the template need to be merged with the existing attributes in the DOM.\n * The desired effect is to have both of the attributes present.\n *\n * @param {object} dst destination attributes (original DOM)\n * @param {object} src source attributes (from the directive template)\n */\n function mergeTemplateAttributes(dst, src) {\n var srcAttr = src.$attr,\n dstAttr = dst.$attr;\n\n // reapply the old attributes to the new element\n forEach(dst, function(value, key) {\n if (key.charAt(0) !== '$') {\n if (src[key] && src[key] !== value) {\n if (value.length) {\n value += (key === 'style' ? ';' : ' ') + src[key];\n } else {\n value = src[key];\n }\n }\n dst.$set(key, value, true, srcAttr[key]);\n }\n });\n\n // copy the new attributes on the old attrs object\n forEach(src, function(value, key) {\n // Check if we already set this attribute in the loop above.\n // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') {\n dst[key] = value;\n\n if (key !== 'class' && key !== 'style') {\n dstAttr[key] = srcAttr[key];\n }\n }\n });\n }\n\n\n function compileTemplateUrl(directives, $compileNode, tAttrs,\n $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n var linkQueue = [],\n afterTemplateNodeLinkFn,\n afterTemplateChildLinkFn,\n beforeTemplateCompileNode = $compileNode[0],\n origAsyncDirective = directives.shift(),\n derivedSyncDirective = inherit(origAsyncDirective, {\n templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective\n }),\n templateUrl = (isFunction(origAsyncDirective.templateUrl))\n ? origAsyncDirective.templateUrl($compileNode, tAttrs)\n : origAsyncDirective.templateUrl,\n templateNamespace = origAsyncDirective.templateNamespace;\n\n $compileNode.empty();\n\n $templateRequest(templateUrl)\n .then(function(content) {\n var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n content = denormalizeTemplate(content);\n\n if (origAsyncDirective.replace) {\n if (jqLiteIsTextNode(content)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n }\n compileNode = $template[0];\n\n if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n 'Template for directive \\'{0}\\' must have exactly one root element. {1}',\n origAsyncDirective.name, templateUrl);\n }\n\n tempTemplateAttrs = {$attr: {}};\n replaceWith($rootElement, $compileNode, compileNode);\n var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n\n if (isObject(origAsyncDirective.scope)) {\n // the original directive that caused the template to be loaded async required\n // an isolate scope\n markDirectiveScope(templateDirectives, true);\n }\n directives = templateDirectives.concat(directives);\n mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n } else {\n compileNode = beforeTemplateCompileNode;\n $compileNode.html(content);\n }\n\n directives.unshift(derivedSyncDirective);\n\n afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,\n childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,\n previousCompileContext);\n forEach($rootElement, function(node, i) {\n if (node === compileNode) {\n $rootElement[i] = $compileNode[0];\n }\n });\n afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n\n while (linkQueue.length) {\n var scope = linkQueue.shift(),\n beforeTemplateLinkNode = linkQueue.shift(),\n linkRootElement = linkQueue.shift(),\n boundTranscludeFn = linkQueue.shift(),\n linkNode = $compileNode[0];\n\n if (scope.$$destroyed) continue;\n\n if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n var oldClasses = beforeTemplateLinkNode.className;\n\n if (!(previousCompileContext.hasElementTranscludeDirective &&\n origAsyncDirective.replace)) {\n // it was cloned therefore we have to clone as well.\n linkNode = jqLiteClone(compileNode);\n }\n replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n // Copy in CSS classes from original node\n safeAddClass(jqLite(linkNode), oldClasses);\n }\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n } else {\n childBoundTranscludeFn = boundTranscludeFn;\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n childBoundTranscludeFn);\n }\n linkQueue = null;\n }).catch(function(error) {\n if (isError(error)) {\n $exceptionHandler(error);\n }\n });\n\n return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n var childBoundTranscludeFn = boundTranscludeFn;\n if (scope.$$destroyed) return;\n if (linkQueue) {\n linkQueue.push(scope,\n node,\n rootElement,\n childBoundTranscludeFn);\n } else {\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n }\n };\n }\n\n\n /**\n * Sorting function for bound directives.\n */\n function byPriority(a, b) {\n var diff = b.priority - a.priority;\n if (diff !== 0) return diff;\n if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;\n return a.index - b.index;\n }\n\n function assertNoDuplicate(what, previousDirective, directive, element) {\n\n function wrapModuleNameIfDefined(moduleName) {\n return moduleName ?\n (' (module: ' + moduleName + ')') :\n '';\n }\n\n if (previousDirective) {\n throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',\n previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),\n directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));\n }\n }\n\n\n function addTextInterpolateDirective(directives, text) {\n var interpolateFn = $interpolate(text, true);\n if (interpolateFn) {\n directives.push({\n priority: 0,\n compile: function textInterpolateCompileFn(templateNode) {\n var templateNodeParent = templateNode.parent(),\n hasCompileParent = !!templateNodeParent.length;\n\n // When transcluding a template that has bindings in the root\n // we don't have a parent and thus need to add the class during linking fn.\n if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n\n return function textInterpolateLinkFn(scope, node) {\n var parent = node.parent();\n if (!hasCompileParent) compile.$$addBindingClass(parent);\n compile.$$addBindingInfo(parent, interpolateFn.expressions);\n scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n node[0].nodeValue = value;\n });\n };\n }\n });\n }\n }\n\n\n function wrapTemplate(type, template) {\n type = lowercase(type || 'html');\n switch (type) {\n case 'svg':\n case 'math':\n var wrapper = window.document.createElement('div');\n wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';\n return wrapper.childNodes[0].childNodes;\n default:\n return template;\n }\n }\n\n\n function getTrustedContext(node, attrNormalizedName) {\n if (attrNormalizedName === 'srcdoc') {\n return $sce.HTML;\n }\n var tag = nodeName_(node);\n // All tags with src attributes require a RESOURCE_URL value, except for\n // img and various html5 media tags.\n if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') {\n if (['img', 'video', 'audio', 'source', 'track'].indexOf(tag) === -1) {\n return $sce.RESOURCE_URL;\n }\n // maction[xlink:href] can source SVG. It's not limited to <maction>.\n } else if (attrNormalizedName === 'xlinkHref' ||\n (tag === 'form' && attrNormalizedName === 'action') ||\n // links can be stylesheets or imports, which can run script in the current origin\n (tag === 'link' && attrNormalizedName === 'href')\n ) {\n return $sce.RESOURCE_URL;\n }\n }\n\n\n function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {\n var trustedContext = getTrustedContext(node, name);\n var mustHaveExpression = !isNgAttr;\n var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr;\n\n var interpolateFn = $interpolate(value, mustHaveExpression, trustedContext, allOrNothing);\n\n // no interpolation found -> ignore\n if (!interpolateFn) return;\n\n if (name === 'multiple' && nodeName_(node) === 'select') {\n throw $compileMinErr('selmulti',\n 'Binding to the \\'multiple\\' attribute is not supported. Element: {0}',\n startingTag(node));\n }\n\n if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n throw $compileMinErr('nodomevents',\n 'Interpolations for HTML DOM event attributes are disallowed. Please use the ' +\n 'ng- versions (such as ng-click instead of onclick) instead.');\n }\n\n directives.push({\n priority: 100,\n compile: function() {\n return {\n pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n var $$observers = (attr.$$observers || (attr.$$observers = createMap()));\n\n // If the attribute has changed since last $interpolate()ed\n var newValue = attr[name];\n if (newValue !== value) {\n // we need to interpolate again since the attribute value has been updated\n // (e.g. by another directive's compile function)\n // ensure unset/empty values make interpolateFn falsy\n interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n value = newValue;\n }\n\n // if attribute was updated so that there is no interpolation going on we don't want to\n // register any observers\n if (!interpolateFn) return;\n\n // initialize attr object so that it's ready in case we need the value for isolate\n // scope initialization, otherwise the value would not be available from isolate\n // directive's linking fn during linking phase\n attr[name] = interpolateFn(scope);\n\n ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n (attr.$$observers && attr.$$observers[name].$$scope || scope).\n $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n //special case for class attribute addition + removal\n //so that class changes can tap into the animation\n //hooks provided by the $animate service. Be sure to\n //skip animations when the first digest occurs (when\n //both the new and the old values are the same) since\n //the CSS classes are the non-interpolated values\n if (name === 'class' && newValue !== oldValue) {\n attr.$updateClass(newValue, oldValue);\n } else {\n attr.$set(name, newValue);\n }\n });\n }\n };\n }\n });\n }\n\n\n /**\n * This is a special jqLite.replaceWith, which can replace items which\n * have no parents, provided that the containing jqLite collection is provided.\n *\n * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n * in the root of the tree.\n * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n * the shell, but replace its DOM node reference.\n * @param {Node} newNode The new DOM node.\n */\n function replaceWith($rootElement, elementsToRemove, newNode) {\n var firstElementToRemove = elementsToRemove[0],\n removeCount = elementsToRemove.length,\n parent = firstElementToRemove.parentNode,\n i, ii;\n\n if ($rootElement) {\n for (i = 0, ii = $rootElement.length; i < ii; i++) {\n if ($rootElement[i] === firstElementToRemove) {\n $rootElement[i++] = newNode;\n for (var j = i, j2 = j + removeCount - 1,\n jj = $rootElement.length;\n j < jj; j++, j2++) {\n if (j2 < jj) {\n $rootElement[j] = $rootElement[j2];\n } else {\n delete $rootElement[j];\n }\n }\n $rootElement.length -= removeCount - 1;\n\n // If the replaced element is also the jQuery .context then replace it\n // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n // http://api.jquery.com/context/\n if ($rootElement.context === firstElementToRemove) {\n $rootElement.context = newNode;\n }\n break;\n }\n }\n }\n\n if (parent) {\n parent.replaceChild(newNode, firstElementToRemove);\n }\n\n // Append all the `elementsToRemove` to a fragment. This will...\n // - remove them from the DOM\n // - allow them to still be traversed with .nextSibling\n // - allow a single fragment.qSA to fetch all elements being removed\n var fragment = window.document.createDocumentFragment();\n for (i = 0; i < removeCount; i++) {\n fragment.appendChild(elementsToRemove[i]);\n }\n\n if (jqLite.hasData(firstElementToRemove)) {\n // Copy over user data (that includes Angular's $scope etc.). Don't copy private\n // data here because there's no public interface in jQuery to do that and copying over\n // event listeners (which is the main use of private data) wouldn't work anyway.\n jqLite.data(newNode, jqLite.data(firstElementToRemove));\n\n // Remove $destroy event listeners from `firstElementToRemove`\n jqLite(firstElementToRemove).off('$destroy');\n }\n\n // Cleanup any data/listeners on the elements and children.\n // This includes invoking the $destroy event on any elements with listeners.\n jqLite.cleanData(fragment.querySelectorAll('*'));\n\n // Update the jqLite collection to only contain the `newNode`\n for (i = 1; i < removeCount; i++) {\n delete elementsToRemove[i];\n }\n elementsToRemove[0] = newNode;\n elementsToRemove.length = 1;\n }\n\n\n function cloneAndAnnotateFn(fn, annotation) {\n return extend(function() { return fn.apply(null, arguments); }, fn, annotation);\n }\n\n\n function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n try {\n linkFn(scope, $element, attrs, controllers, transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\n }\n }\n\n function strictBindingsCheck(attrName, directiveName) {\n if (strictComponentBindingsEnabled) {\n throw $compileMinErr('missingattr',\n 'Attribute \\'{0}\\' of \\'{1}\\' is non-optional and must be set!',\n attrName, directiveName);\n }\n }\n\n // Set up $watches for isolate scope and controller bindings.\n function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {\n var removeWatchCollection = [];\n var initialChanges = {};\n var changes;\n\n forEach(bindings, function initializeBinding(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, <, or &\n lastValue,\n parentGet, parentSet, compare, removeWatch;\n\n switch (mode) {\n\n case '@':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n strictBindingsCheck(attrName, directive.name);\n destination[scopeName] = attrs[attrName] = undefined;\n\n }\n removeWatch = attrs.$observe(attrName, function(value) {\n if (isString(value) || isBoolean(value)) {\n var oldValue = destination[scopeName];\n recordChanges(scopeName, value, oldValue);\n destination[scopeName] = value;\n }\n });\n attrs.$$observers[attrName].$$scope = scope;\n lastValue = attrs[attrName];\n if (isString(lastValue)) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(lastValue)(scope);\n } else if (isBoolean(lastValue)) {\n // If the attributes is one of the BOOLEAN_ATTR then Angular will have converted\n // the value to boolean rather than a string, so we special case this situation\n destination[scopeName] = lastValue;\n }\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n removeWatchCollection.push(removeWatch);\n break;\n\n case '=':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n strictBindingsCheck(attrName, directive.name);\n attrs[attrName] = undefined;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = simpleCompare;\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n 'Expression \\'{0}\\' in attribute \\'{1}\\' used with directive \\'{2}\\' is non-assignable!',\n attrs[attrName], attrName, directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n lastValue = parentValue;\n return lastValue;\n };\n parentValueWatch.$stateful = true;\n if (definition.collection) {\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n removeWatchCollection.push(removeWatch);\n break;\n\n case '<':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n strictBindingsCheck(attrName, directive.name);\n attrs[attrName] = undefined;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n var deepWatch = parentGet.literal;\n\n var initialValue = destination[scopeName] = parentGet(scope);\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n\n removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newValue, oldValue) {\n if (oldValue === newValue) {\n if (oldValue === initialValue || (deepWatch && equals(oldValue, initialValue))) {\n return;\n }\n oldValue = initialValue;\n }\n recordChanges(scopeName, newValue, oldValue);\n destination[scopeName] = newValue;\n }, deepWatch);\n\n removeWatchCollection.push(removeWatch);\n break;\n\n case '&':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n strictBindingsCheck(attrName, directive.name);\n }\n // Don't assign Object.prototype method to scope\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n\n function recordChanges(key, currentValue, previousValue) {\n if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) {\n // If we have not already scheduled the top level onChangesQueue handler then do so now\n if (!onChangesQueue) {\n scope.$$postDigest(flushOnChangesQueue);\n onChangesQueue = [];\n }\n // If we have not already queued a trigger of onChanges for this controller then do so now\n if (!changes) {\n changes = {};\n onChangesQueue.push(triggerOnChangesHook);\n }\n // If the has been a change on this property already then we need to reuse the previous value\n if (changes[key]) {\n previousValue = changes[key].previousValue;\n }\n // Store this change\n changes[key] = new SimpleChange(previousValue, currentValue);\n }\n }\n\n function triggerOnChangesHook() {\n destination.$onChanges(changes);\n // Now clear the changes so that we schedule onChanges when more changes arrive\n changes = undefined;\n }\n\n return {\n initialChanges: initialChanges,\n removeWatches: removeWatchCollection.length && function removeWatches() {\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {\n removeWatchCollection[i]();\n }\n }\n };\n }\n }];\n}\n\nfunction SimpleChange(previous, current) {\n this.previousValue = previous;\n this.currentValue = current;\n}\nSimpleChange.prototype.isFirstChange = function() { return this.previousValue === _UNINITIALIZED_VALUE; };\n\n\nvar PREFIX_REGEXP = /^((?:x|data)[:\\-_])/i;\nvar SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n\n/**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, fnCamelCaseReplace);\n}\n\n/**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in Angular:\n *\n * ```\n * <span ng:bind=\"a\" ng-bind=\"a\" data-ng-bind=\"a\" x-ng-bind=\"a\">\n * ```\n */\n\n/**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n\n/**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n * property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n\n\n/**\n * Closure compiler type information\n */\n\nfunction nodesetLinkingFn(\n /* angular.Scope */ scope,\n /* NodeList */ nodeList,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction directiveLinkingFn(\n /* nodesetLinkingFn */ nodesetLinkingFn,\n /* angular.Scope */ scope,\n /* Node */ node,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction tokenDifference(str1, str2) {\n var values = '',\n tokens1 = str1.split(/\\s+/),\n tokens2 = str2.split(/\\s+/);\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values += (values.length > 0 ? ' ' : '') + token;\n }\n return values;\n}\n\nfunction removeComments(jqNodes) {\n jqNodes = jqLite(jqNodes);\n var i = jqNodes.length;\n\n if (i <= 1) {\n return jqNodes;\n }\n\n while (i--) {\n var node = jqNodes[i];\n if (node.nodeType === NODE_TYPE_COMMENT ||\n (node.nodeType === NODE_TYPE_TEXT && node.nodeValue.trim() === '')) {\n splice.call(jqNodes, i, 1);\n }\n }\n return jqNodes;\n}\n\nvar $controllerMinErr = minErr('$controller');\n\n\nvar CNTRL_REG = /^(\\S+)(\\s+as\\s+([\\w$]+))?$/;\nfunction identifierForController(controller, ident) {\n if (ident && isString(ident)) return ident;\n if (isString(controller)) {\n var match = CNTRL_REG.exec(controller);\n if (match) return match[3];\n }\n}\n\n\n/**\n * @ngdoc provider\n * @name $controllerProvider\n * @this\n *\n * @description\n * The {@link ng.$controller $controller service} is used by Angular to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\nfunction $ControllerProvider() {\n var controllers = {},\n globals = false;\n\n /**\n * @ngdoc method\n * @name $controllerProvider#has\n * @param {string} name Controller name to check.\n */\n this.has = function(name) {\n return controllers.hasOwnProperty(name);\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#register\n * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n * the names and the values are the constructors.\n * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n * annotations in the array notation).\n */\n this.register = function(name, constructor) {\n assertNotHasOwnProperty(name, 'controller');\n if (isObject(name)) {\n extend(controllers, name);\n } else {\n controllers[name] = constructor;\n }\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#allowGlobals\n * @description If called, allows `$controller` to find controller constructors on `window`\n *\n * @deprecated\n * sinceVersion=\"v1.3.0\"\n * removeVersion=\"v1.7.0\"\n * This method of finding controllers has been deprecated.\n */\n this.allowGlobals = function() {\n globals = true;\n };\n\n\n this.$get = ['$injector', '$window', function($injector, $window) {\n\n /**\n * @ngdoc service\n * @name $controller\n * @requires $injector\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n * `window` object (deprecated, not recommended)\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @return {Object} Instance of given controller.\n *\n * @description\n * `$controller` service is responsible for instantiating controllers.\n *\n * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n */\n return function $controller(expression, locals, later, ident) {\n // PRIVATE API:\n // param `later` --- indicates that the controller's constructor is invoked at a later time.\n // If true, $controller will allocate the object with the correct\n // prototype chain, but will not invoke the controller until a returned\n // callback is invoked.\n // param `ident` --- An optional label which overrides the label parsed from the controller\n // expression, if any.\n var instance, match, constructor, identifier;\n later = later === true;\n if (ident && isString(ident)) {\n identifier = ident;\n }\n\n if (isString(expression)) {\n match = expression.match(CNTRL_REG);\n if (!match) {\n throw $controllerMinErr('ctrlfmt',\n 'Badly formed controller string \\'{0}\\'. ' +\n 'Must match `__name__ as __id__` or `__name__`.', expression);\n }\n constructor = match[1];\n identifier = identifier || match[3];\n expression = controllers.hasOwnProperty(constructor)\n ? controllers[constructor]\n : getter(locals.$scope, constructor, true) ||\n (globals ? getter($window, constructor, true) : undefined);\n\n if (!expression) {\n throw $controllerMinErr('ctrlreg',\n 'The controller with the name \\'{0}\\' is not registered.', constructor);\n }\n\n assertArgFn(expression, constructor, true);\n }\n\n if (later) {\n // Instantiate controller later:\n // This machinery is used to create an instance of the object before calling the\n // controller's constructor itself.\n //\n // This allows properties to be added to the controller before the constructor is\n // invoked. Primarily, this is used for isolate scope bindings in $compile.\n //\n // This feature is not intended for use by applications, and is thus not documented\n // publicly.\n // Object creation: http://jsperf.com/create-constructor/2\n var controllerPrototype = (isArray(expression) ?\n expression[expression.length - 1] : expression).prototype;\n instance = Object.create(controllerPrototype || null);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n return extend(function $controllerInit() {\n var result = $injector.invoke(expression, instance, locals, constructor);\n if (result !== instance && (isObject(result) || isFunction(result))) {\n instance = result;\n if (identifier) {\n // If result changed, re-assign controllerAs value to scope.\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n }\n return instance;\n }, {\n instance: instance,\n identifier: identifier\n });\n }\n\n instance = $injector.instantiate(expression, locals, constructor);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n return instance;\n };\n\n function addIdentifier(locals, identifier, instance, name) {\n if (!(locals && isObject(locals.$scope))) {\n throw minErr('$controller')('noscp',\n 'Cannot export controller \\'{0}\\' as \\'{1}\\'! No $scope object provided via `locals`.',\n name, identifier);\n }\n\n locals.$scope[identifier] = instance;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $document\n * @requires $window\n * @this\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n <example module=\"documentExample\" name=\"document\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <p>$document title: <b ng-bind=\"title\"></b></p>\n <p>window.document title: <b ng-bind=\"windowTitle\"></b></p>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('documentExample', [])\n .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n $scope.title = $document[0].title;\n $scope.windowTitle = angular.element(window.document)[0].title;\n }]);\n </file>\n </example>\n */\nfunction $DocumentProvider() {\n this.$get = ['$window', function(window) {\n return jqLite(window.document);\n }];\n}\n\n\n/**\n * @private\n * @this\n * Listens for document visibility change and makes the current status accessible.\n */\nfunction $$IsDocumentHiddenProvider() {\n this.$get = ['$document', '$rootScope', function($document, $rootScope) {\n var doc = $document[0];\n var hidden = doc && doc.hidden;\n\n $document.on('visibilitychange', changeListener);\n\n $rootScope.$on('$destroy', function() {\n $document.off('visibilitychange', changeListener);\n });\n\n function changeListener() {\n hidden = doc.hidden;\n }\n\n return function() {\n return hidden;\n };\n }];\n}\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n * @this\n *\n * @description\n * Any uncaught exception in angular expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught\n * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead\n * of `$log.error()`.\n *\n * ```js\n * angular.\n * module('exceptionOverwrite', []).\n * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {\n * return function myExceptionHandler(exception, cause) {\n * logErrorsToBackend(exception, cause);\n * $log.warn(exception, cause);\n * };\n * }]);\n * ```\n *\n * <hr />\n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause Optional information about the context in which\n * the error was thrown.\n *\n */\nfunction $ExceptionHandlerProvider() {\n this.$get = ['$log', function($log) {\n return function(exception, cause) {\n $log.error.apply($log, arguments);\n };\n }];\n}\n\nvar $$ForceReflowProvider = /** @this */ function() {\n this.$get = ['$document', function($document) {\n return function(domNode) {\n //the line below will force the browser to perform a repaint so\n //that all the animated elements within the animation frame will\n //be properly updated and drawn on screen. This is required to\n //ensure that the preparation animation is properly flushed so that\n //the active state picks up from there. DO NOT REMOVE THIS LINE.\n //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH\n //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND\n //WILL TAKE YEARS AWAY FROM YOUR LIFE.\n if (domNode) {\n if (!domNode.nodeType && domNode instanceof jqLite) {\n domNode = domNode[0];\n }\n } else {\n domNode = $document[0].body;\n }\n return domNode.offsetWidth + 1;\n };\n }];\n};\n\nvar APPLICATION_JSON = 'application/json';\nvar CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};\nvar JSON_START = /^\\[|^\\{(?!\\{)/;\nvar JSON_ENDS = {\n '[': /]$/,\n '{': /}$/\n};\nvar JSON_PROTECTION_PREFIX = /^\\)]\\}',?\\n/;\nvar $httpMinErr = minErr('$http');\n\nfunction serializeValue(v) {\n if (isObject(v)) {\n return isDate(v) ? v.toISOString() : toJson(v);\n }\n return v;\n}\n\n\n/** @this */\nfunction $HttpParamSerializerProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializer\n * @description\n *\n * Default {@link $http `$http`} params serializer that converts objects to strings\n * according to the following rules:\n *\n * * `{'foo': 'bar'}` results in `foo=bar`\n * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)\n * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)\n * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object)\n *\n * Note that serializer will sort the request parameters alphabetically.\n * */\n\n this.$get = function() {\n return function ngParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n forEachSorted(params, function(value, key) {\n if (value === null || isUndefined(value) || isFunction(value)) return;\n if (isArray(value)) {\n forEach(value, function(v) {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));\n });\n } else {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));\n }\n });\n\n return parts.join('&');\n };\n };\n}\n\n/** @this */\nfunction $HttpParamSerializerJQLikeProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializerJQLike\n *\n * @description\n *\n * Alternative {@link $http `$http`} params serializer that follows\n * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.\n * The serializer will also sort the params alphabetically.\n *\n * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:\n *\n * ```js\n * $http({\n * url: myUrl,\n * method: 'GET',\n * params: myParams,\n * paramSerializer: '$httpParamSerializerJQLike'\n * });\n * ```\n *\n * It is also possible to set it as the default `paramSerializer` in the\n * {@link $httpProvider#defaults `$httpProvider`}.\n *\n * Additionally, you can inject the serializer and use it explicitly, for example to serialize\n * form data for submission:\n *\n * ```js\n * .controller(function($http, $httpParamSerializerJQLike) {\n * //...\n *\n * $http({\n * url: myUrl,\n * method: 'POST',\n * data: $httpParamSerializerJQLike(myData),\n * headers: {\n * 'Content-Type': 'application/x-www-form-urlencoded'\n * }\n * });\n *\n * });\n * ```\n *\n * */\n this.$get = function() {\n return function jQueryLikeParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n serialize(params, '', true);\n return parts.join('&');\n\n function serialize(toSerialize, prefix, topLevel) {\n if (toSerialize === null || isUndefined(toSerialize)) return;\n if (isArray(toSerialize)) {\n forEach(toSerialize, function(value, index) {\n serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');\n });\n } else if (isObject(toSerialize) && !isDate(toSerialize)) {\n forEachSorted(toSerialize, function(value, key) {\n serialize(value, prefix +\n (topLevel ? '' : '[') +\n key +\n (topLevel ? '' : ']'));\n });\n } else {\n parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize)));\n }\n }\n };\n };\n}\n\nfunction defaultHttpResponseTransform(data, headers) {\n if (isString(data)) {\n // Strip json vulnerability protection prefix and trim whitespace\n var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n\n if (tempData) {\n var contentType = headers('Content-Type');\n var hasJsonContentType = contentType && (contentType.indexOf(APPLICATION_JSON) === 0);\n\n if (hasJsonContentType || isJsonLike(tempData)) {\n try {\n data = fromJson(tempData);\n } catch (e) {\n if (!hasJsonContentType) {\n return data;\n }\n throw $httpMinErr('baddata', 'Data must be a valid JSON object. Received: \"{0}\". ' +\n 'Parse error: \"{1}\"', data, e);\n }\n }\n }\n }\n\n return data;\n}\n\nfunction isJsonLike(str) {\n var jsonStart = str.match(JSON_START);\n return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n}\n\n/**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\nfunction parseHeaders(headers) {\n var parsed = createMap(), i;\n\n function fillInParsed(key, val) {\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n\n if (isString(headers)) {\n forEach(headers.split('\\n'), function(line) {\n i = line.indexOf(':');\n fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));\n });\n } else if (isObject(headers)) {\n forEach(headers, function(headerVal, headerKey) {\n fillInParsed(lowercase(headerKey), trim(headerVal));\n });\n }\n\n return parsed;\n}\n\n\n/**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n * - if called with an argument returns a single header value or null\n * - if called with no arguments returns an object containing all headers.\n */\nfunction headersGetter(headers) {\n var headersObj;\n\n return function(name) {\n if (!headersObj) headersObj = parseHeaders(headers);\n\n if (name) {\n var value = headersObj[lowercase(name)];\n if (value === undefined) {\n value = null;\n }\n return value;\n }\n\n return headersObj;\n };\n}\n\n\n/**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.<Function>)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, status, fns) {\n if (isFunction(fns)) {\n return fns(data, headers, status);\n }\n\n forEach(fns, function(fn) {\n data = fn(data, headers, status);\n });\n\n return data;\n}\n\n\nfunction isSuccess(status) {\n return 200 <= status && status < 300;\n}\n\n\n/**\n * @ngdoc provider\n * @name $httpProvider\n * @this\n *\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n * */\nfunction $HttpProvider() {\n /**\n * @ngdoc property\n * @name $httpProvider#defaults\n * @description\n *\n * Object containing default values for all {@link ng.$http $http} requests.\n *\n * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses\n * by default. See {@link $http#caching $http Caching} for more information.\n *\n * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n * setting default headers.\n * - **`defaults.headers.common`**\n * - **`defaults.headers.post`**\n * - **`defaults.headers.put`**\n * - **`defaults.headers.patch`**\n *\n * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the\n * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the\n * {@link $jsonpCallbacks} service. Defaults to `'callback'`.\n *\n * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function\n * used to the prepare string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.\n * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.\n *\n * - **`defaults.transformRequest`** -\n * `{Array<function(data, headersGetter)>|function(data, headersGetter)}` -\n * An array of functions (or a single function) which are applied to the request data.\n * By default, this is an array with one request transformation function:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * - **`defaults.transformResponse`** -\n * `{Array<function(data, headersGetter, status)>|function(data, headersGetter, status)}` -\n * An array of functions (or a single function) which are applied to the response data. By default,\n * this is an array which applies one response transformation function that does two things:\n *\n * - If XSRF prefix is detected, strip it\n * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}).\n * - If the `Content-Type` is `application/json` or the response looks like JSON,\n * deserialize it using a JSON parser.\n *\n * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n * Defaults value is `'XSRF-TOKEN'`.\n *\n * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n *\n **/\n var defaults = this.defaults = {\n // transform incoming response data\n transformResponse: [defaultHttpResponseTransform],\n\n // transform outgoing request data\n transformRequest: [function(d) {\n return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n }],\n\n // default headers\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n },\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n paramSerializer: '$httpParamSerializer',\n\n jsonpCallbackParam: 'callback'\n };\n\n var useApplyAsync = false;\n /**\n * @ngdoc method\n * @name $httpProvider#useApplyAsync\n * @description\n *\n * Configure $http service to combine processing of multiple http responses received at around\n * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n * significant performance improvement for bigger applications that make many HTTP requests\n * concurrently (common during application bootstrap).\n *\n * Defaults to false. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n * \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n * to load and share the same digest cycle.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n **/\n this.useApplyAsync = function(value) {\n if (isDefined(value)) {\n useApplyAsync = !!value;\n return this;\n }\n return useApplyAsync;\n };\n\n /**\n * @ngdoc property\n * @name $httpProvider#interceptors\n * @description\n *\n * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n * pre-processing of request or postprocessing of responses.\n *\n * These service factories are ordered by request, i.e. they are applied in the same order as the\n * array, on request, but reverse order, on response.\n *\n * {@link ng.$http#interceptors Interceptors detailed info}\n **/\n var interceptorFactories = this.interceptors = [];\n\n this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce',\n function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) {\n\n var defaultCache = $cacheFactory('$http');\n\n /**\n * Make sure that default param serializer is exposed as a function\n */\n defaults.paramSerializer = isString(defaults.paramSerializer) ?\n $injector.get(defaults.paramSerializer) : defaults.paramSerializer;\n\n /**\n * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n * The reversal is needed so that we can build up the interception chain around the\n * server request.\n */\n var reversedInterceptors = [];\n\n forEach(interceptorFactories, function(interceptorFactory) {\n reversedInterceptors.unshift(isString(interceptorFactory)\n ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n });\n\n /**\n * @ngdoc service\n * @kind function\n * @name $http\n * @requires ng.$httpBackend\n * @requires $cacheFactory\n * @requires $rootScope\n * @requires $q\n * @requires $injector\n *\n * @description\n * The `$http` service is a core Angular service that facilitates communication with the remote\n * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n *\n * For unit testing applications that use `$http` service, see\n * {@link ngMock.$httpBackend $httpBackend mock}.\n *\n * For a higher level of abstraction, please check out the {@link ngResource.$resource\n * $resource} service.\n *\n * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n * it is important to familiarize yourself with these APIs and the guarantees they provide.\n *\n *\n * ## General usage\n * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —\n * that is used to generate an HTTP request and returns a {@link ng.$q promise}.\n *\n * ```js\n * // Simple GET request example:\n * $http({\n * method: 'GET',\n * url: '/someUrl'\n * }).then(function successCallback(response) {\n * // this callback will be called asynchronously\n * // when the response is available\n * }, function errorCallback(response) {\n * // called asynchronously if an error occurs\n * // or server returns response with an error status.\n * });\n * ```\n *\n * The response object has these properties:\n *\n * - **data** – `{string|Object}` – The response body transformed with the transform\n * functions.\n * - **status** – `{number}` – HTTP status code of the response.\n * - **headers** – `{function([headerName])}` – Header getter function.\n * - **config** – `{Object}` – The configuration object that was used to generate the request.\n * - **statusText** – `{string}` – HTTP status text of the response.\n * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest (`complete`, `error`, `timeout` or `abort`).\n *\n * A response status code between 200 and 299 is considered a success status and will result in\n * the success callback being called. Any response status code outside of that range is\n * considered an error status and will result in the error callback being called.\n * Also, status codes less than -1 are normalized to zero. -1 usually means the request was\n * aborted, e.g. using a `config.timeout`.\n * Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning\n * that the outcome (success or error) will be determined by the final response status code.\n *\n *\n * ## Shortcut methods\n *\n * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n * request data must be passed in for POST/PUT requests. An optional config can be passed as the\n * last argument.\n *\n * ```js\n * $http.get('/someUrl', config).then(successCallback, errorCallback);\n * $http.post('/someUrl', data, config).then(successCallback, errorCallback);\n * ```\n *\n * Complete list of shortcut methods:\n *\n * - {@link ng.$http#get $http.get}\n * - {@link ng.$http#head $http.head}\n * - {@link ng.$http#post $http.post}\n * - {@link ng.$http#put $http.put}\n * - {@link ng.$http#delete $http.delete}\n * - {@link ng.$http#jsonp $http.jsonp}\n * - {@link ng.$http#patch $http.patch}\n *\n *\n * ## Writing Unit Tests that use $http\n * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n * request using trained responses.\n *\n * ```\n * $httpBackend.expectGET(...);\n * $http.get(...);\n * $httpBackend.flush();\n * ```\n *\n * ## Setting HTTP Headers\n *\n * The $http service will automatically add certain HTTP headers to all requests. These defaults\n * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n * object, which currently contains this default configuration:\n *\n * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n * - <code>Accept: application/json, text/plain, \\*/\\*</code>\n * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n * - `Content-Type: application/json`\n * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n * - `Content-Type: application/json`\n *\n * To add or overwrite these defaults, simply add or remove a property from these configuration\n * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n * with the lowercased HTTP method name as the key, e.g.\n * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.\n *\n * The defaults can also be set at runtime via the `$http.defaults` object in the same\n * fashion. For example:\n *\n * ```\n * module.run(function($http) {\n * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';\n * });\n * ```\n *\n * In addition, you can supply a `headers` property in the config object passed when\n * calling `$http(config)`, which overrides the defaults without changing them globally.\n *\n * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n * Use the `headers` property, setting the desired header to `undefined`. For example:\n *\n * ```js\n * var req = {\n * method: 'POST',\n * url: 'http://example.com',\n * headers: {\n * 'Content-Type': undefined\n * },\n * data: { test: 'test' }\n * }\n *\n * $http(req).then(function(){...}, function(){...});\n * ```\n *\n * ## Transforming Requests and Responses\n *\n * Both requests and responses can be transformed using transformation functions: `transformRequest`\n * and `transformResponse`. These properties can be a single function that returns\n * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Angular does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline.\n * That means changes to the properties of `data` are not local to the transform function (since Javascript passes objects by reference).\n * For example, when calling `$http.get(url, $scope.myObject)`, modifications to the object's properties in a transformRequest\n * function will be reflected on the scope and in any templates where the object is data-bound.\n * To prevent this, transform functions should have no side-effects.\n * If you need to modify properties, it is recommended to make a copy of the data, or create new object to return.\n * </div>\n *\n * ### Default Transformations\n *\n * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n * `defaults.transformResponse` properties. If a request does not provide its own transformations\n * then these will be applied.\n *\n * You can augment or replace the default transformations by modifying these properties by adding to or\n * replacing the array.\n *\n * Angular provides the following default transformations:\n *\n * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is\n * an array with one function that does the following:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is\n * an array with one function that does the following:\n *\n * - If XSRF prefix is detected, strip it (see Security Considerations section below).\n * - If the `Content-Type` is `application/json` or the response looks like JSON,\n * deserialize it using a JSON parser.\n *\n *\n * ### Overriding the Default Transformations Per Request\n *\n * If you wish to override the request/response transformations only for a single request then provide\n * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n * into `$http`.\n *\n * Note that if you provide these properties on the config object the default transformations will be\n * overwritten. If you wish to augment the default transformations then you must include them in your\n * local transformation array.\n *\n * The following code demonstrates adding a new response transformation to be run after the default response\n * transformations have been run.\n *\n * ```js\n * function appendTransform(defaults, transform) {\n *\n * // We can't guarantee that the default transformation is an array\n * defaults = angular.isArray(defaults) ? defaults : [defaults];\n *\n * // Append the new transformation to the defaults\n * return defaults.concat(transform);\n * }\n *\n * $http({\n * url: '...',\n * method: 'GET',\n * transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n * return doTransform(value);\n * })\n * });\n * ```\n *\n *\n * ## Caching\n *\n * {@link ng.$http `$http`} responses are not cached by default. To enable caching, you must\n * set the config.cache value or the default cache value to TRUE or to a cache object (created\n * with {@link ng.$cacheFactory `$cacheFactory`}). If defined, the value of config.cache takes\n * precedence over the default cache value.\n *\n * In order to:\n * * cache all responses - set the default cache value to TRUE or to a cache object\n * * cache a specific response - set config.cache value to TRUE or to a cache object\n *\n * If caching is enabled, but neither the default cache nor config.cache are set to a cache object,\n * then the default `$cacheFactory(\"$http\")` object is used.\n *\n * The default cache value can be set by updating the\n * {@link ng.$http#defaults `$http.defaults.cache`} property or the\n * {@link $httpProvider#defaults `$httpProvider.defaults.cache`} property.\n *\n * When caching is enabled, {@link ng.$http `$http`} stores the response from the server using\n * the relevant cache object. The next time the same request is made, the response is returned\n * from the cache without sending a request to the server.\n *\n * Take note that:\n *\n * * Only GET and JSONP requests are cached.\n * * The cache key is the request URL including search parameters; headers are not considered.\n * * Cached responses are returned asynchronously, in the same way as responses from the server.\n * * If multiple identical requests are made using the same cache, which is not yet populated,\n * one request will be made to the server and remaining requests will return the same response.\n * * A cache-control header on the response does not affect if or how responses are cached.\n *\n *\n * ## Interceptors\n *\n * Before you start creating interceptors, be sure to understand the\n * {@link ng.$q $q and deferred/promise APIs}.\n *\n * For purposes of global error handling, authentication, or any kind of synchronous or\n * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n * able to intercept requests before they are handed to the server and\n * responses before they are handed over to the application code that\n * initiated these requests. The interceptors leverage the {@link ng.$q\n * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n *\n * The interceptors are service factories that are registered with the `$httpProvider` by\n * adding them to the `$httpProvider.interceptors` array. The factory is called and\n * injected with dependencies (if specified) and returns the interceptor.\n *\n * There are two kinds of interceptors (and two kinds of rejection interceptors):\n *\n * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to\n * modify the `config` object or create a new one. The function needs to return the `config`\n * object directly, or a promise containing the `config` or a new `config` object.\n * * `requestError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n * * `response`: interceptors get called with http `response` object. The function is free to\n * modify the `response` object or create a new one. The function needs to return the `response`\n * object directly, or as a promise containing the `response` or a new `response` object.\n * * `responseError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n *\n *\n * ```js\n * // register the interceptor as a service\n * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n * return {\n * // optional method\n * 'request': function(config) {\n * // do something on success\n * return config;\n * },\n *\n * // optional method\n * 'requestError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * },\n *\n *\n *\n * // optional method\n * 'response': function(response) {\n * // do something on success\n * return response;\n * },\n *\n * // optional method\n * 'responseError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * }\n * };\n * });\n *\n * $httpProvider.interceptors.push('myHttpInterceptor');\n *\n *\n * // alternatively, register the interceptor via an anonymous factory\n * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n * return {\n * 'request': function(config) {\n * // same as above\n * },\n *\n * 'response': function(response) {\n * // same as above\n * }\n * };\n * });\n * ```\n *\n * ## Security Considerations\n *\n * When designing web applications, consider security threats from:\n *\n * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n *\n * Both server and the client must cooperate in order to eliminate these threats. Angular comes\n * pre-configured with strategies that address these issues, but for this to work backend server\n * cooperation is required.\n *\n * ### JSON Vulnerability Protection\n *\n * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * allows third party website to turn your JSON resource URL into\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n * Angular will automatically strip the prefix before processing it as JSON.\n *\n * For example if your server needs to return:\n * ```js\n * ['one','two']\n * ```\n *\n * which is vulnerable to attack, your server can return:\n * ```js\n * )]}',\n * ['one','two']\n * ```\n *\n * Angular will strip the prefix, before processing the JSON.\n *\n *\n * ### Cross Site Request Forgery (XSRF) Protection\n *\n * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by\n * which the attacker can trick an authenticated user into unknowingly executing actions on your\n * website. Angular provides a mechanism to counter XSRF. When performing XHR requests, the\n * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP\n * header (`X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read the\n * cookie, your server can be assured that the XHR came from JavaScript running on your domain.\n * The header will not be set for cross-domain requests.\n *\n * To take advantage of this, your server needs to set a token in a JavaScript readable session\n * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure\n * that only JavaScript running on your domain could have sent the request. The token must be\n * unique for each user and must be verifiable by the server (to prevent the JavaScript from\n * making up its own tokens). We recommend that the token is a digest of your site's\n * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))\n * for added security.\n *\n * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName\n * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,\n * or the per-request config object.\n *\n * In order to prevent collisions in environments where multiple Angular apps share the\n * same domain or subdomain, we recommend that each application uses unique cookie name.\n *\n * @param {object} config Object describing the request to be made and how it should be\n * processed. The object has following properties:\n *\n * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n * - **url** – `{string|TrustedObject}` – Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be serialized\n * with the `paramSerializer` and appended as GET parameters.\n * - **data** – `{string|Object}` – Data to be sent as the request message data.\n * - **headers** – `{Object}` – Map of strings or functions which return strings representing\n * HTTP headers to send to the server. If the return value of a function is null, the\n * header will not be sent. Functions accept a config object as an argument.\n * - **eventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest object.\n * To bind events to the XMLHttpRequest upload object, use `uploadEventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **uploadEventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest upload\n * object. To bind events to the XMLHttpRequest object, use `eventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n * - **transformRequest** –\n * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n * transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **transformResponse** –\n * `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –\n * transform function or an array of such functions. The transform function takes the http\n * response body, headers and status and returns its transformed (typically deserialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **paramSerializer** - `{string|function(Object<string,string>):string}` - A function used to\n * prepare the string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as function registered with the\n * {@link $injector $injector}, which means you can create your own serializer\n * by registering it as a {@link auto.$provide#service service}.\n * The default serializer is the {@link $httpParamSerializer $httpParamSerializer};\n * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}\n * - **cache** – `{boolean|Object}` – A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response.\n * See {@link $http#caching $http Caching} for more information.\n * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n * that should abort the request when resolved.\n * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n * for more information.\n * - **responseType** - `{string}` - see\n * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).\n *\n * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object\n * when the request succeeds or fails.\n *\n *\n * @property {Array.<Object>} pendingRequests Array of config objects for currently pending\n * requests. This is primarily meant to be used for debugging purposes.\n *\n *\n * @example\n<example module=\"httpExample\" name=\"http-service\">\n<file name=\"index.html\">\n <div ng-controller=\"FetchController\">\n <select ng-model=\"method\" aria-label=\"Request method\">\n <option>GET</option>\n <option>JSONP</option>\n </select>\n <input type=\"text\" ng-model=\"url\" size=\"80\" aria-label=\"URL\" />\n <button id=\"fetchbtn\" ng-click=\"fetch()\">fetch</button><br>\n <button id=\"samplegetbtn\" ng-click=\"updateModel('GET', 'http-hello.html')\">Sample GET</button>\n <button id=\"samplejsonpbtn\"\n ng-click=\"updateModel('JSONP',\n 'https://angularjs.org/greet.php?name=Super%20Hero')\">\n Sample JSONP\n </button>\n <button id=\"invalidjsonpbtn\"\n ng-click=\"updateModel('JSONP', 'https://angularjs.org/doesntexist')\">\n Invalid JSONP\n </button>\n <pre>http status code: {{status}}</pre>\n <pre>http response data: {{data}}</pre>\n </div>\n</file>\n<file name=\"script.js\">\n angular.module('httpExample', [])\n .config(['$sceDelegateProvider', function($sceDelegateProvider) {\n // We must whitelist the JSONP endpoint that we are using to show that we trust it\n $sceDelegateProvider.resourceUrlWhitelist([\n 'self',\n 'https://angularjs.org/**'\n ]);\n }])\n .controller('FetchController', ['$scope', '$http', '$templateCache',\n function($scope, $http, $templateCache) {\n $scope.method = 'GET';\n $scope.url = 'http-hello.html';\n\n $scope.fetch = function() {\n $scope.code = null;\n $scope.response = null;\n\n $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n then(function(response) {\n $scope.status = response.status;\n $scope.data = response.data;\n }, function(response) {\n $scope.data = response.data || 'Request failed';\n $scope.status = response.status;\n });\n };\n\n $scope.updateModel = function(method, url) {\n $scope.method = method;\n $scope.url = url;\n };\n }]);\n</file>\n<file name=\"http-hello.html\">\n Hello, $http!\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n var status = element(by.binding('status'));\n var data = element(by.binding('data'));\n var fetchBtn = element(by.id('fetchbtn'));\n var sampleGetBtn = element(by.id('samplegetbtn'));\n var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n\n it('should make an xhr GET request', function() {\n sampleGetBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('200');\n expect(data.getText()).toMatch(/Hello, \\$http!/);\n });\n\n// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n// it('should make a JSONP request to angularjs.org', function() {\n// var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n// sampleJsonpBtn.click();\n// fetchBtn.click();\n// expect(status.getText()).toMatch('200');\n// expect(data.getText()).toMatch(/Super Hero!/);\n// });\n\n it('should make JSONP request to invalid URL and invoke the error handler',\n function() {\n invalidJsonpBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('0');\n expect(data.getText()).toMatch('Request failed');\n });\n</file>\n</example>\n */\n function $http(requestConfig) {\n\n if (!isObject(requestConfig)) {\n throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);\n }\n\n if (!isString($sce.valueOf(requestConfig.url))) {\n throw minErr('$http')('badreq', 'Http request configuration url must be a string or a $sce trusted object. Received: {0}', requestConfig.url);\n }\n\n var config = extend({\n method: 'get',\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse,\n paramSerializer: defaults.paramSerializer,\n jsonpCallbackParam: defaults.jsonpCallbackParam\n }, requestConfig);\n\n config.headers = mergeHeaders(requestConfig);\n config.method = uppercase(config.method);\n config.paramSerializer = isString(config.paramSerializer) ?\n $injector.get(config.paramSerializer) : config.paramSerializer;\n\n $browser.$$incOutstandingRequestCount();\n\n var requestInterceptors = [];\n var responseInterceptors = [];\n var promise = $q.resolve(config);\n\n // apply interceptors\n forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.request || interceptor.requestError) {\n requestInterceptors.unshift(interceptor.request, interceptor.requestError);\n }\n if (interceptor.response || interceptor.responseError) {\n responseInterceptors.push(interceptor.response, interceptor.responseError);\n }\n });\n\n promise = chainInterceptors(promise, requestInterceptors);\n promise = promise.then(serverRequest);\n promise = chainInterceptors(promise, responseInterceptors);\n promise = promise.finally(completeOutstandingRequest);\n\n return promise;\n\n\n function chainInterceptors(promise, interceptors) {\n for (var i = 0, ii = interceptors.length; i < ii;) {\n var thenFn = interceptors[i++];\n var rejectFn = interceptors[i++];\n\n promise = promise.then(thenFn, rejectFn);\n }\n\n interceptors.length = 0;\n\n return promise;\n }\n\n function completeOutstandingRequest() {\n $browser.$$completeOutstandingRequest(noop);\n }\n\n function executeHeaderFns(headers, config) {\n var headerContent, processedHeaders = {};\n\n forEach(headers, function(headerFn, header) {\n if (isFunction(headerFn)) {\n headerContent = headerFn(config);\n if (headerContent != null) {\n processedHeaders[header] = headerContent;\n }\n } else {\n processedHeaders[header] = headerFn;\n }\n });\n\n return processedHeaders;\n }\n\n function mergeHeaders(config) {\n var defHeaders = defaults.headers,\n reqHeaders = extend({}, config.headers),\n defHeaderName, lowercaseDefHeaderName, reqHeaderName;\n\n defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n // using for-in instead of forEach to avoid unnecessary iteration after header has been found\n defaultHeadersIteration:\n for (defHeaderName in defHeaders) {\n lowercaseDefHeaderName = lowercase(defHeaderName);\n\n for (reqHeaderName in reqHeaders) {\n if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n continue defaultHeadersIteration;\n }\n }\n\n reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n }\n\n // execute if header value is a function for merged headers\n return executeHeaderFns(reqHeaders, shallowCopy(config));\n }\n\n function serverRequest(config) {\n var headers = config.headers;\n var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n // strip content-type if data is undefined\n if (isUndefined(reqData)) {\n forEach(headers, function(value, header) {\n if (lowercase(header) === 'content-type') {\n delete headers[header];\n }\n });\n }\n\n if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n config.withCredentials = defaults.withCredentials;\n }\n\n // send request\n return sendReq(config, reqData).then(transformResponse, transformResponse);\n }\n\n function transformResponse(response) {\n // make a copy since the response must be cacheable\n var resp = extend({}, response);\n resp.data = transformData(response.data, response.headers, response.status,\n config.transformResponse);\n return (isSuccess(response.status))\n ? resp\n : $q.reject(resp);\n }\n }\n\n $http.pendingRequests = [];\n\n /**\n * @ngdoc method\n * @name $http#get\n *\n * @description\n * Shortcut method to perform `GET` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#delete\n *\n * @description\n * Shortcut method to perform `DELETE` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#head\n *\n * @description\n * Shortcut method to perform `HEAD` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#jsonp\n *\n * @description\n * Shortcut method to perform `JSONP` request.\n *\n * Note that, since JSONP requests are sensitive because the response is given full access to the browser,\n * the url must be declared, via {@link $sce} as a trusted resource URL.\n * You can trust a URL by adding it to the whitelist via\n * {@link $sceDelegateProvider#resourceUrlWhitelist `$sceDelegateProvider.resourceUrlWhitelist`} or\n * by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}.\n *\n * JSONP requests must specify a callback to be used in the response from the server. This callback\n * is passed as a query parameter in the request. You must specify the name of this parameter by\n * setting the `jsonpCallbackParam` property on the request config object.\n *\n * ```\n * $http.jsonp('some/trusted/url', {jsonpCallbackParam: 'callback'})\n * ```\n *\n * You can also specify a default callback parameter name in `$http.defaults.jsonpCallbackParam`.\n * Initially this is set to `'callback'`.\n *\n * <div class=\"alert alert-danger\">\n * You can no longer use the `JSON_CALLBACK` string as a placeholder for specifying where the callback\n * parameter value should go.\n * </div>\n *\n * If you would like to customise where and how the callbacks are stored then try overriding\n * or decorating the {@link $jsonpCallbacks} service.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n createShortMethods('get', 'delete', 'head', 'jsonp');\n\n /**\n * @ngdoc method\n * @name $http#post\n *\n * @description\n * Shortcut method to perform `POST` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#put\n *\n * @description\n * Shortcut method to perform `PUT` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#patch\n *\n * @description\n * Shortcut method to perform `PATCH` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n createShortMethodsWithData('post', 'put', 'patch');\n\n /**\n * @ngdoc property\n * @name $http#defaults\n *\n * @description\n * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n * default headers, withCredentials as well as request and response transformations.\n *\n * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n */\n $http.defaults = defaults;\n\n\n return $http;\n\n\n function createShortMethods(names) {\n forEach(arguments, function(name) {\n $http[name] = function(url, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url\n }));\n };\n });\n }\n\n\n function createShortMethodsWithData(name) {\n forEach(arguments, function(name) {\n $http[name] = function(url, data, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url,\n data: data\n }));\n };\n });\n }\n\n\n /**\n * Makes the request.\n *\n * !!! ACCESSES CLOSURE VARS:\n * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n */\n function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }\n\n\n function buildUrl(url, serializedParams) {\n if (serializedParams.length > 0) {\n url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams;\n }\n return url;\n }\n\n function sanitizeJsonpCallbackParam(url, key) {\n if (/[&?][^=]+=JSON_CALLBACK/.test(url)) {\n // Throw if the url already contains a reference to JSON_CALLBACK\n throw $httpMinErr('badjsonp', 'Illegal use of JSON_CALLBACK in url, \"{0}\"', url);\n }\n\n var callbackParamRegex = new RegExp('[&?]' + key + '=');\n if (callbackParamRegex.test(url)) {\n // Throw if the callback param was already provided\n throw $httpMinErr('badjsonp', 'Illegal use of callback param, \"{0}\", in url, \"{1}\"', key, url);\n }\n\n // Add in the JSON_CALLBACK callback param value\n url += ((url.indexOf('?') === -1) ? '?' : '&') + key + '=JSON_CALLBACK';\n\n return url;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $xhrFactory\n * @this\n *\n * @description\n * Factory function used to create XMLHttpRequest objects.\n *\n * Replace or decorate this service to create your own custom XMLHttpRequest objects.\n *\n * ```\n * angular.module('myApp', [])\n * .factory('$xhrFactory', function() {\n * return function createXhr(method, url) {\n * return new window.XMLHttpRequest({mozSystem: true});\n * };\n * });\n * ```\n *\n * @param {string} method HTTP method of the request (GET, POST, PUT, ..)\n * @param {string} url URL of the request.\n */\nfunction $xhrFactoryProvider() {\n this.$get = function() {\n return function createXhr() {\n return new window.XMLHttpRequest();\n };\n };\n}\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @requires $jsonpCallbacks\n * @requires $document\n * @requires $xhrFactory\n * @this\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\nfunction $HttpBackendProvider() {\n this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) {\n return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]);\n }];\n}\n\nfunction createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n // TODO(vojta): fix the signature\n return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {\n url = url || $browser.url();\n\n if (lowercase(method) === 'jsonp') {\n var callbackPath = callbacks.createCallback(url);\n var jsonpDone = jsonpReq(url, callbackPath, function(status, text) {\n // jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING)\n var response = (status === 200) && callbacks.getResponse(callbackPath);\n completeRequest(callback, status, response, '', text, 'complete');\n callbacks.removeCallback(callbackPath);\n });\n } else {\n\n var xhr = createXhr(method, url);\n\n xhr.open(method, url, true);\n forEach(headers, function(value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n\n xhr.onload = function requestLoaded() {\n var statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var status = xhr.status === 1223 ? 204 : xhr.status;\n\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0;\n }\n\n completeRequest(callback,\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText,\n 'complete');\n };\n\n var requestError = function() {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '', 'error');\n };\n\n var requestAborted = function() {\n completeRequest(callback, -1, null, null, '', 'abort');\n };\n\n var requestTimeout = function() {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '', 'timeout');\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestAborted;\n xhr.ontimeout = requestTimeout;\n\n forEach(eventHandlers, function(value, key) {\n xhr.addEventListener(key, value);\n });\n\n forEach(uploadEventHandlers, function(value, key) {\n xhr.upload.addEventListener(key, value);\n });\n\n if (withCredentials) {\n xhr.withCredentials = true;\n }\n\n if (responseType) {\n try {\n xhr.responseType = responseType;\n } catch (e) {\n // WebKit added support for the json responseType value on 09/03/2013\n // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n // known to throw when setting the value \"json\" as the response type. Other older\n // browsers implementing the responseType\n //\n // The json response type can be ignored if not supported, because JSON payloads are\n // parsed on the client-side regardless.\n if (responseType !== 'json') {\n throw e;\n }\n }\n }\n\n xhr.send(isUndefined(post) ? null : post);\n }\n\n if (timeout > 0) {\n var timeoutId = $browserDefer(timeoutRequest, timeout);\n } else if (isPromiseLike(timeout)) {\n timeout.then(timeoutRequest);\n }\n\n\n function timeoutRequest() {\n if (jsonpDone) {\n jsonpDone();\n }\n if (xhr) {\n xhr.abort();\n }\n }\n\n function completeRequest(callback, status, response, headersString, statusText, xhrStatus) {\n // cancel timeout and subsequent timeout promise resolution\n if (isDefined(timeoutId)) {\n $browserDefer.cancel(timeoutId);\n }\n jsonpDone = xhr = null;\n\n callback(status, response, headersString, statusText, xhrStatus);\n }\n };\n\n function jsonpReq(url, callbackPath, done) {\n url = url.replace('JSON_CALLBACK', callbackPath);\n // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:\n // - fetches local scripts via XHR and evals them\n // - adds and immediately removes script elements from the document\n var script = rawDocument.createElement('script'), callback = null;\n script.type = 'text/javascript';\n script.src = url;\n script.async = true;\n\n callback = function(event) {\n script.removeEventListener('load', callback);\n script.removeEventListener('error', callback);\n rawDocument.body.removeChild(script);\n script = null;\n var status = -1;\n var text = 'unknown';\n\n if (event) {\n if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) {\n event = { type: 'error' };\n }\n text = event.type;\n status = event.type === 'error' ? 404 : 200;\n }\n\n if (done) {\n done(status, text);\n }\n };\n\n script.addEventListener('load', callback);\n script.addEventListener('error', callback);\n rawDocument.body.appendChild(script);\n return callback;\n }\n}\n\nvar $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');\n$interpolateMinErr.throwNoconcat = function(text) {\n throw $interpolateMinErr('noconcat',\n 'Error while interpolating: {0}\\nStrict Contextual Escaping disallows ' +\n 'interpolations that concatenate multiple expressions when a trusted value is ' +\n 'required. See http://docs.angularjs.org/api/ng.$sce', text);\n};\n\n$interpolateMinErr.interr = function(text, err) {\n return $interpolateMinErr('interr', 'Can\\'t interpolate: {0}\\n{1}', text, err.toString());\n};\n\n/**\n * @ngdoc provider\n * @name $interpolateProvider\n * @this\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n * <div class=\"alert alert-danger\">\n * This feature is sometimes used to mix different markup languages, e.g. to wrap an Angular\n * template within a Python Jinja template (or any other template language). Mixing templating\n * languages is **very dangerous**. The embedding template language will not safely escape Angular\n * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)\n * security bugs!\n * </div>\n *\n * @example\n<example name=\"custom-interpolation-markup\" module=\"customInterpolationApp\">\n<file name=\"index.html\">\n<script>\n var customInterpolationApp = angular.module('customInterpolationApp', []);\n\n customInterpolationApp.config(function($interpolateProvider) {\n $interpolateProvider.startSymbol('//');\n $interpolateProvider.endSymbol('//');\n });\n\n\n customInterpolationApp.controller('DemoController', function() {\n this.label = \"This binding is brought you by // interpolation symbols.\";\n });\n</script>\n<div ng-controller=\"DemoController as demo\">\n //demo.label//\n</div>\n</file>\n<file name=\"protractor.js\" type=\"protractor\">\n it('should interpolate binding with custom symbols', function() {\n expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n });\n</file>\n</example>\n */\nfunction $InterpolateProvider() {\n var startSymbol = '{{';\n var endSymbol = '}}';\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#startSymbol\n * @description\n * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n *\n * @param {string=} value new value to set the starting symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.startSymbol = function(value) {\n if (value) {\n startSymbol = value;\n return this;\n } else {\n return startSymbol;\n }\n };\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * @param {string=} value new value to set the ending symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.endSymbol = function(value) {\n if (value) {\n endSymbol = value;\n return this;\n } else {\n return endSymbol;\n }\n };\n\n\n this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {\n var startSymbolLength = startSymbol.length,\n endSymbolLength = endSymbol.length,\n escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n\n function escape(ch) {\n return '\\\\\\\\\\\\' + ch;\n }\n\n function unescapeText(text) {\n return text.replace(escapedStartRegexp, startSymbol).\n replace(escapedEndRegexp, endSymbol);\n }\n\n // TODO: this is the same as the constantWatchDelegate in parse.js\n function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }\n\n /**\n * @ngdoc service\n * @name $interpolate\n * @kind function\n *\n * @requires $parse\n * @requires $sce\n *\n * @description\n *\n * Compiles a string with markup into an interpolation function. This service is used by the\n * HTML {@link ng.$compile $compile} service for data binding. See\n * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n * interpolation markup.\n *\n *\n * ```js\n * var $interpolate = ...; // injected\n * var exp = $interpolate('Hello {{name | uppercase}}!');\n * expect(exp({name:'Angular'})).toEqual('Hello ANGULAR!');\n * ```\n *\n * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n * `true`, the interpolation function will return `undefined` unless all embedded expressions\n * evaluate to a value other than `undefined`.\n *\n * ```js\n * var $interpolate = ...; // injected\n * var context = {greeting: 'Hello', name: undefined };\n *\n * // default \"forgiving\" mode\n * var exp = $interpolate('{{greeting}} {{name}}!');\n * expect(exp(context)).toEqual('Hello !');\n *\n * // \"allOrNothing\" mode\n * exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n * expect(exp(context)).toBeUndefined();\n * context.name = 'Angular';\n * expect(exp(context)).toEqual('Hello Angular!');\n * ```\n *\n * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n *\n * #### Escaped Interpolation\n * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n * or binding.\n *\n * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n * degree, while also enabling code examples to work without relying on the\n * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n *\n * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all\n * interpolation start/end markers with their escaped counterparts.**\n *\n * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n * output when the $interpolate service processes the text. So, for HTML elements interpolated\n * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n * this is typically useful only when user-data is used in rendering a template from the server, or\n * when otherwise untrusted data is used by a directive.\n *\n * <example name=\"interpolation\">\n * <file name=\"index.html\">\n * <div ng-init=\"username='A user'\">\n * <p ng-init=\"apptitle='Escaping demo'\">{{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n * </p>\n * <p><strong>{{username}}</strong> attempts to inject code which will deface the\n * application, but fails to accomplish their task, because the server has correctly\n * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n * characters.</p>\n * <p>Instead, the result of the attempted script injection is visible, and can be removed\n * from the database by an administrator.</p>\n * </div>\n * </file>\n * </example>\n *\n * @knownIssue\n * It is currently not possible for an interpolated expression to contain the interpolation end\n * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e.\n * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string.\n *\n * @knownIssue\n * All directives and components must use the standard `{{` `}}` interpolation symbols\n * in their templates. If you change the application interpolation symbols the {@link $compile}\n * service will attempt to denormalize the standard symbols to the custom symbols.\n * The denormalization process is not clever enough to know not to replace instances of the standard\n * symbols where they would not normally be treated as interpolation symbols. For example in the following\n * code snippet the closing braces of the literal object will get incorrectly denormalized:\n *\n * ```\n * <div data-context='{\"context\":{\"id\":3,\"type\":\"page\"}}\">\n * ```\n *\n * The workaround is to ensure that such instances are separated by whitespace:\n * ```\n * <div data-context='{\"context\":{\"id\":3,\"type\":\"page\"} }\">\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14610#issuecomment-219401099 for more information.\n *\n * @param {string} text The text with markup to interpolate.\n * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n * embedded expression in order to return an interpolation function. Strings with no\n * embedded expression will return null for the interpolation function.\n * @param {string=} trustedContext when provided, the returned function passes the interpolated\n * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that\n * provides Strict Contextual Escaping for details.\n * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n * unless all embedded expressions evaluate to a value other than `undefined`.\n * @returns {function(context)} an interpolation function which is used to compute the\n * interpolated string. The function has these parameters:\n *\n * - `context`: evaluation context for all expressions embedded in the interpolated text\n */\n function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n // Provide a quick exit and simplified result function for text with no interpolation\n if (!text.length || text.indexOf(startSymbol) === -1) {\n var constantInterp;\n if (!mustHaveExpression) {\n var unescapedText = unescapeText(text);\n constantInterp = valueFn(unescapedText);\n constantInterp.exp = text;\n constantInterp.expressions = [];\n constantInterp.$$watchDelegate = constantWatchDelegate;\n }\n return constantInterp;\n }\n\n allOrNothing = !!allOrNothing;\n var startIndex,\n endIndex,\n index = 0,\n expressions = [],\n parseFns = [],\n textLength = text.length,\n exp,\n concat = [],\n expressionPositions = [];\n\n while (index < textLength) {\n if (((startIndex = text.indexOf(startSymbol, index)) !== -1) &&\n ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1)) {\n if (index !== startIndex) {\n concat.push(unescapeText(text.substring(index, startIndex)));\n }\n exp = text.substring(startIndex + startSymbolLength, endIndex);\n expressions.push(exp);\n parseFns.push($parse(exp, parseStringifyInterceptor));\n index = endIndex + endSymbolLength;\n expressionPositions.push(concat.length);\n concat.push('');\n } else {\n // we did not find an interpolation, so we have to add the remainder to the separators array\n if (index !== textLength) {\n concat.push(unescapeText(text.substring(index)));\n }\n break;\n }\n }\n\n // Concatenating expressions makes it hard to reason about whether some combination of\n // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a\n // single expression be used for iframe[src], object[src], etc., we ensure that the value\n // that's used is assigned or constructed by some JS code somewhere that is more testable or\n // make it obvious that you bound the value to some user controlled value. This helps reduce\n // the load when auditing for XSS issues.\n if (trustedContext && concat.length > 1) {\n $interpolateMinErr.throwNoconcat(text);\n }\n\n if (!mustHaveExpression || expressions.length) {\n var compute = function(values) {\n for (var i = 0, ii = expressions.length; i < ii; i++) {\n if (allOrNothing && isUndefined(values[i])) return;\n concat[expressionPositions[i]] = values[i];\n }\n return concat.join('');\n };\n\n var getValue = function(value) {\n return trustedContext ?\n $sce.getTrusted(trustedContext, value) :\n $sce.valueOf(value);\n };\n\n return extend(function interpolationFn(context) {\n var i = 0;\n var ii = expressions.length;\n var values = new Array(ii);\n\n try {\n for (; i < ii; i++) {\n values[i] = parseFns[i](context);\n }\n\n return compute(values);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n\n }, {\n // all of these properties are undocumented for now\n exp: text, //just for compatibility with regular watchers created via $watch\n expressions: expressions,\n $$watchDelegate: function(scope, listener) {\n var lastValue;\n return scope.$watchGroup(parseFns, /** @this */ function interpolateFnWatcher(values, oldValues) {\n var currValue = compute(values);\n if (isFunction(listener)) {\n listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n }\n lastValue = currValue;\n });\n }\n });\n }\n\n function parseStringifyInterceptor(value) {\n try {\n value = getValue(value);\n return allOrNothing && !isDefined(value) ? value : stringify(value);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interpolate#startSymbol\n * @description\n * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n *\n * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n * the symbol.\n *\n * @returns {string} start symbol.\n */\n $interpolate.startSymbol = function() {\n return startSymbol;\n };\n\n\n /**\n * @ngdoc method\n * @name $interpolate#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n * the symbol.\n *\n * @returns {string} end symbol.\n */\n $interpolate.endSymbol = function() {\n return endSymbol;\n };\n\n return $interpolate;\n }];\n}\n\n/** @this */\nfunction $IntervalProvider() {\n this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',\n function($rootScope, $window, $q, $$q, $browser) {\n var intervals = {};\n\n\n /**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n * milliseconds.\n *\n * The return value of registering an interval function is a promise. This promise will be\n * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n * run indefinitely if `count` is not defined. The value of the notification will be the\n * number of iterations that have run.\n * To cancel an interval, call `$interval.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n * <div class=\"alert alert-warning\">\n * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n * with them. In particular they are not automatically destroyed when a controller's scope or a\n * directive's element are destroyed.\n * You should take this into consideration and make sure to always cancel the interval at the\n * appropriate moment. See the example below for more details on how and when to do this.\n * </div>\n *\n * @param {function()} fn A function that should be called repeatedly. If no additional arguments\n * are passed (see below), the function is called with the current iteration count.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete.\n *\n * @example\n * <example module=\"intervalExample\" name=\"interval-service\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('intervalExample', [])\n * .controller('ExampleController', ['$scope', '$interval',\n * function($scope, $interval) {\n * $scope.format = 'M/d/yy h:mm:ss a';\n * $scope.blood_1 = 100;\n * $scope.blood_2 = 120;\n *\n * var stop;\n * $scope.fight = function() {\n * // Don't start a new fight if we are already fighting\n * if ( angular.isDefined(stop) ) return;\n *\n * stop = $interval(function() {\n * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {\n * $scope.blood_1 = $scope.blood_1 - 3;\n * $scope.blood_2 = $scope.blood_2 - 4;\n * } else {\n * $scope.stopFight();\n * }\n * }, 100);\n * };\n *\n * $scope.stopFight = function() {\n * if (angular.isDefined(stop)) {\n * $interval.cancel(stop);\n * stop = undefined;\n * }\n * };\n *\n * $scope.resetFight = function() {\n * $scope.blood_1 = 100;\n * $scope.blood_2 = 120;\n * };\n *\n * $scope.$on('$destroy', function() {\n * // Make sure that the interval is destroyed too\n * $scope.stopFight();\n * });\n * }])\n * // Register the 'myCurrentTime' directive factory method.\n * // We inject $interval and dateFilter service since the factory method is DI.\n * .directive('myCurrentTime', ['$interval', 'dateFilter',\n * function($interval, dateFilter) {\n * // return the directive link function. (compile function not needed)\n * return function(scope, element, attrs) {\n * var format, // date format\n * stopTime; // so that we can cancel the time updates\n *\n * // used to update the UI\n * function updateTime() {\n * element.text(dateFilter(new Date(), format));\n * }\n *\n * // watch the expression, and update the UI on change.\n * scope.$watch(attrs.myCurrentTime, function(value) {\n * format = value;\n * updateTime();\n * });\n *\n * stopTime = $interval(updateTime, 1000);\n *\n * // listen on DOM destroy (removal) event, and cancel the next UI update\n * // to prevent updating time after the DOM element was removed.\n * element.on('$destroy', function() {\n * $interval.cancel(stopTime);\n * });\n * }\n * }]);\n * </script>\n *\n * <div>\n * <div ng-controller=\"ExampleController\">\n * <label>Date format: <input ng-model=\"format\"></label> <hr/>\n * Current time is: <span my-current-time=\"format\"></span>\n * <hr/>\n * Blood 1 : <font color='red'>{{blood_1}}</font>\n * Blood 2 : <font color='red'>{{blood_2}}</font>\n * <button type=\"button\" data-ng-click=\"fight()\">Fight</button>\n * <button type=\"button\" data-ng-click=\"stopFight()\">StopFight</button>\n * <button type=\"button\" data-ng-click=\"resetFight()\">resetFight</button>\n * </div>\n * </div>\n *\n * </file>\n * </example>\n */\n function interval(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? sliceArgs(arguments, 4) : [],\n setInterval = $window.setInterval,\n clearInterval = $window.clearInterval,\n iteration = 0,\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n\n count = isDefined(count) ? count : 0;\n\n promise.$$intervalId = setInterval(function tick() {\n if (skipApply) {\n $browser.defer(callback);\n } else {\n $rootScope.$evalAsync(callback);\n }\n deferred.notify(iteration++);\n\n if (count > 0 && iteration >= count) {\n deferred.resolve(iteration);\n clearInterval(promise.$$intervalId);\n delete intervals[promise.$$intervalId];\n }\n\n if (!skipApply) $rootScope.$apply();\n\n }, delay);\n\n intervals[promise.$$intervalId] = deferred;\n\n return promise;\n\n function callback() {\n if (!hasParams) {\n fn(iteration);\n } else {\n fn.apply(null, args);\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {Promise=} promise returned by the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully canceled.\n */\n interval.cancel = function(promise) {\n if (promise && promise.$$intervalId in intervals) {\n // Interval cancels should not report as unhandled promise.\n markQExceptionHandled(intervals[promise.$$intervalId].promise);\n intervals[promise.$$intervalId].reject('canceled');\n $window.clearInterval(promise.$$intervalId);\n delete intervals[promise.$$intervalId];\n return true;\n }\n return false;\n };\n\n return interval;\n }];\n}\n\n/**\n * @ngdoc service\n * @name $jsonpCallbacks\n * @requires $window\n * @description\n * This service handles the lifecycle of callbacks to handle JSONP requests.\n * Override this service if you wish to customise where the callbacks are stored and\n * how they vary compared to the requested url.\n */\nvar $jsonpCallbacksProvider = /** @this */ function() {\n this.$get = function() {\n var callbacks = angular.callbacks;\n var callbackMap = {};\n\n function createCallback(callbackId) {\n var callback = function(data) {\n callback.data = data;\n callback.called = true;\n };\n callback.id = callbackId;\n return callback;\n }\n\n return {\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#createCallback\n * @param {string} url the url of the JSONP request\n * @returns {string} the callback path to send to the server as part of the JSONP request\n * @description\n * {@link $httpBackend} calls this method to create a callback and get hold of the path to the callback\n * to pass to the server, which will be used to call the callback with its payload in the JSONP response.\n */\n createCallback: function(url) {\n var callbackId = '_' + (callbacks.$$counter++).toString(36);\n var callbackPath = 'angular.callbacks.' + callbackId;\n var callback = createCallback(callbackId);\n callbackMap[callbackPath] = callbacks[callbackId] = callback;\n return callbackPath;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#wasCalled\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {boolean} whether the callback has been called, as a result of the JSONP response\n * @description\n * {@link $httpBackend} calls this method to find out whether the JSONP response actually called the\n * callback that was passed in the request.\n */\n wasCalled: function(callbackPath) {\n return callbackMap[callbackPath].called;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#getResponse\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {*} the data received from the response via the registered callback\n * @description\n * {@link $httpBackend} calls this method to get hold of the data that was provided to the callback\n * in the JSONP response.\n */\n getResponse: function(callbackPath) {\n return callbackMap[callbackPath].data;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#removeCallback\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @description\n * {@link $httpBackend} calls this method to remove the callback after the JSONP request has\n * completed or timed-out.\n */\n removeCallback: function(callbackPath) {\n var callback = callbackMap[callbackPath];\n delete callbacks[callback.id];\n delete callbackMap[callbackPath];\n }\n };\n };\n};\n\n/**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various Angular components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\n\nvar PATH_MATCH = /^([^?#]*)(\\?([^#]*))?(#(.*))?$/,\n DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};\nvar $locationMinErr = minErr('$location');\n\n\n/**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\nfunction encodePath(path) {\n var segments = path.split('/'),\n i = segments.length;\n\n while (i--) {\n segments[i] = encodeUriSegment(segments[i]);\n }\n\n return segments.join('/');\n}\n\nfunction parseAbsoluteUrl(absoluteUrl, locationObj) {\n var parsedUrl = urlResolve(absoluteUrl);\n\n locationObj.$$protocol = parsedUrl.protocol;\n locationObj.$$host = parsedUrl.hostname;\n locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n}\n\nvar DOUBLE_SLASH_REGEX = /^\\s*[\\\\/]{2,}/;\nfunction parseAppUrl(url, locationObj) {\n\n if (DOUBLE_SLASH_REGEX.test(url)) {\n throw $locationMinErr('badpath', 'Invalid url \"{0}\".', url);\n }\n\n var prefixed = (url.charAt(0) !== '/');\n if (prefixed) {\n url = '/' + url;\n }\n var match = urlResolve(url);\n locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?\n match.pathname.substring(1) : match.pathname);\n locationObj.$$search = parseKeyValue(match.search);\n locationObj.$$hash = decodeURIComponent(match.hash);\n\n // make sure path starts with '/';\n if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') {\n locationObj.$$path = '/' + locationObj.$$path;\n }\n}\n\nfunction startsWith(str, search) {\n return str.slice(0, search.length) === search;\n}\n\n/**\n *\n * @param {string} base\n * @param {string} url\n * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with\n * the expected string.\n */\nfunction stripBaseUrl(base, url) {\n if (startsWith(url, base)) {\n return url.substr(base.length);\n }\n}\n\n\nfunction stripHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? url : url.substr(0, index);\n}\n\nfunction trimEmptyHash(url) {\n return url.replace(/(#.+)|#$/, '$1');\n}\n\n\nfunction stripFile(url) {\n return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n}\n\n/* return the server only (scheme://host:port) */\nfunction serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}\n\n\n/**\n * LocationHtml5Url represents a URL\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} basePrefix URL path prefix\n */\nfunction LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {\n this.$$html5 = true;\n basePrefix = basePrefix || '';\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given HTML5 (regular) URL string into properties\n * @param {string} url HTML5 URL\n * @private\n */\n this.$$parse = function(url) {\n var pathUrl = stripBaseUrl(appBaseNoFile, url);\n if (!isString(pathUrl)) {\n throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url,\n appBaseNoFile);\n }\n\n parseAppUrl(pathUrl, this);\n\n if (!this.$$path) {\n this.$$path = '/';\n }\n\n this.$$compose();\n };\n\n /**\n * Compose url and update `absUrl` property\n * @private\n */\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'\n\n this.$$urlUpdatedByLocation = true;\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n var appUrl, prevAppUrl;\n var rewrittenUrl;\n\n\n if (isDefined(appUrl = stripBaseUrl(appBase, url))) {\n prevAppUrl = appUrl;\n if (basePrefix && isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) {\n rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl);\n } else {\n rewrittenUrl = appBase + prevAppUrl;\n }\n } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBaseNoFile + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents URL\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {\n\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given hashbang URL into properties\n * @param {string} url Hashbang URL\n * @private\n */\n this.$$parse = function(url) {\n var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url);\n var withoutHashUrl;\n\n if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {\n\n // The rest of the URL starts with a hash so we have\n // got either a hashbang path or a plain hash fragment\n withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl);\n if (isUndefined(withoutHashUrl)) {\n // There was no hashbang prefix so we just have a hash fragment\n withoutHashUrl = withoutBaseUrl;\n }\n\n } else {\n // There was no hashbang path nor hash fragment:\n // If we are in HTML5 mode we use what is left as the path;\n // Otherwise we ignore what is left\n if (this.$$html5) {\n withoutHashUrl = withoutBaseUrl;\n } else {\n withoutHashUrl = '';\n if (isUndefined(withoutBaseUrl)) {\n appBase = url;\n /** @type {?} */ (this).replace();\n }\n }\n }\n\n parseAppUrl(withoutHashUrl, this);\n\n this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n\n this.$$compose();\n\n /*\n * In Windows, on an anchor node on documents loaded from\n * the filesystem, the browser will return a pathname\n * prefixed with the drive name ('/C:/path') when a\n * pathname without a drive is set:\n * * a.setAttribute('href', '/foo')\n * * a.pathname === '/C:/foo' //true\n *\n * Inside of Angular, we're always using pathnames that\n * do not include drive names for routing.\n */\n function removeWindowsDriveName(path, url, base) {\n /*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */\n var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n var firstPathSegmentMatch;\n\n //Get the relative path from the input URL.\n if (startsWith(url, base)) {\n url = url.replace(base, '');\n }\n\n // The input URL intentionally contains a first path segment that ends with a colon.\n if (windowsFilePathExp.exec(url)) {\n return path;\n }\n\n firstPathSegmentMatch = windowsFilePathExp.exec(path);\n return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n }\n };\n\n /**\n * Compose hashbang URL and update `absUrl` property\n * @private\n */\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');\n\n this.$$urlUpdatedByLocation = true;\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (stripHash(appBase) === stripHash(url)) {\n this.$$parse(url);\n return true;\n }\n return false;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents URL\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {\n this.$$html5 = true;\n LocationHashbangUrl.apply(this, arguments);\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n\n var rewrittenUrl;\n var appUrl;\n\n if (appBase === stripHash(url)) {\n rewrittenUrl = url;\n } else if ((appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBase + hashPrefix + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'\n this.$$absUrl = appBase + hashPrefix + this.$$url;\n\n this.$$urlUpdatedByLocation = true;\n };\n\n}\n\n\nvar locationPrototype = {\n\n /**\n * Ensure absolute URL is initialized.\n * @private\n */\n $$absUrl:'',\n\n /**\n * Are we in html5 mode?\n * @private\n */\n $$html5: false,\n\n /**\n * Has any change been replacing?\n * @private\n */\n $$replace: false,\n\n /**\n * @ngdoc method\n * @name $location#absUrl\n *\n * @description\n * This method is getter only.\n *\n * Return full URL representation with all segments encoded according to rules specified in\n * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var absUrl = $location.absUrl();\n * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @return {string} full URL\n */\n absUrl: locationGetter('$$absUrl'),\n\n /**\n * @ngdoc method\n * @name $location#url\n *\n * @description\n * This method is getter / setter.\n *\n * Return URL (e.g. `/path?a=b#hash`) when called without any parameter.\n *\n * Change path, search and hash, when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var url = $location.url();\n * // => \"/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @param {string=} url New URL without base prefix (e.g. `/path?a=b#hash`)\n * @return {string} url\n */\n url: function(url) {\n if (isUndefined(url)) {\n return this.$$url;\n }\n\n var match = PATH_MATCH.exec(url);\n if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n if (match[2] || match[1] || url === '') this.search(match[3] || '');\n this.hash(match[5] || '');\n\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#protocol\n *\n * @description\n * This method is getter only.\n *\n * Return protocol of current URL.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var protocol = $location.protocol();\n * // => \"http\"\n * ```\n *\n * @return {string} protocol of current URL\n */\n protocol: locationGetter('$$protocol'),\n\n /**\n * @ngdoc method\n * @name $location#host\n *\n * @description\n * This method is getter only.\n *\n * Return host of current URL.\n *\n * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var host = $location.host();\n * // => \"example.com\"\n *\n * // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo\n * host = $location.host();\n * // => \"example.com\"\n * host = location.host;\n * // => \"example.com:8080\"\n * ```\n *\n * @return {string} host of current URL.\n */\n host: locationGetter('$$host'),\n\n /**\n * @ngdoc method\n * @name $location#port\n *\n * @description\n * This method is getter only.\n *\n * Return port of current URL.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var port = $location.port();\n * // => 80\n * ```\n *\n * @return {Number} port\n */\n port: locationGetter('$$port'),\n\n /**\n * @ngdoc method\n * @name $location#path\n *\n * @description\n * This method is getter / setter.\n *\n * Return path of current URL when called without any parameter.\n *\n * Change path when called with parameter and return `$location`.\n *\n * Note: Path should always begin with forward slash (/), this method will add the forward slash\n * if it is missing.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var path = $location.path();\n * // => \"/some/path\"\n * ```\n *\n * @param {(string|number)=} path New path\n * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter\n */\n path: locationGetterSetter('$$path', function(path) {\n path = path !== null ? path.toString() : '';\n return path.charAt(0) === '/' ? path : '/' + path;\n }),\n\n /**\n * @ngdoc method\n * @name $location#search\n *\n * @description\n * This method is getter / setter.\n *\n * Return search part (as object) of current URL when called without any parameter.\n *\n * Change search part when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var searchObject = $location.search();\n * // => {foo: 'bar', baz: 'xoxo'}\n *\n * // set foo to 'yipee'\n * $location.search('foo', 'yipee');\n * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n * ```\n *\n * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or\n * hash object.\n *\n * When called with a single argument the method acts as a setter, setting the `search` component\n * of `$location` to the specified value.\n *\n * If the argument is a hash object containing an array of values, these values will be encoded\n * as duplicate search parameters in the URL.\n *\n * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n * will override only a single search property.\n *\n * If `paramValue` is an array, it will override the property of the `search` component of\n * `$location` specified via the first argument.\n *\n * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n *\n * If `paramValue` is `true`, the property specified via the first argument will be added with no\n * value nor trailing equal sign.\n *\n * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n * one or more arguments returns `$location` object itself.\n */\n search: function(search, paramValue) {\n switch (arguments.length) {\n case 0:\n return this.$$search;\n case 1:\n if (isString(search) || isNumber(search)) {\n search = search.toString();\n this.$$search = parseKeyValue(search);\n } else if (isObject(search)) {\n search = copy(search, {});\n // remove object undefined or null properties\n forEach(search, function(value, key) {\n if (value == null) delete search[key];\n });\n\n this.$$search = search;\n } else {\n throw $locationMinErr('isrcharg',\n 'The first argument of the `$location#search()` call must be a string or an object.');\n }\n break;\n default:\n if (isUndefined(paramValue) || paramValue === null) {\n delete this.$$search[search];\n } else {\n this.$$search[search] = paramValue;\n }\n }\n\n this.$$compose();\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#hash\n *\n * @description\n * This method is getter / setter.\n *\n * Returns the hash fragment when called without any parameters.\n *\n * Changes the hash fragment when called with a parameter and returns `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n * var hash = $location.hash();\n * // => \"hashValue\"\n * ```\n *\n * @param {(string|number)=} hash New hash fragment\n * @return {string} hash\n */\n hash: locationGetterSetter('$$hash', function(hash) {\n return hash !== null ? hash.toString() : '';\n }),\n\n /**\n * @ngdoc method\n * @name $location#replace\n *\n * @description\n * If called, all changes to $location during the current `$digest` will replace the current history\n * record, instead of adding a new one.\n */\n replace: function() {\n this.$$replace = true;\n return this;\n }\n};\n\nforEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {\n Location.prototype = Object.create(locationPrototype);\n\n /**\n * @ngdoc method\n * @name $location#state\n *\n * @description\n * This method is getter / setter.\n *\n * Return the history state object when called without any parameter.\n *\n * Change the history state object when called with one parameter and return `$location`.\n * The state object is later passed to `pushState` or `replaceState`.\n *\n * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n * older browsers (like IE9 or Android < 4.0), don't use this method.\n *\n * @param {object=} state State object for pushState or replaceState\n * @return {object} state\n */\n Location.prototype.state = function(state) {\n if (!arguments.length) {\n return this.$$state;\n }\n\n if (Location !== LocationHtml5Url || !this.$$html5) {\n throw $locationMinErr('nostate', 'History API state support is available only ' +\n 'in HTML5 mode and only in browsers supporting HTML5 History API');\n }\n // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n // but we're changing the $$state reference to $browser.state() during the $digest\n // so the modification window is narrow.\n this.$$state = isUndefined(state) ? null : state;\n this.$$urlUpdatedByLocation = true;\n\n return this;\n };\n});\n\n\nfunction locationGetter(property) {\n return /** @this */ function() {\n return this[property];\n };\n}\n\n\nfunction locationGetterSetter(property, preprocess) {\n return /** @this */ function(value) {\n if (isUndefined(value)) {\n return this[property];\n }\n\n this[property] = preprocess(value);\n this.$$compose();\n\n return this;\n };\n}\n\n\n/**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n * - Watch and observe the URL.\n * - Change the URL.\n * - Synchronizes the URL with the browser when the user\n * - Changes the address bar.\n * - Clicks the back or forward button (or clicks a History link).\n * - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n/**\n * @ngdoc provider\n * @name $locationProvider\n * @this\n *\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\nfunction $LocationProvider() {\n var hashPrefix = '!',\n html5Mode = {\n enabled: false,\n requireBase: true,\n rewriteLinks: true\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#hashPrefix\n * @description\n * The default value for the prefix is `'!'`.\n * @param {string=} prefix Prefix for hash part (containing path and search)\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.hashPrefix = function(prefix) {\n if (isDefined(prefix)) {\n hashPrefix = prefix;\n return this;\n } else {\n return hashPrefix;\n }\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#html5Mode\n * @description\n * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n * properties:\n * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n * support `pushState`.\n * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n * whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are\n * true, and a base tag is not present, an error will be thrown when `$location` is injected.\n * See the {@link guide/$location $location guide for more information}\n * - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled,\n * enables/disables URL rewriting for relative links. If set to a string, URL rewriting will\n * only happen on links with an attribute that matches the given string. For example, if set\n * to `'internal-link'`, then the URL will only be rewritten for `<a internal-link>` links.\n * Note that [attribute name normalization](guide/directive#normalization) does not apply\n * here, so `'internalLink'` will **not** match `'internal-link'`.\n *\n * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n */\n this.html5Mode = function(mode) {\n if (isBoolean(mode)) {\n html5Mode.enabled = mode;\n return this;\n } else if (isObject(mode)) {\n\n if (isBoolean(mode.enabled)) {\n html5Mode.enabled = mode.enabled;\n }\n\n if (isBoolean(mode.requireBase)) {\n html5Mode.requireBase = mode.requireBase;\n }\n\n if (isBoolean(mode.rewriteLinks) || isString(mode.rewriteLinks)) {\n html5Mode.rewriteLinks = mode.rewriteLinks;\n }\n\n return this;\n } else {\n return html5Mode;\n }\n };\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a URL will change.\n *\n * This change can be prevented by calling\n * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n * details about event object. Upon successful change\n * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a URL was changed.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',\n function($rootScope, $browser, $sniffer, $rootElement, $window) {\n var $location,\n LocationMode,\n baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''\n initialUrl = $browser.url(),\n appBase;\n\n if (html5Mode.enabled) {\n if (!baseHref && html5Mode.requireBase) {\n throw $locationMinErr('nobase',\n '$location in HTML5 mode requires a <base> tag to be present!');\n }\n appBase = serverBase(initialUrl) + (baseHref || '/');\n LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n } else {\n appBase = stripHash(initialUrl);\n LocationMode = LocationHashbangUrl;\n }\n var appBaseNoFile = stripFile(appBase);\n\n $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);\n $location.$$parseLinkUrl(initialUrl, initialUrl);\n\n $location.$$state = $browser.state();\n\n var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n function setBrowserUrlWithFallback(url, replace, state) {\n var oldUrl = $location.url();\n var oldState = $location.$$state;\n try {\n $browser.url(url, replace, state);\n\n // Make sure $location.state() returns referentially identical (not just deeply equal)\n // state object; this makes possible quick checking if the state changed in the digest\n // loop. Checking deep equality would be too expensive.\n $location.$$state = $browser.state();\n } catch (e) {\n // Restore old values if pushState fails\n $location.url(oldUrl);\n $location.$$state = oldState;\n\n throw e;\n }\n }\n\n $rootElement.on('click', function(event) {\n var rewriteLinks = html5Mode.rewriteLinks;\n // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n // currently we open nice url link and redirect then\n\n if (!rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return;\n\n var elm = jqLite(event.target);\n\n // traverse the DOM up to find first A tag\n while (nodeName_(elm[0]) !== 'a') {\n // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n }\n\n if (isString(rewriteLinks) && isUndefined(elm.attr(rewriteLinks))) return;\n\n var absHref = elm.prop('href');\n // get the actual href attribute - see\n // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n var relHref = elm.attr('href') || elm.attr('xlink:href');\n\n if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n // an animation.\n absHref = urlResolve(absHref.animVal).href;\n }\n\n // Ignore when url is started with javascript: or mailto:\n if (IGNORE_URI_REGEXP.test(absHref)) return;\n\n if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n if ($location.$$parseLinkUrl(absHref, relHref)) {\n // We do a preventDefault for all urls that are part of the angular application,\n // in html5mode and also without, so that we are able to abort navigation without\n // getting double entries in the location history.\n event.preventDefault();\n // update location manually\n if ($location.absUrl() !== $browser.url()) {\n $rootScope.$apply();\n // hack to work around FF6 bug 684208 when scenario runner clicks on links\n $window.angular['ff-684208-preventDefault'] = true;\n }\n }\n }\n });\n\n\n // rewrite hashbang url <> html5 url\n if (trimEmptyHash($location.absUrl()) !== trimEmptyHash(initialUrl)) {\n $browser.url($location.absUrl(), true);\n }\n\n var initializing = true;\n\n // update $location when $browser url changes\n $browser.onUrlChange(function(newUrl, newState) {\n\n if (!startsWith(newUrl, appBaseNoFile)) {\n // If we are navigating outside of the app then force a reload\n $window.location.href = newUrl;\n return;\n }\n\n $rootScope.$evalAsync(function() {\n var oldUrl = $location.absUrl();\n var oldState = $location.$$state;\n var defaultPrevented;\n newUrl = trimEmptyHash(newUrl);\n $location.$$parse(newUrl);\n $location.$$state = newState;\n\n defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n newState, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n setBrowserUrlWithFallback(oldUrl, false, oldState);\n } else {\n initializing = false;\n afterLocationChange(oldUrl, oldState);\n }\n });\n if (!$rootScope.$$phase) $rootScope.$digest();\n });\n\n // update browser\n $rootScope.$watch(function $locationWatch() {\n if (initializing || $location.$$urlUpdatedByLocation) {\n $location.$$urlUpdatedByLocation = false;\n\n var oldUrl = trimEmptyHash($browser.url());\n var newUrl = trimEmptyHash($location.absUrl());\n var oldState = $browser.state();\n var currentReplace = $location.$$replace;\n var urlOrStateChanged = oldUrl !== newUrl ||\n ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);\n\n if (initializing || urlOrStateChanged) {\n initializing = false;\n\n $rootScope.$evalAsync(function() {\n var newUrl = $location.absUrl();\n var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n $location.$$state, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n } else {\n if (urlOrStateChanged) {\n setBrowserUrlWithFallback(newUrl, currentReplace,\n oldState === $location.$$state ? null : $location.$$state);\n }\n afterLocationChange(oldUrl, oldState);\n }\n });\n }\n }\n\n $location.$$replace = false;\n\n // we don't need to return anything because $evalAsync will make the digest loop dirty when\n // there is a change\n });\n\n return $location;\n\n function afterLocationChange(oldUrl, oldState) {\n $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,\n $location.$$state, oldState);\n }\n}];\n}\n\n/**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * To reveal the location of the calls to `$log` in the JavaScript console,\n * you can \"blackbox\" the AngularJS source in your browser:\n *\n * [Mozilla description of blackboxing](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Black_box_a_source).\n * [Chrome description of blackboxing](https://developer.chrome.com/devtools/docs/blackboxing).\n *\n * Note: Not all browsers support blackboxing.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n <example module=\"logExample\" name=\"log-service\">\n <file name=\"script.js\">\n angular.module('logExample', [])\n .controller('LogController', ['$scope', '$log', function($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }]);\n </file>\n <file name=\"index.html\">\n <div ng-controller=\"LogController\">\n <p>Reload this page with open console, enter text and hit the log button...</p>\n <label>Message:\n <input type=\"text\" ng-model=\"message\" /></label>\n <button ng-click=\"$log.log(message)\">log</button>\n <button ng-click=\"$log.warn(message)\">warn</button>\n <button ng-click=\"$log.info(message)\">info</button>\n <button ng-click=\"$log.error(message)\">error</button>\n <button ng-click=\"$log.debug(message)\">debug</button>\n </div>\n </file>\n </example>\n */\n\n/**\n * @ngdoc provider\n * @name $logProvider\n * @this\n *\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\nfunction $LogProvider() {\n var debug = true,\n self = this;\n\n /**\n * @ngdoc method\n * @name $logProvider#debugEnabled\n * @description\n * @param {boolean=} flag enable or disable debug level messages\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.debugEnabled = function(flag) {\n if (isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n\n this.$get = ['$window', function($window) {\n // Support: IE 9-11, Edge 12-14+\n // IE/Edge display errors in such a way that it requires the user to click in 4 places\n // to see the stack trace. There is no way to feature-detect it so there's a chance\n // of the user agent sniffing to go wrong but since it's only about logging, this shouldn't\n // break apps. Other browsers display errors in a sensible way and some of them map stack\n // traces along source maps if available so it makes sense to let browsers display it\n // as they want.\n var formatStackTrace = msie || /\\bEdge\\//.test($window.navigator && $window.navigator.userAgent);\n\n return {\n /**\n * @ngdoc method\n * @name $log#log\n *\n * @description\n * Write a log message\n */\n log: consoleLog('log'),\n\n /**\n * @ngdoc method\n * @name $log#info\n *\n * @description\n * Write an information message\n */\n info: consoleLog('info'),\n\n /**\n * @ngdoc method\n * @name $log#warn\n *\n * @description\n * Write a warning message\n */\n warn: consoleLog('warn'),\n\n /**\n * @ngdoc method\n * @name $log#error\n *\n * @description\n * Write an error message\n */\n error: consoleLog('error'),\n\n /**\n * @ngdoc method\n * @name $log#debug\n *\n * @description\n * Write a debug message\n */\n debug: (function() {\n var fn = consoleLog('debug');\n\n return function() {\n if (debug) {\n fn.apply(self, arguments);\n }\n };\n })()\n };\n\n function formatError(arg) {\n if (isError(arg)) {\n if (arg.stack && formatStackTrace) {\n arg = (arg.message && arg.stack.indexOf(arg.message) === -1)\n ? 'Error: ' + arg.message + '\\n' + arg.stack\n : arg.stack;\n } else if (arg.sourceURL) {\n arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n }\n }\n return arg;\n }\n\n function consoleLog(type) {\n var console = $window.console || {},\n logFn = console[type] || console.log || noop;\n\n return function() {\n var args = [];\n forEach(arguments, function(arg) {\n args.push(formatError(arg));\n });\n // Support: IE 9 only\n // console methods don't inherit from Function.prototype in IE 9 so we can't\n // call `logFn.apply(console, args)` directly.\n return Function.prototype.apply.call(logFn, console, args);\n };\n }\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $parseMinErr = minErr('$parse');\n\nvar objectValueOf = {}.constructor.prototype.valueOf;\n\n// Sandboxing Angular Expressions\n// ------------------------------\n// Angular expressions are no longer sandboxed. So it is now even easier to access arbitrary JS code by\n// various means such as obtaining a reference to native JS functions like the Function constructor.\n//\n// As an example, consider the following Angular expression:\n//\n// {}.toString.constructor('alert(\"evil JS code\")')\n//\n// It is important to realize that if you create an expression from a string that contains user provided\n// content then it is possible that your application contains a security vulnerability to an XSS style attack.\n//\n// See https://docs.angularjs.org/guide/security\n\n\nfunction getStringValue(name) {\n // Property names must be strings. This means that non-string objects cannot be used\n // as keys in an object. Any non-string object, including a number, is typecasted\n // into a string via the toString method.\n // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names\n //\n // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it\n // to a string. It's not always possible. If `name` is an object and its `toString` method is\n // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:\n //\n // TypeError: Cannot convert object to primitive value\n //\n // For performance reasons, we don't catch this error here and allow it to propagate up the call\n // stack. Note that you'll get the same error in JavaScript if you try to access a property using\n // such a 'broken' object as a key.\n return name + '';\n}\n\n\nvar OPERATORS = createMap();\nforEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });\nvar ESCAPE = {'n':'\\n', 'f':'\\f', 'r':'\\r', 't':'\\t', 'v':'\\v', '\\'':'\\'', '\"':'\"'};\n\n\n/////////////////////////////////////////\n\n\n/**\n * @constructor\n */\nvar Lexer = function Lexer(options) {\n this.options = options;\n};\n\nLexer.prototype = {\n constructor: Lexer,\n\n lex: function(text) {\n this.text = text;\n this.index = 0;\n this.tokens = [];\n\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n if (ch === '\"' || ch === '\\'') {\n this.readString(ch);\n } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n this.readNumber();\n } else if (this.isIdentifierStart(this.peekMultichar())) {\n this.readIdent();\n } else if (this.is(ch, '(){}[].,;:?')) {\n this.tokens.push({index: this.index, text: ch});\n this.index++;\n } else if (this.isWhitespace(ch)) {\n this.index++;\n } else {\n var ch2 = ch + this.peek();\n var ch3 = ch2 + this.peek(2);\n var op1 = OPERATORS[ch];\n var op2 = OPERATORS[ch2];\n var op3 = OPERATORS[ch3];\n if (op1 || op2 || op3) {\n var token = op3 ? ch3 : (op2 ? ch2 : ch);\n this.tokens.push({index: this.index, text: token, operator: true});\n this.index += token.length;\n } else {\n this.throwError('Unexpected next character ', this.index, this.index + 1);\n }\n }\n }\n return this.tokens;\n },\n\n is: function(ch, chars) {\n return chars.indexOf(ch) !== -1;\n },\n\n peek: function(i) {\n var num = i || 1;\n return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;\n },\n\n isNumber: function(ch) {\n return ('0' <= ch && ch <= '9') && typeof ch === 'string';\n },\n\n isWhitespace: function(ch) {\n // IE treats non-breaking space as \\u00A0\n return (ch === ' ' || ch === '\\r' || ch === '\\t' ||\n ch === '\\n' || ch === '\\v' || ch === '\\u00A0');\n },\n\n isIdentifierStart: function(ch) {\n return this.options.isIdentifierStart ?\n this.options.isIdentifierStart(ch, this.codePointAt(ch)) :\n this.isValidIdentifierStart(ch);\n },\n\n isValidIdentifierStart: function(ch) {\n return ('a' <= ch && ch <= 'z' ||\n 'A' <= ch && ch <= 'Z' ||\n '_' === ch || ch === '$');\n },\n\n isIdentifierContinue: function(ch) {\n return this.options.isIdentifierContinue ?\n this.options.isIdentifierContinue(ch, this.codePointAt(ch)) :\n this.isValidIdentifierContinue(ch);\n },\n\n isValidIdentifierContinue: function(ch, cp) {\n return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch);\n },\n\n codePointAt: function(ch) {\n if (ch.length === 1) return ch.charCodeAt(0);\n // eslint-disable-next-line no-bitwise\n return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00;\n },\n\n peekMultichar: function() {\n var ch = this.text.charAt(this.index);\n var peek = this.peek();\n if (!peek) {\n return ch;\n }\n var cp1 = ch.charCodeAt(0);\n var cp2 = peek.charCodeAt(0);\n if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) {\n return ch + peek;\n }\n return ch;\n },\n\n isExpOperator: function(ch) {\n return (ch === '-' || ch === '+' || this.isNumber(ch));\n },\n\n throwError: function(error, start, end) {\n end = end || this.index;\n var colStr = (isDefined(start)\n ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'\n : ' ' + end);\n throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',\n error, colStr, this.text);\n },\n\n readNumber: function() {\n var number = '';\n var start = this.index;\n while (this.index < this.text.length) {\n var ch = lowercase(this.text.charAt(this.index));\n if (ch === '.' || this.isNumber(ch)) {\n number += ch;\n } else {\n var peekCh = this.peek();\n if (ch === 'e' && this.isExpOperator(peekCh)) {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n peekCh && this.isNumber(peekCh) &&\n number.charAt(number.length - 1) === 'e') {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n (!peekCh || !this.isNumber(peekCh)) &&\n number.charAt(number.length - 1) === 'e') {\n this.throwError('Invalid exponent');\n } else {\n break;\n }\n }\n this.index++;\n }\n this.tokens.push({\n index: start,\n text: number,\n constant: true,\n value: Number(number)\n });\n },\n\n readIdent: function() {\n var start = this.index;\n this.index += this.peekMultichar().length;\n while (this.index < this.text.length) {\n var ch = this.peekMultichar();\n if (!this.isIdentifierContinue(ch)) {\n break;\n }\n this.index += ch.length;\n }\n this.tokens.push({\n index: start,\n text: this.text.slice(start, this.index),\n identifier: true\n });\n },\n\n readString: function(quote) {\n var start = this.index;\n this.index++;\n var string = '';\n var rawString = quote;\n var escape = false;\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n rawString += ch;\n if (escape) {\n if (ch === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5);\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n }\n this.index += 4;\n string += String.fromCharCode(parseInt(hex, 16));\n } else {\n var rep = ESCAPE[ch];\n string = string + (rep || ch);\n }\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === quote) {\n this.index++;\n this.tokens.push({\n index: start,\n text: rawString,\n constant: true,\n value: string\n });\n return;\n } else {\n string += ch;\n }\n this.index++;\n }\n this.throwError('Unterminated quote', start);\n }\n};\n\nvar AST = function AST(lexer, options) {\n this.lexer = lexer;\n this.options = options;\n};\n\nAST.Program = 'Program';\nAST.ExpressionStatement = 'ExpressionStatement';\nAST.AssignmentExpression = 'AssignmentExpression';\nAST.ConditionalExpression = 'ConditionalExpression';\nAST.LogicalExpression = 'LogicalExpression';\nAST.BinaryExpression = 'BinaryExpression';\nAST.UnaryExpression = 'UnaryExpression';\nAST.CallExpression = 'CallExpression';\nAST.MemberExpression = 'MemberExpression';\nAST.Identifier = 'Identifier';\nAST.Literal = 'Literal';\nAST.ArrayExpression = 'ArrayExpression';\nAST.Property = 'Property';\nAST.ObjectExpression = 'ObjectExpression';\nAST.ThisExpression = 'ThisExpression';\nAST.LocalsExpression = 'LocalsExpression';\n\n// Internal use only\nAST.NGValueParameter = 'NGValueParameter';\n\nAST.prototype = {\n ast: function(text) {\n this.text = text;\n this.tokens = this.lexer.lex(text);\n\n var value = this.program();\n\n if (this.tokens.length !== 0) {\n this.throwError('is an unexpected token', this.tokens[0]);\n }\n\n return value;\n },\n\n program: function() {\n var body = [];\n while (true) {\n if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))\n body.push(this.expressionStatement());\n if (!this.expect(';')) {\n return { type: AST.Program, body: body};\n }\n }\n },\n\n expressionStatement: function() {\n return { type: AST.ExpressionStatement, expression: this.filterChain() };\n },\n\n filterChain: function() {\n var left = this.expression();\n while (this.expect('|')) {\n left = this.filter(left);\n }\n return left;\n },\n\n expression: function() {\n return this.assignment();\n },\n\n assignment: function() {\n var result = this.ternary();\n if (this.expect('=')) {\n if (!isAssignable(result)) {\n throw $parseMinErr('lval', 'Trying to assign a value to a non l-value');\n }\n\n result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};\n }\n return result;\n },\n\n ternary: function() {\n var test = this.logicalOR();\n var alternate;\n var consequent;\n if (this.expect('?')) {\n alternate = this.expression();\n if (this.consume(':')) {\n consequent = this.expression();\n return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};\n }\n }\n return test;\n },\n\n logicalOR: function() {\n var left = this.logicalAND();\n while (this.expect('||')) {\n left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };\n }\n return left;\n },\n\n logicalAND: function() {\n var left = this.equality();\n while (this.expect('&&')) {\n left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};\n }\n return left;\n },\n\n equality: function() {\n var left = this.relational();\n var token;\n while ((token = this.expect('==','!=','===','!=='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };\n }\n return left;\n },\n\n relational: function() {\n var left = this.additive();\n var token;\n while ((token = this.expect('<', '>', '<=', '>='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };\n }\n return left;\n },\n\n additive: function() {\n var left = this.multiplicative();\n var token;\n while ((token = this.expect('+','-'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };\n }\n return left;\n },\n\n multiplicative: function() {\n var left = this.unary();\n var token;\n while ((token = this.expect('*','/','%'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };\n }\n return left;\n },\n\n unary: function() {\n var token;\n if ((token = this.expect('+', '-', '!'))) {\n return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };\n } else {\n return this.primary();\n }\n },\n\n primary: function() {\n var primary;\n if (this.expect('(')) {\n primary = this.filterChain();\n this.consume(')');\n } else if (this.expect('[')) {\n primary = this.arrayDeclaration();\n } else if (this.expect('{')) {\n primary = this.object();\n } else if (this.selfReferential.hasOwnProperty(this.peek().text)) {\n primary = copy(this.selfReferential[this.consume().text]);\n } else if (this.options.literals.hasOwnProperty(this.peek().text)) {\n primary = { type: AST.Literal, value: this.options.literals[this.consume().text]};\n } else if (this.peek().identifier) {\n primary = this.identifier();\n } else if (this.peek().constant) {\n primary = this.constant();\n } else {\n this.throwError('not a primary expression', this.peek());\n }\n\n var next;\n while ((next = this.expect('(', '[', '.'))) {\n if (next.text === '(') {\n primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };\n this.consume(')');\n } else if (next.text === '[') {\n primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };\n this.consume(']');\n } else if (next.text === '.') {\n primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };\n } else {\n this.throwError('IMPOSSIBLE');\n }\n }\n return primary;\n },\n\n filter: function(baseExpression) {\n var args = [baseExpression];\n var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};\n\n while (this.expect(':')) {\n args.push(this.expression());\n }\n\n return result;\n },\n\n parseArguments: function() {\n var args = [];\n if (this.peekToken().text !== ')') {\n do {\n args.push(this.filterChain());\n } while (this.expect(','));\n }\n return args;\n },\n\n identifier: function() {\n var token = this.consume();\n if (!token.identifier) {\n this.throwError('is not a valid identifier', token);\n }\n return { type: AST.Identifier, name: token.text };\n },\n\n constant: function() {\n // TODO check that it is a constant\n return { type: AST.Literal, value: this.consume().value };\n },\n\n arrayDeclaration: function() {\n var elements = [];\n if (this.peekToken().text !== ']') {\n do {\n if (this.peek(']')) {\n // Support trailing commas per ES5.1.\n break;\n }\n elements.push(this.expression());\n } while (this.expect(','));\n }\n this.consume(']');\n\n return { type: AST.ArrayExpression, elements: elements };\n },\n\n object: function() {\n var properties = [], property;\n if (this.peekToken().text !== '}') {\n do {\n if (this.peek('}')) {\n // Support trailing commas per ES5.1.\n break;\n }\n property = {type: AST.Property, kind: 'init'};\n if (this.peek().constant) {\n property.key = this.constant();\n property.computed = false;\n this.consume(':');\n property.value = this.expression();\n } else if (this.peek().identifier) {\n property.key = this.identifier();\n property.computed = false;\n if (this.peek(':')) {\n this.consume(':');\n property.value = this.expression();\n } else {\n property.value = property.key;\n }\n } else if (this.peek('[')) {\n this.consume('[');\n property.key = this.expression();\n this.consume(']');\n property.computed = true;\n this.consume(':');\n property.value = this.expression();\n } else {\n this.throwError('invalid key', this.peek());\n }\n properties.push(property);\n } while (this.expect(','));\n }\n this.consume('}');\n\n return {type: AST.ObjectExpression, properties: properties };\n },\n\n throwError: function(msg, token) {\n throw $parseMinErr('syntax',\n 'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',\n token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));\n },\n\n consume: function(e1) {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n\n var token = this.expect(e1);\n if (!token) {\n this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n }\n return token;\n },\n\n peekToken: function() {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n return this.tokens[0];\n },\n\n peek: function(e1, e2, e3, e4) {\n return this.peekAhead(0, e1, e2, e3, e4);\n },\n\n peekAhead: function(i, e1, e2, e3, e4) {\n if (this.tokens.length > i) {\n var token = this.tokens[i];\n var t = token.text;\n if (t === e1 || t === e2 || t === e3 || t === e4 ||\n (!e1 && !e2 && !e3 && !e4)) {\n return token;\n }\n }\n return false;\n },\n\n expect: function(e1, e2, e3, e4) {\n var token = this.peek(e1, e2, e3, e4);\n if (token) {\n this.tokens.shift();\n return token;\n }\n return false;\n },\n\n selfReferential: {\n 'this': {type: AST.ThisExpression },\n '$locals': {type: AST.LocalsExpression }\n }\n};\n\nfunction ifDefined(v, d) {\n return typeof v !== 'undefined' ? v : d;\n}\n\nfunction plusFn(l, r) {\n if (typeof l === 'undefined') return r;\n if (typeof r === 'undefined') return l;\n return l + r;\n}\n\nfunction isStateless($filter, filterName) {\n var fn = $filter(filterName);\n return !fn.$stateful;\n}\n\nvar PURITY_ABSOLUTE = 1;\nvar PURITY_RELATIVE = 2;\n\n// Detect nodes which could depend on non-shallow state of objects\nfunction isPure(node, parentIsPure) {\n switch (node.type) {\n // Computed members might invoke a stateful toString()\n case AST.MemberExpression:\n if (node.computed) {\n return false;\n }\n break;\n\n // Unary always convert to primative\n case AST.UnaryExpression:\n return PURITY_ABSOLUTE;\n\n // The binary + operator can invoke a stateful toString().\n case AST.BinaryExpression:\n return node.operator !== '+' ? PURITY_ABSOLUTE : false;\n\n // Functions / filters probably read state from within objects\n case AST.CallExpression:\n return false;\n }\n\n return (undefined === parentIsPure) ? PURITY_RELATIVE : parentIsPure;\n}\n\nfunction findConstantAndWatchExpressions(ast, $filter, parentIsPure) {\n var allConstants;\n var argsToWatch;\n var isStatelessFilter;\n\n var astIsPure = ast.isPure = isPure(ast, parentIsPure);\n\n switch (ast.type) {\n case AST.Program:\n allConstants = true;\n forEach(ast.body, function(expr) {\n findConstantAndWatchExpressions(expr.expression, $filter, astIsPure);\n allConstants = allConstants && expr.expression.constant;\n });\n ast.constant = allConstants;\n break;\n case AST.Literal:\n ast.constant = true;\n ast.toWatch = [];\n break;\n case AST.UnaryExpression:\n findConstantAndWatchExpressions(ast.argument, $filter, astIsPure);\n ast.constant = ast.argument.constant;\n ast.toWatch = ast.argument.toWatch;\n break;\n case AST.BinaryExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);\n break;\n case AST.LogicalExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.ConditionalExpression:\n findConstantAndWatchExpressions(ast.test, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.alternate, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.consequent, $filter, astIsPure);\n ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.Identifier:\n ast.constant = false;\n ast.toWatch = [ast];\n break;\n case AST.MemberExpression:\n findConstantAndWatchExpressions(ast.object, $filter, astIsPure);\n if (ast.computed) {\n findConstantAndWatchExpressions(ast.property, $filter, astIsPure);\n }\n ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.CallExpression:\n isStatelessFilter = ast.filter ? isStateless($filter, ast.callee.name) : false;\n allConstants = isStatelessFilter;\n argsToWatch = [];\n forEach(ast.arguments, function(expr) {\n findConstantAndWatchExpressions(expr, $filter, astIsPure);\n allConstants = allConstants && expr.constant;\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n });\n ast.constant = allConstants;\n ast.toWatch = isStatelessFilter ? argsToWatch : [ast];\n break;\n case AST.AssignmentExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = [ast];\n break;\n case AST.ArrayExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.elements, function(expr) {\n findConstantAndWatchExpressions(expr, $filter, astIsPure);\n allConstants = allConstants && expr.constant;\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ObjectExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.properties, function(property) {\n findConstantAndWatchExpressions(property.value, $filter, astIsPure);\n allConstants = allConstants && property.value.constant;\n argsToWatch.push.apply(argsToWatch, property.value.toWatch);\n if (property.computed) {\n //`{[key]: value}` implicitly does `key.toString()` which may be non-pure\n findConstantAndWatchExpressions(property.key, $filter, /*parentIsPure=*/false);\n allConstants = allConstants && property.key.constant;\n argsToWatch.push.apply(argsToWatch, property.key.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ThisExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n case AST.LocalsExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n }\n}\n\nfunction getInputs(body) {\n if (body.length !== 1) return;\n var lastExpression = body[0].expression;\n var candidate = lastExpression.toWatch;\n if (candidate.length !== 1) return candidate;\n return candidate[0] !== lastExpression ? candidate : undefined;\n}\n\nfunction isAssignable(ast) {\n return ast.type === AST.Identifier || ast.type === AST.MemberExpression;\n}\n\nfunction assignableAST(ast) {\n if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {\n return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};\n }\n}\n\nfunction isLiteral(ast) {\n return ast.body.length === 0 ||\n ast.body.length === 1 && (\n ast.body[0].expression.type === AST.Literal ||\n ast.body[0].expression.type === AST.ArrayExpression ||\n ast.body[0].expression.type === AST.ObjectExpression);\n}\n\nfunction isConstant(ast) {\n return ast.constant;\n}\n\nfunction ASTCompiler($filter) {\n this.$filter = $filter;\n}\n\nASTCompiler.prototype = {\n compile: function(ast) {\n var self = this;\n this.state = {\n nextId: 0,\n filters: {},\n fn: {vars: [], body: [], own: {}},\n assign: {vars: [], body: [], own: {}},\n inputs: []\n };\n findConstantAndWatchExpressions(ast, self.$filter);\n var extra = '';\n var assignable;\n this.stage = 'assign';\n if ((assignable = assignableAST(ast))) {\n this.state.computing = 'assign';\n var result = this.nextId();\n this.recurse(assignable, result);\n this.return_(result);\n extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');\n }\n var toWatch = getInputs(ast.body);\n self.stage = 'inputs';\n forEach(toWatch, function(watch, key) {\n var fnKey = 'fn' + key;\n self.state[fnKey] = {vars: [], body: [], own: {}};\n self.state.computing = fnKey;\n var intoId = self.nextId();\n self.recurse(watch, intoId);\n self.return_(intoId);\n self.state.inputs.push({name: fnKey, isPure: watch.isPure});\n watch.watchId = key;\n });\n this.state.computing = 'fn';\n this.stage = 'main';\n this.recurse(ast);\n var fnString =\n // The build and minification steps remove the string \"use strict\" from the code, but this is done using a regex.\n // This is a workaround for this until we do a better job at only removing the prefix only when we should.\n '\"' + this.USE + ' ' + this.STRICT + '\";\\n' +\n this.filterPrefix() +\n 'var fn=' + this.generateFunction('fn', 's,l,a,i') +\n extra +\n this.watchFns() +\n 'return fn;';\n\n // eslint-disable-next-line no-new-func\n var fn = (new Function('$filter',\n 'getStringValue',\n 'ifDefined',\n 'plus',\n fnString))(\n this.$filter,\n getStringValue,\n ifDefined,\n plusFn);\n this.state = this.stage = undefined;\n return fn;\n },\n\n USE: 'use',\n\n STRICT: 'strict',\n\n watchFns: function() {\n var result = [];\n var inputs = this.state.inputs;\n var self = this;\n forEach(inputs, function(input) {\n result.push('var ' + input.name + '=' + self.generateFunction(input.name, 's'));\n if (input.isPure) {\n result.push(input.name, '.isPure=' + JSON.stringify(input.isPure) + ';');\n }\n });\n if (inputs.length) {\n result.push('fn.inputs=[' + inputs.map(function(i) { return i.name; }).join(',') + '];');\n }\n return result.join('');\n },\n\n generateFunction: function(name, params) {\n return 'function(' + params + '){' +\n this.varsPrefix(name) +\n this.body(name) +\n '};';\n },\n\n filterPrefix: function() {\n var parts = [];\n var self = this;\n forEach(this.state.filters, function(id, filter) {\n parts.push(id + '=$filter(' + self.escape(filter) + ')');\n });\n if (parts.length) return 'var ' + parts.join(',') + ';';\n return '';\n },\n\n varsPrefix: function(section) {\n return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';\n },\n\n body: function(section) {\n return this.state[section].body.join('');\n },\n\n recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var left, right, self = this, args, expression, computed;\n recursionFn = recursionFn || noop;\n if (!skipWatchIdCheck && isDefined(ast.watchId)) {\n intoId = intoId || this.nextId();\n this.if_('i',\n this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),\n this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)\n );\n return;\n }\n switch (ast.type) {\n case AST.Program:\n forEach(ast.body, function(expression, pos) {\n self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });\n if (pos !== ast.body.length - 1) {\n self.current().body.push(right, ';');\n } else {\n self.return_(right);\n }\n });\n break;\n case AST.Literal:\n expression = this.escape(ast.value);\n this.assign(intoId, expression);\n recursionFn(intoId || expression);\n break;\n case AST.UnaryExpression:\n this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });\n expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.BinaryExpression:\n this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });\n this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });\n if (ast.operator === '+') {\n expression = this.plus(left, right);\n } else if (ast.operator === '-') {\n expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);\n } else {\n expression = '(' + left + ')' + ast.operator + '(' + right + ')';\n }\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.LogicalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.left, intoId);\n self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));\n recursionFn(intoId);\n break;\n case AST.ConditionalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.test, intoId);\n self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));\n recursionFn(intoId);\n break;\n case AST.Identifier:\n intoId = intoId || this.nextId();\n if (nameId) {\n nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');\n nameId.computed = false;\n nameId.name = ast.name;\n }\n self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),\n function() {\n self.if_(self.stage === 'inputs' || 's', function() {\n if (create && create !== 1) {\n self.if_(\n self.isNull(self.nonComputedMember('s', ast.name)),\n self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));\n }\n self.assign(intoId, self.nonComputedMember('s', ast.name));\n });\n }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))\n );\n recursionFn(intoId);\n break;\n case AST.MemberExpression:\n left = nameId && (nameId.context = this.nextId()) || this.nextId();\n intoId = intoId || this.nextId();\n self.recurse(ast.object, left, undefined, function() {\n self.if_(self.notNull(left), function() {\n if (ast.computed) {\n right = self.nextId();\n self.recurse(ast.property, right);\n self.getStringValue(right);\n if (create && create !== 1) {\n self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));\n }\n expression = self.computedMember(left, right);\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = true;\n nameId.name = right;\n }\n } else {\n if (create && create !== 1) {\n self.if_(self.isNull(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));\n }\n expression = self.nonComputedMember(left, ast.property.name);\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = false;\n nameId.name = ast.property.name;\n }\n }\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n }, !!create);\n break;\n case AST.CallExpression:\n intoId = intoId || this.nextId();\n if (ast.filter) {\n right = self.filter(ast.callee.name);\n args = [];\n forEach(ast.arguments, function(expr) {\n var argument = self.nextId();\n self.recurse(expr, argument);\n args.push(argument);\n });\n expression = right + '(' + args.join(',') + ')';\n self.assign(intoId, expression);\n recursionFn(intoId);\n } else {\n right = self.nextId();\n left = {};\n args = [];\n self.recurse(ast.callee, right, left, function() {\n self.if_(self.notNull(right), function() {\n forEach(ast.arguments, function(expr) {\n self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {\n args.push(argument);\n });\n });\n if (left.name) {\n expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';\n } else {\n expression = right + '(' + args.join(',') + ')';\n }\n self.assign(intoId, expression);\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n });\n }\n break;\n case AST.AssignmentExpression:\n right = this.nextId();\n left = {};\n this.recurse(ast.left, undefined, left, function() {\n self.if_(self.notNull(left.context), function() {\n self.recurse(ast.right, right);\n expression = self.member(left.context, left.name, left.computed) + ast.operator + right;\n self.assign(intoId, expression);\n recursionFn(intoId || expression);\n });\n }, 1);\n break;\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {\n args.push(argument);\n });\n });\n expression = '[' + args.join(',') + ']';\n this.assign(intoId, expression);\n recursionFn(intoId || expression);\n break;\n case AST.ObjectExpression:\n args = [];\n computed = false;\n forEach(ast.properties, function(property) {\n if (property.computed) {\n computed = true;\n }\n });\n if (computed) {\n intoId = intoId || this.nextId();\n this.assign(intoId, '{}');\n forEach(ast.properties, function(property) {\n if (property.computed) {\n left = self.nextId();\n self.recurse(property.key, left);\n } else {\n left = property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value);\n }\n right = self.nextId();\n self.recurse(property.value, right);\n self.assign(self.member(intoId, left, property.computed), right);\n });\n } else {\n forEach(ast.properties, function(property) {\n self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function(expr) {\n args.push(self.escape(\n property.key.type === AST.Identifier ? property.key.name :\n ('' + property.key.value)) +\n ':' + expr);\n });\n });\n expression = '{' + args.join(',') + '}';\n this.assign(intoId, expression);\n }\n recursionFn(intoId || expression);\n break;\n case AST.ThisExpression:\n this.assign(intoId, 's');\n recursionFn(intoId || 's');\n break;\n case AST.LocalsExpression:\n this.assign(intoId, 'l');\n recursionFn(intoId || 'l');\n break;\n case AST.NGValueParameter:\n this.assign(intoId, 'v');\n recursionFn(intoId || 'v');\n break;\n }\n },\n\n getHasOwnProperty: function(element, property) {\n var key = element + '.' + property;\n var own = this.current().own;\n if (!own.hasOwnProperty(key)) {\n own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');\n }\n return own[key];\n },\n\n assign: function(id, value) {\n if (!id) return;\n this.current().body.push(id, '=', value, ';');\n return id;\n },\n\n filter: function(filterName) {\n if (!this.state.filters.hasOwnProperty(filterName)) {\n this.state.filters[filterName] = this.nextId(true);\n }\n return this.state.filters[filterName];\n },\n\n ifDefined: function(id, defaultValue) {\n return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';\n },\n\n plus: function(left, right) {\n return 'plus(' + left + ',' + right + ')';\n },\n\n return_: function(id) {\n this.current().body.push('return ', id, ';');\n },\n\n if_: function(test, alternate, consequent) {\n if (test === true) {\n alternate();\n } else {\n var body = this.current().body;\n body.push('if(', test, '){');\n alternate();\n body.push('}');\n if (consequent) {\n body.push('else{');\n consequent();\n body.push('}');\n }\n }\n },\n\n not: function(expression) {\n return '!(' + expression + ')';\n },\n\n isNull: function(expression) {\n return expression + '==null';\n },\n\n notNull: function(expression) {\n return expression + '!=null';\n },\n\n nonComputedMember: function(left, right) {\n var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;\n var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;\n if (SAFE_IDENTIFIER.test(right)) {\n return left + '.' + right;\n } else {\n return left + '[\"' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '\"]';\n }\n },\n\n computedMember: function(left, right) {\n return left + '[' + right + ']';\n },\n\n member: function(left, right, computed) {\n if (computed) return this.computedMember(left, right);\n return this.nonComputedMember(left, right);\n },\n\n getStringValue: function(item) {\n this.assign(item, 'getStringValue(' + item + ')');\n },\n\n lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var self = this;\n return function() {\n self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);\n };\n },\n\n lazyAssign: function(id, value) {\n var self = this;\n return function() {\n self.assign(id, value);\n };\n },\n\n stringEscapeRegex: /[^ a-zA-Z0-9]/g,\n\n stringEscapeFn: function(c) {\n return '\\\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);\n },\n\n escape: function(value) {\n if (isString(value)) return '\\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\\'';\n if (isNumber(value)) return value.toString();\n if (value === true) return 'true';\n if (value === false) return 'false';\n if (value === null) return 'null';\n if (typeof value === 'undefined') return 'undefined';\n\n throw $parseMinErr('esc', 'IMPOSSIBLE');\n },\n\n nextId: function(skip, init) {\n var id = 'v' + (this.state.nextId++);\n if (!skip) {\n this.current().vars.push(id + (init ? '=' + init : ''));\n }\n return id;\n },\n\n current: function() {\n return this.state[this.state.computing];\n }\n};\n\n\nfunction ASTInterpreter($filter) {\n this.$filter = $filter;\n}\n\nASTInterpreter.prototype = {\n compile: function(ast) {\n var self = this;\n findConstantAndWatchExpressions(ast, self.$filter);\n var assignable;\n var assign;\n if ((assignable = assignableAST(ast))) {\n assign = this.recurse(assignable);\n }\n var toWatch = getInputs(ast.body);\n var inputs;\n if (toWatch) {\n inputs = [];\n forEach(toWatch, function(watch, key) {\n var input = self.recurse(watch);\n input.isPure = watch.isPure;\n watch.input = input;\n inputs.push(input);\n watch.watchId = key;\n });\n }\n var expressions = [];\n forEach(ast.body, function(expression) {\n expressions.push(self.recurse(expression.expression));\n });\n var fn = ast.body.length === 0 ? noop :\n ast.body.length === 1 ? expressions[0] :\n function(scope, locals) {\n var lastValue;\n forEach(expressions, function(exp) {\n lastValue = exp(scope, locals);\n });\n return lastValue;\n };\n if (assign) {\n fn.assign = function(scope, value, locals) {\n return assign(scope, locals, value);\n };\n }\n if (inputs) {\n fn.inputs = inputs;\n }\n return fn;\n },\n\n recurse: function(ast, context, create) {\n var left, right, self = this, args;\n if (ast.input) {\n return this.inputs(ast.input, ast.watchId);\n }\n switch (ast.type) {\n case AST.Literal:\n return this.value(ast.value, context);\n case AST.UnaryExpression:\n right = this.recurse(ast.argument);\n return this['unary' + ast.operator](right, context);\n case AST.BinaryExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.LogicalExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.ConditionalExpression:\n return this['ternary?:'](\n this.recurse(ast.test),\n this.recurse(ast.alternate),\n this.recurse(ast.consequent),\n context\n );\n case AST.Identifier:\n return self.identifier(ast.name, context, create);\n case AST.MemberExpression:\n left = this.recurse(ast.object, false, !!create);\n if (!ast.computed) {\n right = ast.property.name;\n }\n if (ast.computed) right = this.recurse(ast.property);\n return ast.computed ?\n this.computedMember(left, right, context, create) :\n this.nonComputedMember(left, right, context, create);\n case AST.CallExpression:\n args = [];\n forEach(ast.arguments, function(expr) {\n args.push(self.recurse(expr));\n });\n if (ast.filter) right = this.$filter(ast.callee.name);\n if (!ast.filter) right = this.recurse(ast.callee, true);\n return ast.filter ?\n function(scope, locals, assign, inputs) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n var value = right.apply(undefined, values, inputs);\n return context ? {context: undefined, name: undefined, value: value} : value;\n } :\n function(scope, locals, assign, inputs) {\n var rhs = right(scope, locals, assign, inputs);\n var value;\n if (rhs.value != null) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n value = rhs.value.apply(rhs.context, values);\n }\n return context ? {value: value} : value;\n };\n case AST.AssignmentExpression:\n left = this.recurse(ast.left, true, 1);\n right = this.recurse(ast.right);\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n lhs.context[lhs.name] = rhs;\n return context ? {value: rhs} : rhs;\n };\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n args.push(self.recurse(expr));\n });\n return function(scope, locals, assign, inputs) {\n var value = [];\n for (var i = 0; i < args.length; ++i) {\n value.push(args[i](scope, locals, assign, inputs));\n }\n return context ? {value: value} : value;\n };\n case AST.ObjectExpression:\n args = [];\n forEach(ast.properties, function(property) {\n if (property.computed) {\n args.push({key: self.recurse(property.key),\n computed: true,\n value: self.recurse(property.value)\n });\n } else {\n args.push({key: property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value),\n computed: false,\n value: self.recurse(property.value)\n });\n }\n });\n return function(scope, locals, assign, inputs) {\n var value = {};\n for (var i = 0; i < args.length; ++i) {\n if (args[i].computed) {\n value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);\n } else {\n value[args[i].key] = args[i].value(scope, locals, assign, inputs);\n }\n }\n return context ? {value: value} : value;\n };\n case AST.ThisExpression:\n return function(scope) {\n return context ? {value: scope} : scope;\n };\n case AST.LocalsExpression:\n return function(scope, locals) {\n return context ? {value: locals} : locals;\n };\n case AST.NGValueParameter:\n return function(scope, locals, assign) {\n return context ? {value: assign} : assign;\n };\n }\n },\n\n 'unary+': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = +arg;\n } else {\n arg = 0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary-': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = -arg;\n } else {\n arg = -0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary!': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = !argument(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary+': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = plusFn(lhs, rhs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary-': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);\n return context ? {value: arg} : arg;\n };\n },\n 'binary*': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary/': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary%': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary===': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n // eslint-disable-next-line eqeqeq\n var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n // eslint-disable-next-line eqeqeq\n var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary&&': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary||': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'ternary?:': function(test, alternate, consequent, context) {\n return function(scope, locals, assign, inputs) {\n var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n value: function(value, context) {\n return function() { return context ? {context: undefined, name: undefined, value: value} : value; };\n },\n identifier: function(name, context, create) {\n return function(scope, locals, assign, inputs) {\n var base = locals && (name in locals) ? locals : scope;\n if (create && create !== 1 && base && base[name] == null) {\n base[name] = {};\n }\n var value = base ? base[name] : undefined;\n if (context) {\n return {context: base, name: name, value: value};\n } else {\n return value;\n }\n };\n },\n computedMember: function(left, right, context, create) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs;\n var value;\n if (lhs != null) {\n rhs = right(scope, locals, assign, inputs);\n rhs = getStringValue(rhs);\n if (create && create !== 1) {\n if (lhs && !(lhs[rhs])) {\n lhs[rhs] = {};\n }\n }\n value = lhs[rhs];\n }\n if (context) {\n return {context: lhs, name: rhs, value: value};\n } else {\n return value;\n }\n };\n },\n nonComputedMember: function(left, right, context, create) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n if (create && create !== 1) {\n if (lhs && lhs[right] == null) {\n lhs[right] = {};\n }\n }\n var value = lhs != null ? lhs[right] : undefined;\n if (context) {\n return {context: lhs, name: right, value: value};\n } else {\n return value;\n }\n };\n },\n inputs: function(input, watchId) {\n return function(scope, value, locals, inputs) {\n if (inputs) return inputs[watchId];\n return input(scope, value, locals);\n };\n }\n};\n\n/**\n * @constructor\n */\nfunction Parser(lexer, $filter, options) {\n this.ast = new AST(lexer, options);\n this.astCompiler = options.csp ? new ASTInterpreter($filter) :\n new ASTCompiler($filter);\n}\n\nParser.prototype = {\n constructor: Parser,\n\n parse: function(text) {\n var ast = this.ast.ast(text);\n var fn = this.astCompiler.compile(ast);\n fn.literal = isLiteral(ast);\n fn.constant = isConstant(ast);\n return fn;\n }\n};\n\nfunction getValueOf(value) {\n return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * ```js\n * var getter = $parse('user.name');\n * var setter = getter.assign;\n * var context = {user:{name:'angular'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('angular');\n * setter(context, 'newValue');\n * expect(context.user.name).toEqual('newValue');\n * expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n *\n * The returned function also has the following properties:\n * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n * literal.\n * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n * constant literals.\n * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n * set to a function to change its value on the given context.\n *\n */\n\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n * @this\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n * service.\n */\nfunction $ParseProvider() {\n var cache = createMap();\n var literals = {\n 'true': true,\n 'false': false,\n 'null': null,\n 'undefined': undefined\n };\n var identStart, identContinue;\n\n /**\n * @ngdoc method\n * @name $parseProvider#addLiteral\n * @description\n *\n * Configure $parse service to add literal values that will be present as literal at expressions.\n *\n * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.\n * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.\n *\n **/\n this.addLiteral = function(literalName, literalValue) {\n literals[literalName] = literalValue;\n };\n\n /**\n * @ngdoc method\n * @name $parseProvider#setIdentifierFns\n *\n * @description\n *\n * Allows defining the set of characters that are allowed in Angular expressions. The function\n * `identifierStart` will get called to know if a given character is a valid character to be the\n * first character for an identifier. The function `identifierContinue` will get called to know if\n * a given character is a valid character to be a follow-up identifier character. The functions\n * `identifierStart` and `identifierContinue` will receive as arguments the single character to be\n * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in\n * mind that the `string` parameter can be two characters long depending on the character\n * representation. It is expected for the function to return `true` or `false`, whether that\n * character is allowed or not.\n *\n * Since this function will be called extensively, keep the implementation of these functions fast,\n * as the performance of these functions have a direct impact on the expressions parsing speed.\n *\n * @param {function=} identifierStart The function that will decide whether the given character is\n * a valid identifier start character.\n * @param {function=} identifierContinue The function that will decide whether the given character is\n * a valid identifier continue character.\n */\n this.setIdentifierFns = function(identifierStart, identifierContinue) {\n identStart = identifierStart;\n identContinue = identifierContinue;\n return this;\n };\n\n this.$get = ['$filter', function($filter) {\n var noUnsafeEval = csp().noUnsafeEval;\n var $parseOptions = {\n csp: noUnsafeEval,\n literals: copy(literals),\n isIdentifierStart: isFunction(identStart) && identStart,\n isIdentifierContinue: isFunction(identContinue) && identContinue\n };\n return $parse;\n\n function $parse(exp, interceptorFn) {\n var parsedExpression, oneTime, cacheKey;\n\n switch (typeof exp) {\n case 'string':\n exp = exp.trim();\n cacheKey = exp;\n\n parsedExpression = cache[cacheKey];\n\n if (!parsedExpression) {\n if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n oneTime = true;\n exp = exp.substring(2);\n }\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n parsedExpression = parser.parse(exp);\n if (parsedExpression.constant) {\n parsedExpression.$$watchDelegate = constantWatchDelegate;\n } else if (oneTime) {\n parsedExpression.$$watchDelegate = parsedExpression.literal ?\n oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;\n } else if (parsedExpression.inputs) {\n parsedExpression.$$watchDelegate = inputsWatchDelegate;\n }\n cache[cacheKey] = parsedExpression;\n }\n return addInterceptor(parsedExpression, interceptorFn);\n\n case 'function':\n return addInterceptor(exp, interceptorFn);\n\n default:\n return addInterceptor(noop, interceptorFn);\n }\n }\n\n function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) {\n\n if (newValue == null || oldValueOfValue == null) { // null/undefined\n return newValue === oldValueOfValue;\n }\n\n if (typeof newValue === 'object') {\n\n // attempt to convert the value to a primitive type\n // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n // be cheaply dirty-checked\n newValue = getValueOf(newValue);\n\n if (typeof newValue === 'object' && !compareObjectIdentity) {\n // objects/arrays are not supported - deep-watching them would be too expensive\n return false;\n }\n\n // fall-through to the primitive equality check\n }\n\n //Primitive or NaN\n // eslint-disable-next-line no-self-compare\n return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);\n }\n\n function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var inputExpressions = parsedExpression.inputs;\n var lastResult;\n\n if (inputExpressions.length === 1) {\n var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails\n inputExpressions = inputExpressions[0];\n return scope.$watch(function expressionInputWatch(scope) {\n var newInputValue = inputExpressions(scope);\n if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf, inputExpressions.isPure)) {\n lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);\n oldInputValueOf = newInputValue && getValueOf(newInputValue);\n }\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n var oldInputValueOfValues = [];\n var oldInputValues = [];\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n oldInputValues[i] = null;\n }\n\n return scope.$watch(function expressionInputsWatch(scope) {\n var changed = false;\n\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n var newInputValue = inputExpressions[i](scope);\n if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i], inputExpressions[i].isPure))) {\n oldInputValues[i] = newInputValue;\n oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n }\n }\n\n if (changed) {\n lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);\n }\n\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var unwatch, lastValue;\n if (parsedExpression.inputs) {\n unwatch = inputsWatchDelegate(scope, oneTimeListener, objectEquality, parsedExpression, prettyPrintExpression);\n } else {\n unwatch = scope.$watch(oneTimeWatch, oneTimeListener, objectEquality);\n }\n return unwatch;\n\n function oneTimeWatch(scope) {\n return parsedExpression(scope);\n }\n function oneTimeListener(value, old, scope) {\n lastValue = value;\n if (isFunction(listener)) {\n listener(value, old, scope);\n }\n if (isDefined(value)) {\n scope.$$postDigest(function() {\n if (isDefined(lastValue)) {\n unwatch();\n }\n });\n }\n }\n }\n\n function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch, lastValue;\n unwatch = scope.$watch(function oneTimeWatch(scope) {\n return parsedExpression(scope);\n }, function oneTimeListener(value, old, scope) {\n lastValue = value;\n if (isFunction(listener)) {\n listener(value, old, scope);\n }\n if (isAllDefined(value)) {\n scope.$$postDigest(function() {\n if (isAllDefined(lastValue)) unwatch();\n });\n }\n }, objectEquality);\n\n return unwatch;\n\n function isAllDefined(value) {\n var allDefined = true;\n forEach(value, function(val) {\n if (!isDefined(val)) allDefined = false;\n });\n return allDefined;\n }\n }\n\n function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch = scope.$watch(function constantWatch(scope) {\n unwatch();\n return parsedExpression(scope);\n }, listener, objectEquality);\n return unwatch;\n }\n\n function addInterceptor(parsedExpression, interceptorFn) {\n if (!interceptorFn) return parsedExpression;\n var watchDelegate = parsedExpression.$$watchDelegate;\n var useInputs = false;\n\n var regularWatch =\n watchDelegate !== oneTimeLiteralWatchDelegate &&\n watchDelegate !== oneTimeWatchDelegate;\n\n var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) {\n var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);\n return interceptorFn(value, scope, locals);\n } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) {\n var value = parsedExpression(scope, locals, assign, inputs);\n var result = interceptorFn(value, scope, locals);\n // we only return the interceptor's result if the\n // initial value is defined (for bind-once)\n return isDefined(value) ? result : value;\n };\n\n // Propagate $$watchDelegates other then inputsWatchDelegate\n useInputs = !parsedExpression.inputs;\n if (watchDelegate && watchDelegate !== inputsWatchDelegate) {\n fn.$$watchDelegate = watchDelegate;\n fn.inputs = parsedExpression.inputs;\n } else if (!interceptorFn.$stateful) {\n // Treat interceptor like filters - assume non-stateful by default and use the inputsWatchDelegate\n fn.$$watchDelegate = inputsWatchDelegate;\n fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];\n }\n\n if (fn.inputs) {\n fn.inputs = fn.inputs.map(function(e) {\n // Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a\n // potentially non-pure interceptor function.\n if (e.isPure === PURITY_RELATIVE) {\n return function depurifier(s) { return e(s); };\n }\n return e;\n });\n }\n\n return fn;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is a [Promises/A+](https://promisesaplus.com/)-compliant implementation of promises/deferred\n * objects inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 (ES2015) promises to some degree.\n *\n * # $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * // perform some asynchronous operation, resolve or reject the promise when appropriate.\n * return $q(function(resolve, reject) {\n * setTimeout(function() {\n * if (okToGreet(name)) {\n * resolve('Hello, ' + name + '!');\n * } else {\n * reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n * });\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * var deferred = $q.defer();\n *\n * setTimeout(function() {\n * deferred.notify('About to greet ' + name + '.');\n *\n * if (okToGreet(name)) {\n * deferred.resolve('Hello, ' + name + '!');\n * } else {\n * deferred.reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n *\n * return deferred.promise;\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * }, function(update) {\n * alert('Got notification: ' + update);\n * });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * # The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n * constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n * resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n * multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * # The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or\n * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n * as soon as the result is available. The callbacks are called with a single argument: the result\n * or rejection reason. Additionally, the notify callback may be called zero or more times to\n * provide a progress indication, before the promise is resolved or rejected.\n *\n * This method *returns a new promise* which is resolved or rejected via the return value of the\n * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved\n * with the value which is resolved in that promise using\n * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).\n * It also notifies via the return value of the `notifyCallback` method. The promise cannot be\n * resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback\n * arguments are optional.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n * but to do so without modifying the final value. This is useful to release resources or do some\n * clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n * more information.\n *\n * # Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * return result + 1;\n * });\n *\n * // promiseB will be resolved immediately after promiseA is resolved and its value\n * // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * # Differences between Kris Kowal's Q and $q\n *\n * There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n * mechanism in angular, which means faster propagation of resolution or rejection into your\n * models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n * all the important functionality needed for common async tasks.\n *\n * # Testing\n *\n * ```js\n * it('should simulate promise', inject(function($q, $rootScope) {\n * var deferred = $q.defer();\n * var promise = deferred.promise;\n * var resolvedValue;\n *\n * promise.then(function(value) { resolvedValue = value; });\n * expect(resolvedValue).toBeUndefined();\n *\n * // Simulate resolving of promise\n * deferred.resolve(123);\n * // Note that the 'then' function does not get called synchronously.\n * // This is because we want the promise API to always be async, whether or not\n * // it got called synchronously or asynchronously.\n * expect(resolvedValue).toBeUndefined();\n *\n * // Propagate promise resolution to 'then' functions using $apply().\n * $rootScope.$apply();\n * expect(resolvedValue).toEqual(123);\n * }));\n * ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n * rejecting the newly created promise. The first parameter is a function which resolves the\n * promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\n/**\n * @ngdoc provider\n * @name $qProvider\n * @this\n *\n * @description\n */\nfunction $QProvider() {\n var errorOnUnhandledRejections = true;\n this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {\n return qFactory(function(callback) {\n $rootScope.$evalAsync(callback);\n }, $exceptionHandler, errorOnUnhandledRejections);\n }];\n\n /**\n * @ngdoc method\n * @name $qProvider#errorOnUnhandledRejections\n * @kind function\n *\n * @description\n * Retrieves or overrides whether to generate an error when a rejected promise is not handled.\n * This feature is enabled by default.\n *\n * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.\n * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for\n * chaining otherwise.\n */\n this.errorOnUnhandledRejections = function(value) {\n if (isDefined(value)) {\n errorOnUnhandledRejections = value;\n return this;\n } else {\n return errorOnUnhandledRejections;\n }\n };\n}\n\n/** @this */\nfunction $$QProvider() {\n var errorOnUnhandledRejections = true;\n this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {\n return qFactory(function(callback) {\n $browser.defer(callback);\n }, $exceptionHandler, errorOnUnhandledRejections);\n }];\n\n this.errorOnUnhandledRejections = function(value) {\n if (isDefined(value)) {\n errorOnUnhandledRejections = value;\n return this;\n } else {\n return errorOnUnhandledRejections;\n }\n };\n}\n\n/**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n * debugging purposes.\n * @param {boolean=} errorOnUnhandledRejections Whether an error should be generated on unhandled\n * promises rejections.\n * @returns {object} Promise manager.\n */\nfunction qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {\n var $qMinErr = minErr('$q', TypeError);\n var queueSize = 0;\n var checkQueue = [];\n\n /**\n * @ngdoc method\n * @name ng.$q#defer\n * @kind function\n *\n * @description\n * Creates a `Deferred` object which represents a task which will finish in the future.\n *\n * @returns {Deferred} Returns a new instance of deferred.\n */\n function defer() {\n return new Deferred();\n }\n\n function Deferred() {\n var promise = this.promise = new Promise();\n //Non prototype methods necessary to support unbound execution :/\n this.resolve = function(val) { resolvePromise(promise, val); };\n this.reject = function(reason) { rejectPromise(promise, reason); };\n this.notify = function(progress) { notifyPromise(promise, progress); };\n }\n\n\n function Promise() {\n this.$$state = { status: 0 };\n }\n\n extend(Promise.prototype, {\n then: function(onFulfilled, onRejected, progressBack) {\n if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {\n return this;\n }\n var result = new Promise();\n\n this.$$state.pending = this.$$state.pending || [];\n this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n\n return result;\n },\n\n 'catch': function(callback) {\n return this.then(null, callback);\n },\n\n 'finally': function(callback, progressBack) {\n return this.then(function(value) {\n return handleCallback(value, resolve, callback);\n }, function(error) {\n return handleCallback(error, reject, callback);\n }, progressBack);\n }\n });\n\n function processQueue(state) {\n var fn, promise, pending;\n\n pending = state.pending;\n state.processScheduled = false;\n state.pending = undefined;\n try {\n for (var i = 0, ii = pending.length; i < ii; ++i) {\n markQStateExceptionHandled(state);\n promise = pending[i][0];\n fn = pending[i][state.status];\n try {\n if (isFunction(fn)) {\n resolvePromise(promise, fn(state.value));\n } else if (state.status === 1) {\n resolvePromise(promise, state.value);\n } else {\n rejectPromise(promise, state.value);\n }\n } catch (e) {\n rejectPromise(promise, e);\n }\n }\n } finally {\n --queueSize;\n if (errorOnUnhandledRejections && queueSize === 0) {\n nextTick(processChecks);\n }\n }\n }\n\n function processChecks() {\n // eslint-disable-next-line no-unmodified-loop-condition\n while (!queueSize && checkQueue.length) {\n var toCheck = checkQueue.shift();\n if (!isStateExceptionHandled(toCheck)) {\n markQStateExceptionHandled(toCheck);\n var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);\n if (isError(toCheck.value)) {\n exceptionHandler(toCheck.value, errorMessage);\n } else {\n exceptionHandler(errorMessage);\n }\n }\n }\n }\n\n function scheduleProcessQueue(state) {\n if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !isStateExceptionHandled(state)) {\n if (queueSize === 0 && checkQueue.length === 0) {\n nextTick(processChecks);\n }\n checkQueue.push(state);\n }\n if (state.processScheduled || !state.pending) return;\n state.processScheduled = true;\n ++queueSize;\n nextTick(function() { processQueue(state); });\n }\n\n function resolvePromise(promise, val) {\n if (promise.$$state.status) return;\n if (val === promise) {\n $$reject(promise, $qMinErr(\n 'qcycle',\n 'Expected promise to be resolved with value other than itself \\'{0}\\'',\n val));\n } else {\n $$resolve(promise, val);\n }\n\n }\n\n function $$resolve(promise, val) {\n var then;\n var done = false;\n try {\n if (isObject(val) || isFunction(val)) then = val.then;\n if (isFunction(then)) {\n promise.$$state.status = -1;\n then.call(val, doResolve, doReject, doNotify);\n } else {\n promise.$$state.value = val;\n promise.$$state.status = 1;\n scheduleProcessQueue(promise.$$state);\n }\n } catch (e) {\n doReject(e);\n }\n\n function doResolve(val) {\n if (done) return;\n done = true;\n $$resolve(promise, val);\n }\n function doReject(val) {\n if (done) return;\n done = true;\n $$reject(promise, val);\n }\n function doNotify(progress) {\n notifyPromise(promise, progress);\n }\n }\n\n function rejectPromise(promise, reason) {\n if (promise.$$state.status) return;\n $$reject(promise, reason);\n }\n\n function $$reject(promise, reason) {\n promise.$$state.value = reason;\n promise.$$state.status = 2;\n scheduleProcessQueue(promise.$$state);\n }\n\n function notifyPromise(promise, progress) {\n var callbacks = promise.$$state.pending;\n\n if ((promise.$$state.status <= 0) && callbacks && callbacks.length) {\n nextTick(function() {\n var callback, result;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n result = callbacks[i][0];\n callback = callbacks[i][3];\n try {\n notifyPromise(result, isFunction(callback) ? callback(progress) : progress);\n } catch (e) {\n exceptionHandler(e);\n }\n }\n });\n }\n }\n\n /**\n * @ngdoc method\n * @name $q#reject\n * @kind function\n *\n * @description\n * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n * a promise chain, you don't need to worry about it.\n *\n * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n * a promise error callback and you want to forward the error to the promise derived from the\n * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n * `reject`.\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * // success: do something and resolve promiseB\n * // with the old or a new result\n * return result;\n * }, function(reason) {\n * // error: handle the error if possible and\n * // resolve promiseB with newPromiseOrValue,\n * // otherwise forward the rejection to promiseB\n * if (canHandle(reason)) {\n * // handle the error and recover\n * return newPromiseOrValue;\n * }\n * return $q.reject(reason);\n * });\n * ```\n *\n * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n */\n function reject(reason) {\n var result = new Promise();\n rejectPromise(result, reason);\n return result;\n }\n\n function handleCallback(value, resolver, callback) {\n var callbackOutput = null;\n try {\n if (isFunction(callback)) callbackOutput = callback();\n } catch (e) {\n return reject(e);\n }\n if (isPromiseLike(callbackOutput)) {\n return callbackOutput.then(function() {\n return resolver(value);\n }, reject);\n } else {\n return resolver(value);\n }\n }\n\n /**\n * @ngdoc method\n * @name $q#when\n * @kind function\n *\n * @description\n * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n * This is useful when you are dealing with an object that might or might not be a promise, or if\n * the promise comes from a source that can't be trusted.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n\n\n function when(value, callback, errback, progressBack) {\n var result = new Promise();\n resolvePromise(result, value);\n return result.then(callback, errback, progressBack);\n }\n\n /**\n * @ngdoc method\n * @name $q#resolve\n * @kind function\n *\n * @description\n * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n var resolve = when;\n\n /**\n * @ngdoc method\n * @name $q#all\n * @kind function\n *\n * @description\n * Combines multiple promises into a single promise that is resolved when all of the input\n * promises are resolved.\n *\n * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.\n * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n * each value corresponding to the promise at the same index/key in the `promises` array/hash.\n * If any of the promises is resolved with a rejection, this resulting promise will be rejected\n * with the same rejection value.\n */\n\n function all(promises) {\n var result = new Promise(),\n counter = 0,\n results = isArray(promises) ? [] : {};\n\n forEach(promises, function(promise, key) {\n counter++;\n when(promise).then(function(value) {\n results[key] = value;\n if (!(--counter)) resolvePromise(result, results);\n }, function(reason) {\n rejectPromise(result, reason);\n });\n });\n\n if (counter === 0) {\n resolvePromise(result, results);\n }\n\n return result;\n }\n\n /**\n * @ngdoc method\n * @name $q#race\n * @kind function\n *\n * @description\n * Returns a promise that resolves or rejects as soon as one of those promises\n * resolves or rejects, with the value or reason from that promise.\n *\n * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.\n * @returns {Promise} a promise that resolves or rejects as soon as one of the `promises`\n * resolves or rejects, with the value or reason from that promise.\n */\n\n function race(promises) {\n var deferred = defer();\n\n forEach(promises, function(promise) {\n when(promise).then(deferred.resolve, deferred.reject);\n });\n\n return deferred.promise;\n }\n\n function $Q(resolver) {\n if (!isFunction(resolver)) {\n throw $qMinErr('norslvr', 'Expected resolverFn, got \\'{0}\\'', resolver);\n }\n\n var promise = new Promise();\n\n function resolveFn(value) {\n resolvePromise(promise, value);\n }\n\n function rejectFn(reason) {\n rejectPromise(promise, reason);\n }\n\n resolver(resolveFn, rejectFn);\n\n return promise;\n }\n\n // Let's make the instanceof operator work for promises, so that\n // `new $q(fn) instanceof $q` would evaluate to true.\n $Q.prototype = Promise.prototype;\n\n $Q.defer = defer;\n $Q.reject = reject;\n $Q.when = when;\n $Q.resolve = resolve;\n $Q.all = all;\n $Q.race = race;\n\n return $Q;\n}\n\nfunction isStateExceptionHandled(state) {\n return !!state.pur;\n}\nfunction markQStateExceptionHandled(state) {\n state.pur = true;\n}\nfunction markQExceptionHandled(q) {\n markQStateExceptionHandled(q.$$state);\n}\n\n/** @this */\nfunction $$RAFProvider() { //rAF\n this.$get = ['$window', '$timeout', function($window, $timeout) {\n var requestAnimationFrame = $window.requestAnimationFrame ||\n $window.webkitRequestAnimationFrame;\n\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\n $window.webkitCancelAnimationFrame ||\n $window.webkitCancelRequestAnimationFrame;\n\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported\n ? function(fn) {\n var id = requestAnimationFrame(fn);\n return function() {\n cancelAnimationFrame(id);\n };\n }\n : function(fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function() {\n $timeout.cancel(timer);\n };\n };\n\n raf.supported = rafSupported;\n\n return raf;\n }];\n}\n\n/**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n * - No closures, instead use prototypical inheritance for API\n * - Internal state needs to be stored on scope directly, which means that private state is\n * exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n * - This means that in order to keep the same order of execution as addition we have to add\n * items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists\n *\n * There are fewer watches than observers. This is why you don't want the observer to be implemented\n * in the same way as watch. Watch requires return of the initialization function which is expensive\n * to construct.\n */\n\n\n/**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n\n/**\n * @ngdoc service\n * @name $rootScope\n * @this\n *\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\nfunction $RootScopeProvider() {\n var TTL = 10;\n var $rootScopeMinErr = minErr('$rootScope');\n var lastDirtyWatch = null;\n var applyAsyncId = null;\n\n this.digestTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n }\n return TTL;\n };\n\n function createChildScopeClass(parent) {\n function ChildScope() {\n this.$$watchers = this.$$nextSibling =\n this.$$childHead = this.$$childTail = null;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$id = nextUid();\n this.$$ChildScope = null;\n }\n ChildScope.prototype = parent;\n return ChildScope;\n }\n\n this.$get = ['$exceptionHandler', '$parse', '$browser',\n function($exceptionHandler, $parse, $browser) {\n\n function destroyChildScope($event) {\n $event.currentScope.$$destroyed = true;\n }\n\n function cleanUpScope($scope) {\n\n // Support: IE 9 only\n if (msie === 9) {\n // There is a memory leak in IE9 if all child scopes are not disconnected\n // completely when a scope is destroyed. So this code will recurse up through\n // all this scopes children\n //\n // See issue https://github.com/angular/angular.js/issues/10706\n if ($scope.$$childHead) {\n cleanUpScope($scope.$$childHead);\n }\n if ($scope.$$nextSibling) {\n cleanUpScope($scope.$$nextSibling);\n }\n }\n\n // The code below works around IE9 and V8's memory leaks\n //\n // See:\n // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead =\n $scope.$$childTail = $scope.$root = $scope.$$watchers = null;\n }\n\n /**\n * @ngdoc type\n * @name $rootScope.Scope\n *\n * @description\n * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n * {@link auto.$injector $injector}. Child scopes are created using the\n * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for\n * an in-depth introduction and usage examples.\n *\n *\n * # Inheritance\n * A scope can inherit from a parent scope, as in this example:\n * ```js\n var parent = $rootScope;\n var child = parent.$new();\n\n parent.salutation = \"Hello\";\n expect(child.salutation).toEqual('Hello');\n\n child.salutation = \"Welcome\";\n expect(child.salutation).toEqual('Welcome');\n expect(parent.salutation).toEqual('Hello');\n * ```\n *\n * When interacting with `Scope` in tests, additional helper methods are available on the\n * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n * details.\n *\n *\n * @param {Object.<string, function()>=} providers Map of service factory which need to be\n * provided for the current scope. Defaults to {@link ng}.\n * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should\n * append/override services provided by `providers`. This is handy\n * when unit-testing and having the need to override a default\n * service.\n * @returns {Object} Newly created scope.\n *\n */\n function Scope() {\n this.$id = nextUid();\n this.$$phase = this.$parent = this.$$watchers =\n this.$$nextSibling = this.$$prevSibling =\n this.$$childHead = this.$$childTail = null;\n this.$root = this;\n this.$$destroyed = false;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$$isolateBindings = null;\n }\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$id\n *\n * @description\n * Unique scope ID (monotonically increasing) useful for debugging.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$parent\n *\n * @description\n * Reference to the parent scope.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$root\n *\n * @description\n * Reference to the root scope.\n */\n\n Scope.prototype = {\n constructor: Scope,\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$new\n * @kind function\n *\n * @description\n * Creates a new child {@link ng.$rootScope.Scope scope}.\n *\n * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n *\n * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n * desired for the scope and its child scopes to be permanently detached from the parent and\n * thus stop participating in model change detection and listener notification by invoking.\n *\n * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n * parent scope. The scope is isolated, as it can not see parent scope properties.\n * When creating widgets, it is useful for the widget to not accidentally read parent\n * state.\n *\n * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n * of the newly created scope. Defaults to `this` scope if not provided.\n * This is used when creating a transclude scope to correctly place it\n * in the scope hierarchy while maintaining the correct prototypical\n * inheritance.\n *\n * @returns {Object} The newly created child scope.\n *\n */\n $new: function(isolate, parent) {\n var child;\n\n parent = parent || this;\n\n if (isolate) {\n child = new Scope();\n child.$root = this.$root;\n } else {\n // Only create a child scope class if somebody asks for one,\n // but cache it to allow the VM to optimize lookups.\n if (!this.$$ChildScope) {\n this.$$ChildScope = createChildScopeClass(this);\n }\n child = new this.$$ChildScope();\n }\n child.$parent = parent;\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n\n // When the new scope is not isolated or we inherit from `this`, and\n // the parent scope is destroyed, the property `$$destroyed` is inherited\n // prototypically. In all other cases, this property needs to be set\n // when the parent scope is destroyed.\n // The listener needs to be added after the parent is set\n if (isolate || parent !== this) child.$on('$destroy', destroyChildScope);\n\n return child;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watch\n * @kind function\n *\n * @description\n * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n *\n * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n * $digest()} and should return the value that will be watched. (`watchExpression` should not change\n * its value when executed multiple times with the same input because it may be executed multiple\n * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be\n * [idempotent](http://en.wikipedia.org/wiki/Idempotence).)\n * - The `listener` is called only when the value from the current `watchExpression` and the\n * previous call to `watchExpression` are not equal (with the exception of the initial run,\n * see below). Inequality is determined according to reference inequality,\n * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n * via the `!==` Javascript operator, unless `objectEquality == true`\n * (see next point)\n * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n * according to the {@link angular.equals} function. To save the value of the object for\n * later comparison, the {@link angular.copy} function is used. This therefore means that\n * watching complex objects will have adverse memory and performance implications.\n * - This should not be used to watch for changes in objects that are\n * or contain [File](https://developer.mozilla.org/docs/Web/API/File) objects due to limitations with {@link angular.copy `angular.copy`}.\n * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n * This is achieved by rerunning the watchers until no changes are detected. The rerun\n * iteration limit is 10 to prevent an infinite loop deadlock.\n *\n *\n * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n * you can register a `watchExpression` function with no `listener`. (Be prepared for\n * multiple calls to your `watchExpression` because it will execute multiple times in a\n * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)\n *\n * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n * watcher. In rare cases, this is undesirable because the listener is called when the result\n * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n * listener was called due to initialization.\n *\n *\n *\n * # Example\n * ```js\n // let's assume that scope was dependency injected as the $rootScope\n var scope = $rootScope;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n\n\n\n // Using a function as a watchExpression\n var food;\n scope.foodCounter = 0;\n expect(scope.foodCounter).toEqual(0);\n scope.$watch(\n // This function returns the value being watched. It is called for each turn of the $digest loop\n function() { return food; },\n // This is the change listener, called when the value returned from the above function changes\n function(newValue, oldValue) {\n if ( newValue !== oldValue ) {\n // Only increment the counter if the value changed\n scope.foodCounter = scope.foodCounter + 1;\n }\n }\n );\n // No digest has been run so the counter will be zero\n expect(scope.foodCounter).toEqual(0);\n\n // Run the digest but since food has not changed count will still be zero\n scope.$digest();\n expect(scope.foodCounter).toEqual(0);\n\n // Update food and run digest. Now the counter will increment\n food = 'cheeseburger';\n scope.$digest();\n expect(scope.foodCounter).toEqual(1);\n\n * ```\n *\n *\n *\n * @param {(function()|string)} watchExpression Expression that is evaluated on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n * a call to the `listener`.\n *\n * - `string`: Evaluated as {@link guide/expression expression}\n * - `function(scope)`: called with current `scope` as a parameter.\n * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n * of `watchExpression` changes.\n *\n * - `newVal` contains the current value of the `watchExpression`\n * - `oldVal` contains the previous value of the `watchExpression`\n * - `scope` refers to the current scope\n * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of\n * comparing for reference equality.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {\n var get = $parse(watchExp);\n\n if (get.$$watchDelegate) {\n return get.$$watchDelegate(this, listener, objectEquality, get, watchExp);\n }\n var scope = this,\n array = scope.$$watchers,\n watcher = {\n fn: listener,\n last: initWatchVal,\n get: get,\n exp: prettyPrintExpression || watchExp,\n eq: !!objectEquality\n };\n\n lastDirtyWatch = null;\n\n if (!isFunction(listener)) {\n watcher.fn = noop;\n }\n\n if (!array) {\n array = scope.$$watchers = [];\n array.$$digestWatchIndex = -1;\n }\n // we use unshift since we use a while loop in $digest for speed.\n // the while loop reads in reverse order.\n array.unshift(watcher);\n array.$$digestWatchIndex++;\n incrementWatchersCount(this, 1);\n\n return function deregisterWatch() {\n var index = arrayRemove(array, watcher);\n if (index >= 0) {\n incrementWatchersCount(scope, -1);\n if (index < array.$$digestWatchIndex) {\n array.$$digestWatchIndex--;\n }\n }\n lastDirtyWatch = null;\n };\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchGroup\n * @kind function\n *\n * @description\n * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n * If any one expression in the collection changes the `listener` is executed.\n *\n * - The items in the `watchExpressions` array are observed via the standard `$watch` operation. Their return\n * values are examined for changes on every call to `$digest`.\n * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n *\n * `$watchGroup` is more performant than watching each expression individually, and should be\n * used when the listener does not need to know which expression has changed.\n * If the listener needs to know which expression has changed,\n * {@link ng.$rootScope.Scope#$watch $watch()} or\n * {@link ng.$rootScope.Scope#$watchCollection $watchCollection()} should be used.\n *\n * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually\n * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n *\n * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n * expression in `watchExpressions` changes\n * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`.\n *\n * Note that `newValues` and `oldValues` reflect the differences in each **individual**\n * expression, and not the difference of the values between each call of the listener.\n * That means the difference between `newValues` and `oldValues` cannot be used to determine\n * which expression has changed / remained stable:\n *\n * ```js\n *\n * $scope.$watchGroup(['v1', 'v2'], function(newValues, oldValues) {\n * console.log(newValues, oldValues);\n * });\n *\n * // newValues, oldValues initially\n * // [undefined, undefined], [undefined, undefined]\n *\n * $scope.v1 = 'a';\n * $scope.v2 = 'a';\n *\n * // ['a', 'a'], [undefined, undefined]\n *\n * $scope.v2 = 'b'\n *\n * // v1 hasn't changed since it became `'a'`, therefore its oldValue is still `undefined`\n * // ['a', 'b'], [undefined, 'a']\n *\n * ```\n *\n * The `scope` refers to the current scope.\n * @returns {function()} Returns a de-registration function for all listeners.\n */\n $watchGroup: function(watchExpressions, listener) {\n var oldValues = new Array(watchExpressions.length);\n var newValues = new Array(watchExpressions.length);\n var deregisterFns = [];\n var self = this;\n var changeReactionScheduled = false;\n var firstRun = true;\n\n if (!watchExpressions.length) {\n // No expressions means we call the listener ASAP\n var shouldCall = true;\n self.$evalAsync(function() {\n if (shouldCall) listener(newValues, newValues, self);\n });\n return function deregisterWatchGroup() {\n shouldCall = false;\n };\n }\n\n if (watchExpressions.length === 1) {\n // Special case size of one\n return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n newValues[0] = value;\n oldValues[0] = oldValue;\n listener(newValues, (value === oldValue) ? newValues : oldValues, scope);\n });\n }\n\n forEach(watchExpressions, function(expr, i) {\n var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {\n newValues[i] = value;\n oldValues[i] = oldValue;\n if (!changeReactionScheduled) {\n changeReactionScheduled = true;\n self.$evalAsync(watchGroupAction);\n }\n });\n deregisterFns.push(unwatchFn);\n });\n\n function watchGroupAction() {\n changeReactionScheduled = false;\n\n if (firstRun) {\n firstRun = false;\n listener(newValues, newValues, self);\n } else {\n listener(newValues, oldValues, self);\n }\n }\n\n return function deregisterWatchGroup() {\n while (deregisterFns.length) {\n deregisterFns.shift()();\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchCollection\n * @kind function\n *\n * @description\n * Shallow watches the properties of an object and fires whenever any of the properties change\n * (for arrays, this implies watching the array items; for object maps, this implies watching\n * the properties). If a change is detected, the `listener` callback is fired.\n *\n * - The `obj` collection is observed via standard $watch operation and is examined on every\n * call to $digest() to see if any items have been added, removed, or moved.\n * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n * adding, removing, and moving items belonging to an object or array.\n *\n *\n * # Example\n * ```js\n $scope.names = ['igor', 'matias', 'misko', 'james'];\n $scope.dataCount = 4;\n\n $scope.$watchCollection('names', function(newNames, oldNames) {\n $scope.dataCount = newNames.length;\n });\n\n expect($scope.dataCount).toEqual(4);\n $scope.$digest();\n\n //still at 4 ... no changes\n expect($scope.dataCount).toEqual(4);\n\n $scope.names.pop();\n $scope.$digest();\n\n //now there's been a change\n expect($scope.dataCount).toEqual(3);\n * ```\n *\n *\n * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n * expression value should evaluate to an object or an array which is observed on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n * collection will trigger a call to the `listener`.\n *\n * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n * when a change is detected.\n * - The `newCollection` object is the newly modified data obtained from the `obj` expression\n * - The `oldCollection` object is a copy of the former collection data.\n * Due to performance considerations, the`oldCollection` value is computed only if the\n * `listener` function declares two or more arguments.\n * - The `scope` argument refers to the current scope.\n *\n * @returns {function()} Returns a de-registration function for this listener. When the\n * de-registration function is executed, the internal watch operation is terminated.\n */\n $watchCollection: function(obj, listener) {\n $watchCollectionInterceptor.$stateful = true;\n\n var self = this;\n // the current value, updated on each dirty-check run\n var newValue;\n // a shallow copy of the newValue from the last dirty-check run,\n // updated to match newValue during dirty-check run\n var oldValue;\n // a shallow copy of the newValue from when the last change happened\n var veryOldValue;\n // only track veryOldValue if the listener is asking for it\n var trackVeryOldValue = (listener.length > 1);\n var changeDetected = 0;\n var changeDetector = $parse(obj, $watchCollectionInterceptor);\n var internalArray = [];\n var internalObject = {};\n var initRun = true;\n var oldLength = 0;\n\n function $watchCollectionInterceptor(_value) {\n newValue = _value;\n var newLength, key, bothNaN, newItem, oldItem;\n\n // If the new value is undefined, then return undefined as the watch may be a one-time watch\n if (isUndefined(newValue)) return;\n\n if (!isObject(newValue)) { // if primitive\n if (oldValue !== newValue) {\n oldValue = newValue;\n changeDetected++;\n }\n } else if (isArrayLike(newValue)) {\n if (oldValue !== internalArray) {\n // we are transitioning from something which was not an array into array.\n oldValue = internalArray;\n oldLength = oldValue.length = 0;\n changeDetected++;\n }\n\n newLength = newValue.length;\n\n if (oldLength !== newLength) {\n // if lengths do not match we need to trigger change notification\n changeDetected++;\n oldValue.length = oldLength = newLength;\n }\n // copy the items to oldValue and look for changes.\n for (var i = 0; i < newLength; i++) {\n oldItem = oldValue[i];\n newItem = newValue[i];\n\n // eslint-disable-next-line no-self-compare\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[i] = newItem;\n }\n }\n } else {\n if (oldValue !== internalObject) {\n // we are transitioning from something which was not an object into object.\n oldValue = internalObject = {};\n oldLength = 0;\n changeDetected++;\n }\n // copy the items to oldValue and look for changes.\n newLength = 0;\n for (key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n newLength++;\n newItem = newValue[key];\n oldItem = oldValue[key];\n\n if (key in oldValue) {\n // eslint-disable-next-line no-self-compare\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[key] = newItem;\n }\n } else {\n oldLength++;\n oldValue[key] = newItem;\n changeDetected++;\n }\n }\n }\n if (oldLength > newLength) {\n // we used to have more keys, need to find them and destroy them.\n changeDetected++;\n for (key in oldValue) {\n if (!hasOwnProperty.call(newValue, key)) {\n oldLength--;\n delete oldValue[key];\n }\n }\n }\n }\n return changeDetected;\n }\n\n function $watchCollectionAction() {\n if (initRun) {\n initRun = false;\n listener(newValue, newValue, self);\n } else {\n listener(newValue, veryOldValue, self);\n }\n\n // make a copy for the next time a collection is changed\n if (trackVeryOldValue) {\n if (!isObject(newValue)) {\n //primitive\n veryOldValue = newValue;\n } else if (isArrayLike(newValue)) {\n veryOldValue = new Array(newValue.length);\n for (var i = 0; i < newValue.length; i++) {\n veryOldValue[i] = newValue[i];\n }\n } else { // if object\n veryOldValue = {};\n for (var key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n veryOldValue[key] = newValue[key];\n }\n }\n }\n }\n }\n\n return this.$watch(changeDetector, $watchCollectionAction);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$digest\n * @kind function\n *\n * @description\n * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n * until no more listeners are firing. This means that it is possible to get into an infinite\n * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n * iterations exceeds 10.\n *\n * Usually, you don't call `$digest()` directly in\n * {@link ng.directive:ngController controllers} or in\n * {@link ng.$compileProvider#directive directives}.\n * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n *\n * If you want to be notified whenever `$digest()` is called,\n * you can register a `watchExpression` function with\n * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n *\n * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n *\n * # Example\n * ```js\n var scope = ...;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n * ```\n *\n */\n $digest: function() {\n var watch, value, last, fn, get,\n watchers,\n dirty, ttl = TTL,\n next, current, target = this,\n watchLog = [],\n logIdx, asyncTask;\n\n beginPhase('$digest');\n // Check for changes to browser url that happened in sync before the call to $digest\n $browser.$$checkUrlChange();\n\n if (this === $rootScope && applyAsyncId !== null) {\n // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n $browser.defer.cancel(applyAsyncId);\n flushApplyAsync();\n }\n\n lastDirtyWatch = null;\n\n do { // \"while dirty\" loop\n dirty = false;\n current = target;\n\n // It's safe for asyncQueuePosition to be a local variable here because this loop can't\n // be reentered recursively. Calling $digest from a function passed to $evalAsync would\n // lead to a '$digest already in progress' error.\n for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) {\n try {\n asyncTask = asyncQueue[asyncQueuePosition];\n fn = asyncTask.fn;\n fn(asyncTask.scope, asyncTask.locals);\n } catch (e) {\n $exceptionHandler(e);\n }\n lastDirtyWatch = null;\n }\n asyncQueue.length = 0;\n\n traverseScopesLoop:\n do { // \"traverse the scopes\" loop\n if ((watchers = current.$$watchers)) {\n // process our watches\n watchers.$$digestWatchIndex = watchers.length;\n while (watchers.$$digestWatchIndex--) {\n try {\n watch = watchers[watchers.$$digestWatchIndex];\n // Most common watches are on primitives, in which case we can short\n // circuit it with === operator, only when === fails do we use .equals\n if (watch) {\n get = watch.get;\n if ((value = get(current)) !== (last = watch.last) &&\n !(watch.eq\n ? equals(value, last)\n : (isNumberNaN(value) && isNumberNaN(last)))) {\n dirty = true;\n lastDirtyWatch = watch;\n watch.last = watch.eq ? copy(value, null) : value;\n fn = watch.fn;\n fn(value, ((last === initWatchVal) ? value : last), current);\n if (ttl < 5) {\n logIdx = 4 - ttl;\n if (!watchLog[logIdx]) watchLog[logIdx] = [];\n watchLog[logIdx].push({\n msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n newVal: value,\n oldVal: last\n });\n }\n } else if (watch === lastDirtyWatch) {\n // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n // have already been tested.\n dirty = false;\n break traverseScopesLoop;\n }\n }\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $broadcast\n if (!(next = ((current.$$watchersCount && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n } while ((current = next));\n\n // `break traverseScopesLoop;` takes us to here\n\n if ((dirty || asyncQueue.length) && !(ttl--)) {\n clearPhase();\n throw $rootScopeMinErr('infdig',\n '{0} $digest() iterations reached. Aborting!\\n' +\n 'Watchers fired in the last 5 iterations: {1}',\n TTL, watchLog);\n }\n\n } while (dirty || asyncQueue.length);\n\n clearPhase();\n\n // postDigestQueuePosition isn't local here because this loop can be reentered recursively.\n while (postDigestQueuePosition < postDigestQueue.length) {\n try {\n postDigestQueue[postDigestQueuePosition++]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n postDigestQueue.length = postDigestQueuePosition = 0;\n\n // Check for changes to browser url that happened during the $digest\n // (for which no event is fired; e.g. via `history.pushState()`)\n $browser.$$checkUrlChange();\n },\n\n\n /**\n * @ngdoc event\n * @name $rootScope.Scope#$destroy\n * @eventType broadcast on scope being destroyed\n *\n * @description\n * Broadcasted when a scope and its children are being destroyed.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$destroy\n * @kind function\n *\n * @description\n * Removes the current scope (and all of its children) from the parent scope. Removal implies\n * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n * propagate to the current scope and its children. Removal also implies that the current\n * scope is eligible for garbage collection.\n *\n * The `$destroy()` is usually used by directives such as\n * {@link ng.directive:ngRepeat ngRepeat} for managing the\n * unrolling of the loop.\n *\n * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n * Application code can register a `$destroy` event handler that will give it a chance to\n * perform any necessary cleanup.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n $destroy: function() {\n // We can't destroy a scope that has been already destroyed.\n if (this.$$destroyed) return;\n var parent = this.$parent;\n\n this.$broadcast('$destroy');\n this.$$destroyed = true;\n\n if (this === $rootScope) {\n //Remove handlers attached to window when $rootScope is removed\n $browser.$$applicationDestroyed();\n }\n\n incrementWatchersCount(this, -this.$$watchersCount);\n for (var eventName in this.$$listenerCount) {\n decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n }\n\n // sever all the references to parent scopes (after this cleanup, the current scope should\n // not be retained by any of our references and should be eligible for garbage collection)\n if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling;\n if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling;\n if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n // Disable listeners, watchers and apply/digest methods\n this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n this.$on = this.$watch = this.$watchGroup = function() { return noop; };\n this.$$listeners = {};\n\n // Disconnect the next sibling to prevent `cleanUpScope` destroying those too\n this.$$nextSibling = null;\n cleanUpScope(this);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$eval\n * @kind function\n *\n * @description\n * Executes the `expression` on the current scope and returns the result. Any exceptions in\n * the expression are propagated (uncaught). This is useful when evaluating Angular\n * expressions.\n *\n * # Example\n * ```js\n var scope = ng.$rootScope.Scope();\n scope.a = 1;\n scope.b = 2;\n\n expect(scope.$eval('a+b')).toEqual(3);\n expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n * ```\n *\n * @param {(string|function())=} expression An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n * @returns {*} The result of evaluating the expression.\n */\n $eval: function(expr, locals) {\n return $parse(expr)(this, locals);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$evalAsync\n * @kind function\n *\n * @description\n * Executes the expression on the current scope at a later point in time.\n *\n * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n * that:\n *\n * - it will execute after the function that scheduled the evaluation (preferably before DOM\n * rendering).\n * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n * `expression` execution.\n *\n * Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n * will be scheduled. However, it is encouraged to always call code that changes the model\n * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n *\n * @param {(string|function())=} expression An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n */\n $evalAsync: function(expr, locals) {\n // if we are outside of an $digest loop and this is the first time we are scheduling async\n // task also schedule async auto-flush\n if (!$rootScope.$$phase && !asyncQueue.length) {\n $browser.defer(function() {\n if (asyncQueue.length) {\n $rootScope.$digest();\n }\n });\n }\n\n asyncQueue.push({scope: this, fn: $parse(expr), locals: locals});\n },\n\n $$postDigest: function(fn) {\n postDigestQueue.push(fn);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$apply\n * @kind function\n *\n * @description\n * `$apply()` is used to execute an expression in angular from outside of the angular\n * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n * Because we are calling into the angular framework we need to perform proper scope life\n * cycle of {@link ng.$exceptionHandler exception handling},\n * {@link ng.$rootScope.Scope#$digest executing watches}.\n *\n * ## Life cycle\n *\n * # Pseudo-Code of `$apply()`\n * ```js\n function $apply(expr) {\n try {\n return $eval(expr);\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n $root.$digest();\n }\n }\n * ```\n *\n *\n * Scope's `$apply()` method transitions through the following stages:\n *\n * 1. The {@link guide/expression expression} is executed using the\n * {@link ng.$rootScope.Scope#$eval $eval()} method.\n * 2. Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n *\n *\n * @param {(string|function())=} exp An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n *\n * @returns {*} The result of evaluating the expression.\n */\n $apply: function(expr) {\n try {\n beginPhase('$apply');\n try {\n return this.$eval(expr);\n } finally {\n clearPhase();\n }\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n try {\n $rootScope.$digest();\n } catch (e) {\n $exceptionHandler(e);\n // eslint-disable-next-line no-unsafe-finally\n throw e;\n }\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$applyAsync\n * @kind function\n *\n * @description\n * Schedule the invocation of $apply to occur at a later time. The actual time difference\n * varies across browsers, but is typically around ~10 milliseconds.\n *\n * This can be used to queue up multiple expressions which need to be evaluated in the same\n * digest.\n *\n * @param {(string|function())=} exp An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n */\n $applyAsync: function(expr) {\n var scope = this;\n if (expr) {\n applyAsyncQueue.push($applyAsyncExpression);\n }\n expr = $parse(expr);\n scheduleApplyAsync();\n\n function $applyAsyncExpression() {\n scope.$eval(expr);\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$on\n * @kind function\n *\n * @description\n * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n * discussion of event life cycle.\n *\n * The event listener function format is: `function(event, args...)`. The `event` object\n * passed into the listener has the following attributes:\n *\n * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n * `$broadcast`-ed.\n * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n * event propagates through the scope hierarchy, this property is set to null.\n * - `name` - `{string}`: name of the event.\n * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n * further event propagation (available only for events that were `$emit`-ed).\n * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n * to true.\n * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n *\n * @param {string} name Event name to listen on.\n * @param {function(event, ...args)} listener Function to call when the event is emitted.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $on: function(name, listener) {\n var namedListeners = this.$$listeners[name];\n if (!namedListeners) {\n this.$$listeners[name] = namedListeners = [];\n }\n namedListeners.push(listener);\n\n var current = this;\n do {\n if (!current.$$listenerCount[name]) {\n current.$$listenerCount[name] = 0;\n }\n current.$$listenerCount[name]++;\n } while ((current = current.$parent));\n\n var self = this;\n return function() {\n var indexOfListener = namedListeners.indexOf(listener);\n if (indexOfListener !== -1) {\n namedListeners[indexOfListener] = null;\n decrementListenerCount(self, 1, name);\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$emit\n * @kind function\n *\n * @description\n * Dispatches an event `name` upwards through the scope hierarchy notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$emit` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n * registered listeners along the way. The event will stop propagating if one of the listeners\n * cancels it.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to emit.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n */\n $emit: function(name, args) {\n var empty = [],\n namedListeners,\n scope = this,\n stopPropagation = false,\n event = {\n name: name,\n targetScope: scope,\n stopPropagation: function() {stopPropagation = true;},\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n },\n listenerArgs = concat([event], arguments, 1),\n i, length;\n\n do {\n namedListeners = scope.$$listeners[name] || empty;\n event.currentScope = scope;\n for (i = 0, length = namedListeners.length; i < length; i++) {\n\n // if listeners were deregistered, defragment the array\n if (!namedListeners[i]) {\n namedListeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n try {\n //allow all listeners attached to the current scope to run\n namedListeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n //if any listener on the current scope stops propagation, prevent bubbling\n if (stopPropagation) {\n event.currentScope = null;\n return event;\n }\n //traverse upwards\n scope = scope.$parent;\n } while (scope);\n\n event.currentScope = null;\n\n return event;\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$broadcast\n * @kind function\n *\n * @description\n * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$broadcast` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n * scope and calls all registered listeners along the way. The event cannot be canceled.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to broadcast.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n */\n $broadcast: function(name, args) {\n var target = this,\n current = target,\n next = target,\n event = {\n name: name,\n targetScope: target,\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n };\n\n if (!target.$$listenerCount[name]) return event;\n\n var listenerArgs = concat([event], arguments, 1),\n listeners, i, length;\n\n //down while you can, then up and next sibling or up and next sibling until back at root\n while ((current = next)) {\n event.currentScope = current;\n listeners = current.$$listeners[name] || [];\n for (i = 0, length = listeners.length; i < length; i++) {\n // if listeners were deregistered, defragment the array\n if (!listeners[i]) {\n listeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n\n try {\n listeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $digest\n // (though it differs due to having the extra check for $$listenerCount)\n if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n }\n\n event.currentScope = null;\n return event;\n }\n };\n\n var $rootScope = new Scope();\n\n //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n var asyncQueue = $rootScope.$$asyncQueue = [];\n var postDigestQueue = $rootScope.$$postDigestQueue = [];\n var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n\n var postDigestQueuePosition = 0;\n\n return $rootScope;\n\n\n function beginPhase(phase) {\n if ($rootScope.$$phase) {\n throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n }\n\n $rootScope.$$phase = phase;\n }\n\n function clearPhase() {\n $rootScope.$$phase = null;\n }\n\n function incrementWatchersCount(current, count) {\n do {\n current.$$watchersCount += count;\n } while ((current = current.$parent));\n }\n\n function decrementListenerCount(current, count, name) {\n do {\n current.$$listenerCount[name] -= count;\n\n if (current.$$listenerCount[name] === 0) {\n delete current.$$listenerCount[name];\n }\n } while ((current = current.$parent));\n }\n\n /**\n * function used as an initial value for watchers.\n * because it's unique we can easily tell it apart from other values\n */\n function initWatchVal() {}\n\n function flushApplyAsync() {\n while (applyAsyncQueue.length) {\n try {\n applyAsyncQueue.shift()();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n applyAsyncId = null;\n }\n\n function scheduleApplyAsync() {\n if (applyAsyncId === null) {\n applyAsyncId = $browser.defer(function() {\n $rootScope.$apply(flushApplyAsync);\n });\n }\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $rootElement\n *\n * @description\n * The root element of Angular application. This is either the element where {@link\n * ng.directive:ngApp ngApp} was declared or the element passed into\n * {@link angular.bootstrap}. The element represents the root element of application. It is also the\n * location where the application's {@link auto.$injector $injector} service gets\n * published, and can be retrieved using `$rootElement.injector()`.\n */\n\n\n// the implementation is in angular.bootstrap\n\n/**\n * @this\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\nfunction $$SanitizeUriProvider() {\n var aHrefSanitizationWhitelist = /^\\s*(https?|ftp|mailto|tel|file):/,\n imgSrcSanitizationWhitelist = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n aHrefSanitizationWhitelist = regexp;\n return this;\n }\n return aHrefSanitizationWhitelist;\n };\n\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n imgSrcSanitizationWhitelist = regexp;\n return this;\n }\n return imgSrcSanitizationWhitelist;\n };\n\n this.$get = function() {\n return function sanitizeUri(uri, isImage) {\n var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;\n var normalizedVal;\n normalizedVal = urlResolve(uri).href;\n if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n return 'unsafe:' + normalizedVal;\n }\n return uri;\n };\n };\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* exported $SceProvider, $SceDelegateProvider */\n\nvar $sceMinErr = minErr('$sce');\n\nvar SCE_CONTEXTS = {\n // HTML is used when there's HTML rendered (e.g. ng-bind-html, iframe srcdoc binding).\n HTML: 'html',\n\n // Style statements or stylesheets. Currently unused in AngularJS.\n CSS: 'css',\n\n // An URL used in a context where it does not refer to a resource that loads code. Currently\n // unused in AngularJS.\n URL: 'url',\n\n // RESOURCE_URL is a subtype of URL used where the referred-to resource could be interpreted as\n // code. (e.g. ng-include, script src binding, templateUrl)\n RESOURCE_URL: 'resourceUrl',\n\n // Script. Currently unused in AngularJS.\n JS: 'js'\n};\n\n// Helper functions follow.\n\nvar UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g;\n\nfunction snakeToCamel(name) {\n return name\n .replace(UNDERSCORE_LOWERCASE_REGEXP, fnCamelCaseReplace);\n}\n\nfunction adjustMatcher(matcher) {\n if (matcher === 'self') {\n return matcher;\n } else if (isString(matcher)) {\n // Strings match exactly except for 2 wildcards - '*' and '**'.\n // '*' matches any character except those from the set ':/.?&'.\n // '**' matches any character (like .* in a RegExp).\n // More than 2 *'s raises an error as it's ill defined.\n if (matcher.indexOf('***') > -1) {\n throw $sceMinErr('iwcard',\n 'Illegal sequence *** in string matcher. String: {0}', matcher);\n }\n matcher = escapeForRegexp(matcher).\n replace(/\\\\\\*\\\\\\*/g, '.*').\n replace(/\\\\\\*/g, '[^:/.?&;]*');\n return new RegExp('^' + matcher + '$');\n } else if (isRegExp(matcher)) {\n // The only other type of matcher allowed is a Regexp.\n // Match entire URL / disallow partial matches.\n // Flags are reset (i.e. no global, ignoreCase or multiline)\n return new RegExp('^' + matcher.source + '$');\n } else {\n throw $sceMinErr('imatcher',\n 'Matchers may only be \"self\", string patterns or RegExp objects');\n }\n}\n\n\nfunction adjustMatchers(matchers) {\n var adjustedMatchers = [];\n if (isDefined(matchers)) {\n forEach(matchers, function(matcher) {\n adjustedMatchers.push(adjustMatcher(matcher));\n });\n }\n return adjustedMatchers;\n}\n\n\n/**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * For an overview of this service and the functionnality it provides in AngularJS, see the main\n * page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how\n * SCE works in their application, which shouldn't be needed in most cases.\n *\n * <div class=\"alert alert-danger\">\n * AngularJS strongly relies on contextual escaping for the security of bindings: disabling or\n * modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners,\n * changes to this service will also influence users, so be extra careful and document your changes.\n * </div>\n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain. While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as\n * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist\n * $sceDelegateProvider.resourceUrlWhitelist} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n */\n\n/**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @this\n *\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.\n *\n * The `$sceDelegateProvider` allows one to get/set the whitelists and blacklists used to ensure\n * that the URLs used for sourcing AngularJS templates and other script-running URLs are safe (all\n * places that use the `$sce.RESOURCE_URL` context). See\n * {@link ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist}\n * and\n * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist},\n *\n * For the general details about this service in Angular, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**: Consider the following case. <a name=\"example\"></a>\n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n * angular.module('myApp', []).config(function($sceDelegateProvider) {\n * $sceDelegateProvider.resourceUrlWhitelist([\n * // Allow same origin resource loads.\n * 'self',\n * // Allow loading from our assets domain. Notice the difference between * and **.\n * 'http://srv*.assets.example.com/**'\n * ]);\n *\n * // The blacklist overrides the whitelist so the open redirect here is blocked.\n * $sceDelegateProvider.resourceUrlBlacklist([\n * 'http://myapp.example.com/clickThru**'\n * ]);\n * });\n * ```\n * Note that an empty whitelist will block every resource URL from being loaded, and will require\n * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates\n * requested by {@link ng.$templateRequest $templateRequest} that are present in\n * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism\n * to populate your templates in that cache at config time, then it is a good idea to remove 'self'\n * from that whitelist. This helps to mitigate the security impact of certain types of issues, like\n * for instance attacker-controlled `ng-includes`.\n */\n\nfunction $SceDelegateProvider() {\n this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n // Resource URLs can also be trusted by policy.\n var resourceUrlWhitelist = ['self'],\n resourceUrlBlacklist = [];\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlWhitelist\n * @kind function\n *\n * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value\n * provided. This must be an array or null. A snapshot of this array is used so further\n * changes to the array are ignored.\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n * @return {Array} The currently set whitelist array.\n *\n * @description\n * Sets/Gets the whitelist of trusted resource URLs.\n *\n * The **default value** when no whitelist has been explicitly set is `['self']` allowing only\n * same origin resource requests.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** the default whitelist of 'self' is not recommended if your app shares its origin\n * with other apps! It is a good idea to limit it to only your application's directory.\n * </div>\n */\n this.resourceUrlWhitelist = function(value) {\n if (arguments.length) {\n resourceUrlWhitelist = adjustMatchers(value);\n }\n return resourceUrlWhitelist;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlBlacklist\n * @kind function\n *\n * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value\n * provided. This must be an array or null. A snapshot of this array is used so further\n * changes to the array are ignored.</p><p>\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.</p><p>\n * The typical usage for the blacklist is to **block\n * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n * these would otherwise be trusted but actually return content from the redirected domain.\n * </p><p>\n * Finally, **the blacklist overrides the whitelist** and has the final say.\n *\n * @return {Array} The currently set blacklist array.\n *\n * @description\n * Sets/Gets the blacklist of trusted resource URLs.\n *\n * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there\n * is no blacklist.)\n */\n\n this.resourceUrlBlacklist = function(value) {\n if (arguments.length) {\n resourceUrlBlacklist = adjustMatchers(value);\n }\n return resourceUrlBlacklist;\n };\n\n this.$get = ['$injector', function($injector) {\n\n var htmlSanitizer = function htmlSanitizer(html) {\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n };\n\n if ($injector.has('$sanitize')) {\n htmlSanitizer = $injector.get('$sanitize');\n }\n\n\n function matchUrl(matcher, parsedUrl) {\n if (matcher === 'self') {\n return urlIsSameOrigin(parsedUrl);\n } else {\n // definitely a regex. See adjustMatchers()\n return !!matcher.exec(parsedUrl.href);\n }\n }\n\n function isResourceUrlAllowedByPolicy(url) {\n var parsedUrl = urlResolve(url.toString());\n var i, n, allowed = false;\n // Ensure that at least one item from the whitelist allows this url.\n for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {\n if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {\n allowed = true;\n break;\n }\n }\n if (allowed) {\n // Ensure that no item from the blacklist blocked this url.\n for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {\n if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {\n allowed = false;\n break;\n }\n }\n }\n return allowed;\n }\n\n function generateHolderType(Base) {\n var holderType = function TrustedValueHolderType(trustedValue) {\n this.$$unwrapTrustedValue = function() {\n return trustedValue;\n };\n };\n if (Base) {\n holderType.prototype = new Base();\n }\n holderType.prototype.valueOf = function sceValueOf() {\n return this.$$unwrapTrustedValue();\n };\n holderType.prototype.toString = function sceToString() {\n return this.$$unwrapTrustedValue().toString();\n };\n return holderType;\n }\n\n var trustedValueHolderBase = generateHolderType(),\n byType = {};\n\n byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n /**\n * @ngdoc method\n * @name $sceDelegate#trustAs\n *\n * @description\n * Returns a trusted representation of the parameter for the specified context. This trusted\n * object will later on be used as-is, without any security check, by bindings or directives\n * that require this security context.\n * For instance, marking a string as trusted for the `$sce.HTML` context will entirely bypass\n * the potential `$sanitize` call in corresponding `$sce.HTML` bindings or directives, such as\n * `ng-bind-html`. Note that in most cases you won't need to call this function: if you have the\n * sanitizer loaded, passing the value itself will render all the HTML that does not pose a\n * security risk.\n *\n * See {@link ng.$sceDelegate#getTrusted getTrusted} for the function that will consume those\n * trusted values, and {@link ng.$sce $sce} for general documentation about strict contextual\n * escaping.\n *\n * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,\n * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.\n *\n * @param {*} value The value that should be considered trusted.\n * @return {*} A trusted representation of value, that can be used in the given context.\n */\n function trustAs(type, trustedValue) {\n var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n if (!Constructor) {\n throw $sceMinErr('icontext',\n 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',\n type, trustedValue);\n }\n if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {\n return trustedValue;\n }\n // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting\n // mutable objects, we ensure here that the value passed in is actually a string.\n if (typeof trustedValue !== 'string') {\n throw $sceMinErr('itype',\n 'Attempted to trust a non-string value in a content requiring a string: Context: {0}',\n type);\n }\n return new Constructor(trustedValue);\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#valueOf\n *\n * @description\n * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n *\n * If the passed parameter is not a value that had been returned by {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, it must be returned as-is.\n *\n * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n * call or anything else.\n * @return {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns\n * `value` unchanged.\n */\n function valueOf(maybeTrusted) {\n if (maybeTrusted instanceof trustedValueHolderBase) {\n return maybeTrusted.$$unwrapTrustedValue();\n } else {\n return maybeTrusted;\n }\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#getTrusted\n *\n * @description\n * Takes any input, and either returns a value that's safe to use in the specified context, or\n * throws an exception.\n *\n * In practice, there are several cases. When given a string, this function runs checks\n * and sanitization to make it safe without prior assumptions. When given the result of a {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call, it returns the originally supplied\n * value if that value's context is valid for this call's context. Finally, this function can\n * also throw when there is no way to turn `maybeTrusted` in a safe value (e.g., no sanitization\n * is available or possible.)\n *\n * @param {string} type The context in which this value is to be used (such as `$sce.HTML`).\n * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} call, or anything else (which will not be considered trusted.)\n * @return {*} A version of the value that's safe to use in the given context, or throws an\n * exception if this is impossible.\n */\n function getTrusted(type, maybeTrusted) {\n if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {\n return maybeTrusted;\n }\n var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n // If maybeTrusted is a trusted class instance or subclass instance, then unwrap and return\n // as-is.\n if (constructor && maybeTrusted instanceof constructor) {\n return maybeTrusted.$$unwrapTrustedValue();\n }\n // Otherwise, if we get here, then we may either make it safe, or throw an exception. This\n // depends on the context: some are sanitizatible (HTML), some use whitelists (RESOURCE_URL),\n // some are impossible to do (JS). This step isn't implemented for CSS and URL, as AngularJS\n // has no corresponding sinks.\n if (type === SCE_CONTEXTS.RESOURCE_URL) {\n // RESOURCE_URL uses a whitelist.\n if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n return maybeTrusted;\n } else {\n throw $sceMinErr('insecurl',\n 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}',\n maybeTrusted.toString());\n }\n } else if (type === SCE_CONTEXTS.HTML) {\n // htmlSanitizer throws its own error when no sanitizer is available.\n return htmlSanitizer(maybeTrusted);\n }\n // Default error when the $sce service has no way to make the input safe.\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n }\n\n return { trustAs: trustAs,\n getTrusted: getTrusted,\n valueOf: valueOf };\n }];\n}\n\n\n/**\n * @ngdoc provider\n * @name $sceProvider\n * @this\n *\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * - enable/disable Strict Contextual Escaping (SCE) in a module\n * - override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n/**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * # Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render\n * trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and\n * (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * ## Overview\n *\n * To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in\n * HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically\n * run security checks on them (sanitizations, whitelists, depending on context), or throw when it\n * cannot guarantee the security of the result. That behavior depends strongly on contexts: HTML\n * can be sanitized, but template URLs cannot, for instance.\n *\n * To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML:\n * we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it\n * before rendering if a sanitizer is available, and throw otherwise. To bypass sanitization and\n * render the input as-is, you will need to mark it as trusted for that context before attempting\n * to bind it.\n *\n * As of version 1.2, AngularJS ships with SCE enabled by default.\n *\n * ## In practice\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * <input ng-model=\"userHtml\" aria-label=\"User input\">\n * <div ng-bind-html=\"userHtml\"></div>\n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV, which would\n * be an XSS security bug. In a more realistic example, one may be rendering user comments, blog\n * articles, etc. via bindings. (HTML is just one example of a context where rendering user\n * controlled input creates security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?) How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, AngularJS makes sure bindings go through that sanitization, or\n * any similar validation process, unless there's a good reason to trust the given value in this\n * context. That trust is formalized with a function call. This means that as a developer, you\n * can assume all untrusted bindings are safe. Then, to audit your code for binding security issues,\n * you just need to ensure the values you mark as trusted indeed are safe - because they were\n * received from your server, sanitized by your library, etc. You can organize your codebase to\n * help with this - perhaps allowing only the files in a specific directory to do this.\n * Ensuring that the internal API exposed by that code doesn't markup arbitrary values as safe then\n * becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * build the trusted versions of your values.\n *\n * ## How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as\n * a way to enforce the required security context in your data sink. Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs\n * the {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. Also,\n * when binding without directives, AngularJS will understand the context of your bindings\n * automatically.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n * return function(scope, element, attr) {\n * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n * element.html(value || '');\n * });\n * };\n * }];\n * ```\n *\n * ## Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, Angular only loads templates from the same domain and protocol as the application\n * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or\n * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist\n * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded. This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers. Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ## This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (e.g.\n * `<div ng-bind-html=\"'<b>implicitly trusted</b>'\"></div>`) just works. The `$sceDelegate` will\n * also use the `$sanitize` service if it is available when binding untrusted values to\n * `$sce.HTML` context. AngularJS provides an implementation in `angular-sanitize.js`, and if you\n * wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in\n * your application.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document. You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.\n *\n * This significantly reduces the overhead. It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * <a name=\"contexts\"></a>\n * ## What trusted context types are supported?\n *\n * | Context | Notes |\n * |---------------------|----------------|\n * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered, and the {@link ngSanitize.$sanitize $sanitize} service is available (implemented by the {@link ngSanitize ngSanitize} module) this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS` | For CSS that's safe to source into the application. Currently, no bindings require this context. Feel free to use it in your own directives. |\n * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=`, `<img src=`, and some others sanitize their urls and don't constitute an SCE context.) |\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG`, `VIDEO`, `AUDIO`, `SOURCE`, and `TRACK` (e.g. `IFRAME`, `OBJECT`, etc.) <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does (it's not just the URL that matters, but also what is at the end of it), and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |\n * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently, no bindings require this context. Feel free to use it in your own directives. |\n *\n *\n * Be aware that `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them\n * through {@link ng.$sce#getTrusted $sce.getTrusted}. There's no CSS-, URL-, or JS-context bindings\n * in AngularJS currently, so their corresponding `$sce.trustAs` functions aren't useful yet. This\n * might evolve.\n *\n * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name=\"resourceUrlPatternItem\"></a>\n *\n * Each element in these arrays must be one of the following:\n *\n * - **'self'**\n * - The special **string**, `'self'`, can be used to match against all URLs of the **same\n * domain** as the application document using the **same protocol**.\n * - **String** (except the special value `'self'`)\n * - The string is matched against the full *normalized / absolute URL* of the resource\n * being tested (substring matches are not good enough.)\n * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters\n * match themselves.\n * - `*`: matches zero or more occurrences of any character other than one of the following 6\n * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use\n * in a whitelist.\n * - `**`: matches zero or more occurrences of *any* character. As such, it's not\n * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.\n * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n * not have been the intention.) Its usage at the very end of the path is ok. (e.g.\n * http://foo.example.com/templates/**).\n * - **RegExp** (*see caveat below*)\n * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax\n * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to\n * accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n * have good test coverage). For instance, the use of `.` in the regex is correct only in a\n * small number of cases. A `.` character in the regex used when matching the scheme or a\n * subdomain could be matched against a `:` or literal `.` that was likely not intended. It\n * is highly recommended to use the string patterns and only fall back to regular expressions\n * as a last resort.\n * - The regular expression must be an instance of RegExp (i.e. not a string.) It is\n * matched against the **entire** *normalized / absolute URL* of the resource being tested\n * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags\n * present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n * - If you are generating your JavaScript from some other templating engine (not\n * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n * remember to escape your regular expression (and be aware that you might need more than\n * one level of escaping depending on your templating engine and the way you interpolated\n * the value.) Do make use of your platform's escaping mechanism as it might be good\n * enough before coding your own. E.g. Ruby has\n * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n * Javascript lacks a similar built in function for escaping. Take a look at Google\n * Closure library's [goog.string.regExpEscape(s)](\n * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ## Show me an example using SCE.\n *\n * <example module=\"mySceApp\" deps=\"angular-sanitize.js\" name=\"sce-service\">\n * <file name=\"index.html\">\n * <div ng-controller=\"AppController as myCtrl\">\n * <i ng-bind-html=\"myCtrl.explicitlyTrustedHtml\" id=\"explicitlyTrustedHtml\"></i><br><br>\n * <b>User comments</b><br>\n * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n * $sanitize is available. If $sanitize isn't available, this results in an error instead of an\n * exploit.\n * <div class=\"well\">\n * <div ng-repeat=\"userComment in myCtrl.userComments\">\n * <b>{{userComment.name}}</b>:\n * <span ng-bind-html=\"userComment.htmlComment\" class=\"htmlComment\"></span>\n * <br>\n * </div>\n * </div>\n * </div>\n * </file>\n *\n * <file name=\"script.js\">\n * angular.module('mySceApp', ['ngSanitize'])\n * .controller('AppController', ['$http', '$templateCache', '$sce',\n * function AppController($http, $templateCache, $sce) {\n * var self = this;\n * $http.get('test_data.json', {cache: $templateCache}).then(function(response) {\n * self.userComments = response.data;\n * });\n * self.explicitlyTrustedHtml = $sce.trustAsHtml(\n * '<span onmouseover=\"this.textContent="Explicitly trusted HTML bypasses ' +\n * 'sanitization."\">Hover over this text.</span>');\n * }]);\n * </file>\n *\n * <file name=\"test_data.json\">\n * [\n * { \"name\": \"Alice\",\n * \"htmlComment\":\n * \"<span onmouseover='this.textContent=\\\"PWN3D!\\\"'>Is <i>anyone</i> reading this?</span>\"\n * },\n * { \"name\": \"Bob\",\n * \"htmlComment\": \"<i>Yes!</i> Am I the only other one?\"\n * }\n * ]\n * </file>\n *\n * <file name=\"protractor.js\" type=\"protractor\">\n * describe('SCE doc demo', function() {\n * it('should sanitize untrusted values', function() {\n * expect(element.all(by.css('.htmlComment')).first().getAttribute('innerHTML'))\n * .toBe('<span>Is <i>anyone</i> reading this?</span>');\n * });\n *\n * it('should NOT sanitize explicitly trusted values', function() {\n * expect(element(by.id('explicitlyTrustedHtml')).getAttribute('innerHTML')).toBe(\n * '<span onmouseover=\"this.textContent="Explicitly trusted HTML bypasses ' +\n * 'sanitization."\">Hover over this text.</span>');\n * });\n * });\n * </file>\n * </example>\n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits\n * for little coding overhead. It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time. Also do note that this is an app-wide setting, so if\n * you are writing a library, you will cause security bugs applications using it.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n * // Completely disable SCE. For demonstration purposes only!\n * // Do not use in new projects or libraries.\n * $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n\nfunction $SceProvider() {\n var enabled = true;\n\n /**\n * @ngdoc method\n * @name $sceProvider#enabled\n * @kind function\n *\n * @param {boolean=} value If provided, then enables/disables SCE application-wide.\n * @return {boolean} True if SCE is enabled, false otherwise.\n *\n * @description\n * Enables/disables SCE and returns the current value.\n */\n this.enabled = function(value) {\n if (arguments.length) {\n enabled = !!value;\n }\n return enabled;\n };\n\n\n /* Design notes on the default implementation for SCE.\n *\n * The API contract for the SCE delegate\n * -------------------------------------\n * The SCE delegate object must provide the following 3 methods:\n *\n * - trustAs(contextEnum, value)\n * This method is used to tell the SCE service that the provided value is OK to use in the\n * contexts specified by contextEnum. It must return an object that will be accepted by\n * getTrusted() for a compatible contextEnum and return this value.\n *\n * - valueOf(value)\n * For values that were not produced by trustAs(), return them as is. For values that were\n * produced by trustAs(), return the corresponding input value to trustAs. Basically, if\n * trustAs is wrapping the given values into some type, this operation unwraps it when given\n * such a value.\n *\n * - getTrusted(contextEnum, value)\n * This function should return the a value that is safe to use in the context specified by\n * contextEnum or throw and exception otherwise.\n *\n * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n * opaque or wrapped in some holder object. That happens to be an implementation detail. For\n * instance, an implementation could maintain a registry of all trusted objects by context. In\n * such a case, trustAs() would return the same object that was passed in. getTrusted() would\n * return the same object passed in if it was found in the registry under a compatible context or\n * throw an exception otherwise. An implementation might only wrap values some of the time based\n * on some criteria. getTrusted() might return a value and not throw an exception for special\n * constants or objects even if not wrapped. All such implementations fulfill this contract.\n *\n *\n * A note on the inheritance model for SCE contexts\n * ------------------------------------------------\n * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This\n * is purely an implementation details.\n *\n * The contract is simply this:\n *\n * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n * will also succeed.\n *\n * Inheritance happens to capture this in a natural way. In some future, we may not use\n * inheritance anymore. That is OK because no code outside of sce.js and sceSpecs.js would need to\n * be aware of this detail.\n */\n\n this.$get = ['$parse', '$sceDelegate', function(\n $parse, $sceDelegate) {\n // Support: IE 9-11 only\n // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow\n // the \"expression(javascript expression)\" syntax which is insecure.\n if (enabled && msie < 8) {\n throw $sceMinErr('iequirks',\n 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +\n 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +\n 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');\n }\n\n var sce = shallowCopy(SCE_CONTEXTS);\n\n /**\n * @ngdoc method\n * @name $sce#isEnabled\n * @kind function\n *\n * @return {Boolean} True if SCE is enabled, false otherwise. If you want to set the value, you\n * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n *\n * @description\n * Returns a boolean indicating if SCE is enabled.\n */\n sce.isEnabled = function() {\n return enabled;\n };\n sce.trustAs = $sceDelegate.trustAs;\n sce.getTrusted = $sceDelegate.getTrusted;\n sce.valueOf = $sceDelegate.valueOf;\n\n if (!enabled) {\n sce.trustAs = sce.getTrusted = function(type, value) { return value; };\n sce.valueOf = identity;\n }\n\n /**\n * @ngdoc method\n * @name $sce#parseAs\n *\n * @description\n * Converts Angular {@link guide/expression expression} into a function. This is like {@link\n * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it\n * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n * *result*)}\n *\n * @param {string} type The SCE context in which this result will be used.\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n sce.parseAs = function sceParseAs(type, expr) {\n var parsed = $parse(expr);\n if (parsed.literal && parsed.constant) {\n return parsed;\n } else {\n return $parse(expr, function(value) {\n return sce.getTrusted(type, value);\n });\n }\n };\n\n /**\n * @ngdoc method\n * @name $sce#trustAs\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, returns a\n * wrapped object that represents your value, and the trust you have in its safety for the given\n * context. AngularJS can then use that value as-is in bindings of the specified secure context.\n * This is used in bindings for `ng-bind-html`, `ng-include`, and most `src` attribute\n * interpolations. See {@link ng.$sce $sce} for strict contextual escaping.\n *\n * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,\n * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.\n *\n * @param {*} value The value that that should be considered trusted.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in the context you specified.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsHtml\n *\n * @description\n * Shorthand method. `$sce.trustAsHtml(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.HTML` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.HTML` context (like `ng-bind-html`).\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsCss\n *\n * @description\n * Shorthand method. `$sce.trustAsCss(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.CSS, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.CSS` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant\n * of your `value` in `$sce.CSS` context. This context is currently unused, so there are\n * almost no reasons to use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.URL` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.URL` context. That context is currently unused, so there are almost no reasons\n * to use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsResourceUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.RESOURCE_URL` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.RESOURCE_URL` context (template URLs in `ng-include`, most `src` attribute\n * bindings, ...)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsJs\n *\n * @description\n * Shorthand method. `$sce.trustAsJs(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.JS` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.JS` context. That context is currently unused, so there are almost no reasons to\n * use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrusted\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such,\n * takes any input, and either returns a value that's safe to use in the specified context,\n * or throws an exception. This function is aware of trusted values created by the `trustAs`\n * function and its shorthands, and when contexts are appropriate, returns the unwrapped value\n * as-is. Finally, this function can also throw when there is no way to turn `maybeTrusted` in a\n * safe value (e.g., no sanitization is available or possible.)\n *\n * @param {string} type The context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs\n * `$sce.trustAs`} call, or anything else (which will not be considered trusted.)\n * @return {*} A version of the value that's safe to use in the given context, or throws an\n * exception if this is impossible.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedHtml\n *\n * @description\n * Shorthand method. `$sce.getTrustedHtml(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedCss\n *\n * @description\n * Shorthand method. `$sce.getTrustedCss(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedResourceUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedResourceUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedJs\n *\n * @description\n * Shorthand method. `$sce.getTrustedJs(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.JS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsHtml\n *\n * @description\n * Shorthand method. `$sce.parseAsHtml(expression string)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsCss\n *\n * @description\n * Shorthand method. `$sce.parseAsCss(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsResourceUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsJs\n *\n * @description\n * Shorthand method. `$sce.parseAsJs(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n // Shorthand delegations.\n var parse = sce.parseAs,\n getTrusted = sce.getTrusted,\n trustAs = sce.trustAs;\n\n forEach(SCE_CONTEXTS, function(enumValue, name) {\n var lName = lowercase(name);\n sce[snakeToCamel('parse_as_' + lName)] = function(expr) {\n return parse(enumValue, expr);\n };\n sce[snakeToCamel('get_trusted_' + lName)] = function(value) {\n return getTrusted(enumValue, value);\n };\n sce[snakeToCamel('trust_as_' + lName)] = function(value) {\n return trustAs(enumValue, value);\n };\n });\n\n return sce;\n }];\n}\n\n/* exported $SnifferProvider */\n\n/**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n * @this\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\nfunction $SnifferProvider() {\n this.$get = ['$window', '$document', function($window, $document) {\n var eventSupport = {},\n // Chrome Packaged Apps are not allowed to access `history.pushState`.\n // If not sandboxed, they can be detected by the presence of `chrome.app.runtime`\n // (see https://developer.chrome.com/apps/api_index). If sandboxed, they can be detected by\n // the presence of an extension runtime ID and the absence of other Chrome runtime APIs\n // (see https://developer.chrome.com/apps/manifest/sandbox).\n // (NW.js apps have access to Chrome APIs, but do support `history`.)\n isNw = $window.nw && $window.nw.process,\n isChromePackagedApp =\n !isNw &&\n $window.chrome &&\n ($window.chrome.app && $window.chrome.app.runtime ||\n !$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id),\n hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState,\n android =\n toInt((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n document = $document[0] || {},\n bodyStyle = document.body && document.body.style,\n transitions = false,\n animations = false;\n\n if (bodyStyle) {\n // Support: Android <5, Blackberry Browser 10, default Chrome in Android 4.4.x\n // Mentioned browsers need a -webkit- prefix for transitions & animations.\n transitions = !!('transition' in bodyStyle || 'webkitTransition' in bodyStyle);\n animations = !!('animation' in bodyStyle || 'webkitAnimation' in bodyStyle);\n }\n\n\n return {\n // Android has history.pushState, but it does not update location correctly\n // so let's not use the history API at all.\n // http://code.google.com/p/android/issues/detail?id=17471\n // https://github.com/angular/angular.js/issues/904\n\n // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n // so let's not use the history API also\n // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n history: !!(hasHistoryPushState && !(android < 4) && !boxee),\n hasEvent: function(event) {\n // Support: IE 9-11 only\n // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n // it. In particular the event is not fired when backspace or delete key are pressed or\n // when cut operation is performed.\n // IE10+ implements 'input' event but it erroneously fires under various situations,\n // e.g. when placeholder changes, or a form is focused.\n if (event === 'input' && msie) return false;\n\n if (isUndefined(eventSupport[event])) {\n var divElm = document.createElement('div');\n eventSupport[event] = 'on' + event in divElm;\n }\n\n return eventSupport[event];\n },\n csp: csp(),\n transitions: transitions,\n animations: animations,\n android: android\n };\n }];\n}\n\nvar $templateRequestMinErr = minErr('$compile');\n\n/**\n * @ngdoc provider\n * @name $templateRequestProvider\n * @this\n *\n * @description\n * Used to configure the options passed to the {@link $http} service when making a template request.\n *\n * For example, it can be used for specifying the \"Accept\" header that is sent to the server, when\n * requesting a template.\n */\nfunction $TemplateRequestProvider() {\n\n var httpOptions;\n\n /**\n * @ngdoc method\n * @name $templateRequestProvider#httpOptions\n * @description\n * The options to be passed to the {@link $http} service when making the request.\n * You can use this to override options such as the \"Accept\" header for template requests.\n *\n * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the\n * options if not overridden here.\n *\n * @param {string=} value new value for the {@link $http} options.\n * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter.\n */\n this.httpOptions = function(val) {\n if (val) {\n httpOptions = val;\n return this;\n }\n return httpOptions;\n };\n\n /**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service runs security checks then downloads the provided template using\n * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request\n * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the\n * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the\n * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted\n * when `tpl` is of type string and `$templateCache` has the matching entry.\n *\n * If you want to pass custom options to the `$http` service, such as setting the Accept header you\n * can configure this via {@link $templateRequestProvider#httpOptions}.\n *\n * @param {string|TrustedResourceUrl} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} a promise for the HTTP response data of the given URL.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\n this.$get = ['$exceptionHandler', '$templateCache', '$http', '$q', '$sce',\n function($exceptionHandler, $templateCache, $http, $q, $sce) {\n\n function handleRequestFn(tpl, ignoreRequestError) {\n handleRequestFn.totalPendingRequests++;\n\n // We consider the template cache holds only trusted templates, so\n // there's no need to go through whitelisting again for keys that already\n // are included in there. This also makes Angular accept any script\n // directive, no matter its name. However, we still need to unwrap trusted\n // types.\n if (!isString(tpl) || isUndefined($templateCache.get(tpl))) {\n tpl = $sce.getTrustedResourceUrl(tpl);\n }\n\n var transformResponse = $http.defaults && $http.defaults.transformResponse;\n\n if (isArray(transformResponse)) {\n transformResponse = transformResponse.filter(function(transformer) {\n return transformer !== defaultHttpResponseTransform;\n });\n } else if (transformResponse === defaultHttpResponseTransform) {\n transformResponse = null;\n }\n\n return $http.get(tpl, extend({\n cache: $templateCache,\n transformResponse: transformResponse\n }, httpOptions))\n .finally(function() {\n handleRequestFn.totalPendingRequests--;\n })\n .then(function(response) {\n $templateCache.put(tpl, response.data);\n return response.data;\n }, handleError);\n\n function handleError(resp) {\n if (!ignoreRequestError) {\n resp = $templateRequestMinErr('tpload',\n 'Failed to load template: {0} (HTTP status: {1} {2})',\n tpl, resp.status, resp.statusText);\n\n $exceptionHandler(resp);\n }\n\n return $q.reject(resp);\n }\n }\n\n handleRequestFn.totalPendingRequests = 0;\n\n return handleRequestFn;\n }\n ];\n}\n\n/** @this */\nfunction $$TestabilityProvider() {\n this.$get = ['$rootScope', '$browser', '$location',\n function($rootScope, $browser, $location) {\n\n /**\n * @name $testability\n *\n * @description\n * The private $$testability service provides a collection of methods for use when debugging\n * or by automated test and debugging tools.\n */\n var testability = {};\n\n /**\n * @name $$testability#findBindings\n *\n * @description\n * Returns an array of elements that are bound (via ng-bind or {{}})\n * to expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The binding expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression. Filters and whitespace are ignored.\n */\n testability.findBindings = function(element, expression, opt_exactMatch) {\n var bindings = element.getElementsByClassName('ng-binding');\n var matches = [];\n forEach(bindings, function(binding) {\n var dataBinding = angular.element(binding).data('$binding');\n if (dataBinding) {\n forEach(dataBinding, function(bindingName) {\n if (opt_exactMatch) {\n var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n if (matcher.test(bindingName)) {\n matches.push(binding);\n }\n } else {\n if (bindingName.indexOf(expression) !== -1) {\n matches.push(binding);\n }\n }\n });\n }\n });\n return matches;\n };\n\n /**\n * @name $$testability#findModels\n *\n * @description\n * Returns an array of elements that are two-way found via ng-model to\n * expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The model expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression.\n */\n testability.findModels = function(element, expression, opt_exactMatch) {\n var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n for (var p = 0; p < prefixes.length; ++p) {\n var attributeEquals = opt_exactMatch ? '=' : '*=';\n var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n var elements = element.querySelectorAll(selector);\n if (elements.length) {\n return elements;\n }\n }\n };\n\n /**\n * @name $$testability#getLocation\n *\n * @description\n * Shortcut for getting the location in a browser agnostic way. Returns\n * the path, search, and hash. (e.g. /path?a=b#hash)\n */\n testability.getLocation = function() {\n return $location.url();\n };\n\n /**\n * @name $$testability#setLocation\n *\n * @description\n * Shortcut for navigating to a location without doing a full page reload.\n *\n * @param {string} url The location url (path, search and hash,\n * e.g. /path?a=b#hash) to go to.\n */\n testability.setLocation = function(url) {\n if (url !== $location.url()) {\n $location.url(url);\n $rootScope.$digest();\n }\n };\n\n /**\n * @name $$testability#whenStable\n *\n * @description\n * Calls the callback when $timeout and $http requests are completed.\n *\n * @param {function} callback\n */\n testability.whenStable = function(callback) {\n $browser.notifyWhenNoOutstandingRequests(callback);\n };\n\n return testability;\n }];\n}\n\n/** @this */\nfunction $TimeoutProvider() {\n this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',\n function($rootScope, $browser, $q, $$q, $exceptionHandler) {\n\n var deferreds = {};\n\n\n /**\n * @ngdoc service\n * @name $timeout\n *\n * @description\n * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n * block and delegates any exceptions to\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * The return value of calling `$timeout` is a promise, which will be resolved when\n * the delay has passed and the timeout function, if provided, is executed.\n *\n * To cancel a timeout request, call `$timeout.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n * synchronously flush the queue of deferred functions.\n *\n * If you only want a promise that will be resolved after some specified delay\n * then you can call `$timeout` without the `fn` function.\n *\n * @param {function()=} fn A function, whose execution should be delayed.\n * @param {number=} [delay=0] Delay in milliseconds.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise\n * will be resolved with the return value of the `fn` function.\n *\n */\n function timeout(fn, delay, invokeApply) {\n if (!isFunction(fn)) {\n invokeApply = delay;\n delay = fn;\n fn = noop;\n }\n\n var args = sliceArgs(arguments, 3),\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise,\n timeoutId;\n\n timeoutId = $browser.defer(function() {\n try {\n deferred.resolve(fn.apply(null, args));\n } catch (e) {\n deferred.reject(e);\n $exceptionHandler(e);\n } finally {\n delete deferreds[promise.$$timeoutId];\n }\n\n if (!skipApply) $rootScope.$apply();\n }, delay);\n\n promise.$$timeoutId = timeoutId;\n deferreds[timeoutId] = deferred;\n\n return promise;\n }\n\n\n /**\n * @ngdoc method\n * @name $timeout#cancel\n *\n * @description\n * Cancels a task associated with the `promise`. As a result of this, the promise will be\n * resolved with a rejection.\n *\n * @param {Promise=} promise Promise returned by the `$timeout` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n timeout.cancel = function(promise) {\n if (promise && promise.$$timeoutId in deferreds) {\n // Timeout cancels should not report an unhandled promise.\n markQExceptionHandled(deferreds[promise.$$timeoutId].promise);\n deferreds[promise.$$timeoutId].reject('canceled');\n delete deferreds[promise.$$timeoutId];\n return $browser.defer.cancel(promise.$$timeoutId);\n }\n return false;\n };\n\n return timeout;\n }];\n}\n\n// NOTE: The usage of window and document instead of $window and $document here is\n// deliberate. This service depends on the specific behavior of anchor nodes created by the\n// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n// cause us to break tests. In addition, when the browser resolves a URL for XHR, it\n// doesn't know about mocked locations and resolves URLs to the real document - which is\n// exactly the behavior needed here. There is little value is mocking these out for this\n// service.\nvar urlParsingNode = window.document.createElement('a');\nvar originUrl = urlResolve(window.location.href);\n\n\n/**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+ etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\nfunction urlResolve(url) {\n var href = url;\n\n // Support: IE 9-11 only\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/')\n ? urlParsingNode.pathname\n : '/' + urlParsingNode.pathname\n };\n}\n\n/**\n * Parse a request URL and determine whether this is a same-origin request as the application document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\nfunction urlIsSameOrigin(requestUrl) {\n var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n return (parsed.protocol === originUrl.protocol &&\n parsed.host === originUrl.host);\n}\n\n/**\n * @ngdoc service\n * @name $window\n * @this\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In angular we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope. Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n <example module=\"windowExample\" name=\"window-service\">\n <file name=\"index.html\">\n <script>\n angular.module('windowExample', [])\n .controller('ExampleController', ['$scope', '$window', function($scope, $window) {\n $scope.greeting = 'Hello, World!';\n $scope.doGreeting = function(greeting) {\n $window.alert(greeting);\n };\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <input type=\"text\" ng-model=\"greeting\" aria-label=\"greeting\" />\n <button ng-click=\"doGreeting(greeting)\">ALERT</button>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should display the greeting in the input box', function() {\n element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n // If we click the button it will block the test runner\n // element(':button').click();\n });\n </file>\n </example>\n */\nfunction $WindowProvider() {\n this.$get = valueFn(window);\n}\n\n/**\n * @name $$cookieReader\n * @requires $document\n *\n * @description\n * This is a private service for reading cookies used by $http and ngCookies\n *\n * @return {Object} a key/value map of the current cookies\n */\nfunction $$CookieReader($document) {\n var rawDocument = $document[0] || {};\n var lastCookies = {};\n var lastCookieString = '';\n\n function safeGetCookie(rawDocument) {\n try {\n return rawDocument.cookie || '';\n } catch (e) {\n return '';\n }\n }\n\n function safeDecodeURIComponent(str) {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n }\n\n return function() {\n var cookieArray, cookie, i, index, name;\n var currentCookieString = safeGetCookie(rawDocument);\n\n if (currentCookieString !== lastCookieString) {\n lastCookieString = currentCookieString;\n cookieArray = lastCookieString.split('; ');\n lastCookies = {};\n\n for (i = 0; i < cookieArray.length; i++) {\n cookie = cookieArray[i];\n index = cookie.indexOf('=');\n if (index > 0) { //ignore nameless cookies\n name = safeDecodeURIComponent(cookie.substring(0, index));\n // the first value that is seen for a cookie is the most\n // specific one. values for the same cookie name that\n // follow are for less specific paths.\n if (isUndefined(lastCookies[name])) {\n lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n }\n }\n }\n }\n return lastCookies;\n };\n}\n\n$$CookieReader.$inject = ['$document'];\n\n/** @this */\nfunction $$CookieReaderProvider() {\n this.$get = $$CookieReader;\n}\n\n/* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n/**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n *\n * ```js\n * // Filter registration\n * function MyModule($provide, $filterProvider) {\n * // create a service to demonstrate injection (not always needed)\n * $provide.value('greet', function(name){\n * return 'Hello ' + name + '!';\n * });\n *\n * // register a filter factory which uses the\n * // greet service to demonstrate DI.\n * $filterProvider.register('greet', function(greet){\n * // return the filter function which uses the greet service\n * // to generate salutation\n * return function(text) {\n * // filters need to be forgiving so check input validity\n * return text && greet(text) || text;\n * };\n * });\n * }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n * it('should be the same instance', inject(\n * function($filterProvider) {\n * $filterProvider.register('reverse', function(){\n * return ...;\n * });\n * },\n * function($filter, reverseFilter) {\n * expect($filter('reverse')).toBe(reverseFilter);\n * });\n * ```\n *\n *\n * For more information about how angular filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the Angular Developer Guide.\n */\n\n/**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * They can be used in view templates, controllers or services.Angular comes\n * with a collection of [built-in filters](api/ng/filter), but it is easy to\n * define your own as well.\n *\n * The general syntax in templates is as follows:\n *\n * ```html\n * {{ expression [| filter_name[:parameter_value] ... ] }}\n * ```\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n <example name=\"$filter\" module=\"filterExample\">\n <file name=\"index.html\">\n <div ng-controller=\"MainCtrl\">\n <h3>{{ originalText }}</h3>\n <h3>{{ filteredText }}</h3>\n </div>\n </file>\n\n <file name=\"script.js\">\n angular.module('filterExample', [])\n .controller('MainCtrl', function($scope, $filter) {\n $scope.originalText = 'hello';\n $scope.filteredText = $filter('uppercase')($scope.originalText);\n });\n </file>\n </example>\n */\n$FilterProvider.$inject = ['$provide'];\n/** @this */\nfunction $FilterProvider($provide) {\n var suffix = 'Filter';\n\n /**\n * @ngdoc method\n * @name $filterProvider#register\n * @param {string|Object} name Name of the filter function, or an object map of filters where\n * the keys are the filter names and the values are the filter factories.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.\n * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n * of the registered filter instances.\n */\n function register(name, factory) {\n if (isObject(name)) {\n var filters = {};\n forEach(name, function(filter, key) {\n filters[key] = register(key, filter);\n });\n return filters;\n } else {\n return $provide.factory(name + suffix, factory);\n }\n }\n this.register = register;\n\n this.$get = ['$injector', function($injector) {\n return function(name) {\n return $injector.get(name + suffix);\n };\n }];\n\n ////////////////////////////////////////\n\n /* global\n currencyFilter: false,\n dateFilter: false,\n filterFilter: false,\n jsonFilter: false,\n limitToFilter: false,\n lowercaseFilter: false,\n numberFilter: false,\n orderByFilter: false,\n uppercaseFilter: false\n */\n\n register('currency', currencyFilter);\n register('date', dateFilter);\n register('filter', filterFilter);\n register('json', jsonFilter);\n register('limitTo', limitToFilter);\n register('lowercase', lowercaseFilter);\n register('number', numberFilter);\n register('orderBy', orderByFilter);\n register('uppercase', uppercaseFilter);\n}\n\n/**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n * <div class=\"alert alert-info\">\n * **Note**: If the array contains objects that reference themselves, filtering is not possible.\n * </div>\n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n * `array`.\n *\n * Can be one of:\n *\n * - `string`: The string is used for matching against the contents of the `array`. All strings or\n * objects with string properties in `array` that match this string will be returned. This also\n * applies to nested object properties.\n * The predicate can be negated by prefixing the string with `!`.\n *\n * - `Object`: A pattern object can be used to filter specific properties on objects contained\n * by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n * which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n * property name (`$` by default) can be used (e.g. as in `{$: \"text\"}`) to accept a match\n * against any property of the object or its nested object properties. That's equivalent to the\n * simple substring match with a `string` as described above. The special property name can be\n * overwritten, using the `anyPropertyKey` parameter.\n * The predicate can be negated by prefixing the string with `!`.\n * For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n * not containing \"M\".\n *\n * Note that a named property will match properties on the same level only, while the special\n * `$` property will match properties on the same level or deeper. E.g. an array item like\n * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n * **will** be matched by `{$: 'John'}`.\n *\n * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.\n * The function is called for each element of the array, with the element, its index, and\n * the entire array itself as arguments.\n *\n * The final result is an array of those elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|false} [comparator] Comparator which is used in\n * determining if values retrieved using `expression` (when it is not a function) should be\n * considered a match based on the expected value (from the filter expression) and actual\n * value (from the object in the array).\n *\n * Can be one of:\n *\n * - `function(actual, expected)`:\n * The function will be given the object value and the predicate value to compare and\n * should return true if both values should be considered equal.\n *\n * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n * This is essentially strict comparison of expected and actual.\n *\n * - `false`: A short hand for a function which will look for a substring match in a case\n * insensitive way. Primitive values are converted to strings. Objects are not compared against\n * primitives, unless they have a custom `toString` method (e.g. `Date` objects).\n *\n *\n * Defaults to `false`.\n *\n * @param {string} [anyPropertyKey] The special property name that matches against any property.\n * By default `$`.\n *\n * @example\n <example name=\"filter-filter\">\n <file name=\"index.html\">\n <div ng-init=\"friends = [{name:'John', phone:'555-1276'},\n {name:'Mary', phone:'800-BIG-MARY'},\n {name:'Mike', phone:'555-4321'},\n {name:'Adam', phone:'555-5678'},\n {name:'Julie', phone:'555-8765'},\n {name:'Juliette', phone:'555-5678'}]\"></div>\n\n <label>Search: <input ng-model=\"searchText\"></label>\n <table id=\"searchTextResults\">\n <tr><th>Name</th><th>Phone</th></tr>\n <tr ng-repeat=\"friend in friends | filter:searchText\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n </tr>\n </table>\n <hr>\n <label>Any: <input ng-model=\"search.$\"></label> <br>\n <label>Name only <input ng-model=\"search.name\"></label><br>\n <label>Phone only <input ng-model=\"search.phone\"></label><br>\n <label>Equality <input type=\"checkbox\" ng-model=\"strict\"></label><br>\n <table id=\"searchObjResults\">\n <tr><th>Name</th><th>Phone</th></tr>\n <tr ng-repeat=\"friendObj in friends | filter:search:strict\">\n <td>{{friendObj.name}}</td>\n <td>{{friendObj.phone}}</td>\n </tr>\n </table>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var expectFriendNames = function(expectedNames, key) {\n element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n arr.forEach(function(wd, i) {\n expect(wd.getText()).toMatch(expectedNames[i]);\n });\n });\n };\n\n it('should search across all fields when filtering with a string', function() {\n var searchText = element(by.model('searchText'));\n searchText.clear();\n searchText.sendKeys('m');\n expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n\n searchText.clear();\n searchText.sendKeys('76');\n expectFriendNames(['John', 'Julie'], 'friend');\n });\n\n it('should search in specific fields when filtering with a predicate object', function() {\n var searchAny = element(by.model('search.$'));\n searchAny.clear();\n searchAny.sendKeys('i');\n expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n });\n it('should use a equal comparison when comparator is true', function() {\n var searchName = element(by.model('search.name'));\n var strict = element(by.model('strict'));\n searchName.clear();\n searchName.sendKeys('Julie');\n strict.click();\n expectFriendNames(['Julie'], 'friendObj');\n });\n </file>\n </example>\n */\n\nfunction filterFilter() {\n return function(array, expression, comparator, anyPropertyKey) {\n if (!isArrayLike(array)) {\n if (array == null) {\n return array;\n } else {\n throw minErr('filter')('notarray', 'Expected array but received: {0}', array);\n }\n }\n\n anyPropertyKey = anyPropertyKey || '$';\n var expressionType = getTypeForFilter(expression);\n var predicateFn;\n var matchAgainstAnyProp;\n\n switch (expressionType) {\n case 'function':\n predicateFn = expression;\n break;\n case 'boolean':\n case 'null':\n case 'number':\n case 'string':\n matchAgainstAnyProp = true;\n // falls through\n case 'object':\n predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n break;\n default:\n return array;\n }\n\n return Array.prototype.filter.call(array, predicateFn);\n };\n}\n\n// Helper functions for `filterFilter`\nfunction createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}\n\nfunction deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) {\n var actualType = getTypeForFilter(actual);\n var expectedType = getTypeForFilter(expected);\n\n if ((expectedType === 'string') && (expected.charAt(0) === '!')) {\n return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp);\n } else if (isArray(actual)) {\n // In case `actual` is an array, consider it a match\n // if ANY of it's items matches `expected`\n return actual.some(function(item) {\n return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp);\n });\n }\n\n switch (actualType) {\n case 'object':\n var key;\n if (matchAgainstAnyProp) {\n for (key in actual) {\n // Under certain, rare, circumstances, key may not be a string and `charAt` will be undefined\n // See: https://github.com/angular/angular.js/issues/15644\n if (key.charAt && (key.charAt(0) !== '$') &&\n deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) {\n return true;\n }\n }\n return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false);\n } else if (expectedType === 'object') {\n for (key in expected) {\n var expectedVal = expected[key];\n if (isFunction(expectedVal) || isUndefined(expectedVal)) {\n continue;\n }\n\n var matchAnyProperty = key === anyPropertyKey;\n var actualVal = matchAnyProperty ? actual : actual[key];\n if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) {\n return false;\n }\n }\n return true;\n } else {\n return comparator(actual, expected);\n }\n case 'function':\n return false;\n default:\n return comparator(actual, expected);\n }\n}\n\n// Used for easily differentiating between `null` and actual `object`\nfunction getTypeForFilter(val) {\n return (val === null) ? 'null' : typeof val;\n}\n\nvar MAX_DIGITS = 22;\nvar DECIMAL_SEP = '.';\nvar ZERO_CHAR = '0';\n\n/**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n <example module=\"currencyExample\" name=\"currency-filter\">\n <file name=\"index.html\">\n <script>\n angular.module('currencyExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.amount = 1234.56;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <input type=\"number\" ng-model=\"amount\" aria-label=\"amount\"> <br>\n default currency symbol ($): <span id=\"currency-default\">{{amount | currency}}</span><br>\n custom currency identifier (USD$): <span id=\"currency-custom\">{{amount | currency:\"USD$\"}}</span><br>\n no fractions (0): <span id=\"currency-no-fractions\">{{amount | currency:\"USD$\":0}}</span>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should init with 1234.56', function() {\n expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n });\n it('should update', function() {\n if (browser.params.browser === 'safari') {\n // Safari does not understand the minus key. See\n // https://github.com/angular/protractor/issues/481\n return;\n }\n element(by.model('amount')).clear();\n element(by.model('amount')).sendKeys('-1234');\n expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');\n expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');\n });\n </file>\n </example>\n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(amount, currencySymbol, fractionSize) {\n if (isUndefined(currencySymbol)) {\n currencySymbol = formats.CURRENCY_SYM;\n }\n\n if (isUndefined(fractionSize)) {\n fractionSize = formats.PATTERNS[1].maxFrac;\n }\n\n // if null or undefined pass it through\n return (amount == null)\n ? amount\n : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).\n replace(/\\u00A4/g, currencySymbol);\n };\n}\n\n/**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is null or undefined, it will just be returned.\n * If the input is infinite (Infinity or -Infinity), the Infinity symbol '∞' or '-∞' is returned, respectively.\n * If the input is not a number an empty string is returned.\n *\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to `fractionSize` appropriately formatted based on the current\n * locale (e.g., in the en_US locale it will have \".\" as the decimal separator and\n * include \",\" group separators after each third digit).\n *\n * @example\n <example module=\"numberFilterExample\" name=\"number-filter\">\n <file name=\"index.html\">\n <script>\n angular.module('numberFilterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.val = 1234.56789;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Enter number: <input ng-model='val'></label><br>\n Default formatting: <span id='number-default'>{{val | number}}</span><br>\n No fractions: <span>{{val | number:0}}</span><br>\n Negative number: <span>{{-val | number:4}}</span>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should format numbers', function() {\n expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n });\n\n it('should update', function() {\n element(by.model('val')).clear();\n element(by.model('val')).sendKeys('3374.333');\n expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n });\n </file>\n </example>\n */\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(number, fractionSize) {\n\n // if null or undefined pass it through\n return (number == null)\n ? number\n : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,\n fractionSize);\n };\n}\n\n/**\n * Parse a number (as a string) into three components that can be used\n * for formatting the number.\n *\n * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/)\n *\n * @param {string} numStr The number to parse\n * @return {object} An object describing this number, containing the following keys:\n * - d : an array of digits containing leading zeros as necessary\n * - i : the number of the digits in `d` that are to the left of the decimal point\n * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d`\n *\n */\nfunction parse(numStr) {\n var exponent = 0, digits, numberOfIntegerDigits;\n var i, j, zeros;\n\n // Decimal point?\n if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i;\n numberOfIntegerDigits += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (numberOfIntegerDigits < 0) {\n // There was no decimal point or exponent so it is an integer.\n numberOfIntegerDigits = numStr.length;\n }\n\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */ }\n\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n numberOfIntegerDigits = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;\n\n // Trailing zeros are insignificant so ignore them\n numberOfIntegerDigits -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n\n // If the number overflows the maximum allowed digits then use an exponent.\n if (numberOfIntegerDigits > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = numberOfIntegerDigits - 1;\n numberOfIntegerDigits = 1;\n }\n\n return { d: digits, e: exponent, i: numberOfIntegerDigits };\n}\n\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changed the parsedNumber in-place\n */\nfunction roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.i, roundAt));\n\n // Set non-fractional digits beyond `roundAt` to 0\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.i = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var i = 1; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.i++;\n }\n digits.unshift(1);\n parsedNumber.i++;\n } else {\n digits[roundAt - 1]++;\n }\n }\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function(carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n}\n\n/**\n * Format a number into a string\n * @param {number} number The number to format\n * @param {{\n * minFrac, // the minimum number of digits required in the fraction part of the number\n * maxFrac, // the maximum number of digits required in the fraction part of the number\n * gSize, // number of digits in each group of separated digits\n * lgSize, // number of digits in the last group of digits before the decimal separator\n * negPre, // the string to go in front of a negative number (e.g. `-` or `(`))\n * posPre, // the string to go in front of a positive number\n * negSuf, // the string to go after a negative number (e.g. `)`)\n * posSuf // the string to go after a positive number\n * }} pattern\n * @param {string} groupSep The string to separate groups of number (e.g. `,`)\n * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`)\n * @param {[type]} fractionSize The size of the fractional part of the number\n * @return {string} The number formatted as a string\n */\nfunction formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n\n if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';\n\n var isInfinity = !isFinite(number);\n var isZero = false;\n var numStr = Math.abs(number) + '',\n formattedText = '',\n parsedNumber;\n\n if (isInfinity) {\n formattedText = '\\u221e';\n } else {\n parsedNumber = parse(numStr);\n\n roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac);\n\n var digits = parsedNumber.d;\n var integerLen = parsedNumber.i;\n var exponent = parsedNumber.e;\n var decimals = [];\n isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true);\n\n // pad zeros for small numbers\n while (integerLen < 0) {\n digits.unshift(0);\n integerLen++;\n }\n\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n } else {\n decimals = digits;\n digits = [0];\n }\n\n // format the integer digits with grouping separators\n var groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n formattedText = groups.join(groupSep);\n\n // append the decimal digits\n if (decimals.length) {\n formattedText += decimalSep + decimals.join('');\n }\n\n if (exponent) {\n formattedText += 'e+' + exponent;\n }\n }\n if (number < 0 && !isZero) {\n return pattern.negPre + formattedText + pattern.negSuf;\n } else {\n return pattern.posPre + formattedText + pattern.posSuf;\n }\n}\n\nfunction padNumber(num, digits, trim, negWrap) {\n var neg = '';\n if (num < 0 || (negWrap && num <= 0)) {\n if (negWrap) {\n num = -num + 1;\n } else {\n num = -num;\n neg = '-';\n }\n }\n num = '' + num;\n while (num.length < digits) num = ZERO_CHAR + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n}\n\n\nfunction dateGetter(name, size, offset, trim, negWrap) {\n offset = offset || 0;\n return function(date) {\n var value = date['get' + name]();\n if (offset > 0 || value > -offset) {\n value += offset;\n }\n if (value === 0 && offset === -12) value = 12;\n return padNumber(value, size, trim, negWrap);\n };\n}\n\nfunction dateStrGetter(name, shortForm, standAlone) {\n return function(date, formats) {\n var value = date['get' + name]();\n var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : '');\n var get = uppercase(propPrefix + name);\n\n return formats[get][value];\n };\n}\n\nfunction timeZoneGetter(date, formats, offset) {\n var zone = -1 * offset;\n var paddedZone = (zone >= 0) ? '+' : '';\n\n paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +\n padNumber(Math.abs(zone % 60), 2);\n\n return paddedZone;\n}\n\nfunction getFirstThursdayOfYear(year) {\n // 0 = index of January\n var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();\n // 4 = index of Thursday (+1 to account for 1st = 5)\n // 11 = index of *next* Thursday (+1 account for 1st = 12)\n return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);\n}\n\nfunction getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(),\n // 4 = index of Thursday\n datetime.getDate() + (4 - datetime.getDay()));\n}\n\nfunction weekGetter(size) {\n return function(date) {\n var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n thisThurs = getThursdayThisWeek(date);\n\n var diff = +thisThurs - +firstThurs,\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n return padNumber(result, size);\n };\n}\n\nfunction ampmGetter(date, formats) {\n return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n}\n\nfunction eraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];\n}\n\nfunction longEraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];\n}\n\nvar DATE_FORMATS = {\n yyyy: dateGetter('FullYear', 4, 0, false, true),\n yy: dateGetter('FullYear', 2, 0, true, true),\n y: dateGetter('FullYear', 1, 0, false, true),\n MMMM: dateStrGetter('Month'),\n MMM: dateStrGetter('Month', true),\n MM: dateGetter('Month', 2, 1),\n M: dateGetter('Month', 1, 1),\n LLLL: dateStrGetter('Month', false, true),\n dd: dateGetter('Date', 2),\n d: dateGetter('Date', 1),\n HH: dateGetter('Hours', 2),\n H: dateGetter('Hours', 1),\n hh: dateGetter('Hours', 2, -12),\n h: dateGetter('Hours', 1, -12),\n mm: dateGetter('Minutes', 2),\n m: dateGetter('Minutes', 1),\n ss: dateGetter('Seconds', 2),\n s: dateGetter('Seconds', 1),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n sss: dateGetter('Milliseconds', 3),\n EEEE: dateStrGetter('Day'),\n EEE: dateStrGetter('Day', true),\n a: ampmGetter,\n Z: timeZoneGetter,\n ww: weekGetter(2),\n w: weekGetter(1),\n G: eraGetter,\n GG: eraGetter,\n GGG: eraGetter,\n GGGG: longEraGetter\n};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\\s\\S]*)/,\n NUMBER_STRING = /^-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n * Formats `date` to a string based on the requested `format`.\n *\n * `format` string can be composed of the following elements:\n *\n * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n * * `'MMMM'`: Month in year (January-December)\n * * `'MMM'`: Month in year (Jan-Dec)\n * * `'MM'`: Month in year, padded (01-12)\n * * `'M'`: Month in year (1-12)\n * * `'LLLL'`: Stand-alone month in year (January-December)\n * * `'dd'`: Day in month, padded (01-31)\n * * `'d'`: Day in month (1-31)\n * * `'EEEE'`: Day in Week,(Sunday-Saturday)\n * * `'EEE'`: Day in Week, (Sun-Sat)\n * * `'HH'`: Hour in day, padded (00-23)\n * * `'H'`: Hour in day (0-23)\n * * `'hh'`: Hour in AM/PM, padded (01-12)\n * * `'h'`: Hour in AM/PM, (1-12)\n * * `'mm'`: Minute in hour, padded (00-59)\n * * `'m'`: Minute in hour (0-59)\n * * `'ss'`: Second in minute, padded (00-59)\n * * `'s'`: Second in minute (0-59)\n * * `'sss'`: Millisecond in second, padded (000-999)\n * * `'a'`: AM/PM marker\n * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')\n * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')\n *\n * `format` string can also be one of the following predefined\n * {@link guide/i18n localizable formats}:\n *\n * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n * (e.g. Sep 3, 2010 12:05:08 PM)\n * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM)\n * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale\n * (e.g. Friday, September 3, 2010)\n * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010)\n * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)\n * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n * `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n * (e.g. `\"h 'o''clock'\"`).\n *\n * Any other characters in the `format` string will be output as-is.\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n * specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n * `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n <example name=\"filter-date\">\n <file name=\"index.html\">\n <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:\n <span>{{1288323623006 | date:'medium'}}</span><br>\n <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:\n <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>\n <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:\n <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>\n <span ng-non-bindable>{{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}</span>:\n <span>{{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}</span><br>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should format date', function() {\n expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n toMatch(/2010-10-2\\d \\d{2}:\\d{2}:\\d{2} (-|\\+)?\\d{4}/);\n expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n });\n </file>\n </example>\n */\ndateFilter.$inject = ['$locale'];\nfunction dateFilter($locale) {\n\n\n var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n // 1 2 3 4 5 6 7 8 9 10 11\n function jsonStringToDate(string) {\n var match;\n if ((match = string.match(R_ISO8601_STR))) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n var h = toInt(match[4] || 0) - tzHour;\n var m = toInt(match[5] || 0) - tzMin;\n var s = toInt(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }\n return string;\n }\n\n\n return function(date, format, timezone) {\n var text = '',\n parts = [],\n fn, match;\n\n format = format || 'mediumDate';\n format = $locale.DATETIME_FORMATS[format] || format;\n if (isString(date)) {\n date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);\n }\n\n if (isNumber(date)) {\n date = new Date(date);\n }\n\n if (!isDate(date) || !isFinite(date.getTime())) {\n return date;\n }\n\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = concat(parts, match, 1);\n format = parts.pop();\n } else {\n parts.push(format);\n format = null;\n }\n }\n\n var dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n forEach(parts, function(value) {\n fn = DATE_FORMATS[value];\n text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)\n : value === '\\'\\'' ? '\\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n });\n\n return text;\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n * Allows you to convert a JavaScript object into JSON string.\n *\n * This filter is mostly useful for debugging. When using the double curly {{value}} notation\n * the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n <example name=\"filter-json\">\n <file name=\"index.html\">\n <pre id=\"default-spacing\">{{ {'name':'value'} | json }}</pre>\n <pre id=\"custom-spacing\">{{ {'name':'value'} | json:4 }}</pre>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should jsonify filtered objects', function() {\n expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n {2}\"name\": ?\"value\"\\n}/);\n expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n {4}\"name\": ?\"value\"\\n}/);\n });\n </file>\n </example>\n *\n */\nfunction jsonFilter() {\n return function(object, spacing) {\n if (isUndefined(spacing)) {\n spacing = 2;\n }\n return toJson(object, spacing);\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n *\n * See the {@link ng.uppercase uppercase filter documentation} for a functionally identical example.\n *\n * @see angular.lowercase\n */\nvar lowercaseFilter = valueFn(lowercase);\n\n\n/**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @example\n <example module=\"uppercaseFilterExample\" name=\"filter-uppercase\">\n <file name=\"index.html\">\n <script>\n angular.module('uppercaseFilterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.title = 'This is a title';\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <!-- This title should be formatted normally -->\n <h1>{{title}}</h1>\n <!-- This title should be capitalized -->\n <h1>{{title | uppercase}}</h1>\n </div>\n </file>\n </example>\n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements are\n * taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. Other array-like objects are also supported\n * (e.g. array subclasses, NodeLists, jqLite/jQuery collections etc). If a number is used as input,\n * it is converted to a string.\n *\n * @param {Array|ArrayLike|string|number} input - Array/array-like, string or number to be limited.\n * @param {string|number} limit - The length of the returned array or string. If the `limit` number\n * is positive, `limit` number of items from the beginning of the source array/string are copied.\n * If the number is negative, `limit` number of items from the end of the source array/string\n * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,\n * the input will be returned unchanged.\n * @param {(string|number)=} begin - Index at which to begin limitation. As a negative index,\n * `begin` indicates an offset from the end of `input`. Defaults to `0`.\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if the input had\n * less than `limit` elements.\n *\n * @example\n <example module=\"limitToExample\" name=\"limit-to-filter\">\n <file name=\"index.html\">\n <script>\n angular.module('limitToExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.numbers = [1,2,3,4,5,6,7,8,9];\n $scope.letters = \"abcdefghi\";\n $scope.longNumber = 2345432342;\n $scope.numLimit = 3;\n $scope.letterLimit = 3;\n $scope.longNumberLimit = 3;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>\n Limit {{numbers}} to:\n <input type=\"number\" step=\"1\" ng-model=\"numLimit\">\n </label>\n <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>\n <label>\n Limit {{letters}} to:\n <input type=\"number\" step=\"1\" ng-model=\"letterLimit\">\n </label>\n <p>Output letters: {{ letters | limitTo:letterLimit }}</p>\n <label>\n Limit {{longNumber}} to:\n <input type=\"number\" step=\"1\" ng-model=\"longNumberLimit\">\n </label>\n <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var numLimitInput = element(by.model('numLimit'));\n var letterLimitInput = element(by.model('letterLimit'));\n var longNumberLimitInput = element(by.model('longNumberLimit'));\n var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n\n it('should limit the number array to first three items', function() {\n expect(numLimitInput.getAttribute('value')).toBe('3');\n expect(letterLimitInput.getAttribute('value')).toBe('3');\n expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n expect(limitedLetters.getText()).toEqual('Output letters: abc');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n });\n\n // There is a bug in safari and protractor that doesn't like the minus key\n // it('should update the output when -3 is entered', function() {\n // numLimitInput.clear();\n // numLimitInput.sendKeys('-3');\n // letterLimitInput.clear();\n // letterLimitInput.sendKeys('-3');\n // longNumberLimitInput.clear();\n // longNumberLimitInput.sendKeys('-3');\n // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n // expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n // expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n // });\n\n it('should not exceed the maximum size of input array', function() {\n numLimitInput.clear();\n numLimitInput.sendKeys('100');\n letterLimitInput.clear();\n letterLimitInput.sendKeys('100');\n longNumberLimitInput.clear();\n longNumberLimitInput.sendKeys('100');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n });\n </file>\n </example>\n*/\nfunction limitToFilter() {\n return function(input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = toInt(limit);\n }\n if (isNumberNaN(limit)) return input;\n\n if (isNumber(input)) input = input.toString();\n if (!isArrayLike(input)) return input;\n\n begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);\n begin = (begin < 0) ? Math.max(0, input.length + begin) : begin;\n\n if (limit >= 0) {\n return sliceFn(input, begin, begin + limit);\n } else {\n if (begin === 0) {\n return sliceFn(input, limit, input.length);\n } else {\n return sliceFn(input, Math.max(0, begin + limit), begin);\n }\n }\n };\n}\n\nfunction sliceFn(input, begin, end) {\n if (isString(input)) return input.slice(begin, end);\n\n return slice.call(input, begin, end);\n}\n\n/**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Returns an array containing the items from the specified `collection`, ordered by a `comparator`\n * function based on the values computed using the `expression` predicate.\n *\n * For example, `[{id: 'foo'}, {id: 'bar'}] | orderBy:'id'` would result in\n * `[{id: 'bar'}, {id: 'foo'}]`.\n *\n * The `collection` can be an Array or array-like object (e.g. NodeList, jQuery object, TypedArray,\n * String, etc).\n *\n * The `expression` can be a single predicate, or a list of predicates each serving as a tie-breaker\n * for the preceding one. The `expression` is evaluated against each item and the output is used\n * for comparing with other items.\n *\n * You can change the sorting order by setting `reverse` to `true`. By default, items are sorted in\n * ascending order.\n *\n * The comparison is done using the `comparator` function. If none is specified, a default, built-in\n * comparator is used (see below for details - in a nutshell, it compares numbers numerically and\n * strings alphabetically).\n *\n * ### Under the hood\n *\n * Ordering the specified `collection` happens in two phases:\n *\n * 1. All items are passed through the predicate (or predicates), and the returned values are saved\n * along with their type (`string`, `number` etc). For example, an item `{label: 'foo'}`, passed\n * through a predicate that extracts the value of the `label` property, would be transformed to:\n * ```\n * {\n * value: 'foo',\n * type: 'string',\n * index: ...\n * }\n * ```\n * 2. The comparator function is used to sort the items, based on the derived values, types and\n * indices.\n *\n * If you use a custom comparator, it will be called with pairs of objects of the form\n * `{value: ..., type: '...', index: ...}` and is expected to return `0` if the objects are equal\n * (as far as the comparator is concerned), `-1` if the 1st one should be ranked higher than the\n * second, or `1` otherwise.\n *\n * In order to ensure that the sorting will be deterministic across platforms, if none of the\n * specified predicates can distinguish between two items, `orderBy` will automatically introduce a\n * dummy predicate that returns the item's index as `value`.\n * (If you are using a custom comparator, make sure it can handle this predicate as well.)\n *\n * If a custom comparator still can't distinguish between two items, then they will be sorted based\n * on their index using the built-in comparator.\n *\n * Finally, in an attempt to simplify things, if a predicate returns an object as the extracted\n * value for an item, `orderBy` will try to convert that object to a primitive value, before passing\n * it to the comparator. The following rules govern the conversion:\n *\n * 1. If the object has a `valueOf()` method that returns a primitive, its return value will be\n * used instead.<br />\n * (If the object has a `valueOf()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 2. If the object has a custom `toString()` method (i.e. not the one inherited from `Object`) that\n * returns a primitive, its return value will be used instead.<br />\n * (If the object has a `toString()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 3. No conversion; the object itself is used.\n *\n * ### The default comparator\n *\n * The default, built-in comparator should be sufficient for most usecases. In short, it compares\n * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to\n * using their index in the original collection, and sorts values of different types by type.\n *\n * More specifically, it follows these steps to determine the relative order of items:\n *\n * 1. If the compared values are of different types, compare the types themselves alphabetically.\n * 2. If both values are of type `string`, compare them alphabetically in a case- and\n * locale-insensitive way.\n * 3. If both values are objects, compare their indices instead.\n * 4. Otherwise, return:\n * - `0`, if the values are equal (by strict equality comparison, i.e. using `===`).\n * - `-1`, if the 1st value is \"less than\" the 2nd value (compared using the `<` operator).\n * - `1`, otherwise.\n *\n * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being\n * saved as numbers and not strings.\n * **Note:** For the purpose of sorting, `null` values are treated as the string `'null'` (i.e.\n * `type: 'string'`, `value: 'null'`). This may cause unexpected sort order relative to\n * other values.\n *\n * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort.\n * @param {(Function|string|Array.<Function|string>)=} expression - A predicate (or list of\n * predicates) to be used by the comparator to determine the order of elements.\n *\n * Can be one of:\n *\n * - `Function`: A getter function. This function will be called with each item as argument and\n * the return value will be used for sorting.\n * - `string`: An Angular expression. This expression will be evaluated against each item and the\n * result will be used for sorting. For example, use `'label'` to sort by a property called\n * `label` or `'label.substring(0, 3)'` to sort by the first 3 characters of the `label`\n * property.<br />\n * (The result of a constant expression is interpreted as a property name to be used for\n * comparison. For example, use `'\"special name\"'` (note the extra pair of quotes) to sort by a\n * property called `special name`.)<br />\n * An expression can be optionally prefixed with `+` or `-` to control the sorting direction,\n * ascending or descending. For example, `'+label'` or `'-label'`. If no property is provided,\n * (e.g. `'+'` or `'-'`), the collection element itself is used in comparisons.\n * - `Array`: An array of function and/or string predicates. If a predicate cannot determine the\n * relative order of two items, the next predicate is used as a tie-breaker.\n *\n * **Note:** If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse - If `true`, reverse the sorting order.\n * @param {(Function)=} comparator - The comparator function used to determine the relative order of\n * value pairs. If omitted, the built-in comparator will be used.\n *\n * @returns {Array} - The sorted array.\n *\n *\n * @example\n * ### Ordering a table with `ngRepeat`\n *\n * The example below demonstrates a simple {@link ngRepeat ngRepeat}, where the data is sorted by\n * age in descending order (expression is set to `'-age'`). The `comparator` is not set, which means\n * it defaults to the built-in comparator.\n *\n <example name=\"orderBy-static\" module=\"orderByExample1\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <table class=\"friends\">\n <tr>\n <th>Name</th>\n <th>Phone Number</th>\n <th>Age</th>\n </tr>\n <tr ng-repeat=\"friend in friends | orderBy:'-age'\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n <td>{{friend.age}}</td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('orderByExample1', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n }]);\n </file>\n <file name=\"style.css\">\n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n // Element locators\n var names = element.all(by.repeater('friends').column('friend.name'));\n\n it('should sort friends by age in reverse order', function() {\n expect(names.get(0).getText()).toBe('Adam');\n expect(names.get(1).getText()).toBe('Julie');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('John');\n });\n </file>\n </example>\n * <hr />\n *\n * @example\n * ### Changing parameters dynamically\n *\n * All parameters can be changed dynamically. The next example shows how you can make the columns of\n * a table sortable, by binding the `expression` and `reverse` parameters to scope properties.\n *\n <example name=\"orderBy-dynamic\" module=\"orderByExample2\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <pre>Sort by = {{propertyName}}; reverse = {{reverse}}</pre>\n <hr/>\n <button ng-click=\"propertyName = null; reverse = false\">Set to unsorted</button>\n <hr/>\n <table class=\"friends\">\n <tr>\n <th>\n <button ng-click=\"sortBy('name')\">Name</button>\n <span class=\"sortorder\" ng-show=\"propertyName === 'name'\" ng-class=\"{reverse: reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"sortBy('phone')\">Phone Number</button>\n <span class=\"sortorder\" ng-show=\"propertyName === 'phone'\" ng-class=\"{reverse: reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"sortBy('age')\">Age</button>\n <span class=\"sortorder\" ng-show=\"propertyName === 'age'\" ng-class=\"{reverse: reverse}\"></span>\n </th>\n </tr>\n <tr ng-repeat=\"friend in friends | orderBy:propertyName:reverse\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n <td>{{friend.age}}</td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('orderByExample2', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n\n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = friends;\n\n $scope.sortBy = function(propertyName) {\n $scope.reverse = ($scope.propertyName === propertyName) ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n };\n }]);\n </file>\n <file name=\"style.css\">\n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n\n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n\n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n\n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n\n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n </file>\n </example>\n * <hr />\n *\n * @example\n * ### Using `orderBy` inside a controller\n *\n * It is also possible to call the `orderBy` filter manually, by injecting `orderByFilter`, and\n * calling it with the desired parameters. (Alternatively, you could inject the `$filter` factory\n * and retrieve the `orderBy` filter with `$filter('orderBy')`.)\n *\n <example name=\"orderBy-call-manually\" module=\"orderByExample3\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <pre>Sort by = {{propertyName}}; reverse = {{reverse}}</pre>\n <hr/>\n <button ng-click=\"sortBy(null)\">Set to unsorted</button>\n <hr/>\n <table class=\"friends\">\n <tr>\n <th>\n <button ng-click=\"sortBy('name')\">Name</button>\n <span class=\"sortorder\" ng-show=\"propertyName === 'name'\" ng-class=\"{reverse: reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"sortBy('phone')\">Phone Number</button>\n <span class=\"sortorder\" ng-show=\"propertyName === 'phone'\" ng-class=\"{reverse: reverse}\"></span>\n </th>\n <th>\n <button ng-click=\"sortBy('age')\">Age</button>\n <span class=\"sortorder\" ng-show=\"propertyName === 'age'\" ng-class=\"{reverse: reverse}\"></span>\n </th>\n </tr>\n <tr ng-repeat=\"friend in friends\">\n <td>{{friend.name}}</td>\n <td>{{friend.phone}}</td>\n <td>{{friend.age}}</td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('orderByExample3', [])\n .controller('ExampleController', ['$scope', 'orderByFilter', function($scope, orderBy) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n\n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n\n $scope.sortBy = function(propertyName) {\n $scope.reverse = (propertyName !== null && $scope.propertyName === propertyName)\n ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n };\n }]);\n </file>\n <file name=\"style.css\">\n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n\n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n\n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n\n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n\n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n </file>\n </example>\n * <hr />\n *\n * @example\n * ### Using a custom comparator\n *\n * If you have very specific requirements about the way items are sorted, you can pass your own\n * comparator function. For example, you might need to compare some strings in a locale-sensitive\n * way. (When specifying a custom comparator, you also need to pass a value for the `reverse`\n * argument - passing `false` retains the default sorting order, i.e. ascending.)\n *\n <example name=\"orderBy-custom-comparator\" module=\"orderByExample4\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <div class=\"friends-container custom-comparator\">\n <h3>Locale-sensitive Comparator</h3>\n <table class=\"friends\">\n <tr>\n <th>Name</th>\n <th>Favorite Letter</th>\n </tr>\n <tr ng-repeat=\"friend in friends | orderBy:'favoriteLetter':false:localeSensitiveComparator\">\n <td>{{friend.name}}</td>\n <td>{{friend.favoriteLetter}}</td>\n </tr>\n </table>\n </div>\n <div class=\"friends-container default-comparator\">\n <h3>Default Comparator</h3>\n <table class=\"friends\">\n <tr>\n <th>Name</th>\n <th>Favorite Letter</th>\n </tr>\n <tr ng-repeat=\"friend in friends | orderBy:'favoriteLetter'\">\n <td>{{friend.name}}</td>\n <td>{{friend.favoriteLetter}}</td>\n </tr>\n </table>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('orderByExample4', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', favoriteLetter: 'Ä'},\n {name: 'Mary', favoriteLetter: 'Ãœ'},\n {name: 'Mike', favoriteLetter: 'Ö'},\n {name: 'Adam', favoriteLetter: 'H'},\n {name: 'Julie', favoriteLetter: 'Z'}\n ];\n\n $scope.localeSensitiveComparator = function(v1, v2) {\n // If we don't get strings, just compare by index\n if (v1.type !== 'string' || v2.type !== 'string') {\n return (v1.index < v2.index) ? -1 : 1;\n }\n\n // Compare strings alphabetically, taking locale into account\n return v1.value.localeCompare(v2.value);\n };\n }]);\n </file>\n <file name=\"style.css\">\n .friends-container {\n display: inline-block;\n margin: 0 30px;\n }\n\n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n // Element locators\n var container = element(by.css('.custom-comparator'));\n var names = container.all(by.repeater('friends').column('friend.name'));\n\n it('should sort friends by favorite letter (in correct alphabetical order)', function() {\n expect(names.get(0).getText()).toBe('John');\n expect(names.get(1).getText()).toBe('Adam');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('Julie');\n });\n </file>\n </example>\n *\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse) {\n return function(array, sortPredicate, reverseOrder, compareFn) {\n\n if (array == null) return array;\n if (!isArrayLike(array)) {\n throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);\n }\n\n if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }\n if (sortPredicate.length === 0) { sortPredicate = ['+']; }\n\n var predicates = processPredicates(sortPredicate);\n\n var descending = reverseOrder ? -1 : 1;\n\n // Define the `compare()` function. Use a default comparator if none is specified.\n var compare = isFunction(compareFn) ? compareFn : defaultCompare;\n\n // The next three lines are a version of a Swartzian Transform idiom from Perl\n // (sometimes called the Decorate-Sort-Undecorate idiom)\n // See https://en.wikipedia.org/wiki/Schwartzian_transform\n var compareValues = Array.prototype.map.call(array, getComparisonObject);\n compareValues.sort(doComparison);\n array = compareValues.map(function(item) { return item.value; });\n\n return array;\n\n function getComparisonObject(value, index) {\n // NOTE: We are adding an extra `tieBreaker` value based on the element's index.\n // This will be used to keep the sort stable when none of the input predicates can\n // distinguish between two elements.\n return {\n value: value,\n tieBreaker: {value: index, type: 'number', index: index},\n predicateValues: predicates.map(function(predicate) {\n return getPredicateValue(predicate.get(value), index);\n })\n };\n }\n\n function doComparison(v1, v2) {\n for (var i = 0, ii = predicates.length; i < ii; i++) {\n var result = compare(v1.predicateValues[i], v2.predicateValues[i]);\n if (result) {\n return result * predicates[i].descending * descending;\n }\n }\n\n return (compare(v1.tieBreaker, v2.tieBreaker) || defaultCompare(v1.tieBreaker, v2.tieBreaker)) * descending;\n }\n };\n\n function processPredicates(sortPredicates) {\n return sortPredicates.map(function(predicate) {\n var descending = 1, get = identity;\n\n if (isFunction(predicate)) {\n get = predicate;\n } else if (isString(predicate)) {\n if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {\n descending = predicate.charAt(0) === '-' ? -1 : 1;\n predicate = predicate.substring(1);\n }\n if (predicate !== '') {\n get = $parse(predicate);\n if (get.constant) {\n var key = get();\n get = function(value) { return value[key]; };\n }\n }\n }\n return {get: get, descending: descending};\n });\n }\n\n function isPrimitive(value) {\n switch (typeof value) {\n case 'number': /* falls through */\n case 'boolean': /* falls through */\n case 'string':\n return true;\n default:\n return false;\n }\n }\n\n function objectValue(value) {\n // If `valueOf` is a valid function use that\n if (isFunction(value.valueOf)) {\n value = value.valueOf();\n if (isPrimitive(value)) return value;\n }\n // If `toString` is a valid function and not the one from `Object.prototype` use that\n if (hasCustomToString(value)) {\n value = value.toString();\n if (isPrimitive(value)) return value;\n }\n\n return value;\n }\n\n function getPredicateValue(value, index) {\n var type = typeof value;\n if (value === null) {\n type = 'string';\n value = 'null';\n } else if (type === 'object') {\n value = objectValue(value);\n }\n return {value: value, type: type, index: index};\n }\n\n function defaultCompare(v1, v2) {\n var result = 0;\n var type1 = v1.type;\n var type2 = v2.type;\n\n if (type1 === type2) {\n var value1 = v1.value;\n var value2 = v2.value;\n\n if (type1 === 'string') {\n // Compare strings case-insensitively\n value1 = value1.toLowerCase();\n value2 = value2.toLowerCase();\n } else if (type1 === 'object') {\n // For basic objects, use the position of the object\n // in the collection instead of the value\n if (isObject(value1)) value1 = v1.index;\n if (isObject(value2)) value2 = v2.index;\n }\n\n if (value1 !== value2) {\n result = value1 < value2 ? -1 : 1;\n }\n } else {\n result = type1 < type2 ? -1 : 1;\n }\n\n return result;\n }\n}\n\nfunction ngDirective(directive) {\n if (isFunction(directive)) {\n directive = {\n link: directive\n };\n }\n directive.restrict = directive.restrict || 'AC';\n return valueFn(directive);\n}\n\n/**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html a tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * For dynamically creating `href` attributes for a tags, see the {@link ng.ngHref `ngHref`} directive.\n */\nvar htmlAnchorDirective = valueFn({\n restrict: 'E',\n compile: function(element, attr) {\n if (!attr.href && !attr.xlinkHref) {\n return function(scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n 'xlink:href' : 'href';\n element.on('click', function(event) {\n // if we have no href url, then don't navigate anywhere.\n if (!element.attr(href)) {\n event.preventDefault();\n }\n });\n };\n }\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * Angular has a chance to replace the `{{hash}}` markup with its\n * value. Until Angular replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * <a href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <a ng-href=\"http://www.gravatar.com/avatar/{{hash}}\">link1</a>\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n <example name=\"ng-href\">\n <file name=\"index.html\">\n <input ng-model=\"value\" /><br />\n <a id=\"link-1\" href ng-click=\"value = 1\">link 1</a> (link, don't reload)<br />\n <a id=\"link-2\" href=\"\" ng-click=\"value = 2\">link 2</a> (link, don't reload)<br />\n <a id=\"link-3\" ng-href=\"/{{'123'}}\">link 3</a> (link, reload!)<br />\n <a id=\"link-4\" href=\"\" name=\"xx\" ng-click=\"value = 4\">anchor</a> (link, don't reload)<br />\n <a id=\"link-5\" name=\"xxx\" ng-click=\"value = 5\">anchor</a> (no link)<br />\n <a id=\"link-6\" ng-href=\"{{value}}\">link</a> (link, change location)\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should execute ng-click but not reload when href without value', function() {\n element(by.id('link-1')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when href empty string', function() {\n element(by.id('link-2')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click and change url when ng-href specified', function() {\n expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n\n element(by.id('link-3')).click();\n\n // At this point, we navigate away from an Angular page, so we need\n // to use browser.driver to get the base webdriver.\n\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/123$/);\n });\n }, 5000, 'page should navigate to /123');\n });\n\n it('should execute ng-click but not reload when href empty string and name specified', function() {\n element(by.id('link-4')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when no href but name specified', function() {\n element(by.id('link-5')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n });\n\n it('should only change url when only ng-href', function() {\n element(by.model('value')).clear();\n element(by.model('value')).sendKeys('6');\n expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n\n element(by.id('link-6')).click();\n\n // At this point, we navigate away from an Angular page, so we need\n // to use browser.driver to get the base webdriver.\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/6$/);\n });\n }, 5000, 'page should navigate to /6');\n });\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img src=\"http://www.gravatar.com/avatar/{{hash}}\" alt=\"Description\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-src=\"http://www.gravatar.com/avatar/{{hash}}\" alt=\"Description\" />\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * <img srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\" alt=\"Description\"/>\n * ```\n *\n * The correct way to write it:\n * ```html\n * <img ng-srcset=\"http://www.gravatar.com/avatar/{{hash}} 2x\" alt=\"Description\" />\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * This directive sets the `disabled` attribute on the element (typically a form control,\n * e.g. `input`, `button`, `select` etc.) if the\n * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `disabled`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example name=\"ng-disabled\">\n <file name=\"index.html\">\n <label>Click me to toggle: <input type=\"checkbox\" ng-model=\"checked\"></label><br/>\n <button ng-model=\"button\" ng-disabled=\"checked\">Button</button>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should toggle button', function() {\n expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element INPUT\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n * then the `disabled` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.\n *\n * Note that this directive should not be used together with {@link ngModel `ngModel`},\n * as this can lead to unexpected behavior.\n *\n * A special directive is necessary because we cannot use interpolation inside the `checked`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example name=\"ng-checked\">\n <file name=\"index.html\">\n <label>Check me to check both: <input type=\"checkbox\" ng-model=\"master\"></label><br/>\n <input id=\"checkSlave\" type=\"checkbox\" ng-checked=\"master\" aria-label=\"Slave input\">\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check both checkBoxes', function() {\n expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();\n element(by.model('master')).click();\n expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n * then the `checked` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `readonly` attribute on the element, if the expression inside `ngReadonly` is truthy.\n * Note that `readonly` applies only to `input` elements with specific types. [See the input docs on\n * MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) for more information.\n *\n * A special directive is necessary because we cannot use interpolation inside the `readonly`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n <example name=\"ng-readonly\">\n <file name=\"index.html\">\n <label>Check me to make text readonly: <input type=\"checkbox\" ng-model=\"checked\"></label><br/>\n <input type=\"text\" ng-readonly=\"checked\" value=\"I'm Angular\" aria-label=\"Readonly field\" />\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should toggle readonly attr', function() {\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n * then special attribute \"readonly\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `selected`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `ngSelected` does not interact with the `select` and `ngModel` directives, it only\n * sets the `selected` attribute on the element. If you are using `ngModel` on the select, you\n * should not use `ngSelected` on the options, as `ngModel` will set the select value and\n * selected options.\n * </div>\n *\n * @example\n <example name=\"ng-selected\">\n <file name=\"index.html\">\n <label>Check me to select: <input type=\"checkbox\" ng-model=\"selected\"></label><br/>\n <select aria-label=\"ngSelected demo\">\n <option>Hello!</option>\n <option id=\"greet\" ng-selected=\"selected\">Greetings!</option>\n </select>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should select Greetings!', function() {\n expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n element(by.model('selected')).click();\n expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n * then special attribute \"selected\" will be set on the element\n */\n\n/**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `open`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * ## A note about browser compatibility\n *\n * Internet Explorer and Edge do not support the `details` element, it is\n * recommended to use {@link ng.ngShow} and {@link ng.ngHide} instead.\n *\n * @example\n <example name=\"ng-open\">\n <file name=\"index.html\">\n <label>Toggle details: <input type=\"checkbox\" ng-model=\"open\"></label><br/>\n <details id=\"details\" ng-open=\"open\">\n <summary>List</summary>\n <ul>\n <li>Apple</li>\n <li>Orange</li>\n <li>Durian</li>\n </ul>\n </details>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should toggle open', function() {\n expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n element(by.model('open')).click();\n expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n });\n </file>\n </example>\n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n * then special attribute \"open\" will be set on the element\n */\n\nvar ngAttributeAliasDirectives = {};\n\n// boolean attrs are evaluated\nforEach(BOOLEAN_ATTR, function(propName, attrName) {\n // binding to multiple is not supported\n if (propName === 'multiple') return;\n\n function defaultLinkFn(scope, element, attr) {\n scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n attr.$set(attrName, !!value);\n });\n }\n\n var normalized = directiveNormalize('ng-' + attrName);\n var linkFn = defaultLinkFn;\n\n if (propName === 'checked') {\n linkFn = function(scope, element, attr) {\n // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input\n if (attr.ngModel !== attr[normalized]) {\n defaultLinkFn(scope, element, attr);\n }\n };\n }\n\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n restrict: 'A',\n priority: 100,\n link: linkFn\n };\n };\n});\n\n// aliased input attrs are evaluated\nforEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {\n ngAttributeAliasDirectives[ngAttr] = function() {\n return {\n priority: 100,\n link: function(scope, element, attr) {\n //special case ngPattern when a literal regular expression value\n //is used as the expression (this way we don't have to watch anything).\n if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') {\n var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n if (match) {\n attr.$set('ngPattern', new RegExp(match[1], match[2]));\n return;\n }\n }\n\n scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n attr.$set(ngAttr, value);\n });\n }\n };\n };\n});\n\n// ng-src, ng-srcset, ng-href are interpolated\nforEach(['src', 'srcset', 'href'], function(attrName) {\n var normalized = directiveNormalize('ng-' + attrName);\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n priority: 99, // it needs to run after the attributes are interpolated\n link: function(scope, element, attr) {\n var propName = attrName,\n name = attrName;\n\n if (attrName === 'href' &&\n toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n name = 'xlinkHref';\n attr.$attr[name] = 'xlink:href';\n propName = null;\n }\n\n attr.$observe(normalized, function(value) {\n if (!value) {\n if (attrName === 'href') {\n attr.$set(name, null);\n }\n return;\n }\n\n attr.$set(name, value);\n\n // Support: IE 9-11 only\n // On IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n // to set the property as well to achieve the desired effect.\n // We use attr[attrName] value since $set can sanitize the url.\n if (msie && propName) element.prop(propName, attr[name]);\n });\n }\n };\n };\n});\n\n/* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS\n */\nvar nullFormCtrl = {\n $addControl: noop,\n $$renameControl: nullFormRenameControl,\n $removeControl: noop,\n $setValidity: noop,\n $setDirty: noop,\n $setPristine: noop,\n $setSubmitted: noop\n},\nPENDING_CLASS = 'ng-pending',\nSUBMITTED_CLASS = 'ng-submitted';\n\nfunction nullFormRenameControl(control, name) {\n control.$name = name;\n}\n\n/**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $pending An object hash, containing references to controls or forms with\n * pending validators, where:\n *\n * - keys are validations tokens (error names).\n * - values are arrays of controls or forms that have a pending validator for the given error name.\n *\n * See {@link form.FormController#$error $error} for a list of built-in validation tokens.\n *\n * @property {Object} $error An object hash, containing references to controls or forms with failing\n * validators, where:\n *\n * - keys are validation tokens (error names),\n * - values are arrays of controls or forms that have a failing validator for the given error name.\n *\n * Built-in validation tokens:\n * - `email`\n * - `max`\n * - `maxlength`\n * - `min`\n * - `minlength`\n * - `number`\n * - `pattern`\n * - `required`\n * - `url`\n * - `date`\n * - `datetimelocal`\n * - `time`\n * - `week`\n * - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n//asks for $scope to fool the BC controller module\nFormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\nfunction FormController($element, $attrs, $scope, $animate, $interpolate) {\n this.$$controls = [];\n\n // init state\n this.$error = {};\n this.$$success = {};\n this.$pending = undefined;\n this.$name = $interpolate($attrs.name || $attrs.ngForm || '')($scope);\n this.$dirty = false;\n this.$pristine = true;\n this.$valid = true;\n this.$invalid = false;\n this.$submitted = false;\n this.$$parentForm = nullFormCtrl;\n\n this.$$element = $element;\n this.$$animate = $animate;\n\n setupValidity(this);\n}\n\nFormController.prototype = {\n /**\n * @ngdoc method\n * @name form.FormController#$rollbackViewValue\n *\n * @description\n * Rollback all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is typically needed by the reset button of\n * a form that uses `ng-model-options` to pend updates.\n */\n $rollbackViewValue: function() {\n forEach(this.$$controls, function(control) {\n control.$rollbackViewValue();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$commitViewValue\n *\n * @description\n * Commit all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n $commitViewValue: function() {\n forEach(this.$$controls, function(control) {\n control.$commitViewValue();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$addControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Register a control with the form. Input elements using ngModelController do this automatically\n * when they are linked.\n *\n * Note that the current state of the control will not be reflected on the new parent form. This\n * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`\n * state.\n *\n * However, if the method is used programmatically, for example by adding dynamically created controls,\n * or controls that have been previously removed without destroying their corresponding DOM element,\n * it's the developers responsibility to make sure the current state propagates to the parent form.\n *\n * For example, if an input control is added that is already `$dirty` and has `$error` properties,\n * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.\n */\n $addControl: function(control) {\n // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n // and not added to the scope. Now we throw an error.\n assertNotHasOwnProperty(control.$name, 'input');\n this.$$controls.push(control);\n\n if (control.$name) {\n this[control.$name] = control;\n }\n\n control.$$parentForm = this;\n },\n\n // Private API: rename a form control\n $$renameControl: function(control, newName) {\n var oldName = control.$name;\n\n if (this[oldName] === control) {\n delete this[oldName];\n }\n this[newName] = control;\n control.$name = newName;\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$removeControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Deregister a control from the form.\n *\n * Input elements using ngModelController do this automatically when they are destroyed.\n *\n * Note that only the removed control's validation state (`$errors`etc.) will be removed from the\n * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be\n * different from case to case. For example, removing the only `$dirty` control from a form may or\n * may not mean that the form is still `$dirty`.\n */\n $removeControl: function(control) {\n if (control.$name && this[control.$name] === control) {\n delete this[control.$name];\n }\n forEach(this.$pending, function(value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n forEach(this.$error, function(value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n forEach(this.$$success, function(value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n\n arrayRemove(this.$$controls, control);\n control.$$parentForm = nullFormCtrl;\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setDirty\n *\n * @description\n * Sets the form to a dirty state.\n *\n * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n * state (ng-dirty class). This method will also propagate to parent forms.\n */\n $setDirty: function() {\n this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);\n this.$$animate.addClass(this.$$element, DIRTY_CLASS);\n this.$dirty = true;\n this.$pristine = false;\n this.$$parentForm.$setDirty();\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setPristine\n *\n * @description\n * Sets the form to its pristine state.\n *\n * This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes\n * the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted`\n * state to false.\n *\n * This method will also propagate to all the controls contained in this form.\n *\n * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n * saving or resetting it.\n */\n $setPristine: function() {\n this.$$animate.setClass(this.$$element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n this.$dirty = false;\n this.$pristine = true;\n this.$submitted = false;\n forEach(this.$$controls, function(control) {\n control.$setPristine();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setUntouched\n *\n * @description\n * Sets the form to its untouched state.\n *\n * This method can be called to remove the 'ng-touched' class and set the form controls to their\n * untouched state (ng-untouched class).\n *\n * Setting a form controls back to their untouched state is often useful when setting the form\n * back to its pristine state.\n */\n $setUntouched: function() {\n forEach(this.$$controls, function(control) {\n control.$setUntouched();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setSubmitted\n *\n * @description\n * Sets the form to its submitted state.\n */\n $setSubmitted: function() {\n this.$$animate.addClass(this.$$element, SUBMITTED_CLASS);\n this.$submitted = true;\n this.$$parentForm.$setSubmitted();\n }\n};\n\n/**\n * @ngdoc method\n * @name form.FormController#$setValidity\n *\n * @description\n * Change the validity state of the form, and notify the parent form (if any).\n *\n * Application developers will rarely need to call this method directly. It is used internally, by\n * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a\n * control's validity state to the parent `FormController`.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be\n * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for\n * unfulfilled `$asyncValidators`), so that it is available for data-binding. The\n * `validationErrorKey` should be in camelCase and will get converted into dash-case for\n * class name. Example: `myError` will result in `ng-valid-my-error` and\n * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`.\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending\n * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by AngularJS when validators do not run because of parse errors and when\n * `$asyncValidators` do not run because any of the `$validators` failed.\n * @param {NgModelController | FormController} controller - The controller whose validity state is\n * triggering the change.\n */\naddSetValidityMethod({\n clazz: FormController,\n set: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n object[property] = [controller];\n } else {\n var index = list.indexOf(controller);\n if (index === -1) {\n list.push(controller);\n }\n }\n },\n unset: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n return;\n }\n arrayRemove(list, controller);\n if (list.length === 0) {\n delete object[property];\n }\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Nestable alias of {@link ng.directive:form `form`} directive. HTML\n * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a\n * sub-group of controls needs to be determined.\n *\n * Note: the purpose of `ngForm` is to group controls,\n * but not to be a replacement for the `<form>` tag with all of its capabilities\n * (e.g. posting to the server, ...).\n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * # Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In Angular, forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so\n * Angular provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to\n * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group\n * of controls needs to be determined.\n *\n * # CSS classes\n * - `ng-valid` is set if the form is valid.\n * - `ng-invalid` is set if the form is invalid.\n * - `ng-pending` is set if the form is pending.\n * - `ng-pristine` is set if the form is pristine.\n * - `ng-dirty` is set if the form is dirty.\n * - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * # Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side Angular applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, Angular prevents the default action (form submission to the server) unless the\n * `<form>` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n * button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ## Animation Hooks\n *\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-form {\n * transition:0.5s linear all;\n * background: white;\n * }\n * .my-form.ng-invalid {\n * background: red;\n * color:white;\n * }\n * </pre>\n *\n * @example\n <example name=\"ng-form\" deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"formExample\">\n <file name=\"index.html\">\n <script>\n angular.module('formExample', [])\n .controller('FormController', ['$scope', function($scope) {\n $scope.userType = 'guest';\n }]);\n </script>\n <style>\n .my-form {\n transition:all linear 0.5s;\n background: transparent;\n }\n .my-form.ng-invalid {\n background: red;\n }\n </style>\n <form name=\"myForm\" ng-controller=\"FormController\" class=\"my-form\">\n userType: <input name=\"input\" ng-model=\"userType\" required>\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">Required!</span><br>\n <code>userType = {{userType}}</code><br>\n <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br>\n <code>myForm.input.$error = {{myForm.input.$error}}</code><br>\n <code>myForm.$valid = {{myForm.$valid}}</code><br>\n <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should initialize to model', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n expect(userType.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n var userInput = element(by.model('userType'));\n\n userInput.clear();\n userInput.sendKeys('');\n\n expect(userType.getText()).toEqual('userType =');\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n */\nvar formDirectiveFactory = function(isNgForm) {\n return ['$timeout', '$parse', function($timeout, $parse) {\n var formDirective = {\n name: 'form',\n restrict: isNgForm ? 'EAC' : 'E',\n require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form\n controller: FormController,\n compile: function ngFormCompile(formElement, attr) {\n // Setup initial state of the control\n formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n\n var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);\n\n return {\n pre: function ngFormPreLink(scope, formElement, attr, ctrls) {\n var controller = ctrls[0];\n\n // if `action` attr is not present on the form, prevent the default action (submission)\n if (!('action' in attr)) {\n // we can't use jq events because if a form is destroyed during submission the default\n // action is not prevented. see #1238\n //\n // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n // page reload if the form was destroyed by submission of the form via a click handler\n // on a button in the form. Looks like an IE9 specific bug.\n var handleFormSubmission = function(event) {\n scope.$apply(function() {\n controller.$commitViewValue();\n controller.$setSubmitted();\n });\n\n event.preventDefault();\n };\n\n formElement[0].addEventListener('submit', handleFormSubmission);\n\n // unregister the preventDefault listener so that we don't not leak memory but in a\n // way that will achieve the prevention of the default action.\n formElement.on('$destroy', function() {\n $timeout(function() {\n formElement[0].removeEventListener('submit', handleFormSubmission);\n }, 0, false);\n });\n }\n\n var parentFormCtrl = ctrls[1] || controller.$$parentForm;\n parentFormCtrl.$addControl(controller);\n\n var setter = nameAttr ? getSetter(controller.$name) : noop;\n\n if (nameAttr) {\n setter(scope, controller);\n attr.$observe(nameAttr, function(newValue) {\n if (controller.$name === newValue) return;\n setter(scope, undefined);\n controller.$$parentForm.$$renameControl(controller, newValue);\n setter = getSetter(controller.$name);\n setter(scope, controller);\n });\n }\n formElement.on('$destroy', function() {\n controller.$$parentForm.$removeControl(controller);\n setter(scope, undefined);\n extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n });\n }\n };\n }\n };\n\n return formDirective;\n\n function getSetter(expression) {\n if (expression === '') {\n //create an assignable expression, so forms with an empty name can be renamed later\n return $parse('this[\"\"]').assign;\n }\n return $parse(expression).assign || noop;\n }\n }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n\n\n// helper methods\nfunction setupValidity(instance) {\n instance.$$classCache = {};\n instance.$$classCache[INVALID_CLASS] = !(instance.$$classCache[VALID_CLASS] = instance.$$element.hasClass(VALID_CLASS));\n}\nfunction addSetValidityMethod(context) {\n var clazz = context.clazz,\n set = context.set,\n unset = context.unset;\n\n clazz.prototype.$setValidity = function(validationErrorKey, state, controller) {\n if (isUndefined(state)) {\n createAndSet(this, '$pending', validationErrorKey, controller);\n } else {\n unsetAndCleanup(this, '$pending', validationErrorKey, controller);\n }\n if (!isBoolean(state)) {\n unset(this.$error, validationErrorKey, controller);\n unset(this.$$success, validationErrorKey, controller);\n } else {\n if (state) {\n unset(this.$error, validationErrorKey, controller);\n set(this.$$success, validationErrorKey, controller);\n } else {\n set(this.$error, validationErrorKey, controller);\n unset(this.$$success, validationErrorKey, controller);\n }\n }\n if (this.$pending) {\n cachedToggleClass(this, PENDING_CLASS, true);\n this.$valid = this.$invalid = undefined;\n toggleValidationCss(this, '', null);\n } else {\n cachedToggleClass(this, PENDING_CLASS, false);\n this.$valid = isObjectEmpty(this.$error);\n this.$invalid = !this.$valid;\n toggleValidationCss(this, '', this.$valid);\n }\n\n // re-read the state as the set/unset methods could have\n // combined state in this.$error[validationError] (used for forms),\n // where setting/unsetting only increments/decrements the value,\n // and does not replace it.\n var combinedState;\n if (this.$pending && this.$pending[validationErrorKey]) {\n combinedState = undefined;\n } else if (this.$error[validationErrorKey]) {\n combinedState = false;\n } else if (this.$$success[validationErrorKey]) {\n combinedState = true;\n } else {\n combinedState = null;\n }\n\n toggleValidationCss(this, validationErrorKey, combinedState);\n this.$$parentForm.$setValidity(validationErrorKey, combinedState, this);\n };\n\n function createAndSet(ctrl, name, value, controller) {\n if (!ctrl[name]) {\n ctrl[name] = {};\n }\n set(ctrl[name], value, controller);\n }\n\n function unsetAndCleanup(ctrl, name, value, controller) {\n if (ctrl[name]) {\n unset(ctrl[name], value, controller);\n }\n if (isObjectEmpty(ctrl[name])) {\n ctrl[name] = undefined;\n }\n }\n\n function cachedToggleClass(ctrl, className, switchValue) {\n if (switchValue && !ctrl.$$classCache[className]) {\n ctrl.$$animate.addClass(ctrl.$$element, className);\n ctrl.$$classCache[className] = true;\n } else if (!switchValue && ctrl.$$classCache[className]) {\n ctrl.$$animate.removeClass(ctrl.$$element, className);\n ctrl.$$classCache[className] = false;\n }\n }\n\n function toggleValidationCss(ctrl, validationErrorKey, isValid) {\n validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n\n cachedToggleClass(ctrl, VALID_CLASS + validationErrorKey, isValid === true);\n cachedToggleClass(ctrl, INVALID_CLASS + validationErrorKey, isValid === false);\n }\n}\n\nfunction isObjectEmpty(obj) {\n if (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n }\n return true;\n}\n\n/* global\n VALID_CLASS: false,\n INVALID_CLASS: false,\n PRISTINE_CLASS: false,\n DIRTY_CLASS: false,\n ngModelMinErr: false\n*/\n\n// Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\nvar 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)$/;\n// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)\n// Note: We are being more lenient, because browsers are too.\n// 1. Scheme\n// 2. Slashes\n// 3. Username\n// 4. Password\n// 5. Hostname\n// 6. Port\n// 7. Path\n// 8. Query\n// 9. Fragment\n// 1111111111111111 222 333333 44444 55555555555555555555555 666 77777777 8888888 999\nvar URL_REGEXP = /^[a-z][a-z\\d.+-]*:\\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\\s:/?#]+|\\[[a-f\\d:]+])(?::\\d+)?(?:\\/[^?#]*)?(?:\\?[^#]*)?(?:#.*)?$/i;\n// eslint-disable-next-line max-len\nvar 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])?)*$/;\nvar NUMBER_REGEXP = /^\\s*(-|\\+)?(\\d+|(\\d*(\\.\\d*)))([eE][+-]?\\d+)?\\s*$/;\nvar DATE_REGEXP = /^(\\d{4,})-(\\d{2})-(\\d{2})$/;\nvar DATETIMELOCAL_REGEXP = /^(\\d{4,})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\nvar WEEK_REGEXP = /^(\\d{4,})-W(\\d\\d)$/;\nvar MONTH_REGEXP = /^(\\d{4,})-(\\d\\d)$/;\nvar TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n\nvar PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown';\nvar PARTIAL_VALIDATION_TYPES = createMap();\nforEach('date,datetime-local,month,time,week'.split(','), function(type) {\n PARTIAL_VALIDATION_TYPES[type] = true;\n});\n\nvar inputType = {\n\n /**\n * @ngdoc input\n * @name input[text]\n *\n * @description\n * Standard HTML text input with angular data binding, inherited by most of the `input` elements.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Adds `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n <example name=\"text-input-directive\" module=\"textInputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('textInputExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.example = {\n text: 'guest',\n word: /^\\s*\\w*\\s*$/\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Single word:\n <input type=\"text\" name=\"input\" ng-model=\"example.text\"\n ng-pattern=\"example.word\" required ng-trim=\"false\">\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.pattern\">\n Single word only!</span>\n </div>\n <code>text = {{example.text}}</code><br/>\n <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br/>\n <code>myForm.input.$error = {{myForm.input.$error}}</code><br/>\n <code>myForm.$valid = {{myForm.$valid}}</code><br/>\n <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var text = element(by.binding('example.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if multi word', function() {\n input.clear();\n input.sendKeys('hello world');\n\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'text': textInputType,\n\n /**\n * @ngdoc input\n * @name input[date]\n *\n * @description\n * Input with date validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n * modern browsers do not yet support this input type, it is important to provide cues to users on the\n * expected input format via a placeholder or label.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `min=\"{{minDate | date:'yyyy-MM-dd'}}\"`). Note that `min` will also add native HTML5\n * constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `max=\"{{maxDate | date:'yyyy-MM-dd'}}\"`). Note that `max` will also add native HTML5\n * constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"date-input-directive\" module=\"dateInputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('dateInputExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2013, 9, 22)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a date in 2013:</label>\n <input type=\"date\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"yyyy-MM-dd\" min=\"2013-01-01\" max=\"2013-12-31\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.date\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-MM-dd\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (see https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10-22');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'date': createDateInputType('date', DATE_REGEXP,\n createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),\n 'yyyy-MM-dd'),\n\n /**\n * @ngdoc input\n * @name input[datetime-local]\n *\n * @description\n * Input with datetime validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `min=\"{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `min` will also add native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `max=\"{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `max` will also add native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"datetimelocal-input-directive\" module=\"dateExample\">\n <file name=\"index.html\">\n <script>\n angular.module('dateExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2010, 11, 28, 14, 57)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a date between in 2013:</label>\n <input type=\"datetime-local\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"yyyy-MM-ddTHH:mm:ss\" min=\"2001-01-01T00:00:00\" max=\"2013-12-31T00:00:00\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.datetimelocal\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2010-12-28T14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01T23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,\n createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),\n 'yyyy-MM-ddTHH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[time]\n *\n * @description\n * Input with time validation and transformation. In browsers that do not yet support\n * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minTime | date:'HH:mm:ss'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxTime | date:'HH:mm:ss'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the\n * `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the\n * `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"time-input-directive\" module=\"timeExample\">\n <file name=\"index.html\">\n <script>\n angular.module('timeExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(1970, 0, 1, 14, 57, 0)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a time between 8am and 5pm:</label>\n <input type=\"time\" id=\"exampleInput\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"HH:mm:ss\" min=\"08:00:00\" max=\"17:00:00\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.time\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"HH:mm:ss\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'time': createDateInputType('time', TIME_REGEXP,\n createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),\n 'HH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[week]\n *\n * @description\n * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * week format (yyyy-W##), for example: `2013-W02`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minWeek | date:'yyyy-Www'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxWeek | date:'yyyy-Www'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"week-input-directive\" module=\"weekExample\">\n <file name=\"index.html\">\n <script>\n angular.module('weekExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2013, 0, 3)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label>Pick a date between in 2013:\n <input id=\"exampleInput\" type=\"week\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"YYYY-W##\" min=\"2012-W32\"\n max=\"2013-W52\" required />\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.week\">\n Not a valid date!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-Www\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-W01');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-W01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n\n /**\n * @ngdoc input\n * @name input[month]\n *\n * @description\n * Input with month validation and transformation. In browsers that do not yet support\n * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * month format (yyyy-MM), for example: `2009-01`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n * If the model is not set to the first of the month, the next view to model update will set it\n * to the first of the month.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minMonth | date:'yyyy-MM'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxMonth | date:'yyyy-MM'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"month-input-directive\" module=\"monthExample\">\n <file name=\"index.html\">\n <script>\n angular.module('monthExample', [])\n .controller('DateController', ['$scope', function($scope) {\n $scope.example = {\n value: new Date(2013, 9, 1)\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"DateController as dateCtrl\">\n <label for=\"exampleInput\">Pick a month in 2013:</label>\n <input id=\"exampleInput\" type=\"month\" name=\"input\" ng-model=\"example.value\"\n placeholder=\"yyyy-MM\" min=\"2013-01\" max=\"2013-12\" required />\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.month\">\n Not a valid month!</span>\n </div>\n <tt>value = {{example.value | date: \"yyyy-MM\"}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n </file>\n </example>\n */\n 'month': createDateInputType('month', MONTH_REGEXP,\n createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),\n 'yyyy-MM'),\n\n /**\n * @ngdoc input\n * @name input[number]\n *\n * @description\n * Text input with number validation and transformation. Sets the `number` validation\n * error if not a valid number.\n *\n * <div class=\"alert alert-warning\">\n * The model must always be of type `number` otherwise Angular will throw an error.\n * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}\n * error docs for more information and an example of how to convert your model if necessary.\n * </div>\n *\n * ## Issues with HTML5 constraint validation\n *\n * In browsers that follow the\n * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),\n * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.\n * If a non-number is entered in the input, the browser will report the value as an empty string,\n * which means the view / model values in `ngModel` and subsequently the scope value\n * will also be an empty string.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * Can be interpolated.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * Can be interpolated.\n * @param {string=} ngMin Like `min`, sets the `min` validation error key if the value entered is less than `ngMin`,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} ngMax Like `max`, sets the `max` validation error key if the value entered is greater than `ngMax`,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} step Sets the `step` validation error key if the value entered does not fit the `step` constraint.\n * Can be interpolated.\n * @param {string=} ngStep Like `step`, sets the `step` validation error key if the value entered does not fit the `ngStep` constraint,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"number-input-directive\" module=\"numberExample\">\n <file name=\"index.html\">\n <script>\n angular.module('numberExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.example = {\n value: 12\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Number:\n <input type=\"number\" name=\"input\" ng-model=\"example.value\"\n min=\"0\" max=\"99\" required>\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.number\">\n Not valid number!</span>\n </div>\n <tt>value = {{example.value}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var value = element(by.binding('example.value'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('12');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if over max', function() {\n input.clear();\n input.sendKeys('123');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'number': numberInputType,\n\n\n /**\n * @ngdoc input\n * @name input[url]\n *\n * @description\n * Text input with URL validation. Sets the `url` validation error key if the content is not a\n * valid URL.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n * the built-in validators (see the {@link guide/forms Forms guide})\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"url-input-directive\" module=\"urlExample\">\n <file name=\"index.html\">\n <script>\n angular.module('urlExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.url = {\n text: 'http://google.com'\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>URL:\n <input type=\"url\" name=\"input\" ng-model=\"url.text\" required>\n <label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.url\">\n Not valid url!</span>\n </div>\n <tt>text = {{url.text}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var text = element(by.binding('url.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('url.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('http://google.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not url', function() {\n input.clear();\n input.sendKeys('box');\n\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'url': urlInputType,\n\n\n /**\n * @ngdoc input\n * @name input[email]\n *\n * @description\n * Text input with email validation. Sets the `email` validation error key if not a valid email\n * address.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can\n * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"email-input-directive\" module=\"emailExample\">\n <file name=\"index.html\">\n <script>\n angular.module('emailExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.email = {\n text: 'me@example.com'\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Email:\n <input type=\"email\" name=\"input\" ng-model=\"email.text\" required>\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.input.$error.required\">\n Required!</span>\n <span class=\"error\" ng-show=\"myForm.input.$error.email\">\n Not valid email!</span>\n </div>\n <tt>text = {{email.text}}</tt><br/>\n <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>\n <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var text = element(by.binding('email.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('email.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('me@example.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not email', function() {\n input.clear();\n input.sendKeys('xxx');\n\n expect(valid.getText()).toContain('false');\n });\n </file>\n </example>\n */\n 'email': emailInputType,\n\n\n /**\n * @ngdoc input\n * @name input[radio]\n *\n * @description\n * HTML radio button.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string} value The value to which the `ngModel` expression should be set when selected.\n * Note that `value` only supports `string` values, i.e. the scope model needs to be a string,\n * too. Use `ngValue` if you need complex models (`number`, `object`, ...).\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio\n * is selected. Should be used instead of the `value` attribute if you need\n * a non-string `ngModel` (`boolean`, `array`, ...).\n *\n * @example\n <example name=\"radio-input-directive\" module=\"radioExample\">\n <file name=\"index.html\">\n <script>\n angular.module('radioExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.color = {\n name: 'blue'\n };\n $scope.specialValue = {\n \"id\": \"12345\",\n \"value\": \"green\"\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>\n <input type=\"radio\" ng-model=\"color.name\" value=\"red\">\n Red\n </label><br/>\n <label>\n <input type=\"radio\" ng-model=\"color.name\" ng-value=\"specialValue\">\n Green\n </label><br/>\n <label>\n <input type=\"radio\" ng-model=\"color.name\" value=\"blue\">\n Blue\n </label><br/>\n <tt>color = {{color.name | json}}</tt><br/>\n </form>\n Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should change state', function() {\n var inputs = element.all(by.model('color.name'));\n var color = element(by.binding('color.name'));\n\n expect(color.getText()).toContain('blue');\n\n inputs.get(0).click();\n expect(color.getText()).toContain('red');\n\n inputs.get(1).click();\n expect(color.getText()).toContain('green');\n });\n </file>\n </example>\n */\n 'radio': radioInputType,\n\n /**\n * @ngdoc input\n * @name input[range]\n *\n * @description\n * Native range input with validation and transformation.\n *\n * The model for the range input must always be a `Number`.\n *\n * IE9 and other browsers that do not support the `range` type fall back\n * to a text input without any default values for `min`, `max` and `step`. Model binding,\n * validation and number parsing are nevertheless supported.\n *\n * Browsers that support range (latest Chrome, Safari, Firefox, Edge) treat `input[range]`\n * in a way that never allows the input to hold an invalid value. That means:\n * - any non-numerical value is set to `(max + min) / 2`.\n * - any numerical value that is less than the current min val, or greater than the current max val\n * is set to the min / max val respectively.\n * - additionally, the current `step` is respected, so the nearest value that satisfies a step\n * is used.\n *\n * See the [HTML Spec on input[type=range]](https://www.w3.org/TR/html5/forms.html#range-state-(type=range))\n * for more info.\n *\n * This has the following consequences for Angular:\n *\n * Since the element value should always reflect the current model value, a range input\n * will set the bound ngModel expression to the value that the browser has set for the\n * input element. For example, in the following input `<input type=\"range\" ng-model=\"model.value\">`,\n * if the application sets `model.value = null`, the browser will set the input to `'50'`.\n * Angular will then set the model to `50`, to prevent input and model value being out of sync.\n *\n * That means the model for range will immediately be set to `50` after `ngModel` has been\n * initialized. It also means a range input can never have the required error.\n *\n * This does not only affect changes to the model value, but also to the values of the `min`,\n * `max`, and `step` attributes. When these change in a way that will cause the browser to modify\n * the input value, Angular will also update the model value.\n *\n * Automatic value adjustment also means that a range input element can never have the `required`,\n * `min`, or `max` errors.\n *\n * However, `step` is currently only fully implemented by Firefox. Other browsers have problems\n * when the step value changes dynamically - they do not adjust the element value correctly, but\n * instead may set the `stepMismatch` error. If that's the case, the Angular will set the `step`\n * error on the input, and set the model to `undefined`.\n *\n * Note that `input[range]` is not compatible with`ngMax`, `ngMin`, and `ngStep`, because they do\n * not set the `min` and `max` attributes, which means that the browser won't automatically adjust\n * the input value based on their values, and will always assume min = 0, max = 100, and step = 1.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation to ensure that the value entered is greater\n * than `min`. Can be interpolated.\n * @param {string=} max Sets the `max` validation to ensure that the value entered is less than `max`.\n * Can be interpolated.\n * @param {string=} step Sets the `step` validation to ensure that the value entered matches the `step`\n * Can be interpolated.\n * @param {string=} ngChange Angular expression to be executed when the ngModel value changes due\n * to user interaction with the input element.\n * @param {expression=} ngChecked If the expression is truthy, then the `checked` attribute will be set on the\n * element. **Note** : `ngChecked` should not be used alongside `ngModel`.\n * Checkout {@link ng.directive:ngChecked ngChecked} for usage.\n *\n * @example\n <example name=\"range-input-directive\" module=\"rangeExample\">\n <file name=\"index.html\">\n <script>\n angular.module('rangeExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.value = 75;\n $scope.min = 10;\n $scope.max = 90;\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n\n Model as range: <input type=\"range\" name=\"range\" ng-model=\"value\" min=\"{{min}}\" max=\"{{max}}\">\n <hr>\n Model as number: <input type=\"number\" ng-model=\"value\"><br>\n Min: <input type=\"number\" ng-model=\"min\"><br>\n Max: <input type=\"number\" ng-model=\"max\"><br>\n value = <code>{{value}}</code><br/>\n myForm.range.$valid = <code>{{myForm.range.$valid}}</code><br/>\n myForm.range.$error = <code>{{myForm.range.$error}}</code>\n </form>\n </file>\n </example>\n\n * ## Range Input with ngMin & ngMax attributes\n\n * @example\n <example name=\"range-input-directive-ng\" module=\"rangeExample\">\n <file name=\"index.html\">\n <script>\n angular.module('rangeExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.value = 75;\n $scope.min = 10;\n $scope.max = 90;\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n Model as range: <input type=\"range\" name=\"range\" ng-model=\"value\" ng-min=\"min\" ng-max=\"max\">\n <hr>\n Model as number: <input type=\"number\" ng-model=\"value\"><br>\n Min: <input type=\"number\" ng-model=\"min\"><br>\n Max: <input type=\"number\" ng-model=\"max\"><br>\n value = <code>{{value}}</code><br/>\n myForm.range.$valid = <code>{{myForm.range.$valid}}</code><br/>\n myForm.range.$error = <code>{{myForm.range.$error}}</code>\n </form>\n </file>\n </example>\n\n */\n 'range': rangeInputType,\n\n /**\n * @ngdoc input\n * @name input[checkbox]\n *\n * @description\n * HTML checkbox.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ngTrueValue The value to which the expression should be set when selected.\n * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n <example name=\"checkbox-input-directive\" module=\"checkboxExample\">\n <file name=\"index.html\">\n <script>\n angular.module('checkboxExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.checkboxModel = {\n value1 : true,\n value2 : 'YES'\n };\n }]);\n </script>\n <form name=\"myForm\" ng-controller=\"ExampleController\">\n <label>Value1:\n <input type=\"checkbox\" ng-model=\"checkboxModel.value1\">\n </label><br/>\n <label>Value2:\n <input type=\"checkbox\" ng-model=\"checkboxModel.value2\"\n ng-true-value=\"'YES'\" ng-false-value=\"'NO'\">\n </label><br/>\n <tt>value1 = {{checkboxModel.value1}}</tt><br/>\n <tt>value2 = {{checkboxModel.value2}}</tt><br/>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should change state', function() {\n var value1 = element(by.binding('checkboxModel.value1'));\n var value2 = element(by.binding('checkboxModel.value2'));\n\n expect(value1.getText()).toContain('true');\n expect(value2.getText()).toContain('YES');\n\n element(by.model('checkboxModel.value1')).click();\n element(by.model('checkboxModel.value2')).click();\n\n expect(value1.getText()).toContain('false');\n expect(value2.getText()).toContain('NO');\n });\n </file>\n </example>\n */\n 'checkbox': checkboxInputType,\n\n 'hidden': noop,\n 'button': noop,\n 'submit': noop,\n 'reset': noop,\n 'file': noop\n};\n\nfunction stringBasedInputType(ctrl) {\n ctrl.$formatters.push(function(value) {\n return ctrl.$isEmpty(value) ? value : value.toString();\n });\n}\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n}\n\nfunction baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n var type = lowercase(element[0].type);\n\n // In composition mode, users are still inputting intermediate text buffer,\n // hold the listener until composition is done.\n // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n if (!$sniffer.android) {\n var composing = false;\n\n element.on('compositionstart', function() {\n composing = true;\n });\n\n element.on('compositionend', function() {\n composing = false;\n listener();\n });\n }\n\n var timeout;\n\n var listener = function(ev) {\n if (timeout) {\n $browser.defer.cancel(timeout);\n timeout = null;\n }\n if (composing) return;\n var value = element.val(),\n event = ev && ev.type;\n\n // By default we will trim the value\n // If the attribute ng-trim exists we will avoid trimming\n // If input type is 'password', the value is never trimmed\n if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n value = trim(value);\n }\n\n // If a control is suffering from bad input (due to native validators), browsers discard its\n // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n // control's value is the same empty value twice in a row.\n if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {\n ctrl.$setViewValue(value, event);\n }\n };\n\n // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n // input event on backspace, delete or cut\n if ($sniffer.hasEvent('input')) {\n element.on('input', listener);\n } else {\n var deferListener = function(ev, input, origValue) {\n if (!timeout) {\n timeout = $browser.defer(function() {\n timeout = null;\n if (!input || input.value !== origValue) {\n listener(ev);\n }\n });\n }\n };\n\n element.on('keydown', /** @this */ function(event) {\n var key = event.keyCode;\n\n // ignore\n // command modifiers arrows\n if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;\n\n deferListener(event, this, this.value);\n });\n\n // if user modifies input value using context menu in IE, we need \"paste\" and \"cut\" events to catch it\n if ($sniffer.hasEvent('paste')) {\n element.on('paste cut', deferListener);\n }\n }\n\n // if user paste into input using mouse on older browser\n // or form autocomplete on newer browser, we need \"change\" event to catch it\n element.on('change', listener);\n\n // Some native input types (date-family) have the ability to change validity without\n // firing any input/change events.\n // For these event types, when native validators are present and the browser supports the type,\n // check for validity changes on various DOM events.\n if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {\n element.on(PARTIAL_VALIDATION_EVENTS, /** @this */ function(ev) {\n if (!timeout) {\n var validity = this[VALIDITY_STATE_PROPERTY];\n var origBadInput = validity.badInput;\n var origTypeMismatch = validity.typeMismatch;\n timeout = $browser.defer(function() {\n timeout = null;\n if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) {\n listener(ev);\n }\n });\n }\n });\n }\n\n ctrl.$render = function() {\n // Workaround for Firefox validation #12102.\n var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;\n if (element.val() !== value) {\n element.val(value);\n }\n };\n}\n\nfunction weekParser(isoWeek, existingDate) {\n if (isDate(isoWeek)) {\n return isoWeek;\n }\n\n if (isString(isoWeek)) {\n WEEK_REGEXP.lastIndex = 0;\n var parts = WEEK_REGEXP.exec(isoWeek);\n if (parts) {\n var year = +parts[1],\n week = +parts[2],\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n firstThurs = getFirstThursdayOfYear(year),\n addDays = (week - 1) * 7;\n\n if (existingDate) {\n hours = existingDate.getHours();\n minutes = existingDate.getMinutes();\n seconds = existingDate.getSeconds();\n milliseconds = existingDate.getMilliseconds();\n }\n\n return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n }\n }\n\n return NaN;\n}\n\nfunction createDateParser(regexp, mapping) {\n return function(iso, date) {\n var parts, map;\n\n if (isDate(iso)) {\n return iso;\n }\n\n if (isString(iso)) {\n // When a date is JSON'ified to wraps itself inside of an extra\n // set of double quotes. This makes the date parsing code unable\n // to match the date string and parse it as a date.\n if (iso.charAt(0) === '\"' && iso.charAt(iso.length - 1) === '\"') {\n iso = iso.substring(1, iso.length - 1);\n }\n if (ISO_DATE_REGEXP.test(iso)) {\n return new Date(iso);\n }\n regexp.lastIndex = 0;\n parts = regexp.exec(iso);\n\n if (parts) {\n parts.shift();\n if (date) {\n map = {\n yyyy: date.getFullYear(),\n MM: date.getMonth() + 1,\n dd: date.getDate(),\n HH: date.getHours(),\n mm: date.getMinutes(),\n ss: date.getSeconds(),\n sss: date.getMilliseconds() / 1000\n };\n } else {\n map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };\n }\n\n forEach(parts, function(part, index) {\n if (index < mapping.length) {\n map[mapping[index]] = +part;\n }\n });\n return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n }\n }\n\n return NaN;\n };\n}\n\nfunction createDateInputType(type, regexp, parseDate, format) {\n return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {\n badInputChecker(scope, element, attr, ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n var timezone = ctrl && ctrl.$options.getOption('timezone');\n var previousDate;\n\n ctrl.$$parserName = type;\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (regexp.test(value)) {\n // Note: We cannot read ctrl.$modelValue, as there might be a different\n // parser/formatter in the processing chain so that the model\n // contains some different data format!\n var parsedDate = parseDate(value, previousDate);\n if (timezone) {\n parsedDate = convertTimezoneToLocal(parsedDate, timezone);\n }\n return parsedDate;\n }\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (value && !isDate(value)) {\n throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n }\n if (isValidDate(value)) {\n previousDate = value;\n if (previousDate && timezone) {\n previousDate = convertTimezoneToLocal(previousDate, timezone, true);\n }\n return $filter('date')(value, format, timezone);\n } else {\n previousDate = null;\n return '';\n }\n });\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal;\n ctrl.$validators.min = function(value) {\n return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;\n };\n attr.$observe('min', function(val) {\n minVal = parseObservedDateValue(val);\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal;\n ctrl.$validators.max = function(value) {\n return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;\n };\n attr.$observe('max', function(val) {\n maxVal = parseObservedDateValue(val);\n ctrl.$validate();\n });\n }\n\n function isValidDate(value) {\n // Invalid Date: getTime() returns NaN\n return value && !(value.getTime && value.getTime() !== value.getTime());\n }\n\n function parseObservedDateValue(val) {\n return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val;\n }\n };\n}\n\nfunction badInputChecker(scope, element, attr, ctrl) {\n var node = element[0];\n var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n if (nativeValidation) {\n ctrl.$parsers.push(function(value) {\n var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n return validity.badInput || validity.typeMismatch ? undefined : value;\n });\n }\n}\n\nfunction numberFormatterParser(ctrl) {\n ctrl.$$parserName = 'number';\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (!ctrl.$isEmpty(value)) {\n if (!isNumber(value)) {\n throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n }\n value = value.toString();\n }\n return value;\n });\n}\n\nfunction parseNumberAttrVal(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val);\n }\n return !isNumberNaN(val) ? val : undefined;\n}\n\nfunction isNumberInteger(num) {\n // See http://stackoverflow.com/questions/14636536/how-to-check-if-a-variable-is-an-integer-in-javascript#14794066\n // (minus the assumption that `num` is a number)\n\n // eslint-disable-next-line no-bitwise\n return (num | 0) === num;\n}\n\nfunction countDecimals(num) {\n var numString = num.toString();\n var decimalSymbolIndex = numString.indexOf('.');\n\n if (decimalSymbolIndex === -1) {\n if (-1 < num && num < 1) {\n // It may be in the exponential notation format (`1e-X`)\n var match = /e-(\\d+)$/.exec(numString);\n\n if (match) {\n return Number(match[1]);\n }\n }\n\n return 0;\n }\n\n return numString.length - decimalSymbolIndex - 1;\n}\n\nfunction isValidForStep(viewValue, stepBase, step) {\n // At this point `stepBase` and `step` are expected to be non-NaN values\n // and `viewValue` is expected to be a valid stringified number.\n var value = Number(viewValue);\n\n var isNonIntegerValue = !isNumberInteger(value);\n var isNonIntegerStepBase = !isNumberInteger(stepBase);\n var isNonIntegerStep = !isNumberInteger(step);\n\n // Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or\n // `0.5 % 0.1 !== 0`), we need to convert all numbers to integers.\n if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) {\n var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0;\n var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0;\n var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0;\n\n var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals);\n var multiplier = Math.pow(10, decimalCount);\n\n value = value * multiplier;\n stepBase = stepBase * multiplier;\n step = step * multiplier;\n\n if (isNonIntegerValue) value = Math.round(value);\n if (isNonIntegerStepBase) stepBase = Math.round(stepBase);\n if (isNonIntegerStep) step = Math.round(step);\n }\n\n return (value - stepBase) % step === 0;\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n badInputChecker(scope, element, attr, ctrl);\n numberFormatterParser(ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var minVal;\n var maxVal;\n\n if (isDefined(attr.min) || attr.ngMin) {\n ctrl.$validators.min = function(value) {\n return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;\n };\n\n attr.$observe('min', function(val) {\n minVal = parseNumberAttrVal(val);\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n ctrl.$validators.max = function(value) {\n return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;\n };\n\n attr.$observe('max', function(val) {\n maxVal = parseNumberAttrVal(val);\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.step) || attr.ngStep) {\n var stepVal;\n ctrl.$validators.step = function(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) ||\n isValidForStep(viewValue, minVal || 0, stepVal);\n };\n\n attr.$observe('step', function(val) {\n stepVal = parseNumberAttrVal(val);\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n}\n\nfunction rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n badInputChecker(scope, element, attr, ctrl);\n numberFormatterParser(ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var supportsRange = ctrl.$$hasNativeValidators && element[0].type === 'range',\n minVal = supportsRange ? 0 : undefined,\n maxVal = supportsRange ? 100 : undefined,\n stepVal = supportsRange ? 1 : undefined,\n validity = element[0].validity,\n hasMinAttr = isDefined(attr.min),\n hasMaxAttr = isDefined(attr.max),\n hasStepAttr = isDefined(attr.step);\n\n var originalRender = ctrl.$render;\n\n ctrl.$render = supportsRange && isDefined(validity.rangeUnderflow) && isDefined(validity.rangeOverflow) ?\n //Browsers that implement range will set these values automatically, but reading the adjusted values after\n //$render would cause the min / max validators to be applied with the wrong value\n function rangeRender() {\n originalRender();\n ctrl.$setViewValue(element.val());\n } :\n originalRender;\n\n if (hasMinAttr) {\n ctrl.$validators.min = supportsRange ?\n // Since all browsers set the input to a valid value, we don't need to check validity\n function noopMinValidator() { return true; } :\n // non-support browsers validate the min val\n function minValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal;\n };\n\n setInitialValueAndObserver('min', minChange);\n }\n\n if (hasMaxAttr) {\n ctrl.$validators.max = supportsRange ?\n // Since all browsers set the input to a valid value, we don't need to check validity\n function noopMaxValidator() { return true; } :\n // non-support browsers validate the max val\n function maxValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal;\n };\n\n setInitialValueAndObserver('max', maxChange);\n }\n\n if (hasStepAttr) {\n ctrl.$validators.step = supportsRange ?\n function nativeStepValidator() {\n // Currently, only FF implements the spec on step change correctly (i.e. adjusting the\n // input element value to a valid value). It's possible that other browsers set the stepMismatch\n // validity error instead, so we can at least report an error in that case.\n return !validity.stepMismatch;\n } :\n // ngStep doesn't set the setp attr, so the browser doesn't adjust the input value as setting step would\n function stepValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) ||\n isValidForStep(viewValue, minVal || 0, stepVal);\n };\n\n setInitialValueAndObserver('step', stepChange);\n }\n\n function setInitialValueAndObserver(htmlAttrName, changeFn) {\n // interpolated attributes set the attribute value only after a digest, but we need the\n // attribute value when the input is first rendered, so that the browser can adjust the\n // input value based on the min/max value\n element.attr(htmlAttrName, attr[htmlAttrName]);\n attr.$observe(htmlAttrName, changeFn);\n }\n\n function minChange(val) {\n minVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n if (supportsRange) {\n var elVal = element.val();\n // IE11 doesn't set the el val correctly if the minVal is greater than the element value\n if (minVal > elVal) {\n elVal = minVal;\n element.val(elVal);\n }\n ctrl.$setViewValue(elVal);\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n\n function maxChange(val) {\n maxVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n if (supportsRange) {\n var elVal = element.val();\n // IE11 doesn't set the el val correctly if the maxVal is less than the element value\n if (maxVal < elVal) {\n element.val(maxVal);\n // IE11 and Chrome don't set the value to the minVal when max < min\n elVal = maxVal < minVal ? minVal : maxVal;\n }\n ctrl.$setViewValue(elVal);\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n\n function stepChange(val) {\n stepVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n // Some browsers don't adjust the input value correctly, but set the stepMismatch error\n if (supportsRange && ctrl.$viewValue !== element.val()) {\n ctrl.$setViewValue(element.val());\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$$parserName = 'url';\n ctrl.$validators.url = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n };\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$$parserName = 'email';\n ctrl.$validators.email = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n };\n}\n\nfunction radioInputType(scope, element, attr, ctrl) {\n var doTrim = !attr.ngTrim || trim(attr.ngTrim) !== 'false';\n // make the name unique, if not defined\n if (isUndefined(attr.name)) {\n element.attr('name', nextUid());\n }\n\n var listener = function(ev) {\n var value;\n if (element[0].checked) {\n value = attr.value;\n if (doTrim) {\n value = trim(value);\n }\n ctrl.$setViewValue(value, ev && ev.type);\n }\n };\n\n element.on('click', listener);\n\n ctrl.$render = function() {\n var value = attr.value;\n if (doTrim) {\n value = trim(value);\n }\n element[0].checked = (value === ctrl.$viewValue);\n };\n\n attr.$observe('value', ctrl.$render);\n}\n\nfunction parseConstantExpr($parse, context, name, expression, fallback) {\n var parseFn;\n if (isDefined(expression)) {\n parseFn = $parse(expression);\n if (!parseFn.constant) {\n throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +\n '`{1}`.', name, expression);\n }\n return parseFn(context);\n }\n return fallback;\n}\n\nfunction checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n\n var listener = function(ev) {\n ctrl.$setViewValue(element[0].checked, ev && ev.type);\n };\n\n element.on('click', listener);\n\n ctrl.$render = function() {\n element[0].checked = ctrl.$viewValue;\n };\n\n // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n // it to a boolean.\n ctrl.$isEmpty = function(value) {\n return value === false;\n };\n\n ctrl.$formatters.push(function(value) {\n return equals(value, trueValue);\n });\n\n ctrl.$parsers.push(function(value) {\n return value ? trueValue : falseValue;\n });\n}\n\n\n/**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with angular data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n *\n * @knownIssue\n *\n * When specifying the `placeholder` attribute of `<textarea>`, Internet Explorer will temporarily\n * insert the placeholder value as the textarea's content. If the placeholder value contains\n * interpolation (`{{ ... }}`), an error will be logged in the console when Angular tries to update\n * the value of the by-then-removed text node. This doesn't affect the functionality of the\n * textarea, but can be undesirable.\n *\n * You can work around this Internet Explorer issue by using `ng-attr-placeholder` instead of\n * `placeholder` on textareas, whenever you need interpolation in the placeholder value. You can\n * find more details on `ngAttr` in the\n * [Interpolation](guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes) section of the\n * Developer Guide.\n */\n\n\n/**\n * @ngdoc directive\n * @name input\n * @restrict E\n *\n * @description\n * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,\n * input state control, and validation.\n * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Not every feature offered is available for all input types.\n * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.\n * </div>\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {boolean=} ngRequired Sets `required` attribute if set to true\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * value does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.<br />\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n <example name=\"input-directive\" module=\"inputExample\">\n <file name=\"index.html\">\n <script>\n angular.module('inputExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.user = {name: 'guest', last: 'visitor'};\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <form name=\"myForm\">\n <label>\n User name:\n <input type=\"text\" name=\"userName\" ng-model=\"user.name\" required>\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.userName.$error.required\">\n Required!</span>\n </div>\n <label>\n Last name:\n <input type=\"text\" name=\"lastName\" ng-model=\"user.last\"\n ng-minlength=\"3\" ng-maxlength=\"10\">\n </label>\n <div role=\"alert\">\n <span class=\"error\" ng-show=\"myForm.lastName.$error.minlength\">\n Too short!</span>\n <span class=\"error\" ng-show=\"myForm.lastName.$error.maxlength\">\n Too long!</span>\n </div>\n </form>\n <hr>\n <tt>user = {{user}}</tt><br/>\n <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br/>\n <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br/>\n <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br/>\n <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br/>\n <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br/>\n <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br/>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var user = element(by.exactBinding('user'));\n var userNameValid = element(by.binding('myForm.userName.$valid'));\n var lastNameValid = element(by.binding('myForm.lastName.$valid'));\n var lastNameError = element(by.binding('myForm.lastName.$error'));\n var formValid = element(by.binding('myForm.$valid'));\n var userNameInput = element(by.model('user.name'));\n var userLastInput = element(by.model('user.last'));\n\n it('should initialize to model', function() {\n expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"visitor\"}');\n expect(userNameValid.getText()).toContain('true');\n expect(formValid.getText()).toContain('true');\n });\n\n it('should be invalid if empty when required', function() {\n userNameInput.clear();\n userNameInput.sendKeys('');\n\n expect(user.getText()).toContain('{\"last\":\"visitor\"}');\n expect(userNameValid.getText()).toContain('false');\n expect(formValid.getText()).toContain('false');\n });\n\n it('should be valid if empty when min length is set', function() {\n userLastInput.clear();\n userLastInput.sendKeys('');\n\n expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"\"}');\n expect(lastNameValid.getText()).toContain('true');\n expect(formValid.getText()).toContain('true');\n });\n\n it('should be invalid if less than required min length', function() {\n userLastInput.clear();\n userLastInput.sendKeys('xx');\n\n expect(user.getText()).toContain('{\"name\":\"guest\"}');\n expect(lastNameValid.getText()).toContain('false');\n expect(lastNameError.getText()).toContain('minlength');\n expect(formValid.getText()).toContain('false');\n });\n\n it('should be invalid if longer than max length', function() {\n userLastInput.clear();\n userLastInput.sendKeys('some ridiculously long name');\n\n expect(user.getText()).toContain('{\"name\":\"guest\"}');\n expect(lastNameValid.getText()).toContain('false');\n expect(lastNameError.getText()).toContain('maxlength');\n expect(formValid.getText()).toContain('false');\n });\n </file>\n </example>\n */\nvar inputDirective = ['$browser', '$sniffer', '$filter', '$parse',\n function($browser, $sniffer, $filter, $parse) {\n return {\n restrict: 'E',\n require: ['?ngModel'],\n link: {\n pre: function(scope, element, attr, ctrls) {\n if (ctrls[0]) {\n (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,\n $browser, $filter, $parse);\n }\n }\n }\n };\n}];\n\n\n\nvar CONSTANT_VALUE_REGEXP = /^(true|false|\\d+)$/;\n/**\n * @ngdoc directive\n * @name ngValue\n *\n * @description\n * Binds the given expression to the value of the element.\n *\n * It is mainly used on {@link input[radio] `input[radio]`} and option elements,\n * so that when the element is selected, the {@link ngModel `ngModel`} of that element (or its\n * {@link select `select`} parent element) is set to the bound value. It is especially useful\n * for dynamically generated lists using {@link ngRepeat `ngRepeat`}, as shown below.\n *\n * It can also be used to achieve one-way binding of a given expression to an input element\n * such as an `input[text]` or a `textarea`, when that element does not use ngModel.\n *\n * @element input\n * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute\n * and `value` property of the element.\n *\n * @example\n <example name=\"ngValue-directive\" module=\"valueExample\">\n <file name=\"index.html\">\n <script>\n angular.module('valueExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.names = ['pizza', 'unicorns', 'robots'];\n $scope.my = { favorite: 'unicorns' };\n }]);\n </script>\n <form ng-controller=\"ExampleController\">\n <h2>Which is your favorite?</h2>\n <label ng-repeat=\"name in names\" for=\"{{name}}\">\n {{name}}\n <input type=\"radio\"\n ng-model=\"my.favorite\"\n ng-value=\"name\"\n id=\"{{name}}\"\n name=\"favorite\">\n </label>\n <div>You chose {{my.favorite}}</div>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var favorite = element(by.binding('my.favorite'));\n\n it('should initialize to model', function() {\n expect(favorite.getText()).toContain('unicorns');\n });\n it('should bind the values to the inputs', function() {\n element.all(by.model('my.favorite')).get(0).click();\n expect(favorite.getText()).toContain('pizza');\n });\n </file>\n </example>\n */\nvar ngValueDirective = function() {\n /**\n * inputs use the value attribute as their default value if the value property is not set.\n * Once the value property has been set (by adding input), it will not react to changes to\n * the value attribute anymore. Setting both attribute and property fixes this behavior, and\n * makes it possible to use ngValue as a sort of one-way bind.\n */\n function updateElementValue(element, attr, value) {\n // Support: IE9 only\n // In IE9 values are converted to string (e.g. `input.value = null` results in `input.value === 'null'`).\n var propValue = isDefined(value) ? value : (msie === 9) ? '' : null;\n element.prop('value', propValue);\n attr.$set('value', value);\n }\n\n return {\n restrict: 'A',\n priority: 100,\n compile: function(tpl, tplAttr) {\n if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {\n return function ngValueConstantLink(scope, elm, attr) {\n var value = scope.$eval(attr.ngValue);\n updateElementValue(elm, attr, value);\n };\n } else {\n return function ngValueLink(scope, elm, attr) {\n scope.$watch(attr.ngValue, function valueWatchAction(value) {\n updateElementValue(elm, attr, value);\n });\n };\n }\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngBind\n * @restrict AC\n *\n * @description\n * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element\n * with the value of a given expression, and to update the text content when the value of that\n * expression changes.\n *\n * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like\n * `{{ expression }}` which is similar but less verbose.\n *\n * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily\n * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an\n * element attribute, it makes the bindings invisible to the user while the page is loading.\n *\n * An alternative solution to this problem would be using the\n * {@link ng.directive:ngCloak ngCloak} directive.\n *\n *\n * @element ANY\n * @param {expression} ngBind {@link guide/expression Expression} to evaluate.\n *\n * @example\n * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.\n <example module=\"bindExample\" name=\"ng-bind\">\n <file name=\"index.html\">\n <script>\n angular.module('bindExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.name = 'Whirled';\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Enter name: <input type=\"text\" ng-model=\"name\"></label><br>\n Hello <span ng-bind=\"name\"></span>!\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-bind', function() {\n var nameInput = element(by.model('name'));\n\n expect(element(by.binding('name')).getText()).toBe('Whirled');\n nameInput.clear();\n nameInput.sendKeys('world');\n expect(element(by.binding('name')).getText()).toBe('world');\n });\n </file>\n </example>\n */\nvar ngBindDirective = ['$compile', function($compile) {\n return {\n restrict: 'AC',\n compile: function ngBindCompile(templateElement) {\n $compile.$$addBindingClass(templateElement);\n return function ngBindLink(scope, element, attr) {\n $compile.$$addBindingInfo(element, attr.ngBind);\n element = element[0];\n scope.$watch(attr.ngBind, function ngBindWatchAction(value) {\n element.textContent = stringify(value);\n });\n };\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindTemplate\n *\n * @description\n * The `ngBindTemplate` directive specifies that the element\n * text content should be replaced with the interpolation of the template\n * in the `ngBindTemplate` attribute.\n * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`\n * expressions. This directive is needed since some HTML elements\n * (such as TITLE and OPTION) cannot contain SPAN elements.\n *\n * @element ANY\n * @param {string} ngBindTemplate template of form\n * <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.\n *\n * @example\n * Try it here: enter text in text box and watch the greeting change.\n <example module=\"bindExample\" name=\"ng-bind-template\">\n <file name=\"index.html\">\n <script>\n angular.module('bindExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.salutation = 'Hello';\n $scope.name = 'World';\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Salutation: <input type=\"text\" ng-model=\"salutation\"></label><br>\n <label>Name: <input type=\"text\" ng-model=\"name\"></label><br>\n <pre ng-bind-template=\"{{salutation}} {{name}}!\"></pre>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-bind', function() {\n var salutationElem = element(by.binding('salutation'));\n var salutationInput = element(by.model('salutation'));\n var nameInput = element(by.model('name'));\n\n expect(salutationElem.getText()).toBe('Hello World!');\n\n salutationInput.clear();\n salutationInput.sendKeys('Greetings');\n nameInput.clear();\n nameInput.sendKeys('user');\n\n expect(salutationElem.getText()).toBe('Greetings user!');\n });\n </file>\n </example>\n */\nvar ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {\n return {\n compile: function ngBindTemplateCompile(templateElement) {\n $compile.$$addBindingClass(templateElement);\n return function ngBindTemplateLink(scope, element, attr) {\n var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));\n $compile.$$addBindingInfo(element, interpolateFn.expressions);\n element = element[0];\n attr.$observe('ngBindTemplate', function(value) {\n element.textContent = isUndefined(value) ? '' : value;\n });\n };\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngBindHtml\n *\n * @description\n * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default,\n * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service.\n * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link\n * ngSanitize} in your module's dependencies (not in core Angular). In order to use {@link ngSanitize}\n * in your module's dependencies, you need to include \"angular-sanitize.js\" in your application.\n *\n * You may also bypass sanitization for values you know are safe. To do so, bind to\n * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}. See the example\n * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}.\n *\n * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you\n * will have an exception (instead of an exploit.)\n *\n * @element ANY\n * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.\n *\n * @example\n\n <example module=\"bindHtmlExample\" deps=\"angular-sanitize.js\" name=\"ng-bind-html\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <p ng-bind-html=\"myHTML\"></p>\n </div>\n </file>\n\n <file name=\"script.js\">\n angular.module('bindHtmlExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.myHTML =\n 'I am an <code>HTML</code>string with ' +\n '<a href=\"#\">links!</a> and other <em>stuff</em>';\n }]);\n </file>\n\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-bind-html', function() {\n expect(element(by.binding('myHTML')).getText()).toBe(\n 'I am an HTMLstring with links! and other stuff');\n });\n </file>\n </example>\n */\nvar ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {\n return {\n restrict: 'A',\n compile: function ngBindHtmlCompile(tElement, tAttrs) {\n var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);\n var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function sceValueOf(val) {\n // Unwrap the value to compare the actual inner safe value, not the wrapper object.\n return $sce.valueOf(val);\n });\n $compile.$$addBindingClass(tElement);\n\n return function ngBindHtmlLink(scope, element, attr) {\n $compile.$$addBindingInfo(element, attr.ngBindHtml);\n\n scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {\n // The watched value is the unwrapped value. To avoid re-escaping, use the direct getter.\n var value = ngBindHtmlGetter(scope);\n element.html($sce.getTrustedHtml(value) || '');\n });\n };\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngChange\n *\n * @description\n * Evaluate the given expression when the user changes the input.\n * The expression is evaluated immediately, unlike the JavaScript onchange event\n * which only triggers at the end of a change (usually, when the user leaves the\n * form element or presses the return key).\n *\n * The `ngChange` expression is only evaluated when a change in the input value causes\n * a new value to be committed to the model.\n *\n * It will not be evaluated:\n * * if the value returned from the `$parsers` transformation pipeline has not changed\n * * if the input has continued to be invalid since the model will stay `null`\n * * if the model is changed programmatically and not by a change to the input value\n *\n *\n * Note, this directive requires `ngModel` to be present.\n *\n * @element input\n * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change\n * in input value.\n *\n * @example\n * <example name=\"ngChange-directive\" module=\"changeExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('changeExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.counter = 0;\n * $scope.change = function() {\n * $scope.counter++;\n * };\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <input type=\"checkbox\" ng-model=\"confirmed\" ng-change=\"change()\" id=\"ng-change-example1\" />\n * <input type=\"checkbox\" ng-model=\"confirmed\" id=\"ng-change-example2\" />\n * <label for=\"ng-change-example2\">Confirmed</label><br />\n * <tt>debug = {{confirmed}}</tt><br/>\n * <tt>counter = {{counter}}</tt><br/>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * var counter = element(by.binding('counter'));\n * var debug = element(by.binding('confirmed'));\n *\n * it('should evaluate the expression if changing from view', function() {\n * expect(counter.getText()).toContain('0');\n *\n * element(by.id('ng-change-example1')).click();\n *\n * expect(counter.getText()).toContain('1');\n * expect(debug.getText()).toContain('true');\n * });\n *\n * it('should not evaluate the expression if changing from model', function() {\n * element(by.id('ng-change-example2')).click();\n\n * expect(counter.getText()).toContain('0');\n * expect(debug.getText()).toContain('true');\n * });\n * </file>\n * </example>\n */\nvar ngChangeDirective = valueFn({\n restrict: 'A',\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n ctrl.$viewChangeListeners.push(function() {\n scope.$eval(attr.ngChange);\n });\n }\n});\n\n/* exported\n ngClassDirective,\n ngClassEvenDirective,\n ngClassOddDirective\n*/\n\nfunction classDirective(name, selector) {\n name = 'ngClass' + name;\n var indexWatchExpression;\n\n return ['$parse', function($parse) {\n return {\n restrict: 'AC',\n link: function(scope, element, attr) {\n var expression = attr[name].trim();\n var isOneTime = (expression.charAt(0) === ':') && (expression.charAt(1) === ':');\n\n var watchInterceptor = isOneTime ? toFlatValue : toClassString;\n var watchExpression = $parse(expression, watchInterceptor);\n var watchAction = isOneTime ? ngClassOneTimeWatchAction : ngClassWatchAction;\n\n var classCounts = element.data('$classCounts');\n var oldModulo = true;\n var oldClassString;\n\n if (!classCounts) {\n // Use createMap() to prevent class assumptions involving property\n // names in Object.prototype\n classCounts = createMap();\n element.data('$classCounts', classCounts);\n }\n\n if (name !== 'ngClass') {\n if (!indexWatchExpression) {\n indexWatchExpression = $parse('$index', function moduloTwo($index) {\n // eslint-disable-next-line no-bitwise\n return $index & 1;\n });\n }\n\n scope.$watch(indexWatchExpression, ngClassIndexWatchAction);\n }\n\n scope.$watch(watchExpression, watchAction, isOneTime);\n\n function addClasses(classString) {\n classString = digestClassCounts(split(classString), 1);\n attr.$addClass(classString);\n }\n\n function removeClasses(classString) {\n classString = digestClassCounts(split(classString), -1);\n attr.$removeClass(classString);\n }\n\n function updateClasses(oldClassString, newClassString) {\n var oldClassArray = split(oldClassString);\n var newClassArray = split(newClassString);\n\n var toRemoveArray = arrayDifference(oldClassArray, newClassArray);\n var toAddArray = arrayDifference(newClassArray, oldClassArray);\n\n var toRemoveString = digestClassCounts(toRemoveArray, -1);\n var toAddString = digestClassCounts(toAddArray, 1);\n\n attr.$addClass(toAddString);\n attr.$removeClass(toRemoveString);\n }\n\n function digestClassCounts(classArray, count) {\n var classesToUpdate = [];\n\n forEach(classArray, function(className) {\n if (count > 0 || classCounts[className]) {\n classCounts[className] = (classCounts[className] || 0) + count;\n if (classCounts[className] === +(count > 0)) {\n classesToUpdate.push(className);\n }\n }\n });\n\n return classesToUpdate.join(' ');\n }\n\n function ngClassIndexWatchAction(newModulo) {\n // This watch-action should run before the `ngClass[OneTime]WatchAction()`, thus it\n // adds/removes `oldClassString`. If the `ngClass` expression has changed as well, the\n // `ngClass[OneTime]WatchAction()` will update the classes.\n if (newModulo === selector) {\n addClasses(oldClassString);\n } else {\n removeClasses(oldClassString);\n }\n\n oldModulo = newModulo;\n }\n\n function ngClassOneTimeWatchAction(newClassValue) {\n var newClassString = toClassString(newClassValue);\n\n if (newClassString !== oldClassString) {\n ngClassWatchAction(newClassString);\n }\n }\n\n function ngClassWatchAction(newClassString) {\n if (oldModulo === selector) {\n updateClasses(oldClassString, newClassString);\n }\n\n oldClassString = newClassString;\n }\n }\n };\n }];\n\n // Helpers\n function arrayDifference(tokens1, tokens2) {\n if (!tokens1 || !tokens1.length) return [];\n if (!tokens2 || !tokens2.length) return tokens1;\n\n var values = [];\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values.push(token);\n }\n\n return values;\n }\n\n function split(classString) {\n return classString && classString.split(' ');\n }\n\n function toClassString(classValue) {\n var classString = classValue;\n\n if (isArray(classValue)) {\n classString = classValue.map(toClassString).join(' ');\n } else if (isObject(classValue)) {\n classString = Object.keys(classValue).\n filter(function(key) { return classValue[key]; }).\n join(' ');\n }\n\n return classString;\n }\n\n function toFlatValue(classValue) {\n var flatValue = classValue;\n\n if (isArray(classValue)) {\n flatValue = classValue.map(toFlatValue);\n } else if (isObject(classValue)) {\n var hasUndefined = false;\n\n flatValue = Object.keys(classValue).filter(function(key) {\n var value = classValue[key];\n\n if (!hasUndefined && isUndefined(value)) {\n hasUndefined = true;\n }\n\n return value;\n });\n\n if (hasUndefined) {\n // Prevent the `oneTimeLiteralWatchInterceptor` from unregistering\n // the watcher, by including at least one `undefined` value.\n flatValue.push(undefined);\n }\n }\n\n return flatValue;\n }\n}\n\n/**\n * @ngdoc directive\n * @name ngClass\n * @restrict AC\n *\n * @description\n * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding\n * an expression that represents all classes to be added.\n *\n * The directive operates in three different ways, depending on which of three types the expression\n * evaluates to:\n *\n * 1. If the expression evaluates to a string, the string should be one or more space-delimited class\n * names.\n *\n * 2. If the expression evaluates to an object, then for each key-value pair of the\n * object with a truthy value the corresponding key is used as a class name.\n *\n * 3. If the expression evaluates to an array, each element of the array should either be a string as in\n * type 1 or an object as in type 2. This means that you can mix strings and objects together in an array\n * to give you more control over what CSS classes appear. See the code below for an example of this.\n *\n *\n * The directive won't add duplicate classes if a particular class was already set.\n *\n * When the expression changes, the previously added classes are removed and only then are the\n * new classes added.\n *\n * @knownIssue\n * You should not use {@link guide/interpolation interpolation} in the value of the `class`\n * attribute, when using the `ngClass` directive on the same element.\n * See {@link guide/interpolation#known-issues here} for more info.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#addClass addClass} | just before the class is applied to the element |\n * | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element |\n *\n * @element ANY\n * @param {expression} ngClass {@link guide/expression Expression} to eval. The result\n * of the evaluation can be a string representing space delimited class\n * names, an array, or a map of class names to boolean values. In the case of a map, the\n * names of the properties whose values are truthy will be added as css classes to the\n * element.\n *\n * @example Example that demonstrates basic bindings via ngClass directive.\n <example name=\"ng-class\">\n <file name=\"index.html\">\n <p ng-class=\"{strike: deleted, bold: important, 'has-error': error}\">Map Syntax Example</p>\n <label>\n <input type=\"checkbox\" ng-model=\"deleted\">\n deleted (apply \"strike\" class)\n </label><br>\n <label>\n <input type=\"checkbox\" ng-model=\"important\">\n important (apply \"bold\" class)\n </label><br>\n <label>\n <input type=\"checkbox\" ng-model=\"error\">\n error (apply \"has-error\" class)\n </label>\n <hr>\n <p ng-class=\"style\">Using String Syntax</p>\n <input type=\"text\" ng-model=\"style\"\n placeholder=\"Type: bold strike red\" aria-label=\"Type: bold strike red\">\n <hr>\n <p ng-class=\"[style1, style2, style3]\">Using Array Syntax</p>\n <input ng-model=\"style1\"\n placeholder=\"Type: bold, strike or red\" aria-label=\"Type: bold, strike or red\"><br>\n <input ng-model=\"style2\"\n placeholder=\"Type: bold, strike or red\" aria-label=\"Type: bold, strike or red 2\"><br>\n <input ng-model=\"style3\"\n placeholder=\"Type: bold, strike or red\" aria-label=\"Type: bold, strike or red 3\"><br>\n <hr>\n <p ng-class=\"[style4, {orange: warning}]\">Using Array and Map Syntax</p>\n <input ng-model=\"style4\" placeholder=\"Type: bold, strike\" aria-label=\"Type: bold, strike\"><br>\n <label><input type=\"checkbox\" ng-model=\"warning\"> warning (apply \"orange\" class)</label>\n </file>\n <file name=\"style.css\">\n .strike {\n text-decoration: line-through;\n }\n .bold {\n font-weight: bold;\n }\n .red {\n color: red;\n }\n .has-error {\n color: red;\n background-color: yellow;\n }\n .orange {\n color: orange;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var ps = element.all(by.css('p'));\n\n it('should let you toggle the class', function() {\n\n expect(ps.first().getAttribute('class')).not.toMatch(/bold/);\n expect(ps.first().getAttribute('class')).not.toMatch(/has-error/);\n\n element(by.model('important')).click();\n expect(ps.first().getAttribute('class')).toMatch(/bold/);\n\n element(by.model('error')).click();\n expect(ps.first().getAttribute('class')).toMatch(/has-error/);\n });\n\n it('should let you toggle string example', function() {\n expect(ps.get(1).getAttribute('class')).toBe('');\n element(by.model('style')).clear();\n element(by.model('style')).sendKeys('red');\n expect(ps.get(1).getAttribute('class')).toBe('red');\n });\n\n it('array example should have 3 classes', function() {\n expect(ps.get(2).getAttribute('class')).toBe('');\n element(by.model('style1')).sendKeys('bold');\n element(by.model('style2')).sendKeys('strike');\n element(by.model('style3')).sendKeys('red');\n expect(ps.get(2).getAttribute('class')).toBe('bold strike red');\n });\n\n it('array with map example should have 2 classes', function() {\n expect(ps.last().getAttribute('class')).toBe('');\n element(by.model('style4')).sendKeys('bold');\n element(by.model('warning')).click();\n expect(ps.last().getAttribute('class')).toBe('bold orange');\n });\n </file>\n </example>\n\n ## Animations\n\n The example below demonstrates how to perform animations using ngClass.\n\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-class\">\n <file name=\"index.html\">\n <input id=\"setbtn\" type=\"button\" value=\"set\" ng-click=\"myVar='my-class'\">\n <input id=\"clearbtn\" type=\"button\" value=\"clear\" ng-click=\"myVar=''\">\n <br>\n <span class=\"base-class\" ng-class=\"myVar\">Sample Text</span>\n </file>\n <file name=\"style.css\">\n .base-class {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n }\n\n .base-class.my-class {\n color: red;\n font-size:3em;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-class', function() {\n expect(element(by.css('.base-class')).getAttribute('class')).not.\n toMatch(/my-class/);\n\n element(by.id('setbtn')).click();\n\n expect(element(by.css('.base-class')).getAttribute('class')).\n toMatch(/my-class/);\n\n element(by.id('clearbtn')).click();\n\n expect(element(by.css('.base-class')).getAttribute('class')).not.\n toMatch(/my-class/);\n });\n </file>\n </example>\n\n\n ## ngClass and pre-existing CSS3 Transitions/Animations\n The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.\n Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder\n any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure\n to view the step by step details of {@link $animate#addClass $animate.addClass} and\n {@link $animate#removeClass $animate.removeClass}.\n */\nvar ngClassDirective = classDirective('', true);\n\n/**\n * @ngdoc directive\n * @name ngClassOdd\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result\n * of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n <example name=\"ng-class-odd\">\n <file name=\"index.html\">\n <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng-repeat=\"name in names\">\n <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n {{name}}\n </span>\n </li>\n </ol>\n </file>\n <file name=\"style.css\">\n .odd {\n color: red;\n }\n .even {\n color: blue;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-class-odd and ng-class-even', function() {\n expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n toMatch(/odd/);\n expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n toMatch(/even/);\n });\n </file>\n </example>\n */\nvar ngClassOddDirective = classDirective('Odd', 0);\n\n/**\n * @ngdoc directive\n * @name ngClassEven\n * @restrict AC\n *\n * @description\n * The `ngClassOdd` and `ngClassEven` directives work exactly as\n * {@link ng.directive:ngClass ngClass}, except they work in\n * conjunction with `ngRepeat` and take effect only on odd (even) rows.\n *\n * This directive can be applied only within the scope of an\n * {@link ng.directive:ngRepeat ngRepeat}.\n *\n * @element ANY\n * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The\n * result of the evaluation can be a string representing space delimited class names or an array.\n *\n * @example\n <example name=\"ng-class-even\">\n <file name=\"index.html\">\n <ol ng-init=\"names=['John', 'Mary', 'Cate', 'Suz']\">\n <li ng-repeat=\"name in names\">\n <span ng-class-odd=\"'odd'\" ng-class-even=\"'even'\">\n {{name}} \n </span>\n </li>\n </ol>\n </file>\n <file name=\"style.css\">\n .odd {\n color: red;\n }\n .even {\n color: blue;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-class-odd and ng-class-even', function() {\n expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).\n toMatch(/odd/);\n expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).\n toMatch(/even/);\n });\n </file>\n </example>\n */\nvar ngClassEvenDirective = classDirective('Even', 1);\n\n/**\n * @ngdoc directive\n * @name ngCloak\n * @restrict AC\n *\n * @description\n * The `ngCloak` directive is used to prevent the Angular html template from being briefly\n * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this\n * directive to avoid the undesirable flicker effect caused by the html template display.\n *\n * The directive can be applied to the `<body>` element, but the preferred usage is to apply\n * multiple `ngCloak` directives to small portions of the page to permit progressive rendering\n * of the browser view.\n *\n * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and\n * `angular.min.js`.\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```css\n * [ng\\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {\n * display: none !important;\n * }\n * ```\n *\n * When this css rule is loaded by the browser, all html elements (including their children) that\n * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive\n * during the compilation of the template it deletes the `ngCloak` element attribute, making\n * the compiled element visible.\n *\n * For the best result, the `angular.js` script must be loaded in the head section of the html\n * document; alternatively, the css rule above must be included in the external stylesheet of the\n * application.\n *\n * @element ANY\n *\n * @example\n <example name=\"ng-cloak\">\n <file name=\"index.html\">\n <div id=\"template1\" ng-cloak>{{ 'hello' }}</div>\n <div id=\"template2\" class=\"ng-cloak\">{{ 'world' }}</div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should remove the template directive and css class', function() {\n expect($('#template1').getAttribute('ng-cloak')).\n toBeNull();\n expect($('#template2').getAttribute('ng-cloak')).\n toBeNull();\n });\n </file>\n </example>\n *\n */\nvar ngCloakDirective = ngDirective({\n compile: function(element, attr) {\n attr.$set('ngCloak', undefined);\n element.removeClass('ng-cloak');\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngController\n *\n * @description\n * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular\n * supports the principles behind the Model-View-Controller design pattern.\n *\n * MVC components in angular:\n *\n * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties\n * are accessed through bindings.\n * * View — The template (HTML with data bindings) that is rendered into the View.\n * * Controller — The `ngController` directive specifies a Controller class; the class contains business\n * logic behind the application to decorate the scope with functions and values\n *\n * Note that you can also attach controllers to the DOM by declaring it in a route definition\n * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller\n * again using `ng-controller` in the template itself. This will cause the controller to be attached\n * and executed twice.\n *\n * @element ANY\n * @scope\n * @priority 500\n * @param {expression} ngController Name of a constructor function registered with the current\n * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression}\n * that on the current scope evaluates to a constructor function.\n *\n * The controller instance can be published into a scope property by specifying\n * `ng-controller=\"as propertyName\"`.\n *\n * If the current `$controllerProvider` is configured to use globals (via\n * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may\n * also be the name of a globally accessible constructor function (deprecated, not recommended).\n *\n * @example\n * Here is a simple form for editing user contact information. Adding, removing, clearing, and\n * greeting are methods declared on the controller (see source tab). These methods can\n * easily be called from the angular markup. Any changes to the data are automatically reflected\n * in the View without the need for a manual update.\n *\n * Two different declaration styles are included below:\n *\n * * one binds methods and properties directly onto the controller using `this`:\n * `ng-controller=\"SettingsController1 as settings\"`\n * * one injects `$scope` into the controller:\n * `ng-controller=\"SettingsController2\"`\n *\n * The second option is more common in the Angular community, and is generally used in boilerplates\n * and in this guide. However, there are advantages to binding properties directly to the controller\n * and avoiding scope.\n *\n * * Using `controller as` makes it obvious which controller you are accessing in the template when\n * multiple controllers apply to an element.\n * * If you are writing your controllers as classes you have easier access to the properties and\n * methods, which will appear on the scope, from inside the controller code.\n * * Since there is always a `.` in the bindings, you don't have to worry about prototypal\n * inheritance masking primitives.\n *\n * This example demonstrates the `controller as` syntax.\n *\n * <example name=\"ngControllerAs\" module=\"controllerAsExample\">\n * <file name=\"index.html\">\n * <div id=\"ctrl-as-exmpl\" ng-controller=\"SettingsController1 as settings\">\n * <label>Name: <input type=\"text\" ng-model=\"settings.name\"/></label>\n * <button ng-click=\"settings.greet()\">greet</button><br/>\n * Contact:\n * <ul>\n * <li ng-repeat=\"contact in settings.contacts\">\n * <select ng-model=\"contact.type\" aria-label=\"Contact method\" id=\"select_{{$index}}\">\n * <option>phone</option>\n * <option>email</option>\n * </select>\n * <input type=\"text\" ng-model=\"contact.value\" aria-labelledby=\"select_{{$index}}\" />\n * <button ng-click=\"settings.clearContact(contact)\">clear</button>\n * <button ng-click=\"settings.removeContact(contact)\" aria-label=\"Remove\">X</button>\n * </li>\n * <li><button ng-click=\"settings.addContact()\">add</button></li>\n * </ul>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('controllerAsExample', [])\n * .controller('SettingsController1', SettingsController1);\n *\n * function SettingsController1() {\n * this.name = 'John Smith';\n * this.contacts = [\n * {type: 'phone', value: '408 555 1212'},\n * {type: 'email', value: 'john.smith@example.org'}\n * ];\n * }\n *\n * SettingsController1.prototype.greet = function() {\n * alert(this.name);\n * };\n *\n * SettingsController1.prototype.addContact = function() {\n * this.contacts.push({type: 'email', value: 'yourname@example.org'});\n * };\n *\n * SettingsController1.prototype.removeContact = function(contactToRemove) {\n * var index = this.contacts.indexOf(contactToRemove);\n * this.contacts.splice(index, 1);\n * };\n *\n * SettingsController1.prototype.clearContact = function(contact) {\n * contact.type = 'phone';\n * contact.value = '';\n * };\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should check controller as', function() {\n * var container = element(by.id('ctrl-as-exmpl'));\n * expect(container.element(by.model('settings.name'))\n * .getAttribute('value')).toBe('John Smith');\n *\n * var firstRepeat =\n * container.element(by.repeater('contact in settings.contacts').row(0));\n * var secondRepeat =\n * container.element(by.repeater('contact in settings.contacts').row(1));\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('408 555 1212');\n *\n * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('john.smith@example.org');\n *\n * firstRepeat.element(by.buttonText('clear')).click();\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('');\n *\n * container.element(by.buttonText('add')).click();\n *\n * expect(container.element(by.repeater('contact in settings.contacts').row(2))\n * .element(by.model('contact.value'))\n * .getAttribute('value'))\n * .toBe('yourname@example.org');\n * });\n * </file>\n * </example>\n *\n * This example demonstrates the \"attach to `$scope`\" style of controller.\n *\n * <example name=\"ngController\" module=\"controllerExample\">\n * <file name=\"index.html\">\n * <div id=\"ctrl-exmpl\" ng-controller=\"SettingsController2\">\n * <label>Name: <input type=\"text\" ng-model=\"name\"/></label>\n * <button ng-click=\"greet()\">greet</button><br/>\n * Contact:\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <select ng-model=\"contact.type\" id=\"select_{{$index}}\">\n * <option>phone</option>\n * <option>email</option>\n * </select>\n * <input type=\"text\" ng-model=\"contact.value\" aria-labelledby=\"select_{{$index}}\" />\n * <button ng-click=\"clearContact(contact)\">clear</button>\n * <button ng-click=\"removeContact(contact)\">X</button>\n * </li>\n * <li>[ <button ng-click=\"addContact()\">add</button> ]</li>\n * </ul>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('controllerExample', [])\n * .controller('SettingsController2', ['$scope', SettingsController2]);\n *\n * function SettingsController2($scope) {\n * $scope.name = 'John Smith';\n * $scope.contacts = [\n * {type:'phone', value:'408 555 1212'},\n * {type:'email', value:'john.smith@example.org'}\n * ];\n *\n * $scope.greet = function() {\n * alert($scope.name);\n * };\n *\n * $scope.addContact = function() {\n * $scope.contacts.push({type:'email', value:'yourname@example.org'});\n * };\n *\n * $scope.removeContact = function(contactToRemove) {\n * var index = $scope.contacts.indexOf(contactToRemove);\n * $scope.contacts.splice(index, 1);\n * };\n *\n * $scope.clearContact = function(contact) {\n * contact.type = 'phone';\n * contact.value = '';\n * };\n * }\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should check controller', function() {\n * var container = element(by.id('ctrl-exmpl'));\n *\n * expect(container.element(by.model('name'))\n * .getAttribute('value')).toBe('John Smith');\n *\n * var firstRepeat =\n * container.element(by.repeater('contact in contacts').row(0));\n * var secondRepeat =\n * container.element(by.repeater('contact in contacts').row(1));\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('408 555 1212');\n * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('john.smith@example.org');\n *\n * firstRepeat.element(by.buttonText('clear')).click();\n *\n * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))\n * .toBe('');\n *\n * container.element(by.buttonText('add')).click();\n *\n * expect(container.element(by.repeater('contact in contacts').row(2))\n * .element(by.model('contact.value'))\n * .getAttribute('value'))\n * .toBe('yourname@example.org');\n * });\n * </file>\n *</example>\n\n */\nvar ngControllerDirective = [function() {\n return {\n restrict: 'A',\n scope: true,\n controller: '@',\n priority: 500\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngCsp\n *\n * @restrict A\n * @element ANY\n * @description\n *\n * Angular has some features that can conflict with certain restrictions that are applied when using\n * [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) rules.\n *\n * If you intend to implement CSP with these rules then you must tell Angular not to use these\n * features.\n *\n * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps.\n *\n *\n * The following default rules in CSP affect Angular:\n *\n * * The use of `eval()`, `Function(string)` and similar functions to dynamically create and execute\n * code from strings is forbidden. Angular makes use of this in the {@link $parse} service to\n * provide a 30% increase in the speed of evaluating Angular expressions. (This CSP rule can be\n * disabled with the CSP keyword `unsafe-eval`, but it is generally not recommended as it would\n * weaken the protections offered by CSP.)\n *\n * * The use of inline resources, such as inline `<script>` and `<style>` elements, are forbidden.\n * This prevents apps from injecting custom styles directly into the document. Angular makes use of\n * this to include some CSS rules (e.g. {@link ngCloak} and {@link ngHide}). To make these\n * directives work when a CSP rule is blocking inline styles, you must link to the `angular-csp.css`\n * in your HTML manually. (This CSP rule can be disabled with the CSP keyword `unsafe-inline`, but\n * it is generally not recommended as it would weaken the protections offered by CSP.)\n *\n * If you do not provide `ngCsp` then Angular tries to autodetect if CSP is blocking dynamic code\n * creation from strings (e.g., `unsafe-eval` not specified in CSP header) and automatically\n * deactivates this feature in the {@link $parse} service. This autodetection, however, triggers a\n * CSP error to be logged in the console:\n *\n * ```\n * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of\n * script in the following Content Security Policy directive: \"default-src 'self'\". Note that\n * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.\n * ```\n *\n * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`\n * directive on an element of the HTML document that appears before the `<script>` tag that loads\n * the `angular.js` file.\n *\n * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*\n *\n * You can specify which of the CSP related Angular features should be deactivated by providing\n * a value for the `ng-csp` attribute. The options are as follows:\n *\n * * no-inline-style: this stops Angular from injecting CSS styles into the DOM\n *\n * * no-unsafe-eval: this stops Angular from optimizing $parse with unsafe eval of strings\n *\n * You can use these values in the following combinations:\n *\n *\n * * No declaration means that Angular will assume that you can do inline styles, but it will do\n * a runtime check for unsafe-eval. E.g. `<body>`. This is backwardly compatible with previous\n * versions of Angular.\n *\n * * A simple `ng-csp` (or `data-ng-csp`) attribute will tell Angular to deactivate both inline\n * styles and unsafe eval. E.g. `<body ng-csp>`. This is backwardly compatible with previous\n * versions of Angular.\n *\n * * Specifying only `no-unsafe-eval` tells Angular that we must not use eval, but that we can\n * inject inline styles. E.g. `<body ng-csp=\"no-unsafe-eval\">`.\n *\n * * Specifying only `no-inline-style` tells Angular that we must not inject styles, but that we can\n * run eval - no automatic check for unsafe eval will occur. E.g. `<body ng-csp=\"no-inline-style\">`\n *\n * * Specifying both `no-unsafe-eval` and `no-inline-style` tells Angular that we must not inject\n * styles nor use eval, which is the same as an empty: ng-csp.\n * E.g.`<body ng-csp=\"no-inline-style;no-unsafe-eval\">`\n *\n * @example\n * This example shows how to apply the `ngCsp` directive to the `html` tag.\n ```html\n <!doctype html>\n <html ng-app ng-csp>\n ...\n ...\n </html>\n ```\n * @example\n <!-- Note: the `.csp` suffix in the example name triggers CSP mode in our http server! -->\n <example name=\"example.csp\" module=\"cspExample\" ng-csp=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"MainController as ctrl\">\n <div>\n <button ng-click=\"ctrl.inc()\" id=\"inc\">Increment</button>\n <span id=\"counter\">\n {{ctrl.counter}}\n </span>\n </div>\n\n <div>\n <button ng-click=\"ctrl.evil()\" id=\"evil\">Evil</button>\n <span id=\"evilError\">\n {{ctrl.evilError}}\n </span>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('cspExample', [])\n .controller('MainController', function MainController() {\n this.counter = 0;\n this.inc = function() {\n this.counter++;\n };\n this.evil = function() {\n try {\n eval('1+2'); // eslint-disable-line no-eval\n } catch (e) {\n this.evilError = e.message;\n }\n };\n });\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var util, webdriver;\n\n var incBtn = element(by.id('inc'));\n var counter = element(by.id('counter'));\n var evilBtn = element(by.id('evil'));\n var evilError = element(by.id('evilError'));\n\n function getAndClearSevereErrors() {\n return browser.manage().logs().get('browser').then(function(browserLog) {\n return browserLog.filter(function(logEntry) {\n return logEntry.level.value > webdriver.logging.Level.WARNING.value;\n });\n });\n }\n\n function clearErrors() {\n getAndClearSevereErrors();\n }\n\n function expectNoErrors() {\n getAndClearSevereErrors().then(function(filteredLog) {\n expect(filteredLog.length).toEqual(0);\n if (filteredLog.length) {\n console.log('browser console errors: ' + util.inspect(filteredLog));\n }\n });\n }\n\n function expectError(regex) {\n getAndClearSevereErrors().then(function(filteredLog) {\n var found = false;\n filteredLog.forEach(function(log) {\n if (log.message.match(regex)) {\n found = true;\n }\n });\n if (!found) {\n throw new Error('expected an error that matches ' + regex);\n }\n });\n }\n\n beforeEach(function() {\n util = require('util');\n webdriver = require('selenium-webdriver');\n });\n\n // For now, we only test on Chrome,\n // as Safari does not load the page with Protractor's injected scripts,\n // and Firefox webdriver always disables content security policy (#6358)\n if (browser.params.browser !== 'chrome') {\n return;\n }\n\n it('should not report errors when the page is loaded', function() {\n // clear errors so we are not dependent on previous tests\n clearErrors();\n // Need to reload the page as the page is already loaded when\n // we come here\n browser.driver.getCurrentUrl().then(function(url) {\n browser.get(url);\n });\n expectNoErrors();\n });\n\n it('should evaluate expressions', function() {\n expect(counter.getText()).toEqual('0');\n incBtn.click();\n expect(counter.getText()).toEqual('1');\n expectNoErrors();\n });\n\n it('should throw and report an error when using \"eval\"', function() {\n evilBtn.click();\n expect(evilError.getText()).toMatch(/Content Security Policy/);\n expectError(/Content Security Policy/);\n });\n </file>\n </example>\n */\n\n// `ngCsp` is not implemented as a proper directive any more, because we need it be processed while\n// we bootstrap the app (before `$parse` is instantiated). For this reason, we just have the `csp()`\n// fn that looks for the `ng-csp` attribute anywhere in the current doc.\n\n/**\n * @ngdoc directive\n * @name ngClick\n *\n * @description\n * The ngClick directive allows you to specify custom behavior when\n * an element is clicked.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon\n * click. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-click\">\n <file name=\"index.html\">\n <button ng-click=\"count = count + 1\" ng-init=\"count=0\">\n Increment\n </button>\n <span>\n count: {{count}}\n </span>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-click', function() {\n expect(element(by.binding('count')).getText()).toMatch('0');\n element(by.css('button')).click();\n expect(element(by.binding('count')).getText()).toMatch('1');\n });\n </file>\n </example>\n */\n/*\n * A collection of directives that allows creation of custom event handlers that are defined as\n * angular expressions and are compiled and executed within the current scope.\n */\nvar ngEventDirectives = {};\n\n// For events that might fire synchronously during DOM manipulation\n// we need to execute their event handlers asynchronously using $evalAsync,\n// so that they are not executed in an inconsistent state.\nvar forceAsyncEvents = {\n 'blur': true,\n 'focus': true\n};\nforEach(\n 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),\n function(eventName) {\n var directiveName = directiveNormalize('ng-' + eventName);\n ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {\n return {\n restrict: 'A',\n compile: function($element, attr) {\n // NOTE:\n // We expose the powerful `$event` object on the scope that provides access to the Window,\n // etc. This is OK, because expressions are not sandboxed any more (and the expression\n // sandbox was never meant to be a security feature anyway).\n var fn = $parse(attr[directiveName]);\n return function ngEventHandler(scope, element) {\n element.on(eventName, function(event) {\n var callback = function() {\n fn(scope, {$event: event});\n };\n if (forceAsyncEvents[eventName] && $rootScope.$$phase) {\n scope.$evalAsync(callback);\n } else {\n scope.$apply(callback);\n }\n });\n };\n }\n };\n }];\n }\n);\n\n/**\n * @ngdoc directive\n * @name ngDblclick\n *\n * @description\n * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon\n * a dblclick. (The Event object is available as `$event`)\n *\n * @example\n <example name=\"ng-dblclick\">\n <file name=\"index.html\">\n <button ng-dblclick=\"count = count + 1\" ng-init=\"count=0\">\n Increment (on double click)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousedown\n *\n * @description\n * The ngMousedown directive allows you to specify custom behavior on mousedown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon\n * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-mousedown\">\n <file name=\"index.html\">\n <button ng-mousedown=\"count = count + 1\" ng-init=\"count=0\">\n Increment (on mouse down)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseup\n *\n * @description\n * Specify custom behavior on mouseup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon\n * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-mouseup\">\n <file name=\"index.html\">\n <button ng-mouseup=\"count = count + 1\" ng-init=\"count=0\">\n Increment (on mouse up)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngMouseover\n *\n * @description\n * Specify custom behavior on mouseover event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon\n * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-mouseover\">\n <file name=\"index.html\">\n <button ng-mouseover=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse is over)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseenter\n *\n * @description\n * Specify custom behavior on mouseenter event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon\n * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-mouseenter\">\n <file name=\"index.html\">\n <button ng-mouseenter=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse enters)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMouseleave\n *\n * @description\n * Specify custom behavior on mouseleave event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon\n * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-mouseleave\">\n <file name=\"index.html\">\n <button ng-mouseleave=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse leaves)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngMousemove\n *\n * @description\n * Specify custom behavior on mousemove event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon\n * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-mousemove\">\n <file name=\"index.html\">\n <button ng-mousemove=\"count = count + 1\" ng-init=\"count=0\">\n Increment (when mouse moves)\n </button>\n count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeydown\n *\n * @description\n * Specify custom behavior on keydown event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon\n * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n <example name=\"ng-keydown\">\n <file name=\"index.html\">\n <input ng-keydown=\"count = count + 1\" ng-init=\"count=0\">\n key down count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeyup\n *\n * @description\n * Specify custom behavior on keyup event.\n *\n * @element ANY\n * @priority 0\n * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon\n * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n <example name=\"ng-keyup\">\n <file name=\"index.html\">\n <p>Typing in the input box below updates the key count</p>\n <input ng-keyup=\"count = count + 1\" ng-init=\"count=0\"> key up count: {{count}}\n\n <p>Typing in the input box below updates the keycode</p>\n <input ng-keyup=\"event=$event\">\n <p>event keyCode: {{ event.keyCode }}</p>\n <p>event altKey: {{ event.altKey }}</p>\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngKeypress\n *\n * @description\n * Specify custom behavior on keypress event.\n *\n * @element ANY\n * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon\n * keypress. ({@link guide/expression#-event- Event object is available as `$event`}\n * and can be interrogated for keyCode, altKey, etc.)\n *\n * @example\n <example name=\"ng-keypress\">\n <file name=\"index.html\">\n <input ng-keypress=\"count = count + 1\" ng-init=\"count=0\">\n key press count: {{count}}\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSubmit\n *\n * @description\n * Enables binding angular expressions to onsubmit events.\n *\n * Additionally it prevents the default action (which for form means sending the request to the\n * server and reloading the current page), but only if the form does not contain `action`,\n * `data-action`, or `x-action` attributes.\n *\n * <div class=\"alert alert-warning\">\n * **Warning:** Be careful not to cause \"double-submission\" by using both the `ngClick` and\n * `ngSubmit` handlers together. See the\n * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}\n * for a detailed discussion of when `ngSubmit` may be triggered.\n * </div>\n *\n * @element form\n * @priority 0\n * @param {expression} ngSubmit {@link guide/expression Expression} to eval.\n * ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example module=\"submitExample\" name=\"ng-submit\">\n <file name=\"index.html\">\n <script>\n angular.module('submitExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.list = [];\n $scope.text = 'hello';\n $scope.submit = function() {\n if ($scope.text) {\n $scope.list.push(this.text);\n $scope.text = '';\n }\n };\n }]);\n </script>\n <form ng-submit=\"submit()\" ng-controller=\"ExampleController\">\n Enter text and hit enter:\n <input type=\"text\" ng-model=\"text\" name=\"text\" />\n <input type=\"submit\" id=\"submit\" value=\"Submit\" />\n <pre>list={{list}}</pre>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-submit', function() {\n expect(element(by.binding('list')).getText()).toBe('list=[]');\n element(by.css('#submit')).click();\n expect(element(by.binding('list')).getText()).toContain('hello');\n expect(element(by.model('text')).getAttribute('value')).toBe('');\n });\n it('should ignore empty strings', function() {\n expect(element(by.binding('list')).getText()).toBe('list=[]');\n element(by.css('#submit')).click();\n element(by.css('#submit')).click();\n expect(element(by.binding('list')).getText()).toContain('hello');\n });\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngFocus\n *\n * @description\n * Specify custom behavior on focus event.\n *\n * Note: As the `focus` event is executed synchronously when calling `input.focus()`\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon\n * focus. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngBlur\n *\n * @description\n * Specify custom behavior on blur event.\n *\n * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when\n * an element has lost focus.\n *\n * Note: As the `blur` event is executed synchronously also during DOM manipulations\n * (e.g. removing a focussed input),\n * AngularJS executes the expression using `scope.$evalAsync` if the event is fired\n * during an `$apply` to ensure a consistent state.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon\n * blur. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n * See {@link ng.directive:ngClick ngClick}\n */\n\n/**\n * @ngdoc directive\n * @name ngCopy\n *\n * @description\n * Specify custom behavior on copy event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon\n * copy. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-copy\">\n <file name=\"index.html\">\n <input ng-copy=\"copied=true\" ng-init=\"copied=false; value='copy me'\" ng-model=\"value\">\n copied: {{copied}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngCut\n *\n * @description\n * Specify custom behavior on cut event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon\n * cut. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-cut\">\n <file name=\"index.html\">\n <input ng-cut=\"cut=true\" ng-init=\"cut=false; value='cut me'\" ng-model=\"value\">\n cut: {{cut}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngPaste\n *\n * @description\n * Specify custom behavior on paste event.\n *\n * @element window, input, select, textarea, a\n * @priority 0\n * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon\n * paste. ({@link guide/expression#-event- Event object is available as `$event`})\n *\n * @example\n <example name=\"ng-paste\">\n <file name=\"index.html\">\n <input ng-paste=\"paste=true\" ng-init=\"paste=false\" placeholder='paste here'>\n pasted: {{paste}}\n </file>\n </example>\n */\n\n/**\n * @ngdoc directive\n * @name ngIf\n * @restrict A\n * @multiElement\n *\n * @description\n * The `ngIf` directive removes or recreates a portion of the DOM tree based on an\n * {expression}. If the expression assigned to `ngIf` evaluates to a false\n * value then the element is removed from the DOM, otherwise a clone of the\n * element is reinserted into the DOM.\n *\n * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the\n * element in the DOM rather than changing its visibility via the `display` css property. A common\n * case when this difference is significant is when using css selectors that rely on an element's\n * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.\n *\n * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope\n * is created when the element is restored. The scope created within `ngIf` inherits from\n * its parent scope using\n * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance).\n * An important implication of this is if `ngModel` is used within `ngIf` to bind to\n * a javascript primitive defined in the parent scope. In this case any modifications made to the\n * variable within the child scope will override (hide) the value in the parent scope.\n *\n * Also, `ngIf` recreates elements using their compiled state. An example of this behavior\n * is if an element's class attribute is directly modified after it's compiled, using something like\n * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element\n * the added class will be lost because the original compiled state is used to regenerate the element.\n *\n * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`\n * and `leave` effects.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container |\n * | {@link ng.$animate#leave leave} | just before the `ngIf` contents are removed from the DOM |\n *\n * @element ANY\n * @scope\n * @priority 600\n * @param {expression} ngIf If the {@link guide/expression expression} is falsy then\n * the element is removed from the DOM tree. If it is truthy a copy of the compiled\n * element is added to the DOM tree.\n *\n * @example\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-if\">\n <file name=\"index.html\">\n <label>Click me: <input type=\"checkbox\" ng-model=\"checked\" ng-init=\"checked=true\" /></label><br/>\n Show when checked:\n <span ng-if=\"checked\" class=\"animate-if\">\n This is removed when the checkbox is unchecked.\n </span>\n </file>\n <file name=\"animations.css\">\n .animate-if {\n background:white;\n border:1px solid black;\n padding:10px;\n }\n\n .animate-if.ng-enter, .animate-if.ng-leave {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n }\n\n .animate-if.ng-enter,\n .animate-if.ng-leave.ng-leave-active {\n opacity:0;\n }\n\n .animate-if.ng-leave,\n .animate-if.ng-enter.ng-enter-active {\n opacity:1;\n }\n </file>\n </example>\n */\nvar ngIfDirective = ['$animate', '$compile', function($animate, $compile) {\n return {\n multiElement: true,\n transclude: 'element',\n priority: 600,\n terminal: true,\n restrict: 'A',\n $$tlb: true,\n link: function($scope, $element, $attr, ctrl, $transclude) {\n var block, childScope, previousElements;\n $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {\n\n if (value) {\n if (!childScope) {\n $transclude(function(clone, newScope) {\n childScope = newScope;\n clone[clone.length++] = $compile.$$createComment('end ngIf', $attr.ngIf);\n // Note: We only need the first/last node of the cloned nodes.\n // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n // by a directive with templateUrl when its template arrives.\n block = {\n clone: clone\n };\n $animate.enter(clone, $element.parent(), $element);\n });\n }\n } else {\n if (previousElements) {\n previousElements.remove();\n previousElements = null;\n }\n if (childScope) {\n childScope.$destroy();\n childScope = null;\n }\n if (block) {\n previousElements = getBlockNodes(block.clone);\n $animate.leave(previousElements).done(function(response) {\n if (response !== false) previousElements = null;\n });\n block = null;\n }\n }\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngInclude\n * @restrict ECA\n *\n * @description\n * Fetches, compiles and includes an external HTML fragment.\n *\n * By default, the template URL is restricted to the same domain and protocol as the\n * application document. This is done by calling {@link $sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols\n * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or\n * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link\n * ng.$sce Strict Contextual Escaping}.\n *\n * In addition, the browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy may further restrict whether the template is successfully loaded.\n * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`\n * access on some browsers.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | when the expression changes, on the new include |\n * | {@link ng.$animate#leave leave} | when the expression changes, on the old include |\n *\n * The enter and leave animation occur concurrently.\n *\n * @scope\n * @priority 400\n *\n * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,\n * make sure you wrap it in **single** quotes, e.g. `src=\"'myPartialTemplate.html'\"`.\n * @param {string=} onload Expression to evaluate when a new partial is loaded.\n * <div class=\"alert alert-warning\">\n * **Note:** When using onload on SVG elements in IE11, the browser will try to call\n * a function with the name on the window element, which will usually throw a\n * \"function is undefined\" error. To fix this, you can instead use `data-onload` or a\n * different form that {@link guide/directive#normalization matches} `onload`.\n * </div>\n *\n * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll\n * $anchorScroll} to scroll the viewport after the content is loaded.\n *\n * - If the attribute is not set, disable scrolling.\n * - If the attribute is set without value, enable scrolling.\n * - Otherwise enable scrolling only if the expression evaluates to truthy value.\n *\n * @example\n <example module=\"includeExample\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-include\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <select ng-model=\"template\" ng-options=\"t.name for t in templates\">\n <option value=\"\">(blank)</option>\n </select>\n url of the template: <code>{{template.url}}</code>\n <hr/>\n <div class=\"slide-animate-container\">\n <div class=\"slide-animate\" ng-include=\"template.url\"></div>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('includeExample', ['ngAnimate'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.templates =\n [{ name: 'template1.html', url: 'template1.html'},\n { name: 'template2.html', url: 'template2.html'}];\n $scope.template = $scope.templates[0];\n }]);\n </file>\n <file name=\"template1.html\">\n Content of template1.html\n </file>\n <file name=\"template2.html\">\n Content of template2.html\n </file>\n <file name=\"animations.css\">\n .slide-animate-container {\n position:relative;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .slide-animate {\n padding:10px;\n }\n\n .slide-animate.ng-enter, .slide-animate.ng-leave {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n display:block;\n padding:10px;\n }\n\n .slide-animate.ng-enter {\n top:-50px;\n }\n .slide-animate.ng-enter.ng-enter-active {\n top:0;\n }\n\n .slide-animate.ng-leave {\n top:0;\n }\n .slide-animate.ng-leave.ng-leave-active {\n top:50px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var templateSelect = element(by.model('template'));\n var includeElem = element(by.css('[ng-include]'));\n\n it('should load template1.html', function() {\n expect(includeElem.getText()).toMatch(/Content of template1.html/);\n });\n\n it('should load template2.html', function() {\n if (browser.params.browser === 'firefox') {\n // Firefox can't handle using selects\n // See https://github.com/angular/protractor/issues/480\n return;\n }\n templateSelect.click();\n templateSelect.all(by.css('option')).get(2).click();\n expect(includeElem.getText()).toMatch(/Content of template2.html/);\n });\n\n it('should change to blank', function() {\n if (browser.params.browser === 'firefox') {\n // Firefox can't handle using selects\n return;\n }\n templateSelect.click();\n templateSelect.all(by.css('option')).get(0).click();\n expect(includeElem.isPresent()).toBe(false);\n });\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentRequested\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted every time the ngInclude content is requested.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentLoaded\n * @eventType emit on the current ngInclude scope\n * @description\n * Emitted every time the ngInclude content is reloaded.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\n\n\n/**\n * @ngdoc event\n * @name ngInclude#$includeContentError\n * @eventType emit on the scope ngInclude was declared in\n * @description\n * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299)\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {String} src URL of content to load.\n */\nvar ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate',\n function($templateRequest, $anchorScroll, $animate) {\n return {\n restrict: 'ECA',\n priority: 400,\n terminal: true,\n transclude: 'element',\n controller: angular.noop,\n compile: function(element, attr) {\n var srcExp = attr.ngInclude || attr.src,\n onloadExp = attr.onload || '',\n autoScrollExp = attr.autoscroll;\n\n return function(scope, $element, $attr, ctrl, $transclude) {\n var changeCounter = 0,\n currentScope,\n previousElement,\n currentElement;\n\n var cleanupLastIncludeContent = function() {\n if (previousElement) {\n previousElement.remove();\n previousElement = null;\n }\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentElement) {\n $animate.leave(currentElement).done(function(response) {\n if (response !== false) previousElement = null;\n });\n previousElement = currentElement;\n currentElement = null;\n }\n };\n\n scope.$watch(srcExp, function ngIncludeWatchAction(src) {\n var afterAnimation = function(response) {\n if (response !== false && isDefined(autoScrollExp) &&\n (!autoScrollExp || scope.$eval(autoScrollExp))) {\n $anchorScroll();\n }\n };\n var thisChangeId = ++changeCounter;\n\n if (src) {\n //set the 2nd param to true to ignore the template request error so that the inner\n //contents and scope can be cleaned up.\n $templateRequest(src, true).then(function(response) {\n if (scope.$$destroyed) return;\n\n if (thisChangeId !== changeCounter) return;\n var newScope = scope.$new();\n ctrl.template = response;\n\n // Note: This will also link all children of ng-include that were contained in the original\n // html. If that content contains controllers, ... they could pollute/change the scope.\n // However, using ng-include on an element with additional content does not make sense...\n // Note: We can't remove them in the cloneAttchFn of $transclude as that\n // function is called before linking the content, which would apply child\n // directives to non existing elements.\n var clone = $transclude(newScope, function(clone) {\n cleanupLastIncludeContent();\n $animate.enter(clone, null, $element).done(afterAnimation);\n });\n\n currentScope = newScope;\n currentElement = clone;\n\n currentScope.$emit('$includeContentLoaded', src);\n scope.$eval(onloadExp);\n }, function() {\n if (scope.$$destroyed) return;\n\n if (thisChangeId === changeCounter) {\n cleanupLastIncludeContent();\n scope.$emit('$includeContentError', src);\n }\n });\n scope.$emit('$includeContentRequested', src);\n } else {\n cleanupLastIncludeContent();\n ctrl.template = null;\n }\n });\n };\n }\n };\n}];\n\n// This directive is called during the $transclude call of the first `ngInclude` directive.\n// It will replace and compile the content of the element with the loaded template.\n// We need this directive so that the element content is already filled when\n// the link function of another directive on the same element as ngInclude\n// is called.\nvar ngIncludeFillContentDirective = ['$compile',\n function($compile) {\n return {\n restrict: 'ECA',\n priority: -400,\n require: 'ngInclude',\n link: function(scope, $element, $attr, ctrl) {\n if (toString.call($element[0]).match(/SVG/)) {\n // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not\n // support innerHTML, so detect this here and try to generate the contents\n // specially.\n $element.empty();\n $compile(jqLiteBuildFragment(ctrl.template, window.document).childNodes)(scope,\n function namespaceAdaptedClone(clone) {\n $element.append(clone);\n }, {futureParentElement: $element});\n return;\n }\n\n $element.html(ctrl.template);\n $compile($element.contents())(scope);\n }\n };\n }];\n\n/**\n * @ngdoc directive\n * @name ngInit\n * @restrict AC\n *\n * @description\n * The `ngInit` directive allows you to evaluate an expression in the\n * current scope.\n *\n * <div class=\"alert alert-danger\">\n * This directive can be abused to add unnecessary amounts of logic into your templates.\n * There are only a few appropriate uses of `ngInit`, such as for aliasing special properties of\n * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below; and for injecting data via\n * server side scripting. Besides these few cases, you should use {@link guide/controller controllers}\n * rather than `ngInit` to initialize values on a scope.\n * </div>\n *\n * <div class=\"alert alert-warning\">\n * **Note**: If you have assignment in `ngInit` along with a {@link ng.$filter `filter`}, make\n * sure you have parentheses to ensure correct operator precedence:\n * <pre class=\"prettyprint\">\n * `<div ng-init=\"test1 = ($index | toString)\"></div>`\n * </pre>\n * </div>\n *\n * @priority 450\n *\n * @element ANY\n * @param {expression} ngInit {@link guide/expression Expression} to eval.\n *\n * @example\n <example module=\"initExample\" name=\"ng-init\">\n <file name=\"index.html\">\n <script>\n angular.module('initExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.list = [['a', 'b'], ['c', 'd']];\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <div ng-repeat=\"innerList in list\" ng-init=\"outerIndex = $index\">\n <div ng-repeat=\"value in innerList\" ng-init=\"innerIndex = $index\">\n <span class=\"example-init\">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>\n </div>\n </div>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should alias index positions', function() {\n var elements = element.all(by.css('.example-init'));\n expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');\n expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');\n expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');\n expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');\n });\n </file>\n </example>\n */\nvar ngInitDirective = ngDirective({\n priority: 450,\n compile: function() {\n return {\n pre: function(scope, element, attrs) {\n scope.$eval(attrs.ngInit);\n }\n };\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngList\n *\n * @description\n * Text input that converts between a delimited string and an array of strings. The default\n * delimiter is a comma followed by a space - equivalent to `ng-list=\", \"`. You can specify a custom\n * delimiter as the value of the `ngList` attribute - for example, `ng-list=\" | \"`.\n *\n * The behaviour of the directive is affected by the use of the `ngTrim` attribute.\n * * If `ngTrim` is set to `\"false\"` then whitespace around both the separator and each\n * list item is respected. This implies that the user of the directive is responsible for\n * dealing with whitespace but also allows you to use whitespace as a delimiter, such as a\n * tab or newline character.\n * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected\n * when joining the list items back together) and whitespace around each list item is stripped\n * before it is added to the model.\n *\n * ### Example with Validation\n *\n * <example name=\"ngList-directive\" module=\"listExample\">\n * <file name=\"app.js\">\n * angular.module('listExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.names = ['morpheus', 'neo', 'trinity'];\n * }]);\n * </file>\n * <file name=\"index.html\">\n * <form name=\"myForm\" ng-controller=\"ExampleController\">\n * <label>List: <input name=\"namesInput\" ng-model=\"names\" ng-list required></label>\n * <span role=\"alert\">\n * <span class=\"error\" ng-show=\"myForm.namesInput.$error.required\">\n * Required!</span>\n * </span>\n * <br>\n * <tt>names = {{names}}</tt><br/>\n * <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>\n * <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>\n * <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>\n * <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>\n * </form>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * var listInput = element(by.model('names'));\n * var names = element(by.exactBinding('names'));\n * var valid = element(by.binding('myForm.namesInput.$valid'));\n * var error = element(by.css('span.error'));\n *\n * it('should initialize to model', function() {\n * expect(names.getText()).toContain('[\"morpheus\",\"neo\",\"trinity\"]');\n * expect(valid.getText()).toContain('true');\n * expect(error.getCssValue('display')).toBe('none');\n * });\n *\n * it('should be invalid if empty', function() {\n * listInput.clear();\n * listInput.sendKeys('');\n *\n * expect(names.getText()).toContain('');\n * expect(valid.getText()).toContain('false');\n * expect(error.getCssValue('display')).not.toBe('none');\n * });\n * </file>\n * </example>\n *\n * ### Example - splitting on newline\n * <example name=\"ngList-directive-newlines\">\n * <file name=\"index.html\">\n * <textarea ng-model=\"list\" ng-list=\" \" ng-trim=\"false\"></textarea>\n * <pre>{{ list | json }}</pre>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it(\"should split the text by newlines\", function() {\n * var listInput = element(by.model('list'));\n * var output = element(by.binding('list | json'));\n * listInput.sendKeys('abc\\ndef\\nghi');\n * expect(output.getText()).toContain('[\\n \"abc\",\\n \"def\",\\n \"ghi\"\\n]');\n * });\n * </file>\n * </example>\n *\n * @element input\n * @param {string=} ngList optional delimiter that should be used to split the value.\n */\nvar ngListDirective = function() {\n return {\n restrict: 'A',\n priority: 100,\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n var ngList = attr.ngList || ', ';\n var trimValues = attr.ngTrim !== 'false';\n var separator = trimValues ? trim(ngList) : ngList;\n\n var parse = function(viewValue) {\n // If the viewValue is invalid (say required but empty) it will be `undefined`\n if (isUndefined(viewValue)) return;\n\n var list = [];\n\n if (viewValue) {\n forEach(viewValue.split(separator), function(value) {\n if (value) list.push(trimValues ? trim(value) : value);\n });\n }\n\n return list;\n };\n\n ctrl.$parsers.push(parse);\n ctrl.$formatters.push(function(value) {\n if (isArray(value)) {\n return value.join(ngList);\n }\n\n return undefined;\n });\n\n // Override the standard $isEmpty because an empty array means the input is empty.\n ctrl.$isEmpty = function(value) {\n return !value || !value.length;\n };\n }\n };\n};\n\n/* global VALID_CLASS: true,\n INVALID_CLASS: true,\n PRISTINE_CLASS: true,\n DIRTY_CLASS: true,\n UNTOUCHED_CLASS: true,\n TOUCHED_CLASS: true,\n PENDING_CLASS: true,\n addSetValidityMethod: true,\n setupValidity: true,\n defaultModelOptions: false\n*/\n\n\nvar VALID_CLASS = 'ng-valid',\n INVALID_CLASS = 'ng-invalid',\n PRISTINE_CLASS = 'ng-pristine',\n DIRTY_CLASS = 'ng-dirty',\n UNTOUCHED_CLASS = 'ng-untouched',\n TOUCHED_CLASS = 'ng-touched',\n EMPTY_CLASS = 'ng-empty',\n NOT_EMPTY_CLASS = 'ng-not-empty';\n\nvar ngModelMinErr = minErr('ngModel');\n\n/**\n * @ngdoc type\n * @name ngModel.NgModelController\n *\n * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a\n * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue\n * is set.\n *\n * @property {*} $modelValue The value in the model that the control is bound to.\n *\n * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever\n * the control updates the ngModelController with a new {@link ngModel.NgModelController#$viewValue\n `$viewValue`} from the DOM, usually via user input.\n See {@link ngModel.NgModelController#$setViewValue `$setViewValue()`} for a detailed lifecycle explanation.\n Note that the `$parsers` are not called when the bound ngModel expression changes programmatically.\n\n The functions are called in array order, each passing\n its return value through to the next. The last return value is forwarded to the\n {@link ngModel.NgModelController#$validators `$validators`} collection.\n\n Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue\n `$viewValue`}.\n\n Returning `undefined` from a parser means a parse error occurred. In that case,\n no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`\n will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}\n is set to `true`. The parse error is stored in `ngModel.$error.parse`.\n\n This simple example shows a parser that would convert text input value to lowercase:\n * ```js\n * function parse(value) {\n * if (value) {\n * return value.toLowerCase();\n * }\n * }\n * ngModelController.$parsers.push(parse);\n * ```\n\n *\n * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever\n the bound ngModel expression changes programmatically. The `$formatters` are not called when the\n value of the control is changed by user interaction.\n\n Formatters are used to format / convert the {@link ngModel.NgModelController#$modelValue\n `$modelValue`} for display in the control.\n\n The functions are called in reverse array order, each passing the value through to the\n next. The last return value is used as the actual DOM value.\n\n This simple example shows a formatter that would convert the model value to uppercase:\n\n * ```js\n * function format(value) {\n * if (value) {\n * return value.toUpperCase();\n * }\n * }\n * ngModel.$formatters.push(format);\n * ```\n *\n * @property {Object.<string, function>} $validators A collection of validators that are applied\n * whenever the model value changes. The key value within the object refers to the name of the\n * validator while the function refers to the validation operation. The validation operation is\n * provided with the model value as an argument and must return a true or false value depending\n * on the response of that validation.\n *\n * ```js\n * ngModel.$validators.validCharacters = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n * return /[0-9]+/.test(value) &&\n * /[a-z]+/.test(value) &&\n * /[A-Z]+/.test(value) &&\n * /\\W+/.test(value);\n * };\n * ```\n *\n * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to\n * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided\n * is expected to return a promise when it is run during the model validation process. Once the promise\n * is delivered then the validation status will be set to true when fulfilled and false when rejected.\n * When the asynchronous validators are triggered, each of the validators will run in parallel and the model\n * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator\n * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators\n * will only run once all synchronous validators have passed.\n *\n * Please note that if $http is used then it is important that the server returns a success HTTP response code\n * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.\n *\n * ```js\n * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n *\n * // Lookup user by username\n * return $http.get('/api/users/' + value).\n * then(function resolved() {\n * //username exists, this means validation fails\n * return $q.reject('exists');\n * }, function rejected() {\n * //username does not exist, therefore this validation passes\n * return true;\n * });\n * };\n * ```\n *\n * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the\n * view value has changed. It is called with no arguments, and its return value is ignored.\n * This can be used in place of additional $watches against the model value.\n *\n * @property {Object} $error An object hash with all failing validator ids as keys.\n * @property {Object} $pending An object hash with all pending validator ids as keys.\n *\n * @property {boolean} $untouched True if control has not lost focus yet.\n * @property {boolean} $touched True if control has lost focus.\n * @property {boolean} $pristine True if user has not interacted with the control yet.\n * @property {boolean} $dirty True if user has already interacted with the control.\n * @property {boolean} $valid True if there is no error.\n * @property {boolean} $invalid True if at least one error on the control.\n * @property {string} $name The name attribute of the control.\n *\n * @description\n *\n * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.\n * The controller contains services for data-binding, validation, CSS updates, and value formatting\n * and parsing. It purposefully does not contain any logic which deals with DOM rendering or\n * listening to DOM events.\n * Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding to control elements.\n * Angular provides this DOM logic for most {@link input `input`} elements.\n * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example\n * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.\n *\n * @example\n * ### Custom Control Example\n * This example shows how to use `NgModelController` with a custom control to achieve\n * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)\n * collaborate together to achieve the desired result.\n *\n * `contenteditable` is an HTML5 attribute, which tells the browser to let the element\n * contents be edited in place by the user.\n *\n * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}\n * module to automatically remove \"bad\" content like inline event listener (e.g. `<span onclick=\"...\">`).\n * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks\n * that content using the `$sce` service.\n *\n * <example name=\"NgModelController\" module=\"customControl\" deps=\"angular-sanitize.js\">\n <file name=\"style.css\">\n [contenteditable] {\n border: 1px solid black;\n background-color: white;\n min-height: 20px;\n }\n\n .ng-invalid {\n border: 1px solid red;\n }\n\n </file>\n <file name=\"script.js\">\n angular.module('customControl', ['ngSanitize']).\n directive('contenteditable', ['$sce', function($sce) {\n return {\n restrict: 'A', // only activate on element attribute\n require: '?ngModel', // get a hold of NgModelController\n link: function(scope, element, attrs, ngModel) {\n if (!ngModel) return; // do nothing if no ng-model\n\n // Specify how UI should be updated\n ngModel.$render = function() {\n element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));\n };\n\n // Listen for change events to enable binding\n element.on('blur keyup change', function() {\n scope.$evalAsync(read);\n });\n read(); // initialize\n\n // Write data to the model\n function read() {\n var html = element.html();\n // When we clear the content editable the browser leaves a <br> behind\n // If strip-br attribute is provided then we strip this out\n if (attrs.stripBr && html === '<br>') {\n html = '';\n }\n ngModel.$setViewValue(html);\n }\n }\n };\n }]);\n </file>\n <file name=\"index.html\">\n <form name=\"myForm\">\n <div contenteditable\n name=\"myWidget\" ng-model=\"userContent\"\n strip-br=\"true\"\n required>Change me!</div>\n <span ng-show=\"myForm.myWidget.$error.required\">Required!</span>\n <hr>\n <textarea ng-model=\"userContent\" aria-label=\"Dynamic textarea\"></textarea>\n </form>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should data-bind and become invalid', function() {\n if (browser.params.browser === 'safari' || browser.params.browser === 'firefox') {\n // SafariDriver can't handle contenteditable\n // and Firefox driver can't clear contenteditables very well\n return;\n }\n var contentEditable = element(by.css('[contenteditable]'));\n var content = 'Change me!';\n\n expect(contentEditable.getText()).toEqual(content);\n\n contentEditable.clear();\n contentEditable.sendKeys(protractor.Key.BACK_SPACE);\n expect(contentEditable.getText()).toEqual('');\n expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);\n });\n </file>\n * </example>\n *\n *\n */\nNgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate'];\nfunction NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) {\n this.$viewValue = Number.NaN;\n this.$modelValue = Number.NaN;\n this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.\n this.$validators = {};\n this.$asyncValidators = {};\n this.$parsers = [];\n this.$formatters = [];\n this.$viewChangeListeners = [];\n this.$untouched = true;\n this.$touched = false;\n this.$pristine = true;\n this.$dirty = false;\n this.$valid = true;\n this.$invalid = false;\n this.$error = {}; // keep invalid keys here\n this.$$success = {}; // keep valid keys here\n this.$pending = undefined; // keep pending keys here\n this.$name = $interpolate($attr.name || '', false)($scope);\n this.$$parentForm = nullFormCtrl;\n this.$options = defaultModelOptions;\n\n this.$$parsedNgModel = $parse($attr.ngModel);\n this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;\n this.$$ngModelGet = this.$$parsedNgModel;\n this.$$ngModelSet = this.$$parsedNgModelAssign;\n this.$$pendingDebounce = null;\n this.$$parserValid = undefined;\n\n this.$$currentValidationRunId = 0;\n\n // https://github.com/angular/angular.js/issues/15833\n // Prevent `$$scope` from being iterated over by `copy` when NgModelController is deep watched\n Object.defineProperty(this, '$$scope', {value: $scope});\n this.$$attr = $attr;\n this.$$element = $element;\n this.$$animate = $animate;\n this.$$timeout = $timeout;\n this.$$parse = $parse;\n this.$$q = $q;\n this.$$exceptionHandler = $exceptionHandler;\n\n setupValidity(this);\n setupModelWatcher(this);\n}\n\nNgModelController.prototype = {\n $$initGetterSetters: function() {\n if (this.$options.getOption('getterSetter')) {\n var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'),\n invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)');\n\n this.$$ngModelGet = function($scope) {\n var modelValue = this.$$parsedNgModel($scope);\n if (isFunction(modelValue)) {\n modelValue = invokeModelGetter($scope);\n }\n return modelValue;\n };\n this.$$ngModelSet = function($scope, newValue) {\n if (isFunction(this.$$parsedNgModel($scope))) {\n invokeModelSetter($scope, {$$$p: newValue});\n } else {\n this.$$parsedNgModelAssign($scope, newValue);\n }\n };\n } else if (!this.$$parsedNgModel.assign) {\n throw ngModelMinErr('nonassign', 'Expression \\'{0}\\' is non-assignable. Element: {1}',\n this.$$attr.ngModel, startingTag(this.$$element));\n }\n },\n\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$render\n *\n * @description\n * Called when the view needs to be updated. It is expected that the user of the ng-model\n * directive will implement this method.\n *\n * The `$render()` method is invoked in the following situations:\n *\n * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last\n * committed value then `$render()` is called to update the input control.\n * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and\n * the `$viewValue` are different from last time.\n *\n * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of\n * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue`\n * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be\n * invoked if you only change a property on the objects.\n */\n $render: noop,\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$isEmpty\n *\n * @description\n * This is called when we need to determine if the value of an input is empty.\n *\n * For instance, the required directive does this to work out if the input has data or not.\n *\n * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.\n *\n * You can override this for input directives whose concept of being empty is different from the\n * default. The `checkboxInputType` directive does this because in its case a value of `false`\n * implies empty.\n *\n * @param {*} value The value of the input to check for emptiness.\n * @returns {boolean} True if `value` is \"empty\".\n */\n $isEmpty: function(value) {\n // eslint-disable-next-line no-self-compare\n return isUndefined(value) || value === '' || value === null || value !== value;\n },\n\n $$updateEmptyClasses: function(value) {\n if (this.$isEmpty(value)) {\n this.$$animate.removeClass(this.$$element, NOT_EMPTY_CLASS);\n this.$$animate.addClass(this.$$element, EMPTY_CLASS);\n } else {\n this.$$animate.removeClass(this.$$element, EMPTY_CLASS);\n this.$$animate.addClass(this.$$element, NOT_EMPTY_CLASS);\n }\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setPristine\n *\n * @description\n * Sets the control to its pristine state.\n *\n * This method can be called to remove the `ng-dirty` class and set the control to its pristine\n * state (`ng-pristine` class). A model is considered to be pristine when the control\n * has not been changed from when first compiled.\n */\n $setPristine: function() {\n this.$dirty = false;\n this.$pristine = true;\n this.$$animate.removeClass(this.$$element, DIRTY_CLASS);\n this.$$animate.addClass(this.$$element, PRISTINE_CLASS);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setDirty\n *\n * @description\n * Sets the control to its dirty state.\n *\n * This method can be called to remove the `ng-pristine` class and set the control to its dirty\n * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed\n * from when first compiled.\n */\n $setDirty: function() {\n this.$dirty = true;\n this.$pristine = false;\n this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);\n this.$$animate.addClass(this.$$element, DIRTY_CLASS);\n this.$$parentForm.$setDirty();\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setUntouched\n *\n * @description\n * Sets the control to its untouched state.\n *\n * This method can be called to remove the `ng-touched` class and set the control to its\n * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched\n * by default, however this function can be used to restore that state if the model has\n * already been touched by the user.\n */\n $setUntouched: function() {\n this.$touched = false;\n this.$untouched = true;\n this.$$animate.setClass(this.$$element, UNTOUCHED_CLASS, TOUCHED_CLASS);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setTouched\n *\n * @description\n * Sets the control to its touched state.\n *\n * This method can be called to remove the `ng-untouched` class and set the control to its\n * touched state (`ng-touched` class). A model is considered to be touched when the user has\n * first focused the control element and then shifted focus away from the control (blur event).\n */\n $setTouched: function() {\n this.$touched = true;\n this.$untouched = false;\n this.$$animate.setClass(this.$$element, TOUCHED_CLASS, UNTOUCHED_CLASS);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$rollbackViewValue\n *\n * @description\n * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,\n * which may be caused by a pending debounced event or because the input is waiting for some\n * future event.\n *\n * If you have an input that uses `ng-model-options` to set up debounced updates or updates that\n * depend on special events such as `blur`, there can be a period when the `$viewValue` is out of\n * sync with the ngModel's `$modelValue`.\n *\n * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update\n * and reset the input to the last committed view value.\n *\n * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue`\n * programmatically before these debounced/future events have resolved/occurred, because Angular's\n * dirty checking mechanism is not able to tell whether the model has actually changed or not.\n *\n * The `$rollbackViewValue()` method should be called before programmatically changing the model of an\n * input which may have such events pending. This is important in order to make sure that the\n * input field will be updated with the new model value and any pending operations are cancelled.\n *\n * <example name=\"ng-model-cancel-update\" module=\"cancel-update-example\">\n * <file name=\"app.js\">\n * angular.module('cancel-update-example', [])\n *\n * .controller('CancelUpdateController', ['$scope', function($scope) {\n * $scope.model = {value1: '', value2: ''};\n *\n * $scope.setEmpty = function(e, value, rollback) {\n * if (e.keyCode === 27) {\n * e.preventDefault();\n * if (rollback) {\n * $scope.myForm[value].$rollbackViewValue();\n * }\n * $scope.model[value] = '';\n * }\n * };\n * }]);\n * </file>\n * <file name=\"index.html\">\n * <div ng-controller=\"CancelUpdateController\">\n * <p>Both of these inputs are only updated if they are blurred. Hitting escape should\n * empty them. Follow these steps and observe the difference:</p>\n * <ol>\n * <li>Type something in the input. You will see that the model is not yet updated</li>\n * <li>Press the Escape key.\n * <ol>\n * <li> In the first example, nothing happens, because the model is already '', and no\n * update is detected. If you blur the input, the model will be set to the current view.\n * </li>\n * <li> In the second example, the pending update is cancelled, and the input is set back\n * to the last committed view value (''). Blurring the input does nothing.\n * </li>\n * </ol>\n * </li>\n * </ol>\n *\n * <form name=\"myForm\" ng-model-options=\"{ updateOn: 'blur' }\">\n * <div>\n * <p id=\"inputDescription1\">Without $rollbackViewValue():</p>\n * <input name=\"value1\" aria-describedby=\"inputDescription1\" ng-model=\"model.value1\"\n * ng-keydown=\"setEmpty($event, 'value1')\">\n * value1: \"{{ model.value1 }}\"\n * </div>\n *\n * <div>\n * <p id=\"inputDescription2\">With $rollbackViewValue():</p>\n * <input name=\"value2\" aria-describedby=\"inputDescription2\" ng-model=\"model.value2\"\n * ng-keydown=\"setEmpty($event, 'value2', true)\">\n * value2: \"{{ model.value2 }}\"\n * </div>\n * </form>\n * </div>\n * </file>\n <file name=\"style.css\">\n div {\n display: table-cell;\n }\n div:nth-child(1) {\n padding-right: 30px;\n }\n\n </file>\n * </example>\n */\n $rollbackViewValue: function() {\n this.$$timeout.cancel(this.$$pendingDebounce);\n this.$viewValue = this.$$lastCommittedViewValue;\n this.$render();\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$validate\n *\n * @description\n * Runs each of the registered validators (first synchronous validators and then\n * asynchronous validators).\n * If the validity changes to invalid, the model will be set to `undefined`,\n * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.\n * If the validity changes to valid, it will set the model to the last available valid\n * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.\n */\n $validate: function() {\n // ignore $validate before model is initialized\n if (isNumberNaN(this.$modelValue)) {\n return;\n }\n\n var viewValue = this.$$lastCommittedViewValue;\n // Note: we use the $$rawModelValue as $modelValue might have been\n // set to undefined during a view -> model update that found validation\n // errors. We can't parse the view here, since that could change\n // the model although neither viewValue nor the model on the scope changed\n var modelValue = this.$$rawModelValue;\n\n var prevValid = this.$valid;\n var prevModelValue = this.$modelValue;\n\n var allowInvalid = this.$options.getOption('allowInvalid');\n\n var that = this;\n this.$$runValidators(modelValue, viewValue, function(allValid) {\n // If there was no change in validity, don't update the model\n // This prevents changing an invalid modelValue to undefined\n if (!allowInvalid && prevValid !== allValid) {\n // Note: Don't check this.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n that.$modelValue = allValid ? modelValue : undefined;\n\n if (that.$modelValue !== prevModelValue) {\n that.$$writeModelToScope();\n }\n }\n });\n },\n\n $$runValidators: function(modelValue, viewValue, doneCallback) {\n this.$$currentValidationRunId++;\n var localValidationRunId = this.$$currentValidationRunId;\n var that = this;\n\n // check parser error\n if (!processParseErrors()) {\n validationDone(false);\n return;\n }\n if (!processSyncValidators()) {\n validationDone(false);\n return;\n }\n processAsyncValidators();\n\n function processParseErrors() {\n var errorKey = that.$$parserName || 'parse';\n if (isUndefined(that.$$parserValid)) {\n setValidity(errorKey, null);\n } else {\n if (!that.$$parserValid) {\n forEach(that.$validators, function(v, name) {\n setValidity(name, null);\n });\n forEach(that.$asyncValidators, function(v, name) {\n setValidity(name, null);\n });\n }\n // Set the parse error last, to prevent unsetting it, should a $validators key == parserName\n setValidity(errorKey, that.$$parserValid);\n return that.$$parserValid;\n }\n return true;\n }\n\n function processSyncValidators() {\n var syncValidatorsValid = true;\n forEach(that.$validators, function(validator, name) {\n var result = Boolean(validator(modelValue, viewValue));\n syncValidatorsValid = syncValidatorsValid && result;\n setValidity(name, result);\n });\n if (!syncValidatorsValid) {\n forEach(that.$asyncValidators, function(v, name) {\n setValidity(name, null);\n });\n return false;\n }\n return true;\n }\n\n function processAsyncValidators() {\n var validatorPromises = [];\n var allValid = true;\n forEach(that.$asyncValidators, function(validator, name) {\n var promise = validator(modelValue, viewValue);\n if (!isPromiseLike(promise)) {\n throw ngModelMinErr('nopromise',\n 'Expected asynchronous validator to return a promise but got \\'{0}\\' instead.', promise);\n }\n setValidity(name, undefined);\n validatorPromises.push(promise.then(function() {\n setValidity(name, true);\n }, function() {\n allValid = false;\n setValidity(name, false);\n }));\n });\n if (!validatorPromises.length) {\n validationDone(true);\n } else {\n that.$$q.all(validatorPromises).then(function() {\n validationDone(allValid);\n }, noop);\n }\n }\n\n function setValidity(name, isValid) {\n if (localValidationRunId === that.$$currentValidationRunId) {\n that.$setValidity(name, isValid);\n }\n }\n\n function validationDone(allValid) {\n if (localValidationRunId === that.$$currentValidationRunId) {\n\n doneCallback(allValid);\n }\n }\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$commitViewValue\n *\n * @description\n * Commit a pending update to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n $commitViewValue: function() {\n var viewValue = this.$viewValue;\n\n this.$$timeout.cancel(this.$$pendingDebounce);\n\n // If the view value has not changed then we should just exit, except in the case where there is\n // a native validator on the element. In this case the validation state may have changed even though\n // the viewValue has stayed empty.\n if (this.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !this.$$hasNativeValidators)) {\n return;\n }\n this.$$updateEmptyClasses(viewValue);\n this.$$lastCommittedViewValue = viewValue;\n\n // change to dirty\n if (this.$pristine) {\n this.$setDirty();\n }\n this.$$parseAndValidate();\n },\n\n $$parseAndValidate: function() {\n var viewValue = this.$$lastCommittedViewValue;\n var modelValue = viewValue;\n var that = this;\n\n this.$$parserValid = isUndefined(modelValue) ? undefined : true;\n\n if (this.$$parserValid) {\n for (var i = 0; i < this.$parsers.length; i++) {\n modelValue = this.$parsers[i](modelValue);\n if (isUndefined(modelValue)) {\n this.$$parserValid = false;\n break;\n }\n }\n }\n if (isNumberNaN(this.$modelValue)) {\n // this.$modelValue has not been touched yet...\n this.$modelValue = this.$$ngModelGet(this.$$scope);\n }\n var prevModelValue = this.$modelValue;\n var allowInvalid = this.$options.getOption('allowInvalid');\n this.$$rawModelValue = modelValue;\n\n if (allowInvalid) {\n this.$modelValue = modelValue;\n writeToModelIfNeeded();\n }\n\n // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.\n // This can happen if e.g. $setViewValue is called from inside a parser\n this.$$runValidators(modelValue, this.$$lastCommittedViewValue, function(allValid) {\n if (!allowInvalid) {\n // Note: Don't check this.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n that.$modelValue = allValid ? modelValue : undefined;\n writeToModelIfNeeded();\n }\n });\n\n function writeToModelIfNeeded() {\n if (that.$modelValue !== prevModelValue) {\n that.$$writeModelToScope();\n }\n }\n },\n\n $$writeModelToScope: function() {\n this.$$ngModelSet(this.$$scope, this.$modelValue);\n forEach(this.$viewChangeListeners, function(listener) {\n try {\n listener();\n } catch (e) {\n // eslint-disable-next-line no-invalid-this\n this.$$exceptionHandler(e);\n }\n }, this);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setViewValue\n *\n * @description\n * Update the view value.\n *\n * This method should be called when a control wants to change the view value; typically,\n * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}\n * directive calls it when the value of the input changes and {@link ng.directive:select select}\n * calls it when an option is selected.\n *\n * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`\n * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged\n * value is sent directly for processing through the `$parsers` pipeline. After this, the `$validators` and\n * `$asyncValidators` are called and the value is applied to `$modelValue`.\n * Finally, the value is set to the **expression** specified in the `ng-model` attribute and\n * all the registered change listeners, in the `$viewChangeListeners` list are called.\n *\n * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`\n * and the `default` trigger is not listed, all those actions will remain pending until one of the\n * `updateOn` events is triggered on the DOM element.\n * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}\n * directive is used with a custom debounce for this particular event.\n * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`\n * is specified, once the timer runs out.\n *\n * When used with standard inputs, the view value will always be a string (which is in some cases\n * parsed into another type, such as a `Date` object for `input[date]`.)\n * However, custom controls might also pass objects to this method. In this case, we should make\n * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not\n * perform a deep watch of objects, it only looks for a change of identity. If you only change\n * the property of the object then ngModel will not realize that the object has changed and\n * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should\n * not change properties of the copy once it has been passed to `$setViewValue`.\n * Otherwise you may cause the model value on the scope to change incorrectly.\n *\n * <div class=\"alert alert-info\">\n * In any case, the value passed to the method should always reflect the current value\n * of the control. For example, if you are calling `$setViewValue` for an input element,\n * you should pass the input DOM value. Otherwise, the control and the scope model become\n * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change\n * the control's DOM value in any way. If we want to change the control's DOM value\n * programmatically, we should update the `ngModel` scope expression. Its new value will be\n * picked up by the model controller, which will run it through the `$formatters`, `$render` it\n * to update the DOM, and finally call `$validate` on it.\n * </div>\n *\n * @param {*} value value from the view.\n * @param {string} trigger Event that triggered the update.\n */\n $setViewValue: function(value, trigger) {\n this.$viewValue = value;\n if (this.$options.getOption('updateOnDefault')) {\n this.$$debounceViewValueCommit(trigger);\n }\n },\n\n $$debounceViewValueCommit: function(trigger) {\n var debounceDelay = this.$options.getOption('debounce');\n\n if (isNumber(debounceDelay[trigger])) {\n debounceDelay = debounceDelay[trigger];\n } else if (isNumber(debounceDelay['default'])) {\n debounceDelay = debounceDelay['default'];\n }\n\n this.$$timeout.cancel(this.$$pendingDebounce);\n var that = this;\n if (debounceDelay > 0) { // this fails if debounceDelay is an object\n this.$$pendingDebounce = this.$$timeout(function() {\n that.$commitViewValue();\n }, debounceDelay);\n } else if (this.$$scope.$root.$$phase) {\n this.$commitViewValue();\n } else {\n this.$$scope.$apply(function() {\n that.$commitViewValue();\n });\n }\n },\n\n /**\n * @ngdoc method\n *\n * @name ngModel.NgModelController#$overrideModelOptions\n *\n * @description\n *\n * Override the current model options settings programmatically.\n *\n * The previous `ModelOptions` value will not be modified. Instead, a\n * new `ModelOptions` object will inherit from the previous one overriding\n * or inheriting settings that are defined in the given parameter.\n *\n * See {@link ngModelOptions} for information about what options can be specified\n * and how model option inheritance works.\n *\n * @param {Object} options a hash of settings to override the previous options\n *\n */\n $overrideModelOptions: function(options) {\n this.$options = this.$options.createChild(options);\n }\n};\n\nfunction setupModelWatcher(ctrl) {\n // model -> value\n // Note: we cannot use a normal scope.$watch as we want to detect the following:\n // 1. scope value is 'a'\n // 2. user enters 'b'\n // 3. ng-change kicks in and reverts scope value to 'a'\n // -> scope value did not change since the last digest as\n // ng-change executes in apply phase\n // 4. view should be changed back to 'a'\n ctrl.$$scope.$watch(function ngModelWatch(scope) {\n var modelValue = ctrl.$$ngModelGet(scope);\n\n // if scope model value and ngModel value are out of sync\n // TODO(perf): why not move this to the action fn?\n if (modelValue !== ctrl.$modelValue &&\n // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator\n // eslint-disable-next-line no-self-compare\n (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)\n ) {\n ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;\n ctrl.$$parserValid = undefined;\n\n var formatters = ctrl.$formatters,\n idx = formatters.length;\n\n var viewValue = modelValue;\n while (idx--) {\n viewValue = formatters[idx](viewValue);\n }\n if (ctrl.$viewValue !== viewValue) {\n ctrl.$$updateEmptyClasses(viewValue);\n ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;\n ctrl.$render();\n\n // It is possible that model and view value have been updated during render\n ctrl.$$runValidators(ctrl.$modelValue, ctrl.$viewValue, noop);\n }\n }\n\n return modelValue;\n });\n}\n\n/**\n * @ngdoc method\n * @name ngModel.NgModelController#$setValidity\n *\n * @description\n * Change the validity state, and notify the form.\n *\n * This method can be called within $parsers/$formatters or a custom validation implementation.\n * However, in most cases it should be sufficient to use the `ngModel.$validators` and\n * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned\n * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`\n * (for unfulfilled `$asyncValidators`), so that it is available for data-binding.\n * The `validationErrorKey` should be in camelCase and will get converted into dash-case\n * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`\n * classes and can be bound to as `{{ someForm.someControl.$error.myError }}`.\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),\n * or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by Angular when validators do not run because of parse errors and\n * when `$asyncValidators` do not run because any of the `$validators` failed.\n */\naddSetValidityMethod({\n clazz: NgModelController,\n set: function(object, property) {\n object[property] = true;\n },\n unset: function(object, property) {\n delete object[property];\n }\n});\n\n\n/**\n * @ngdoc directive\n * @name ngModel\n *\n * @element input\n * @priority 1\n *\n * @description\n * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a\n * property on the scope using {@link ngModel.NgModelController NgModelController},\n * which is created and exposed by this directive.\n *\n * `ngModel` is responsible for:\n *\n * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`\n * require.\n * - Providing validation behavior (i.e. required, number, email, url).\n * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,\n * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.\n * - Registering the control with its parent {@link ng.directive:form form}.\n *\n * Note: `ngModel` will try to bind to the property given by evaluating the expression on the\n * current scope. If the property doesn't already exist on this scope, it will be created\n * implicitly and added to the scope.\n *\n * For best practices on using `ngModel`, see:\n *\n * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)\n *\n * For basic examples, how to use `ngModel`, see:\n *\n * - {@link ng.directive:input input}\n * - {@link input[text] text}\n * - {@link input[checkbox] checkbox}\n * - {@link input[radio] radio}\n * - {@link input[number] number}\n * - {@link input[email] email}\n * - {@link input[url] url}\n * - {@link input[date] date}\n * - {@link input[datetime-local] datetime-local}\n * - {@link input[time] time}\n * - {@link input[month] month}\n * - {@link input[week] week}\n * - {@link ng.directive:select select}\n * - {@link ng.directive:textarea textarea}\n *\n * # Complex Models (objects or collections)\n *\n * By default, `ngModel` watches the model by reference, not value. This is important to know when\n * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the\n * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.\n *\n * The model must be assigned an entirely new object or collection before a re-rendering will occur.\n *\n * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression\n * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or\n * if the select is given the `multiple` attribute.\n *\n * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the\n * first level of the object (or only changing the properties of an item in the collection if it's an array) will still\n * not trigger a re-rendering of the model.\n *\n * # CSS classes\n * The following CSS classes are added and removed on the associated input/select/textarea element\n * depending on the validity of the model.\n *\n * - `ng-valid`: the model is valid\n * - `ng-invalid`: the model is invalid\n * - `ng-valid-[key]`: for each valid key added by `$setValidity`\n * - `ng-invalid-[key]`: for each invalid key added by `$setValidity`\n * - `ng-pristine`: the control hasn't been interacted with yet\n * - `ng-dirty`: the control has been interacted with\n * - `ng-touched`: the control has been blurred\n * - `ng-untouched`: the control hasn't been blurred\n * - `ng-pending`: any `$asyncValidators` are unfulfilled\n * - `ng-empty`: the view does not contain a value or the value is deemed \"empty\", as defined\n * by the {@link ngModel.NgModelController#$isEmpty} method\n * - `ng-not-empty`: the view contains a non-empty value\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n * ## Animation Hooks\n *\n * Animations within models are triggered when any of the associated CSS classes are added and removed\n * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,\n * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.\n * The animations that are triggered within ngModel are similar to how they work in ngClass and\n * animations can be hooked into using CSS transitions, keyframes as well as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style an input element\n * that has been rendered as invalid after it has been validated:\n *\n * <pre>\n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-input {\n * transition:0.5s linear all;\n * background: white;\n * }\n * .my-input.ng-invalid {\n * background: red;\n * color:white;\n * }\n * </pre>\n *\n * @example\n * <example deps=\"angular-animate.js\" animations=\"true\" fixBase=\"true\" module=\"inputExample\" name=\"ng-model\">\n <file name=\"index.html\">\n <script>\n angular.module('inputExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.val = '1';\n }]);\n </script>\n <style>\n .my-input {\n transition:all linear 0.5s;\n background: transparent;\n }\n .my-input.ng-invalid {\n color:white;\n background: red;\n }\n </style>\n <p id=\"inputDescription\">\n Update input to see transitions when valid/invalid.\n Integer is a valid value.\n </p>\n <form name=\"testForm\" ng-controller=\"ExampleController\">\n <input ng-model=\"val\" ng-pattern=\"/^\\d+$/\" name=\"anim\" class=\"my-input\"\n aria-describedby=\"inputDescription\" />\n </form>\n </file>\n * </example>\n *\n * ## Binding to a getter/setter\n *\n * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a\n * function that returns a representation of the model when called with zero arguments, and sets\n * the internal state of a model when called with an argument. It's sometimes useful to use this\n * for models that have an internal representation that's different from what the model exposes\n * to the view.\n *\n * <div class=\"alert alert-success\">\n * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more\n * frequently than other parts of your code.\n * </div>\n *\n * You use this behavior by adding `ng-model-options=\"{ getterSetter: true }\"` to an element that\n * has `ng-model` attached to it. You can also add `ng-model-options=\"{ getterSetter: true }\"` to\n * a `<form>`, which will enable this behavior for all `<input>`s within it. See\n * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.\n *\n * The following example shows how to use `ngModel` with a getter/setter:\n *\n * @example\n * <example name=\"ngModel-getter-setter\" module=\"getterSetterExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form name=\"userForm\">\n <label>Name:\n <input type=\"text\" name=\"userName\"\n ng-model=\"user.name\"\n ng-model-options=\"{ getterSetter: true }\" />\n </label>\n </form>\n <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n </div>\n </file>\n <file name=\"app.js\">\n angular.module('getterSetterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var _name = 'Brian';\n $scope.user = {\n name: function(newName) {\n // Note that newName can be undefined for two reasons:\n // 1. Because it is called as a getter and thus called with no arguments\n // 2. Because the property should actually be set to undefined. This happens e.g. if the\n // input is invalid\n return arguments.length ? (_name = newName) : _name;\n }\n };\n }]);\n </file>\n * </example>\n */\nvar ngModelDirective = ['$rootScope', function($rootScope) {\n return {\n restrict: 'A',\n require: ['ngModel', '^?form', '^?ngModelOptions'],\n controller: NgModelController,\n // Prelink needs to run before any input directive\n // so that we can set the NgModelOptions in NgModelController\n // before anyone else uses it.\n priority: 1,\n compile: function ngModelCompile(element) {\n // Setup initial state of the control\n element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);\n\n return {\n pre: function ngModelPreLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0],\n formCtrl = ctrls[1] || modelCtrl.$$parentForm,\n optionsCtrl = ctrls[2];\n\n if (optionsCtrl) {\n modelCtrl.$options = optionsCtrl.$options;\n }\n\n modelCtrl.$$initGetterSetters();\n\n // notify others, especially parent forms\n formCtrl.$addControl(modelCtrl);\n\n attr.$observe('name', function(newValue) {\n if (modelCtrl.$name !== newValue) {\n modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);\n }\n });\n\n scope.$on('$destroy', function() {\n modelCtrl.$$parentForm.$removeControl(modelCtrl);\n });\n },\n post: function ngModelPostLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0];\n if (modelCtrl.$options.getOption('updateOn')) {\n element.on(modelCtrl.$options.getOption('updateOn'), function(ev) {\n modelCtrl.$$debounceViewValueCommit(ev && ev.type);\n });\n }\n\n function setTouched() {\n modelCtrl.$setTouched();\n }\n\n element.on('blur', function() {\n if (modelCtrl.$touched) return;\n\n if ($rootScope.$$phase) {\n scope.$evalAsync(setTouched);\n } else {\n scope.$apply(setTouched);\n }\n });\n }\n };\n }\n };\n}];\n\n/* exported defaultModelOptions */\nvar defaultModelOptions;\nvar DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n\n/**\n * @ngdoc type\n * @name ModelOptions\n * @description\n * A container for the options set by the {@link ngModelOptions} directive\n */\nfunction ModelOptions(options) {\n this.$$options = options;\n}\n\nModelOptions.prototype = {\n\n /**\n * @ngdoc method\n * @name ModelOptions#getOption\n * @param {string} name the name of the option to retrieve\n * @returns {*} the value of the option\n * @description\n * Returns the value of the given option\n */\n getOption: function(name) {\n return this.$$options[name];\n },\n\n /**\n * @ngdoc method\n * @name ModelOptions#createChild\n * @param {Object} options a hash of options for the new child that will override the parent's options\n * @return {ModelOptions} a new `ModelOptions` object initialized with the given options.\n */\n createChild: function(options) {\n var inheritAll = false;\n\n // make a shallow copy\n options = extend({}, options);\n\n // Inherit options from the parent if specified by the value `\"$inherit\"`\n forEach(options, /* @this */ function(option, key) {\n if (option === '$inherit') {\n if (key === '*') {\n inheritAll = true;\n } else {\n options[key] = this.$$options[key];\n // `updateOn` is special so we must also inherit the `updateOnDefault` option\n if (key === 'updateOn') {\n options.updateOnDefault = this.$$options.updateOnDefault;\n }\n }\n } else {\n if (key === 'updateOn') {\n // If the `updateOn` property contains the `default` event then we have to remove\n // it from the event list and set the `updateOnDefault` flag.\n options.updateOnDefault = false;\n options[key] = trim(option.replace(DEFAULT_REGEXP, function() {\n options.updateOnDefault = true;\n return ' ';\n }));\n }\n }\n }, this);\n\n if (inheritAll) {\n // We have a property of the form: `\"*\": \"$inherit\"`\n delete options['*'];\n defaults(options, this.$$options);\n }\n\n // Finally add in any missing defaults\n defaults(options, defaultModelOptions.$$options);\n\n return new ModelOptions(options);\n }\n};\n\n\ndefaultModelOptions = new ModelOptions({\n updateOn: '',\n updateOnDefault: true,\n debounce: 0,\n getterSetter: false,\n allowInvalid: false,\n timezone: null\n});\n\n\n/**\n * @ngdoc directive\n * @name ngModelOptions\n *\n * @description\n * This directive allows you to modify the behaviour of {@link ngModel} directives within your\n * application. You can specify an `ngModelOptions` directive on any element. All {@link ngModel}\n * directives will use the options of their nearest `ngModelOptions` ancestor.\n *\n * The `ngModelOptions` settings are found by evaluating the value of the attribute directive as\n * an Angular expression. This expression should evaluate to an object, whose properties contain\n * the settings. For example: `<div \"ng-model-options\"=\"{ debounce: 100 }\"`.\n *\n * ## Inheriting Options\n *\n * You can specify that an `ngModelOptions` setting should be inherited from a parent `ngModelOptions`\n * directive by giving it the value of `\"$inherit\"`.\n * Then it will inherit that setting from the first `ngModelOptions` directive found by traversing up the\n * DOM tree. If there is no ancestor element containing an `ngModelOptions` directive then default settings\n * will be used.\n *\n * For example given the following fragment of HTML\n *\n *\n * ```html\n * <div ng-model-options=\"{ allowInvalid: true, debounce: 200 }\">\n * <form ng-model-options=\"{ updateOn: 'blur', allowInvalid: '$inherit' }\">\n * <input ng-model-options=\"{ updateOn: 'default', allowInvalid: '$inherit' }\" />\n * </form>\n * </div>\n * ```\n *\n * the `input` element will have the following settings\n *\n * ```js\n * { allowInvalid: true, updateOn: 'default', debounce: 0 }\n * ```\n *\n * Notice that the `debounce` setting was not inherited and used the default value instead.\n *\n * You can specify that all undefined settings are automatically inherited from an ancestor by\n * including a property with key of `\"*\"` and value of `\"$inherit\"`.\n *\n * For example given the following fragment of HTML\n *\n *\n * ```html\n * <div ng-model-options=\"{ allowInvalid: true, debounce: 200 }\">\n * <form ng-model-options=\"{ updateOn: 'blur', \"*\": '$inherit' }\">\n * <input ng-model-options=\"{ updateOn: 'default', \"*\": '$inherit' }\" />\n * </form>\n * </div>\n * ```\n *\n * the `input` element will have the following settings\n *\n * ```js\n * { allowInvalid: true, updateOn: 'default', debounce: 200 }\n * ```\n *\n * Notice that the `debounce` setting now inherits the value from the outer `<div>` element.\n *\n * If you are creating a reusable component then you should be careful when using `\"*\": \"$inherit\"`\n * since you may inadvertently inherit a setting in the future that changes the behavior of your component.\n *\n *\n * ## Triggering and debouncing model updates\n *\n * The `updateOn` and `debounce` properties allow you to specify a custom list of events that will\n * trigger a model update and/or a debouncing delay so that the actual update only takes place when\n * a timer expires; this timer will be reset after another change takes place.\n *\n * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might\n * be different from the value in the actual model. This means that if you update the model you\n * should also invoke {@link ngModel.NgModelController#$rollbackViewValue} on the relevant input field in\n * order to make sure it is synchronized with the model and that any debounced action is canceled.\n *\n * The easiest way to reference the control's {@link ngModel.NgModelController#$rollbackViewValue}\n * method is by making sure the input is placed inside a form that has a `name` attribute. This is\n * important because `form` controllers are published to the related scope under the name in their\n * `name` attribute.\n *\n * Any pending changes will take place immediately when an enclosing form is submitted via the\n * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * The following example shows how to override immediate updates. Changes on the inputs within the\n * form will update the model only when the control loses focus (blur event). If `escape` key is\n * pressed while the input field is focused, the value is reset to the value in the current model.\n *\n * <example name=\"ngModelOptions-directive-blur\" module=\"optionsExample\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"userForm\">\n * <label>\n * Name:\n * <input type=\"text\" name=\"userName\"\n * ng-model=\"user.name\"\n * ng-model-options=\"{ updateOn: 'blur' }\"\n * ng-keyup=\"cancel($event)\" />\n * </label><br />\n * <label>\n * Other data:\n * <input type=\"text\" ng-model=\"user.data\" />\n * </label><br />\n * </form>\n * <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say', data: '' };\n *\n * $scope.cancel = function(e) {\n * if (e.keyCode === 27) {\n * $scope.userForm.userName.$rollbackViewValue();\n * }\n * };\n * }]);\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * var model = element(by.binding('user.name'));\n * var input = element(by.model('user.name'));\n * var other = element(by.model('user.data'));\n *\n * it('should allow custom events', function() {\n * input.sendKeys(' hello');\n * input.click();\n * expect(model.getText()).toEqual('say');\n * other.click();\n * expect(model.getText()).toEqual('say hello');\n * });\n *\n * it('should $rollbackViewValue when model changes', function() {\n * input.sendKeys(' hello');\n * expect(input.getAttribute('value')).toEqual('say hello');\n * input.sendKeys(protractor.Key.ESCAPE);\n * expect(input.getAttribute('value')).toEqual('say');\n * other.click();\n * expect(model.getText()).toEqual('say');\n * });\n * </file>\n * </example>\n *\n * The next example shows how to debounce model changes. Model will be updated only 1 sec after last change.\n * If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n *\n * <example name=\"ngModelOptions-directive-debounce\" module=\"optionsExample\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"userForm\">\n * Name:\n * <input type=\"text\" name=\"userName\"\n * ng-model=\"user.name\"\n * ng-model-options=\"{ debounce: 1000 }\" />\n * <button ng-click=\"userForm.userName.$rollbackViewValue(); user.name=''\">Clear</button><br />\n * </form>\n * <pre>user.name = <span ng-bind=\"user.name\"></span></pre>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say' };\n * }]);\n * </file>\n * </example>\n *\n * ## Model updates and validation\n *\n * The default behaviour in `ngModel` is that the model value is set to `undefined` when the\n * validation determines that the value is invalid. By setting the `allowInvalid` property to true,\n * the model will still be updated even if the value is invalid.\n *\n *\n * ## Connecting to the scope\n *\n * By setting the `getterSetter` property to true you are telling ngModel that the `ngModel` expression\n * on the scope refers to a \"getter/setter\" function rather than the value itself.\n *\n * The following example shows how to bind to getter/setters:\n *\n * <example name=\"ngModelOptions-directive-getter-setter\" module=\"getterSetterExample\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"userForm\">\n * <label>\n * Name:\n * <input type=\"text\" name=\"userName\"\n * ng-model=\"user.name\"\n * ng-model-options=\"{ getterSetter: true }\" />\n * </label>\n * </form>\n * <pre>user.name = <span ng-bind=\"user.name()\"></span></pre>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('getterSetterExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * var _name = 'Brian';\n * $scope.user = {\n * name: function(newName) {\n * return angular.isDefined(newName) ? (_name = newName) : _name;\n * }\n * };\n * }]);\n * </file>\n * </example>\n *\n *\n * ## Specifying timezones\n *\n * You can specify the timezone that date/time input directives expect by providing its name in the\n * `timezone` property.\n *\n * @param {Object} ngModelOptions options to apply to {@link ngModel} directives on this element and\n * and its descendents. Valid keys are:\n * - `updateOn`: string specifying which event should the input be bound to. You can set several\n * events using an space delimited list. There is a special event called `default` that\n * matches the default events belonging to the control.\n * - `debounce`: integer value which contains the debounce model update value in milliseconds. A\n * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a\n * custom value for each event. For example:\n * ```\n * ng-model-options=\"{\n * updateOn: 'default blur',\n * debounce: { 'default': 500, 'blur': 0 }\n * }\"\n * ```\n * - `allowInvalid`: boolean value which indicates that the model can be set with values that did\n * not validate correctly instead of the default behavior of setting the model to undefined.\n * - `getterSetter`: boolean value which determines whether or not to treat functions bound to\n * `ngModel` as getters/setters.\n * - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for\n * `<input type=\"date\" />`, `<input type=\"time\" />`, ... . It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n *\n */\nvar ngModelOptionsDirective = function() {\n NgModelOptionsController.$inject = ['$attrs', '$scope'];\n function NgModelOptionsController($attrs, $scope) {\n this.$$attrs = $attrs;\n this.$$scope = $scope;\n }\n NgModelOptionsController.prototype = {\n $onInit: function() {\n var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;\n var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);\n\n this.$options = parentOptions.createChild(modelOptionsDefinition);\n }\n };\n\n return {\n restrict: 'A',\n // ngModelOptions needs to run before ngModel and input directives\n priority: 10,\n require: {parentCtrl: '?^^ngModelOptions'},\n bindToController: true,\n controller: NgModelOptionsController\n };\n};\n\n\n// shallow copy over values from `src` that are not already specified on `dst`\nfunction defaults(dst, src) {\n forEach(src, function(value, key) {\n if (!isDefined(dst[key])) {\n dst[key] = value;\n }\n });\n}\n\n/**\n * @ngdoc directive\n * @name ngNonBindable\n * @restrict AC\n * @priority 1000\n *\n * @description\n * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current\n * DOM element. This is useful if the element contains what appears to be Angular directives and\n * bindings but which should be ignored by Angular. This could be the case if you have a site that\n * displays snippets of code, for instance.\n *\n * @element ANY\n *\n * @example\n * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,\n * but the one wrapped in `ngNonBindable` is left alone.\n *\n * @example\n <example name=\"ng-non-bindable\">\n <file name=\"index.html\">\n <div>Normal: {{1 + 2}}</div>\n <div ng-non-bindable>Ignored: {{1 + 2}}</div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-non-bindable', function() {\n expect(element(by.binding('1 + 2')).getText()).toContain('3');\n expect(element.all(by.css('div')).last().getText()).toMatch(/1 \\+ 2/);\n });\n </file>\n </example>\n */\nvar ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });\n\n/* exported ngOptionsDirective */\n\n/* global jqLiteRemove */\n\nvar ngOptionsMinErr = minErr('ngOptions');\n\n/**\n * @ngdoc directive\n * @name ngOptions\n * @restrict A\n *\n * @description\n *\n * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`\n * elements for the `<select>` element using the array or object obtained by evaluating the\n * `ngOptions` comprehension expression.\n *\n * In many cases, {@link ng.directive:ngRepeat ngRepeat} can be used on `<option>` elements instead of\n * `ngOptions` to achieve a similar result. However, `ngOptions` provides some benefits:\n * - more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the\n * comprehension expression\n * - reduced memory consumption by not creating a new scope for each repeated instance\n * - increased render speed by creating the options in a documentFragment instead of individually\n *\n * When an item in the `<select>` menu is selected, the array element or object property\n * represented by the selected option will be bound to the model identified by the `ngModel`\n * directive.\n *\n * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can\n * be nested into the `<select>` element. This element will then represent the `null` or \"not selected\"\n * option. See example below for demonstration.\n *\n * ## Complex Models (objects or collections)\n *\n * By default, `ngModel` watches the model by reference, not value. This is important to know when\n * binding the select to a model that is an object or a collection.\n *\n * One issue occurs if you want to preselect an option. For example, if you set\n * the model to an object that is equal to an object in your collection, `ngOptions` won't be able to set the selection,\n * because the objects are not identical. So by default, you should always reference the item in your collection\n * for preselections, e.g.: `$scope.selected = $scope.collection[3]`.\n *\n * Another solution is to use a `track by` clause, because then `ngOptions` will track the identity\n * of the item not by reference, but by the result of the `track by` expression. For example, if your\n * collection items have an id property, you would `track by item.id`.\n *\n * A different issue with objects or collections is that ngModel won't detect if an object property or\n * a collection item changes. For that reason, `ngOptions` additionally watches the model using\n * `$watchCollection`, when the expression contains a `track by` clause or the the select has the `multiple` attribute.\n * This allows ngOptions to trigger a re-rendering of the options even if the actual object/collection\n * has not changed identity, but only a property on the object or an item in the collection changes.\n *\n * Note that `$watchCollection` does a shallow comparison of the properties of the object (or the items in the collection\n * if the model is an array). This means that changing a property deeper than the first level inside the\n * object/collection will not trigger a re-rendering.\n *\n * ## `select` **`as`**\n *\n * Using `select` **`as`** will bind the result of the `select` expression to the model, but\n * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)\n * or property name (for object data sources) of the value within the collection. If a **`track by`** expression\n * is used, the result of that expression will be set as the value of the `option` and `select` elements.\n *\n *\n * ### `select` **`as`** and **`track by`**\n *\n * <div class=\"alert alert-warning\">\n * Be careful when using `select` **`as`** and **`track by`** in the same expression.\n * </div>\n *\n * Given this array of items on the $scope:\n *\n * ```js\n * $scope.items = [{\n * id: 1,\n * label: 'aLabel',\n * subItem: { name: 'aSubItem' }\n * }, {\n * id: 2,\n * label: 'bLabel',\n * subItem: { name: 'bSubItem' }\n * }];\n * ```\n *\n * This will work:\n *\n * ```html\n * <select ng-options=\"item as item.label for item in items track by item.id\" ng-model=\"selected\"></select>\n * ```\n * ```js\n * $scope.selected = $scope.items[0];\n * ```\n *\n * but this will not work:\n *\n * ```html\n * <select ng-options=\"item.subItem as item.label for item in items track by item.id\" ng-model=\"selected\"></select>\n * ```\n * ```js\n * $scope.selected = $scope.items[0].subItem;\n * ```\n *\n * In both examples, the **`track by`** expression is applied successfully to each `item` in the\n * `items` array. Because the selected option has been set programmatically in the controller, the\n * **`track by`** expression is also applied to the `ngModel` value. In the first example, the\n * `ngModel` value is `items[0]` and the **`track by`** expression evaluates to `items[0].id` with\n * no issue. In the second example, the `ngModel` value is `items[0].subItem` and the **`track by`**\n * expression evaluates to `items[0].subItem.id` (which is undefined). As a result, the model value\n * is not matched against any `<option>` and the `<select>` appears as having no selected value.\n *\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {comprehension_expression} ngOptions in one of the following forms:\n *\n * * for array data sources:\n * * `label` **`for`** `value` **`in`** `array`\n * * `select` **`as`** `label` **`for`** `value` **`in`** `array`\n * * `label` **`group by`** `group` **`for`** `value` **`in`** `array`\n * * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array`\n * * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\n * * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`\n * * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`\n * (for including a filter with `track by`)\n * * for object data sources:\n * * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n * * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`\n * * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`\n * * `label` **`disable when`** `disable` **`for (`**`key`**`,`** `value`**`) in`** `object`\n * * `select` **`as`** `label` **`group by`** `group`\n * **`for` `(`**`key`**`,`** `value`**`) in`** `object`\n * * `select` **`as`** `label` **`disable when`** `disable`\n * **`for` `(`**`key`**`,`** `value`**`) in`** `object`\n *\n * Where:\n *\n * * `array` / `object`: an expression which evaluates to an array / object to iterate over.\n * * `value`: local variable which will refer to each item in the `array` or each property value\n * of `object` during iteration.\n * * `key`: local variable which will refer to a property name in `object` during iteration.\n * * `label`: The result of this expression will be the label for `<option>` element. The\n * `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).\n * * `select`: The result of this expression will be bound to the model of the parent `<select>`\n * element. If not specified, `select` expression will default to `value`.\n * * `group`: The result of this expression will be used to group options using the `<optgroup>`\n * DOM element.\n * * `disable`: The result of this expression will be used to disable the rendered `<option>`\n * element. Return `true` to disable.\n * * `trackexpr`: Used when working with an array of objects. The result of this expression will be\n * used to identify the objects in the array. The `trackexpr` will most likely refer to the\n * `value` variable (e.g. `value.propertyName`). With this the selection is preserved\n * even when the options are recreated (e.g. reloaded from the server).\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required The control is considered valid only if value is entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngAttrSize sets the size of the select element dynamically. Uses the\n * {@link guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes ngAttr} directive.\n *\n * @example\n <example module=\"selectExample\" name=\"select\">\n <file name=\"index.html\">\n <script>\n angular.module('selectExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.colors = [\n {name:'black', shade:'dark'},\n {name:'white', shade:'light', notAnOption: true},\n {name:'red', shade:'dark'},\n {name:'blue', shade:'dark', notAnOption: true},\n {name:'yellow', shade:'light', notAnOption: false}\n ];\n $scope.myColor = $scope.colors[2]; // red\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <ul>\n <li ng-repeat=\"color in colors\">\n <label>Name: <input ng-model=\"color.name\"></label>\n <label><input type=\"checkbox\" ng-model=\"color.notAnOption\"> Disabled?</label>\n <button ng-click=\"colors.splice($index, 1)\" aria-label=\"Remove\">X</button>\n </li>\n <li>\n <button ng-click=\"colors.push({})\">add</button>\n </li>\n </ul>\n <hr/>\n <label>Color (null not allowed):\n <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\"></select>\n </label><br/>\n <label>Color (null allowed):\n <span class=\"nullable\">\n <select ng-model=\"myColor\" ng-options=\"color.name for color in colors\">\n <option value=\"\">-- choose color --</option>\n </select>\n </span></label><br/>\n\n <label>Color grouped by shade:\n <select ng-model=\"myColor\" ng-options=\"color.name group by color.shade for color in colors\">\n </select>\n </label><br/>\n\n <label>Color grouped by shade, with some disabled:\n <select ng-model=\"myColor\"\n ng-options=\"color.name group by color.shade disable when color.notAnOption for color in colors\">\n </select>\n </label><br/>\n\n\n\n Select <button ng-click=\"myColor = { name:'not in list', shade: 'other' }\">bogus</button>.\n <br/>\n <hr/>\n Currently selected: {{ {selected_color:myColor} }}\n <div style=\"border:solid 1px black; height:20px\"\n ng-style=\"{'background-color':myColor.name}\">\n </div>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ng-options', function() {\n expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');\n element.all(by.model('myColor')).first().click();\n element.all(by.css('select[ng-model=\"myColor\"] option')).first().click();\n expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');\n element(by.css('.nullable select[ng-model=\"myColor\"]')).click();\n element.all(by.css('.nullable select[ng-model=\"myColor\"] option')).first().click();\n expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');\n });\n </file>\n </example>\n */\n\n/* eslint-disable max-len */\n// //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555000000000666666666666600000007777777777777000000000000000888888888800000000000000000009999999999\nvar NG_OPTIONS_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+group\\s+by\\s+([\\s\\S]+?))?(?:\\s+disable\\s+when\\s+([\\s\\S]+?))?\\s+for\\s+(?:([$\\w][$\\w]*)|(?:\\(\\s*([$\\w][$\\w]*)\\s*,\\s*([$\\w][$\\w]*)\\s*\\)))\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?$/;\n // 1: value expression (valueFn)\n // 2: label expression (displayFn)\n // 3: group by expression (groupByFn)\n // 4: disable when expression (disableWhenFn)\n // 5: array item variable name\n // 6: object item key variable name\n // 7: object item value variable name\n // 8: collection expression\n // 9: track by expression\n/* eslint-enable */\n\n\nvar ngOptionsDirective = ['$compile', '$document', '$parse', function($compile, $document, $parse) {\n\n function parseOptionsExpression(optionsExp, selectElement, scope) {\n\n var match = optionsExp.match(NG_OPTIONS_REGEXP);\n if (!(match)) {\n throw ngOptionsMinErr('iexp',\n 'Expected expression in form of ' +\n '\\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\\'' +\n ' but got \\'{0}\\'. Element: {1}',\n optionsExp, startingTag(selectElement));\n }\n\n // Extract the parts from the ngOptions expression\n\n // The variable name for the value of the item in the collection\n var valueName = match[5] || match[7];\n // The variable name for the key of the item in the collection\n var keyName = match[6];\n\n // An expression that generates the viewValue for an option if there is a label expression\n var selectAs = / as /.test(match[0]) && match[1];\n // An expression that is used to track the id of each object in the options collection\n var trackBy = match[9];\n // An expression that generates the viewValue for an option if there is no label expression\n var valueFn = $parse(match[2] ? match[1] : valueName);\n var selectAsFn = selectAs && $parse(selectAs);\n var viewValueFn = selectAsFn || valueFn;\n var trackByFn = trackBy && $parse(trackBy);\n\n // Get the value by which we are going to track the option\n // if we have a trackFn then use that (passing scope and locals)\n // otherwise just hash the given viewValue\n var getTrackByValueFn = trackBy ?\n function(value, locals) { return trackByFn(scope, locals); } :\n function getHashOfValue(value) { return hashKey(value); };\n var getTrackByValue = function(value, key) {\n return getTrackByValueFn(value, getLocals(value, key));\n };\n\n var displayFn = $parse(match[2] || match[1]);\n var groupByFn = $parse(match[3] || '');\n var disableWhenFn = $parse(match[4] || '');\n var valuesFn = $parse(match[8]);\n\n var locals = {};\n var getLocals = keyName ? function(value, key) {\n locals[keyName] = key;\n locals[valueName] = value;\n return locals;\n } : function(value) {\n locals[valueName] = value;\n return locals;\n };\n\n\n function Option(selectValue, viewValue, label, group, disabled) {\n this.selectValue = selectValue;\n this.viewValue = viewValue;\n this.label = label;\n this.group = group;\n this.disabled = disabled;\n }\n\n function getOptionValuesKeys(optionValues) {\n var optionValuesKeys;\n\n if (!keyName && isArrayLike(optionValues)) {\n optionValuesKeys = optionValues;\n } else {\n // if object, extract keys, in enumeration order, unsorted\n optionValuesKeys = [];\n for (var itemKey in optionValues) {\n if (optionValues.hasOwnProperty(itemKey) && itemKey.charAt(0) !== '$') {\n optionValuesKeys.push(itemKey);\n }\n }\n }\n return optionValuesKeys;\n }\n\n return {\n trackBy: trackBy,\n getTrackByValue: getTrackByValue,\n getWatchables: $parse(valuesFn, function(optionValues) {\n // Create a collection of things that we would like to watch (watchedArray)\n // so that they can all be watched using a single $watchCollection\n // that only runs the handler once if anything changes\n var watchedArray = [];\n optionValues = optionValues || [];\n\n var optionValuesKeys = getOptionValuesKeys(optionValues);\n var optionValuesLength = optionValuesKeys.length;\n for (var index = 0; index < optionValuesLength; index++) {\n var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];\n var value = optionValues[key];\n\n var locals = getLocals(value, key);\n var selectValue = getTrackByValueFn(value, locals);\n watchedArray.push(selectValue);\n\n // Only need to watch the displayFn if there is a specific label expression\n if (match[2] || match[1]) {\n var label = displayFn(scope, locals);\n watchedArray.push(label);\n }\n\n // Only need to watch the disableWhenFn if there is a specific disable expression\n if (match[4]) {\n var disableWhen = disableWhenFn(scope, locals);\n watchedArray.push(disableWhen);\n }\n }\n return watchedArray;\n }),\n\n getOptions: function() {\n\n var optionItems = [];\n var selectValueMap = {};\n\n // The option values were already computed in the `getWatchables` fn,\n // which must have been called to trigger `getOptions`\n var optionValues = valuesFn(scope) || [];\n var optionValuesKeys = getOptionValuesKeys(optionValues);\n var optionValuesLength = optionValuesKeys.length;\n\n for (var index = 0; index < optionValuesLength; index++) {\n var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];\n var value = optionValues[key];\n var locals = getLocals(value, key);\n var viewValue = viewValueFn(scope, locals);\n var selectValue = getTrackByValueFn(viewValue, locals);\n var label = displayFn(scope, locals);\n var group = groupByFn(scope, locals);\n var disabled = disableWhenFn(scope, locals);\n var optionItem = new Option(selectValue, viewValue, label, group, disabled);\n\n optionItems.push(optionItem);\n selectValueMap[selectValue] = optionItem;\n }\n\n return {\n items: optionItems,\n selectValueMap: selectValueMap,\n getOptionFromViewValue: function(value) {\n return selectValueMap[getTrackByValue(value)];\n },\n getViewValueFromOption: function(option) {\n // If the viewValue could be an object that may be mutated by the application,\n // we need to make a copy and not return the reference to the value on the option.\n return trackBy ? copy(option.viewValue) : option.viewValue;\n }\n };\n }\n };\n }\n\n\n // Support: IE 9 only\n // We can't just jqLite('<option>') since jqLite is not smart enough\n // to create it in <select> and IE barfs otherwise.\n var optionTemplate = window.document.createElement('option'),\n optGroupTemplate = window.document.createElement('optgroup');\n\n function ngOptionsPostLink(scope, selectElement, attr, ctrls) {\n\n var selectCtrl = ctrls[0];\n var ngModelCtrl = ctrls[1];\n var multiple = attr.multiple;\n\n // The emptyOption allows the application developer to provide their own custom \"empty\"\n // option when the viewValue does not match any of the option values.\n for (var i = 0, children = selectElement.children(), ii = children.length; i < ii; i++) {\n if (children[i].value === '') {\n selectCtrl.hasEmptyOption = true;\n selectCtrl.emptyOption = children.eq(i);\n break;\n }\n }\n\n // The empty option will be compiled and rendered before we first generate the options\n selectElement.empty();\n\n var providedEmptyOption = !!selectCtrl.emptyOption;\n\n var unknownOption = jqLite(optionTemplate.cloneNode(false));\n unknownOption.val('?');\n\n var options;\n var ngOptions = parseOptionsExpression(attr.ngOptions, selectElement, scope);\n // This stores the newly created options before they are appended to the select.\n // Since the contents are removed from the fragment when it is appended,\n // we only need to create it once.\n var listFragment = $document[0].createDocumentFragment();\n\n // Overwrite the implementation. ngOptions doesn't use hashes\n selectCtrl.generateUnknownOptionValue = function(val) {\n return '?';\n };\n\n // Update the controller methods for multiple selectable options\n if (!multiple) {\n\n selectCtrl.writeValue = function writeNgOptionsValue(value) {\n // The options might not be defined yet when ngModel tries to render\n if (!options) return;\n\n var selectedOption = selectElement[0].options[selectElement[0].selectedIndex];\n var option = options.getOptionFromViewValue(value);\n\n // Make sure to remove the selected attribute from the previously selected option\n // Otherwise, screen readers might get confused\n if (selectedOption) selectedOption.removeAttribute('selected');\n\n if (option) {\n // Don't update the option when it is already selected.\n // For example, the browser will select the first option by default. In that case,\n // most properties are set automatically - except the `selected` attribute, which we\n // set always\n\n if (selectElement[0].value !== option.selectValue) {\n selectCtrl.removeUnknownOption();\n\n selectElement[0].value = option.selectValue;\n option.element.selected = true;\n }\n\n option.element.setAttribute('selected', 'selected');\n } else {\n selectCtrl.selectUnknownOrEmptyOption(value);\n }\n };\n\n selectCtrl.readValue = function readNgOptionsValue() {\n\n var selectedOption = options.selectValueMap[selectElement.val()];\n\n if (selectedOption && !selectedOption.disabled) {\n selectCtrl.unselectEmptyOption();\n selectCtrl.removeUnknownOption();\n return options.getViewValueFromOption(selectedOption);\n }\n return null;\n };\n\n // If we are using `track by` then we must watch the tracked value on the model\n // since ngModel only watches for object identity change\n // FIXME: When a user selects an option, this watch will fire needlessly\n if (ngOptions.trackBy) {\n scope.$watch(\n function() { return ngOptions.getTrackByValue(ngModelCtrl.$viewValue); },\n function() { ngModelCtrl.$render(); }\n );\n }\n\n } else {\n\n selectCtrl.writeValue = function writeNgOptionsMultiple(values) {\n // The options might not be defined yet when ngModel tries to render\n if (!options) return;\n\n // Only set `<option>.selected` if necessary, in order to prevent some browsers from\n // scrolling to `<option>` elements that are outside the `<select>` element's viewport.\n var selectedOptions = values && values.map(getAndUpdateSelectedOption) || [];\n\n options.items.forEach(function(option) {\n if (option.element.selected && !includes(selectedOptions, option)) {\n option.element.selected = false;\n }\n });\n };\n\n\n selectCtrl.readValue = function readNgOptionsMultiple() {\n var selectedValues = selectElement.val() || [],\n selections = [];\n\n forEach(selectedValues, function(value) {\n var option = options.selectValueMap[value];\n if (option && !option.disabled) selections.push(options.getViewValueFromOption(option));\n });\n\n return selections;\n };\n\n // If we are using `track by` then we must watch these tracked values on the model\n // since ngModel only watches for object identity change\n if (ngOptions.trackBy) {\n\n scope.$watchCollection(function() {\n if (isArray(ngModelCtrl.$viewValue)) {\n return ngModelCtrl.$viewValue.map(function(value) {\n return ngOptions.getTrackByValue(value);\n });\n }\n }, function() {\n ngModelCtrl.$render();\n });\n\n }\n }\n\n if (providedEmptyOption) {\n\n // compile the element since there might be bindings in it\n $compile(selectCtrl.emptyOption)(scope);\n\n selectElement.prepend(selectCtrl.emptyOption);\n\n if (selectCtrl.emptyOption[0].nodeType === NODE_TYPE_COMMENT) {\n // This means the empty option has currently no actual DOM node, probably because\n // it has been modified by a transclusion directive.\n selectCtrl.hasEmptyOption = false;\n\n // Redefine the registerOption function, which will catch\n // options that are added by ngIf etc. (rendering of the node is async because of\n // lazy transclusion)\n selectCtrl.registerOption = function(optionScope, optionEl) {\n if (optionEl.val() === '') {\n selectCtrl.hasEmptyOption = true;\n selectCtrl.emptyOption = optionEl;\n selectCtrl.emptyOption.removeClass('ng-scope');\n // This ensures the new empty option is selected if previously no option was selected\n ngModelCtrl.$render();\n\n optionEl.on('$destroy', function() {\n var needsRerender = selectCtrl.$isEmptyOptionSelected();\n\n selectCtrl.hasEmptyOption = false;\n selectCtrl.emptyOption = undefined;\n\n if (needsRerender) ngModelCtrl.$render();\n });\n }\n };\n\n } else {\n // remove the class, which is added automatically because we recompile the element and it\n // becomes the compilation root\n selectCtrl.emptyOption.removeClass('ng-scope');\n }\n\n }\n\n // We will re-render the option elements if the option values or labels change\n scope.$watchCollection(ngOptions.getWatchables, updateOptions);\n\n // ------------------------------------------------------------------ //\n\n function addOptionElement(option, parent) {\n var optionElement = optionTemplate.cloneNode(false);\n parent.appendChild(optionElement);\n updateOptionElement(option, optionElement);\n }\n\n function getAndUpdateSelectedOption(viewValue) {\n var option = options.getOptionFromViewValue(viewValue);\n var element = option && option.element;\n\n if (element && !element.selected) element.selected = true;\n\n return option;\n }\n\n function updateOptionElement(option, element) {\n option.element = element;\n element.disabled = option.disabled;\n // Support: IE 11 only, Edge 12-13 only\n // NOTE: The label must be set before the value, otherwise IE 11 & Edge create unresponsive\n // selects in certain circumstances when multiple selects are next to each other and display\n // the option list in listbox style, i.e. the select is [multiple], or specifies a [size].\n // See https://github.com/angular/angular.js/issues/11314 for more info.\n // This is unfortunately untestable with unit / e2e tests\n if (option.label !== element.label) {\n element.label = option.label;\n element.textContent = option.label;\n }\n element.value = option.selectValue;\n }\n\n function updateOptions() {\n var previousValue = options && selectCtrl.readValue();\n\n // We must remove all current options, but cannot simply set innerHTML = null\n // since the providedEmptyOption might have an ngIf on it that inserts comments which we\n // must preserve.\n // Instead, iterate over the current option elements and remove them or their optgroup\n // parents\n if (options) {\n\n for (var i = options.items.length - 1; i >= 0; i--) {\n var option = options.items[i];\n if (isDefined(option.group)) {\n jqLiteRemove(option.element.parentNode);\n } else {\n jqLiteRemove(option.element);\n }\n }\n }\n\n options = ngOptions.getOptions();\n\n var groupElementMap = {};\n\n options.items.forEach(function addOption(option) {\n var groupElement;\n\n if (isDefined(option.group)) {\n\n // This option is to live in a group\n // See if we have already created this group\n groupElement = groupElementMap[option.group];\n\n if (!groupElement) {\n\n groupElement = optGroupTemplate.cloneNode(false);\n listFragment.appendChild(groupElement);\n\n // Update the label on the group element\n // \"null\" is special cased because of Safari\n groupElement.label = option.group === null ? 'null' : option.group;\n\n // Store it for use later\n groupElementMap[option.group] = groupElement;\n }\n\n addOptionElement(option, groupElement);\n\n } else {\n\n // This option is not in a group\n addOptionElement(option, listFragment);\n }\n });\n\n selectElement[0].appendChild(listFragment);\n\n ngModelCtrl.$render();\n\n // Check to see if the value has changed due to the update to the options\n if (!ngModelCtrl.$isEmpty(previousValue)) {\n var nextValue = selectCtrl.readValue();\n var isNotPrimitive = ngOptions.trackBy || multiple;\n if (isNotPrimitive ? !equals(previousValue, nextValue) : previousValue !== nextValue) {\n ngModelCtrl.$setViewValue(nextValue);\n ngModelCtrl.$render();\n }\n }\n }\n }\n\n return {\n restrict: 'A',\n terminal: true,\n require: ['select', 'ngModel'],\n link: {\n pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) {\n // Deactivate the SelectController.register method to prevent\n // option directives from accidentally registering themselves\n // (and unwanted $destroy handlers etc.)\n ctrls[0].registerOption = noop;\n },\n post: ngOptionsPostLink\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngPluralize\n * @restrict EA\n *\n * @description\n * `ngPluralize` is a directive that displays messages according to en-US localization rules.\n * These rules are bundled with angular.js, but can be overridden\n * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive\n * by specifying the mappings between\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * and the strings to be displayed.\n *\n * # Plural categories and explicit number rules\n * There are two\n * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)\n * in Angular's default en-US locale: \"one\" and \"other\".\n *\n * While a plural category may match many numbers (for example, in en-US locale, \"other\" can match\n * any number that is not 1), an explicit number rule can only match one number. For example, the\n * explicit number rule for \"3\" matches the number 3. There are examples of plural categories\n * and explicit number rules throughout the rest of this documentation.\n *\n * # Configuring ngPluralize\n * You configure ngPluralize by providing 2 attributes: `count` and `when`.\n * You can also provide an optional attribute, `offset`.\n *\n * The value of the `count` attribute can be either a string or an {@link guide/expression\n * Angular expression}; these are evaluated on the current scope for its bound value.\n *\n * The `when` attribute specifies the mappings between plural categories and the actual\n * string to be displayed. The value of the attribute should be a JSON object.\n *\n * The following example shows how to configure ngPluralize:\n *\n * ```html\n * <ng-pluralize count=\"personCount\"\n when=\"{'0': 'Nobody is viewing.',\n * 'one': '1 person is viewing.',\n * 'other': '{} people are viewing.'}\">\n * </ng-pluralize>\n *```\n *\n * In the example, `\"0: Nobody is viewing.\"` is an explicit number rule. If you did not\n * specify this rule, 0 would be matched to the \"other\" category and \"0 people are viewing\"\n * would be shown instead of \"Nobody is viewing\". You can specify an explicit number rule for\n * other numbers, for example 12, so that instead of showing \"12 people are viewing\", you can\n * show \"a dozen people are viewing\".\n *\n * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted\n * into pluralized strings. In the previous example, Angular will replace `{}` with\n * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder\n * for <span ng-non-bindable>{{numberExpression}}</span>.\n *\n * If no rule is defined for a category, then an empty string is displayed and a warning is generated.\n * Note that some locales define more categories than `one` and `other`. For example, fr-fr defines `few` and `many`.\n *\n * # Configuring ngPluralize with offset\n * The `offset` attribute allows further customization of pluralized text, which can result in\n * a better user experience. For example, instead of the message \"4 people are viewing this document\",\n * you might display \"John, Kate and 2 others are viewing this document\".\n * The offset attribute allows you to offset a number by any desired value.\n * Let's take a look at an example:\n *\n * ```html\n * <ng-pluralize count=\"personCount\" offset=2\n * when=\"{'0': 'Nobody is viewing.',\n * '1': '{{person1}} is viewing.',\n * '2': '{{person1}} and {{person2}} are viewing.',\n * 'one': '{{person1}}, {{person2}} and one other person are viewing.',\n * 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n * </ng-pluralize>\n * ```\n *\n * Notice that we are still using two plural categories(one, other), but we added\n * three explicit number rules 0, 1 and 2.\n * When one person, perhaps John, views the document, \"John is viewing\" will be shown.\n * When three people view the document, no explicit number rule is found, so\n * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.\n * In this case, plural category 'one' is matched and \"John, Mary and one other person are viewing\"\n * is shown.\n *\n * Note that when you specify offsets, you must provide explicit number rules for\n * numbers from 0 up to and including the offset. If you use an offset of 3, for example,\n * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for\n * plural categories \"one\" and \"other\".\n *\n * @param {string|expression} count The variable to be bound to.\n * @param {string} when The mapping between plural category to its corresponding strings.\n * @param {number=} offset Offset to deduct from the total number.\n *\n * @example\n <example module=\"pluralizeExample\" name=\"ng-pluralize\">\n <file name=\"index.html\">\n <script>\n angular.module('pluralizeExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.person1 = 'Igor';\n $scope.person2 = 'Misko';\n $scope.personCount = 1;\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n <label>Person 1:<input type=\"text\" ng-model=\"person1\" value=\"Igor\" /></label><br/>\n <label>Person 2:<input type=\"text\" ng-model=\"person2\" value=\"Misko\" /></label><br/>\n <label>Number of People:<input type=\"text\" ng-model=\"personCount\" value=\"1\" /></label><br/>\n\n <!--- Example with simple pluralization rules for en locale --->\n Without Offset:\n <ng-pluralize count=\"personCount\"\n when=\"{'0': 'Nobody is viewing.',\n 'one': '1 person is viewing.',\n 'other': '{} people are viewing.'}\">\n </ng-pluralize><br>\n\n <!--- Example with offset --->\n With Offset(2):\n <ng-pluralize count=\"personCount\" offset=2\n when=\"{'0': 'Nobody is viewing.',\n '1': '{{person1}} is viewing.',\n '2': '{{person1}} and {{person2}} are viewing.',\n 'one': '{{person1}}, {{person2}} and one other person are viewing.',\n 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}\">\n </ng-pluralize>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should show correct pluralized string', function() {\n var withoutOffset = element.all(by.css('ng-pluralize')).get(0);\n var withOffset = element.all(by.css('ng-pluralize')).get(1);\n var countInput = element(by.model('personCount'));\n\n expect(withoutOffset.getText()).toEqual('1 person is viewing.');\n expect(withOffset.getText()).toEqual('Igor is viewing.');\n\n countInput.clear();\n countInput.sendKeys('0');\n\n expect(withoutOffset.getText()).toEqual('Nobody is viewing.');\n expect(withOffset.getText()).toEqual('Nobody is viewing.');\n\n countInput.clear();\n countInput.sendKeys('2');\n\n expect(withoutOffset.getText()).toEqual('2 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');\n\n countInput.clear();\n countInput.sendKeys('3');\n\n expect(withoutOffset.getText()).toEqual('3 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');\n\n countInput.clear();\n countInput.sendKeys('4');\n\n expect(withoutOffset.getText()).toEqual('4 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');\n });\n it('should show data-bound names', function() {\n var withOffset = element.all(by.css('ng-pluralize')).get(1);\n var personCount = element(by.model('personCount'));\n var person1 = element(by.model('person1'));\n var person2 = element(by.model('person2'));\n personCount.clear();\n personCount.sendKeys('4');\n person1.clear();\n person1.sendKeys('Di');\n person2.clear();\n person2.sendKeys('Vojta');\n expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');\n });\n </file>\n </example>\n */\nvar ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {\n var BRACE = /{}/g,\n IS_WHEN = /^when(Minus)?(.+)$/;\n\n return {\n link: function(scope, element, attr) {\n var numberExp = attr.count,\n whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs\n offset = attr.offset || 0,\n whens = scope.$eval(whenExp) || {},\n whensExpFns = {},\n startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,\n watchRemover = angular.noop,\n lastCount;\n\n forEach(attr, function(expression, attributeName) {\n var tmpMatch = IS_WHEN.exec(attributeName);\n if (tmpMatch) {\n var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);\n whens[whenKey] = element.attr(attr.$attr[attributeName]);\n }\n });\n forEach(whens, function(expression, key) {\n whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));\n\n });\n\n scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {\n var count = parseFloat(newVal);\n var countIsNaN = isNumberNaN(count);\n\n if (!countIsNaN && !(count in whens)) {\n // If an explicit number rule such as 1, 2, 3... is defined, just use it.\n // Otherwise, check it against pluralization rules in $locale service.\n count = $locale.pluralCat(count - offset);\n }\n\n // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.\n // In JS `NaN !== NaN`, so we have to explicitly check.\n if ((count !== lastCount) && !(countIsNaN && isNumberNaN(lastCount))) {\n watchRemover();\n var whenExpFn = whensExpFns[count];\n if (isUndefined(whenExpFn)) {\n if (newVal != null) {\n $log.debug('ngPluralize: no rule defined for \\'' + count + '\\' in ' + whenExp);\n }\n watchRemover = noop;\n updateElementText();\n } else {\n watchRemover = scope.$watch(whenExpFn, updateElementText);\n }\n lastCount = count;\n }\n });\n\n function updateElementText(newText) {\n element.text(newText || '');\n }\n }\n };\n}];\n\n/* exported ngRepeatDirective */\n\n/**\n * @ngdoc directive\n * @name ngRepeat\n * @multiElement\n * @restrict A\n *\n * @description\n * The `ngRepeat` directive instantiates a template once per item from a collection. Each template\n * instance gets its own scope, where the given loop variable is set to the current collection item,\n * and `$index` is set to the item index or key.\n *\n * Special properties are exposed on the local scope of each template instance, including:\n *\n * | Variable | Type | Details |\n * |-----------|-----------------|-----------------------------------------------------------------------------|\n * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) |\n * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. |\n * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |\n * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. |\n * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |\n * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |\n *\n * <div class=\"alert alert-info\">\n * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.\n * This may be useful when, for instance, nesting ngRepeats.\n * </div>\n *\n *\n * # Iterating over object properties\n *\n * It is possible to get `ngRepeat` to iterate over the properties of an object using the following\n * syntax:\n *\n * ```js\n * <div ng-repeat=\"(key, value) in myObj\"> ... </div>\n * ```\n *\n * However, there are a few limitations compared to array iteration:\n *\n * - The JavaScript specification does not define the order of keys\n * returned for an object, so Angular relies on the order returned by the browser\n * when running `for key in myObj`. Browsers generally follow the strategy of providing\n * keys in the order in which they were defined, although there are exceptions when keys are deleted\n * and reinstated. See the\n * [MDN page on `delete` for more info](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_notes).\n *\n * - `ngRepeat` will silently *ignore* object keys starting with `$`, because\n * it's a prefix used by Angular for public (`$`) and private (`$$`) properties.\n *\n * - The built-in filters {@link ng.orderBy orderBy} and {@link ng.filter filter} do not work with\n * objects, and will throw an error if used with one.\n *\n * If you are hitting any of these limitations, the recommended workaround is to convert your object into an array\n * that is sorted into the order that you prefer before providing it to `ngRepeat`. You could\n * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)\n * or implement a `$watch` on the object yourself.\n *\n *\n * # Tracking and Duplicates\n *\n * `ngRepeat` uses {@link $rootScope.Scope#$watchCollection $watchCollection} to detect changes in\n * the collection. When a change happens, `ngRepeat` then makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n *\n * To minimize creation of DOM elements, `ngRepeat` uses a function\n * to \"keep track\" of all items in the collection and their corresponding DOM elements.\n * For example, if an item is added to the collection, `ngRepeat` will know that all other items\n * already have DOM elements, and will not re-render them.\n *\n * The default tracking function (which tracks items by their identity) does not allow\n * duplicate items in arrays. This is because when there are duplicates, it is not possible\n * to maintain a one-to-one mapping between collection items and DOM elements.\n *\n * If you do need to repeat duplicate items, you can substitute the default tracking behavior\n * with your own using the `track by` expression.\n *\n * For example, you may track items by the index of each item in the collection, using the\n * special scope property `$index`:\n * ```html\n * <div ng-repeat=\"n in [42, 42, 43, 43] track by $index\">\n * {{n}}\n * </div>\n * ```\n *\n * You may also use arbitrary expressions in `track by`, including references to custom functions\n * on the scope:\n * ```html\n * <div ng-repeat=\"n in [42, 42, 43, 43] track by myTrackingFunction(n)\">\n * {{n}}\n * </div>\n * ```\n *\n * <div class=\"alert alert-success\">\n * If you are working with objects that have a unique identifier property, you should track\n * by this identifier instead of the object instance. Should you reload your data later, `ngRepeat`\n * will not have to rebuild the DOM elements for items it has already rendered, even if the\n * JavaScript objects in the collection have been substituted for new ones. For large collections,\n * this significantly improves rendering performance. If you don't have a unique identifier,\n * `track by $index` can also provide a performance boost.\n * </div>\n *\n * ```html\n * <div ng-repeat=\"model in collection track by model.id\">\n * {{model.name}}\n * </div>\n * ```\n *\n * <br />\n * <div class=\"alert alert-warning\">\n * Avoid using `track by $index` when the repeated template contains\n * {@link guide/expression#one-time-binding one-time bindings}. In such cases, the `nth` DOM\n * element will always be matched with the `nth` item of the array, so the bindings on that element\n * will not be updated even when the corresponding item changes, essentially causing the view to get\n * out-of-sync with the underlying data.\n * </div>\n *\n * When no `track by` expression is provided, it is equivalent to tracking by the built-in\n * `$id` function, which tracks items by their identity:\n * ```html\n * <div ng-repeat=\"obj in collection track by $id(obj)\">\n * {{obj.prop}}\n * </div>\n * ```\n *\n * <br />\n * <div class=\"alert alert-warning\">\n * **Note:** `track by` must always be the last expression:\n * </div>\n * ```\n * <div ng-repeat=\"model in collection | orderBy: 'id' as filtered_result track by model.id\">\n * {{model.name}}\n * </div>\n * ```\n *\n *\n * # Special repeat start and end points\n * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending\n * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.\n * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)\n * up to and including the ending HTML tag where **ng-repeat-end** is placed.\n *\n * The example below makes use of this feature:\n * ```html\n * <header ng-repeat-start=\"item in items\">\n * Header {{ item }}\n * </header>\n * <div class=\"body\">\n * Body {{ item }}\n * </div>\n * <footer ng-repeat-end>\n * Footer {{ item }}\n * </footer>\n * ```\n *\n * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:\n * ```html\n * <header>\n * Header A\n * </header>\n * <div class=\"body\">\n * Body A\n * </div>\n * <footer>\n * Footer A\n * </footer>\n * <header>\n * Header B\n * </header>\n * <div class=\"body\">\n * Body B\n * </div>\n * <footer>\n * Footer B\n * </footer>\n * ```\n *\n * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such\n * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | when a new item is added to the list or when an item is revealed after a filter |\n * | {@link ng.$animate#leave leave} | when an item is removed from the list or when an item is filtered out |\n * | {@link ng.$animate#move move } | when an adjacent item is filtered out causing a reorder or when the item contents are reordered |\n *\n * See the example below for defining CSS animations with ngRepeat.\n *\n * @element ANY\n * @scope\n * @priority 1000\n * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These\n * formats are currently supported:\n *\n * * `variable in expression` – where variable is the user defined loop variable and `expression`\n * is a scope expression giving the collection to enumerate.\n *\n * For example: `album in artist.albums`.\n *\n * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,\n * and `expression` is the scope expression giving the collection to enumerate.\n *\n * For example: `(name, age) in {'adam':10, 'amalie':12}`.\n *\n * * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression\n * which can be used to associate the objects in the collection with the DOM elements. If no tracking expression\n * is specified, ng-repeat associates elements by identity. It is an error to have\n * more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are\n * mapped to the same DOM element, which is not possible.)\n *\n * <div class=\"alert alert-warning\">\n * <strong>Note:</strong> the `track by` expression must come last - after any filters, and the alias expression.\n * </div>\n *\n * For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements\n * will be associated by item identity in the array.\n *\n * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique\n * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements\n * with the corresponding item in the array by identity. Moving the same object in array would move the DOM\n * element in the same way in the DOM.\n *\n * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this\n * case the object identity does not matter. Two objects are considered equivalent as long as their `id`\n * property is same.\n *\n * For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter\n * to items in conjunction with a tracking expression.\n *\n * * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the\n * intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message\n * when a filter is active on the repeater, but the filtered result set is empty.\n *\n * For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after\n * the items have been processed through the filter.\n *\n * Please note that `as [variable name] is not an operator but rather a part of ngRepeat micro-syntax so it can be used only at the end\n * (and not as operator, inside an expression).\n *\n * For example: `item in items | filter : x | orderBy : order | limitTo : limit as results` .\n *\n * @example\n * This example uses `ngRepeat` to display a list of people. A filter is used to restrict the displayed\n * results by name or by age. New (entering) and removed (leaving) items are animated.\n <example module=\"ngRepeat\" name=\"ngRepeat\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-repeat\">\n <file name=\"index.html\">\n <div ng-controller=\"repeatController\">\n I have {{friends.length}} friends. They are:\n <input type=\"search\" ng-model=\"q\" placeholder=\"filter friends...\" aria-label=\"filter friends\" />\n <ul class=\"example-animate-container\">\n <li class=\"animate-repeat\" ng-repeat=\"friend in friends | filter:q as results\">\n [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n </li>\n <li class=\"animate-repeat\" ng-if=\"results.length === 0\">\n <strong>No results found...</strong>\n </li>\n </ul>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngRepeat', ['ngAnimate']).controller('repeatController', function($scope) {\n $scope.friends = [\n {name:'John', age:25, gender:'boy'},\n {name:'Jessie', age:30, gender:'girl'},\n {name:'Johanna', age:28, gender:'girl'},\n {name:'Joy', age:15, gender:'girl'},\n {name:'Mary', age:28, gender:'girl'},\n {name:'Peter', age:95, gender:'boy'},\n {name:'Sebastian', age:50, gender:'boy'},\n {name:'Erika', age:27, gender:'girl'},\n {name:'Patrick', age:40, gender:'boy'},\n {name:'Samantha', age:60, gender:'girl'}\n ];\n });\n </file>\n <file name=\"animations.css\">\n .example-animate-container {\n background:white;\n border:1px solid black;\n list-style:none;\n margin:0;\n padding:0 10px;\n }\n\n .animate-repeat {\n line-height:30px;\n list-style:none;\n box-sizing:border-box;\n }\n\n .animate-repeat.ng-move,\n .animate-repeat.ng-enter,\n .animate-repeat.ng-leave {\n transition:all linear 0.5s;\n }\n\n .animate-repeat.ng-leave.ng-leave-active,\n .animate-repeat.ng-move,\n .animate-repeat.ng-enter {\n opacity:0;\n max-height:0;\n }\n\n .animate-repeat.ng-leave,\n .animate-repeat.ng-move.ng-move-active,\n .animate-repeat.ng-enter.ng-enter-active {\n opacity:1;\n max-height:30px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var friends = element.all(by.repeater('friend in friends'));\n\n it('should render initial data set', function() {\n expect(friends.count()).toBe(10);\n expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');\n expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');\n expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');\n expect(element(by.binding('friends.length')).getText())\n .toMatch(\"I have 10 friends. They are:\");\n });\n\n it('should update repeater when filter predicate changes', function() {\n expect(friends.count()).toBe(10);\n\n element(by.model('q')).sendKeys('ma');\n\n expect(friends.count()).toBe(2);\n expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');\n expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');\n });\n </file>\n </example>\n */\nvar ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $animate, $compile) {\n var NG_REMOVED = '$$NG_REMOVED';\n var ngRepeatMinErr = minErr('ngRepeat');\n\n var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {\n // TODO(perf): generate setters to shave off ~40ms or 1-1.5%\n scope[valueIdentifier] = value;\n if (keyIdentifier) scope[keyIdentifier] = key;\n scope.$index = index;\n scope.$first = (index === 0);\n scope.$last = (index === (arrayLength - 1));\n scope.$middle = !(scope.$first || scope.$last);\n // eslint-disable-next-line no-bitwise\n scope.$odd = !(scope.$even = (index & 1) === 0);\n };\n\n var getBlockStart = function(block) {\n return block.clone[0];\n };\n\n var getBlockEnd = function(block) {\n return block.clone[block.clone.length - 1];\n };\n\n\n return {\n restrict: 'A',\n multiElement: true,\n transclude: 'element',\n priority: 1000,\n terminal: true,\n $$tlb: true,\n compile: function ngRepeatCompile($element, $attr) {\n var expression = $attr.ngRepeat;\n var ngRepeatEndComment = $compile.$$createComment('end ngRepeat', expression);\n\n var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n\n if (!match) {\n throw ngRepeatMinErr('iexp', 'Expected expression in form of \\'_item_ in _collection_[ track by _id_]\\' but got \\'{0}\\'.',\n expression);\n }\n\n var lhs = match[1];\n var rhs = match[2];\n var aliasAs = match[3];\n var trackByExp = match[4];\n\n match = lhs.match(/^(?:(\\s*[$\\w]+)|\\(\\s*([$\\w]+)\\s*,\\s*([$\\w]+)\\s*\\))$/);\n\n if (!match) {\n throw ngRepeatMinErr('iidexp', '\\'_item_\\' in \\'_item_ in _collection_\\' should be an identifier or \\'(_key_, _value_)\\' expression, but got \\'{0}\\'.',\n lhs);\n }\n var valueIdentifier = match[3] || match[1];\n var keyIdentifier = match[2];\n\n if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||\n /^(null|undefined|this|\\$index|\\$first|\\$middle|\\$last|\\$even|\\$odd|\\$parent|\\$root|\\$id)$/.test(aliasAs))) {\n throw ngRepeatMinErr('badident', 'alias \\'{0}\\' is invalid --- must be a valid JS identifier which is not a reserved name.',\n aliasAs);\n }\n\n var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;\n var hashFnLocals = {$id: hashKey};\n\n if (trackByExp) {\n trackByExpGetter = $parse(trackByExp);\n } else {\n trackByIdArrayFn = function(key, value) {\n return hashKey(value);\n };\n trackByIdObjFn = function(key) {\n return key;\n };\n }\n\n return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {\n\n if (trackByExpGetter) {\n trackByIdExpFn = function(key, value, index) {\n // assign key, value, and $index to the locals so that they can be used in hash functions\n if (keyIdentifier) hashFnLocals[keyIdentifier] = key;\n hashFnLocals[valueIdentifier] = value;\n hashFnLocals.$index = index;\n return trackByExpGetter($scope, hashFnLocals);\n };\n }\n\n // Store a list of elements from previous run. This is a hash where key is the item from the\n // iterator, and the value is objects with following properties.\n // - scope: bound scope\n // - clone: previous element.\n // - index: position\n //\n // We are using no-proto object so that we don't need to guard against inherited props via\n // hasOwnProperty.\n var lastBlockMap = createMap();\n\n //watch props\n $scope.$watchCollection(rhs, function ngRepeatAction(collection) {\n var index, length,\n previousNode = $element[0], // node that cloned nodes should be inserted after\n // initialized to the comment node anchor\n nextNode,\n // Same as lastBlockMap but it has the current state. It will become the\n // lastBlockMap on the next iteration.\n nextBlockMap = createMap(),\n collectionLength,\n key, value, // key/value of iteration\n trackById,\n trackByIdFn,\n collectionKeys,\n block, // last object information {scope, element, id}\n nextBlockOrder,\n elementsToRemove;\n\n if (aliasAs) {\n $scope[aliasAs] = collection;\n }\n\n if (isArrayLike(collection)) {\n collectionKeys = collection;\n trackByIdFn = trackByIdExpFn || trackByIdArrayFn;\n } else {\n trackByIdFn = trackByIdExpFn || trackByIdObjFn;\n // if object, extract keys, in enumeration order, unsorted\n collectionKeys = [];\n for (var itemKey in collection) {\n if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') {\n collectionKeys.push(itemKey);\n }\n }\n }\n\n collectionLength = collectionKeys.length;\n nextBlockOrder = new Array(collectionLength);\n\n // locate existing items\n for (index = 0; index < collectionLength; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n trackById = trackByIdFn(key, value, index);\n if (lastBlockMap[trackById]) {\n // found previously seen block\n block = lastBlockMap[trackById];\n delete lastBlockMap[trackById];\n nextBlockMap[trackById] = block;\n nextBlockOrder[index] = block;\n } else if (nextBlockMap[trackById]) {\n // if collision detected. restore lastBlockMap and throw an error\n forEach(nextBlockOrder, function(block) {\n if (block && block.scope) lastBlockMap[block.id] = block;\n });\n throw ngRepeatMinErr('dupes',\n 'Duplicates in a repeater are not allowed. Use \\'track by\\' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}',\n expression, trackById, value);\n } else {\n // new never before seen block\n nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};\n nextBlockMap[trackById] = true;\n }\n }\n\n // remove leftover items\n for (var blockKey in lastBlockMap) {\n block = lastBlockMap[blockKey];\n elementsToRemove = getBlockNodes(block.clone);\n $animate.leave(elementsToRemove);\n if (elementsToRemove[0].parentNode) {\n // if the element was not removed yet because of pending animation, mark it as deleted\n // so that we can ignore it later\n for (index = 0, length = elementsToRemove.length; index < length; index++) {\n elementsToRemove[index][NG_REMOVED] = true;\n }\n }\n block.scope.$destroy();\n }\n\n // we are not using forEach for perf reasons (trying to avoid #call)\n for (index = 0; index < collectionLength; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n block = nextBlockOrder[index];\n\n if (block.scope) {\n // if we have already seen this object, then we need to reuse the\n // associated scope/element\n\n nextNode = previousNode;\n\n // skip nodes that are already pending removal via leave animation\n do {\n nextNode = nextNode.nextSibling;\n } while (nextNode && nextNode[NG_REMOVED]);\n\n if (getBlockStart(block) !== nextNode) {\n // existing item which got moved\n $animate.move(getBlockNodes(block.clone), null, previousNode);\n }\n previousNode = getBlockEnd(block);\n updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n } else {\n // new item which we don't know about\n $transclude(function ngRepeatTransclude(clone, scope) {\n block.scope = scope;\n // http://jsperf.com/clone-vs-createcomment\n var endNode = ngRepeatEndComment.cloneNode(false);\n clone[clone.length++] = endNode;\n\n $animate.enter(clone, null, previousNode);\n previousNode = endNode;\n // Note: We only need the first/last node of the cloned nodes.\n // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n // by a directive with templateUrl when its template arrives.\n block.clone = clone;\n nextBlockMap[block.id] = block;\n updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n });\n }\n }\n lastBlockMap = nextBlockMap;\n });\n };\n }\n };\n}];\n\nvar NG_HIDE_CLASS = 'ng-hide';\nvar NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';\n/**\n * @ngdoc directive\n * @name ngShow\n * @multiElement\n *\n * @description\n * The `ngShow` directive shows or hides the given HTML element based on the expression provided to\n * the `ngShow` attribute.\n *\n * The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element.\n * The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an\n * `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see\n * {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is visible) -->\n * <div ng-show=\"myValue\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is hidden) -->\n * <div ng-show=\"myValue\" class=\"ng-hide\"></div>\n * ```\n *\n * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added\n * to the class attribute on the element causing it to become hidden. When truthy, the `.ng-hide`\n * CSS class is removed from the element causing the element not to appear hidden.\n *\n * ## Why is `!important` used?\n *\n * You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the\n * `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as\n * simple as changing the display style on a HTML list item would make hidden elements appear\n * visible. This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using `!important`, the show and hide behavior will work as expected despite any clash between\n * CSS selector specificity (when `!important` isn't used with any conflicting styles). If a\n * developer chooses to override the styling to change how to hide an element then it is just a\n * matter of using `!important` in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none !important`. If you\n * wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for\n * the `.ng-hide` CSS class. Note that the selector that needs to be used is actually\n * `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added.\n *\n * ```css\n * .ng-hide:not(.ng-hide-animate) {\n * /* These are just alternative ways of hiding an element */\n * display: block!important;\n * position: absolute;\n * top: -9999px;\n * left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override anything in CSS and the animations will work around the\n * display style.\n *\n * ## A note about animations with `ngShow`\n *\n * Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the\n * directive expression is true and false. This system works like the animation system present with\n * `ngClass` except that you must also include the `!important` flag to override the display\n * property so that the elements are not actually hidden during the animation.\n *\n * ```css\n * /* A working example can be found at the bottom of this page. */\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n * transition: all 0.5s linear;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property\n * to block during animation states - ngAnimate will automatically handle the style toggling for you.\n *\n * @animations\n * | Animation | Occurs |\n * |-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n * | {@link $animate#addClass addClass} `.ng-hide` | After the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden. |\n * | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngShow` expression evaluates to a truthy value and just before contents are set to visible. |\n *\n * @element ANY\n * @param {expression} ngShow If the {@link guide/expression expression} is truthy/falsy then the\n * element is shown/hidden respectively.\n *\n * @example\n * A simple example, animating the element's opacity:\n *\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-show-simple\">\n <file name=\"index.html\">\n Show: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngShow\"><br />\n <div class=\"check-element animate-show-hide\" ng-show=\"checked\">\n I show up when your checkbox is checked.\n </div>\n </file>\n <file name=\"animations.css\">\n .animate-show-hide.ng-hide {\n opacity: 0;\n }\n\n .animate-show-hide.ng-hide-add,\n .animate-show-hide.ng-hide-remove {\n transition: all linear 0.5s;\n }\n\n .check-element {\n border: 1px solid black;\n opacity: 1;\n padding: 10px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ngShow', function() {\n var checkbox = element(by.model('checked'));\n var checkElem = element(by.css('.check-element'));\n\n expect(checkElem.isDisplayed()).toBe(false);\n checkbox.click();\n expect(checkElem.isDisplayed()).toBe(true);\n });\n </file>\n </example>\n *\n * <hr />\n * @example\n * A more complex example, featuring different show/hide animations:\n *\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-show-complex\">\n <file name=\"index.html\">\n Show: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngShow\"><br />\n <div class=\"check-element funky-show-hide\" ng-show=\"checked\">\n I show up when your checkbox is checked.\n </div>\n </file>\n <file name=\"animations.css\">\n body {\n overflow: hidden;\n perspective: 1000px;\n }\n\n .funky-show-hide.ng-hide-add {\n transform: rotateZ(0);\n transform-origin: right;\n transition: all 0.5s ease-in-out;\n }\n\n .funky-show-hide.ng-hide-add.ng-hide-add-active {\n transform: rotateZ(-135deg);\n }\n\n .funky-show-hide.ng-hide-remove {\n transform: rotateY(90deg);\n transform-origin: left;\n transition: all 0.5s ease;\n }\n\n .funky-show-hide.ng-hide-remove.ng-hide-remove-active {\n transform: rotateY(0);\n }\n\n .check-element {\n border: 1px solid black;\n opacity: 1;\n padding: 10px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ngShow', function() {\n var checkbox = element(by.model('checked'));\n var checkElem = element(by.css('.check-element'));\n\n expect(checkElem.isDisplayed()).toBe(false);\n checkbox.click();\n expect(checkElem.isDisplayed()).toBe(true);\n });\n </file>\n </example>\n */\nvar ngShowDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function(scope, element, attr) {\n scope.$watch(attr.ngShow, function ngShowWatchAction(value) {\n // we're adding a temporary, animation-specific class for ng-hide since this way\n // we can control when the element is actually displayed on screen without having\n // to have a global/greedy CSS selector that breaks when other animations are run.\n // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845\n $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {\n tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n });\n });\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngHide\n * @multiElement\n *\n * @description\n * The `ngHide` directive shows or hides the given HTML element based on the expression provided to\n * the `ngHide` attribute.\n *\n * The element is shown or hidden by removing or adding the `.ng-hide` CSS class onto the element.\n * The `.ng-hide` CSS class is predefined in AngularJS and sets the display style to none (using an\n * `!important` flag). For CSP mode please add `angular-csp.css` to your HTML file (see\n * {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * <!-- when $scope.myValue is truthy (element is hidden) -->\n * <div ng-hide=\"myValue\" class=\"ng-hide\"></div>\n *\n * <!-- when $scope.myValue is falsy (element is visible) -->\n * <div ng-hide=\"myValue\"></div>\n * ```\n *\n * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added\n * to the class attribute on the element causing it to become hidden. When falsy, the `.ng-hide`\n * CSS class is removed from the element causing the element not to appear hidden.\n *\n * ## Why is `!important` used?\n *\n * You may be wondering why `!important` is used for the `.ng-hide` CSS class. This is because the\n * `.ng-hide` selector can be easily overridden by heavier selectors. For example, something as\n * simple as changing the display style on a HTML list item would make hidden elements appear\n * visible. This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using `!important`, the show and hide behavior will work as expected despite any clash between\n * CSS selector specificity (when `!important` isn't used with any conflicting styles). If a\n * developer chooses to override the styling to change how to hide an element then it is just a\n * matter of using `!important` in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none !important`. If you\n * wish to change the hide behavior with `ngShow`/`ngHide`, you can simply overwrite the styles for\n * the `.ng-hide` CSS class. Note that the selector that needs to be used is actually\n * `.ng-hide:not(.ng-hide-animate)` to cope with extra animation classes that can be added.\n *\n * ```css\n * .ng-hide:not(.ng-hide-animate) {\n * /* These are just alternative ways of hiding an element */\n * display: block!important;\n * position: absolute;\n * top: -9999px;\n * left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the\n * display style.\n *\n * ## A note about animations with `ngHide`\n *\n * Animations in `ngShow`/`ngHide` work with the show and hide events that are triggered when the\n * directive expression is true and false. This system works like the animation system present with\n * `ngClass` except that you must also include the `!important` flag to override the display\n * property so that the elements are not actually hidden during the animation.\n *\n * ```css\n * /* A working example can be found at the bottom of this page. */\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n * transition: all 0.5s linear;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3, there is no need to change the display property\n * to block during animation states - ngAnimate will automatically handle the style toggling for you.\n *\n * @animations\n * | Animation | Occurs |\n * |-----------------------------------------------------|------------------------------------------------------------------------------------------------------------|\n * | {@link $animate#addClass addClass} `.ng-hide` | After the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden. |\n * | {@link $animate#removeClass removeClass} `.ng-hide` | After the `ngHide` expression evaluates to a non truthy value and just before contents are set to visible. |\n *\n *\n * @element ANY\n * @param {expression} ngHide If the {@link guide/expression expression} is truthy/falsy then the\n * element is hidden/shown respectively.\n *\n * @example\n * A simple example, animating the element's opacity:\n *\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-hide-simple\">\n <file name=\"index.html\">\n Hide: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngHide\"><br />\n <div class=\"check-element animate-show-hide\" ng-hide=\"checked\">\n I hide when your checkbox is checked.\n </div>\n </file>\n <file name=\"animations.css\">\n .animate-show-hide.ng-hide {\n opacity: 0;\n }\n\n .animate-show-hide.ng-hide-add,\n .animate-show-hide.ng-hide-remove {\n transition: all linear 0.5s;\n }\n\n .check-element {\n border: 1px solid black;\n opacity: 1;\n padding: 10px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ngHide', function() {\n var checkbox = element(by.model('checked'));\n var checkElem = element(by.css('.check-element'));\n\n expect(checkElem.isDisplayed()).toBe(true);\n checkbox.click();\n expect(checkElem.isDisplayed()).toBe(false);\n });\n </file>\n </example>\n *\n * <hr />\n * @example\n * A more complex example, featuring different show/hide animations:\n *\n <example module=\"ngAnimate\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-hide-complex\">\n <file name=\"index.html\">\n Hide: <input type=\"checkbox\" ng-model=\"checked\" aria-label=\"Toggle ngHide\"><br />\n <div class=\"check-element funky-show-hide\" ng-hide=\"checked\">\n I hide when your checkbox is checked.\n </div>\n </file>\n <file name=\"animations.css\">\n body {\n overflow: hidden;\n perspective: 1000px;\n }\n\n .funky-show-hide.ng-hide-add {\n transform: rotateZ(0);\n transform-origin: right;\n transition: all 0.5s ease-in-out;\n }\n\n .funky-show-hide.ng-hide-add.ng-hide-add-active {\n transform: rotateZ(-135deg);\n }\n\n .funky-show-hide.ng-hide-remove {\n transform: rotateY(90deg);\n transform-origin: left;\n transition: all 0.5s ease;\n }\n\n .funky-show-hide.ng-hide-remove.ng-hide-remove-active {\n transform: rotateY(0);\n }\n\n .check-element {\n border: 1px solid black;\n opacity: 1;\n padding: 10px;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should check ngHide', function() {\n var checkbox = element(by.model('checked'));\n var checkElem = element(by.css('.check-element'));\n\n expect(checkElem.isDisplayed()).toBe(true);\n checkbox.click();\n expect(checkElem.isDisplayed()).toBe(false);\n });\n </file>\n </example>\n */\nvar ngHideDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function(scope, element, attr) {\n scope.$watch(attr.ngHide, function ngHideWatchAction(value) {\n // The comment inside of the ngShowDirective explains why we add and\n // remove a temporary class for the show/hide animation\n $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {\n tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n });\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngStyle\n * @restrict AC\n *\n * @description\n * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.\n *\n * @knownIssue\n * You should not use {@link guide/interpolation interpolation} in the value of the `style`\n * attribute, when using the `ngStyle` directive on the same element.\n * See {@link guide/interpolation#known-issues here} for more info.\n *\n * @element ANY\n * @param {expression} ngStyle\n *\n * {@link guide/expression Expression} which evals to an\n * object whose keys are CSS style names and values are corresponding values for those CSS\n * keys.\n *\n * Since some CSS style names are not valid keys for an object, they must be quoted.\n * See the 'background-color' style in the example below.\n *\n * @example\n <example name=\"ng-style\">\n <file name=\"index.html\">\n <input type=\"button\" value=\"set color\" ng-click=\"myStyle={color:'red'}\">\n <input type=\"button\" value=\"set background\" ng-click=\"myStyle={'background-color':'blue'}\">\n <input type=\"button\" value=\"clear\" ng-click=\"myStyle={}\">\n <br/>\n <span ng-style=\"myStyle\">Sample Text</span>\n <pre>myStyle={{myStyle}}</pre>\n </file>\n <file name=\"style.css\">\n span {\n color: black;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var colorSpan = element(by.css('span'));\n\n it('should check ng-style', function() {\n expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n element(by.css('input[value=\\'set color\\']')).click();\n expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');\n element(by.css('input[value=clear]')).click();\n expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n });\n </file>\n </example>\n */\nvar ngStyleDirective = ngDirective(function(scope, element, attr) {\n scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {\n if (oldStyles && (newStyles !== oldStyles)) {\n forEach(oldStyles, function(val, style) { element.css(style, '');});\n }\n if (newStyles) element.css(newStyles);\n }, true);\n});\n\n/**\n * @ngdoc directive\n * @name ngSwitch\n * @restrict EA\n *\n * @description\n * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.\n * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location\n * as specified in the template.\n *\n * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it\n * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element\n * matches the value obtained from the evaluated expression. In other words, you define a container element\n * (where you place the directive), place an expression on the **`on=\"...\"` attribute**\n * (or the **`ng-switch=\"...\"` attribute**), define any inner elements inside of the directive and place\n * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on\n * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default\n * attribute is displayed.\n *\n * <div class=\"alert alert-info\">\n * Be aware that the attribute values to match against cannot be expressions. They are interpreted\n * as literal string values to match against.\n * For example, **`ng-switch-when=\"someVal\"`** will match against the string `\"someVal\"` not against the\n * value of the expression `$scope.someVal`.\n * </div>\n\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | after the ngSwitch contents change and the matched child element is placed inside the container |\n * | {@link ng.$animate#leave leave} | after the ngSwitch contents change and just before the former contents are removed from the DOM |\n *\n * @usage\n *\n * ```\n * <ANY ng-switch=\"expression\">\n * <ANY ng-switch-when=\"matchValue1\">...</ANY>\n * <ANY ng-switch-when=\"matchValue2\">...</ANY>\n * <ANY ng-switch-default>...</ANY>\n * </ANY>\n * ```\n *\n *\n * @scope\n * @priority 1200\n * @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>.\n * On child elements add:\n *\n * * `ngSwitchWhen`: the case statement to match against. If match then this\n * case will be displayed. If the same match appears multiple times, all the\n * elements will be displayed. It is possible to associate multiple values to\n * the same `ngSwitchWhen` by defining the optional attribute\n * `ngSwitchWhenSeparator`. The separator will be used to split the value of\n * the `ngSwitchWhen` attribute into multiple tokens, and the element will show\n * if any of the `ngSwitch` evaluates to any of these tokens.\n * * `ngSwitchDefault`: the default case when no other case match. If there\n * are multiple default cases, all of them will be displayed when no other\n * case match.\n *\n *\n * @example\n <example module=\"switchExample\" deps=\"angular-animate.js\" animations=\"true\" name=\"ng-switch\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <select ng-model=\"selection\" ng-options=\"item for item in items\">\n </select>\n <code>selection={{selection}}</code>\n <hr/>\n <div class=\"animate-switch-container\"\n ng-switch on=\"selection\">\n <div class=\"animate-switch\" ng-switch-when=\"settings|options\" ng-switch-when-separator=\"|\">Settings Div</div>\n <div class=\"animate-switch\" ng-switch-when=\"home\">Home Span</div>\n <div class=\"animate-switch\" ng-switch-default>default</div>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('switchExample', ['ngAnimate'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.items = ['settings', 'home', 'options', 'other'];\n $scope.selection = $scope.items[0];\n }]);\n </file>\n <file name=\"animations.css\">\n .animate-switch-container {\n position:relative;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .animate-switch {\n padding:10px;\n }\n\n .animate-switch.ng-animate {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n }\n\n .animate-switch.ng-leave.ng-leave-active,\n .animate-switch.ng-enter {\n top:-50px;\n }\n .animate-switch.ng-leave,\n .animate-switch.ng-enter.ng-enter-active {\n top:0;\n }\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n var switchElem = element(by.css('[ng-switch]'));\n var select = element(by.model('selection'));\n\n it('should start in settings', function() {\n expect(switchElem.getText()).toMatch(/Settings Div/);\n });\n it('should change to home', function() {\n select.all(by.css('option')).get(1).click();\n expect(switchElem.getText()).toMatch(/Home Span/);\n });\n it('should change to settings via \"options\"', function() {\n select.all(by.css('option')).get(2).click();\n expect(switchElem.getText()).toMatch(/Settings Div/);\n });\n it('should select default', function() {\n select.all(by.css('option')).get(3).click();\n expect(switchElem.getText()).toMatch(/default/);\n });\n </file>\n </example>\n */\nvar ngSwitchDirective = ['$animate', '$compile', function($animate, $compile) {\n return {\n require: 'ngSwitch',\n\n // asks for $scope to fool the BC controller module\n controller: ['$scope', function NgSwitchController() {\n this.cases = {};\n }],\n link: function(scope, element, attr, ngSwitchController) {\n var watchExpr = attr.ngSwitch || attr.on,\n selectedTranscludes = [],\n selectedElements = [],\n previousLeaveAnimations = [],\n selectedScopes = [];\n\n var spliceFactory = function(array, index) {\n return function(response) {\n if (response !== false) array.splice(index, 1);\n };\n };\n\n scope.$watch(watchExpr, function ngSwitchWatchAction(value) {\n var i, ii;\n\n // Start with the last, in case the array is modified during the loop\n while (previousLeaveAnimations.length) {\n $animate.cancel(previousLeaveAnimations.pop());\n }\n\n for (i = 0, ii = selectedScopes.length; i < ii; ++i) {\n var selected = getBlockNodes(selectedElements[i].clone);\n selectedScopes[i].$destroy();\n var runner = previousLeaveAnimations[i] = $animate.leave(selected);\n runner.done(spliceFactory(previousLeaveAnimations, i));\n }\n\n selectedElements.length = 0;\n selectedScopes.length = 0;\n\n if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {\n forEach(selectedTranscludes, function(selectedTransclude) {\n selectedTransclude.transclude(function(caseElement, selectedScope) {\n selectedScopes.push(selectedScope);\n var anchor = selectedTransclude.element;\n caseElement[caseElement.length++] = $compile.$$createComment('end ngSwitchWhen');\n var block = { clone: caseElement };\n\n selectedElements.push(block);\n $animate.enter(caseElement, anchor.parent(), anchor);\n });\n });\n }\n });\n }\n };\n}];\n\nvar ngSwitchWhenDirective = ngDirective({\n transclude: 'element',\n priority: 1200,\n require: '^ngSwitch',\n multiElement: true,\n link: function(scope, element, attrs, ctrl, $transclude) {\n\n var cases = attrs.ngSwitchWhen.split(attrs.ngSwitchWhenSeparator).sort().filter(\n // Filter duplicate cases\n function(element, index, array) { return array[index - 1] !== element; }\n );\n\n forEach(cases, function(whenCase) {\n ctrl.cases['!' + whenCase] = (ctrl.cases['!' + whenCase] || []);\n ctrl.cases['!' + whenCase].push({ transclude: $transclude, element: element });\n });\n }\n});\n\nvar ngSwitchDefaultDirective = ngDirective({\n transclude: 'element',\n priority: 1200,\n require: '^ngSwitch',\n multiElement: true,\n link: function(scope, element, attr, ctrl, $transclude) {\n ctrl.cases['?'] = (ctrl.cases['?'] || []);\n ctrl.cases['?'].push({ transclude: $transclude, element: element });\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngTransclude\n * @restrict EAC\n *\n * @description\n * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.\n *\n * You can specify that you want to insert a named transclusion slot, instead of the default slot, by providing the slot name\n * as the value of the `ng-transclude` or `ng-transclude-slot` attribute.\n *\n * If the transcluded content is not empty (i.e. contains one or more DOM nodes, including whitespace text nodes), any existing\n * content of this element will be removed before the transcluded content is inserted.\n * If the transcluded content is empty (or only whitespace), the existing content is left intact. This lets you provide fallback\n * content in the case that no transcluded content is provided.\n *\n * @element ANY\n *\n * @param {string} ngTransclude|ngTranscludeSlot the name of the slot to insert at this point. If this is not provided, is empty\n * or its value is the same as the name of the attribute then the default slot is used.\n *\n * @example\n * ### Basic transclusion\n * This example demonstrates basic transclusion of content into a component directive.\n * <example name=\"simpleTranscludeExample\" module=\"transcludeExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('transcludeExample', [])\n * .directive('pane', function(){\n * return {\n * restrict: 'E',\n * transclude: true,\n * scope: { title:'@' },\n * template: '<div style=\"border: 1px solid black;\">' +\n * '<div style=\"background-color: gray\">{{title}}</div>' +\n * '<ng-transclude></ng-transclude>' +\n * '</div>'\n * };\n * })\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.title = 'Lorem Ipsum';\n * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <input ng-model=\"title\" aria-label=\"title\"> <br/>\n * <textarea ng-model=\"text\" aria-label=\"text\"></textarea> <br/>\n * <pane title=\"{{title}}\"><span>{{text}}</span></pane>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should have transcluded', function() {\n * var titleElement = element(by.model('title'));\n * titleElement.clear();\n * titleElement.sendKeys('TITLE');\n * var textElement = element(by.model('text'));\n * textElement.clear();\n * textElement.sendKeys('TEXT');\n * expect(element(by.binding('title')).getText()).toEqual('TITLE');\n * expect(element(by.binding('text')).getText()).toEqual('TEXT');\n * });\n * </file>\n * </example>\n *\n * @example\n * ### Transclude fallback content\n * This example shows how to use `NgTransclude` with fallback content, that\n * is displayed if no transcluded content is provided.\n *\n * <example module=\"transcludeFallbackContentExample\" name=\"ng-transclude\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('transcludeFallbackContentExample', [])\n * .directive('myButton', function(){\n * return {\n * restrict: 'E',\n * transclude: true,\n * scope: true,\n * template: '<button style=\"cursor: pointer;\">' +\n * '<ng-transclude>' +\n * '<b style=\"color: red;\">Button1</b>' +\n * '</ng-transclude>' +\n * '</button>'\n * };\n * });\n * </script>\n * <!-- fallback button content -->\n * <my-button id=\"fallback\"></my-button>\n * <!-- modified button content -->\n * <my-button id=\"modified\">\n * <i style=\"color: green;\">Button2</i>\n * </my-button>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should have different transclude element content', function() {\n * expect(element(by.id('fallback')).getText()).toBe('Button1');\n * expect(element(by.id('modified')).getText()).toBe('Button2');\n * });\n * </file>\n * </example>\n *\n * @example\n * ### Multi-slot transclusion\n * This example demonstrates using multi-slot transclusion in a component directive.\n * <example name=\"multiSlotTranscludeExample\" module=\"multiSlotTranscludeExample\">\n * <file name=\"index.html\">\n * <style>\n * .title, .footer {\n * background-color: gray\n * }\n * </style>\n * <div ng-controller=\"ExampleController\">\n * <input ng-model=\"title\" aria-label=\"title\"> <br/>\n * <textarea ng-model=\"text\" aria-label=\"text\"></textarea> <br/>\n * <pane>\n * <pane-title><a ng-href=\"{{link}}\">{{title}}</a></pane-title>\n * <pane-body><p>{{text}}</p></pane-body>\n * </pane>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('multiSlotTranscludeExample', [])\n * .directive('pane', function() {\n * return {\n * restrict: 'E',\n * transclude: {\n * 'title': '?paneTitle',\n * 'body': 'paneBody',\n * 'footer': '?paneFooter'\n * },\n * template: '<div style=\"border: 1px solid black;\">' +\n * '<div class=\"title\" ng-transclude=\"title\">Fallback Title</div>' +\n * '<div ng-transclude=\"body\"></div>' +\n * '<div class=\"footer\" ng-transclude=\"footer\">Fallback Footer</div>' +\n * '</div>'\n * };\n * })\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.title = 'Lorem Ipsum';\n * $scope.link = 'https://google.com';\n * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n * }]);\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should have transcluded the title and the body', function() {\n * var titleElement = element(by.model('title'));\n * titleElement.clear();\n * titleElement.sendKeys('TITLE');\n * var textElement = element(by.model('text'));\n * textElement.clear();\n * textElement.sendKeys('TEXT');\n * expect(element(by.css('.title')).getText()).toEqual('TITLE');\n * expect(element(by.binding('text')).getText()).toEqual('TEXT');\n * expect(element(by.css('.footer')).getText()).toEqual('Fallback Footer');\n * });\n * </file>\n * </example>\n */\nvar ngTranscludeMinErr = minErr('ngTransclude');\nvar ngTranscludeDirective = ['$compile', function($compile) {\n return {\n restrict: 'EAC',\n terminal: true,\n compile: function ngTranscludeCompile(tElement) {\n\n // Remove and cache any original content to act as a fallback\n var fallbackLinkFn = $compile(tElement.contents());\n tElement.empty();\n\n return function ngTranscludePostLink($scope, $element, $attrs, controller, $transclude) {\n\n if (!$transclude) {\n throw ngTranscludeMinErr('orphan',\n 'Illegal use of ngTransclude directive in the template! ' +\n 'No parent directive that requires a transclusion found. ' +\n 'Element: {0}',\n startingTag($element));\n }\n\n\n // If the attribute is of the form: `ng-transclude=\"ng-transclude\"` then treat it like the default\n if ($attrs.ngTransclude === $attrs.$attr.ngTransclude) {\n $attrs.ngTransclude = '';\n }\n var slotName = $attrs.ngTransclude || $attrs.ngTranscludeSlot;\n\n // If the slot is required and no transclusion content is provided then this call will throw an error\n $transclude(ngTranscludeCloneAttachFn, null, slotName);\n\n // If the slot is optional and no transclusion content is provided then use the fallback content\n if (slotName && !$transclude.isSlotFilled(slotName)) {\n useFallbackContent();\n }\n\n function ngTranscludeCloneAttachFn(clone, transcludedScope) {\n if (clone.length && notWhitespace(clone)) {\n $element.append(clone);\n } else {\n useFallbackContent();\n // There is nothing linked against the transcluded scope since no content was available,\n // so it should be safe to clean up the generated scope.\n transcludedScope.$destroy();\n }\n }\n\n function useFallbackContent() {\n // Since this is the fallback content rather than the transcluded content,\n // we link against the scope of this directive rather than the transcluded scope\n fallbackLinkFn($scope, function(clone) {\n $element.append(clone);\n });\n }\n\n function notWhitespace(nodes) {\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n var node = nodes[i];\n if (node.nodeType !== NODE_TYPE_TEXT || node.nodeValue.trim()) {\n return true;\n }\n }\n }\n };\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name script\n * @restrict E\n *\n * @description\n * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the\n * template can be used by {@link ng.directive:ngInclude `ngInclude`},\n * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the\n * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be\n * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.\n *\n * @param {string} type Must be set to `'text/ng-template'`.\n * @param {string} id Cache name of the template.\n *\n * @example\n <example name=\"script-tag\">\n <file name=\"index.html\">\n <script type=\"text/ng-template\" id=\"/tpl.html\">\n Content of the template.\n </script>\n\n <a ng-click=\"currentTpl='/tpl.html'\" id=\"tpl-link\">Load inlined template</a>\n <div id=\"tpl-content\" ng-include src=\"currentTpl\"></div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should load template defined inside script tag', function() {\n element(by.css('#tpl-link')).click();\n expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);\n });\n </file>\n </example>\n */\nvar scriptDirective = ['$templateCache', function($templateCache) {\n return {\n restrict: 'E',\n terminal: true,\n compile: function(element, attr) {\n if (attr.type === 'text/ng-template') {\n var templateUrl = attr.id,\n text = element[0].text;\n\n $templateCache.put(templateUrl, text);\n }\n }\n };\n}];\n\n/* exported selectDirective, optionDirective */\n\nvar noopNgModelController = { $setViewValue: noop, $render: noop };\n\nfunction setOptionSelectedStatus(optionEl, value) {\n optionEl.prop('selected', value);\n /**\n * When unselecting an option, setting the property to null / false should be enough\n * However, screenreaders might react to the selected attribute instead, see\n * https://github.com/angular/angular.js/issues/14419\n * Note: \"selected\" is a boolean attr and will be removed when the \"value\" arg in attr() is false\n * or null\n */\n optionEl.attr('selected', value);\n}\n\n/**\n * @ngdoc type\n * @name select.SelectController\n *\n * @description\n * The controller for the {@link ng.select select} directive. The controller exposes\n * a few utility methods that can be used to augment the behavior of a regular or an\n * {@link ng.ngOptions ngOptions} select element.\n *\n * @example\n * ### Set a custom error when the unknown option is selected\n *\n * This example sets a custom error \"unknownValue\" on the ngModelController\n * when the select element's unknown option is selected, i.e. when the model is set to a value\n * that is not matched by any option.\n *\n * <example name=\"select-unknown-value-error\" module=\"staticSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"testSelect\"> Single select: </label><br>\n * <select name=\"testSelect\" ng-model=\"selected\" unknown-value-error>\n * <option value=\"option-1\">Option 1</option>\n * <option value=\"option-2\">Option 2</option>\n * </select><br>\n * <span ng-if=\"myForm.testSelect.$error.unknownValue\">Error: The current model doesn't match any option</span>\n *\n * <button ng-click=\"forceUnknownOption()\">Force unknown option</button><br>\n * </form>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('staticSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.selected = null;\n *\n * $scope.forceUnknownOption = function() {\n * $scope.selected = 'nonsense';\n * };\n * }])\n * .directive('unknownValueError', function() {\n * return {\n * require: ['ngModel', 'select'],\n * link: function(scope, element, attrs, ctrls) {\n * var ngModelCtrl = ctrls[0];\n * var selectCtrl = ctrls[1];\n *\n * ngModelCtrl.$validators.unknownValue = function(modelValue, viewValue) {\n * if (selectCtrl.$isUnknownOptionSelected()) {\n * return false;\n * }\n *\n * return true;\n * };\n * }\n *\n * };\n * });\n * </file>\n *</example>\n *\n *\n * @example\n * ### Set the \"required\" error when the unknown option is selected.\n *\n * By default, the \"required\" error on the ngModelController is only set on a required select\n * when the empty option is selected. This example adds a custom directive that also sets the\n * error when the unknown option is selected.\n *\n * <example name=\"select-unknown-value-required\" module=\"staticSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"testSelect\"> Select: </label><br>\n * <select name=\"testSelect\" ng-model=\"selected\" unknown-value-required>\n * <option value=\"option-1\">Option 1</option>\n * <option value=\"option-2\">Option 2</option>\n * </select><br>\n * <span ng-if=\"myForm.testSelect.$error.required\">Error: Please select a value</span><br>\n *\n * <button ng-click=\"forceUnknownOption()\">Force unknown option</button><br>\n * </form>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('staticSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.selected = null;\n *\n * $scope.forceUnknownOption = function() {\n * $scope.selected = 'nonsense';\n * };\n * }])\n * .directive('unknownValueRequired', function() {\n * return {\n * priority: 1, // This directive must run after the required directive has added its validator\n * require: ['ngModel', 'select'],\n * link: function(scope, element, attrs, ctrls) {\n * var ngModelCtrl = ctrls[0];\n * var selectCtrl = ctrls[1];\n *\n * var originalRequiredValidator = ngModelCtrl.$validators.required;\n *\n * ngModelCtrl.$validators.required = function() {\n * if (attrs.required && selectCtrl.$isUnknownOptionSelected()) {\n * return false;\n * }\n *\n * return originalRequiredValidator.apply(this, arguments);\n * };\n * }\n * };\n * });\n * </file>\n *</example>\n *\n *\n */\nvar SelectController =\n ['$element', '$scope', /** @this */ function($element, $scope) {\n\n var self = this,\n optionsMap = new NgMap();\n\n self.selectValueMap = {}; // Keys are the hashed values, values the original values\n\n // If the ngModel doesn't get provided then provide a dummy noop version to prevent errors\n self.ngModelCtrl = noopNgModelController;\n self.multiple = false;\n\n // The \"unknown\" option is one that is prepended to the list if the viewValue\n // does not match any of the options. When it is rendered the value of the unknown\n // option is '? XXX ?' where XXX is the hashKey of the value that is not known.\n //\n // Support: IE 9 only\n // We can't just jqLite('<option>') since jqLite is not smart enough\n // to create it in <select> and IE barfs otherwise.\n self.unknownOption = jqLite(window.document.createElement('option'));\n\n // The empty option is an option with the value '' that the application developer can\n // provide inside the select. It is always selectable and indicates that a \"null\" selection has\n // been made by the user.\n // If the select has an empty option, and the model of the select is set to \"undefined\" or \"null\",\n // the empty option is selected.\n // If the model is set to a different unmatched value, the unknown option is rendered and\n // selected, i.e both are present, because a \"null\" selection and an unknown value are different.\n self.hasEmptyOption = false;\n self.emptyOption = undefined;\n\n self.renderUnknownOption = function(val) {\n var unknownVal = self.generateUnknownOptionValue(val);\n self.unknownOption.val(unknownVal);\n $element.prepend(self.unknownOption);\n setOptionSelectedStatus(self.unknownOption, true);\n $element.val(unknownVal);\n };\n\n self.updateUnknownOption = function(val) {\n var unknownVal = self.generateUnknownOptionValue(val);\n self.unknownOption.val(unknownVal);\n setOptionSelectedStatus(self.unknownOption, true);\n $element.val(unknownVal);\n };\n\n self.generateUnknownOptionValue = function(val) {\n return '? ' + hashKey(val) + ' ?';\n };\n\n self.removeUnknownOption = function() {\n if (self.unknownOption.parent()) self.unknownOption.remove();\n };\n\n self.selectEmptyOption = function() {\n if (self.emptyOption) {\n $element.val('');\n setOptionSelectedStatus(self.emptyOption, true);\n }\n };\n\n self.unselectEmptyOption = function() {\n if (self.hasEmptyOption) {\n setOptionSelectedStatus(self.emptyOption, false);\n }\n };\n\n $scope.$on('$destroy', function() {\n // disable unknown option so that we don't do work when the whole select is being destroyed\n self.renderUnknownOption = noop;\n });\n\n // Read the value of the select control, the implementation of this changes depending\n // upon whether the select can have multiple values and whether ngOptions is at work.\n self.readValue = function readSingleValue() {\n var val = $element.val();\n // ngValue added option values are stored in the selectValueMap, normal interpolations are not\n var realVal = val in self.selectValueMap ? self.selectValueMap[val] : val;\n\n if (self.hasOption(realVal)) {\n return realVal;\n }\n\n return null;\n };\n\n\n // Write the value to the select control, the implementation of this changes depending\n // upon whether the select can have multiple values and whether ngOptions is at work.\n self.writeValue = function writeSingleValue(value) {\n // Make sure to remove the selected attribute from the previously selected option\n // Otherwise, screen readers might get confused\n var currentlySelectedOption = $element[0].options[$element[0].selectedIndex];\n if (currentlySelectedOption) setOptionSelectedStatus(jqLite(currentlySelectedOption), false);\n\n if (self.hasOption(value)) {\n self.removeUnknownOption();\n\n var hashedVal = hashKey(value);\n $element.val(hashedVal in self.selectValueMap ? hashedVal : value);\n\n // Set selected attribute and property on selected option for screen readers\n var selectedOption = $element[0].options[$element[0].selectedIndex];\n setOptionSelectedStatus(jqLite(selectedOption), true);\n } else {\n self.selectUnknownOrEmptyOption(value);\n }\n };\n\n\n // Tell the select control that an option, with the given value, has been added\n self.addOption = function(value, element) {\n // Skip comment nodes, as they only pollute the `optionsMap`\n if (element[0].nodeType === NODE_TYPE_COMMENT) return;\n\n assertNotHasOwnProperty(value, '\"option value\"');\n if (value === '') {\n self.hasEmptyOption = true;\n self.emptyOption = element;\n }\n var count = optionsMap.get(value) || 0;\n optionsMap.set(value, count + 1);\n // Only render at the end of a digest. This improves render performance when many options\n // are added during a digest and ensures all relevant options are correctly marked as selected\n scheduleRender();\n };\n\n // Tell the select control that an option, with the given value, has been removed\n self.removeOption = function(value) {\n var count = optionsMap.get(value);\n if (count) {\n if (count === 1) {\n optionsMap.delete(value);\n if (value === '') {\n self.hasEmptyOption = false;\n self.emptyOption = undefined;\n }\n } else {\n optionsMap.set(value, count - 1);\n }\n }\n };\n\n // Check whether the select control has an option matching the given value\n self.hasOption = function(value) {\n return !!optionsMap.get(value);\n };\n\n /**\n * @ngdoc method\n * @name select.SelectController#$hasEmptyOption\n *\n * @description\n *\n * Returns `true` if the select element currently has an empty option\n * element, i.e. an option that signifies that the select is empty / the selection is null.\n *\n */\n self.$hasEmptyOption = function() {\n return self.hasEmptyOption;\n };\n\n /**\n * @ngdoc method\n * @name select.SelectController#$isUnknownOptionSelected\n *\n * @description\n *\n * Returns `true` if the select element's unknown option is selected. The unknown option is added\n * and automatically selected whenever the select model doesn't match any option.\n *\n */\n self.$isUnknownOptionSelected = function() {\n // Presence of the unknown option means it is selected\n return $element[0].options[0] === self.unknownOption[0];\n };\n\n /**\n * @ngdoc method\n * @name select.SelectController#$isEmptyOptionSelected\n *\n * @description\n *\n * Returns `true` if the select element has an empty option and this empty option is currently\n * selected. Returns `false` if the select element has no empty option or it is not selected.\n *\n */\n self.$isEmptyOptionSelected = function() {\n return self.hasEmptyOption && $element[0].options[$element[0].selectedIndex] === self.emptyOption[0];\n };\n\n self.selectUnknownOrEmptyOption = function(value) {\n if (value == null && self.emptyOption) {\n self.removeUnknownOption();\n self.selectEmptyOption();\n } else if (self.unknownOption.parent().length) {\n self.updateUnknownOption(value);\n } else {\n self.renderUnknownOption(value);\n }\n };\n\n var renderScheduled = false;\n function scheduleRender() {\n if (renderScheduled) return;\n renderScheduled = true;\n $scope.$$postDigest(function() {\n renderScheduled = false;\n self.ngModelCtrl.$render();\n });\n }\n\n var updateScheduled = false;\n function scheduleViewValueUpdate(renderAfter) {\n if (updateScheduled) return;\n\n updateScheduled = true;\n\n $scope.$$postDigest(function() {\n if ($scope.$$destroyed) return;\n\n updateScheduled = false;\n self.ngModelCtrl.$setViewValue(self.readValue());\n if (renderAfter) self.ngModelCtrl.$render();\n });\n }\n\n\n self.registerOption = function(optionScope, optionElement, optionAttrs, interpolateValueFn, interpolateTextFn) {\n\n if (optionAttrs.$attr.ngValue) {\n // The value attribute is set by ngValue\n var oldVal, hashedVal = NaN;\n optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) {\n\n var removal;\n var previouslySelected = optionElement.prop('selected');\n\n if (isDefined(hashedVal)) {\n self.removeOption(oldVal);\n delete self.selectValueMap[hashedVal];\n removal = true;\n }\n\n hashedVal = hashKey(newVal);\n oldVal = newVal;\n self.selectValueMap[hashedVal] = newVal;\n self.addOption(newVal, optionElement);\n // Set the attribute directly instead of using optionAttrs.$set - this stops the observer\n // from firing a second time. Other $observers on value will also get the result of the\n // ngValue expression, not the hashed value\n optionElement.attr('value', hashedVal);\n\n if (removal && previouslySelected) {\n scheduleViewValueUpdate();\n }\n\n });\n } else if (interpolateValueFn) {\n // The value attribute is interpolated\n optionAttrs.$observe('value', function valueAttributeObserveAction(newVal) {\n // This method is overwritten in ngOptions and has side-effects!\n self.readValue();\n\n var removal;\n var previouslySelected = optionElement.prop('selected');\n\n if (isDefined(oldVal)) {\n self.removeOption(oldVal);\n removal = true;\n }\n oldVal = newVal;\n self.addOption(newVal, optionElement);\n\n if (removal && previouslySelected) {\n scheduleViewValueUpdate();\n }\n });\n } else if (interpolateTextFn) {\n // The text content is interpolated\n optionScope.$watch(interpolateTextFn, function interpolateWatchAction(newVal, oldVal) {\n optionAttrs.$set('value', newVal);\n var previouslySelected = optionElement.prop('selected');\n if (oldVal !== newVal) {\n self.removeOption(oldVal);\n }\n self.addOption(newVal, optionElement);\n\n if (oldVal && previouslySelected) {\n scheduleViewValueUpdate();\n }\n });\n } else {\n // The value attribute is static\n self.addOption(optionAttrs.value, optionElement);\n }\n\n\n optionAttrs.$observe('disabled', function(newVal) {\n\n // Since model updates will also select disabled options (like ngOptions),\n // we only have to handle options becoming disabled, not enabled\n\n if (newVal === 'true' || newVal && optionElement.prop('selected')) {\n if (self.multiple) {\n scheduleViewValueUpdate(true);\n } else {\n self.ngModelCtrl.$setViewValue(null);\n self.ngModelCtrl.$render();\n }\n }\n });\n\n optionElement.on('$destroy', function() {\n var currentValue = self.readValue();\n var removeValue = optionAttrs.value;\n\n self.removeOption(removeValue);\n scheduleRender();\n\n if (self.multiple && currentValue && currentValue.indexOf(removeValue) !== -1 ||\n currentValue === removeValue\n ) {\n // When multiple (selected) options are destroyed at the same time, we don't want\n // to run a model update for each of them. Instead, run a single update in the $$postDigest\n scheduleViewValueUpdate(true);\n }\n });\n };\n}];\n\n/**\n * @ngdoc directive\n * @name select\n * @restrict E\n *\n * @description\n * HTML `select` element with angular data-binding.\n *\n * The `select` directive is used together with {@link ngModel `ngModel`} to provide data-binding\n * between the scope and the `<select>` control (including setting default values).\n * It also handles dynamic `<option>` elements, which can be added using the {@link ngRepeat `ngRepeat}` or\n * {@link ngOptions `ngOptions`} directives.\n *\n * When an item in the `<select>` menu is selected, the value of the selected option will be bound\n * to the model identified by the `ngModel` directive. With static or repeated options, this is\n * the content of the `value` attribute or the textContent of the `<option>`, if the value attribute is missing.\n * Value and textContent can be interpolated.\n *\n * The {@link select.SelectController select controller} exposes utility functions that can be used\n * to manipulate the select's behavior.\n *\n * ## Matching model and option values\n *\n * In general, the match between the model and an option is evaluated by strictly comparing the model\n * value against the value of the available options.\n *\n * If you are setting the option value with the option's `value` attribute, or textContent, the\n * value will always be a `string` which means that the model value must also be a string.\n * Otherwise the `select` directive cannot match them correctly.\n *\n * To bind the model to a non-string value, you can use one of the following strategies:\n * - the {@link ng.ngOptions `ngOptions`} directive\n * ({@link ng.select#using-select-with-ngoptions-and-setting-a-default-value})\n * - the {@link ng.ngValue `ngValue`} directive, which allows arbitrary expressions to be\n * option values ({@link ng.select#using-ngvalue-to-bind-the-model-to-an-array-of-objects Example})\n * - model $parsers / $formatters to convert the string value\n * ({@link ng.select#binding-select-to-a-non-string-value-via-ngmodel-parsing-formatting Example})\n *\n * If the viewValue of `ngModel` does not match any of the options, then the control\n * will automatically add an \"unknown\" option, which it then removes when the mismatch is resolved.\n *\n * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can\n * be nested into the `<select>` element. This element will then represent the `null` or \"not selected\"\n * option. See example below for demonstration.\n *\n * ## Choosing between `ngRepeat` and `ngOptions`\n *\n * In many cases, `ngRepeat` can be used on `<option>` elements instead of {@link ng.directive:ngOptions\n * ngOptions} to achieve a similar result. However, `ngOptions` provides some benefits:\n * - more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the\n * comprehension expression\n * - reduced memory consumption by not creating a new scope for each repeated instance\n * - increased render speed by creating the options in a documentFragment instead of individually\n *\n * Specifically, select with repeated options slows down significantly starting at 2000 options in\n * Chrome and Internet Explorer / Edge.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} multiple Allows multiple options to be selected. The selected values will be\n * bound to the model as an array.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds required attribute and required validation constraint to\n * the element when the ngRequired expression evaluates to true. Use ngRequired instead of required\n * when you want to data-bind to the required attribute.\n * @param {string=} ngChange Angular expression to be executed when selected option(s) changes due to user\n * interaction with the select element.\n * @param {string=} ngOptions sets the options that the select is populated with and defines what is\n * set on the model on selection. See {@link ngOptions `ngOptions`}.\n * @param {string=} ngAttrSize sets the size of the select element dynamically. Uses the\n * {@link guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes ngAttr} directive.\n *\n *\n * @knownIssue\n *\n * In Firefox, the select model is only updated when the select element is blurred. For example,\n * when switching between options with the keyboard, the select model is only set to the\n * currently selected option when the select is blurred, e.g via tab key or clicking the mouse\n * outside the select.\n *\n * This is due to an ambiguity in the select element specification. See the\n * [issue on the Firefox bug tracker](https://bugzilla.mozilla.org/show_bug.cgi?id=126379)\n * for more information, and this\n * [Github comment for a workaround](https://github.com/angular/angular.js/issues/9134#issuecomment-130800488)\n *\n * @example\n * ### Simple `select` elements with static options\n *\n * <example name=\"static-select\" module=\"staticSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"singleSelect\"> Single select: </label><br>\n * <select name=\"singleSelect\" ng-model=\"data.singleSelect\">\n * <option value=\"option-1\">Option 1</option>\n * <option value=\"option-2\">Option 2</option>\n * </select><br>\n *\n * <label for=\"singleSelect\"> Single select with \"not selected\" option and dynamic option values: </label><br>\n * <select name=\"singleSelect\" id=\"singleSelect\" ng-model=\"data.singleSelect\">\n * <option value=\"\">---Please select---</option> <!-- not selected / blank option -->\n * <option value=\"{{data.option1}}\">Option 1</option> <!-- interpolation -->\n * <option value=\"option-2\">Option 2</option>\n * </select><br>\n * <button ng-click=\"forceUnknownOption()\">Force unknown option</button><br>\n * <tt>singleSelect = {{data.singleSelect}}</tt>\n *\n * <hr>\n * <label for=\"multipleSelect\"> Multiple select: </label><br>\n * <select name=\"multipleSelect\" id=\"multipleSelect\" ng-model=\"data.multipleSelect\" multiple>\n * <option value=\"option-1\">Option 1</option>\n * <option value=\"option-2\">Option 2</option>\n * <option value=\"option-3\">Option 3</option>\n * </select><br>\n * <tt>multipleSelect = {{data.multipleSelect}}</tt><br/>\n * </form>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('staticSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * singleSelect: null,\n * multipleSelect: [],\n * option1: 'option-1'\n * };\n *\n * $scope.forceUnknownOption = function() {\n * $scope.data.singleSelect = 'nonsense';\n * };\n * }]);\n * </file>\n *</example>\n *\n * ### Using `ngRepeat` to generate `select` options\n * <example name=\"select-ngrepeat\" module=\"ngrepeatSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"repeatSelect\"> Repeat select: </label>\n * <select name=\"repeatSelect\" id=\"repeatSelect\" ng-model=\"data.model\">\n * <option ng-repeat=\"option in data.availableOptions\" value=\"{{option.id}}\">{{option.name}}</option>\n * </select>\n * </form>\n * <hr>\n * <tt>model = {{data.model}}</tt><br/>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('ngrepeatSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * model: null,\n * availableOptions: [\n * {id: '1', name: 'Option A'},\n * {id: '2', name: 'Option B'},\n * {id: '3', name: 'Option C'}\n * ]\n * };\n * }]);\n * </file>\n *</example>\n *\n * ### Using `ngValue` to bind the model to an array of objects\n * <example name=\"select-ngvalue\" module=\"ngvalueSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"ngvalueselect\"> ngvalue select: </label>\n * <select size=\"6\" name=\"ngvalueselect\" ng-model=\"data.model\" multiple>\n * <option ng-repeat=\"option in data.availableOptions\" ng-value=\"option.value\">{{option.name}}</option>\n * </select>\n * </form>\n * <hr>\n * <pre>model = {{data.model | json}}</pre><br/>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('ngvalueSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * model: null,\n * availableOptions: [\n {value: 'myString', name: 'string'},\n {value: 1, name: 'integer'},\n {value: true, name: 'boolean'},\n {value: null, name: 'null'},\n {value: {prop: 'value'}, name: 'object'},\n {value: ['a'], name: 'array'}\n * ]\n * };\n * }]);\n * </file>\n *</example>\n *\n * ### Using `select` with `ngOptions` and setting a default value\n * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples.\n *\n * <example name=\"select-with-default-values\" module=\"defaultValueSelect\">\n * <file name=\"index.html\">\n * <div ng-controller=\"ExampleController\">\n * <form name=\"myForm\">\n * <label for=\"mySelect\">Make a choice:</label>\n * <select name=\"mySelect\" id=\"mySelect\"\n * ng-options=\"option.name for option in data.availableOptions track by option.id\"\n * ng-model=\"data.selectedOption\"></select>\n * </form>\n * <hr>\n * <tt>option = {{data.selectedOption}}</tt><br/>\n * </div>\n * </file>\n * <file name=\"app.js\">\n * angular.module('defaultValueSelect', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.data = {\n * availableOptions: [\n * {id: '1', name: 'Option A'},\n * {id: '2', name: 'Option B'},\n * {id: '3', name: 'Option C'}\n * ],\n * selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui\n * };\n * }]);\n * </file>\n *</example>\n *\n *\n * ### Binding `select` to a non-string value via `ngModel` parsing / formatting\n *\n * <example name=\"select-with-non-string-options\" module=\"nonStringSelect\">\n * <file name=\"index.html\">\n * <select ng-model=\"model.id\" convert-to-number>\n * <option value=\"0\">Zero</option>\n * <option value=\"1\">One</option>\n * <option value=\"2\">Two</option>\n * </select>\n * {{ model }}\n * </file>\n * <file name=\"app.js\">\n * angular.module('nonStringSelect', [])\n * .run(function($rootScope) {\n * $rootScope.model = { id: 2 };\n * })\n * .directive('convertToNumber', function() {\n * return {\n * require: 'ngModel',\n * link: function(scope, element, attrs, ngModel) {\n * ngModel.$parsers.push(function(val) {\n * return parseInt(val, 10);\n * });\n * ngModel.$formatters.push(function(val) {\n * return '' + val;\n * });\n * }\n * };\n * });\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should initialize to model', function() {\n * expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two');\n * });\n * </file>\n * </example>\n *\n */\nvar selectDirective = function() {\n\n return {\n restrict: 'E',\n require: ['select', '?ngModel'],\n controller: SelectController,\n priority: 1,\n link: {\n pre: selectPreLink,\n post: selectPostLink\n }\n };\n\n function selectPreLink(scope, element, attr, ctrls) {\n\n var selectCtrl = ctrls[0];\n var ngModelCtrl = ctrls[1];\n\n // if ngModel is not defined, we don't need to do anything but set the registerOption\n // function to noop, so options don't get added internally\n if (!ngModelCtrl) {\n selectCtrl.registerOption = noop;\n return;\n }\n\n\n selectCtrl.ngModelCtrl = ngModelCtrl;\n\n // When the selected item(s) changes we delegate getting the value of the select control\n // to the `readValue` method, which can be changed if the select can have multiple\n // selected values or if the options are being generated by `ngOptions`\n element.on('change', function() {\n selectCtrl.removeUnknownOption();\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(selectCtrl.readValue());\n });\n });\n\n // If the select allows multiple values then we need to modify how we read and write\n // values from and to the control; also what it means for the value to be empty and\n // we have to add an extra watch since ngModel doesn't work well with arrays - it\n // doesn't trigger rendering if only an item in the array changes.\n if (attr.multiple) {\n selectCtrl.multiple = true;\n\n // Read value now needs to check each option to see if it is selected\n selectCtrl.readValue = function readMultipleValue() {\n var array = [];\n forEach(element.find('option'), function(option) {\n if (option.selected && !option.disabled) {\n var val = option.value;\n array.push(val in selectCtrl.selectValueMap ? selectCtrl.selectValueMap[val] : val);\n }\n });\n return array;\n };\n\n // Write value now needs to set the selected property of each matching option\n selectCtrl.writeValue = function writeMultipleValue(value) {\n forEach(element.find('option'), function(option) {\n var shouldBeSelected = !!value && (includes(value, option.value) ||\n includes(value, selectCtrl.selectValueMap[option.value]));\n var currentlySelected = option.selected;\n\n // Support: IE 9-11 only, Edge 12-15+\n // In IE and Edge adding options to the selection via shift+click/UP/DOWN\n // will de-select already selected options if \"selected\" on those options was set\n // more than once (i.e. when the options were already selected)\n // So we only modify the selected property if necessary.\n // Note: this behavior cannot be replicated via unit tests because it only shows in the\n // actual user interface.\n if (shouldBeSelected !== currentlySelected) {\n setOptionSelectedStatus(jqLite(option), shouldBeSelected);\n }\n\n });\n };\n\n // we have to do it on each watch since ngModel watches reference, but\n // we need to work of an array, so we need to see if anything was inserted/removed\n var lastView, lastViewRef = NaN;\n scope.$watch(function selectMultipleWatch() {\n if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) {\n lastView = shallowCopy(ngModelCtrl.$viewValue);\n ngModelCtrl.$render();\n }\n lastViewRef = ngModelCtrl.$viewValue;\n });\n\n // If we are a multiple select then value is now a collection\n // so the meaning of $isEmpty changes\n ngModelCtrl.$isEmpty = function(value) {\n return !value || value.length === 0;\n };\n\n }\n }\n\n function selectPostLink(scope, element, attrs, ctrls) {\n // if ngModel is not defined, we don't need to do anything\n var ngModelCtrl = ctrls[1];\n if (!ngModelCtrl) return;\n\n var selectCtrl = ctrls[0];\n\n // We delegate rendering to the `writeValue` method, which can be changed\n // if the select can have multiple selected values or if the options are being\n // generated by `ngOptions`.\n // This must be done in the postLink fn to prevent $render to be called before\n // all nodes have been linked correctly.\n ngModelCtrl.$render = function() {\n selectCtrl.writeValue(ngModelCtrl.$viewValue);\n };\n }\n};\n\n\n// The option directive is purely designed to communicate the existence (or lack of)\n// of dynamically created (and destroyed) option elements to their containing select\n// directive via its controller.\nvar optionDirective = ['$interpolate', function($interpolate) {\n return {\n restrict: 'E',\n priority: 100,\n compile: function(element, attr) {\n var interpolateValueFn, interpolateTextFn;\n\n if (isDefined(attr.ngValue)) {\n // Will be handled by registerOption\n } else if (isDefined(attr.value)) {\n // If the value attribute is defined, check if it contains an interpolation\n interpolateValueFn = $interpolate(attr.value, true);\n } else {\n // If the value attribute is not defined then we fall back to the\n // text content of the option element, which may be interpolated\n interpolateTextFn = $interpolate(element.text(), true);\n if (!interpolateTextFn) {\n attr.$set('value', element.text());\n }\n }\n\n return function(scope, element, attr) {\n // This is an optimization over using ^^ since we don't want to have to search\n // all the way to the root of the DOM for every single option element\n var selectCtrlName = '$selectController',\n parent = element.parent(),\n selectCtrl = parent.data(selectCtrlName) ||\n parent.parent().data(selectCtrlName); // in case we are in optgroup\n\n if (selectCtrl) {\n selectCtrl.registerOption(scope, element, attr, interpolateValueFn, interpolateTextFn);\n }\n };\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngRequired\n * @restrict A\n *\n * @description\n *\n * ngRequired adds the required {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for {@link input `input`} and {@link select `select`} controls, but can also be\n * applied to custom controls.\n *\n * The directive sets the `required` attribute on the element if the Angular expression inside\n * `ngRequired` evaluates to true. A special directive for setting `required` is necessary because we\n * cannot use interpolation inside `required`. See the {@link guide/interpolation interpolation guide}\n * for more info.\n *\n * The validator will set the `required` error key to true if the `required` attribute is set and\n * calling {@link ngModel.NgModelController#$isEmpty `NgModelController.$isEmpty`} with the\n * {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`} returns `true`. For example, the\n * `$isEmpty()` implementation for `input[text]` checks the length of the `$viewValue`. When developing\n * custom controls, `$isEmpty()` can be overwritten to account for a $viewValue that is not string-based.\n *\n * @example\n * <example name=\"ngRequiredDirective\" module=\"ngRequiredExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngRequiredExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.required = true;\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"required\">Toggle required: </label>\n * <input type=\"checkbox\" ng-model=\"required\" id=\"required\" />\n * <br>\n * <label for=\"input\">This input must be filled if `required` is true: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-required=\"required\" /><br>\n * <hr>\n * required error set? = <code>{{form.input.$error.required}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var required = element(by.binding('form.input.$error.required'));\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should set the required error', function() {\n expect(required.getText()).toContain('true');\n\n input.sendKeys('123');\n expect(required.getText()).not.toContain('true');\n expect(model.getText()).toContain('123');\n });\n * </file>\n * </example>\n */\nvar requiredDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n attr.required = true; // force truthy in case we are on non input element\n\n ctrl.$validators.required = function(modelValue, viewValue) {\n return !attr.required || !ctrl.$isEmpty(viewValue);\n };\n\n attr.$observe('required', function() {\n ctrl.$validate();\n });\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngPattern\n *\n * @description\n *\n * ngPattern adds the pattern {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.\n *\n * The validator sets the `pattern` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}\n * does not match a RegExp which is obtained by evaluating the Angular expression given in the\n * `ngPattern` attribute value:\n * * If the expression evaluates to a RegExp object, then this is used directly.\n * * If the expression evaluates to a string, then it will be converted to a RegExp after wrapping it\n * in `^` and `$` characters. For instance, `\"abc\"` will be converted to `new RegExp('^abc$')`.\n *\n * <div class=\"alert alert-info\">\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * </div>\n *\n * <div class=\"alert alert-info\">\n * **Note:** This directive is also added when the plain `pattern` attribute is used, with two\n * differences:\n * <ol>\n * <li>\n * `ngPattern` does not set the `pattern` attribute and therefore HTML5 constraint validation is\n * not available.\n * </li>\n * <li>\n * The `ngPattern` attribute must be an expression, while the `pattern` value must be\n * interpolated.\n * </li>\n * </ol>\n * </div>\n *\n * @example\n * <example name=\"ngPatternDirective\" module=\"ngPatternExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngPatternExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.regex = '\\\\d+';\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"regex\">Set a pattern (regex string): </label>\n * <input type=\"text\" ng-model=\"regex\" id=\"regex\" />\n * <br>\n * <label for=\"input\">This input is restricted by the current pattern: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-pattern=\"regex\" /><br>\n * <hr>\n * input valid? = <code>{{form.input.$valid}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should validate the input with the default pattern', function() {\n input.sendKeys('aaa');\n expect(model.getText()).not.toContain('aaa');\n\n input.clear().then(function() {\n input.sendKeys('123');\n expect(model.getText()).toContain('123');\n });\n });\n * </file>\n * </example>\n */\nvar patternDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n\n var regexp, patternExp = attr.ngPattern || attr.pattern;\n attr.$observe('pattern', function(regex) {\n if (isString(regex) && regex.length > 0) {\n regex = new RegExp('^' + regex + '$');\n }\n\n if (regex && !regex.test) {\n throw minErr('ngPattern')('noregexp',\n 'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,\n regex, startingTag(elm));\n }\n\n regexp = regex || undefined;\n ctrl.$validate();\n });\n\n ctrl.$validators.pattern = function(modelValue, viewValue) {\n // HTML5 pattern constraint validates the input value, so we validate the viewValue\n return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);\n };\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngMaxlength\n *\n * @description\n *\n * ngMaxlength adds the maxlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.\n *\n * The validator sets the `maxlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}\n * is longer than the integer obtained by evaluating the Angular expression given in the\n * `ngMaxlength` attribute value.\n *\n * <div class=\"alert alert-info\">\n * **Note:** This directive is also added when the plain `maxlength` attribute is used, with two\n * differences:\n * <ol>\n * <li>\n * `ngMaxlength` does not set the `maxlength` attribute and therefore HTML5 constraint\n * validation is not available.\n * </li>\n * <li>\n * The `ngMaxlength` attribute must be an expression, while the `maxlength` value must be\n * interpolated.\n * </li>\n * </ol>\n * </div>\n *\n * @example\n * <example name=\"ngMaxlengthDirective\" module=\"ngMaxlengthExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngMaxlengthExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.maxlength = 5;\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"maxlength\">Set a maxlength: </label>\n * <input type=\"number\" ng-model=\"maxlength\" id=\"maxlength\" />\n * <br>\n * <label for=\"input\">This input is restricted by the current maxlength: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-maxlength=\"maxlength\" /><br>\n * <hr>\n * input valid? = <code>{{form.input.$valid}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should validate the input with the default maxlength', function() {\n input.sendKeys('abcdef');\n expect(model.getText()).not.toContain('abcdef');\n\n input.clear().then(function() {\n input.sendKeys('abcde');\n expect(model.getText()).toContain('abcde');\n });\n });\n * </file>\n * </example>\n */\nvar maxlengthDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n\n var maxlength = -1;\n attr.$observe('maxlength', function(value) {\n var intVal = toInt(value);\n maxlength = isNumberNaN(intVal) ? -1 : intVal;\n ctrl.$validate();\n });\n ctrl.$validators.maxlength = function(modelValue, viewValue) {\n return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);\n };\n }\n };\n};\n\n/**\n * @ngdoc directive\n * @name ngMinlength\n *\n * @description\n *\n * ngMinlength adds the minlength {@link ngModel.NgModelController#$validators `validator`} to {@link ngModel `ngModel`}.\n * It is most often used for text-based {@link input `input`} controls, but can also be applied to custom text-based controls.\n *\n * The validator sets the `minlength` error key if the {@link ngModel.NgModelController#$viewValue `ngModel.$viewValue`}\n * is shorter than the integer obtained by evaluating the Angular expression given in the\n * `ngMinlength` attribute value.\n *\n * <div class=\"alert alert-info\">\n * **Note:** This directive is also added when the plain `minlength` attribute is used, with two\n * differences:\n * <ol>\n * <li>\n * `ngMinlength` does not set the `minlength` attribute and therefore HTML5 constraint\n * validation is not available.\n * </li>\n * <li>\n * The `ngMinlength` value must be an expression, while the `minlength` value must be\n * interpolated.\n * </li>\n * </ol>\n * </div>\n *\n * @example\n * <example name=\"ngMinlengthDirective\" module=\"ngMinlengthExample\">\n * <file name=\"index.html\">\n * <script>\n * angular.module('ngMinlengthExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.minlength = 3;\n * }]);\n * </script>\n * <div ng-controller=\"ExampleController\">\n * <form name=\"form\">\n * <label for=\"minlength\">Set a minlength: </label>\n * <input type=\"number\" ng-model=\"minlength\" id=\"minlength\" />\n * <br>\n * <label for=\"input\">This input is restricted by the current minlength: </label>\n * <input type=\"text\" ng-model=\"model\" id=\"input\" name=\"input\" ng-minlength=\"minlength\" /><br>\n * <hr>\n * input valid? = <code>{{form.input.$valid}}</code><br>\n * model = <code>{{model}}</code>\n * </form>\n * </div>\n * </file>\n * <file name=\"protractor.js\" type=\"protractor\">\n var model = element(by.binding('model'));\n var input = element(by.id('input'));\n\n it('should validate the input with the default minlength', function() {\n input.sendKeys('ab');\n expect(model.getText()).not.toContain('ab');\n\n input.sendKeys('abc');\n expect(model.getText()).toContain('abc');\n });\n * </file>\n * </example>\n */\nvar minlengthDirective = function() {\n return {\n restrict: 'A',\n require: '?ngModel',\n link: function(scope, elm, attr, ctrl) {\n if (!ctrl) return;\n\n var minlength = 0;\n attr.$observe('minlength', function(value) {\n minlength = toInt(value) || 0;\n ctrl.$validate();\n });\n ctrl.$validators.minlength = function(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;\n };\n }\n };\n};\n\nif (window.angular.bootstrap) {\n // AngularJS is already loaded, so we can return here...\n if (window.console) {\n console.log('WARNING: Tried to load angular more than once.');\n }\n return;\n}\n\n// try to bind to jquery now so that one can write jqLite(fn)\n// but we will rebind on bootstrap again.\nbindJQuery();\n\npublishExternalAPI(angular);\n\nangular.module(\"ngLocale\", [], [\"$provide\", function($provide) {\nvar PLURAL_CATEGORY = {ZERO: \"zero\", ONE: \"one\", TWO: \"two\", FEW: \"few\", MANY: \"many\", OTHER: \"other\"};\nfunction getDecimals(n) {\n n = n + '';\n var i = n.indexOf('.');\n return (i == -1) ? 0 : n.length - i - 1;\n}\n\nfunction getVF(n, opt_precision) {\n var v = opt_precision;\n\n if (undefined === v) {\n v = Math.min(getDecimals(n), 3);\n }\n\n var base = Math.pow(10, v);\n var f = ((n * base) | 0) % base;\n return {v: v, f: f};\n}\n\n$provide.value(\"$locale\", {\n \"DATETIME_FORMATS\": {\n \"AMPMS\": [\n \"AM\",\n \"PM\"\n ],\n \"DAY\": [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n ],\n \"ERANAMES\": [\n \"Before Christ\",\n \"Anno Domini\"\n ],\n \"ERAS\": [\n \"BC\",\n \"AD\"\n ],\n \"FIRSTDAYOFWEEK\": 6,\n \"MONTH\": [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n \"SHORTDAY\": [\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\"\n ],\n \"SHORTMONTH\": [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ],\n \"STANDALONEMONTH\": [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n \"WEEKENDRANGE\": [\n 5,\n 6\n ],\n \"fullDate\": \"EEEE, MMMM d, y\",\n \"longDate\": \"MMMM d, y\",\n \"medium\": \"MMM d, y h:mm:ss a\",\n \"mediumDate\": \"MMM d, y\",\n \"mediumTime\": \"h:mm:ss a\",\n \"short\": \"M/d/yy h:mm a\",\n \"shortDate\": \"M/d/yy\",\n \"shortTime\": \"h:mm a\"\n },\n \"NUMBER_FORMATS\": {\n \"CURRENCY_SYM\": \"$\",\n \"DECIMAL_SEP\": \".\",\n \"GROUP_SEP\": \",\",\n \"PATTERNS\": [\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 3,\n \"minFrac\": 0,\n \"minInt\": 1,\n \"negPre\": \"-\",\n \"negSuf\": \"\",\n \"posPre\": \"\",\n \"posSuf\": \"\"\n },\n {\n \"gSize\": 3,\n \"lgSize\": 3,\n \"maxFrac\": 2,\n \"minFrac\": 2,\n \"minInt\": 1,\n \"negPre\": \"-\\u00a4\",\n \"negSuf\": \"\",\n \"posPre\": \"\\u00a4\",\n \"posSuf\": \"\"\n }\n ]\n },\n \"id\": \"en-us\",\n \"localeID\": \"en_US\",\n \"pluralCat\": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}\n});\n}]);\n\n jqLite(function() {\n angularInit(window.document, bootstrap);\n });\n\n})(window);\n\n!window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type=\"text/css\">@charset \"UTF-8\";[ng\\\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');\n/**\n * @license AngularJS v1.6.6\n * (c) 2010-2017 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/* global shallowCopy: true */\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}\n\n/* global shallowCopy: false */\n\n// `isArray` and `isObject` are necessary for `shallowCopy()` (included via `src/shallowCopy.js`).\n// They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available.\nvar isArray;\nvar isObject;\nvar isDefined;\nvar noop;\n\n/**\n * @ngdoc module\n * @name ngRoute\n * @description\n *\n * # ngRoute\n *\n * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.\n *\n * ## Example\n * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.\n *\n *\n * <div doc-module-components=\"ngRoute\"></div>\n */\n/* global -ngRouteModule */\nvar ngRouteModule = angular.\n module('ngRoute', []).\n info({ angularVersion: '1.6.6' }).\n provider('$route', $RouteProvider).\n // Ensure `$route` will be instantiated in time to capture the initial `$locationChangeSuccess`\n // event (unless explicitly disabled). This is necessary in case `ngView` is included in an\n // asynchronously loaded template.\n run(instantiateRoute);\nvar $routeMinErr = angular.$$minErr('ngRoute');\nvar isEagerInstantiationEnabled;\n\n\n/**\n * @ngdoc provider\n * @name $routeProvider\n * @this\n *\n * @description\n *\n * Used for configuring routes.\n *\n * ## Example\n * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.\n *\n * ## Dependencies\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n */\nfunction $RouteProvider() {\n isArray = angular.isArray;\n isObject = angular.isObject;\n isDefined = angular.isDefined;\n noop = angular.noop;\n\n function inherit(parent, extra) {\n return angular.extend(Object.create(parent), extra);\n }\n\n var routes = {};\n\n /**\n * @ngdoc method\n * @name $routeProvider#when\n *\n * @param {string} path Route path (matched against `$location.path`). If `$location.path`\n * contains redundant trailing slash or is missing one, the route will still match and the\n * `$location.path` will be updated to add or drop the trailing slash to exactly match the\n * route definition.\n *\n * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up\n * to the next slash are matched and stored in `$routeParams` under the given `name`\n * when the route matches.\n * * `path` can contain named groups starting with a colon and ending with a star:\n * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`\n * when the route matches.\n * * `path` can contain optional named groups with a question mark: e.g.`:name?`.\n *\n * For example, routes like `/color/:color/largecode/:largecode*\\/edit` will match\n * `/color/brown/largecode/code/with/slashes/edit` and extract:\n *\n * * `color: brown`\n * * `largecode: code/with/slashes`.\n *\n *\n * @param {Object} route Mapping information to be assigned to `$route.current` on route\n * match.\n *\n * Object properties:\n *\n * - `controller` – `{(string|Function)=}` – Controller fn that should be associated with\n * newly created scope or the name of a {@link angular.Module#controller registered\n * controller} if passed as a string.\n * - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * - `template` – `{(string|Function)=}` – html template as a string or a function that\n * returns an html template as a string which should be used by {@link\n * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.\n * This property takes precedence over `templateUrl`.\n *\n * If `template` is a function, it will be called with the following parameters:\n *\n * - `{Array.<Object>}` - route parameters extracted from the current\n * `$location.path()` by applying the current route\n *\n * One of `template` or `templateUrl` is required.\n *\n * - `templateUrl` – `{(string|Function)=}` – path or function that returns a path to an html\n * template that should be used by {@link ngRoute.directive:ngView ngView}.\n *\n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - `{Array.<Object>}` - route parameters extracted from the current\n * `$location.path()` by applying the current route\n *\n * One of `templateUrl` or `template` is required.\n *\n * - `resolve` - `{Object.<string, Function>=}` - An optional map of dependencies which should\n * be injected into the controller. If any of these dependencies are promises, the router\n * will wait for them all to be resolved or one to be rejected before the controller is\n * instantiated.\n * If all the promises are resolved successfully, the values of the resolved promises are\n * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is\n * fired. If any of the promises are rejected the\n * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired.\n * For easier access to the resolved dependencies from the template, the `resolve` map will\n * be available on the scope of the route, under `$resolve` (by default) or a custom name\n * specified by the `resolveAs` property (see below). This can be particularly useful, when\n * working with {@link angular.Module#component components} as route templates.<br />\n * <div class=\"alert alert-warning\">\n * **Note:** If your scope already contains a property with this name, it will be hidden\n * or overwritten. Make sure, you specify an appropriate name for this property, that\n * does not collide with other properties on the scope.\n * </div>\n * The map object is:\n *\n * - `key` – `{string}`: a name of a dependency to be injected into the controller.\n * - `factory` - `{string|Function}`: If `string` then it is an alias for a service.\n * Otherwise if function, then it is {@link auto.$injector#invoke injected}\n * and the return value is treated as the dependency. If the result is a promise, it is\n * resolved before its value is injected into the controller. Be aware that\n * `ngRoute.$routeParams` will still refer to the previous route within these resolve\n * functions. Use `$route.current.params` to access the new route parameters, instead.\n *\n * - `resolveAs` - `{string=}` - The name under which the `resolve` map will be available on\n * the scope of the route. If omitted, defaults to `$resolve`.\n *\n * - `redirectTo` – `{(string|Function)=}` – value to update\n * {@link ng.$location $location} path with and trigger route redirection.\n *\n * If `redirectTo` is a function, it will be called with the following parameters:\n *\n * - `{Object.<string>}` - route parameters extracted from the current\n * `$location.path()` by applying the current route templateUrl.\n * - `{string}` - current `$location.path()`\n * - `{Object}` - current `$location.search()`\n *\n * The custom `redirectTo` function is expected to return a string which will be used\n * to update `$location.url()`. If the function throws an error, no further processing will\n * take place and the {@link ngRoute.$route#$routeChangeError $routeChangeError} event will\n * be fired.\n *\n * Routes that specify `redirectTo` will not have their controllers, template functions\n * or resolves called, the `$location` will be changed to the redirect url and route\n * processing will stop. The exception to this is if the `redirectTo` is a function that\n * returns `undefined`. In this case the route transition occurs as though there was no\n * redirection.\n *\n * - `resolveRedirectTo` – `{Function=}` – a function that will (eventually) return the value\n * to update {@link ng.$location $location} URL with and trigger route redirection. In\n * contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the\n * return value can be either a string or a promise that will be resolved to a string.\n *\n * Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets\n * resolved to `undefined`), no redirection takes place and the route transition occurs as\n * though there was no redirection.\n *\n * If the function throws an error or the returned promise gets rejected, no further\n * processing will take place and the\n * {@link ngRoute.$route#$routeChangeError $routeChangeError} event will be fired.\n *\n * `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same\n * route definition, will cause the latter to be ignored.\n *\n * - `[reloadOnSearch=true]` - `{boolean=}` - reload route when only `$location.search()`\n * or `$location.hash()` changes.\n *\n * If the option is set to `false` and url in the browser changes, then\n * `$routeUpdate` event is broadcasted on the root scope.\n *\n * - `[caseInsensitiveMatch=false]` - `{boolean=}` - match routes without being case sensitive\n *\n * If the option is set to `true`, then the particular route can be matched without being\n * case sensitive\n *\n * @returns {Object} self\n *\n * @description\n * Adds a new route definition to the `$route` service.\n */\n this.when = function(path, route) {\n //copy original route object to preserve params inherited from proto chain\n var routeCopy = shallowCopy(route);\n if (angular.isUndefined(routeCopy.reloadOnSearch)) {\n routeCopy.reloadOnSearch = true;\n }\n if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {\n routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;\n }\n routes[path] = angular.extend(\n routeCopy,\n path && pathRegExp(path, routeCopy)\n );\n\n // create redirection for trailing slashes\n if (path) {\n var redirectPath = (path[path.length - 1] === '/')\n ? path.substr(0, path.length - 1)\n : path + '/';\n\n routes[redirectPath] = angular.extend(\n {redirectTo: path},\n pathRegExp(redirectPath, routeCopy)\n );\n }\n\n return this;\n };\n\n /**\n * @ngdoc property\n * @name $routeProvider#caseInsensitiveMatch\n * @description\n *\n * A boolean property indicating if routes defined\n * using this provider should be matched using a case insensitive\n * algorithm. Defaults to `false`.\n */\n this.caseInsensitiveMatch = false;\n\n /**\n * @param path {string} path\n * @param opts {Object} options\n * @return {?Object}\n *\n * @description\n * Normalizes the given path, returning a regular expression\n * and the original path.\n *\n * Inspired by pathRexp in visionmedia/express/lib/utils.js.\n */\n function pathRegExp(path, opts) {\n var insensitive = opts.caseInsensitiveMatch,\n ret = {\n originalPath: path,\n regexp: path\n },\n keys = ret.keys = [];\n\n path = path\n .replace(/([().])/g, '\\\\$1')\n .replace(/(\\/)?:(\\w+)(\\*\\?|[?*])?/g, function(_, slash, key, option) {\n var optional = (option === '?' || option === '*?') ? '?' : null;\n var star = (option === '*' || option === '*?') ? '*' : null;\n keys.push({ name: key, optional: !!optional });\n slash = slash || '';\n return ''\n + (optional ? '' : slash)\n + '(?:'\n + (optional ? slash : '')\n + (star && '(.+?)' || '([^/]+)')\n + (optional || '')\n + ')'\n + (optional || '');\n })\n .replace(/([/$*])/g, '\\\\$1');\n\n ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');\n return ret;\n }\n\n /**\n * @ngdoc method\n * @name $routeProvider#otherwise\n *\n * @description\n * Sets route definition that will be used on route change when no other route definition\n * is matched.\n *\n * @param {Object|string} params Mapping information to be assigned to `$route.current`.\n * If called with a string, the value maps to `redirectTo`.\n * @returns {Object} self\n */\n this.otherwise = function(params) {\n if (typeof params === 'string') {\n params = {redirectTo: params};\n }\n this.when(null, params);\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $routeProvider#eagerInstantiationEnabled\n * @kind function\n *\n * @description\n * Call this method as a setter to enable/disable eager instantiation of the\n * {@link ngRoute.$route $route} service upon application bootstrap. You can also call it as a\n * getter (i.e. without any arguments) to get the current value of the\n * `eagerInstantiationEnabled` flag.\n *\n * Instantiating `$route` early is necessary for capturing the initial\n * {@link ng.$location#$locationChangeStart $locationChangeStart} event and navigating to the\n * appropriate route. Usually, `$route` is instantiated in time by the\n * {@link ngRoute.ngView ngView} directive. Yet, in cases where `ngView` is included in an\n * asynchronously loaded template (e.g. in another directive's template), the directive factory\n * might not be called soon enough for `$route` to be instantiated _before_ the initial\n * `$locationChangeSuccess` event is fired. Eager instantiation ensures that `$route` is always\n * instantiated in time, regardless of when `ngView` will be loaded.\n *\n * The default value is true.\n *\n * **Note**:<br />\n * You may want to disable the default behavior when unit-testing modules that depend on\n * `ngRoute`, in order to avoid an unexpected request for the default route's template.\n *\n * @param {boolean=} enabled - If provided, update the internal `eagerInstantiationEnabled` flag.\n *\n * @returns {*} The current value of the `eagerInstantiationEnabled` flag if used as a getter or\n * itself (for chaining) if used as a setter.\n */\n isEagerInstantiationEnabled = true;\n this.eagerInstantiationEnabled = function eagerInstantiationEnabled(enabled) {\n if (isDefined(enabled)) {\n isEagerInstantiationEnabled = enabled;\n return this;\n }\n\n return isEagerInstantiationEnabled;\n };\n\n\n this.$get = ['$rootScope',\n '$location',\n '$routeParams',\n '$q',\n '$injector',\n '$templateRequest',\n '$sce',\n '$browser',\n function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {\n\n /**\n * @ngdoc service\n * @name $route\n * @requires $location\n * @requires $routeParams\n *\n * @property {Object} current Reference to the current route definition.\n * The route definition contains:\n *\n * - `controller`: The controller constructor as defined in the route definition.\n * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for\n * controller instantiation. The `locals` contain\n * the resolved values of the `resolve` map. Additionally the `locals` also contain:\n *\n * - `$scope` - The current route scope.\n * - `$template` - The current route template HTML.\n *\n * The `locals` will be assigned to the route scope's `$resolve` property. You can override\n * the property name, using `resolveAs` in the route definition. See\n * {@link ngRoute.$routeProvider $routeProvider} for more info.\n *\n * @property {Object} routes Object with all route configuration Objects as its properties.\n *\n * @description\n * `$route` is used for deep-linking URLs to controllers and views (HTML partials).\n * It watches `$location.url()` and tries to map the path to an existing route definition.\n *\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n *\n * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.\n *\n * The `$route` service is typically used in conjunction with the\n * {@link ngRoute.directive:ngView `ngView`} directive and the\n * {@link ngRoute.$routeParams `$routeParams`} service.\n *\n * @example\n * This example shows how changing the URL hash causes the `$route` to match a route against the\n * URL, and the `ngView` pulls in the partial.\n *\n * <example name=\"$route-service\" module=\"ngRouteExample\"\n * deps=\"angular-route.js\" fixBase=\"true\">\n * <file name=\"index.html\">\n * <div ng-controller=\"MainController\">\n * Choose:\n * <a href=\"Book/Moby\">Moby</a> |\n * <a href=\"Book/Moby/ch/1\">Moby: Ch1</a> |\n * <a href=\"Book/Gatsby\">Gatsby</a> |\n * <a href=\"Book/Gatsby/ch/4?key=value\">Gatsby: Ch4</a> |\n * <a href=\"Book/Scarlet\">Scarlet Letter</a><br/>\n *\n * <div ng-view></div>\n *\n * <hr />\n *\n * <pre>$location.path() = {{$location.path()}}</pre>\n * <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>\n * <pre>$route.current.params = {{$route.current.params}}</pre>\n * <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>\n * <pre>$routeParams = {{$routeParams}}</pre>\n * </div>\n * </file>\n *\n * <file name=\"book.html\">\n * controller: {{name}}<br />\n * Book Id: {{params.bookId}}<br />\n * </file>\n *\n * <file name=\"chapter.html\">\n * controller: {{name}}<br />\n * Book Id: {{params.bookId}}<br />\n * Chapter Id: {{params.chapterId}}\n * </file>\n *\n * <file name=\"script.js\">\n * angular.module('ngRouteExample', ['ngRoute'])\n *\n * .controller('MainController', function($scope, $route, $routeParams, $location) {\n * $scope.$route = $route;\n * $scope.$location = $location;\n * $scope.$routeParams = $routeParams;\n * })\n *\n * .controller('BookController', function($scope, $routeParams) {\n * $scope.name = 'BookController';\n * $scope.params = $routeParams;\n * })\n *\n * .controller('ChapterController', function($scope, $routeParams) {\n * $scope.name = 'ChapterController';\n * $scope.params = $routeParams;\n * })\n *\n * .config(function($routeProvider, $locationProvider) {\n * $routeProvider\n * .when('/Book/:bookId', {\n * templateUrl: 'book.html',\n * controller: 'BookController',\n * resolve: {\n * // I will cause a 1 second delay\n * delay: function($q, $timeout) {\n * var delay = $q.defer();\n * $timeout(delay.resolve, 1000);\n * return delay.promise;\n * }\n * }\n * })\n * .when('/Book/:bookId/ch/:chapterId', {\n * templateUrl: 'chapter.html',\n * controller: 'ChapterController'\n * });\n *\n * // configure html5 to get links working on jsfiddle\n * $locationProvider.html5Mode(true);\n * });\n *\n * </file>\n *\n * <file name=\"protractor.js\" type=\"protractor\">\n * it('should load and compile correct template', function() {\n * element(by.linkText('Moby: Ch1')).click();\n * var content = element(by.css('[ng-view]')).getText();\n * expect(content).toMatch(/controller: ChapterController/);\n * expect(content).toMatch(/Book Id: Moby/);\n * expect(content).toMatch(/Chapter Id: 1/);\n *\n * element(by.partialLinkText('Scarlet')).click();\n *\n * content = element(by.css('[ng-view]')).getText();\n * expect(content).toMatch(/controller: BookController/);\n * expect(content).toMatch(/Book Id: Scarlet/);\n * });\n * </file>\n * </example>\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a route change. At this point the route services starts\n * resolving all of the dependencies needed for the route change to occur.\n * Typically this involves fetching the view template as well as any dependencies\n * defined in `resolve` route property. Once all of the dependencies are resolved\n * `$routeChangeSuccess` is fired.\n *\n * The route change (and the `$location` change that triggered it) can be prevented\n * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}\n * for more details about event object.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {Route} next Future route information.\n * @param {Route} current Current route information.\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a route change has happened successfully.\n * The `resolve` dependencies are now available in the `current.locals` property.\n *\n * {@link ngRoute.directive:ngView ngView} listens for the directive\n * to instantiate the controller and render the view.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {Route} current Current route information.\n * @param {Route|Undefined} previous Previous route information, or undefined if current is\n * first route entered.\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeChangeError\n * @eventType broadcast on root scope\n * @description\n * Broadcasted if a redirection function fails or any redirection or resolve promises are\n * rejected.\n *\n * @param {Object} angularEvent Synthetic event object\n * @param {Route} current Current route information.\n * @param {Route} previous Previous route information.\n * @param {Route} rejection The thrown error or the rejection reason of the promise. Usually\n * the rejection reason is the error that caused the promise to get rejected.\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeUpdate\n * @eventType broadcast on root scope\n * @description\n * The `reloadOnSearch` property has been set to false, and we are reusing the same\n * instance of the Controller.\n *\n * @param {Object} angularEvent Synthetic event object\n * @param {Route} current Current/previous route information.\n */\n\n var forceReload = false,\n preparedRoute,\n preparedRouteIsUpdateOnly,\n $route = {\n routes: routes,\n\n /**\n * @ngdoc method\n * @name $route#reload\n *\n * @description\n * Causes `$route` service to reload the current route even if\n * {@link ng.$location $location} hasn't changed.\n *\n * As a result of that, {@link ngRoute.directive:ngView ngView}\n * creates new scope and reinstantiates the controller.\n */\n reload: function() {\n forceReload = true;\n\n var fakeLocationEvent = {\n defaultPrevented: false,\n preventDefault: function fakePreventDefault() {\n this.defaultPrevented = true;\n forceReload = false;\n }\n };\n\n $rootScope.$evalAsync(function() {\n prepareRoute(fakeLocationEvent);\n if (!fakeLocationEvent.defaultPrevented) commitRoute();\n });\n },\n\n /**\n * @ngdoc method\n * @name $route#updateParams\n *\n * @description\n * Causes `$route` service to update the current URL, replacing\n * current route parameters with those specified in `newParams`.\n * Provided property names that match the route's path segment\n * definitions will be interpolated into the location's path, while\n * remaining properties will be treated as query params.\n *\n * @param {!Object<string, string>} newParams mapping of URL parameter names to values\n */\n updateParams: function(newParams) {\n if (this.current && this.current.$$route) {\n newParams = angular.extend({}, this.current.params, newParams);\n $location.path(interpolate(this.current.$$route.originalPath, newParams));\n // interpolate modifies newParams, only query params are left\n $location.search(newParams);\n } else {\n throw $routeMinErr('norout', 'Tried updating route when with no current route');\n }\n }\n };\n\n $rootScope.$on('$locationChangeStart', prepareRoute);\n $rootScope.$on('$locationChangeSuccess', commitRoute);\n\n return $route;\n\n /////////////////////////////////////////////////////\n\n /**\n * @param on {string} current url\n * @param route {Object} route regexp to match the url against\n * @return {?Object}\n *\n * @description\n * Check if the route matches the current url.\n *\n * Inspired by match in\n * visionmedia/express/lib/router/router.js.\n */\n function switchRouteMatcher(on, route) {\n var keys = route.keys,\n params = {};\n\n if (!route.regexp) return null;\n\n var m = route.regexp.exec(on);\n if (!m) return null;\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = keys[i - 1];\n\n var val = m[i];\n\n if (key && val) {\n params[key.name] = val;\n }\n }\n return params;\n }\n\n function prepareRoute($locationEvent) {\n var lastRoute = $route.current;\n\n preparedRoute = parseRoute();\n preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route\n && angular.equals(preparedRoute.pathParams, lastRoute.pathParams)\n && !preparedRoute.reloadOnSearch && !forceReload;\n\n if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {\n if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {\n if ($locationEvent) {\n $locationEvent.preventDefault();\n }\n }\n }\n }\n\n function commitRoute() {\n var lastRoute = $route.current;\n var nextRoute = preparedRoute;\n\n if (preparedRouteIsUpdateOnly) {\n lastRoute.params = nextRoute.params;\n angular.copy(lastRoute.params, $routeParams);\n $rootScope.$broadcast('$routeUpdate', lastRoute);\n } else if (nextRoute || lastRoute) {\n forceReload = false;\n $route.current = nextRoute;\n\n var nextRoutePromise = $q.resolve(nextRoute);\n\n $browser.$$incOutstandingRequestCount();\n\n nextRoutePromise.\n then(getRedirectionData).\n then(handlePossibleRedirection).\n then(function(keepProcessingRoute) {\n return keepProcessingRoute && nextRoutePromise.\n then(resolveLocals).\n then(function(locals) {\n // after route change\n if (nextRoute === $route.current) {\n if (nextRoute) {\n nextRoute.locals = locals;\n angular.copy(nextRoute.params, $routeParams);\n }\n $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);\n }\n });\n }).catch(function(error) {\n if (nextRoute === $route.current) {\n $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);\n }\n }).finally(function() {\n // Because `commitRoute()` is called from a `$rootScope.$evalAsync` block (see\n // `$locationWatch`), this `$$completeOutstandingRequest()` call will not cause\n // `outstandingRequestCount` to hit zero. This is important in case we are redirecting\n // to a new route which also requires some asynchronous work.\n\n $browser.$$completeOutstandingRequest(noop);\n });\n }\n }\n\n function getRedirectionData(route) {\n var data = {\n route: route,\n hasRedirection: false\n };\n\n if (route) {\n if (route.redirectTo) {\n if (angular.isString(route.redirectTo)) {\n data.path = interpolate(route.redirectTo, route.params);\n data.search = route.params;\n data.hasRedirection = true;\n } else {\n var oldPath = $location.path();\n var oldSearch = $location.search();\n var newUrl = route.redirectTo(route.pathParams, oldPath, oldSearch);\n\n if (angular.isDefined(newUrl)) {\n data.url = newUrl;\n data.hasRedirection = true;\n }\n }\n } else if (route.resolveRedirectTo) {\n return $q.\n resolve($injector.invoke(route.resolveRedirectTo)).\n then(function(newUrl) {\n if (angular.isDefined(newUrl)) {\n data.url = newUrl;\n data.hasRedirection = true;\n }\n\n return data;\n });\n }\n }\n\n return data;\n }\n\n function handlePossibleRedirection(data) {\n var keepProcessingRoute = true;\n\n if (data.route !== $route.current) {\n keepProcessingRoute = false;\n } else if (data.hasRedirection) {\n var oldUrl = $location.url();\n var newUrl = data.url;\n\n if (newUrl) {\n $location.\n url(newUrl).\n replace();\n } else {\n newUrl = $location.\n path(data.path).\n search(data.search).\n replace().\n url();\n }\n\n if (newUrl !== oldUrl) {\n // Exit out and don't process current next value,\n // wait for next location change from redirect\n keepProcessingRoute = false;\n }\n }\n\n return keepProcessingRoute;\n }\n\n function resolveLocals(route) {\n if (route) {\n var locals = angular.extend({}, route.resolve);\n angular.forEach(locals, function(value, key) {\n locals[key] = angular.isString(value) ?\n $injector.get(value) :\n $injector.invoke(value, null, null, key);\n });\n var template = getTemplateFor(route);\n if (angular.isDefined(template)) {\n locals['$template'] = template;\n }\n return $q.all(locals);\n }\n }\n\n function getTemplateFor(route) {\n var template, templateUrl;\n if (angular.isDefined(template = route.template)) {\n if (angular.isFunction(template)) {\n template = template(route.params);\n }\n } else if (angular.isDefined(templateUrl = route.templateUrl)) {\n if (angular.isFunction(templateUrl)) {\n templateUrl = templateUrl(route.params);\n }\n if (angular.isDefined(templateUrl)) {\n route.loadedTemplateUrl = $sce.valueOf(templateUrl);\n template = $templateRequest(templateUrl);\n }\n }\n return template;\n }\n\n /**\n * @returns {Object} the current active route, by matching it against the URL\n */\n function parseRoute() {\n // Match a route\n var params, match;\n angular.forEach(routes, function(route, path) {\n if (!match && (params = switchRouteMatcher($location.path(), route))) {\n match = inherit(route, {\n params: angular.extend({}, $location.search(), params),\n pathParams: params});\n match.$$route = route;\n }\n });\n // No route matched; fallback to \"otherwise\" route\n return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});\n }\n\n /**\n * @returns {string} interpolation of the redirect path with the parameters\n */\n function interpolate(string, params) {\n var result = [];\n angular.forEach((string || '').split(':'), function(segment, i) {\n if (i === 0) {\n result.push(segment);\n } else {\n var segmentMatch = segment.match(/(\\w+)(?:[?*])?(.*)/);\n var key = segmentMatch[1];\n result.push(params[key]);\n result.push(segmentMatch[2] || '');\n delete params[key];\n }\n });\n return result.join('');\n }\n }];\n}\n\ninstantiateRoute.$inject = ['$injector'];\nfunction instantiateRoute($injector) {\n if (isEagerInstantiationEnabled) {\n // Instantiate `$route`\n $injector.get('$route');\n }\n}\n\nngRouteModule.provider('$routeParams', $RouteParamsProvider);\n\n\n/**\n * @ngdoc service\n * @name $routeParams\n * @requires $route\n * @this\n *\n * @description\n * The `$routeParams` service allows you to retrieve the current set of route parameters.\n *\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n *\n * The route parameters are a combination of {@link ng.$location `$location`}'s\n * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.\n * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.\n *\n * In case of parameter name collision, `path` params take precedence over `search` params.\n *\n * The service guarantees that the identity of the `$routeParams` object will remain unchanged\n * (but its properties will likely change) even when a route change occurs.\n *\n * Note that the `$routeParams` are only updated *after* a route change completes successfully.\n * This means that you cannot rely on `$routeParams` being correct in route resolve functions.\n * Instead you can use `$route.current.params` to access the new route's parameters.\n *\n * @example\n * ```js\n * // Given:\n * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby\n * // Route: /Chapter/:chapterId/Section/:sectionId\n * //\n * // Then\n * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}\n * ```\n */\nfunction $RouteParamsProvider() {\n this.$get = function() { return {}; };\n}\n\nngRouteModule.directive('ngView', ngViewFactory);\nngRouteModule.directive('ngView', ngViewFillContentFactory);\n\n\n/**\n * @ngdoc directive\n * @name ngView\n * @restrict ECA\n *\n * @description\n * # Overview\n * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by\n * including the rendered template of the current route into the main layout (`index.html`) file.\n * Every time the current route changes, the included view changes with it according to the\n * configuration of the `$route` service.\n *\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |\n * | {@link ng.$animate#leave leave} | when the old element is removed from to the DOM |\n *\n * The enter and leave animation occur concurrently.\n *\n * @scope\n * @priority 400\n * @param {string=} onload Expression to evaluate whenever the view updates.\n *\n * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll\n * $anchorScroll} to scroll the viewport after the view is updated.\n *\n * - If the attribute is not set, disable scrolling.\n * - If the attribute is set without value, enable scrolling.\n * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated\n * as an expression yields a truthy value.\n * @example\n <example name=\"ngView-directive\" module=\"ngViewExample\"\n deps=\"angular-route.js;angular-animate.js\"\n animations=\"true\" fixBase=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"MainCtrl as main\">\n Choose:\n <a href=\"Book/Moby\">Moby</a> |\n <a href=\"Book/Moby/ch/1\">Moby: Ch1</a> |\n <a href=\"Book/Gatsby\">Gatsby</a> |\n <a href=\"Book/Gatsby/ch/4?key=value\">Gatsby: Ch4</a> |\n <a href=\"Book/Scarlet\">Scarlet Letter</a><br/>\n\n <div class=\"view-animate-container\">\n <div ng-view class=\"view-animate\"></div>\n </div>\n <hr />\n\n <pre>$location.path() = {{main.$location.path()}}</pre>\n <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>\n <pre>$route.current.params = {{main.$route.current.params}}</pre>\n <pre>$routeParams = {{main.$routeParams}}</pre>\n </div>\n </file>\n\n <file name=\"book.html\">\n <div>\n controller: {{book.name}}<br />\n Book Id: {{book.params.bookId}}<br />\n </div>\n </file>\n\n <file name=\"chapter.html\">\n <div>\n controller: {{chapter.name}}<br />\n Book Id: {{chapter.params.bookId}}<br />\n Chapter Id: {{chapter.params.chapterId}}\n </div>\n </file>\n\n <file name=\"animations.css\">\n .view-animate-container {\n position:relative;\n height:100px!important;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .view-animate {\n padding:10px;\n }\n\n .view-animate.ng-enter, .view-animate.ng-leave {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;\n\n display:block;\n width:100%;\n border-left:1px solid black;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n padding:10px;\n }\n\n .view-animate.ng-enter {\n left:100%;\n }\n .view-animate.ng-enter.ng-enter-active {\n left:0;\n }\n .view-animate.ng-leave.ng-leave-active {\n left:-100%;\n }\n </file>\n\n <file name=\"script.js\">\n angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])\n .config(['$routeProvider', '$locationProvider',\n function($routeProvider, $locationProvider) {\n $routeProvider\n .when('/Book/:bookId', {\n templateUrl: 'book.html',\n controller: 'BookCtrl',\n controllerAs: 'book'\n })\n .when('/Book/:bookId/ch/:chapterId', {\n templateUrl: 'chapter.html',\n controller: 'ChapterCtrl',\n controllerAs: 'chapter'\n });\n\n $locationProvider.html5Mode(true);\n }])\n .controller('MainCtrl', ['$route', '$routeParams', '$location',\n function MainCtrl($route, $routeParams, $location) {\n this.$route = $route;\n this.$location = $location;\n this.$routeParams = $routeParams;\n }])\n .controller('BookCtrl', ['$routeParams', function BookCtrl($routeParams) {\n this.name = 'BookCtrl';\n this.params = $routeParams;\n }])\n .controller('ChapterCtrl', ['$routeParams', function ChapterCtrl($routeParams) {\n this.name = 'ChapterCtrl';\n this.params = $routeParams;\n }]);\n\n </file>\n\n <file name=\"protractor.js\" type=\"protractor\">\n it('should load and compile correct template', function() {\n element(by.linkText('Moby: Ch1')).click();\n var content = element(by.css('[ng-view]')).getText();\n expect(content).toMatch(/controller: ChapterCtrl/);\n expect(content).toMatch(/Book Id: Moby/);\n expect(content).toMatch(/Chapter Id: 1/);\n\n element(by.partialLinkText('Scarlet')).click();\n\n content = element(by.css('[ng-view]')).getText();\n expect(content).toMatch(/controller: BookCtrl/);\n expect(content).toMatch(/Book Id: Scarlet/);\n });\n </file>\n </example>\n */\n\n\n/**\n * @ngdoc event\n * @name ngView#$viewContentLoaded\n * @eventType emit on the current ngView scope\n * @description\n * Emitted every time the ngView content is reloaded.\n */\nngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];\nfunction ngViewFactory($route, $anchorScroll, $animate) {\n return {\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n link: function(scope, $element, attr, ctrl, $transclude) {\n var currentScope,\n currentElement,\n previousLeaveAnimation,\n autoScrollExp = attr.autoscroll,\n onloadExp = attr.onload || '';\n\n scope.$on('$routeChangeSuccess', update);\n update();\n\n function cleanupLastView() {\n if (previousLeaveAnimation) {\n $animate.cancel(previousLeaveAnimation);\n previousLeaveAnimation = null;\n }\n\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentElement) {\n previousLeaveAnimation = $animate.leave(currentElement);\n previousLeaveAnimation.done(function(response) {\n if (response !== false) previousLeaveAnimation = null;\n });\n currentElement = null;\n }\n }\n\n function update() {\n var locals = $route.current && $route.current.locals,\n template = locals && locals.$template;\n\n if (angular.isDefined(template)) {\n var newScope = scope.$new();\n var current = $route.current;\n\n // Note: This will also link all children of ng-view that were contained in the original\n // html. If that content contains controllers, ... they could pollute/change the scope.\n // However, using ng-view on an element with additional content does not make sense...\n // Note: We can't remove them in the cloneAttchFn of $transclude as that\n // function is called before linking the content, which would apply child\n // directives to non existing elements.\n var clone = $transclude(newScope, function(clone) {\n $animate.enter(clone, null, currentElement || $element).done(function onNgViewEnter(response) {\n if (response !== false && angular.isDefined(autoScrollExp)\n && (!autoScrollExp || scope.$eval(autoScrollExp))) {\n $anchorScroll();\n }\n });\n cleanupLastView();\n });\n\n currentElement = clone;\n currentScope = current.scope = newScope;\n currentScope.$emit('$viewContentLoaded');\n currentScope.$eval(onloadExp);\n } else {\n cleanupLastView();\n }\n }\n }\n };\n}\n\n// This directive is called during the $transclude call of the first `ngView` directive.\n// It will replace and compile the content of the element with the loaded template.\n// We need this directive so that the element content is already filled when\n// the link function of another directive on the same element as ngView\n// is called.\nngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];\nfunction ngViewFillContentFactory($compile, $controller, $route) {\n return {\n restrict: 'ECA',\n priority: -400,\n link: function(scope, $element) {\n var current = $route.current,\n locals = current.locals;\n\n $element.html(locals.$template);\n\n var link = $compile($element.contents());\n\n if (current.controller) {\n locals.$scope = scope;\n var controller = $controller(current.controller, locals);\n if (current.controllerAs) {\n scope[current.controllerAs] = controller;\n }\n $element.data('$ngControllerController', controller);\n $element.children().data('$ngControllerController', controller);\n }\n scope[current.resolveAs || '$resolve'] = locals;\n\n link(scope);\n }\n };\n}\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.6.6\n * (c) 2010-2017 Google, Inc. http://angularjs.org\n * License: MIT\n */\n\n(function() {'use strict';\n // NOTE:\n // These functions are copied here from `src/Angular.js`, because they are needed inside the\n // `angular-loader.js` closure and need to be available before the main `angular.js` script has\n // been loaded.\n function isFunction(value) {return typeof value === 'function';}\n function isDefined(value) {return typeof value !== 'undefined';}\n function isNumber(value) {return typeof value === 'number';}\n function isObject(value) {return value !== null && typeof value === 'object';}\n function isScope(obj) {return obj && obj.$evalAsync && obj.$watch;}\n function isUndefined(value) {return typeof value === 'undefined';}\n function isWindow(obj) {return obj && obj.window === obj;}\n function sliceArgs(args, startIndex) {return Array.prototype.slice.call(args, startIndex || 0);}\n function toJsonReplacer(key, value) {\n var val = value;\n\n if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n val = undefined;\n } else if (isWindow(value)) {\n val = '$WINDOW';\n } else if (value && window.document === value) {\n val = '$DOCUMENT';\n } else if (isScope(value)) {\n val = '$SCOPE';\n }\n\n return val;\n }\n\n/* exported toDebugString */\n\nfunction serializeObject(obj, maxDepth) {\n var seen = [];\n\n // There is no direct way to stringify object until reaching a specific depth\n // and a very deep object can cause a performance issue, so we copy the object\n // based on this specific depth and then stringify it.\n if (isValidObjectMaxDepth(maxDepth)) {\n // This file is also included in `angular-loader`, so `copy()` might not always be available in\n // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.\n obj = angular.copy(obj, null, maxDepth);\n }\n return JSON.stringify(obj, function(key, val) {\n val = toJsonReplacer(key, val);\n if (isObject(val)) {\n\n if (seen.indexOf(val) >= 0) return '...';\n\n seen.push(val);\n }\n return val;\n });\n}\n\nfunction toDebugString(obj, maxDepth) {\n if (typeof obj === 'function') {\n return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n } else if (isUndefined(obj)) {\n return 'undefined';\n } else if (typeof obj !== 'string') {\n return serializeObject(obj, maxDepth);\n }\n return obj;\n}\n\n/* exported\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth\n*/\n\nvar minErrConfig = {\n objectMaxDepth: 5\n};\n\n/**\n * @ngdoc function\n * @name angular.errorHandlingConfig\n * @module ng\n * @kind function\n *\n * @description\n * Configure several aspects of error handling in AngularJS if used as a setter or return the\n * current configuration if used as a getter. The following options are supported:\n *\n * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.\n *\n * Omitted or undefined options will leave the corresponding configuration values unchanged.\n *\n * @param {Object=} config - The configuration object. May only contain the options that need to be\n * updated. Supported keys:\n *\n * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a\n * non-positive or non-numeric value, removes the max depth limit.\n * Default: 5\n */\nfunction errorHandlingConfig(config) {\n if (isObject(config)) {\n if (isDefined(config.objectMaxDepth)) {\n minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;\n }\n } else {\n return minErrConfig;\n }\n}\n\n/**\n * @private\n * @param {Number} maxDepth\n * @return {boolean}\n */\nfunction isValidObjectMaxDepth(maxDepth) {\n return isNumber(maxDepth) && maxDepth > 0;\n}\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n ErrorConstructor = ErrorConstructor || Error;\n return function() {\n var code = arguments[0],\n template = arguments[1],\n message = '[' + (module ? module + ':' : '') + code + '] ',\n templateArgs = sliceArgs(arguments, 2).map(function(arg) {\n return toDebugString(arg, minErrConfig.objectMaxDepth);\n }),\n paramPrefix, i;\n\n message += template.replace(/\\{\\d+\\}/g, function(match) {\n var index = +match.slice(1, -1);\n\n if (index < templateArgs.length) {\n return templateArgs[index];\n }\n\n return match;\n });\n\n message += '\\nhttp://errors.angularjs.org/1.6.6/' +\n (module ? module + '/' : '') + code;\n\n for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {\n message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);\n }\n\n return new ErrorConstructor(message);\n };\n}\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring angular {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n var $injectorMinErr = minErr('$injector');\n var ngMinErr = minErr('ng');\n\n function ensure(obj, name, factory) {\n return obj[name] || (obj[name] = factory());\n }\n\n var angular = ensure(window, 'angular', Object);\n\n // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n angular.$$minErr = angular.$$minErr || minErr;\n\n return ensure(angular, 'module', function() {\n /** @type {Object.<string, angular.Module>} */\n var modules = {};\n\n /**\n * @ngdoc function\n * @name angular.module\n * @module ng\n * @description\n *\n * The `angular.module` is a global place for creating, registering and retrieving Angular\n * modules.\n * All modules (angular core or 3rd party) that should be available to an application must be\n * registered using this mechanism.\n *\n * Passing one argument retrieves an existing {@link angular.Module},\n * whereas passing more than one argument creates a new {@link angular.Module}\n *\n *\n * # Module\n *\n * A module is a collection of services, directives, controllers, filters, and configuration information.\n * `angular.module` is used to configure the {@link auto.$injector $injector}.\n *\n * ```js\n * // Create a new module\n * var myModule = angular.module('myModule', []);\n *\n * // register a new service\n * myModule.value('appName', 'MyCoolApp');\n *\n * // configure existing services inside initialization blocks.\n * myModule.config(['$locationProvider', function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * }]);\n * ```\n *\n * Then you can create an injector and load your modules like this:\n *\n * ```js\n * var injector = angular.injector(['ng', 'myModule'])\n * ```\n *\n * However it's more likely that you'll just use\n * {@link ng.directive:ngApp ngApp} or\n * {@link angular.bootstrap} to simplify this process for you.\n *\n * @param {!string} name The name of the module to create or retrieve.\n * @param {!Array.<string>=} requires If specified then new module is being created. If\n * unspecified then the module is being retrieved for further configuration.\n * @param {Function=} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#config Module#config()}.\n * @returns {angular.Module} new module with the {@link angular.Module} api.\n */\n return function module(name, requires, configFn) {\n\n var info = {};\n\n var assertNotHasOwnProperty = function(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n };\n\n assertNotHasOwnProperty(name, 'module');\n if (requires && modules.hasOwnProperty(name)) {\n modules[name] = null;\n }\n return ensure(modules, name, function() {\n if (!requires) {\n throw $injectorMinErr('nomod', 'Module \\'{0}\\' is not available! You either misspelled ' +\n 'the module name or forgot to load it. If registering a module ensure that you ' +\n 'specify the dependencies as the second argument.', name);\n }\n\n /** @type {!Array.<Array.<*>>} */\n var invokeQueue = [];\n\n /** @type {!Array.<Function>} */\n var configBlocks = [];\n\n /** @type {!Array.<Function>} */\n var runBlocks = [];\n\n var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _configBlocks: configBlocks,\n _runBlocks: runBlocks,\n\n /**\n * @ngdoc method\n * @name angular.Module#info\n * @module ng\n *\n * @param {Object=} info Information about the module\n * @returns {Object|Module} The current info object for this module if called as a getter,\n * or `this` if called as a setter.\n *\n * @description\n * Read and write custom information about this module.\n * For example you could put the version of the module in here.\n *\n * ```js\n * angular.module('myModule', []).info({ version: '1.0.0' });\n * ```\n *\n * The version could then be read back out by accessing the module elsewhere:\n *\n * ```\n * var version = angular.module('myModule').info().version;\n * ```\n *\n * You can also retrieve this information during runtime via the\n * {@link $injector#modules `$injector.modules`} property:\n *\n * ```js\n * var version = $injector.modules['myModule'].info().version;\n * ```\n */\n info: function(value) {\n if (isDefined(value)) {\n if (!isObject(value)) throw ngMinErr('aobj', 'Argument \\'{0}\\' must be an object', 'value');\n info = value;\n return this;\n }\n return info;\n },\n\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @module ng\n *\n * @description\n * Holds the list of modules which the injector will load before the current module is\n * loaded.\n */\n requires: requires,\n\n /**\n * @ngdoc property\n * @name angular.Module#name\n * @module ng\n *\n * @description\n * Name of the module.\n */\n name: name,\n\n\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @module ng\n * @param {string} name service name\n * @param {Function} providerType Construction function for creating new instance of the\n * service.\n * @description\n * See {@link auto.$provide#provider $provide.provider()}.\n */\n provider: invokeLaterAndSetModuleName('$provide', 'provider'),\n\n /**\n * @ngdoc method\n * @name angular.Module#factory\n * @module ng\n * @param {string} name service name\n * @param {Function} providerFunction Function for creating new instance of the service.\n * @description\n * See {@link auto.$provide#factory $provide.factory()}.\n */\n factory: invokeLaterAndSetModuleName('$provide', 'factory'),\n\n /**\n * @ngdoc method\n * @name angular.Module#service\n * @module ng\n * @param {string} name service name\n * @param {Function} constructor A constructor function that will be instantiated.\n * @description\n * See {@link auto.$provide#service $provide.service()}.\n */\n service: invokeLaterAndSetModuleName('$provide', 'service'),\n\n /**\n * @ngdoc method\n * @name angular.Module#value\n * @module ng\n * @param {string} name service name\n * @param {*} object Service instance object.\n * @description\n * See {@link auto.$provide#value $provide.value()}.\n */\n value: invokeLater('$provide', 'value'),\n\n /**\n * @ngdoc method\n * @name angular.Module#constant\n * @module ng\n * @param {string} name constant name\n * @param {*} object Constant value.\n * @description\n * Because the constants are fixed, they get applied before other provide methods.\n * See {@link auto.$provide#constant $provide.constant()}.\n */\n constant: invokeLater('$provide', 'constant', 'unshift'),\n\n /**\n * @ngdoc method\n * @name angular.Module#decorator\n * @module ng\n * @param {string} name The name of the service to decorate.\n * @param {Function} decorFn This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance.\n * @description\n * See {@link auto.$provide#decorator $provide.decorator()}.\n */\n decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks),\n\n /**\n * @ngdoc method\n * @name angular.Module#animation\n * @module ng\n * @param {string} name animation name\n * @param {Function} animationFactory Factory function for creating new instance of an\n * animation.\n * @description\n *\n * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n *\n *\n * Defines an animation hook that can be later used with\n * {@link $animate $animate} service and directives that use this service.\n *\n * ```js\n * module.animation('.animation-name', function($inject1, $inject2) {\n * return {\n * eventName : function(element, done) {\n * //code to run the animation\n * //once complete, then run done()\n * return function cancellationFunction(element) {\n * //code to cancel the animation\n * }\n * }\n * }\n * })\n * ```\n *\n * See {@link ng.$animateProvider#register $animateProvider.register()} and\n * {@link ngAnimate ngAnimate module} for more information.\n */\n animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#filter\n * @module ng\n * @param {string} name Filter name - this must be a valid angular expression identifier\n * @param {Function} filterFactory Factory function for creating new instance of filter.\n * @description\n * See {@link ng.$filterProvider#register $filterProvider.register()}.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n * </div>\n */\n filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#controller\n * @module ng\n * @param {string|Object} name Controller name, or an object map of controllers where the\n * keys are the names and the values are the constructors.\n * @param {Function} constructor Controller constructor function.\n * @description\n * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n */\n controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#directive\n * @module ng\n * @param {string|Object} name Directive name, or an object map of directives where the\n * keys are the names and the values are the factories.\n * @param {Function} directiveFactory Factory function for creating new instance of\n * directives.\n * @description\n * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),\n\n /**\n * @ngdoc method\n * @name angular.Module#component\n * @module ng\n * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object})\n *\n * @description\n * See {@link ng.$compileProvider#component $compileProvider.component()}.\n */\n component: invokeLaterAndSetModuleName('$compileProvider', 'component'),\n\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @module ng\n * @param {Function} configFn Execute this function on module load. Useful for service\n * configuration.\n * @description\n * Use this method to register work which needs to be performed on module loading.\n * For more about how to configure services, see\n * {@link providers#provider-recipe Provider Recipe}.\n */\n config: config,\n\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @module ng\n * @param {Function} initializationFn Execute this function after injector creation.\n * Useful for application initialization.\n * @description\n * Use this method to register work which should be performed when the injector is done\n * loading all modules.\n */\n run: function(block) {\n runBlocks.push(block);\n return this;\n }\n };\n\n if (configFn) {\n config(configFn);\n }\n\n return moduleInstance;\n\n /**\n * @param {string} provider\n * @param {string} method\n * @param {String=} insertMethod\n * @returns {angular.Module}\n */\n function invokeLater(provider, method, insertMethod, queue) {\n if (!queue) queue = invokeQueue;\n return function() {\n queue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n\n /**\n * @param {string} provider\n * @param {string} method\n * @returns {angular.Module}\n */\n function invokeLaterAndSetModuleName(provider, method, queue) {\n if (!queue) queue = invokeQueue;\n return function(recipeName, factoryFunction) {\n if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;\n queue.push([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n\n}\n\nsetupModuleLoader(window);\n})(window);\n\n/**\n * Closure compiler type information\n *\n * @typedef { {\n * requires: !Array.<string>,\n * invokeQueue: !Array.<Array.<*>>,\n *\n * service: function(string, Function):angular.Module,\n * factory: function(string, Function):angular.Module,\n * value: function(string, *):angular.Module,\n *\n * filter: function(string, Function):angular.Module,\n *\n * init: function(Function):angular.Module\n * } }\n */\nangular.Module;\n\n\n/**\n * @license AngularJS v1.4.14\n * (c) 2010-2015 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {\n\n'use strict';\n\n/**\n * @ngdoc object\n * @name angular.mock\n * @description\n *\n * Namespace from 'angular-mocks.js' which contains testing related code.\n */\nangular.mock = {};\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n *\n * @description\n * This service is a mock implementation of {@link ng.$browser}. It provides fake\n * implementation for commonly used browser apis that are hard to test, e.g. setTimeout, xhr,\n * cookies, etc...\n *\n * The api of this service is the same as that of the real {@link ng.$browser $browser}, except\n * that there are several helper methods available which can be used in tests.\n */\nangular.mock.$BrowserProvider = function() {\n this.$get = function() {\n return new angular.mock.$Browser();\n };\n};\n\nangular.mock.$Browser = function() {\n var self = this;\n\n this.isMock = true;\n self.$$url = \"http://server/\";\n self.$$lastUrl = self.$$url; // used by url polling fn\n self.pollFns = [];\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = angular.noop;\n self.$$incOutstandingRequestCount = angular.noop;\n\n\n // register url polling fn\n\n self.onUrlChange = function(listener) {\n self.pollFns.push(\n function() {\n if (self.$$lastUrl !== self.$$url || self.$$state !== self.$$lastState) {\n self.$$lastUrl = self.$$url;\n self.$$lastState = self.$$state;\n listener(self.$$url, self.$$state);\n }\n }\n );\n\n return listener;\n };\n\n self.$$applicationDestroyed = angular.noop;\n self.$$checkUrlChange = angular.noop;\n\n self.deferredFns = [];\n self.deferredNextId = 0;\n\n self.defer = function(fn, delay) {\n delay = delay || 0;\n self.deferredFns.push({time:(self.defer.now + delay), fn:fn, id: self.deferredNextId});\n self.deferredFns.sort(function(a, b) { return a.time - b.time;});\n return self.deferredNextId++;\n };\n\n\n /**\n * @name $browser#defer.now\n *\n * @description\n * Current milliseconds mock time.\n */\n self.defer.now = 0;\n\n\n self.defer.cancel = function(deferId) {\n var fnIndex;\n\n angular.forEach(self.deferredFns, function(fn, index) {\n if (fn.id === deferId) fnIndex = index;\n });\n\n if (angular.isDefined(fnIndex)) {\n self.deferredFns.splice(fnIndex, 1);\n return true;\n }\n\n return false;\n };\n\n\n /**\n * @name $browser#defer.flush\n *\n * @description\n * Flushes all pending requests and executes the defer callbacks.\n *\n * @param {number=} number of milliseconds to flush. See {@link #defer.now}\n */\n self.defer.flush = function(delay) {\n if (angular.isDefined(delay)) {\n self.defer.now += delay;\n } else {\n if (self.deferredFns.length) {\n self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;\n } else {\n throw new Error('No deferred tasks to be flushed');\n }\n }\n\n while (self.deferredFns.length && self.deferredFns[0].time <= self.defer.now) {\n self.deferredFns.shift().fn();\n }\n };\n\n self.$$baseHref = '/';\n self.baseHref = function() {\n return this.$$baseHref;\n };\n};\nangular.mock.$Browser.prototype = {\n\n/**\n * @name $browser#poll\n *\n * @description\n * run all fns in pollFns\n */\n poll: function poll() {\n angular.forEach(this.pollFns, function(pollFn) {\n pollFn();\n });\n },\n\n url: function(url, replace, state) {\n if (angular.isUndefined(state)) {\n state = null;\n }\n if (url) {\n this.$$url = url;\n // Native pushState serializes & copies the object; simulate it.\n this.$$state = angular.copy(state);\n return this;\n }\n\n return this.$$url;\n },\n\n state: function() {\n return this.$$state;\n },\n\n notifyWhenNoOutstandingRequests: function(fn) {\n fn();\n }\n};\n\n\n/**\n * @ngdoc provider\n * @name $exceptionHandlerProvider\n *\n * @description\n * Configures the mock implementation of {@link ng.$exceptionHandler} to rethrow or to log errors\n * passed to the `$exceptionHandler`.\n */\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n *\n * @description\n * Mock implementation of {@link ng.$exceptionHandler} that rethrows or logs errors passed\n * to it. See {@link ngMock.$exceptionHandlerProvider $exceptionHandlerProvider} for configuration\n * information.\n *\n *\n * ```js\n * describe('$exceptionHandlerProvider', function() {\n *\n * it('should capture log messages and exceptions', function() {\n *\n * module(function($exceptionHandlerProvider) {\n * $exceptionHandlerProvider.mode('log');\n * });\n *\n * inject(function($log, $exceptionHandler, $timeout) {\n * $timeout(function() { $log.log(1); });\n * $timeout(function() { $log.log(2); throw 'banana peel'; });\n * $timeout(function() { $log.log(3); });\n * expect($exceptionHandler.errors).toEqual([]);\n * expect($log.assertEmpty());\n * $timeout.flush();\n * expect($exceptionHandler.errors).toEqual(['banana peel']);\n * expect($log.log.logs).toEqual([[1], [2], [3]]);\n * });\n * });\n * });\n * ```\n */\n\nangular.mock.$ExceptionHandlerProvider = function() {\n var handler;\n\n /**\n * @ngdoc method\n * @name $exceptionHandlerProvider#mode\n *\n * @description\n * Sets the logging mode.\n *\n * @param {string} mode Mode of operation, defaults to `rethrow`.\n *\n * - `log`: Sometimes it is desirable to test that an error is thrown, for this case the `log`\n * mode stores an array of errors in `$exceptionHandler.errors`, to allow later\n * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and\n * {@link ngMock.$log#reset reset()}\n * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there\n * is a bug in the application or test, so this mock will make these tests fail.\n * For any implementations that expect exceptions to be thrown, the `rethrow` mode\n * will also maintain a log of thrown errors.\n */\n this.mode = function(mode) {\n\n switch (mode) {\n case 'log':\n case 'rethrow':\n var errors = [];\n handler = function(e) {\n if (arguments.length == 1) {\n errors.push(e);\n } else {\n errors.push([].slice.call(arguments, 0));\n }\n if (mode === \"rethrow\") {\n throw e;\n }\n };\n handler.errors = errors;\n break;\n default:\n throw new Error(\"Unknown mode '\" + mode + \"', only 'log'/'rethrow' modes are allowed!\");\n }\n };\n\n this.$get = function() {\n return handler;\n };\n\n this.mode('rethrow');\n};\n\n\n/**\n * @ngdoc service\n * @name $log\n *\n * @description\n * Mock implementation of {@link ng.$log} that gathers all logged messages in arrays\n * (one array per logging level). These arrays are exposed as `logs` property of each of the\n * level-specific log function, e.g. for level `error` the array is exposed as `$log.error.logs`.\n *\n */\nangular.mock.$LogProvider = function() {\n var debug = true;\n\n function concat(array1, array2, index) {\n return array1.concat(Array.prototype.slice.call(array2, index));\n }\n\n this.debugEnabled = function(flag) {\n if (angular.isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n\n this.$get = function() {\n var $log = {\n log: function() { $log.log.logs.push(concat([], arguments, 0)); },\n warn: function() { $log.warn.logs.push(concat([], arguments, 0)); },\n info: function() { $log.info.logs.push(concat([], arguments, 0)); },\n error: function() { $log.error.logs.push(concat([], arguments, 0)); },\n debug: function() {\n if (debug) {\n $log.debug.logs.push(concat([], arguments, 0));\n }\n }\n };\n\n /**\n * @ngdoc method\n * @name $log#reset\n *\n * @description\n * Reset all of the logging arrays to empty.\n */\n $log.reset = function() {\n /**\n * @ngdoc property\n * @name $log#log.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#log `log()`}.\n *\n * @example\n * ```js\n * $log.log('Some Log');\n * var first = $log.log.logs.unshift();\n * ```\n */\n $log.log.logs = [];\n /**\n * @ngdoc property\n * @name $log#info.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#info `info()`}.\n *\n * @example\n * ```js\n * $log.info('Some Info');\n * var first = $log.info.logs.unshift();\n * ```\n */\n $log.info.logs = [];\n /**\n * @ngdoc property\n * @name $log#warn.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#warn `warn()`}.\n *\n * @example\n * ```js\n * $log.warn('Some Warning');\n * var first = $log.warn.logs.unshift();\n * ```\n */\n $log.warn.logs = [];\n /**\n * @ngdoc property\n * @name $log#error.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#error `error()`}.\n *\n * @example\n * ```js\n * $log.error('Some Error');\n * var first = $log.error.logs.unshift();\n * ```\n */\n $log.error.logs = [];\n /**\n * @ngdoc property\n * @name $log#debug.logs\n *\n * @description\n * Array of messages logged using {@link ng.$log#debug `debug()`}.\n *\n * @example\n * ```js\n * $log.debug('Some Error');\n * var first = $log.debug.logs.unshift();\n * ```\n */\n $log.debug.logs = [];\n };\n\n /**\n * @ngdoc method\n * @name $log#assertEmpty\n *\n * @description\n * Assert that all of the logging methods have no logged messages. If any messages are present,\n * an exception is thrown.\n */\n $log.assertEmpty = function() {\n var errors = [];\n angular.forEach(['error', 'warn', 'info', 'log', 'debug'], function(logLevel) {\n angular.forEach($log[logLevel].logs, function(log) {\n angular.forEach(log, function(logItem) {\n errors.push('MOCK $log (' + logLevel + '): ' + String(logItem) + '\\n' +\n (logItem.stack || ''));\n });\n });\n });\n if (errors.length) {\n errors.unshift(\"Expected $log to be empty! Either a message was logged unexpectedly, or \" +\n \"an expected log message was not checked and removed:\");\n errors.push('');\n throw new Error(errors.join('\\n---------\\n'));\n }\n };\n\n $log.reset();\n return $log;\n };\n};\n\n\n/**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * Mock implementation of the $interval service.\n *\n * Use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n * @param {function()} fn A function that should be called repeatedly.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration.\n */\nangular.mock.$IntervalProvider = function() {\n this.$get = ['$browser', '$rootScope', '$q', '$$q',\n function($browser, $rootScope, $q, $$q) {\n var repeatFns = [],\n nextRepeatId = 0,\n now = 0;\n\n var $interval = function(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? Array.prototype.slice.call(arguments, 4) : [],\n iteration = 0,\n skipApply = (angular.isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n\n count = (angular.isDefined(count)) ? count : 0;\n promise.then(null, null, (!hasParams) ? fn : function() {\n fn.apply(null, args);\n });\n\n promise.$$intervalId = nextRepeatId;\n\n function tick() {\n deferred.notify(iteration++);\n\n if (count > 0 && iteration >= count) {\n var fnIndex;\n deferred.resolve(iteration);\n\n angular.forEach(repeatFns, function(fn, index) {\n if (fn.id === promise.$$intervalId) fnIndex = index;\n });\n\n if (angular.isDefined(fnIndex)) {\n repeatFns.splice(fnIndex, 1);\n }\n }\n\n if (skipApply) {\n $browser.defer.flush();\n } else {\n $rootScope.$apply();\n }\n }\n\n repeatFns.push({\n nextTime:(now + delay),\n delay: delay,\n fn: tick,\n id: nextRepeatId,\n deferred: deferred\n });\n repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});\n\n nextRepeatId++;\n return promise;\n };\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {promise} promise A promise from calling the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully cancelled.\n */\n $interval.cancel = function(promise) {\n if (!promise) return false;\n var fnIndex;\n\n angular.forEach(repeatFns, function(fn, index) {\n if (fn.id === promise.$$intervalId) fnIndex = index;\n });\n\n if (angular.isDefined(fnIndex)) {\n repeatFns[fnIndex].deferred.reject('canceled');\n repeatFns.splice(fnIndex, 1);\n return true;\n }\n\n return false;\n };\n\n /**\n * @ngdoc method\n * @name $interval#flush\n * @description\n *\n * Runs interval tasks scheduled to be run in the next `millis` milliseconds.\n *\n * @param {number=} millis maximum timeout amount to flush up until.\n *\n * @return {number} The amount of time moved forward.\n */\n $interval.flush = function(millis) {\n now += millis;\n while (repeatFns.length && repeatFns[0].nextTime <= now) {\n var task = repeatFns[0];\n task.fn();\n task.nextTime += task.delay;\n repeatFns.sort(function(a, b) { return a.nextTime - b.nextTime;});\n }\n return millis;\n };\n\n return $interval;\n }];\n};\n\n\n/* jshint -W101 */\n/* The R_ISO8061_STR regex is never going to fit into the 100 char limit!\n * This directive should go inside the anonymous function but a bug in JSHint means that it would\n * not be enacted early enough to prevent the warning.\n */\nvar R_ISO8061_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?:\\:?(\\d\\d)(?:\\:?(\\d\\d)(?:\\.(\\d{3}))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d)))?$/;\n\nfunction jsonStringToDate(string) {\n var match;\n if (match = string.match(R_ISO8061_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0;\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n date.setUTCFullYear(toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n date.setUTCHours(toInt(match[4] || 0) - tzHour,\n toInt(match[5] || 0) - tzMin,\n toInt(match[6] || 0),\n toInt(match[7] || 0));\n return date;\n }\n return string;\n}\n\nfunction toInt(str) {\n return parseInt(str, 10);\n}\n\nfunction padNumber(num, digits, trim) {\n var neg = '';\n if (num < 0) {\n neg = '-';\n num = -num;\n }\n num = '' + num;\n while (num.length < digits) num = '0' + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n}\n\n\n/**\n * @ngdoc type\n * @name angular.mock.TzDate\n * @description\n *\n * *NOTE*: this is not an injectable instance, just a globally available mock class of `Date`.\n *\n * Mock of the Date type which has its timezone specified via constructor arg.\n *\n * The main purpose is to create Date-like instances with timezone fixed to the specified timezone\n * offset, so that we can test code that depends on local timezone settings without dependency on\n * the time zone settings of the machine where the code is running.\n *\n * @param {number} offset Offset of the *desired* timezone in hours (fractions will be honored)\n * @param {(number|string)} timestamp Timestamp representing the desired time in *UTC*\n *\n * @example\n * !!!! WARNING !!!!!\n * This is not a complete Date object so only methods that were implemented can be called safely.\n * To make matters worse, TzDate instances inherit stuff from Date via a prototype.\n *\n * We do our best to intercept calls to \"unimplemented\" methods, but since the list of methods is\n * incomplete we might be missing some non-standard methods. This can result in errors like:\n * \"Date.prototype.foo called on incompatible Object\".\n *\n * ```js\n * var newYearInBratislava = new TzDate(-1, '2009-12-31T23:00:00Z');\n * newYearInBratislava.getTimezoneOffset() => -60;\n * newYearInBratislava.getFullYear() => 2010;\n * newYearInBratislava.getMonth() => 0;\n * newYearInBratislava.getDate() => 1;\n * newYearInBratislava.getHours() => 0;\n * newYearInBratislava.getMinutes() => 0;\n * newYearInBratislava.getSeconds() => 0;\n * ```\n *\n */\nangular.mock.TzDate = function(offset, timestamp) {\n var self = new Date(0);\n if (angular.isString(timestamp)) {\n var tsStr = timestamp;\n\n self.origDate = jsonStringToDate(timestamp);\n\n timestamp = self.origDate.getTime();\n if (isNaN(timestamp)) {\n throw {\n name: \"Illegal Argument\",\n message: \"Arg '\" + tsStr + \"' passed into TzDate constructor is not a valid date string\"\n };\n }\n } else {\n self.origDate = new Date(timestamp);\n }\n\n var localOffset = new Date(timestamp).getTimezoneOffset();\n self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;\n self.date = new Date(timestamp + self.offsetDiff);\n\n self.getTime = function() {\n return self.date.getTime() - self.offsetDiff;\n };\n\n self.toLocaleDateString = function() {\n return self.date.toLocaleDateString();\n };\n\n self.getFullYear = function() {\n return self.date.getFullYear();\n };\n\n self.getMonth = function() {\n return self.date.getMonth();\n };\n\n self.getDate = function() {\n return self.date.getDate();\n };\n\n self.getHours = function() {\n return self.date.getHours();\n };\n\n self.getMinutes = function() {\n return self.date.getMinutes();\n };\n\n self.getSeconds = function() {\n return self.date.getSeconds();\n };\n\n self.getMilliseconds = function() {\n return self.date.getMilliseconds();\n };\n\n self.getTimezoneOffset = function() {\n return offset * 60;\n };\n\n self.getUTCFullYear = function() {\n return self.origDate.getUTCFullYear();\n };\n\n self.getUTCMonth = function() {\n return self.origDate.getUTCMonth();\n };\n\n self.getUTCDate = function() {\n return self.origDate.getUTCDate();\n };\n\n self.getUTCHours = function() {\n return self.origDate.getUTCHours();\n };\n\n self.getUTCMinutes = function() {\n return self.origDate.getUTCMinutes();\n };\n\n self.getUTCSeconds = function() {\n return self.origDate.getUTCSeconds();\n };\n\n self.getUTCMilliseconds = function() {\n return self.origDate.getUTCMilliseconds();\n };\n\n self.getDay = function() {\n return self.date.getDay();\n };\n\n // provide this method only on browsers that already have it\n if (self.toISOString) {\n self.toISOString = function() {\n return padNumber(self.origDate.getUTCFullYear(), 4) + '-' +\n padNumber(self.origDate.getUTCMonth() + 1, 2) + '-' +\n padNumber(self.origDate.getUTCDate(), 2) + 'T' +\n padNumber(self.origDate.getUTCHours(), 2) + ':' +\n padNumber(self.origDate.getUTCMinutes(), 2) + ':' +\n padNumber(self.origDate.getUTCSeconds(), 2) + '.' +\n padNumber(self.origDate.getUTCMilliseconds(), 3) + 'Z';\n };\n }\n\n //hide all methods not implemented in this mock that the Date prototype exposes\n var unimplementedMethods = ['getUTCDay',\n 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',\n 'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',\n 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds',\n 'setYear', 'toDateString', 'toGMTString', 'toJSON', 'toLocaleFormat', 'toLocaleString',\n 'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];\n\n angular.forEach(unimplementedMethods, function(methodName) {\n self[methodName] = function() {\n throw new Error(\"Method '\" + methodName + \"' is not implemented in the TzDate mock\");\n };\n });\n\n return self;\n};\n\n//make \"tzDateInstance instanceof Date\" return true\nangular.mock.TzDate.prototype = Date.prototype;\n/* jshint +W101 */\n\n\n/**\n * @ngdoc service\n * @name $animate\n *\n * @description\n * Mock implementation of the {@link ng.$animate `$animate`} service. Exposes two additional methods\n * for testing animations.\n */\nangular.mock.animate = angular.module('ngAnimateMock', ['ng'])\n\n .config(['$provide', function($provide) {\n\n $provide.factory('$$forceReflow', function() {\n function reflowFn() {\n reflowFn.totalReflows++;\n }\n reflowFn.totalReflows = 0;\n return reflowFn;\n });\n\n $provide.factory('$$animateAsyncRun', function() {\n var queue = [];\n var queueFn = function() {\n return function(fn) {\n queue.push(fn);\n };\n };\n queueFn.flush = function() {\n if (queue.length === 0) return false;\n\n for (var i = 0; i < queue.length; i++) {\n queue[i]();\n }\n queue = [];\n\n return true;\n };\n return queueFn;\n });\n\n $provide.decorator('$$animateJs', ['$delegate', function($delegate) {\n var runners = [];\n\n var animateJsConstructor = function() {\n var animator = $delegate.apply($delegate, arguments);\n // If no javascript animation is found, animator is undefined\n if (animator) {\n runners.push(animator);\n }\n return animator;\n };\n\n animateJsConstructor.$closeAndFlush = function() {\n runners.forEach(function(runner) {\n runner.end();\n });\n runners = [];\n };\n\n return animateJsConstructor;\n }]);\n\n $provide.decorator('$animateCss', ['$delegate', function($delegate) {\n var runners = [];\n\n var animateCssConstructor = function(element, options) {\n var animator = $delegate(element, options);\n runners.push(animator);\n return animator;\n };\n\n animateCssConstructor.$closeAndFlush = function() {\n runners.forEach(function(runner) {\n runner.end();\n });\n runners = [];\n };\n\n return animateCssConstructor;\n }]);\n\n $provide.decorator('$animate', ['$delegate', '$timeout', '$browser', '$$rAF', '$animateCss', '$$animateJs',\n '$$forceReflow', '$$animateAsyncRun', '$rootScope',\n function($delegate, $timeout, $browser, $$rAF, $animateCss, $$animateJs,\n $$forceReflow, $$animateAsyncRun, $rootScope) {\n var animate = {\n queue: [],\n cancel: $delegate.cancel,\n on: $delegate.on,\n off: $delegate.off,\n pin: $delegate.pin,\n get reflows() {\n return $$forceReflow.totalReflows;\n },\n enabled: $delegate.enabled,\n /**\n * @ngdoc method\n * @name $animate#closeAndFlush\n * @description\n *\n * This method will close all pending animations (both {@link ngAnimate#javascript-based-animations Javascript}\n * and {@link ngAnimate.$animateCss CSS}) and it will also flush any remaining animation frames and/or callbacks.\n */\n closeAndFlush: function() {\n // we allow the flush command to swallow the errors\n // because depending on whether CSS or JS animations are\n // used, there may not be a RAF flush. The primary flush\n // at the end of this function must throw an exception\n // because it will track if there were pending animations\n this.flush(true);\n $animateCss.$closeAndFlush();\n $$animateJs.$closeAndFlush();\n this.flush();\n },\n /**\n * @ngdoc method\n * @name $animate#flush\n * @description\n *\n * This method is used to flush the pending callbacks and animation frames to either start\n * an animation or conclude an animation. Note that this will not actually close an\n * actively running animation (see {@link ngMock.$animate#closeAndFlush `closeAndFlush()`} for that).\n */\n flush: function(hideErrors) {\n $rootScope.$digest();\n\n var doNextRun, somethingFlushed = false;\n do {\n doNextRun = false;\n\n if ($$rAF.queue.length) {\n $$rAF.flush();\n doNextRun = somethingFlushed = true;\n }\n\n if ($$animateAsyncRun.flush()) {\n doNextRun = somethingFlushed = true;\n }\n } while (doNextRun);\n\n if (!somethingFlushed && !hideErrors) {\n throw new Error('No pending animations ready to be closed or flushed');\n }\n\n $rootScope.$digest();\n }\n };\n\n angular.forEach(\n ['animate','enter','leave','move','addClass','removeClass','setClass'], function(method) {\n animate[method] = function() {\n animate.queue.push({\n event: method,\n element: arguments[0],\n options: arguments[arguments.length - 1],\n args: arguments\n });\n return $delegate[method].apply($delegate, arguments);\n };\n });\n\n return animate;\n }]);\n\n }]);\n\n\n/**\n * @ngdoc function\n * @name angular.mock.dump\n * @description\n *\n * *NOTE*: this is not an injectable instance, just a globally available function.\n *\n * Method for serializing common angular objects (scope, elements, etc..) into strings, useful for\n * debugging.\n *\n * This method is also available on window, where it can be used to display objects on debug\n * console.\n *\n * @param {*} object - any object to turn into string.\n * @return {string} a serialized string of the argument\n */\nangular.mock.dump = function(object) {\n return serialize(object);\n\n function serialize(object) {\n var out;\n\n if (angular.isElement(object)) {\n object = angular.element(object);\n out = angular.element('<div></div>');\n angular.forEach(object, function(element) {\n out.append(angular.element(element).clone());\n });\n out = out.html();\n } else if (angular.isArray(object)) {\n out = [];\n angular.forEach(object, function(o) {\n out.push(serialize(o));\n });\n out = '[ ' + out.join(', ') + ' ]';\n } else if (angular.isObject(object)) {\n if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) {\n out = serializeScope(object);\n } else if (object instanceof Error) {\n out = object.stack || ('' + object.name + ': ' + object.message);\n } else {\n // TODO(i): this prevents methods being logged,\n // we should have a better way to serialize objects\n out = angular.toJson(object, true);\n }\n } else {\n out = String(object);\n }\n\n return out;\n }\n\n function serializeScope(scope, offset) {\n offset = offset || ' ';\n var log = [offset + 'Scope(' + scope.$id + '): {'];\n for (var key in scope) {\n if (Object.prototype.hasOwnProperty.call(scope, key) && !key.match(/^(\\$|this)/)) {\n log.push(' ' + key + ': ' + angular.toJson(scope[key]));\n }\n }\n var child = scope.$$childHead;\n while (child) {\n log.push(serializeScope(child, offset + ' '));\n child = child.$$nextSibling;\n }\n log.push('}');\n return log.join('\\n' + offset);\n }\n};\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @description\n * Fake HTTP backend implementation suitable for unit testing applications that use the\n * {@link ng.$http $http service}.\n *\n * *Note*: For fake HTTP backend implementation suitable for end-to-end testing or backend-less\n * development please see {@link ngMockE2E.$httpBackend e2e $httpBackend mock}.\n *\n * During unit testing, we want our unit tests to run quickly and have no external dependencies so\n * we don’t want to send [XHR](https://developer.mozilla.org/en/xmlhttprequest) or\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) requests to a real server. All we really need is\n * to verify whether a certain request has been sent or not, or alternatively just let the\n * application make requests, respond with pre-trained responses and assert that the end result is\n * what we expect it to be.\n *\n * This mock implementation can be used to respond with static or dynamic responses via the\n * `expect` and `when` apis and their shortcuts (`expectGET`, `whenPOST`, etc).\n *\n * When an Angular application needs some data from a server, it calls the $http service, which\n * sends the request to a real server using $httpBackend service. With dependency injection, it is\n * easy to inject $httpBackend mock (which has the same API as $httpBackend) and use it to verify\n * the requests and respond with some testing data without sending a request to a real server.\n *\n * There are two ways to specify what test data should be returned as http responses by the mock\n * backend when the code under test makes http requests:\n *\n * - `$httpBackend.expect` - specifies a request expectation\n * - `$httpBackend.when` - specifies a backend definition\n *\n *\n * # Request Expectations vs Backend Definitions\n *\n * Request expectations provide a way to make assertions about requests made by the application and\n * to define responses for those requests. The test will fail if the expected requests are not made\n * or they are made in the wrong order.\n *\n * Backend definitions allow you to define a fake backend for your application which doesn't assert\n * if a particular request was made or not, it just returns a trained response if a request is made.\n * The test will pass whether or not the request gets made during testing.\n *\n *\n * <table class=\"table\">\n * <tr><th width=\"220px\"></th><th>Request expectations</th><th>Backend definitions</th></tr>\n * <tr>\n * <th>Syntax</th>\n * <td>.expect(...).respond(...)</td>\n * <td>.when(...).respond(...)</td>\n * </tr>\n * <tr>\n * <th>Typical usage</th>\n * <td>strict unit tests</td>\n * <td>loose (black-box) unit testing</td>\n * </tr>\n * <tr>\n * <th>Fulfills multiple requests</th>\n * <td>NO</td>\n * <td>YES</td>\n * </tr>\n * <tr>\n * <th>Order of requests matters</th>\n * <td>YES</td>\n * <td>NO</td>\n * </tr>\n * <tr>\n * <th>Request required</th>\n * <td>YES</td>\n * <td>NO</td>\n * </tr>\n * <tr>\n * <th>Response required</th>\n * <td>optional (see below)</td>\n * <td>YES</td>\n * </tr>\n * </table>\n *\n * In cases where both backend definitions and request expectations are specified during unit\n * testing, the request expectations are evaluated first.\n *\n * If a request expectation has no response specified, the algorithm will search your backend\n * definitions for an appropriate response.\n *\n * If a request didn't match any expectation or if the expectation doesn't have the response\n * defined, the backend definitions are evaluated in sequential order to see if any of them match\n * the request. The response from the first matched definition is returned.\n *\n *\n * # Flushing HTTP requests\n *\n * The $httpBackend used in production always responds to requests asynchronously. If we preserved\n * this behavior in unit testing, we'd have to create async unit tests, which are hard to write,\n * to follow and to maintain. But neither can the testing mock respond synchronously; that would\n * change the execution of the code under test. For this reason, the mock $httpBackend has a\n * `flush()` method, which allows the test to explicitly flush pending requests. This preserves\n * the async api of the backend, while allowing the test to execute synchronously.\n *\n *\n * # Unit testing with mock $httpBackend\n * The following code shows how to setup and use the mock backend when unit testing a controller.\n * First we create the controller under test:\n *\n ```js\n // The module code\n angular\n .module('MyApp', [])\n .controller('MyController', MyController);\n\n // The controller code\n function MyController($scope, $http) {\n var authToken;\n\n $http.get('/auth.py').success(function(data, status, headers) {\n authToken = headers('A-Token');\n $scope.user = data;\n });\n\n $scope.saveMessage = function(message) {\n var headers = { 'Authorization': authToken };\n $scope.status = 'Saving...';\n\n $http.post('/add-msg.py', message, { headers: headers } ).success(function(response) {\n $scope.status = '';\n }).error(function() {\n $scope.status = 'Failed...';\n });\n };\n }\n ```\n *\n * Now we setup the mock backend and create the test specs:\n *\n ```js\n // testing controller\n describe('MyController', function() {\n var $httpBackend, $rootScope, createController, authRequestHandler;\n\n // Set up the module\n beforeEach(module('MyApp'));\n\n beforeEach(inject(function($injector) {\n // Set up the mock http service responses\n $httpBackend = $injector.get('$httpBackend');\n // backend definition common for all tests\n authRequestHandler = $httpBackend.when('GET', '/auth.py')\n .respond({userId: 'userX'}, {'A-Token': 'xxx'});\n\n // Get hold of a scope (i.e. the root scope)\n $rootScope = $injector.get('$rootScope');\n // The $controller service is used to create instances of controllers\n var $controller = $injector.get('$controller');\n\n createController = function() {\n return $controller('MyController', {'$scope' : $rootScope });\n };\n }));\n\n\n afterEach(function() {\n $httpBackend.verifyNoOutstandingExpectation();\n $httpBackend.verifyNoOutstandingRequest();\n });\n\n\n it('should fetch authentication token', function() {\n $httpBackend.expectGET('/auth.py');\n var controller = createController();\n $httpBackend.flush();\n });\n\n\n it('should fail authentication', function() {\n\n // Notice how you can change the response even after it was set\n authRequestHandler.respond(401, '');\n\n $httpBackend.expectGET('/auth.py');\n var controller = createController();\n $httpBackend.flush();\n expect($rootScope.status).toBe('Failed...');\n });\n\n\n it('should send msg to server', function() {\n var controller = createController();\n $httpBackend.flush();\n\n // now you don’t care about the authentication, but\n // the controller will still send the request and\n // $httpBackend will respond without you having to\n // specify the expectation and response for this request\n\n $httpBackend.expectPOST('/add-msg.py', 'message content').respond(201, '');\n $rootScope.saveMessage('message content');\n expect($rootScope.status).toBe('Saving...');\n $httpBackend.flush();\n expect($rootScope.status).toBe('');\n });\n\n\n it('should send auth header', function() {\n var controller = createController();\n $httpBackend.flush();\n\n $httpBackend.expectPOST('/add-msg.py', undefined, function(headers) {\n // check if the header was sent, if it wasn't the expectation won't\n // match the request and the test will fail\n return headers['Authorization'] == 'xxx';\n }).respond(201, '');\n\n $rootScope.saveMessage('whatever');\n $httpBackend.flush();\n });\n });\n ```\n */\nangular.mock.$HttpBackendProvider = function() {\n this.$get = ['$rootScope', '$timeout', createHttpBackendMock];\n};\n\n/**\n * General factory function for $httpBackend mock.\n * Returns instance for unit testing (when no arguments specified):\n * - passing through is disabled\n * - auto flushing is disabled\n *\n * Returns instance for e2e testing (when `$delegate` and `$browser` specified):\n * - passing through (delegating request to real backend) is enabled\n * - auto flushing is enabled\n *\n * @param {Object=} $delegate Real $httpBackend instance (allow passing through if specified)\n * @param {Object=} $browser Auto-flushing enabled if specified\n * @return {Object} Instance of $httpBackend mock\n */\nfunction createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {\n var definitions = [],\n expectations = [],\n responses = [],\n responsesPush = angular.bind(responses, responses.push),\n copy = angular.copy;\n\n function createResponse(status, data, headers, statusText) {\n if (angular.isFunction(status)) return status;\n\n return function() {\n return angular.isNumber(status)\n ? [status, data, headers, statusText]\n : [200, status, data, headers];\n };\n }\n\n // TODO(vojta): change params to: method, url, data, headers, callback\n function $httpBackend(method, url, data, callback, headers, timeout, withCredentials, responseType) {\n\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n function wrapResponse(wrapped) {\n if (!$browser && timeout) {\n timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);\n }\n\n return handleResponse;\n\n function handleResponse() {\n var response = wrapped.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(copy(response[0]), copy(response[1]), xhr.getAllResponseHeaders(),\n copy(response[3] || ''));\n }\n\n function handleTimeout() {\n for (var i = 0, ii = responses.length; i < ii; i++) {\n if (responses[i] === handleResponse) {\n responses.splice(i, 1);\n callback(-1, undefined, '');\n break;\n }\n }\n }\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data)) {\n throw new Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n }\n\n if (!expectation.matchHeaders(headers)) {\n throw new Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n }\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(wrapResponse(expectation));\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(wrapResponse(definition));\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers, timeout, withCredentials, responseType);\n } else throw new Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n new Error('No response defined !') :\n new Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }\n\n /**\n * @ngdoc method\n * @name $httpBackend#when\n * @description\n * Creates a new backend definition.\n *\n * @param {string} method HTTP method.\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives\n * data string and returns true if the data is as expected.\n * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header\n * object and returns true if the headers match the current definition.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n *\n * - respond –\n * `{function([status,] data[, headers, statusText])\n * | function(function(method, url, data, headers)}`\n * – The respond method takes a set of static data to be returned or a function that can\n * return an array containing response status (number), response data (string), response\n * headers (Object), and the text for the status (string). The respond method returns the\n * `requestHandler` object for possible overrides.\n */\n $httpBackend.when = function(method, url, data, headers) {\n var definition = new MockHttpExpectation(method, url, data, headers),\n chain = {\n respond: function(status, data, headers, statusText) {\n definition.passThrough = undefined;\n definition.response = createResponse(status, data, headers, statusText);\n return chain;\n }\n };\n\n if ($browser) {\n chain.passThrough = function() {\n definition.response = undefined;\n definition.passThrough = true;\n return chain;\n };\n }\n\n definitions.push(definition);\n return chain;\n };\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenGET\n * @description\n * Creates a new backend definition for GET requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenHEAD\n * @description\n * Creates a new backend definition for HEAD requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenDELETE\n * @description\n * Creates a new backend definition for DELETE requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenPOST\n * @description\n * Creates a new backend definition for POST requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives\n * data string and returns true if the data is as expected.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenPUT\n * @description\n * Creates a new backend definition for PUT requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string))=} data HTTP request body or function that receives\n * data string and returns true if the data is as expected.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#whenJSONP\n * @description\n * Creates a new backend definition for JSONP requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n createShortMethods('when');\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#expect\n * @description\n * Creates a new request expectation.\n *\n * @param {string} method HTTP method.\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header\n * object and returns true if the headers match the current expectation.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n *\n * - respond –\n * `{function([status,] data[, headers, statusText])\n * | function(function(method, url, data, headers)}`\n * – The respond method takes a set of static data to be returned or a function that can\n * return an array containing response status (number), response data (string), response\n * headers (Object), and the text for the status (string). The respond method returns the\n * `requestHandler` object for possible overrides.\n */\n $httpBackend.expect = function(method, url, data, headers) {\n var expectation = new MockHttpExpectation(method, url, data, headers),\n chain = {\n respond: function(status, data, headers, statusText) {\n expectation.response = createResponse(status, data, headers, statusText);\n return chain;\n }\n };\n\n expectations.push(expectation);\n return chain;\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectGET\n * @description\n * Creates a new request expectation for GET requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {Object=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled. See #expect for more info.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectHEAD\n * @description\n * Creates a new request expectation for HEAD requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {Object=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectDELETE\n * @description\n * Creates a new request expectation for DELETE requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {Object=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectPOST\n * @description\n * Creates a new request expectation for POST requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {Object=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectPUT\n * @description\n * Creates a new request expectation for PUT requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {Object=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectPATCH\n * @description\n * Creates a new request expectation for PATCH requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp|function(string)|Object)=} data HTTP request body or function that\n * receives data string and returns true if the data is as expected, or Object if request body\n * is in JSON format.\n * @param {Object=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n\n /**\n * @ngdoc method\n * @name $httpBackend#expectJSONP\n * @description\n * Creates a new request expectation for JSONP requests. For more info see `expect()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives an url\n * and returns true if the url matches the current definition.\n * @returns {requestHandler} Returns an object with `respond` method that controls how a matched\n * request is handled. You can save this object for later use and invoke `respond` again in\n * order to change how a matched request is handled.\n */\n createShortMethods('expect');\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#flush\n * @description\n * Flushes all pending requests using the trained responses.\n *\n * @param {number=} count Number of responses to flush (in the order they arrived). If undefined,\n * all pending requests will be flushed. If there are no pending requests when the flush method\n * is called an exception is thrown (as this typically a sign of programming error).\n */\n $httpBackend.flush = function(count, digest) {\n if (digest !== false) $rootScope.$digest();\n if (!responses.length) throw new Error('No pending request to flush !');\n\n if (angular.isDefined(count) && count !== null) {\n while (count--) {\n if (!responses.length) throw new Error('No more pending request to flush !');\n responses.shift()();\n }\n } else {\n while (responses.length) {\n responses.shift()();\n }\n }\n $httpBackend.verifyNoOutstandingExpectation(digest);\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#verifyNoOutstandingExpectation\n * @description\n * Verifies that all of the requests defined via the `expect` api were made. If any of the\n * requests were not made, verifyNoOutstandingExpectation throws an exception.\n *\n * Typically, you would call this method following each test case that asserts requests using an\n * \"afterEach\" clause.\n *\n * ```js\n * afterEach($httpBackend.verifyNoOutstandingExpectation);\n * ```\n */\n $httpBackend.verifyNoOutstandingExpectation = function(digest) {\n if (digest !== false) $rootScope.$digest();\n if (expectations.length) {\n throw new Error('Unsatisfied requests: ' + expectations.join(', '));\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#verifyNoOutstandingRequest\n * @description\n * Verifies that there are no outstanding requests that need to be flushed.\n *\n * Typically, you would call this method following each test case that asserts requests using an\n * \"afterEach\" clause.\n *\n * ```js\n * afterEach($httpBackend.verifyNoOutstandingRequest);\n * ```\n */\n $httpBackend.verifyNoOutstandingRequest = function() {\n if (responses.length) {\n throw new Error('Unflushed requests: ' + responses.length);\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $httpBackend#resetExpectations\n * @description\n * Resets all request expectations, but preserves all backend definitions. Typically, you would\n * call resetExpectations during a multiple-phase test when you want to reuse the same instance of\n * $httpBackend mock.\n */\n $httpBackend.resetExpectations = function() {\n expectations.length = 0;\n responses.length = 0;\n };\n\n return $httpBackend;\n\n\n function createShortMethods(prefix) {\n angular.forEach(['GET', 'DELETE', 'JSONP', 'HEAD'], function(method) {\n $httpBackend[prefix + method] = function(url, headers) {\n return $httpBackend[prefix](method, url, undefined, headers);\n };\n });\n\n angular.forEach(['PUT', 'POST', 'PATCH'], function(method) {\n $httpBackend[prefix + method] = function(url, data, headers) {\n return $httpBackend[prefix](method, url, data, headers);\n };\n });\n }\n}\n\nfunction MockHttpExpectation(method, url, data, headers) {\n\n this.data = data;\n this.headers = headers;\n\n this.match = function(m, u, d, h) {\n if (method != m) return false;\n if (!this.matchUrl(u)) return false;\n if (angular.isDefined(d) && !this.matchData(d)) return false;\n if (angular.isDefined(h) && !this.matchHeaders(h)) return false;\n return true;\n };\n\n this.matchUrl = function(u) {\n if (!url) return true;\n if (angular.isFunction(url.test)) return url.test(u);\n if (angular.isFunction(url)) return url(u);\n return url == u;\n };\n\n this.matchHeaders = function(h) {\n if (angular.isUndefined(headers)) return true;\n if (angular.isFunction(headers)) return headers(h);\n return angular.equals(headers, h);\n };\n\n this.matchData = function(d) {\n if (angular.isUndefined(data)) return true;\n if (data && angular.isFunction(data.test)) return data.test(d);\n if (data && angular.isFunction(data)) return data(d);\n if (data && !angular.isString(data)) {\n return angular.equals(angular.fromJson(angular.toJson(data)), angular.fromJson(d));\n }\n return data == d;\n };\n\n this.toString = function() {\n return method + ' ' + url;\n };\n}\n\nfunction createMockXhr() {\n return new MockXhr();\n}\n\nfunction MockXhr() {\n\n // hack for testing $http, $httpBackend\n MockXhr.$$lastInstance = this;\n\n this.open = function(method, url, async) {\n this.$$method = method;\n this.$$url = url;\n this.$$async = async;\n this.$$reqHeaders = {};\n this.$$respHeaders = {};\n };\n\n this.send = function(data) {\n this.$$data = data;\n };\n\n this.setRequestHeader = function(key, value) {\n this.$$reqHeaders[key] = value;\n };\n\n this.getResponseHeader = function(name) {\n // the lookup must be case insensitive,\n // that's why we try two quick lookups first and full scan last\n var header = this.$$respHeaders[name];\n if (header) return header;\n\n name = angular.lowercase(name);\n header = this.$$respHeaders[name];\n if (header) return header;\n\n header = undefined;\n angular.forEach(this.$$respHeaders, function(headerVal, headerName) {\n if (!header && angular.lowercase(headerName) == name) header = headerVal;\n });\n return header;\n };\n\n this.getAllResponseHeaders = function() {\n var lines = [];\n\n angular.forEach(this.$$respHeaders, function(value, key) {\n lines.push(key + ': ' + value);\n });\n return lines.join('\\n');\n };\n\n this.abort = angular.noop;\n}\n\n\n/**\n * @ngdoc service\n * @name $timeout\n * @description\n *\n * This service is just a simple decorator for {@link ng.$timeout $timeout} service\n * that adds a \"flush\" and \"verifyNoPendingTasks\" methods.\n */\n\nangular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $browser) {\n\n /**\n * @ngdoc method\n * @name $timeout#flush\n * @description\n *\n * Flushes the queue of pending tasks.\n *\n * @param {number=} delay maximum timeout amount to flush up until\n */\n $delegate.flush = function(delay) {\n $browser.defer.flush(delay);\n };\n\n /**\n * @ngdoc method\n * @name $timeout#verifyNoPendingTasks\n * @description\n *\n * Verifies that there are no pending tasks that need to be flushed.\n */\n $delegate.verifyNoPendingTasks = function() {\n if ($browser.deferredFns.length) {\n throw new Error('Deferred tasks to flush (' + $browser.deferredFns.length + '): ' +\n formatPendingTasksAsString($browser.deferredFns));\n }\n };\n\n function formatPendingTasksAsString(tasks) {\n var result = [];\n angular.forEach(tasks, function(task) {\n result.push('{id: ' + task.id + ', ' + 'time: ' + task.time + '}');\n });\n\n return result.join(', ');\n }\n\n return $delegate;\n}];\n\nangular.mock.$RAFDecorator = ['$delegate', function($delegate) {\n var rafFn = function(fn) {\n var index = rafFn.queue.length;\n rafFn.queue.push(fn);\n return function() {\n rafFn.queue.splice(index, 1);\n };\n };\n\n rafFn.queue = [];\n rafFn.supported = $delegate.supported;\n\n rafFn.flush = function() {\n if (rafFn.queue.length === 0) {\n throw new Error('No rAF callbacks present');\n }\n\n var length = rafFn.queue.length;\n for (var i = 0; i < length; i++) {\n rafFn.queue[i]();\n }\n\n rafFn.queue = rafFn.queue.slice(i);\n };\n\n return rafFn;\n}];\n\n/**\n *\n */\nangular.mock.$RootElementProvider = function() {\n this.$get = function() {\n return angular.element('<div ng-app></div>');\n };\n};\n\n/**\n * @ngdoc service\n * @name $controller\n * @description\n * A decorator for {@link ng.$controller} with additional `bindings` parameter, useful when testing\n * controllers of directives that use {@link $compile#-bindtocontroller- `bindToController`}.\n *\n *\n * ## Example\n *\n * ```js\n *\n * // Directive definition ...\n *\n * myMod.directive('myDirective', {\n * controller: 'MyDirectiveController',\n * bindToController: {\n * name: '@'\n * }\n * });\n *\n *\n * // Controller definition ...\n *\n * myMod.controller('MyDirectiveController', ['$log', function($log) {\n * $log.info(this.name);\n * }]);\n *\n *\n * // In a test ...\n *\n * describe('myDirectiveController', function() {\n * it('should write the bound name to the log', inject(function($controller, $log) {\n * var ctrl = $controller('MyDirectiveController', { /* no locals */ }, { name: 'Clark Kent' });\n * expect(ctrl.name).toEqual('Clark Kent');\n * expect($log.info.logs).toEqual(['Clark Kent']);\n * }));\n * });\n *\n * ```\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n * `window` object (not recommended)\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @param {Object=} bindings Properties to add to the controller before invoking the constructor. This is used\n * to simulate the `bindToController` feature and simplify certain kinds of tests.\n * @return {Object} Instance of given controller.\n */\nangular.mock.$ControllerDecorator = ['$delegate', function($delegate) {\n return function(expression, locals, later, ident) {\n if (later && typeof later === 'object') {\n var create = $delegate(expression, locals, true, ident);\n angular.extend(create.instance, later);\n return create();\n }\n return $delegate(expression, locals, later, ident);\n };\n}];\n\n\n/**\n * @ngdoc module\n * @name ngMock\n * @packageName angular-mocks\n * @description\n *\n * # ngMock\n *\n * The `ngMock` module provides support to inject and mock Angular services into unit tests.\n * In addition, ngMock also extends various core ng services such that they can be\n * inspected and controlled in a synchronous manner within test code.\n *\n *\n * <div doc-module-components=\"ngMock\"></div>\n *\n */\nangular.module('ngMock', ['ng']).provider({\n $browser: angular.mock.$BrowserProvider,\n $exceptionHandler: angular.mock.$ExceptionHandlerProvider,\n $log: angular.mock.$LogProvider,\n $interval: angular.mock.$IntervalProvider,\n $httpBackend: angular.mock.$HttpBackendProvider,\n $rootElement: angular.mock.$RootElementProvider\n}).config(['$provide', function($provide) {\n $provide.decorator('$timeout', angular.mock.$TimeoutDecorator);\n $provide.decorator('$$rAF', angular.mock.$RAFDecorator);\n $provide.decorator('$rootScope', angular.mock.$RootScopeDecorator);\n $provide.decorator('$controller', angular.mock.$ControllerDecorator);\n}]);\n\n/**\n * @ngdoc module\n * @name ngMockE2E\n * @module ngMockE2E\n * @packageName angular-mocks\n * @description\n *\n * The `ngMockE2E` is an angular module which contains mocks suitable for end-to-end testing.\n * Currently there is only one mock present in this module -\n * the {@link ngMockE2E.$httpBackend e2e $httpBackend} mock.\n */\nangular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {\n $provide.decorator('$httpBackend', angular.mock.e2e.$httpBackendDecorator);\n}]);\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @module ngMockE2E\n * @description\n * Fake HTTP backend implementation suitable for end-to-end testing or backend-less development of\n * applications that use the {@link ng.$http $http service}.\n *\n * *Note*: For fake http backend implementation suitable for unit testing please see\n * {@link ngMock.$httpBackend unit-testing $httpBackend mock}.\n *\n * This implementation can be used to respond with static or dynamic responses via the `when` api\n * and its shortcuts (`whenGET`, `whenPOST`, etc) and optionally pass through requests to the\n * real $httpBackend for specific requests (e.g. to interact with certain remote apis or to fetch\n * templates from a webserver).\n *\n * As opposed to unit-testing, in an end-to-end testing scenario or in scenario when an application\n * is being developed with the real backend api replaced with a mock, it is often desirable for\n * certain category of requests to bypass the mock and issue a real http request (e.g. to fetch\n * templates or static files from the webserver). To configure the backend with this behavior\n * use the `passThrough` request handler of `when` instead of `respond`.\n *\n * Additionally, we don't want to manually have to flush mocked out requests like we do during unit\n * testing. For this reason the e2e $httpBackend flushes mocked out requests\n * automatically, closely simulating the behavior of the XMLHttpRequest object.\n *\n * To setup the application to run with this http backend, you have to create a module that depends\n * on the `ngMockE2E` and your application modules and defines the fake backend:\n *\n * ```js\n * myAppDev = angular.module('myAppDev', ['myApp', 'ngMockE2E']);\n * myAppDev.run(function($httpBackend) {\n * phones = [{name: 'phone1'}, {name: 'phone2'}];\n *\n * // returns the current list of phones\n * $httpBackend.whenGET('/phones').respond(phones);\n *\n * // adds a new phone to the phones array\n * $httpBackend.whenPOST('/phones').respond(function(method, url, data) {\n * var phone = angular.fromJson(data);\n * phones.push(phone);\n * return [200, phone, {}];\n * });\n * $httpBackend.whenGET(/^\\/templates\\//).passThrough();\n * //...\n * });\n * ```\n *\n * Afterwards, bootstrap your app with this new module.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#when\n * @module ngMockE2E\n * @description\n * Creates a new backend definition.\n *\n * @param {string} method HTTP method.\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers or function that receives http header\n * object and returns true if the headers match the current definition.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n *\n * - respond –\n * `{function([status,] data[, headers, statusText])\n * | function(function(method, url, data, headers)}`\n * – The respond method takes a set of static data to be returned or a function that can return\n * an array containing response status (number), response data (string), response headers\n * (Object), and the text for the status (string).\n * - passThrough – `{function()}` – Any request matching a backend definition with\n * `passThrough` handler will be passed through to the real backend (an XHR request will be made\n * to the server.)\n * - Both methods return the `requestHandler` object for possible overrides.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenGET\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for GET requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenHEAD\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for HEAD requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenDELETE\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for DELETE requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenPOST\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for POST requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenPUT\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for PUT requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenPATCH\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for PATCH requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @param {(string|RegExp)=} data HTTP request body.\n * @param {(Object|function(Object))=} headers HTTP headers.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\n\n/**\n * @ngdoc method\n * @name $httpBackend#whenJSONP\n * @module ngMockE2E\n * @description\n * Creates a new backend definition for JSONP requests. For more info see `when()`.\n *\n * @param {string|RegExp|function(string)} url HTTP url or function that receives a url\n * and returns true if the url matches the current definition.\n * @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that\n * control how a matched request is handled. You can save this object for later use and invoke\n * `respond` or `passThrough` again in order to change how a matched request is handled.\n */\nangular.mock.e2e = {};\nangular.mock.e2e.$httpBackendDecorator =\n ['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];\n\n\n/**\n * @ngdoc type\n * @name $rootScope.Scope\n * @module ngMock\n * @description\n * {@link ng.$rootScope.Scope Scope} type decorated with helper methods useful for testing. These\n * methods are automatically available on any {@link ng.$rootScope.Scope Scope} instance when\n * `ngMock` module is loaded.\n *\n * In addition to all the regular `Scope` methods, the following helper methods are available:\n */\nangular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {\n\n var $rootScopePrototype = Object.getPrototypeOf($delegate);\n\n $rootScopePrototype.$countChildScopes = countChildScopes;\n $rootScopePrototype.$countWatchers = countWatchers;\n\n return $delegate;\n\n // ------------------------------------------------------------------------------------------ //\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$countChildScopes\n * @module ngMock\n * @description\n * Counts all the direct and indirect child scopes of the current scope.\n *\n * The current scope is excluded from the count. The count includes all isolate child scopes.\n *\n * @returns {number} Total number of child scopes.\n */\n function countChildScopes() {\n // jshint validthis: true\n var count = 0; // exclude the current scope\n var pendingChildHeads = [this.$$childHead];\n var currentScope;\n\n while (pendingChildHeads.length) {\n currentScope = pendingChildHeads.shift();\n\n while (currentScope) {\n count += 1;\n pendingChildHeads.push(currentScope.$$childHead);\n currentScope = currentScope.$$nextSibling;\n }\n }\n\n return count;\n }\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$countWatchers\n * @module ngMock\n * @description\n * Counts all the watchers of direct and indirect child scopes of the current scope.\n *\n * The watchers of the current scope are included in the count and so are all the watchers of\n * isolate child scopes.\n *\n * @returns {number} Total number of watchers.\n */\n function countWatchers() {\n // jshint validthis: true\n var count = this.$$watchers ? this.$$watchers.length : 0; // include the current scope\n var pendingChildHeads = [this.$$childHead];\n var currentScope;\n\n while (pendingChildHeads.length) {\n currentScope = pendingChildHeads.shift();\n\n while (currentScope) {\n count += currentScope.$$watchers ? currentScope.$$watchers.length : 0;\n pendingChildHeads.push(currentScope.$$childHead);\n currentScope = currentScope.$$nextSibling;\n }\n }\n\n return count;\n }\n}];\n\n\nif (window.jasmine || window.mocha) {\n\n var currentSpec = null,\n annotatedFunctions = [],\n isSpecRunning = function() {\n return !!currentSpec;\n };\n\n angular.mock.$$annotate = angular.injector.$$annotate;\n angular.injector.$$annotate = function(fn) {\n if (typeof fn === 'function' && !fn.$inject) {\n annotatedFunctions.push(fn);\n }\n return angular.mock.$$annotate.apply(this, arguments);\n };\n\n\n (window.beforeEach || window.setup)(function() {\n annotatedFunctions = [];\n currentSpec = this;\n });\n\n (window.afterEach || window.teardown)(function() {\n var injector = currentSpec.$injector;\n\n annotatedFunctions.forEach(function(fn) {\n delete fn.$inject;\n });\n\n angular.forEach(currentSpec.$modules, function(module) {\n if (module && module.$$hashKey) {\n module.$$hashKey = undefined;\n }\n });\n\n currentSpec.$injector = null;\n currentSpec.$modules = null;\n currentSpec = null;\n\n if (injector) {\n injector.get('$rootElement').off();\n }\n\n // clean up jquery's fragment cache\n angular.forEach(angular.element.fragments, function(val, key) {\n delete angular.element.fragments[key];\n });\n\n MockXhr.$$lastInstance = null;\n\n angular.forEach(angular.callbacks, function(val, key) {\n delete angular.callbacks[key];\n });\n angular.callbacks.counter = 0;\n });\n\n /**\n * @ngdoc function\n * @name angular.mock.module\n * @description\n *\n * *NOTE*: This function is also published on window for easy access.<br>\n * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha\n *\n * This function registers a module configuration code. It collects the configuration information\n * which will be used when the injector is created by {@link angular.mock.inject inject}.\n *\n * See {@link angular.mock.inject inject} for usage example\n *\n * @param {...(string|Function|Object)} fns any number of modules which are represented as string\n * aliases or as anonymous module initialization functions. The modules are used to\n * configure the injector. The 'ng' and 'ngMock' modules are automatically loaded. If an\n * object literal is passed each key-value pair will be registered on the module via\n * {@link auto.$provide $provide}.value, the key being the string name (or token) to associate\n * with the value on the injector.\n */\n window.module = angular.mock.module = function() {\n var moduleFns = Array.prototype.slice.call(arguments, 0);\n return isSpecRunning() ? workFn() : workFn;\n /////////////////////\n function workFn() {\n if (currentSpec.$injector) {\n throw new Error('Injector already created, can not register a module!');\n } else {\n var modules = currentSpec.$modules || (currentSpec.$modules = []);\n angular.forEach(moduleFns, function(module) {\n if (angular.isObject(module) && !angular.isArray(module)) {\n modules.push(function($provide) {\n angular.forEach(module, function(value, key) {\n $provide.value(key, value);\n });\n });\n } else {\n modules.push(module);\n }\n });\n }\n }\n };\n\n /**\n * @ngdoc function\n * @name angular.mock.inject\n * @description\n *\n * *NOTE*: This function is also published on window for easy access.<br>\n * *NOTE*: This function is declared ONLY WHEN running tests with jasmine or mocha\n *\n * The inject function wraps a function into an injectable function. The inject() creates new\n * instance of {@link auto.$injector $injector} per test, which is then used for\n * resolving references.\n *\n *\n * ## Resolving References (Underscore Wrapping)\n * Often, we would like to inject a reference once, in a `beforeEach()` block and reuse this\n * in multiple `it()` clauses. To be able to do this we must assign the reference to a variable\n * that is declared in the scope of the `describe()` block. Since we would, most likely, want\n * the variable to have the same name of the reference we have a problem, since the parameter\n * to the `inject()` function would hide the outer variable.\n *\n * To help with this, the injected parameters can, optionally, be enclosed with underscores.\n * These are ignored by the injector when the reference name is resolved.\n *\n * For example, the parameter `_myService_` would be resolved as the reference `myService`.\n * Since it is available in the function body as _myService_, we can then assign it to a variable\n * defined in an outer scope.\n *\n * ```\n * // Defined out reference variable outside\n * var myService;\n *\n * // Wrap the parameter in underscores\n * beforeEach( inject( function(_myService_){\n * myService = _myService_;\n * }));\n *\n * // Use myService in a series of tests.\n * it('makes use of myService', function() {\n * myService.doStuff();\n * });\n *\n * ```\n *\n * See also {@link angular.mock.module angular.mock.module}\n *\n * ## Example\n * Example of what a typical jasmine tests looks like with the inject method.\n * ```js\n *\n * angular.module('myApplicationModule', [])\n * .value('mode', 'app')\n * .value('version', 'v1.0.1');\n *\n *\n * describe('MyApp', function() {\n *\n * // You need to load modules that you want to test,\n * // it loads only the \"ng\" module by default.\n * beforeEach(module('myApplicationModule'));\n *\n *\n * // inject() is used to inject arguments of all given functions\n * it('should provide a version', inject(function(mode, version) {\n * expect(version).toEqual('v1.0.1');\n * expect(mode).toEqual('app');\n * }));\n *\n *\n * // The inject and module method can also be used inside of the it or beforeEach\n * it('should override a version and test the new version is injected', function() {\n * // module() takes functions or strings (module aliases)\n * module(function($provide) {\n * $provide.value('version', 'overridden'); // override version here\n * });\n *\n * inject(function(version) {\n * expect(version).toEqual('overridden');\n * });\n * });\n * });\n *\n * ```\n *\n * @param {...Function} fns any number of functions which will be injected using the injector.\n */\n\n\n\n var ErrorAddingDeclarationLocationStack = function(e, errorForStack) {\n this.message = e.message;\n this.name = e.name;\n if (e.line) this.line = e.line;\n if (e.sourceId) this.sourceId = e.sourceId;\n if (e.stack && errorForStack)\n this.stack = e.stack + '\\n' + errorForStack.stack;\n if (e.stackArray) this.stackArray = e.stackArray;\n };\n ErrorAddingDeclarationLocationStack.prototype.toString = Error.prototype.toString;\n\n window.inject = angular.mock.inject = function() {\n var blockFns = Array.prototype.slice.call(arguments, 0);\n var errorForStack = new Error('Declaration Location');\n // IE10+ and PhanthomJS do not set stack trace information, until the error is thrown\n if (!errorForStack.stack) {\n try {\n throw errorForStack;\n } catch (e) {}\n }\n return isSpecRunning() ? workFn.call(currentSpec) : workFn;\n /////////////////////\n function workFn() {\n var modules = currentSpec.$modules || [];\n var strictDi = !!currentSpec.$injectorStrict;\n modules.unshift('ngMock');\n modules.unshift('ng');\n var injector = currentSpec.$injector;\n if (!injector) {\n if (strictDi) {\n // If strictDi is enabled, annotate the providerInjector blocks\n angular.forEach(modules, function(moduleFn) {\n if (typeof moduleFn === \"function\") {\n angular.injector.$$annotate(moduleFn);\n }\n });\n }\n injector = currentSpec.$injector = angular.injector(modules, strictDi);\n currentSpec.$injectorStrict = strictDi;\n }\n for (var i = 0, ii = blockFns.length; i < ii; i++) {\n if (currentSpec.$injectorStrict) {\n // If the injector is strict / strictDi, and the spec wants to inject using automatic\n // annotation, then annotate the function here.\n injector.annotate(blockFns[i]);\n }\n try {\n /* jshint -W040 *//* Jasmine explicitly provides a `this` object when calling functions */\n injector.invoke(blockFns[i] || angular.noop, this);\n /* jshint +W040 */\n } catch (e) {\n if (e.stack && errorForStack) {\n throw new ErrorAddingDeclarationLocationStack(e, errorForStack);\n }\n throw e;\n } finally {\n errorForStack = null;\n }\n }\n }\n };\n\n\n angular.mock.inject.strictDi = function(value) {\n value = arguments.length ? !!value : true;\n return isSpecRunning() ? workFn() : workFn;\n\n function workFn() {\n if (value !== currentSpec.$injectorStrict) {\n if (currentSpec.$injector) {\n throw new Error('Injector already created, can not modify strict annotations');\n } else {\n currentSpec.$injectorStrict = value;\n }\n }\n }\n };\n}\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.6.6\n * (c) 2010-2017 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\nvar forEach;\nvar isArray;\nvar isString;\nvar jqLite;\n\n/**\n * @ngdoc module\n * @name ngMessages\n * @description\n *\n * The `ngMessages` module provides enhanced support for displaying messages within templates\n * (typically within forms or when rendering message objects that return key/value data).\n * Instead of relying on JavaScript code and/or complex ng-if statements within your form template to\n * show and hide error messages specific to the state of an input field, the `ngMessages` and\n * `ngMessage` directives are designed to handle the complexity, inheritance and priority\n * sequencing based on the order of how the messages are defined in the template.\n *\n * Currently, the ngMessages module only contains the code for the `ngMessages`, `ngMessagesInclude`\n * `ngMessage` and `ngMessageExp` directives.\n *\n * # Usage\n * The `ngMessages` directive allows keys in a key/value collection to be associated with a child element\n * (or 'message') that will show or hide based on the truthiness of that key's value in the collection. A common use\n * case for `ngMessages` is to display error messages for inputs using the `$error` object exposed by the\n * {@link ngModel ngModel} directive.\n *\n * The child elements of the `ngMessages` directive are matched to the collection keys by a `ngMessage` or\n * `ngMessageExp` directive. The value of these attributes must match a key in the collection that is provided by\n * the `ngMessages` directive.\n *\n * Consider the following example, which illustrates a typical use case of `ngMessages`. Within the form `myForm` we\n * have a text input named `myField` which is bound to the scope variable `field` using the {@link ngModel ngModel}\n * directive.\n *\n * The `myField` field is a required input of type `email` with a maximum length of 15 characters.\n *\n * ```html\n * <form name=\"myForm\">\n * <label>\n * Enter text:\n * <input type=\"email\" ng-model=\"field\" name=\"myField\" required maxlength=\"15\" />\n * </label>\n * <div ng-messages=\"myForm.myField.$error\" role=\"alert\">\n * <div ng-message=\"required\">Please enter a value for this field.</div>\n * <div ng-message=\"email\">This field must be a valid email address.</div>\n * <div ng-message=\"maxlength\">This field can be at most 15 characters long.</div>\n * </div>\n * </form>\n * ```\n *\n * In order to show error messages corresponding to `myField` we first create an element with an `ngMessages` attribute\n * set to the `$error` object owned by the `myField` input in our `myForm` form.\n *\n * Within this element we then create separate elements for each of the possible errors that `myField` could have.\n * The `ngMessage` attribute is used to declare which element(s) will appear for which error - for example,\n * setting `ng-message=\"required\"` specifies that this particular element should be displayed when there\n * is no value present for the required field `myField` (because the key `required` will be `true` in the object\n * `myForm.myField.$error`).\n *\n * ### Message order\n *\n * By default, `ngMessages` will only display one message for a particular key/value collection at any time. If more\n * than one message (or error) key is currently true, then which message is shown is determined by the order of messages\n * in the HTML template code (messages declared first are prioritised). This mechanism means the developer does not have\n * to prioritize messages using custom JavaScript code.\n *\n * Given the following error object for our example (which informs us that the field `myField` currently has both the\n * `required` and `email` errors):\n *\n * ```javascript\n * <!-- keep in mind that ngModel automatically sets these error flags -->\n * myField.$error = { required : true, email: true, maxlength: false };\n * ```\n * The `required` message will be displayed to the user since it appears before the `email` message in the DOM.\n * Once the user types a single character, the `required` message will disappear (since the field now has a value)\n * but the `email` message will be visible because it is still applicable.\n *\n * ### Displaying multiple messages at the same time\n *\n * While `ngMessages` will by default only display one error element at a time, the `ng-messages-multiple` attribute can\n * be applied to the `ngMessages` container element to cause it to display all applicable error messages at once:\n *\n * ```html\n * <!-- attribute-style usage -->\n * <div ng-messages=\"myForm.myField.$error\" ng-messages-multiple>...</div>\n *\n * <!-- element-style usage -->\n * <ng-messages for=\"myForm.myField.$error\" multiple>...</ng-messages>\n * ```\n *\n * ## Reusing and Overriding Messages\n * In addition to prioritization, ngMessages also allows for including messages from a remote or an inline\n * template. This allows for generic collection of messages to be reused across multiple parts of an\n * application.\n *\n * ```html\n * <script type=\"text/ng-template\" id=\"error-messages\">\n * <div ng-message=\"required\">This field is required</div>\n * <div ng-message=\"minlength\">This field is too short</div>\n * </script>\n *\n * <div ng-messages=\"myForm.myField.$error\" role=\"alert\">\n * <div ng-messages-include=\"error-messages\"></div>\n * </div>\n * ```\n *\n * However, including generic messages may not be useful enough to match all input fields, therefore,\n * `ngMessages` provides the ability to override messages defined in the remote template by redefining\n * them within the directive container.\n *\n * ```html\n * <!-- a generic template of error messages known as \"my-custom-messages\" -->\n * <script type=\"text/ng-template\" id=\"my-custom-messages\">\n * <div ng-message=\"required\">This field is required</div>\n * <div ng-message=\"minlength\">This field is too short</div>\n * </script>\n *\n * <form name=\"myForm\">\n * <label>\n * Email address\n * <input type=\"email\"\n * id=\"email\"\n * name=\"myEmail\"\n * ng-model=\"email\"\n * minlength=\"5\"\n * required />\n * </label>\n * <!-- any ng-message elements that appear BEFORE the ng-messages-include will\n * override the messages present in the ng-messages-include template -->\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <!-- this required message has overridden the template message -->\n * <div ng-message=\"required\">You did not enter your email address</div>\n *\n * <!-- this is a brand new message and will appear last in the prioritization -->\n * <div ng-message=\"email\">Your email address is invalid</div>\n *\n * <!-- and here are the generic error messages -->\n * <div ng-messages-include=\"my-custom-messages\"></div>\n * </div>\n * </form>\n * ```\n *\n * In the example HTML code above the message that is set on required will override the corresponding\n * required message defined within the remote template. Therefore, with particular input fields (such\n * email addresses, date fields, autocomplete inputs, etc...), specialized error messages can be applied\n * while more generic messages can be used to handle other, more general input errors.\n *\n * ## Dynamic Messaging\n * ngMessages also supports using expressions to dynamically change key values. Using arrays and\n * repeaters to list messages is also supported. This means that the code below will be able to\n * fully adapt itself and display the appropriate message when any of the expression data changes:\n *\n * ```html\n * <form name=\"myForm\">\n * <label>\n * Email address\n * <input type=\"email\"\n * name=\"myEmail\"\n * ng-model=\"email\"\n * minlength=\"5\"\n * required />\n * </label>\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <div ng-message=\"required\">You did not enter your email address</div>\n * <div ng-repeat=\"errorMessage in errorMessages\">\n * <!-- use ng-message-exp for a message whose key is given by an expression -->\n * <div ng-message-exp=\"errorMessage.type\">{{ errorMessage.text }}</div>\n * </div>\n * </div>\n * </form>\n * ```\n *\n * The `errorMessage.type` expression can be a string value or it can be an array so\n * that multiple errors can be associated with a single error message:\n *\n * ```html\n * <label>\n * Email address\n * <input type=\"email\"\n * ng-model=\"data.email\"\n * name=\"myEmail\"\n * ng-minlength=\"5\"\n * ng-maxlength=\"100\"\n * required />\n * </label>\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <div ng-message-exp=\"'required'\">You did not enter your email address</div>\n * <div ng-message-exp=\"['minlength', 'maxlength']\">\n * Your email must be between 5 and 100 characters long\n * </div>\n * </div>\n * ```\n *\n * Feel free to use other structural directives such as ng-if and ng-switch to further control\n * what messages are active and when. Be careful, if you place ng-message on the same element\n * as these structural directives, Angular may not be able to determine if a message is active\n * or not. Therefore it is best to place the ng-message on a child element of the structural\n * directive.\n *\n * ```html\n * <div ng-messages=\"myForm.myEmail.$error\" role=\"alert\">\n * <div ng-if=\"showRequiredError\">\n * <div ng-message=\"required\">Please enter something</div>\n * </div>\n * </div>\n * ```\n *\n * ## Animations\n * If the `ngAnimate` module is active within the application then the `ngMessages`, `ngMessage` and\n * `ngMessageExp` directives will trigger animations whenever any messages are added and removed from\n * the DOM by the `ngMessages` directive.\n *\n * Whenever the `ngMessages` directive contains one or more visible messages then the `.ng-active` CSS\n * class will be added to the element. The `.ng-inactive` CSS class will be applied when there are no\n * messages present. Therefore, CSS transitions and keyframes as well as JavaScript animations can\n * hook into the animations whenever these classes are added/removed.\n *\n * Let's say that our HTML code for our messages container looks like so:\n *\n * ```html\n * <div ng-messages=\"myMessages\" class=\"my-messages\" role=\"alert\">\n * <div ng-message=\"alert\" class=\"some-message\">...</div>\n * <div ng-message=\"fail\" class=\"some-message\">...</div>\n * </div>\n * ```\n *\n * Then the CSS animation code for the message container looks like so:\n *\n * ```css\n * .my-messages {\n * transition:1s linear all;\n * }\n * .my-messages.ng-active {\n * // messages are visible\n * }\n * .my-messages.ng-inactive {\n * // messages are hidden\n * }\n * ```\n *\n * Whenever an inner message is attached (becomes visible) or removed (becomes hidden) then the enter\n * and leave animation is triggered for each particular element bound to the `ngMessage` directive.\n *\n * Therefore, the CSS code for the inner messages looks like so:\n *\n * ```css\n * .some-message {\n * transition:1s linear all;\n * }\n *\n * .some-message.ng-enter {}\n * .some-message.ng-enter.ng-enter-active {}\n *\n * .some-message.ng-leave {}\n * .some-message.ng-leave.ng-leave-active {}\n * ```\n *\n * {@link ngAnimate Click here} to learn how to use JavaScript animations or to learn more about ngAnimate.\n */\nangular.module('ngMessages', [], function initAngularHelpers() {\n // Access helpers from angular core.\n // Do it inside a `config` block to ensure `window.angular` is available.\n forEach = angular.forEach;\n isArray = angular.isArray;\n isString = angular.isString;\n jqLite = angular.element;\n})\n .info({ angularVersion: '1.6.6' })\n\n /**\n * @ngdoc directive\n * @module ngMessages\n * @name ngMessages\n * @restrict AE\n *\n * @description\n * `ngMessages` is a directive that is designed to show and hide messages based on the state\n * of a key/value object that it listens on. The directive itself complements error message\n * reporting with the `ngModel` $error object (which stores a key/value state of validation errors).\n *\n * `ngMessages` manages the state of internal messages within its container element. The internal\n * messages use the `ngMessage` directive and will be inserted/removed from the page depending\n * on if they're present within the key/value object. By default, only one message will be displayed\n * at a time and this depends on the prioritization of the messages within the template. (This can\n * be changed by using the `ng-messages-multiple` or `multiple` attribute on the directive container.)\n *\n * A remote template can also be used to promote message reusability and messages can also be\n * overridden.\n *\n * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\" role=\"alert\">\n * <ANY ng-message=\"stringValue\">...</ANY>\n * <ANY ng-message=\"stringValue1, stringValue2, ...\">...</ANY>\n * <ANY ng-message-exp=\"expressionValue\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\" role=\"alert\">\n * <ng-message when=\"stringValue\">...</ng-message>\n * <ng-message when=\"stringValue1, stringValue2, ...\">...</ng-message>\n * <ng-message when-exp=\"expressionValue\">...</ng-message>\n * </ng-messages>\n * ```\n *\n * @param {string} ngMessages an angular expression evaluating to a key/value object\n * (this is typically the $error object on an ngModel instance).\n * @param {string=} ngMessagesMultiple|multiple when set, all messages will be displayed with true\n *\n * @example\n * <example name=\"ngMessages-directive\" module=\"ngMessagesExample\"\n * deps=\"angular-messages.js\"\n * animations=\"true\" fixBase=\"true\">\n * <file name=\"index.html\">\n * <form name=\"myForm\">\n * <label>\n * Enter your name:\n * <input type=\"text\"\n * name=\"myName\"\n * ng-model=\"name\"\n * ng-minlength=\"5\"\n * ng-maxlength=\"20\"\n * required />\n * </label>\n * <pre>myForm.myName.$error = {{ myForm.myName.$error | json }}</pre>\n *\n * <div ng-messages=\"myForm.myName.$error\" style=\"color:maroon\" role=\"alert\">\n * <div ng-message=\"required\">You did not enter a field</div>\n * <div ng-message=\"minlength\">Your field is too short</div>\n * <div ng-message=\"maxlength\">Your field is too long</div>\n * </div>\n * </form>\n * </file>\n * <file name=\"script.js\">\n * angular.module('ngMessagesExample', ['ngMessages']);\n * </file>\n * </example>\n */\n .directive('ngMessages', ['$animate', function($animate) {\n var ACTIVE_CLASS = 'ng-active';\n var INACTIVE_CLASS = 'ng-inactive';\n\n return {\n require: 'ngMessages',\n restrict: 'AE',\n controller: ['$element', '$scope', '$attrs', function NgMessagesCtrl($element, $scope, $attrs) {\n var ctrl = this;\n var latestKey = 0;\n var nextAttachId = 0;\n\n this.getAttachId = function getAttachId() { return nextAttachId++; };\n\n var messages = this.messages = {};\n var renderLater, cachedCollection;\n\n this.render = function(collection) {\n collection = collection || {};\n\n renderLater = false;\n cachedCollection = collection;\n\n // this is true if the attribute is empty or if the attribute value is truthy\n var multiple = isAttrTruthy($scope, $attrs.ngMessagesMultiple) ||\n isAttrTruthy($scope, $attrs.multiple);\n\n var unmatchedMessages = [];\n var matchedKeys = {};\n var messageItem = ctrl.head;\n var messageFound = false;\n var totalMessages = 0;\n\n // we use != instead of !== to allow for both undefined and null values\n while (messageItem != null) {\n totalMessages++;\n var messageCtrl = messageItem.message;\n\n var messageUsed = false;\n if (!messageFound) {\n forEach(collection, function(value, key) {\n if (!messageUsed && truthy(value) && messageCtrl.test(key)) {\n // this is to prevent the same error name from showing up twice\n if (matchedKeys[key]) return;\n matchedKeys[key] = true;\n\n messageUsed = true;\n messageCtrl.attach();\n }\n });\n }\n\n if (messageUsed) {\n // unless we want to display multiple messages then we should\n // set a flag here to avoid displaying the next message in the list\n messageFound = !multiple;\n } else {\n unmatchedMessages.push(messageCtrl);\n }\n\n messageItem = messageItem.next;\n }\n\n forEach(unmatchedMessages, function(messageCtrl) {\n messageCtrl.detach();\n });\n\n if (unmatchedMessages.length !== totalMessages) {\n $animate.setClass($element, ACTIVE_CLASS, INACTIVE_CLASS);\n } else {\n $animate.setClass($element, INACTIVE_CLASS, ACTIVE_CLASS);\n }\n };\n\n $scope.$watchCollection($attrs.ngMessages || $attrs['for'], ctrl.render);\n\n // If the element is destroyed, proactively destroy all the currently visible messages\n $element.on('$destroy', function() {\n forEach(messages, function(item) {\n item.message.detach();\n });\n });\n\n this.reRender = function() {\n if (!renderLater) {\n renderLater = true;\n $scope.$evalAsync(function() {\n if (renderLater && cachedCollection) {\n ctrl.render(cachedCollection);\n }\n });\n }\n };\n\n this.register = function(comment, messageCtrl) {\n var nextKey = latestKey.toString();\n messages[nextKey] = {\n message: messageCtrl\n };\n insertMessageNode($element[0], comment, nextKey);\n comment.$$ngMessageNode = nextKey;\n latestKey++;\n\n ctrl.reRender();\n };\n\n this.deregister = function(comment) {\n var key = comment.$$ngMessageNode;\n delete comment.$$ngMessageNode;\n removeMessageNode($element[0], comment, key);\n delete messages[key];\n ctrl.reRender();\n };\n\n function findPreviousMessage(parent, comment) {\n var prevNode = comment;\n var parentLookup = [];\n\n while (prevNode && prevNode !== parent) {\n var prevKey = prevNode.$$ngMessageNode;\n if (prevKey && prevKey.length) {\n return messages[prevKey];\n }\n\n // dive deeper into the DOM and examine its children for any ngMessage\n // comments that may be in an element that appears deeper in the list\n if (prevNode.childNodes.length && parentLookup.indexOf(prevNode) === -1) {\n parentLookup.push(prevNode);\n prevNode = prevNode.childNodes[prevNode.childNodes.length - 1];\n } else if (prevNode.previousSibling) {\n prevNode = prevNode.previousSibling;\n } else {\n prevNode = prevNode.parentNode;\n parentLookup.push(prevNode);\n }\n }\n }\n\n function insertMessageNode(parent, comment, key) {\n var messageNode = messages[key];\n if (!ctrl.head) {\n ctrl.head = messageNode;\n } else {\n var match = findPreviousMessage(parent, comment);\n if (match) {\n messageNode.next = match.next;\n match.next = messageNode;\n } else {\n messageNode.next = ctrl.head;\n ctrl.head = messageNode;\n }\n }\n }\n\n function removeMessageNode(parent, comment, key) {\n var messageNode = messages[key];\n\n var match = findPreviousMessage(parent, comment);\n if (match) {\n match.next = messageNode.next;\n } else {\n ctrl.head = messageNode.next;\n }\n }\n }]\n };\n\n function isAttrTruthy(scope, attr) {\n return (isString(attr) && attr.length === 0) || //empty attribute\n truthy(scope.$eval(attr));\n }\n\n function truthy(val) {\n return isString(val) ? val.length : !!val;\n }\n }])\n\n /**\n * @ngdoc directive\n * @name ngMessagesInclude\n * @restrict AE\n * @scope\n *\n * @description\n * `ngMessagesInclude` is a directive with the purpose to import existing ngMessage template\n * code from a remote template and place the downloaded template code into the exact spot\n * that the ngMessagesInclude directive is placed within the ngMessages container. This allows\n * for a series of pre-defined messages to be reused and also allows for the developer to\n * determine what messages are overridden due to the placement of the ngMessagesInclude directive.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\" role=\"alert\">\n * <ANY ng-messages-include=\"remoteTplString\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\" role=\"alert\">\n * <ng-messages-include src=\"expressionValue1\">...</ng-messages-include>\n * </ng-messages>\n * ```\n *\n * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.\n *\n * @param {string} ngMessagesInclude|src a string value corresponding to the remote template.\n */\n .directive('ngMessagesInclude',\n ['$templateRequest', '$document', '$compile', function($templateRequest, $document, $compile) {\n\n return {\n restrict: 'AE',\n require: '^^ngMessages', // we only require this for validation sake\n link: function($scope, element, attrs) {\n var src = attrs.ngMessagesInclude || attrs.src;\n $templateRequest(src).then(function(html) {\n if ($scope.$$destroyed) return;\n\n if (isString(html) && !html.trim()) {\n // Empty template - nothing to compile\n replaceElementWithMarker(element, src);\n } else {\n // Non-empty template - compile and link\n $compile(html)($scope, function(contents) {\n element.after(contents);\n replaceElementWithMarker(element, src);\n });\n }\n });\n }\n };\n\n // Helpers\n function replaceElementWithMarker(element, src) {\n // A comment marker is placed for debugging purposes\n var comment = $compile.$$createComment ?\n $compile.$$createComment('ngMessagesInclude', src) :\n $document[0].createComment(' ngMessagesInclude: ' + src + ' ');\n var marker = jqLite(comment);\n element.after(marker);\n\n // Don't pollute the DOM anymore by keeping an empty directive element\n element.remove();\n }\n }])\n\n /**\n * @ngdoc directive\n * @name ngMessage\n * @restrict AE\n * @scope\n *\n * @description\n * `ngMessage` is a directive with the purpose to show and hide a particular message.\n * For `ngMessage` to operate, a parent `ngMessages` directive on a parent DOM element\n * must be situated since it determines which messages are visible based on the state\n * of the provided key/value map that `ngMessages` listens on.\n *\n * More information about using `ngMessage` can be found in the\n * {@link module:ngMessages `ngMessages` module documentation}.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\" role=\"alert\">\n * <ANY ng-message=\"stringValue\">...</ANY>\n * <ANY ng-message=\"stringValue1, stringValue2, ...\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\" role=\"alert\">\n * <ng-message when=\"stringValue\">...</ng-message>\n * <ng-message when=\"stringValue1, stringValue2, ...\">...</ng-message>\n * </ng-messages>\n * ```\n *\n * @param {expression} ngMessage|when a string value corresponding to the message key.\n */\n .directive('ngMessage', ngMessageDirectiveFactory())\n\n\n /**\n * @ngdoc directive\n * @name ngMessageExp\n * @restrict AE\n * @priority 1\n * @scope\n *\n * @description\n * `ngMessageExp` is the same as {@link directive:ngMessage `ngMessage`}, but instead of a static\n * value, it accepts an expression to be evaluated for the message key.\n *\n * @usage\n * ```html\n * <!-- using attribute directives -->\n * <ANY ng-messages=\"expression\">\n * <ANY ng-message-exp=\"expressionValue\">...</ANY>\n * </ANY>\n *\n * <!-- or by using element directives -->\n * <ng-messages for=\"expression\">\n * <ng-message when-exp=\"expressionValue\">...</ng-message>\n * </ng-messages>\n * ```\n *\n * {@link module:ngMessages Click here} to learn more about `ngMessages` and `ngMessage`.\n *\n * @param {expression} ngMessageExp|whenExp an expression value corresponding to the message key.\n */\n .directive('ngMessageExp', ngMessageDirectiveFactory());\n\nfunction ngMessageDirectiveFactory() {\n return ['$animate', function($animate) {\n return {\n restrict: 'AE',\n transclude: 'element',\n priority: 1, // must run before ngBind, otherwise the text is set on the comment\n terminal: true,\n require: '^^ngMessages',\n link: function(scope, element, attrs, ngMessagesCtrl, $transclude) {\n var commentNode = element[0];\n\n var records;\n var staticExp = attrs.ngMessage || attrs.when;\n var dynamicExp = attrs.ngMessageExp || attrs.whenExp;\n var assignRecords = function(items) {\n records = items\n ? (isArray(items)\n ? items\n : items.split(/[\\s,]+/))\n : null;\n ngMessagesCtrl.reRender();\n };\n\n if (dynamicExp) {\n assignRecords(scope.$eval(dynamicExp));\n scope.$watchCollection(dynamicExp, assignRecords);\n } else {\n assignRecords(staticExp);\n }\n\n var currentElement, messageCtrl;\n ngMessagesCtrl.register(commentNode, messageCtrl = {\n test: function(name) {\n return contains(records, name);\n },\n attach: function() {\n if (!currentElement) {\n $transclude(function(elm, newScope) {\n $animate.enter(elm, null, element);\n currentElement = elm;\n\n // Each time we attach this node to a message we get a new id that we can match\n // when we are destroying the node later.\n var $$attachId = currentElement.$$attachId = ngMessagesCtrl.getAttachId();\n\n // in the event that the element or a parent element is destroyed\n // by another structural directive then it's time\n // to deregister the message from the controller\n currentElement.on('$destroy', function() {\n if (currentElement && currentElement.$$attachId === $$attachId) {\n ngMessagesCtrl.deregister(commentNode);\n messageCtrl.detach();\n }\n newScope.$destroy();\n });\n });\n }\n },\n detach: function() {\n if (currentElement) {\n var elm = currentElement;\n currentElement = null;\n $animate.leave(elm);\n }\n }\n });\n }\n };\n }];\n\n function contains(collection, key) {\n if (collection) {\n return isArray(collection)\n ? collection.indexOf(key) >= 0\n : collection.hasOwnProperty(key);\n }\n }\n}\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.4.14\n * (c) 2010-2015 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $sanitizeMinErr = angular.$$minErr('$sanitize');\n\n/**\n * @ngdoc module\n * @name ngSanitize\n * @description\n *\n * # ngSanitize\n *\n * The `ngSanitize` module provides functionality to sanitize HTML.\n *\n *\n * <div doc-module-components=\"ngSanitize\"></div>\n *\n * See {@link ngSanitize.$sanitize `$sanitize`} for usage.\n */\n\n/*\n * HTML Parser By Misko Hevery (misko@hevery.com)\n * based on: HTML Parser By John Resig (ejohn.org)\n * Original code by Erik Arvidsson, Mozilla Public License\n * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js\n *\n * // Use like so:\n * htmlParser(htmlString, {\n * start: function(tag, attrs, unary) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * });\n *\n */\n\n\n/**\n * @ngdoc service\n * @name $sanitize\n * @kind function\n *\n * @description\n * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are\n * then serialized back to properly escaped html string. This means that no unsafe input can make\n * it into the returned string, however, since our parser is more strict than a typical browser\n * parser, it's possible that some obscure input, which would be recognized as valid HTML by a\n * browser, won't make it through the sanitizer. The input may also contain SVG markup.\n * The whitelist is configured using the functions `aHrefSanitizationWhitelist` and\n * `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.\n *\n * @param {string} html HTML input.\n * @returns {string} Sanitized HTML.\n *\n * @example\n <example module=\"sanitizeExample\" deps=\"angular-sanitize.js\">\n <file name=\"index.html\">\n <script>\n angular.module('sanitizeExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', '$sce', function($scope, $sce) {\n $scope.snippet =\n '<p style=\"color:blue\">an html\\n' +\n '<em onmouseover=\"this.textContent=\\'PWN3D!\\'\">click here</em>\\n' +\n 'snippet</p>';\n $scope.deliberatelyTrustDangerousSnippet = function() {\n return $sce.trustAsHtml($scope.snippet);\n };\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n <table>\n <tr>\n <td>Directive</td>\n <td>How</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"bind-html-with-sanitize\">\n <td>ng-bind-html</td>\n <td>Automatically uses $sanitize</td>\n <td><pre><div ng-bind-html=\"snippet\"><br/></div></pre></td>\n <td><div ng-bind-html=\"snippet\"></div></td>\n </tr>\n <tr id=\"bind-html-with-trust\">\n <td>ng-bind-html</td>\n <td>Bypass $sanitize by explicitly trusting the dangerous value</td>\n <td>\n <pre><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\">\n</div></pre>\n </td>\n <td><div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\"></div></td>\n </tr>\n <tr id=\"bind-default\">\n <td>ng-bind</td>\n <td>Automatically escapes</td>\n <td><pre><div ng-bind=\"snippet\"><br/></div></pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </div>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should sanitize the html snippet by default', function() {\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('<p>an html\\n<em>click here</em>\\nsnippet</p>');\n });\n\n it('should inline raw snippet if bound to a trusted value', function() {\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should escape snippet without any filter', function() {\n expect(element(by.css('#bind-default div')).getInnerHtml()).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should update', function() {\n element(by.model('snippet')).clear();\n element(by.model('snippet')).sendKeys('new <b onclick=\"alert(1)\">text</b>');\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('new <b>text</b>');\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(\n 'new <b onclick=\"alert(1)\">text</b>');\n expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(\n \"new <b onclick=\\\"alert(1)\\\">text</b>\");\n });\n </file>\n </example>\n */\nfunction $SanitizeProvider() {\n this.$get = ['$$sanitizeUri', function($$sanitizeUri) {\n return function(html) {\n var buf = [];\n htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {\n return !/^unsafe/.test($$sanitizeUri(uri, isImage));\n }));\n return buf.join('');\n };\n }];\n}\n\nfunction sanitizeText(chars) {\n var buf = [];\n var writer = htmlSanitizeWriter(buf, angular.noop);\n writer.chars(chars);\n return buf.join('');\n}\n\n\n// Regular Expressions for parsing tags and attributes\nvar START_TAG_REGEXP =\n /^<((?:[a-zA-Z])[\\w:-]*)((?:\\s+[\\w:-]+(?:\\s*=\\s*(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?)*)\\s*(\\/?)\\s*(>?)/,\n END_TAG_REGEXP = /^<\\/\\s*([\\w:-]+)[^>]*>/,\n ATTR_REGEXP = /([\\w:-]+)(?:\\s*=\\s*(?:(?:\"((?:[^\"])*)\")|(?:'((?:[^'])*)')|([^>\\s]+)))?/g,\n BEGIN_TAG_REGEXP = /^</,\n BEGING_END_TAGE_REGEXP = /^<\\//,\n COMMENT_REGEXP = /<!--(.*?)-->/g,\n DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,\n CDATA_REGEXP = /<!\\[CDATA\\[(.*?)]]>/g,\n SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n // Match everything outside of normal chars and \" (quote character)\n NON_ALPHANUMERIC_REGEXP = /([^\\#-~| |!])/g;\n\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nvar voidElements = makeMap(\"area,br,col,hr,img,wbr\");\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nvar optionalEndTagBlockElements = makeMap(\"colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr\"),\n optionalEndTagInlineElements = makeMap(\"rp,rt\"),\n optionalEndTagElements = angular.extend({},\n optionalEndTagInlineElements,\n optionalEndTagBlockElements);\n\n// Safe Block Elements - HTML5\nvar blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap(\"address,article,\" +\n \"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,\" +\n \"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul\"));\n\n// Inline Elements - HTML5\nvar inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap(\"a,abbr,acronym,b,\" +\n \"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,\" +\n \"samp,small,span,strike,strong,sub,sup,time,tt,u,var\"));\n\n// SVG Elements\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements\n// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.\n// They can potentially allow for arbitrary javascript to be executed. See #11290\nvar svgElements = makeMap(\"circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,\" +\n \"hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,\" +\n \"radialGradient,rect,stop,svg,switch,text,title,tspan,use\");\n\n// Special Elements (can contain anything)\nvar specialElements = makeMap(\"script,style\");\n\nvar validElements = angular.extend({},\n voidElements,\n blockElements,\n inlineElements,\n optionalEndTagElements,\n svgElements);\n\n//Attributes that have href and hence need to be sanitized\nvar uriAttrs = makeMap(\"background,cite,href,longdesc,src,usemap,xlink:href\");\n\nvar htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +\n 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +\n 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +\n 'valign,value,vspace,width');\n\n// SVG attributes (without \"id\" and \"name\" attributes)\n// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes\nvar svgAttrs = makeMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +\n 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +\n 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +\n 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +\n 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +\n 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +\n 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +\n 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +\n 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +\n 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +\n 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +\n 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +\n 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +\n 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +\n 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);\n\nvar validAttrs = angular.extend({},\n uriAttrs,\n svgAttrs,\n htmlAttrs);\n\nfunction makeMap(str, lowercaseKeys) {\n var obj = {}, items = str.split(','), i;\n for (i = 0; i < items.length; i++) {\n obj[lowercaseKeys ? angular.lowercase(items[i]) : items[i]] = true;\n }\n return obj;\n}\n\n\n/**\n * @example\n * htmlParser(htmlString, {\n * start: function(tag, attrs, unary) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * });\n *\n * @param {string} html string\n * @param {object} handler\n */\nfunction htmlParser(html, handler) {\n if (typeof html !== 'string') {\n if (html === null || typeof html === 'undefined') {\n html = '';\n } else {\n html = '' + html;\n }\n }\n var index, chars, match, stack = [], last = html, text;\n stack.last = function() { return stack[stack.length - 1]; };\n\n while (html) {\n text = '';\n chars = true;\n\n // Make sure we're not in a script or style element\n if (!stack.last() || !specialElements[stack.last()]) {\n\n // Comment\n if (html.indexOf(\"<!--\") === 0) {\n // comments containing -- are not allowed unless they terminate the comment\n index = html.indexOf(\"--\", 4);\n\n if (index >= 0 && html.lastIndexOf(\"-->\", index) === index) {\n if (handler.comment) handler.comment(html.substring(4, index));\n html = html.substring(index + 3);\n chars = false;\n }\n // DOCTYPE\n } else if (DOCTYPE_REGEXP.test(html)) {\n match = html.match(DOCTYPE_REGEXP);\n\n if (match) {\n html = html.replace(match[0], '');\n chars = false;\n }\n // end tag\n } else if (BEGING_END_TAGE_REGEXP.test(html)) {\n match = html.match(END_TAG_REGEXP);\n\n if (match) {\n html = html.substring(match[0].length);\n match[0].replace(END_TAG_REGEXP, parseEndTag);\n chars = false;\n }\n\n // start tag\n } else if (BEGIN_TAG_REGEXP.test(html)) {\n match = html.match(START_TAG_REGEXP);\n\n if (match) {\n // We only have a valid start-tag if there is a '>'.\n if (match[4]) {\n html = html.substring(match[0].length);\n match[0].replace(START_TAG_REGEXP, parseStartTag);\n }\n chars = false;\n } else {\n // no ending tag found --- this piece should be encoded as an entity.\n text += '<';\n html = html.substring(1);\n }\n }\n\n if (chars) {\n index = html.indexOf(\"<\");\n\n text += index < 0 ? html : html.substring(0, index);\n html = index < 0 ? \"\" : html.substring(index);\n\n if (handler.chars) handler.chars(decodeEntities(text));\n }\n\n } else {\n // IE versions 9 and 10 do not understand the regex '[^]', so using a workaround with [\\W\\w].\n html = html.replace(new RegExp(\"([\\\\W\\\\w]*)<\\\\s*\\\\/\\\\s*\" + stack.last() + \"[^>]*>\", 'i'),\n function(all, text) {\n text = text.replace(COMMENT_REGEXP, \"$1\").replace(CDATA_REGEXP, \"$1\");\n\n if (handler.chars) handler.chars(decodeEntities(text));\n\n return \"\";\n });\n\n parseEndTag(\"\", stack.last());\n }\n\n if (html == last) {\n throw $sanitizeMinErr('badparse', \"The sanitizer was unable to parse the following block \" +\n \"of html: {0}\", html);\n }\n last = html;\n }\n\n // Clean up any remaining tags\n parseEndTag();\n\n function parseStartTag(tag, tagName, rest, unary) {\n tagName = angular.lowercase(tagName);\n if (blockElements[tagName]) {\n while (stack.last() && inlineElements[stack.last()]) {\n parseEndTag(\"\", stack.last());\n }\n }\n\n if (optionalEndTagElements[tagName] && stack.last() == tagName) {\n parseEndTag(\"\", tagName);\n }\n\n unary = voidElements[tagName] || !!unary;\n\n if (!unary) {\n stack.push(tagName);\n }\n\n var attrs = {};\n\n rest.replace(ATTR_REGEXP,\n function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {\n var value = doubleQuotedValue\n || singleQuotedValue\n || unquotedValue\n || '';\n\n attrs[name] = decodeEntities(value);\n });\n if (handler.start) handler.start(tagName, attrs, unary);\n }\n\n function parseEndTag(tag, tagName) {\n var pos = 0, i;\n tagName = angular.lowercase(tagName);\n if (tagName) {\n // Find the closest opened tag of the same type\n for (pos = stack.length - 1; pos >= 0; pos--) {\n if (stack[pos] == tagName) break;\n }\n }\n\n if (pos >= 0) {\n // Close all the open elements, up the stack\n for (i = stack.length - 1; i >= pos; i--)\n if (handler.end) handler.end(stack[i]);\n\n // Remove the open elements from the stack\n stack.length = pos;\n }\n }\n}\n\nvar hiddenPre=document.createElement(\"pre\");\n/**\n * decodes all entities into regular string\n * @param value\n * @returns {string} A string with decoded entities.\n */\nfunction decodeEntities(value) {\n if (!value) { return ''; }\n\n hiddenPre.innerHTML = value.replace(/</g,\"<\");\n // innerText depends on styling as it doesn't display hidden elements.\n // Therefore, it's better to use textContent not to cause unnecessary reflows.\n return hiddenPre.textContent;\n}\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n * @returns {string} escaped text\n */\nfunction encodeEntities(value) {\n return value.\n replace(/&/g, '&').\n replace(SURROGATE_PAIR_REGEXP, function(value) {\n var hi = value.charCodeAt(0);\n var low = value.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n }).\n replace(NON_ALPHANUMERIC_REGEXP, function(value) {\n return '&#' + value.charCodeAt(0) + ';';\n }).\n replace(/</g, '<').\n replace(/>/g, '>');\n}\n\n/**\n * create an HTML/XML writer which writes to buffer\n * @param {Array} buf use buf.jain('') to get out sanitized html string\n * @returns {object} in the form of {\n * start: function(tag, attrs, unary) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * }\n */\nfunction htmlSanitizeWriter(buf, uriValidator) {\n var ignore = false;\n var out = angular.bind(buf, buf.push);\n return {\n start: function(tag, attrs, unary) {\n tag = angular.lowercase(tag);\n if (!ignore && specialElements[tag]) {\n ignore = tag;\n }\n if (!ignore && validElements[tag] === true) {\n out('<');\n out(tag);\n angular.forEach(attrs, function(value, key) {\n var lkey=angular.lowercase(key);\n var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');\n if (validAttrs[lkey] === true &&\n (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {\n out(' ');\n out(key);\n out('=\"');\n out(encodeEntities(value));\n out('\"');\n }\n });\n out(unary ? '/>' : '>');\n }\n },\n end: function(tag) {\n tag = angular.lowercase(tag);\n if (!ignore && validElements[tag] === true) {\n out('</');\n out(tag);\n out('>');\n }\n if (tag == ignore) {\n ignore = false;\n }\n },\n chars: function(chars) {\n if (!ignore) {\n out(encodeEntities(chars));\n }\n }\n };\n}\n\n\n// define ngSanitize module and register $sanitize service\nangular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);\n\n/* global sanitizeText: false */\n\n/**\n * @ngdoc filter\n * @name linky\n * @kind function\n *\n * @description\n * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and\n * plain email address links.\n *\n * Requires the {@link ngSanitize `ngSanitize`} module to be installed.\n *\n * @param {string} text Input text.\n * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.\n * @returns {string} Html-linkified text.\n *\n * @usage\n <span ng-bind-html=\"linky_expression | linky\"></span>\n *\n * @example\n <example module=\"linkyExample\" deps=\"angular-sanitize.js\">\n <file name=\"index.html\">\n <script>\n angular.module('linkyExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.snippet =\n 'Pretty text with some links:\\n'+\n 'http://angularjs.org/,\\n'+\n 'mailto:us@somewhere.org,\\n'+\n 'another@somewhere.org,\\n'+\n 'and one more: ftp://127.0.0.1/.';\n $scope.snippetWithTarget = 'http://angularjs.org/';\n }]);\n </script>\n <div ng-controller=\"ExampleController\">\n Snippet: <textarea ng-model=\"snippet\" cols=\"60\" rows=\"3\"></textarea>\n <table>\n <tr>\n <td>Filter</td>\n <td>Source</td>\n <td>Rendered</td>\n </tr>\n <tr id=\"linky-filter\">\n <td>linky filter</td>\n <td>\n <pre><div ng-bind-html=\"snippet | linky\"><br></div></pre>\n </td>\n <td>\n <div ng-bind-html=\"snippet | linky\"></div>\n </td>\n </tr>\n <tr id=\"linky-target\">\n <td>linky target</td>\n <td>\n <pre><div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"><br></div></pre>\n </td>\n <td>\n <div ng-bind-html=\"snippetWithTarget | linky:'_blank'\"></div>\n </td>\n </tr>\n <tr id=\"escaped-html\">\n <td>no filter</td>\n <td><pre><div ng-bind=\"snippet\"><br></div></pre></td>\n <td><div ng-bind=\"snippet\"></div></td>\n </tr>\n </table>\n </file>\n <file name=\"protractor.js\" type=\"protractor\">\n it('should linkify the snippet with urls', function() {\n expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +\n 'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);\n });\n\n it('should not linkify snippet without the linky filter', function() {\n expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).\n toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +\n 'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);\n });\n\n it('should update', function() {\n element(by.model('snippet')).clear();\n element(by.model('snippet')).sendKeys('new http://link.');\n expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n toBe('new http://link.');\n expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);\n expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())\n .toBe('new http://link.');\n });\n\n it('should work with the target property', function() {\n expect(element(by.id('linky-target')).\n element(by.binding(\"snippetWithTarget | linky:'_blank'\")).getText()).\n toBe('http://angularjs.org/');\n expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');\n });\n </file>\n </example>\n */\nangular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"\\u201d\\u2019]/i,\n MAILTO_REGEXP = /^mailto:/i;\n\n return function(text, target) {\n if (!text) return text;\n var match;\n var raw = text;\n var html = [];\n var url;\n var i;\n while ((match = raw.match(LINKY_URL_REGEXP))) {\n // We can not end in these as they are sometimes found at the end of the sentence\n url = match[0];\n // if we did not match ftp/http/www/mailto then assume mailto\n if (!match[2] && !match[4]) {\n url = (match[3] ? 'http://' : 'mailto:') + url;\n }\n i = match.index;\n addText(raw.substr(0, i));\n addLink(url, match[0].replace(MAILTO_REGEXP, ''));\n raw = raw.substring(i + match[0].length);\n }\n addText(raw);\n return $sanitize(html.join(''));\n\n function addText(text) {\n if (!text) {\n return;\n }\n html.push(sanitizeText(text));\n }\n\n function addLink(url, text) {\n html.push('<a ');\n if (angular.isDefined(target)) {\n html.push('target=\"',\n target,\n '\" ');\n }\n html.push('href=\"',\n url.replace(/\"/g, '"'),\n '\">');\n addText(text);\n html.push('</a>');\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n/**\n * State-based routing for AngularJS\n * @version v0.4.3\n * @link http://angular-ui.github.com/\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n\n/* commonjs package manager support (eg componentjs) */\nif (typeof module !== \"undefined\" && typeof exports !== \"undefined\" && module.exports === exports){\n module.exports = 'ui.router';\n}\n\n(function (window, angular, undefined) {\n/*jshint globalstrict:true*/\n/*global angular:false*/\n'use strict';\n\nvar isDefined = angular.isDefined,\n isFunction = angular.isFunction,\n isString = angular.isString,\n isObject = angular.isObject,\n isArray = angular.isArray,\n forEach = angular.forEach,\n extend = angular.extend,\n copy = angular.copy,\n toJson = angular.toJson;\n\nfunction inherit(parent, extra) {\n return extend(new (extend(function() {}, { prototype: parent }))(), extra);\n}\n\nfunction merge(dst) {\n forEach(arguments, function(obj) {\n if (obj !== dst) {\n forEach(obj, function(value, key) {\n if (!dst.hasOwnProperty(key)) dst[key] = value;\n });\n }\n });\n return dst;\n}\n\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nfunction ancestors(first, second) {\n var path = [];\n\n for (var n in first.path) {\n if (first.path[n] !== second.path[n]) break;\n path.push(first.path[n]);\n }\n return path;\n}\n\n/**\n * IE8-safe wrapper for `Object.keys()`.\n *\n * @param {Object} object A JavaScript object.\n * @return {Array} Returns the keys of the object as an array.\n */\nfunction objectKeys(object) {\n if (Object.keys) {\n return Object.keys(object);\n }\n var result = [];\n\n forEach(object, function(val, key) {\n result.push(key);\n });\n return result;\n}\n\n/**\n * IE8-safe wrapper for `Array.prototype.indexOf()`.\n *\n * @param {Array} array A JavaScript array.\n * @param {*} value A value to search the array for.\n * @return {Number} Returns the array index value of `value`, or `-1` if not present.\n */\nfunction indexOf(array, value) {\n if (Array.prototype.indexOf) {\n return array.indexOf(value, Number(arguments[2]) || 0);\n }\n var len = array.length >>> 0, from = Number(arguments[2]) || 0;\n from = (from < 0) ? Math.ceil(from) : Math.floor(from);\n\n if (from < 0) from += len;\n\n for (; from < len; from++) {\n if (from in array && array[from] === value) return from;\n }\n return -1;\n}\n\n/**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} currentParams The value of the current state parameters ($stateParams).\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\nfunction inheritParams(currentParams, newParams, $current, $to) {\n var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];\n\n for (var i in parents) {\n if (!parents[i] || !parents[i].params) continue;\n parentParams = objectKeys(parents[i].params);\n if (!parentParams.length) continue;\n\n for (var j in parentParams) {\n if (indexOf(inheritList, parentParams[j]) >= 0) continue;\n inheritList.push(parentParams[j]);\n inherited[parentParams[j]] = currentParams[parentParams[j]];\n }\n }\n return extend({}, inherited, newParams);\n}\n\n/**\n * Performs a non-strict comparison of the subset of two objects, defined by a list of keys.\n *\n * @param {Object} a The first object.\n * @param {Object} b The second object.\n * @param {Array} keys The list of keys within each object to compare. If the list is empty or not specified,\n * it defaults to the list of keys in `a`.\n * @return {Boolean} Returns `true` if the keys match, otherwise `false`.\n */\nfunction equalForKeys(a, b, keys) {\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n }\n\n for (var i=0; i<keys.length; i++) {\n var k = keys[i];\n if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n }\n return true;\n}\n\n/**\n * Returns the subset of an object, based on a list of keys.\n *\n * @param {Array} keys\n * @param {Object} values\n * @return {Boolean} Returns a subset of `values`.\n */\nfunction filterByKeys(keys, values) {\n var filtered = {};\n\n forEach(keys, function (name) {\n filtered[name] = values[name];\n });\n return filtered;\n}\n\n// like _.indexBy\n// when you know that your index values will be unique, or you want last-one-in to win\nfunction indexBy(array, propName) {\n var result = {};\n forEach(array, function(item) {\n result[item[propName]] = item;\n });\n return result;\n}\n\n// extracted from underscore.js\n// Return a copy of the object only containing the whitelisted properties.\nfunction pick(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n forEach(keys, function(key) {\n if (key in obj) copy[key] = obj[key];\n });\n return copy;\n}\n\n// extracted from underscore.js\n// Return a copy of the object omitting the blacklisted properties.\nfunction omit(obj) {\n var copy = {};\n var keys = Array.prototype.concat.apply(Array.prototype, Array.prototype.slice.call(arguments, 1));\n for (var key in obj) {\n if (indexOf(keys, key) == -1) copy[key] = obj[key];\n }\n return copy;\n}\n\nfunction pluck(collection, key) {\n var result = isArray(collection) ? [] : {};\n\n forEach(collection, function(val, i) {\n result[i] = isFunction(key) ? key(val) : val[key];\n });\n return result;\n}\n\nfunction filter(collection, callback) {\n var array = isArray(collection);\n var result = array ? [] : {};\n forEach(collection, function(val, i) {\n if (callback(val, i)) {\n result[array ? result.length : i] = val;\n }\n });\n return result;\n}\n\nfunction map(collection, callback) {\n var result = isArray(collection) ? [] : {};\n\n forEach(collection, function(val, i) {\n result[i] = callback(val, i);\n });\n return result;\n}\n\n// issue #2676 #2889\nfunction silenceUncaughtInPromise (promise) {\n return promise.then(undefined, function() {}) && promise;\n}\n\n/**\n * @ngdoc overview\n * @name ui.router.util\n *\n * @description\n * # ui.router.util sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n *\n */\nangular.module('ui.router.util', ['ng']);\n\n/**\n * @ngdoc overview\n * @name ui.router.router\n * \n * @requires ui.router.util\n *\n * @description\n * # ui.router.router sub-module\n *\n * This module is a dependency of other sub-modules. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n */\nangular.module('ui.router.router', ['ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router.state\n * \n * @requires ui.router.router\n * @requires ui.router.util\n *\n * @description\n * # ui.router.state sub-module\n *\n * This module is a dependency of the main ui.router module. Do not include this module as a dependency\n * in your angular app (use {@link ui.router} module instead).\n * \n */\nangular.module('ui.router.state', ['ui.router.router', 'ui.router.util']);\n\n/**\n * @ngdoc overview\n * @name ui.router\n *\n * @requires ui.router.state\n *\n * @description\n * # ui.router\n * \n * ## The main module for ui.router \n * There are several sub-modules included with the ui.router module, however only this module is needed\n * as a dependency within your angular app. The other modules are for organization purposes. \n *\n * The modules are:\n * * ui.router - the main \"umbrella\" module\n * * ui.router.router - \n * \n * *You'll need to include **only** this module as the dependency within your angular app.*\n * \n * <pre>\n * <!doctype html>\n * <html ng-app=\"myApp\">\n * <head>\n * <script src=\"js/angular.js\"></script>\n * <!-- Include the ui-router script -->\n * <script src=\"js/angular-ui-router.min.js\"></script>\n * <script>\n * // ...and add 'ui.router' as a dependency\n * var myApp = angular.module('myApp', ['ui.router']);\n * </script>\n * </head>\n * <body>\n * </body>\n * </html>\n * </pre>\n */\nangular.module('ui.router', ['ui.router.state']);\n\nangular.module('ui.router.compat', ['ui.router']);\n\n/**\n * @ngdoc object\n * @name ui.router.util.$resolve\n *\n * @requires $q\n * @requires $injector\n *\n * @description\n * Manages resolution of (acyclic) graphs of promises.\n */\n$Resolve.$inject = ['$q', '$injector'];\nfunction $Resolve( $q, $injector) {\n \n var VISIT_IN_PROGRESS = 1,\n VISIT_DONE = 2,\n NOTHING = {},\n NO_DEPENDENCIES = [],\n NO_LOCALS = NOTHING,\n NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING });\n \n\n /**\n * @ngdoc function\n * @name ui.router.util.$resolve#study\n * @methodOf ui.router.util.$resolve\n *\n * @description\n * Studies a set of invocables that are likely to be used multiple times.\n * <pre>\n * $resolve.study(invocables)(locals, parent, self)\n * </pre>\n * is equivalent to\n * <pre>\n * $resolve.resolve(invocables, locals, parent, self)\n * </pre>\n * but the former is more efficient (in fact `resolve` just calls `study` \n * internally).\n *\n * @param {object} invocables Invocable objects\n * @return {function} a function to pass in locals, parent and self\n */\n this.study = function (invocables) {\n if (!isObject(invocables)) throw new Error(\"'invocables' must be an object\");\n var invocableKeys = objectKeys(invocables || {});\n \n // Perform a topological sort of invocables to build an ordered plan\n var plan = [], cycle = [], visited = {};\n function visit(value, key) {\n if (visited[key] === VISIT_DONE) return;\n \n cycle.push(key);\n if (visited[key] === VISIT_IN_PROGRESS) {\n cycle.splice(0, indexOf(cycle, key));\n throw new Error(\"Cyclic dependency: \" + cycle.join(\" -> \"));\n }\n visited[key] = VISIT_IN_PROGRESS;\n \n if (isString(value)) {\n plan.push(key, [ function() { return $injector.get(value); }], NO_DEPENDENCIES);\n } else {\n var params = $injector.annotate(value);\n forEach(params, function (param) {\n if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param);\n });\n plan.push(key, value, params);\n }\n \n cycle.pop();\n visited[key] = VISIT_DONE;\n }\n forEach(invocables, visit);\n invocables = cycle = visited = null; // plan is all that's required\n \n function isResolve(value) {\n return isObject(value) && value.then && value.$$promises;\n }\n \n return function (locals, parent, self) {\n if (isResolve(locals) && self === undefined) {\n self = parent; parent = locals; locals = null;\n }\n if (!locals) locals = NO_LOCALS;\n else if (!isObject(locals)) {\n throw new Error(\"'locals' must be an object\");\n } \n if (!parent) parent = NO_PARENT;\n else if (!isResolve(parent)) {\n throw new Error(\"'parent' must be a promise returned by $resolve.resolve()\");\n }\n \n // To complete the overall resolution, we have to wait for the parent\n // promise and for the promise for each invokable in our plan.\n var resolution = $q.defer(),\n result = silenceUncaughtInPromise(resolution.promise),\n promises = result.$$promises = {},\n values = extend({}, locals),\n wait = 1 + plan.length/3,\n merged = false;\n\n silenceUncaughtInPromise(result);\n \n function done() {\n // Merge parent values we haven't got yet and publish our own $$values\n if (!--wait) {\n if (!merged) merge(values, parent.$$values); \n result.$$values = values;\n result.$$promises = result.$$promises || true; // keep for isResolve()\n delete result.$$inheritedValues;\n resolution.resolve(values);\n }\n }\n \n function fail(reason) {\n result.$$failure = reason;\n resolution.reject(reason);\n }\n\n // Short-circuit if parent has already failed\n if (isDefined(parent.$$failure)) {\n fail(parent.$$failure);\n return result;\n }\n \n if (parent.$$inheritedValues) {\n merge(values, omit(parent.$$inheritedValues, invocableKeys));\n }\n\n // Merge parent values if the parent has already resolved, or merge\n // parent promises and wait if the parent resolve is still in progress.\n extend(promises, parent.$$promises);\n if (parent.$$values) {\n merged = merge(values, omit(parent.$$values, invocableKeys));\n result.$$inheritedValues = omit(parent.$$values, invocableKeys);\n done();\n } else {\n if (parent.$$inheritedValues) {\n result.$$inheritedValues = omit(parent.$$inheritedValues, invocableKeys);\n } \n parent.then(done, fail);\n }\n \n // Process each invocable in the plan, but ignore any where a local of the same name exists.\n for (var i=0, ii=plan.length; i<ii; i+=3) {\n if (locals.hasOwnProperty(plan[i])) done();\n else invoke(plan[i], plan[i+1], plan[i+2]);\n }\n \n function invoke(key, invocable, params) {\n // Create a deferred for this invocation. Failures will propagate to the resolution as well.\n var invocation = $q.defer(), waitParams = 0;\n function onfailure(reason) {\n invocation.reject(reason);\n fail(reason);\n }\n // Wait for any parameter that we have a promise for (either from parent or from this\n // resolve; in that case study() will have made sure it's ordered before us in the plan).\n forEach(params, function (dep) {\n if (promises.hasOwnProperty(dep) && !locals.hasOwnProperty(dep)) {\n waitParams++;\n promises[dep].then(function (result) {\n values[dep] = result;\n if (!(--waitParams)) proceed();\n }, onfailure);\n }\n });\n if (!waitParams) proceed();\n function proceed() {\n if (isDefined(result.$$failure)) return;\n try {\n invocation.resolve($injector.invoke(invocable, self, values));\n invocation.promise.then(function (result) {\n values[key] = result;\n done();\n }, onfailure);\n } catch (e) {\n onfailure(e);\n }\n }\n // Publish promise synchronously; invocations further down in the plan may depend on it.\n promises[key] = silenceUncaughtInPromise(invocation.promise);\n }\n \n return result;\n };\n };\n \n /**\n * @ngdoc function\n * @name ui.router.util.$resolve#resolve\n * @methodOf ui.router.util.$resolve\n *\n * @description\n * Resolves a set of invocables. An invocable is a function to be invoked via \n * `$injector.invoke()`, and can have an arbitrary number of dependencies. \n * An invocable can either return a value directly,\n * or a `$q` promise. If a promise is returned it will be resolved and the \n * resulting value will be used instead. Dependencies of invocables are resolved \n * (in this order of precedence)\n *\n * - from the specified `locals`\n * - from another invocable that is part of this `$resolve` call\n * - from an invocable that is inherited from a `parent` call to `$resolve` \n * (or recursively\n * - from any ancestor `$resolve` of that parent).\n *\n * The return value of `$resolve` is a promise for an object that contains \n * (in this order of precedence)\n *\n * - any `locals` (if specified)\n * - the resolved return values of all injectables\n * - any values inherited from a `parent` call to `$resolve` (if specified)\n *\n * The promise will resolve after the `parent` promise (if any) and all promises \n * returned by injectables have been resolved. If any invocable \n * (or `$injector.invoke`) throws an exception, or if a promise returned by an \n * invocable is rejected, the `$resolve` promise is immediately rejected with the \n * same error. A rejection of a `parent` promise (if specified) will likewise be \n * propagated immediately. Once the `$resolve` promise has been rejected, no \n * further invocables will be called.\n * \n * Cyclic dependencies between invocables are not permitted and will cause `$resolve`\n * to throw an error. As a special case, an injectable can depend on a parameter \n * with the same name as the injectable, which will be fulfilled from the `parent` \n * injectable of the same name. This allows inherited values to be decorated. \n * Note that in this case any other injectable in the same `$resolve` with the same\n * dependency would see the decorated value, not the inherited value.\n *\n * Note that missing dependencies -- unlike cyclic dependencies -- will cause an \n * (asynchronous) rejection of the `$resolve` promise rather than a (synchronous) \n * exception.\n *\n * Invocables are invoked eagerly as soon as all dependencies are available. \n * This is true even for dependencies inherited from a `parent` call to `$resolve`.\n *\n * As a special case, an invocable can be a string, in which case it is taken to \n * be a service name to be passed to `$injector.get()`. This is supported primarily \n * for backwards-compatibility with the `resolve` property of `$routeProvider` \n * routes.\n *\n * @param {object} invocables functions to invoke or \n * `$injector` services to fetch.\n * @param {object} locals values to make available to the injectables\n * @param {object} parent a promise returned by another call to `$resolve`.\n * @param {object} self the `this` for the invoked methods\n * @return {object} Promise for an object that contains the resolved return value\n * of all invocables, as well as any inherited and local values.\n */\n this.resolve = function (invocables, locals, parent, self) {\n return this.study(invocables)(locals, parent, self);\n };\n}\n\nangular.module('ui.router.util').service('$resolve', $Resolve);\n\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$templateFactoryProvider\n *\n * @description\n * Provider for $templateFactory. Manages which template-loading mechanism to\n * use, and will default to the most recent one ($templateRequest on Angular\n * versions starting from 1.3, $http otherwise).\n */\nfunction TemplateFactoryProvider() {\n var shouldUnsafelyUseHttp = angular.version.minor < 3;\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactoryProvider#shouldUnsafelyUseHttp\n * @methodOf ui.router.util.$templateFactoryProvider\n *\n * @description\n * Forces $templateFactory to use $http instead of $templateRequest. This\n * might cause XSS, as $http doesn't enforce the regular security checks for\n * templates that have been introduced in Angular 1.3. Note that setting this\n * to false on Angular older than 1.3.x will crash, as the $templateRequest\n * service (and the security checks) are not implemented on these versions.\n *\n * See the $sce documentation, section\n * <a href=\"https://docs.angularjs.org/api/ng/service/$sce#impact-on-loading-templates\">\n * Impact on loading templates</a> for more details about this mechanism.\n *\n * @param {boolean} value\n */\n this.shouldUnsafelyUseHttp = function(value) {\n shouldUnsafelyUseHttp = !!value;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.util.$templateFactory\n *\n * @requires $http\n * @requires $templateCache\n * @requires $injector\n *\n * @description\n * Service. Manages loading of templates.\n */\n this.$get = ['$http', '$templateCache', '$injector', function($http, $templateCache, $injector){\n return new TemplateFactory($http, $templateCache, $injector, shouldUnsafelyUseHttp);}];\n}\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$templateFactory\n *\n * @requires $http\n * @requires $templateCache\n * @requires $injector\n *\n * @description\n * Service. Manages loading of templates.\n */\nfunction TemplateFactory($http, $templateCache, $injector, shouldUnsafelyUseHttp) {\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromConfig\n * @methodOf ui.router.util.$templateFactory\n *\n * @description\n * Creates a template from a configuration object. \n *\n * @param {object} config Configuration object for which to load a template. \n * The following properties are search in the specified order, and the first one \n * that is defined is used to create the template:\n *\n * @param {string|object} config.template html string template or function to \n * load via {@link ui.router.util.$templateFactory#fromString fromString}.\n * @param {string|object} config.templateUrl url to load or a function returning \n * the url to load via {@link ui.router.util.$templateFactory#fromUrl fromUrl}.\n * @param {Function} config.templateProvider function to invoke via \n * {@link ui.router.util.$templateFactory#fromProvider fromProvider}.\n * @param {object} params Parameters to pass to the template function.\n * @param {object} locals Locals to pass to `invoke` if the template is loaded \n * via a `templateProvider`. Defaults to `{ params: params }`.\n *\n * @return {string|object} The template html as a string, or a promise for \n * that string,or `null` if no template is configured.\n */\n this.fromConfig = function (config, params, locals) {\n return (\n isDefined(config.template) ? this.fromString(config.template, params) :\n isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) :\n isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) :\n null\n );\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromString\n * @methodOf ui.router.util.$templateFactory\n *\n * @description\n * Creates a template from a string or a function returning a string.\n *\n * @param {string|object} template html template as a string or function that \n * returns an html template as a string.\n * @param {object} params Parameters to pass to the template function.\n *\n * @return {string|object} The template html as a string, or a promise for that \n * string.\n */\n this.fromString = function (template, params) {\n return isFunction(template) ? template(params) : template;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromUrl\n * @methodOf ui.router.util.$templateFactory\n * \n * @description\n * Loads a template from the a URL via `$http` and `$templateCache`.\n *\n * @param {string|Function} url url of the template to load, or a function \n * that returns a url.\n * @param {Object} params Parameters to pass to the url function.\n * @return {string|Promise.<string>} The template html as a string, or a promise \n * for that string.\n */\n this.fromUrl = function (url, params) {\n if (isFunction(url)) url = url(params);\n if (url == null) return null;\n else {\n if(!shouldUnsafelyUseHttp) {\n return $injector.get('$templateRequest')(url);\n } else {\n return $http\n .get(url, { cache: $templateCache, headers: { Accept: 'text/html' }})\n .then(function(response) { return response.data; });\n }\n }\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$templateFactory#fromProvider\n * @methodOf ui.router.util.$templateFactory\n *\n * @description\n * Creates a template by invoking an injectable provider function.\n *\n * @param {Function} provider Function to invoke via `$injector.invoke`\n * @param {Object} params Parameters for the template.\n * @param {Object} locals Locals to pass to `invoke`. Defaults to \n * `{ params: params }`.\n * @return {string|Promise.<string>} The template html as a string, or a promise \n * for that string.\n */\n this.fromProvider = function (provider, params, locals) {\n return $injector.invoke(provider, null, locals || { params: params });\n };\n}\n\nangular.module('ui.router.util').provider('$templateFactory', TemplateFactoryProvider);\n\nvar $$UMFP; // reference to $UrlMatcherFactoryProvider\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:UrlMatcher\n *\n * @description\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list\n * of search parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by {@link ui.router.util.type:UrlMatcher#methods_exec exec}.\n *\n * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace\n * syntax, which optionally allows a regular expression for the parameter to be specified:\n *\n * * `':'` name - colon placeholder\n * * `'*'` name - catch-all placeholder\n * * `'{' name '}'` - curly placeholder\n * * `'{' name ':' regexp|type '}'` - curly placeholder with regexp or type name. Should the\n * regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters). For colon\n * placeholders or curly placeholders without an explicit regexp, a path parameter matches any\n * number of characters other than '/'. For catch-all placeholders the path parameter matches\n * any number of characters.\n *\n * Examples:\n *\n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n * trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n * parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n * path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n * in the built-in `date` Type matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n * @param {string} pattern The pattern to compile into a matcher.\n * @param {Object} config A configuration object hash:\n * @param {Object=} parentMatcher Used to concatenate the pattern/config onto\n * an existing UrlMatcher\n *\n * * `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.\n * * `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.\n *\n * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any\n * URL matching this matcher (i.e. any string for which {@link ui.router.util.type:UrlMatcher#methods_exec exec()} returns\n * non-null) will start with this prefix.\n *\n * @property {string} source The pattern that was passed into the constructor\n *\n * @property {string} sourcePath The path portion of the source property\n *\n * @property {string} sourceSearch The search portion of the source property\n *\n * @property {string} regex The constructed regex that will be used to match against the url when\n * it is time to determine which url will match.\n *\n * @returns {Object} New `UrlMatcher` object\n */\nfunction UrlMatcher(pattern, config, parentMatcher) {\n config = extend({ params: {} }, isObject(config) ? config : {});\n\n // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n // '*' name\n // ':' name\n // '{' name '}'\n // '{' name ':' regexp '}'\n // The regular expression is somewhat complicated due to the need to allow curly braces\n // inside the regular expression. The placeholder regexp breaks down as follows:\n // ([:*])([\\w\\[\\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)\n // \\{([\\w\\[\\]]+)(?:\\:\\s*( ... ))?\\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either\n // [^{}\\\\]+ - anything other than curly braces or backslash\n // \\\\. - a backslash escape\n // \\{(?:[^{}\\\\]+|\\\\.)*\\} - a matched set of curly braces containing other atoms\n var placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g,\n compiled = '^', last = 0, m,\n segments = this.segments = [],\n parentParams = parentMatcher ? parentMatcher.params : {},\n params = this.params = parentMatcher ? parentMatcher.params.$$new() : new $$UMFP.ParamSet(),\n paramNames = [];\n\n function addParameter(id, type, config, location) {\n paramNames.push(id);\n if (parentParams[id]) return parentParams[id];\n if (!/^\\w+([-.]+\\w+)*(?:\\[\\])?$/.test(id)) throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n if (params[id]) throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n params[id] = new $$UMFP.Param(id, type, config, location);\n return params[id];\n }\n\n function quoteRegExp(string, pattern, squash, optional) {\n var surroundPattern = ['',''], result = string.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, \"\\\\$&\");\n if (!pattern) return result;\n switch(squash) {\n case false: surroundPattern = ['(', ')' + (optional ? \"?\" : \"\")]; break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:\\/(', ')|\\/)?'];\n break;\n default: surroundPattern = ['(' + squash + \"|\", ')?']; break;\n }\n return result + surroundPattern[0] + pattern + surroundPattern[1];\n }\n\n this.source = pattern;\n\n // Split into static segments separated by path parameter placeholders.\n // The number of segments is always 1 more than the number of parameters.\n function matchDetails(m, isSearch) {\n var id, regexp, segment, type, cfg, arrayMode;\n id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null\n cfg = config.params[id];\n segment = pattern.substring(last, m.index);\n regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);\n\n if (regexp) {\n type = $$UMFP.type(regexp) || inherit($$UMFP.type(\"string\"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });\n }\n\n return {\n id: id, regexp: regexp, segment: segment, type: type, cfg: cfg\n };\n }\n\n var p, param, segment;\n while ((m = placeholder.exec(pattern))) {\n p = matchDetails(m, false);\n if (p.segment.indexOf('?') >= 0) break; // we're into the search part\n\n param = addParameter(p.id, p.type, p.cfg, \"path\");\n compiled += quoteRegExp(p.segment, param.type.pattern.source, param.squash, param.isOptional);\n segments.push(p.segment);\n last = placeholder.lastIndex;\n }\n segment = pattern.substring(last);\n\n // Find any search parameter names and remove them from the last segment\n var i = segment.indexOf('?');\n\n if (i >= 0) {\n var search = this.sourceSearch = segment.substring(i);\n segment = segment.substring(0, i);\n this.sourcePath = pattern.substring(0, last + i);\n\n if (search.length > 0) {\n last = 0;\n while ((m = searchPlaceholder.exec(search))) {\n p = matchDetails(m, true);\n param = addParameter(p.id, p.type, p.cfg, \"search\");\n last = placeholder.lastIndex;\n // check if ?&\n }\n }\n } else {\n this.sourcePath = pattern;\n this.sourceSearch = '';\n }\n\n compiled += quoteRegExp(segment) + (config.strict === false ? '\\/?' : '') + '$';\n segments.push(segment);\n\n this.regexp = new RegExp(compiled, config.caseInsensitive ? 'i' : undefined);\n this.prefix = segments[0];\n this.$$paramNames = paramNames;\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#concat\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns a new matcher for a pattern constructed by appending the path part and adding the\n * search parameters of the specified pattern to this pattern. The current pattern is not\n * modified. This can be understood as creating a pattern for URLs that are relative to (or\n * suffixes of) the current pattern.\n *\n * @example\n * The following two matchers are equivalent:\n * <pre>\n * new UrlMatcher('/user/{id}?q').concat('/details?date');\n * new UrlMatcher('/user/{id}/details?q&date');\n * </pre>\n *\n * @param {string} pattern The pattern to append.\n * @param {Object} config An object hash of the configuration for the matcher.\n * @returns {UrlMatcher} A matcher for the concatenated pattern.\n */\nUrlMatcher.prototype.concat = function (pattern, config) {\n // Because order of search parameters is irrelevant, we can add our own search\n // parameters to the end of the new pattern. Parse the new pattern by itself\n // and then join the bits together, but it's much easier to do this on a string level.\n var defaultConfig = {\n caseInsensitive: $$UMFP.caseInsensitive(),\n strict: $$UMFP.strictMode(),\n squash: $$UMFP.defaultSquashPolicy()\n };\n return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch, extend(defaultConfig, config), this);\n};\n\nUrlMatcher.prototype.toString = function () {\n return this.source;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#exec\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Tests the specified path against this matcher, and returns an object containing the captured\n * parameter values, or null if the path does not match. The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `searchParams`. This means that search parameters are always treated\n * as optional.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n * x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * </pre>\n *\n * @param {string} path The URL path to match, e.g. `$location.path()`.\n * @param {Object} searchParams URL search parameters, e.g. `$location.search()`.\n * @returns {Object} The captured parameter values.\n */\nUrlMatcher.prototype.exec = function (path, searchParams) {\n var m = this.regexp.exec(path);\n if (!m) return null;\n searchParams = searchParams || {};\n\n var paramNames = this.parameters(), nTotal = paramNames.length,\n nPath = this.segments.length - 1,\n values = {}, i, j, cfg, paramName;\n\n if (nPath !== m.length - 1) throw new Error(\"Unbalanced capture group in route '\" + this.source + \"'\");\n\n function decodePathArray(string) {\n function reverseString(str) { return str.split(\"\").reverse().join(\"\"); }\n function unquoteDashes(str) { return str.replace(/\\\\-/g, \"-\"); }\n\n var split = reverseString(string).split(/-(?!\\\\)/);\n var allReversed = map(split, reverseString);\n return map(allReversed, unquoteDashes).reverse();\n }\n\n var param, paramVal;\n for (i = 0; i < nPath; i++) {\n paramName = paramNames[i];\n param = this.params[paramName];\n paramVal = m[i+1];\n // if the param value matches a pre-replace pair, replace the value before decoding.\n for (j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n }\n if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);\n if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);\n values[paramName] = param.value(paramVal);\n }\n for (/**/; i < nTotal; i++) {\n paramName = paramNames[i];\n values[paramName] = this.params[paramName].value(searchParams[paramName]);\n param = this.params[paramName];\n paramVal = searchParams[paramName];\n for (j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;\n }\n if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);\n values[paramName] = param.value(paramVal);\n }\n\n return values;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#parameters\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Returns the names of all path and search parameters of this pattern in an unspecified order.\n *\n * @returns {Array.<string>} An array of parameter names. Must be treated as read-only. If the\n * pattern has no parameters, an empty array is returned.\n */\nUrlMatcher.prototype.parameters = function (param) {\n if (!isDefined(param)) return this.$$paramNames;\n return this.params[param] || null;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#validates\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param {Object} params The object hash of parameters to validate.\n * @returns {boolean} Returns `true` if `params` validates, otherwise `false`.\n */\nUrlMatcher.prototype.validates = function (params) {\n return this.params.$$validates(params);\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:UrlMatcher#format\n * @methodOf ui.router.util.type:UrlMatcher\n *\n * @description\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters. Null values for path parameters are\n * treated as empty strings.\n *\n * @example\n * <pre>\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * </pre>\n *\n * @param {Object} values the values to substitute for the parameters in this pattern.\n * @returns {string} the formatted URL (path and optionally search part).\n */\nUrlMatcher.prototype.format = function (values) {\n values = values || {};\n var segments = this.segments, params = this.parameters(), paramset = this.params;\n if (!this.validates(values)) return null;\n\n var i, search = false, nPath = segments.length - 1, nTotal = params.length, result = segments[0];\n\n function encodeDashes(str) { // Replace dashes with encoded \"\\-\"\n return encodeURIComponent(str).replace(/-/g, function(c) { return '%5C%' + c.charCodeAt(0).toString(16).toUpperCase(); });\n }\n\n for (i = 0; i < nTotal; i++) {\n var isPathParam = i < nPath;\n var name = params[i], param = paramset[name], value = param.value(values[name]);\n var isDefaultValue = param.isOptional && param.type.equals(param.value(), value);\n var squash = isDefaultValue ? param.squash : false;\n var encoded = param.type.encode(value);\n\n if (isPathParam) {\n var nextSegment = segments[i + 1];\n var isFinalPathParam = i + 1 === nPath;\n\n if (squash === false) {\n if (encoded != null) {\n if (isArray(encoded)) {\n result += map(encoded, encodeDashes).join(\"-\");\n } else {\n result += encodeURIComponent(encoded);\n }\n }\n result += nextSegment;\n } else if (squash === true) {\n var capture = result.match(/\\/$/) ? /\\/?(.*)/ : /(.*)/;\n result += nextSegment.match(capture)[1];\n } else if (isString(squash)) {\n result += squash + nextSegment;\n }\n\n if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1);\n } else {\n if (encoded == null || (isDefaultValue && squash !== false)) continue;\n if (!isArray(encoded)) encoded = [ encoded ];\n if (encoded.length === 0) continue;\n encoded = map(encoded, encodeURIComponent).join('&' + name + '=');\n result += (search ? '&' : '?') + (name + '=' + encoded);\n search = true;\n }\n }\n\n return result;\n};\n\n/**\n * @ngdoc object\n * @name ui.router.util.type:Type\n *\n * @description\n * Implements an interface to define custom parameter types that can be decoded from and encoded to\n * string parameters matched in a URL. Used by {@link ui.router.util.type:UrlMatcher `UrlMatcher`}\n * objects when matching or formatting URLs, or comparing or validating parameter values.\n *\n * See {@link ui.router.util.$urlMatcherFactory#methods_type `$urlMatcherFactory#type()`} for more\n * information on registering custom types.\n *\n * @param {Object} config A configuration object which contains the custom type definition. The object's\n * properties will override the default methods and/or pattern in `Type`'s public interface.\n * @example\n * <pre>\n * {\n * decode: function(val) { return parseInt(val, 10); },\n * encode: function(val) { return val && val.toString(); },\n * equals: function(a, b) { return this.is(a) && a === b; },\n * is: function(val) { return angular.isNumber(val) isFinite(val) && val % 1 === 0; },\n * pattern: /\\d+/\n * }\n * </pre>\n *\n * @property {RegExp} pattern The regular expression pattern used to match values of this type when\n * coming from a substring of a URL.\n *\n * @returns {Object} Returns a new `Type` object.\n */\nfunction Type(config) {\n extend(this, config);\n}\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#is\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Detects whether a value is of a particular type. Accepts a native (decoded) value\n * and determines whether it matches the current `Type` object.\n *\n * @param {*} val The value to check.\n * @param {string} key Optional. If the type check is happening in the context of a specific\n * {@link ui.router.util.type:UrlMatcher `UrlMatcher`} object, this is the name of the\n * parameter in which `val` is stored. Can be used for meta-programming of `Type` objects.\n * @returns {Boolean} Returns `true` if the value matches the type, otherwise `false`.\n */\nType.prototype.is = function(val, key) {\n return true;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#encode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Encodes a custom/native type value to a string that can be embedded in a URL. Note that the\n * return value does *not* need to be URL-safe (i.e. passed through `encodeURIComponent()`), it\n * only needs to be a representation of `val` that has been coerced to a string.\n *\n * @param {*} val The value to encode.\n * @param {string} key The name of the parameter in which `val` is stored. Can be used for\n * meta-programming of `Type` objects.\n * @returns {string} Returns a string representation of `val` that can be encoded in a URL.\n */\nType.prototype.encode = function(val, key) {\n return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#decode\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Converts a parameter value (from URL string or transition param) to a custom/native value.\n *\n * @param {string} val The URL parameter value to decode.\n * @param {string} key The name of the parameter in which `val` is stored. Can be used for\n * meta-programming of `Type` objects.\n * @returns {*} Returns a custom representation of the URL parameter value.\n */\nType.prototype.decode = function(val, key) {\n return val;\n};\n\n/**\n * @ngdoc function\n * @name ui.router.util.type:Type#equals\n * @methodOf ui.router.util.type:Type\n *\n * @description\n * Determines whether two decoded values are equivalent.\n *\n * @param {*} a A value to compare against.\n * @param {*} b A value to compare against.\n * @returns {Boolean} Returns `true` if the values are equivalent/equal, otherwise `false`.\n */\nType.prototype.equals = function(a, b) {\n return a == b;\n};\n\nType.prototype.$subPattern = function() {\n var sub = this.pattern.toString();\n return sub.substr(1, sub.length - 2);\n};\n\nType.prototype.pattern = /.*/;\n\nType.prototype.toString = function() { return \"{Type:\" + this.name + \"}\"; };\n\n/** Given an encoded string, or a decoded object, returns a decoded object */\nType.prototype.$normalize = function(val) {\n return this.is(val) ? val : this.decode(val);\n};\n\n/*\n * Wraps an existing custom Type as an array of Type, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\nType.prototype.$asArray = function(mode, isSearch) {\n if (!mode) return this;\n if (mode === \"auto\" && !isSearch) throw new Error(\"'auto' array mode is for query parameters only\");\n\n function ArrayType(type, mode) {\n function bindTo(type, callbackName) {\n return function() {\n return type[callbackName].apply(type, arguments);\n };\n }\n\n // Wrap non-array value as array\n function arrayWrap(val) { return isArray(val) ? val : (isDefined(val) ? [ val ] : []); }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch(val.length) {\n case 0: return undefined;\n case 1: return mode === \"auto\" ? val[0] : val;\n default: return val;\n }\n }\n function falsey(val) { return !val; }\n\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if (isArray(val) && val.length === 0) return val;\n val = arrayWrap(val);\n var result = map(val, callback);\n if (allTruthyMode === true)\n return filter(result, falsey).length === 0;\n return arrayUnwrap(result);\n };\n }\n\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length) return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i])) return false;\n }\n return true;\n };\n }\n\n this.encode = arrayHandler(bindTo(type, 'encode'));\n this.decode = arrayHandler(bindTo(type, 'decode'));\n this.is = arrayHandler(bindTo(type, 'is'), true);\n this.equals = arrayEqualsHandler(bindTo(type, 'equals'));\n this.pattern = type.pattern;\n this.$normalize = arrayHandler(bindTo(type, '$normalize'));\n this.name = type.name;\n this.$arrayMode = mode;\n }\n\n return new ArrayType(this, mode);\n};\n\n\n\n/**\n * @ngdoc object\n * @name ui.router.util.$urlMatcherFactory\n *\n * @description\n * Factory for {@link ui.router.util.type:UrlMatcher `UrlMatcher`} instances. The factory\n * is also available to providers under the name `$urlMatcherFactoryProvider`.\n */\nfunction $UrlMatcherFactory() {\n $$UMFP = this;\n\n var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;\n\n // Use tildes to pre-encode slashes.\n // If the slashes are simply URLEncoded, the browser can choose to pre-decode them,\n // and bidirectional encoding/decoding fails.\n // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character\n function valToString(val) { return val != null ? val.toString().replace(/(~|\\/)/g, function (m) { return {'~':'~~', '/':'~2F'}[m]; }) : val; }\n function valFromString(val) { return val != null ? val.toString().replace(/(~~|~2F)/g, function (m) { return {'~~':'~', '~2F':'/'}[m]; }) : val; }\n\n var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {\n \"string\": {\n encode: valToString,\n decode: valFromString,\n // TODO: in 1.0, make string .is() return false if value is undefined/null by default.\n // In 0.2.x, string params are optional by default for backwards compat\n is: function(val) { return val == null || !isDefined(val) || typeof val === \"string\"; },\n pattern: /[^/]*/\n },\n \"int\": {\n encode: valToString,\n decode: function(val) { return parseInt(val, 10); },\n is: function(val) { return val !== undefined && val !== null && this.decode(val.toString()) === val; },\n pattern: /-?\\d+/\n },\n \"bool\": {\n encode: function(val) { return val ? 1 : 0; },\n decode: function(val) { return parseInt(val, 10) !== 0; },\n is: function(val) { return val === true || val === false; },\n pattern: /0|1/\n },\n \"date\": {\n encode: function (val) {\n if (!this.is(val))\n return undefined;\n return [ val.getFullYear(),\n ('0' + (val.getMonth() + 1)).slice(-2),\n ('0' + val.getDate()).slice(-2)\n ].join(\"-\");\n },\n decode: function (val) {\n if (this.is(val)) return val;\n var match = this.capture.exec(val);\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n },\n is: function(val) { return val instanceof Date && !isNaN(val.valueOf()); },\n equals: function (a, b) { return this.is(a) && this.is(b) && a.toISOString() === b.toISOString(); },\n pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/\n },\n \"json\": {\n encode: angular.toJson,\n decode: angular.fromJson,\n is: angular.isObject,\n equals: angular.equals,\n pattern: /[^/]*/\n },\n \"any\": { // does not encode/decode\n encode: angular.identity,\n decode: angular.identity,\n equals: angular.equals,\n pattern: /.*/\n }\n };\n\n function getDefaultConfig() {\n return {\n strict: isStrictMode,\n caseInsensitive: isCaseInsensitive\n };\n }\n\n function isInjectable(value) {\n return (isFunction(value) || (isArray(value) && isFunction(value[value.length - 1])));\n }\n\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n $UrlMatcherFactory.$$getDefaultValue = function(config) {\n if (!isInjectable(config.value)) return config.value;\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n return injector.invoke(config.value);\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#caseInsensitive\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Defines whether URL matching should be case sensitive (the default behavior), or not.\n *\n * @param {boolean} value `false` to match URL in a case sensitive manner; otherwise `true`;\n * @returns {boolean} the current value of caseInsensitive\n */\n this.caseInsensitive = function(value) {\n if (isDefined(value))\n isCaseInsensitive = value;\n return isCaseInsensitive;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#strictMode\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Defines whether URLs should match trailing slashes, or not (the default behavior).\n *\n * @param {boolean=} value `false` to match trailing slashes in URLs, otherwise `true`.\n * @returns {boolean} the current value of strictMode\n */\n this.strictMode = function(value) {\n if (isDefined(value))\n isStrictMode = value;\n return isStrictMode;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#defaultSquashPolicy\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Sets the default behavior when generating or matching URLs with default parameter values.\n *\n * @param {string} value A string that defines the default parameter URL squashing behavior.\n * `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n * `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n * parameter is surrounded by slashes, squash (remove) one slash from the URL\n * any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n * the parameter value from the URL and replace it with this string.\n */\n this.defaultSquashPolicy = function(value) {\n if (!isDefined(value)) return defaultSquashPolicy;\n if (value !== true && value !== false && !isString(value))\n throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n defaultSquashPolicy = value;\n return value;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#compile\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Creates a {@link ui.router.util.type:UrlMatcher `UrlMatcher`} for the specified pattern.\n *\n * @param {string} pattern The URL pattern.\n * @param {Object} config The config object hash.\n * @returns {UrlMatcher} The UrlMatcher.\n */\n this.compile = function (pattern, config) {\n return new UrlMatcher(pattern, extend(getDefaultConfig(), config));\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#isMatcher\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Returns true if the specified object is a `UrlMatcher`, or false otherwise.\n *\n * @param {Object} object The object to perform the type check against.\n * @returns {Boolean} Returns `true` if the object matches the `UrlMatcher` interface, by\n * implementing all the same methods.\n */\n this.isMatcher = function (o) {\n if (!isObject(o)) return false;\n var result = true;\n\n forEach(UrlMatcher.prototype, function(val, name) {\n if (isFunction(val)) {\n result = result && (isDefined(o[name]) && isFunction(o[name]));\n }\n });\n return result;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.util.$urlMatcherFactory#type\n * @methodOf ui.router.util.$urlMatcherFactory\n *\n * @description\n * Registers a custom {@link ui.router.util.type:Type `Type`} object that can be used to\n * generate URLs with typed parameters.\n *\n * @param {string} name The type name.\n * @param {Object|Function} definition The type definition. See\n * {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n * @param {Object|Function} definitionFn (optional) A function that is injected before the app\n * runtime starts. The result of this function is merged into the existing `definition`.\n * See {@link ui.router.util.type:Type `Type`} for information on the values accepted.\n *\n * @returns {Object} Returns `$urlMatcherFactoryProvider`.\n *\n * @example\n * This is a simple example of a custom type that encodes and decodes items from an\n * array, using the array index as the URL-encoded value:\n *\n * <pre>\n * var list = ['John', 'Paul', 'George', 'Ringo'];\n *\n * $urlMatcherFactoryProvider.type('listItem', {\n * encode: function(item) {\n * // Represent the list item in the URL using its corresponding index\n * return list.indexOf(item);\n * },\n * decode: function(item) {\n * // Look up the list item by index\n * return list[parseInt(item, 10)];\n * },\n * is: function(item) {\n * // Ensure the item is valid by checking to see that it appears\n * // in the list\n * return list.indexOf(item) > -1;\n * }\n * });\n *\n * $stateProvider.state('list', {\n * url: \"/list/{item:listItem}\",\n * controller: function($scope, $stateParams) {\n * console.log($stateParams.item);\n * }\n * });\n *\n * // ...\n *\n * // Changes URL to '/list/3', logs \"Ringo\" to the console\n * $state.go('list', { item: \"Ringo\" });\n * </pre>\n *\n * This is a more complex example of a type that relies on dependency injection to\n * interact with services, and uses the parameter name from the URL to infer how to\n * handle encoding and decoding parameter values:\n *\n * <pre>\n * // Defines a custom type that gets a value from a service,\n * // where each service gets different types of values from\n * // a backend API:\n * $urlMatcherFactoryProvider.type('dbObject', {}, function(Users, Posts) {\n *\n * // Matches up services to URL parameter names\n * var services = {\n * user: Users,\n * post: Posts\n * };\n *\n * return {\n * encode: function(object) {\n * // Represent the object in the URL using its unique ID\n * return object.id;\n * },\n * decode: function(value, key) {\n * // Look up the object by ID, using the parameter\n * // name (key) to call the correct service\n * return services[key].findById(value);\n * },\n * is: function(object, key) {\n * // Check that object is a valid dbObject\n * return angular.isObject(object) && object.id && services[key];\n * }\n * equals: function(a, b) {\n * // Check the equality of decoded objects by comparing\n * // their unique IDs\n * return a.id === b.id;\n * }\n * };\n * });\n *\n * // In a config() block, you can then attach URLs with\n * // type-annotated parameters:\n * $stateProvider.state('users', {\n * url: \"/users\",\n * // ...\n * }).state('users.item', {\n * url: \"/{user:dbObject}\",\n * controller: function($scope, $stateParams) {\n * // $stateParams.user will now be an object returned from\n * // the Users service\n * },\n * // ...\n * });\n * </pre>\n */\n this.type = function (name, definition, definitionFn) {\n if (!isDefined(definition)) return $types[name];\n if ($types.hasOwnProperty(name)) throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n\n $types[name] = new Type(extend({ name: name }, definition));\n if (definitionFn) {\n typeQueue.push({ name: name, def: definitionFn });\n if (!enqueue) flushTypeQueue();\n }\n return this;\n };\n\n // `flushTypeQueue()` waits until `$urlMatcherFactory` is injected before invoking the queued `definitionFn`s\n function flushTypeQueue() {\n while(typeQueue.length) {\n var type = typeQueue.shift();\n if (type.pattern) throw new Error(\"You cannot override a type's .pattern at runtime.\");\n angular.extend($types[type.name], injector.invoke(type.def));\n }\n }\n\n // Register default types. Store them in the prototype of $types.\n forEach(defaultTypes, function(type, name) { $types[name] = new Type(extend({name: name}, type)); });\n $types = inherit($types, {});\n\n /* No need to document $get, since it returns this */\n this.$get = ['$injector', function ($injector) {\n injector = $injector;\n enqueue = false;\n flushTypeQueue();\n\n forEach(defaultTypes, function(type, name) {\n if (!$types[name]) $types[name] = new Type(type);\n });\n return this;\n }];\n\n this.Param = function Param(id, type, config, location) {\n var self = this;\n config = unwrapShorthand(config);\n type = getType(config, type, location);\n var arrayMode = getArrayMode();\n type = arrayMode ? type.$asArray(arrayMode, location === \"search\") : type;\n if (type.name === \"string\" && !arrayMode && location === \"path\" && config.value === undefined)\n config.value = \"\"; // for 0.2.x; in 0.3.0+ do not automatically default to \"\"\n var isOptional = config.value !== undefined;\n var squash = getSquashPolicy(config, isOptional);\n var replace = getReplace(config, arrayMode, isOptional, squash);\n\n function unwrapShorthand(config) {\n var keys = isObject(config) ? objectKeys(config) : [];\n var isShorthand = indexOf(keys, \"value\") === -1 && indexOf(keys, \"type\") === -1 &&\n indexOf(keys, \"squash\") === -1 && indexOf(keys, \"array\") === -1;\n if (isShorthand) config = { value: config };\n config.$$fn = isInjectable(config.value) ? config.value : function () { return config.value; };\n return config;\n }\n\n function getType(config, urlType, location) {\n if (config.type && urlType) throw new Error(\"Param '\"+id+\"' has two type configurations.\");\n if (urlType) return urlType;\n if (!config.type) return (location === \"config\" ? $types.any : $types.string);\n\n if (angular.isString(config.type))\n return $types[config.type];\n if (config.type instanceof Type)\n return config.type;\n return new Type(config.type);\n }\n\n // array config: param name (param[]) overrides default settings. explicit config overrides param name.\n function getArrayMode() {\n var arrayDefaults = { array: (location === \"search\" ? \"auto\" : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }\n\n /**\n * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n */\n function getSquashPolicy(config, isOptional) {\n var squash = config.squash;\n if (!isOptional || squash === false) return false;\n if (!isDefined(squash) || squash == null) return defaultSquashPolicy;\n if (squash === true || isString(squash)) return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n }\n\n function getReplace(config, arrayMode, isOptional, squash) {\n var replace, configuredKeys, defaultPolicy = [\n { from: \"\", to: (isOptional || arrayMode ? undefined : \"\") },\n { from: null, to: (isOptional || arrayMode ? undefined : \"\") }\n ];\n replace = isArray(config.replace) ? config.replace : [];\n if (isString(squash))\n replace.push({ from: squash, to: undefined });\n configuredKeys = map(replace, function(item) { return item.from; } );\n return filter(defaultPolicy, function(item) { return indexOf(configuredKeys, item.from) === -1; }).concat(replace);\n }\n\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n function $$getDefaultValue() {\n if (!injector) throw new Error(\"Injectable functions cannot be called at configuration time\");\n var defaultValue = injector.invoke(config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !self.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + self.id + \"' is not an instance of Type (\" + self.type.name + \")\");\n return defaultValue;\n }\n\n /**\n * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n * default value, which may be the result of an injectable function.\n */\n function $value(value) {\n function hasReplaceVal(val) { return function(obj) { return obj.from === val; }; }\n function $replace(value) {\n var replacement = map(filter(self.replace, hasReplaceVal(value)), function(obj) { return obj.to; });\n return replacement.length ? replacement[0] : value;\n }\n value = $replace(value);\n return !isDefined(value) ? $$getDefaultValue() : self.type.$normalize(value);\n }\n\n function toString() { return \"{Param:\" + id + \" \" + type + \" squash: '\" + squash + \"' optional: \" + isOptional + \"}\"; }\n\n extend(this, {\n id: id,\n type: type,\n location: location,\n array: arrayMode,\n squash: squash,\n replace: replace,\n isOptional: isOptional,\n value: $value,\n dynamic: undefined,\n config: config,\n toString: toString\n });\n };\n\n function ParamSet(params) {\n extend(this, params || {});\n }\n\n ParamSet.prototype = {\n $$new: function() {\n return inherit(this, extend(new ParamSet(), { $$parent: this}));\n },\n $$keys: function () {\n var keys = [], chain = [], parent = this,\n ignore = objectKeys(ParamSet.prototype);\n while (parent) { chain.push(parent); parent = parent.$$parent; }\n chain.reverse();\n forEach(chain, function(paramset) {\n forEach(objectKeys(paramset), function(key) {\n if (indexOf(keys, key) === -1 && indexOf(ignore, key) === -1) keys.push(key);\n });\n });\n return keys;\n },\n $$values: function(paramValues) {\n var values = {}, self = this;\n forEach(self.$$keys(), function(key) {\n values[key] = self[key].value(paramValues && paramValues[key]);\n });\n return values;\n },\n $$equals: function(paramValues1, paramValues2) {\n var equal = true, self = this;\n forEach(self.$$keys(), function(key) {\n var left = paramValues1 && paramValues1[key], right = paramValues2 && paramValues2[key];\n if (!self[key].type.equals(left, right)) equal = false;\n });\n return equal;\n },\n $$validates: function $$validate(paramValues) {\n var keys = this.$$keys(), i, param, rawVal, normalized, encoded;\n for (i = 0; i < keys.length; i++) {\n param = this[keys[i]];\n rawVal = paramValues[keys[i]];\n if ((rawVal === undefined || rawVal === null) && param.isOptional)\n break; // There was no parameter value, but the param is optional\n normalized = param.type.$normalize(rawVal);\n if (!param.type.is(normalized))\n return false; // The value was not of the correct Type, and could not be decoded to the correct Type\n encoded = param.type.encode(normalized);\n if (angular.isString(encoded) && !param.type.pattern.exec(encoded))\n return false; // The value was of the correct type, but when encoded, did not match the Type's regexp\n }\n return true;\n },\n $$parent: undefined\n };\n\n this.ParamSet = ParamSet;\n}\n\n// Register as a provider so it's available to other providers\nangular.module('ui.router.util').provider('$urlMatcherFactory', $UrlMatcherFactory);\nangular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);\n\n/**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider\n *\n * @requires ui.router.util.$urlMatcherFactoryProvider\n * @requires $locationProvider\n *\n * @description\n * `$urlRouterProvider` has the responsibility of watching `$location`. \n * When `$location` changes it runs through a list of rules one by one until a \n * match is found. `$urlRouterProvider` is used behind the scenes anytime you specify \n * a url in a state configuration. All urls are compiled into a UrlMatcher object.\n *\n * There are several methods on `$urlRouterProvider` that make it useful to use directly\n * in your module config.\n */\n$UrlRouterProvider.$inject = ['$locationProvider', '$urlMatcherFactoryProvider'];\nfunction $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {\n var rules = [], otherwise = null, interceptDeferred = false, listener;\n\n // Returns a string that is a prefix of all strings matching the RegExp\n function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }\n\n // Interpolates matched values into a String.replace()-style pattern\n function interpolate(pattern, match) {\n return pattern.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n }\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouterProvider#rule\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Defines rules that are used by `$urlRouterProvider` to find matches for\n * specific URLs.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Here's an example of how you might allow case insensitive urls\n * $urlRouterProvider.rule(function ($injector, $location) {\n * var path = $location.path(),\n * normalized = path.toLowerCase();\n *\n * if (path !== normalized) {\n * return normalized;\n * }\n * });\n * });\n * </pre>\n *\n * @param {function} rule Handler function that takes `$injector` and `$location`\n * services as arguments. You can use them to return a valid path as a string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n this.rule = function (rule) {\n if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n rules.push(rule);\n return this;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.router.$urlRouterProvider#otherwise\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Defines a path that is used when an invalid route is requested.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // if the path doesn't match any of the urls you configured\n * // otherwise will take care of routing the user to the\n * // specified url\n * $urlRouterProvider.otherwise('/index');\n *\n * // Example of using function rule as param\n * $urlRouterProvider.otherwise(function ($injector, $location) {\n * return '/a/valid/url';\n * });\n * });\n * </pre>\n *\n * @param {string|function} rule The url path you want to redirect to or a function \n * rule that returns the url path. The function version is passed two params: \n * `$injector` and `$location` services, and must return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n this.otherwise = function (rule) {\n if (isString(rule)) {\n var redirect = rule;\n rule = function () { return redirect; };\n }\n else if (!isFunction(rule)) throw new Error(\"'rule' must be a function\");\n otherwise = rule;\n return this;\n };\n\n\n function handleIfMatch($injector, handler, match) {\n if (!match) return false;\n var result = $injector.invoke(handler, handler, { $match: match });\n return isDefined(result) ? result : true;\n }\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouterProvider#when\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Registers a handler for a given url matching. \n * \n * If the handler is a string, it is\n * treated as a redirect, and is interpolated according to the syntax of match\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n *\n * If the handler is a function, it is injectable. It gets invoked if `$location`\n * matches. You have the option of inject the match object as `$match`.\n *\n * The handler can return\n *\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n * will continue trying to find another one that matches.\n * - **string** which is treated as a redirect and passed to `$location.url()`\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n * if ($state.$current.navigable !== state ||\n * !equalForKeys($match, $stateParams) {\n * $state.transitionTo(state, $match, false);\n * }\n * });\n * });\n * </pre>\n *\n * @param {string|object} what The incoming path that you want to redirect.\n * @param {string|function} handler The path you want to redirect your user to.\n */\n this.when = function (what, handler) {\n var redirect, handlerIsString = isString(handler);\n if (isString(what)) what = $urlMatcherFactory.compile(what);\n\n if (!handlerIsString && !isFunction(handler) && !isArray(handler))\n throw new Error(\"invalid 'handler' in when()\");\n\n var strategies = {\n matcher: function (what, handler) {\n if (handlerIsString) {\n redirect = $urlMatcherFactory.compile(handler);\n handler = ['$match', function ($match) { return redirect.format($match); }];\n }\n return extend(function ($injector, $location) {\n return handleIfMatch($injector, handler, what.exec($location.path(), $location.search()));\n }, {\n prefix: isString(what.prefix) ? what.prefix : ''\n });\n },\n regex: function (what, handler) {\n if (what.global || what.sticky) throw new Error(\"when() RegExp must not be global or sticky\");\n\n if (handlerIsString) {\n redirect = handler;\n handler = ['$match', function ($match) { return interpolate(redirect, $match); }];\n }\n return extend(function ($injector, $location) {\n return handleIfMatch($injector, handler, what.exec($location.path()));\n }, {\n prefix: regExpPrefix(what)\n });\n }\n };\n\n var check = { matcher: $urlMatcherFactory.isMatcher(what), regex: what instanceof RegExp };\n\n for (var n in check) {\n if (check[n]) return this.rule(strategies[n](what, handler));\n }\n\n throw new Error(\"invalid 'what' in when()\");\n };\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouterProvider#deferIntercept\n * @methodOf ui.router.router.$urlRouterProvider\n *\n * @description\n * Disables (or enables) deferring location change interception.\n *\n * If you wish to customize the behavior of syncing the URL (for example, if you wish to\n * defer a transition but maintain the current URL), call this method at configuration time.\n * Then, at run time, call `$urlRouter.listen()` after you have configured your own\n * `$locationChangeSuccess` event handler.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n *\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * // this allows you to configure custom behavior in between\n * // location changes and route synchronization:\n * $urlRouterProvider.deferIntercept();\n *\n * }).run(function ($rootScope, $urlRouter, UserService) {\n *\n * $rootScope.$on('$locationChangeSuccess', function(e) {\n * // UserService is an example service for managing user state\n * if (UserService.isLoggedIn()) return;\n *\n * // Prevent $urlRouter's default handler from firing\n * e.preventDefault();\n *\n * UserService.handleLogin().then(function() {\n * // Once the user has logged in, sync the current URL\n * // to the router:\n * $urlRouter.sync();\n * });\n * });\n *\n * // Configures $urlRouter's listener *after* your custom listener\n * $urlRouter.listen();\n * });\n * </pre>\n *\n * @param {boolean} defer Indicates whether to defer location change interception. Passing\n no parameter is equivalent to `true`.\n */\n this.deferIntercept = function (defer) {\n if (defer === undefined) defer = true;\n interceptDeferred = defer;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.router.$urlRouter\n *\n * @requires $location\n * @requires $rootScope\n * @requires $injector\n * @requires $browser\n *\n * @description\n *\n */\n this.$get = $get;\n $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer'];\n function $get( $location, $rootScope, $injector, $browser, $sniffer) {\n\n var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;\n\n function appendBasePath(url, isHtml5, absolute) {\n if (baseHref === '/') return url;\n if (isHtml5) return baseHref.slice(0, -1) + url;\n if (absolute) return baseHref.slice(1) + url;\n return url;\n }\n\n // TODO: Optimize groups of rules with non-empty prefix into some sort of decision tree\n function update(evt) {\n if (evt && evt.defaultPrevented) return;\n var ignoreUpdate = lastPushedUrl && $location.url() === lastPushedUrl;\n lastPushedUrl = undefined;\n // TODO: Re-implement this in 1.0 for https://github.com/angular-ui/ui-router/issues/1573\n //if (ignoreUpdate) return true;\n\n function check(rule) {\n var handled = rule($injector, $location);\n\n if (!handled) return false;\n if (isString(handled)) $location.replace().url(handled);\n return true;\n }\n var n = rules.length, i;\n\n for (i = 0; i < n; i++) {\n if (check(rules[i])) return;\n }\n // always check otherwise last to allow dynamic updates to the set of rules\n if (otherwise) check(otherwise);\n }\n\n function listen() {\n listener = listener || $rootScope.$on('$locationChangeSuccess', update);\n return listener;\n }\n\n if (!interceptDeferred) listen();\n\n return {\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouter#sync\n * @methodOf ui.router.router.$urlRouter\n *\n * @description\n * Triggers an update; the same update that happens when the address bar url changes, aka `$locationChangeSuccess`.\n * This method is useful when you need to use `preventDefault()` on the `$locationChangeSuccess` event,\n * perform some custom logic (route protection, auth, config, redirection, etc) and then finally proceed\n * with the transition by calling `$urlRouter.sync()`.\n *\n * @example\n * <pre>\n * angular.module('app', ['ui.router'])\n * .run(function($rootScope, $urlRouter) {\n * $rootScope.$on('$locationChangeSuccess', function(evt) {\n * // Halt state change from even starting\n * evt.preventDefault();\n * // Perform custom logic\n * var meetsRequirement = ...\n * // Continue with the update and state transition if logic allows\n * if (meetsRequirement) $urlRouter.sync();\n * });\n * });\n * </pre>\n */\n sync: function() {\n update();\n },\n\n listen: function() {\n return listen();\n },\n\n update: function(read) {\n if (read) {\n location = $location.url();\n return;\n }\n if ($location.url() === location) return;\n\n $location.url(location);\n $location.replace();\n },\n\n push: function(urlMatcher, params, options) {\n var url = urlMatcher.format(params || {});\n\n // Handle the special hash param, if needed\n if (url !== null && params && params['#']) {\n url += '#' + params['#'];\n }\n\n $location.url(url);\n lastPushedUrl = options && options.$$avoidResync ? $location.url() : undefined;\n if (options && options.replace) $location.replace();\n },\n\n /**\n * @ngdoc function\n * @name ui.router.router.$urlRouter#href\n * @methodOf ui.router.router.$urlRouter\n *\n * @description\n * A URL generation method that returns the compiled URL for a given\n * {@link ui.router.util.type:UrlMatcher `UrlMatcher`}, populated with the provided parameters.\n *\n * @example\n * <pre>\n * $bob = $urlRouter.href(new UrlMatcher(\"/about/:person\"), {\n * person: \"bob\"\n * });\n * // $bob == \"/about/bob\";\n * </pre>\n *\n * @param {UrlMatcher} urlMatcher The `UrlMatcher` object which is used as the template of the URL to generate.\n * @param {object=} params An object of parameter values to fill the matcher's required parameters.\n * @param {object=} options Options object. The options are:\n *\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n *\n * @returns {string} Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n */\n href: function(urlMatcher, params, options) {\n if (!urlMatcher.validates(params)) return null;\n\n var isHtml5 = $locationProvider.html5Mode();\n if (angular.isObject(isHtml5)) {\n isHtml5 = isHtml5.enabled;\n }\n\n isHtml5 = isHtml5 && $sniffer.history;\n \n var url = urlMatcher.format(params);\n options = options || {};\n\n if (!isHtml5 && url !== null) {\n url = \"#\" + $locationProvider.hashPrefix() + url;\n }\n\n // Handle special hash param, if needed\n if (url !== null && params && params['#']) {\n url += '#' + params['#'];\n }\n\n url = appendBasePath(url, isHtml5, options.absolute);\n\n if (!options.absolute || !url) {\n return url;\n }\n\n var slash = (!isHtml5 && url ? '/' : ''), port = $location.port();\n port = (port === 80 || port === 443 ? '' : ':' + port);\n\n return [$location.protocol(), '://', $location.host(), port, slash, url].join('');\n }\n };\n }\n}\n\nangular.module('ui.router.router').provider('$urlRouter', $UrlRouterProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$stateProvider\n *\n * @requires ui.router.router.$urlRouterProvider\n * @requires ui.router.util.$urlMatcherFactoryProvider\n *\n * @description\n * The new `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\n$StateProvider.$inject = ['$urlRouterProvider', '$urlMatcherFactoryProvider'];\nfunction $StateProvider( $urlRouterProvider, $urlMatcherFactory) {\n\n var root, states = {}, $state, queue = {}, abstractKey = 'abstract';\n\n // Builds state properties from definition passed to registerState()\n var stateBuilder = {\n\n // Derive parent state from a hierarchical name only if 'parent' is not explicitly defined.\n // state.children = [];\n // if (parent) parent.children.push(state);\n parent: function(state) {\n if (isDefined(state.parent) && state.parent) return findState(state.parent);\n // regex matches any valid composite state name\n // would match \"contact.list\" but not \"contacts\"\n var compositeName = /^(.+)\\.[^.]+$/.exec(state.name);\n return compositeName ? findState(compositeName[1]) : root;\n },\n\n // inherit 'data' from parent and override by own values (if any)\n data: function(state) {\n if (state.parent && state.parent.data) {\n state.data = state.self.data = inherit(state.parent.data, state.data);\n }\n return state.data;\n },\n\n // Build a URLMatcher if necessary, either via a relative or absolute URL\n url: function(state) {\n var url = state.url, config = { params: state.params || {} };\n\n if (isString(url)) {\n if (url.charAt(0) == '^') return $urlMatcherFactory.compile(url.substring(1), config);\n return (state.parent.navigable || root).url.concat(url, config);\n }\n\n if (!url || $urlMatcherFactory.isMatcher(url)) return url;\n throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n },\n\n // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n navigable: function(state) {\n return state.url ? state : (state.parent ? state.parent.navigable : null);\n },\n\n // Own parameters for this state. state.url.params is already built at this point. Create and add non-url params\n ownParams: function(state) {\n var params = state.url && state.url.params || new $$UMFP.ParamSet();\n forEach(state.params || {}, function(config, id) {\n if (!params[id]) params[id] = new $$UMFP.Param(id, null, config, \"config\");\n });\n return params;\n },\n\n // Derive parameters for this state and ensure they're a super-set of parent's parameters\n params: function(state) {\n var ownParams = pick(state.ownParams, state.ownParams.$$keys());\n return state.parent && state.parent.params ? extend(state.parent.params.$$new(), ownParams) : new $$UMFP.ParamSet();\n },\n\n // If there is no explicit multi-view configuration, make one up so we don't have\n // to handle both cases in the view directive later. Note that having an explicit\n // 'views' property will mean the default unnamed view properties are ignored. This\n // is also a good time to resolve view names to absolute names, so everything is a\n // straight lookup at link time.\n views: function(state) {\n var views = {};\n\n forEach(isDefined(state.views) ? state.views : { '': state }, function (view, name) {\n if (name.indexOf('@') < 0) name += '@' + state.parent.name;\n view.resolveAs = view.resolveAs || state.resolveAs || '$resolve';\n views[name] = view;\n });\n return views;\n },\n\n // Keep a full path from the root down to this state as this is needed for state activation.\n path: function(state) {\n return state.parent ? state.parent.path.concat(state) : []; // exclude root from path\n },\n\n // Speed up $state.contains() as it's used a lot\n includes: function(state) {\n var includes = state.parent ? extend({}, state.parent.includes) : {};\n includes[state.name] = true;\n return includes;\n },\n\n $delegates: {}\n };\n\n function isRelative(stateName) {\n return stateName.indexOf(\".\") === 0 || stateName.indexOf(\"^\") === 0;\n }\n\n function findState(stateOrName, base) {\n if (!stateOrName) return undefined;\n\n var isStr = isString(stateOrName),\n name = isStr ? stateOrName : stateOrName.name,\n path = isRelative(name);\n\n if (path) {\n if (!base) throw new Error(\"No reference point given for path '\" + name + \"'\");\n base = findState(base);\n \n var rel = name.split(\".\"), i = 0, pathLength = rel.length, current = base;\n\n for (; i < pathLength; i++) {\n if (rel[i] === \"\" && i === 0) {\n current = base;\n continue;\n }\n if (rel[i] === \"^\") {\n if (!current.parent) throw new Error(\"Path '\" + name + \"' not valid for state '\" + base.name + \"'\");\n current = current.parent;\n continue;\n }\n break;\n }\n rel = rel.slice(i).join(\".\");\n name = current.name + (current.name && rel ? \".\" : \"\") + rel;\n }\n var state = states[name];\n\n if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n return state;\n }\n return undefined;\n }\n\n function queueState(parentName, state) {\n if (!queue[parentName]) {\n queue[parentName] = [];\n }\n queue[parentName].push(state);\n }\n\n function flushQueuedChildren(parentName) {\n var queued = queue[parentName] || [];\n while(queued.length) {\n registerState(queued.shift());\n }\n }\n\n function registerState(state) {\n // Wrap a new object around the state so we can store our private details easily.\n state = inherit(state, {\n self: state,\n resolve: state.resolve || {},\n toString: function() { return this.name; }\n });\n\n var name = state.name;\n if (!isString(name) || name.indexOf('@') >= 0) throw new Error(\"State must have a valid name\");\n if (states.hasOwnProperty(name)) throw new Error(\"State '\" + name + \"' is already defined\");\n\n // Get parent name\n var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))\n : (isString(state.parent)) ? state.parent\n : (isObject(state.parent) && isString(state.parent.name)) ? state.parent.name\n : '';\n\n // If parent is not registered yet, add state to queue and register later\n if (parentName && !states[parentName]) {\n return queueState(parentName, state.self);\n }\n\n for (var key in stateBuilder) {\n if (isFunction(stateBuilder[key])) state[key] = stateBuilder[key](state, stateBuilder.$delegates[key]);\n }\n states[name] = state;\n\n // Register the state in the global state list and with $urlRouter if necessary.\n if (!state[abstractKey] && state.url) {\n $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) {\n if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) {\n $state.transitionTo(state, $match, { inherit: true, location: false });\n }\n }]);\n }\n\n // Register any queued children\n flushQueuedChildren(name);\n\n return state;\n }\n\n // Checks text to see if it looks like a glob.\n function isGlob (text) {\n return text.indexOf('*') > -1;\n }\n\n // Returns true if glob matches current $state name.\n function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match single stars\n for (var i = 0, l = globSegments.length; i < l; i++) {\n if (globSegments[i] === '*') {\n segments[i] = '*';\n }\n }\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //match greedy ends\n if (globSegments[globSegments.length - 1] === '**') {\n segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);\n segments.push('**');\n }\n\n if (globSegments.length != segments.length) {\n return false;\n }\n\n return segments.join('') === globSegments.join('');\n }\n\n\n // Implicit root state that is always active\n root = registerState({\n name: '',\n url: '^',\n views: null,\n 'abstract': true\n });\n root.navigable = null;\n\n\n /**\n * @ngdoc function\n * @name ui.router.state.$stateProvider#decorator\n * @methodOf ui.router.state.$stateProvider\n *\n * @description\n * Allows you to extend (carefully) or override (at your own peril) the \n * `stateBuilder` object used internally by `$stateProvider`. This can be used \n * to add custom functionality to ui-router, for example inferring templateUrl \n * based on the state name.\n *\n * When passing only a name, it returns the current (original or decorated) builder\n * function that matches `name`.\n *\n * The builder functions that can be decorated are listed below. Though not all\n * necessarily have a good use case for decoration, that is up to you to decide.\n *\n * In addition, users can attach custom decorators, which will generate new \n * properties within the state's internal definition. There is currently no clear \n * use-case for this beyond accessing internal states (i.e. $state.$current), \n * however, expect this to become increasingly relevant as we introduce additional \n * meta-programming features.\n *\n * **Warning**: Decorators should not be interdependent because the order of \n * execution of the builder functions in non-deterministic. Builder functions \n * should only be dependent on the state definition object and super function.\n *\n *\n * Existing builder functions and current return values:\n *\n * - **parent** `{object}` - returns the parent state object.\n * - **data** `{object}` - returns state data, including any inherited data that is not\n * overridden by own values (if any).\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n * or `null`.\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is \n * navigable).\n * - **params** `{object}` - returns an array of state params that are ensured to \n * be a super-set of parent's params.\n * - **views** `{object}` - returns a views object where each key is an absolute view \n * name (i.e. \"viewName@stateName\") and each value is the config object \n * (template, controller) for the view. Even when you don't use the views object \n * explicitly on a state config, one is still created for you internally.\n * So by decorating this builder function you have access to decorating template \n * and controller properties.\n * - **ownParams** `{object}` - returns an array of params that belong to the state, \n * not including any params defined by ancestor states.\n * - **path** `{string}` - returns the full path from the root down to this state. \n * Needed for state activation.\n * - **includes** `{object}` - returns an object that includes every state that \n * would pass a `$state.includes()` test.\n *\n * @example\n * <pre>\n * // Override the internal 'views' builder with a function that takes the state\n * // definition, and a reference to the internal function being overridden:\n * $stateProvider.decorator('views', function (state, parent) {\n * var result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * var autoName = (state.name + '.' + name).replace('.', '/');\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n * result[name] = config;\n * });\n * return result;\n * });\n *\n * $stateProvider.state('home', {\n * views: {\n * 'contact.list': { controller: 'ListController' },\n * 'contact.item': { controller: 'ItemController' }\n * }\n * });\n *\n * // ...\n *\n * $state.go('home');\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * </pre>\n *\n * @param {string} name The name of the builder function to decorate. \n * @param {object} func A function that is responsible for decorating the original \n * builder function. The function receives two parameters:\n *\n * - `{object}` - state - The state config object.\n * - `{object}` - super - The original builder function.\n *\n * @return {object} $stateProvider - $stateProvider instance\n */\n this.decorator = decorator;\n function decorator(name, func) {\n /*jshint validthis: true */\n if (isString(name) && !isDefined(func)) {\n return stateBuilder[name];\n }\n if (!isFunction(func) || !isString(name)) {\n return this;\n }\n if (stateBuilder[name] && !stateBuilder.$delegates[name]) {\n stateBuilder.$delegates[name] = stateBuilder[name];\n }\n stateBuilder[name] = func;\n return this;\n }\n\n /**\n * @ngdoc function\n * @name ui.router.state.$stateProvider#state\n * @methodOf ui.router.state.$stateProvider\n *\n * @description\n * Registers a state configuration under a given state name. The stateConfig object\n * has the following acceptable properties.\n *\n * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n * @param {object} stateConfig State configuration object.\n * @param {string|function=} stateConfig.template\n * <a id='template'></a>\n * html template as a string or a function that returns\n * an html template as a string which should be used by the uiView directives. This property \n * takes precedence over templateUrl.\n * \n * If `template` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * <pre>template:\n * \"<h1>inline template definition</h1>\" +\n * \"<div ui-view></div>\"</pre>\n * <pre>template: function(params) {\n * return \"<h1>generated template</h1>\"; }</pre>\n * </div>\n *\n * @param {string|function=} stateConfig.templateUrl\n * <a id='templateUrl'></a>\n *\n * path or function that returns a path to an html\n * template that should be used by uiView.\n * \n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by \n * applying the current state\n *\n * <pre>templateUrl: \"home.html\"</pre>\n * <pre>templateUrl: function(params) {\n * return myTemplates[params.pageId]; }</pre>\n *\n * @param {function=} stateConfig.templateProvider\n * <a id='templateProvider'></a>\n * Provider function that returns HTML content string.\n * <pre> templateProvider:\n * function(MyTemplateService, params) {\n * return MyTemplateService.getTemplate(params.pageId);\n * }</pre>\n *\n * @param {string|function=} stateConfig.controller\n * <a id='controller'></a>\n *\n * Controller fn that should be associated with newly\n * related scope or the name of a registered controller if passed as a string.\n * Optionally, the ControllerAs may be declared here.\n * <pre>controller: \"MyRegisteredController\"</pre>\n * <pre>controller:\n * \"MyRegisteredController as fooCtrl\"}</pre>\n * <pre>controller: function($scope, MyService) {\n * $scope.data = MyService.getData(); }</pre>\n *\n * @param {function=} stateConfig.controllerProvider\n * <a id='controllerProvider'></a>\n *\n * Injectable provider function that returns the actual controller or string.\n * <pre>controllerProvider:\n * function(MyResolveData) {\n * if (MyResolveData.foo)\n * return \"FooCtrl\"\n * else if (MyResolveData.bar)\n * return \"BarCtrl\";\n * else return function($scope) {\n * $scope.baz = \"Qux\";\n * }\n * }</pre>\n *\n * @param {string=} stateConfig.controllerAs\n * <a id='controllerAs'></a>\n * \n * A controller alias name. If present the controller will be\n * published to scope under the controllerAs name.\n * <pre>controllerAs: \"myCtrl\"</pre>\n *\n * @param {string|object=} stateConfig.parent\n * <a id='parent'></a>\n * Optionally specifies the parent state of this state.\n *\n * <pre>parent: 'parentState'</pre>\n * <pre>parent: parentState // JS variable</pre>\n *\n * @param {object=} stateConfig.resolve\n * <a id='resolve'></a>\n *\n * An optional map<string, function> of dependencies which\n * should be injected into the controller. If any of these dependencies are promises, \n * the router will wait for them all to be resolved before the controller is instantiated.\n * If all the promises are resolved successfully, the $stateChangeSuccess event is fired\n * and the values of the resolved promises are injected into any controllers that reference them.\n * If any of the promises are rejected the $stateChangeError event is fired.\n *\n * The map object is:\n * \n * - key - {string}: name of dependency to be injected into controller\n * - factory - {string|function}: If string then it is alias for service. Otherwise if function, \n * it is injected and return value it treated as dependency. If result is a promise, it is \n * resolved before its value is injected into controller.\n *\n * <pre>resolve: {\n * myResolve1:\n * function($http, $stateParams) {\n * return $http.get(\"/api/foos/\"+stateParams.fooID);\n * }\n * }</pre>\n *\n * @param {string=} stateConfig.url\n * <a id='url'></a>\n *\n * A url fragment with optional parameters. When a state is navigated or\n * transitioned to, the `$stateParams` service will be populated with any \n * parameters that were passed.\n *\n * (See {@link ui.router.util.type:UrlMatcher UrlMatcher} `UrlMatcher`} for\n * more details on acceptable patterns )\n *\n * examples:\n * <pre>url: \"/home\"\n * url: \"/users/:userid\"\n * url: \"/books/{bookid:[a-zA-Z_-]}\"\n * url: \"/books/{categoryid:int}\"\n * url: \"/books/{publishername:string}/{categoryid:int}\"\n * url: \"/messages?before&after\"\n * url: \"/messages?{before:date}&{after:date}\"\n * url: \"/messages/:mailboxid?{before:date}&{after:date}\"\n * </pre>\n *\n * @param {object=} stateConfig.views\n * <a id='views'></a>\n * an optional map<string, object> which defined multiple views, or targets views\n * manually/explicitly.\n *\n * Examples:\n *\n * Targets three named `ui-view`s in the parent state's template\n * <pre>views: {\n * header: {\n * controller: \"headerCtrl\",\n * templateUrl: \"header.html\"\n * }, body: {\n * controller: \"bodyCtrl\",\n * templateUrl: \"body.html\"\n * }, footer: {\n * controller: \"footCtrl\",\n * templateUrl: \"footer.html\"\n * }\n * }</pre>\n *\n * Targets named `ui-view=\"header\"` from grandparent state 'top''s template, and named `ui-view=\"body\" from parent state's template.\n * <pre>views: {\n * 'header@top': {\n * controller: \"msgHeaderCtrl\",\n * templateUrl: \"msgHeader.html\"\n * }, 'body': {\n * controller: \"messagesCtrl\",\n * templateUrl: \"messages.html\"\n * }\n * }</pre>\n *\n * @param {boolean=} [stateConfig.abstract=false]\n * <a id='abstract'></a>\n * An abstract state will never be directly activated,\n * but can provide inherited properties to its common children states.\n * <pre>abstract: true</pre>\n *\n * @param {function=} stateConfig.onEnter\n * <a id='onEnter'></a>\n *\n * Callback function for when a state is entered. Good way\n * to trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to explicitly annotate this function,\n * because it won't be automatically annotated by your build tools.\n *\n * <pre>onEnter: function(MyService, $stateParams) {\n * MyService.foo($stateParams.myParam);\n * }</pre>\n *\n * @param {function=} stateConfig.onExit\n * <a id='onExit'></a>\n *\n * Callback function for when a state is exited. Good way to\n * trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to explicitly annotate this function,\n * because it won't be automatically annotated by your build tools.\n *\n * <pre>onExit: function(MyService, $stateParams) {\n * MyService.cleanup($stateParams.myParam);\n * }</pre>\n *\n * @param {boolean=} [stateConfig.reloadOnSearch=true]\n * <a id='reloadOnSearch'></a>\n *\n * If `false`, will not retrigger the same state\n * just because a search/query parameter has changed (via $location.search() or $location.hash()). \n * Useful for when you'd like to modify $location.search() without triggering a reload.\n * <pre>reloadOnSearch: false</pre>\n *\n * @param {object=} stateConfig.data\n * <a id='data'></a>\n *\n * Arbitrary data object, useful for custom configuration. The parent state's `data` is\n * prototypally inherited. In other words, adding a data property to a state adds it to\n * the entire subtree via prototypal inheritance.\n *\n * <pre>data: {\n * requiredRole: 'foo'\n * } </pre>\n *\n * @param {object=} stateConfig.params\n * <a id='params'></a>\n *\n * A map which optionally configures parameters declared in the `url`, or\n * defines additional non-url parameters. For each parameter being\n * configured, add a configuration object keyed to the name of the parameter.\n *\n * Each parameter configuration object may contain the following properties:\n *\n * - ** value ** - {object|function=}: specifies the default value for this\n * parameter. This implicitly sets this parameter as optional.\n *\n * When UI-Router routes to a state and no value is\n * specified for this parameter in the URL or transition, the\n * default value will be used instead. If `value` is a function,\n * it will be injected and invoked, and the return value used.\n *\n * *Note*: `undefined` is treated as \"no default value\" while `null`\n * is treated as \"the default value is `null`\".\n *\n * *Shorthand*: If you only need to configure the default value of the\n * parameter, you may use a shorthand syntax. In the **`params`**\n * map, instead mapping the param name to a full parameter configuration\n * object, simply set map it to the default parameter value, e.g.:\n *\n * <pre>// define a parameter's default value\n * params: {\n * param1: { value: \"defaultValue\" }\n * }\n * // shorthand default values\n * params: {\n * param1: \"defaultValue\",\n * param2: \"param2Default\"\n * }</pre>\n *\n * - ** array ** - {boolean=}: *(default: false)* If true, the param value will be\n * treated as an array of values. If you specified a Type, the value will be\n * treated as an array of the specified Type. Note: query parameter values\n * default to a special `\"auto\"` mode.\n *\n * For query parameters in `\"auto\"` mode, if multiple values for a single parameter\n * are present in the URL (e.g.: `/foo?bar=1&bar=2&bar=3`) then the values\n * are mapped to an array (e.g.: `{ foo: [ '1', '2', '3' ] }`). However, if\n * only one value is present (e.g.: `/foo?bar=1`) then the value is treated as single\n * value (e.g.: `{ foo: '1' }`).\n *\n * <pre>params: {\n * param1: { array: true }\n * }</pre>\n *\n * - ** squash ** - {bool|string=}: `squash` configures how a default parameter value is represented in the URL when\n * the current parameter value is the same as the default value. If `squash` is not set, it uses the\n * configured default squash policy.\n * (See {@link ui.router.util.$urlMatcherFactory#methods_defaultSquashPolicy `defaultSquashPolicy()`})\n *\n * There are three squash settings:\n *\n * - false: The parameter's default value is not squashed. It is encoded and included in the URL\n * - true: The parameter's default value is omitted from the URL. If the parameter is preceeded and followed\n * by slashes in the state's `url` declaration, then one of those slashes are omitted.\n * This can allow for cleaner looking URLs.\n * - `\"<arbitrary string>\"`: The parameter's default value is replaced with an arbitrary placeholder of your choice.\n *\n * <pre>params: {\n * param1: {\n * value: \"defaultId\",\n * squash: true\n * } }\n * // squash \"defaultValue\" to \"~\"\n * params: {\n * param1: {\n * value: \"defaultValue\",\n * squash: \"~\"\n * } }\n * </pre>\n *\n *\n * @example\n * <pre>\n * // Some state name examples\n *\n * // stateName can be a single top-level name (must be unique).\n * $stateProvider.state(\"home\", {});\n *\n * // Or it can be a nested state name. This state is a child of the\n * // above \"home\" state.\n * $stateProvider.state(\"home.newest\", {});\n *\n * // Nest states as deeply as needed.\n * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n *\n * // state() returns $stateProvider, so you can chain state declarations.\n * $stateProvider\n * .state(\"home\", {})\n * .state(\"about\", {})\n * .state(\"contacts\", {});\n * </pre>\n *\n */\n this.state = state;\n function state(name, definition) {\n /*jshint validthis: true */\n if (isObject(name)) definition = name;\n else definition.name = name;\n registerState(definition);\n return this;\n }\n\n /**\n * @ngdoc object\n * @name ui.router.state.$state\n *\n * @requires $rootScope\n * @requires $q\n * @requires ui.router.state.$view\n * @requires $injector\n * @requires ui.router.util.$resolve\n * @requires ui.router.state.$stateParams\n * @requires ui.router.router.$urlRouter\n *\n * @property {object} params A param object, e.g. {sectionId: section.id)}, that \n * you'd like to test against the current active state.\n * @property {object} current A reference to the state's config object. However \n * you passed it in. Useful for accessing custom data.\n * @property {object} transition Currently pending transition. A promise that'll \n * resolve or reject.\n *\n * @description\n * `$state` service is responsible for representing states as well as transitioning\n * between them. It also provides interfaces to ask for current state or even states\n * you're coming from.\n */\n this.$get = $get;\n $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$urlRouter', '$location', '$urlMatcherFactory'];\n function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $urlRouter, $location, $urlMatcherFactory) {\n\n var TransitionSupersededError = new Error('transition superseded');\n\n var TransitionSuperseded = silenceUncaughtInPromise($q.reject(TransitionSupersededError));\n var TransitionPrevented = silenceUncaughtInPromise($q.reject(new Error('transition prevented')));\n var TransitionAborted = silenceUncaughtInPromise($q.reject(new Error('transition aborted')));\n var TransitionFailed = silenceUncaughtInPromise($q.reject(new Error('transition failed')));\n\n // Handles the case where a state which is the target of a transition is not found, and the user\n // can optionally retry or defer the transition\n function handleRedirect(redirect, state, params, options) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateNotFound\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when a requested state **cannot be found** using the provided state name during transition.\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A special `unfoundState` object is passed to the listener handler,\n * you can see its three properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `go` will be rejected with a `'transition aborted'` value.\n *\n * @param {Object} event Event object.\n * @param {Object} unfoundState Unfound State information. Contains: `to, toParams, options` properties.\n * @param {State} fromState Current state object.\n * @param {Object} fromParams Current state params.\n *\n * @example\n *\n * <pre>\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", {a:1, b:2}, {inherit:false});\n *\n * // somewhere else\n * $scope.$on('$stateNotFound',\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * })\n * </pre>\n */\n var evt = $rootScope.$broadcast('$stateNotFound', redirect, state, params);\n\n if (evt.defaultPrevented) {\n $urlRouter.update();\n return TransitionAborted;\n }\n\n if (!evt.retry) {\n return null;\n }\n\n // Allow the handler to return a promise to defer state lookup retry\n if (options.$retry) {\n $urlRouter.update();\n return TransitionFailed;\n }\n var retryTransition = $state.transition = $q.when(evt.retry);\n\n retryTransition.then(function() {\n if (retryTransition !== $state.transition) {\n $rootScope.$broadcast('$stateChangeCancel', redirect.to, redirect.toParams, state, params);\n return TransitionSuperseded;\n }\n redirect.options.$retry = true;\n return $state.transitionTo(redirect.to, redirect.toParams, redirect.options);\n }, function() {\n return TransitionAborted;\n });\n $urlRouter.update();\n\n return retryTransition;\n }\n\n root.locals = { resolve: null, globals: { $stateParams: {} } };\n\n $state = {\n params: {},\n current: root.self,\n $current: root,\n transition: null\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#reload\n * @methodOf ui.router.state.$state\n *\n * @description\n * A method that force reloads the current state. All resolves are re-resolved,\n * controllers reinstantiated, and events re-fired.\n *\n * @example\n * <pre>\n * var app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * $state.reload();\n * }\n * });\n * </pre>\n *\n * `reload()` is just an alias for:\n * <pre>\n * $state.transitionTo($state.current, $stateParams, { \n * reload: true, inherit: false, notify: true\n * });\n * </pre>\n *\n * @param {string=|object=} state - A state name or a state object, which is the root of the resolves to be re-resolved.\n * @example\n * <pre>\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' \n * //and current state is 'contacts.detail.item'\n * var app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * //will reload 'contact.detail' and 'contact.detail.item' states\n * $state.reload('contact.detail');\n * }\n * });\n * </pre>\n *\n * `reload()` is just an alias for:\n * <pre>\n * $state.transitionTo($state.current, $stateParams, { \n * reload: true, inherit: false, notify: true\n * });\n * </pre>\n\n * @returns {promise} A promise representing the state of the new transition. See\n * {@link ui.router.state.$state#methods_go $state.go}.\n */\n $state.reload = function reload(state) {\n return $state.transitionTo($state.current, $stateParams, { reload: state || true, inherit: false, notify: true});\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#go\n * @methodOf ui.router.state.$state\n *\n * @description\n * Convenience method for transitioning to a new state. `$state.go` calls \n * `$state.transitionTo` internally but automatically sets options to \n * `{ location: true, inherit: true, relative: $state.$current, notify: true }`. \n * This allows you to easily use an absolute or relative to path and specify \n * only the parameters you'd like to update (while letting unspecified parameters \n * inherit from the currently active ancestor states).\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.go('contact.detail');\n * };\n * });\n * </pre>\n * <img src='../ngdoc_assets/StateGoExamples.png'/>\n *\n * @param {string} to Absolute state name or relative state path. Some examples:\n *\n * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n * - `$state.go('^')` - will go to a parent state\n * - `$state.go('^.sibling')` - will go to a sibling state\n * - `$state.go('.child.grandchild')` - will go to grandchild state\n *\n * @param {object=} params A map of the parameters that will be sent to the state, \n * will populate $stateParams. Any parameters that are not specified will be inherited from currently \n * defined parameters. Only parameters specified in the state definition can be overridden, new \n * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters\n * specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.\n * transitioning to a sibling will get you the parameters for all parents, transitioning to a child\n * will get you all current parameters, etc.\n * @param {object=} options Options object. The options are:\n *\n * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n * will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n * defines which state to be relative from.\n * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params\n * have changed. It will reload the resolves and views of the current state and parent states.\n * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \\\n * the transition reloads the resolves and views for that matched state, and all its children states.\n *\n * @returns {promise} A promise representing the state of the new transition.\n *\n * Possible success values:\n *\n * - $state.current\n *\n * <br/>Possible rejection values:\n *\n * - 'transition superseded' - when a newer transition has been started after this one\n * - 'transition prevented' - when `event.preventDefault()` has been called in a `$stateChangeStart` listener\n * - 'transition aborted' - when `event.preventDefault()` has been called in a `$stateNotFound` listener or\n * when a `$stateNotFound` `event.retry` promise errors.\n * - 'transition failed' - when a state has been unsuccessfully found after 2 tries.\n * - *resolve error* - when an error has occurred with a `resolve`\n *\n */\n $state.go = function go(to, params, options) {\n return $state.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options));\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#transitionTo\n * @methodOf ui.router.state.$state\n *\n * @description\n * Low-level method for transitioning to a new state. {@link ui.router.state.$state#methods_go $state.go}\n * uses `transitionTo` internally. `$state.go` is recommended in most situations.\n *\n * @example\n * <pre>\n * var app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.transitionTo('contact.detail');\n * };\n * });\n * </pre>\n *\n * @param {string} to State name.\n * @param {object=} toParams A map of the parameters that will be sent to the state,\n * will populate $stateParams.\n * @param {object=} options Options object. The options are:\n *\n * - **`location`** - {boolean=true|string=} - If `true` will update the url in the location bar, if `false`\n * will not. If string, must be `\"replace\"`, which will update url and also replace last history record.\n * - **`inherit`** - {boolean=false}, If `true` will inherit url parameters from current url.\n * - **`relative`** - {object=}, When transitioning with relative path (e.g '^'), \n * defines which state to be relative from.\n * - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.\n * - **`reload`** (v0.2.5) - {boolean=false|string=|object=}, If `true` will force transition even if the state or params \n * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd\n * use this when you want to force a reload when *everything* is the same, including search params.\n * if String, then will reload the state with the name given in reload, and any children.\n * if Object, then a stateObj is expected, will reload the state found in stateObj, and any children.\n *\n * @returns {promise} A promise representing the state of the new transition. See\n * {@link ui.router.state.$state#methods_go $state.go}.\n */\n $state.transitionTo = function transitionTo(to, toParams, options) {\n toParams = toParams || {};\n options = extend({\n location: true, inherit: false, relative: null, notify: true, reload: false, $retry: false\n }, options || {});\n\n var from = $state.$current, fromParams = $state.params, fromPath = from.path;\n var evt, toState = findState(to, options.relative);\n\n // Store the hash param for later (since it will be stripped out by various methods)\n var hash = toParams['#'];\n\n if (!isDefined(toState)) {\n var redirect = { to: to, toParams: toParams, options: options };\n var redirectResult = handleRedirect(redirect, from.self, fromParams, options);\n\n if (redirectResult) {\n return redirectResult;\n }\n\n // Always retry once if the $stateNotFound was not prevented\n // (handles either redirect changed or state lazy-definition)\n to = redirect.to;\n toParams = redirect.toParams;\n options = redirect.options;\n toState = findState(to, options.relative);\n\n if (!isDefined(toState)) {\n if (!options.relative) throw new Error(\"No such state '\" + to + \"'\");\n throw new Error(\"Could not resolve '\" + to + \"' from state '\" + options.relative + \"'\");\n }\n }\n if (toState[abstractKey]) throw new Error(\"Cannot transition to abstract state '\" + to + \"'\");\n if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState);\n if (!toState.params.$$validates(toParams)) return TransitionFailed;\n\n toParams = toState.params.$$values(toParams);\n to = toState;\n\n var toPath = to.path;\n\n // Starting from the root of the path, keep all levels that haven't changed\n var keep = 0, state = toPath[keep], locals = root.locals, toLocals = [];\n\n if (!options.reload) {\n while (state && state === fromPath[keep] && state.ownParams.$$equals(toParams, fromParams)) {\n locals = toLocals[keep] = state.locals;\n keep++;\n state = toPath[keep];\n }\n } else if (isString(options.reload) || isObject(options.reload)) {\n if (isObject(options.reload) && !options.reload.name) {\n throw new Error('Invalid reload state object');\n }\n \n var reloadState = options.reload === true ? fromPath[0] : findState(options.reload);\n if (options.reload && !reloadState) {\n throw new Error(\"No such reload state '\" + (isString(options.reload) ? options.reload : options.reload.name) + \"'\");\n }\n\n while (state && state === fromPath[keep] && state !== reloadState) {\n locals = toLocals[keep] = state.locals;\n keep++;\n state = toPath[keep];\n }\n }\n\n // If we're going to the same state and all locals are kept, we've got nothing to do.\n // But clear 'transition', as we still want to cancel any other pending transitions.\n // TODO: We may not want to bump 'transition' if we're called from a location change\n // that we've initiated ourselves, because we might accidentally abort a legitimate\n // transition initiated from code?\n if (shouldSkipReload(to, toParams, from, fromParams, locals, options)) {\n if (hash) toParams['#'] = hash;\n $state.params = toParams;\n copy($state.params, $stateParams);\n copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams);\n if (options.location && to.navigable && to.navigable.url) {\n $urlRouter.push(to.navigable.url, toParams, {\n $$avoidResync: true, replace: options.location === 'replace'\n });\n $urlRouter.update(true);\n }\n $state.transition = null;\n return $q.when($state.current);\n }\n\n // Filter parameters before we pass them to event handlers etc.\n toParams = filterByKeys(to.params.$$keys(), toParams || {});\n \n // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart\n if (hash) toParams['#'] = hash;\n \n // Broadcast start event and cancel the transition if requested\n if (options.notify) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateChangeStart\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when the state transition **begins**. You can use `event.preventDefault()`\n * to prevent the transition from happening and then the transition promise will be\n * rejected with a `'transition prevented'` value.\n *\n * @param {Object} event Event object.\n * @param {State} toState The state being transitioned to.\n * @param {Object} toParams The params supplied to the `toState`.\n * @param {State} fromState The current state, pre-transition.\n * @param {Object} fromParams The params supplied to the `fromState`.\n *\n * @example\n *\n * <pre>\n * $rootScope.$on('$stateChangeStart',\n * function(event, toState, toParams, fromState, fromParams){\n * event.preventDefault();\n * // transitionTo() promise will be rejected with\n * // a 'transition prevented' error\n * })\n * </pre>\n */\n if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) {\n $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);\n //Don't update and resync url if there's been a new transition started. see issue #2238, #600\n if ($state.transition == null) $urlRouter.update();\n return TransitionPrevented;\n }\n }\n\n // Resolve locals for the remaining states, but don't update any global state just\n // yet -- if anything fails to resolve the current state needs to remain untouched.\n // We also set up an inheritance chain for the locals here. This allows the view directive\n // to quickly look up the correct definition for each view in the current state. Even\n // though we create the locals object itself outside resolveState(), it is initially\n // empty and gets filled asynchronously. We need to keep track of the promise for the\n // (fully resolved) current locals, and pass this down the chain.\n var resolved = $q.when(locals);\n\n for (var l = keep; l < toPath.length; l++, state = toPath[l]) {\n locals = toLocals[l] = inherit(locals);\n resolved = resolveState(state, toParams, state === to, resolved, locals, options);\n }\n\n // Once everything is resolved, we are ready to perform the actual transition\n // and return a promise for the new state. We also keep track of what the\n // current promise is, so that we can detect overlapping transitions and\n // keep only the outcome of the last transition.\n var transition = $state.transition = resolved.then(function () {\n var l, entering, exiting;\n\n if ($state.transition !== transition) {\n $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);\n return TransitionSuperseded;\n }\n\n // Exit 'from' states not kept\n for (l = fromPath.length - 1; l >= keep; l--) {\n exiting = fromPath[l];\n if (exiting.self.onExit) {\n $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals);\n }\n exiting.locals = null;\n }\n\n // Enter 'to' states not kept\n for (l = keep; l < toPath.length; l++) {\n entering = toPath[l];\n entering.locals = toLocals[l];\n if (entering.self.onEnter) {\n $injector.invoke(entering.self.onEnter, entering.self, entering.locals.globals);\n }\n }\n\n // Run it again, to catch any transitions in callbacks\n if ($state.transition !== transition) {\n $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);\n return TransitionSuperseded;\n }\n\n // Update globals in $state\n $state.$current = to;\n $state.current = to.self;\n $state.params = toParams;\n copy($state.params, $stateParams);\n $state.transition = null;\n\n if (options.location && to.navigable) {\n $urlRouter.push(to.navigable.url, to.navigable.locals.globals.$stateParams, {\n $$avoidResync: true, replace: options.location === 'replace'\n });\n }\n\n if (options.notify) {\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateChangeSuccess\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired once the state transition is **complete**.\n *\n * @param {Object} event Event object.\n * @param {State} toState The state being transitioned to.\n * @param {Object} toParams The params supplied to the `toState`.\n * @param {State} fromState The current state, pre-transition.\n * @param {Object} fromParams The params supplied to the `fromState`.\n */\n $rootScope.$broadcast('$stateChangeSuccess', to.self, toParams, from.self, fromParams);\n }\n $urlRouter.update(true);\n\n return $state.current;\n }).then(null, function (error) {\n // propagate TransitionSuperseded error without emitting $stateChangeCancel\n // as it was already emitted in the success handler above\n if (error === TransitionSupersededError) return TransitionSuperseded;\n\n if ($state.transition !== transition) {\n $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);\n return TransitionSuperseded;\n }\n\n $state.transition = null;\n /**\n * @ngdoc event\n * @name ui.router.state.$state#$stateChangeError\n * @eventOf ui.router.state.$state\n * @eventType broadcast on root scope\n * @description\n * Fired when an **error occurs** during transition. It's important to note that if you\n * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n * they will not throw traditionally. You must listen for this $stateChangeError event to\n * catch **ALL** errors.\n *\n * @param {Object} event Event object.\n * @param {State} toState The state being transitioned to.\n * @param {Object} toParams The params supplied to the `toState`.\n * @param {State} fromState The current state, pre-transition.\n * @param {Object} fromParams The params supplied to the `fromState`.\n * @param {Error} error The resolve error object.\n */\n evt = $rootScope.$broadcast('$stateChangeError', to.self, toParams, from.self, fromParams, error);\n\n if (!evt.defaultPrevented) {\n $urlRouter.update();\n }\n\n return $q.reject(error);\n });\n\n silenceUncaughtInPromise(transition);\n return transition;\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#is\n * @methodOf ui.router.state.$state\n *\n * @description\n * Similar to {@link ui.router.state.$state#methods_includes $state.includes},\n * but only checks for the full state name. If params is supplied then it will be\n * tested for strict equality against the current active params object, so all params\n * must match with none missing and no extras.\n *\n * @example\n * <pre>\n * $state.$current.name = 'contacts.details.item';\n *\n * // absolute name\n * $state.is('contact.details.item'); // returns true\n * $state.is(contactDetailItemStateObject); // returns true\n *\n * // relative name (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * <div ng-class=\"{highlighted: $state.is('.item')}\">Item</div>\n * </pre>\n *\n * @param {string|object} stateOrName The state name (absolute or relative) or state object you'd like to check.\n * @param {object=} params A param object, e.g. `{sectionId: section.id}`, that you'd like\n * to test against the current active state.\n * @param {object=} options An options object. The options are:\n *\n * - **`relative`** - {string|object} - If `stateOrName` is a relative state name and `options.relative` is set, .is will\n * test relative to `options.relative` state (or name).\n *\n * @returns {boolean} Returns true if it is the state.\n */\n $state.is = function is(stateOrName, params, options) {\n options = extend({ relative: $state.$current }, options || {});\n var state = findState(stateOrName, options.relative);\n\n if (!isDefined(state)) { return undefined; }\n if ($state.$current !== state) { return false; }\n\n return !params || objectKeys(params).reduce(function(acc, key) {\n var paramDef = state.params[key];\n return acc && (!paramDef || paramDef.type.equals($stateParams[key], params[key]));\n }, true);\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#includes\n * @methodOf ui.router.state.$state\n *\n * @description\n * A method to determine if the current active state is equal to or is the child of the\n * state stateName. If any params are passed then they will be tested for a match as well.\n * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n *\n * @example\n * Partial and relative names\n * <pre>\n * $state.$current.name = 'contacts.details.item';\n *\n * // Using partial names\n * $state.includes(\"contacts\"); // returns true\n * $state.includes(\"contacts.details\"); // returns true\n * $state.includes(\"contacts.details.item\"); // returns true\n * $state.includes(\"contacts.list\"); // returns false\n * $state.includes(\"about\"); // returns false\n *\n * // Using relative names (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * <div ng-class=\"{highlighted: $state.includes('.item')}\">Item</div>\n * </pre>\n *\n * Basic globbing patterns\n * <pre>\n * $state.$current.name = 'contacts.details.item.url';\n *\n * $state.includes(\"*.details.*.*\"); // returns true\n * $state.includes(\"*.details.**\"); // returns true\n * $state.includes(\"**.item.**\"); // returns true\n * $state.includes(\"*.details.item.url\"); // returns true\n * $state.includes(\"*.details.*.url\"); // returns true\n * $state.includes(\"*.details.*\"); // returns false\n * $state.includes(\"item.**\"); // returns false\n * </pre>\n *\n * @param {string} stateOrName A partial name, relative name, or glob pattern\n * to be searched for within the current state name.\n * @param {object=} params A param object, e.g. `{sectionId: section.id}`,\n * that you'd like to test against the current active state.\n * @param {object=} options An options object. The options are:\n *\n * - **`relative`** - {string|object=} - If `stateOrName` is a relative state reference and `options.relative` is set,\n * .includes will test relative to `options.relative` state (or name).\n *\n * @returns {boolean} Returns true if it does include the state\n */\n $state.includes = function includes(stateOrName, params, options) {\n options = extend({ relative: $state.$current }, options || {});\n if (isString(stateOrName) && isGlob(stateOrName)) {\n if (!doesStateMatchGlob(stateOrName)) {\n return false;\n }\n stateOrName = $state.$current.name;\n }\n\n var state = findState(stateOrName, options.relative);\n if (!isDefined(state)) { return undefined; }\n if (!isDefined($state.$current.includes[state.name])) { return false; }\n if (!params) { return true; }\n\n var keys = objectKeys(params);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i], paramDef = state.params[key];\n if (paramDef && !paramDef.type.equals($stateParams[key], params[key])) {\n return false;\n }\n }\n\n return objectKeys(params).reduce(function(acc, key) {\n var paramDef = state.params[key];\n return acc && !paramDef || paramDef.type.equals($stateParams[key], params[key]);\n }, true);\n };\n\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#href\n * @methodOf ui.router.state.$state\n *\n * @description\n * A url generation method that returns the compiled url for the given state populated with the given params.\n *\n * @example\n * <pre>\n * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n * </pre>\n *\n * @param {string|object} stateOrName The state name or state object you'd like to generate a url from.\n * @param {object=} params An object of parameter values to fill the state's required parameters.\n * @param {object=} options Options object. The options are:\n *\n * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the\n * first parameter, then the constructed href url will be built from the first navigable ancestor (aka\n * ancestor with a valid url).\n * - **`inherit`** - {boolean=true}, If `true` will inherit url parameters from current url.\n * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'), \n * defines which state to be relative from.\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n * \n * @returns {string} compiled state url\n */\n $state.href = function href(stateOrName, params, options) {\n options = extend({\n lossy: true,\n inherit: true,\n absolute: false,\n relative: $state.$current\n }, options || {});\n\n var state = findState(stateOrName, options.relative);\n\n if (!isDefined(state)) return null;\n if (options.inherit) params = inheritParams($stateParams, params || {}, $state.$current, state);\n \n var nav = (state && options.lossy) ? state.navigable : state;\n\n if (!nav || nav.url === undefined || nav.url === null) {\n return null;\n }\n return $urlRouter.href(nav.url, filterByKeys(state.params.$$keys().concat('#'), params || {}), {\n absolute: options.absolute\n });\n };\n\n /**\n * @ngdoc function\n * @name ui.router.state.$state#get\n * @methodOf ui.router.state.$state\n *\n * @description\n * Returns the state configuration object for any specific state or all states.\n *\n * @param {string|object=} stateOrName (absolute or relative) If provided, will only get the config for\n * the requested state. If not provided, returns an array of ALL state configs.\n * @param {string|object=} context When stateOrName is a relative state reference, the state will be retrieved relative to context.\n * @returns {Object|Array} State configuration object or array of all objects.\n */\n $state.get = function (stateOrName, context) {\n if (arguments.length === 0) return map(objectKeys(states), function(name) { return states[name].self; });\n var state = findState(stateOrName, context || $state.$current);\n return (state && state.self) ? state.self : null;\n };\n\n function resolveState(state, params, paramsAreFiltered, inherited, dst, options) {\n // Make a restricted $stateParams with only the parameters that apply to this state if\n // necessary. In addition to being available to the controller and onEnter/onExit callbacks,\n // we also need $stateParams to be available for any $injector calls we make during the\n // dependency resolution process.\n var $stateParams = (paramsAreFiltered) ? params : filterByKeys(state.params.$$keys(), params);\n var locals = { $stateParams: $stateParams };\n\n // Resolve 'global' dependencies for the state, i.e. those not specific to a view.\n // We're also including $stateParams in this; that way the parameters are restricted\n // to the set that should be visible to the state, and are independent of when we update\n // the global $state and $stateParams values.\n dst.resolve = $resolve.resolve(state.resolve, locals, dst.resolve, state);\n var promises = [dst.resolve.then(function (globals) {\n dst.globals = globals;\n })];\n if (inherited) promises.push(inherited);\n\n function resolveViews() {\n var viewsPromises = [];\n\n // Resolve template and dependencies for all views.\n forEach(state.views, function (view, name) {\n var injectables = (view.resolve && view.resolve !== state.resolve ? view.resolve : {});\n injectables.$template = [ function () {\n return $view.load(name, { view: view, locals: dst.globals, params: $stateParams, notify: options.notify }) || '';\n }];\n\n viewsPromises.push($resolve.resolve(injectables, dst.globals, dst.resolve, state).then(function (result) {\n // References to the controller (only instantiated at link time)\n if (isFunction(view.controllerProvider) || isArray(view.controllerProvider)) {\n var injectLocals = angular.extend({}, injectables, dst.globals);\n result.$$controller = $injector.invoke(view.controllerProvider, null, injectLocals);\n } else {\n result.$$controller = view.controller;\n }\n // Provide access to the state itself for internal use\n result.$$state = state;\n result.$$controllerAs = view.controllerAs;\n result.$$resolveAs = view.resolveAs;\n dst[name] = result;\n }));\n });\n\n return $q.all(viewsPromises).then(function(){\n return dst.globals;\n });\n }\n\n // Wait for all the promises and then return the activation object\n return $q.all(promises).then(resolveViews).then(function (values) {\n return dst;\n });\n }\n\n return $state;\n }\n\n function shouldSkipReload(to, toParams, from, fromParams, locals, options) {\n // Return true if there are no differences in non-search (path/object) params, false if there are differences\n function nonSearchParamsEqual(fromAndToState, fromParams, toParams) {\n // Identify whether all the parameters that differ between `fromParams` and `toParams` were search params.\n function notSearchParam(key) {\n return fromAndToState.params[key].location != \"search\";\n }\n var nonQueryParamKeys = fromAndToState.params.$$keys().filter(notSearchParam);\n var nonQueryParams = pick.apply({}, [fromAndToState.params].concat(nonQueryParamKeys));\n var nonQueryParamSet = new $$UMFP.ParamSet(nonQueryParams);\n return nonQueryParamSet.$$equals(fromParams, toParams);\n }\n\n // If reload was not explicitly requested\n // and we're transitioning to the same state we're already in\n // and the locals didn't change\n // or they changed in a way that doesn't merit reloading\n // (reloadOnParams:false, or reloadOnSearch.false and only search params changed)\n // Then return true.\n if (!options.reload && to === from &&\n (locals === from.locals || (to.self.reloadOnSearch === false && nonSearchParamsEqual(from, fromParams, toParams)))) {\n return true;\n }\n }\n}\n\nangular.module('ui.router.state')\n .factory('$stateParams', function () { return {}; })\n .constant(\"$state.runtime\", { autoinject: true })\n .provider('$state', $StateProvider)\n // Inject $state to initialize when entering runtime. #2574\n .run(['$injector', function ($injector) {\n // Allow tests (stateSpec.js) to turn this off by defining this constant\n if ($injector.get(\"$state.runtime\").autoinject) {\n $injector.get('$state');\n }\n }]);\n\n\n$ViewProvider.$inject = [];\nfunction $ViewProvider() {\n\n this.$get = $get;\n /**\n * @ngdoc object\n * @name ui.router.state.$view\n *\n * @requires ui.router.util.$templateFactory\n * @requires $rootScope\n *\n * @description\n *\n */\n $get.$inject = ['$rootScope', '$templateFactory'];\n function $get( $rootScope, $templateFactory) {\n return {\n // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })\n /**\n * @ngdoc function\n * @name ui.router.state.$view#load\n * @methodOf ui.router.state.$view\n *\n * @description\n *\n * @param {string} name name\n * @param {object} options option object.\n */\n load: function load(name, options) {\n var result, defaults = {\n template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}\n };\n options = extend(defaults, options);\n\n if (options.view) {\n result = $templateFactory.fromConfig(options.view, options.params, options.locals);\n }\n return result;\n }\n };\n }\n}\n\nangular.module('ui.router.state').provider('$view', $ViewProvider);\n\n/**\n * @ngdoc object\n * @name ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Provider that returns the {@link ui.router.state.$uiViewScroll} service function.\n */\nfunction $ViewScrollProvider() {\n\n var useAnchorScroll = false;\n\n /**\n * @ngdoc function\n * @name ui.router.state.$uiViewScrollProvider#useAnchorScroll\n * @methodOf ui.router.state.$uiViewScrollProvider\n *\n * @description\n * Reverts back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll) service for\n * scrolling based on the url anchor.\n */\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n\n /**\n * @ngdoc object\n * @name ui.router.state.$uiViewScroll\n *\n * @requires $anchorScroll\n * @requires $timeout\n *\n * @description\n * When called with a jqLite element, it scrolls the element into view (after a\n * `$timeout` so the DOM has time to refresh).\n *\n * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\n * this can be enabled by calling {@link ui.router.state.$uiViewScrollProvider#methods_useAnchorScroll `$uiViewScrollProvider.useAnchorScroll()`}.\n */\n this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n\n return function ($element) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-view\n *\n * @requires ui.router.state.$state\n * @requires $compile\n * @requires $controller\n * @requires $injector\n * @requires ui.router.state.$uiViewScroll\n * @requires $document\n *\n * @restrict ECA\n *\n * @description\n * The ui-view directive tells $state where to place your templates.\n *\n * @param {string=} name A view name. The name should be unique amongst the other views in the\n * same state. You can have views of the same name that live in different states.\n *\n * @param {string=} autoscroll It allows you to set the scroll behavior of the browser window\n * when a view is populated. By default, $anchorScroll is overridden by ui-router's custom scroll\n * service, {@link ui.router.state.$uiViewScroll}. This custom service let's you\n * scroll ui-view elements into view when they are populated during a state activation.\n *\n * *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*\n *\n * @param {string=} onload Expression to evaluate whenever the view updates.\n *\n * @example\n * A view can be unnamed or named.\n * <pre>\n * <!-- Unnamed -->\n * <div ui-view></div>\n *\n * <!-- Named -->\n * <div ui-view=\"viewName\"></div>\n * </pre>\n *\n * You can only have one unnamed view within any template (or root html). If you are only using a\n * single view and it is unnamed then you can populate it like so:\n * <pre>\n * <div ui-view></div>\n * $stateProvider.state(\"home\", {\n * template: \"<h1>HELLO!</h1>\"\n * })\n * </pre>\n *\n * The above is a convenient shortcut equivalent to specifying your view explicitly with the {@link ui.router.state.$stateProvider#methods_state `views`}\n * config property, by name, in this case an empty name:\n * <pre>\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"<h1>HELLO!</h1>\"\n * }\n * } \n * })\n * </pre>\n *\n * But typically you'll only use the views property if you name your view or have more than one view\n * in the same template. There's not really a compelling reason to name a view if its the only one,\n * but you could if you wanted, like so:\n * <pre>\n * <div ui-view=\"main\"></div>\n * </pre>\n * <pre>\n * $stateProvider.state(\"home\", {\n * views: {\n * \"main\": {\n * template: \"<h1>HELLO!</h1>\"\n * }\n * } \n * })\n * </pre>\n *\n * Really though, you'll use views to set up multiple views:\n * <pre>\n * <div ui-view></div>\n * <div ui-view=\"chart\"></div>\n * <div ui-view=\"data\"></div>\n * </pre>\n *\n * <pre>\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"<h1>HELLO!</h1>\"\n * },\n * \"chart\": {\n * template: \"<chart_thing/>\"\n * },\n * \"data\": {\n * template: \"<data_thing/>\"\n * }\n * } \n * })\n * </pre>\n *\n * Examples for `autoscroll`:\n *\n * <pre>\n * <!-- If autoscroll present with no expression,\n * then scroll ui-view into view -->\n * <ui-view autoscroll/>\n *\n * <!-- If autoscroll present with valid expression,\n * then scroll ui-view into view if expression evaluates to true -->\n * <ui-view autoscroll='true'/>\n * <ui-view autoscroll='false'/>\n * <ui-view autoscroll='scopeVariable'/>\n * </pre>\n *\n * Resolve data:\n *\n * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this\n * can be customized using [[ViewDeclaration.resolveAs]]). This can be then accessed from the template.\n *\n * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the\n * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which\n * depends on `$resolve` data.\n *\n * Example usage of $resolve in a view template\n * <pre>\n * $stateProvider.state('home', {\n * template: '<my-component user=\"$resolve.user\"></my-component>',\n * resolve: {\n * user: function(UserService) { return UserService.fetchUser(); }\n * }\n * });\n * </pre>\n */\n$ViewDirective.$inject = ['$state', '$injector', '$uiViewScroll', '$interpolate', '$q'];\nfunction $ViewDirective( $state, $injector, $uiViewScroll, $interpolate, $q) {\n\n function getService() {\n return ($injector.has) ? function(service) {\n return $injector.has(service) ? $injector.get(service) : null;\n } : function(service) {\n try {\n return $injector.get(service);\n } catch (e) {\n return null;\n }\n };\n }\n\n var service = getService(),\n $animator = service('$animator'),\n $animate = service('$animate');\n\n // Returns a set of DOM manipulation functions based on which Angular version\n // it should use\n function getRenderer(attrs, scope) {\n var statics = function() {\n return {\n enter: function (element, target, cb) { target.after(element); cb(); },\n leave: function (element, cb) { element.remove(); cb(); }\n };\n };\n\n if ($animate) {\n return {\n enter: function(element, target, cb) {\n if (angular.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n } else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function(element, cb) {\n if (angular.version.minor > 2) {\n $animate.leave(element).then(cb);\n } else {\n $animate.leave(element, cb);\n }\n }\n };\n }\n\n if ($animator) {\n var animate = $animator && $animator(scope, attrs);\n\n return {\n enter: function(element, target, cb) {animate.enter(element, null, target); cb(); },\n leave: function(element, cb) { animate.leave(element); cb(); }\n };\n }\n\n return statics();\n }\n\n var directive = {\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n compile: function (tElement, tAttrs, $transclude) {\n return function (scope, $element, attrs) {\n var previousEl, currentEl, currentScope, latestLocals,\n onloadExp = attrs.onload || '',\n autoScrollExp = attrs.autoscroll,\n renderer = getRenderer(attrs, scope),\n inherited = $element.inheritedData('$uiView');\n\n scope.$on('$stateChangeSuccess', function() {\n updateView(false);\n });\n\n updateView(true);\n\n function cleanupLastView() {\n if (previousEl) {\n previousEl.remove();\n previousEl = null;\n }\n\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n\n if (currentEl) {\n var $uiViewData = currentEl.data('$uiViewAnim');\n renderer.leave(currentEl, function() {\n $uiViewData.$$animLeave.resolve();\n previousEl = null;\n });\n\n previousEl = currentEl;\n currentEl = null;\n }\n }\n\n function updateView(firstTime) {\n var newScope,\n name = getUiViewName(scope, attrs, $element, $interpolate),\n previousLocals = name && $state.$current && $state.$current.locals[name];\n\n if (!firstTime && previousLocals === latestLocals) return; // nothing to do\n newScope = scope.$new();\n latestLocals = $state.$current.locals[name];\n\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoading\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description\n *\n * Fired once the view **begins loading**, *before* the DOM is rendered.\n *\n * @param {Object} event Event object.\n * @param {string} viewName Name of the view.\n */\n newScope.$emit('$viewContentLoading', name);\n\n var clone = $transclude(newScope, function(clone) {\n var animEnter = $q.defer(), animLeave = $q.defer();\n var viewAnimData = {\n $animEnter: animEnter.promise,\n $animLeave: animLeave.promise,\n $$animLeave: animLeave\n };\n\n clone.data('$uiViewAnim', viewAnimData);\n renderer.enter(clone, $element, function onUiViewEnter() {\n animEnter.resolve();\n if(currentScope) {\n currentScope.$emit('$viewContentAnimationEnded');\n }\n\n if (angular.isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n $uiViewScroll(clone);\n }\n });\n cleanupLastView();\n });\n\n currentEl = clone;\n currentScope = newScope;\n /**\n * @ngdoc event\n * @name ui.router.state.directive:ui-view#$viewContentLoaded\n * @eventOf ui.router.state.directive:ui-view\n * @eventType emits on ui-view directive scope\n * @description\n * Fired once the view is **loaded**, *after* the DOM is rendered.\n *\n * @param {Object} event Event object.\n * @param {string} viewName Name of the view.\n */\n currentScope.$emit('$viewContentLoaded', name);\n currentScope.$eval(onloadExp);\n }\n };\n }\n };\n\n return directive;\n}\n\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$state', '$interpolate'];\nfunction $ViewDirectiveFill ( $compile, $controller, $state, $interpolate) {\n return {\n restrict: 'ECA',\n priority: -400,\n compile: function (tElement) {\n var initial = tElement.html();\n if (tElement.empty) {\n tElement.empty();\n } else {\n // ng 1.0.0 doesn't have empty(), which cleans up data and handlers\n tElement[0].innerHTML = null;\n }\n\n return function (scope, $element, attrs) {\n var current = $state.$current,\n name = getUiViewName(scope, attrs, $element, $interpolate),\n locals = current && current.locals[name];\n\n if (! locals) {\n $element.html(initial);\n $compile($element.contents())(scope);\n return;\n }\n\n $element.data('$uiView', { name: name, state: locals.$$state });\n $element.html(locals.$template ? locals.$template : initial);\n\n var resolveData = angular.extend({}, locals);\n scope[locals.$$resolveAs] = resolveData;\n\n var link = $compile($element.contents());\n\n if (locals.$$controller) {\n locals.$scope = scope;\n locals.$element = $element;\n var controller = $controller(locals.$$controller, locals);\n if (locals.$$controllerAs) {\n scope[locals.$$controllerAs] = controller;\n scope[locals.$$controllerAs][locals.$$resolveAs] = resolveData;\n }\n if (isFunction(controller.$onInit)) controller.$onInit();\n $element.data('$ngControllerController', controller);\n $element.children().data('$ngControllerController', controller);\n }\n\n link(scope);\n };\n }\n };\n}\n\n/**\n * Shared ui-view code for both directives:\n * Given scope, element, and its attributes, return the view's name\n */\nfunction getUiViewName(scope, attrs, element, $interpolate) {\n var name = $interpolate(attrs.uiView || attrs.name || '')(scope);\n var uiViewCreatedBy = element.inheritedData('$uiView');\n return name.indexOf('@') >= 0 ? name : (name + '@' + (uiViewCreatedBy ? uiViewCreatedBy.state.name : ''));\n}\n\nangular.module('ui.router.state').directive('uiView', $ViewDirective);\nangular.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\nfunction parseStateRef(ref, current) {\n var preparsed = ref.match(/^\\s*({[^}]*})\\s*$/), parsed;\n if (preparsed) ref = current + '(' + preparsed[1] + ')';\n parsed = ref.replace(/\\n/g, \" \").match(/^([^(]+?)\\s*(\\((.*)\\))?$/);\n if (!parsed || parsed.length !== 4) throw new Error(\"Invalid state ref '\" + ref + \"'\");\n return { state: parsed[1], paramExpr: parsed[3] || null };\n}\n\nfunction stateContext(el) {\n var stateData = el.parent().inheritedData('$uiView');\n\n if (stateData && stateData.state && stateData.state.name) {\n return stateData.state;\n }\n}\n\nfunction getTypeInfo(el) {\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\n var isForm = el[0].nodeName === \"FORM\";\n\n return {\n attr: isForm ? \"action\" : (isSvg ? 'xlink:href' : 'href'),\n isAnchor: el.prop(\"tagName\").toUpperCase() === \"A\",\n clickable: !isForm\n };\n}\n\nfunction clickHook(el, $state, $timeout, type, current) {\n return function(e) {\n var button = e.which || e.button, target = current();\n\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {\n // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\n var transition = $timeout(function() {\n $state.go(target.state, target.params, target.options);\n });\n e.preventDefault();\n\n // if the state has no URL, ignore one preventDefault from the <a> directive.\n var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0;\n\n e.preventDefault = function() {\n if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition);\n };\n }\n };\n}\n\nfunction defaultOpts(el, $state) {\n return { relative: stateContext(el) || $state.$current, inherit: true };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref\n *\n * @requires ui.router.state.$state\n * @requires $timeout\n *\n * @restrict A\n *\n * @description\n * A directive that binds a link (`<a>` tag) to a state. If the state has an associated\n * URL, the directive will automatically generate & update the `href` attribute via\n * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking\n * the link will trigger a state transition with optional parameters.\n *\n * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be\n * handled natively by the browser.\n *\n * You can also use relative state paths within ui-sref, just like the relative\n * paths passed to `$state.go()`. You just need to be aware that the path is relative\n * to the state that the link lives in, in other words the state that loaded the\n * template containing the link.\n *\n * You can specify options to pass to {@link ui.router.state.$state#methods_go $state.go()}\n * using the `ui-sref-opts` attribute. Options are restricted to `location`, `inherit`,\n * and `reload`.\n *\n * @example\n * Here's an example of how you'd use ui-sref and how it would compile. If you have the\n * following template:\n * <pre>\n * <a ui-sref=\"home\">Home</a> | <a ui-sref=\"about\">About</a> | <a ui-sref=\"{page: 2}\">Next page</a>\n *\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <a ui-sref=\"contacts.detail({ id: contact.id })\">{{ contact.name }}</a>\n * </li>\n * </ul>\n * </pre>\n *\n * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):\n * <pre>\n * <a href=\"#/home\" ui-sref=\"home\">Home</a> | <a href=\"#/about\" ui-sref=\"about\">About</a> | <a href=\"#/contacts?page=2\" ui-sref=\"{page: 2}\">Next page</a>\n *\n * <ul>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/1\" ui-sref=\"contacts.detail({ id: contact.id })\">Joe</a>\n * </li>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/2\" ui-sref=\"contacts.detail({ id: contact.id })\">Alice</a>\n * </li>\n * <li ng-repeat=\"contact in contacts\">\n * <a href=\"#/contacts/3\" ui-sref=\"contacts.detail({ id: contact.id })\">Bob</a>\n * </li>\n * </ul>\n *\n * <a ui-sref=\"home\" ui-sref-opts=\"{reload: true}\">Home</a>\n * </pre>\n *\n * @param {string} ui-sref 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-sref-opts options to pass to {@link ui.router.state.$state#methods_go $state.go()}\n */\n$StateRefDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDirective($state, $timeout) {\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function(scope, element, attrs, uiSrefActive) {\n var ref = parseStateRef(attrs.uiSref, $state.current.name);\n var def = { state: ref.state, href: null, params: null };\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var unlinkInfoFn = null;\n var hookFn;\n\n def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {});\n\n var update = function(val) {\n if (val) def.params = angular.copy(val);\n def.href = $state.href(ref.state, def.params, def.options);\n\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(ref.state, def.params);\n if (def.href !== null) attrs.$set(type.attr, def.href);\n };\n\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true);\n def.params = angular.copy(scope.$eval(ref.paramExpr));\n }\n update();\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, function() { return def; });\n element[element.on ? 'on' : 'bind'](\"click\", hookFn);\n scope.$on('$destroy', function() {\n element[element.off ? 'off' : 'unbind'](\"click\", hookFn);\n });\n }\n };\n}\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-state\n *\n * @requires ui.router.state.uiSref\n *\n * @restrict A\n *\n * @description\n * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition,\n * params and override options.\n *\n * @param {string} ui-state 'stateName' can be any valid absolute or relative state\n * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#methods_href $state.href()}\n * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#methods_go $state.go()}\n */\n$StateRefDynamicDirective.$inject = ['$state', '$timeout'];\nfunction $StateRefDynamicDirective($state, $timeout) {\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function(scope, element, attrs, uiSrefActive) {\n var type = getTypeInfo(element);\n var active = uiSrefActive[1] || uiSrefActive[0];\n var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null];\n var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']';\n var def = { state: null, params: null, options: null, href: null };\n var unlinkInfoFn = null;\n var hookFn;\n\n function runStateRefLink (group) {\n def.state = group[0]; def.params = group[1]; def.options = group[2];\n def.href = $state.href(def.state, def.params, def.options);\n\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.state, def.params);\n if (def.href) attrs.$set(type.attr, def.href);\n }\n\n scope.$watch(watch, runStateRefLink, true);\n runStateRefLink(scope.$eval(watch));\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, function() { return def; });\n element[element.on ? 'on' : 'bind'](\"click\", hookFn);\n scope.$on('$destroy', function() {\n element[element.off ? 'off' : 'unbind'](\"click\", hookFn);\n });\n }\n };\n}\n\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * A directive working alongside ui-sref to add classes to an element when the\n * related ui-sref directive's state is active, and removing them when it is inactive.\n * The primary use-case is to simplify the special appearance of navigation menus\n * relying on `ui-sref`, by having the \"active\" state's menu button appear different,\n * distinguishing it from the inactive menu items.\n *\n * ui-sref-active can live on the same element as ui-sref or on a parent element. The first\n * ui-sref-active found at the same level or above the ui-sref will be used.\n *\n * Will activate when the ui-sref's target state or any child state is active. If you\n * need to activate only when the ui-sref target state is active and *not* any of\n * it's children, then you will use\n * {@link ui.router.state.directive:ui-sref-active-eq ui-sref-active-eq}\n *\n * @example\n * Given the following template:\n * <pre>\n * <ul>\n * <li ui-sref-active=\"active\" class=\"item\">\n * <a href ui-sref=\"app.user({user: 'bilbobaggins'})\">@bilbobaggins</a>\n * </li>\n * </ul>\n * </pre>\n *\n *\n * When the app state is \"app.user\" (or any children states), and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n * <pre>\n * <ul>\n * <li ui-sref-active=\"active\" class=\"item active\">\n * <a ui-sref=\"app.user({user: 'bilbobaggins'})\" href=\"/users/bilbobaggins\">@bilbobaggins</a>\n * </li>\n * </ul>\n * </pre>\n *\n * The class name is interpolated **once** during the directives link time (any further changes to the\n * interpolated value are ignored).\n *\n * Multiple classes may be specified in a space-separated format:\n * <pre>\n * <ul>\n * <li ui-sref-active='class1 class2 class3'>\n * <a ui-sref=\"app.user\">link</a>\n * </li>\n * </ul>\n * </pre>\n *\n * It is also possible to pass ui-sref-active an expression that evaluates\n * to an object hash, whose keys represent active class names and whose\n * values represent the respective state names/globs.\n * ui-sref-active will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * @Example\n * Given the following template, with \"admin\" being an abstract state:\n * <pre>\n * <div ui-sref-active=\"{'active': 'admin.*'}\">\n * <a ui-sref-active=\"active\" ui-sref=\"admin.roles\">Roles</a>\n * </div>\n * </pre>\n *\n * When the current state is \"admin.roles\" the \"active\" class will be applied\n * to both the <div> and <a> elements. It is important to note that the state\n * names/globs passed to ui-sref-active shadow the state provided by ui-sref.\n */\n\n/**\n * @ngdoc directive\n * @name ui.router.state.directive:ui-sref-active-eq\n *\n * @requires ui.router.state.$state\n * @requires ui.router.state.$stateParams\n * @requires $interpolate\n *\n * @restrict A\n *\n * @description\n * The same as {@link ui.router.state.directive:ui-sref-active ui-sref-active} but will only activate\n * when the exact target state used in the `ui-sref` is active; no child states.\n *\n */\n$StateRefActiveDirective.$inject = ['$state', '$stateParams', '$interpolate'];\nfunction $StateRefActiveDirective($state, $stateParams, $interpolate) {\n return {\n restrict: \"A\",\n controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {\n var states = [], activeClasses = {}, activeEqClass, uiSrefActive;\n\n // There probably isn't much point in $observing this\n // uiSrefActive and uiSrefActiveEq share the same directive object with some\n // slight difference in logic routing\n activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\n\n try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n } catch (e) {\n // Do nothing. uiSrefActive is not a valid expression.\n // Fall back to using $interpolate below\n }\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\n if (isObject(uiSrefActive)) {\n forEach(uiSrefActive, function(stateOrName, activeClass) {\n if (isString(stateOrName)) {\n var ref = parseStateRef(stateOrName, $state.current.name);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n }\n });\n }\n\n // Allow uiSref to communicate with uiSrefActive[Equals]\n this.$$addStateInfo = function (newState, newParams) {\n // we already got an explicit state provided by ui-sref-active, so we\n // shadow the one that comes from ui-sref\n if (isObject(uiSrefActive) && states.length > 0) {\n return;\n }\n var deregister = addState(newState, newParams, uiSrefActive);\n update();\n return deregister;\n };\n\n $scope.$on('$stateChangeSuccess', update);\n\n function addState(stateName, stateParams, activeClass) {\n var state = $state.get(stateName, stateContext($element));\n var stateHash = createStateHash(stateName, stateParams);\n\n var stateInfo = {\n state: state || { name: stateName },\n params: stateParams,\n hash: stateHash\n };\n\n states.push(stateInfo);\n activeClasses[stateHash] = activeClass;\n\n return function removeState() {\n var idx = states.indexOf(stateInfo);\n if (idx !== -1) states.splice(idx, 1);\n };\n }\n\n /**\n * @param {string} state\n * @param {Object|string} [params]\n * @return {string}\n */\n function createStateHash(state, params) {\n if (!isString(state)) {\n throw new Error('state should be a string');\n }\n if (isObject(params)) {\n return state + toJson(params);\n }\n params = $scope.$eval(params);\n if (isObject(params)) {\n return state + toJson(params);\n }\n return state;\n }\n\n // Update route state\n function update() {\n for (var i = 0; i < states.length; i++) {\n if (anyMatch(states[i].state, states[i].params)) {\n addClass($element, activeClasses[states[i].hash]);\n } else {\n removeClass($element, activeClasses[states[i].hash]);\n }\n\n if (exactMatch(states[i].state, states[i].params)) {\n addClass($element, activeEqClass);\n } else {\n removeClass($element, activeEqClass);\n }\n }\n }\n\n function addClass(el, className) { $timeout(function () { el.addClass(className); }); }\n function removeClass(el, className) { el.removeClass(className); }\n function anyMatch(state, params) { return $state.includes(state.name, params); }\n function exactMatch(state, params) { return $state.is(state.name, params); }\n\n update();\n }]\n };\n}\n\nangular.module('ui.router.state')\n .directive('uiSref', $StateRefDirective)\n .directive('uiSrefActive', $StateRefActiveDirective)\n .directive('uiSrefActiveEq', $StateRefActiveDirective)\n .directive('uiState', $StateRefDynamicDirective);\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:isState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_is $state.is(\"stateName\")}.\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n var isFilter = function (state, params) {\n return $state.is(state, params);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n\n/**\n * @ngdoc filter\n * @name ui.router.state.filter:includedByState\n *\n * @requires ui.router.state.$state\n *\n * @description\n * Translates to {@link ui.router.state.$state#methods_includes $state.includes('fullOrPartialStateName')}.\n */\n$IncludedByStateFilter.$inject = ['$state'];\nfunction $IncludedByStateFilter($state) {\n var includesFilter = function (state, params, options) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\n\nangular.module('ui.router.state')\n .filter('isState', $IsStateFilter)\n .filter('includedByState', $IncludedByStateFilter);\n})(window, window.angular);\n/**\n * @license AngularJS v1.8.2\n * (c) 2010-2020 Google LLC. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\nvar ELEMENT_NODE = 1;\nvar COMMENT_NODE = 8;\n\nvar ADD_CLASS_SUFFIX = '-add';\nvar REMOVE_CLASS_SUFFIX = '-remove';\nvar EVENT_CLASS_PREFIX = 'ng-';\nvar ACTIVE_CLASS_SUFFIX = '-active';\nvar PREPARE_CLASS_SUFFIX = '-prepare';\n\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\nvar NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';\n\n// Detect proper transitionend/animationend event names.\nvar CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n// If unprefixed events are not supported but webkit-prefixed are, use the latter.\n// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n// Register both events in case `window.onanimationend` is not supported because of that,\n// do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n// therefore there is no reason to test anymore for other vendor prefixes:\n// http://caniuse.com/#search=transition\nif ((window.ontransitionend === undefined) && (window.onwebkittransitionend !== undefined)) {\n CSS_PREFIX = '-webkit-';\n TRANSITION_PROP = 'WebkitTransition';\n TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n} else {\n TRANSITION_PROP = 'transition';\n TRANSITIONEND_EVENT = 'transitionend';\n}\n\nif ((window.onanimationend === undefined) && (window.onwebkitanimationend !== undefined)) {\n CSS_PREFIX = '-webkit-';\n ANIMATION_PROP = 'WebkitAnimation';\n ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n} else {\n ANIMATION_PROP = 'animation';\n ANIMATIONEND_EVENT = 'animationend';\n}\n\nvar DURATION_KEY = 'Duration';\nvar PROPERTY_KEY = 'Property';\nvar DELAY_KEY = 'Delay';\nvar TIMING_KEY = 'TimingFunction';\nvar ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\nvar ANIMATION_PLAYSTATE_KEY = 'PlayState';\nvar SAFE_FAST_FORWARD_DURATION_VALUE = 9999;\n\nvar ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;\nvar ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;\nvar TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;\nvar TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;\n\nvar ngMinErr = angular.$$minErr('ng');\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', 'Argument \\'{0}\\' is {1}', (name || '?'), (reason || 'required'));\n }\n return arg;\n}\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction packageStyles(options) {\n var styles = {};\n if (options && (options.to || options.from)) {\n styles.to = options.to;\n styles.from = options.from;\n }\n return styles;\n}\n\nfunction pendClasses(classes, fix, isPrefix) {\n var className = '';\n classes = isArray(classes)\n ? classes\n : classes && isString(classes) && classes.length\n ? classes.split(/\\s+/)\n : [];\n forEach(classes, function(klass, i) {\n if (klass && klass.length > 0) {\n className += (i > 0) ? ' ' : '';\n className += isPrefix ? fix + klass\n : klass + fix;\n }\n });\n return className;\n}\n\nfunction removeFromArray(arr, val) {\n var index = arr.indexOf(val);\n if (val >= 0) {\n arr.splice(index, 1);\n }\n}\n\nfunction stripCommentsFromElement(element) {\n if (element instanceof jqLite) {\n switch (element.length) {\n case 0:\n return element;\n\n case 1:\n // there is no point of stripping anything if the element\n // is the only element within the jqLite wrapper.\n // (it's important that we retain the element instance.)\n if (element[0].nodeType === ELEMENT_NODE) {\n return element;\n }\n break;\n\n default:\n return jqLite(extractElementNode(element));\n }\n }\n\n if (element.nodeType === ELEMENT_NODE) {\n return jqLite(element);\n }\n}\n\nfunction extractElementNode(element) {\n if (!element[0]) return element;\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction $$addClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.addClass(elm, className);\n });\n}\n\nfunction $$removeClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.removeClass(elm, className);\n });\n}\n\nfunction applyAnimationClassesFactory($$jqLite) {\n return function(element, options) {\n if (options.addClass) {\n $$addClass($$jqLite, element, options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n $$removeClass($$jqLite, element, options.removeClass);\n options.removeClass = null;\n }\n };\n}\n\nfunction prepareAnimationOptions(options) {\n options = options || {};\n if (!options.$$prepared) {\n var domOperation = options.domOperation || noop;\n options.domOperation = function() {\n options.$$domOperationFired = true;\n domOperation();\n domOperation = noop;\n };\n options.$$prepared = true;\n }\n return options;\n}\n\nfunction applyAnimationStyles(element, options) {\n applyAnimationFromStyles(element, options);\n applyAnimationToStyles(element, options);\n}\n\nfunction applyAnimationFromStyles(element, options) {\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n}\n\nfunction applyAnimationToStyles(element, options) {\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n}\n\nfunction mergeAnimationDetails(element, oldAnimation, newAnimation) {\n var target = oldAnimation.options || {};\n var newOptions = newAnimation.options || {};\n\n var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');\n var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');\n var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);\n\n if (newOptions.preparationClasses) {\n target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);\n delete newOptions.preparationClasses;\n }\n\n // noop is basically when there is no callback; otherwise something has been set\n var realDomOperation = target.domOperation !== noop ? target.domOperation : null;\n\n extend(target, newOptions);\n\n // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.\n if (realDomOperation) {\n target.domOperation = realDomOperation;\n }\n\n if (classes.addClass) {\n target.addClass = classes.addClass;\n } else {\n target.addClass = null;\n }\n\n if (classes.removeClass) {\n target.removeClass = classes.removeClass;\n } else {\n target.removeClass = null;\n }\n\n oldAnimation.addClass = target.addClass;\n oldAnimation.removeClass = target.removeClass;\n\n return target;\n}\n\nfunction resolveElementClasses(existing, toAdd, toRemove) {\n var ADD_CLASS = 1;\n var REMOVE_CLASS = -1;\n\n var flags = {};\n existing = splitClassesToLookup(existing);\n\n toAdd = splitClassesToLookup(toAdd);\n forEach(toAdd, function(value, key) {\n flags[key] = ADD_CLASS;\n });\n\n toRemove = splitClassesToLookup(toRemove);\n forEach(toRemove, function(value, key) {\n flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;\n });\n\n var classes = {\n addClass: '',\n removeClass: ''\n };\n\n forEach(flags, function(val, klass) {\n var prop, allow;\n if (val === ADD_CLASS) {\n prop = 'addClass';\n allow = !existing[klass] || existing[klass + REMOVE_CLASS_SUFFIX];\n } else if (val === REMOVE_CLASS) {\n prop = 'removeClass';\n allow = existing[klass] || existing[klass + ADD_CLASS_SUFFIX];\n }\n if (allow) {\n if (classes[prop].length) {\n classes[prop] += ' ';\n }\n classes[prop] += klass;\n }\n });\n\n function splitClassesToLookup(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n var obj = {};\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n }\n\n return classes;\n}\n\nfunction getDomNode(element) {\n return (element instanceof jqLite) ? element[0] : element;\n}\n\nfunction applyGeneratedPreparationClasses($$jqLite, element, event, options) {\n var classes = '';\n if (event) {\n classes = pendClasses(event, EVENT_CLASS_PREFIX, true);\n }\n if (options.addClass) {\n classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));\n }\n if (options.removeClass) {\n classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));\n }\n if (classes.length) {\n options.preparationClasses = classes;\n element.addClass(classes);\n }\n}\n\nfunction clearGeneratedClasses(element, options) {\n if (options.preparationClasses) {\n element.removeClass(options.preparationClasses);\n options.preparationClasses = null;\n }\n if (options.activeClasses) {\n element.removeClass(options.activeClasses);\n options.activeClasses = null;\n }\n}\n\nfunction blockKeyframeAnimations(node, applyBlock) {\n var value = applyBlock ? 'paused' : '';\n var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;\n applyInlineStyle(node, [key, value]);\n return [key, value];\n}\n\nfunction applyInlineStyle(node, styleTuple) {\n var prop = styleTuple[0];\n var value = styleTuple[1];\n node.style[prop] = value;\n}\n\nfunction concatWithSpace(a,b) {\n if (!a) return b;\n if (!b) return a;\n return a + ' ' + b;\n}\n\nvar helpers = {\n blockTransitions: function(node, duration) {\n // we use a negative delay value since it performs blocking\n // yet it doesn't kill any existing transitions running on the\n // same element which makes this safe for class-based animations\n var value = duration ? '-' + duration + 's' : '';\n applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);\n return [TRANSITION_DELAY_PROP, value];\n }\n};\n\nvar $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {\n var queue, cancelFn;\n\n function scheduler(tasks) {\n // we make a copy since RAFScheduler mutates the state\n // of the passed in array variable and this would be difficult\n // to track down on the outside code\n queue = queue.concat(tasks);\n nextTick();\n }\n\n queue = scheduler.queue = [];\n\n /* waitUntilQuiet does two things:\n * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through\n * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.\n *\n * The motivation here is that animation code can request more time from the scheduler\n * before the next wave runs. This allows for certain DOM properties such as classes to\n * be resolved in time for the next animation to run.\n */\n scheduler.waitUntilQuiet = function(fn) {\n if (cancelFn) cancelFn();\n\n cancelFn = $$rAF(function() {\n cancelFn = null;\n fn();\n nextTick();\n });\n };\n\n return scheduler;\n\n function nextTick() {\n if (!queue.length) return;\n\n var items = queue.shift();\n for (var i = 0; i < items.length; i++) {\n items[i]();\n }\n\n if (!cancelFn) {\n $$rAF(function() {\n if (!cancelFn) nextTick();\n });\n }\n }\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateChildren\n * @restrict AE\n * @element ANY\n *\n * @description\n *\n * ngAnimateChildren allows you to specify that children of this element should animate even if any\n * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`\n * (structural) animation, child elements that also have an active structural animation are not animated.\n *\n * Note that even if `ngAnimateChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).\n *\n *\n * @param {string} ngAnimateChildren If the value is empty, `true` or `on`,\n * then child animations are allowed. If the value is `false`, child animations are not allowed.\n *\n * @example\n * <example module=\"ngAnimateChildren\" name=\"ngAnimateChildren\" deps=\"angular-animate.js\" animations=\"true\">\n <file name=\"index.html\">\n <div ng-controller=\"MainController as main\">\n <label>Show container? <input type=\"checkbox\" ng-model=\"main.enterElement\" /></label>\n <label>Animate children? <input type=\"checkbox\" ng-model=\"main.animateChildren\" /></label>\n <hr>\n <div ng-animate-children=\"{{main.animateChildren}}\">\n <div ng-if=\"main.enterElement\" class=\"container\">\n List of items:\n <div ng-repeat=\"item in [0, 1, 2, 3]\" class=\"item\">Item {{item}}</div>\n </div>\n </div>\n </div>\n </file>\n <file name=\"animations.css\">\n\n .container.ng-enter,\n .container.ng-leave {\n transition: all ease 1.5s;\n }\n\n .container.ng-enter,\n .container.ng-leave-active {\n opacity: 0;\n }\n\n .container.ng-leave,\n .container.ng-enter-active {\n opacity: 1;\n }\n\n .item {\n background: firebrick;\n color: #FFF;\n margin-bottom: 10px;\n }\n\n .item.ng-enter,\n .item.ng-leave {\n transition: transform 1.5s ease;\n }\n\n .item.ng-enter {\n transform: translateX(50px);\n }\n\n .item.ng-enter-active {\n transform: translateX(0);\n }\n </file>\n <file name=\"script.js\">\n angular.module('ngAnimateChildren', ['ngAnimate'])\n .controller('MainController', function MainController() {\n this.animateChildren = false;\n this.enterElement = false;\n });\n </file>\n </example>\n */\nvar $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {\n return {\n link: function(scope, element, attrs) {\n var val = attrs.ngAnimateChildren;\n if (isString(val) && val.length === 0) { //empty attribute\n element.data(NG_ANIMATE_CHILDREN_DATA, true);\n } else {\n // Interpolate and set the value, so that it is available to\n // animations that run right after compilation\n setData($interpolate(val)(scope));\n attrs.$observe('ngAnimateChildren', setData);\n }\n\n function setData(value) {\n value = value === 'on' || value === 'true';\n element.data(NG_ANIMATE_CHILDREN_DATA, value);\n }\n }\n };\n}];\n\n/* exported $AnimateCssProvider */\n\nvar ANIMATE_TIMER_KEY = '$$animateCss';\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes\n * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT\n * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or\n * directives to create more complex animations that can be purely driven using CSS code.\n *\n * Note that only browsers that support CSS transitions and/or keyframe animations are capable of\n * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).\n *\n * ## General Use\n * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that\n * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,\n * any automatic control over cancelling animations and/or preventing animations from being run on\n * child elements will not be handled by AngularJS. For this to work as expected, please use `$animate` to\n * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger\n * the CSS animation.\n *\n * The example below shows how we can create a folding animation on an element using `ng-if`:\n *\n * ```html\n * <!-- notice the `fold-animation` CSS class -->\n * <div ng-if=\"onOff\" class=\"fold-animation\">\n * This element will go BOOM\n * </div>\n * <button ng-click=\"onOff=true\">Fold In</button>\n * ```\n *\n * Now we create the **JavaScript animation** that will trigger the CSS transition:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * ## More Advanced Uses\n *\n * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks\n * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.\n *\n * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,\n * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with\n * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order\n * to provide a working animation that will run in CSS.\n *\n * The example below showcases a more advanced version of the `.fold-animation` from the example above:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * addClass: 'red large-text pulse-twice',\n * easing: 'ease-out',\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Since we're adding/removing CSS classes then the CSS transition will also pick those up:\n *\n * ```css\n * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code,\n * the CSS classes below will be transitioned despite them being defined as regular CSS classes */\n * .red { background:red; }\n * .large-text { font-size:20px; }\n *\n * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */\n * .pulse-twice {\n * animation: 0.5s pulse linear 2;\n * -webkit-animation: 0.5s pulse linear 2;\n * }\n *\n * @keyframes pulse {\n * from { transform: scale(0.5); }\n * to { transform: scale(1.5); }\n * }\n *\n * @-webkit-keyframes pulse {\n * from { -webkit-transform: scale(0.5); }\n * to { -webkit-transform: scale(1.5); }\n * }\n * ```\n *\n * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.\n *\n * ## How the Options are handled\n *\n * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation\n * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline\n * styles using the `from` and `to` properties.\n *\n * ```js\n * var animator = $animateCss(element, {\n * from: { background:'red' },\n * to: { background:'blue' }\n * });\n * animator.start();\n * ```\n *\n * ```css\n * .rotating-animation {\n * animation:0.5s rotate linear;\n * -webkit-animation:0.5s rotate linear;\n * }\n *\n * @keyframes rotate {\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * }\n *\n * @-webkit-keyframes rotate {\n * from { -webkit-transform: rotate(0deg); }\n * to { -webkit-transform: rotate(360deg); }\n * }\n * ```\n *\n * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is\n * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition\n * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition\n * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied\n * and spread across the transition and keyframe animation.\n *\n * ## What is returned\n *\n * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually\n * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are\n * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:\n *\n * ```js\n * var animator = $animateCss(element, { ... });\n * ```\n *\n * Now what do the contents of our `animator` variable look like:\n *\n * ```js\n * {\n * // starts the animation\n * start: Function,\n *\n * // ends (aborts) the animation\n * end: Function\n * }\n * ```\n *\n * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.\n * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been\n * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties\n * and that changing them will not reconfigure the parameters of the animation.\n *\n * ### runner.done() vs runner.then()\n * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the\n * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.\n * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`\n * unless you really need a digest to kick off afterwards.\n *\n * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss\n * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).\n * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.\n *\n * @param {DOMElement} element the element that will be animated\n * @param {object} options the animation-related options that will be applied during the animation\n *\n * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied\n * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)\n * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and\n * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted.\n * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).\n * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).\n * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).\n * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.\n * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.\n * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.\n * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.\n * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`\n * is provided then the animation will be skipped entirely.\n * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is\n * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value\n * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same\n * CSS delay value.\n * * `stagger` - A numeric time value representing the delay between successively animated elements\n * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})\n * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a\n * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)\n * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.)\n * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once\n * the animation is closed. This is useful for when the styles are used purely for the sake of\n * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation).\n * By default this value is set to `false`.\n *\n * @return {object} an object with start and end methods and details about the animation.\n *\n * * `start` - The method to start the animation. This will return a `Promise` when called.\n * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.\n */\nvar ONE_SECOND = 1000;\n\nvar ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\nvar CLOSING_TIME_BUFFER = 1.5;\n\nvar DETECT_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n transitionProperty: TRANSITION_PROP + PROPERTY_KEY,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP,\n animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY\n};\n\nvar DETECT_STAGGER_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP\n};\n\nfunction getCssKeyframeDurationStyle(duration) {\n return [ANIMATION_DURATION_PROP, duration + 's'];\n}\n\nfunction getCssDelayStyle(delay, isKeyframeAnimation) {\n var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;\n return [prop, delay + 's'];\n}\n\nfunction computeCssStyles($window, element, properties) {\n var styles = Object.create(null);\n var detectedStyles = $window.getComputedStyle(element) || {};\n forEach(properties, function(formalStyleName, actualStyleName) {\n var val = detectedStyles[formalStyleName];\n if (val) {\n var c = val.charAt(0);\n\n // only numerical-based values have a negative sign or digit as the first value\n if (c === '-' || c === '+' || c >= 0) {\n val = parseMaxTime(val);\n }\n\n // by setting this to null in the event that the delay is not set or is set directly as 0\n // then we can still allow for negative values to be used later on and not mistake this\n // value for being greater than any other negative value.\n if (val === 0) {\n val = null;\n }\n styles[actualStyleName] = val;\n }\n });\n\n return styles;\n}\n\nfunction parseMaxTime(str) {\n var maxValue = 0;\n var values = str.split(/\\s*,\\s*/);\n forEach(values, function(value) {\n // it's always safe to consider only second values and omit `ms` values since\n // getComputedStyle will always handle the conversion for us\n if (value.charAt(value.length - 1) === 's') {\n value = value.substring(0, value.length - 1);\n }\n value = parseFloat(value) || 0;\n maxValue = maxValue ? Math.max(value, maxValue) : value;\n });\n return maxValue;\n}\n\nfunction truthyTimingValue(val) {\n return val === 0 || val != null;\n}\n\nfunction getCssTransitionDurationStyle(duration, applyOnlyDuration) {\n var style = TRANSITION_PROP;\n var value = duration + 's';\n if (applyOnlyDuration) {\n style += DURATION_KEY;\n } else {\n value += ' linear all';\n }\n return [style, value];\n}\n\n// we do not reassign an already present style value since\n// if we detect the style property value again we may be\n// detecting styles that were added via the `from` styles.\n// We make use of `isDefined` here since an empty string\n// or null value (which is what getPropertyValue will return\n// for a non-existing style) will still be marked as a valid\n// value for the style (a falsy value implies that the style\n// is to be removed at the end of the animation). If we had a simple\n// \"OR\" statement then it would not be enough to catch that.\nfunction registerRestorableStyles(backup, node, properties) {\n forEach(properties, function(prop) {\n backup[prop] = isDefined(backup[prop])\n ? backup[prop]\n : node.style.getPropertyValue(prop);\n });\n}\n\nvar $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout', '$$animateCache',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout, $$animateCache,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function computeCachedCssStyles(node, className, cacheKey, allowNoDuration, properties) {\n var timings = $$animateCache.get(cacheKey);\n\n if (!timings) {\n timings = computeCssStyles($window, node, properties);\n if (timings.animationIterationCount === 'infinite') {\n timings.animationIterationCount = 1;\n }\n }\n\n // if a css animation has no duration we\n // should mark that so that repeated addClass/removeClass calls are skipped\n var hasDuration = allowNoDuration || (timings.transitionDuration > 0 || timings.animationDuration > 0);\n\n // we keep putting this in multiple times even though the value and the cacheKey are the same\n // because we're keeping an internal tally of how many duplicate animations are detected.\n $$animateCache.put(cacheKey, timings, hasDuration);\n\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\n var staggerCacheKey = 'stagger-' + cacheKey;\n\n // if we have one or more existing matches of matching elements\n // containing the same parent + CSS styles (which is how cacheKey works)\n // then staggering is possible\n if ($$animateCache.count(cacheKey) > 0) {\n stagger = $$animateCache.get(staggerCacheKey);\n\n if (!stagger) {\n var staggerClassName = pendClasses(className, '-stagger');\n\n $$jqLite.addClass(node, staggerClassName);\n\n stagger = computeCssStyles($window, node, properties);\n\n // force the conversion of a null value to zero incase not set\n stagger.animationDuration = Math.max(stagger.animationDuration, 0);\n stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);\n\n $$jqLite.removeClass(node, staggerClassName);\n\n $$animateCache.put(staggerCacheKey, stagger, true);\n }\n }\n\n return stagger || {};\n }\n\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n $$animateCache.flush();\n\n // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n var pageWidth = $$forceReflow();\n\n // we use a for loop to ensure that if the queue is changed\n // during this looping then it will consider new requests\n for (var i = 0; i < rafWaitQueue.length; i++) {\n rafWaitQueue[i](pageWidth);\n }\n rafWaitQueue.length = 0;\n });\n }\n\n function computeTimings(node, className, cacheKey, allowNoDuration) {\n var timings = computeCachedCssStyles(node, className, cacheKey, allowNoDuration, DETECT_CSS_PROPERTIES);\n var aD = timings.animationDelay;\n var tD = timings.transitionDelay;\n timings.maxDelay = aD && tD\n ? Math.max(aD, tD)\n : (aD || tD);\n timings.maxDuration = Math.max(\n timings.animationDuration * timings.animationIterationCount,\n timings.transitionDuration);\n\n return timings;\n }\n\n return function init(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = prepareAnimationOptions(copy(options));\n }\n\n var restoreStyles = {};\n var node = getDomNode(element);\n if (!node\n || !node.parentNode\n || !$$animateQueue.enabled()) {\n return closeAndReturnNoopAnimator();\n }\n\n var temporaryStyles = [];\n var classes = element.attr('class');\n var styles = packageStyles(options);\n var animationClosed;\n var animationPaused;\n var animationCompleted;\n var runner;\n var runnerHost;\n var maxDelay;\n var maxDelayTime;\n var maxDuration;\n var maxDurationTime;\n var startTime;\n var events = [];\n\n if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {\n return closeAndReturnNoopAnimator();\n }\n\n var method = options.event && isArray(options.event)\n ? options.event.join(' ')\n : options.event;\n\n var isStructural = method && options.structural;\n var structuralClassName = '';\n var addRemoveClassName = '';\n\n if (isStructural) {\n structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true);\n } else if (method) {\n structuralClassName = method;\n }\n\n if (options.addClass) {\n addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX);\n }\n\n if (options.removeClass) {\n if (addRemoveClassName.length) {\n addRemoveClassName += ' ';\n }\n addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);\n }\n\n // there may be a situation where a structural animation is combined together\n // with CSS classes that need to resolve before the animation is computed.\n // However this means that there is no explicit CSS code to block the animation\n // from happening (by setting 0s none in the class name). If this is the case\n // we need to apply the classes before the first rAF so we know to continue if\n // there actually is a detected transition or keyframe animation\n if (options.applyClassesEarly && addRemoveClassName.length) {\n applyAnimationClasses(element, options);\n }\n\n var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim();\n var fullClassName = classes + ' ' + preparationClasses;\n var hasToStyles = styles.to && Object.keys(styles.to).length > 0;\n var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0;\n\n // there is no way we can trigger an animation if no styles and\n // no classes are being applied which would then trigger a transition,\n // unless there a is raw keyframe value that is applied to the element.\n if (!containsKeyframeAnimation\n && !hasToStyles\n && !preparationClasses) {\n return closeAndReturnNoopAnimator();\n }\n\n var stagger, cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass);\n if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {\n preparationClasses = null;\n return closeAndReturnNoopAnimator();\n }\n\n if (options.stagger > 0) {\n var staggerVal = parseFloat(options.stagger);\n stagger = {\n transitionDelay: staggerVal,\n animationDelay: staggerVal,\n transitionDuration: 0,\n animationDuration: 0\n };\n } else {\n stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);\n }\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.addClass(element, preparationClasses);\n }\n\n var applyOnlyDuration;\n\n if (options.transitionStyle) {\n var transitionStyle = [TRANSITION_PROP, options.transitionStyle];\n applyInlineStyle(node, transitionStyle);\n temporaryStyles.push(transitionStyle);\n }\n\n if (options.duration >= 0) {\n applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;\n var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);\n\n // we set the duration so that it will be picked up by getComputedStyle later\n applyInlineStyle(node, durationStyle);\n temporaryStyles.push(durationStyle);\n }\n\n if (options.keyframeStyle) {\n var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];\n applyInlineStyle(node, keyframeStyle);\n temporaryStyles.push(keyframeStyle);\n }\n\n var itemIndex = stagger\n ? options.staggerIndex >= 0\n ? options.staggerIndex\n : $$animateCache.count(cacheKey)\n : 0;\n\n var isFirst = itemIndex === 0;\n\n // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY\n // without causing any combination of transitions to kick in. By adding a negative delay value\n // it forces the setup class' transition to end immediately. We later then remove the negative\n // transition delay to allow for the transition to naturally do it's thing. The beauty here is\n // that if there is no transition defined then nothing will happen and this will also allow\n // other transitions to be stacked on top of each other without any chopping them out.\n if (isFirst && !options.skipBlocking) {\n helpers.blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey, !isStructural);\n var relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n var flags = {};\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty === 'all';\n flags.applyTransitionDuration = hasToStyles && (\n (flags.hasTransitions && !flags.hasTransitionAll)\n || (flags.hasAnimations && !flags.hasTransitions));\n flags.applyAnimationDuration = options.duration && flags.hasAnimations;\n flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);\n flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations;\n flags.recalculateTimingStyles = addRemoveClassName.length > 0;\n\n if (flags.applyTransitionDuration || flags.applyAnimationDuration) {\n maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;\n\n if (flags.applyTransitionDuration) {\n flags.hasTransitions = true;\n timings.transitionDuration = maxDuration;\n applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;\n temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));\n }\n\n if (flags.applyAnimationDuration) {\n flags.hasAnimations = true;\n timings.animationDuration = maxDuration;\n temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));\n }\n }\n\n if (maxDuration === 0 && !flags.recalculateTimingStyles) {\n return closeAndReturnNoopAnimator();\n }\n\n var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\n\n if (options.delay != null) {\n var delayStyle;\n if (typeof options.delay !== 'boolean') {\n delayStyle = parseFloat(options.delay);\n // number in options.delay means we have to recalculate the delay for the closing timeout\n maxDelay = Math.max(delayStyle, 0);\n }\n\n if (flags.applyTransitionDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle));\n }\n\n if (flags.applyAnimationDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle, true));\n }\n }\n\n // we need to recalculate the delay value since we used a pre-emptive negative\n // delay value and the delay value is required for the final event checking. This\n // property will ensure that this will happen after the RAF phase has passed.\n if (options.duration == null && timings.transitionDuration > 0) {\n flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n if (!options.skipBlocking) {\n flags.blockTransition = timings.transitionDuration > 0;\n flags.blockKeyframeAnimation = timings.animationDuration > 0 &&\n stagger.animationDelay > 0 &&\n stagger.animationDuration === 0;\n }\n\n if (options.from) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.from));\n }\n applyAnimationFromStyles(element, options);\n }\n\n if (flags.blockTransition || flags.blockKeyframeAnimation) {\n applyBlocking(maxDuration);\n } else if (!options.skipBlocking) {\n helpers.blockTransitions(node, false);\n }\n\n // TODO(matsko): for 1.5 change this code to have an animator object for better debugging\n return {\n $$willAnimate: true,\n end: endFn,\n start: function() {\n if (animationClosed) return;\n\n runnerHost = {\n end: endFn,\n cancel: cancelFn,\n resume: null, //this will be set during the start() phase\n pause: null\n };\n\n runner = new $$AnimateRunner(runnerHost);\n\n waitUntilQuiet(start);\n\n // we don't have access to pause/resume the animation\n // since it hasn't run yet. AnimateRunner will therefore\n // set noop functions for resume and pause and they will\n // later be overridden once the animation is triggered\n return runner;\n }\n };\n\n function endFn() {\n close();\n }\n\n function cancelFn() {\n close(true);\n }\n\n function close(rejected) {\n // if the promise has been called already then we shouldn't close\n // the animation again\n if (animationClosed || (animationCompleted && animationPaused)) return;\n animationClosed = true;\n animationPaused = false;\n\n if (preparationClasses && !options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n\n if (activeClasses) {\n $$jqLite.removeClass(element, activeClasses);\n }\n\n blockKeyframeAnimations(node, false);\n helpers.blockTransitions(node, false);\n\n forEach(temporaryStyles, function(entry) {\n // There is only one way to remove inline style properties entirely from elements.\n // By using `removeProperty` this works, but we need to convert camel-cased CSS\n // styles down to hyphenated values.\n node.style[entry[0]] = '';\n });\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n\n if (Object.keys(restoreStyles).length) {\n forEach(restoreStyles, function(value, prop) {\n if (value) {\n node.style.setProperty(prop, value);\n } else {\n node.style.removeProperty(prop);\n }\n });\n }\n\n // the reason why we have this option is to allow a synchronous closing callback\n // that is fired as SOON as the animation ends (when the CSS is removed) or if\n // the animation never takes off at all. A good example is a leave animation since\n // the element must be removed just after the animation is over or else the element\n // will appear on screen for one animation frame causing an overbearing flicker.\n if (options.onDone) {\n options.onDone();\n }\n\n if (events && events.length) {\n // Remove the transitionend / animationend listener(s)\n element.off(events.join(' '), onAnimationProgress);\n }\n\n //Cancel the fallback closing timeout and remove the timer data\n var animationTimerData = element.data(ANIMATE_TIMER_KEY);\n if (animationTimerData) {\n $timeout.cancel(animationTimerData[0].timer);\n element.removeData(ANIMATE_TIMER_KEY);\n }\n\n // if the preparation function fails then the promise is not setup\n if (runner) {\n runner.complete(!rejected);\n }\n }\n\n function applyBlocking(duration) {\n if (flags.blockTransition) {\n helpers.blockTransitions(node, duration);\n }\n\n if (flags.blockKeyframeAnimation) {\n blockKeyframeAnimations(node, !!duration);\n }\n }\n\n function closeAndReturnNoopAnimator() {\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: cancelFn\n });\n\n // should flush the cache animation\n waitUntilQuiet(noop);\n close();\n\n return {\n $$willAnimate: false,\n start: function() {\n return runner;\n },\n end: endFn\n };\n }\n\n function onAnimationProgress(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n\n if (ev.target !== node) {\n // Since TransitionEvent / AnimationEvent bubble up,\n // we have to ignore events by finished child animations\n return;\n }\n\n // we now always use `Date.now()` due to the recent changes with\n // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)\n var timeStamp = ev.$manualTimeStamp || Date.now();\n\n /* Firefox (or possibly just Gecko) likes to not round values up\n * when a ms measurement is used for the animation */\n var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n /* $manualTimeStamp is a mocked timeStamp value which is set\n * within browserTrigger(). This is only here so that tests can\n * mock animations properly. Real events fallback to event.timeStamp,\n * or, if they don't, then a timeStamp is automatically created for them.\n * We're checking to see if the timeStamp surpasses the expected delay,\n * but we're using elapsedTime instead of the timeStamp on the 2nd\n * pre-condition since animationPauseds sometimes close off early */\n if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n // we set this flag to ensure that if the transition is paused then, when resumed,\n // the animation will automatically close itself since transitions cannot be paused.\n animationCompleted = true;\n close();\n }\n }\n\n function start() {\n if (animationClosed) return;\n if (!node.parentNode) {\n close();\n return;\n }\n\n // even though we only pause keyframe animations here the pause flag\n // will still happen when transitions are used. Only the transition will\n // not be paused since that is not possible. If the animation ends when\n // paused then it will not complete until unpaused or cancelled.\n var playPause = function(playAnimation) {\n if (!animationCompleted) {\n animationPaused = !playAnimation;\n if (timings.animationDuration) {\n var value = blockKeyframeAnimations(node, animationPaused);\n if (animationPaused) {\n temporaryStyles.push(value);\n } else {\n removeFromArray(temporaryStyles, value);\n }\n }\n } else if (animationPaused && playAnimation) {\n animationPaused = false;\n close();\n }\n };\n\n // checking the stagger duration prevents an accidentally cascade of the CSS delay style\n // being inherited from the parent. If the transition duration is zero then we can safely\n // rely that the delay value is an intentional stagger delay style.\n var maxStagger = itemIndex > 0\n && ((timings.transitionDuration && stagger.transitionDuration === 0) ||\n (timings.animationDuration && stagger.animationDuration === 0))\n && Math.max(stagger.animationDelay, stagger.transitionDelay);\n if (maxStagger) {\n $timeout(triggerAnimationStart,\n Math.floor(maxStagger * itemIndex * ONE_SECOND),\n false);\n } else {\n triggerAnimationStart();\n }\n\n // this will decorate the existing promise runner with pause/resume methods\n runnerHost.resume = function() {\n playPause(true);\n };\n\n runnerHost.pause = function() {\n playPause(false);\n };\n\n function triggerAnimationStart() {\n // just incase a stagger animation kicks in when the animation\n // itself was cancelled entirely\n if (animationClosed) return;\n\n applyBlocking(false);\n\n forEach(temporaryStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[key] = value;\n });\n\n applyAnimationClasses(element, options);\n $$jqLite.addClass(element, activeClasses);\n\n if (flags.recalculateTimingStyles) {\n fullClassName = node.getAttribute('class') + ' ' + preparationClasses;\n cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass);\n\n timings = computeTimings(node, fullClassName, cacheKey, false);\n relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n if (maxDuration === 0) {\n close();\n return;\n }\n\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n }\n\n if (flags.applyAnimationDelay) {\n relativeDelay = typeof options.delay !== 'boolean' && truthyTimingValue(options.delay)\n ? parseFloat(options.delay)\n : relativeDelay;\n\n maxDelay = Math.max(relativeDelay, 0);\n timings.animationDelay = relativeDelay;\n delayStyle = getCssDelayStyle(relativeDelay, true);\n temporaryStyles.push(delayStyle);\n node.style[delayStyle[0]] = delayStyle[1];\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n\n if (options.easing) {\n var easeProp, easeVal = options.easing;\n if (flags.hasTransitions) {\n easeProp = TRANSITION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n if (flags.hasAnimations) {\n easeProp = ANIMATION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n }\n\n if (timings.transitionDuration) {\n events.push(TRANSITIONEND_EVENT);\n }\n\n if (timings.animationDuration) {\n events.push(ANIMATIONEND_EVENT);\n }\n\n startTime = Date.now();\n var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;\n var endTime = startTime + timerTime;\n\n var animationsData = element.data(ANIMATE_TIMER_KEY) || [];\n var setupFallbackTimer = true;\n if (animationsData.length) {\n var currentTimerData = animationsData[0];\n setupFallbackTimer = endTime > currentTimerData.expectedEndTime;\n if (setupFallbackTimer) {\n $timeout.cancel(currentTimerData.timer);\n } else {\n animationsData.push(close);\n }\n }\n\n if (setupFallbackTimer) {\n var timer = $timeout(onAnimationExpired, timerTime, false);\n animationsData[0] = {\n timer: timer,\n expectedEndTime: endTime\n };\n animationsData.push(close);\n element.data(ANIMATE_TIMER_KEY, animationsData);\n }\n\n if (events.length) {\n element.on(events.join(' '), onAnimationProgress);\n }\n\n if (options.to) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.to));\n }\n applyAnimationToStyles(element, options);\n }\n }\n\n function onAnimationExpired() {\n var animationsData = element.data(ANIMATE_TIMER_KEY);\n\n // this will be false in the event that the element was\n // removed from the DOM (via a leave animation or something\n // similar)\n if (animationsData) {\n for (var i = 1; i < animationsData.length; i++) {\n animationsData[i]();\n }\n element.removeData(ANIMATE_TIMER_KEY);\n }\n }\n }\n };\n }];\n}];\n\nvar $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateCssDriver');\n\n var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';\n var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';\n\n var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';\n var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';\n\n function isDocumentFragment(node) {\n return node.parentNode && node.parentNode.nodeType === 11;\n }\n\n this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',\n function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) {\n\n // only browsers that support these properties can render animations\n if (!$sniffer.animations && !$sniffer.transitions) return noop;\n\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var rootBodyElement = jqLite(\n // this is to avoid using something that exists outside of the body\n // we also special case the doc fragment case because our unit test code\n // appends the $rootElement to the body after the app has been bootstrapped\n isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode\n );\n\n return function initDriverFn(animationDetails) {\n return animationDetails.from && animationDetails.to\n ? prepareFromToAnchorAnimation(animationDetails.from,\n animationDetails.to,\n animationDetails.classes,\n animationDetails.anchors)\n : prepareRegularAnimation(animationDetails);\n };\n\n function filterCssClasses(classes) {\n //remove all the `ng-` stuff\n return classes.replace(/\\bng-\\S+\\b/g, '');\n }\n\n function getUniqueValues(a, b) {\n if (isString(a)) a = a.split(' ');\n if (isString(b)) b = b.split(' ');\n return a.filter(function(val) {\n return b.indexOf(val) === -1;\n }).join(' ');\n }\n\n function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {\n var clone = jqLite(getDomNode(outAnchor).cloneNode(true));\n var startingClasses = filterCssClasses(getClassVal(clone));\n\n outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n\n clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);\n\n rootBodyElement.append(clone);\n\n var animatorIn, animatorOut = prepareOutAnimation();\n\n // the user may not end up using the `out` animation and\n // only making use of the `in` animation or vice-versa.\n // In either case we should allow this and not assume the\n // animation is over unless both animations are not used.\n if (!animatorOut) {\n animatorIn = prepareInAnimation();\n if (!animatorIn) {\n return end();\n }\n }\n\n var startingAnimator = animatorOut || animatorIn;\n\n return {\n start: function() {\n var runner;\n\n var currentAnimation = startingAnimator.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n if (!animatorIn) {\n animatorIn = prepareInAnimation();\n if (animatorIn) {\n currentAnimation = animatorIn.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n end();\n runner.complete();\n });\n return currentAnimation;\n }\n }\n // in the event that there is no `in` animation\n end();\n runner.complete();\n });\n\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn\n });\n\n return runner;\n\n function endFn() {\n if (currentAnimation) {\n currentAnimation.end();\n }\n }\n }\n };\n\n function calculateAnchorStyles(anchor) {\n var styles = {};\n\n var coords = getDomNode(anchor).getBoundingClientRect();\n\n // we iterate directly since safari messes up and doesn't return\n // all the keys for the coords object when iterated\n forEach(['width','height','top','left'], function(key) {\n var value = coords[key];\n switch (key) {\n case 'top':\n value += bodyNode.scrollTop;\n break;\n case 'left':\n value += bodyNode.scrollLeft;\n break;\n }\n styles[key] = Math.floor(value) + 'px';\n });\n return styles;\n }\n\n function prepareOutAnimation() {\n var animator = $animateCss(clone, {\n addClass: NG_OUT_ANCHOR_CLASS_NAME,\n delay: true,\n from: calculateAnchorStyles(outAnchor)\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function getClassVal(element) {\n return element.attr('class') || '';\n }\n\n function prepareInAnimation() {\n var endingClasses = filterCssClasses(getClassVal(inAnchor));\n var toAdd = getUniqueValues(endingClasses, startingClasses);\n var toRemove = getUniqueValues(startingClasses, endingClasses);\n\n var animator = $animateCss(clone, {\n to: calculateAnchorStyles(inAnchor),\n addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,\n removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,\n delay: true\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function end() {\n clone.remove();\n outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n }\n }\n\n function prepareFromToAnchorAnimation(from, to, classes, anchors) {\n var fromAnimation = prepareRegularAnimation(from, noop);\n var toAnimation = prepareRegularAnimation(to, noop);\n\n var anchorAnimations = [];\n forEach(anchors, function(anchor) {\n var outElement = anchor['out'];\n var inElement = anchor['in'];\n var animator = prepareAnchoredAnimation(classes, outElement, inElement);\n if (animator) {\n anchorAnimations.push(animator);\n }\n });\n\n // no point in doing anything when there are no elements to animate\n if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n forEach(anchorAnimations, function(animation) {\n animationRunners.push(animation.start());\n });\n\n var runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn // CSS-driven animations cannot be cancelled, only ended\n });\n\n $$AnimateRunner.all(animationRunners, function(status) {\n runner.complete(status);\n });\n\n return runner;\n\n function endFn() {\n forEach(animationRunners, function(runner) {\n runner.end();\n });\n }\n }\n };\n }\n\n function prepareRegularAnimation(animationDetails) {\n var element = animationDetails.element;\n var options = animationDetails.options || {};\n\n if (animationDetails.structural) {\n options.event = animationDetails.event;\n options.structural = true;\n options.applyClassesEarly = true;\n\n // we special case the leave animation since we want to ensure that\n // the element is removed as soon as the animation is over. Otherwise\n // a flicker might appear or the element may not be removed at all\n if (animationDetails.event === 'leave') {\n options.onDone = options.domOperation;\n }\n }\n\n // We assign the preparationClasses as the actual animation event since\n // the internals of $animateCss will just suffix the event token values\n // with `-active` to trigger the animation.\n if (options.preparationClasses) {\n options.event = concatWithSpace(options.event, options.preparationClasses);\n }\n\n var animator = $animateCss(element, options);\n\n // the driver lookup code inside of $$animation attempts to spawn a\n // driver one by one until a driver returns a.$$willAnimate animator object.\n // $animateCss will always return an object, however, it will pass in\n // a flag as a hint as to whether an animation was detected or not\n return animator.$$willAnimate ? animator : null;\n }\n }];\n}];\n\n// TODO(matsko): use caching here to speed things up for detection\n// TODO(matsko): add documentation\n// by the time...\n\nvar $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',\n function($injector, $$AnimateRunner, $$jqLite) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n // $animateJs(element, 'enter');\n return function(element, event, classes, options) {\n var animationClosed = false;\n\n // the `classes` argument is optional and if it is not used\n // then the classes will be resolved from the element's className\n // property as well as options.addClass/options.removeClass.\n if (arguments.length === 3 && isObject(classes)) {\n options = classes;\n classes = null;\n }\n\n options = prepareAnimationOptions(options);\n if (!classes) {\n classes = element.attr('class') || '';\n if (options.addClass) {\n classes += ' ' + options.addClass;\n }\n if (options.removeClass) {\n classes += ' ' + options.removeClass;\n }\n }\n\n var classesToAdd = options.addClass;\n var classesToRemove = options.removeClass;\n\n // the lookupAnimations function returns a series of animation objects that are\n // matched up with one or more of the CSS classes. These animation objects are\n // defined via the module.animation factory function. If nothing is detected then\n // we don't return anything which then makes $animation query the next driver.\n var animations = lookupAnimations(classes);\n var before, after;\n if (animations.length) {\n var afterFn, beforeFn;\n if (event === 'leave') {\n beforeFn = 'leave';\n afterFn = 'afterLeave'; // TODO(matsko): get rid of this\n } else {\n beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);\n afterFn = event;\n }\n\n if (event !== 'enter' && event !== 'move') {\n before = packageAnimations(element, event, options, animations, beforeFn);\n }\n after = packageAnimations(element, event, options, animations, afterFn);\n }\n\n // no matching animations\n if (!before && !after) return;\n\n function applyOptions() {\n options.domOperation();\n applyAnimationClasses(element, options);\n }\n\n function close() {\n animationClosed = true;\n applyOptions();\n applyAnimationStyles(element, options);\n }\n\n var runner;\n\n return {\n $$willAnimate: true,\n end: function() {\n if (runner) {\n runner.end();\n } else {\n close();\n runner = new $$AnimateRunner();\n runner.complete(true);\n }\n return runner;\n },\n start: function() {\n if (runner) {\n return runner;\n }\n\n runner = new $$AnimateRunner();\n var closeActiveAnimations;\n var chain = [];\n\n if (before) {\n chain.push(function(fn) {\n closeActiveAnimations = before(fn);\n });\n }\n\n if (chain.length) {\n chain.push(function(fn) {\n applyOptions();\n fn(true);\n });\n } else {\n applyOptions();\n }\n\n if (after) {\n chain.push(function(fn) {\n closeActiveAnimations = after(fn);\n });\n }\n\n runner.setHost({\n end: function() {\n endAnimations();\n },\n cancel: function() {\n endAnimations(true);\n }\n });\n\n $$AnimateRunner.chain(chain, onComplete);\n return runner;\n\n function onComplete(success) {\n close(success);\n runner.complete(success);\n }\n\n function endAnimations(cancelled) {\n if (!animationClosed) {\n (closeActiveAnimations || noop)(cancelled);\n onComplete(cancelled);\n }\n }\n }\n };\n\n function executeAnimationFn(fn, element, event, options, onDone) {\n var args;\n switch (event) {\n case 'animate':\n args = [element, options.from, options.to, onDone];\n break;\n\n case 'setClass':\n args = [element, classesToAdd, classesToRemove, onDone];\n break;\n\n case 'addClass':\n args = [element, classesToAdd, onDone];\n break;\n\n case 'removeClass':\n args = [element, classesToRemove, onDone];\n break;\n\n default:\n args = [element, onDone];\n break;\n }\n\n args.push(options);\n\n var value = fn.apply(fn, args);\n if (value) {\n if (isFunction(value.start)) {\n value = value.start();\n }\n\n if (value instanceof $$AnimateRunner) {\n value.done(onDone);\n } else if (isFunction(value)) {\n // optional onEnd / onCancel callback\n return value;\n }\n }\n\n return noop;\n }\n\n function groupEventedAnimations(element, event, options, animations, fnName) {\n var operations = [];\n forEach(animations, function(ani) {\n var animation = ani[fnName];\n if (!animation) return;\n\n // note that all of these animations will run in parallel\n operations.push(function() {\n var runner;\n var endProgressCb;\n\n var resolved = false;\n var onAnimationComplete = function(rejected) {\n if (!resolved) {\n resolved = true;\n (endProgressCb || noop)(rejected);\n runner.complete(!rejected);\n }\n };\n\n runner = new $$AnimateRunner({\n end: function() {\n onAnimationComplete();\n },\n cancel: function() {\n onAnimationComplete(true);\n }\n });\n\n endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {\n var cancelled = result === false;\n onAnimationComplete(cancelled);\n });\n\n return runner;\n });\n });\n\n return operations;\n }\n\n function packageAnimations(element, event, options, animations, fnName) {\n var operations = groupEventedAnimations(element, event, options, animations, fnName);\n if (operations.length === 0) {\n var a, b;\n if (fnName === 'beforeSetClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');\n } else if (fnName === 'setClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');\n }\n\n if (a) {\n operations = operations.concat(a);\n }\n if (b) {\n operations = operations.concat(b);\n }\n }\n\n if (operations.length === 0) return;\n\n // TODO(matsko): add documentation\n return function startAnimation(callback) {\n var runners = [];\n if (operations.length) {\n forEach(operations, function(animateFn) {\n runners.push(animateFn());\n });\n }\n\n if (runners.length) {\n $$AnimateRunner.all(runners, callback);\n } else {\n callback();\n }\n\n return function endFn(reject) {\n forEach(runners, function(runner) {\n if (reject) {\n runner.cancel();\n } else {\n runner.end();\n }\n });\n };\n };\n }\n };\n\n function lookupAnimations(classes) {\n classes = isArray(classes) ? classes : classes.split(' ');\n var matches = [], flagMap = {};\n for (var i = 0; i < classes.length; i++) {\n var klass = classes[i],\n animationFactory = $animateProvider.$$registeredAnimations[klass];\n if (animationFactory && !flagMap[klass]) {\n matches.push($injector.get(animationFactory));\n flagMap[klass] = true;\n }\n }\n return matches;\n }\n }];\n}];\n\nvar $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateJsDriver');\n this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {\n return function initDriverFn(animationDetails) {\n if (animationDetails.from && animationDetails.to) {\n var fromAnimation = prepareAnimation(animationDetails.from);\n var toAnimation = prepareAnimation(animationDetails.to);\n if (!fromAnimation && !toAnimation) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n $$AnimateRunner.all(animationRunners, done);\n\n var runner = new $$AnimateRunner({\n end: endFnFactory(),\n cancel: endFnFactory()\n });\n\n return runner;\n\n function endFnFactory() {\n return function() {\n forEach(animationRunners, function(runner) {\n // at this point we cannot cancel animations for groups just yet. 1.5+\n runner.end();\n });\n };\n }\n\n function done(status) {\n runner.complete(status);\n }\n }\n };\n } else {\n return prepareAnimation(animationDetails);\n }\n };\n\n function prepareAnimation(animationDetails) {\n // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations\n var element = animationDetails.element;\n var event = animationDetails.event;\n var options = animationDetails.options;\n var classes = animationDetails.classes;\n return $$animateJs(element, event, classes, options);\n }\n }];\n}];\n\nvar NG_ANIMATE_ATTR_NAME = 'data-ng-animate';\nvar NG_ANIMATE_PIN_DATA = '$ngAnimatePin';\nvar $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n var PRE_DIGEST_STATE = 1;\n var RUNNING_STATE = 2;\n var ONE_SPACE = ' ';\n\n var rules = this.rules = {\n skip: [],\n cancel: [],\n join: []\n };\n\n function getEventData(options) {\n return {\n addClass: options.addClass,\n removeClass: options.removeClass,\n from: options.from,\n to: options.to\n };\n }\n\n function makeTruthyCssClassMap(classString) {\n if (!classString) {\n return null;\n }\n\n var keys = classString.split(ONE_SPACE);\n var map = Object.create(null);\n\n forEach(keys, function(key) {\n map[key] = true;\n });\n return map;\n }\n\n function hasMatchingClasses(newClassString, currentClassString) {\n if (newClassString && currentClassString) {\n var currentClassMap = makeTruthyCssClassMap(currentClassString);\n return newClassString.split(ONE_SPACE).some(function(className) {\n return currentClassMap[className];\n });\n }\n }\n\n function isAllowed(ruleType, currentAnimation, previousAnimation) {\n return rules[ruleType].some(function(fn) {\n return fn(currentAnimation, previousAnimation);\n });\n }\n\n function hasAnimationClasses(animation, and) {\n var a = (animation.addClass || '').length > 0;\n var b = (animation.removeClass || '').length > 0;\n return and ? a && b : a || b;\n }\n\n rules.join.push(function(newAnimation, currentAnimation) {\n // if the new animation is class-based then we can just tack that on\n return !newAnimation.structural && hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(newAnimation, currentAnimation) {\n // there is no need to animate anything if no classes are being added and\n // there is no structural animation that will be triggered\n return !newAnimation.structural && !hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(newAnimation, currentAnimation) {\n // why should we trigger a new structural animation if the element will\n // be removed from the DOM anyway?\n return currentAnimation.event === 'leave' && newAnimation.structural;\n });\n\n rules.skip.push(function(newAnimation, currentAnimation) {\n // if there is an ongoing current animation then don't even bother running the class-based animation\n return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;\n });\n\n rules.cancel.push(function(newAnimation, currentAnimation) {\n // there can never be two structural animations running at the same time\n return currentAnimation.structural && newAnimation.structural;\n });\n\n rules.cancel.push(function(newAnimation, currentAnimation) {\n // if the previous animation is already running, but the new animation will\n // be triggered, but the new animation is structural\n return currentAnimation.state === RUNNING_STATE && newAnimation.structural;\n });\n\n rules.cancel.push(function(newAnimation, currentAnimation) {\n // cancel the animation if classes added / removed in both animation cancel each other out,\n // but only if the current animation isn't structural\n\n if (currentAnimation.structural) return false;\n\n var nA = newAnimation.addClass;\n var nR = newAnimation.removeClass;\n var cA = currentAnimation.addClass;\n var cR = currentAnimation.removeClass;\n\n // early detection to save the global CPU shortage :)\n if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) {\n return false;\n }\n\n return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);\n });\n\n this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$Map',\n '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',\n '$$isDocumentHidden',\n function($$rAF, $rootScope, $rootElement, $document, $$Map,\n $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow,\n $$isDocumentHidden) {\n\n var activeAnimationsLookup = new $$Map();\n var disabledElementsLookup = new $$Map();\n var animationsEnabled = null;\n\n function removeFromDisabledElementsLookup(evt) {\n disabledElementsLookup.delete(evt.target);\n }\n\n function postDigestTaskFactory() {\n var postDigestCalled = false;\n return function(fn) {\n // we only issue a call to postDigest before\n // it has first passed. This prevents any callbacks\n // from not firing once the animation has completed\n // since it will be out of the digest cycle.\n if (postDigestCalled) {\n fn();\n } else {\n $rootScope.$$postDigest(function() {\n postDigestCalled = true;\n fn();\n });\n }\n };\n }\n\n // Wait until all directive and route-related templates are downloaded and\n // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n // all of the remote templates being currently downloaded. If there are no\n // templates currently downloading then the watcher will still fire anyway.\n var deregisterWatch = $rootScope.$watch(\n function() { return $templateRequest.totalPendingRequests === 0; },\n function(isEmpty) {\n if (!isEmpty) return;\n deregisterWatch();\n\n // Now that all templates have been downloaded, $animate will wait until\n // the post digest queue is empty before enabling animations. By having two\n // calls to $postDigest calls we can ensure that the flag is enabled at the\n // very end of the post digest queue. Since all of the animations in $animate\n // use $postDigest, it's important that the code below executes at the end.\n // This basically means that the page is fully downloaded and compiled before\n // any animations are triggered.\n $rootScope.$$postDigest(function() {\n $rootScope.$$postDigest(function() {\n // we check for null directly in the event that the application already called\n // .enabled() with whatever arguments that it provided it with\n if (animationsEnabled === null) {\n animationsEnabled = true;\n }\n });\n });\n }\n );\n\n var callbackRegistry = Object.create(null);\n\n // remember that the `customFilter`/`classNameFilter` are set during the\n // provider/config stage therefore we can optimize here and setup helper functions\n var customFilter = $animateProvider.customFilter();\n var classNameFilter = $animateProvider.classNameFilter();\n var returnTrue = function() { return true; };\n\n var isAnimatableByFilter = customFilter || returnTrue;\n var isAnimatableClassName = !classNameFilter ? returnTrue : function(node, options) {\n var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' ');\n return classNameFilter.test(className);\n };\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function normalizeAnimationDetails(element, animation) {\n return mergeAnimationDetails(element, animation, {});\n }\n\n // IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\n var contains = window.Node.prototype.contains || /** @this */ function(arg) {\n // eslint-disable-next-line no-bitwise\n return this === arg || !!(this.compareDocumentPosition(arg) & 16);\n };\n\n function findCallbacks(targetParentNode, targetNode, event) {\n var matches = [];\n var entries = callbackRegistry[event];\n if (entries) {\n forEach(entries, function(entry) {\n if (contains.call(entry.node, targetNode)) {\n matches.push(entry.callback);\n } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) {\n matches.push(entry.callback);\n }\n });\n }\n\n return matches;\n }\n\n function filterFromRegistry(list, matchContainer, matchCallback) {\n var containerNode = extractElementNode(matchContainer);\n return list.filter(function(entry) {\n var isMatch = entry.node === containerNode &&\n (!matchCallback || entry.callback === matchCallback);\n return !isMatch;\n });\n }\n\n function cleanupEventListeners(phase, node) {\n if (phase === 'close' && !node.parentNode) {\n // If the element is not attached to a parentNode, it has been removed by\n // the domOperation, and we can safely remove the event callbacks\n $animate.off(node);\n }\n }\n\n var $animate = {\n on: function(event, container, callback) {\n var node = extractElementNode(container);\n callbackRegistry[event] = callbackRegistry[event] || [];\n callbackRegistry[event].push({\n node: node,\n callback: callback\n });\n\n // Remove the callback when the element is removed from the DOM\n jqLite(container).on('$destroy', function() {\n var animationDetails = activeAnimationsLookup.get(node);\n\n if (!animationDetails) {\n // If there's an animation ongoing, the callback calling code will remove\n // the event listeners. If we'd remove here, the callbacks would be removed\n // before the animation ends\n $animate.off(event, container, callback);\n }\n });\n },\n\n off: function(event, container, callback) {\n if (arguments.length === 1 && !isString(arguments[0])) {\n container = arguments[0];\n for (var eventType in callbackRegistry) {\n callbackRegistry[eventType] = filterFromRegistry(callbackRegistry[eventType], container);\n }\n\n return;\n }\n\n var entries = callbackRegistry[event];\n if (!entries) return;\n\n callbackRegistry[event] = arguments.length === 1\n ? null\n : filterFromRegistry(entries, container, callback);\n },\n\n pin: function(element, parentElement) {\n assertArg(isElement(element), 'element', 'not an element');\n assertArg(isElement(parentElement), 'parentElement', 'not an element');\n element.data(NG_ANIMATE_PIN_DATA, parentElement);\n },\n\n push: function(element, event, options, domOperation) {\n options = options || {};\n options.domOperation = domOperation;\n return queueAnimation(element, event, options);\n },\n\n // this method has four signatures:\n // () - global getter\n // (bool) - global setter\n // (element) - element getter\n // (element, bool) - element setter<F37>\n enabled: function(element, bool) {\n var argCount = arguments.length;\n\n if (argCount === 0) {\n // () - Global getter\n bool = !!animationsEnabled;\n } else {\n var hasElement = isElement(element);\n\n if (!hasElement) {\n // (bool) - Global setter\n bool = animationsEnabled = !!element;\n } else {\n var node = getDomNode(element);\n\n if (argCount === 1) {\n // (element) - Element getter\n bool = !disabledElementsLookup.get(node);\n } else {\n // (element, bool) - Element setter\n if (!disabledElementsLookup.has(node)) {\n // The element is added to the map for the first time.\n // Create a listener to remove it on `$destroy` (to avoid memory leak).\n jqLite(element).on('$destroy', removeFromDisabledElementsLookup);\n }\n disabledElementsLookup.set(node, !bool);\n }\n }\n }\n\n return bool;\n }\n };\n\n return $animate;\n\n function queueAnimation(originalElement, event, initialOptions) {\n // we always make a copy of the options since\n // there should never be any side effects on\n // the input data when running `$animateCss`.\n var options = copy(initialOptions);\n\n var element = stripCommentsFromElement(originalElement);\n var node = getDomNode(element);\n var parentNode = node && node.parentNode;\n\n options = prepareAnimationOptions(options);\n\n // we create a fake runner with a working promise.\n // These methods will become available after the digest has passed\n var runner = new $$AnimateRunner();\n\n // this is used to trigger callbacks in postDigest mode\n var runInNextPostDigestOrNow = postDigestTaskFactory();\n\n if (isArray(options.addClass)) {\n options.addClass = options.addClass.join(' ');\n }\n\n if (options.addClass && !isString(options.addClass)) {\n options.addClass = null;\n }\n\n if (isArray(options.removeClass)) {\n options.removeClass = options.removeClass.join(' ');\n }\n\n if (options.removeClass && !isString(options.removeClass)) {\n options.removeClass = null;\n }\n\n if (options.from && !isObject(options.from)) {\n options.from = null;\n }\n\n if (options.to && !isObject(options.to)) {\n options.to = null;\n }\n\n // If animations are hard-disabled for the whole application there is no need to continue.\n // There are also situations where a directive issues an animation for a jqLite wrapper that\n // contains only comment nodes. In this case, there is no way we can perform an animation.\n if (!animationsEnabled ||\n !node ||\n !isAnimatableByFilter(node, event, initialOptions) ||\n !isAnimatableClassName(node, options)) {\n close();\n return runner;\n }\n\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n var documentHidden = $$isDocumentHidden();\n\n // This is a hard disable of all animations the element itself, therefore there is no need to\n // continue further past this point if not enabled\n // Animations are also disabled if the document is currently hidden (page is not visible\n // to the user), because browsers slow down or do not flush calls to requestAnimationFrame\n var skipAnimations = documentHidden || disabledElementsLookup.get(node);\n var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};\n var hasExistingAnimation = !!existingAnimation.state;\n\n // there is no point in traversing the same collection of parent ancestors if a followup\n // animation will be run on the same element that already did all that checking work\n if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state !== PRE_DIGEST_STATE)) {\n skipAnimations = !areAnimationsAllowed(node, parentNode, event);\n }\n\n if (skipAnimations) {\n // Callbacks should fire even if the document is hidden (regression fix for issue #14120)\n if (documentHidden) notifyProgress(runner, event, 'start', getEventData(options));\n close();\n if (documentHidden) notifyProgress(runner, event, 'close', getEventData(options));\n return runner;\n }\n\n if (isStructural) {\n closeChildAnimations(node);\n }\n\n var newAnimation = {\n structural: isStructural,\n element: element,\n event: event,\n addClass: options.addClass,\n removeClass: options.removeClass,\n close: close,\n options: options,\n runner: runner\n };\n\n if (hasExistingAnimation) {\n var skipAnimationFlag = isAllowed('skip', newAnimation, existingAnimation);\n if (skipAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n close();\n return runner;\n } else {\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n return existingAnimation.runner;\n }\n }\n var cancelAnimationFlag = isAllowed('cancel', newAnimation, existingAnimation);\n if (cancelAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n // this will end the animation right away and it is safe\n // to do so since the animation is already running and the\n // runner callback code will run in async\n existingAnimation.runner.end();\n } else if (existingAnimation.structural) {\n // this means that the animation is queued into a digest, but\n // hasn't started yet. Therefore it is safe to run the close\n // method which will call the runner methods in async.\n existingAnimation.close();\n } else {\n // this will merge the new animation options into existing animation options\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n return existingAnimation.runner;\n }\n } else {\n // a joined animation means that this animation will take over the existing one\n // so an example would involve a leave animation taking over an enter. Then when\n // the postDigest kicks in the enter will be ignored.\n var joinAnimationFlag = isAllowed('join', newAnimation, existingAnimation);\n if (joinAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n normalizeAnimationDetails(element, newAnimation);\n } else {\n applyGeneratedPreparationClasses($$jqLite, element, isStructural ? event : null, options);\n\n event = newAnimation.event = existingAnimation.event;\n options = mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n //we return the same runner since only the option values of this animation will\n //be fed into the `existingAnimation`.\n return existingAnimation.runner;\n }\n }\n }\n } else {\n // normalization in this case means that it removes redundant CSS classes that\n // already exist (addClass) or do not exist (removeClass) on the element\n normalizeAnimationDetails(element, newAnimation);\n }\n\n // when the options are merged and cleaned up we may end up not having to do\n // an animation at all, therefore we should check this before issuing a post\n // digest callback. Structural animations will always run no matter what.\n var isValidAnimation = newAnimation.structural;\n if (!isValidAnimation) {\n // animate (from/to) can be quickly checked first, otherwise we check if any classes are present\n isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)\n || hasAnimationClasses(newAnimation);\n }\n\n if (!isValidAnimation) {\n close();\n clearElementAnimationState(node);\n return runner;\n }\n\n // the counter keeps track of cancelled animations\n var counter = (existingAnimation.counter || 0) + 1;\n newAnimation.counter = counter;\n\n markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation);\n\n $rootScope.$$postDigest(function() {\n // It is possible that the DOM nodes inside `originalElement` have been replaced. This can\n // happen if the animated element is a transcluded clone and also has a `templateUrl`\n // directive on it. Therefore, we must recreate `element` in order to interact with the\n // actual DOM nodes.\n // Note: We still need to use the old `node` for certain things, such as looking up in\n // HashMaps where it was used as the key.\n\n element = stripCommentsFromElement(originalElement);\n\n var animationDetails = activeAnimationsLookup.get(node);\n var animationCancelled = !animationDetails;\n animationDetails = animationDetails || {};\n\n // if addClass/removeClass is called before something like enter then the\n // registered parent element may not be present. The code below will ensure\n // that a final value for parent element is obtained\n var parentElement = element.parent() || [];\n\n // animate/structural/class-based animations all have requirements. Otherwise there\n // is no point in performing an animation. The parent node must also be set.\n var isValidAnimation = parentElement.length > 0\n && (animationDetails.event === 'animate'\n || animationDetails.structural\n || hasAnimationClasses(animationDetails));\n\n // this means that the previous animation was cancelled\n // even if the follow-up animation is the same event\n if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {\n // if another animation did not take over then we need\n // to make sure that the domOperation and options are\n // handled accordingly\n if (animationCancelled) {\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n }\n\n // if the event changed from something like enter to leave then we do\n // it, otherwise if it's the same then the end result will be the same too\n if (animationCancelled || (isStructural && animationDetails.event !== event)) {\n options.domOperation();\n runner.end();\n }\n\n // in the event that the element animation was not cancelled or a follow-up animation\n // isn't allowed to animate from here then we need to clear the state of the element\n // so that any future animations won't read the expired animation data.\n if (!isValidAnimation) {\n clearElementAnimationState(node);\n }\n\n return;\n }\n\n // this combined multiple class to addClass / removeClass into a setClass event\n // so long as a structural event did not take over the animation\n event = !animationDetails.structural && hasAnimationClasses(animationDetails, true)\n ? 'setClass'\n : animationDetails.event;\n\n markElementAnimationState(node, RUNNING_STATE);\n var realRunner = $$animation(element, event, animationDetails.options);\n\n // this will update the runner's flow-control events based on\n // the `realRunner` object.\n runner.setHost(realRunner);\n notifyProgress(runner, event, 'start', getEventData(options));\n\n realRunner.done(function(status) {\n close(!status);\n var animationDetails = activeAnimationsLookup.get(node);\n if (animationDetails && animationDetails.counter === counter) {\n clearElementAnimationState(node);\n }\n notifyProgress(runner, event, 'close', getEventData(options));\n });\n });\n\n return runner;\n\n function notifyProgress(runner, event, phase, data) {\n runInNextPostDigestOrNow(function() {\n var callbacks = findCallbacks(parentNode, node, event);\n if (callbacks.length) {\n // do not optimize this call here to RAF because\n // we don't know how heavy the callback code here will\n // be and if this code is buffered then this can\n // lead to a performance regression.\n $$rAF(function() {\n forEach(callbacks, function(callback) {\n callback(element, phase, data);\n });\n cleanupEventListeners(phase, node);\n });\n } else {\n cleanupEventListeners(phase, node);\n }\n });\n runner.progress(event, phase, data);\n }\n\n function close(reject) {\n clearGeneratedClasses(element, options);\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n runner.complete(!reject);\n }\n }\n\n function closeChildAnimations(node) {\n var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');\n forEach(children, function(child) {\n var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);\n var animationDetails = activeAnimationsLookup.get(child);\n if (animationDetails) {\n switch (state) {\n case RUNNING_STATE:\n animationDetails.runner.end();\n /* falls through */\n case PRE_DIGEST_STATE:\n activeAnimationsLookup.delete(child);\n break;\n }\n }\n });\n }\n\n function clearElementAnimationState(node) {\n node.removeAttribute(NG_ANIMATE_ATTR_NAME);\n activeAnimationsLookup.delete(node);\n }\n\n /**\n * This fn returns false if any of the following is true:\n * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed\n * b) a parent element has an ongoing structural animation, and animateChildren is false\n * c) the element is not a child of the body\n * d) the element is not a child of the $rootElement\n */\n function areAnimationsAllowed(node, parentNode, event) {\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';\n var rootNodeDetected = (node === rootNode);\n var parentAnimationDetected = false;\n var elementDisabled = disabledElementsLookup.get(node);\n var animateChildren;\n\n var parentHost = jqLite.data(node, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n parentNode = getDomNode(parentHost);\n }\n\n while (parentNode) {\n if (!rootNodeDetected) {\n // AngularJS doesn't want to attempt to animate elements outside of the application\n // therefore we need to ensure that the rootElement is an ancestor of the current element\n rootNodeDetected = (parentNode === rootNode);\n }\n\n if (parentNode.nodeType !== ELEMENT_NODE) {\n // no point in inspecting the #document element\n break;\n }\n\n var details = activeAnimationsLookup.get(parentNode) || {};\n // either an enter, leave or move animation will commence\n // therefore we can't allow any animations to take place\n // but if a parent animation is class-based then that's ok\n if (!parentAnimationDetected) {\n var parentNodeDisabled = disabledElementsLookup.get(parentNode);\n\n if (parentNodeDisabled === true && elementDisabled !== false) {\n // disable animations if the user hasn't explicitly enabled animations on the\n // current element\n elementDisabled = true;\n // element is disabled via parent element, no need to check anything else\n break;\n } else if (parentNodeDisabled === false) {\n elementDisabled = false;\n }\n parentAnimationDetected = details.structural;\n }\n\n if (isUndefined(animateChildren) || animateChildren === true) {\n var value = jqLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA);\n if (isDefined(value)) {\n animateChildren = value;\n }\n }\n\n // there is no need to continue traversing at this point\n if (parentAnimationDetected && animateChildren === false) break;\n\n if (!bodyNodeDetected) {\n // we also need to ensure that the element is or will be a part of the body element\n // otherwise it is pointless to even issue an animation to be rendered\n bodyNodeDetected = (parentNode === bodyNode);\n }\n\n if (bodyNodeDetected && rootNodeDetected) {\n // If both body and root have been found, any other checks are pointless,\n // as no animation data should live outside the application\n break;\n }\n\n if (!rootNodeDetected) {\n // If `rootNode` is not detected, check if `parentNode` is pinned to another element\n parentHost = jqLite.data(parentNode, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n // The pin target element becomes the next parent element\n parentNode = getDomNode(parentHost);\n continue;\n }\n }\n\n parentNode = parentNode.parentNode;\n }\n\n var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;\n return allowAnimation && rootNodeDetected && bodyNodeDetected;\n }\n\n function markElementAnimationState(node, state, details) {\n details = details || {};\n details.state = state;\n\n node.setAttribute(NG_ANIMATE_ATTR_NAME, state);\n\n var oldValue = activeAnimationsLookup.get(node);\n var newValue = oldValue\n ? extend(oldValue, details)\n : details;\n activeAnimationsLookup.set(node, newValue);\n }\n }];\n}];\n\n/** @this */\nvar $$AnimateCacheProvider = function() {\n\n var KEY = '$$ngAnimateParentKey';\n var parentCounter = 0;\n var cache = Object.create(null);\n\n this.$get = [function() {\n return {\n cacheKey: function(node, method, addClass, removeClass) {\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n var parts = [parentID, method, node.getAttribute('class')];\n if (addClass) {\n parts.push(addClass);\n }\n if (removeClass) {\n parts.push(removeClass);\n }\n return parts.join(' ');\n },\n\n containsCachedAnimationWithoutDuration: function(key) {\n var entry = cache[key];\n\n // nothing cached, so go ahead and animate\n // otherwise it should be a valid animation\n return (entry && !entry.isValid) || false;\n },\n\n flush: function() {\n cache = Object.create(null);\n },\n\n count: function(key) {\n var entry = cache[key];\n return entry ? entry.total : 0;\n },\n\n get: function(key) {\n var entry = cache[key];\n return entry && entry.value;\n },\n\n put: function(key, value, isValid) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value, isValid: isValid };\n } else {\n cache[key].total++;\n cache[key].value = value;\n }\n }\n };\n }];\n};\n\n/* exported $$AnimationProvider */\n\nvar $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';\n\n var drivers = this.drivers = [];\n\n var RUNNER_STORAGE_KEY = '$$animationRunner';\n var PREPARE_CLASSES_KEY = '$$animatePrepareClasses';\n\n function setRunner(element, runner) {\n element.data(RUNNER_STORAGE_KEY, runner);\n }\n\n function removeRunner(element) {\n element.removeData(RUNNER_STORAGE_KEY);\n }\n\n function getRunner(element) {\n return element.data(RUNNER_STORAGE_KEY);\n }\n\n this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$Map', '$$rAFScheduler', '$$animateCache',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler, $$animateCache) {\n\n var animationQueue = [];\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function sortAnimations(animations) {\n var tree = { children: [] };\n var i, lookup = new $$Map();\n\n // this is done first beforehand so that the map\n // is filled with a list of the elements that will be animated\n for (i = 0; i < animations.length; i++) {\n var animation = animations[i];\n lookup.set(animation.domNode, animations[i] = {\n domNode: animation.domNode,\n element: animation.element,\n fn: animation.fn,\n children: []\n });\n }\n\n for (i = 0; i < animations.length; i++) {\n processNode(animations[i]);\n }\n\n return flatten(tree);\n\n function processNode(entry) {\n if (entry.processed) return entry;\n entry.processed = true;\n\n var elementNode = entry.domNode;\n var parentNode = elementNode.parentNode;\n lookup.set(elementNode, entry);\n\n var parentEntry;\n while (parentNode) {\n parentEntry = lookup.get(parentNode);\n if (parentEntry) {\n if (!parentEntry.processed) {\n parentEntry = processNode(parentEntry);\n }\n break;\n }\n parentNode = parentNode.parentNode;\n }\n\n (parentEntry || tree).children.push(entry);\n return entry;\n }\n\n function flatten(tree) {\n var result = [];\n var queue = [];\n var i;\n\n for (i = 0; i < tree.children.length; i++) {\n queue.push(tree.children[i]);\n }\n\n var remainingLevelEntries = queue.length;\n var nextLevelEntries = 0;\n var row = [];\n\n for (i = 0; i < queue.length; i++) {\n var entry = queue[i];\n if (remainingLevelEntries <= 0) {\n remainingLevelEntries = nextLevelEntries;\n nextLevelEntries = 0;\n result.push(row);\n row = [];\n }\n row.push(entry);\n entry.children.forEach(function(childEntry) {\n nextLevelEntries++;\n queue.push(childEntry);\n });\n remainingLevelEntries--;\n }\n\n if (row.length) {\n result.push(row);\n }\n\n return result;\n }\n }\n\n // TODO(matsko): document the signature in a better way\n return function(element, event, options) {\n options = prepareAnimationOptions(options);\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n // there is no animation at the current moment, however\n // these runner methods will get later updated with the\n // methods leading into the driver's end/cancel methods\n // for now they just stop the animation from starting\n var runner = new $$AnimateRunner({\n end: function() { close(); },\n cancel: function() { close(true); }\n });\n\n if (!drivers.length) {\n close();\n return runner;\n }\n\n var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));\n var tempClasses = options.tempClasses;\n if (tempClasses) {\n classes += ' ' + tempClasses;\n options.tempClasses = null;\n }\n\n if (isStructural) {\n element.data(PREPARE_CLASSES_KEY, 'ng-' + event + PREPARE_CLASS_SUFFIX);\n }\n\n setRunner(element, runner);\n\n animationQueue.push({\n // this data is used by the postDigest code and passed into\n // the driver step function\n element: element,\n classes: classes,\n event: event,\n structural: isStructural,\n options: options,\n beforeStart: beforeStart,\n close: close\n });\n\n element.on('$destroy', handleDestroyedElement);\n\n // we only want there to be one function called within the post digest\n // block. This way we can group animations for all the animations that\n // were apart of the same postDigest flush call.\n if (animationQueue.length > 1) return runner;\n\n $rootScope.$$postDigest(function() {\n var animations = [];\n forEach(animationQueue, function(entry) {\n // the element was destroyed early on which removed the runner\n // form its storage. This means we can't animate this element\n // at all and it already has been closed due to destruction.\n if (getRunner(entry.element)) {\n animations.push(entry);\n } else {\n entry.close();\n }\n });\n\n // now any future animations will be in another postDigest\n animationQueue.length = 0;\n\n var groupedAnimations = groupAnimations(animations);\n var toBeSortedAnimations = [];\n\n forEach(groupedAnimations, function(animationEntry) {\n var element = animationEntry.from ? animationEntry.from.element : animationEntry.element;\n var extraClasses = options.addClass;\n\n extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;\n var cacheKey = $$animateCache.cacheKey(element[0], animationEntry.event, extraClasses, options.removeClass);\n\n toBeSortedAnimations.push({\n element: element,\n domNode: getDomNode(element),\n fn: function triggerAnimationStart() {\n var startAnimationFn, closeFn = animationEntry.close;\n\n // in the event that we've cached the animation status for this element\n // and it's in fact an invalid animation (something that has duration = 0)\n // then we should skip all the heavy work from here on\n if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {\n closeFn();\n return;\n }\n\n // it's important that we apply the `ng-animate` CSS class and the\n // temporary classes before we do any driver invoking since these\n // CSS classes may be required for proper CSS detection.\n animationEntry.beforeStart();\n\n // in the event that the element was removed before the digest runs or\n // during the RAF sequencing then we should not trigger the animation.\n var targetElement = animationEntry.anchors\n ? (animationEntry.from.element || animationEntry.to.element)\n : animationEntry.element;\n\n if (getRunner(targetElement)) {\n var operation = invokeFirstDriver(animationEntry);\n if (operation) {\n startAnimationFn = operation.start;\n }\n }\n\n if (!startAnimationFn) {\n closeFn();\n } else {\n var animationRunner = startAnimationFn();\n animationRunner.done(function(status) {\n closeFn(!status);\n });\n updateAnimationRunners(animationEntry, animationRunner);\n }\n }\n });\n });\n\n // we need to sort each of the animations in order of parent to child\n // relationships. This ensures that the child classes are applied at the\n // right time.\n var finalAnimations = sortAnimations(toBeSortedAnimations);\n for (var i = 0; i < finalAnimations.length; i++) {\n var innerArray = finalAnimations[i];\n for (var j = 0; j < innerArray.length; j++) {\n var entry = innerArray[j];\n var element = entry.element;\n\n // the RAFScheduler code only uses functions\n finalAnimations[i][j] = entry.fn;\n\n // the first row of elements shouldn't have a prepare-class added to them\n // since the elements are at the top of the animation hierarchy and they\n // will be applied without a RAF having to pass...\n if (i === 0) {\n element.removeData(PREPARE_CLASSES_KEY);\n continue;\n }\n\n var prepareClassName = element.data(PREPARE_CLASSES_KEY);\n if (prepareClassName) {\n $$jqLite.addClass(element, prepareClassName);\n }\n }\n }\n\n $$rAFScheduler(finalAnimations);\n });\n\n return runner;\n\n // TODO(matsko): change to reference nodes\n function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }\n\n function groupAnimations(animations) {\n var preparedAnimations = [];\n var refLookup = {};\n forEach(animations, function(animation, index) {\n var element = animation.element;\n var node = getDomNode(element);\n var event = animation.event;\n var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;\n var anchorNodes = animation.structural ? getAnchorNodes(node) : [];\n\n if (anchorNodes.length) {\n var direction = enterOrMove ? 'to' : 'from';\n\n forEach(anchorNodes, function(anchor) {\n var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);\n refLookup[key] = refLookup[key] || {};\n refLookup[key][direction] = {\n animationID: index,\n element: jqLite(anchor)\n };\n });\n } else {\n preparedAnimations.push(animation);\n }\n });\n\n var usedIndicesLookup = {};\n var anchorGroups = {};\n forEach(refLookup, function(operations, key) {\n var from = operations.from;\n var to = operations.to;\n\n if (!from || !to) {\n // only one of these is set therefore we can't have an\n // anchor animation since all three pieces are required\n var index = from ? from.animationID : to.animationID;\n var indexKey = index.toString();\n if (!usedIndicesLookup[indexKey]) {\n usedIndicesLookup[indexKey] = true;\n preparedAnimations.push(animations[index]);\n }\n return;\n }\n\n var fromAnimation = animations[from.animationID];\n var toAnimation = animations[to.animationID];\n var lookupKey = from.animationID.toString();\n if (!anchorGroups[lookupKey]) {\n var group = anchorGroups[lookupKey] = {\n structural: true,\n beforeStart: function() {\n fromAnimation.beforeStart();\n toAnimation.beforeStart();\n },\n close: function() {\n fromAnimation.close();\n toAnimation.close();\n },\n classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),\n from: fromAnimation,\n to: toAnimation,\n anchors: [] // TODO(matsko): change to reference nodes\n };\n\n // the anchor animations require that the from and to elements both have at least\n // one shared CSS class which effectively marries the two elements together to use\n // the same animation driver and to properly sequence the anchor animation.\n if (group.classes.length) {\n preparedAnimations.push(group);\n } else {\n preparedAnimations.push(fromAnimation);\n preparedAnimations.push(toAnimation);\n }\n }\n\n anchorGroups[lookupKey].anchors.push({\n 'out': from.element, 'in': to.element\n });\n });\n\n return preparedAnimations;\n }\n\n function cssClassesIntersection(a,b) {\n a = a.split(' ');\n b = b.split(' ');\n var matches = [];\n\n for (var i = 0; i < a.length; i++) {\n var aa = a[i];\n if (aa.substring(0,3) === 'ng-') continue;\n\n for (var j = 0; j < b.length; j++) {\n if (aa === b[j]) {\n matches.push(aa);\n break;\n }\n }\n }\n\n return matches.join(' ');\n }\n\n function invokeFirstDriver(animationDetails) {\n // we loop in reverse order since the more general drivers (like CSS and JS)\n // may attempt more elements, but custom drivers are more particular\n for (var i = drivers.length - 1; i >= 0; i--) {\n var driverName = drivers[i];\n var factory = $injector.get(driverName);\n var driver = factory(animationDetails);\n if (driver) {\n return driver;\n }\n }\n }\n\n function beforeStart() {\n tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;\n $$jqLite.addClass(element, tempClasses);\n\n var prepareClassName = element.data(PREPARE_CLASSES_KEY);\n if (prepareClassName) {\n $$jqLite.removeClass(element, prepareClassName);\n prepareClassName = null;\n }\n }\n\n function updateAnimationRunners(animation, newRunner) {\n if (animation.from && animation.to) {\n update(animation.from.element);\n update(animation.to.element);\n } else {\n update(animation.element);\n }\n\n function update(element) {\n var runner = getRunner(element);\n if (runner) runner.setHost(newRunner);\n }\n }\n\n function handleDestroyedElement() {\n var runner = getRunner(element);\n if (runner && (event !== 'leave' || !options.$$domOperationFired)) {\n runner.end();\n }\n }\n\n function close(rejected) {\n element.off('$destroy', handleDestroyedElement);\n removeRunner(element);\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n\n if (tempClasses) {\n $$jqLite.removeClass(element, tempClasses);\n }\n\n runner.complete(!rejected);\n }\n };\n }];\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateSwap\n * @restrict A\n * @scope\n *\n * @description\n *\n * ngAnimateSwap is a animation-oriented directive that allows for the container to\n * be removed and entered in whenever the associated expression changes. A\n * common usecase for this directive is a rotating banner or slider component which\n * contains one image being present at a time. When the active image changes\n * then the old image will perform a `leave` animation and the new element\n * will be inserted via an `enter` animation.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|--------------------------------------|\n * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |\n * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM |\n *\n * @example\n * <example name=\"ngAnimateSwap-directive\" module=\"ngAnimateSwapExample\"\n * deps=\"angular-animate.js\"\n * animations=\"true\" fixBase=\"true\">\n * <file name=\"index.html\">\n * <div class=\"container\" ng-controller=\"AppCtrl\">\n * <div ng-animate-swap=\"number\" class=\"cell swap-animation\" ng-class=\"colorClass(number)\">\n * {{ number }}\n * </div>\n * </div>\n * </file>\n * <file name=\"script.js\">\n * angular.module('ngAnimateSwapExample', ['ngAnimate'])\n * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {\n * $scope.number = 0;\n * $interval(function() {\n * $scope.number++;\n * }, 1000);\n *\n * var colors = ['red','blue','green','yellow','orange'];\n * $scope.colorClass = function(number) {\n * return colors[number % colors.length];\n * };\n * }]);\n * </file>\n * <file name=\"animations.css\">\n * .container {\n * height:250px;\n * width:250px;\n * position:relative;\n * overflow:hidden;\n * border:2px solid black;\n * }\n * .container .cell {\n * font-size:150px;\n * text-align:center;\n * line-height:250px;\n * position:absolute;\n * top:0;\n * left:0;\n * right:0;\n * border-bottom:2px solid black;\n * }\n * .swap-animation.ng-enter, .swap-animation.ng-leave {\n * transition:0.5s linear all;\n * }\n * .swap-animation.ng-enter {\n * top:-250px;\n * }\n * .swap-animation.ng-enter-active {\n * top:0px;\n * }\n * .swap-animation.ng-leave {\n * top:0px;\n * }\n * .swap-animation.ng-leave-active {\n * top:250px;\n * }\n * .red { background:red; }\n * .green { background:green; }\n * .blue { background:blue; }\n * .yellow { background:yellow; }\n * .orange { background:orange; }\n * </file>\n * </example>\n */\nvar ngAnimateSwapDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 550, // We use 550 here to ensure that the directive is caught before others,\n // but after `ngIf` (at priority 600).\n link: function(scope, $element, attrs, ctrl, $transclude) {\n var previousElement, previousScope;\n scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) {\n if (previousElement) {\n $animate.leave(previousElement);\n }\n if (previousScope) {\n previousScope.$destroy();\n previousScope = null;\n }\n if (value || value === 0) {\n $transclude(function(clone, childScope) {\n previousElement = clone;\n previousScope = childScope;\n $animate.enter(clone, null, $element);\n });\n }\n });\n }\n };\n}];\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via\n * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an AngularJS app.\n *\n * ## Usage\n * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based\n * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For\n * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within\n * the HTML element that the animation will be triggered on.\n *\n * ## Directive Support\n * The following directives are \"animation aware\":\n *\n * | Directive | Supported Animations |\n * |-------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n * | {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |\n * | {@link ngAnimate.directive:ngAnimateSwap#animations ngAnimateSwap} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass / {{class}​}} | add and remove |\n * | {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove |\n * | {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove |\n * | {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |\n * | {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |\n * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave, and move |\n * | {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n *\n * (More information can be found by visiting the documentation associated with each directive.)\n *\n * For a full breakdown of the steps involved during each animation event, refer to the\n * {@link ng.$animate `$animate` API docs}.\n *\n * ## CSS-based Animations\n *\n * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML\n * and CSS code we can create an animation that will be picked up by AngularJS when an underlying directive performs an operation.\n *\n * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:\n *\n * ```html\n * <div ng-if=\"bool\" class=\"fade\">\n * Fade me in out\n * </div>\n * <button ng-click=\"bool=true\">Fade In!</button>\n * <button ng-click=\"bool=false\">Fade Out!</button>\n * ```\n *\n * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:\n *\n * ```css\n * /* The starting CSS styles for the enter animation */\n * .fade.ng-enter {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n *\n * /* The finishing CSS styles for the enter animation */\n * .fade.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * ```\n *\n * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two\n * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition\n * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.\n *\n * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:\n *\n * ```css\n * /* now the element will fade out before it is removed from the DOM */\n * .fade.ng-leave {\n * transition:0.5s linear all;\n * opacity:1;\n * }\n * .fade.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:\n *\n * ```css\n * /* there is no need to define anything inside of the destination\n * CSS class since the keyframe will take charge of the animation */\n * .fade.ng-leave {\n * animation: my_fade_animation 0.5s linear;\n * -webkit-animation: my_fade_animation 0.5s linear;\n * }\n *\n * @keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n *\n * @-webkit-keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n * ```\n *\n * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.\n *\n * ### CSS Class-based Animations\n *\n * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different\n * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added\n * and removed.\n *\n * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:\n *\n * ```html\n * <div ng-show=\"bool\" class=\"fade\">\n * Show and hide me\n * </div>\n * <button ng-click=\"bool=!bool\">Toggle</button>\n *\n * <style>\n * .fade.ng-hide {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n * </style>\n * ```\n *\n * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since\n * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.\n *\n * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation\n * with CSS styles.\n *\n * ```html\n * <div ng-class=\"{on:onOff}\" class=\"highlight\">\n * Highlight this box\n * </div>\n * <button ng-click=\"onOff=!onOff\">Toggle</button>\n *\n * <style>\n * .highlight {\n * transition:0.5s linear all;\n * }\n * .highlight.on-add {\n * background:white;\n * }\n * .highlight.on {\n * background:yellow;\n * }\n * .highlight.on-remove {\n * background:black;\n * }\n * </style>\n * ```\n *\n * We can also make use of CSS keyframes by placing them within the CSS classes.\n *\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n * /* standard transition code */\n * transition: 1s linear all;\n * opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n * /* this will have a 100ms delay between each successive leave animation */\n * transition-delay: 0.1s;\n *\n * /* As of 1.4.4, this must always be set: it signals ngAnimate\n * to not accidentally inherit a delay property from another CSS class */\n * transition-duration: 0s;\n *\n * /* if you are using animations instead of transitions you should configure as follows:\n * animation-delay: 0.1s;\n * animation-duration: 0s; */\n * }\n * .my-animation.ng-enter.ng-enter-active {\n * /* standard transition styles */\n * opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * window.requestAnimationFrame(function() {\n * //stagger has reset itself\n * $animate.leave(kids[5]); //stagger index=0\n * $animate.leave(kids[6]); //stagger index=1\n *\n * $scope.$digest();\n * });\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ### The `ng-animate` CSS class\n *\n * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.\n * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).\n *\n * Therefore, animations can be applied to an element using this temporary class directly via CSS.\n *\n * ```css\n * .zipper.ng-animate {\n * transition:0.5s linear all;\n * }\n * .zipper.ng-enter {\n * opacity:0;\n * }\n * .zipper.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * .zipper.ng-leave {\n * opacity:1;\n * }\n * .zipper.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove\n * the CSS class once an animation has completed.)\n *\n *\n * ### The `ng-[event]-prepare` class\n *\n * This is a special class that can be used to prevent unwanted flickering / flash of content before\n * the actual animation starts. The class is added as soon as an animation is initialized, but removed\n * before the actual animation starts (after waiting for a $digest).\n * It is also only added for *structural* animations (`enter`, `move`, and `leave`).\n *\n * In practice, flickering can appear when nesting elements with structural animations such as `ngIf`\n * into elements that have class-based animations such as `ngClass`.\n *\n * ```html\n * <div ng-class=\"{red: myProp}\">\n * <div ng-class=\"{blue: myProp}\">\n * <div class=\"message\" ng-if=\"myProp\"></div>\n * </div>\n * </div>\n * ```\n *\n * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.\n * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:\n *\n * ```css\n * .message.ng-enter-prepare {\n * opacity: 0;\n * }\n * ```\n *\n * ### Animating between value changes\n *\n * Sometimes you need to animate between different expression states, whose values\n * don't necessary need to be known or referenced in CSS styles.\n * Unless possible with another {@link ngAnimate#directive-support \"animation aware\" directive},\n * that specific use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as\n * can be seen in {@link ngAnimate.directive:ngAnimateSwap#examples this example}.\n *\n * Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it\n * creates a new instance of the element (including any other/child directives it may have) and\n * links it to a new scope every time *swap* happens. In some cases this might not be desirable\n * (e.g. for performance reasons, or when you wish to retain internal state on the original\n * element instance).\n *\n * ## JavaScript-based Animations\n *\n * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared\n * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the\n * `module.animation()` module function we can register the animation.\n *\n * Let's see an example of a enter/leave animation using `ngRepeat`:\n *\n * ```html\n * <div ng-repeat=\"item in items\" class=\"slide\">\n * {{ item }}\n * </div>\n * ```\n *\n * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * // make note that other events (like addClass/removeClass)\n * // have different function input parameters\n * enter: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n *\n * // remember to call doneFn so that AngularJS\n * // knows that the animation has concluded\n * },\n *\n * move: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n * },\n *\n * leave: function(element, doneFn) {\n * jQuery(element).fadeOut(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as\n * greensock.js and velocity.js.\n *\n * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define\n * our animations inside of the same registered animation, however, the function input arguments are a bit different:\n *\n * ```html\n * <div ng-class=\"color\" class=\"colorful\">\n * this box is moody\n * </div>\n * <button ng-click=\"color='red'\">Change to red</button>\n * <button ng-click=\"color='blue'\">Change to blue</button>\n * <button ng-click=\"color='green'\">Change to green</button>\n * ```\n *\n * ```js\n * myModule.animation('.colorful', [function() {\n * return {\n * addClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * removeClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * setClass: function(element, addedClass, removedClass, doneFn) {\n * // do some cool animation and call the doneFn\n * }\n * }\n * }]);\n * ```\n *\n * ## CSS + JS Animations Together\n *\n * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of AngularJS,\n * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking\n * charge of the animation**:\n *\n * ```html\n * <div ng-if=\"bool\" class=\"slide\">\n * Slide in and out\n * </div>\n * ```\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * enter: function(element, doneFn) {\n * jQuery(element).slideIn(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * ```css\n * .slide.ng-enter {\n * transition:0.5s linear all;\n * transform:translateY(-100px);\n * }\n * .slide.ng-enter.ng-enter-active {\n * transform:translateY(0);\n * }\n * ```\n *\n * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the\n * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from\n * our own JS-based animation code:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true\n * });\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.\n *\n * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or\n * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that\n * data into `$animateCss` directly:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true,\n * addClass: 'maroon-setting',\n * from: { height:0 },\n * to: { height: 200 }\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Now we can fill in the rest via our transition CSS code:\n *\n * ```css\n * /* the transition tells ngAnimate to make the animation happen */\n * .slide.ng-enter { transition:0.5s linear all; }\n *\n * /* this extra CSS class will be absorbed into the transition\n * since the $animateCss code is adding the class */\n * .maroon-setting { background:red; }\n * ```\n *\n * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.\n *\n * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.\n *\n * ## Animation Anchoring (via `ng-animate-ref`)\n *\n * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between\n * structural areas of an application (like views) by pairing up elements using an attribute\n * called `ng-animate-ref`.\n *\n * Let's say for example we have two views that are managed by `ng-view` and we want to show\n * that there is a relationship between two components situated in within these views. By using the\n * `ng-animate-ref` attribute we can identify that the two components are paired together and we\n * can then attach an animation, which is triggered when the view changes.\n *\n * Say for example we have the following template code:\n *\n * ```html\n * <!-- index.html -->\n * <div ng-view class=\"view-animation\">\n * </div>\n *\n * <!-- home.html -->\n * <a href=\"#/banner-page\">\n * <img src=\"./banner.jpg\" class=\"banner\" ng-animate-ref=\"banner\">\n * </a>\n *\n * <!-- banner-page.html -->\n * <img src=\"./banner.jpg\" class=\"banner\" ng-animate-ref=\"banner\">\n * ```\n *\n * Now, when the view changes (once the link is clicked), ngAnimate will examine the\n * HTML contents to see if there is a match reference between any components in the view\n * that is leaving and the view that is entering. It will scan both the view which is being\n * removed (leave) and inserted (enter) to see if there are any paired DOM elements that\n * contain a matching ref value.\n *\n * The two images match since they share the same ref value. ngAnimate will now create a\n * transport element (which is a clone of the first image element) and it will then attempt\n * to animate to the position of the second image element in the next view. For the animation to\n * work a special CSS class called `ng-anchor` will be added to the transported element.\n *\n * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then\n * ngAnimate will handle the entire transition for us as well as the addition and removal of\n * any changes of CSS classes between the elements:\n *\n * ```css\n * .banner.ng-anchor {\n * /* this animation will last for 1 second since there are\n * two phases to the animation (an `in` and an `out` phase) */\n * transition:0.5s linear all;\n * }\n * ```\n *\n * We also **must** include animations for the views that are being entered and removed\n * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).\n *\n * ```css\n * .view-animation.ng-enter, .view-animation.ng-leave {\n * transition:0.5s linear all;\n * position:fixed;\n * left:0;\n * top:0;\n * width:100%;\n * }\n * .view-animation.ng-enter {\n * transform:translateX(100%);\n * }\n * .view-animation.ng-leave,\n * .view-animation.ng-enter.ng-enter-active {\n * transform:translateX(0%);\n * }\n * .view-animation.ng-leave.ng-leave-active {\n * transform:translateX(-100%);\n * }\n * ```\n *\n * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:\n * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away\n * from its origin. Once that animation is over then the `in` stage occurs which animates the\n * element to its destination. The reason why there are two animations is to give enough time\n * for the enter animation on the new element to be ready.\n *\n * The example above sets up a transition for both the in and out phases, but we can also target the out or\n * in phases directly via `ng-anchor-out` and `ng-anchor-in`.\n *\n * ```css\n * .banner.ng-anchor-out {\n * transition: 0.5s linear all;\n *\n * /* the scale will be applied during the out animation,\n * but will be animated away when the in animation runs */\n * transform: scale(1.2);\n * }\n *\n * .banner.ng-anchor-in {\n * transition: 1s linear all;\n * }\n * ```\n *\n *\n *\n *\n * ### Anchoring Demo\n *\n <example module=\"anchoringExample\"\n name=\"anchoringExample\"\n id=\"anchoringExample\"\n deps=\"angular-animate.js;angular-route.js\"\n animations=\"true\">\n <file name=\"index.html\">\n <a href=\"#!/\">Home</a>\n <hr />\n <div class=\"view-container\">\n <div ng-view class=\"view\"></div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])\n .config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/', {\n templateUrl: 'home.html',\n controller: 'HomeController as home'\n });\n $routeProvider.when('/profile/:id', {\n templateUrl: 'profile.html',\n controller: 'ProfileController as profile'\n });\n }])\n .run(['$rootScope', function($rootScope) {\n $rootScope.records = [\n { id: 1, title: 'Miss Beulah Roob' },\n { id: 2, title: 'Trent Morissette' },\n { id: 3, title: 'Miss Ava Pouros' },\n { id: 4, title: 'Rod Pouros' },\n { id: 5, title: 'Abdul Rice' },\n { id: 6, title: 'Laurie Rutherford Sr.' },\n { id: 7, title: 'Nakia McLaughlin' },\n { id: 8, title: 'Jordon Blanda DVM' },\n { id: 9, title: 'Rhoda Hand' },\n { id: 10, title: 'Alexandrea Sauer' }\n ];\n }])\n .controller('HomeController', [function() {\n //empty\n }])\n .controller('ProfileController', ['$rootScope', '$routeParams',\n function ProfileController($rootScope, $routeParams) {\n var index = parseInt($routeParams.id, 10);\n var record = $rootScope.records[index - 1];\n\n this.title = record.title;\n this.id = record.id;\n }]);\n </file>\n <file name=\"home.html\">\n <h2>Welcome to the home page</h1>\n <p>Please click on an element</p>\n <a class=\"record\"\n ng-href=\"#!/profile/{{ record.id }}\"\n ng-animate-ref=\"{{ record.id }}\"\n ng-repeat=\"record in records\">\n {{ record.title }}\n </a>\n </file>\n <file name=\"profile.html\">\n <div class=\"profile record\" ng-animate-ref=\"{{ profile.id }}\">\n {{ profile.title }}\n </div>\n </file>\n <file name=\"animations.css\">\n .record {\n display:block;\n font-size:20px;\n }\n .profile {\n background:black;\n color:white;\n font-size:100px;\n }\n .view-container {\n position:relative;\n }\n .view-container > .view.ng-animate {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n min-height:500px;\n }\n .view.ng-enter, .view.ng-leave,\n .record.ng-anchor {\n transition:0.5s linear all;\n }\n .view.ng-enter {\n transform:translateX(100%);\n }\n .view.ng-enter.ng-enter-active, .view.ng-leave {\n transform:translateX(0%);\n }\n .view.ng-leave.ng-leave-active {\n transform:translateX(-100%);\n }\n .record.ng-anchor-out {\n background:red;\n }\n </file>\n </example>\n *\n * ### How is the element transported?\n *\n * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting\n * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element\n * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The\n * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match\n * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied\n * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class\n * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element\n * will become visible since the shim class will be removed.\n *\n * ### How is the morphing handled?\n *\n * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out\n * what CSS classes differ between the starting element and the destination element. These different CSS classes\n * will be added/removed on the anchor element and a transition will be applied (the transition that is provided\n * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will\n * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that\n * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since\n * the cloned element is placed inside of root element which is likely close to the body element).\n *\n * Note that if the root element is on the `<html>` element then the cloned node will be placed inside of body.\n *\n *\n * ## Using $animate in your directive code\n *\n * So far we've explored how to feed in animations into an AngularJS application, but how do we trigger animations within our own directives in our application?\n * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's\n * imagine we have a greeting box that shows and hides itself when the data changes\n *\n * ```html\n * <greeting-box active=\"onOrOff\">Hi there</greeting-box>\n * ```\n *\n * ```js\n * ngModule.directive('greetingBox', ['$animate', function($animate) {\n * return function(scope, element, attrs) {\n * attrs.$observe('active', function(value) {\n * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');\n * });\n * });\n * }]);\n * ```\n *\n * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element\n * in our HTML code then we can trigger a CSS or JS animation to happen.\n *\n * ```css\n * /* normally we would create a CSS class to reference on the element */\n * greeting-box.on { transition:0.5s linear all; background:green; color:white; }\n * ```\n *\n * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's\n * possible be sure to visit the {@link ng.$animate $animate service API page}.\n *\n *\n * ## Callbacks and Promises\n *\n * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger\n * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has\n * ended by chaining onto the returned promise that animation method returns.\n *\n * ```js\n * // somewhere within the depths of the directive\n * $animate.enter(element, parent).then(function() {\n * //the animation has completed\n * });\n * ```\n *\n * (Note that earlier versions of AngularJS prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case\n * anymore.)\n *\n * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering\n * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view\n * routing controller to hook into that:\n *\n * ```js\n * ngModule.controller('HomePageController', ['$animate', function($animate) {\n * $animate.on('enter', ngViewElement, function(element) {\n * // the animation for this route has completed\n * }]);\n * }])\n * ```\n *\n * (Note that you will need to trigger a digest within the callback to get AngularJS to notice any scope-related changes.)\n */\n\nvar copy;\nvar extend;\nvar forEach;\nvar isArray;\nvar isDefined;\nvar isElement;\nvar isFunction;\nvar isObject;\nvar isString;\nvar isUndefined;\nvar jqLite;\nvar noop;\n\n/**\n * @ngdoc service\n * @name $animate\n * @kind object\n *\n * @description\n * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.\n *\n * Click here {@link ng.$animate to learn more about animations with `$animate`}.\n */\nangular.module('ngAnimate', [], function initAngularHelpers() {\n // Access helpers from AngularJS core.\n // Do it inside a `config` block to ensure `window.angular` is available.\n noop = angular.noop;\n copy = angular.copy;\n extend = angular.extend;\n jqLite = angular.element;\n forEach = angular.forEach;\n isArray = angular.isArray;\n isString = angular.isString;\n isObject = angular.isObject;\n isUndefined = angular.isUndefined;\n isDefined = angular.isDefined;\n isFunction = angular.isFunction;\n isElement = angular.isElement;\n})\n .info({ angularVersion: '1.8.2' })\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\n .provider('$$animateCache', $$AnimateCacheProvider)\n .provider('$$animation', $$AnimationProvider)\n\n .provider('$animateCss', $AnimateCssProvider)\n .provider('$$animateCssDriver', $$AnimateCssDriverProvider)\n\n .provider('$$animateJs', $$AnimateJsProvider)\n .provider('$$animateJsDriver', $$AnimateJsDriverProvider);\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.8.2\n * (c) 2010-2020 Google LLC. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngAria\n * @description\n *\n * The `ngAria` module provides support for common\n * [<abbr title=\"Accessible Rich Internet Applications\">ARIA</abbr>](http://www.w3.org/TR/wai-aria/)\n * attributes that convey state or semantic information about the application for users\n * of assistive technologies, such as screen readers.\n *\n * ## Usage\n *\n * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following\n * directives are supported:\n * `ngModel`, `ngChecked`, `ngReadonly`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`,\n * `ngClick`, `ngDblClick`, and `ngMessages`.\n *\n * Below is a more detailed breakdown of the attributes handled by ngAria:\n *\n * | Directive | Supported Attributes |\n * |---------------------------------------------|-----------------------------------------------------------------------------------------------------|\n * | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles |\n * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled |\n * | {@link ng.directive:ngRequired ngRequired} | aria-required |\n * | {@link ng.directive:ngChecked ngChecked} | aria-checked |\n * | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly |\n * | {@link ng.directive:ngValue ngValue} | aria-checked |\n * | {@link ng.directive:ngShow ngShow} | aria-hidden |\n * | {@link ng.directive:ngHide ngHide} | aria-hidden |\n * | {@link ng.directive:ngDblclick ngDblclick} | tabindex |\n * | {@link module:ngMessages ngMessages} | aria-live |\n * | {@link ng.directive:ngClick ngClick} | tabindex, keydown event, button role |\n *\n * Find out more information about each directive by reading the\n * {@link guide/accessibility ngAria Developer Guide}.\n *\n * ## Example\n * Using ngDisabled with ngAria:\n * ```html\n * <md-checkbox ng-disabled=\"disabled\">\n * ```\n * Becomes:\n * ```html\n * <md-checkbox ng-disabled=\"disabled\" aria-disabled=\"true\">\n * ```\n *\n * ## Disabling Specific Attributes\n * It is possible to disable individual attributes added by ngAria with the\n * {@link ngAria.$ariaProvider#config config} method. For more details, see the\n * {@link guide/accessibility Developer Guide}.\n *\n * ## Disabling `ngAria` on Specific Elements\n * It is possible to make `ngAria` ignore a specific element, by adding the `ng-aria-disable`\n * attribute on it. Note that only the element itself (and not its child elements) will be ignored.\n */\nvar ARIA_DISABLE_ATTR = 'ngAriaDisable';\n\nvar ngAriaModule = angular.module('ngAria', ['ng']).\n info({ angularVersion: '1.8.2' }).\n provider('$aria', $AriaProvider);\n\n/**\n* Internal Utilities\n*/\nvar nativeAriaNodeNames = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY'];\n\nvar isNodeOneOf = function(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) {\n return true;\n }\n};\n/**\n * @ngdoc provider\n * @name $ariaProvider\n * @this\n *\n * @description\n *\n * Used for configuring the ARIA attributes injected and managed by ngAria.\n *\n * ```js\n * angular.module('myApp', ['ngAria'], function config($ariaProvider) {\n * $ariaProvider.config({\n * ariaValue: true,\n * tabindex: false\n * });\n * });\n *```\n *\n * ## Dependencies\n * Requires the {@link ngAria} module to be installed.\n *\n */\nfunction $AriaProvider() {\n var config = {\n ariaHidden: true,\n ariaChecked: true,\n ariaReadonly: true,\n ariaDisabled: true,\n ariaRequired: true,\n ariaInvalid: true,\n ariaValue: true,\n tabindex: true,\n bindKeydown: true,\n bindRoleForClick: true\n };\n\n /**\n * @ngdoc method\n * @name $ariaProvider#config\n *\n * @param {object} config object to enable/disable specific ARIA attributes\n *\n * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags\n * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags\n * - **ariaReadonly** – `{boolean}` – Enables/disables aria-readonly tags\n * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags\n * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags\n * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags\n * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and\n * aria-valuenow tags\n * - **tabindex** – `{boolean}` – Enables/disables tabindex tags\n * - **bindKeydown** – `{boolean}` – Enables/disables keyboard event binding on non-interactive\n * elements (such as `div` or `li`) using ng-click, making them more accessible to users of\n * assistive technologies\n * - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements (such as\n * `div` or `li`) using ng-click, making them more accessible to users of assistive\n * technologies\n *\n * @description\n * Enables/disables various ARIA attributes\n */\n this.config = function(newConfig) {\n config = angular.extend(config, newConfig);\n };\n\n function watchExpr(attrName, ariaAttr, nativeAriaNodeNames, negate) {\n return function(scope, elem, attr) {\n if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;\n\n var ariaCamelName = attr.$normalize(ariaAttr);\n if (config[ariaCamelName] && !isNodeOneOf(elem, nativeAriaNodeNames) && !attr[ariaCamelName]) {\n scope.$watch(attr[attrName], function(boolVal) {\n // ensure boolean value\n boolVal = negate ? !boolVal : !!boolVal;\n elem.attr(ariaAttr, boolVal);\n });\n }\n };\n }\n /**\n * @ngdoc service\n * @name $aria\n *\n * @description\n *\n * The $aria service contains helper methods for applying common\n * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives.\n *\n * ngAria injects common accessibility attributes that tell assistive technologies when HTML\n * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria,\n * let's review a code snippet from ngAria itself:\n *\n *```js\n * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) {\n * return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nativeAriaNodeNames, false);\n * }])\n *```\n * Shown above, the ngAria module creates a directive with the same signature as the\n * traditional `ng-disabled` directive. But this ngAria version is dedicated to\n * solely managing accessibility attributes on custom elements. The internal `$aria` service is\n * used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the\n * developer, `aria-disabled` is injected as an attribute with its value synchronized to the\n * value in `ngDisabled`.\n *\n * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do\n * anything to enable this feature. The `aria-disabled` attribute is automatically managed\n * simply as a silent side-effect of using `ng-disabled` with the ngAria module.\n *\n * The full list of directives that interface with ngAria:\n * * **ngModel**\n * * **ngChecked**\n * * **ngReadonly**\n * * **ngRequired**\n * * **ngDisabled**\n * * **ngValue**\n * * **ngShow**\n * * **ngHide**\n * * **ngClick**\n * * **ngDblclick**\n * * **ngMessages**\n *\n * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each\n * directive.\n *\n *\n * ## Dependencies\n * Requires the {@link ngAria} module to be installed.\n */\n this.$get = function() {\n return {\n config: function(key) {\n return config[key];\n },\n $$watchExpr: watchExpr\n };\n };\n}\n\n\nngAriaModule.directive('ngShow', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true);\n}])\n.directive('ngHide', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false);\n}])\n.directive('ngValue', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngValue', 'aria-checked', nativeAriaNodeNames, false);\n}])\n.directive('ngChecked', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngChecked', 'aria-checked', nativeAriaNodeNames, false);\n}])\n.directive('ngReadonly', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngReadonly', 'aria-readonly', nativeAriaNodeNames, false);\n}])\n.directive('ngRequired', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngRequired', 'aria-required', nativeAriaNodeNames, false);\n}])\n.directive('ngModel', ['$aria', function($aria) {\n\n function shouldAttachAttr(attr, normalizedAttr, elem, allowNonAriaNodes) {\n return $aria.config(normalizedAttr) &&\n !elem.attr(attr) &&\n (allowNonAriaNodes || !isNodeOneOf(elem, nativeAriaNodeNames)) &&\n (elem.attr('type') !== 'hidden' || elem[0].nodeName !== 'INPUT');\n }\n\n function shouldAttachRole(role, elem) {\n // if element does not have role attribute\n // AND element type is equal to role (if custom element has a type equaling shape) <-- remove?\n // AND element is not in nativeAriaNodeNames\n return !elem.attr('role') && (elem.attr('type') === role) && !isNodeOneOf(elem, nativeAriaNodeNames);\n }\n\n function getShape(attr, elem) {\n var type = attr.type,\n role = attr.role;\n\n return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' :\n ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' :\n (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' : '';\n }\n\n return {\n restrict: 'A',\n require: 'ngModel',\n priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value\n compile: function(elem, attr) {\n if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;\n\n var shape = getShape(attr, elem);\n\n return {\n post: function(scope, elem, attr, ngModel) {\n var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false);\n\n function ngAriaWatchModelValue() {\n return ngModel.$modelValue;\n }\n\n function getRadioReaction(newVal) {\n // Strict comparison would cause a BC\n // eslint-disable-next-line eqeqeq\n var boolVal = (attr.value == ngModel.$viewValue);\n elem.attr('aria-checked', boolVal);\n }\n\n function getCheckboxReaction() {\n elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue));\n }\n\n switch (shape) {\n case 'radio':\n case 'checkbox':\n if (shouldAttachRole(shape, elem)) {\n elem.attr('role', shape);\n }\n if (shouldAttachAttr('aria-checked', 'ariaChecked', elem, false)) {\n scope.$watch(ngAriaWatchModelValue, shape === 'radio' ?\n getRadioReaction : getCheckboxReaction);\n }\n if (needsTabIndex) {\n elem.attr('tabindex', 0);\n }\n break;\n case 'range':\n if (shouldAttachRole(shape, elem)) {\n elem.attr('role', 'slider');\n }\n if ($aria.config('ariaValue')) {\n var needsAriaValuemin = !elem.attr('aria-valuemin') &&\n (attr.hasOwnProperty('min') || attr.hasOwnProperty('ngMin'));\n var needsAriaValuemax = !elem.attr('aria-valuemax') &&\n (attr.hasOwnProperty('max') || attr.hasOwnProperty('ngMax'));\n var needsAriaValuenow = !elem.attr('aria-valuenow');\n\n if (needsAriaValuemin) {\n attr.$observe('min', function ngAriaValueMinReaction(newVal) {\n elem.attr('aria-valuemin', newVal);\n });\n }\n if (needsAriaValuemax) {\n attr.$observe('max', function ngAriaValueMinReaction(newVal) {\n elem.attr('aria-valuemax', newVal);\n });\n }\n if (needsAriaValuenow) {\n scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) {\n elem.attr('aria-valuenow', newVal);\n });\n }\n }\n if (needsTabIndex) {\n elem.attr('tabindex', 0);\n }\n break;\n }\n\n if (!attr.hasOwnProperty('ngRequired') && ngModel.$validators.required\n && shouldAttachAttr('aria-required', 'ariaRequired', elem, false)) {\n // ngModel.$error.required is undefined on custom controls\n attr.$observe('required', function() {\n elem.attr('aria-required', !!attr['required']);\n });\n }\n\n if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem, true)) {\n scope.$watch(function ngAriaInvalidWatch() {\n return ngModel.$invalid;\n }, function ngAriaInvalidReaction(newVal) {\n elem.attr('aria-invalid', !!newVal);\n });\n }\n }\n };\n }\n };\n}])\n.directive('ngDisabled', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nativeAriaNodeNames, false);\n}])\n.directive('ngMessages', function() {\n return {\n restrict: 'A',\n require: '?ngMessages',\n link: function(scope, elem, attr, ngMessages) {\n if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;\n\n if (!elem.attr('aria-live')) {\n elem.attr('aria-live', 'assertive');\n }\n }\n };\n})\n.directive('ngClick',['$aria', '$parse', function($aria, $parse) {\n return {\n restrict: 'A',\n compile: function(elem, attr) {\n if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;\n\n var fn = $parse(attr.ngClick);\n return function(scope, elem, attr) {\n\n if (!isNodeOneOf(elem, nativeAriaNodeNames)) {\n\n if ($aria.config('bindRoleForClick') && !elem.attr('role')) {\n elem.attr('role', 'button');\n }\n\n if ($aria.config('tabindex') && !elem.attr('tabindex')) {\n elem.attr('tabindex', 0);\n }\n\n if ($aria.config('bindKeydown') && !attr.ngKeydown && !attr.ngKeypress && !attr.ngKeyup) {\n elem.on('keydown', function(event) {\n var keyCode = event.which || event.keyCode;\n\n if (keyCode === 13 || keyCode === 32) {\n // If the event is triggered on a non-interactive element ...\n if (nativeAriaNodeNames.indexOf(event.target.nodeName) === -1 && !event.target.isContentEditable) {\n // ... prevent the default browser behavior (e.g. scrolling when pressing spacebar)\n // See https://github.com/angular/angular.js/issues/16664\n event.preventDefault();\n }\n scope.$apply(callback);\n }\n\n function callback() {\n fn(scope, { $event: event });\n }\n });\n }\n }\n };\n }\n };\n}])\n.directive('ngDblclick', ['$aria', function($aria) {\n return function(scope, elem, attr) {\n if (attr.hasOwnProperty(ARIA_DISABLE_ATTR)) return;\n\n if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nativeAriaNodeNames)) {\n elem.attr('tabindex', 0);\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n/*!\n * Angular Material Design\n * https://github.com/angular/material\n * @license MIT\n * v1.0.9\n */\n(function( window, angular, undefined ){\n\"use strict\";\n\n(function(){\n\"use strict\";\n\nangular.module('ngMaterial', [\"ng\",\"ngAnimate\",\"ngAria\",\"material.core\",\"material.core.gestures\",\"material.core.layout\",\"material.core.theming.palette\",\"material.core.theming\",\"material.core.animate\",\"material.components.autocomplete\",\"material.components.backdrop\",\"material.components.bottomSheet\",\"material.components.button\",\"material.components.card\",\"material.components.checkbox\",\"material.components.chips\",\"material.components.content\",\"material.components.datepicker\",\"material.components.dialog\",\"material.components.divider\",\"material.components.fabActions\",\"material.components.fabShared\",\"material.components.fabSpeedDial\",\"material.components.fabToolbar\",\"material.components.fabTrigger\",\"material.components.gridList\",\"material.components.icon\",\"material.components.input\",\"material.components.list\",\"material.components.menu\",\"material.components.menuBar\",\"material.components.panel\",\"material.components.progressCircular\",\"material.components.progressLinear\",\"material.components.radioButton\",\"material.components.select\",\"material.components.showHide\",\"material.components.sidenav\",\"material.components.slider\",\"material.components.sticky\",\"material.components.subheader\",\"material.components.swipe\",\"material.components.switch\",\"material.components.toast\",\"material.components.tabs\",\"material.components.toolbar\",\"material.components.tooltip\",\"material.components.virtualRepeat\",\"material.components.whiteframe\"]);\n})();\n(function(){\n\"use strict\";\n\n/**\n * Initialization function that validates environment\n * requirements.\n */\nangular\n .module('material.core', [\n 'ngAnimate',\n 'material.core.animate',\n 'material.core.layout',\n 'material.core.gestures',\n 'material.core.theming'\n ])\n .config(MdCoreConfigure)\n .run(DetectNgTouch);\n\n\n/**\n * Detect if the ng-Touch module is also being used.\n * Warn if detected.\n * @ngInject\n */\nfunction DetectNgTouch($log, $injector) {\n if ( $injector.has('$swipe') ) {\n var msg = \"\" +\n \"You are using the ngTouch module. \\n\" +\n \"Angular Material already has mobile click, tap, and swipe support... \\n\" +\n \"ngTouch is not supported with Angular Material!\";\n $log.warn(msg);\n }\n}\nDetectNgTouch.$inject = [\"$log\", \"$injector\"];\n\n/**\n * @ngInject\n */\nfunction MdCoreConfigure($provide, $mdThemingProvider) {\n\n $provide.decorator('$$rAF', [\"$delegate\", rAFDecorator]);\n\n $mdThemingProvider.theme('default')\n .primaryPalette('indigo')\n .accentPalette('pink')\n .warnPalette('deep-orange')\n .backgroundPalette('grey');\n}\nMdCoreConfigure.$inject = [\"$provide\", \"$mdThemingProvider\"];\n\n/**\n * @ngInject\n */\nfunction rAFDecorator($delegate) {\n /**\n * Use this to throttle events that come in often.\n * The throttled function will always use the *last* invocation before the\n * coming frame.\n *\n * For example, window resize events that fire many times a second:\n * If we set to use an raf-throttled callback on window resize, then\n * our callback will only be fired once per frame, with the last resize\n * event that happened before that frame.\n *\n * @param {function} callback function to debounce\n */\n $delegate.throttle = function(cb) {\n var queuedArgs, alreadyQueued, queueCb, context;\n return function debounced() {\n queuedArgs = arguments;\n context = this;\n queueCb = cb;\n if (!alreadyQueued) {\n alreadyQueued = true;\n $delegate(function() {\n queueCb.apply(context, Array.prototype.slice.call(queuedArgs));\n alreadyQueued = false;\n });\n }\n };\n };\n return $delegate;\n}\nrAFDecorator.$inject = [\"$delegate\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n .directive('mdAutofocus', MdAutofocusDirective)\n\n // Support the deprecated md-auto-focus and md-sidenav-focus as well\n .directive('mdAutoFocus', MdAutofocusDirective)\n .directive('mdSidenavFocus', MdAutofocusDirective);\n\n/**\n * @ngdoc directive\n * @name mdAutofocus\n * @module material.core.util\n *\n * @description\n *\n * `[md-autofocus]` provides an optional way to identify the focused element when a `$mdDialog`,\n * `$mdBottomSheet`, or `$mdSidenav` opens or upon page load for input-like elements.\n *\n * When one of these opens, it will find the first nested element with the `[md-autofocus]`\n * attribute directive and optional expression. An expression may be specified as the directive\n * value to enable conditional activation of the autofocus.\n *\n * @usage\n *\n * ### Dialog\n * <hljs lang=\"html\">\n * <md-dialog>\n * <form>\n * <md-input-container>\n * <label for=\"testInput\">Label</label>\n * <input id=\"testInput\" type=\"text\" md-autofocus>\n * </md-input-container>\n * </form>\n * </md-dialog>\n * </hljs>\n *\n * ### Bottomsheet\n * <hljs lang=\"html\">\n * <md-bottom-sheet class=\"md-list md-has-header\">\n * <md-subheader>Comment Actions</md-subheader>\n * <md-list>\n * <md-list-item ng-repeat=\"item in items\">\n *\n * <md-button md-autofocus=\"$index == 2\">\n * <md-icon md-svg-src=\"{{item.icon}}\"></md-icon>\n * <span class=\"md-inline-list-icon-label\">{{ item.name }}</span>\n * </md-button>\n *\n * </md-list-item>\n * </md-list>\n * </md-bottom-sheet>\n * </hljs>\n *\n * ### Autocomplete\n * <hljs lang=\"html\">\n * <md-autocomplete\n * md-autofocus\n * md-selected-item=\"selectedItem\"\n * md-search-text=\"searchText\"\n * md-items=\"item in getMatches(searchText)\"\n * md-item-text=\"item.display\">\n * <span md-highlight-text=\"searchText\">{{item.display}}</span>\n * </md-autocomplete>\n * </hljs>\n *\n * ### Sidenav\n * <hljs lang=\"html\">\n * <div layout=\"row\" ng-controller=\"MyController\">\n * <md-sidenav md-component-id=\"left\" class=\"md-sidenav-left\">\n * Left Nav!\n * </md-sidenav>\n *\n * <md-content>\n * Center Content\n * <md-button ng-click=\"openLeftMenu()\">\n * Open Left Menu\n * </md-button>\n * </md-content>\n *\n * <md-sidenav md-component-id=\"right\"\n * md-is-locked-open=\"$mdMedia('min-width: 333px')\"\n * class=\"md-sidenav-right\">\n * <form>\n * <md-input-container>\n * <label for=\"testInput\">Test input</label>\n * <input id=\"testInput\" type=\"text\"\n * ng-model=\"data\" md-autofocus>\n * </md-input-container>\n * </form>\n * </md-sidenav>\n * </div>\n * </hljs>\n **/\nfunction MdAutofocusDirective() {\n return {\n restrict: 'A',\n\n link: postLink\n }\n}\n\nfunction postLink(scope, element, attrs) {\n var attr = attrs.mdAutoFocus || attrs.mdAutofocus || attrs.mdSidenavFocus;\n\n // Setup a watcher on the proper attribute to update a class we can check for in $mdUtil\n scope.$watch(attr, function(canAutofocus) {\n element.toggleClass('md-autofocus', canAutofocus);\n });\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n.factory('$mdConstant', MdConstantFactory);\n\n/**\n * Factory function that creates the grab-bag $mdConstant service.\n * @ngInject\n */\nfunction MdConstantFactory($sniffer) {\n\n var webkit = /webkit/i.test($sniffer.vendorPrefix);\n function vendorProperty(name) {\n return webkit ? ('webkit' + name.charAt(0).toUpperCase() + name.substring(1)) : name;\n }\n\n return {\n KEY_CODE: {\n COMMA: 188,\n SEMICOLON : 186,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n LEFT_ARROW : 37,\n UP_ARROW : 38,\n RIGHT_ARROW : 39,\n DOWN_ARROW : 40,\n TAB : 9,\n BACKSPACE: 8,\n DELETE: 46\n },\n CSS: {\n /* Constants */\n TRANSITIONEND: 'transitionend' + (webkit ? ' webkitTransitionEnd' : ''),\n ANIMATIONEND: 'animationend' + (webkit ? ' webkitAnimationEnd' : ''),\n\n TRANSFORM: vendorProperty('transform'),\n TRANSFORM_ORIGIN: vendorProperty('transformOrigin'),\n TRANSITION: vendorProperty('transition'),\n TRANSITION_DURATION: vendorProperty('transitionDuration'),\n ANIMATION_PLAY_STATE: vendorProperty('animationPlayState'),\n ANIMATION_DURATION: vendorProperty('animationDuration'),\n ANIMATION_NAME: vendorProperty('animationName'),\n ANIMATION_TIMING: vendorProperty('animationTimingFunction'),\n ANIMATION_DIRECTION: vendorProperty('animationDirection')\n },\n /**\n * As defined in core/style/variables.scss\n *\n * $layout-breakpoint-xs: 600px !default;\n * $layout-breakpoint-sm: 960px !default;\n * $layout-breakpoint-md: 1280px !default;\n * $layout-breakpoint-lg: 1920px !default;\n *\n */\n MEDIA: {\n 'xs' : '(max-width: 599px)' ,\n 'gt-xs' : '(min-width: 600px)' ,\n 'sm' : '(min-width: 600px) and (max-width: 959px)' ,\n 'gt-sm' : '(min-width: 960px)' ,\n 'md' : '(min-width: 960px) and (max-width: 1279px)' ,\n 'gt-md' : '(min-width: 1280px)' ,\n 'lg' : '(min-width: 1280px) and (max-width: 1919px)',\n 'gt-lg' : '(min-width: 1920px)' ,\n 'xl' : '(min-width: 1920px)' ,\n 'print' : 'print'\n },\n MEDIA_PRIORITY: [\n 'xl',\n 'gt-lg',\n 'lg',\n 'gt-md',\n 'md',\n 'gt-sm',\n 'sm',\n 'gt-xs',\n 'xs',\n 'print'\n ]\n };\n}\nMdConstantFactory.$inject = [\"$sniffer\"];\n\n})();\n(function(){\n\"use strict\";\n\n angular\n .module('material.core')\n .config( [\"$provide\", function($provide){\n $provide.decorator('$mdUtil', ['$delegate', function ($delegate){\n /**\n * Inject the iterator facade to easily support iteration and accessors\n * @see iterator below\n */\n $delegate.iterator = MdIterator;\n\n return $delegate;\n }\n ]);\n }]);\n\n /**\n * iterator is a list facade to easily support iteration and accessors\n *\n * @param items Array list which this iterator will enumerate\n * @param reloop Boolean enables iterator to consider the list as an endless reloop\n */\n function MdIterator(items, reloop) {\n var trueFn = function() { return true; };\n\n if (items && !angular.isArray(items)) {\n items = Array.prototype.slice.call(items);\n }\n\n reloop = !!reloop;\n var _items = items || [ ];\n\n // Published API\n return {\n items: getItems,\n count: count,\n\n inRange: inRange,\n contains: contains,\n indexOf: indexOf,\n itemAt: itemAt,\n\n findBy: findBy,\n\n add: add,\n remove: remove,\n\n first: first,\n last: last,\n next: angular.bind(null, findSubsequentItem, false),\n previous: angular.bind(null, findSubsequentItem, true),\n\n hasPrevious: hasPrevious,\n hasNext: hasNext\n\n };\n\n /**\n * Publish copy of the enumerable set\n * @returns {Array|*}\n */\n function getItems() {\n return [].concat(_items);\n }\n\n /**\n * Determine length of the list\n * @returns {Array.length|*|number}\n */\n function count() {\n return _items.length;\n }\n\n /**\n * Is the index specified valid\n * @param index\n * @returns {Array.length|*|number|boolean}\n */\n function inRange(index) {\n return _items.length && ( index > -1 ) && (index < _items.length );\n }\n\n /**\n * Can the iterator proceed to the next item in the list; relative to\n * the specified item.\n *\n * @param item\n * @returns {Array.length|*|number|boolean}\n */\n function hasNext(item) {\n return item ? inRange(indexOf(item) + 1) : false;\n }\n\n /**\n * Can the iterator proceed to the previous item in the list; relative to\n * the specified item.\n *\n * @param item\n * @returns {Array.length|*|number|boolean}\n */\n function hasPrevious(item) {\n return item ? inRange(indexOf(item) - 1) : false;\n }\n\n /**\n * Get item at specified index/position\n * @param index\n * @returns {*}\n */\n function itemAt(index) {\n return inRange(index) ? _items[index] : null;\n }\n\n /**\n * Find all elements matching the key/value pair\n * otherwise return null\n *\n * @param val\n * @param key\n *\n * @return array\n */\n function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }\n\n /**\n * Add item to list\n * @param item\n * @param index\n * @returns {*}\n */\n function add(item, index) {\n if ( !item ) return -1;\n\n if (!angular.isNumber(index)) {\n index = _items.length;\n }\n\n _items.splice(index, 0, item);\n\n return indexOf(item);\n }\n\n /**\n * Remove item from list...\n * @param item\n */\n function remove(item) {\n if ( contains(item) ){\n _items.splice(indexOf(item), 1);\n }\n }\n\n /**\n * Get the zero-based index of the target item\n * @param item\n * @returns {*}\n */\n function indexOf(item) {\n return _items.indexOf(item);\n }\n\n /**\n * Boolean existence check\n * @param item\n * @returns {boolean}\n */\n function contains(item) {\n return item && (indexOf(item) > -1);\n }\n\n /**\n * Return first item in the list\n * @returns {*}\n */\n function first() {\n return _items.length ? _items[0] : null;\n }\n\n /**\n * Return last item in the list...\n * @returns {*}\n */\n function last() {\n return _items.length ? _items[_items.length - 1] : null;\n }\n\n /**\n * Find the next item. If reloop is true and at the end of the list, it will go back to the\n * first item. If given, the `validate` callback will be used to determine whether the next item\n * is valid. If not valid, it will try to find the next item again.\n *\n * @param {boolean} backwards Specifies the direction of searching (forwards/backwards)\n * @param {*} item The item whose subsequent item we are looking for\n * @param {Function=} validate The `validate` function\n * @param {integer=} limit The recursion limit\n *\n * @returns {*} The subsequent item or null\n */\n function findSubsequentItem(backwards, item, validate, limit) {\n validate = validate || trueFn;\n\n var curIndex = indexOf(item);\n while (true) {\n if (!inRange(curIndex)) return null;\n\n var nextIndex = curIndex + (backwards ? -1 : 1);\n var foundItem = null;\n if (inRange(nextIndex)) {\n foundItem = _items[nextIndex];\n } else if (reloop) {\n foundItem = backwards ? last() : first();\n nextIndex = indexOf(foundItem);\n }\n\n if ((foundItem === null) || (nextIndex === limit)) return null;\n if (validate(foundItem)) return foundItem;\n\n if (angular.isUndefined(limit)) limit = nextIndex;\n\n curIndex = nextIndex;\n }\n }\n }\n\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n.factory('$mdMedia', mdMediaFactory);\n\n/**\n * @ngdoc service\n * @name $mdMedia\n * @module material.core\n *\n * @description\n * `$mdMedia` is used to evaluate whether a given media query is true or false given the\n * current device's screen / window size. The media query will be re-evaluated on resize, allowing\n * you to register a watch.\n *\n * `$mdMedia` also has pre-programmed support for media queries that match the layout breakpoints:\n *\n * <table class=\"md-api-table\">\n * <thead>\n * <tr>\n * <th>Breakpoint</th>\n * <th>mediaQuery</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>xs</td>\n * <td>(max-width: 599px)</td>\n * </tr>\n * <tr>\n * <td>gt-xs</td>\n * <td>(min-width: 600px)</td>\n * </tr>\n * <tr>\n * <td>sm</td>\n * <td>(min-width: 600px) and (max-width: 959px)</td>\n * </tr>\n * <tr>\n * <td>gt-sm</td>\n * <td>(min-width: 960px)</td>\n * </tr>\n * <tr>\n * <td>md</td>\n * <td>(min-width: 960px) and (max-width: 1279px)</td>\n * </tr>\n * <tr>\n * <td>gt-md</td>\n * <td>(min-width: 1280px)</td>\n * </tr>\n * <tr>\n * <td>lg</td>\n * <td>(min-width: 1280px) and (max-width: 1919px)</td>\n * </tr>\n * <tr>\n * <td>gt-lg</td>\n * <td>(min-width: 1920px)</td>\n * </tr>\n * <tr>\n * <td>xl</td>\n * <td>(min-width: 1920px)</td>\n * </tr>\n * <tr>\n * <td>print</td>\n * <td>print</td>\n * </tr>\n * </tbody>\n * </table>\n *\n * See Material Design's <a href=\"https://www.google.com/design/spec/layout/adaptive-ui.html\">Layout - Adaptive UI</a> for more details.\n *\n * <a href=\"https://www.google.com/design/spec/layout/adaptive-ui.html\">\n * <img src=\"https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B8olV15J7abPSGFxemFiQVRtb1k/layout_adaptive_breakpoints_01.png\" width=\"100%\" height=\"100%\"></img>\n * </a>\n *\n * @returns {boolean} a boolean representing whether or not the given media query is true or false.\n *\n * @usage\n * <hljs lang=\"js\">\n * app.controller('MyController', function($mdMedia, $scope) {\n * $scope.$watch(function() { return $mdMedia('lg'); }, function(big) {\n * $scope.bigScreen = big;\n * });\n *\n * $scope.screenIsSmall = $mdMedia('sm');\n * $scope.customQuery = $mdMedia('(min-width: 1234px)');\n * $scope.anotherCustom = $mdMedia('max-width: 300px');\n * });\n * </hljs>\n * @ngInject\n */\n\nfunction mdMediaFactory($mdConstant, $rootScope, $window) {\n var queries = {};\n var mqls = {};\n var results = {};\n var normalizeCache = {};\n\n $mdMedia.getResponsiveAttribute = getResponsiveAttribute;\n $mdMedia.getQuery = getQuery;\n $mdMedia.watchResponsiveAttributes = watchResponsiveAttributes;\n\n return $mdMedia;\n\n function $mdMedia(query) {\n var validated = queries[query];\n if (angular.isUndefined(validated)) {\n validated = queries[query] = validate(query);\n }\n\n var result = results[validated];\n if (angular.isUndefined(result)) {\n result = add(validated);\n }\n\n return result;\n }\n\n function validate(query) {\n return $mdConstant.MEDIA[query] ||\n ((query.charAt(0) !== '(') ? ('(' + query + ')') : query);\n }\n\n function add(query) {\n var result = mqls[query];\n if ( !result ) {\n result = mqls[query] = $window.matchMedia(query);\n }\n\n result.addListener(onQueryChange);\n return (results[result.media] = !!result.matches);\n }\n\n function onQueryChange(query) {\n $rootScope.$evalAsync(function() {\n results[query.media] = !!query.matches;\n });\n }\n\n function getQuery(name) {\n return mqls[name];\n }\n\n function getResponsiveAttribute(attrs, attrName) {\n for (var i = 0; i < $mdConstant.MEDIA_PRIORITY.length; i++) {\n var mediaName = $mdConstant.MEDIA_PRIORITY[i];\n if (!mqls[queries[mediaName]].matches) {\n continue;\n }\n\n var normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName);\n if (attrs[normalizedName]) {\n return attrs[normalizedName];\n }\n }\n\n // fallback on unprefixed\n return attrs[getNormalizedName(attrs, attrName)];\n }\n\n function watchResponsiveAttributes(attrNames, attrs, watchFn) {\n var unwatchFns = [];\n attrNames.forEach(function(attrName) {\n var normalizedName = getNormalizedName(attrs, attrName);\n if (angular.isDefined(attrs[normalizedName])) {\n unwatchFns.push(\n attrs.$observe(normalizedName, angular.bind(void 0, watchFn, null)));\n }\n\n for (var mediaName in $mdConstant.MEDIA) {\n normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName);\n if (angular.isDefined(attrs[normalizedName])) {\n unwatchFns.push(\n attrs.$observe(normalizedName, angular.bind(void 0, watchFn, mediaName)));\n }\n }\n });\n\n return function unwatch() {\n unwatchFns.forEach(function(fn) { fn(); })\n };\n }\n\n // Improves performance dramatically\n function getNormalizedName(attrs, attrName) {\n return normalizeCache[attrName] ||\n (normalizeCache[attrName] = attrs.$normalize(attrName));\n }\n}\nmdMediaFactory.$inject = [\"$mdConstant\", \"$rootScope\", \"$window\"];\n\n})();\n(function(){\n\"use strict\";\n\n/*\n * This var has to be outside the angular factory, otherwise when\n * there are multiple material apps on the same page, each app\n * will create its own instance of this array and the app's IDs\n * will not be unique.\n */\nvar nextUniqueId = 0;\n\n/**\n * @ngdoc module\n * @name material.core.util\n * @description\n * Util\n */\nangular\n .module('material.core')\n .factory('$mdUtil', UtilFactory);\n\n/**\n * @ngInject\n */\nfunction UtilFactory($document, $timeout, $compile, $rootScope, $$mdAnimate, $interpolate, $log, $rootElement, $window) {\n // Setup some core variables for the processTemplate method\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n usesStandardSymbols = ((startSymbol === '{{') && (endSymbol === '}}'));\n\n /**\n * Checks if the target element has the requested style by key\n * @param {DOMElement|JQLite} target Target element\n * @param {string} key Style key\n * @param {string=} expectedVal Optional expected value\n * @returns {boolean} Whether the target element has the style or not\n */\n var hasComputedStyle = function (target, key, expectedVal) {\n var hasValue = false;\n\n if ( target && target.length ) {\n var computedStyles = $window.getComputedStyle(target[0]);\n hasValue = angular.isDefined(computedStyles[key]) && (expectedVal ? computedStyles[key] == expectedVal : true);\n }\n\n return hasValue;\n };\n\n var $mdUtil = {\n dom: {},\n now: window.performance ?\n angular.bind(window.performance, window.performance.now) : Date.now || function() {\n return new Date().getTime();\n },\n\n clientRect: function(element, offsetParent, isOffsetRect) {\n var node = getNode(element);\n offsetParent = getNode(offsetParent || node.offsetParent || document.body);\n var nodeRect = node.getBoundingClientRect();\n\n // The user can ask for an offsetRect: a rect relative to the offsetParent,\n // or a clientRect: a rect relative to the page\n var offsetRect = isOffsetRect ?\n offsetParent.getBoundingClientRect() :\n {left: 0, top: 0, width: 0, height: 0};\n return {\n left: nodeRect.left - offsetRect.left,\n top: nodeRect.top - offsetRect.top,\n width: nodeRect.width,\n height: nodeRect.height\n };\n },\n offsetRect: function(element, offsetParent) {\n return $mdUtil.clientRect(element, offsetParent, true);\n },\n\n // Annoying method to copy nodes to an array, thanks to IE\n nodesToArray: function(nodes) {\n nodes = nodes || [];\n\n var results = [];\n for (var i = 0; i < nodes.length; ++i) {\n results.push(nodes.item(i));\n }\n return results;\n },\n\n /**\n * Calculate the positive scroll offset\n * TODO: Check with pinch-zoom in IE/Chrome;\n * https://code.google.com/p/chromium/issues/detail?id=496285\n */\n scrollTop: function(element) {\n element = angular.element(element || $document[0].body);\n\n var body = (element[0] == $document[0].body) ? $document[0].body : undefined;\n var scrollTop = body ? body.scrollTop + body.parentElement.scrollTop : 0;\n\n // Calculate the positive scroll offset\n return scrollTop || Math.abs(element[0].getBoundingClientRect().top);\n },\n\n /**\n * Finds the proper focus target by searching the DOM.\n *\n * @param containerEl\n * @param attributeVal\n * @returns {*}\n */\n findFocusTarget: function(containerEl, attributeVal) {\n var AUTO_FOCUS = '[md-autofocus]';\n var elToFocus;\n\n elToFocus = scanForFocusable(containerEl, attributeVal || AUTO_FOCUS);\n\n if ( !elToFocus && attributeVal != AUTO_FOCUS) {\n // Scan for deprecated attribute\n elToFocus = scanForFocusable(containerEl, '[md-auto-focus]');\n\n if ( !elToFocus ) {\n // Scan for fallback to 'universal' API\n elToFocus = scanForFocusable(containerEl, AUTO_FOCUS);\n }\n }\n\n return elToFocus;\n\n /**\n * Can target and nested children for specified Selector (attribute)\n * whose value may be an expression that evaluates to True/False.\n */\n function scanForFocusable(target, selector) {\n var elFound, items = target[0].querySelectorAll(selector);\n\n // Find the last child element with the focus attribute\n if ( items && items.length ){\n items.length && angular.forEach(items, function(it) {\n it = angular.element(it);\n\n // Check the element for the md-autofocus class to ensure any associated expression\n // evaluated to true.\n var isFocusable = it.hasClass('md-autofocus');\n if (isFocusable) elFound = it;\n });\n }\n return elFound;\n }\n },\n\n /**\n * Disables scroll around the passed parent element.\n * @param element Unused\n * @param {!Element|!angular.JQLite} parent Element to disable scrolling within.\n * Defaults to body if none supplied.\n */\n disableScrollAround: function(element, parent) {\n $mdUtil.disableScrollAround._count = $mdUtil.disableScrollAround._count || 0;\n ++$mdUtil.disableScrollAround._count;\n if ($mdUtil.disableScrollAround._enableScrolling) return $mdUtil.disableScrollAround._enableScrolling;\n var body = $document[0].body,\n restoreBody = disableBodyScroll(),\n restoreElement = disableElementScroll(parent);\n\n return $mdUtil.disableScrollAround._enableScrolling = function() {\n if (!--$mdUtil.disableScrollAround._count) {\n restoreBody();\n restoreElement();\n delete $mdUtil.disableScrollAround._enableScrolling;\n }\n };\n\n // Creates a virtual scrolling mask to absorb touchmove, keyboard, scrollbar clicking, and wheel events\n function disableElementScroll(element) {\n element = angular.element(element || body)[0];\n var zIndex = 50;\n var scrollMask = angular.element(\n '<div class=\"md-scroll-mask\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>').css('z-index', zIndex);\n element.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }\n\n // Converts the body to a position fixed block and translate it to the proper scroll\n // position\n function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.style.cssText || '';\n var restoreBodyStyle = body.style.cssText || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight + 1) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.style.cssText = restoreBodyStyle;\n htmlNode.style.cssText = restoreHtmlStyle;\n body.scrollTop = scrollOffset;\n htmlNode.scrollTop = scrollOffset;\n };\n }\n\n function applyStyles(el, styles) {\n for (var key in styles) {\n el.style[key] = styles[key];\n }\n }\n },\n enableScrolling: function() {\n var method = this.disableScrollAround._enableScrolling;\n method && method();\n },\n floatingScrollbars: function() {\n if (this.floatingScrollbars.cached === undefined) {\n var tempNode = angular.element('<div><div></div></div>').css({\n width: '100%',\n 'z-index': -1,\n position: 'absolute',\n height: '35px',\n 'overflow-y': 'scroll'\n });\n tempNode.children().css('height', '60px');\n\n $document[0].body.appendChild(tempNode[0]);\n this.floatingScrollbars.cached = (tempNode[0].offsetWidth == tempNode[0].childNodes[0].offsetWidth);\n tempNode.remove();\n }\n return this.floatingScrollbars.cached;\n },\n\n // Mobile safari only allows you to set focus in click event listeners...\n forceFocus: function(element) {\n var node = element[0] || element;\n\n document.addEventListener('click', function focusOnClick(ev) {\n if (ev.target === node && ev.$focus) {\n node.focus();\n ev.stopImmediatePropagation();\n ev.preventDefault();\n node.removeEventListener('click', focusOnClick);\n }\n }, true);\n\n var newEvent = document.createEvent('MouseEvents');\n newEvent.initMouseEvent('click', false, true, window, {}, 0, 0, 0, 0,\n false, false, false, false, 0, null);\n newEvent.$material = true;\n newEvent.$focus = true;\n node.dispatchEvent(newEvent);\n },\n\n /**\n * facade to build md-backdrop element with desired styles\n * NOTE: Use $compile to trigger backdrop postLink function\n */\n createBackdrop: function(scope, addClass) {\n return $compile($mdUtil.supplant('<md-backdrop class=\"{0}\">', [addClass]))(scope);\n },\n\n /**\n * supplant() method from Crockford's `Remedial Javascript`\n * Equivalent to use of $interpolate; without dependency on\n * interpolation symbols and scope. Note: the '{<token>}' can\n * be property names, property chains, or array indices.\n */\n supplant: function(template, values, pattern) {\n pattern = pattern || /\\{([^\\{\\}]*)\\}/g;\n return template.replace(pattern, function(a, b) {\n var p = b.split('.'),\n r = values;\n try {\n for (var s in p) {\n if (p.hasOwnProperty(s) ) {\n r = r[p[s]];\n }\n }\n } catch (e) {\n r = a;\n }\n return (typeof r === 'string' || typeof r === 'number') ? r : a;\n });\n },\n\n fakeNgModel: function() {\n return {\n $fake: true,\n $setTouched: angular.noop,\n $setViewValue: function(value) {\n this.$viewValue = value;\n this.$render(value);\n this.$viewChangeListeners.forEach(function(cb) {\n cb();\n });\n },\n $isEmpty: function(value) {\n return ('' + value).length === 0;\n },\n $parsers: [],\n $formatters: [],\n $viewChangeListeners: [],\n $render: angular.noop\n };\n },\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds.\n // @param wait Integer value of msecs to delay (since last debounce reset); default value 10 msecs\n // @param invokeApply should the $timeout trigger $digest() dirty checking\n debounce: function(func, wait, scope, invokeApply) {\n var timer;\n\n return function debounced() {\n var context = scope,\n args = Array.prototype.slice.call(arguments);\n\n $timeout.cancel(timer);\n timer = $timeout(function() {\n\n timer = undefined;\n func.apply(context, args);\n\n }, wait || 10, invokeApply);\n };\n },\n\n // Returns a function that can only be triggered every `delay` milliseconds.\n // In other words, the function will not be called unless it has been more\n // than `delay` milliseconds since the last call.\n throttle: function throttle(func, delay) {\n var recent;\n return function throttled() {\n var context = this;\n var args = arguments;\n var now = $mdUtil.now();\n\n if (!recent || (now - recent > delay)) {\n func.apply(context, args);\n recent = now;\n }\n };\n },\n\n /**\n * Measures the number of milliseconds taken to run the provided callback\n * function. Uses a high-precision timer if available.\n */\n time: function time(cb) {\n var start = $mdUtil.now();\n cb();\n return $mdUtil.now() - start;\n },\n\n /**\n * Create an implicit getter that caches its `getter()`\n * lookup value\n */\n valueOnUse : function (scope, key, getter) {\n var value = null, args = Array.prototype.slice.call(arguments);\n var params = (args.length > 3) ? args.slice(3) : [ ];\n\n Object.defineProperty(scope, key, {\n get: function () {\n if (value === null) value = getter.apply(scope, params);\n return value;\n }\n });\n },\n\n /**\n * Get a unique ID.\n *\n * @returns {string} an unique numeric string\n */\n nextUid: function() {\n return '' + nextUniqueId++;\n },\n\n // Stop watchers and events from firing on a scope without destroying it,\n // by disconnecting it from its parent and its siblings' linked lists.\n disconnectScope: function disconnectScope(scope) {\n if (!scope) return;\n\n // we can't destroy the root scope or a scope that has been already destroyed\n if (scope.$root === scope) return;\n if (scope.$$destroyed) return;\n\n var parent = scope.$parent;\n scope.$$disconnected = true;\n\n // See Scope.$destroy\n if (parent.$$childHead === scope) parent.$$childHead = scope.$$nextSibling;\n if (parent.$$childTail === scope) parent.$$childTail = scope.$$prevSibling;\n if (scope.$$prevSibling) scope.$$prevSibling.$$nextSibling = scope.$$nextSibling;\n if (scope.$$nextSibling) scope.$$nextSibling.$$prevSibling = scope.$$prevSibling;\n\n scope.$$nextSibling = scope.$$prevSibling = null;\n\n },\n\n // Undo the effects of disconnectScope above.\n reconnectScope: function reconnectScope(scope) {\n if (!scope) return;\n\n // we can't disconnect the root node or scope already disconnected\n if (scope.$root === scope) return;\n if (!scope.$$disconnected) return;\n\n var child = scope;\n\n var parent = child.$parent;\n child.$$disconnected = false;\n // See Scope.$new for this logic...\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n },\n\n /*\n * getClosest replicates jQuery.closest() to walk up the DOM tree until it finds a matching nodeName\n *\n * @param el Element to start walking the DOM from\n * @param tagName Tag name to find closest to el, such as 'form'\n * @param onlyParent Only start checking from the parent element, not `el`.\n */\n getClosest: function getClosest(el, tagName, onlyParent) {\n if (el instanceof angular.element) el = el[0];\n tagName = tagName.toUpperCase();\n if (onlyParent) el = el.parentNode;\n if (!el) return null;\n do {\n if (el.nodeName === tagName) {\n return el;\n }\n } while (el = el.parentNode);\n return null;\n },\n\n /**\n * Build polyfill for the Node.contains feature (if needed)\n */\n elementContains: function(node, child) {\n var hasContains = (window.Node && window.Node.prototype && Node.prototype.contains);\n var findFn = hasContains ? angular.bind(node, node.contains) : angular.bind(node, function(arg) {\n // compares the positions of two nodes and returns a bitmask\n return (node === child) || !!(this.compareDocumentPosition(arg) & 16)\n });\n\n return findFn(child);\n },\n\n /**\n * Functional equivalent for $element.filter(‘md-bottom-sheet’)\n * useful with interimElements where the element and its container are important...\n *\n * @param {[]} elements to scan\n * @param {string} name of node to find (e.g. 'md-dialog')\n * @param {boolean=} optional flag to allow deep scans; defaults to 'false'.\n * @param {boolean=} optional flag to enable log warnings; defaults to false\n */\n extractElementByName: function(element, nodeName, scanDeep, warnNotFound) {\n var found = scanTree(element);\n if (!found && !!warnNotFound) {\n $log.warn( $mdUtil.supplant(\"Unable to find node '{0}' in element '{1}'.\",[nodeName, element[0].outerHTML]) );\n }\n\n return angular.element(found || element);\n\n /**\n * Breadth-First tree scan for element with matching `nodeName`\n */\n function scanTree(element) {\n return scanLevel(element) || (!!scanDeep ? scanChildren(element) : null);\n }\n\n /**\n * Case-insensitive scan of current elements only (do not descend).\n */\n function scanLevel(element) {\n if ( element ) {\n for (var i = 0, len = element.length; i < len; i++) {\n if (element[i].nodeName.toLowerCase() === nodeName) {\n return element[i];\n }\n }\n }\n return null;\n }\n\n /**\n * Scan children of specified node\n */\n function scanChildren(element) {\n var found;\n if ( element ) {\n for (var i = 0, len = element.length; i < len; i++) {\n var target = element[i];\n if ( !found ) {\n for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {\n found = found || scanTree([target.childNodes[j]]);\n }\n }\n }\n }\n return found;\n }\n\n },\n\n /**\n * Give optional properties with no value a boolean true if attr provided or false otherwise\n */\n initOptionalProperties: function(scope, attr, defaults) {\n defaults = defaults || {};\n angular.forEach(scope.$$isolateBindings, function(binding, key) {\n if (binding.optional && angular.isUndefined(scope[key])) {\n var attrIsDefined = angular.isDefined(attr[binding.attrName]);\n scope[key] = angular.isDefined(defaults[key]) ? defaults[key] : attrIsDefined;\n }\n });\n },\n\n /**\n * Alternative to $timeout calls with 0 delay.\n * nextTick() coalesces all calls within a single frame\n * to minimize $digest thrashing\n *\n * @param callback\n * @param digest\n * @returns {*}\n */\n nextTick: function(callback, digest, scope) {\n //-- grab function reference for storing state details\n var nextTick = $mdUtil.nextTick;\n var timeout = nextTick.timeout;\n var queue = nextTick.queue || [];\n\n //-- add callback to the queue\n queue.push(callback);\n\n //-- set default value for digest\n if (digest == null) digest = true;\n\n //-- store updated digest/queue values\n nextTick.digest = nextTick.digest || digest;\n nextTick.queue = queue;\n\n //-- either return existing timeout or create a new one\n return timeout || (nextTick.timeout = $timeout(processQueue, 0, false));\n\n /**\n * Grab a copy of the current queue\n * Clear the queue for future use\n * Process the existing queue\n * Trigger digest if necessary\n */\n function processQueue() {\n var skip = scope && scope.$$destroyed;\n var queue = !skip ? nextTick.queue : [];\n var digest = !skip ? nextTick.digest : null;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function(callback) {\n callback();\n });\n\n if (digest) $rootScope.$digest();\n }\n },\n\n /**\n * Processes a template and replaces the start/end symbols if the application has\n * overriden them.\n *\n * @param template The template to process whose start/end tags may be replaced.\n * @returns {*}\n */\n processTemplate: function(template) {\n if (usesStandardSymbols) {\n return template;\n } else {\n if (!template || !angular.isString(template)) return template;\n return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n }\n },\n\n /**\n * Scan up dom hierarchy for enabled parent;\n */\n getParentWithPointerEvents: function (element) {\n var parent = element.parent();\n\n // jqLite might return a non-null, but still empty, parent; so check for parent and length\n while (hasComputedStyle(parent, 'pointer-events', 'none')) {\n parent = parent.parent();\n }\n\n return parent;\n },\n\n getNearestContentElement: function (element) {\n var current = element.parent()[0];\n // Look for the nearest parent md-content, stopping at the rootElement.\n while (current && current !== $rootElement[0] && current !== document.body && current.nodeName.toUpperCase() !== 'MD-CONTENT') {\n current = current.parentNode;\n }\n return current;\n },\n\n /**\n * Parses an attribute value, mostly a string.\n * By default checks for negated values and returns `false´ if present.\n * Negated values are: (native falsy) and negative strings like:\n * `false` or `0`.\n * @param value Attribute value which should be parsed.\n * @param negatedCheck When set to false, won't check for negated values.\n * @returns {boolean}\n */\n parseAttributeBoolean: function(value, negatedCheck) {\n return value === '' || !!value && (negatedCheck === false || value !== 'false' && value !== '0');\n },\n\n hasComputedStyle: hasComputedStyle\n };\n\n// Instantiate other namespace utility methods\n\n $mdUtil.dom.animator = $$mdAnimate($mdUtil);\n\n return $mdUtil;\n\n function getNode(el) {\n return el[0] || el;\n }\n\n}\nUtilFactory.$inject = [\"$document\", \"$timeout\", \"$compile\", \"$rootScope\", \"$$mdAnimate\", \"$interpolate\", \"$log\", \"$rootElement\", \"$window\"];\n\n/*\n * Since removing jQuery from the demos, some code that uses `element.focus()` is broken.\n * We need to add `element.focus()`, because it's testable unlike `element[0].focus`.\n */\n\nangular.element.prototype.focus = angular.element.prototype.focus || function() {\n if (this.length) {\n this[0].focus();\n }\n return this;\n };\nangular.element.prototype.blur = angular.element.prototype.blur || function() {\n if (this.length) {\n this[0].blur();\n }\n return this;\n };\n\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.core')\n .service('$mdCompiler', mdCompilerService);\n\nfunction mdCompilerService($q, $http, $injector, $compile, $controller, $templateCache) {\n /* jshint validthis: true */\n\n /*\n * @ngdoc service\n * @name $mdCompiler\n * @module material.core\n * @description\n * The $mdCompiler service is an abstraction of angular's compiler, that allows the developer\n * to easily compile an element with a templateUrl, controller, and locals.\n *\n * @usage\n * <hljs lang=\"js\">\n * $mdCompiler.compile({\n * templateUrl: 'modal.html',\n * controller: 'ModalCtrl',\n * locals: {\n * modal: myModalInstance;\n * }\n * }).then(function(compileData) {\n * compileData.element; // modal.html's template in an element\n * compileData.link(myScope); //attach controller & scope to element\n * });\n * </hljs>\n */\n\n /*\n * @ngdoc method\n * @name $mdCompiler#compile\n * @description A helper to compile an HTML template/templateUrl with a given controller,\n * locals, and scope.\n * @param {object} options An options object, with the following properties:\n *\n * - `controller` - `{(string=|function()=}` Controller fn that should be associated with\n * newly created scope or the name of a registered controller if passed as a string.\n * - `controllerAs` - `{string=}` A controller alias name. If present the controller will be\n * published to scope under the `controllerAs` name.\n * - `template` - `{string=}` An html template as a string.\n * - `templateUrl` - `{string=}` A path to an html template.\n * - `transformTemplate` - `{function(template)=}` A function which transforms the template after\n * it is loaded. It will be given the template string as a parameter, and should\n * return a a new string representing the transformed template.\n * - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should\n * be injected into the controller. If any of these dependencies are promises, the compiler\n * will wait for them all to be resolved, or if one is rejected before the controller is\n * instantiated `compile()` will fail..\n * * `key` - `{string}`: a name of a dependency to be injected into the controller.\n * * `factory` - `{string|function}`: If `string` then it is an alias for a service.\n * Otherwise if function, then it is injected and the return value is treated as the\n * dependency. If the result is a promise, it is resolved before its value is\n * injected into the controller.\n *\n * @returns {object=} promise A promise, which will be resolved with a `compileData` object.\n * `compileData` has the following properties:\n *\n * - `element` - `{element}`: an uncompiled element matching the provided template.\n * - `link` - `{function(scope)}`: A link function, which, when called, will compile\n * the element and instantiate the provided controller (if given).\n * - `locals` - `{object}`: The locals which will be passed into the controller once `link` is\n * called. If `bindToController` is true, they will be coppied to the ctrl instead\n * - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.\n */\n this.compile = function(options) {\n var templateUrl = options.templateUrl;\n var template = options.template || '';\n var controller = options.controller;\n var controllerAs = options.controllerAs;\n var resolve = angular.extend({}, options.resolve || {});\n var locals = angular.extend({}, options.locals || {});\n var transformTemplate = options.transformTemplate || angular.identity;\n var bindToController = options.bindToController;\n\n // Take resolve values and invoke them.\n // Resolves can either be a string (value: 'MyRegisteredAngularConst'),\n // or an invokable 'factory' of sorts: (value: function ValueGetter($dependency) {})\n angular.forEach(resolve, function(value, key) {\n if (angular.isString(value)) {\n resolve[key] = $injector.get(value);\n } else {\n resolve[key] = $injector.invoke(value);\n }\n });\n //Add the locals, which are just straight values to inject\n //eg locals: { three: 3 }, will inject three into the controller\n angular.extend(resolve, locals);\n\n if (templateUrl) {\n resolve.$template = $http.get(templateUrl, {cache: $templateCache})\n .then(function(response) {\n return response.data;\n });\n } else {\n resolve.$template = $q.when(template);\n }\n\n // Wait for all the resolves to finish if they are promises\n return $q.all(resolve).then(function(locals) {\n\n var compiledData;\n var template = transformTemplate(locals.$template, options);\n var element = options.element || angular.element('<div>').html(template.trim()).contents();\n var linkFn = $compile(element);\n\n // Return a linking function that can be used later when the element is ready\n return compiledData = {\n locals: locals,\n element: element,\n link: function link(scope) {\n locals.$scope = scope;\n\n //Instantiate controller if it exists, because we have scope\n if (controller) {\n var invokeCtrl = $controller(controller, locals, true);\n if (bindToController) {\n angular.extend(invokeCtrl.instance, locals);\n }\n var ctrl = invokeCtrl();\n //See angular-route source for this logic\n element.data('$ngControllerController', ctrl);\n element.children().data('$ngControllerController', ctrl);\n\n if (controllerAs) {\n scope[controllerAs] = ctrl;\n }\n\n // Publish reference to this controller\n compiledData.controller = ctrl;\n }\n return linkFn(scope);\n }\n };\n });\n\n };\n}\nmdCompilerService.$inject = [\"$q\", \"$http\", \"$injector\", \"$compile\", \"$controller\", \"$templateCache\"];\n\n})();\n(function(){\n\"use strict\";\n\n\nangular.module('material.core')\n .service('$mdAria', AriaService);\n\n/*\n * @ngInject\n */\nfunction AriaService($$rAF, $log, $window, $interpolate) {\n\n return {\n expect: expect,\n expectAsync: expectAsync,\n expectWithText: expectWithText\n };\n\n /**\n * Check if expected attribute has been specified on the target element or child\n * @param element\n * @param attrName\n * @param {optional} defaultValue What to set the attr to if no value is found\n */\n function expect(element, attrName, defaultValue) {\n\n var node = angular.element(element)[0] || element;\n\n // if node exists and neither it nor its children have the attribute\n if (node &&\n ((!node.hasAttribute(attrName) ||\n node.getAttribute(attrName).length === 0) &&\n !childHasAttribute(node, attrName))) {\n\n defaultValue = angular.isString(defaultValue) ? defaultValue.trim() : '';\n if (defaultValue.length) {\n element.attr(attrName, defaultValue);\n } else {\n $log.warn('ARIA: Attribute \"', attrName, '\", required for accessibility, is missing on node:', node);\n }\n\n }\n }\n\n function expectAsync(element, attrName, defaultValueGetter) {\n // Problem: when retrieving the element's contents synchronously to find the label,\n // the text may not be defined yet in the case of a binding.\n // There is a higher chance that a binding will be defined if we wait one frame.\n $$rAF(function() {\n expect(element, attrName, defaultValueGetter());\n });\n }\n\n function expectWithText(element, attrName) {\n var content = getText(element) || \"\";\n var hasBinding = content.indexOf($interpolate.startSymbol())>-1;\n\n if ( hasBinding ) {\n expectAsync(element, attrName, function() {\n return getText(element);\n });\n } else {\n expect(element, attrName, content);\n }\n }\n\n function getText(element) {\n return (element.text() || \"\").trim();\n }\n\n function childHasAttribute(node, attrName) {\n var hasChildren = node.hasChildNodes(),\n hasAttr = false;\n\n function isHidden(el) {\n var style = el.currentStyle ? el.currentStyle : $window.getComputedStyle(el);\n return (style.display === 'none');\n }\n\n if(hasChildren) {\n var children = node.childNodes;\n for(var i=0; i<children.length; i++){\n var child = children[i];\n if(child.nodeType === 1 && child.hasAttribute(attrName)) {\n if(!isHidden(child)){\n hasAttr = true;\n }\n }\n }\n }\n return hasAttr;\n }\n}\nAriaService.$inject = [\"$$rAF\", \"$log\", \"$window\", \"$interpolate\"];\n\n})();\n(function(){\n\"use strict\";\n\nvar HANDLERS = {};\n\n/* The state of the current 'pointer'\n * The pointer represents the state of the current touch.\n * It contains normalized x and y coordinates from DOM events,\n * as well as other information abstracted from the DOM.\n */\n \nvar pointer, lastPointer, forceSkipClickHijack = false;\n\n/**\n * The position of the most recent click if that click was on a label element.\n * @type {{x: number, y: number}?}\n */\nvar lastLabelClickPos = null;\n\n// Used to attach event listeners once when multiple ng-apps are running.\nvar isInitialized = false;\n\nangular\n .module('material.core.gestures', [ ])\n .provider('$mdGesture', MdGestureProvider)\n .factory('$$MdGestureHandler', MdGestureHandler)\n .run( attachToDocument );\n\n/**\n * @ngdoc service\n * @name $mdGestureProvider\n * @module material.core.gestures\n *\n * @description\n * In some scenarios on Mobile devices (without jQuery), the click events should NOT be hijacked.\n * `$mdGestureProvider` is used to configure the Gesture module to ignore or skip click hijacking on mobile\n * devices.\n *\n * <hljs lang=\"js\">\n * app.config(function($mdGestureProvider) {\n *\n * // For mobile devices without jQuery loaded, do not\n * // intercept click events during the capture phase.\n * $mdGestureProvider.skipClickHijack();\n *\n * });\n * </hljs>\n *\n */\nfunction MdGestureProvider() { }\n\nMdGestureProvider.prototype = {\n\n // Publish access to setter to configure a variable BEFORE the\n // $mdGesture service is instantiated...\n skipClickHijack: function() {\n return forceSkipClickHijack = true;\n },\n\n /**\n * $get is used to build an instance of $mdGesture\n * @ngInject\n */\n $get : [\"$$MdGestureHandler\", \"$$rAF\", \"$timeout\", function($$MdGestureHandler, $$rAF, $timeout) {\n return new MdGesture($$MdGestureHandler, $$rAF, $timeout);\n }]\n};\n\n\n\n/**\n * MdGesture factory construction function\n * @ngInject\n */\nfunction MdGesture($$MdGestureHandler, $$rAF, $timeout) {\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n var isIos = userAgent.match(/ipad|iphone|ipod/i);\n var isAndroid = userAgent.match(/android/i);\n var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n var self = {\n handler: addHandler,\n register: register,\n // On mobile w/out jQuery, we normally intercept clicks. Should we skip that?\n isHijackingClicks: (isIos || isAndroid) && !hasJQuery && !forceSkipClickHijack\n };\n\n if (self.isHijackingClicks) {\n var maxClickDistance = 6;\n self.handler('click', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: checkDistanceAndEmit('click')\n });\n\n self.handler('focus', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: function(ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n if (canFocus(ev.target)) {\n this.dispatchEvent(ev, 'focus', pointer);\n ev.target.focus();\n }\n }\n\n function canFocus(element) {\n var focusableElements = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'];\n\n return (element.getAttribute('tabindex') != '-1') &&\n !element.hasAttribute('DISABLED') &&\n (element.hasAttribute('tabindex') || element.hasAttribute('href') ||\n (focusableElements.indexOf(element.nodeName) != -1));\n }\n }\n });\n\n self.handler('mouseup', {\n options: {\n maxDistance: maxClickDistance\n },\n onEnd: checkDistanceAndEmit('mouseup')\n });\n\n self.handler('mousedown', {\n onStart: function(ev) {\n this.dispatchEvent(ev, 'mousedown');\n }\n });\n }\n\n function checkDistanceAndEmit(eventName) {\n return function(ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n this.dispatchEvent(ev, eventName, pointer);\n }\n };\n }\n\n /*\n * Register an element to listen for a handler.\n * This allows an element to override the default options for a handler.\n * Additionally, some handlers like drag and hold only dispatch events if\n * the domEvent happens inside an element that's registered to listen for these events.\n *\n * @see GestureHandler for how overriding of default options works.\n * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horziontal: false })\n */\n function register(element, handlerName, options) {\n var handler = HANDLERS[handlerName.replace(/^\\$md./, '')];\n if (!handler) {\n throw new Error('Failed to register element with handler ' + handlerName + '. ' +\n 'Available handlers: ' + Object.keys(HANDLERS).join(', '));\n }\n return handler.registerElement(element, options);\n }\n\n /*\n * add a handler to $mdGesture. see below.\n */\n function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }\n\n /*\n * Register handlers. These listen to touch/start/move events, interpret them,\n * and dispatch gesture events depending on options & conditions. These are all\n * instances of GestureHandler.\n * @see GestureHandler \n */\n return self\n /*\n * The press handler dispatches an event on touchdown/touchend.\n * It's a simple abstraction of touch/mouse/pointer start and end.\n */\n .handler('press', {\n onStart: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressdown');\n },\n onEnd: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressup');\n }\n })\n\n /*\n * The hold handler dispatches an event if the user keeps their finger within\n * the same <maxDistance> area for <delay> ms.\n * The hold handler will only run if a parent of the touch target is registered\n * to listen for hold events through $mdGesture.register()\n */\n .handler('hold', {\n options: {\n maxDistance: 6,\n delay: 500\n },\n onCancel: function () {\n $timeout.cancel(this.state.timeout);\n },\n onStart: function (ev, pointer) {\n // For hold, require a parent to be registered with $mdGesture.register()\n // Because we prevent scroll events, this is necessary.\n if (!this.state.registeredParent) return this.cancel();\n\n this.state.pos = {x: pointer.x, y: pointer.y};\n this.state.timeout = $timeout(angular.bind(this, function holdDelayFn() {\n this.dispatchEvent(ev, '$md.hold');\n this.cancel(); //we're done!\n }), this.state.options.delay, false);\n },\n onMove: function (ev, pointer) {\n // Don't scroll while waiting for hold.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n ev.preventDefault();\n\n // If the user moves greater than <maxDistance> pixels, stop the hold timer\n // set in onStart\n var dx = this.state.pos.x - pointer.x;\n var dy = this.state.pos.y - pointer.y;\n if (Math.sqrt(dx * dx + dy * dy) > this.options.maxDistance) {\n this.cancel();\n }\n },\n onEnd: function () {\n this.onCancel();\n }\n })\n\n /*\n * The drag handler dispatches a drag event if the user holds and moves his finger greater than\n * <minDistance> px in the x or y direction, depending on options.horizontal.\n * The drag will be cancelled if the user moves his finger greater than <minDistance>*<cancelMultiplier> in\n * the perpindicular direction. Eg if the drag is horizontal and the user moves his finger <minDistance>*<cancelMultiplier>\n * pixels vertically, this handler won't consider the move part of a drag.\n */\n .handler('drag', {\n options: {\n minDistance: 6,\n horizontal: true,\n cancelMultiplier: 1.5\n },\n onStart: function (ev) {\n // For drag, require a parent to be registered with $mdGesture.register()\n if (!this.state.registeredParent) this.cancel();\n },\n onMove: function (ev, pointer) {\n var shouldStartDrag, shouldCancel;\n // Don't scroll while deciding if this touchmove qualifies as a drag event.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n ev.preventDefault();\n\n if (!this.state.dragPointer) {\n if (this.state.options.horizontal) {\n shouldStartDrag = Math.abs(pointer.distanceX) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n } else {\n shouldStartDrag = Math.abs(pointer.distanceY) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n }\n\n if (shouldStartDrag) {\n // Create a new pointer representing this drag, starting at this point where the drag started.\n this.state.dragPointer = makeStartPointer(ev);\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragstart', this.state.dragPointer);\n\n } else if (shouldCancel) {\n this.cancel();\n }\n } else {\n this.dispatchDragMove(ev);\n }\n },\n // Only dispatch dragmove events every frame; any more is unnecessray\n dispatchDragMove: $$rAF.throttle(function (ev) {\n // Make sure the drag didn't stop while waiting for the next frame\n if (this.state.isRunning) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.drag', this.state.dragPointer);\n }\n }),\n onEnd: function (ev, pointer) {\n if (this.state.dragPointer) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragend', this.state.dragPointer);\n }\n }\n })\n\n /*\n * The swipe handler will dispatch a swipe event if, on the end of a touch,\n * the velocity and distance were high enough.\n */\n .handler('swipe', {\n options: {\n minVelocity: 0.65,\n minDistance: 10\n },\n onEnd: function (ev, pointer) {\n var eventType;\n\n if (Math.abs(pointer.velocityX) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceX) > this.state.options.minDistance) {\n eventType = pointer.directionX == 'left' ? '$md.swipeleft' : '$md.swiperight';\n this.dispatchEvent(ev, eventType);\n }\n else if (Math.abs(pointer.velocityY) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceY) > this.state.options.minDistance) {\n eventType = pointer.directionY == 'up' ? '$md.swipeup' : '$md.swipedown';\n this.dispatchEvent(ev, eventType);\n }\n }\n });\n\n}\nMdGesture.$inject = [\"$$MdGestureHandler\", \"$$rAF\", \"$timeout\"];\n\n/**\n * MdGestureHandler\n * A GestureHandler is an object which is able to dispatch custom dom events\n * based on native dom {touch,pointer,mouse}{start,move,end} events.\n *\n * A gesture will manage its lifecycle through the start,move,end, and cancel\n * functions, which are called by native dom events.\n *\n * A gesture has the concept of 'options' (eg a swipe's required velocity), which can be\n * overridden by elements registering through $mdGesture.register()\n */\nfunction GestureHandler (name) {\n this.name = name;\n this.state = {};\n}\n\nfunction MdGestureHandler() {\n var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n GestureHandler.prototype = {\n options: {},\n // jQuery listeners don't work with custom DOMEvents, so we have to dispatch events\n // differently when jQuery is loaded\n dispatchEvent: hasJQuery ? jQueryDispatchEvent : nativeDispatchEvent,\n\n // These are overridden by the registered handler\n onStart: angular.noop,\n onMove: angular.noop,\n onEnd: angular.noop,\n onCancel: angular.noop,\n\n // onStart sets up a new state for the handler, which includes options from the\n // nearest registered parent element of ev.target.\n start: function (ev, pointer) {\n if (this.state.isRunning) return;\n var parentTarget = this.getNearestParent(ev.target);\n // Get the options from the nearest registered parent\n var parentTargetOptions = parentTarget && parentTarget.$mdGesture[this.name] || {};\n\n this.state = {\n isRunning: true,\n // Override the default options with the nearest registered parent's options\n options: angular.extend({}, this.options, parentTargetOptions),\n // Pass in the registered parent node to the state so the onStart listener can use\n registeredParent: parentTarget\n };\n this.onStart(ev, pointer);\n },\n move: function (ev, pointer) {\n if (!this.state.isRunning) return;\n this.onMove(ev, pointer);\n },\n end: function (ev, pointer) {\n if (!this.state.isRunning) return;\n this.onEnd(ev, pointer);\n this.state.isRunning = false;\n },\n cancel: function (ev, pointer) {\n this.onCancel(ev, pointer);\n this.state = {};\n },\n\n // Find and return the nearest parent element that has been registered to\n // listen for this handler via $mdGesture.register(element, 'handlerName').\n getNearestParent: function (node) {\n var current = node;\n while (current) {\n if ((current.$mdGesture || {})[this.name]) {\n return current;\n }\n current = current.parentNode;\n }\n return null;\n },\n\n // Called from $mdGesture.register when an element reigsters itself with a handler.\n // Store the options the user gave on the DOMElement itself. These options will\n // be retrieved with getNearestParent when the handler starts.\n registerElement: function (element, options) {\n var self = this;\n element[0].$mdGesture = element[0].$mdGesture || {};\n element[0].$mdGesture[this.name] = options || {};\n element.on('$destroy', onDestroy);\n\n return onDestroy;\n\n function onDestroy() {\n delete element[0].$mdGesture[self.name];\n element.off('$destroy', onDestroy);\n }\n }\n };\n\n return GestureHandler;\n\n /*\n * Dispatch an event with jQuery\n * TODO: Make sure this sends bubbling events\n *\n * @param srcEvent the original DOM touch event that started this.\n * @param eventType the name of the custom event to send (eg 'click' or '$md.drag')\n * @param eventPointer the pointer object that matches this event.\n */\n function jQueryDispatchEvent(srcEvent, eventType, eventPointer) {\n eventPointer = eventPointer || pointer;\n var eventObj = new angular.element.Event(eventType);\n\n eventObj.$material = true;\n eventObj.pointer = eventPointer;\n eventObj.srcEvent = srcEvent;\n\n angular.extend(eventObj, {\n clientX: eventPointer.x,\n clientY: eventPointer.y,\n screenX: eventPointer.x,\n screenY: eventPointer.y,\n pageX: eventPointer.x,\n pageY: eventPointer.y,\n ctrlKey: srcEvent.ctrlKey,\n altKey: srcEvent.altKey,\n shiftKey: srcEvent.shiftKey,\n metaKey: srcEvent.metaKey\n });\n angular.element(eventPointer.target).trigger(eventObj);\n }\n\n /*\n * NOTE: nativeDispatchEvent is very performance sensitive.\n * @param srcEvent the original DOM touch event that started this.\n * @param eventType the name of the custom event to send (eg 'click' or '$md.drag')\n * @param eventPointer the pointer object that matches this event.\n */\n function nativeDispatchEvent(srcEvent, eventType, eventPointer) {\n eventPointer = eventPointer || pointer;\n var eventObj;\n\n if (eventType === 'click' || eventType == 'mouseup' || eventType == 'mousedown' ) {\n eventObj = document.createEvent('MouseEvents');\n eventObj.initMouseEvent(\n eventType, true, true, window, srcEvent.detail,\n eventPointer.x, eventPointer.y, eventPointer.x, eventPointer.y,\n srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey,\n srcEvent.button, srcEvent.relatedTarget || null\n );\n\n } else {\n eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent(eventType, true, true, {});\n }\n eventObj.$material = true;\n eventObj.pointer = eventPointer;\n eventObj.srcEvent = srcEvent;\n eventPointer.target.dispatchEvent(eventObj);\n }\n\n}\n\n/**\n * Attach Gestures: hook document and check shouldHijack clicks\n * @ngInject\n */\nfunction attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click' , clickHijacker , true);\n document.addEventListener('mouseup' , mouseInputHijacker, true);\n document.addEventListener('mousedown', mouseInputHijacker, true);\n document.addEventListener('focus' , mouseInputHijacker, true);\n\n isInitialized = true;\n }\n\n function mouseInputHijacker(ev) {\n var isKeyClick = !ev.clientX && !ev.clientY;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }\n\n function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap\n && !isInputEventFromLabelClick(ev)) {\n ev.preventDefault();\n ev.stopPropagation();\n lastLabelClickPos = null;\n } else {\n lastLabelClickPos = null;\n if (ev.target.tagName.toLowerCase() == 'label') {\n lastLabelClickPos = {x: ev.x, y: ev.y};\n }\n }\n }\n\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n}\nattachToDocument.$inject = [\"$mdGesture\", \"$$MdGestureHandler\"];\n\n// ********************\n// Module Functions\n// ********************\n\n/*\n * Initiate the pointer. x, y, and the pointer's type.\n */\nfunction makeStartPointer(ev) {\n var point = getEventPoint(ev);\n var startPointer = {\n startTime: +Date.now(),\n target: ev.target,\n // 'p' for pointer events, 'm' for mouse, 't' for touch\n type: ev.type.charAt(0)\n };\n startPointer.startX = startPointer.x = point.pageX;\n startPointer.startY = startPointer.y = point.pageY;\n return startPointer;\n}\n\n/*\n * return whether the pointer's type matches the event's type.\n * Eg if a touch event happens but the pointer has a mouse type, return false.\n */\nfunction typesMatch(ev, pointer) {\n return ev && pointer && ev.type.charAt(0) === pointer.type;\n}\n\n/**\n * Gets whether the given event is an input event that was caused by clicking on an\n * associated label element.\n *\n * This is necessary because the browser will, upon clicking on a label element, fire an\n * *extra* click event on its associated input (if any). mdGesture is able to flag the label\n * click as with `$material` correctly, but not the second input click.\n *\n * In order to determine whether an input event is from a label click, we compare the (x, y) for\n * the event to the (x, y) for the most recent label click (which is cleared whenever a non-label\n * click occurs). Unfortunately, there are no event properties that tie the input and the label\n * together (such as relatedTarget).\n *\n * @param {MouseEvent} event\n * @returns {boolean}\n */\nfunction isInputEventFromLabelClick(event) {\n return lastLabelClickPos\n && lastLabelClickPos.x == event.x\n && lastLabelClickPos.y == event.y;\n}\n\n/*\n * Update the given pointer based upon the given DOMEvent.\n * Distance, velocity, direction, duration, etc\n */\nfunction updatePointerState(ev, pointer) {\n var point = getEventPoint(ev);\n var x = pointer.x = point.pageX;\n var y = pointer.y = point.pageY;\n\n pointer.distanceX = x - pointer.startX;\n pointer.distanceY = y - pointer.startY;\n pointer.distance = Math.sqrt(\n pointer.distanceX * pointer.distanceX + pointer.distanceY * pointer.distanceY\n );\n\n pointer.directionX = pointer.distanceX > 0 ? 'right' : pointer.distanceX < 0 ? 'left' : '';\n pointer.directionY = pointer.distanceY > 0 ? 'down' : pointer.distanceY < 0 ? 'up' : '';\n\n pointer.duration = +Date.now() - pointer.startTime;\n pointer.velocityX = pointer.distanceX / pointer.duration;\n pointer.velocityY = pointer.distanceY / pointer.duration;\n}\n\n/*\n * Normalize the point where the DOM event happened whether it's touch or mouse.\n * @returns point event obj with pageX and pageY on it.\n */\nfunction getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n .provider('$$interimElement', InterimElementProvider);\n\n/*\n * @ngdoc service\n * @name $$interimElement\n * @module material.core\n *\n * @description\n *\n * Factory that contructs `$$interimElement.$service` services.\n * Used internally in material design for elements that appear on screen temporarily.\n * The service provides a promise-like API for interacting with the temporary\n * elements.\n *\n * ```js\n * app.service('$mdToast', function($$interimElement) {\n * var $mdToast = $$interimElement(toastDefaultOptions);\n * return $mdToast;\n * });\n * ```\n * @param {object=} defaultOptions Options used by default for the `show` method on the service.\n *\n * @returns {$$interimElement.$service}\n *\n */\n\nfunction InterimElementProvider() {\n createInterimElementProvider.$get = InterimElementFactory;\n InterimElementFactory.$inject = [\"$document\", \"$q\", \"$$q\", \"$rootScope\", \"$timeout\", \"$rootElement\", \"$animate\", \"$mdUtil\", \"$mdCompiler\", \"$mdTheming\", \"$injector\"];\n return createInterimElementProvider;\n\n /**\n * Returns a new provider which allows configuration of a new interimElement\n * service. Allows configuration of default options & methods for options,\n * as well as configuration of 'preset' methods (eg dialog.basic(): basic is a preset method)\n */\n function createInterimElementProvider(interimFactoryName) {\n var EXPOSED_METHODS = ['onHide', 'onShow', 'onRemove'];\n\n var customMethods = {};\n var providerConfig = {\n presets: {}\n };\n\n var provider = {\n setDefaults: setDefaults,\n addPreset: addPreset,\n addMethod: addMethod,\n $get: factory\n };\n\n /**\n * all interim elements will come with the 'build' preset\n */\n provider.addPreset('build', {\n methods: ['controller', 'controllerAs', 'resolve',\n 'template', 'templateUrl', 'themable', 'transformTemplate', 'parent']\n });\n\n factory.$inject = [\"$$interimElement\", \"$injector\"];\n return provider;\n\n /**\n * Save the configured defaults to be used when the factory is instantiated\n */\n function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }\n\n /**\n * Add a method to the factory that isn't specific to any interim element operations\n */\n\n function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }\n\n /**\n * Save the configured preset to be used when the factory is instantiated\n */\n function addPreset(name, definition) {\n definition = definition || {};\n definition.methods = definition.methods || [];\n definition.options = definition.options || function() { return {}; };\n\n if (/^cancel|hide|show$/.test(name)) {\n throw new Error(\"Preset '\" + name + \"' in \" + interimFactoryName + \" is reserved!\");\n }\n if (definition.methods.indexOf('_options') > -1) {\n throw new Error(\"Method '_options' in \" + interimFactoryName + \" is reserved!\");\n }\n providerConfig.presets[name] = {\n methods: definition.methods.concat(EXPOSED_METHODS),\n optionsFactory: definition.options,\n argOption: definition.argOption\n };\n return provider;\n }\n\n function addPresetMethod(presetName, methodName, method) {\n providerConfig.presets[presetName][methodName] = method;\n }\n\n /**\n * Create a factory that has the given methods & defaults implementing interimElement\n */\n /* @ngInject */\n function factory($$interimElement, $injector) {\n var defaultMethods;\n var defaultOptions;\n var interimElementService = $$interimElement();\n\n /*\n * publicService is what the developer will be using.\n * It has methods hide(), cancel(), show(), build(), and any other\n * presets which were set during the config phase.\n */\n var publicService = {\n hide: interimElementService.hide,\n cancel: interimElementService.cancel,\n show: showInterimElement,\n\n // Special internal method to destroy an interim element without animations\n // used when navigation changes causes a $scope.$destroy() action\n destroy : destroyInterimElement\n };\n\n\n defaultMethods = providerConfig.methods || [];\n // This must be invoked after the publicService is initialized\n defaultOptions = invokeFactory(providerConfig.optionsFactory, {});\n\n // Copy over the simple custom methods\n angular.forEach(customMethods, function(fn, name) {\n publicService[name] = fn;\n });\n\n angular.forEach(providerConfig.presets, function(definition, name) {\n var presetDefaults = invokeFactory(definition.optionsFactory, {});\n var presetMethods = (definition.methods || []).concat(defaultMethods);\n\n // Every interimElement built with a preset has a field called `$type`,\n // which matches the name of the preset.\n // Eg in preset 'confirm', options.$type === 'confirm'\n angular.extend(presetDefaults, { $type: name });\n\n // This creates a preset class which has setter methods for every\n // method given in the `.addPreset()` function, as well as every\n // method given in the `.setDefaults()` function.\n //\n // @example\n // .setDefaults({\n // methods: ['hasBackdrop', 'clickOutsideToClose', 'escapeToClose', 'targetEvent'],\n // options: dialogDefaultOptions\n // })\n // .addPreset('alert', {\n // methods: ['title', 'ok'],\n // options: alertDialogOptions\n // })\n //\n // Set values will be passed to the options when interimElement.show() is called.\n function Preset(opts) {\n this._options = angular.extend({}, presetDefaults, opts);\n }\n angular.forEach(presetMethods, function(name) {\n Preset.prototype[name] = function(value) {\n this._options[name] = value;\n return this;\n };\n });\n\n // Create shortcut method for one-linear methods\n if (definition.argOption) {\n var methodName = 'show' + name.charAt(0).toUpperCase() + name.slice(1);\n publicService[methodName] = function(arg) {\n var config = publicService[name](arg);\n return publicService.show(config);\n };\n }\n\n // eg $mdDialog.alert() will return a new alert preset\n publicService[name] = function(arg) {\n // If argOption is supplied, eg `argOption: 'content'`, then we assume\n // if the argument is not an options object then it is the `argOption` option.\n //\n // @example `$mdToast.simple('hello')` // sets options.content to hello\n // // because argOption === 'content'\n if (arguments.length && definition.argOption &&\n !angular.isObject(arg) && !angular.isArray(arg)) {\n\n return (new Preset())[definition.argOption](arg);\n\n } else {\n return new Preset(arg);\n }\n\n };\n });\n\n return publicService;\n\n /**\n *\n */\n function showInterimElement(opts) {\n // opts is either a preset which stores its options on an _options field,\n // or just an object made up of options\n opts = opts || { };\n if (opts._options) opts = opts._options;\n\n return interimElementService.show(\n angular.extend({}, defaultOptions, opts)\n );\n }\n\n /**\n * Special method to hide and destroy an interimElement WITHOUT\n * any 'leave` or hide animations ( an immediate force hide/remove )\n *\n * NOTE: This calls the onRemove() subclass method for each component...\n * which must have code to respond to `options.$destroy == true`\n */\n function destroyInterimElement(opts) {\n return interimElementService.destroy(opts);\n }\n\n /**\n * Helper to call $injector.invoke with a local of the factory name for\n * this provider.\n * If an $mdDialog is providing options for a dialog and tries to inject\n * $mdDialog, a circular dependency error will happen.\n * We get around that by manually injecting $mdDialog as a local.\n */\n function invokeFactory(factory, defaultVal) {\n var locals = {};\n locals[interimFactoryName] = publicService;\n return $injector.invoke(factory || function() { return defaultVal; }, {}, locals);\n }\n\n }\n\n }\n\n /* @ngInject */\n function InterimElementFactory($document, $q, $$q, $rootScope, $timeout, $rootElement, $animate,\n $mdUtil, $mdCompiler, $mdTheming, $injector ) {\n return function createInterimElementService() {\n var SHOW_CANCELLED = false;\n\n /*\n * @ngdoc service\n * @name $$interimElement.$service\n *\n * @description\n * A service used to control inserting and removing an element into the DOM.\n *\n */\n var service, stack = [];\n\n // Publish instance $$interimElement service;\n // ... used as $mdDialog, $mdToast, $mdMenu, and $mdSelect\n\n return service = {\n show: show,\n hide: hide,\n cancel: cancel,\n destroy : destroy,\n $injector_: $injector\n };\n\n /*\n * @ngdoc method\n * @name $$interimElement.$service#show\n * @kind function\n *\n * @description\n * Adds the `$interimElement` to the DOM and returns a special promise that will be resolved or rejected\n * with hide or cancel, respectively. To external cancel/hide, developers should use the\n *\n * @param {*} options is hashMap of settings\n * @returns a Promise\n *\n */\n function show(options) {\n options = options || {};\n var interimElement = new InterimElement(options || {});\n var hideExisting = !options.skipHide && stack.length ? service.hide() : $q.when(true);\n\n // This hide()s only the current interim element before showing the next, new one\n // NOTE: this is not reversible (e.g. interim elements are not stackable)\n\n hideExisting.finally(function() {\n\n stack.push(interimElement);\n interimElement\n .show()\n .catch(function( reason ) {\n //$log.error(\"InterimElement.show() error: \" + reason );\n return reason;\n });\n\n });\n\n // Return a promise that will be resolved when the interim\n // element is hidden or cancelled...\n\n return interimElement.deferred.promise;\n }\n\n /*\n * @ngdoc method\n * @name $$interimElement.$service#hide\n * @kind function\n *\n * @description\n * Removes the `$interimElement` from the DOM and resolves the promise returned from `show`\n *\n * @param {*} resolveParam Data to resolve the promise with\n * @returns a Promise that will be resolved after the element has been removed.\n *\n */\n function hide(reason, options) {\n if ( !stack.length ) return $q.when(reason);\n options = options || {};\n\n if (options.closeAll) {\n var promise = $q.all(stack.reverse().map(closeElement));\n stack = [];\n return promise;\n } else if (options.closeTo !== undefined) {\n return $q.all(stack.splice(options.closeTo).map(closeElement));\n } else {\n var interim = stack.pop();\n return closeElement(interim);\n }\n\n function closeElement(interim) {\n interim\n .remove(reason, false, options || { })\n .catch(function( reason ) {\n //$log.error(\"InterimElement.hide() error: \" + reason );\n return reason;\n });\n return interim.deferred.promise;\n }\n }\n\n /*\n * @ngdoc method\n * @name $$interimElement.$service#cancel\n * @kind function\n *\n * @description\n * Removes the `$interimElement` from the DOM and rejects the promise returned from `show`\n *\n * @param {*} reason Data to reject the promise with\n * @returns Promise that will be resolved after the element has been removed.\n *\n */\n function cancel(reason, options) {\n var interim = stack.pop();\n if ( !interim ) return $q.when(reason);\n\n interim\n .remove(reason, true, options || { })\n .catch(function( reason ) {\n //$log.error(\"InterimElement.cancel() error: \" + reason );\n return reason;\n });\n\n return interim.deferred.promise;\n }\n\n /*\n * Special method to quick-remove the interim element without animations\n * Note: interim elements are in \"interim containers\"\n */\n function destroy(target) {\n var interim = !target ? stack.shift() : null;\n var cntr = angular.element(target).length ? angular.element(target)[0].parentNode : null;\n\n if (cntr) {\n // Try to find the interim element in the stack which corresponds to the supplied DOM element.\n var filtered = stack.filter(function(entry) {\n var currNode = entry.options.element[0];\n return (currNode === cntr);\n });\n\n // Note: this function might be called when the element already has been removed, in which\n // case we won't find any matches. That's ok.\n if (filtered.length > 0) {\n interim = filtered[0];\n stack.splice(stack.indexOf(interim), 1);\n }\n }\n\n return interim ? interim.remove(SHOW_CANCELLED, false, {'$destroy':true}) : $q.when(SHOW_CANCELLED);\n }\n\n /*\n * Internal Interim Element Object\n * Used internally to manage the DOM element and related data\n */\n function InterimElement(options) {\n var self, element, showAction = $q.when(true);\n\n options = configureScopeAndTransitions(options);\n\n return self = {\n options : options,\n deferred: $q.defer(),\n show : createAndTransitionIn,\n remove : transitionOutAndRemove\n };\n\n /**\n * Compile, link, and show this interim element\n * Use optional autoHided and transition-in effects\n */\n function createAndTransitionIn() {\n return $q(function(resolve, reject){\n\n compileElement(options)\n .then(function( compiledData ) {\n element = linkElement( compiledData, options );\n\n showAction = showElement(element, options, compiledData.controller)\n .then(resolve, rejectAll);\n\n }, rejectAll);\n\n function rejectAll(fault) {\n // Force the '$md<xxx>.show()' promise to reject\n self.deferred.reject(fault);\n\n // Continue rejection propagation\n reject(fault);\n }\n });\n }\n\n /**\n * After the show process has finished/rejected:\n * - announce 'removing',\n * - perform the transition-out, and\n * - perform optional clean up scope.\n */\n function transitionOutAndRemove(response, isCancelled, opts) {\n\n // abort if the show() and compile failed\n if ( !element ) return $q.when(false);\n\n options = angular.extend(options || {}, opts || {});\n options.cancelAutoHide && options.cancelAutoHide();\n options.element.triggerHandler('$mdInterimElementRemove');\n\n if ( options.$destroy === true ) {\n\n return hideElement(options.element, options).then(function(){\n (isCancelled && rejectAll(response)) || resolveAll(response);\n });\n\n } else {\n\n $q.when(showAction)\n .finally(function() {\n hideElement(options.element, options).then(function() {\n\n (isCancelled && rejectAll(response)) || resolveAll(response);\n\n }, rejectAll);\n });\n\n return self.deferred.promise;\n }\n\n\n /**\n * The `show()` returns a promise that will be resolved when the interim\n * element is hidden or cancelled...\n */\n function resolveAll(response) {\n self.deferred.resolve(response);\n }\n\n /**\n * Force the '$md<xxx>.show()' promise to reject\n */\n function rejectAll(fault) {\n self.deferred.reject(fault);\n }\n }\n\n /**\n * Prepare optional isolated scope and prepare $animate with default enter and leave\n * transitions for the new element instance.\n */\n function configureScopeAndTransitions(options) {\n options = options || { };\n if ( options.template ) {\n options.template = $mdUtil.processTemplate(options.template);\n }\n\n return angular.extend({\n preserveScope: false,\n cancelAutoHide : angular.noop,\n scope: options.scope || $rootScope.$new(options.isolateScope),\n\n /**\n * Default usage to enable $animate to transition-in; can be easily overridden via 'options'\n */\n onShow: function transitionIn(scope, element, options) {\n return $animate.enter(element, options.parent);\n },\n\n /**\n * Default usage to enable $animate to transition-out; can be easily overridden via 'options'\n */\n onRemove: function transitionOut(scope, element) {\n // Element could be undefined if a new element is shown before\n // the old one finishes compiling.\n return element && $animate.leave(element) || $q.when();\n }\n }, options );\n\n }\n\n /**\n * Compile an element with a templateUrl, controller, and locals\n */\n function compileElement(options) {\n\n var compiled = !options.skipCompile ? $mdCompiler.compile(options) : null;\n\n return compiled || $q(function (resolve) {\n resolve({\n locals: {},\n link: function () {\n return options.element;\n }\n });\n });\n }\n\n /**\n * Link an element with compiled configuration\n */\n function linkElement(compileData, options){\n angular.extend(compileData.locals, options);\n\n var element = compileData.link(options.scope);\n\n // Search for parent at insertion time, if not specified\n options.element = element;\n options.parent = findParent(element, options);\n if (options.themable) $mdTheming(element);\n\n return element;\n }\n\n /**\n * Search for parent at insertion time, if not specified\n */\n function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }\n\n /**\n * If auto-hide is enabled, start timer and prepare cancel function\n */\n function startAutoHide() {\n var autoHideTimer, cancelAutoHide = angular.noop;\n\n if (options.hideDelay) {\n autoHideTimer = $timeout(service.hide, options.hideDelay) ;\n cancelAutoHide = function() {\n $timeout.cancel(autoHideTimer);\n }\n }\n\n // Cache for subsequent use\n options.cancelAutoHide = function() {\n cancelAutoHide();\n options.cancelAutoHide = undefined;\n }\n }\n\n /**\n * Show the element ( with transitions), notify complete and start\n * optional auto-Hide\n */\n function showElement(element, options, controller) {\n // Trigger onShowing callback before the `show()` starts\n var notifyShowing = options.onShowing || angular.noop;\n // Trigger onComplete callback when the `show()` finishes\n var notifyComplete = options.onComplete || angular.noop;\n\n notifyShowing(options.scope, element, options, controller);\n\n return $q(function (resolve, reject) {\n try {\n // Start transitionIn\n $q.when(options.onShow(options.scope, element, options, controller))\n .then(function () {\n notifyComplete(options.scope, element, options);\n startAutoHide();\n\n resolve(element);\n\n }, reject );\n\n } catch(e) {\n reject(e.message);\n }\n });\n }\n\n function hideElement(element, options) {\n var announceRemoving = options.onRemoving || angular.noop;\n\n return $$q(function (resolve, reject) {\n try {\n // Start transitionIn\n var action = $$q.when( options.onRemove(options.scope, element, options) || true );\n\n // Trigger callback *before* the remove operation starts\n announceRemoving(element, action);\n\n if ( options.$destroy == true ) {\n\n // For $destroy, onRemove should be synchronous\n resolve(element);\n\n } else {\n\n // Wait until transition-out is done\n action.then(function () {\n\n if (!options.preserveScope && options.scope ) {\n options.scope.$destroy();\n }\n\n resolve(element);\n\n }, reject );\n }\n\n } catch(e) {\n reject(e);\n }\n });\n }\n\n }\n };\n\n }\n\n}\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n var $mdUtil, $interpolate, $log;\n\n var SUFFIXES = /(-gt)?-(sm|md|lg|print)/g;\n var WHITESPACE = /\\s+/g;\n\n var FLEX_OPTIONS = ['grow', 'initial', 'auto', 'none', 'noshrink', 'nogrow' ];\n var LAYOUT_OPTIONS = ['row', 'column'];\n var ALIGNMENT_MAIN_AXIS= [ \"\", \"start\", \"center\", \"end\", \"stretch\", \"space-around\", \"space-between\" ];\n var ALIGNMENT_CROSS_AXIS= [ \"\", \"start\", \"center\", \"end\", \"stretch\" ];\n\n var config = {\n /**\n * Enable directive attribute-to-class conversions\n * Developers can use `<body md-layout-css />` to quickly\n * disable the Layout directives and prohibit the injection of Layout classNames\n */\n enabled: true,\n\n /**\n * List of mediaQuery breakpoints and associated suffixes\n *\n * [\n * { suffix: \"sm\", mediaQuery: \"screen and (max-width: 599px)\" },\n * { suffix: \"md\", mediaQuery: \"screen and (min-width: 600px) and (max-width: 959px)\" }\n * ]\n */\n breakpoints: []\n };\n\n registerLayoutAPI( angular.module('material.core.layout', ['ng']) );\n\n /**\n * registerLayoutAPI()\n *\n * The original ngMaterial Layout solution used attribute selectors and CSS.\n *\n * ```html\n * <div layout=\"column\"> My Content </div>\n * ```\n *\n * ```css\n * [layout] {\n * box-sizing: border-box;\n * display:flex;\n * }\n * [layout=column] {\n * flex-direction : column\n * }\n * ```\n *\n * Use of attribute selectors creates significant performance impacts in some\n * browsers... mainly IE.\n *\n * This module registers directives that allow the same layout attributes to be\n * interpreted and converted to class selectors. The directive will add equivalent classes to each element that\n * contains a Layout directive.\n *\n * ```html\n * <div layout=\"column\" class=\"layout layout-column\"> My Content </div>\n *```\n *\n * ```css\n * .layout {\n * box-sizing: border-box;\n * display:flex;\n * }\n * .layout-column {\n * flex-direction : column\n * }\n * ```\n */\n function registerLayoutAPI(module){\n var PREFIX_REGEXP = /^((?:x|data)[\\:\\-_])/i;\n var SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\n\n // NOTE: these are also defined in constants::MEDIA_PRIORITY and constants::MEDIA\n var BREAKPOINTS = [ \"\", \"xs\", \"gt-xs\", \"sm\", \"gt-sm\", \"md\", \"gt-md\", \"lg\", \"gt-lg\", \"xl\", \"print\" ];\n var API_WITH_VALUES = [ \"layout\", \"flex\", \"flex-order\", \"flex-offset\", \"layout-align\" ];\n var API_NO_VALUES = [ \"show\", \"hide\", \"layout-padding\", \"layout-margin\" ];\n\n\n // Build directive registration functions for the standard Layout API... for all breakpoints.\n angular.forEach(BREAKPOINTS, function(mqb) {\n\n // Attribute directives with expected, observable value(s)\n angular.forEach( API_WITH_VALUES, function(name){\n var fullName = mqb ? name + \"-\" + mqb : name;\n module.directive( directiveNormalize(fullName), attributeWithObserve(fullName));\n });\n\n // Attribute directives with no expected value(s)\n angular.forEach( API_NO_VALUES, function(name){\n var fullName = mqb ? name + \"-\" + mqb : name;\n module.directive( directiveNormalize(fullName), attributeWithoutValue(fullName));\n });\n\n });\n\n // Register other, special directive functions for the Layout features:\n module\n .directive('mdLayoutCss' , disableLayoutDirective )\n .directive('ngCloak' , buildCloakInterceptor('ng-cloak'))\n\n .directive('layoutWrap' , attributeWithoutValue('layout-wrap'))\n .directive('layoutNowrap' , attributeWithoutValue('layout-nowrap'))\n .directive('layoutNoWrap' , attributeWithoutValue('layout-no-wrap'))\n .directive('layoutFill' , attributeWithoutValue('layout-fill'))\n\n // !! Deprecated attributes: use the `-lt` (aka less-than) notations\n\n .directive('layoutLtMd' , warnAttrNotSupported('layout-lt-md', true))\n .directive('layoutLtLg' , warnAttrNotSupported('layout-lt-lg', true))\n .directive('flexLtMd' , warnAttrNotSupported('flex-lt-md', true))\n .directive('flexLtLg' , warnAttrNotSupported('flex-lt-lg', true))\n\n .directive('layoutAlignLtMd', warnAttrNotSupported('layout-align-lt-md'))\n .directive('layoutAlignLtLg', warnAttrNotSupported('layout-align-lt-lg'))\n .directive('flexOrderLtMd' , warnAttrNotSupported('flex-order-lt-md'))\n .directive('flexOrderLtLg' , warnAttrNotSupported('flex-order-lt-lg'))\n .directive('offsetLtMd' , warnAttrNotSupported('flex-offset-lt-md'))\n .directive('offsetLtLg' , warnAttrNotSupported('flex-offset-lt-lg'))\n\n .directive('hideLtMd' , warnAttrNotSupported('hide-lt-md'))\n .directive('hideLtLg' , warnAttrNotSupported('hide-lt-lg'))\n .directive('showLtMd' , warnAttrNotSupported('show-lt-md'))\n .directive('showLtLg' , warnAttrNotSupported('show-lt-lg'));\n\n /**\n * Converts snake_case to camelCase.\n * Also there is special case for Moz prefix starting with upper case letter.\n * @param name Name to normalize\n */\n function directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }\n\n }\n\n /**\n * Special directive that will disable ALL Layout conversions of layout\n * attribute(s) to classname(s).\n *\n * <link rel=\"stylesheet\" href=\"angular-material.min.css\">\n * <link rel=\"stylesheet\" href=\"angular-material.layout.css\">\n *\n * <body md-layout-css>\n * ...\n * </body>\n *\n * Note: Using md-layout-css directive requires the developer to load the Material\n * Layout Attribute stylesheet (which only uses attribute selectors):\n *\n * `angular-material.layout.css`\n *\n * Another option is to use the LayoutProvider to configure and disable the attribute\n * conversions; this would obviate the use of the `md-layout-css` directive\n *\n */\n function disableLayoutDirective() {\n return {\n restrict : 'A',\n priority : '900',\n compile : function(element, attr) {\n config.enabled = false;\n return angular.noop;\n }\n };\n }\n\n /**\n * Tail-hook ngCloak to delay the uncloaking while Layout transformers\n * finish processing. Eliminates flicker with Material.Layoouts\n */\n function buildCloakInterceptor(className) {\n return [ '$timeout', function($timeout){\n return {\n restrict : 'A',\n priority : -10, // run after normal ng-cloak\n compile : function( element ) {\n if (!config.enabled) return angular.noop;\n\n // Re-add the cloak\n element.addClass(className);\n\n return function( scope, element ) {\n // Wait while layout injectors configure, then uncloak\n // NOTE: $rAF does not delay enough... and this is a 1x-only event,\n // $timeout is acceptable.\n $timeout( function(){\n element.removeClass(className);\n }, 10, false);\n };\n }\n };\n }];\n }\n\n\n // *********************************************************************************\n //\n // These functions create registration functions for ngMaterial Layout attribute directives\n // This provides easy translation to switch ngMaterial attribute selectors to\n // CLASS selectors and directives; which has huge performance implications\n // for IE Browsers\n //\n // *********************************************************************************\n\n /**\n * Creates a directive registration function where a possible dynamic attribute\n * value will be observed/watched.\n * @param {string} className attribute name; eg `layout-gt-md` with value =\"row\"\n */\n function attributeWithObserve(className) {\n\n return ['$mdUtil', '$interpolate', \"$log\", function(_$mdUtil_, _$interpolate_, _$log_) {\n $mdUtil = _$mdUtil_;\n $interpolate = _$interpolate_;\n $log = _$log_;\n\n return {\n restrict: 'A',\n compile: function(element, attr) {\n var linkFn;\n if (config.enabled) {\n // immediately replace static (non-interpolated) invalid values...\n\n validateAttributeUsage(className, attr, element, $log);\n\n validateAttributeValue( className,\n getNormalizedAttrValue(className, attr, \"\"),\n buildUpdateFn(element, className, attr)\n );\n\n linkFn = translateWithValueToCssClass;\n }\n\n // Use for postLink to account for transforms after ng-transclude.\n return linkFn || angular.noop;\n }\n };\n }];\n\n /**\n * Add as transformed class selector(s), then\n * remove the deprecated attribute selector\n */\n function translateWithValueToCssClass(scope, element, attrs) {\n var updateFn = updateClassWithValue(element, className, attrs);\n var unwatch = attrs.$observe(attrs.$normalize(className), updateFn);\n\n updateFn(getNormalizedAttrValue(className, attrs, \"\"));\n scope.$on(\"$destroy\", function() { unwatch() });\n }\n }\n\n /**\n * Creates a registration function for ngMaterial Layout attribute directive.\n * This is a `simple` transpose of attribute usage to class usage; where we ignore\n * any attribute value\n */\n function attributeWithoutValue(className) {\n return ['$mdUtil', '$interpolate', \"$log\", function(_$mdUtil_, _$interpolate_, _$log_) {\n $mdUtil = _$mdUtil_;\n $interpolate = _$interpolate_;\n $log = _$log_;\n\n return {\n restrict: 'A',\n compile: function(element, attr) {\n var linkFn;\n if (config.enabled) {\n // immediately replace static (non-interpolated) invalid values...\n\n validateAttributeValue( className,\n getNormalizedAttrValue(className, attr, \"\"),\n buildUpdateFn(element, className, attr)\n );\n\n translateToCssClass(null, element);\n\n // Use for postLink to account for transforms after ng-transclude.\n linkFn = translateToCssClass;\n }\n\n return linkFn || angular.noop;\n }\n };\n }];\n\n /**\n * Add as transformed class selector, then\n * remove the deprecated attribute selector\n */\n function translateToCssClass(scope, element) {\n element.addClass(className);\n }\n }\n\n\n\n /**\n * After link-phase, do NOT remove deprecated layout attribute selector.\n * Instead watch the attribute so interpolated data-bindings to layout\n * selectors will continue to be supported.\n *\n * $observe() the className and update with new class (after removing the last one)\n *\n * e.g. `layout=\"{{layoutDemo.direction}}\"` will update...\n *\n * NOTE: The value must match one of the specified styles in the CSS.\n * For example `flex-gt-md=\"{{size}}` where `scope.size == 47` will NOT work since\n * only breakpoints for 0, 5, 10, 15... 100, 33, 34, 66, 67 are defined.\n *\n */\n function updateClassWithValue(element, className) {\n var lastClass;\n\n return function updateClassFn(newValue) {\n var value = validateAttributeValue(className, newValue || \"\");\n if ( angular.isDefined(value) ) {\n if (lastClass) element.removeClass(lastClass);\n lastClass = !value ? className : className + \"-\" + value.replace(WHITESPACE, \"-\");\n element.addClass(lastClass);\n }\n };\n }\n\n /**\n * Provide console warning that this layout attribute has been deprecated\n *\n */\n function warnAttrNotSupported(className) {\n var parts = className.split(\"-\");\n return [\"$log\", function($log) {\n $log.warn(className + \"has been deprecated. Please use a `\" + parts[0] + \"-gt-<xxx>` variant.\");\n return angular.noop;\n }];\n }\n\n /**\n * Centralize warnings for known flexbox issues (especially IE-related issues)\n */\n function validateAttributeUsage(className, attr, element, $log){\n var message, usage, url;\n var nodeName = element[0].nodeName.toLowerCase();\n\n switch(className.replace(SUFFIXES,\"\")) {\n case \"flex\":\n if ((nodeName == \"md-button\") || (nodeName == \"fieldset\")){\n // @see https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers\n // Use <div flex> wrapper inside (preferred) or outside\n\n usage = \"<\" + nodeName + \" \" + className + \"></\" + nodeName + \">\";\n url = \"https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers\";\n message = \"Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.\";\n\n $log.warn( $mdUtil.supplant(message, [usage, url]) );\n }\n }\n\n }\n\n\n /**\n * For the Layout attribute value, validate or replace with default\n * fallback value\n */\n function validateAttributeValue(className, value, updateFn) {\n var origValue = value;\n\n if (!needsInterpolation(value)) {\n switch (className.replace(SUFFIXES,\"\")) {\n case 'layout' :\n if ( !findIn(value, LAYOUT_OPTIONS) ) {\n value = LAYOUT_OPTIONS[0]; // 'row';\n }\n break;\n\n case 'flex' :\n if (!findIn(value, FLEX_OPTIONS)) {\n if (isNaN(value)) {\n value = '';\n }\n }\n break;\n\n case 'flex-offset' :\n case 'flex-order' :\n if (!value || isNaN(+value)) {\n value = '0';\n }\n break;\n\n case 'layout-align' :\n var axis = extractAlignAxis(value);\n value = $mdUtil.supplant(\"{main}-{cross}\",axis);\n break;\n\n case 'layout-padding' :\n case 'layout-margin' :\n case 'layout-fill' :\n case 'layout-wrap' :\n case 'layout-nowrap' :\n case 'layout-nowrap' :\n value = '';\n break;\n }\n\n if (value != origValue) {\n (updateFn || angular.noop)(value);\n }\n }\n\n return value;\n }\n\n /**\n * Replace current attribute value with fallback value\n */\n function buildUpdateFn(element, className, attrs) {\n return function updateAttrValue(fallback) {\n if (!needsInterpolation(fallback)) {\n // Do not modify the element's attribute value; so\n // uses '<ui-layout layout=\"/api/sidebar.html\" />' will not\n // be affected. Just update the attrs value.\n attrs[attrs.$normalize(className)] = fallback;\n }\n };\n }\n\n /**\n * See if the original value has interpolation symbols:\n * e.g. flex-gt-md=\"{{triggerPoint}}\"\n */\n function needsInterpolation(value) {\n return (value || \"\").indexOf($interpolate.startSymbol()) > -1;\n }\n\n function getNormalizedAttrValue(className, attrs, defaultVal) {\n var normalizedAttr = attrs.$normalize(className);\n return attrs[normalizedAttr] ? attrs[normalizedAttr].replace(WHITESPACE, \"-\") : defaultVal || null;\n }\n\n function findIn(item, list, replaceWith) {\n item = replaceWith && item ? item.replace(WHITESPACE, replaceWith) : item;\n\n var found = false;\n if (item) {\n list.forEach(function(it) {\n it = replaceWith ? it.replace(WHITESPACE, replaceWith) : it;\n found = found || (it === item);\n });\n }\n return found;\n }\n\n function extractAlignAxis(attrValue) {\n var axis = {\n main : \"start\",\n cross: \"stretch\"\n }, values;\n\n attrValue = (attrValue || \"\");\n\n if ( attrValue.indexOf(\"-\") == 0 || attrValue.indexOf(\" \") == 0) {\n // For missing main-axis values\n attrValue = \"none\" + attrValue;\n }\n\n values = attrValue.toLowerCase().trim().replace(WHITESPACE, \"-\").split(\"-\");\n if ( values.length && (values[0] === \"space\") ) {\n // for main-axis values of \"space-around\" or \"space-between\"\n values = [ values[0]+\"-\"+values[1],values[2] ];\n }\n\n if ( values.length > 0 ) axis.main = values[0] || axis.main;\n if ( values.length > 1 ) axis.cross = values[1] || axis.cross;\n\n if ( ALIGNMENT_MAIN_AXIS.indexOf(axis.main) < 0 ) axis.main = \"start\";\n if ( ALIGNMENT_CROSS_AXIS.indexOf(axis.cross) < 0 ) axis.cross = \"stretch\";\n\n return axis;\n }\n\n\n})();\n\n})();\n(function(){\n\"use strict\";\n\n /**\n * @ngdoc module\n * @name material.core.componentRegistry\n *\n * @description\n * A component instance registration service.\n * Note: currently this as a private service in the SideNav component.\n */\n angular.module('material.core')\n .factory('$mdComponentRegistry', ComponentRegistry);\n\n /*\n * @private\n * @ngdoc factory\n * @name ComponentRegistry\n * @module material.core.componentRegistry\n *\n */\n function ComponentRegistry($log, $q) {\n\n var self;\n var instances = [ ];\n var pendings = { };\n\n return self = {\n /**\n * Used to print an error when an instance for a handle isn't found.\n */\n notFoundError: function(handle) {\n $log.error('No instance found for handle', handle);\n },\n /**\n * Return all registered instances as an array.\n */\n getInstances: function() {\n return instances;\n },\n\n /**\n * Get a registered instance.\n * @param handle the String handle to look up for a registered instance.\n */\n get: function(handle) {\n if ( !isValidID(handle) ) return null;\n\n var i, j, instance;\n for(i = 0, j = instances.length; i < j; i++) {\n instance = instances[i];\n if(instance.$$mdHandle === handle) {\n return instance;\n }\n }\n return null;\n },\n\n /**\n * Register an instance.\n * @param instance the instance to register\n * @param handle the handle to identify the instance under.\n */\n register: function(instance, handle) {\n if ( !handle ) return angular.noop;\n\n instance.$$mdHandle = handle;\n instances.push(instance);\n resolveWhen();\n\n return deregister;\n\n /**\n * Remove registration for an instance\n */\n function deregister() {\n var index = instances.indexOf(instance);\n if (index !== -1) {\n instances.splice(index, 1);\n }\n }\n\n /**\n * Resolve any pending promises for this instance\n */\n function resolveWhen() {\n var dfd = pendings[handle];\n if ( dfd ) {\n dfd.resolve( instance );\n delete pendings[handle];\n }\n }\n },\n\n /**\n * Async accessor to registered component instance\n * If not available then a promise is created to notify\n * all listeners when the instance is registered.\n */\n when : function(handle) {\n if ( isValidID(handle) ) {\n var deferred = $q.defer();\n var instance = self.get(handle);\n\n if ( instance ) {\n deferred.resolve( instance );\n } else {\n pendings[handle] = deferred;\n }\n\n return deferred.promise;\n }\n return $q.reject(\"Invalid `md-component-id` value.\");\n }\n\n };\n\n function isValidID(handle){\n return handle && (handle !== \"\");\n }\n\n }\n ComponentRegistry.$inject = [\"$log\", \"$q\"];\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdButtonInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-button. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the default ripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdButtonInkRipple', MdButtonInkRipple);\n\n function MdButtonInkRipple($mdInkRipple) {\n return {\n attach: function attachRipple(scope, element, options) {\n options = angular.extend(optionsForElement(element), options);\n\n return $mdInkRipple.attach(scope, element, options);\n }\n };\n\n function optionsForElement(element) {\n if (element.hasClass('md-icon-button')) {\n return {\n isMenuItem: element.hasClass('md-menu-item'),\n fitRipple: true,\n center: true\n };\n } else {\n return {\n isMenuItem: element.hasClass('md-menu-item'),\n dimBackground: true\n }\n }\n };\n }\n MdButtonInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdCheckboxInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-checkbox. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdCheckboxInkRipple', MdCheckboxInkRipple);\n\n function MdCheckboxInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n return $mdInkRipple.attach(scope, element, angular.extend({\n center: true,\n dimBackground: false,\n fitRipple: true\n }, options));\n };\n }\n MdCheckboxInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdListInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-list. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdListInkRipple', MdListInkRipple);\n\n function MdListInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n return $mdInkRipple.attach(scope, element, angular.extend({\n center: false,\n dimBackground: true,\n outline: false,\n rippleSize: 'full'\n }, options));\n };\n }\n MdListInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.core.ripple\n * @description\n * Ripple\n */\nangular.module('material.core')\n .factory('$mdInkRipple', InkRippleService)\n .directive('mdInkRipple', InkRippleDirective)\n .directive('mdNoInk', attrNoDirective)\n .directive('mdNoBar', attrNoDirective)\n .directive('mdNoStretch', attrNoDirective);\n\nvar DURATION = 450;\n\n/**\n * @ngdoc directive\n * @name mdInkRipple\n * @module material.core.ripple\n *\n * @description\n * The `md-ink-ripple` directive allows you to specify the ripple color or id a ripple is allowed.\n *\n * @param {string|boolean} md-ink-ripple A color string `#FF0000` or boolean (`false` or `0`) for preventing ripple\n *\n * @usage\n * ### String values\n * <hljs lang=\"html\">\n * <ANY md-ink-ripple=\"#FF0000\">\n * Ripples in red\n * </ANY>\n *\n * <ANY md-ink-ripple=\"false\">\n * Not rippling\n * </ANY>\n * </hljs>\n *\n * ### Interpolated values\n * <hljs lang=\"html\">\n * <ANY md-ink-ripple=\"{{ randomColor() }}\">\n * Ripples with the return value of 'randomColor' function\n * </ANY>\n *\n * <ANY md-ink-ripple=\"{{ canRipple() }}\">\n * Ripples if 'canRipple' function return value is not 'false' or '0'\n * </ANY>\n * </hljs>\n */\nfunction InkRippleDirective ($mdButtonInkRipple, $mdCheckboxInkRipple) {\n return {\n controller: angular.noop,\n link: function (scope, element, attr) {\n attr.hasOwnProperty('mdInkRippleCheckbox')\n ? $mdCheckboxInkRipple.attach(scope, element)\n : $mdButtonInkRipple.attach(scope, element);\n }\n };\n}\nInkRippleDirective.$inject = [\"$mdButtonInkRipple\", \"$mdCheckboxInkRipple\"];\n\n/**\n * @ngdoc service\n * @name $mdInkRipple\n * @module material.core.ripple\n *\n * @description\n * `$mdInkRipple` is a service for adding ripples to any element\n *\n * @usage\n * <hljs lang=\"js\">\n * app.factory('$myElementInkRipple', function($mdInkRipple) {\n * return {\n * attach: function (scope, element, options) {\n * return $mdInkRipple.attach(scope, element, angular.extend({\n * center: false,\n * dimBackground: true\n * }, options));\n * }\n * };\n * });\n *\n * app.controller('myController', function ($scope, $element, $myElementInkRipple) {\n * $scope.onClick = function (ev) {\n * $myElementInkRipple.attach($scope, angular.element(ev.target), { center: true });\n * }\n * });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdInkRipple#attach\n *\n * @description\n * Attaching given scope, element and options to inkRipple controller\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultRipple configuration\n * * `center` - Whether the ripple should start from the center of the container element\n * * `dimBackground` - Whether the background should be dimmed with the ripple color\n * * `colorElement` - The element the ripple should take its color from, defined by css property `color`\n * * `fitRipple` - Whether the ripple should fill the element\n */\nfunction InkRippleService ($injector) {\n return { attach: attach };\n function attach (scope, element, options) {\n if (element.controller('mdNoInk')) return angular.noop;\n return $injector.instantiate(InkRippleCtrl, {\n $scope: scope,\n $element: element,\n rippleOptions: options\n });\n }\n}\nInkRippleService.$inject = [\"$injector\"];\n\n/**\n * Controller used by the ripple service in order to apply ripples\n * @ngInject\n */\nfunction InkRippleCtrl ($scope, $element, rippleOptions, $window, $timeout, $mdUtil) {\n this.$window = $window;\n this.$timeout = $timeout;\n this.$mdUtil = $mdUtil;\n this.$scope = $scope;\n this.$element = $element;\n this.options = rippleOptions;\n this.mousedown = false;\n this.ripples = [];\n this.timeout = null; // Stores a reference to the most-recent ripple timeout\n this.lastRipple = null;\n\n $mdUtil.valueOnUse(this, 'container', this.createContainer);\n\n this.$element.addClass('md-ink-ripple');\n\n // attach method for unit tests\n ($element.controller('mdInkRipple') || {}).createRipple = angular.bind(this, this.createRipple);\n ($element.controller('mdInkRipple') || {}).setColor = angular.bind(this, this.color);\n\n this.bindEvents();\n}\nInkRippleCtrl.$inject = [\"$scope\", \"$element\", \"rippleOptions\", \"$window\", \"$timeout\", \"$mdUtil\"];\n\n\n/**\n * Either remove or unlock any remaining ripples when the user mouses off of the element (either by\n * mouseup or mouseleave event)\n */\nfunction autoCleanup (self, cleanupFn) {\n\n if ( self.mousedown || self.lastRipple ) {\n self.mousedown = false;\n self.$mdUtil.nextTick( angular.bind(self, cleanupFn), false);\n }\n\n}\n\n\n/**\n * Returns the color that the ripple should be (either based on CSS or hard-coded)\n * @returns {string}\n */\nInkRippleCtrl.prototype.color = function (value) {\n var self = this;\n\n // If assigning a color value, apply it to background and the ripple color\n if (angular.isDefined(value)) {\n self._color = self._parseColor(value);\n }\n\n // If color lookup, use assigned, defined, or inherited\n return self._color || self._parseColor( self.inkRipple() ) || self._parseColor( getElementColor() );\n\n /**\n * Finds the color element and returns its text color for use as default ripple color\n * @returns {string}\n */\n function getElementColor () {\n var items = self.options && self.options.colorElement ? self.options.colorElement : [];\n var elem = items.length ? items[ 0 ] : self.$element[ 0 ];\n\n return elem ? self.$window.getComputedStyle(elem).color : 'rgb(0,0,0)';\n }\n};\n\n/**\n * Updating the ripple colors based on the current inkRipple value\n * or the element's computed style color\n */\nInkRippleCtrl.prototype.calculateColor = function () {\n return this.color();\n};\n\n\n/**\n * Takes a string color and converts it to RGBA format\n * @param color {string}\n * @param [multiplier] {int}\n * @returns {string}\n */\n\nInkRippleCtrl.prototype._parseColor = function parseColor (color, multiplier) {\n multiplier = multiplier || 1;\n\n if (!color) return;\n if (color.indexOf('rgba') === 0) return color.replace(/\\d?\\.?\\d*\\s*\\)\\s*$/, (0.1 * multiplier).toString() + ')');\n if (color.indexOf('rgb') === 0) return rgbToRGBA(color);\n if (color.indexOf('#') === 0) return hexToRGBA(color);\n\n /**\n * Converts hex value to RGBA string\n * @param color {string}\n * @returns {string}\n */\n function hexToRGBA (color) {\n var hex = color[ 0 ] === '#' ? color.substr(1) : color,\n dig = hex.length / 3,\n red = hex.substr(0, dig),\n green = hex.substr(dig, dig),\n blue = hex.substr(dig * 2);\n if (dig === 1) {\n red += red;\n green += green;\n blue += blue;\n }\n return 'rgba(' + parseInt(red, 16) + ',' + parseInt(green, 16) + ',' + parseInt(blue, 16) + ',0.1)';\n }\n\n /**\n * Converts an RGB color to RGBA\n * @param color {string}\n * @returns {string}\n */\n function rgbToRGBA (color) {\n return color.replace(')', ', 0.1)').replace('(', 'a(');\n }\n\n};\n\n/**\n * Binds events to the root element for\n */\nInkRippleCtrl.prototype.bindEvents = function () {\n this.$element.on('mousedown', angular.bind(this, this.handleMousedown));\n this.$element.on('mouseup touchend', angular.bind(this, this.handleMouseup));\n this.$element.on('mouseleave', angular.bind(this, this.handleMouseup));\n this.$element.on('touchmove', angular.bind(this, this.handleTouchmove));\n};\n\n/**\n * Create a new ripple on every mousedown event from the root element\n * @param event {MouseEvent}\n */\nInkRippleCtrl.prototype.handleMousedown = function (event) {\n if ( this.mousedown ) return;\n\n // When jQuery is loaded, we have to get the original event\n if (event.hasOwnProperty('originalEvent')) event = event.originalEvent;\n this.mousedown = true;\n if (this.options.center) {\n this.createRipple(this.container.prop('clientWidth') / 2, this.container.prop('clientWidth') / 2);\n } else {\n\n // We need to calculate the relative coordinates if the target is a sublayer of the ripple element\n if (event.srcElement !== this.$element[0]) {\n var layerRect = this.$element[0].getBoundingClientRect();\n var layerX = event.clientX - layerRect.left;\n var layerY = event.clientY - layerRect.top;\n\n this.createRipple(layerX, layerY);\n } else {\n this.createRipple(event.offsetX, event.offsetY);\n }\n }\n};\n\n/**\n * Either remove or unlock any remaining ripples when the user mouses off of the element (either by\n * mouseup, touchend or mouseleave event)\n */\nInkRippleCtrl.prototype.handleMouseup = function () {\n autoCleanup(this, this.clearRipples);\n};\n\n/**\n * Either remove or unlock any remaining ripples when the user mouses off of the element (by\n * touchmove)\n */\nInkRippleCtrl.prototype.handleTouchmove = function () {\n autoCleanup(this, this.deleteRipples);\n};\n\n/**\n * Cycles through all ripples and attempts to remove them.\n */\nInkRippleCtrl.prototype.deleteRipples = function () {\n for (var i = 0; i < this.ripples.length; i++) {\n this.ripples[ i ].remove();\n }\n};\n\n/**\n * Cycles through all ripples and attempts to remove them with fade.\n * Depending on logic within `fadeInComplete`, some removals will be postponed.\n */\nInkRippleCtrl.prototype.clearRipples = function () {\n for (var i = 0; i < this.ripples.length; i++) {\n this.fadeInComplete(this.ripples[ i ]);\n }\n};\n\n/**\n * Creates the ripple container element\n * @returns {*}\n */\nInkRippleCtrl.prototype.createContainer = function () {\n var container = angular.element('<div class=\"md-ripple-container\"></div>');\n this.$element.append(container);\n return container;\n};\n\nInkRippleCtrl.prototype.clearTimeout = function () {\n if (this.timeout) {\n this.$timeout.cancel(this.timeout);\n this.timeout = null;\n }\n};\n\nInkRippleCtrl.prototype.isRippleAllowed = function () {\n var element = this.$element[0];\n do {\n if (!element.tagName || element.tagName === 'BODY') break;\n\n if (element && angular.isFunction(element.hasAttribute)) {\n if (element.hasAttribute('disabled')) return false;\n if (this.inkRipple() === 'false' || this.inkRipple() === '0') return false;\n }\n\n } while (element = element.parentNode);\n return true;\n};\n\n/**\n * The attribute `md-ink-ripple` may be a static or interpolated\n * color value OR a boolean indicator (used to disable ripples)\n */\nInkRippleCtrl.prototype.inkRipple = function () {\n return this.$element.attr('md-ink-ripple');\n};\n\n/**\n * Creates a new ripple and adds it to the container. Also tracks ripple in `this.ripples`.\n * @param left\n * @param top\n */\nInkRippleCtrl.prototype.createRipple = function (left, top) {\n if (!this.isRippleAllowed()) return;\n\n var ctrl = this;\n var ripple = angular.element('<div class=\"md-ripple\"></div>');\n var width = this.$element.prop('clientWidth');\n var height = this.$element.prop('clientHeight');\n var x = Math.max(Math.abs(width - left), left) * 2;\n var y = Math.max(Math.abs(height - top), top) * 2;\n var size = getSize(this.options.fitRipple, x, y);\n var color = this.calculateColor();\n\n ripple.css({\n left: left + 'px',\n top: top + 'px',\n background: 'black',\n width: size + 'px',\n height: size + 'px',\n backgroundColor: rgbaToRGB(color),\n borderColor: rgbaToRGB(color)\n });\n this.lastRipple = ripple;\n\n // we only want one timeout to be running at a time\n this.clearTimeout();\n this.timeout = this.$timeout(function () {\n ctrl.clearTimeout();\n if (!ctrl.mousedown) ctrl.fadeInComplete(ripple);\n }, DURATION * 0.35, false);\n\n if (this.options.dimBackground) this.container.css({ backgroundColor: color });\n this.container.append(ripple);\n this.ripples.push(ripple);\n ripple.addClass('md-ripple-placed');\n\n this.$mdUtil.nextTick(function () {\n\n ripple.addClass('md-ripple-scaled md-ripple-active');\n ctrl.$timeout(function () {\n ctrl.clearRipples();\n }, DURATION, false);\n\n }, false);\n\n function rgbaToRGB (color) {\n return color\n ? color.replace('rgba', 'rgb').replace(/,[^\\),]+\\)/, ')')\n : 'rgb(0,0,0)';\n }\n\n function getSize (fit, x, y) {\n return fit\n ? Math.max(x, y)\n : Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n }\n};\n\n\n\n/**\n * After fadeIn finishes, either kicks off the fade-out animation or queues the element for removal on mouseup\n * @param ripple\n */\nInkRippleCtrl.prototype.fadeInComplete = function (ripple) {\n if (this.lastRipple === ripple) {\n if (!this.timeout && !this.mousedown) {\n this.removeRipple(ripple);\n }\n } else {\n this.removeRipple(ripple);\n }\n};\n\n/**\n * Kicks off the animation for removing a ripple\n * @param ripple {Element}\n */\nInkRippleCtrl.prototype.removeRipple = function (ripple) {\n var ctrl = this;\n var index = this.ripples.indexOf(ripple);\n if (index < 0) return;\n this.ripples.splice(this.ripples.indexOf(ripple), 1);\n ripple.removeClass('md-ripple-active');\n if (this.ripples.length === 0) this.container.css({ backgroundColor: '' });\n // use a 2-second timeout in order to allow for the animation to finish\n // we don't actually care how long the animation takes\n this.$timeout(function () {\n ctrl.fadeOutComplete(ripple);\n }, DURATION, false);\n};\n\n/**\n * Removes the provided ripple from the DOM\n * @param ripple\n */\nInkRippleCtrl.prototype.fadeOutComplete = function (ripple) {\n ripple.remove();\n this.lastRipple = null;\n};\n\n/**\n * Used to create an empty directive. This is used to track flag-directives whose children may have\n * functionality based on them.\n *\n * Example: `md-no-ink` will potentially be used by all child directives.\n */\nfunction attrNoDirective () {\n return { controller: angular.noop };\n}\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdTabInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-tabs. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdTabInkRipple', MdTabInkRipple);\n\n function MdTabInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n return $mdInkRipple.attach(scope, element, angular.extend({\n center: false,\n dimBackground: true,\n outline: false,\n rippleSize: 'full'\n }, options));\n };\n }\n MdTabInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core.theming.palette', [])\n.constant('$mdColorPalette', {\n 'red': {\n '50': '#ffebee',\n '100': '#ffcdd2',\n '200': '#ef9a9a',\n '300': '#e57373',\n '400': '#ef5350',\n '500': '#f44336',\n '600': '#e53935',\n '700': '#d32f2f',\n '800': '#c62828',\n '900': '#b71c1c',\n 'A100': '#ff8a80',\n 'A200': '#ff5252',\n 'A400': '#ff1744',\n 'A700': '#d50000',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300 A100',\n 'contrastStrongLightColors': '400 500 600 700 A200 A400 A700'\n },\n 'pink': {\n '50': '#fce4ec',\n '100': '#f8bbd0',\n '200': '#f48fb1',\n '300': '#f06292',\n '400': '#ec407a',\n '500': '#e91e63',\n '600': '#d81b60',\n '700': '#c2185b',\n '800': '#ad1457',\n '900': '#880e4f',\n 'A100': '#ff80ab',\n 'A200': '#ff4081',\n 'A400': '#f50057',\n 'A700': '#c51162',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '500 600 A200 A400 A700'\n },\n 'purple': {\n '50': '#f3e5f5',\n '100': '#e1bee7',\n '200': '#ce93d8',\n '300': '#ba68c8',\n '400': '#ab47bc',\n '500': '#9c27b0',\n '600': '#8e24aa',\n '700': '#7b1fa2',\n '800': '#6a1b9a',\n '900': '#4a148c',\n 'A100': '#ea80fc',\n 'A200': '#e040fb',\n 'A400': '#d500f9',\n 'A700': '#aa00ff',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '300 400 A200 A400 A700'\n },\n 'deep-purple': {\n '50': '#ede7f6',\n '100': '#d1c4e9',\n '200': '#b39ddb',\n '300': '#9575cd',\n '400': '#7e57c2',\n '500': '#673ab7',\n '600': '#5e35b1',\n '700': '#512da8',\n '800': '#4527a0',\n '900': '#311b92',\n 'A100': '#b388ff',\n 'A200': '#7c4dff',\n 'A400': '#651fff',\n 'A700': '#6200ea',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '300 400 A200'\n },\n 'indigo': {\n '50': '#e8eaf6',\n '100': '#c5cae9',\n '200': '#9fa8da',\n '300': '#7986cb',\n '400': '#5c6bc0',\n '500': '#3f51b5',\n '600': '#3949ab',\n '700': '#303f9f',\n '800': '#283593',\n '900': '#1a237e',\n 'A100': '#8c9eff',\n 'A200': '#536dfe',\n 'A400': '#3d5afe',\n 'A700': '#304ffe',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '300 400 A200 A400'\n },\n 'blue': {\n '50': '#e3f2fd',\n '100': '#bbdefb',\n '200': '#90caf9',\n '300': '#64b5f6',\n '400': '#42a5f5',\n '500': '#2196f3',\n '600': '#1e88e5',\n '700': '#1976d2',\n '800': '#1565c0',\n '900': '#0d47a1',\n 'A100': '#82b1ff',\n 'A200': '#448aff',\n 'A400': '#2979ff',\n 'A700': '#2962ff',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300 400 A100',\n 'contrastStrongLightColors': '500 600 700 A200 A400 A700'\n },\n 'light-blue': {\n '50': '#e1f5fe',\n '100': '#b3e5fc',\n '200': '#81d4fa',\n '300': '#4fc3f7',\n '400': '#29b6f6',\n '500': '#03a9f4',\n '600': '#039be5',\n '700': '#0288d1',\n '800': '#0277bd',\n '900': '#01579b',\n 'A100': '#80d8ff',\n 'A200': '#40c4ff',\n 'A400': '#00b0ff',\n 'A700': '#0091ea',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '600 700 800 900 A700',\n 'contrastStrongLightColors': '600 700 800 A700'\n },\n 'cyan': {\n '50': '#e0f7fa',\n '100': '#b2ebf2',\n '200': '#80deea',\n '300': '#4dd0e1',\n '400': '#26c6da',\n '500': '#00bcd4',\n '600': '#00acc1',\n '700': '#0097a7',\n '800': '#00838f',\n '900': '#006064',\n 'A100': '#84ffff',\n 'A200': '#18ffff',\n 'A400': '#00e5ff',\n 'A700': '#00b8d4',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '700 800 900',\n 'contrastStrongLightColors': '700 800 900'\n },\n 'teal': {\n '50': '#e0f2f1',\n '100': '#b2dfdb',\n '200': '#80cbc4',\n '300': '#4db6ac',\n '400': '#26a69a',\n '500': '#009688',\n '600': '#00897b',\n '700': '#00796b',\n '800': '#00695c',\n '900': '#004d40',\n 'A100': '#a7ffeb',\n 'A200': '#64ffda',\n 'A400': '#1de9b6',\n 'A700': '#00bfa5',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '500 600 700 800 900',\n 'contrastStrongLightColors': '500 600 700'\n },\n 'green': {\n '50': '#e8f5e9',\n '100': '#c8e6c9',\n '200': '#a5d6a7',\n '300': '#81c784',\n '400': '#66bb6a',\n '500': '#4caf50',\n '600': '#43a047',\n '700': '#388e3c',\n '800': '#2e7d32',\n '900': '#1b5e20',\n 'A100': '#b9f6ca',\n 'A200': '#69f0ae',\n 'A400': '#00e676',\n 'A700': '#00c853',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '600 700 800 900',\n 'contrastStrongLightColors': '600 700'\n },\n 'light-green': {\n '50': '#f1f8e9',\n '100': '#dcedc8',\n '200': '#c5e1a5',\n '300': '#aed581',\n '400': '#9ccc65',\n '500': '#8bc34a',\n '600': '#7cb342',\n '700': '#689f38',\n '800': '#558b2f',\n '900': '#33691e',\n 'A100': '#ccff90',\n 'A200': '#b2ff59',\n 'A400': '#76ff03',\n 'A700': '#64dd17',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '700 800 900',\n 'contrastStrongLightColors': '700 800 900'\n },\n 'lime': {\n '50': '#f9fbe7',\n '100': '#f0f4c3',\n '200': '#e6ee9c',\n '300': '#dce775',\n '400': '#d4e157',\n '500': '#cddc39',\n '600': '#c0ca33',\n '700': '#afb42b',\n '800': '#9e9d24',\n '900': '#827717',\n 'A100': '#f4ff81',\n 'A200': '#eeff41',\n 'A400': '#c6ff00',\n 'A700': '#aeea00',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '900',\n 'contrastStrongLightColors': '900'\n },\n 'yellow': {\n '50': '#fffde7',\n '100': '#fff9c4',\n '200': '#fff59d',\n '300': '#fff176',\n '400': '#ffee58',\n '500': '#ffeb3b',\n '600': '#fdd835',\n '700': '#fbc02d',\n '800': '#f9a825',\n '900': '#f57f17',\n 'A100': '#ffff8d',\n 'A200': '#ffff00',\n 'A400': '#ffea00',\n 'A700': '#ffd600',\n 'contrastDefaultColor': 'dark'\n },\n 'amber': {\n '50': '#fff8e1',\n '100': '#ffecb3',\n '200': '#ffe082',\n '300': '#ffd54f',\n '400': '#ffca28',\n '500': '#ffc107',\n '600': '#ffb300',\n '700': '#ffa000',\n '800': '#ff8f00',\n '900': '#ff6f00',\n 'A100': '#ffe57f',\n 'A200': '#ffd740',\n 'A400': '#ffc400',\n 'A700': '#ffab00',\n 'contrastDefaultColor': 'dark'\n },\n 'orange': {\n '50': '#fff3e0',\n '100': '#ffe0b2',\n '200': '#ffcc80',\n '300': '#ffb74d',\n '400': '#ffa726',\n '500': '#ff9800',\n '600': '#fb8c00',\n '700': '#f57c00',\n '800': '#ef6c00',\n '900': '#e65100',\n 'A100': '#ffd180',\n 'A200': '#ffab40',\n 'A400': '#ff9100',\n 'A700': '#ff6d00',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '800 900',\n 'contrastStrongLightColors': '800 900'\n },\n 'deep-orange': {\n '50': '#fbe9e7',\n '100': '#ffccbc',\n '200': '#ffab91',\n '300': '#ff8a65',\n '400': '#ff7043',\n '500': '#ff5722',\n '600': '#f4511e',\n '700': '#e64a19',\n '800': '#d84315',\n '900': '#bf360c',\n 'A100': '#ff9e80',\n 'A200': '#ff6e40',\n 'A400': '#ff3d00',\n 'A700': '#dd2c00',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300 400 A100 A200',\n 'contrastStrongLightColors': '500 600 700 800 900 A400 A700'\n },\n 'brown': {\n '50': '#efebe9',\n '100': '#d7ccc8',\n '200': '#bcaaa4',\n '300': '#a1887f',\n '400': '#8d6e63',\n '500': '#795548',\n '600': '#6d4c41',\n '700': '#5d4037',\n '800': '#4e342e',\n '900': '#3e2723',\n 'A100': '#d7ccc8',\n 'A200': '#bcaaa4',\n 'A400': '#8d6e63',\n 'A700': '#5d4037',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200',\n 'contrastStrongLightColors': '300 400'\n },\n 'grey': {\n '50': '#fafafa',\n '100': '#f5f5f5',\n '200': '#eeeeee',\n '300': '#e0e0e0',\n '400': '#bdbdbd',\n '500': '#9e9e9e',\n '600': '#757575',\n '700': '#616161',\n '800': '#424242',\n '900': '#212121',\n '1000': '#000000',\n 'A100': '#ffffff',\n 'A200': '#eeeeee',\n 'A400': '#bdbdbd',\n 'A700': '#616161',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '600 700 800 900'\n },\n 'blue-grey': {\n '50': '#eceff1',\n '100': '#cfd8dc',\n '200': '#b0bec5',\n '300': '#90a4ae',\n '400': '#78909c',\n '500': '#607d8b',\n '600': '#546e7a',\n '700': '#455a64',\n '800': '#37474f',\n '900': '#263238',\n 'A100': '#cfd8dc',\n 'A200': '#b0bec5',\n 'A400': '#78909c',\n 'A700': '#455a64',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300',\n 'contrastStrongLightColors': '400 500'\n }\n});\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core.theming', ['material.core.theming.palette'])\n .directive('mdTheme', ThemingDirective)\n .directive('mdThemable', ThemableDirective)\n .provider('$mdTheming', ThemingProvider)\n .run(generateAllThemes);\n\n/**\n * @ngdoc service\n * @name $mdThemingProvider\n * @module material.core.theming\n *\n * @description Provider to configure the `$mdTheming` service.\n */\n\n/**\n * @ngdoc method\n * @name $mdThemingProvider#setNonce\n * @param {string} nonceValue The nonce to be added as an attribute to the theme style tags.\n * Setting a value allows the use CSP policy without using the unsafe-inline directive.\n */\n\n/**\n * @ngdoc method\n * @name $mdThemingProvider#setDefaultTheme\n * @param {string} themeName Default theme name to be applied to elements. Default value is `default`.\n */\n\n/**\n * @ngdoc method\n * @name $mdThemingProvider#alwaysWatchTheme\n * @param {boolean} watch Whether or not to always watch themes for changes and re-apply\n * classes when they change. Default is `false`. Enabling can reduce performance.\n */\n\n/* Some Example Valid Theming Expressions\n * =======================================\n *\n * Intention group expansion: (valid for primary, accent, warn, background)\n *\n * {{primary-100}} - grab shade 100 from the primary palette\n * {{primary-100-0.7}} - grab shade 100, apply opacity of 0.7\n * {{primary-100-contrast}} - grab shade 100's contrast color\n * {{primary-hue-1}} - grab the shade assigned to hue-1 from the primary palette\n * {{primary-hue-1-0.7}} - apply 0.7 opacity to primary-hue-1\n * {{primary-color}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured shades set for each hue\n * {{primary-color-0.7}} - Apply 0.7 opacity to each of the above rules\n * {{primary-contrast}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured contrast (ie. text) color shades set for each hue\n * {{primary-contrast-0.7}} - Apply 0.7 opacity to each of the above rules\n *\n * Foreground expansion: Applies rgba to black/white foreground text\n *\n * {{foreground-1}} - used for primary text\n * {{foreground-2}} - used for secondary text/divider\n * {{foreground-3}} - used for disabled text\n * {{foreground-4}} - used for dividers\n *\n */\n\n// In memory generated CSS rules; registered by theme.name\nvar GENERATED = { };\n\n// In memory storage of defined themes and color palettes (both loaded by CSS, and user specified)\nvar PALETTES;\nvar THEMES;\n\nvar DARK_FOREGROUND = {\n name: 'dark',\n '1': 'rgba(0,0,0,0.87)',\n '2': 'rgba(0,0,0,0.54)',\n '3': 'rgba(0,0,0,0.26)',\n '4': 'rgba(0,0,0,0.12)'\n};\nvar LIGHT_FOREGROUND = {\n name: 'light',\n '1': 'rgba(255,255,255,1.0)',\n '2': 'rgba(255,255,255,0.7)',\n '3': 'rgba(255,255,255,0.3)',\n '4': 'rgba(255,255,255,0.12)'\n};\n\nvar DARK_SHADOW = '1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4)';\nvar LIGHT_SHADOW = '';\n\nvar DARK_CONTRAST_COLOR = colorToRgbaArray('rgba(0,0,0,0.87)');\nvar LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgba(255,255,255,0.87)');\nvar STRONG_LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgb(255,255,255)');\n\nvar THEME_COLOR_TYPES = ['primary', 'accent', 'warn', 'background'];\nvar DEFAULT_COLOR_TYPE = 'primary';\n\n// A color in a theme will use these hues by default, if not specified by user.\nvar LIGHT_DEFAULT_HUES = {\n 'accent': {\n 'default': 'A200',\n 'hue-1': 'A100',\n 'hue-2': 'A400',\n 'hue-3': 'A700'\n },\n 'background': {\n 'default': 'A100',\n 'hue-1': '300',\n 'hue-2': '800',\n 'hue-3': '900'\n }\n};\n\nvar DARK_DEFAULT_HUES = {\n 'background': {\n 'default': '800',\n 'hue-1': '600',\n 'hue-2': '300',\n 'hue-3': '900'\n }\n};\nTHEME_COLOR_TYPES.forEach(function(colorType) {\n // Color types with unspecified default hues will use these default hue values\n var defaultDefaultHues = {\n 'default': '500',\n 'hue-1': '300',\n 'hue-2': '800',\n 'hue-3': 'A100'\n };\n if (!LIGHT_DEFAULT_HUES[colorType]) LIGHT_DEFAULT_HUES[colorType] = defaultDefaultHues;\n if (!DARK_DEFAULT_HUES[colorType]) DARK_DEFAULT_HUES[colorType] = defaultDefaultHues;\n});\n\nvar VALID_HUE_VALUES = [\n '50', '100', '200', '300', '400', '500', '600',\n '700', '800', '900', 'A100', 'A200', 'A400', 'A700'\n];\n\n// Whether or not themes are to be generated on-demand (vs. eagerly).\nvar generateOnDemand = false;\n\n// Nonce to be added as an attribute to the generated themes style tags.\nvar nonce = null;\n\nfunction ThemingProvider($mdColorPalette) {\n PALETTES = { };\n THEMES = { };\n\n var themingProvider;\n var defaultTheme = 'default';\n var alwaysWatchTheme = false;\n\n // Load JS Defined Palettes\n angular.extend(PALETTES, $mdColorPalette);\n\n // Default theme defined in core.js\n\n ThemingService.$inject = [\"$rootScope\", \"$log\"];\n return themingProvider = {\n definePalette: definePalette,\n extendPalette: extendPalette,\n theme: registerTheme,\n\n setNonce: function(nonceValue) {\n nonce = nonceValue;\n },\n setDefaultTheme: function(theme) {\n defaultTheme = theme;\n },\n alwaysWatchTheme: function(alwaysWatch) {\n alwaysWatchTheme = alwaysWatch;\n },\n generateThemesOnDemand: function(onDemand) {\n generateOnDemand = onDemand;\n },\n $get: ThemingService,\n _LIGHT_DEFAULT_HUES: LIGHT_DEFAULT_HUES,\n _DARK_DEFAULT_HUES: DARK_DEFAULT_HUES,\n _PALETTES: PALETTES,\n _THEMES: THEMES,\n _parseRules: parseRules,\n _rgba: rgba\n };\n\n // Example: $mdThemingProvider.definePalette('neonRed', { 50: '#f5fafa', ... });\n function definePalette(name, map) {\n map = map || {};\n PALETTES[name] = checkPaletteValid(name, map);\n return themingProvider;\n }\n\n // Returns an new object which is a copy of a given palette `name` with variables from\n // `map` overwritten\n // Example: var neonRedMap = $mdThemingProvider.extendPalette('red', { 50: '#f5fafafa' });\n function extendPalette(name, map) {\n return checkPaletteValid(name, angular.extend({}, PALETTES[name] || {}, map) );\n }\n\n // Make sure that palette has all required hues\n function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }\n\n // Register a theme (which is a collection of color palettes to use with various states\n // ie. warn, accent, primary )\n // Optionally inherit from an existing theme\n // $mdThemingProvider.theme('custom-theme').primaryPalette('red');\n function registerTheme(name, inheritFrom) {\n if (THEMES[name]) return THEMES[name];\n\n inheritFrom = inheritFrom || 'default';\n\n var parentTheme = typeof inheritFrom === 'string' ? THEMES[inheritFrom] : inheritFrom;\n var theme = new Theme(name);\n\n if (parentTheme) {\n angular.forEach(parentTheme.colors, function(color, colorType) {\n theme.colors[colorType] = {\n name: color.name,\n // Make sure a COPY of the hues is given to the child color,\n // not the same reference.\n hues: angular.extend({}, color.hues)\n };\n });\n }\n THEMES[name] = theme;\n\n return theme;\n }\n\n function Theme(name) {\n var self = this;\n self.name = name;\n self.colors = {};\n\n self.dark = setDark;\n setDark(false);\n\n function setDark(isDark) {\n isDark = arguments.length === 0 ? true : !!isDark;\n\n // If no change, abort\n if (isDark === self.isDark) return;\n\n self.isDark = isDark;\n\n self.foregroundPalette = self.isDark ? LIGHT_FOREGROUND : DARK_FOREGROUND;\n self.foregroundShadow = self.isDark ? DARK_SHADOW : LIGHT_SHADOW;\n\n // Light and dark themes have different default hues.\n // Go through each existing color type for this theme, and for every\n // hue value that is still the default hue value from the previous light/dark setting,\n // set it to the default hue value from the new light/dark setting.\n var newDefaultHues = self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES;\n var oldDefaultHues = self.isDark ? LIGHT_DEFAULT_HUES : DARK_DEFAULT_HUES;\n angular.forEach(newDefaultHues, function(newDefaults, colorType) {\n var color = self.colors[colorType];\n var oldDefaults = oldDefaultHues[colorType];\n if (color) {\n for (var hueName in color.hues) {\n if (color.hues[hueName] === oldDefaults[hueName]) {\n color.hues[hueName] = newDefaults[hueName];\n }\n }\n }\n });\n\n return self;\n }\n\n THEME_COLOR_TYPES.forEach(function(colorType) {\n var defaultHues = (self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES)[colorType];\n self[colorType + 'Palette'] = function setPaletteType(paletteName, hues) {\n var color = self.colors[colorType] = {\n name: paletteName,\n hues: angular.extend({}, defaultHues, hues)\n };\n\n Object.keys(color.hues).forEach(function(name) {\n if (!defaultHues[name]) {\n throw new Error(\"Invalid hue name '%1' in theme %2's %3 color %4. Available hue names: %4\"\n .replace('%1', name)\n .replace('%2', self.name)\n .replace('%3', paletteName)\n .replace('%4', Object.keys(defaultHues).join(', '))\n );\n }\n });\n Object.keys(color.hues).map(function(key) {\n return color.hues[key];\n }).forEach(function(hueValue) {\n if (VALID_HUE_VALUES.indexOf(hueValue) == -1) {\n throw new Error(\"Invalid hue value '%1' in theme %2's %3 color %4. Available hue values: %5\"\n .replace('%1', hueValue)\n .replace('%2', self.name)\n .replace('%3', colorType)\n .replace('%4', paletteName)\n .replace('%5', VALID_HUE_VALUES.join(', '))\n );\n }\n });\n return self;\n };\n\n self[colorType + 'Color'] = function() {\n var args = Array.prototype.slice.call(arguments);\n console.warn('$mdThemingProviderTheme.' + colorType + 'Color() has been deprecated. ' +\n 'Use $mdThemingProviderTheme.' + colorType + 'Palette() instead.');\n return self[colorType + 'Palette'].apply(self, args);\n };\n });\n }\n\n /**\n * @ngdoc service\n * @name $mdTheming\n *\n * @description\n *\n * Service that makes an element apply theming related classes to itself.\n *\n * ```js\n * app.directive('myFancyDirective', function($mdTheming) {\n * return {\n * restrict: 'e',\n * link: function(scope, el, attrs) {\n * $mdTheming(el);\n * }\n * };\n * });\n * ```\n * @param {el=} element to apply theming to\n */\n /* @ngInject */\n function ThemingService($rootScope, $log) {\n // Allow us to be invoked via a linking function signature.\n var applyTheme = function (scope, el) {\n if (el === undefined) { el = scope; scope = undefined; }\n if (scope === undefined) { scope = $rootScope; }\n applyTheme.inherit(el, el);\n };\n\n applyTheme.THEMES = angular.extend({}, THEMES);\n applyTheme.inherit = inheritTheme;\n applyTheme.registered = registered;\n applyTheme.defaultTheme = function() { return defaultTheme; };\n applyTheme.generateTheme = function(name) { generateTheme(name, nonce); };\n\n return applyTheme;\n\n /**\n * Determine is specified theme name is a valid, registered theme\n */\n function registered(themeName) {\n if (themeName === undefined || themeName === '') return true;\n return applyTheme.THEMES[themeName] !== undefined;\n }\n\n /**\n * Get theme name for the element, then update with Theme CSS class\n */\n function inheritTheme (el, parent) {\n var ctrl = parent.controller('mdTheme');\n var attrThemeValue = el.attr('md-theme-watch');\n var watchTheme = (alwaysWatchTheme || angular.isDefined(attrThemeValue)) && attrThemeValue != 'false';\n\n updateThemeClass(lookupThemeName());\n\n el.on('$destroy', watchTheme ? $rootScope.$watch(lookupThemeName, updateThemeClass) : angular.noop );\n\n /**\n * Find the theme name from the parent controller or element data\n */\n function lookupThemeName() {\n // As a few components (dialog) add their controllers later, we should also watch for a controller init.\n ctrl = parent.controller('mdTheme') || el.data('$mdThemeController');\n return ctrl && ctrl.$mdTheme || (defaultTheme == 'default' ? '' : defaultTheme);\n }\n\n /**\n * Remove old theme class and apply a new one\n * NOTE: if not a valid theme name, then the current name is not changed\n */\n function updateThemeClass(theme) {\n if (!theme) return;\n if (!registered(theme)) {\n $log.warn('Attempted to use unregistered theme \\'' + theme + '\\'. ' +\n 'Register it with $mdThemingProvider.theme().');\n }\n\n var oldTheme = el.data('$mdThemeName');\n if (oldTheme) el.removeClass('md-' + oldTheme +'-theme');\n el.addClass('md-' + theme + '-theme');\n el.data('$mdThemeName', theme);\n if (ctrl) {\n el.data('$mdThemeController', ctrl);\n }\n }\n }\n\n }\n}\nThemingProvider.$inject = [\"$mdColorPalette\"];\n\nfunction ThemingDirective($mdTheming, $interpolate, $log) {\n return {\n priority: 100,\n link: {\n pre: function(scope, el, attrs) {\n var ctrl = {\n $setTheme: function(theme) {\n if (!$mdTheming.registered(theme)) {\n $log.warn('attempted to use unregistered theme \\'' + theme + '\\'');\n }\n ctrl.$mdTheme = theme;\n }\n };\n el.data('$mdThemeController', ctrl);\n ctrl.$setTheme($interpolate(attrs.mdTheme)(scope));\n attrs.$observe('mdTheme', ctrl.$setTheme);\n }\n }\n };\n}\nThemingDirective.$inject = [\"$mdTheming\", \"$interpolate\", \"$log\"];\n\nfunction ThemableDirective($mdTheming) {\n return $mdTheming;\n}\nThemableDirective.$inject = [\"$mdTheming\"];\n\nfunction parseRules(theme, colorType, rules) {\n checkValidPalette(theme, colorType);\n\n rules = rules.replace(/THEME_NAME/g, theme.name);\n var generatedRules = [];\n var color = theme.colors[colorType];\n\n var themeNameRegex = new RegExp('.md-' + theme.name + '-theme', 'g');\n // Matches '{{ primary-color }}', etc\n var hueRegex = new RegExp('(\\'|\")?{{\\\\s*(' + colorType + ')-(color|contrast)-?(\\\\d\\\\.?\\\\d*)?\\\\s*}}(\\\"|\\')?','g');\n var simpleVariableRegex = /'?\"?\\{\\{\\s*([a-zA-Z]+)-(A?\\d+|hue\\-[0-3]|shadow)-?(\\d\\.?\\d*)?(contrast)?\\s*\\}\\}'?\"?/g;\n var palette = PALETTES[color.name];\n\n // find and replace simple variables where we use a specific hue, not an entire palette\n // eg. \"{{primary-100}}\"\n //\\(' + THEME_COLOR_TYPES.join('\\|') + '\\)'\n rules = rules.replace(simpleVariableRegex, function(match, colorType, hue, opacity, contrast) {\n if (colorType === 'foreground') {\n if (hue == 'shadow') {\n return theme.foregroundShadow;\n } else {\n return theme.foregroundPalette[hue] || theme.foregroundPalette['1'];\n }\n }\n if (hue.indexOf('hue') === 0) {\n hue = theme.colors[colorType].hues[hue];\n }\n return rgba( (PALETTES[ theme.colors[colorType].name ][hue] || '')[contrast ? 'contrast' : 'value'], opacity );\n });\n\n // For each type, generate rules for each hue (ie. default, md-hue-1, md-hue-2, md-hue-3)\n angular.forEach(color.hues, function(hueValue, hueName) {\n var newRule = rules\n .replace(hueRegex, function(match, _, colorType, hueType, opacity) {\n return rgba(palette[hueValue][hueType === 'color' ? 'value' : 'contrast'], opacity);\n });\n if (hueName !== 'default') {\n newRule = newRule.replace(themeNameRegex, '.md-' + theme.name + '-theme.md-' + hueName);\n }\n\n // Don't apply a selector rule to the default theme, making it easier to override\n // styles of the base-component\n if (theme.name == 'default') {\n var themeRuleRegex = /((?:(?:(?: |>|\\.|\\w|-|:|\\(|\\)|\\[|\\]|\"|'|=)+) )?)((?:(?:\\w|\\.|-)+)?)\\.md-default-theme((?: |>|\\.|\\w|-|:|\\(|\\)|\\[|\\]|\"|'|=)*)/g;\n newRule = newRule.replace(themeRuleRegex, function(match, prefix, target, suffix) {\n return match + ', ' + prefix + target + suffix;\n });\n }\n generatedRules.push(newRule);\n });\n\n return generatedRules;\n}\n\nvar rulesByType = {};\n\n// Generate our themes at run time given the state of THEMES and PALETTES\nfunction generateAllThemes($injector) {\n var head = document.head;\n var firstChild = head ? head.firstElementChild : null;\n var themeCss = $injector.has('$MD_THEME_CSS') ? $injector.get('$MD_THEME_CSS') : '';\n\n if ( !firstChild ) return;\n if (themeCss.length === 0) return; // no rules, so no point in running this expensive task\n\n // Expose contrast colors for palettes to ensure that text is always readable\n angular.forEach(PALETTES, sanitizePalette);\n\n // MD_THEME_CSS is a string generated by the build process that includes all the themable\n // components as templates\n\n // Break the CSS into individual rules\n var rules = themeCss\n .split(/\\}(?!(\\}|'|\"|;))/)\n .filter(function(rule) { return rule && rule.length; })\n .map(function(rule) { return rule.trim() + '}'; });\n\n\n var ruleMatchRegex = new RegExp('md-(' + THEME_COLOR_TYPES.join('|') + ')', 'g');\n\n THEME_COLOR_TYPES.forEach(function(type) {\n rulesByType[type] = '';\n });\n\n\n // Sort the rules based on type, allowing us to do color substitution on a per-type basis\n rules.forEach(function(rule) {\n var match = rule.match(ruleMatchRegex);\n // First: test that if the rule has '.md-accent', it goes into the accent set of rules\n for (var i = 0, type; type = THEME_COLOR_TYPES[i]; i++) {\n if (rule.indexOf('.md-' + type) > -1) {\n return rulesByType[type] += rule;\n }\n }\n\n // If no eg 'md-accent' class is found, try to just find 'accent' in the rule and guess from\n // there\n for (i = 0; type = THEME_COLOR_TYPES[i]; i++) {\n if (rule.indexOf(type) > -1) {\n return rulesByType[type] += rule;\n }\n }\n\n // Default to the primary array\n return rulesByType[DEFAULT_COLOR_TYPE] += rule;\n });\n\n // If themes are being generated on-demand, quit here. The user will later manually\n // call generateTheme to do this on a theme-by-theme basis.\n if (generateOnDemand) return;\n\n angular.forEach(THEMES, function(theme) {\n if (!GENERATED[theme.name]) {\n generateTheme(theme.name, nonce);\n }\n });\n\n\n // *************************\n // Internal functions\n // *************************\n\n // The user specifies a 'default' contrast color as either light or dark,\n // then explicitly lists which hues are the opposite contrast (eg. A100 has dark, A200 has light)\n function sanitizePalette(palette) {\n var defaultContrast = palette.contrastDefaultColor;\n var lightColors = palette.contrastLightColors || [];\n var strongLightColors = palette.contrastStrongLightColors || [];\n var darkColors = palette.contrastDarkColors || [];\n\n // These colors are provided as space-separated lists\n if (typeof lightColors === 'string') lightColors = lightColors.split(' ');\n if (typeof strongLightColors === 'string') strongLightColors = strongLightColors.split(' ');\n if (typeof darkColors === 'string') darkColors = darkColors.split(' ');\n\n // Cleanup after ourselves\n delete palette.contrastDefaultColor;\n delete palette.contrastLightColors;\n delete palette.contrastStrongLightColors;\n delete palette.contrastDarkColors;\n\n // Change { 'A100': '#fffeee' } to { 'A100': { value: '#fffeee', contrast:DARK_CONTRAST_COLOR }\n angular.forEach(palette, function(hueValue, hueName) {\n if (angular.isObject(hueValue)) return; // Already converted\n // Map everything to rgb colors\n var rgbValue = colorToRgbaArray(hueValue);\n if (!rgbValue) {\n throw new Error(\"Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.\"\n .replace('%1', hueValue)\n .replace('%2', palette.name)\n .replace('%3', hueName));\n }\n\n palette[hueName] = {\n value: rgbValue,\n contrast: getContrastColor()\n };\n function getContrastColor() {\n if (defaultContrast === 'light') {\n if (darkColors.indexOf(hueName) > -1) {\n return DARK_CONTRAST_COLOR;\n } else {\n return strongLightColors.indexOf(hueName) > -1 ? STRONG_LIGHT_CONTRAST_COLOR\n : LIGHT_CONTRAST_COLOR;\n }\n } else {\n if (lightColors.indexOf(hueName) > -1) {\n return strongLightColors.indexOf(hueName) > -1 ? STRONG_LIGHT_CONTRAST_COLOR\n : LIGHT_CONTRAST_COLOR;\n } else {\n return DARK_CONTRAST_COLOR;\n }\n }\n }\n });\n }\n}\ngenerateAllThemes.$inject = [\"$injector\"];\n\nfunction generateTheme(name, nonce) {\n var theme = THEMES[name];\n var head = document.head;\n var firstChild = head ? head.firstElementChild : null;\n\n if (!GENERATED[name]) {\n // For each theme, use the color palettes specified for\n // `primary`, `warn` and `accent` to generate CSS rules.\n THEME_COLOR_TYPES.forEach(function(colorType) {\n var styleStrings = parseRules(theme, colorType, rulesByType[colorType]);\n while (styleStrings.length) {\n var styleContent = styleStrings.shift();\n if (styleContent) {\n var style = document.createElement('style');\n style.setAttribute('md-theme-style', '');\n if (nonce) {\n style.setAttribute('nonce', nonce);\n }\n style.appendChild(document.createTextNode(styleContent));\n head.insertBefore(style, firstChild);\n }\n }\n });\n\n\n if (theme.colors.primary.name == theme.colors.accent.name) {\n console.warn('$mdThemingProvider: Using the same palette for primary and' +\n ' accent. This violates the material design spec.');\n }\n\n GENERATED[theme.name] = true;\n }\n\n}\n\n\nfunction checkValidPalette(theme, colorType) {\n // If theme attempts to use a palette that doesnt exist, throw error\n if (!PALETTES[ (theme.colors[colorType] || {}).name ]) {\n throw new Error(\n \"You supplied an invalid color palette for theme %1's %2 palette. Available palettes: %3\"\n .replace('%1', theme.name)\n .replace('%2', colorType)\n .replace('%3', Object.keys(PALETTES).join(', '))\n );\n }\n}\n\nfunction colorToRgbaArray(clr) {\n if (angular.isArray(clr) && clr.length == 3) return clr;\n if (/^rgb/.test(clr)) {\n return clr.replace(/(^\\s*rgba?\\(|\\)\\s*$)/g, '').split(',').map(function(value, i) {\n return i == 3 ? parseFloat(value, 10) : parseInt(value, 10);\n });\n }\n if (clr.charAt(0) == '#') clr = clr.substring(1);\n if (!/^([a-fA-F0-9]{3}){1,2}$/g.test(clr)) return;\n\n var dig = clr.length / 3;\n var red = clr.substr(0, dig);\n var grn = clr.substr(dig, dig);\n var blu = clr.substr(dig * 2);\n if (dig === 1) {\n red += red;\n grn += grn;\n blu += blu;\n }\n return [parseInt(red, 16), parseInt(grn, 16), parseInt(blu, 16)];\n}\n\nfunction rgba(rgbArray, opacity) {\n if ( !rgbArray ) return \"rgb('0,0,0')\";\n\n if (rgbArray.length == 4) {\n rgbArray = angular.copy(rgbArray);\n opacity ? rgbArray.pop() : opacity = rgbArray.pop();\n }\n return opacity && (typeof opacity == 'number' || (typeof opacity == 'string' && opacity.length)) ?\n 'rgba(' + rgbArray.join(',') + ',' + opacity + ')' :\n 'rgb(' + rgbArray.join(',') + ')';\n}\n\n\n})();\n(function(){\n\"use strict\";\n\n// Polyfill angular < 1.4 (provide $animateCss)\nangular\n .module('material.core')\n .factory('$$mdAnimate', [\"$q\", \"$timeout\", \"$mdConstant\", \"$animateCss\", function($q, $timeout, $mdConstant, $animateCss){\n\n // Since $$mdAnimate is injected into $mdUtil... use a wrapper function\n // to subsequently inject $mdUtil as an argument to the AnimateDomUtils\n\n return function($mdUtil) {\n return AnimateDomUtils( $mdUtil, $q, $timeout, $mdConstant, $animateCss);\n };\n }]);\n\n/**\n * Factory function that requires special injections\n */\nfunction AnimateDomUtils($mdUtil, $q, $timeout, $mdConstant, $animateCss) {\n var self;\n return self = {\n /**\n *\n */\n translate3d : function( target, from, to, options ) {\n return $animateCss(target,{\n from:from,\n to:to,\n addClass:options.transitionInClass,\n removeClass:options.transitionOutClass\n })\n .start()\n .then(function(){\n // Resolve with reverser function...\n return reverseTranslate;\n });\n\n /**\n * Specific reversal of the request translate animation above...\n */\n function reverseTranslate (newFrom) {\n return $animateCss(target, {\n to: newFrom || from,\n addClass: options.transitionOutClass,\n removeClass: options.transitionInClass\n }).start();\n\n }\n },\n\n /**\n * Listen for transitionEnd event (with optional timeout)\n * Announce completion or failure via promise handlers\n */\n waitTransitionEnd: function (element, opts) {\n var TIMEOUT = 3000; // fallback is 3 secs\n\n return $q(function(resolve, reject){\n opts = opts || { };\n\n var timer = $timeout(finished, opts.timeout || TIMEOUT);\n element.on($mdConstant.CSS.TRANSITIONEND, finished);\n\n /**\n * Upon timeout or transitionEnd, reject or resolve (respectively) this promise.\n * NOTE: Make sure this transitionEnd didn't bubble up from a child\n */\n function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }\n\n });\n },\n\n calculateTransformValues: function (element, originator) {\n var origin = originator.element;\n var bounds = originator.bounds;\n\n if (origin || bounds) {\n var originBnds = origin ? self.clientRect(origin) || currentBounds() : self.copyRect(bounds);\n var dialogRect = self.copyRect(element[0].getBoundingClientRect());\n var dialogCenterPt = self.centerPointFor(dialogRect);\n var originCenterPt = self.centerPointFor(originBnds);\n\n return {\n centerX: originCenterPt.x - dialogCenterPt.x,\n centerY: originCenterPt.y - dialogCenterPt.y,\n scaleX: Math.round(100 * Math.min(0.5, originBnds.width / dialogRect.width)) / 100,\n scaleY: Math.round(100 * Math.min(0.5, originBnds.height / dialogRect.height)) / 100\n };\n }\n return {centerX: 0, centerY: 0, scaleX: 0.5, scaleY: 0.5};\n\n /**\n * This is a fallback if the origin information is no longer valid, then the\n * origin bounds simply becomes the current bounds for the dialogContainer's parent\n */\n function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }\n },\n\n /**\n * Calculate the zoom transform from dialog to origin.\n *\n * We use this to set the dialog position immediately;\n * then the md-transition-in actually translates back to\n * `translate3d(0,0,0) scale(1.0)`...\n *\n * NOTE: all values are rounded to the nearest integer\n */\n calculateZoomToOrigin: function (element, originator) {\n var zoomTemplate = \"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )\";\n var buildZoom = angular.bind(null, $mdUtil.supplant, zoomTemplate);\n\n return buildZoom(self.calculateTransformValues(element, originator));\n },\n\n /**\n * Calculate the slide transform from panel to origin.\n * NOTE: all values are rounded to the nearest integer\n */\n calculateSlideToOrigin: function (element, originator) {\n var slideTemplate = \"translate3d( {centerX}px, {centerY}px, 0 )\";\n var buildSlide = angular.bind(null, $mdUtil.supplant, slideTemplate);\n\n return buildSlide(self.calculateTransformValues(element, originator));\n },\n\n /**\n * Enhance raw values to represent valid css stylings...\n */\n toCss : function( raw ) {\n var css = { };\n var lookups = 'left top right bottom width height x y min-width min-height max-width max-height';\n\n angular.forEach(raw, function(value,key) {\n if ( angular.isUndefined(value) ) return;\n\n if ( lookups.indexOf(key) >= 0 ) {\n css[key] = value + 'px';\n } else {\n switch (key) {\n case 'transition':\n convertToVendor(key, $mdConstant.CSS.TRANSITION, value);\n break;\n case 'transform':\n convertToVendor(key, $mdConstant.CSS.TRANSFORM, value);\n break;\n case 'transformOrigin':\n convertToVendor(key, $mdConstant.CSS.TRANSFORM_ORIGIN, value);\n break;\n }\n }\n });\n\n return css;\n\n function convertToVendor(key, vendor, value) {\n angular.forEach(vendor.split(' '), function (key) {\n css[key] = value;\n });\n }\n },\n\n /**\n * Convert the translate CSS value to key/value pair(s).\n */\n toTransformCss: function (transform, addTransition, transition) {\n var css = {};\n angular.forEach($mdConstant.CSS.TRANSFORM.split(' '), function (key) {\n css[key] = transform;\n });\n\n if (addTransition) {\n transition = transition || \"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important\";\n css['transition'] = transition;\n }\n\n return css;\n },\n\n /**\n * Clone the Rect and calculate the height/width if needed\n */\n copyRect: function (source, destination) {\n if (!source) return null;\n\n destination = destination || {};\n\n angular.forEach('left top right bottom width height'.split(' '), function (key) {\n destination[key] = Math.round(source[key])\n });\n\n destination.width = destination.width || (destination.right - destination.left);\n destination.height = destination.height || (destination.bottom - destination.top);\n\n return destination;\n },\n\n /**\n * Calculate ClientRect of element; return null if hidden or zero size\n */\n clientRect: function (element) {\n var bounds = angular.element(element)[0].getBoundingClientRect();\n var isPositiveSizeClientRect = function (rect) {\n return rect && (rect.width > 0) && (rect.height > 0);\n };\n\n // If the event origin element has zero size, it has probably been hidden.\n return isPositiveSizeClientRect(bounds) ? self.copyRect(bounds) : null;\n },\n\n /**\n * Calculate 'rounded' center point of Rect\n */\n centerPointFor: function (targetRect) {\n return targetRect ? {\n x: Math.round(targetRect.left + (targetRect.width / 2)),\n y: Math.round(targetRect.top + (targetRect.height / 2))\n } : { x : 0, y : 0 };\n }\n\n };\n};\n\n\n})();\n(function(){\n\"use strict\";\n\n\"use strict\";\n\nif (angular.version.minor >= 4) {\n angular.module('material.core.animate', []);\n} else {\n(function() {\n\n var forEach = angular.forEach;\n\n var WEBKIT = angular.isDefined(document.documentElement.style.WebkitAppearance);\n var TRANSITION_PROP = WEBKIT ? 'WebkitTransition' : 'transition';\n var ANIMATION_PROP = WEBKIT ? 'WebkitAnimation' : 'animation';\n var PREFIX = WEBKIT ? '-webkit-' : '';\n\n var TRANSITION_EVENTS = (WEBKIT ? 'webkitTransitionEnd ' : '') + 'transitionend';\n var ANIMATION_EVENTS = (WEBKIT ? 'webkitAnimationEnd ' : '') + 'animationend';\n\n var $$ForceReflowFactory = ['$document', function($document) {\n return function() {\n return $document[0].body.clientWidth + 1;\n }\n }];\n\n var $$rAFMutexFactory = ['$$rAF', function($$rAF) {\n return function() {\n var passed = false;\n $$rAF(function() {\n passed = true;\n });\n return function(fn) {\n passed ? fn() : $$rAF(fn);\n };\n };\n }];\n\n var $$AnimateRunnerFactory = ['$q', '$$rAFMutex', function($q, $$rAFMutex) {\n var INITIAL_STATE = 0;\n var DONE_PENDING_STATE = 1;\n var DONE_COMPLETE_STATE = 2;\n\n function AnimateRunner(host) {\n this.setHost(host);\n\n this._doneCallbacks = [];\n this._runInAnimationFrame = $$rAFMutex();\n this._state = 0;\n }\n\n AnimateRunner.prototype = {\n setHost: function(host) {\n this.host = host || {};\n },\n\n done: function(fn) {\n if (this._state === DONE_COMPLETE_STATE) {\n fn();\n } else {\n this._doneCallbacks.push(fn);\n }\n },\n\n progress: angular.noop,\n\n getPromise: function() {\n if (!this.promise) {\n var self = this;\n this.promise = $q(function(resolve, reject) {\n self.done(function(status) {\n status === false ? reject() : resolve();\n });\n });\n }\n return this.promise;\n },\n\n then: function(resolveHandler, rejectHandler) {\n return this.getPromise().then(resolveHandler, rejectHandler);\n },\n\n 'catch': function(handler) {\n return this.getPromise()['catch'](handler);\n },\n\n 'finally': function(handler) {\n return this.getPromise()['finally'](handler);\n },\n\n pause: function() {\n if (this.host.pause) {\n this.host.pause();\n }\n },\n\n resume: function() {\n if (this.host.resume) {\n this.host.resume();\n }\n },\n\n end: function() {\n if (this.host.end) {\n this.host.end();\n }\n this._resolve(true);\n },\n\n cancel: function() {\n if (this.host.cancel) {\n this.host.cancel();\n }\n this._resolve(false);\n },\n\n complete: function(response) {\n var self = this;\n if (self._state === INITIAL_STATE) {\n self._state = DONE_PENDING_STATE;\n self._runInAnimationFrame(function() {\n self._resolve(response);\n });\n }\n },\n\n _resolve: function(response) {\n if (this._state !== DONE_COMPLETE_STATE) {\n forEach(this._doneCallbacks, function(fn) {\n fn(response);\n });\n this._doneCallbacks.length = 0;\n this._state = DONE_COMPLETE_STATE;\n }\n }\n };\n\n return AnimateRunner;\n }];\n\n angular\n .module('material.core.animate', [])\n .factory('$$forceReflow', $$ForceReflowFactory)\n .factory('$$AnimateRunner', $$AnimateRunnerFactory)\n .factory('$$rAFMutex', $$rAFMutexFactory)\n .factory('$animateCss', ['$window', '$$rAF', '$$AnimateRunner', '$$forceReflow', '$$jqLite', '$timeout', '$animate',\n function($window, $$rAF, $$AnimateRunner, $$forceReflow, $$jqLite, $timeout, $animate) {\n\n function init(element, options) {\n\n var temporaryStyles = [];\n var node = getDomNode(element);\n var areAnimationsAllowed = node && $animate.enabled();\n\n var hasCompleteStyles = false;\n var hasCompleteClasses = false;\n\n if (areAnimationsAllowed) {\n if (options.transitionStyle) {\n temporaryStyles.push([PREFIX + 'transition', options.transitionStyle]);\n }\n\n if (options.keyframeStyle) {\n temporaryStyles.push([PREFIX + 'animation', options.keyframeStyle]);\n }\n\n if (options.delay) {\n temporaryStyles.push([PREFIX + 'transition-delay', options.delay + 's']);\n }\n\n if (options.duration) {\n temporaryStyles.push([PREFIX + 'transition-duration', options.duration + 's']);\n }\n\n hasCompleteStyles = options.keyframeStyle ||\n (options.to && (options.duration > 0 || options.transitionStyle));\n hasCompleteClasses = !!options.addClass || !!options.removeClass;\n\n blockTransition(element, true);\n }\n\n var hasCompleteAnimation = areAnimationsAllowed && (hasCompleteStyles || hasCompleteClasses);\n\n applyAnimationFromStyles(element, options);\n\n var animationClosed = false;\n var events, eventFn;\n\n return {\n close: $window.close,\n start: function() {\n var runner = new $$AnimateRunner();\n waitUntilQuiet(function() {\n blockTransition(element, false);\n if (!hasCompleteAnimation) {\n return close();\n }\n\n forEach(temporaryStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[camelCase(key)] = value;\n });\n\n applyClasses(element, options);\n\n var timings = computeTimings(element);\n if (timings.duration === 0) {\n return close();\n }\n\n var moreStyles = [];\n\n if (options.easing) {\n if (timings.transitionDuration) {\n moreStyles.push([PREFIX + 'transition-timing-function', options.easing]);\n }\n if (timings.animationDuration) {\n moreStyles.push([PREFIX + 'animation-timing-function', options.easing]);\n }\n }\n\n if (options.delay && timings.animationDelay) {\n moreStyles.push([PREFIX + 'animation-delay', options.delay + 's']);\n }\n\n if (options.duration && timings.animationDuration) {\n moreStyles.push([PREFIX + 'animation-duration', options.duration + 's']);\n }\n\n forEach(moreStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[camelCase(key)] = value;\n temporaryStyles.push(entry);\n });\n\n var maxDelay = timings.delay;\n var maxDelayTime = maxDelay * 1000;\n var maxDuration = timings.duration;\n var maxDurationTime = maxDuration * 1000;\n var startTime = Date.now();\n\n events = [];\n if (timings.transitionDuration) {\n events.push(TRANSITION_EVENTS);\n }\n if (timings.animationDuration) {\n events.push(ANIMATION_EVENTS);\n }\n events = events.join(' ');\n eventFn = function(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n var timeStamp = ev.timeStamp || Date.now();\n var elapsedTime = parseFloat(ev.elapsedTime.toFixed(3));\n if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n close();\n }\n };\n element.on(events, eventFn);\n\n applyAnimationToStyles(element, options);\n\n $timeout(close, maxDelayTime + maxDurationTime * 1.5, false);\n });\n\n return runner;\n\n function close() {\n if (animationClosed) return;\n animationClosed = true;\n\n if (events && eventFn) {\n element.off(events, eventFn);\n }\n applyClasses(element, options);\n applyAnimationStyles(element, options);\n forEach(temporaryStyles, function(entry) {\n node.style[camelCase(entry[0])] = '';\n });\n runner.complete(true);\n return runner;\n }\n }\n }\n }\n\n function applyClasses(element, options) {\n if (options.addClass) {\n $$jqLite.addClass(element, options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n $$jqLite.removeClass(element, options.removeClass);\n options.removeClass = null;\n }\n }\n\n function computeTimings(element) {\n var node = getDomNode(element);\n var cs = $window.getComputedStyle(node)\n var tdr = parseMaxTime(cs[prop('transitionDuration')]);\n var adr = parseMaxTime(cs[prop('animationDuration')]);\n var tdy = parseMaxTime(cs[prop('transitionDelay')]);\n var ady = parseMaxTime(cs[prop('animationDelay')]);\n\n adr *= (parseInt(cs[prop('animationIterationCount')], 10) || 1);\n var duration = Math.max(adr, tdr);\n var delay = Math.max(ady, tdy);\n\n return {\n duration: duration,\n delay: delay,\n animationDuration: adr,\n transitionDuration: tdr,\n animationDelay: ady,\n transitionDelay: tdy\n };\n\n function prop(key) {\n return WEBKIT ? 'Webkit' + key.charAt(0).toUpperCase() + key.substr(1)\n : key;\n }\n }\n\n function parseMaxTime(str) {\n var maxValue = 0;\n var values = (str || \"\").split(/\\s*,\\s*/);\n forEach(values, function(value) {\n // it's always safe to consider only second values and omit `ms` values since\n // getComputedStyle will always handle the conversion for us\n if (value.charAt(value.length - 1) == 's') {\n value = value.substring(0, value.length - 1);\n }\n value = parseFloat(value) || 0;\n maxValue = maxValue ? Math.max(value, maxValue) : value;\n });\n return maxValue;\n }\n\n var cancelLastRAFRequest;\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n if (cancelLastRAFRequest) {\n cancelLastRAFRequest(); //cancels the request\n }\n rafWaitQueue.push(callback);\n cancelLastRAFRequest = $$rAF(function() {\n cancelLastRAFRequest = null;\n\n // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n var pageWidth = $$forceReflow();\n\n // we use a for loop to ensure that if the queue is changed\n // during this looping then it will consider new requests\n for (var i = 0; i < rafWaitQueue.length; i++) {\n rafWaitQueue[i](pageWidth);\n }\n rafWaitQueue.length = 0;\n });\n }\n\n function applyAnimationStyles(element, options) {\n applyAnimationFromStyles(element, options);\n applyAnimationToStyles(element, options);\n }\n\n function applyAnimationFromStyles(element, options) {\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n }\n\n function applyAnimationToStyles(element, options) {\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n }\n\n function getDomNode(element) {\n for (var i = 0; i < element.length; i++) {\n if (element[i].nodeType === 1) return element[i];\n }\n }\n\n function blockTransition(element, bool) {\n var node = getDomNode(element);\n var key = camelCase(PREFIX + 'transition-delay');\n node.style[key] = bool ? '-9999s' : '';\n }\n\n return init;\n }]);\n\n /**\n * Older browsers [FF31] expect camelCase\n * property keys.\n * e.g.\n * animation-duration --> animationDuration\n */\n function camelCase(str) {\n return str.replace(/-[a-z]/g, function(str) {\n return str.charAt(1).toUpperCase();\n });\n }\n\n})();\n\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.autocomplete\n */\n/*\n * @see js folder for autocomplete implementation\n */\nangular.module('material.components.autocomplete', [\n 'material.core',\n 'material.components.icon',\n 'material.components.virtualRepeat'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/*\n * @ngdoc module\n * @name material.components.backdrop\n * @description Backdrop\n */\n\n/**\n * @ngdoc directive\n * @name mdBackdrop\n * @module material.components.backdrop\n *\n * @restrict E\n *\n * @description\n * `<md-backdrop>` is a backdrop element used by other components, such as dialog and bottom sheet.\n * Apply class `opaque` to make the backdrop use the theme backdrop color.\n *\n */\n\nangular\n .module('material.components.backdrop', ['material.core'])\n .directive('mdBackdrop', [\"$mdTheming\", \"$animate\", \"$rootElement\", \"$window\", \"$log\", \"$$rAF\", \"$document\", function BackdropDirective($mdTheming, $animate, $rootElement, $window, $log, $$rAF, $document) {\n var ERROR_CSS_POSITION = \"<md-backdrop> may not work properly in a scrolled, static-positioned parent container.\";\n\n return {\n restrict: 'E',\n link: postLink\n };\n\n function postLink(scope, element, attrs) {\n\n // If body scrolling has been disabled using mdUtil.disableBodyScroll(),\n // adjust the 'backdrop' height to account for the fixed 'body' top offset\n var body = $window.getComputedStyle($document[0].body);\n if (body.position == 'fixed') {\n var hViewport = parseInt(body.height, 10) + Math.abs(parseInt(body.top, 10));\n element.css({\n height: hViewport + 'px'\n });\n }\n\n // backdrop may be outside the $rootElement, tell ngAnimate to animate regardless\n if ($animate.pin) $animate.pin(element, $rootElement);\n\n $$rAF(function () {\n\n // Often $animate.enter() is used to append the backDrop element\n // so let's wait until $animate is done...\n var parent = element.parent()[0];\n if (parent) {\n\n if ( parent.nodeName == 'BODY' ) {\n element.css({position : 'fixed'});\n }\n\n var styles = $window.getComputedStyle(parent);\n if (styles.position == 'static') {\n // backdrop uses position:absolute and will not work properly with parent position:static (default)\n $log.warn(ERROR_CSS_POSITION);\n }\n }\n\n // Only inherit the parent if the backdrop has a parent.\n if (element.parent().length) {\n $mdTheming.inherit(element, element.parent());\n }\n });\n\n }\n\n }]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.bottomSheet\n * @description\n * BottomSheet\n */\nangular\n .module('material.components.bottomSheet', [\n 'material.core',\n 'material.components.backdrop'\n ])\n .directive('mdBottomSheet', MdBottomSheetDirective)\n .provider('$mdBottomSheet', MdBottomSheetProvider);\n\n/* @ngInject */\nfunction MdBottomSheetDirective($mdBottomSheet) {\n return {\n restrict: 'E',\n link : function postLink(scope, element, attr) {\n // When navigation force destroys an interimElement, then\n // listen and $destroy() that interim instance...\n scope.$on('$destroy', function() {\n $mdBottomSheet.destroy();\n });\n }\n };\n}\nMdBottomSheetDirective.$inject = [\"$mdBottomSheet\"];\n\n\n/**\n * @ngdoc service\n * @name $mdBottomSheet\n * @module material.components.bottomSheet\n *\n * @description\n * `$mdBottomSheet` opens a bottom sheet over the app and provides a simple promise API.\n *\n * ## Restrictions\n *\n * - The bottom sheet's template must have an outer `<md-bottom-sheet>` element.\n * - Add the `md-grid` class to the bottom sheet for a grid layout.\n * - Add the `md-list` class to the bottom sheet for a list layout.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyController\">\n * <md-button ng-click=\"openBottomSheet()\">\n * Open a Bottom Sheet!\n * </md-button>\n * </div>\n * </hljs>\n * <hljs lang=\"js\">\n * var app = angular.module('app', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdBottomSheet) {\n * $scope.openBottomSheet = function() {\n * $mdBottomSheet.show({\n * template: '<md-bottom-sheet>Hello!</md-bottom-sheet>'\n * });\n * };\n * });\n * </hljs>\n */\n\n /**\n * @ngdoc method\n * @name $mdBottomSheet#show\n *\n * @description\n * Show a bottom sheet with the specified options.\n *\n * @param {object} options An options object, with the following properties:\n *\n * - `templateUrl` - `{string=}`: The url of an html template file that will\n * be used as the content of the bottom sheet. Restrictions: the template must\n * have an outer `md-bottom-sheet` element.\n * - `template` - `{string=}`: Same as templateUrl, except this is an actual\n * template string.\n * - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified, it will create a new child scope.\n * This scope will be destroyed when the bottom sheet is removed unless `preserveScope` is set to true.\n * - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false\n * - `controller` - `{string=}`: The controller to associate with this bottom sheet.\n * - `locals` - `{string=}`: An object containing key/value pairs. The keys will\n * be used as names of values to inject into the controller. For example,\n * `locals: {three: 3}` would inject `three` into the controller with the value\n * of 3.\n * - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the bottom sheet to\n * close it. Default true.\n * - `disableBackdrop` - `{boolean=}`: When set to true, the bottomsheet will not show a backdrop.\n * - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the bottom sheet.\n * Default true.\n * - `resolve` - `{object=}`: Similar to locals, except it takes promises as values\n * and the bottom sheet will not open until the promises resolve.\n * - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n * - `parent` - `{element=}`: The element to append the bottom sheet to. The `parent` may be a `function`, `string`,\n * `object`, or null. Defaults to appending to the body of the root element (or the root element) of the application.\n * e.g. angular.element(document.getElementById('content')) or \"#content\"\n * - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the bottom sheet is open.\n * Default true.\n *\n * @returns {promise} A promise that can be resolved with `$mdBottomSheet.hide()` or\n * rejected with `$mdBottomSheet.cancel()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#hide\n *\n * @description\n * Hide the existing bottom sheet and resolve the promise returned from\n * `$mdBottomSheet.show()`. This call will close the most recently opened/current bottomsheet (if any).\n *\n * @param {*=} response An argument for the resolved promise.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#cancel\n *\n * @description\n * Hide the existing bottom sheet and reject the promise returned from\n * `$mdBottomSheet.show()`.\n *\n * @param {*=} response An argument for the rejected promise.\n *\n */\n\nfunction MdBottomSheetProvider($$interimElementProvider) {\n // how fast we need to flick down to close the sheet, pixels/ms\n var CLOSING_VELOCITY = 0.5;\n var PADDING = 80; // same as css\n\n bottomSheetDefaults.$inject = [\"$animate\", \"$mdConstant\", \"$mdUtil\", \"$mdTheming\", \"$mdBottomSheet\", \"$rootElement\", \"$mdGesture\"];\n return $$interimElementProvider('$mdBottomSheet')\n .setDefaults({\n methods: ['disableParentScroll', 'escapeToClose', 'clickOutsideToClose'],\n options: bottomSheetDefaults\n });\n\n /* @ngInject */\n function bottomSheetDefaults($animate, $mdConstant, $mdUtil, $mdTheming, $mdBottomSheet, $rootElement, $mdGesture) {\n var backdrop;\n\n return {\n themable: true,\n onShow: onShow,\n onRemove: onRemove,\n disableBackdrop: false,\n escapeToClose: true,\n clickOutsideToClose: true,\n disableParentScroll: true\n };\n\n\n function onShow(scope, element, options, controller) {\n\n element = $mdUtil.extractElementByName(element, 'md-bottom-sheet');\n\n // prevent tab focus or click focus on the bottom-sheet container\n element.attr('tabindex',\"-1\");\n\n if (!options.disableBackdrop) {\n // Add a backdrop that will close on click\n backdrop = $mdUtil.createBackdrop(scope, \"md-bottom-sheet-backdrop md-opaque\");\n\n // Prevent mouse focus on backdrop; ONLY programatic focus allowed.\n // This allows clicks on backdrop to propogate to the $rootElement and\n // ESC key events to be detected properly.\n \n backdrop[0].tabIndex = -1;\n\n if (options.clickOutsideToClose) {\n backdrop.on('click', function() {\n $mdUtil.nextTick($mdBottomSheet.cancel,true);\n });\n }\n\n $mdTheming.inherit(backdrop, options.parent);\n\n $animate.enter(backdrop, options.parent, null);\n }\n\n var bottomSheet = new BottomSheet(element, options.parent);\n options.bottomSheet = bottomSheet;\n\n $mdTheming.inherit(bottomSheet.element, options.parent);\n\n if (options.disableParentScroll) {\n options.restoreScroll = $mdUtil.disableScrollAround(bottomSheet.element, options.parent);\n }\n\n return $animate.enter(bottomSheet.element, options.parent, backdrop)\n .then(function() {\n var focusable = $mdUtil.findFocusTarget(element) || angular.element(\n element[0].querySelector('button') ||\n element[0].querySelector('a') ||\n element[0].querySelector('[ng-click]')\n ) || backdrop;\n\n if (options.escapeToClose) {\n options.rootElementKeyupCallback = function(e) {\n if (e.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n $mdUtil.nextTick($mdBottomSheet.cancel,true);\n }\n };\n\n $rootElement.on('keyup', options.rootElementKeyupCallback);\n focusable && focusable.focus();\n }\n });\n\n }\n\n function onRemove(scope, element, options) {\n\n var bottomSheet = options.bottomSheet;\n\n if (!options.disableBackdrop) $animate.leave(backdrop);\n return $animate.leave(bottomSheet.element).then(function() {\n if (options.disableParentScroll) {\n options.restoreScroll();\n delete options.restoreScroll;\n }\n\n bottomSheet.cleanup();\n });\n }\n\n /**\n * BottomSheet class to apply bottom-sheet behavior to an element\n */\n function BottomSheet(element, parent) {\n var deregister = $mdGesture.register(parent, 'drag', { horizontal: false });\n parent.on('$md.dragstart', onDragStart)\n .on('$md.drag', onDrag)\n .on('$md.dragend', onDragEnd);\n\n return {\n element: element,\n cleanup: function cleanup() {\n deregister();\n parent.off('$md.dragstart', onDragStart);\n parent.off('$md.drag', onDrag);\n parent.off('$md.dragend', onDragEnd);\n }\n };\n\n function onDragStart(ev) {\n // Disable transitions on transform so that it feels fast\n element.css($mdConstant.CSS.TRANSITION_DURATION, '0ms');\n }\n\n function onDrag(ev) {\n var transform = ev.pointer.distanceY;\n if (transform < 5) {\n // Slow down drag when trying to drag up, and stop after PADDING\n transform = Math.max(-PADDING, transform / 2);\n }\n element.css($mdConstant.CSS.TRANSFORM, 'translate3d(0,' + (PADDING + transform) + 'px,0)');\n }\n\n function onDragEnd(ev) {\n if (ev.pointer.distanceY > 0 &&\n (ev.pointer.distanceY > 20 || Math.abs(ev.pointer.velocityY) > CLOSING_VELOCITY)) {\n var distanceRemaining = element.prop('offsetHeight') - ev.pointer.distanceY;\n var transitionDuration = Math.min(distanceRemaining / ev.pointer.velocityY * 0.75, 500);\n element.css($mdConstant.CSS.TRANSITION_DURATION, transitionDuration + 'ms');\n $mdUtil.nextTick($mdBottomSheet.cancel,true);\n } else {\n element.css($mdConstant.CSS.TRANSITION_DURATION, '');\n element.css($mdConstant.CSS.TRANSFORM, '');\n }\n }\n }\n\n }\n\n}\nMdBottomSheetProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.button\n * @description\n *\n * Button\n */\nangular\n .module('material.components.button', [ 'material.core' ])\n .directive('mdButton', MdButtonDirective);\n\n/**\n * @ngdoc directive\n * @name mdButton\n * @module material.components.button\n *\n * @restrict E\n *\n * @description\n * `<md-button>` is a button directive with optional ink ripples (default enabled).\n *\n * If you supply a `href` or `ng-href` attribute, it will become an `<a>` element. Otherwise, it will\n * become a `<button>` element. As per the [Material Design specifications](http://www.google.com/design/spec/style/color.html#color-ui-color-application)\n * the FAB button background is filled with the accent color [by default]. The primary color palette may be used with\n * the `md-primary` class.\n *\n * @param {boolean=} md-no-ink If present, disable ripple ink effects.\n * @param {expression=} ng-disabled En/Disable based on the expression\n * @param {string=} md-ripple-size Overrides the default ripple size logic. Options: `full`, `partial`, `auto`\n * @param {string=} aria-label Adds alternative text to button for accessibility, useful for icon buttons.\n * If no default text is found, a warning will be logged.\n *\n * @usage\n *\n * Regular buttons:\n *\n * <hljs lang=\"html\">\n * <md-button> Flat Button </md-button>\n * <md-button href=\"http://google.com\"> Flat link </md-button>\n * <md-button class=\"md-raised\"> Raised Button </md-button>\n * <md-button ng-disabled=\"true\"> Disabled Button </md-button>\n * <md-button>\n * <md-icon md-svg-src=\"your/icon.svg\"></md-icon>\n * Register Now\n * </md-button>\n * </hljs>\n *\n * FAB buttons:\n *\n * <hljs lang=\"html\">\n * <md-button class=\"md-fab\" aria-label=\"FAB\">\n * <md-icon md-svg-src=\"your/icon.svg\"></md-icon>\n * </md-button>\n * <!-- mini-FAB -->\n * <md-button class=\"md-fab md-mini\" aria-label=\"Mini FAB\">\n * <md-icon md-svg-src=\"your/icon.svg\"></md-icon>\n * </md-button>\n * <!-- Button with SVG Icon -->\n * <md-button class=\"md-icon-button\" aria-label=\"Custom Icon Button\">\n * <md-icon md-svg-icon=\"path/to/your.svg\"></md-icon>\n * </md-button>\n * </hljs>\n */\nfunction MdButtonDirective($mdButtonInkRipple, $mdTheming, $mdAria, $timeout) {\n\n return {\n restrict: 'EA',\n replace: true,\n transclude: true,\n template: getTemplate,\n link: postLink\n };\n\n function isAnchor(attr) {\n return angular.isDefined(attr.href) || angular.isDefined(attr.ngHref) || angular.isDefined(attr.ngLink) || angular.isDefined(attr.uiSref);\n }\n\n function getTemplate(element, attr) {\n if (isAnchor(attr)) {\n return '<a class=\"md-button\" ng-transclude></a>';\n } else {\n //If buttons don't have type=\"button\", they will submit forms automatically.\n var btnType = (typeof attr.type === 'undefined') ? 'button' : attr.type;\n return '<button class=\"md-button\" type=\"' + btnType + '\" ng-transclude></button>';\n }\n }\n\n function postLink(scope, element, attr) {\n $mdTheming(element);\n $mdButtonInkRipple.attach(scope, element);\n\n // Use async expect to support possible bindings in the button label\n $mdAria.expectWithText(element, 'aria-label');\n\n // For anchor elements, we have to set tabindex manually when the\n // element is disabled\n if (isAnchor(attr) && angular.isDefined(attr.ngDisabled) ) {\n scope.$watch(attr.ngDisabled, function(isDisabled) {\n element.attr('tabindex', isDisabled ? -1 : 0);\n });\n }\n\n // disabling click event when disabled is true\n element.on('click', function(e){\n if (attr.disabled === true) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n });\n\n // restrict focus styles to the keyboard\n scope.mouseActive = false;\n element.on('mousedown', function() {\n scope.mouseActive = true;\n $timeout(function(){\n scope.mouseActive = false;\n }, 100);\n })\n .on('focus', function() {\n if (scope.mouseActive === false) {\n element.addClass('md-focused');\n }\n })\n .on('blur', function(ev) {\n element.removeClass('md-focused');\n });\n }\n\n}\nMdButtonDirective.$inject = [\"$mdButtonInkRipple\", \"$mdTheming\", \"$mdAria\", \"$timeout\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.card\n *\n * @description\n * Card components.\n */\nangular.module('material.components.card', [\n 'material.core'\n ])\n .directive('mdCard', mdCardDirective);\n\n\n/**\n * @ngdoc directive\n * @name mdCard\n * @module material.components.card\n *\n * @restrict E\n *\n * @description\n * The `<md-card>` directive is a container element used within `<md-content>` containers.\n *\n * An image included as a direct descendant will fill the card's width, while the `<md-card-content>`\n * container will wrap text content and provide padding. An `<md-card-footer>` element can be\n * optionally included to put content flush against the bottom edge of the card.\n *\n * Action buttons can be included in an `<md-card-actions>` element, similar to `<md-dialog-actions>`.\n * You can then position buttons using layout attributes.\n *\n * Card is built with:\n * * `<md-card-header>` - Header for the card, holds avatar, text and squared image\n * - `<md-card-avatar>` - Card avatar\n * - `md-user-avatar` - Class for user image\n * - `<md-icon>`\n * - `<md-card-header-text>` - Contains elements for the card description\n * - `md-title` - Class for the card title\n * - `md-subhead` - Class for the card sub header\n * * `<img>` - Image for the card\n * * `<md-card-title>` - Card content title\n * - `<md-card-title-text>`\n * - `md-headline` - Class for the card content title\n * - `md-subhead` - Class for the card content sub header\n * - `<md-card-title-media>` - Squared image within the title\n * - `md-media-sm` - Class for small image\n * - `md-media-md` - Class for medium image\n * - `md-media-lg` - Class for large image\n * * `<md-card-content>` - Card content\n * - `md-media-xl` - Class for extra large image\n * * `<md-card-actions>` - Card actions\n * - `<md-card-icon-actions>` - Icon actions\n *\n * Cards have constant width and variable heights; where the maximum height is limited to what can\n * fit within a single view on a platform, but it can temporarily expand as needed.\n *\n * @usage\n * ### Card with optional footer\n * <hljs lang=\"html\">\n * <md-card>\n * <img src=\"card-image.png\" class=\"md-card-image\" alt=\"image caption\">\n * <md-card-content>\n * <h2>Card headline</h2>\n * <p>Card content</p>\n * </md-card-content>\n * <md-card-footer>\n * Card footer\n * </md-card-footer>\n * </md-card>\n * </hljs>\n *\n * ### Card with actions\n * <hljs lang=\"html\">\n * <md-card>\n * <img src=\"card-image.png\" class=\"md-card-image\" alt=\"image caption\">\n * <md-card-content>\n * <h2>Card headline</h2>\n * <p>Card content</p>\n * </md-card-content>\n * <md-card-actions layout=\"row\" layout-align=\"end center\">\n * <md-button>Action 1</md-button>\n * <md-button>Action 2</md-button>\n * </md-card-actions>\n * </md-card>\n * </hljs>\n *\n * ### Card with header, image, title actions and content\n * <hljs lang=\"html\">\n * <md-card>\n * <md-card-header>\n * <md-card-avatar>\n * <img class=\"md-user-avatar\" src=\"avatar.png\"/>\n * </md-card-avatar>\n * <md-card-header-text>\n * <span class=\"md-title\">Title</span>\n * <span class=\"md-subhead\">Sub header</span>\n * </md-card-header-text>\n * </md-card-header>\n * <img ng-src=\"card-image.png\" class=\"md-card-image\" alt=\"image caption\">\n * <md-card-title>\n * <md-card-title-text>\n * <span class=\"md-headline\">Card headline</span>\n * <span class=\"md-subhead\">Card subheader</span>\n * </md-card-title-text>\n * </md-card-title>\n * <md-card-actions layout=\"row\" layout-align=\"start center\">\n * <md-button>Action 1</md-button>\n * <md-button>Action 2</md-button>\n * <md-card-icon-actions>\n * <md-button class=\"md-icon-button\" aria-label=\"icon\">\n * <md-icon md-svg-icon=\"icon\"></md-icon>\n * </md-button>\n * </md-card-icon-actions>\n * </md-card-actions>\n * <md-card-content>\n * <p>\n * Card content\n * </p>\n * </md-card-content>\n * </md-card>\n * </hljs>\n */\nfunction mdCardDirective($mdTheming) {\n return {\n restrict: 'E',\n link: function ($scope, $element) {\n $mdTheming($element);\n }\n };\n}\nmdCardDirective.$inject = [\"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.checkbox\n * @description Checkbox module!\n */\nangular\n .module('material.components.checkbox', ['material.core'])\n .directive('mdCheckbox', MdCheckboxDirective);\n\n/**\n * @ngdoc directive\n * @name mdCheckbox\n * @module material.components.checkbox\n * @restrict E\n *\n * @description\n * The checkbox directive is used like the normal [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D).\n *\n * As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)\n * the checkbox is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * @param {string} ng-model Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ng-true-value The value to which the expression should be set when selected.\n * @param {expression=} ng-false-value The value to which the expression should be set when not selected.\n * @param {string=} ng-change Angular expression to be executed when input changes due to user interaction with the input element.\n * @param {boolean=} md-no-ink Use of attribute indicates use of ripple ink effects\n * @param {string=} aria-label Adds label to checkbox for accessibility.\n * Defaults to checkbox's text. If no default text is found, a warning will be logged.\n * @param {expression=} md-indeterminate This determines when the checkbox should be rendered as 'indeterminate'.\n * If a truthy expression or no value is passed in the checkbox renders in the md-indeterminate state.\n * If falsy expression is passed in it just looks like a normal unchecked checkbox.\n * The indeterminate, checked, and unchecked states are mutually exclusive. A box cannot be in any two states at the same time. \n * When a checkbox is indeterminate that overrides any checked/unchecked rendering logic.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-checkbox ng-model=\"isChecked\" aria-label=\"Finished?\">\n * Finished ?\n * </md-checkbox>\n *\n * <md-checkbox md-no-ink ng-model=\"hasInk\" aria-label=\"No Ink Effects\">\n * No Ink Effects\n * </md-checkbox>\n *\n * <md-checkbox ng-disabled=\"true\" ng-model=\"isDisabled\" aria-label=\"Disabled\">\n * Disabled\n * </md-checkbox>\n *\n * </hljs>\n *\n */\nfunction MdCheckboxDirective(inputDirective, $mdAria, $mdConstant, $mdTheming, $mdUtil, $timeout) {\n inputDirective = inputDirective[0];\n var CHECKED_CSS = 'md-checked';\n\n return {\n restrict: 'E',\n transclude: true,\n require: '?ngModel',\n priority: 210, // Run before ngAria\n template:\n '<div class=\"md-container\" md-ink-ripple md-ink-ripple-checkbox>' +\n '<div class=\"md-icon\"></div>' +\n '</div>' +\n '<div ng-transclude class=\"md-label\"></div>',\n compile: compile\n };\n\n // **********************************************************\n // Private Methods\n // **********************************************************\n\n function compile (tElement, tAttrs) {\n var container = tElement.children();\n var mdIndeterminateStateEnabled = tAttrs.hasOwnProperty('mdIndeterminate');\n\n tAttrs.type = 'checkbox';\n tAttrs.tabindex = tAttrs.tabindex || '0';\n tElement.attr('role', tAttrs.type);\n\n // Attach a click handler in compile in order to immediately stop propagation\n // (especially for ng-click) when the checkbox is disabled.\n tElement.on('click', function(event) {\n if (this.hasAttribute('disabled')) {\n event.stopImmediatePropagation();\n }\n });\n\n // Redirect focus events to the root element, because IE11 is always focusing the container element instead\n // of the md-checkbox element. This causes issues when using ngModelOptions: `updateOnBlur`\n container.on('focus', function() {\n tElement.focus();\n });\n\n return function postLink(scope, element, attr, ngModelCtrl) {\n var isIndeterminate;\n ngModelCtrl = ngModelCtrl || $mdUtil.fakeNgModel();\n $mdTheming(element);\n if (mdIndeterminateStateEnabled) {\n setIndeterminateState();\n scope.$watch(attr.mdIndeterminate, setIndeterminateState);\n }\n\n if (attr.ngChecked) {\n scope.$watch(\n scope.$eval.bind(scope, attr.ngChecked),\n ngModelCtrl.$setViewValue.bind(ngModelCtrl)\n );\n }\n\n $$watchExpr('ngDisabled', 'tabindex', {\n true: '-1',\n false: attr.tabindex\n });\n\n $mdAria.expectWithText(element, 'aria-label');\n\n // Reuse the original input[type=checkbox] directive from Angular core.\n // This is a bit hacky as we need our own event listener and own render\n // function.\n inputDirective.link.pre(scope, {\n on: angular.noop,\n 0: {}\n }, attr, [ngModelCtrl]);\n\n scope.mouseActive = false;\n element.on('click', listener)\n .on('keypress', keypressHandler)\n .on('mousedown', function() {\n scope.mouseActive = true;\n $timeout(function() {\n scope.mouseActive = false;\n }, 100);\n })\n .on('focus', function() {\n if (scope.mouseActive === false) {\n element.addClass('md-focused');\n }\n })\n .on('blur', function() {\n element.removeClass('md-focused');\n });\n\n ngModelCtrl.$render = render;\n\n function $$watchExpr(expr, htmlAttr, valueOpts) {\n if (attr[expr]) {\n scope.$watch(attr[expr], function(val) {\n if (valueOpts[val]) {\n element.attr(htmlAttr, valueOpts[val]);\n }\n });\n }\n }\n\n function keypressHandler(ev) {\n var keyCode = ev.which || ev.keyCode;\n if (keyCode === $mdConstant.KEY_CODE.SPACE || keyCode === $mdConstant.KEY_CODE.ENTER) {\n ev.preventDefault();\n\n if (!element.hasClass('md-focused')) {\n element.addClass('md-focused');\n }\n\n listener(ev);\n }\n }\n\n function listener(ev) {\n if (element[0].hasAttribute('disabled')) {\n return;\n }\n\n scope.$apply(function() {\n // Toggle the checkbox value...\n var viewValue = attr.ngChecked ? attr.checked : !ngModelCtrl.$viewValue;\n\n ngModelCtrl.$setViewValue( viewValue, ev && ev.type);\n ngModelCtrl.$render();\n });\n }\n\n function render() {\n if(ngModelCtrl.$viewValue && !isIndeterminate) {\n element.addClass(CHECKED_CSS);\n } else {\n element.removeClass(CHECKED_CSS);\n }\n }\n\n function setIndeterminateState(newValue) {\n isIndeterminate = newValue !== false;\n if (isIndeterminate) {\n element.attr('aria-checked', 'mixed');\n }\n element.toggleClass('md-indeterminate', isIndeterminate);\n }\n };\n }\n}\nMdCheckboxDirective.$inject = [\"inputDirective\", \"$mdAria\", \"$mdConstant\", \"$mdTheming\", \"$mdUtil\", \"$timeout\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.chips\n */\n/*\n * @see js folder for chips implementation\n */\nangular.module('material.components.chips', [\n 'material.core',\n 'material.components.autocomplete'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.content\n *\n * @description\n * Scrollable content\n */\nangular.module('material.components.content', [\n 'material.core'\n])\n .directive('mdContent', mdContentDirective);\n\n/**\n * @ngdoc directive\n * @name mdContent\n * @module material.components.content\n *\n * @restrict E\n *\n * @description\n * The `<md-content>` directive is a container element useful for scrollable content\n *\n * @usage\n *\n * - Add the `[layout-padding]` attribute to make the content padded.\n *\n * <hljs lang=\"html\">\n * <md-content layout-padding>\n * Lorem ipsum dolor sit amet, ne quod novum mei.\n * </md-content>\n * </hljs>\n *\n */\n\nfunction mdContentDirective($mdTheming) {\n return {\n restrict: 'E',\n controller: ['$scope', '$element', ContentController],\n link: function(scope, element, attr) {\n var node = element[0];\n\n $mdTheming(element);\n scope.$broadcast('$mdContentLoaded', element);\n\n iosScrollFix(element[0]);\n }\n };\n\n function ContentController($scope, $element) {\n this.$scope = $scope;\n this.$element = $element;\n }\n}\nmdContentDirective.$inject = [\"$mdTheming\"];\n\nfunction iosScrollFix(node) {\n // IOS FIX:\n // If we scroll where there is no more room for the webview to scroll,\n // by default the webview itself will scroll up and down, this looks really\n // bad. So if we are scrolling to the very top or bottom, add/subtract one\n angular.element(node).on('$md.pressdown', function(ev) {\n // Only touch events\n if (ev.pointer.type !== 't') return;\n // Don't let a child content's touchstart ruin it for us.\n if (ev.$materialScrollFixed) return;\n ev.$materialScrollFixed = true;\n\n if (node.scrollTop === 0) {\n node.scrollTop = 1;\n } else if (node.scrollHeight === node.scrollTop + node.offsetHeight) {\n node.scrollTop -= 1;\n }\n });\n}\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc module\n * @name material.components.datepicker\n * @description Datepicker\n */\n angular.module('material.components.datepicker', [\n 'material.core',\n 'material.components.icon',\n 'material.components.virtualRepeat'\n ]).directive('mdCalendar', calendarDirective);\n\n\n // POST RELEASE\n // TODO(jelbourn): Mac Cmd + left / right == Home / End\n // TODO(jelbourn): Clicking on the month label opens the month-picker.\n // TODO(jelbourn): Minimum and maximum date\n // TODO(jelbourn): Refactor month element creation to use cloneNode (performance).\n // TODO(jelbourn): Define virtual scrolling constants (compactness) users can override.\n // TODO(jelbourn): Animated month transition on ng-model change (virtual-repeat)\n // TODO(jelbourn): Scroll snapping (virtual repeat)\n // TODO(jelbourn): Remove superfluous row from short months (virtual-repeat)\n // TODO(jelbourn): Month headers stick to top when scrolling.\n // TODO(jelbourn): Previous month opacity is lowered when partially scrolled out of view.\n // TODO(jelbourn): Support md-calendar standalone on a page (as a tabstop w/ aria-live\n // announcement and key handling).\n // Read-only calendar (not just date-picker).\n\n /**\n * Height of one calendar month tbody. This must be made known to the virtual-repeat and is\n * subsequently used for scrolling to specific months.\n */\n var TBODY_HEIGHT = 265;\n\n /**\n * Height of a calendar month with a single row. This is needed to calculate the offset for\n * rendering an extra month in virtual-repeat that only contains one row.\n */\n var TBODY_SINGLE_ROW_HEIGHT = 45;\n\n function calendarDirective() {\n return {\n template:\n '<table aria-hidden=\"true\" class=\"md-calendar-day-header\"><thead></thead></table>' +\n '<div class=\"md-calendar-scroll-mask\">' +\n '<md-virtual-repeat-container class=\"md-calendar-scroll-container\" ' +\n 'md-offset-size=\"' + (TBODY_SINGLE_ROW_HEIGHT - TBODY_HEIGHT) + '\">' +\n '<table role=\"grid\" tabindex=\"0\" class=\"md-calendar\" aria-readonly=\"true\">' +\n '<tbody role=\"rowgroup\" md-virtual-repeat=\"i in ctrl.items\" md-calendar-month ' +\n 'md-month-offset=\"$index\" class=\"md-calendar-month\" ' +\n 'md-start-index=\"ctrl.getSelectedMonthIndex()\" ' +\n 'md-item-size=\"' + TBODY_HEIGHT + '\"></tbody>' +\n '</table>' +\n '</md-virtual-repeat-container>' +\n '</div>',\n scope: {\n minDate: '=mdMinDate',\n maxDate: '=mdMaxDate',\n dateFilter: '=mdDateFilter',\n },\n require: ['ngModel', 'mdCalendar'],\n controller: CalendarCtrl,\n controllerAs: 'ctrl',\n bindToController: true,\n link: function(scope, element, attrs, controllers) {\n var ngModelCtrl = controllers[0];\n var mdCalendarCtrl = controllers[1];\n mdCalendarCtrl.configureNgModel(ngModelCtrl);\n }\n };\n }\n\n /** Class applied to the selected date cell/. */\n var SELECTED_DATE_CLASS = 'md-calendar-selected-date';\n\n /** Class applied to the focused date cell/. */\n var FOCUSED_DATE_CLASS = 'md-focus';\n\n /** Next identifier for calendar instance. */\n var nextUniqueId = 0;\n\n /** The first renderable date in the virtual-scrolling calendar (for all instances). */\n var firstRenderableDate = null;\n\n /**\n * Controller for the mdCalendar component.\n * @ngInject @constructor\n */\n function CalendarCtrl($element, $attrs, $scope, $animate, $q, $mdConstant,\n $mdTheming, $$mdDateUtil, $mdDateLocale, $mdInkRipple, $mdUtil) {\n $mdTheming($element);\n /**\n * Dummy array-like object for virtual-repeat to iterate over. The length is the total\n * number of months that can be viewed. This is shorter than ideal because of (potential)\n * Firefox bug https://bugzilla.mozilla.org/show_bug.cgi?id=1181658.\n */\n this.items = {length: 2000};\n\n if (this.maxDate && this.minDate) {\n // Limit the number of months if min and max dates are set.\n var numMonths = $$mdDateUtil.getMonthDistance(this.minDate, this.maxDate) + 1;\n numMonths = Math.max(numMonths, 1);\n // Add an additional month as the final dummy month for rendering purposes.\n numMonths += 1;\n this.items.length = numMonths;\n }\n\n /** @final {!angular.$animate} */\n this.$animate = $animate;\n\n /** @final {!angular.$q} */\n this.$q = $q;\n\n /** @final */\n this.$mdInkRipple = $mdInkRipple;\n\n /** @final */\n this.$mdUtil = $mdUtil;\n\n /** @final */\n this.keyCode = $mdConstant.KEY_CODE;\n\n /** @final */\n this.dateUtil = $$mdDateUtil;\n\n /** @final */\n this.dateLocale = $mdDateLocale;\n\n /** @final {!angular.JQLite} */\n this.$element = $element;\n\n /** @final {!angular.Scope} */\n this.$scope = $scope;\n\n /** @final {HTMLElement} */\n this.calendarElement = $element[0].querySelector('.md-calendar');\n\n /** @final {HTMLElement} */\n this.calendarScroller = $element[0].querySelector('.md-virtual-repeat-scroller');\n\n /** @final {Date} */\n this.today = this.dateUtil.createDateAtMidnight();\n\n /** @type {Date} */\n this.firstRenderableDate = this.dateUtil.incrementMonths(this.today, -this.items.length / 2);\n\n if (this.minDate && this.minDate > this.firstRenderableDate) {\n this.firstRenderableDate = this.minDate;\n } else if (this.maxDate) {\n // Calculate the difference between the start date and max date.\n // Subtract 1 because it's an inclusive difference and 1 for the final dummy month.\n //\n var monthDifference = this.items.length - 2;\n this.firstRenderableDate = this.dateUtil.incrementMonths(this.maxDate, -(this.items.length - 2));\n }\n\n\n /** @final {number} Unique ID for this calendar instance. */\n this.id = nextUniqueId++;\n\n /** @type {!angular.NgModelController} */\n this.ngModelCtrl = null;\n\n /**\n * The selected date. Keep track of this separately from the ng-model value so that we\n * can know, when the ng-model value changes, what the previous value was before it's updated\n * in the component's UI.\n *\n * @type {Date}\n */\n this.selectedDate = null;\n\n /**\n * The date that is currently focused or showing in the calendar. This will initially be set\n * to the ng-model value if set, otherwise to today. It will be updated as the user navigates\n * to other months. The cell corresponding to the displayDate does not necesarily always have\n * focus in the document (such as for cases when the user is scrolling the calendar).\n * @type {Date}\n */\n this.displayDate = null;\n\n /**\n * The date that has or should have focus.\n * @type {Date}\n */\n this.focusDate = null;\n\n /** @type {boolean} */\n this.isInitialized = false;\n\n /** @type {boolean} */\n this.isMonthTransitionInProgress = false;\n\n // Unless the user specifies so, the calendar should not be a tab stop.\n // This is necessary because ngAria might add a tabindex to anything with an ng-model\n // (based on whether or not the user has turned that particular feature on/off).\n if (!$attrs['tabindex']) {\n $element.attr('tabindex', '-1');\n }\n\n var self = this;\n\n /**\n * Handles a click event on a date cell.\n * Created here so that every cell can use the same function instance.\n * @this {HTMLTableCellElement} The cell that was clicked.\n */\n this.cellClickHandler = function() {\n var cellElement = this;\n if (this.hasAttribute('data-timestamp')) {\n $scope.$apply(function() {\n var timestamp = Number(cellElement.getAttribute('data-timestamp'));\n self.setNgModelValue(self.dateUtil.createDateAtMidnight(timestamp));\n });\n }\n };\n\n this.attachCalendarEventListeners();\n }\n CalendarCtrl.$inject = [\"$element\", \"$attrs\", \"$scope\", \"$animate\", \"$q\", \"$mdConstant\", \"$mdTheming\", \"$$mdDateUtil\", \"$mdDateLocale\", \"$mdInkRipple\", \"$mdUtil\"];\n\n\n /*** Initialization ***/\n\n /**\n * Sets up the controller's reference to ngModelController.\n * @param {!angular.NgModelController} ngModelCtrl\n */\n CalendarCtrl.prototype.configureNgModel = function(ngModelCtrl) {\n this.ngModelCtrl = ngModelCtrl;\n\n var self = this;\n ngModelCtrl.$render = function() {\n self.changeSelectedDate(self.ngModelCtrl.$viewValue);\n };\n };\n\n /**\n * Initialize the calendar by building the months that are initially visible.\n * Initialization should occur after the ngModel value is known.\n */\n CalendarCtrl.prototype.buildInitialCalendarDisplay = function() {\n this.buildWeekHeader();\n this.hideVerticalScrollbar();\n\n this.displayDate = this.selectedDate || this.today;\n this.isInitialized = true;\n };\n\n /**\n * Hides the vertical scrollbar on the calendar scroller by setting the width on the\n * calendar scroller and the `overflow: hidden` wrapper around the scroller, and then setting\n * a padding-right on the scroller equal to the width of the browser's scrollbar.\n *\n * This will cause a reflow.\n */\n CalendarCtrl.prototype.hideVerticalScrollbar = function() {\n var element = this.$element[0];\n\n var scrollMask = element.querySelector('.md-calendar-scroll-mask');\n var scroller = this.calendarScroller;\n\n var headerWidth = element.querySelector('.md-calendar-day-header').clientWidth;\n var scrollbarWidth = scroller.offsetWidth - scroller.clientWidth;\n\n scrollMask.style.width = headerWidth + 'px';\n scroller.style.width = (headerWidth + scrollbarWidth) + 'px';\n scroller.style.paddingRight = scrollbarWidth + 'px';\n };\n\n\n /** Attach event listeners for the calendar. */\n CalendarCtrl.prototype.attachCalendarEventListeners = function() {\n // Keyboard interaction.\n this.$element.on('keydown', angular.bind(this, this.handleKeyEvent));\n };\n\n /*** User input handling ***/\n\n /**\n * Handles a key event in the calendar with the appropriate action. The action will either\n * be to select the focused date or to navigate to focus a new date.\n * @param {KeyboardEvent} event\n */\n CalendarCtrl.prototype.handleKeyEvent = function(event) {\n var self = this;\n this.$scope.$apply(function() {\n // Capture escape and emit back up so that a wrapping component\n // (such as a date-picker) can decide to close.\n if (event.which == self.keyCode.ESCAPE || event.which == self.keyCode.TAB) {\n self.$scope.$emit('md-calendar-close');\n\n if (event.which == self.keyCode.TAB) {\n event.preventDefault();\n }\n\n return;\n }\n\n // Remaining key events fall into two categories: selection and navigation.\n // Start by checking if this is a selection event.\n if (event.which === self.keyCode.ENTER) {\n self.setNgModelValue(self.displayDate);\n event.preventDefault();\n return;\n }\n\n // Selection isn't occuring, so the key event is either navigation or nothing.\n var date = self.getFocusDateFromKeyEvent(event);\n if (date) {\n date = self.boundDateByMinAndMax(date);\n event.preventDefault();\n event.stopPropagation();\n\n // Since this is a keyboard interaction, actually give the newly focused date keyboard\n // focus after the been brought into view.\n self.changeDisplayDate(date).then(function () {\n self.focus(date);\n });\n }\n });\n };\n\n /**\n * Gets the date to focus as the result of a key event.\n * @param {KeyboardEvent} event\n * @returns {Date} Date to navigate to, or null if the key does not match a calendar shortcut.\n */\n CalendarCtrl.prototype.getFocusDateFromKeyEvent = function(event) {\n var dateUtil = this.dateUtil;\n var keyCode = this.keyCode;\n\n switch (event.which) {\n case keyCode.RIGHT_ARROW: return dateUtil.incrementDays(this.displayDate, 1);\n case keyCode.LEFT_ARROW: return dateUtil.incrementDays(this.displayDate, -1);\n case keyCode.DOWN_ARROW:\n return event.metaKey ?\n dateUtil.incrementMonths(this.displayDate, 1) :\n dateUtil.incrementDays(this.displayDate, 7);\n case keyCode.UP_ARROW:\n return event.metaKey ?\n dateUtil.incrementMonths(this.displayDate, -1) :\n dateUtil.incrementDays(this.displayDate, -7);\n case keyCode.PAGE_DOWN: return dateUtil.incrementMonths(this.displayDate, 1);\n case keyCode.PAGE_UP: return dateUtil.incrementMonths(this.displayDate, -1);\n case keyCode.HOME: return dateUtil.getFirstDateOfMonth(this.displayDate);\n case keyCode.END: return dateUtil.getLastDateOfMonth(this.displayDate);\n default: return null;\n }\n };\n\n /**\n * Gets the \"index\" of the currently selected date as it would be in the virtual-repeat.\n * @returns {number}\n */\n CalendarCtrl.prototype.getSelectedMonthIndex = function() {\n return this.dateUtil.getMonthDistance(this.firstRenderableDate,\n this.selectedDate || this.today);\n };\n\n /**\n * Scrolls to the month of the given date.\n * @param {Date} date\n */\n CalendarCtrl.prototype.scrollToMonth = function(date) {\n if (!this.dateUtil.isValidDate(date)) {\n return;\n }\n\n var monthDistance = this.dateUtil.getMonthDistance(this.firstRenderableDate, date);\n this.calendarScroller.scrollTop = monthDistance * TBODY_HEIGHT;\n };\n\n /**\n * Sets the ng-model value for the calendar and emits a change event.\n * @param {Date} date\n */\n CalendarCtrl.prototype.setNgModelValue = function(date) {\n this.$scope.$emit('md-calendar-change', date);\n this.ngModelCtrl.$setViewValue(date);\n this.ngModelCtrl.$render();\n };\n\n /**\n * Focus the cell corresponding to the given date.\n * @param {Date=} opt_date\n */\n CalendarCtrl.prototype.focus = function(opt_date) {\n var date = opt_date || this.selectedDate || this.today;\n\n var previousFocus = this.calendarElement.querySelector('.md-focus');\n if (previousFocus) {\n previousFocus.classList.remove(FOCUSED_DATE_CLASS);\n }\n\n var cellId = this.getDateId(date);\n var cell = document.getElementById(cellId);\n if (cell) {\n cell.classList.add(FOCUSED_DATE_CLASS);\n cell.focus();\n } else {\n this.focusDate = date;\n }\n };\n\n /**\n * If a date exceeds minDate or maxDate, returns date matching minDate or maxDate, respectively.\n * Otherwise, returns the date.\n * @param {Date} date\n * @return {Date}\n */\n CalendarCtrl.prototype.boundDateByMinAndMax = function(date) {\n var boundDate = date;\n if (this.minDate && date < this.minDate) {\n boundDate = new Date(this.minDate.getTime());\n }\n if (this.maxDate && date > this.maxDate) {\n boundDate = new Date(this.maxDate.getTime());\n }\n return boundDate;\n };\n\n /*** Updating the displayed / selected date ***/\n\n /**\n * Change the selected date in the calendar (ngModel value has already been changed).\n * @param {Date} date\n */\n CalendarCtrl.prototype.changeSelectedDate = function(date) {\n var self = this;\n var previousSelectedDate = this.selectedDate;\n this.selectedDate = date;\n this.changeDisplayDate(date).then(function() {\n\n // Remove the selected class from the previously selected date, if any.\n if (previousSelectedDate) {\n var prevDateCell =\n document.getElementById(self.getDateId(previousSelectedDate));\n if (prevDateCell) {\n prevDateCell.classList.remove(SELECTED_DATE_CLASS);\n prevDateCell.setAttribute('aria-selected', 'false');\n }\n }\n\n // Apply the select class to the new selected date if it is set.\n if (date) {\n var dateCell = document.getElementById(self.getDateId(date));\n if (dateCell) {\n dateCell.classList.add(SELECTED_DATE_CLASS);\n dateCell.setAttribute('aria-selected', 'true');\n }\n }\n });\n };\n\n\n /**\n * Change the date that is being shown in the calendar. If the given date is in a different\n * month, the displayed month will be transitioned.\n * @param {Date} date\n */\n CalendarCtrl.prototype.changeDisplayDate = function(date) {\n // Initialization is deferred until this function is called because we want to reflect\n // the starting value of ngModel.\n if (!this.isInitialized) {\n this.buildInitialCalendarDisplay();\n return this.$q.when();\n }\n\n // If trying to show an invalid date or a transition is in progress, do nothing.\n if (!this.dateUtil.isValidDate(date) || this.isMonthTransitionInProgress) {\n return this.$q.when();\n }\n\n this.isMonthTransitionInProgress = true;\n var animationPromise = this.animateDateChange(date);\n\n this.displayDate = date;\n\n var self = this;\n animationPromise.then(function() {\n self.isMonthTransitionInProgress = false;\n });\n\n return animationPromise;\n };\n\n /**\n * Animates the transition from the calendar's current month to the given month.\n * @param {Date} date\n * @returns {angular.$q.Promise} The animation promise.\n */\n CalendarCtrl.prototype.animateDateChange = function(date) {\n this.scrollToMonth(date);\n return this.$q.when();\n };\n\n /*** Constructing the calendar table ***/\n\n /**\n * Builds and appends a day-of-the-week header to the calendar.\n * This should only need to be called once during initialization.\n */\n CalendarCtrl.prototype.buildWeekHeader = function() {\n var firstDayOfWeek = this.dateLocale.firstDayOfWeek;\n var shortDays = this.dateLocale.shortDays;\n\n var row = document.createElement('tr');\n for (var i = 0; i < 7; i++) {\n var th = document.createElement('th');\n th.textContent = shortDays[(i + firstDayOfWeek) % 7];\n row.appendChild(th);\n }\n\n this.$element.find('thead').append(row);\n };\n\n /**\n * Gets an identifier for a date unique to the calendar instance for internal\n * purposes. Not to be displayed.\n * @param {Date} date\n * @returns {string}\n */\n CalendarCtrl.prototype.getDateId = function(date) {\n return [\n 'md',\n this.id,\n date.getFullYear(),\n date.getMonth(),\n date.getDate()\n ].join('-');\n };\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n\n angular.module('material.components.datepicker')\n .directive('mdCalendarMonth', mdCalendarMonthDirective);\n\n\n /**\n * Private directive consumed by md-calendar. Having this directive lets the calender use\n * md-virtual-repeat and also cleanly separates the month DOM construction functions from\n * the rest of the calendar controller logic.\n */\n function mdCalendarMonthDirective() {\n return {\n require: ['^^mdCalendar', 'mdCalendarMonth'],\n scope: {offset: '=mdMonthOffset'},\n controller: CalendarMonthCtrl,\n controllerAs: 'mdMonthCtrl',\n bindToController: true,\n link: function(scope, element, attrs, controllers) {\n var calendarCtrl = controllers[0];\n var monthCtrl = controllers[1];\n\n monthCtrl.calendarCtrl = calendarCtrl;\n monthCtrl.generateContent();\n\n // The virtual-repeat re-uses the same DOM elements, so there are only a limited number\n // of repeated items that are linked, and then those elements have their bindings updataed.\n // Since the months are not generated by bindings, we simply regenerate the entire thing\n // when the binding (offset) changes.\n scope.$watch(function() { return monthCtrl.offset; }, function(offset, oldOffset) {\n if (offset != oldOffset) {\n monthCtrl.generateContent();\n }\n });\n }\n };\n }\n\n /** Class applied to the cell for today. */\n var TODAY_CLASS = 'md-calendar-date-today';\n\n /** Class applied to the selected date cell/. */\n var SELECTED_DATE_CLASS = 'md-calendar-selected-date';\n\n /** Class applied to the focused date cell/. */\n var FOCUSED_DATE_CLASS = 'md-focus';\n\n /**\n * Controller for a single calendar month.\n * @ngInject @constructor\n */\n function CalendarMonthCtrl($element, $$mdDateUtil, $mdDateLocale) {\n this.dateUtil = $$mdDateUtil;\n this.dateLocale = $mdDateLocale;\n this.$element = $element;\n this.calendarCtrl = null;\n\n /**\n * Number of months from the start of the month \"items\" that the currently rendered month\n * occurs. Set via angular data binding.\n * @type {number}\n */\n this.offset;\n\n /**\n * Date cell to focus after appending the month to the document.\n * @type {HTMLElement}\n */\n this.focusAfterAppend = null;\n }\n CalendarMonthCtrl.$inject = [\"$element\", \"$$mdDateUtil\", \"$mdDateLocale\"];\n\n /** Generate and append the content for this month to the directive element. */\n CalendarMonthCtrl.prototype.generateContent = function() {\n var calendarCtrl = this.calendarCtrl;\n var date = this.dateUtil.incrementMonths(calendarCtrl.firstRenderableDate, this.offset);\n\n this.$element.empty();\n this.$element.append(this.buildCalendarForMonth(date));\n\n if (this.focusAfterAppend) {\n this.focusAfterAppend.classList.add(FOCUSED_DATE_CLASS);\n this.focusAfterAppend.focus();\n this.focusAfterAppend = null;\n }\n };\n\n /**\n * Creates a single cell to contain a date in the calendar with all appropriate\n * attributes and classes added. If a date is given, the cell content will be set\n * based on the date.\n * @param {Date=} opt_date\n * @returns {HTMLElement}\n */\n CalendarMonthCtrl.prototype.buildDateCell = function(opt_date) {\n var calendarCtrl = this.calendarCtrl;\n\n // TODO(jelbourn): cloneNode is likely a faster way of doing this.\n var cell = document.createElement('td');\n cell.tabIndex = -1;\n cell.classList.add('md-calendar-date');\n cell.setAttribute('role', 'gridcell');\n\n if (opt_date) {\n cell.setAttribute('tabindex', '-1');\n cell.setAttribute('aria-label', this.dateLocale.longDateFormatter(opt_date));\n cell.id = calendarCtrl.getDateId(opt_date);\n\n // Use `data-timestamp` attribute because IE10 does not support the `dataset` property.\n cell.setAttribute('data-timestamp', opt_date.getTime());\n\n // TODO(jelourn): Doing these comparisons for class addition during generation might be slow.\n // It may be better to finish the construction and then query the node and add the class.\n if (this.dateUtil.isSameDay(opt_date, calendarCtrl.today)) {\n cell.classList.add(TODAY_CLASS);\n }\n\n if (this.dateUtil.isValidDate(calendarCtrl.selectedDate) &&\n this.dateUtil.isSameDay(opt_date, calendarCtrl.selectedDate)) {\n cell.classList.add(SELECTED_DATE_CLASS);\n cell.setAttribute('aria-selected', 'true');\n }\n\n var cellText = this.dateLocale.dates[opt_date.getDate()];\n\n if (this.isDateEnabled(opt_date)) {\n // Add a indicator for select, hover, and focus states.\n var selectionIndicator = document.createElement('span');\n cell.appendChild(selectionIndicator);\n selectionIndicator.classList.add('md-calendar-date-selection-indicator');\n selectionIndicator.textContent = cellText;\n\n cell.addEventListener('click', calendarCtrl.cellClickHandler);\n\n if (calendarCtrl.focusDate && this.dateUtil.isSameDay(opt_date, calendarCtrl.focusDate)) {\n this.focusAfterAppend = cell;\n }\n } else {\n cell.classList.add('md-calendar-date-disabled');\n cell.textContent = cellText;\n }\n }\n\n return cell;\n };\n \n /**\n * Check whether date is in range and enabled\n * @param {Date=} opt_date\n * @return {boolean} Whether the date is enabled.\n */\n CalendarMonthCtrl.prototype.isDateEnabled = function(opt_date) {\n return this.dateUtil.isDateWithinRange(opt_date, \n this.calendarCtrl.minDate, this.calendarCtrl.maxDate) && \n (!angular.isFunction(this.calendarCtrl.dateFilter)\n || this.calendarCtrl.dateFilter(opt_date));\n }\n \n /**\n * Builds a `tr` element for the calendar grid.\n * @param rowNumber The week number within the month.\n * @returns {HTMLElement}\n */\n CalendarMonthCtrl.prototype.buildDateRow = function(rowNumber) {\n var row = document.createElement('tr');\n row.setAttribute('role', 'row');\n\n // Because of an NVDA bug (with Firefox), the row needs an aria-label in order\n // to prevent the entire row being read aloud when the user moves between rows.\n // See http://community.nvda-project.org/ticket/4643.\n row.setAttribute('aria-label', this.dateLocale.weekNumberFormatter(rowNumber));\n\n return row;\n };\n\n /**\n * Builds the <tbody> content for the given date's month.\n * @param {Date=} opt_dateInMonth\n * @returns {DocumentFragment} A document fragment containing the <tr> elements.\n */\n CalendarMonthCtrl.prototype.buildCalendarForMonth = function(opt_dateInMonth) {\n var date = this.dateUtil.isValidDate(opt_dateInMonth) ? opt_dateInMonth : new Date();\n\n var firstDayOfMonth = this.dateUtil.getFirstDateOfMonth(date);\n var firstDayOfTheWeek = this.getLocaleDay_(firstDayOfMonth);\n var numberOfDaysInMonth = this.dateUtil.getNumberOfDaysInMonth(date);\n\n // Store rows for the month in a document fragment so that we can append them all at once.\n var monthBody = document.createDocumentFragment();\n\n var rowNumber = 1;\n var row = this.buildDateRow(rowNumber);\n monthBody.appendChild(row);\n\n // If this is the final month in the list of items, only the first week should render,\n // so we should return immediately after the first row is complete and has been\n // attached to the body.\n var isFinalMonth = this.offset === this.calendarCtrl.items.length - 1;\n\n // Add a label for the month. If the month starts on a Sun/Mon/Tues, the month label\n // goes on a row above the first of the month. Otherwise, the month label takes up the first\n // two cells of the first row.\n var blankCellOffset = 0;\n var monthLabelCell = document.createElement('td');\n monthLabelCell.classList.add('md-calendar-month-label');\n // If the entire month is after the max date, render the label as a disabled state.\n if (this.calendarCtrl.maxDate && firstDayOfMonth > this.calendarCtrl.maxDate) {\n monthLabelCell.classList.add('md-calendar-month-label-disabled');\n }\n monthLabelCell.textContent = this.dateLocale.monthHeaderFormatter(date);\n if (firstDayOfTheWeek <= 2) {\n monthLabelCell.setAttribute('colspan', '7');\n\n var monthLabelRow = this.buildDateRow();\n monthLabelRow.appendChild(monthLabelCell);\n monthBody.insertBefore(monthLabelRow, row);\n\n if (isFinalMonth) {\n return monthBody;\n }\n } else {\n blankCellOffset = 2;\n monthLabelCell.setAttribute('colspan', '2');\n row.appendChild(monthLabelCell);\n }\n\n // Add a blank cell for each day of the week that occurs before the first of the month.\n // For example, if the first day of the month is a Tuesday, add blank cells for Sun and Mon.\n // The blankCellOffset is needed in cases where the first N cells are used by the month label.\n for (var i = blankCellOffset; i < firstDayOfTheWeek; i++) {\n row.appendChild(this.buildDateCell());\n }\n\n // Add a cell for each day of the month, keeping track of the day of the week so that\n // we know when to start a new row.\n var dayOfWeek = firstDayOfTheWeek;\n var iterationDate = firstDayOfMonth;\n for (var d = 1; d <= numberOfDaysInMonth; d++) {\n // If we've reached the end of the week, start a new row.\n if (dayOfWeek === 7) {\n // We've finished the first row, so we're done if this is the final month.\n if (isFinalMonth) {\n return monthBody;\n }\n dayOfWeek = 0;\n rowNumber++;\n row = this.buildDateRow(rowNumber);\n monthBody.appendChild(row);\n }\n\n iterationDate.setDate(d);\n var cell = this.buildDateCell(iterationDate);\n row.appendChild(cell);\n\n dayOfWeek++;\n }\n\n // Ensure that the last row of the month has 7 cells.\n while (row.childNodes.length < 7) {\n row.appendChild(this.buildDateCell());\n }\n\n // Ensure that all months have 6 rows. This is necessary for now because the virtual-repeat\n // requires that all items have exactly the same height.\n while (monthBody.childNodes.length < 6) {\n var whitespaceRow = this.buildDateRow();\n for (var i = 0; i < 7; i++) {\n whitespaceRow.appendChild(this.buildDateCell());\n }\n monthBody.appendChild(whitespaceRow);\n }\n\n return monthBody;\n };\n\n /**\n * Gets the day-of-the-week index for a date for the current locale.\n * @private\n * @param {Date} date\n * @returns {number} The column index of the date in the calendar.\n */\n CalendarMonthCtrl.prototype.getLocaleDay_ = function(date) {\n return (date.getDay() + (7 - this.dateLocale.firstDayOfWeek)) % 7\n };\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdDateLocaleProvider\n * @module material.components.datepicker\n *\n * @description\n * The `$mdDateLocaleProvider` is the provider that creates the `$mdDateLocale` service.\n * This provider that allows the user to specify messages, formatters, and parsers for date\n * internationalization. The `$mdDateLocale` service itself is consumed by Angular Material\n * components that deal with dates.\n *\n * @property {(Array<string>)=} months Array of month names (in order).\n * @property {(Array<string>)=} shortMonths Array of abbreviated month names.\n * @property {(Array<string>)=} days Array of the days of the week (in order).\n * @property {(Array<string>)=} shortDays Array of abbreviated dayes of the week.\n * @property {(Array<string>)=} dates Array of dates of the month. Only necessary for locales\n * using a numeral system other than [1, 2, 3...].\n * @property {(Array<string>)=} firstDayOfWeek The first day of the week. Sunday = 0, Monday = 1,\n * etc.\n * @property {(function(string): Date)=} parseDate Function to parse a date object from a string.\n * @property {(function(Date): string)=} formatDate Function to format a date object to a string.\n * @property {(function(Date): string)=} monthHeaderFormatter Function that returns the label for\n * a month given a date.\n * @property {(function(number): string)=} weekNumberFormatter Function that returns a label for\n * a week given the week number.\n * @property {(string)=} msgCalendar Translation of the label \"Calendar\" for the current locale.\n * @property {(string)=} msgOpenCalendar Translation of the button label \"Open calendar\" for the\n * current locale.\n *\n * @usage\n * <hljs lang=\"js\">\n * myAppModule.config(function($mdDateLocaleProvider) {\n *\n * // Example of a French localization.\n * $mdDateLocaleProvider.months = ['janvier', 'février', 'mars', ...];\n * $mdDateLocaleProvider.shortMonths = ['janv', 'févr', 'mars', ...];\n * $mdDateLocaleProvider.days = ['dimanche', 'lundi', 'mardi', ...];\n * $mdDateLocaleProvider.shortDays = ['Di', 'Lu', 'Ma', ...];\n *\n * // Can change week display to start on Monday.\n * $mdDateLocaleProvider.firstDayOfWeek = 1;\n *\n * // Optional.\n * $mdDateLocaleProvider.dates = [1, 2, 3, 4, 5, 6, ...];\n *\n * // Example uses moment.js to parse and format dates.\n * $mdDateLocaleProvider.parseDate = function(dateString) {\n * var m = moment(dateString, 'L', true);\n * return m.isValid() ? m.toDate() : new Date(NaN);\n * };\n *\n * $mdDateLocaleProvider.formatDate = function(date) {\n * return moment(date).format('L');\n * };\n *\n * $mdDateLocaleProvider.monthHeaderFormatter = function(date) {\n * return myShortMonths[date.getMonth()] + ' ' + date.getFullYear();\n * };\n *\n * // In addition to date display, date components also need localized messages\n * // for aria-labels for screen-reader users.\n *\n * $mdDateLocaleProvider.weekNumberFormatter = function(weekNumber) {\n * return 'Semaine ' + weekNumber;\n * };\n *\n * $mdDateLocaleProvider.msgCalendar = 'Calendrier';\n * $mdDateLocaleProvider.msgOpenCalendar = 'Ouvrir le calendrier';\n *\n * });\n * </hljs>\n *\n */\n\n angular.module('material.components.datepicker').config([\"$provide\", function($provide) {\n // TODO(jelbourn): Assert provided values are correctly formatted. Need assertions.\n\n /** @constructor */\n function DateLocaleProvider() {\n /** Array of full month names. E.g., ['January', 'Febuary', ...] */\n this.months = null;\n\n /** Array of abbreviated month names. E.g., ['Jan', 'Feb', ...] */\n this.shortMonths = null;\n\n /** Array of full day of the week names. E.g., ['Monday', 'Tuesday', ...] */\n this.days = null;\n\n /** Array of abbreviated dat of the week names. E.g., ['M', 'T', ...] */\n this.shortDays = null;\n\n /** Array of dates of a month (1 - 31). Characters might be different in some locales. */\n this.dates = null;\n\n /** Index of the first day of the week. 0 = Sunday, 1 = Monday, etc. */\n this.firstDayOfWeek = 0;\n\n /**\n * Function that converts the date portion of a Date to a string.\n * @type {(function(Date): string)}\n */\n this.formatDate = null;\n\n /**\n * Function that converts a date string to a Date object (the date portion)\n * @type {function(string): Date}\n */\n this.parseDate = null;\n\n /**\n * Function that formats a Date into a month header string.\n * @type {function(Date): string}\n */\n this.monthHeaderFormatter = null;\n\n /**\n * Function that formats a week number into a label for the week.\n * @type {function(number): string}\n */\n this.weekNumberFormatter = null;\n\n /**\n * Function that formats a date into a long aria-label that is read\n * when the focused date changes.\n * @type {function(Date): string}\n */\n this.longDateFormatter = null;\n\n /**\n * ARIA label for the calendar \"dialog\" used in the datepicker.\n * @type {string}\n */\n this.msgCalendar = '';\n\n /**\n * ARIA label for the datepicker's \"Open calendar\" buttons.\n * @type {string}\n */\n this.msgOpenCalendar = '';\n }\n\n /**\n * Factory function that returns an instance of the dateLocale service.\n * @ngInject\n * @param $locale\n * @returns {DateLocale}\n */\n DateLocaleProvider.prototype.$get = function($locale) {\n /**\n * Default date-to-string formatting function.\n * @param {!Date} date\n * @returns {string}\n */\n function defaultFormatDate(date) {\n if (!date) {\n return '';\n }\n\n // All of the dates created through ng-material *should* be set to midnight.\n // If we encounter a date where the localeTime shows at 11pm instead of midnight,\n // we have run into an issue with DST where we need to increment the hour by one:\n // var d = new Date(1992, 9, 8, 0, 0, 0);\n // d.toLocaleString(); // == \"10/7/1992, 11:00:00 PM\"\n var localeTime = date.toLocaleTimeString();\n var formatDate = date;\n if (date.getHours() == 0 &&\n (localeTime.indexOf('11:') !== -1 || localeTime.indexOf('23:') !== -1)) {\n formatDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 1, 0, 0);\n }\n\n return formatDate.toLocaleDateString();\n }\n\n /**\n * Default string-to-date parsing function.\n * @param {string} dateString\n * @returns {!Date}\n */\n function defaultParseDate(dateString) {\n return new Date(dateString);\n }\n\n /**\n * Default function to determine whether a string makes sense to be\n * parsed to a Date object.\n *\n * This is very permissive and is just a basic sanity check to ensure that\n * things like single integers aren't able to be parsed into dates.\n * @param {string} dateString\n * @returns {boolean}\n */\n function defaultIsDateComplete(dateString) {\n dateString = dateString.trim();\n\n // Looks for three chunks of content (either numbers or text) separated\n // by delimiters.\n var re = /^(([a-zA-Z]{3,}|[0-9]{1,4})([ \\.,]+|[\\/\\-])){2}([a-zA-Z]{3,}|[0-9]{1,4})$/;\n return re.test(dateString);\n }\n\n /**\n * Default date-to-string formatter to get a month header.\n * @param {!Date} date\n * @returns {string}\n */\n function defaultMonthHeaderFormatter(date) {\n return service.shortMonths[date.getMonth()] + ' ' + date.getFullYear();\n }\n\n /**\n * Default week number formatter.\n * @param number\n * @returns {string}\n */\n function defaultWeekNumberFormatter(number) {\n return 'Week ' + number;\n }\n\n /**\n * Default formatter for date cell aria-labels.\n * @param {!Date} date\n * @returns {string}\n */\n function defaultLongDateFormatter(date) {\n // Example: 'Thursday June 18 2015'\n return [\n service.days[date.getDay()],\n service.months[date.getMonth()],\n service.dates[date.getDate()],\n date.getFullYear()\n ].join(' ');\n }\n\n // The default \"short\" day strings are the first character of each day,\n // e.g., \"Monday\" => \"M\".\n var defaultShortDays = $locale.DATETIME_FORMATS.DAY.map(function(day) {\n return day[0];\n });\n\n // The default dates are simply the numbers 1 through 31.\n var defaultDates = Array(32);\n for (var i = 1; i <= 31; i++) {\n defaultDates[i] = i;\n }\n\n // Default ARIA messages are in English (US).\n var defaultMsgCalendar = 'Calendar';\n var defaultMsgOpenCalendar = 'Open calendar';\n\n var service = {\n months: this.months || $locale.DATETIME_FORMATS.MONTH,\n shortMonths: this.shortMonths || $locale.DATETIME_FORMATS.SHORTMONTH,\n days: this.days || $locale.DATETIME_FORMATS.DAY,\n shortDays: this.shortDays || defaultShortDays,\n dates: this.dates || defaultDates,\n firstDayOfWeek: this.firstDayOfWeek || 0,\n formatDate: this.formatDate || defaultFormatDate,\n parseDate: this.parseDate || defaultParseDate,\n isDateComplete: this.isDateComplete || defaultIsDateComplete,\n monthHeaderFormatter: this.monthHeaderFormatter || defaultMonthHeaderFormatter,\n weekNumberFormatter: this.weekNumberFormatter || defaultWeekNumberFormatter,\n longDateFormatter: this.longDateFormatter || defaultLongDateFormatter,\n msgCalendar: this.msgCalendar || defaultMsgCalendar,\n msgOpenCalendar: this.msgOpenCalendar || defaultMsgOpenCalendar\n };\n\n return service;\n };\n DateLocaleProvider.prototype.$get.$inject = [\"$locale\"];\n\n $provide.provider('$mdDateLocale', new DateLocaleProvider());\n }]);\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n // POST RELEASE\n // TODO(jelbourn): Demo that uses moment.js\n // TODO(jelbourn): make sure this plays well with validation and ngMessages.\n // TODO(jelbourn): calendar pane doesn't open up outside of visible viewport.\n // TODO(jelbourn): forward more attributes to the internal input (required, autofocus, etc.)\n // TODO(jelbourn): something better for mobile (calendar panel takes up entire screen?)\n // TODO(jelbourn): input behavior (masking? auto-complete?)\n // TODO(jelbourn): UTC mode\n // TODO(jelbourn): RTL\n\n\n angular.module('material.components.datepicker')\n .directive('mdDatepicker', datePickerDirective);\n\n /**\n * @ngdoc directive\n * @name mdDatepicker\n * @module material.components.datepicker\n *\n * @param {Date} ng-model The component's model. Expects a JavaScript Date object.\n * @param {expression=} ng-change Expression evaluated when the model value changes.\n * @param {Date=} md-min-date Expression representing a min date (inclusive).\n * @param {Date=} md-max-date Expression representing a max date (inclusive).\n * @param {(function(Date): boolean)=} md-date-filter Function expecting a date and returning a boolean whether it can be selected or not.\n * @param {String=} md-placeholder The date input placeholder value.\n * @param {boolean=} ng-disabled Whether the datepicker is disabled.\n * @param {boolean=} ng-required Whether a value is required for the datepicker.\n *\n * @description\n * `<md-datepicker>` is a component used to select a single date.\n * For information on how to configure internationalization for the date picker,\n * see `$mdDateLocaleProvider`.\n *\n * This component supports [ngMessages](https://docs.angularjs.org/api/ngMessages/directive/ngMessages).\n * Supported attributes are:\n * * `required`: whether a required date is not set.\n * * `mindate`: whether the selected date is before the minimum allowed date.\n * * `maxdate`: whether the selected date is after the maximum allowed date.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-datepicker ng-model=\"birthday\"></md-datepicker>\n * </hljs>\n *\n */\n function datePickerDirective() {\n return {\n template:\n // Buttons are not in the tab order because users can open the calendar via keyboard\n // interaction on the text input, and multiple tab stops for one component (picker)\n // may be confusing.\n '<md-button class=\"md-datepicker-button md-icon-button\" type=\"button\" ' +\n 'tabindex=\"-1\" aria-hidden=\"true\" ' +\n 'ng-click=\"ctrl.openCalendarPane($event)\">' +\n '<md-icon class=\"md-datepicker-calendar-icon\" md-svg-icon=\"md-calendar\"></md-icon>' +\n '</md-button>' +\n '<div class=\"md-datepicker-input-container\" ' +\n 'ng-class=\"{\\'md-datepicker-focused\\': ctrl.isFocused}\">' +\n '<input class=\"md-datepicker-input\" aria-haspopup=\"true\" ' +\n 'ng-focus=\"ctrl.setFocused(true)\" ng-blur=\"ctrl.setFocused(false)\">' +\n '<md-button type=\"button\" md-no-ink ' +\n 'class=\"md-datepicker-triangle-button md-icon-button\" ' +\n 'ng-click=\"ctrl.openCalendarPane($event)\" ' +\n 'aria-label=\"{{::ctrl.dateLocale.msgOpenCalendar}}\">' +\n '<div class=\"md-datepicker-expand-triangle\"></div>' +\n '</md-button>' +\n '</div>' +\n\n // This pane will be detached from here and re-attached to the document body.\n '<div class=\"md-datepicker-calendar-pane md-whiteframe-z1\">' +\n '<div class=\"md-datepicker-input-mask\">' +\n '<div class=\"md-datepicker-input-mask-opaque\"></div>' +\n '</div>' +\n '<div class=\"md-datepicker-calendar\">' +\n '<md-calendar role=\"dialog\" aria-label=\"{{::ctrl.dateLocale.msgCalendar}}\" ' +\n 'md-min-date=\"ctrl.minDate\" md-max-date=\"ctrl.maxDate\"' +\n 'md-date-filter=\"ctrl.dateFilter\"' +\n 'ng-model=\"ctrl.date\" ng-if=\"ctrl.isCalendarOpen\">' +\n '</md-calendar>' +\n '</div>' +\n '</div>',\n require: ['ngModel', 'mdDatepicker', '?^mdInputContainer'],\n scope: {\n minDate: '=mdMinDate',\n maxDate: '=mdMaxDate',\n placeholder: '@mdPlaceholder',\n dateFilter: '=mdDateFilter'\n },\n controller: DatePickerCtrl,\n controllerAs: 'ctrl',\n bindToController: true,\n link: function(scope, element, attr, controllers) {\n var ngModelCtrl = controllers[0];\n var mdDatePickerCtrl = controllers[1];\n\n var mdInputContainer = controllers[2];\n if (mdInputContainer) {\n throw Error('md-datepicker should not be placed inside md-input-container.');\n }\n\n mdDatePickerCtrl.configureNgModel(ngModelCtrl);\n }\n };\n }\n\n /** Additional offset for the input's `size` attribute, which is updated based on its content. */\n var EXTRA_INPUT_SIZE = 3;\n\n /** Class applied to the container if the date is invalid. */\n var INVALID_CLASS = 'md-datepicker-invalid';\n\n /** Default time in ms to debounce input event by. */\n var DEFAULT_DEBOUNCE_INTERVAL = 500;\n\n /**\n * Height of the calendar pane used to check if the pane is going outside the boundary of\n * the viewport. See calendar.scss for how $md-calendar-height is computed; an extra 20px is\n * also added to space the pane away from the exact edge of the screen.\n *\n * This is computed statically now, but can be changed to be measured if the circumstances\n * of calendar sizing are changed.\n */\n var CALENDAR_PANE_HEIGHT = 368;\n\n /**\n * Width of the calendar pane used to check if the pane is going outside the boundary of\n * the viewport. See calendar.scss for how $md-calendar-width is computed; an extra 20px is\n * also added to space the pane away from the exact edge of the screen.\n *\n * This is computed statically now, but can be changed to be measured if the circumstances\n * of calendar sizing are changed.\n */\n var CALENDAR_PANE_WIDTH = 360;\n\n /**\n * Controller for md-datepicker.\n *\n * @ngInject @constructor\n */\n function DatePickerCtrl($scope, $element, $attrs, $compile, $timeout, $window,\n $mdConstant, $mdTheming, $mdUtil, $mdDateLocale, $$mdDateUtil, $$rAF) {\n /** @final */\n this.$compile = $compile;\n\n /** @final */\n this.$timeout = $timeout;\n\n /** @final */\n this.$window = $window;\n\n /** @final */\n this.dateLocale = $mdDateLocale;\n\n /** @final */\n this.dateUtil = $$mdDateUtil;\n\n /** @final */\n this.$mdConstant = $mdConstant;\n\n /* @final */\n this.$mdUtil = $mdUtil;\n\n /** @final */\n this.$$rAF = $$rAF;\n\n /**\n * The root document element. This is used for attaching a top-level click handler to\n * close the calendar panel when a click outside said panel occurs. We use `documentElement`\n * instead of body because, when scrolling is disabled, some browsers consider the body element\n * to be completely off the screen and propagate events directly to the html element.\n * @type {!angular.JQLite}\n */\n this.documentElement = angular.element(document.documentElement);\n\n /** @type {!angular.NgModelController} */\n this.ngModelCtrl = null;\n\n /** @type {HTMLInputElement} */\n this.inputElement = $element[0].querySelector('input');\n\n /** @final {!angular.JQLite} */\n this.ngInputElement = angular.element(this.inputElement);\n\n /** @type {HTMLElement} */\n this.inputContainer = $element[0].querySelector('.md-datepicker-input-container');\n\n /** @type {HTMLElement} Floating calendar pane. */\n this.calendarPane = $element[0].querySelector('.md-datepicker-calendar-pane');\n\n /** @type {HTMLElement} Calendar icon button. */\n this.calendarButton = $element[0].querySelector('.md-datepicker-button');\n\n /**\n * Element covering everything but the input in the top of the floating calendar pane.\n * @type {HTMLElement}\n */\n this.inputMask = $element[0].querySelector('.md-datepicker-input-mask-opaque');\n\n /** @final {!angular.JQLite} */\n this.$element = $element;\n\n /** @final {!angular.Attributes} */\n this.$attrs = $attrs;\n\n /** @final {!angular.Scope} */\n this.$scope = $scope;\n\n /** @type {Date} */\n this.date = null;\n\n /** @type {boolean} */\n this.isFocused = false;\n\n /** @type {boolean} */\n this.isDisabled;\n this.setDisabled($element[0].disabled || angular.isString($attrs['disabled']));\n\n /** @type {boolean} Whether the date-picker's calendar pane is open. */\n this.isCalendarOpen = false;\n\n /**\n * Element from which the calendar pane was opened. Keep track of this so that we can return\n * focus to it when the pane is closed.\n * @type {HTMLElement}\n */\n this.calendarPaneOpenedFrom = null;\n\n this.calendarPane.id = 'md-date-pane' + $mdUtil.nextUid();\n\n $mdTheming($element);\n\n /** Pre-bound click handler is saved so that the event listener can be removed. */\n this.bodyClickHandler = angular.bind(this, this.handleBodyClick);\n\n /** Pre-bound resize handler so that the event listener can be removed. */\n this.windowResizeHandler = $mdUtil.debounce(angular.bind(this, this.closeCalendarPane), 100);\n\n // Unless the user specifies so, the datepicker should not be a tab stop.\n // This is necessary because ngAria might add a tabindex to anything with an ng-model\n // (based on whether or not the user has turned that particular feature on/off).\n if (!$attrs['tabindex']) {\n $element.attr('tabindex', '-1');\n }\n\n this.installPropertyInterceptors();\n this.attachChangeListeners();\n this.attachInteractionListeners();\n\n var self = this;\n $scope.$on('$destroy', function() {\n self.detachCalendarPane();\n });\n }\n DatePickerCtrl.$inject = [\"$scope\", \"$element\", \"$attrs\", \"$compile\", \"$timeout\", \"$window\", \"$mdConstant\", \"$mdTheming\", \"$mdUtil\", \"$mdDateLocale\", \"$$mdDateUtil\", \"$$rAF\"];\n\n /**\n * Sets up the controller's reference to ngModelController.\n * @param {!angular.NgModelController} ngModelCtrl\n */\n DatePickerCtrl.prototype.configureNgModel = function(ngModelCtrl) {\n this.ngModelCtrl = ngModelCtrl;\n\n var self = this;\n ngModelCtrl.$render = function() {\n var value = self.ngModelCtrl.$viewValue;\n\n if (value && !(value instanceof Date)) {\n throw Error('The ng-model for md-datepicker must be a Date instance. ' +\n 'Currently the model is a: ' + (typeof value));\n }\n\n self.date = value;\n self.inputElement.value = self.dateLocale.formatDate(value);\n self.resizeInputElement();\n self.updateErrorState();\n };\n };\n\n /**\n * Attach event listeners for both the text input and the md-calendar.\n * Events are used instead of ng-model so that updates don't infinitely update the other\n * on a change. This should also be more performant than using a $watch.\n */\n DatePickerCtrl.prototype.attachChangeListeners = function() {\n var self = this;\n\n self.$scope.$on('md-calendar-change', function(event, date) {\n self.ngModelCtrl.$setViewValue(date);\n self.date = date;\n self.inputElement.value = self.dateLocale.formatDate(date);\n self.closeCalendarPane();\n self.resizeInputElement();\n self.updateErrorState();\n });\n\n self.ngInputElement.on('input', angular.bind(self, self.resizeInputElement));\n // TODO(chenmike): Add ability for users to specify this interval.\n self.ngInputElement.on('input', self.$mdUtil.debounce(self.handleInputEvent,\n DEFAULT_DEBOUNCE_INTERVAL, self));\n };\n\n /** Attach event listeners for user interaction. */\n DatePickerCtrl.prototype.attachInteractionListeners = function() {\n var self = this;\n var $scope = this.$scope;\n var keyCodes = this.$mdConstant.KEY_CODE;\n\n // Add event listener through angular so that we can triggerHandler in unit tests.\n self.ngInputElement.on('keydown', function(event) {\n if (event.altKey && event.keyCode == keyCodes.DOWN_ARROW) {\n self.openCalendarPane(event);\n $scope.$digest();\n }\n });\n\n $scope.$on('md-calendar-close', function() {\n self.closeCalendarPane();\n });\n };\n\n /**\n * Capture properties set to the date-picker and imperitively handle internal changes.\n * This is done to avoid setting up additional $watches.\n */\n DatePickerCtrl.prototype.installPropertyInterceptors = function() {\n var self = this;\n\n if (this.$attrs['ngDisabled']) {\n // The expression is to be evaluated against the directive element's scope and not\n // the directive's isolate scope.\n var scope = this.$scope.$parent;\n\n if (scope) {\n scope.$watch(this.$attrs['ngDisabled'], function(isDisabled) {\n self.setDisabled(isDisabled);\n });\n }\n }\n\n Object.defineProperty(this, 'placeholder', {\n get: function() { return self.inputElement.placeholder; },\n set: function(value) { self.inputElement.placeholder = value || ''; }\n });\n };\n\n /**\n * Sets whether the date-picker is disabled.\n * @param {boolean} isDisabled\n */\n DatePickerCtrl.prototype.setDisabled = function(isDisabled) {\n this.isDisabled = isDisabled;\n this.inputElement.disabled = isDisabled;\n this.calendarButton.disabled = isDisabled;\n };\n\n /**\n * Sets the custom ngModel.$error flags to be consumed by ngMessages. Flags are:\n * - mindate: whether the selected date is before the minimum date.\n * - maxdate: whether the selected flag is after the maximum date.\n * - filtered: whether the selected date is allowed by the custom filtering function.\n * - valid: whether the entered text input is a valid date\n *\n * The 'required' flag is handled automatically by ngModel.\n *\n * @param {Date=} opt_date Date to check. If not given, defaults to the datepicker's model value.\n */\n DatePickerCtrl.prototype.updateErrorState = function(opt_date) {\n var date = opt_date || this.date;\n\n // Clear any existing errors to get rid of anything that's no longer relevant.\n this.clearErrorState();\n\n if (this.dateUtil.isValidDate(date)) {\n // Force all dates to midnight in order to ignore the time portion.\n date = this.dateUtil.createDateAtMidnight(date);\n\n if (this.dateUtil.isValidDate(this.minDate)) {\n var minDate = this.dateUtil.createDateAtMidnight(this.minDate);\n this.ngModelCtrl.$setValidity('mindate', date >= minDate);\n }\n\n if (this.dateUtil.isValidDate(this.maxDate)) {\n var maxDate = this.dateUtil.createDateAtMidnight(this.maxDate);\n this.ngModelCtrl.$setValidity('maxdate', date <= maxDate);\n }\n \n if (angular.isFunction(this.dateFilter)) {\n this.ngModelCtrl.$setValidity('filtered', this.dateFilter(date));\n }\n } else {\n // The date is seen as \"not a valid date\" if there is *something* set\n // (i.e.., not null or undefined), but that something isn't a valid date.\n this.ngModelCtrl.$setValidity('valid', date == null);\n }\n\n // TODO(jelbourn): Change this to classList.toggle when we stop using PhantomJS in unit tests\n // because it doesn't conform to the DOMTokenList spec.\n // See https://github.com/ariya/phantomjs/issues/12782.\n if (!this.ngModelCtrl.$valid) {\n this.inputContainer.classList.add(INVALID_CLASS);\n }\n };\n\n /** Clears any error flags set by `updateErrorState`. */\n DatePickerCtrl.prototype.clearErrorState = function() {\n this.inputContainer.classList.remove(INVALID_CLASS);\n ['mindate', 'maxdate', 'filtered', 'valid'].forEach(function(field) {\n this.ngModelCtrl.$setValidity(field, true);\n }, this);\n };\n\n /** Resizes the input element based on the size of its content. */\n DatePickerCtrl.prototype.resizeInputElement = function() {\n this.inputElement.size = this.inputElement.value.length + EXTRA_INPUT_SIZE;\n };\n\n /**\n * Sets the model value if the user input is a valid date.\n * Adds an invalid class to the input element if not.\n */\n DatePickerCtrl.prototype.handleInputEvent = function() {\n var inputString = this.inputElement.value;\n var parsedDate = inputString ? this.dateLocale.parseDate(inputString) : null;\n this.dateUtil.setDateTimeToMidnight(parsedDate);\n\n // An input string is valid if it is either empty (representing no date)\n // or if it parses to a valid date that the user is allowed to select.\n var isValidInput = inputString == '' || (\n this.dateUtil.isValidDate(parsedDate) &&\n this.dateLocale.isDateComplete(inputString) &&\n this.isDateEnabled(parsedDate)\n );\n\n // The datepicker's model is only updated when there is a valid input.\n if (isValidInput) {\n this.ngModelCtrl.$setViewValue(parsedDate);\n this.date = parsedDate;\n }\n\n this.updateErrorState(parsedDate);\n };\n \n /**\n * Check whether date is in range and enabled\n * @param {Date=} opt_date\n * @return {boolean} Whether the date is enabled.\n */\n DatePickerCtrl.prototype.isDateEnabled = function(opt_date) {\n return this.dateUtil.isDateWithinRange(opt_date, this.minDate, this.maxDate) && \n (!angular.isFunction(this.dateFilter) || this.dateFilter(opt_date));\n };\n \n /** Position and attach the floating calendar to the document. */\n DatePickerCtrl.prototype.attachCalendarPane = function() {\n var calendarPane = this.calendarPane;\n calendarPane.style.transform = '';\n this.$element.addClass('md-datepicker-open');\n\n var elementRect = this.inputContainer.getBoundingClientRect();\n var bodyRect = document.body.getBoundingClientRect();\n\n // Check to see if the calendar pane would go off the screen. If so, adjust position\n // accordingly to keep it within the viewport.\n var paneTop = elementRect.top - bodyRect.top;\n var paneLeft = elementRect.left - bodyRect.left;\n\n // If ng-material has disabled body scrolling (for example, if a dialog is open),\n // then it's possible that the already-scrolled body has a negative top/left. In this case,\n // we want to treat the \"real\" top as (0 - bodyRect.top). In a normal scrolling situation,\n // though, the top of the viewport should just be the body's scroll position.\n var viewportTop = (bodyRect.top < 0 && document.body.scrollTop == 0) ?\n -bodyRect.top :\n document.body.scrollTop;\n\n var viewportLeft = (bodyRect.left < 0 && document.body.scrollLeft == 0) ?\n -bodyRect.left :\n document.body.scrollLeft;\n\n var viewportBottom = viewportTop + this.$window.innerHeight;\n var viewportRight = viewportLeft + this.$window.innerWidth;\n\n // If the right edge of the pane would be off the screen and shifting it left by the\n // difference would not go past the left edge of the screen. If the calendar pane is too\n // big to fit on the screen at all, move it to the left of the screen and scale the entire\n // element down to fit.\n if (paneLeft + CALENDAR_PANE_WIDTH > viewportRight) {\n if (viewportRight - CALENDAR_PANE_WIDTH > 0) {\n paneLeft = viewportRight - CALENDAR_PANE_WIDTH;\n } else {\n paneLeft = viewportLeft;\n var scale = this.$window.innerWidth / CALENDAR_PANE_WIDTH;\n calendarPane.style.transform = 'scale(' + scale + ')';\n }\n\n calendarPane.classList.add('md-datepicker-pos-adjusted');\n }\n\n // If the bottom edge of the pane would be off the screen and shifting it up by the\n // difference would not go past the top edge of the screen.\n if (paneTop + CALENDAR_PANE_HEIGHT > viewportBottom &&\n viewportBottom - CALENDAR_PANE_HEIGHT > viewportTop) {\n paneTop = viewportBottom - CALENDAR_PANE_HEIGHT;\n calendarPane.classList.add('md-datepicker-pos-adjusted');\n }\n\n calendarPane.style.left = paneLeft + 'px';\n calendarPane.style.top = paneTop + 'px';\n document.body.appendChild(calendarPane);\n\n // The top of the calendar pane is a transparent box that shows the text input underneath.\n // Since the pane is floating, though, the page underneath the pane *adjacent* to the input is\n // also shown unless we cover it up. The inputMask does this by filling up the remaining space\n // based on the width of the input.\n this.inputMask.style.left = elementRect.width + 'px';\n\n // Add CSS class after one frame to trigger open animation.\n this.$$rAF(function() {\n calendarPane.classList.add('md-pane-open');\n });\n };\n\n /** Detach the floating calendar pane from the document. */\n DatePickerCtrl.prototype.detachCalendarPane = function() {\n this.$element.removeClass('md-datepicker-open');\n this.calendarPane.classList.remove('md-pane-open');\n this.calendarPane.classList.remove('md-datepicker-pos-adjusted');\n\n if (this.isCalendarOpen) {\n this.$mdUtil.enableScrolling();\n }\n\n if (this.calendarPane.parentNode) {\n // Use native DOM removal because we do not want any of the angular state of this element\n // to be disposed.\n this.calendarPane.parentNode.removeChild(this.calendarPane);\n }\n };\n\n /**\n * Open the floating calendar pane.\n * @param {Event} event\n */\n DatePickerCtrl.prototype.openCalendarPane = function(event) {\n if (!this.isCalendarOpen && !this.isDisabled) {\n this.isCalendarOpen = true;\n this.calendarPaneOpenedFrom = event.target;\n\n // Because the calendar pane is attached directly to the body, it is possible that the\n // rest of the component (input, etc) is in a different scrolling container, such as\n // an md-content. This means that, if the container is scrolled, the pane would remain\n // stationary. To remedy this, we disable scrolling while the calendar pane is open, which\n // also matches the native behavior for things like `<select>` on Mac and Windows.\n this.$mdUtil.disableScrollAround(this.calendarPane);\n\n this.attachCalendarPane();\n this.focusCalendar();\n\n // Attach click listener inside of a timeout because, if this open call was triggered by a\n // click, we don't want it to be immediately propogated up to the body and handled.\n var self = this;\n this.$mdUtil.nextTick(function() {\n // Use 'touchstart` in addition to click in order to work on iOS Safari, where click\n // events aren't propogated under most circumstances.\n // See http://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n self.documentElement.on('click touchstart', self.bodyClickHandler);\n }, false);\n\n window.addEventListener('resize', this.windowResizeHandler);\n }\n };\n\n /** Close the floating calendar pane. */\n DatePickerCtrl.prototype.closeCalendarPane = function() {\n if (this.isCalendarOpen) {\n this.detachCalendarPane();\n this.isCalendarOpen = false;\n this.calendarPaneOpenedFrom.focus();\n this.calendarPaneOpenedFrom = null;\n\n this.ngModelCtrl.$setTouched();\n\n this.documentElement.off('click touchstart', this.bodyClickHandler);\n window.removeEventListener('resize', this.windowResizeHandler);\n }\n };\n\n /** Gets the controller instance for the calendar in the floating pane. */\n DatePickerCtrl.prototype.getCalendarCtrl = function() {\n return angular.element(this.calendarPane.querySelector('md-calendar')).controller('mdCalendar');\n };\n\n /** Focus the calendar in the floating pane. */\n DatePickerCtrl.prototype.focusCalendar = function() {\n // Use a timeout in order to allow the calendar to be rendered, as it is gated behind an ng-if.\n var self = this;\n this.$mdUtil.nextTick(function() {\n self.getCalendarCtrl().focus();\n }, false);\n };\n\n /**\n * Sets whether the input is currently focused.\n * @param {boolean} isFocused\n */\n DatePickerCtrl.prototype.setFocused = function(isFocused) {\n if (!isFocused) {\n this.ngModelCtrl.$setTouched();\n }\n this.isFocused = isFocused;\n };\n\n /**\n * Handles a click on the document body when the floating calendar pane is open.\n * Closes the floating calendar pane if the click is not inside of it.\n * @param {MouseEvent} event\n */\n DatePickerCtrl.prototype.handleBodyClick = function(event) {\n if (this.isCalendarOpen) {\n // TODO(jelbourn): way want to also include the md-datepicker itself in this check.\n var isInCalendar = this.$mdUtil.getClosest(event.target, 'md-calendar');\n if (!isInCalendar) {\n this.closeCalendarPane();\n }\n\n this.$scope.$digest();\n }\n };\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * Utility for performing date calculations to facilitate operation of the calendar and\n * datepicker.\n */\n angular.module('material.components.datepicker').factory('$$mdDateUtil', function() {\n return {\n getFirstDateOfMonth: getFirstDateOfMonth,\n getNumberOfDaysInMonth: getNumberOfDaysInMonth,\n getDateInNextMonth: getDateInNextMonth,\n getDateInPreviousMonth: getDateInPreviousMonth,\n isInNextMonth: isInNextMonth,\n isInPreviousMonth: isInPreviousMonth,\n getDateMidpoint: getDateMidpoint,\n isSameMonthAndYear: isSameMonthAndYear,\n getWeekOfMonth: getWeekOfMonth,\n incrementDays: incrementDays,\n incrementMonths: incrementMonths,\n getLastDateOfMonth: getLastDateOfMonth,\n isSameDay: isSameDay,\n getMonthDistance: getMonthDistance,\n isValidDate: isValidDate,\n setDateTimeToMidnight: setDateTimeToMidnight,\n createDateAtMidnight: createDateAtMidnight,\n isDateWithinRange: isDateWithinRange\n };\n\n /**\n * Gets the first day of the month for the given date's month.\n * @param {Date} date\n * @returns {Date}\n */\n function getFirstDateOfMonth(date) {\n return new Date(date.getFullYear(), date.getMonth(), 1);\n }\n\n /**\n * Gets the number of days in the month for the given date's month.\n * @param date\n * @returns {number}\n */\n function getNumberOfDaysInMonth(date) {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n }\n\n /**\n * Get an arbitrary date in the month after the given date's month.\n * @param date\n * @returns {Date}\n */\n function getDateInNextMonth(date) {\n return new Date(date.getFullYear(), date.getMonth() + 1, 1);\n }\n\n /**\n * Get an arbitrary date in the month before the given date's month.\n * @param date\n * @returns {Date}\n */\n function getDateInPreviousMonth(date) {\n return new Date(date.getFullYear(), date.getMonth() - 1, 1);\n }\n\n /**\n * Gets whether two dates have the same month and year.\n * @param {Date} d1\n * @param {Date} d2\n * @returns {boolean}\n */\n function isSameMonthAndYear(d1, d2) {\n return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth();\n }\n\n /**\n * Gets whether two dates are the same day (not not necesarily the same time).\n * @param {Date} d1\n * @param {Date} d2\n * @returns {boolean}\n */\n function isSameDay(d1, d2) {\n return d1.getDate() == d2.getDate() && isSameMonthAndYear(d1, d2);\n }\n\n /**\n * Gets whether a date is in the month immediately after some date.\n * @param {Date} startDate The date from which to compare.\n * @param {Date} endDate The date to check.\n * @returns {boolean}\n */\n function isInNextMonth(startDate, endDate) {\n var nextMonth = getDateInNextMonth(startDate);\n return isSameMonthAndYear(nextMonth, endDate);\n }\n\n /**\n * Gets whether a date is in the month immediately before some date.\n * @param {Date} startDate The date from which to compare.\n * @param {Date} endDate The date to check.\n * @returns {boolean}\n */\n function isInPreviousMonth(startDate, endDate) {\n var previousMonth = getDateInPreviousMonth(startDate);\n return isSameMonthAndYear(endDate, previousMonth);\n }\n\n /**\n * Gets the midpoint between two dates.\n * @param {Date} d1\n * @param {Date} d2\n * @returns {Date}\n */\n function getDateMidpoint(d1, d2) {\n return createDateAtMidnight((d1.getTime() + d2.getTime()) / 2);\n }\n\n /**\n * Gets the week of the month that a given date occurs in.\n * @param {Date} date\n * @returns {number} Index of the week of the month (zero-based).\n */\n function getWeekOfMonth(date) {\n var firstDayOfMonth = getFirstDateOfMonth(date);\n return Math.floor((firstDayOfMonth.getDay() + date.getDate() - 1) / 7);\n }\n\n /**\n * Gets a new date incremented by the given number of days. Number of days can be negative.\n * @param {Date} date\n * @param {number} numberOfDays\n * @returns {Date}\n */\n function incrementDays(date, numberOfDays) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays);\n }\n\n /**\n * Gets a new date incremented by the given number of months. Number of months can be negative.\n * If the date of the given month does not match the target month, the date will be set to the\n * last day of the month.\n * @param {Date} date\n * @param {number} numberOfMonths\n * @returns {Date}\n */\n function incrementMonths(date, numberOfMonths) {\n // If the same date in the target month does not actually exist, the Date object will\n // automatically advance *another* month by the number of missing days.\n // For example, if you try to go from Jan. 30 to Feb. 30, you'll end up on March 2.\n // So, we check if the month overflowed and go to the last day of the target month instead.\n var dateInTargetMonth = new Date(date.getFullYear(), date.getMonth() + numberOfMonths, 1);\n var numberOfDaysInMonth = getNumberOfDaysInMonth(dateInTargetMonth);\n if (numberOfDaysInMonth < date.getDate()) {\n dateInTargetMonth.setDate(numberOfDaysInMonth);\n } else {\n dateInTargetMonth.setDate(date.getDate());\n }\n\n return dateInTargetMonth;\n }\n\n /**\n * Get the integer distance between two months. This *only* considers the month and year\n * portion of the Date instances.\n *\n * @param {Date} start\n * @param {Date} end\n * @returns {number} Number of months between `start` and `end`. If `end` is before `start`\n * chronologically, this number will be negative.\n */\n function getMonthDistance(start, end) {\n return (12 * (end.getFullYear() - start.getFullYear())) + (end.getMonth() - start.getMonth());\n }\n\n /**\n * Gets the last day of the month for the given date.\n * @param {Date} date\n * @returns {Date}\n */\n function getLastDateOfMonth(date) {\n return new Date(date.getFullYear(), date.getMonth(), getNumberOfDaysInMonth(date));\n }\n\n /**\n * Checks whether a date is valid.\n * @param {Date} date\n * @return {boolean} Whether the date is a valid Date.\n */\n function isValidDate(date) {\n return date != null && date.getTime && !isNaN(date.getTime());\n }\n\n /**\n * Sets a date's time to midnight.\n * @param {Date} date\n */\n function setDateTimeToMidnight(date) {\n if (isValidDate(date)) {\n date.setHours(0, 0, 0, 0);\n }\n }\n\n /**\n * Creates a date with the time set to midnight.\n * Drop-in replacement for two forms of the Date constructor:\n * 1. No argument for Date representing now.\n * 2. Single-argument value representing number of seconds since Unix Epoch\n * or a Date object.\n * @param {number|Date=} opt_value\n * @return {Date} New date with time set to midnight.\n */\n function createDateAtMidnight(opt_value) {\n var date;\n if (angular.isUndefined(opt_value)) {\n date = new Date();\n } else {\n date = new Date(opt_value);\n }\n setDateTimeToMidnight(date);\n return date;\n }\n\n /**\n * Checks if a date is within a min and max range, ignoring the time component.\n * If minDate or maxDate are not dates, they are ignored.\n * @param {Date} date\n * @param {Date} minDate\n * @param {Date} maxDate\n */\n function isDateWithinRange(date, minDate, maxDate) {\n var dateAtMidnight = createDateAtMidnight(date);\n var minDateAtMidnight = isValidDate(minDate) ? createDateAtMidnight(minDate) : null;\n var maxDateAtMidnight = isValidDate(maxDate) ? createDateAtMidnight(maxDate) : null;\n return (!minDateAtMidnight || minDateAtMidnight <= dateAtMidnight) &&\n (!maxDateAtMidnight || maxDateAtMidnight >= dateAtMidnight);\n }\n });\n})();\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.dialog\n */\nangular\n .module('material.components.dialog', [\n 'material.core',\n 'material.components.backdrop'\n ])\n .directive('mdDialog', MdDialogDirective)\n .provider('$mdDialog', MdDialogProvider);\n\n/**\n * @ngdoc directive\n * @name mdDialog\n * @module material.components.dialog\n *\n * @restrict E\n *\n * @description\n * `<md-dialog>` - The dialog's template must be inside this element.\n *\n * Inside, use an `<md-dialog-content>` element for the dialog's content, and use\n * an `<md-dialog-actions>` element for the dialog's actions.\n *\n * ## CSS\n * - `.md-dialog-content` - class that sets the padding on the content as the spec file\n *\n * ## Notes\n * - If you specify an `id` for the `<md-dialog>`, the `<md-dialog-content>` will have the same `id`\n * prefixed with `dialogContent_`.\n *\n * @usage\n * ### Dialog template\n * <hljs lang=\"html\">\n * <md-dialog aria-label=\"List dialog\">\n * <md-dialog-content>\n * <md-list>\n * <md-list-item ng-repeat=\"item in items\">\n * <p>Number {{item}}</p>\n * </md-list-item>\n * </md-list>\n * </md-dialog-content>\n * <md-dialog-actions>\n * <md-button ng-click=\"closeDialog()\" class=\"md-primary\">Close Dialog</md-button>\n * </md-dialog-actions>\n * </md-dialog>\n * </hljs>\n */\nfunction MdDialogDirective($$rAF, $mdTheming, $mdDialog) {\n return {\n restrict: 'E',\n link: function(scope, element, attr) {\n $mdTheming(element);\n $$rAF(function() {\n var images;\n var content = element[0].querySelector('md-dialog-content');\n\n if (content) {\n images = content.getElementsByTagName('img');\n addOverflowClass();\n //-- delayed image loading may impact scroll height, check after images are loaded\n angular.element(images).on('load', addOverflowClass);\n }\n\n scope.$on('$destroy', function() {\n $mdDialog.destroy(element);\n });\n\n /**\n *\n */\n function addOverflowClass() {\n element.toggleClass('md-content-overflow', content.scrollHeight > content.clientHeight);\n }\n\n\n });\n }\n };\n}\nMdDialogDirective.$inject = [\"$$rAF\", \"$mdTheming\", \"$mdDialog\"];\n\n/**\n * @ngdoc service\n * @name $mdDialog\n * @module material.components.dialog\n *\n * @description\n * `$mdDialog` opens a dialog over the app to inform users about critical information or require\n * them to make decisions. There are two approaches for setup: a simple promise API\n * and regular object syntax.\n *\n * ## Restrictions\n *\n * - The dialog is always given an isolate scope.\n * - The dialog's template must have an outer `<md-dialog>` element.\n * Inside, use an `<md-dialog-content>` element for the dialog's content, and use\n * an `<md-dialog-actions>` element for the dialog's actions.\n * - Dialogs must cover the entire application to keep interactions inside of them.\n * Use the `parent` option to change where dialogs are appended.\n *\n * ## Sizing\n * - Complex dialogs can be sized with `flex=\"percentage\"`, i.e. `flex=\"66\"`.\n * - Default max-width is 80% of the `rootElement` or `parent`.\n *\n * ## CSS\n * - `.md-dialog-content` - class that sets the padding on the content as the spec file\n *\n * @usage\n * <hljs lang=\"html\">\n * <div ng-app=\"demoApp\" ng-controller=\"EmployeeController\">\n * <div>\n * <md-button ng-click=\"showAlert()\" class=\"md-raised md-warn\">\n * Employee Alert!\n * </md-button>\n * </div>\n * <div>\n * <md-button ng-click=\"showDialog($event)\" class=\"md-raised\">\n * Custom Dialog\n * </md-button>\n * </div>\n * <div>\n * <md-button ng-click=\"closeAlert()\" ng-disabled=\"!hasAlert()\" class=\"md-raised\">\n * Close Alert\n * </md-button>\n * </div>\n * <div>\n * <md-button ng-click=\"showGreeting($event)\" class=\"md-raised md-primary\" >\n * Greet Employee\n * </md-button>\n * </div>\n * </div>\n * </hljs>\n *\n * ### JavaScript: object syntax\n * <hljs lang=\"js\">\n * (function(angular, undefined){\n * \"use strict\";\n *\n * angular\n * .module('demoApp', ['ngMaterial'])\n * .controller('AppCtrl', AppController);\n *\n * function AppController($scope, $mdDialog) {\n * var alert;\n * $scope.showAlert = showAlert;\n * $scope.showDialog = showDialog;\n * $scope.items = [1, 2, 3];\n *\n * // Internal method\n * function showAlert() {\n * alert = $mdDialog.alert({\n * title: 'Attention',\n * textContent: 'This is an example of how easy dialogs can be!',\n * ok: 'Close'\n * });\n *\n * $mdDialog\n * .show( alert )\n * .finally(function() {\n * alert = undefined;\n * });\n * }\n *\n * function showDialog($event) {\n * var parentEl = angular.element(document.body);\n * $mdDialog.show({\n * parent: parentEl,\n * targetEvent: $event,\n * template:\n * '<md-dialog aria-label=\"List dialog\">' +\n * ' <md-dialog-content>'+\n * ' <md-list>'+\n * ' <md-list-item ng-repeat=\"item in items\">'+\n * ' <p>Number {{item}}</p>' +\n * ' </md-item>'+\n * ' </md-list>'+\n * ' </md-dialog-content>' +\n * ' <md-dialog-actions>' +\n * ' <md-button ng-click=\"closeDialog()\" class=\"md-primary\">' +\n * ' Close Dialog' +\n * ' </md-button>' +\n * ' </md-dialog-actions>' +\n * '</md-dialog>',\n * locals: {\n * items: $scope.items\n * },\n * controller: DialogController\n * });\n * function DialogController($scope, $mdDialog, items) {\n * $scope.items = items;\n * $scope.closeDialog = function() {\n * $mdDialog.hide();\n * }\n * }\n * }\n * }\n * })(angular);\n * </hljs>\n *\n * ### JavaScript: promise API syntax, custom dialog template\n * <hljs lang=\"js\">\n * (function(angular, undefined){\n * \"use strict\";\n *\n * angular\n * .module('demoApp', ['ngMaterial'])\n * .controller('EmployeeController', EmployeeEditor)\n * .controller('GreetingController', GreetingController);\n *\n * // Fictitious Employee Editor to show how to use simple and complex dialogs.\n *\n * function EmployeeEditor($scope, $mdDialog) {\n * var alert;\n *\n * $scope.showAlert = showAlert;\n * $scope.closeAlert = closeAlert;\n * $scope.showGreeting = showCustomGreeting;\n *\n * $scope.hasAlert = function() { return !!alert };\n * $scope.userName = $scope.userName || 'Bobby';\n *\n * // Dialog #1 - Show simple alert dialog and cache\n * // reference to dialog instance\n *\n * function showAlert() {\n * alert = $mdDialog.alert()\n * .title('Attention, ' + $scope.userName)\n * .textContent('This is an example of how easy dialogs can be!')\n * .ok('Close');\n *\n * $mdDialog\n * .show( alert )\n * .finally(function() {\n * alert = undefined;\n * });\n * }\n *\n * // Close the specified dialog instance and resolve with 'finished' flag\n * // Normally this is not needed, just use '$mdDialog.hide()' to close\n * // the most recent dialog popup.\n *\n * function closeAlert() {\n * $mdDialog.hide( alert, \"finished\" );\n * alert = undefined;\n * }\n *\n * // Dialog #2 - Demonstrate more complex dialogs construction and popup.\n *\n * function showCustomGreeting($event) {\n * $mdDialog.show({\n * targetEvent: $event,\n * template:\n * '<md-dialog>' +\n *\n * ' <md-dialog-content>Hello {{ employee }}!</md-dialog-content>' +\n *\n * ' <md-dialog-actions>' +\n * ' <md-button ng-click=\"closeDialog()\" class=\"md-primary\">' +\n * ' Close Greeting' +\n * ' </md-button>' +\n * ' </md-dialog-actions>' +\n * '</md-dialog>',\n * controller: 'GreetingController',\n * onComplete: afterShowAnimation,\n * locals: { employee: $scope.userName }\n * });\n *\n * // When the 'enter' animation finishes...\n *\n * function afterShowAnimation(scope, element, options) {\n * // post-show code here: DOM element focus, etc.\n * }\n * }\n *\n * // Dialog #3 - Demonstrate use of ControllerAs and passing $scope to dialog\n * // Here we used ng-controller=\"GreetingController as vm\" and\n * // $scope.vm === <controller instance>\n *\n * function showCustomGreeting() {\n *\n * $mdDialog.show({\n * clickOutsideToClose: true,\n *\n * scope: $scope, // use parent scope in template\n * preserveScope: true, // do not forget this if use parent scope\n\n * // Since GreetingController is instantiated with ControllerAs syntax\n * // AND we are passing the parent '$scope' to the dialog, we MUST\n * // use 'vm.<xxx>' in the template markup\n *\n * template: '<md-dialog>' +\n * ' <md-dialog-content>' +\n * ' Hi There {{vm.employee}}' +\n * ' </md-dialog-content>' +\n * '</md-dialog>',\n *\n * controller: function DialogController($scope, $mdDialog) {\n * $scope.closeDialog = function() {\n * $mdDialog.hide();\n * }\n * }\n * });\n * }\n *\n * }\n *\n * // Greeting controller used with the more complex 'showCustomGreeting()' custom dialog\n *\n * function GreetingController($scope, $mdDialog, employee) {\n * // Assigned from construction <code>locals</code> options...\n * $scope.employee = employee;\n *\n * $scope.closeDialog = function() {\n * // Easily hides most recent dialog shown...\n * // no specific instance reference is needed.\n * $mdDialog.hide();\n * };\n * }\n *\n * })(angular);\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#alert\n *\n * @description\n * Builds a preconfigured dialog with the specified message.\n *\n * @returns {obj} an `$mdDialogPreset` with the chainable configuration methods:\n *\n * - $mdDialogPreset#title(string) - Sets the alert title.\n * - $mdDialogPreset#textContent(string) - Sets the alert message.\n * - $mdDialogPreset#htmlContent(string) - Sets the alert message as HTML. Requires ngSanitize\n * module to be loaded. HTML is not run through Angular's compiler.\n * - $mdDialogPreset#ok(string) - Sets the alert \"Okay\" button text.\n * - $mdDialogPreset#theme(string) - Sets the theme of the alert dialog.\n * - $mdDialogPreset#targetEvent(DOMClickEvent=) - A click's event object. When passed in as an option,\n * the location of the click will be used as the starting point for the opening animation\n * of the the dialog.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#confirm\n *\n * @description\n * Builds a preconfigured dialog with the specified message. You can call show and the promise returned\n * will be resolved only if the user clicks the confirm action on the dialog.\n *\n * @returns {obj} an `$mdDialogPreset` with the chainable configuration methods:\n *\n * Additionally, it supports the following methods:\n *\n * - $mdDialogPreset#title(string) - Sets the confirm title.\n * - $mdDialogPreset#textContent(string) - Sets the confirm message.\n * - $mdDialogPreset#htmlContent(string) - Sets the confirm message as HTML. Requires ngSanitize\n * module to be loaded. HTML is not run through Angular's compiler.\n * - $mdDialogPreset#ok(string) - Sets the confirm \"Okay\" button text.\n * - $mdDialogPreset#cancel(string) - Sets the confirm \"Cancel\" button text.\n * - $mdDialogPreset#theme(string) - Sets the theme of the confirm dialog.\n * - $mdDialogPreset#targetEvent(DOMClickEvent=) - A click's event object. When passed in as an option,\n * the location of the click will be used as the starting point for the opening animation\n * of the the dialog.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#prompt\n *\n * @description\n * Builds a preconfigured dialog with the specified message and input box. You can call show and the promise returned\n * will be resolved only if the user clicks the prompt action on the dialog, passing the input value as the first argument.\n *\n * @returns {obj} an `$mdDialogPreset` with the chainable configuration methods:\n *\n * Additionally, it supports the following methods:\n *\n * - $mdDialogPreset#title(string) - Sets the prompt title.\n * - $mdDialogPreset#textContent(string) - Sets the prompt message.\n * - $mdDialogPreset#htmlContent(string) - Sets the prompt message as HTML. Requires ngSanitize\n * module to be loaded. HTML is not run through Angular's compiler.\n * - $mdDialogPreset#placeholder(string) - Sets the placeholder text for the input.\n * - $mdDialogPreset#ok(string) - Sets the prompt \"Okay\" button text.\n * - $mdDialogPreset#cancel(string) - Sets the prompt \"Cancel\" button text.\n * - $mdDialogPreset#theme(string) - Sets the theme of the prompt dialog.\n * - $mdDialogPreset#targetEvent(DOMClickEvent=) - A click's event object. When passed in as an option,\n * the location of the click will be used as the starting point for the opening animation\n * of the the dialog.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#show\n *\n * @description\n * Show a dialog with the specified options.\n *\n * @param {object} optionsOrPreset Either provide an `$mdDialogPreset` returned from `alert()`, and\n * `confirm()`, or an options object with the following properties:\n * - `templateUrl` - `{string=}`: The url of a template that will be used as the content\n * of the dialog.\n * - `template` - `{string=}`: HTML template to show in the dialog. This **must** be trusted HTML\n * with respect to Angular's [$sce service](https://docs.angularjs.org/api/ng/service/$sce).\n * This template should **never** be constructed with any kind of user input or user data.\n * - `autoWrap` - `{boolean=}`: Whether or not to automatically wrap the template with a\n * `<md-dialog>` tag if one is not provided. Defaults to true. Can be disabled if you provide a\n * custom dialog directive.\n * - `targetEvent` - `{DOMClickEvent=}`: A click's event object. When passed in as an option,\n * the location of the click will be used as the starting point for the opening animation\n * of the the dialog.\n * - `openFrom` - `{string|Element|object}`: The query selector, DOM element or the Rect object\n * that is used to determine the bounds (top, left, height, width) from which the Dialog will\n * originate.\n * - `closeTo` - `{string|Element|object}`: The query selector, DOM element or the Rect object\n * that is used to determine the bounds (top, left, height, width) to which the Dialog will\n * target.\n * - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified,\n * it will create a new isolate scope.\n * This scope will be destroyed when the dialog is removed unless `preserveScope` is set to true.\n * - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false\n * - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the dialog is open.\n * Default true.\n * - `hasBackdrop` - `{boolean=}`: Whether there should be an opaque backdrop behind the dialog.\n * Default true.\n * - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the dialog to\n * close it. Default false.\n * - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the dialog.\n * Default true.\n * - `focusOnOpen` - `{boolean=}`: An option to override focus behavior on open. Only disable if\n * focusing some other way, as focus management is required for dialogs to be accessible.\n * Defaults to true.\n * - `controller` - `{function|string=}`: The controller to associate with the dialog. The controller\n * will be injected with the local `$mdDialog`, which passes along a scope for the dialog.\n * - `locals` - `{object=}`: An object containing key/value pairs. The keys will be used as names\n * of values to inject into the controller. For example, `locals: {three: 3}` would inject\n * `three` into the controller, with the value 3. If `bindToController` is true, they will be\n * copied to the controller instead.\n * - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.\n * - `resolve` - `{object=}`: Similar to locals, except it takes promises as values, and the\n * dialog will not open until all of the promises resolve.\n * - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n * - `parent` - `{element=}`: The element to append the dialog to. Defaults to appending\n * to the root element of the application.\n * - `onShowing` `{function=} Callback function used to announce the show() action is\n * starting.\n * - `onComplete` `{function=}`: Callback function used to announce when the show() action is\n * finished.\n * - `onRemoving` `{function=}`: Callback function used to announce the close/hide() action is\n * starting. This allows developers to run custom animations in parallel the close animations.\n * - `fullscreen` `{boolean=}`: An option to apply `.md-dialog-fullscreen` class on open.\n * @returns {promise} A promise that can be resolved with `$mdDialog.hide()` or\n * rejected with `$mdDialog.cancel()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#hide\n *\n * @description\n * Hide an existing dialog and resolve the promise returned from `$mdDialog.show()`.\n *\n * @param {*=} response An argument for the resolved promise.\n *\n * @returns {promise} A promise that is resolved when the dialog has been closed.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#cancel\n *\n * @description\n * Hide an existing dialog and reject the promise returned from `$mdDialog.show()`.\n *\n * @param {*=} response An argument for the rejected promise.\n *\n * @returns {promise} A promise that is resolved when the dialog has been closed.\n */\n\nfunction MdDialogProvider($$interimElementProvider) {\n // Elements to capture and redirect focus when the user presses tab at the dialog boundary.\n var topFocusTrap, bottomFocusTrap;\n\n advancedDialogOptions.$inject = [\"$mdDialog\", \"$mdTheming\", \"$mdConstant\"];\n dialogDefaultOptions.$inject = [\"$mdDialog\", \"$mdAria\", \"$mdUtil\", \"$mdConstant\", \"$animate\", \"$document\", \"$window\", \"$rootElement\", \"$log\", \"$injector\"];\n return $$interimElementProvider('$mdDialog')\n .setDefaults({\n methods: ['disableParentScroll', 'hasBackdrop', 'clickOutsideToClose', 'escapeToClose',\n 'targetEvent', 'closeTo', 'openFrom', 'parent', 'fullscreen'],\n options: dialogDefaultOptions\n })\n .addPreset('alert', {\n methods: ['title', 'htmlContent', 'textContent', 'content', 'ariaLabel', 'ok', 'theme',\n 'css'],\n options: advancedDialogOptions\n })\n .addPreset('confirm', {\n methods: ['title', 'htmlContent', 'textContent', 'content', 'ariaLabel', 'ok', 'cancel',\n 'theme', 'css'],\n options: advancedDialogOptions\n })\n .addPreset('prompt', {\n methods: ['title', 'htmlContent', 'textContent', 'content', 'placeholder', 'ariaLabel',\n 'ok', 'cancel', 'theme', 'css'],\n options: advancedDialogOptions\n });\n\n /* @ngInject */\n function advancedDialogOptions($mdDialog, $mdTheming, $mdConstant) {\n return {\n template: [\n '<md-dialog md-theme=\"{{ dialog.theme }}\" aria-label=\"{{ dialog.ariaLabel }}\" ng-class=\"dialog.css\">',\n ' <md-dialog-content class=\"md-dialog-content\" role=\"document\" tabIndex=\"-1\">',\n ' <h2 class=\"md-title\">{{ dialog.title }}</h2>',\n ' <div ng-if=\"::dialog.mdHtmlContent\" class=\"md-dialog-content-body\" ',\n ' ng-bind-html=\"::dialog.mdHtmlContent\"></div>',\n ' <div ng-if=\"::!dialog.mdHtmlContent\" class=\"md-dialog-content-body\">',\n ' <p>{{::dialog.mdTextContent}}</p>',\n ' </div>',\n ' <md-input-container md-no-float ng-if=\"::dialog.$type == \\'prompt\\'\" class=\"md-prompt-input-container\">',\n ' <input ng-keypress=\"dialog.keypress($event)\" md-autofocus ng-model=\"dialog.result\" placeholder=\"{{::dialog.placeholder}}\">',\n ' </md-input-container>',\n ' </md-dialog-content>',\n ' <md-dialog-actions>',\n ' <md-button ng-if=\"dialog.$type === \\'confirm\\' || dialog.$type === \\'prompt\\'\"' +\n ' ng-click=\"dialog.abort()\" class=\"md-primary\">',\n ' {{ dialog.cancel }}',\n ' </md-button>',\n ' <md-button ng-click=\"dialog.hide()\" class=\"md-primary\" md-autofocus=\"dialog.$type===\\'alert\\'\">',\n ' {{ dialog.ok }}',\n ' </md-button>',\n ' </md-dialog-actions>',\n '</md-dialog>'\n ].join('').replace(/\\s\\s+/g, ''),\n controller: function mdDialogCtrl() {\n this.hide = function() {\n $mdDialog.hide(this.$type === 'prompt' ? this.result : true);\n };\n this.abort = function() {\n $mdDialog.cancel();\n };\n this.keypress = function($event) {\n if ($event.keyCode === $mdConstant.KEY_CODE.ENTER) {\n $mdDialog.hide(this.result)\n }\n }\n },\n controllerAs: 'dialog',\n bindToController: true,\n theme: $mdTheming.defaultTheme()\n };\n }\n\n /* @ngInject */\n function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document, $window, $rootElement, $log, $injector) {\n return {\n hasBackdrop: true,\n isolateScope: true,\n onShow: onShow,\n onShowing: beforeShow,\n onRemove: onRemove,\n clickOutsideToClose: false,\n escapeToClose: true,\n targetEvent: null,\n closeTo: null,\n openFrom: null,\n focusOnOpen: true,\n disableParentScroll: true,\n autoWrap: true,\n fullscreen: false,\n transformTemplate: function(template, options) {\n // Make the dialog container focusable, because otherwise the focus will be always redirected to\n // an element outside of the container, and the focus trap won't work probably..\n // Also the tabindex is needed for the `escapeToClose` functionality, because\n // the keyDown event can't be triggered when the focus is outside of the container.\n return '<div class=\"md-dialog-container\" tabindex=\"-1\">' + validatedTemplate(template) + '</div>';\n\n /**\n * The specified template should contain a <md-dialog> wrapper element....\n */\n function validatedTemplate(template) {\n if (options.autoWrap && !/<\\/md-dialog>/g.test(template)) {\n return '<md-dialog>' + (template || '') + '</md-dialog>';\n } else {\n return template || '';\n }\n }\n }\n };\n\n function beforeShow(scope, element, options, controller) {\n if (controller) {\n controller.mdHtmlContent = controller.htmlContent || options.htmlContent || '';\n controller.mdTextContent = controller.textContent || options.textContent ||\n controller.content || options.content || '';\n\n if (controller.mdHtmlContent && !$injector.has('$sanitize')) {\n throw Error('The ngSanitize module must be loaded in order to use htmlContent.');\n }\n\n if (controller.mdHtmlContent && controller.mdTextContent) {\n throw Error('md-dialog cannot have both `htmlContent` and `textContent`');\n }\n }\n }\n\n /** Show method for dialogs */\n function onShow(scope, element, options, controller) {\n angular.element($document[0].body).addClass('md-dialog-is-showing');\n\n captureParentAndFromToElements(options);\n configureAria(element.find('md-dialog'), options);\n showBackdrop(scope, element, options);\n\n return dialogPopIn(element, options)\n .then(function() {\n activateListeners(element, options);\n lockScreenReader(element, options);\n warnDeprecatedActions();\n focusOnOpen();\n });\n\n /**\n * Check to see if they used the deprecated .md-actions class and log a warning\n */\n function warnDeprecatedActions() {\n var badActions = element[0].querySelectorAll('.md-actions');\n\n if (badActions.length > 0) {\n $log.warn('Using a class of md-actions is deprecated, please use <md-dialog-actions>.');\n }\n }\n\n /**\n * For alerts, focus on content... otherwise focus on\n * the close button (or equivalent)\n */\n function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = $mdUtil.findFocusTarget(element) || findCloseButton();\n target.focus();\n }\n\n /**\n * If no element with class dialog-close, try to find the last\n * button child in md-actions and assume it is a close button.\n *\n * If we find no actions at all, log a warning to the console.\n */\n function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }\n }\n }\n\n /**\n * Remove function for all dialogs\n */\n function onRemove(scope, element, options) {\n options.deactivateListeners();\n options.unlockScreenReader();\n options.hideBackdrop(options.$destroy);\n\n // Remove the focus traps that we added earlier for keeping focus within the dialog.\n if (topFocusTrap && topFocusTrap.parentNode) {\n topFocusTrap.parentNode.removeChild(topFocusTrap);\n }\n\n if (bottomFocusTrap && bottomFocusTrap.parentNode) {\n bottomFocusTrap.parentNode.removeChild(bottomFocusTrap);\n }\n\n // For navigation $destroy events, do a quick, non-animated removal,\n // but for normal closes (from clicks, etc) animate the removal\n return !!options.$destroy ? detachAndClean() : animateRemoval().then( detachAndClean );\n\n /**\n * For normal closes, animate the removal.\n * For forced closes (like $destroy events), skip the animations\n */\n function animateRemoval() {\n return dialogPopOut(element, options);\n }\n\n /**\n * Detach the element\n */\n function detachAndClean() {\n angular.element($document[0].body).removeClass('md-dialog-is-showing');\n element.remove();\n\n if (!options.$destroy) options.origin.focus();\n }\n }\n\n /**\n * Capture originator/trigger/from/to element information (if available)\n * and the parent container for the dialog; defaults to the $rootElement\n * unless overridden in the options.parent\n */\n function captureParentAndFromToElements(options) {\n options.origin = angular.extend({\n element: null,\n bounds: null,\n focus: angular.noop\n }, options.origin || {});\n\n options.parent = getDomElement(options.parent, $rootElement);\n options.closeTo = getBoundingClientRect(getDomElement(options.closeTo));\n options.openFrom = getBoundingClientRect(getDomElement(options.openFrom));\n\n if ( options.targetEvent ) {\n options.origin = getBoundingClientRect(options.targetEvent.target, options.origin);\n }\n\n /**\n * Identify the bounding RECT for the target element\n *\n */\n function getBoundingClientRect (element, orig) {\n var source = angular.element((element || {}));\n if (source && source.length) {\n // Compute and save the target element's bounding rect, so that if the\n // element is hidden when the dialog closes, we can shrink the dialog\n // back to the same position it expanded from.\n //\n // Checking if the source is a rect object or a DOM element\n var bounds = {top:0,left:0,height:0,width:0};\n var hasFn = angular.isFunction(source[0].getBoundingClientRect);\n\n return angular.extend(orig || {}, {\n element : hasFn ? source : undefined,\n bounds : hasFn ? source[0].getBoundingClientRect() : angular.extend({}, bounds, source[0]),\n focus : angular.bind(source, source.focus),\n });\n }\n }\n\n /**\n * If the specifier is a simple string selector, then query for\n * the DOM element.\n */\n function getDomElement(element, defaultElement) {\n if (angular.isString(element)) {\n var simpleSelector = element,\n container = $document[0].querySelectorAll(simpleSelector);\n element = container.length ? container[0] : null;\n }\n\n // If we have a reference to a raw dom element, always wrap it in jqLite\n return angular.element(element || defaultElement);\n }\n\n }\n\n /**\n * Listen for escape keys and outside clicks to auto close\n */\n function activateListeners(element, options) {\n var window = angular.element($window);\n var onWindowResize = $mdUtil.debounce(function(){\n stretchDialogContainerToViewport(element, options);\n }, 60);\n\n var removeListeners = [];\n var smartClose = function() {\n // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n // cancel or fallback to hide.\n var closeFn = ( options.$type == 'alert' ) ? $mdDialog.hide : $mdDialog.cancel;\n $mdUtil.nextTick(closeFn, true);\n };\n\n if (options.escapeToClose) {\n var parentTarget = options.parent;\n var keyHandlerFn = function(ev) {\n if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add keydown listeners\n element.on('keydown', keyHandlerFn);\n parentTarget.on('keydown', keyHandlerFn);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n\n element.off('keydown', keyHandlerFn);\n parentTarget.off('keydown', keyHandlerFn);\n\n });\n }\n\n // Register listener to update dialog on window resize\n window.on('resize', onWindowResize);\n\n removeListeners.push(function() {\n window.off('resize', onWindowResize);\n });\n\n if (options.clickOutsideToClose) {\n var target = element;\n var sourceElem;\n\n // Keep track of the element on which the mouse originally went down\n // so that we can only close the backdrop when the 'click' started on it.\n // A simple 'click' handler does not work,\n // it sets the target object as the element the mouse went down on.\n var mousedownHandler = function(ev) {\n sourceElem = ev.target;\n };\n\n // We check if our original element and the target is the backdrop\n // because if the original was the backdrop and the target was inside the dialog\n // we don't want to dialog to close.\n var mouseupHandler = function(ev) {\n if (sourceElem === target[0] && ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add listeners\n target.on('mousedown', mousedownHandler);\n target.on('mouseup', mouseupHandler);\n\n // Queue remove listeners function\n removeListeners.push(function() {\n target.off('mousedown', mousedownHandler);\n target.off('mouseup', mouseupHandler);\n });\n }\n\n // Attach specific `remove` listener handler\n options.deactivateListeners = function() {\n removeListeners.forEach(function(removeFn) {\n removeFn();\n });\n options.deactivateListeners = null;\n };\n }\n\n /**\n * Show modal backdrop element...\n */\n function showBackdrop(scope, element, options) {\n\n if (options.disableParentScroll) {\n // !! DO this before creating the backdrop; since disableScrollAround()\n // configures the scroll offset; which is used by mdBackDrop postLink()\n options.restoreScroll = $mdUtil.disableScrollAround(element, options.parent);\n }\n\n if (options.hasBackdrop) {\n options.backdrop = $mdUtil.createBackdrop(scope, \"md-dialog-backdrop md-opaque\");\n $animate.enter(options.backdrop, options.parent);\n }\n\n /**\n * Hide modal backdrop element...\n */\n options.hideBackdrop = function hideBackdrop($destroy) {\n if (options.backdrop) {\n if ( !!$destroy ) options.backdrop.remove();\n else $animate.leave(options.backdrop);\n }\n\n if (options.disableParentScroll) {\n options.restoreScroll();\n delete options.restoreScroll;\n }\n\n options.hideBackdrop = null;\n }\n }\n\n /**\n * Inject ARIA-specific attributes appropriate for Dialogs\n */\n function configureAria(element, options) {\n\n var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';\n var dialogContent = element.find('md-dialog-content');\n var existingDialogId = element.attr('id');\n var dialogContentId = 'dialogContent_' + (existingDialogId || $mdUtil.nextUid());\n\n element.attr({\n 'role': role,\n 'tabIndex': '-1'\n });\n\n if (dialogContent.length === 0) {\n dialogContent = element;\n // If the dialog element already had an ID, don't clobber it.\n if (existingDialogId) {\n dialogContentId = existingDialogId;\n }\n }\n\n dialogContent.attr('id', dialogContentId);\n element.attr('aria-describedby', dialogContentId);\n\n if (options.ariaLabel) {\n $mdAria.expect(element, 'aria-label', options.ariaLabel);\n }\n else {\n $mdAria.expectAsync(element, 'aria-label', function() {\n var words = dialogContent.text().split(/\\s+/);\n if (words.length > 3) words = words.slice(0, 3).concat('...');\n return words.join(' ');\n });\n }\n\n // Set up elements before and after the dialog content to capture focus and\n // redirect back into the dialog.\n topFocusTrap = document.createElement('div');\n topFocusTrap.classList.add('md-dialog-focus-trap');\n topFocusTrap.tabIndex = 0;\n\n bottomFocusTrap = topFocusTrap.cloneNode(false);\n\n // When focus is about to move out of the dialog, we want to intercept it and redirect it\n // back to the dialog element.\n var focusHandler = function() {\n element.focus();\n };\n topFocusTrap.addEventListener('focus', focusHandler);\n bottomFocusTrap.addEventListener('focus', focusHandler);\n\n // The top focus trap inserted immeidately before the md-dialog element (as a sibling).\n // The bottom focus trap is inserted at the very end of the md-dialog element (as a child).\n element[0].parentNode.insertBefore(topFocusTrap, element[0]);\n element.after(bottomFocusTrap);\n }\n\n /**\n * Prevents screen reader interaction behind modal window\n * on swipe interfaces\n */\n function lockScreenReader(element, options) {\n var isHidden = true;\n\n // get raw DOM node\n walkDOM(element[0]);\n\n options.unlockScreenReader = function() {\n isHidden = false;\n walkDOM(element[0]);\n\n options.unlockScreenReader = null;\n };\n\n /**\n * Walk DOM to apply or remove aria-hidden on sibling nodes\n * and parent sibling nodes\n *\n */\n function walkDOM(element) {\n while (element.parentNode) {\n if (element === document.body) {\n return;\n }\n var children = element.parentNode.children;\n for (var i = 0; i < children.length; i++) {\n // skip over child if it is an ascendant of the dialog\n // or a script or style tag\n if (element !== children[i] && !isNodeOneOf(children[i], ['SCRIPT', 'STYLE'])) {\n children[i].setAttribute('aria-hidden', isHidden);\n }\n }\n\n walkDOM(element = element.parentNode);\n }\n }\n }\n\n /**\n * Ensure the dialog container fill-stretches to the viewport\n */\n function stretchDialogContainerToViewport(container, options) {\n var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';\n var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;\n var height = backdrop ? Math.min($document[0].body.clientHeight, Math.ceil(Math.abs(parseInt(backdrop.height, 10)))) : 0;\n\n container.css({\n top: (isFixed ? $mdUtil.scrollTop(options.parent) : 0) + 'px',\n height: height ? height + 'px' : '100%'\n });\n\n return container;\n }\n\n /**\n * Dialog open and pop-in animation\n */\n function dialogPopIn(container, options) {\n // Add the `md-dialog-container` to the DOM\n options.parent.append(container);\n stretchDialogContainerToViewport(container, options);\n\n var dialogEl = container.find('md-dialog');\n var animator = $mdUtil.dom.animator;\n var buildTranslateToOrigin = animator.calculateZoomToOrigin;\n var translateOptions = {transitionInClass: 'md-transition-in', transitionOutClass: 'md-transition-out'};\n var from = animator.toTransformCss(buildTranslateToOrigin(dialogEl, options.openFrom || options.origin));\n var to = animator.toTransformCss(\"\"); // defaults to center display (or parent or $rootElement)\n\n if (options.fullscreen) {\n dialogEl.addClass('md-dialog-fullscreen');\n }\n\n return animator\n .translate3d(dialogEl, from, to, translateOptions)\n .then(function(animateReversal) {\n // Build a reversal translate function synched to this translation...\n options.reverseAnimate = function() {\n delete options.reverseAnimate;\n\n if (options.closeTo) {\n // Using the opposite classes to create a close animation to the closeTo element\n translateOptions = {transitionInClass: 'md-transition-out', transitionOutClass: 'md-transition-in'};\n from = to;\n to = animator.toTransformCss(buildTranslateToOrigin(dialogEl, options.closeTo));\n\n return animator\n .translate3d(dialogEl, from, to,translateOptions);\n }\n\n return animateReversal(\n animator.toTransformCss(\n // in case the origin element has moved or is hidden,\n // let's recalculate the translateCSS\n buildTranslateToOrigin(dialogEl, options.origin)\n )\n );\n\n };\n return true;\n });\n }\n\n /**\n * Dialog close and pop-out animation\n */\n function dialogPopOut(container, options) {\n return options.reverseAnimate();\n }\n\n /**\n * Utility function to filter out raw DOM nodes\n */\n function isNodeOneOf(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) {\n return true;\n }\n }\n\n }\n}\nMdDialogProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.divider\n * @description Divider module!\n */\nangular.module('material.components.divider', [\n 'material.core'\n])\n .directive('mdDivider', MdDividerDirective);\n\n/**\n * @ngdoc directive\n * @name mdDivider\n * @module material.components.divider\n * @restrict E\n *\n * @description\n * Dividers group and separate content within lists and page layouts using strong visual and spatial distinctions. This divider is a thin rule, lightweight enough to not distract the user from content.\n *\n * @param {boolean=} md-inset Add this attribute to activate the inset divider style.\n * @usage\n * <hljs lang=\"html\">\n * <md-divider></md-divider>\n *\n * <md-divider md-inset></md-divider>\n * </hljs>\n *\n */\nfunction MdDividerDirective($mdTheming) {\n return {\n restrict: 'E',\n link: $mdTheming\n };\n}\nMdDividerDirective.$inject = [\"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc module\n * @name material.components.fabActions\n */\n angular\n .module('material.components.fabActions', ['material.core'])\n .directive('mdFabActions', MdFabActionsDirective);\n\n /**\n * @ngdoc directive\n * @name mdFabActions\n * @module material.components.fabActions\n *\n * @restrict E\n *\n * @description\n * The `<md-fab-actions>` directive is used inside of a `<md-fab-speed-dial>` or\n * `<md-fab-toolbar>` directive to mark an element (or elements) as the actions and setup the\n * proper event listeners.\n *\n * @usage\n * See the `<md-fab-speed-dial>` or `<md-fab-toolbar>` directives for example usage.\n */\n function MdFabActionsDirective() {\n return {\n restrict: 'E',\n\n require: ['^?mdFabSpeedDial', '^?mdFabToolbar'],\n\n compile: function(element, attributes) {\n var children = element.children();\n\n var hasNgRepeat = false;\n\n angular.forEach(['', 'data-', 'x-'], function(prefix) {\n hasNgRepeat = hasNgRepeat || (children.attr(prefix + 'ng-repeat') ? true : false);\n });\n\n // Support both ng-repeat and static content\n if (hasNgRepeat) {\n children.addClass('md-fab-action-item');\n } else {\n // Wrap every child in a new div and add a class that we can scale/fling independently\n children.wrap('<div class=\"md-fab-action-item\">');\n }\n }\n }\n }\n\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n angular.module('material.components.fabShared', ['material.core'])\n .controller('FabController', FabController);\n\n function FabController($scope, $element, $animate, $mdUtil, $mdConstant, $timeout) {\n var vm = this;\n\n // NOTE: We use async eval(s) below to avoid conflicts with any existing digest loops\n\n vm.open = function() {\n $scope.$evalAsync(\"vm.isOpen = true\");\n };\n\n vm.close = function() {\n // Async eval to avoid conflicts with existing digest loops\n $scope.$evalAsync(\"vm.isOpen = false\");\n\n // Focus the trigger when the element closes so users can still tab to the next item\n $element.find('md-fab-trigger')[0].focus();\n };\n\n // Toggle the open/close state when the trigger is clicked\n vm.toggle = function() {\n $scope.$evalAsync(\"vm.isOpen = !vm.isOpen\");\n };\n\n setupDefaults();\n setupListeners();\n setupWatchers();\n\n var initialAnimationAttempts = 0;\n fireInitialAnimations();\n\n function setupDefaults() {\n // Set the default direction to 'down' if none is specified\n vm.direction = vm.direction || 'down';\n\n // Set the default to be closed\n vm.isOpen = vm.isOpen || false;\n\n // Start the keyboard interaction at the first action\n resetActionIndex();\n\n // Add an animations waiting class so we know not to run\n $element.addClass('md-animations-waiting');\n }\n\n function setupListeners() {\n var eventTypes = [\n 'click', 'focusin', 'focusout'\n ];\n\n // Add our listeners\n angular.forEach(eventTypes, function(eventType) {\n $element.on(eventType, parseEvents);\n });\n\n // Remove our listeners when destroyed\n $scope.$on('$destroy', function() {\n angular.forEach(eventTypes, function(eventType) {\n $element.off(eventType, parseEvents);\n });\n\n // remove any attached keyboard handlers in case element is removed while\n // speed dial is open\n disableKeyboard();\n });\n }\n\n var closeTimeout;\n function parseEvents(event) {\n // If the event is a click, just handle it\n if (event.type == 'click') {\n handleItemClick(event);\n }\n\n // If we focusout, set a timeout to close the element\n if (event.type == 'focusout' && !closeTimeout) {\n closeTimeout = $timeout(function() {\n vm.close();\n }, 100, false);\n }\n\n // If we see a focusin and there is a timeout about to run, cancel it so we stay open\n if (event.type == 'focusin' && closeTimeout) {\n $timeout.cancel(closeTimeout);\n closeTimeout = null;\n }\n }\n\n function resetActionIndex() {\n vm.currentActionIndex = -1;\n }\n\n function setupWatchers() {\n // Watch for changes to the direction and update classes/attributes\n $scope.$watch('vm.direction', function(newDir, oldDir) {\n // Add the appropriate classes so we can target the direction in the CSS\n $animate.removeClass($element, 'md-' + oldDir);\n $animate.addClass($element, 'md-' + newDir);\n\n // Reset the action index since it may have changed\n resetActionIndex();\n });\n\n var trigger, actions;\n\n // Watch for changes to md-open\n $scope.$watch('vm.isOpen', function(isOpen) {\n // Reset the action index since it may have changed\n resetActionIndex();\n\n // We can't get the trigger/actions outside of the watch because the component hasn't been\n // linked yet, so we wait until the first watch fires to cache them.\n if (!trigger || !actions) {\n trigger = getTriggerElement();\n actions = getActionsElement();\n }\n\n if (isOpen) {\n enableKeyboard();\n } else {\n disableKeyboard();\n }\n\n var toAdd = isOpen ? 'md-is-open' : '';\n var toRemove = isOpen ? '' : 'md-is-open';\n\n // Set the proper ARIA attributes\n trigger.attr('aria-haspopup', true);\n trigger.attr('aria-expanded', isOpen);\n actions.attr('aria-hidden', !isOpen);\n\n // Animate the CSS classes\n $animate.setClass($element, toAdd, toRemove);\n });\n }\n\n function fireInitialAnimations() {\n // If the element is actually visible on the screen\n if ($element[0].scrollHeight > 0) {\n // Fire our animation\n $animate.addClass($element, 'md-animations-ready').then(function() {\n // Remove the waiting class\n $element.removeClass('md-animations-waiting');\n });\n }\n\n // Otherwise, try for up to 1 second before giving up\n else if (initialAnimationAttempts < 10) {\n $timeout(fireInitialAnimations, 100);\n\n // Increment our counter\n initialAnimationAttempts = initialAnimationAttempts + 1;\n }\n }\n\n function enableKeyboard() {\n $element.on('keydown', keyPressed);\n\n // On the next tick, setup a check for outside clicks; we do this on the next tick to avoid\n // clicks/touches that result in the isOpen attribute changing (e.g. a bound radio button)\n $mdUtil.nextTick(function() {\n angular.element(document).on('click touchend', checkForOutsideClick);\n });\n\n // TODO: On desktop, we should be able to reset the indexes so you cannot tab through, but\n // this breaks accessibility, especially on mobile, since you have no arrow keys to press\n //resetActionTabIndexes();\n }\n\n function disableKeyboard() {\n $element.off('keydown', keyPressed);\n angular.element(document).off('click touchend', checkForOutsideClick);\n }\n\n function checkForOutsideClick(event) {\n if (event.target) {\n var closestTrigger = $mdUtil.getClosest(event.target, 'md-fab-trigger');\n var closestActions = $mdUtil.getClosest(event.target, 'md-fab-actions');\n\n if (!closestTrigger && !closestActions) {\n vm.close();\n }\n }\n }\n\n function keyPressed(event) {\n switch (event.which) {\n case $mdConstant.KEY_CODE.ESCAPE: vm.close(); event.preventDefault(); return false;\n case $mdConstant.KEY_CODE.LEFT_ARROW: doKeyLeft(event); return false;\n case $mdConstant.KEY_CODE.UP_ARROW: doKeyUp(event); return false;\n case $mdConstant.KEY_CODE.RIGHT_ARROW: doKeyRight(event); return false;\n case $mdConstant.KEY_CODE.DOWN_ARROW: doKeyDown(event); return false;\n }\n }\n\n function doActionPrev(event) {\n focusAction(event, -1);\n }\n\n function doActionNext(event) {\n focusAction(event, 1);\n }\n\n function focusAction(event, direction) {\n var actions = resetActionTabIndexes();\n\n // Increment/decrement the counter with restrictions\n vm.currentActionIndex = vm.currentActionIndex + direction;\n vm.currentActionIndex = Math.min(actions.length - 1, vm.currentActionIndex);\n vm.currentActionIndex = Math.max(0, vm.currentActionIndex);\n\n // Focus the element\n var focusElement = angular.element(actions[vm.currentActionIndex]).children()[0];\n angular.element(focusElement).attr('tabindex', 0);\n focusElement.focus();\n\n // Make sure the event doesn't bubble and cause something else\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n function resetActionTabIndexes() {\n // Grab all of the actions\n var actions = getActionsElement()[0].querySelectorAll('.md-fab-action-item');\n\n // Disable all other actions for tabbing\n angular.forEach(actions, function(action) {\n angular.element(angular.element(action).children()[0]).attr('tabindex', -1);\n });\n\n return actions;\n }\n\n function doKeyLeft(event) {\n if (vm.direction === 'left') {\n doActionNext(event);\n } else {\n doActionPrev(event);\n }\n }\n\n function doKeyUp(event) {\n if (vm.direction === 'down') {\n doActionPrev(event);\n } else {\n doActionNext(event);\n }\n }\n\n function doKeyRight(event) {\n if (vm.direction === 'left') {\n doActionPrev(event);\n } else {\n doActionNext(event);\n }\n }\n\n function doKeyDown(event) {\n if (vm.direction === 'up') {\n doActionPrev(event);\n } else {\n doActionNext(event);\n }\n }\n\n function isTrigger(element) {\n return $mdUtil.getClosest(element, 'md-fab-trigger');\n }\n\n function isAction(element) {\n return $mdUtil.getClosest(element, 'md-fab-actions');\n }\n\n function handleItemClick(event) {\n if (isTrigger(event.target)) {\n vm.toggle();\n }\n\n if (isAction(event.target)) {\n vm.close();\n }\n }\n\n function getTriggerElement() {\n return $element.find('md-fab-trigger');\n }\n\n function getActionsElement() {\n return $element.find('md-fab-actions');\n }\n }\n FabController.$inject = [\"$scope\", \"$element\", \"$animate\", \"$mdUtil\", \"$mdConstant\", \"$timeout\"];\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * The duration of the CSS animation in milliseconds.\n *\n * @type {number}\n */\n var cssAnimationDuration = 300;\n\n /**\n * @ngdoc module\n * @name material.components.fabSpeedDial\n */\n angular\n // Declare our module\n .module('material.components.fabSpeedDial', [\n 'material.core',\n 'material.components.fabShared',\n 'material.components.fabTrigger',\n 'material.components.fabActions'\n ])\n\n // Register our directive\n .directive('mdFabSpeedDial', MdFabSpeedDialDirective)\n\n // Register our custom animations\n .animation('.md-fling', MdFabSpeedDialFlingAnimation)\n .animation('.md-scale', MdFabSpeedDialScaleAnimation)\n\n // Register a service for each animation so that we can easily inject them into unit tests\n .service('mdFabSpeedDialFlingAnimation', MdFabSpeedDialFlingAnimation)\n .service('mdFabSpeedDialScaleAnimation', MdFabSpeedDialScaleAnimation);\n\n /**\n * @ngdoc directive\n * @name mdFabSpeedDial\n * @module material.components.fabSpeedDial\n *\n * @restrict E\n *\n * @description\n * The `<md-fab-speed-dial>` directive is used to present a series of popup elements (usually\n * `<md-button>`s) for quick access to common actions.\n *\n * There are currently two animations available by applying one of the following classes to\n * the component:\n *\n * - `md-fling` - The speed dial items appear from underneath the trigger and move into their\n * appropriate positions.\n * - `md-scale` - The speed dial items appear in their proper places by scaling from 0% to 100%.\n *\n * You may also easily position the trigger by applying one one of the following classes to the\n * `<md-fab-speed-dial>` element:\n * - `md-fab-top-left`\n * - `md-fab-top-right`\n * - `md-fab-bottom-left`\n * - `md-fab-bottom-right`\n *\n * These CSS classes use `position: absolute`, so you need to ensure that the container element\n * also uses `position: absolute` or `position: relative` in order for them to work.\n *\n * Additionally, you may use the standard `ng-mouseenter` and `ng-mouseleave` directives to\n * open or close the speed dial. However, if you wish to allow users to hover over the empty\n * space where the actions will appear, you must also add the `md-hover-full` class to the speed\n * dial element. Without this, the hover effect will only occur on top of the trigger.\n *\n * See the demos for more information.\n *\n * ## Troubleshooting\n *\n * If your speed dial shows the closing animation upon launch, you may need to use `ng-cloak` on\n * the parent container to ensure that it is only visible once ready. We have plans to remove this\n * necessity in the future.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-fab-speed-dial md-direction=\"up\" class=\"md-fling\">\n * <md-fab-trigger>\n * <md-button aria-label=\"Add...\"><md-icon icon=\"/img/icons/plus.svg\"></md-icon></md-button>\n * </md-fab-trigger>\n *\n * <md-fab-actions>\n * <md-button aria-label=\"Add User\">\n * <md-icon icon=\"/img/icons/user.svg\"></md-icon>\n * </md-button>\n *\n * <md-button aria-label=\"Add Group\">\n * <md-icon icon=\"/img/icons/group.svg\"></md-icon>\n * </md-button>\n * </md-fab-actions>\n * </md-fab-speed-dial>\n * </hljs>\n *\n * @param {string} md-direction From which direction you would like the speed dial to appear\n * relative to the trigger element.\n * @param {expression=} md-open Programmatically control whether or not the speed-dial is visible.\n */\n function MdFabSpeedDialDirective() {\n return {\n restrict: 'E',\n\n scope: {\n direction: '@?mdDirection',\n isOpen: '=?mdOpen'\n },\n\n bindToController: true,\n controller: 'FabController',\n controllerAs: 'vm',\n\n link: FabSpeedDialLink\n };\n\n function FabSpeedDialLink(scope, element) {\n // Prepend an element to hold our CSS variables so we can use them in the animations below\n element.prepend('<div class=\"md-css-variables\"></div>');\n }\n }\n\n function MdFabSpeedDialFlingAnimation($timeout) {\n function delayDone(done) { $timeout(done, cssAnimationDuration, false); }\n\n function runAnimation(element) {\n // Don't run if we are still waiting and we are not ready\n if (element.hasClass('md-animations-waiting') && !element.hasClass('md-animations-ready')) {\n return;\n }\n\n var el = element[0];\n var ctrl = element.controller('mdFabSpeedDial');\n var items = el.querySelectorAll('.md-fab-action-item');\n\n // Grab our trigger element\n var triggerElement = el.querySelector('md-fab-trigger');\n\n // Grab our element which stores CSS variables\n var variablesElement = el.querySelector('.md-css-variables');\n\n // Setup JS variables based on our CSS variables\n var startZIndex = parseInt(window.getComputedStyle(variablesElement).zIndex);\n\n // Always reset the items to their natural position/state\n angular.forEach(items, function(item, index) {\n var styles = item.style;\n\n styles.transform = styles.webkitTransform = '';\n styles.transitionDelay = '';\n styles.opacity = 1;\n\n // Make the items closest to the trigger have the highest z-index\n styles.zIndex = (items.length - index) + startZIndex;\n });\n\n // Set the trigger to be above all of the actions so they disappear behind it.\n triggerElement.style.zIndex = startZIndex + items.length + 1;\n\n // If the control is closed, hide the items behind the trigger\n if (!ctrl.isOpen) {\n angular.forEach(items, function(item, index) {\n var newPosition, axis;\n var styles = item.style;\n\n // Make sure to account for differences in the dimensions of the trigger verses the items\n // so that we can properly center everything; this helps hide the item's shadows behind\n // the trigger.\n var triggerItemHeightOffset = (triggerElement.clientHeight - item.clientHeight) / 2;\n var triggerItemWidthOffset = (triggerElement.clientWidth - item.clientWidth) / 2;\n\n switch (ctrl.direction) {\n case 'up':\n newPosition = (item.scrollHeight * (index + 1) + triggerItemHeightOffset);\n axis = 'Y';\n break;\n case 'down':\n newPosition = -(item.scrollHeight * (index + 1) + triggerItemHeightOffset);\n axis = 'Y';\n break;\n case 'left':\n newPosition = (item.scrollWidth * (index + 1) + triggerItemWidthOffset);\n axis = 'X';\n break;\n case 'right':\n newPosition = -(item.scrollWidth * (index + 1) + triggerItemWidthOffset);\n axis = 'X';\n break;\n }\n\n var newTranslate = 'translate' + axis + '(' + newPosition + 'px)';\n\n styles.transform = styles.webkitTransform = newTranslate;\n });\n }\n }\n\n return {\n addClass: function(element, className, done) {\n if (element.hasClass('md-fling')) {\n runAnimation(element);\n delayDone(done);\n } else {\n done();\n }\n },\n removeClass: function(element, className, done) {\n runAnimation(element);\n delayDone(done);\n }\n }\n }\n MdFabSpeedDialFlingAnimation.$inject = [\"$timeout\"];\n\n function MdFabSpeedDialScaleAnimation($timeout) {\n function delayDone(done) { $timeout(done, cssAnimationDuration, false); }\n\n var delay = 65;\n\n function runAnimation(element) {\n var el = element[0];\n var ctrl = element.controller('mdFabSpeedDial');\n var items = el.querySelectorAll('.md-fab-action-item');\n\n // Grab our element which stores CSS variables\n var variablesElement = el.querySelector('.md-css-variables');\n\n // Setup JS variables based on our CSS variables\n var startZIndex = parseInt(window.getComputedStyle(variablesElement).zIndex);\n\n // Always reset the items to their natural position/state\n angular.forEach(items, function(item, index) {\n var styles = item.style,\n offsetDelay = index * delay;\n\n styles.opacity = ctrl.isOpen ? 1 : 0;\n styles.transform = styles.webkitTransform = ctrl.isOpen ? 'scale(1)' : 'scale(0)';\n styles.transitionDelay = (ctrl.isOpen ? offsetDelay : (items.length - offsetDelay)) + 'ms';\n\n // Make the items closest to the trigger have the highest z-index\n styles.zIndex = (items.length - index) + startZIndex;\n });\n }\n\n return {\n addClass: function(element, className, done) {\n runAnimation(element);\n delayDone(done);\n },\n\n removeClass: function(element, className, done) {\n runAnimation(element);\n delayDone(done);\n }\n }\n }\n MdFabSpeedDialScaleAnimation.$inject = [\"$timeout\"];\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc module\n * @name material.components.fabToolbar\n */\n angular\n // Declare our module\n .module('material.components.fabToolbar', [\n 'material.core',\n 'material.components.fabShared',\n 'material.components.fabTrigger',\n 'material.components.fabActions'\n ])\n\n // Register our directive\n .directive('mdFabToolbar', MdFabToolbarDirective)\n\n // Register our custom animations\n .animation('.md-fab-toolbar', MdFabToolbarAnimation)\n\n // Register a service for the animation so that we can easily inject it into unit tests\n .service('mdFabToolbarAnimation', MdFabToolbarAnimation);\n\n /**\n * @ngdoc directive\n * @name mdFabToolbar\n * @module material.components.fabToolbar\n *\n * @restrict E\n *\n * @description\n *\n * The `<md-fab-toolbar>` directive is used present a toolbar of elements (usually `<md-button>`s)\n * for quick access to common actions when a floating action button is activated (via click or\n * keyboard navigation).\n *\n * You may also easily position the trigger by applying one one of the following classes to the\n * `<md-fab-toolbar>` element:\n * - `md-fab-top-left`\n * - `md-fab-top-right`\n * - `md-fab-bottom-left`\n * - `md-fab-bottom-right`\n *\n * These CSS classes use `position: absolute`, so you need to ensure that the container element\n * also uses `position: absolute` or `position: relative` in order for them to work.\n *\n * @usage\n *\n * <hljs lang=\"html\">\n * <md-fab-toolbar md-direction='left'>\n * <md-fab-trigger>\n * <md-button aria-label=\"Add...\"><md-icon icon=\"/img/icons/plus.svg\"></md-icon></md-button>\n * </md-fab-trigger>\n *\n * <md-fab-actions>\n * <md-button aria-label=\"Add User\">\n * <md-icon icon=\"/img/icons/user.svg\"></md-icon>\n * </md-button>\n *\n * <md-button aria-label=\"Add Group\">\n * <md-icon icon=\"/img/icons/group.svg\"></md-icon>\n * </md-button>\n * </md-fab-actions>\n * </md-fab-toolbar>\n * </hljs>\n *\n * @param {string} md-direction From which direction you would like the toolbar items to appear\n * relative to the trigger element. Supports `left` and `right` directions.\n * @param {expression=} md-open Programmatically control whether or not the toolbar is visible.\n */\n function MdFabToolbarDirective() {\n return {\n restrict: 'E',\n transclude: true,\n template: '<div class=\"md-fab-toolbar-wrapper\">' +\n ' <div class=\"md-fab-toolbar-content\" ng-transclude></div>' +\n '</div>',\n\n scope: {\n direction: '@?mdDirection',\n isOpen: '=?mdOpen'\n },\n\n bindToController: true,\n controller: 'FabController',\n controllerAs: 'vm',\n\n link: link\n };\n\n function link(scope, element, attributes) {\n // Add the base class for animations\n element.addClass('md-fab-toolbar');\n\n // Prepend the background element to the trigger's button\n element.find('md-fab-trigger').find('button')\n .prepend('<div class=\"md-fab-toolbar-background\"></div>');\n }\n }\n\n function MdFabToolbarAnimation() {\n\n function runAnimation(element, className, done) {\n // If no className was specified, don't do anything\n if (!className) {\n return;\n }\n\n var el = element[0];\n var ctrl = element.controller('mdFabToolbar');\n\n // Grab the relevant child elements\n var backgroundElement = el.querySelector('.md-fab-toolbar-background');\n var triggerElement = el.querySelector('md-fab-trigger button');\n var toolbarElement = el.querySelector('md-toolbar');\n var iconElement = el.querySelector('md-fab-trigger button md-icon');\n var actions = element.find('md-fab-actions').children();\n\n // If we have both elements, use them to position the new background\n if (triggerElement && backgroundElement) {\n // Get our variables\n var color = window.getComputedStyle(triggerElement).getPropertyValue('background-color');\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n\n // Make it twice as big as it should be since we scale from the center\n var scale = 2 * (width / triggerElement.offsetWidth);\n\n // Set some basic styles no matter what animation we're doing\n backgroundElement.style.backgroundColor = color;\n backgroundElement.style.borderRadius = width + 'px';\n\n // If we're open\n if (ctrl.isOpen) {\n // Turn on toolbar pointer events when closed\n toolbarElement.style.pointerEvents = 'initial';\n\n backgroundElement.style.width = triggerElement.offsetWidth + 'px';\n backgroundElement.style.height = triggerElement.offsetHeight + 'px';\n backgroundElement.style.transform = 'scale(' + scale + ')';\n\n // Set the next close animation to have the proper delays\n backgroundElement.style.transitionDelay = '0ms';\n iconElement && (iconElement.style.transitionDelay = '.3s');\n\n // Apply a transition delay to actions\n angular.forEach(actions, function(action, index) {\n action.style.transitionDelay = (actions.length - index) * 25 + 'ms';\n });\n } else {\n // Turn off toolbar pointer events when closed\n toolbarElement.style.pointerEvents = 'none';\n\n // Scale it back down to the trigger's size\n backgroundElement.style.transform = 'scale(1)';\n\n // Reset the position\n backgroundElement.style.top = '0';\n\n if (element.hasClass('md-right')) {\n backgroundElement.style.left = '0';\n backgroundElement.style.right = null;\n }\n\n if (element.hasClass('md-left')) {\n backgroundElement.style.right = '0';\n backgroundElement.style.left = null;\n }\n\n // Set the next open animation to have the proper delays\n backgroundElement.style.transitionDelay = '200ms';\n iconElement && (iconElement.style.transitionDelay = '0ms');\n\n // Apply a transition delay to actions\n angular.forEach(actions, function(action, index) {\n action.style.transitionDelay = 200 + (index * 25) + 'ms';\n });\n }\n }\n }\n\n return {\n addClass: function(element, className, done) {\n runAnimation(element, className, done);\n done();\n },\n\n removeClass: function(element, className, done) {\n runAnimation(element, className, done);\n done();\n }\n }\n }\n})();\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc module\n * @name material.components.fabTrigger\n */\n angular\n .module('material.components.fabTrigger', ['material.core'])\n .directive('mdFabTrigger', MdFabTriggerDirective);\n\n /**\n * @ngdoc directive\n * @name mdFabTrigger\n * @module material.components.fabSpeedDial\n *\n * @restrict E\n *\n * @description\n * The `<md-fab-trigger>` directive is used inside of a `<md-fab-speed-dial>` or\n * `<md-fab-toolbar>` directive to mark an element (or elements) as the trigger and setup the\n * proper event listeners.\n *\n * @usage\n * See the `<md-fab-speed-dial>` or `<md-fab-toolbar>` directives for example usage.\n */\n function MdFabTriggerDirective() {\n // TODO: Remove this completely?\n return {\n restrict: 'E',\n\n require: ['^?mdFabSpeedDial', '^?mdFabToolbar']\n };\n }\n})();\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.gridList\n */\nangular.module('material.components.gridList', ['material.core'])\n .directive('mdGridList', GridListDirective)\n .directive('mdGridTile', GridTileDirective)\n .directive('mdGridTileFooter', GridTileCaptionDirective)\n .directive('mdGridTileHeader', GridTileCaptionDirective)\n .factory('$mdGridLayout', GridLayoutFactory);\n\n/**\n * @ngdoc directive\n * @name mdGridList\n * @module material.components.gridList\n * @restrict E\n * @description\n * Grid lists are an alternative to standard list views. Grid lists are distinct\n * from grids used for layouts and other visual presentations.\n *\n * A grid list is best suited to presenting a homogenous data type, typically\n * images, and is optimized for visual comprehension and differentiating between\n * like data types.\n *\n * A grid list is a continuous element consisting of tessellated, regular\n * subdivisions called cells that contain tiles (`md-grid-tile`).\n *\n * <img src=\"//material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0Bx4BSt6jniD7OVlEaXZ5YmU1Xzg/components_grids_usage2.png\"\n * style=\"width: 300px; height: auto; margin-right: 16px;\" alt=\"Concept of grid explained visually\">\n * <img src=\"//material-design.storage.googleapis.com/publish/v_2/material_ext_publish/0Bx4BSt6jniD7VGhsOE5idWlJWXM/components_grids_usage3.png\"\n * style=\"width: 300px; height: auto;\" alt=\"Grid concepts legend\">\n *\n * Cells are arrayed vertically and horizontally within the grid.\n *\n * Tiles hold content and can span one or more cells vertically or horizontally.\n *\n * ### Responsive Attributes\n *\n * The `md-grid-list` directive supports \"responsive\" attributes, which allow\n * different `md-cols`, `md-gutter` and `md-row-height` values depending on the\n * currently matching media query.\n *\n * In order to set a responsive attribute, first define the fallback value with\n * the standard attribute name, then add additional attributes with the\n * following convention: `{base-attribute-name}-{media-query-name}=\"{value}\"`\n * (ie. `md-cols-lg=\"8\"`)\n *\n * @param {number} md-cols Number of columns in the grid.\n * @param {string} md-row-height One of\n * <ul>\n * <li>CSS length - Fixed height rows (eg. `8px` or `1rem`)</li>\n * <li>`{width}:{height}` - Ratio of width to height (eg.\n * `md-row-height=\"16:9\"`)</li>\n * <li>`\"fit\"` - Height will be determined by subdividing the available\n * height by the number of rows</li>\n * </ul>\n * @param {string=} md-gutter The amount of space between tiles in CSS units\n * (default 1px)\n * @param {expression=} md-on-layout Expression to evaluate after layout. Event\n * object is available as `$event`, and contains performance information.\n *\n * @usage\n * Basic:\n * <hljs lang=\"html\">\n * <md-grid-list md-cols=\"5\" md-gutter=\"1em\" md-row-height=\"4:3\">\n * <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n *\n * Fixed-height rows:\n * <hljs lang=\"html\">\n * <md-grid-list md-cols=\"4\" md-row-height=\"200px\" ...>\n * <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n *\n * Fit rows:\n * <hljs lang=\"html\">\n * <md-grid-list md-cols=\"4\" md-row-height=\"fit\" style=\"height: 400px;\" ...>\n * <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n *\n * Using responsive attributes:\n * <hljs lang=\"html\">\n * <md-grid-list\n * md-cols-sm=\"2\"\n * md-cols-md=\"4\"\n * md-cols-lg=\"8\"\n * md-cols-gt-lg=\"12\"\n * ...>\n * <md-grid-tile></md-grid-tile>\n * </md-grid-list>\n * </hljs>\n */\nfunction GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {\n return {\n restrict: 'E',\n controller: GridListController,\n scope: {\n mdOnLayout: '&'\n },\n link: postLink\n };\n\n function postLink(scope, element, attrs, ctrl) {\n // Apply semantics\n element.attr('role', 'list');\n\n // Provide the controller with a way to trigger layouts.\n ctrl.layoutDelegate = layoutDelegate;\n\n var invalidateLayout = angular.bind(ctrl, ctrl.invalidateLayout),\n unwatchAttrs = watchMedia();\n scope.$on('$destroy', unwatchMedia);\n\n /**\n * Watches for changes in media, invalidating layout as necessary.\n */\n function watchMedia() {\n for (var mediaName in $mdConstant.MEDIA) {\n $mdMedia(mediaName); // initialize\n $mdMedia.getQuery($mdConstant.MEDIA[mediaName])\n .addListener(invalidateLayout);\n }\n return $mdMedia.watchResponsiveAttributes(\n ['md-cols', 'md-row-height', 'md-gutter'], attrs, layoutIfMediaMatch);\n }\n\n function unwatchMedia() {\n ctrl.layoutDelegate = angular.noop;\n\n unwatchAttrs();\n for (var mediaName in $mdConstant.MEDIA) {\n $mdMedia.getQuery($mdConstant.MEDIA[mediaName])\n .removeListener(invalidateLayout);\n }\n }\n\n /**\n * Performs grid layout if the provided mediaName matches the currently\n * active media type.\n */\n function layoutIfMediaMatch(mediaName) {\n if (mediaName == null) {\n // TODO(shyndman): It would be nice to only layout if we have\n // instances of attributes using this media type\n ctrl.invalidateLayout();\n } else if ($mdMedia(mediaName)) {\n ctrl.invalidateLayout();\n }\n }\n\n var lastLayoutProps;\n\n /**\n * Invokes the layout engine, and uses its results to lay out our\n * tile elements.\n *\n * @param {boolean} tilesInvalidated Whether tiles have been\n * added/removed/moved since the last layout. This is to avoid situations\n * where tiles are replaced with properties identical to their removed\n * counterparts.\n */\n function layoutDelegate(tilesInvalidated) {\n var tiles = getTileElements();\n var props = {\n tileSpans: getTileSpans(tiles),\n colCount: getColumnCount(),\n rowMode: getRowMode(),\n rowHeight: getRowHeight(),\n gutter: getGutter()\n };\n\n if (!tilesInvalidated && angular.equals(props, lastLayoutProps)) {\n return;\n }\n\n var performance =\n $mdGridLayout(props.colCount, props.tileSpans, tiles)\n .map(function(tilePositions, rowCount) {\n return {\n grid: {\n element: element,\n style: getGridStyle(props.colCount, rowCount,\n props.gutter, props.rowMode, props.rowHeight)\n },\n tiles: tilePositions.map(function(ps, i) {\n return {\n element: angular.element(tiles[i]),\n style: getTileStyle(ps.position, ps.spans,\n props.colCount, rowCount,\n props.gutter, props.rowMode, props.rowHeight)\n }\n })\n }\n })\n .reflow()\n .performance();\n\n // Report layout\n scope.mdOnLayout({\n $event: {\n performance: performance\n }\n });\n\n lastLayoutProps = props;\n }\n\n // Use $interpolate to do some simple string interpolation as a convenience.\n\n var startSymbol = $interpolate.startSymbol();\n var endSymbol = $interpolate.endSymbol();\n\n // Returns an expression wrapped in the interpolator's start and end symbols.\n function expr(exprStr) {\n return startSymbol + exprStr + endSymbol;\n }\n\n // The amount of space a single 1x1 tile would take up (either width or height), used as\n // a basis for other calculations. This consists of taking the base size percent (as would be\n // if evenly dividing the size between cells), and then subtracting the size of one gutter.\n // However, since there are no gutters on the edges, each tile only uses a fration\n // (gutterShare = numGutters / numCells) of the gutter size. (Imagine having one gutter per\n // tile, and then breaking up the extra gutter on the edge evenly among the cells).\n var UNIT = $interpolate(expr('share') + '% - (' + expr('gutter') + ' * ' + expr('gutterShare') + ')');\n\n // The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value.\n // The position comes the size of a 1x1 tile plus gutter for each previous tile in the\n // row/column (offset).\n var POSITION = $interpolate('calc((' + expr('unit') + ' + ' + expr('gutter') + ') * ' + expr('offset') + ')');\n\n // The actual size of a tile, e.g., width or height, taking rowSpan or colSpan into account.\n // This is computed by multiplying the base unit by the rowSpan/colSpan, and then adding back\n // in the space that the gutter would normally have used (which was already accounted for in\n // the base unit calculation).\n var DIMENSION = $interpolate('calc((' + expr('unit') + ') * ' + expr('span') + ' + (' + expr('span') + ' - 1) * ' + expr('gutter') + ')');\n\n /**\n * Gets the styles applied to a tile element described by the given parameters.\n * @param {{row: number, col: number}} position The row and column indices of the tile.\n * @param {{row: number, col: number}} spans The rowSpan and colSpan of the tile.\n * @param {number} colCount The number of columns.\n * @param {number} rowCount The number of rows.\n * @param {string} gutter The amount of space between tiles. This will be something like\n * '5px' or '2em'.\n * @param {string} rowMode The row height mode. Can be one of:\n * 'fixed': all rows have a fixed size, given by rowHeight,\n * 'ratio': row height defined as a ratio to width, or\n * 'fit': fit to the grid-list element height, divinding evenly among rows.\n * @param {string|number} rowHeight The height of a row. This is only used for 'fixed' mode and\n * for 'ratio' mode. For 'ratio' mode, this is the *ratio* of width-to-height (e.g., 0.75).\n * @returns {Object} Map of CSS properties to be applied to the style element. Will define\n * values for top, left, width, height, marginTop, and paddingTop.\n */\n function getTileStyle(position, spans, colCount, rowCount, gutter, rowMode, rowHeight) {\n // TODO(shyndman): There are style caching opportunities here.\n\n // Percent of the available horizontal space that one column takes up.\n var hShare = (1 / colCount) * 100;\n\n // Fraction of the gutter size that each column takes up.\n var hGutterShare = (colCount - 1) / colCount;\n\n // Base horizontal size of a column.\n var hUnit = UNIT({share: hShare, gutterShare: hGutterShare, gutter: gutter});\n\n // The width and horizontal position of each tile is always calculated the same way, but the\n // height and vertical position depends on the rowMode.\n var style = {\n left: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),\n width: DIMENSION({ unit: hUnit, span: spans.col, gutter: gutter }),\n // resets\n paddingTop: '',\n marginTop: '',\n top: '',\n height: ''\n };\n\n switch (rowMode) {\n case 'fixed':\n // In fixed mode, simply use the given rowHeight.\n style.top = POSITION({ unit: rowHeight, offset: position.row, gutter: gutter });\n style.height = DIMENSION({ unit: rowHeight, span: spans.row, gutter: gutter });\n break;\n\n case 'ratio':\n // Percent of the available vertical space that one row takes up. Here, rowHeight holds\n // the ratio value. For example, if the width:height ratio is 4:3, rowHeight = 1.333.\n var vShare = hShare / rowHeight;\n\n // Base veritcal size of a row.\n var vUnit = UNIT({ share: vShare, gutterShare: hGutterShare, gutter: gutter });\n\n // padidngTop and marginTop are used to maintain the given aspect ratio, as\n // a percentage-based value for these properties is applied to the *width* of the\n // containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties\n style.paddingTop = DIMENSION({ unit: vUnit, span: spans.row, gutter: gutter});\n style.marginTop = POSITION({ unit: vUnit, offset: position.row, gutter: gutter });\n break;\n\n case 'fit':\n // Fraction of the gutter size that each column takes up.\n var vGutterShare = (rowCount - 1) / rowCount;\n\n // Percent of the available vertical space that one row takes up.\n var vShare = (1 / rowCount) * 100;\n\n // Base vertical size of a row.\n var vUnit = UNIT({share: vShare, gutterShare: vGutterShare, gutter: gutter});\n\n style.top = POSITION({unit: vUnit, offset: position.row, gutter: gutter});\n style.height = DIMENSION({unit: vUnit, span: spans.row, gutter: gutter});\n break;\n }\n\n return style;\n }\n\n function getGridStyle(colCount, rowCount, gutter, rowMode, rowHeight) {\n var style = {};\n\n switch(rowMode) {\n case 'fixed':\n style.height = DIMENSION({ unit: rowHeight, span: rowCount, gutter: gutter });\n style.paddingBottom = '';\n break;\n\n case 'ratio':\n // rowHeight is width / height\n var hGutterShare = colCount === 1 ? 0 : (colCount - 1) / colCount,\n hShare = (1 / colCount) * 100,\n vShare = hShare * (1 / rowHeight),\n vUnit = UNIT({ share: vShare, gutterShare: hGutterShare, gutter: gutter });\n\n style.height = '';\n style.paddingBottom = DIMENSION({ unit: vUnit, span: rowCount, gutter: gutter});\n break;\n\n case 'fit':\n // noop, as the height is user set\n break;\n }\n\n return style;\n }\n\n function getTileElements() {\n return [].filter.call(element.children(), function(ele) {\n return ele.tagName == 'MD-GRID-TILE' && !ele.$$mdDestroyed;\n });\n }\n\n /**\n * Gets an array of objects containing the rowspan and colspan for each tile.\n * @returns {Array<{row: number, col: number}>}\n */\n function getTileSpans(tileElements) {\n return [].map.call(tileElements, function(ele) {\n var ctrl = angular.element(ele).controller('mdGridTile');\n return {\n row: parseInt(\n $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-rowspan'), 10) || 1,\n col: parseInt(\n $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-colspan'), 10) || 1\n };\n });\n }\n\n function getColumnCount() {\n var colCount = parseInt($mdMedia.getResponsiveAttribute(attrs, 'md-cols'), 10);\n if (isNaN(colCount)) {\n throw 'md-grid-list: md-cols attribute was not found, or contained a non-numeric value';\n }\n return colCount;\n }\n\n function getGutter() {\n return applyDefaultUnit($mdMedia.getResponsiveAttribute(attrs, 'md-gutter') || 1);\n }\n\n function getRowHeight() {\n var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');\n if (!rowHeight) {\n throw 'md-grid-list: md-row-height attribute was not found';\n }\n\n switch (getRowMode()) {\n case 'fixed':\n return applyDefaultUnit(rowHeight);\n case 'ratio':\n var whRatio = rowHeight.split(':');\n return parseFloat(whRatio[0]) / parseFloat(whRatio[1]);\n case 'fit':\n return 0; // N/A\n }\n }\n\n function getRowMode() {\n var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');\n if (!rowHeight) {\n throw 'md-grid-list: md-row-height attribute was not found';\n }\n\n if (rowHeight == 'fit') {\n return 'fit';\n } else if (rowHeight.indexOf(':') !== -1) {\n return 'ratio';\n } else {\n return 'fixed';\n }\n }\n\n function applyDefaultUnit(val) {\n return /\\D$/.test(val) ? val : val + 'px';\n }\n }\n}\nGridListDirective.$inject = [\"$interpolate\", \"$mdConstant\", \"$mdGridLayout\", \"$mdMedia\"];\n\n/* @ngInject */\nfunction GridListController($mdUtil) {\n this.layoutInvalidated = false;\n this.tilesInvalidated = false;\n this.$timeout_ = $mdUtil.nextTick;\n this.layoutDelegate = angular.noop;\n}\nGridListController.$inject = [\"$mdUtil\"];\n\nGridListController.prototype = {\n invalidateTiles: function() {\n this.tilesInvalidated = true;\n this.invalidateLayout();\n },\n\n invalidateLayout: function() {\n if (this.layoutInvalidated) {\n return;\n }\n this.layoutInvalidated = true;\n this.$timeout_(angular.bind(this, this.layout));\n },\n\n layout: function() {\n try {\n this.layoutDelegate(this.tilesInvalidated);\n } finally {\n this.layoutInvalidated = false;\n this.tilesInvalidated = false;\n }\n }\n};\n\n\n/* @ngInject */\nfunction GridLayoutFactory($mdUtil) {\n var defaultAnimator = GridTileAnimator;\n\n /**\n * Set the reflow animator callback\n */\n GridLayout.animateWith = function(customAnimator) {\n defaultAnimator = !angular.isFunction(customAnimator) ? GridTileAnimator : customAnimator;\n };\n\n return GridLayout;\n\n /**\n * Publish layout function\n */\n function GridLayout(colCount, tileSpans) {\n var self, layoutInfo, gridStyles, layoutTime, mapTime, reflowTime;\n\n layoutTime = $mdUtil.time(function() {\n layoutInfo = calculateGridFor(colCount, tileSpans);\n });\n\n return self = {\n\n /**\n * An array of objects describing each tile's position in the grid.\n */\n layoutInfo: function() {\n return layoutInfo;\n },\n\n /**\n * Maps grid positioning to an element and a set of styles using the\n * provided updateFn.\n */\n map: function(updateFn) {\n mapTime = $mdUtil.time(function() {\n var info = self.layoutInfo();\n gridStyles = updateFn(info.positioning, info.rowCount);\n });\n return self;\n },\n\n /**\n * Default animator simply sets the element.css( <styles> ). An alternate\n * animator can be provided as an argument. The function has the following\n * signature:\n *\n * function({grid: {element: JQLite, style: Object}, tiles: Array<{element: JQLite, style: Object}>)\n */\n reflow: function(animatorFn) {\n reflowTime = $mdUtil.time(function() {\n var animator = animatorFn || defaultAnimator;\n animator(gridStyles.grid, gridStyles.tiles);\n });\n return self;\n },\n\n /**\n * Timing for the most recent layout run.\n */\n performance: function() {\n return {\n tileCount: tileSpans.length,\n layoutTime: layoutTime,\n mapTime: mapTime,\n reflowTime: reflowTime,\n totalTime: layoutTime + mapTime + reflowTime\n };\n }\n };\n }\n\n /**\n * Default Gridlist animator simple sets the css for each element;\n * NOTE: any transitions effects must be manually set in the CSS.\n * e.g.\n *\n * md-grid-tile {\n * transition: all 700ms ease-out 50ms;\n * }\n *\n */\n function GridTileAnimator(grid, tiles) {\n grid.element.css(grid.style);\n tiles.forEach(function(t) {\n t.element.css(t.style);\n })\n }\n\n /**\n * Calculates the positions of tiles.\n *\n * The algorithm works as follows:\n * An Array<Number> with length colCount (spaceTracker) keeps track of\n * available tiling positions, where elements of value 0 represents an\n * empty position. Space for a tile is reserved by finding a sequence of\n * 0s with length <= than the tile's colspan. When such a space has been\n * found, the occupied tile positions are incremented by the tile's\n * rowspan value, as these positions have become unavailable for that\n * many rows.\n *\n * If the end of a row has been reached without finding space for the\n * tile, spaceTracker's elements are each decremented by 1 to a minimum\n * of 0. Rows are searched in this fashion until space is found.\n */\n function calculateGridFor(colCount, tileSpans) {\n var curCol = 0,\n curRow = 0,\n spaceTracker = newSpaceTracker();\n\n return {\n positioning: tileSpans.map(function(spans, i) {\n return {\n spans: spans,\n position: reserveSpace(spans, i)\n };\n }),\n rowCount: curRow + Math.max.apply(Math, spaceTracker)\n };\n\n function reserveSpace(spans, i) {\n if (spans.col > colCount) {\n throw 'md-grid-list: Tile at position ' + i + ' has a colspan ' +\n '(' + spans.col + ') that exceeds the column count ' +\n '(' + colCount + ')';\n }\n\n var start = 0,\n end = 0;\n\n // TODO(shyndman): This loop isn't strictly necessary if you can\n // determine the minimum number of rows before a space opens up. To do\n // this, recognize that you've iterated across an entire row looking for\n // space, and if so fast-forward by the minimum rowSpan count. Repeat\n // until the required space opens up.\n while (end - start < spans.col) {\n if (curCol >= colCount) {\n nextRow();\n continue;\n }\n\n start = spaceTracker.indexOf(0, curCol);\n if (start === -1 || (end = findEnd(start + 1)) === -1) {\n start = end = 0;\n nextRow();\n continue;\n }\n\n curCol = end + 1;\n }\n\n adjustRow(start, spans.col, spans.row);\n curCol = start + spans.col;\n\n return {\n col: start,\n row: curRow\n };\n }\n\n function nextRow() {\n curCol = 0;\n curRow++;\n adjustRow(0, colCount, -1); // Decrement row spans by one\n }\n\n function adjustRow(from, cols, by) {\n for (var i = from; i < from + cols; i++) {\n spaceTracker[i] = Math.max(spaceTracker[i] + by, 0);\n }\n }\n\n function findEnd(start) {\n var i;\n for (i = start; i < spaceTracker.length; i++) {\n if (spaceTracker[i] !== 0) {\n return i;\n }\n }\n\n if (i === spaceTracker.length) {\n return i;\n }\n }\n\n function newSpaceTracker() {\n var tracker = [];\n for (var i = 0; i < colCount; i++) {\n tracker.push(0);\n }\n return tracker;\n }\n }\n}\nGridLayoutFactory.$inject = [\"$mdUtil\"];\n\n/**\n * @ngdoc directive\n * @name mdGridTile\n * @module material.components.gridList\n * @restrict E\n * @description\n * Tiles contain the content of an `md-grid-list`. They span one or more grid\n * cells vertically or horizontally, and use `md-grid-tile-{footer,header}` to\n * display secondary content.\n *\n * ### Responsive Attributes\n *\n * The `md-grid-tile` directive supports \"responsive\" attributes, which allow\n * different `md-rowspan` and `md-colspan` values depending on the currently\n * matching media query.\n *\n * In order to set a responsive attribute, first define the fallback value with\n * the standard attribute name, then add additional attributes with the\n * following convention: `{base-attribute-name}-{media-query-name}=\"{value}\"`\n * (ie. `md-colspan-sm=\"4\"`)\n *\n * @param {number=} md-colspan The number of columns to span (default 1). Cannot\n * exceed the number of columns in the grid. Supports interpolation.\n * @param {number=} md-rowspan The number of rows to span (default 1). Supports\n * interpolation.\n *\n * @usage\n * With header:\n * <hljs lang=\"html\">\n * <md-grid-tile>\n * <md-grid-tile-header>\n * <h3>This is a header</h3>\n * </md-grid-tile-header>\n * </md-grid-tile>\n * </hljs>\n *\n * With footer:\n * <hljs lang=\"html\">\n * <md-grid-tile>\n * <md-grid-tile-footer>\n * <h3>This is a footer</h3>\n * </md-grid-tile-footer>\n * </md-grid-tile>\n * </hljs>\n *\n * Spanning multiple rows/columns:\n * <hljs lang=\"html\">\n * <md-grid-tile md-colspan=\"2\" md-rowspan=\"3\">\n * </md-grid-tile>\n * </hljs>\n *\n * Responsive attributes:\n * <hljs lang=\"html\">\n * <md-grid-tile md-colspan=\"1\" md-colspan-sm=\"3\" md-colspan-md=\"5\">\n * </md-grid-tile>\n * </hljs>\n */\nfunction GridTileDirective($mdMedia) {\n return {\n restrict: 'E',\n require: '^mdGridList',\n template: '<figure ng-transclude></figure>',\n transclude: true,\n scope: {},\n // Simple controller that exposes attributes to the grid directive\n controller: [\"$attrs\", function($attrs) {\n this.$attrs = $attrs;\n }],\n link: postLink\n };\n\n function postLink(scope, element, attrs, gridCtrl) {\n // Apply semantics\n element.attr('role', 'listitem');\n\n // If our colspan or rowspan changes, trigger a layout\n var unwatchAttrs = $mdMedia.watchResponsiveAttributes(['md-colspan', 'md-rowspan'],\n attrs, angular.bind(gridCtrl, gridCtrl.invalidateLayout));\n\n // Tile registration/deregistration\n gridCtrl.invalidateTiles();\n scope.$on('$destroy', function() {\n // Mark the tile as destroyed so it is no longer considered in layout,\n // even if the DOM element sticks around (like during a leave animation)\n element[0].$$mdDestroyed = true;\n unwatchAttrs();\n gridCtrl.invalidateLayout();\n });\n\n if (angular.isDefined(scope.$parent.$index)) {\n scope.$watch(function() { return scope.$parent.$index; },\n function indexChanged(newIdx, oldIdx) {\n if (newIdx === oldIdx) {\n return;\n }\n gridCtrl.invalidateTiles();\n });\n }\n }\n}\nGridTileDirective.$inject = [\"$mdMedia\"];\n\n\nfunction GridTileCaptionDirective() {\n return {\n template: '<figcaption ng-transclude></figcaption>',\n transclude: true\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.icon\n * @description\n * Icon\n */\nangular.module('material.components.icon', ['material.core']);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.input\n */\n\nangular.module('material.components.input', [\n 'material.core'\n ])\n .directive('mdInputContainer', mdInputContainerDirective)\n .directive('label', labelDirective)\n .directive('input', inputTextareaDirective)\n .directive('textarea', inputTextareaDirective)\n .directive('mdMaxlength', mdMaxlengthDirective)\n .directive('placeholder', placeholderDirective)\n .directive('ngMessages', ngMessagesDirective)\n .directive('ngMessage', ngMessageDirective)\n .directive('ngMessageExp', ngMessageDirective)\n .directive('mdSelectOnFocus', mdSelectOnFocusDirective)\n\n .animation('.md-input-invalid', mdInputInvalidMessagesAnimation)\n .animation('.md-input-messages-animation', ngMessagesAnimation)\n .animation('.md-input-message-animation', ngMessageAnimation);\n\n/**\n * @ngdoc directive\n * @name mdInputContainer\n * @module material.components.input\n *\n * @restrict E\n *\n * @description\n * `<md-input-container>` is the parent of any input or textarea element.\n *\n * Input and textarea elements will not behave properly unless the md-input-container\n * parent is provided.\n *\n * A single `<md-input-container>` should contain only one `<input>` element, otherwise it will throw an error.\n *\n * <b>Exception:</b> Hidden inputs (`<input type=\"hidden\" />`) are ignored and will not throw an error, so\n * you may combine these with other inputs.\n *\n * @param md-is-error {expression=} When the given expression evaluates to true, the input container\n * will go into error state. Defaults to erroring if the input has been touched and is invalid.\n * @param md-no-float {boolean=} When present, `placeholder` attributes on the input will not be converted to floating\n * labels.\n *\n * @usage\n * <hljs lang=\"html\">\n *\n * <md-input-container>\n * <label>Username</label>\n * <input type=\"text\" ng-model=\"user.name\">\n * </md-input-container>\n *\n * <md-input-container>\n * <label>Description</label>\n * <textarea ng-model=\"user.description\"></textarea>\n * </md-input-container>\n *\n * </hljs>\n *\n * <h3>When disabling floating labels</h3>\n * <hljs lang=\"html\">\n *\n * <md-input-container md-no-float>\n * <input type=\"text\" placeholder=\"Non-Floating Label\">\n * </md-input-container>\n *\n * </hljs>\n */\nfunction mdInputContainerDirective($mdTheming, $parse) {\n ContainerCtrl.$inject = [\"$scope\", \"$element\", \"$attrs\", \"$animate\"];\n return {\n restrict: 'E',\n link: postLink,\n controller: ContainerCtrl\n };\n\n function postLink(scope, element, attr) {\n $mdTheming(element);\n if (element.find('md-icon').length) element.addClass('md-has-icon');\n }\n\n function ContainerCtrl($scope, $element, $attrs, $animate) {\n var self = this;\n\n self.isErrorGetter = $attrs.mdIsError && $parse($attrs.mdIsError);\n\n self.delegateClick = function() {\n self.input.focus();\n };\n self.element = $element;\n self.setFocused = function(isFocused) {\n $element.toggleClass('md-input-focused', !!isFocused);\n };\n self.setHasValue = function(hasValue) {\n $element.toggleClass('md-input-has-value', !!hasValue);\n };\n self.setHasPlaceholder = function(hasPlaceholder) {\n $element.toggleClass('md-input-has-placeholder', !!hasPlaceholder);\n };\n self.setInvalid = function(isInvalid) {\n if (isInvalid) {\n $animate.addClass($element, 'md-input-invalid');\n } else {\n $animate.removeClass($element, 'md-input-invalid');\n }\n };\n $scope.$watch(function() {\n return self.label && self.input;\n }, function(hasLabelAndInput) {\n if (hasLabelAndInput && !self.label.attr('for')) {\n self.label.attr('for', self.input.attr('id'));\n }\n });\n }\n}\nmdInputContainerDirective.$inject = [\"$mdTheming\", \"$parse\"];\n\nfunction labelDirective() {\n return {\n restrict: 'E',\n require: '^?mdInputContainer',\n link: function(scope, element, attr, containerCtrl) {\n if (!containerCtrl || attr.mdNoFloat || element.hasClass('md-container-ignore')) return;\n\n containerCtrl.label = element;\n scope.$on('$destroy', function() {\n containerCtrl.label = null;\n });\n }\n };\n}\n\n/**\n * @ngdoc directive\n * @name mdInput\n * @restrict E\n * @module material.components.input\n *\n * @description\n * You can use any `<input>` or `<textarea>` element as a child of an `<md-input-container>`. This\n * allows you to build complex forms for data entry.\n *\n * @param {number=} md-maxlength The maximum number of characters allowed in this input. If this is\n * specified, a character counter will be shown underneath the input.<br/><br/>\n * The purpose of **`md-maxlength`** is exactly to show the max length counter text. If you don't\n * want the counter text and only need \"plain\" validation, you can use the \"simple\" `ng-maxlength`\n * or maxlength attributes.\n * @param {string=} aria-label Aria-label is required when no label is present. A warning message\n * will be logged in the console if not present.\n * @param {string=} placeholder An alternative approach to using aria-label when the label is not\n * PRESENT. The placeholder text is copied to the aria-label attribute.\n * @param md-no-autogrow {boolean=} When present, textareas will not grow automatically.\n * @param md-detect-hidden {boolean=} When present, textareas will be sized properly when they are\n * revealed after being hidden. This is off by default for performance reasons because it\n * guarantees a reflow every digest cycle.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-input-container>\n * <label>Color</label>\n * <input type=\"text\" ng-model=\"color\" required md-maxlength=\"10\">\n * </md-input-container>\n * </hljs>\n *\n * <h3>With Errors</h3>\n *\n * `md-input-container` also supports errors using the standard `ng-messages` directives and\n * animates the messages when they become visible using from the `ngEnter`/`ngLeave` events or\n * the `ngShow`/`ngHide` events.\n *\n * By default, the messages will be hidden until the input is in an error state. This is based off\n * of the `md-is-error` expression of the `md-input-container`. This gives the user a chance to\n * fill out the form before the errors become visible.\n *\n * <hljs lang=\"html\">\n * <form name=\"colorForm\">\n * <md-input-container>\n * <label>Favorite Color</label>\n * <input name=\"favoriteColor\" ng-model=\"favoriteColor\" required>\n * <div ng-messages=\"userForm.lastName.$error\">\n * <div ng-message=\"required\">This is required!</div>\n * </div>\n * </md-input-container>\n * </form>\n * </hljs>\n *\n * We automatically disable this auto-hiding functionality if you provide any of the following\n * visibility directives on the `ng-messages` container:\n *\n * - `ng-if`\n * - `ng-show`/`ng-hide`\n * - `ng-switch-when`/`ng-switch-default`\n *\n * You can also disable this functionality manually by adding the `md-auto-hide=\"false\"` expression\n * to the `ng-messages` container. This may be helpful if you always want to see the error messages\n * or if you are building your own visibilty directive.\n *\n * _<b>Note:</b> The `md-auto-hide` attribute is a static string that is only checked upon\n * initialization of the `ng-messages` directive to see if it equals the string `false`._\n *\n * <hljs lang=\"html\">\n * <form name=\"userForm\">\n * <md-input-container>\n * <label>Last Name</label>\n * <input name=\"lastName\" ng-model=\"lastName\" required md-maxlength=\"10\" minlength=\"4\">\n * <div ng-messages=\"userForm.lastName.$error\" ng-show=\"userForm.lastName.$dirty\">\n * <div ng-message=\"required\">This is required!</div>\n * <div ng-message=\"md-maxlength\">That's too long!</div>\n * <div ng-message=\"minlength\">That's too short!</div>\n * </div>\n * </md-input-container>\n * <md-input-container>\n * <label>Biography</label>\n * <textarea name=\"bio\" ng-model=\"biography\" required md-maxlength=\"150\"></textarea>\n * <div ng-messages=\"userForm.bio.$error\" ng-show=\"userForm.bio.$dirty\">\n * <div ng-message=\"required\">This is required!</div>\n * <div ng-message=\"md-maxlength\">That's too long!</div>\n * </div>\n * </md-input-container>\n * <md-input-container>\n * <input aria-label='title' ng-model='title'>\n * </md-input-container>\n * <md-input-container>\n * <input placeholder='title' ng-model='title'>\n * </md-input-container>\n * </form>\n * </hljs>\n *\n * <h3>Notes</h3>\n *\n * - Requires [ngMessages](https://docs.angularjs.org/api/ngMessages).\n * - Behaves like the [AngularJS input directive](https://docs.angularjs.org/api/ng/directive/input).\n *\n * The `md-input` and `md-input-container` directives use very specific positioning to achieve the\n * error animation effects. Therefore, it is *not* advised to use the Layout system inside of the\n * `<md-input-container>` tags. Instead, use relative or absolute positioning.\n *\n */\n\nfunction inputTextareaDirective($mdUtil, $window, $mdAria) {\n return {\n restrict: 'E',\n require: ['^?mdInputContainer', '?ngModel'],\n link: postLink\n };\n\n function postLink(scope, element, attr, ctrls) {\n\n var containerCtrl = ctrls[0];\n var hasNgModel = !!ctrls[1];\n var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel();\n var isReadonly = angular.isDefined(attr.readonly);\n\n if (!containerCtrl) return;\n if (attr.type === 'hidden') {\n element.attr('aria-hidden', 'true');\n return;\n } else if (containerCtrl.input) {\n throw new Error(\"<md-input-container> can only have *one* <input>, <textarea> or <md-select> child element!\");\n }\n containerCtrl.input = element;\n\n // Add an error spacer div after our input to provide space for the char counter and any ng-messages\n var errorsSpacer = angular.element('<div class=\"md-errors-spacer\">');\n element.after(errorsSpacer);\n\n if (!containerCtrl.label) {\n $mdAria.expect(element, 'aria-label', element.attr('placeholder'));\n }\n\n element.addClass('md-input');\n if (!element.attr('id')) {\n element.attr('id', 'input_' + $mdUtil.nextUid());\n }\n\n if (element[0].tagName.toLowerCase() === 'textarea') {\n setupTextarea();\n }\n\n // If the input doesn't have an ngModel, it may have a static value. For that case,\n // we have to do one initial check to determine if the container should be in the\n // \"has a value\" state.\n if (!hasNgModel) {\n inputCheckValue();\n }\n\n var isErrorGetter = containerCtrl.isErrorGetter || function() {\n return ngModelCtrl.$invalid && (ngModelCtrl.$touched || isParentFormSubmitted());\n };\n\n var isParentFormSubmitted = function () {\n var parent = $mdUtil.getClosest(element, 'form');\n var form = parent ? angular.element(parent).controller('form') : null;\n\n return form ? form.$submitted : false;\n };\n\n scope.$watch(isErrorGetter, containerCtrl.setInvalid);\n\n ngModelCtrl.$parsers.push(ngModelPipelineCheckValue);\n ngModelCtrl.$formatters.push(ngModelPipelineCheckValue);\n\n element.on('input', inputCheckValue);\n\n if (!isReadonly) {\n element\n .on('focus', function(ev) {\n $mdUtil.nextTick(function() {\n containerCtrl.setFocused(true);\n });\n })\n .on('blur', function(ev) {\n $mdUtil.nextTick(function() {\n containerCtrl.setFocused(false);\n inputCheckValue();\n });\n });\n }\n\n //ngModelCtrl.$setTouched();\n //if( ngModelCtrl.$invalid ) containerCtrl.setInvalid();\n\n scope.$on('$destroy', function() {\n containerCtrl.setFocused(false);\n containerCtrl.setHasValue(false);\n containerCtrl.input = null;\n });\n\n /**\n *\n */\n function ngModelPipelineCheckValue(arg) {\n containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg));\n return arg;\n }\n\n function inputCheckValue() {\n // An input's value counts if its length > 0,\n // or if the input's validity state says it has bad input (eg string in a number input)\n containerCtrl.setHasValue(element.val().length > 0 || (element[0].validity || {}).badInput);\n }\n\n function setupTextarea() {\n if (angular.isDefined(element.attr('md-no-autogrow'))) {\n return;\n }\n\n var node = element[0];\n var container = containerCtrl.element[0];\n\n var min_rows = NaN;\n var lineHeight = null;\n // can't check if height was or not explicity set,\n // so rows attribute will take precedence if present\n if (node.hasAttribute('rows')) {\n min_rows = parseInt(node.getAttribute('rows'));\n }\n\n var onChangeTextarea = $mdUtil.debounce(growTextarea, 1);\n\n function pipelineListener(value) {\n onChangeTextarea();\n return value;\n }\n\n if (ngModelCtrl) {\n ngModelCtrl.$formatters.push(pipelineListener);\n ngModelCtrl.$viewChangeListeners.push(pipelineListener);\n } else {\n onChangeTextarea();\n }\n element.on('keydown input', onChangeTextarea);\n\n if (isNaN(min_rows)) {\n element.attr('rows', '1');\n\n element.on('scroll', onScroll);\n }\n\n angular.element($window).on('resize', onChangeTextarea);\n\n scope.$on('$destroy', function() {\n angular.element($window).off('resize', onChangeTextarea);\n });\n\n function growTextarea() {\n // sets the md-input-container height to avoid jumping around\n container.style.height = container.offsetHeight + 'px';\n\n // temporarily disables element's flex so its height 'runs free'\n element.addClass('md-no-flex');\n\n if (isNaN(min_rows)) {\n node.style.height = \"auto\";\n node.scrollTop = 0;\n var height = getHeight();\n if (height) node.style.height = height + 'px';\n } else {\n node.setAttribute(\"rows\", 1);\n\n if (!lineHeight) {\n node.style.minHeight = '0';\n\n lineHeight = element.prop('clientHeight');\n\n node.style.minHeight = null;\n }\n\n var rows = Math.min(min_rows, Math.round(node.scrollHeight / lineHeight));\n node.setAttribute(\"rows\", rows);\n node.style.height = lineHeight * rows + \"px\";\n }\n\n // reset everything back to normal\n element.removeClass('md-no-flex');\n container.style.height = 'auto';\n }\n\n function getHeight() {\n var line = node.scrollHeight - node.offsetHeight;\n return node.offsetHeight + (line > 0 ? line : 0);\n }\n\n function onScroll(e) {\n node.scrollTop = 0;\n // for smooth new line adding\n var line = node.scrollHeight - node.offsetHeight;\n var height = node.offsetHeight + line;\n node.style.height = height + 'px';\n }\n\n // Attach a watcher to detect when the textarea gets shown.\n if (angular.isDefined(element.attr('md-detect-hidden'))) {\n\n var handleHiddenChange = function() {\n var wasHidden = false;\n\n return function() {\n var isHidden = node.offsetHeight === 0;\n\n if (isHidden === false && wasHidden === true) {\n growTextarea();\n }\n\n wasHidden = isHidden;\n };\n }();\n\n // Check every digest cycle whether the visibility of the textarea has changed.\n // Queue up to run after the digest cycle is complete.\n scope.$watch(function() {\n $mdUtil.nextTick(handleHiddenChange, false);\n return true;\n });\n }\n }\n }\n}\ninputTextareaDirective.$inject = [\"$mdUtil\", \"$window\", \"$mdAria\"];\n\nfunction mdMaxlengthDirective($animate, $mdUtil) {\n return {\n restrict: 'A',\n require: ['ngModel', '^mdInputContainer'],\n link: postLink\n };\n\n function postLink(scope, element, attr, ctrls) {\n var maxlength;\n var ngModelCtrl = ctrls[0];\n var containerCtrl = ctrls[1];\n var charCountEl, errorsSpacer;\n\n // Wait until the next tick to ensure that the input has setup the errors spacer where we will\n // append our counter\n $mdUtil.nextTick(function() {\n errorsSpacer = angular.element(containerCtrl.element[0].querySelector('.md-errors-spacer'));\n charCountEl = angular.element('<div class=\"md-char-counter\">');\n\n // Append our character counter inside the errors spacer\n errorsSpacer.append(charCountEl);\n\n // Stop model from trimming. This makes it so whitespace\n // over the maxlength still counts as invalid.\n attr.$set('ngTrim', 'false');\n\n ngModelCtrl.$formatters.push(renderCharCount);\n ngModelCtrl.$viewChangeListeners.push(renderCharCount);\n element.on('input keydown keyup', function() {\n renderCharCount(); //make sure it's called with no args\n });\n\n scope.$watch(attr.mdMaxlength, function(value) {\n maxlength = value;\n if (angular.isNumber(value) && value > 0) {\n if (!charCountEl.parent().length) {\n $animate.enter(charCountEl, errorsSpacer);\n }\n renderCharCount();\n } else {\n $animate.leave(charCountEl);\n }\n });\n\n ngModelCtrl.$validators['md-maxlength'] = function(modelValue, viewValue) {\n if (!angular.isNumber(maxlength) || maxlength < 0) {\n return true;\n }\n return ( modelValue || element.val() || viewValue || '' ).length <= maxlength;\n };\n });\n\n function renderCharCount(value) {\n // If we have not been appended to the body yet; do not render\n if (!charCountEl.parent) {\n return value;\n }\n\n // Force the value into a string since it may be a number,\n // which does not have a length property.\n charCountEl.text(String(element.val() || value || '').length + '/' + maxlength);\n return value;\n }\n }\n}\nmdMaxlengthDirective.$inject = [\"$animate\", \"$mdUtil\"];\n\nfunction placeholderDirective($log) {\n return {\n restrict: 'A',\n require: '^^?mdInputContainer',\n priority: 200,\n link: postLink\n };\n\n function postLink(scope, element, attr, inputContainer) {\n // If there is no input container, just return\n if (!inputContainer) return;\n\n var label = inputContainer.element.find('label');\n var hasNoFloat = angular.isDefined(inputContainer.element.attr('md-no-float'));\n\n // If we have a label, or they specify the md-no-float attribute, just return\n if ((label && label.length) || hasNoFloat) {\n // Add a placeholder class so we can target it in the CSS\n inputContainer.setHasPlaceholder(true);\n return;\n }\n\n // Otherwise, grab/remove the placeholder\n var placeholderText = attr.placeholder;\n element.removeAttr('placeholder');\n\n // And add the placeholder text as a separate label\n if (inputContainer.input && inputContainer.input[0].nodeName != 'MD-SELECT') {\n var placeholder = '<label ng-click=\"delegateClick()\">' + placeholderText + '</label>';\n\n inputContainer.element.addClass('md-icon-float');\n inputContainer.element.prepend(placeholder);\n }\n }\n}\nplaceholderDirective.$inject = [\"$log\"];\n\n/**\n * @ngdoc directive\n * @name mdSelectOnFocus\n * @module material.components.input\n *\n * @restrict A\n *\n * @description\n * The `md-select-on-focus` directive allows you to automatically select the element's input text on focus.\n *\n * <h3>Notes</h3>\n * - The use of `md-select-on-focus` is restricted to `<input>` and `<textarea>` elements.\n *\n * @usage\n * <h3>Using with an Input</h3>\n * <hljs lang=\"html\">\n *\n * <md-input-container>\n * <label>Auto Select</label>\n * <input type=\"text\" md-select-on-focus>\n * </md-input-container>\n * </hljs>\n *\n * <h3>Using with a Textarea</h3>\n * <hljs lang=\"html\">\n *\n * <md-input-container>\n * <label>Auto Select</label>\n * <textarea md-select-on-focus>This text will be selected on focus.</textarea>\n * </md-input-container>\n *\n * </hljs>\n */\nfunction mdSelectOnFocusDirective() {\n\n return {\n restrict: 'A',\n link: postLink\n };\n\n function postLink(scope, element, attr) {\n if (element[0].nodeName !== 'INPUT' && element[0].nodeName !== \"TEXTAREA\") return;\n\n element.on('focus', onFocus);\n\n scope.$on('$destroy', function() {\n element.off('focus', onFocus);\n });\n\n function onFocus() {\n // Use HTMLInputElement#select to fix firefox select issues\n element[0].select();\n }\n }\n}\n\nvar visibilityDirectives = ['ngIf', 'ngShow', 'ngHide', 'ngSwitchWhen', 'ngSwitchDefault'];\nfunction ngMessagesDirective() {\n return {\n restrict: 'EA',\n link: postLink,\n\n // This is optional because we don't want target *all* ngMessage instances, just those inside of\n // mdInputContainer.\n require: '^^?mdInputContainer'\n };\n\n function postLink(scope, element, attrs, inputContainer) {\n // If we are not a child of an input container, don't do anything\n if (!inputContainer) return;\n\n // Add our animation class\n element.toggleClass('md-input-messages-animation', true);\n\n // Add our md-auto-hide class to automatically hide/show messages when container is invalid\n element.toggleClass('md-auto-hide', true);\n\n // If we see some known visibility directives, remove the md-auto-hide class\n if (attrs.mdAutoHide == 'false' || hasVisibiltyDirective(attrs)) {\n element.toggleClass('md-auto-hide', false);\n }\n }\n\n function hasVisibiltyDirective(attrs) {\n return visibilityDirectives.some(function(attr) {\n return attrs[attr];\n });\n }\n}\n\nfunction ngMessageDirective($mdUtil) {\n return {\n restrict: 'EA',\n compile: compile,\n priority: 100\n };\n\n function compile(element) {\n var inputContainer = $mdUtil.getClosest(element, \"md-input-container\");\n\n // If we are not a child of an input container, don't do anything\n if (!inputContainer) return;\n\n // Add our animation class\n element.toggleClass('md-input-message-animation', true);\n\n return {};\n }\n}\nngMessageDirective.$inject = [\"$mdUtil\"];\n\nfunction mdInputInvalidMessagesAnimation($q, $animateCss) {\n return {\n addClass: function(element, className, done) {\n var messages = getMessagesElement(element);\n\n if (className == \"md-input-invalid\" && messages.hasClass('md-auto-hide')) {\n showInputMessages(element, $animateCss, $q).finally(done);\n } else {\n done();\n }\n }\n\n // NOTE: We do not need the removeClass method, because the message ng-leave animation will fire\n }\n}\nmdInputInvalidMessagesAnimation.$inject = [\"$q\", \"$animateCss\"];\n\nfunction ngMessagesAnimation($q, $animateCss) {\n return {\n enter: function(element, done) {\n showInputMessages(element, $animateCss, $q).finally(done);\n },\n\n leave: function(element, done) {\n hideInputMessages(element, $animateCss, $q).finally(done);\n },\n\n addClass: function(element, className, done) {\n if (className == \"ng-hide\") {\n hideInputMessages(element, $animateCss, $q).finally(done);\n } else {\n done();\n }\n },\n\n removeClass: function(element, className, done) {\n if (className == \"ng-hide\") {\n showInputMessages(element, $animateCss, $q).finally(done);\n } else {\n done();\n }\n }\n }\n}\nngMessagesAnimation.$inject = [\"$q\", \"$animateCss\"];\n\nfunction ngMessageAnimation($animateCss) {\n return {\n enter: function(element, done) {\n var messages = getMessagesElement(element);\n\n // If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip\n if (messages.hasClass('md-auto-hide')) {\n done();\n return;\n }\n\n return showMessage(element, $animateCss);\n },\n\n leave: function(element, done) {\n return hideMessage(element, $animateCss);\n }\n }\n}\nngMessageAnimation.$inject = [\"$animateCss\"];\n\nfunction showInputMessages(element, $animateCss, $q) {\n var animators = [], animator;\n var messages = getMessagesElement(element);\n\n angular.forEach(messages.children(), function(child) {\n animator = showMessage(angular.element(child), $animateCss);\n\n animators.push(animator.start());\n });\n\n return $q.all(animators);\n}\n\nfunction hideInputMessages(element, $animateCss, $q) {\n var animators = [], animator;\n var messages = getMessagesElement(element);\n\n angular.forEach(messages.children(), function(child) {\n animator = hideMessage(angular.element(child), $animateCss);\n\n animators.push(animator.start());\n });\n\n return $q.all(animators);\n}\n\nfunction showMessage(element, $animateCss) {\n var height = element[0].offsetHeight;\n\n return $animateCss(element, {\n event: 'enter',\n structural: true,\n from: {\"opacity\": 0, \"margin-top\": -height + \"px\"},\n to: {\"opacity\": 1, \"margin-top\": \"0\"},\n duration: 0.3\n });\n}\n\nfunction hideMessage(element, $animateCss) {\n var height = element[0].offsetHeight;\n var styles = window.getComputedStyle(element[0]);\n\n // If we are already hidden, just return an empty animation\n if (styles.opacity == 0) {\n return $animateCss(element, {});\n }\n\n // Otherwise, animate\n return $animateCss(element, {\n event: 'leave',\n structural: true,\n from: {\"opacity\": 1, \"margin-top\": 0},\n to: {\"opacity\": 0, \"margin-top\": -height + \"px\"},\n duration: 0.3\n });\n}\n\nfunction getInputElement(element) {\n var inputContainer = element.controller('mdInputContainer');\n\n return inputContainer.element;\n}\n\nfunction getMessagesElement(element) {\n var input = getInputElement(element);\n var selector = 'ng-messages,data-ng-messages,x-ng-messages,' +\n '[ng-messages],[data-ng-messages],[x-ng-messages]';\n\n return angular.element(input[0].querySelector(selector));\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.list\n * @description\n * List module\n */\nangular.module('material.components.list', [\n 'material.core'\n])\n .controller('MdListController', MdListController)\n .directive('mdList', mdListDirective)\n .directive('mdListItem', mdListItemDirective);\n\n/**\n * @ngdoc directive\n * @name mdList\n * @module material.components.list\n *\n * @restrict E\n *\n * @description\n * The `<md-list>` directive is a list container for 1..n `<md-list-item>` tags.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-list>\n * <md-list-item class=\"md-2-line\" ng-repeat=\"item in todos\">\n * <md-checkbox ng-model=\"item.done\"></md-checkbox>\n * <div class=\"md-list-item-text\">\n * <h3>{{item.title}}</h3>\n * <p>{{item.description}}</p>\n * </div>\n * </md-list-item>\n * </md-list>\n * </hljs>\n */\n\nfunction mdListDirective($mdTheming) {\n return {\n restrict: 'E',\n compile: function(tEl) {\n tEl[0].setAttribute('role', 'list');\n return $mdTheming;\n }\n };\n}\nmdListDirective.$inject = [\"$mdTheming\"];\n/**\n * @ngdoc directive\n * @name mdListItem\n * @module material.components.list\n *\n * @restrict E\n *\n * @description\n * The `<md-list-item>` directive is a container intended for row items in a `<md-list>` container.\n * The `md-2-line` and `md-3-line` classes can be added to a `<md-list-item>` \n * to increase the height with 22px and 40px respectively.\n *\n * ## CSS\n * `.md-avatar` - class for image avatars\n *\n * `.md-avatar-icon` - class for icon avatars\n *\n * `.md-offset` - on content without an avatar\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-list>\n * <md-list-item>\n * <img class=\"md-avatar\" ng-src=\"path/to/img\"/>\n * <span>Item content in list</span>\n * </md-list-item>\n * <md-list-item>\n * <md-icon class=\"md-avatar-icon\" md-svg-icon=\"communication:phone\"></md-icon>\n * <span>Item content in list</span>\n * </md-list-item>\n * </md-list>\n * </hljs>\n *\n * _**Note:** We automatically apply special styling when the inner contents are wrapped inside\n * of a `<md-button>` tag. This styling is automatically ignored for `class=\"md-secondary\"` buttons\n * and you can include a class of `class=\"md-exclude\"` if you need to use a non-secondary button\n * that is inside the list, but does not wrap the contents._\n */\nfunction mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) {\n var proxiedTypes = ['md-checkbox', 'md-switch'];\n return {\n restrict: 'E',\n controller: 'MdListController',\n compile: function(tEl, tAttrs) {\n // Check for proxy controls (no ng-click on parent, and a control inside)\n var secondaryItem = tEl[0].querySelector('.md-secondary');\n var hasProxiedElement;\n var proxyElement;\n\n tEl[0].setAttribute('role', 'listitem');\n\n if (tAttrs.ngClick || tAttrs.ngHref || tAttrs.href || tAttrs.uiSref || tAttrs.ngAttrUiSref) {\n wrapIn('button');\n } else {\n for (var i = 0, type; type = proxiedTypes[i]; ++i) {\n if (proxyElement = tEl[0].querySelector(type)) {\n hasProxiedElement = true;\n break;\n }\n }\n if (hasProxiedElement) {\n wrapIn('div');\n } else if (!tEl[0].querySelector('md-button:not(.md-secondary):not(.md-exclude)')) {\n tEl.addClass('md-no-proxy');\n }\n }\n wrapSecondary();\n setupToggleAria();\n\n\n function setupToggleAria() {\n var toggleTypes = ['md-switch', 'md-checkbox'];\n var toggle;\n\n for (var i = 0, toggleType; toggleType = toggleTypes[i]; ++i) {\n if (toggle = tEl.find(toggleType)[0]) {\n if (!toggle.hasAttribute('aria-label')) {\n var p = tEl.find('p')[0];\n if (!p) return;\n toggle.setAttribute('aria-label', 'Toggle ' + p.textContent);\n }\n }\n }\n }\n\n function wrapIn(type) {\n var container;\n if (type == 'div') {\n container = angular.element('<div class=\"md-no-style md-list-item-inner\">');\n container.append(tEl.contents());\n tEl.addClass('md-proxy-focus');\n } else {\n container = angular.element('<md-button class=\"md-no-style\"><div class=\"md-list-item-inner\"></div></md-button>');\n copyAttributes(tEl[0], container[0]);\n container.children().eq(0).append(tEl.contents());\n }\n\n tEl[0].setAttribute('tabindex', '-1');\n tEl.append(container);\n }\n\n function wrapSecondary() {\n if (secondaryItem && !isButton(secondaryItem) && secondaryItem.hasAttribute('ng-click')) {\n $mdAria.expect(secondaryItem, 'aria-label');\n var buttonWrapper = angular.element('<md-button class=\"md-secondary-container md-icon-button\">');\n copyAttributes(secondaryItem, buttonWrapper[0]);\n secondaryItem.setAttribute('tabindex', '-1');\n secondaryItem.classList.remove('md-secondary');\n buttonWrapper.append(secondaryItem);\n secondaryItem = buttonWrapper[0];\n }\n\n // Check for a secondary item and move it outside\n if ( secondaryItem && (\n secondaryItem.hasAttribute('ng-click') ||\n ( tAttrs.ngClick &&\n isProxiedElement(secondaryItem) )\n )) {\n tEl.addClass('md-with-secondary');\n tEl.append(secondaryItem);\n }\n }\n\n function copyAttributes(item, wrapper) {\n var copiedAttrs = ['ng-if', 'ng-click', 'aria-label', 'ng-disabled',\n 'ui-sref', 'href', 'ng-href', 'ng-attr-ui-sref'];\n angular.forEach(copiedAttrs, function(attr) {\n if (item.hasAttribute(attr)) {\n wrapper.setAttribute(attr, item.getAttribute(attr));\n item.removeAttribute(attr);\n }\n });\n }\n\n function isProxiedElement(el) {\n return proxiedTypes.indexOf(el.nodeName.toLowerCase()) != -1;\n }\n\n function isButton(el) {\n var nodeName = el.nodeName.toUpperCase();\n\n return nodeName == \"MD-BUTTON\" || nodeName == \"BUTTON\";\n }\n\n return postLink;\n\n function postLink($scope, $element, $attr, ctrl) {\n\n var proxies = [],\n firstChild = $element[0].firstElementChild,\n hasClick = firstChild && hasClickEvent(firstChild);\n\n computeProxies();\n computeClickable();\n\n if ($element.hasClass('md-proxy-focus') && proxies.length) {\n angular.forEach(proxies, function(proxy) {\n proxy = angular.element(proxy);\n\n $scope.mouseActive = false;\n proxy.on('mousedown', function() {\n $scope.mouseActive = true;\n $timeout(function(){\n $scope.mouseActive = false;\n }, 100);\n })\n .on('focus', function() {\n if ($scope.mouseActive === false) { $element.addClass('md-focused'); }\n proxy.on('blur', function proxyOnBlur() {\n $element.removeClass('md-focused');\n proxy.off('blur', proxyOnBlur);\n });\n });\n });\n }\n\n function hasClickEvent (element) {\n var attr = element.attributes;\n for (var i = 0; i < attr.length; i++) {\n if ($attr.$normalize(attr[i].name) === 'ngClick') return true;\n }\n return false;\n }\n\n function computeProxies() {\n var children = $element.children();\n if (children.length && !children[0].hasAttribute('ng-click')) {\n angular.forEach(proxiedTypes, function(type) {\n angular.forEach(firstChild.querySelectorAll(type), function(child) {\n proxies.push(child);\n });\n });\n }\n }\n function computeClickable() {\n if (proxies.length == 1 || hasClick) {\n $element.addClass('md-clickable');\n\n if (!hasClick) {\n ctrl.attachRipple($scope, angular.element($element[0].querySelector('.md-no-style')));\n }\n }\n }\n\n var firstChildKeypressListener = function(e) {\n if (e.target.nodeName != 'INPUT' && e.target.nodeName != 'TEXTAREA' && !e.target.isContentEditable) {\n var keyCode = e.which || e.keyCode;\n if (keyCode == $mdConstant.KEY_CODE.SPACE) {\n if (firstChild) {\n firstChild.click();\n e.preventDefault();\n e.stopPropagation();\n }\n }\n }\n };\n\n if (!hasClick && !proxies.length) {\n firstChild && firstChild.addEventListener('keypress', firstChildKeypressListener);\n }\n\n $element.off('click');\n $element.off('keypress');\n\n if (proxies.length == 1 && firstChild) {\n $element.children().eq(0).on('click', function(e) {\n var parentButton = $mdUtil.getClosest(e.target, 'BUTTON');\n if (!parentButton && firstChild.contains(e.target)) {\n angular.forEach(proxies, function(proxy) {\n if (e.target !== proxy && !proxy.contains(e.target)) {\n angular.element(proxy).triggerHandler('click');\n }\n });\n }\n });\n }\n\n $scope.$on('$destroy', function () {\n firstChild && firstChild.removeEventListener('keypress', firstChildKeypressListener);\n });\n }\n }\n };\n}\nmdListItemDirective.$inject = [\"$mdAria\", \"$mdConstant\", \"$mdUtil\", \"$timeout\"];\n\n/*\n * @private\n * @ngdoc controller\n * @name MdListController\n * @module material.components.list\n *\n */\nfunction MdListController($scope, $element, $mdListInkRipple) {\n var ctrl = this;\n ctrl.attachRipple = attachRipple;\n\n function attachRipple (scope, element) {\n var options = {};\n $mdListInkRipple.attach(scope, element, options);\n }\n}\nMdListController.$inject = [\"$scope\", \"$element\", \"$mdListInkRipple\"];\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.menu\n */\n\nangular.module('material.components.menu', [\n 'material.core',\n 'material.components.backdrop'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.menu-bar\n */\n\nangular.module('material.components.menuBar', [\n 'material.core',\n 'material.components.menu'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.panel\n */\nangular\n .module('material.components.panel', [\n 'material.core',\n 'material.components.backdrop'\n ])\n .service('$mdPanel', MdPanelService);\n\n\n/*****************************************************************************\n * PUBLIC DOCUMENTATION *\n *****************************************************************************/\n\n/**\n * @ngdoc service\n * @name $mdPanel\n * @module material.components.panel\n *\n * @description\n * `$mdPanel` is a robust, low-level service for creating floating panels on\n * the screen. It can be used to implement tooltips, dialogs, pop-ups, etc.\n *\n * @usage\n * <hljs lang=\"js\">\n * (function(angular, undefined) {\n * ‘use strict’;\n *\n * angular\n * .module('demoApp', ['ngMaterial'])\n * .controller('DemoDialogController', DialogController);\n *\n * var panelRef;\n *\n * function showPanel($event) {\n * var panelPosition = $mdPanelPosition\n * .absolute()\n * .top('50%')\n * .left('50%');\n *\n * var panelAnimation = $mdPanelAnimation\n * .targetEvent($event)\n * .defaultAnimation('md-panel-animate-fly')\n * .closeTo('.show-button');\n *\n * var config = {\n * attachTo: angular.element(document.body),\n * controller: DialogController,\n * controllerAs: 'ctrl',\n * position: panelPosition,\n * animation: panelAnimation,\n * targetEvent: $event,\n * template: 'dialog-template.html',\n * clickOutsideToClose: true,\n * escapeToClose: true,\n * focusOnOpen: true\n * }\n * panelRef = $mdPanel.create(config);\n * panelRef.open()\n * .finally(function() {\n * panelRef = undefined;\n * });\n * }\n *\n * function DialogController(MdPanelRef, toppings) {\n * var toppings;\n *\n * function closeDialog() {\n * MdPanelRef.close();\n * }\n * }\n * })(angular);\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdPanel#create\n * @description\n * Creates a panel with the specified options.\n *\n * @param opt_config {Object=} Specific configuration object that may contain\n * the following properties:\n *\n * - `template` - `{string=}`: HTML template to show in the dialog. This\n * **must** be trusted HTML with respect to Angular’s\n * [$sce service](https://docs.angularjs.org/api/ng/service/$sce).\n * - `templateUrl` - `{string=}`: The URL that will be used as the content of\n * the panel.\n * - `controller` - `{(function|string)=}`: The controller to associate with\n * the panel. The controller can inject a reference to the returned\n * panelRef, which allows the panel to be closed, hidden, and shown. Any\n * fields passed in through locals or resolve will be bound to the\n * controller.\n * - `controllerAs` - `{string=}`: An alias to assign the controller to on\n * the scope.\n * - `bindToController` - `{boolean=}`: Binds locals to the controller\n * instead of passing them in. Defaults to true, as this is a best\n * practice.\n * - `locals` - `{Object=}`: An object containing key/value pairs. The keys\n * will be used as names of values to inject into the controller. For\n * example, `locals: {three: 3}` would inject `three` into the controller,\n * with the value 3.\n * - `resolve` - `{Object=}`: Similar to locals, except it takes promises as\n * values. The panel will not open until all of the promises resolve.\n * - `attachTo` - `{(string|!angular.JQLite|!Element)=}`: The element to\n * attach the panel to. Defaults to appending to the root element of the\n * application.\n * - `panelClass` - `{string=}`: A css class to apply to the panel element.\n * This class should define any borders, box-shadow, etc. for the panel.\n * - `zIndex` - `{number=}`: The z-index to place the panel at.\n * Defaults to 80.\n * - `position` - `{MdPanelPosition=}`: An MdPanelPosition object that\n * specifies the alignment of the panel. For more information, see\n * `MdPanelPosition`.\n * - `clickOutsideToClose` - `{boolean=}`: Whether the user can click\n * outside the panel to close it. Defaults to false.\n * - `escapeToClose` - `{boolean=}`: Whether the user can press escape to\n * close the panel. Defaults to false.\n * - `trapFocus` - `{boolean=}`: Whether focus should be trapped within the\n * panel. If `trapFocus` is true, the user will not be able to interact\n * with the rest of the page until the panel is dismissed. Defaults to\n * false.\n * - `focusOnOpen` - `{boolean=}`: An option to override focus behavior on\n * open. Only disable if focusing some other way, as focus management is\n * required for panels to be accessible. Defaults to true.\n * - `fullscreen` - `{boolean=}`: Whether the panel should be full screen.\n * Applies the class `._md-panel-fullscreen` to the panel on open. Defaults\n * to false.\n * - `animation` - `{MdPanelAnimation=}`: An MdPanelAnimation object that\n * specifies the animation of the panel. For more information, see\n * `MdPanelAnimation`.\n * - `hasBackdrop` - `{boolean=}`: Whether there should be an opaque backdrop\n * behind the panel. Defaults to false.\n * - `disableParentScroll` - `{boolean=}`: Whether the user can scroll the\n * page behind the panel. Defaults to false.\n * - `onDomAdded` - `{function=}`: Callback function used to announce when\n * the panel is added to the DOM.\n * - `onOpenComplete` - `{function=}`: Callback function used to announce\n * when the open() action is finished.\n * - `onRemoving` - `{function=}`: Callback function used to announce the\n * close/hide() action is starting.\n * - `onDomRemoved` - `{function=}`: Callback function used to announce when the\n * panel is removed from the DOM.\n * - `origin` - `{(string|!angular.JQLite|!Element)=}`: The element to\n * focus on when the panel closes. This is commonly the element which triggered\n * the opening of the panel.\n *\n * TODO(ErinCoughlan): Add the following config options.\n * - `groupName` - `{string=}`: Name of panel groups. This group name is\n * used for configuring the number of open panels and identifying specific\n * behaviors for groups. For instance, all tooltips will be identified\n * using the same groupName.\n *\n * @returns {MdPanelRef} panelRef\n */\n\n\n/**\n * @ngdoc method\n * @name $mdPanel#open\n * @description\n * Calls the create method above, then opens the panel. This is a shortcut for\n * creating and then calling open manually. If custom methods need to be\n * called when the panel is added to the DOM or opened, do not use this method.\n * Instead create the panel, chain promises on the domAdded and openComplete\n * methods, and call open from the returned panelRef.\n *\n * @param {Object=} opt_config Specific configuration object that may contain\n * the properties defined in `$mdPanel.create`.\n *\n * @returns {angular.$q.Promise<MdPanelRef>} panelRef A promise that resolves\n * to an instance of the panel.\n */\n\n\n/**\n * @ngdoc method\n * @name $mdPanel#setGroupMaxOpen\n * @description\n * Sets the maximum number of panels in a group that can be opened at a given\n * time.\n *\n * @param groupName {string} The name of the group to configure.\n * @param maxOpen {number} The max number of panels that can be opened.\n */\n\n\n/**\n * @ngdoc method\n * @name $mdPanel#newPanelPosition\n * @description\n * Returns a new instance of the MdPanelPosition object. Use this to create\n * the position config object.\n *\n * @returns {MdPanelPosition} panelPosition\n */\n\n\n/**\n * @ngdoc method\n * @name $mdPanel#newPanelAnimation\n * @description\n * Returns a new instance of the MdPanelAnimation object. Use this to create\n * the animation config object.\n *\n * @returns {MdPanelAnimation} panelAnimation\n */\n\n\n/*****************************************************************************\n * MdPanelRef *\n *****************************************************************************/\n\n\n/**\n * @ngdoc type\n * @name MdPanelRef\n * @module material.components.panel\n * @description\n * A reference to a created panel. This reference contains a unique id for the\n * panel, along with the following properties:\n * - `id` - `{string}: The unique id for the panel. This id is used to track\n * when a panel was interacted with.\n * - `config` - `{Object=}`: The entire config object that was used in\n * create.\n * - `isAttached` - `{boolean}`: Whether the panel is attached to the DOM.\n * Visibility to the user does not factor into isAttached.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#open\n * @description\n * Attaches and shows the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel is\n * opened.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#close\n * @description\n * Hides and detaches the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel is\n * closed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#attach\n * @description\n * Create the panel elements and attach them to the DOM. The panel will be\n * hidden by default.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel is\n * attached.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#detach\n * @description\n * Removes the panel from the DOM. This will NOT hide the panel before removing it.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel is\n * detached.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#show\n * @description\n * Shows the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel has\n * shown and animations are completed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#hide\n * @description\n * Hides the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel has\n * hidden and animations are completed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#destroy\n * @description\n * Destroys the panel. The panel cannot be opened again after this is called.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#addClass\n * @description\n * Adds a class to the panel. DO NOT use this to hide/show the panel.\n *\n * @param {string} newClass Class to be added.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#removeClass\n * @description\n * Removes a class from the panel. DO NOT use this to hide/show the panel.\n *\n * @param {string} oldClass Class to be removed.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#toggleClass\n * @description\n * Toggles a class on the panel. DO NOT use this to hide/show the panel.\n *\n * @param {string} toggleClass Class to be toggled.\n */\n\n/**\n * @ngdoc method\n * @name MdPanelRef#focusOnOpen\n * @description\n * Focuses the panel content if the focusOnOpen config value is true.\n */\n\n\n/*****************************************************************************\n * MdPanelPosition *\n *****************************************************************************/\n\n\n/**\n * @ngdoc type\n * @name MdPanelPosition\n * @module material.components.panel\n * @description\n * Object for configuring the position of the panel. Examples:\n *\n * Centering the panel:\n * `new MdPanelPosition().absolute().center();`\n *\n * Overlapping the panel with an element:\n * `new MdPanelPosition()\n * .relativeTo(someElement)\n * .addPanelPosition($mdPanel.xPosition.ALIGN_START, $mdPanel.yPosition.ALIGN_TOPS);`\n *\n * Aligning the panel with the bottom of an element:\n * `new MdPanelPosition()\n * .relativeTo(someElement)\n * .addPanelPosition($mdPanel.xPosition.CENTER, $mdPanel.yPosition.BELOW);\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#absolute\n * @description\n * Positions the panel absolutely relative to the parent element. If the parent\n * is document.body, this is equivalent to positioning the panel absolutely\n * within the viewport.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#relativeTo\n * @description\n * Positions the panel relative to a specific element.\n * @param {string|!Element|!angular.JQLite} element Query selector,\n * DOM element, or angular element to position the panel with respect to.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#top\n * @description\n * Sets the value of `top` for the panel. Clears any previously set\n * vertical position.\n * @param {string=} opt_top Value of `top`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#bottom\n * @description\n * Sets the value of `bottom` for the panel. Clears any previously set\n * vertical position.\n * @param {string=} opt_bottom Value of `bottom`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#left\n * @description\n * Sets the value of `left` for the panel. Clears any previously set\n * horizontal position.\n * @param {string=} opt_left Value of `left`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#right\n * @description\n * Sets the value of `right` for the panel. Clears any previously set\n * horizontal position.\n * @param {string=} opt_right Value of `right`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#centerHorizontally\n * @description\n * Centers the panel horizontally in the viewport. Clears any previously set\n * horizontal position.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#centerVertically\n * @description\n * Centers the panel vertically in the viewport. Clears any previously set\n * vertical position.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#center\n * @description\n * Centers the panel horizontally and vertically in the viewport. This is\n * equivalent to calling both `centerHorizontally` and `centerVertically`.\n * Clears any previously set horizontal and vertical positions.\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#addPanelPosition\n * @param {string} xPosition\n * @param {string} yPosition\n * @description\n * Sets the x and y position for the panel relative to another element. Can be\n * called multiple times to specify an ordered list of panel positions. The\n * first position which allows the panel to be completely on-screen will be\n * chosen; the last position will be chose whether it is on-screen or not.\n *\n * xPosition must be one of the following values available on\n * $mdPanel.xPosition:\n *\n * CENTER | ALIGN_START | ALIGN_END | OFFSET_START | OFFSET_END\n *\n * *************\n * * *\n * * PANEL *\n * * *\n * *************\n * A B C D E\n *\n * A: OFFSET_START (for LTR displays)\n * B: ALIGN_START (for LTR displays)\n * C: CENTER\n * D: ALIGN_END (for LTR displays)\n * E: OFFSET_END (for LTR displays)\n *\n * yPosition must be one of the following values available on\n * $mdPanel.yPosition:\n *\n * CENTER | ALIGN_TOPS | ALIGN_BOTTOMS | ABOVE | BELOW\n *\n * F\n * G *************\n * * *\n * H * PANEL *\n * * *\n * I *************\n * J\n *\n * F: BELOW\n * G: ALIGN_TOPS\n * H: CENTER\n * I: ALIGN_BOTTOMS\n * J: ABOVE\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#withOffsetX\n * @description\n * Sets the value of the offset in the x-direction.\n * @param {string} offsetX\n * @returns {MdPanelPosition}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelPosition#withOffsetY\n * @description\n * Sets the value of the offset in the y-direction.\n * @param {string} offsetY\n * @returns {MdPanelPosition}\n */\n\n\n/*****************************************************************************\n * MdPanelAnimation *\n *****************************************************************************/\n\n\n/**\n * @ngdoc object\n * @name MdPanelAnimation\n * @description\n * Animation configuration object. To use, create an MdPanelAnimation with the\n * desired properties, then pass the object as part of $mdPanel creation.\n *\n * Example:\n *\n * var panelAnimation = new MdPanelAnimation()\n * .openFrom(myButtonEl)\n * .closeTo('.my-button')\n * .withAnimation($mdPanel.animation.SCALE);\n *\n * $mdPanel.create({\n * animation: panelAnimation\n * });\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#openFrom\n * @description\n * Specifies where to start the open animation. `openFrom` accepts a\n * click event object, query selector, DOM element, or a Rect object that\n * is used to determine the bounds. When passed a click event, the location\n * of the click will be used as the position to start the animation.\n *\n * @param {string|!Element|!Event|{top: number, left: number}}\n * @returns {MdPanelAnimation}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#closeTo\n * @description\n * Specifies where to animate the dialog close. `closeTo` accepts a\n * query selector, DOM element, or a Rect object that is used to determine\n * the bounds.\n *\n * @param {string|!Element|{top: number, left: number}}\n * @returns {MdPanelAnimation}\n */\n\n/**\n * @ngdoc method\n * @name MdPanelAnimation#withAnimation\n * @description\n * Specifies the animation class.\n *\n * There are several default animations that can be used:\n * ($mdPanel.animation)\n * SLIDE: The panel slides in and out from the specified\n * elements. It will not fade in or out.\n * SCALE: The panel scales in and out. Slide and fade are\n * included in this animation.\n * FADE: The panel fades in and out.\n *\n * Custom classes will by default fade in and out unless\n * \"transition: opacity 1ms\" is added to the to custom class.\n *\n * @param {string|{open: string, close: string}} cssClass\n * @returns {MdPanelAnimation}\n */\n\n\n/*****************************************************************************\n * IMPLEMENTATION *\n *****************************************************************************/\n\n\n// Default z-index for the panel.\nvar defaultZIndex = 80;\nvar MD_PANEL_HIDDEN = '_md-panel-hidden';\n\nvar FOCUS_TRAP_TEMPLATE = angular.element(\n '<div class=\"_md-panel-focus-trap\" tabindex=\"0\"></div>');\n\n\n/**\n * A service that is used for controlling/displaying panels on the screen.\n * @param {!angular.JQLite} $rootElement\n * @param {!angular.Scope} $rootScope\n * @param {!angular.$injector} $injector\n * @param {!angular.$window} $window\n * @final @constructor @ngInject\n */\nfunction MdPanelService($rootElement, $rootScope, $injector, $window) {\n /**\n * Default config options for the panel.\n * Anything angular related needs to be done later. Therefore\n * scope: $rootScope.$new(true),\n * attachTo: $rootElement,\n * are added later.\n * @private {!Object}\n */\n this._defaultConfigOptions = {\n bindToController: true,\n clickOutsideToClose: false,\n disableParentScroll: false,\n escapeToClose: false,\n focusOnOpen: true,\n fullscreen: false,\n hasBackdrop: false,\n transformTemplate: angular.bind(this, this._wrapTemplate),\n trapFocus: false,\n zIndex: defaultZIndex\n };\n\n /** @private {!Object} */\n this._config = {};\n\n /** @private @const */\n this._$rootElement = $rootElement;\n\n /** @private @const */\n this._$rootScope = $rootScope;\n\n /** @private @const */\n this._$injector = $injector;\n\n /** @private @const */\n this._$window = $window;\n\n\n /**\n * Default animations that can be used within the panel.\n * @type {enum}\n */\n this.animation = MdPanelAnimation.animation;\n\n /**\n * Possible values of xPosition for positioning the panel relative to\n * another element.\n * @type {enum}\n */\n this.xPosition = MdPanelPosition.xPosition;\n\n /**\n * Possible values of yPosition for positioning the panel relative to\n * another element.\n * @type {enum}\n */\n this.yPosition = MdPanelPosition.yPosition;\n}\nMdPanelService.$inject = [\"$rootElement\", \"$rootScope\", \"$injector\", \"$window\"];\n\n\n/**\n * Creates a panel with the specified options.\n * @param {!Object=} opt_config Configuration object for the panel.\n * @returns {!MdPanelRef}\n */\nMdPanelService.prototype.create = function(opt_config) {\n var configSettings = opt_config || {};\n\n this._config = {\n scope: this._$rootScope.$new(true),\n attachTo: this._$rootElement\n };\n angular.extend(this._config, this._defaultConfigOptions, configSettings);\n\n var instanceId = 'panel_' + this._$injector.get('$mdUtil').nextUid();\n var instanceConfig = angular.extend({ id: instanceId }, this._config);\n\n return new MdPanelRef(instanceConfig, this._$injector);\n};\n\n\n/**\n * Creates and opens a panel with the specified options.\n * @param {!Object=} opt_config Configuration object for the panel.\n * @returns {!angular.$q.Promise<MdPanelRef>} The panel created from create.\n */\nMdPanelService.prototype.open = function(opt_config) {\n var panelRef = this.create(opt_config);\n return panelRef.open().then(function() {\n return panelRef;\n });\n};\n\n\n/**\n * Returns a new instance of the MdPanelPosition. Use this to create the\n * positioning object.\n *\n * @returns {MdPanelPosition}\n */\nMdPanelService.prototype.newPanelPosition = function() {\n return new MdPanelPosition(this._$window);\n};\n\n\n/**\n * Returns a new instance of the MdPanelAnimation. Use this to create the\n * animation object.\n *\n * @returns {MdPanelAnimation}\n */\nMdPanelService.prototype.newPanelAnimation = function() {\n return new MdPanelAnimation(this._$injector);\n};\n\n\n/**\n * Wraps the users template in two elements, md-panel-outer-wrapper, which\n * covers the entire attachTo element, and md-panel, which contains only the\n * template. This allows the panel control over positioning, animations,\n * and similar properties.\n *\n * @param {string} origTemplate The original template.\n * @returns {string} The wrapped template.\n * @private\n */\nMdPanelService.prototype._wrapTemplate = function(origTemplate) {\n var template = origTemplate || '';\n\n // The panel should be initially rendered offscreen so we can calculate\n // height and width for positioning.\n return '' +\n '<div class=\"md-panel-outer-wrapper\">' +\n ' <div class=\"md-panel\" style=\"left: -9999px;\">' + template + '</div>' +\n '</div>';\n};\n\n\n/*****************************************************************************\n * MdPanelRef *\n *****************************************************************************/\n\n\n/**\n * A reference to a created panel. This reference contains a unique id for the\n * panel, along with properties/functions used to control the panel.\n *\n * @param {!Object} config\n * @param {!angular.$injector} $injector\n * @final @constructor\n */\nfunction MdPanelRef(config, $injector) {\n // Injected variables.\n /** @private @const {!angular.$q} */\n this._$q = $injector.get('$q');\n\n /** @private @const {!angular.$mdCompiler} */\n this._$mdCompiler = $injector.get('$mdCompiler');\n\n /** @private @const {!angular.$mdConstant} */\n this._$mdConstant = $injector.get('$mdConstant');\n\n /** @private @const {!angular.$mdUtil} */\n this._$mdUtil = $injector.get('$mdUtil');\n\n /** @private @const {!angular.Scope} */\n this._$rootScope = $injector.get('$rootScope');\n\n /** @private @const {!angular.$animate} */\n this._$animate = $injector.get('$animate');\n\n /** @private @const {!MdPanelRef} */\n this._$mdPanel = $injector.get('$mdPanel');\n\n /** @private @const {!angular.$log} */\n this._$log = $injector.get('$log');\n\n /** @private @const {!angular.$window} */\n this._$window = $injector.get('$window');\n\n /** @private @const {!Function} */\n this._$$rAF = $injector.get('$$rAF');\n\n // Public variables.\n /**\n * Unique id for the panelRef.\n * @type {string}\n */\n this.id = config.id;\n\n /**\n * Whether the panel is attached. This is synchronous. When attach is called,\n * isAttached is set to true. When detach is called, isAttached is set to\n * false.\n * @type {boolean}\n */\n this.isAttached = false;\n\n // Private variables.\n /** @private {!Object} */\n this._config = config;\n\n /** @private {!angular.JQLite|undefined} */\n this._panelContainer;\n\n /** @private {!angular.JQLite|undefined} */\n this._panelEl;\n\n /** @private {Array<function()>} */\n this._removeListeners = [];\n\n /** @private {!angular.JQLite|undefined} */\n this._topFocusTrap;\n\n /** @private {!angular.JQLite|undefined} */\n this._bottomFocusTrap;\n\n /** @private {!$mdPanel|undefined} */\n this._backdropRef;\n\n /** @private {Function?} */\n this._restoreScroll = null;\n}\n\n\n/**\n * Opens an already created and configured panel. If the panel is already\n * visible, does nothing.\n *\n * @returns {!angular.$q.Promise<MdPanelRef>} A promise that is resolved when\n * the panel is opened and animations finish.\n */\nMdPanelRef.prototype.open = function() {\n var self = this;\n return this._$q(function(resolve, reject) {\n var done = self._done(resolve, self);\n var show = self._simpleBind(self.show, self);\n\n self.attach()\n .then(show)\n .then(done)\n .catch(reject);\n });\n};\n\n\n/**\n * Closes the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel is\n * closed and animations finish.\n */\nMdPanelRef.prototype.close = function() {\n var self = this;\n\n return this._$q(function(resolve, reject) {\n var done = self._done(resolve, self);\n var detach = self._simpleBind(self.detach, self);\n\n self.hide()\n .then(detach)\n .then(done)\n .catch(reject);\n });\n};\n\n\n/**\n * Attaches the panel. The panel will be hidden afterwards.\n *\n * @returns {!angular.$q.Promise<MdPanelRef>} A promise that is resolved when\n * the panel is attached.\n */\nMdPanelRef.prototype.attach = function() {\n if (this.isAttached && this._panelEl) {\n return this._$q.when(this);\n }\n\n var self = this;\n return this._$q(function(resolve, reject) {\n var done = self._done(resolve, self);\n var onDomAdded = self._config['onDomAdded'] || angular.noop;\n var addListeners = function(response) {\n self.isAttached = true;\n self._addEventListeners();\n return response;\n };\n\n self._$q.all([\n self._createBackdrop(),\n self._createPanel()\n .then(addListeners)\n .catch(reject)\n ]).then(onDomAdded)\n .then(done)\n .catch(reject);\n });\n};\n\n\n/**\n * Only detaches the panel. Will NOT hide the panel first.\n *\n * @returns {!angular.$q.Promise<MdPanelRef>} A promise that is resolved when the panel is\n * detached.\n */\nMdPanelRef.prototype.detach = function() {\n if (!this.isAttached) {\n return this._$q.when(this);\n }\n\n var self = this;\n var onDomRemoved = self._config['onDomRemoved'] || angular.noop;\n\n var detachFn = function() {\n self._removeEventListeners();\n\n // Remove the focus traps that we added earlier for keeping focus within\n // the panel.\n if (self._topFocusTrap && self._topFocusTrap.parentNode) {\n self._topFocusTrap.parentNode.removeChild(self._topFocusTrap);\n }\n\n if (self._bottomFocusTrap && self._bottomFocusTrap.parentNode) {\n self._bottomFocusTrap.parentNode.removeChild(self._bottomFocusTrap);\n }\n\n self._panelContainer.remove();\n self.isAttached = false;\n return self._$q.when(self);\n };\n\n if (this._restoreScroll) {\n this._restoreScroll();\n this._restoreScroll = null;\n }\n\n return this._$q(function(resolve, reject) {\n var done = self._done(resolve, self);\n\n self._$q.all([\n detachFn(),\n self._backdropRef ? self._backdropRef.detach() : true\n ]).then(onDomRemoved)\n .then(done)\n .catch(reject);\n });\n};\n\n\n/**\n * Destroys the panel. The Panel cannot be opened again after this.\n */\nMdPanelRef.prototype.destroy = function() {\n this._config.locals = null;\n};\n\n\n/**\n * Shows the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel has\n * shown and animations finish.\n */\nMdPanelRef.prototype.show = function() {\n if (!this._panelContainer) {\n return this._$q(function(resolve, reject) {\n reject('Panel does not exist yet. Call open() or attach().');\n });\n }\n\n if (!this._panelContainer.hasClass(MD_PANEL_HIDDEN)) {\n return this._$q.when(this);\n }\n\n var self = this;\n var animatePromise = function() {\n self.removeClass(MD_PANEL_HIDDEN);\n return self._animateOpen();\n };\n\n return this._$q(function(resolve, reject) {\n var done = self._done(resolve, self);\n var onOpenComplete = self._config['onOpenComplete'] || angular.noop;\n\n self._$q.all([\n self._backdropRef ? self._backdropRef.show() : self,\n animatePromise().then(function() { self._focusOnOpen(); }, reject)\n ]).then(onOpenComplete)\n .then(done)\n .catch(reject);\n });\n};\n\n\n/**\n * Hides the panel.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel has\n * hidden and animations finish.\n */\nMdPanelRef.prototype.hide = function() {\n if (!this._panelContainer) {\n return this._$q(function(resolve, reject) {\n reject('Panel does not exist yet. Call open() or attach().');\n });\n }\n\n if (this._panelContainer.hasClass(MD_PANEL_HIDDEN)) {\n return this._$q.when(this);\n }\n\n var self = this;\n\n return this._$q(function(resolve, reject) {\n var done = self._done(resolve, self);\n var onRemoving = self._config['onRemoving'] || angular.noop;\n\n var focusOnOrigin = function() {\n var origin = self._config['origin'];\n if (origin) {\n getElement(origin).focus();\n }\n };\n\n var hidePanel = function() {\n self.addClass(MD_PANEL_HIDDEN);\n };\n\n self._$q.all([\n self._backdropRef ? self._backdropRef.hide() : self,\n self._animateClose()\n .then(onRemoving)\n .then(hidePanel)\n .then(focusOnOrigin)\n .catch(reject)\n ]).then(done, reject);\n });\n};\n\n\n/**\n * Add a class to the panel. DO NOT use this to hide/show the panel.\n *\n * @param {string} newClass Class to be added.\n */\nMdPanelRef.prototype.addClass = function(newClass) {\n if (!this._panelContainer) {\n throw new Error('Panel does not exist yet. Call open() or attach().');\n }\n\n if (!this._panelContainer.hasClass(newClass)) {\n this._panelContainer.addClass(newClass);\n }\n};\n\n\n/**\n * Remove a class from the panel. DO NOT use this to hide/show the panel.\n *\n * @param {string} oldClass Class to be removed.\n */\nMdPanelRef.prototype.removeClass = function(oldClass) {\n if (!this._panelContainer) {\n throw new Error('Panel does not exist yet. Call open() or attach().');\n }\n\n if (this._panelContainer.hasClass(oldClass)) {\n this._panelContainer.removeClass(oldClass);\n }\n};\n\n\n/**\n * Toggle a class on the panel. DO NOT use this to hide/show the panel.\n *\n * @param {string} toggleClass The class to toggle.\n */\nMdPanelRef.prototype.toggleClass = function(toggleClass) {\n if (!this._panelContainer) {\n throw new Error('Panel does not exist yet. Call open() or attach().');\n }\n\n this._panelContainer.toggleClass(toggleClass);\n};\n\n\n/**\n * Creates a panel and adds it to the dom.\n *\n * @returns {!angular.$q.Promise} A promise that is resolved when the panel is\n * created.\n * @private\n */\nMdPanelRef.prototype._createPanel = function() {\n var self = this;\n\n return this._$q(function(resolve, reject) {\n if (!self._config.locals) {\n self._config.locals = {};\n }\n\n self._config.locals.mdPanelRef = self;\n self._$mdCompiler.compile(self._config)\n .then(function(compileData) {\n self._panelContainer = compileData.link(self._config['scope']);\n getElement(self._config['attachTo']).append(self._panelContainer);\n\n if (self._config['disableParentScroll']) {\n self._restoreScroll = self._$mdUtil.disableScrollAround(\n null, self._panelContainer);\n }\n\n self._panelEl = angular.element(\n self._panelContainer[0].querySelector('.md-panel'));\n\n // Add a custom CSS class.\n if (self._config['panelClass']) {\n self._panelEl.addClass(self._config['panelClass']);\n }\n\n // Panel may be outside the $rootElement, tell ngAnimate to animate\n // regardless.\n if (self._$animate.pin) {\n self._$animate.pin(self._panelContainer,\n getElement(self._config['attachTo']));\n }\n\n self._configureTrapFocus();\n self._addStyles().then(function() {\n resolve(self);\n }, reject);\n }, reject);\n });\n};\n\n\n/**\n * Adds the styles for the panel, such as positioning and z-index.\n * @return {!angular.$q.Promise<MdPanelRef>}\n * @private\n */\nMdPanelRef.prototype._addStyles = function() {\n var self = this;\n return this._$q(function(resolve) {\n self._panelContainer.css('z-index', self._config['zIndex']);\n self._panelEl.css('z-index', self._config['zIndex'] + 1);\n\n var hideAndResolve = function() {\n // Remove left: -9999px and add hidden class.\n self._panelEl.css('left', '');\n self._panelContainer.addClass(MD_PANEL_HIDDEN);\n resolve(self);\n };\n\n if (self._config['fullscreen']) {\n self._panelEl.addClass('_md-panel-fullscreen');\n hideAndResolve();\n return; // Don't setup positioning.\n }\n\n var positionConfig = self._config['position'];\n if (!positionConfig) {\n hideAndResolve();\n return; // Don't setup positioning.\n }\n\n // Wait for angular to finish processing the template, then position it\n // correctly. This is necessary so that the panel will have a defined height\n // and width.\n self._$rootScope['$$postDigest'](function() {\n self._updatePosition(true);\n resolve(self);\n });\n });\n};\n\n\n/**\n * Calculates and updates the position of the panel.\n * @param {boolean=} opt_init\n * @private\n */\nMdPanelRef.prototype._updatePosition = function(opt_init) {\n var positionConfig = this._config['position'];\n\n if (positionConfig) {\n positionConfig._setPanelPosition(this._panelEl);\n \n // Hide the panel now that position is known.\n if (opt_init) {\n this._panelContainer.addClass(MD_PANEL_HIDDEN);\n }\n \n this._panelEl.css('top', positionConfig.getTop());\n this._panelEl.css('bottom', positionConfig.getBottom());\n this._panelEl.css('left', positionConfig.getLeft());\n this._panelEl.css('right', positionConfig.getRight());\n\n // Use the vendor prefixed version of transform.\n var prefixedTransform = this._$mdConstant.CSS.TRANSFORM;\n this._panelEl.css(prefixedTransform, positionConfig.getTransform());\n }\n};\n\n\n/**\n * Focuses on the panel or the first focus target.\n * @private\n */\nMdPanelRef.prototype._focusOnOpen = function() {\n if (this._config['focusOnOpen']) {\n // Wait for the template to finish rendering to guarantee md-autofocus has\n // finished adding the class _md-autofocus, otherwise the focusable element\n // isn't available to focus.\n var self = this;\n this._$rootScope['$$postDigest'](function() {\n var target = self._$mdUtil.findFocusTarget(self._panelEl) ||\n self._panelEl;\n target.focus();\n });\n }\n};\n\n\n/**\n * Shows the backdrop.\n * @returns {!angular.$q.Promise} A promise that is resolved when the backdrop\n * is created and attached.\n * @private\n */\nMdPanelRef.prototype._createBackdrop = function() {\n if (this._config.hasBackdrop) {\n if (!this._backdropRef) {\n var backdropAnimation = this._$mdPanel.newPanelAnimation()\n .openFrom(this._config.attachTo)\n .withAnimation({\n open: '_md-opaque-enter',\n close: '_md-opaque-leave'\n });\n var backdropConfig = {\n animation: backdropAnimation,\n attachTo: this._config.attachTo,\n focusOnOpen: false,\n panelClass: '_md-panel-backdrop',\n zIndex: this._config.zIndex - 1\n };\n this._backdropRef = this._$mdPanel.create(backdropConfig);\n }\n if (!this._backdropRef.isAttached) {\n return this._backdropRef.attach();\n }\n }\n};\n\n\n/**\n * Listen for escape keys and outside clicks to auto close.\n * @private\n */\nMdPanelRef.prototype._addEventListeners = function() {\n this._configureEscapeToClose();\n this._configureClickOutsideToClose();\n this._configureScrollListener();\n};\n\n\n/**\n * Remove event listeners added in _addEventListeners.\n * @private\n */\nMdPanelRef.prototype._removeEventListeners = function() {\n this._removeListeners && this._removeListeners.forEach(function(removeFn) {\n removeFn();\n });\n this._removeListeners = null;\n};\n\n\n/**\n * Setup the escapeToClose event listeners.\n * @private\n */\nMdPanelRef.prototype._configureEscapeToClose = function() {\n if (this._config['escapeToClose']) {\n var parentTarget = getElement(this._config['attachTo']);\n var self = this;\n\n var keyHandlerFn = function(ev) {\n if (ev.keyCode === self._$mdConstant.KEY_CODE.ESCAPE) {\n ev.stopPropagation();\n ev.preventDefault();\n\n self.close();\n }\n };\n\n // Add keydown listeners\n this._panelContainer.on('keydown', keyHandlerFn);\n parentTarget.on('keydown', keyHandlerFn);\n\n // Queue remove listeners function\n this._removeListeners.push(function() {\n self._panelContainer.off('keydown', keyHandlerFn);\n parentTarget.off('keydown', keyHandlerFn);\n });\n }\n};\n\n\n/**\n * Setup the clickOutsideToClose event listeners.\n * @private\n */\nMdPanelRef.prototype._configureClickOutsideToClose = function() {\n if (this._config['clickOutsideToClose']) {\n var target = this._panelContainer;\n var sourceElem;\n\n // Keep track of the element on which the mouse originally went down\n // so that we can only close the backdrop when the 'click' started on it.\n // A simple 'click' handler does not work,\n // it sets the target object as the element the mouse went down on.\n var mousedownHandler = function(ev) {\n sourceElem = ev.target;\n };\n\n // We check if our original element and the target is the backdrop\n // because if the original was the backdrop and the target was inside the\n // dialog we don't want to dialog to close.\n var self = this;\n var mouseupHandler = function(ev) {\n if (sourceElem === target[0] && ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n self.close();\n }\n };\n\n // Add listeners\n target.on('mousedown', mousedownHandler);\n target.on('mouseup', mouseupHandler);\n\n // Queue remove listeners function\n this._removeListeners.push(function() {\n target.off('mousedown', mousedownHandler);\n target.off('mouseup', mouseupHandler);\n });\n }\n};\n\n\n/**\n * Configures the listeners for updating the panel position on scroll.\n * @private\n*/\nMdPanelRef.prototype._configureScrollListener = function() {\n var updatePosition = angular.bind(this, this._updatePosition);\n var debouncedUpdatePosition = this._$$rAF.throttle(updatePosition);\n var self = this;\n\n var onScroll = function() {\n if (!self._config['disableParentScroll']) {\n debouncedUpdatePosition();\n }\n };\n\n // Add listeners.\n this._$window.addEventListener('scroll', onScroll, true);\n\n // Queue remove listeners function.\n this._removeListeners.push(function() {\n self._$window.removeEventListener('scroll', onScroll, true);\n });\n};\n\n\n/**\n * Setup the focus traps. These traps will wrap focus when tabbing past the\n * panel. When shift-tabbing, the focus will stick in place.\n * @private\n */\nMdPanelRef.prototype._configureTrapFocus = function() {\n // Focus doesn't remain instead of the panel without this.\n this._panelEl.attr('tabIndex', '-1');\n if (this._config['trapFocus']) {\n var element = this._panelEl;\n // Set up elements before and after the panel to capture focus and\n // redirect back into the panel.\n this._topFocusTrap = FOCUS_TRAP_TEMPLATE.clone()[0];\n this._bottomFocusTrap = FOCUS_TRAP_TEMPLATE.clone()[0];\n\n // When focus is about to move out of the panel, we want to intercept it\n // and redirect it back to the panel element.\n var focusHandler = function() {\n element.focus();\n };\n this._topFocusTrap.addEventListener('focus', focusHandler);\n this._bottomFocusTrap.addEventListener('focus', focusHandler);\n\n // Queue remove listeners function\n this._removeListeners.push(this._simpleBind(function() {\n this._topFocusTrap.removeEventListener('focus', focusHandler);\n this._bottomFocusTrap.removeEventListener('focus', focusHandler);\n }, this));\n\n // The top focus trap inserted immediately before the md-panel element (as\n // a sibling). The bottom focus trap inserted immediately after the\n // md-panel element (as a sibling).\n element[0].parentNode.insertBefore(this._topFocusTrap, element[0]);\n element.after(this._bottomFocusTrap);\n }\n};\n\n\n/**\n * Animate the panel opening.\n * @returns {!angular.$q.Promise}\n * @private\n */\nMdPanelRef.prototype._animateOpen = function() {\n this.addClass('md-panel-is-showing');\n var animationConfig = this._config['animation'];\n if (!animationConfig) {\n // Promise is in progress, return it.\n this.addClass('_md-panel-shown');\n return this._$q.when(this);\n }\n\n var self = this;\n return this._$q(function(resolve) {\n var done = self._done(resolve, self);\n var warnAndOpen = function() {\n self._$log.warn(\n 'MdPanel Animations failed. Showing panel without animating.');\n done();\n };\n\n animationConfig.animateOpen(self._panelEl)\n .then(done, warnAndOpen);\n });\n};\n\n\n/**\n * Animate the panel closing.\n * @returns {!angular.$q.Promise}\n * @private\n */\nMdPanelRef.prototype._animateClose = function() {\n var animationConfig = this._config['animation'];\n if (!animationConfig) {\n this.removeClass('md-panel-is-showing');\n this.removeClass('_md-panel-shown');\n return this._$q.when(this);\n }\n\n var self = this;\n return this._$q(function(resolve) {\n var done = function() {\n self.removeClass('md-panel-is-showing');\n resolve(self);\n };\n var warnAndClose = function() {\n self._$log.warn(\n 'MdPanel Animations failed. Hiding panel without animating.');\n done();\n };\n\n animationConfig.animateClose(self._panelEl)\n .then(done, warnAndClose);\n });\n};\n\n\n/**\n * Faster, more basic than angular.bind\n * http://jsperf.com/angular-bind-vs-custom-vs-native\n * @param {function} callback\n * @param {!Object} self\n * @return {function} Callback function with a bound self.\n */\nMdPanelRef.prototype._simpleBind = function(callback, self) {\n return function(value) {\n return callback.apply(self, value);\n };\n};\n\n\n/**\n * @param {function} callback\n * @param {!Object} self\n * @return {function} Callback function with a self param.\n */\nMdPanelRef.prototype._done = function(callback, self) {\n return function() {\n callback(self);\n };\n};\n\n\n/*****************************************************************************\n * MdPanelPosition *\n *****************************************************************************/\n\n\n/**\n * Position configuration object. To use, create an MdPanelPosition with the\n * desired properties, then pass the object as part of $mdPanel creation.\n *\n * Example:\n *\n * var panelPosition = new MdPanelPosition()\n * .relativeTo(myButtonEl)\n * .addPanelPosition($mdPanel.xPosition.CENTER, $mdPanel.yPosition.ALIGN_TOPS);\n *\n * $mdPanel.create({\n * position: panelPosition\n * });\n *\n * @param {!angular.$window} $window\n * @final @constructor\n */\nfunction MdPanelPosition($window) {\n /** @private @const */\n this._$window = $window;\n\n /** @private {boolean} */\n this._absolute = false;\n\n /** @private {!angular.JQLite} */\n this._relativeToEl;\n\n /** @private {string} */\n this._top = '';\n\n /** @private {string} */\n this._bottom = '';\n\n /** @private {string} */\n this._left = '';\n\n /** @private {string} */\n this._right = '';\n\n /** @private {!Array<string>} */\n this._translateX = [];\n\n /** @private {!Array<string>} */\n this._translateY = [];\n\n /** @private {!Array<{x:string, y:string}>} */\n this._positions = [];\n\n /** @private {?{x:string, y:string}} */\n this._actualPosition;\n}\n\n\n/**\n * Possible values of xPosition.\n * @enum {string}\n */\nMdPanelPosition.xPosition = {\n CENTER: 'center',\n ALIGN_START: 'align-start',\n ALIGN_END: 'align-end',\n OFFSET_START: 'offset-start',\n OFFSET_END: 'offset-end'\n};\n\n\n/**\n * Possible values of yPosition.\n * @enum {string}\n */\nMdPanelPosition.yPosition = {\n CENTER: 'center',\n ALIGN_TOPS: 'align-tops',\n ALIGN_BOTTOMS: 'align-bottoms',\n ABOVE: 'above',\n BELOW: 'below'\n};\n\n\n/**\n * Sets absolute positioning for the panel.\n * @return {!MdPanelPosition}\n */\nMdPanelPosition.prototype.absolute = function() {\n this._absolute = true;\n return this;\n};\n\n\n/**\n * Sets the value of `top` for the panel. Clears any previously set vertical\n * position.\n * @param {string=} opt_top Value of `top`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.top = function(opt_top) {\n this._bottom = '';\n this._top = opt_top || '0';\n return this;\n};\n\n\n/**\n * Sets the value of `bottom` for the panel. Clears any previously set vertical\n * position.\n * @param {string=} opt_bottom Value of `bottom`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.bottom = function(opt_bottom) {\n this._top = '';\n this._bottom = opt_bottom || '0';\n return this;\n};\n\n\n/**\n * Sets the value of `left` for the panel. Clears any previously set\n * horizontal position.\n * @param {string=} opt_left Value of `left`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.left = function(opt_left) {\n this._right = '';\n this._left = opt_left || '0';\n return this;\n};\n\n\n/**\n * Sets the value of `right` for the panel. Clears any previously set\n * horizontal position.\n * @param {string=} opt_right Value of `right`. Defaults to '0'.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.right = function(opt_right) {\n this._left = '';\n this._right = opt_right || '0';\n return this;\n};\n\n\n/**\n * Centers the panel horizontally in the viewport. Clears any previously set\n * horizontal position.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.centerHorizontally = function() {\n this._left = '50%';\n this._right = '';\n this._translateX = ['-50%'];\n return this;\n};\n\n\n/**\n * Centers the panel vertically in the viewport. Clears any previously set\n * vertical position.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.centerVertically = function() {\n this._top = '50%';\n this._bottom = '';\n this._translateY = ['-50%'];\n return this;\n};\n\n\n/**\n * Centers the panel horizontally and vertically in the viewport. This is\n * equivalent to calling both `centerHorizontally` and `centerVertically`.\n * Clears any previously set horizontal and vertical positions.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.center = function() {\n return this.centerHorizontally().centerVertically();\n};\n\n\n/**\n * Sets element for relative positioning.\n * @param {string|!Element|!angular.JQLite} element Query selector,\n * DOM element, or angular element to set the panel relative to.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.relativeTo = function(element) {\n this._absolute = false;\n this._relativeToEl = getElement(element);\n return this;\n};\n\n\n/**\n * Sets the x and y positions for the panel relative to another element.\n * @param {string} xPosition must be one of the MdPanelPosition.xPosition values.\n * @param {string} yPosition must be one of the MdPanelPosition.yPosition values.\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.addPanelPosition = function(xPosition, yPosition) {\n if (!this._relativeToEl) {\n throw new Error('addPanelPosition can only be used with relative ' +\n 'positioning. Set relativeTo first.');\n }\n\n this._validateXPosition(xPosition);\n this._validateYPosition(yPosition);\n\n this._positions.push({\n x: xPosition,\n y: yPosition,\n });\n return this;\n};\n\n\n/**\n * Ensure that yPosition is a valid position name. Throw an exception if not.\n * @param {string} yPosition\n */\nMdPanelPosition.prototype._validateYPosition = function(yPosition) {\n // empty is ok\n if (yPosition == null) {\n return;\n }\n\n var positionKeys = Object.keys(MdPanelPosition.yPosition);\n var positionValues = [];\n for (var key, i = 0; key = positionKeys[i]; i++) {\n var position = MdPanelPosition.yPosition[key];\n positionValues.push(position);\n\n if (position === yPosition) {\n return;\n }\n }\n\n throw new Error('Panel y position only accepts the following values:\\n' +\n positionValues.join(' | '));\n};\n\n\n/**\n * Ensure that xPosition is a valid position name. Throw an exception if not.\n * @param {string} xPosition\n */\nMdPanelPosition.prototype._validateXPosition = function(xPosition) {\n // empty is ok\n if (xPosition == null) {\n return;\n }\n\n var positionKeys = Object.keys(MdPanelPosition.xPosition);\n var positionValues = [];\n for (var key, i = 0; key = positionKeys[i]; i++) {\n var position = MdPanelPosition.xPosition[key];\n positionValues.push(position);\n if (position === xPosition) {\n return;\n }\n }\n\n throw new Error('Panel x Position only accepts the following values:\\n' +\n positionValues.join(' | '));\n};\n\n\n/**\n * Sets the value of the offset in the x-direction. This will add\n * to any previously set offsets.\n * @param {string} offsetX\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.withOffsetX = function(offsetX) {\n this._translateX.push(offsetX);\n return this;\n};\n\n\n/**\n * Sets the value of the offset in the y-direction. This will add\n * to any previously set offsets.\n * @param {string} offsetY\n * @returns {MdPanelPosition}\n */\nMdPanelPosition.prototype.withOffsetY = function(offsetY) {\n this._translateY.push(offsetY);\n return this;\n};\n\n\n/**\n * Gets the value of `top` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getTop = function() {\n return this._top;\n};\n\n\n/**\n * Gets the value of `bottom` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getBottom = function() {\n return this._bottom;\n};\n\n\n/**\n * Gets the value of `left` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getLeft = function() {\n return this._left;\n};\n\n\n/**\n * Gets the value of `right` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getRight = function() {\n return this._right;\n};\n\n\n/**\n * Gets the value of `transform` for the panel.\n * @returns {string}\n */\nMdPanelPosition.prototype.getTransform = function() {\n var translateX = this._reduceTranslateValues('translateX', this._translateX);\n var translateY = this._reduceTranslateValues('translateY', this._translateY);\n\n // It's important to trim the result, because the browser will ignore the set\n // operation if the string contains only whitespace.\n return (translateX + ' ' + translateY).trim();\n};\n\n/**\n * True if the panel is completely on-screen with this positioning; false\n * otherwise.\n * @param {!angular.JQLite} panelEl\n * @return {boolean}\n */\nMdPanelPosition.prototype._isOnscreen = function(panelEl) {\n // this works because we always use fixed positioning for the panel,\n // which is relative to the viewport.\n // TODO(gmoothart): take into account _translateX and _translateY to the\n // extent feasible.\n\n var left = parseInt(this.getLeft());\n var top = parseInt(this.getTop());\n var right = left + panelEl[0].offsetWidth;\n var bottom = top + panelEl[0].offsetHeight;\n\n return (left >= 0) &&\n (top >= 0) &&\n (bottom <= this._$window.innerHeight) &&\n (right <= this._$window.innerWidth);\n};\n\n\n/**\n * Gets the first x/y position that can fit on-screen.\n * @returns {{x: string, y: string}}\n */\nMdPanelPosition.prototype.getActualPosition = function() {\n return this._actualPosition;\n};\n\n\n/**\n * Reduces a list of translate values to a string that can be used within\n * transform.\n * @param {string} translateFn\n * @param {!Array<string>} values\n * @returns {string}\n * @private\n */\nMdPanelPosition.prototype._reduceTranslateValues =\n function(translateFn, values) {\n return values.map(function(translation) {\n return translateFn + '(' + translation + ')';\n }).join(' ');\n };\n\n\n/**\n * Sets the panel position based on the created panel element and best x/y\n * positioning.\n * @param {!angular.JQLite} panelEl\n * @private\n */\nMdPanelPosition.prototype._setPanelPosition = function(panelEl) {\n // Only calculate the position if necessary.\n if (this._absolute) {\n return;\n }\n\n // TODO(ErinCoughlan): Position panel intelligently to keep it on screen.\n\n if (this._actualPosition) {\n this._calculatePanelPosition(panelEl, this._actualPosition);\n return;\n }\n\n for (var i = 0; i < this._positions.length; i++) {\n this._actualPosition = this._positions[i];\n this._calculatePanelPosition(panelEl, this._actualPosition);\n if (this._isOnscreen(panelEl)) {\n break;\n }\n }\n};\n\n/**\n * Calculates the panel position based on the created panel element and the\n * provided positioning.\n * @param {!angular.JQLite} panelEl\n * @param {!{x:string, y:string}} position\n * @private\n */\nMdPanelPosition.prototype._calculatePanelPosition = function(panelEl, position) {\n\n var panelBounds = panelEl[0].getBoundingClientRect();\n var panelWidth = panelBounds.width;\n var panelHeight = panelBounds.height;\n\n var targetBounds = this._relativeToEl[0].getBoundingClientRect();\n\n var targetLeft = targetBounds.left;\n var targetRight = targetBounds.right;\n var targetWidth = targetBounds.width;\n\n switch (position.x) {\n case MdPanelPosition.xPosition.OFFSET_START:\n // TODO(ErinCoughlan): Change OFFSET_START for rtl vs ltr.\n this._left = targetLeft - panelWidth + 'px';\n break;\n case MdPanelPosition.xPosition.ALIGN_END:\n // TODO(ErinCoughlan): Change ALIGN_END for rtl vs ltr.\n this._left = targetRight - panelWidth + 'px';\n break;\n case MdPanelPosition.xPosition.CENTER:\n var left = targetLeft + (0.5 * targetWidth) - (0.5 * panelWidth);\n this._left = left + 'px';\n break;\n case MdPanelPosition.xPosition.ALIGN_START:\n // TODO(ErinCoughlan): Change ALIGN_START for rtl vs ltr.\n this._left = targetLeft + 'px';\n break;\n case MdPanelPosition.xPosition.OFFSET_END:\n // TODO(ErinCoughlan): Change OFFSET_END for rtl vs ltr.\n this._left = targetRight + 'px';\n break;\n }\n\n var targetTop = targetBounds.top;\n var targetBottom = targetBounds.bottom;\n var targetHeight = targetBounds.height;\n\n switch (position.y) {\n case MdPanelPosition.yPosition.ABOVE:\n this._top = targetTop - panelHeight + 'px';\n break;\n case MdPanelPosition.yPosition.ALIGN_BOTTOMS:\n this._top = targetBottom - panelHeight + 'px';\n break;\n case MdPanelPosition.yPosition.CENTER:\n var top = targetTop + (0.5 * targetHeight) - (0.5 * panelHeight);\n this._top = top + 'px';\n break;\n case MdPanelPosition.yPosition.ALIGN_TOPS:\n this._top = targetTop + 'px';\n break;\n case MdPanelPosition.yPosition.BELOW:\n this._top = targetBottom + 'px';\n break;\n }\n};\n\n\n/*****************************************************************************\n * MdPanelAnimation *\n *****************************************************************************/\n\n\n/**\n * Animation configuration object. To use, create an MdPanelAnimation with the\n * desired properties, then pass the object as part of $mdPanel creation.\n *\n * Example:\n *\n * var panelAnimation = new MdPanelAnimation()\n * .openFrom(myButtonEl)\n * .closeTo('.my-button')\n * .withAnimation($mdPanel.animation.SCALE);\n *\n * $mdPanel.create({\n * animation: panelAnimation\n * });\n *\n * @param {!angular.$injector} $injector\n * @final @constructor\n */\nfunction MdPanelAnimation($injector) {\n /** @private @const {!angular.$mdUtil} */\n this._$mdUtil = $injector.get('$mdUtil');\n\n /**\n * @private {{element: !angular.JQLite|undefined, bounds: !DOMRect}|\n * undefined}\n */\n this._openFrom;\n\n /**\n * @private {{element: !angular.JQLite|undefined, bounds: !DOMRect}|\n * undefined}\n */\n this._closeTo;\n\n /** @private {string|{open: string, close: string} */\n this._animationClass = '';\n}\n\n\n/**\n * Possible default animations.\n * @enum {string}\n */\nMdPanelAnimation.animation = {\n SLIDE: 'md-panel-animate-slide',\n SCALE: 'md-panel-animate-scale',\n FADE: 'md-panel-animate-fade'\n};\n\n\n/**\n * Specifies where to start the open animation. `openFrom` accepts a\n * click event object, query selector, DOM element, or a Rect object that\n * is used to determine the bounds. When passed a click event, the location\n * of the click will be used as the position to start the animation.\n *\n * @param {string|!Element|!Event|{top: number, left: number}} openFrom\n * @returns {MdPanelAnimation}\n */\nMdPanelAnimation.prototype.openFrom = function(openFrom) {\n // Check if 'openFrom' is an Event.\n openFrom = openFrom.target ? openFrom.target : openFrom;\n\n this._openFrom = this._getPanelAnimationTarget(openFrom);\n\n if (!this._closeTo) {\n this._closeTo = this._openFrom;\n }\n return this;\n};\n\n\n/**\n * Specifies where to animate the dialog close. `closeTo` accepts a\n * query selector, DOM element, or a Rect object that is used to determine\n * the bounds.\n *\n * @param {string|!Element|{top: number, left: number}} closeTo\n * @returns {MdPanelAnimation}\n */\nMdPanelAnimation.prototype.closeTo = function(closeTo) {\n this._closeTo = this._getPanelAnimationTarget(closeTo);\n return this;\n};\n\n\n/**\n * Returns the element and bounds for the animation target.\n * @param {string|!Element|{top: number, left: number}} location\n * @returns {{element: !angular.JQLite|undefined, bounds: !DOMRect}}\n * @private\n */\nMdPanelAnimation.prototype._getPanelAnimationTarget = function(location) {\n if (angular.isDefined(location.top) || angular.isDefined(location.left)) {\n return {\n element: undefined,\n bounds: {\n top: location.top || 0,\n left: location.left || 0\n }\n };\n } else {\n return this._getBoundingClientRect(getElement(location));\n }\n};\n\n\n/**\n * Specifies the animation class.\n *\n * There are several default animations that can be used:\n * (MdPanelAnimation.animation)\n * SLIDE: The panel slides in and out from the specified\n * elements.\n * SCALE: The panel scales in and out.\n * FADE: The panel fades in and out.\n *\n * @param {string|{open: string, close: string}} cssClass\n * @returns {MdPanelAnimation}\n */\n\nMdPanelAnimation.prototype.withAnimation = function(cssClass) {\n this._animationClass = cssClass;\n return this;\n};\n\n\n/**\n * Animate the panel open.\n * @param {!angular.JQLite} panelEl\n * @returns {!angular.$q.Promise}\n */\nMdPanelAnimation.prototype.animateOpen = function(panelEl) {\n var animator = this._$mdUtil.dom.animator;\n\n this._fixBounds(panelEl);\n var animationOptions = {};\n\n // Include the panel transformations when calculating the animations.\n var panelTransform = panelEl[0].style.transform || '';\n\n var openFrom = animator.toTransformCss(panelTransform);\n var openTo = animator.toTransformCss(panelTransform);\n\n switch (this._animationClass) {\n case MdPanelAnimation.animation.SLIDE:\n // Slide should start with opacity: 1.\n panelEl.css('opacity', '1');\n\n animationOptions = {\n transitionInClass: '_md-panel-animate-enter'\n };\n\n var openSlide = animator.calculateSlideToOrigin(\n panelEl, this._openFrom) || '';\n openFrom = animator.toTransformCss(openSlide + ' ' + panelTransform);\n break;\n\n case MdPanelAnimation.animation.SCALE:\n animationOptions = {\n transitionInClass: '_md-panel-animate-enter'\n };\n\n var openScale = animator.calculateZoomToOrigin(\n panelEl, this._openFrom) || '';\n openFrom = animator.toTransformCss(openScale + ' ' + panelTransform);\n break;\n\n case MdPanelAnimation.animation.FADE:\n animationOptions = {\n transitionInClass: '_md-panel-animate-enter'\n };\n break;\n\n default:\n if (angular.isString(this._animationClass)) {\n animationOptions = {\n transitionInClass: this._animationClass\n };\n } else {\n animationOptions = {\n transitionInClass: this._animationClass['open'],\n transitionOutClass: this._animationClass['close'],\n };\n }\n\n // TODO(ErinCoughlan): Combine the user's custom transforms with the\n // panel transform.\n }\n\n return animator\n .translate3d(panelEl, openFrom, openTo, animationOptions);\n};\n\n\n/**\n * Animate the panel close.\n * @param {!angular.JQLite} panelEl\n * @returns {!angular.$q.Promise}\n */\nMdPanelAnimation.prototype.animateClose = function(panelEl) {\n var animator = this._$mdUtil.dom.animator;\n var reverseAnimationOptions = {};\n\n // Include the panel transformations when calculating the animations.\n var panelTransform = panelEl[0].style.transform || '';\n\n var closeFrom = animator.toTransformCss(panelTransform);\n var closeTo = animator.toTransformCss(panelTransform);\n\n switch (this._animationClass) {\n case MdPanelAnimation.animation.SLIDE:\n // Slide should start with opacity: 1.\n panelEl.css('opacity', '1');\n reverseAnimationOptions = {\n transitionInClass: '_md-panel-animate-leave'\n };\n\n var closeSlide = animator.calculateSlideToOrigin(\n panelEl, this._closeTo) || '';\n closeTo = animator.toTransformCss(closeSlide + ' ' + panelTransform);\n break;\n\n case MdPanelAnimation.animation.SCALE:\n reverseAnimationOptions = {\n transitionInClass: '_md-panel-animate-scale-out _md-panel-animate-leave'\n };\n\n var closeScale = animator.calculateZoomToOrigin(\n panelEl, this._closeTo) || '';\n closeTo = animator.toTransformCss(closeScale + ' ' + panelTransform);\n break;\n\n case MdPanelAnimation.animation.FADE:\n reverseAnimationOptions = {\n transitionInClass: '_md-panel-animate-fade-out _md-panel-animate-leave'\n };\n break;\n\n default:\n if (angular.isString(this._animationClass)) {\n reverseAnimationOptions = {\n transitionOutClass: this._animationClass\n };\n } else {\n reverseAnimationOptions = {\n transitionInClass: this._animationClass['close'],\n transitionOutClass: this._animationClass['open']\n };\n }\n\n // TODO(ErinCoughlan): Combine the user's custom transforms with the\n // panel transform.\n }\n\n return animator\n .translate3d(panelEl, closeFrom, closeTo, reverseAnimationOptions);\n};\n\n\n/**\n * Set the height and width to match the panel if not provided.\n * @param {!angular.JQLite} panelEl\n * @private\n */\nMdPanelAnimation.prototype._fixBounds = function(panelEl) {\n var panelWidth = panelEl[0].offsetWidth;\n var panelHeight = panelEl[0].offsetHeight;\n\n if (this._openFrom && this._openFrom.bounds.height == null) {\n this._openFrom.bounds.height = panelHeight;\n }\n if (this._openFrom && this._openFrom.bounds.width == null) {\n this._openFrom.bounds.width = panelWidth;\n }\n if (this._closeTo && this._closeTo.bounds.height == null) {\n this._closeTo.bounds.height = panelHeight;\n }\n if (this._closeTo && this._closeTo.bounds.width == null) {\n this._closeTo.bounds.width = panelWidth;\n }\n};\n\n\n/**\n * Identify the bounding RECT for the target element.\n * @param {!angular.JQLite} element\n * @returns {{element: !angular.JQLite|undefined, bounds: !DOMRect}}\n * @private\n */\nMdPanelAnimation.prototype._getBoundingClientRect = function(element) {\n if (element instanceof angular.element) {\n return {\n element: element,\n bounds: element[0].getBoundingClientRect()\n };\n }\n};\n\n\n/*****************************************************************************\n * Util Methods *\n *****************************************************************************/\n\n/**\n * Returns the angular element associated with a css selector or element.\n * @param el {string|!angular.JQLite|!Element}\n * @returns {!angular.JQLite}\n */\nfunction getElement(el) {\n var queryResult = angular.isString(el) ?\n document.querySelector(el) : el;\n return angular.element(queryResult);\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.progressCircular\n * @description Circular Progress module!\n */\nangular.module('material.components.progressCircular', [\n 'material.core'\n])\n .directive('mdProgressCircular', MdProgressCircularDirective);\n\n/**\n * @ngdoc directive\n * @name mdProgressCircular\n * @module material.components.progressCircular\n * @restrict E\n *\n* @description\n * The circular progress directive is used to make loading content in your app as delightful and\n * painless as possible by minimizing the amount of visual change a user sees before they can view\n * and interact with content.\n *\n * For operations where the percentage of the operation completed can be determined, use a\n * determinate indicator. They give users a quick sense of how long an operation will take.\n *\n * For operations where the user is asked to wait a moment while something finishes up, and it’s\n * not necessary to expose what's happening behind the scenes and how long it will take, use an\n * indeterminate indicator.\n *\n * @param {string} md-mode Select from one of two modes: **'determinate'** and **'indeterminate'**.\n *\n * Note: if the `md-mode` value is set as undefined or specified as not 1 of the two (2) valid modes, then `.ng-hide`\n * will be auto-applied as a style to the component.\n *\n * Note: if not configured, the `md-mode=\"indeterminate\"` will be auto injected as an attribute.\n * If `value=\"\"` is also specified, however, then `md-mode=\"determinate\"` would be auto-injected instead.\n * @param {number=} value In determinate mode, this number represents the percentage of the\n * circular progress. Default: 0\n * @param {number=} md-diameter This specifies the diameter of the circular progress. The value\n * may be a percentage (eg '25%') or a pixel-size value (eg '48'). If this attribute is\n * not present then a default value of '48px' is assumed.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-progress-circular md-mode=\"determinate\" value=\"...\"></md-progress-circular>\n *\n * <md-progress-circular md-mode=\"determinate\" ng-value=\"...\"></md-progress-circular>\n *\n * <md-progress-circular md-mode=\"determinate\" value=\"...\" md-diameter=\"100\"></md-progress-circular>\n *\n * <md-progress-circular md-mode=\"indeterminate\"></md-progress-circular>\n * </hljs>\n */\nfunction MdProgressCircularDirective($mdTheming, $mdUtil, $log) {\n var DEFAULT_PROGRESS_SIZE = 100;\n var DEFAULT_SCALING = 0.5;\n\n var MODE_DETERMINATE = \"determinate\",\n MODE_INDETERMINATE = \"indeterminate\";\n\n\n return {\n restrict: 'E',\n scope : true,\n template:\n // The progress 'circle' is composed of two half-circles: the left side and the right\n // side. Each side has CSS applied to 'fill-in' the half-circle to the appropriate progress.\n '<div class=\"md-scale-wrapper\">' +\n '<div class=\"md-spinner-wrapper\">' +\n '<div class=\"md-inner\">' +\n '<div class=\"md-gap\"></div>' +\n '<div class=\"md-left\">' +\n '<div class=\"md-half-circle\"></div>' +\n '</div>' +\n '<div class=\"md-right\">' +\n '<div class=\"md-half-circle\"></div>' +\n '</div>' +\n '</div>' +\n '</div>' +\n '</div>',\n compile: compile\n };\n\n function compile(tElement) {\n // The javascript in this file is mainly responsible for setting the correct aria attributes.\n // The animation of the progress spinner is done entirely with just CSS.\n tElement.attr('aria-valuemin', 0);\n tElement.attr('aria-valuemax', 100);\n tElement.attr('role', 'progressbar');\n\n return postLink;\n }\n\n function postLink(scope, element, attr) {\n $mdTheming(element);\n\n var circle = element;\n var spinnerWrapper = angular.element(element.children()[0]);\n var lastMode, toVendorCSS = $mdUtil.dom.animator.toCss;\n\n element.attr('md-mode', mode());\n\n updateScale();\n validateMode();\n watchAttributes();\n\n /**\n * Watch the value and md-mode attributes\n */\n function watchAttributes() {\n attr.$observe('value', function(value) {\n var percentValue = clamp(value);\n element.attr('aria-valuenow', percentValue);\n\n if (mode() == MODE_DETERMINATE) {\n animateIndicator(percentValue);\n }\n });\n attr.$observe('mdMode',function(mode){\n switch( mode ) {\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n spinnerWrapper.removeClass('ng-hide');\n if (lastMode) spinnerWrapper.removeClass(lastMode);\n spinnerWrapper.addClass( lastMode = \"md-mode-\" + mode );\n break;\n default:\n if (lastMode) spinnerWrapper.removeClass( lastMode );\n spinnerWrapper.addClass('ng-hide');\n lastMode = undefined;\n break;\n }\n });\n }\n\n /**\n * Update size/scaling of the progress indicator\n * Watch the \"value\" and \"md-mode\" attributes\n */\n function updateScale() {\n // set the outer container to the size the user specified\n circle.css({\n width: (100 * getDiameterRatio()) + 'px',\n height: (100 * getDiameterRatio()) + 'px'\n });\n // the internal element is still 100px, so we have to scale it down to match the size\n circle.children().eq(0).css(toVendorCSS({\n transform : $mdUtil.supplant('translate(-50%, -50%) scale( {0} )',[getDiameterRatio()])\n }));\n }\n\n /**\n * Auto-defaults the mode to either `determinate` or `indeterminate` mode; if not specified\n */\n function validateMode() {\n if ( angular.isUndefined(attr.mdMode) ) {\n var hasValue = angular.isDefined(attr.value);\n var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;\n var info = \"Auto-adding the missing md-mode='{0}' to the ProgressCircular element\";\n\n $log.debug( $mdUtil.supplant(info, [mode]) );\n\n element.attr(\"md-mode\",mode);\n attr['mdMode'] = mode;\n }\n }\n\n var leftC, rightC, gap;\n\n /**\n * Manually animate the Determinate indicator based on the specified\n * percentage value (0-100).\n *\n * Note: this animation was previously done using SCSS.\n * - generated 54K of styles\n * - use attribute selectors which had poor performances in IE\n */\n function animateIndicator(value) {\n if ( !mode() ) return;\n\n leftC = leftC || angular.element(element[0].querySelector('.md-left > .md-half-circle'));\n rightC = rightC || angular.element(element[0].querySelector('.md-right > .md-half-circle'));\n gap = gap || angular.element(element[0].querySelector('.md-gap'));\n\n var gapStyles = removeEmptyValues({\n borderBottomColor: (value <= 50) ? \"transparent !important\" : \"\",\n transition: (value <= 50) ? \"\" : \"borderBottomColor 0.1s linear\"\n }),\n leftStyles = removeEmptyValues({\n transition: (value <= 50) ? \"transform 0.1s linear\" : \"\",\n transform: $mdUtil.supplant(\"rotate({0}deg)\", [value <= 50 ? 135 : (((value - 50) / 50 * 180) + 135)])\n }),\n rightStyles = removeEmptyValues({\n transition: (value >= 50) ? \"transform 0.1s linear\" : \"\",\n transform: $mdUtil.supplant(\"rotate({0}deg)\", [value >= 50 ? 45 : (value / 50 * 180 - 135)])\n });\n\n leftC.css(toVendorCSS(leftStyles));\n rightC.css(toVendorCSS(rightStyles));\n gap.css(toVendorCSS(gapStyles));\n\n }\n\n /**\n * We will scale the progress circle based on the default diameter.\n *\n * Determine the diameter percentage (defaults to 100%)\n * May be express as float, percentage, or integer\n */\n function getDiameterRatio() {\n if ( !attr.mdDiameter ) return DEFAULT_SCALING;\n\n var match = /([0-9]*)%/.exec(attr.mdDiameter);\n var value = Math.max(0, (match && match[1]/100) || parseFloat(attr.mdDiameter));\n\n // should return ratio; DEFAULT_PROGRESS_SIZE === 100px is default size\n return (value > 1) ? value / DEFAULT_PROGRESS_SIZE : value;\n }\n\n /**\n * Is the md-mode a valid option?\n */\n function mode() {\n var value = (attr.mdMode || \"\").trim();\n if ( value ) {\n switch(value) {\n case MODE_DETERMINATE :\n case MODE_INDETERMINATE :\n break;\n default:\n value = undefined;\n break;\n }\n }\n return value;\n }\n\n }\n\n /**\n * Clamps the value to be between 0 and 100.\n * @param {number} value The value to clamp.\n * @returns {number}\n */\n function clamp(value) {\n return Math.max(0, Math.min(value || 0, 100));\n }\n\n function removeEmptyValues(target) {\n for (var key in target) {\n if (target.hasOwnProperty(key)) {\n if ( target[key] == \"\" ) delete target[key];\n }\n }\n\n return target;\n }\n}\nMdProgressCircularDirective.$inject = [\"$mdTheming\", \"$mdUtil\", \"$log\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.progressLinear\n * @description Linear Progress module!\n */\nangular.module('material.components.progressLinear', [\n 'material.core'\n])\n .directive('mdProgressLinear', MdProgressLinearDirective);\n\n/**\n * @ngdoc directive\n * @name mdProgressLinear\n * @module material.components.progressLinear\n * @restrict E\n *\n * @description\n * The linear progress directive is used to make loading content\n * in your app as delightful and painless as possible by minimizing\n * the amount of visual change a user sees before they can view\n * and interact with content.\n *\n * Each operation should only be represented by one activity indicator\n * For example: one refresh operation should not display both a\n * refresh bar and an activity circle.\n *\n * For operations where the percentage of the operation completed\n * can be determined, use a determinate indicator. They give users\n * a quick sense of how long an operation will take.\n *\n * For operations where the user is asked to wait a moment while\n * something finishes up, and it’s not necessary to expose what's\n * happening behind the scenes and how long it will take, use an\n * indeterminate indicator.\n *\n * @param {string} md-mode Select from one of four modes: determinate, indeterminate, buffer or query.\n *\n * Note: if the `md-mode` value is set as undefined or specified as 1 of the four (4) valid modes, then `.ng-hide`\n * will be auto-applied as a style to the component.\n *\n * Note: if not configured, the `md-mode=\"indeterminate\"` will be auto injected as an attribute. If `value=\"\"` is also specified, however,\n * then `md-mode=\"determinate\"` would be auto-injected instead.\n * @param {number=} value In determinate and buffer modes, this number represents the percentage of the primary progress bar. Default: 0\n * @param {number=} md-buffer-value In the buffer mode, this number represents the percentage of the secondary progress bar. Default: 0\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-progress-linear md-mode=\"determinate\" value=\"...\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"determinate\" ng-value=\"...\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"indeterminate\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"buffer\" value=\"...\" md-buffer-value=\"...\"></md-progress-linear>\n *\n * <md-progress-linear md-mode=\"query\"></md-progress-linear>\n * </hljs>\n */\nfunction MdProgressLinearDirective($mdTheming, $mdUtil, $log) {\n var MODE_DETERMINATE = \"determinate\",\n MODE_INDETERMINATE = \"indeterminate\",\n MODE_BUFFER = \"buffer\",\n MODE_QUERY = \"query\";\n\n return {\n restrict: 'E',\n template: '<div class=\"md-container\">' +\n '<div class=\"md-dashed\"></div>' +\n '<div class=\"md-bar md-bar1\"></div>' +\n '<div class=\"md-bar md-bar2\"></div>' +\n '</div>',\n compile: compile\n };\n \n function compile(tElement, tAttrs, transclude) {\n tElement.attr('aria-valuemin', 0);\n tElement.attr('aria-valuemax', 100);\n tElement.attr('role', 'progressbar');\n\n return postLink;\n }\n function postLink(scope, element, attr) {\n $mdTheming(element);\n\n var lastMode, toVendorCSS = $mdUtil.dom.animator.toCss;\n var bar1 = angular.element(element[0].querySelector('.md-bar1')),\n bar2 = angular.element(element[0].querySelector('.md-bar2')),\n container = angular.element(element[0].querySelector('.md-container'));\n\n element.attr('md-mode', mode());\n\n validateMode();\n watchAttributes();\n\n /**\n * Watch the value, md-buffer-value, and md-mode attributes\n */\n function watchAttributes() {\n attr.$observe('value', function(value) {\n var percentValue = clamp(value);\n element.attr('aria-valuenow', percentValue);\n\n if (mode() != MODE_QUERY) animateIndicator(bar2, percentValue);\n });\n\n attr.$observe('mdBufferValue', function(value) {\n animateIndicator(bar1, clamp(value));\n });\n\n attr.$observe('mdMode',function(mode){\n switch( mode ) {\n case MODE_QUERY:\n case MODE_BUFFER:\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n container.removeClass( 'ng-hide' + ' ' + lastMode );\n container.addClass( lastMode = \"md-mode-\" + mode );\n break;\n default:\n if (lastMode) container.removeClass( lastMode );\n container.addClass('ng-hide');\n lastMode = undefined;\n break;\n }\n });\n }\n\n /**\n * Auto-defaults the mode to either `determinate` or `indeterminate` mode; if not specified\n */\n function validateMode() {\n if ( angular.isUndefined(attr.mdMode) ) {\n var hasValue = angular.isDefined(attr.value);\n var mode = hasValue ? MODE_DETERMINATE : MODE_INDETERMINATE;\n var info = \"Auto-adding the missing md-mode='{0}' to the ProgressLinear element\";\n\n $log.debug( $mdUtil.supplant(info, [mode]) );\n\n element.attr(\"md-mode\",mode);\n attr['mdMode'] = mode;\n }\n }\n\n /**\n * Is the md-mode a valid option?\n */\n function mode() {\n var value = (attr.mdMode || \"\").trim();\n if ( value ) {\n switch(value) {\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n case MODE_BUFFER:\n case MODE_QUERY:\n break;\n default:\n value = undefined;\n break;\n }\n }\n return value;\n }\n\n /**\n * Manually set CSS to animate the Determinate indicator based on the specified\n * percentage value (0-100).\n */\n function animateIndicator(target, value) {\n if ( !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }\n }\n\n /**\n * Clamps the value to be between 0 and 100.\n * @param {number} value The value to clamp.\n * @returns {number}\n */\n function clamp(value) {\n return Math.max(0, Math.min(value || 0, 100));\n }\n}\nMdProgressLinearDirective.$inject = [\"$mdTheming\", \"$mdUtil\", \"$log\"];\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.radioButton\n * @description radioButton module!\n */\nangular.module('material.components.radioButton', [\n 'material.core'\n])\n .directive('mdRadioGroup', mdRadioGroupDirective)\n .directive('mdRadioButton', mdRadioButtonDirective);\n\n/**\n * @ngdoc directive\n * @module material.components.radioButton\n * @name mdRadioGroup\n *\n * @restrict E\n *\n * @description\n * The `<md-radio-group>` directive identifies a grouping\n * container for the 1..n grouped radio buttons; specified using nested\n * `<md-radio-button>` tags.\n *\n * As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)\n * the radio button is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * Note: `<md-radio-group>` and `<md-radio-button>` handle tabindex differently\n * than the native `<input type='radio'>` controls. Whereas the native controls\n * force the user to tab through all the radio buttons, `<md-radio-group>`\n * is focusable, and by default the `<md-radio-button>`s are not.\n *\n * @param {string} ng-model Assignable angular expression to data-bind to.\n * @param {boolean=} md-no-ink Use of attribute indicates flag to disable ink ripple effects.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-radio-group ng-model=\"selected\">\n *\n * <md-radio-button\n * ng-repeat=\"d in colorOptions\"\n * ng-value=\"d.value\" aria-label=\"{{ d.label }}\">\n *\n * {{ d.label }}\n *\n * </md-radio-button>\n *\n * </md-radio-group>\n * </hljs>\n *\n */\nfunction mdRadioGroupDirective($mdUtil, $mdConstant, $mdTheming, $timeout) {\n RadioGroupController.prototype = createRadioGroupControllerProto();\n\n return {\n restrict: 'E',\n controller: ['$element', RadioGroupController],\n require: ['mdRadioGroup', '?ngModel'],\n link: { pre: linkRadioGroup }\n };\n\n function linkRadioGroup(scope, element, attr, ctrls) {\n $mdTheming(element);\n var rgCtrl = ctrls[0];\n var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel();\n\n rgCtrl.init(ngModelCtrl);\n\n scope.mouseActive = false;\n element.attr({\n 'role': 'radiogroup',\n 'tabIndex': element.attr('tabindex') || '0'\n })\n .on('keydown', keydownListener)\n .on('mousedown', function(event) {\n scope.mouseActive = true;\n $timeout(function() {\n scope.mouseActive = false;\n }, 100);\n })\n .on('focus', function() {\n if(scope.mouseActive === false) { rgCtrl.$element.addClass('md-focused'); }\n })\n .on('blur', function() { rgCtrl.$element.removeClass('md-focused'); });\n\n /**\n *\n */\n function setFocus() {\n if (!element.hasClass('md-focused')) { element.addClass('md-focused'); }\n }\n\n /**\n *\n */\n function keydownListener(ev) {\n var keyCode = ev.which || ev.keyCode;\n\n // Only listen to events that we originated ourselves\n // so that we don't trigger on things like arrow keys in\n // inputs.\n\n if (keyCode != $mdConstant.KEY_CODE.ENTER &&\n ev.currentTarget != ev.target) {\n return;\n }\n\n switch (keyCode) {\n case $mdConstant.KEY_CODE.LEFT_ARROW:\n case $mdConstant.KEY_CODE.UP_ARROW:\n ev.preventDefault();\n rgCtrl.selectPrevious();\n setFocus();\n break;\n\n case $mdConstant.KEY_CODE.RIGHT_ARROW:\n case $mdConstant.KEY_CODE.DOWN_ARROW:\n ev.preventDefault();\n rgCtrl.selectNext();\n setFocus();\n break;\n\n case $mdConstant.KEY_CODE.ENTER:\n var form = angular.element($mdUtil.getClosest(element[0], 'form'));\n if (form.length > 0) {\n form.triggerHandler('submit');\n }\n break;\n }\n\n }\n }\n\n function RadioGroupController($element) {\n this._radioButtonRenderFns = [];\n this.$element = $element;\n }\n\n function createRadioGroupControllerProto() {\n return {\n init: function(ngModelCtrl) {\n this._ngModelCtrl = ngModelCtrl;\n this._ngModelCtrl.$render = angular.bind(this, this.render);\n },\n add: function(rbRender) {\n this._radioButtonRenderFns.push(rbRender);\n },\n remove: function(rbRender) {\n var index = this._radioButtonRenderFns.indexOf(rbRender);\n if (index !== -1) {\n this._radioButtonRenderFns.splice(index, 1);\n }\n },\n render: function() {\n this._radioButtonRenderFns.forEach(function(rbRender) {\n rbRender();\n });\n },\n setViewValue: function(value, eventType) {\n this._ngModelCtrl.$setViewValue(value, eventType);\n // update the other radio buttons as well\n this.render();\n },\n getViewValue: function() {\n return this._ngModelCtrl.$viewValue;\n },\n selectNext: function() {\n return changeSelectedButton(this.$element, 1);\n },\n selectPrevious: function() {\n return changeSelectedButton(this.$element, -1);\n },\n setActiveDescendant: function (radioId) {\n this.$element.attr('aria-activedescendant', radioId);\n }\n };\n }\n /**\n * Change the radio group's selected button by a given increment.\n * If no button is selected, select the first button.\n */\n function changeSelectedButton(parent, increment) {\n // Coerce all child radio buttons into an array, then wrap then in an iterator\n var buttons = $mdUtil.iterator(parent[0].querySelectorAll('md-radio-button'), true);\n\n if (buttons.count()) {\n var validate = function (button) {\n // If disabled, then NOT valid\n return !angular.element(button).attr(\"disabled\");\n };\n\n var selected = parent[0].querySelector('md-radio-button.md-checked');\n var target = buttons[increment < 0 ? 'previous' : 'next'](selected, validate) || buttons.first();\n\n // Activate radioButton's click listener (triggerHandler won't create a real click event)\n angular.element(target).triggerHandler('click');\n\n\n }\n }\n\n}\nmdRadioGroupDirective.$inject = [\"$mdUtil\", \"$mdConstant\", \"$mdTheming\", \"$timeout\"];\n\n/**\n * @ngdoc directive\n * @module material.components.radioButton\n * @name mdRadioButton\n *\n * @restrict E\n *\n * @description\n * The `<md-radio-button>`directive is the child directive required to be used within `<md-radio-group>` elements.\n *\n * While similar to the `<input type=\"radio\" ng-model=\"\" value=\"\">` directive,\n * the `<md-radio-button>` directive provides ink effects, ARIA support, and\n * supports use within named radio groups.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue Angular expression which sets the value to which the expression should\n * be set when selected.\n * @param {string} value The value to which the expression should be set when selected.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} aria-label Adds label to radio button for accessibility.\n * Defaults to radio button's text. If no text content is available, a warning will be logged.\n *\n * @usage\n * <hljs lang=\"html\">\n *\n * <md-radio-button value=\"1\" aria-label=\"Label 1\">\n * Label 1\n * </md-radio-button>\n *\n * <md-radio-button ng-model=\"color\" ng-value=\"specialValue\" aria-label=\"Green\">\n * Green\n * </md-radio-button>\n *\n * </hljs>\n *\n */\nfunction mdRadioButtonDirective($mdAria, $mdUtil, $mdTheming) {\n\n var CHECKED_CSS = 'md-checked';\n\n return {\n restrict: 'E',\n require: '^mdRadioGroup',\n transclude: true,\n template: '<div class=\"md-container\" md-ink-ripple md-ink-ripple-checkbox>' +\n '<div class=\"md-off\"></div>' +\n '<div class=\"md-on\"></div>' +\n '</div>' +\n '<div ng-transclude class=\"md-label\"></div>',\n link: link\n };\n\n function link(scope, element, attr, rgCtrl) {\n var lastChecked;\n\n $mdTheming(element);\n configureAria(element, scope);\n\n initialize();\n\n /**\n *\n */\n function initialize(controller) {\n if ( !rgCtrl ) {\n throw 'RadioGroupController not found.';\n }\n\n rgCtrl.add(render);\n attr.$observe('value', render);\n\n element\n .on('click', listener)\n .on('$destroy', function() {\n rgCtrl.remove(render);\n });\n }\n\n /**\n *\n */\n function listener(ev) {\n if (element[0].hasAttribute('disabled')) return;\n\n scope.$apply(function() {\n rgCtrl.setViewValue(attr.value, ev && ev.type);\n });\n }\n\n /**\n * Add or remove the `.md-checked` class from the RadioButton (and conditionally its parent).\n * Update the `aria-activedescendant` attribute.\n */\n function render() {\n var checked = (rgCtrl.getViewValue() == attr.value);\n if (checked === lastChecked) {\n return;\n }\n\n lastChecked = checked;\n element.attr('aria-checked', checked);\n\n if (checked) {\n markParentAsChecked(true);\n element.addClass(CHECKED_CSS);\n\n rgCtrl.setActiveDescendant(element.attr('id'));\n\n } else {\n markParentAsChecked(false);\n element.removeClass(CHECKED_CSS);\n }\n\n /**\n * If the radioButton is inside a div, then add class so highlighting will work...\n */\n function markParentAsChecked(addClass ) {\n if ( element.parent()[0].nodeName != \"MD-RADIO-GROUP\") {\n element.parent()[ !!addClass ? 'addClass' : 'removeClass'](CHECKED_CSS);\n }\n\n }\n }\n\n /**\n * Inject ARIA-specific attributes appropriate for each radio button\n */\n function configureAria( element, scope ){\n scope.ariaId = buildAriaID();\n\n element.attr({\n 'id' : scope.ariaId,\n 'role' : 'radio',\n 'aria-checked' : 'false'\n });\n\n $mdAria.expectWithText(element, 'aria-label');\n\n /**\n * Build a unique ID for each radio button that will be used with aria-activedescendant.\n * Preserve existing ID if already specified.\n * @returns {*|string}\n */\n function buildAriaID() {\n return attr.id || ( 'radio' + \"_\" + $mdUtil.nextUid() );\n }\n }\n }\n}\nmdRadioButtonDirective.$inject = [\"$mdAria\", \"$mdUtil\", \"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.select\n */\n\n/***************************************************\n\n ### TODO - POST RC1 ###\n - [ ] Abstract placement logic in $mdSelect service to $mdMenu service\n\n ***************************************************/\n\nvar SELECT_EDGE_MARGIN = 8;\nvar selectNextId = 0;\nvar CHECKBOX_SELECTION_INDICATOR =\n angular.element('<div class=\"md-container\"><div class=\"md-icon\"></div></div>');\n\nangular.module('material.components.select', [\n 'material.core',\n 'material.components.backdrop'\n ])\n .directive('mdSelect', SelectDirective)\n .directive('mdSelectMenu', SelectMenuDirective)\n .directive('mdOption', OptionDirective)\n .directive('mdOptgroup', OptgroupDirective)\n .directive('mdSelectHeader', SelectHeaderDirective)\n .provider('$mdSelect', SelectProvider);\n\n/**\n * @ngdoc directive\n * @name mdSelect\n * @restrict E\n * @module material.components.select\n *\n * @description Displays a select box, bound to an ng-model.\n *\n * @param {expression} ng-model The model!\n * @param {boolean=} multiple Whether it's multiple.\n * @param {expression=} md-on-close Expression to be evaluated when the select is closed.\n * @param {expression=} md-on-open Expression to be evaluated when opening the select.\n * Will hide the select options and show a spinner until the evaluated promise resolves.\n * @param {expression=} md-selected-text Expression to be evaluated that will return a string\n * to be displayed as a placeholder in the select input box when it is closed.\n * @param {string=} placeholder Placeholder hint text.\n * @param {string=} aria-label Optional label for accessibility. Only necessary if no placeholder or\n * explicit label is present.\n * @param {string=} md-container-class Class list to get applied to the `.md-select-menu-container`\n * element (for custom styling).\n *\n * @usage\n * With a placeholder (label and aria-label are added dynamically)\n * <hljs lang=\"html\">\n * <md-input-container>\n * <md-select\n * ng-model=\"someModel\"\n * placeholder=\"Select a state\">\n * <md-option ng-value=\"opt\" ng-repeat=\"opt in neighborhoods2\">{{ opt }}</md-option>\n * </md-select>\n * </md-input-container>\n * </hljs>\n *\n * With an explicit label\n * <hljs lang=\"html\">\n * <md-input-container>\n * <label>State</label>\n * <md-select\n * ng-model=\"someModel\">\n * <md-option ng-value=\"opt\" ng-repeat=\"opt in neighborhoods2\">{{ opt }}</md-option>\n * </md-select>\n * </md-input-container>\n * </hljs>\n *\n * With a select-header\n *\n * When a developer needs to put more than just a text label in the\n * md-select-menu, they should use the md-select-header.\n * The user can put custom HTML inside of the header and style it to their liking.\n * One common use case of this would be a sticky search bar.\n *\n * When using the md-select-header the labels that would previously be added to the\n * OptGroupDirective are ignored.\n *\n * <hljs lang=\"html\">\n * <md-input-container>\n * <md-select ng-model=\"someModel\">\n * <md-select-header>\n * <span> Neighborhoods - </span>\n * </md-select-header>\n * <md-option ng-value=\"opt\" ng-repeat=\"opt in neighborhoods2\">{{ opt }}</md-option>\n * </md-select>\n * </md-input-container>\n * </hljs>\n *\n * ## Selects and object equality\n * When using a `md-select` to pick from a list of objects, it is important to realize how javascript handles\n * equality. Consider the following example:\n * <hljs lang=\"js\">\n * angular.controller('MyCtrl', function($scope) {\n * $scope.users = [\n * { id: 1, name: 'Bob' },\n * { id: 2, name: 'Alice' },\n * { id: 3, name: 'Steve' }\n * ];\n * $scope.selectedUser = { id: 1, name: 'Bob' };\n * });\n * </hljs>\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyCtrl\">\n * <md-select ng-model=\"selectedUser\">\n * <md-option ng-value=\"user\" ng-repeat=\"user in users\">{{ user.name }}</md-option>\n * </md-select>\n * </div>\n * </hljs>\n *\n * At first one might expect that the select should be populated with \"Bob\" as the selected user. However,\n * this is not true. To determine whether something is selected,\n * `ngModelController` is looking at whether `$scope.selectedUser == (any user in $scope.users);`;\n *\n * Javascript's `==` operator does not check for deep equality (ie. that all properties\n * on the object are the same), but instead whether the objects are *the same object in memory*.\n * In this case, we have two instances of identical objects, but they exist in memory as unique\n * entities. Because of this, the select will have no value populated for a selected user.\n *\n * To get around this, `ngModelController` provides a `track by` option that allows us to specify a different\n * expression which will be used for the equality operator. As such, we can update our `html` to\n * make use of this by specifying the `ng-model-options=\"{trackBy: '$value.id'}\"` on the `md-select`\n * element. This converts our equality expression to be\n * `$scope.selectedUser.id == (any id in $scope.users.map(function(u) { return u.id; }));`\n * which results in Bob being selected as desired.\n *\n * Working HTML:\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyCtrl\">\n * <md-select ng-model=\"selectedUser\" ng-model-options=\"{trackBy: '$value.id'}\">\n * <md-option ng-value=\"user\" ng-repeat=\"user in users\">{{ user.name }}</md-option>\n * </md-select>\n * </div>\n * </hljs>\n */\nfunction SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $compile, $parse) {\n return {\n restrict: 'E',\n require: ['^?mdInputContainer', 'mdSelect', 'ngModel', '?^form'],\n compile: compile,\n controller: function() {\n } // empty placeholder controller to be initialized in link\n };\n\n function compile(element, attr) {\n // add the select value that will hold our placeholder or selected option value\n var valueEl = angular.element('<md-select-value><span></span></md-select-value>');\n valueEl.append('<span class=\"md-select-icon\" aria-hidden=\"true\"></span>');\n valueEl.addClass('md-select-value');\n if (!valueEl[0].hasAttribute('id')) {\n valueEl.attr('id', 'select_value_label_' + $mdUtil.nextUid());\n }\n\n // There's got to be an md-content inside. If there's not one, let's add it.\n if (!element.find('md-content').length) {\n element.append(angular.element('<md-content>').append(element.contents()));\n }\n\n\n // Add progress spinner for md-options-loading\n if (attr.mdOnOpen) {\n\n // Show progress indicator while loading async\n // Use ng-hide for `display:none` so the indicator does not interfere with the options list\n element\n .find('md-content')\n .prepend(angular.element(\n '<div>' +\n ' <md-progress-circular md-mode=\"{{progressMode}}\" ng-hide=\"$$loadingAsyncDone\" md-diameter=\"25px\"></md-progress-circular>' +\n '</div>'\n ));\n\n // Hide list [of item options] while loading async\n element\n .find('md-option')\n .attr('ng-show', '$$loadingAsyncDone');\n }\n\n if (attr.name) {\n var autofillClone = angular.element('<select class=\"md-visually-hidden\">');\n autofillClone.attr({\n 'name': '.' + attr.name,\n 'ng-model': attr.ngModel,\n 'aria-hidden': 'true',\n 'tabindex': '-1'\n });\n var opts = element.find('md-option');\n angular.forEach(opts, function(el) {\n var newEl = angular.element('<option>' + el.innerHTML + '</option>');\n if (el.hasAttribute('ng-value')) newEl.attr('ng-value', el.getAttribute('ng-value'));\n else if (el.hasAttribute('value')) newEl.attr('value', el.getAttribute('value'));\n autofillClone.append(newEl);\n });\n\n element.parent().append(autofillClone);\n }\n\n // Use everything that's left inside element.contents() as the contents of the menu\n var multiple = angular.isDefined(attr.multiple) ? 'multiple' : '';\n var selectTemplate = '' +\n '<div class=\"md-select-menu-container\" aria-hidden=\"true\">' +\n '<md-select-menu {0}>{1}</md-select-menu>' +\n '</div>';\n\n selectTemplate = $mdUtil.supplant(selectTemplate, [multiple, element.html()]);\n element.empty().append(valueEl);\n element.append(selectTemplate);\n\n if(!attr.tabindex){\n attr.$set('tabindex', 0);\n }\n\n return function postLink(scope, element, attr, ctrls) {\n var untouched = true;\n var isDisabled, ariaLabelBase;\n\n var containerCtrl = ctrls[0];\n var mdSelectCtrl = ctrls[1];\n var ngModelCtrl = ctrls[2];\n var formCtrl = ctrls[3];\n // grab a reference to the select menu value label\n var valueEl = element.find('md-select-value');\n var isReadonly = angular.isDefined(attr.readonly);\n\n if (containerCtrl) {\n var isErrorGetter = containerCtrl.isErrorGetter || function() {\n return ngModelCtrl.$invalid && ngModelCtrl.$touched;\n };\n\n if (containerCtrl.input) {\n // We ignore inputs that are in the md-select-header (one\n // case where this might be useful would be adding as searchbox)\n if (element.find('md-select-header').find('input')[0] !== containerCtrl.input[0]) {\n throw new Error(\"<md-input-container> can only have *one* child <input>, <textarea> or <select> element!\");\n }\n }\n\n containerCtrl.input = element;\n if (!containerCtrl.label) {\n $mdAria.expect(element, 'aria-label', element.attr('placeholder'));\n }\n\n scope.$watch(isErrorGetter, containerCtrl.setInvalid);\n }\n\n var selectContainer, selectScope, selectMenuCtrl;\n\n findSelectContainer();\n $mdTheming(element);\n\n if (attr.name && formCtrl) {\n var selectEl = element.parent()[0].querySelector('select[name=\".' + attr.name + '\"]');\n $mdUtil.nextTick(function() {\n var controller = angular.element(selectEl).controller('ngModel');\n if (controller) {\n formCtrl.$removeControl(controller);\n }\n });\n }\n\n if (formCtrl && angular.isDefined(attr.multiple)) {\n $mdUtil.nextTick(function() {\n var hasModelValue = ngModelCtrl.$modelValue || ngModelCtrl.$viewValue;\n if (hasModelValue) {\n formCtrl.$setPristine();\n }\n });\n }\n\n var originalRender = ngModelCtrl.$render;\n ngModelCtrl.$render = function() {\n originalRender();\n syncLabelText();\n syncAriaLabel();\n inputCheckValue();\n };\n\n\n attr.$observe('placeholder', ngModelCtrl.$render);\n\n\n mdSelectCtrl.setLabelText = function(text) {\n mdSelectCtrl.setIsPlaceholder(!text);\n\n if (attr.mdSelectedText) {\n text = $parse(attr.mdSelectedText)(scope);\n } else {\n // Use placeholder attribute, otherwise fallback to the md-input-container label\n var tmpPlaceholder = attr.placeholder ||\n (containerCtrl && containerCtrl.label ? containerCtrl.label.text() : '');\n text = text || tmpPlaceholder || '';\n }\n\n var target = valueEl.children().eq(0);\n target.html(text);\n };\n\n mdSelectCtrl.setIsPlaceholder = function(isPlaceholder) {\n if (isPlaceholder) {\n valueEl.addClass('md-select-placeholder');\n if (containerCtrl && containerCtrl.label) {\n containerCtrl.label.addClass('md-placeholder');\n }\n } else {\n valueEl.removeClass('md-select-placeholder');\n if (containerCtrl && containerCtrl.label) {\n containerCtrl.label.removeClass('md-placeholder');\n }\n }\n };\n\n if (!isReadonly) {\n element\n .on('focus', function(ev) {\n // only set focus on if we don't currently have a selected value. This avoids the \"bounce\"\n // on the label transition because the focus will immediately switch to the open menu.\n if (containerCtrl && containerCtrl.element.hasClass('md-input-has-value')) {\n containerCtrl.setFocused(true);\n }\n });\n\n // Attach before ngModel's blur listener to stop propagation of blur event\n // to prevent from setting $touched.\n element.on('blur', function(event) {\n if (untouched) {\n untouched = false;\n if (selectScope.isOpen) {\n event.stopImmediatePropagation();\n }\n }\n\n if (selectScope.isOpen) return;\n containerCtrl && containerCtrl.setFocused(false);\n inputCheckValue();\n });\n }\n\n mdSelectCtrl.triggerClose = function() {\n $parse(attr.mdOnClose)(scope);\n };\n\n scope.$$postDigest(function() {\n initAriaLabel();\n syncLabelText();\n syncAriaLabel();\n });\n\n function initAriaLabel() {\n var labelText = element.attr('aria-label') || element.attr('placeholder');\n if (!labelText && containerCtrl && containerCtrl.label) {\n labelText = containerCtrl.label.text();\n }\n ariaLabelBase = labelText;\n $mdAria.expect(element, 'aria-label', labelText);\n }\n\n scope.$watch(selectMenuCtrl.selectedLabels, syncLabelText);\n\n function syncLabelText() {\n if (selectContainer) {\n selectMenuCtrl = selectMenuCtrl || selectContainer.find('md-select-menu').controller('mdSelectMenu');\n mdSelectCtrl.setLabelText(selectMenuCtrl.selectedLabels());\n }\n }\n\n function syncAriaLabel() {\n if (!ariaLabelBase) return;\n var ariaLabels = selectMenuCtrl.selectedLabels({mode: 'aria'});\n element.attr('aria-label', ariaLabels.length ? ariaLabelBase + ': ' + ariaLabels : ariaLabelBase);\n }\n\n var deregisterWatcher;\n attr.$observe('ngMultiple', function(val) {\n if (deregisterWatcher) deregisterWatcher();\n var parser = $parse(val);\n deregisterWatcher = scope.$watch(function() {\n return parser(scope);\n }, function(multiple, prevVal) {\n if (multiple === undefined && prevVal === undefined) return; // assume compiler did a good job\n if (multiple) {\n element.attr('multiple', 'multiple');\n } else {\n element.removeAttr('multiple');\n }\n element.attr('aria-multiselectable', multiple ? 'true' : 'false');\n if (selectContainer) {\n selectMenuCtrl.setMultiple(multiple);\n originalRender = ngModelCtrl.$render;\n ngModelCtrl.$render = function() {\n originalRender();\n syncLabelText();\n syncAriaLabel();\n inputCheckValue();\n };\n ngModelCtrl.$render();\n }\n });\n });\n\n attr.$observe('disabled', function(disabled) {\n if (angular.isString(disabled)) {\n disabled = true;\n }\n // Prevent click event being registered twice\n if (isDisabled !== undefined && isDisabled === disabled) {\n return;\n }\n isDisabled = disabled;\n if (disabled) {\n element\n .attr({'aria-disabled': 'true'})\n .removeAttr('tabindex')\n .off('click', openSelect)\n .off('keydown', handleKeypress);\n } else {\n element\n .attr({'tabindex': attr.tabindex, 'aria-disabled': 'false'})\n .on('click', openSelect)\n .on('keydown', handleKeypress);\n }\n });\n\n if (!attr.hasOwnProperty('disabled') && !attr.hasOwnProperty('ngDisabled')) {\n element.attr({'aria-disabled': 'false'});\n element.on('click', openSelect);\n element.on('keydown', handleKeypress);\n }\n\n var ariaAttrs = {\n role: 'listbox',\n 'aria-expanded': 'false',\n 'aria-multiselectable': attr.multiple !== undefined && !attr.ngMultiple ? 'true' : 'false'\n };\n\n if (!element[0].hasAttribute('id')) {\n ariaAttrs.id = 'select_' + $mdUtil.nextUid();\n }\n\n var containerId = 'select_container_' + $mdUtil.nextUid();\n selectContainer.attr('id', containerId);\n ariaAttrs['aria-owns'] = containerId;\n element.attr(ariaAttrs);\n\n scope.$on('$destroy', function() {\n $mdSelect\n .destroy()\n .finally(function() {\n if (containerCtrl) {\n containerCtrl.setFocused(false);\n containerCtrl.setHasValue(false);\n containerCtrl.input = null;\n }\n ngModelCtrl.$setTouched();\n });\n });\n\n\n\n function inputCheckValue() {\n // The select counts as having a value if one or more options are selected,\n // or if the input's validity state says it has bad input (eg string in a number input)\n containerCtrl && containerCtrl.setHasValue(selectMenuCtrl.selectedLabels().length > 0 || (element[0].validity || {}).badInput);\n }\n\n function findSelectContainer() {\n selectContainer = angular.element(\n element[0].querySelector('.md-select-menu-container')\n );\n selectScope = scope;\n if (attr.mdContainerClass) {\n var value = selectContainer[0].getAttribute('class') + ' ' + attr.mdContainerClass;\n selectContainer[0].setAttribute('class', value);\n }\n selectMenuCtrl = selectContainer.find('md-select-menu').controller('mdSelectMenu');\n selectMenuCtrl.init(ngModelCtrl, attr.ngModel);\n element.on('$destroy', function() {\n selectContainer.remove();\n });\n }\n\n function handleKeypress(e) {\n var allowedCodes = [32, 13, 38, 40];\n if (allowedCodes.indexOf(e.keyCode) != -1) {\n // prevent page scrolling on interaction\n e.preventDefault();\n openSelect(e);\n } else {\n if (e.keyCode <= 90 && e.keyCode >= 31) {\n e.preventDefault();\n var node = selectMenuCtrl.optNodeForKeyboardSearch(e);\n if (!node) return;\n var optionCtrl = angular.element(node).controller('mdOption');\n if (!selectMenuCtrl.isMultiple) {\n selectMenuCtrl.deselect(Object.keys(selectMenuCtrl.selected)[0]);\n }\n selectMenuCtrl.select(optionCtrl.hashKey, optionCtrl.value);\n selectMenuCtrl.refreshViewValue();\n }\n }\n }\n\n function openSelect() {\n selectScope.isOpen = true;\n element.attr('aria-expanded', 'true');\n\n $mdSelect.show({\n scope: selectScope,\n preserveScope: true,\n skipCompile: true,\n element: selectContainer,\n target: element[0],\n selectCtrl: mdSelectCtrl,\n preserveElement: true,\n hasBackdrop: true,\n loadingAsync: attr.mdOnOpen ? scope.$eval(attr.mdOnOpen) || true : false\n }).finally(function() {\n selectScope.isOpen = false;\n element.focus();\n element.attr('aria-expanded', 'false');\n ngModelCtrl.$setTouched();\n });\n }\n };\n }\n}\nSelectDirective.$inject = [\"$mdSelect\", \"$mdUtil\", \"$mdTheming\", \"$mdAria\", \"$compile\", \"$parse\"];\n\nfunction SelectMenuDirective($parse, $mdUtil, $mdTheming) {\n // We want the scope to be set to 'false' so an isolated scope is not created\n // which would interfere with the md-select-header's access to the\n // parent scope.\n SelectMenuController.$inject = [\"$scope\", \"$attrs\", \"$element\"];\n return {\n restrict: 'E',\n require: ['mdSelectMenu'],\n scope: false,\n controller: SelectMenuController,\n link: {pre: preLink}\n };\n\n // We use preLink instead of postLink to ensure that the select is initialized before\n // its child options run postLink.\n function preLink(scope, element, attr, ctrls) {\n var selectCtrl = ctrls[0];\n\n $mdTheming(element);\n element.on('click', clickListener);\n element.on('keypress', keyListener);\n\n function keyListener(e) {\n if (e.keyCode == 13 || e.keyCode == 32) {\n clickListener(e);\n }\n }\n\n function clickListener(ev) {\n var option = $mdUtil.getClosest(ev.target, 'md-option');\n var optionCtrl = option && angular.element(option).data('$mdOptionController');\n if (!option || !optionCtrl) return;\n if (option.hasAttribute('disabled')) {\n ev.stopImmediatePropagation();\n return false;\n }\n\n var optionHashKey = selectCtrl.hashGetter(optionCtrl.value);\n var isSelected = angular.isDefined(selectCtrl.selected[optionHashKey]);\n\n scope.$apply(function() {\n if (selectCtrl.isMultiple) {\n if (isSelected) {\n selectCtrl.deselect(optionHashKey);\n } else {\n selectCtrl.select(optionHashKey, optionCtrl.value);\n }\n } else {\n if (!isSelected) {\n selectCtrl.deselect(Object.keys(selectCtrl.selected)[0]);\n selectCtrl.select(optionHashKey, optionCtrl.value);\n }\n }\n selectCtrl.refreshViewValue();\n });\n }\n }\n\n function SelectMenuController($scope, $attrs, $element) {\n var self = this;\n self.isMultiple = angular.isDefined($attrs.multiple);\n // selected is an object with keys matching all of the selected options' hashed values\n self.selected = {};\n // options is an object with keys matching every option's hash value,\n // and values matching every option's controller.\n self.options = {};\n\n $scope.$watchCollection(function() {\n return self.options;\n }, function() {\n self.ngModel.$render();\n });\n\n var deregisterCollectionWatch;\n var defaultIsEmpty;\n self.setMultiple = function(isMultiple) {\n var ngModel = self.ngModel;\n defaultIsEmpty = defaultIsEmpty || ngModel.$isEmpty;\n\n self.isMultiple = isMultiple;\n if (deregisterCollectionWatch) deregisterCollectionWatch();\n\n if (self.isMultiple) {\n ngModel.$validators['md-multiple'] = validateArray;\n ngModel.$render = renderMultiple;\n\n // watchCollection on the model because by default ngModel only watches the model's\n // reference. This allowed the developer to also push and pop from their array.\n $scope.$watchCollection(self.modelBinding, function(value) {\n if (validateArray(value)) renderMultiple(value);\n self.ngModel.$setPristine();\n });\n\n ngModel.$isEmpty = function(value) {\n return !value || value.length === 0;\n };\n } else {\n delete ngModel.$validators['md-multiple'];\n ngModel.$render = renderSingular;\n }\n\n function validateArray(modelValue, viewValue) {\n // If a value is truthy but not an array, reject it.\n // If value is undefined/falsy, accept that it's an empty array.\n return angular.isArray(modelValue || viewValue || []);\n }\n };\n\n var searchStr = '';\n var clearSearchTimeout, optNodes, optText;\n var CLEAR_SEARCH_AFTER = 300;\n self.optNodeForKeyboardSearch = function(e) {\n clearSearchTimeout && clearTimeout(clearSearchTimeout);\n clearSearchTimeout = setTimeout(function() {\n clearSearchTimeout = undefined;\n searchStr = '';\n optText = undefined;\n optNodes = undefined;\n }, CLEAR_SEARCH_AFTER);\n searchStr += String.fromCharCode(e.keyCode);\n var search = new RegExp('^' + searchStr, 'i');\n if (!optNodes) {\n optNodes = $element.find('md-option');\n optText = new Array(optNodes.length);\n angular.forEach(optNodes, function(el, i) {\n optText[i] = el.textContent.trim();\n });\n }\n for (var i = 0; i < optText.length; ++i) {\n if (search.test(optText[i])) {\n return optNodes[i];\n }\n }\n };\n\n self.init = function(ngModel, binding) {\n self.ngModel = ngModel;\n self.modelBinding = binding;\n\n // Allow users to provide `ng-model=\"foo\" ng-model-options=\"{trackBy: 'foo.id'}\"` so\n // that we can properly compare objects set on the model to the available options\n if (ngModel.$options && ngModel.$options.trackBy) {\n var trackByLocals = {};\n var trackByParsed = $parse(ngModel.$options.trackBy);\n self.hashGetter = function(value, valueScope) {\n trackByLocals.$value = value;\n return trackByParsed(valueScope || $scope, trackByLocals);\n };\n // If the user doesn't provide a trackBy, we automatically generate an id for every\n // value passed in\n } else {\n self.hashGetter = function getHashValue(value) {\n if (angular.isObject(value)) {\n return 'object_' + (value.$$mdSelectId || (value.$$mdSelectId = ++selectNextId));\n }\n return value;\n };\n }\n self.setMultiple(self.isMultiple);\n };\n\n self.selectedLabels = function(opts) {\n opts = opts || {};\n var mode = opts.mode || 'html';\n var selectedOptionEls = $mdUtil.nodesToArray($element[0].querySelectorAll('md-option[selected]'));\n if (selectedOptionEls.length) {\n var mapFn;\n\n if (mode == 'html') {\n // Map the given element to its innerHTML string. If the element has a child ripple\n // container remove it from the HTML string, before returning the string.\n mapFn = function(el) {\n var html = el.innerHTML;\n // Remove the ripple container from the selected option, copying it would cause a CSP violation.\n var rippleContainer = el.querySelector('.md-ripple-container');\n return rippleContainer ? html.replace(rippleContainer.outerHTML, '') : html;\n };\n } else if (mode == 'aria') {\n mapFn = function(el) { return el.hasAttribute('aria-label') ? el.getAttribute('aria-label') : el.textContent; };\n }\n return selectedOptionEls.map(mapFn).join(', ');\n } else {\n return '';\n }\n };\n\n self.select = function(hashKey, hashedValue) {\n var option = self.options[hashKey];\n option && option.setSelected(true);\n self.selected[hashKey] = hashedValue;\n };\n self.deselect = function(hashKey) {\n var option = self.options[hashKey];\n option && option.setSelected(false);\n delete self.selected[hashKey];\n };\n\n self.addOption = function(hashKey, optionCtrl) {\n if (angular.isDefined(self.options[hashKey])) {\n throw new Error('Duplicate md-option values are not allowed in a select. ' +\n 'Duplicate value \"' + optionCtrl.value + '\" found.');\n }\n self.options[hashKey] = optionCtrl;\n\n // If this option's value was already in our ngModel, go ahead and select it.\n if (angular.isDefined(self.selected[hashKey])) {\n self.select(hashKey, optionCtrl.value);\n self.refreshViewValue();\n }\n };\n self.removeOption = function(hashKey) {\n delete self.options[hashKey];\n // Don't deselect an option when it's removed - the user's ngModel should be allowed\n // to have values that do not match a currently available option.\n };\n\n self.refreshViewValue = function() {\n var values = [];\n var option;\n for (var hashKey in self.selected) {\n // If this hashKey has an associated option, push that option's value to the model.\n if ((option = self.options[hashKey])) {\n values.push(option.value);\n } else {\n // Otherwise, the given hashKey has no associated option, and we got it\n // from an ngModel value at an earlier time. Push the unhashed value of\n // this hashKey to the model.\n // This allows the developer to put a value in the model that doesn't yet have\n // an associated option.\n values.push(self.selected[hashKey]);\n }\n }\n var usingTrackBy = self.ngModel.$options && self.ngModel.$options.trackBy;\n\n var newVal = self.isMultiple ? values : values[0];\n var prevVal = self.ngModel.$modelValue;\n\n if (usingTrackBy ? !angular.equals(prevVal, newVal) : prevVal != newVal) {\n self.ngModel.$setViewValue(newVal);\n self.ngModel.$render();\n }\n };\n\n function renderMultiple() {\n var newSelectedValues = self.ngModel.$modelValue || self.ngModel.$viewValue || [];\n if (!angular.isArray(newSelectedValues)) return;\n\n var oldSelected = Object.keys(self.selected);\n\n var newSelectedHashes = newSelectedValues.map(self.hashGetter);\n var deselected = oldSelected.filter(function(hash) {\n return newSelectedHashes.indexOf(hash) === -1;\n });\n\n deselected.forEach(self.deselect);\n newSelectedHashes.forEach(function(hashKey, i) {\n self.select(hashKey, newSelectedValues[i]);\n });\n }\n\n function renderSingular() {\n var value = self.ngModel.$viewValue || self.ngModel.$modelValue;\n Object.keys(self.selected).forEach(self.deselect);\n self.select(self.hashGetter(value), value);\n }\n }\n\n}\nSelectMenuDirective.$inject = [\"$parse\", \"$mdUtil\", \"$mdTheming\"];\n\nfunction OptionDirective($mdButtonInkRipple, $mdUtil) {\n\n OptionController.$inject = [\"$element\"];\n return {\n restrict: 'E',\n require: ['mdOption', '^^mdSelectMenu'],\n controller: OptionController,\n compile: compile\n };\n\n function compile(element, attr) {\n // Manual transclusion to avoid the extra inner <span> that ng-transclude generates\n element.append(angular.element('<div class=\"md-text\">').append(element.contents()));\n\n element.attr('tabindex', attr.tabindex || '0');\n return postLink;\n }\n\n function postLink(scope, element, attr, ctrls) {\n var optionCtrl = ctrls[0];\n var selectCtrl = ctrls[1];\n\n if (selectCtrl.isMultiple) {\n element.addClass('md-checkbox-enabled');\n element.prepend(CHECKBOX_SELECTION_INDICATOR.clone());\n }\n\n if (angular.isDefined(attr.ngValue)) {\n scope.$watch(attr.ngValue, setOptionValue);\n } else if (angular.isDefined(attr.value)) {\n setOptionValue(attr.value);\n } else {\n scope.$watch(function() {\n return element.text().trim();\n }, setOptionValue);\n }\n\n attr.$observe('disabled', function(disabled) {\n if (disabled) {\n element.attr('tabindex', '-1');\n } else {\n element.attr('tabindex', '0');\n }\n });\n\n scope.$$postDigest(function() {\n attr.$observe('selected', function(selected) {\n if (!angular.isDefined(selected)) return;\n if (typeof selected == 'string') selected = true;\n if (selected) {\n if (!selectCtrl.isMultiple) {\n selectCtrl.deselect(Object.keys(selectCtrl.selected)[0]);\n }\n selectCtrl.select(optionCtrl.hashKey, optionCtrl.value);\n } else {\n selectCtrl.deselect(optionCtrl.hashKey);\n }\n selectCtrl.refreshViewValue();\n });\n });\n\n $mdButtonInkRipple.attach(scope, element);\n configureAria();\n\n function setOptionValue(newValue, oldValue, prevAttempt) {\n if (!selectCtrl.hashGetter) {\n if (!prevAttempt) {\n scope.$$postDigest(function() {\n setOptionValue(newValue, oldValue, true);\n });\n }\n return;\n }\n var oldHashKey = selectCtrl.hashGetter(oldValue, scope);\n var newHashKey = selectCtrl.hashGetter(newValue, scope);\n\n optionCtrl.hashKey = newHashKey;\n optionCtrl.value = newValue;\n\n selectCtrl.removeOption(oldHashKey, optionCtrl);\n selectCtrl.addOption(newHashKey, optionCtrl);\n }\n\n scope.$on('$destroy', function() {\n selectCtrl.removeOption(optionCtrl.hashKey, optionCtrl);\n });\n\n function configureAria() {\n var ariaAttrs = {\n 'role': 'option',\n 'aria-selected': 'false'\n };\n\n if (!element[0].hasAttribute('id')) {\n ariaAttrs.id = 'select_option_' + $mdUtil.nextUid();\n }\n element.attr(ariaAttrs);\n }\n }\n\n function OptionController($element) {\n this.selected = false;\n this.setSelected = function(isSelected) {\n if (isSelected && !this.selected) {\n $element.attr({\n 'selected': 'selected',\n 'aria-selected': 'true'\n });\n } else if (!isSelected && this.selected) {\n $element.removeAttr('selected');\n $element.attr('aria-selected', 'false');\n }\n this.selected = isSelected;\n };\n }\n\n}\nOptionDirective.$inject = [\"$mdButtonInkRipple\", \"$mdUtil\"];\n\nfunction OptgroupDirective() {\n return {\n restrict: 'E',\n compile: compile\n };\n function compile(el, attrs) {\n // If we have a select header element, we don't want to add the normal label\n // header.\n if (!hasSelectHeader()) {\n setupLabelElement();\n }\n\n function hasSelectHeader() {\n return el.parent().find('md-select-header').length;\n }\n\n function setupLabelElement() {\n var labelElement = el.find('label');\n if (!labelElement.length) {\n labelElement = angular.element('<label>');\n el.prepend(labelElement);\n }\n labelElement.addClass('md-container-ignore');\n if (attrs.label) labelElement.text(attrs.label);\n }\n }\n}\n\nfunction SelectHeaderDirective() {\n return {\n restrict: 'E',\n };\n}\n\nfunction SelectProvider($$interimElementProvider) {\n selectDefaultOptions.$inject = [\"$mdSelect\", \"$mdConstant\", \"$mdUtil\", \"$window\", \"$q\", \"$$rAF\", \"$animateCss\", \"$animate\", \"$document\"];\n return $$interimElementProvider('$mdSelect')\n .setDefaults({\n methods: ['target'],\n options: selectDefaultOptions\n });\n\n /* @ngInject */\n function selectDefaultOptions($mdSelect, $mdConstant, $mdUtil, $window, $q, $$rAF, $animateCss, $animate, $document) {\n var ERRROR_TARGET_EXPECTED = \"$mdSelect.show() expected a target element in options.target but got '{0}'!\";\n var animator = $mdUtil.dom.animator;\n\n return {\n parent: 'body',\n themable: true,\n onShow: onShow,\n onRemove: onRemove,\n hasBackdrop: true,\n disableParentScroll: true\n };\n\n /**\n * Interim-element onRemove logic....\n */\n function onRemove(scope, element, opts) {\n opts = opts || { };\n opts.cleanupInteraction();\n opts.cleanupResizing();\n opts.hideBackdrop();\n\n // For navigation $destroy events, do a quick, non-animated removal,\n // but for normal closes (from clicks, etc) animate the removal\n\n return (opts.$destroy === true) ? cleanElement() : animateRemoval().then( cleanElement );\n\n /**\n * For normal closes (eg clicks), animate the removal.\n * For forced closes (like $destroy events from navigation),\n * skip the animations\n */\n function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }\n\n /**\n * Restore the element to a closed state\n */\n function cleanElement() {\n\n element.removeClass('md-active');\n element.attr('aria-hidden', 'true');\n element[0].style.display = 'none';\n\n announceClosed(opts);\n\n if (!opts.$destroy && opts.restoreFocus) {\n opts.target.focus();\n }\n }\n\n }\n\n /**\n * Interim-element onShow logic....\n */\n function onShow(scope, element, opts) {\n\n watchAsyncLoad();\n sanitizeAndConfigure(scope, opts);\n\n opts.hideBackdrop = showBackdrop(scope, element, opts);\n\n return showDropDown(scope, element, opts)\n .then(function(response) {\n element.attr('aria-hidden', 'false');\n opts.alreadyOpen = true;\n opts.cleanupInteraction = activateInteraction();\n opts.cleanupResizing = activateResizing();\n\n return response;\n }, opts.hideBackdrop);\n\n // ************************************\n // Closure Functions\n // ************************************\n\n /**\n * Attach the select DOM element(s) and animate to the correct positions\n * and scalings...\n */\n function showDropDown(scope, element, opts) {\n opts.parent.append(element);\n\n return $q(function(resolve, reject) {\n\n try {\n\n $animateCss(element, {removeClass: 'md-leave', duration: 0})\n .start()\n .then(positionAndFocusMenu)\n .then(resolve);\n\n } catch (e) {\n reject(e);\n }\n\n });\n }\n\n /**\n * Initialize container and dropDown menu positions/scale, then animate\n * to show... and autoFocus.\n */\n function positionAndFocusMenu() {\n return $q(function(resolve) {\n if (opts.isRemoved) return $q.reject(false);\n\n var info = calculateMenuPositions(scope, element, opts);\n\n info.container.element.css(animator.toCss(info.container.styles));\n info.dropDown.element.css(animator.toCss(info.dropDown.styles));\n\n $$rAF(function() {\n element.addClass('md-active');\n info.dropDown.element.css(animator.toCss({transform: ''}));\n\n autoFocus(opts.focusedNode);\n resolve();\n });\n\n });\n }\n\n /**\n * Show modal backdrop element...\n */\n function showBackdrop(scope, element, options) {\n\n // If we are not within a dialog...\n if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {\n // !! DO this before creating the backdrop; since disableScrollAround()\n // configures the scroll offset; which is used by mdBackDrop postLink()\n options.restoreScroll = $mdUtil.disableScrollAround(options.element, options.parent);\n } else {\n options.disableParentScroll = false;\n }\n\n if (options.hasBackdrop) {\n // Override duration to immediately show invisible backdrop\n options.backdrop = $mdUtil.createBackdrop(scope, \"md-select-backdrop md-click-catcher\");\n $animate.enter(options.backdrop, $document[0].body, null, {duration: 0});\n }\n\n /**\n * Hide modal backdrop element...\n */\n return function hideBackdrop() {\n if (options.backdrop) options.backdrop.remove();\n if (options.disableParentScroll) options.restoreScroll();\n\n delete options.restoreScroll;\n };\n }\n\n /**\n *\n */\n function autoFocus(focusedNode) {\n if (focusedNode && !focusedNode.hasAttribute('disabled')) {\n focusedNode.focus();\n }\n }\n\n /**\n * Check for valid opts and set some sane defaults\n */\n function sanitizeAndConfigure(scope, options) {\n var selectEl = element.find('md-select-menu');\n\n if (!options.target) {\n throw new Error($mdUtil.supplant(ERRROR_TARGET_EXPECTED, [options.target]));\n }\n\n angular.extend(options, {\n isRemoved: false,\n target: angular.element(options.target), //make sure it's not a naked dom node\n parent: angular.element(options.parent),\n selectEl: selectEl,\n contentEl: element.find('md-content'),\n optionNodes: selectEl[0].getElementsByTagName('md-option')\n });\n }\n\n /**\n * Configure various resize listeners for screen changes\n */\n function activateResizing() {\n var debouncedOnResize = (function(scope, target, options) {\n\n return function() {\n if (options.isRemoved) return;\n\n var updates = calculateMenuPositions(scope, target, options);\n var container = updates.container;\n var dropDown = updates.dropDown;\n\n container.element.css(animator.toCss(container.styles));\n dropDown.element.css(animator.toCss(dropDown.styles));\n };\n\n })(scope, element, opts);\n\n var window = angular.element($window);\n window.on('resize', debouncedOnResize);\n window.on('orientationchange', debouncedOnResize);\n\n // Publish deactivation closure...\n return function deactivateResizing() {\n\n // Disable resizing handlers\n window.off('resize', debouncedOnResize);\n window.off('orientationchange', debouncedOnResize);\n };\n }\n\n /**\n * If asynchronously loading, watch and update internal\n * '$$loadingAsyncDone' flag\n */\n function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n scope.progressMode = 'indeterminate';\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n scope.progressMode = '';\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }\n\n /**\n *\n */\n function activateInteraction() {\n if (opts.isRemoved) return;\n\n var dropDown = opts.selectEl;\n var selectCtrl = dropDown.controller('mdSelectMenu') || {};\n\n element.addClass('md-clickable');\n\n // Close on backdrop click\n opts.backdrop && opts.backdrop.on('click', onBackdropClick);\n\n // Escape to close\n // Cycling of options, and closing on enter\n dropDown.on('keydown', onMenuKeyDown);\n dropDown.on('click', checkCloseMenu);\n\n return function cleanupInteraction() {\n opts.backdrop && opts.backdrop.off('click', onBackdropClick);\n dropDown.off('keydown', onMenuKeyDown);\n dropDown.off('click', checkCloseMenu);\n\n element.removeClass('md-clickable');\n opts.isRemoved = true;\n };\n\n // ************************************\n // Closure Functions\n // ************************************\n\n function onBackdropClick(e) {\n e.preventDefault();\n e.stopPropagation();\n opts.restoreFocus = false;\n $mdUtil.nextTick($mdSelect.hide, true);\n }\n\n function onMenuKeyDown(ev) {\n var keyCodes = $mdConstant.KEY_CODE;\n ev.preventDefault();\n ev.stopPropagation();\n\n switch (ev.keyCode) {\n case keyCodes.UP_ARROW:\n return focusPrevOption();\n case keyCodes.DOWN_ARROW:\n return focusNextOption();\n case keyCodes.SPACE:\n case keyCodes.ENTER:\n var option = $mdUtil.getClosest(ev.target, 'md-option');\n if (option) {\n dropDown.triggerHandler({\n type: 'click',\n target: option\n });\n ev.preventDefault();\n }\n checkCloseMenu(ev);\n break;\n case keyCodes.TAB:\n case keyCodes.ESCAPE:\n ev.stopPropagation();\n ev.preventDefault();\n opts.restoreFocus = true;\n $mdUtil.nextTick($mdSelect.hide, true);\n break;\n default:\n if (ev.keyCode >= 31 && ev.keyCode <= 90) {\n var optNode = dropDown.controller('mdSelectMenu').optNodeForKeyboardSearch(ev);\n opts.focusedNode = optNode || opts.focusedNode;\n optNode && optNode.focus();\n }\n }\n }\n\n function focusOption(direction) {\n var optionsArray = $mdUtil.nodesToArray(opts.optionNodes);\n var index = optionsArray.indexOf(opts.focusedNode);\n\n var newOption;\n\n do {\n if (index === -1) {\n // We lost the previously focused element, reset to first option\n index = 0;\n } else if (direction === 'next' && index < optionsArray.length - 1) {\n index++;\n } else if (direction === 'prev' && index > 0) {\n index--;\n }\n newOption = optionsArray[index];\n if (newOption.hasAttribute('disabled')) newOption = undefined;\n } while (!newOption && index < optionsArray.length - 1 && index > 0);\n\n newOption && newOption.focus();\n opts.focusedNode = newOption;\n }\n\n function focusNextOption() {\n focusOption('next');\n }\n\n function focusPrevOption() {\n focusOption('prev');\n }\n\n function checkCloseMenu(ev) {\n if (ev && ( ev.type == 'click') && (ev.currentTarget != dropDown[0])) return;\n if ( mouseOnScrollbar() ) return;\n\n var option = $mdUtil.getClosest(ev.target, 'md-option');\n if (option && option.hasAttribute && !option.hasAttribute('disabled')) {\n ev.preventDefault();\n ev.stopPropagation();\n if (!selectCtrl.isMultiple) {\n opts.restoreFocus = true;\n\n $mdUtil.nextTick(function () {\n $mdSelect.hide(selectCtrl.ngModel.$viewValue);\n }, true);\n }\n }\n /**\n * check if the mouseup event was on a scrollbar\n */\n function mouseOnScrollbar() {\n var clickOnScrollbar = false;\n if (ev && (ev.currentTarget.children.length > 0)) {\n var child = ev.currentTarget.children[0];\n var hasScrollbar = child.scrollHeight > child.clientHeight;\n if (hasScrollbar && child.children.length > 0) {\n var relPosX = ev.pageX - ev.currentTarget.getBoundingClientRect().left;\n if (relPosX > child.querySelector('md-option').offsetWidth)\n clickOnScrollbar = true;\n }\n }\n return clickOnScrollbar;\n }\n }\n }\n\n }\n\n /**\n * To notify listeners that the Select menu has closed,\n * trigger the [optional] user-defined expression\n */\n function announceClosed(opts) {\n var mdSelect = opts.selectCtrl;\n if (mdSelect) {\n var menuController = opts.selectEl.controller('mdSelectMenu');\n mdSelect.setLabelText(menuController.selectedLabels());\n mdSelect.triggerClose();\n }\n }\n\n\n /**\n * Calculate the\n */\n function calculateMenuPositions(scope, element, opts) {\n var\n containerNode = element[0],\n targetNode = opts.target[0].children[0], // target the label\n parentNode = $document[0].body,\n selectNode = opts.selectEl[0],\n contentNode = opts.contentEl[0],\n parentRect = parentNode.getBoundingClientRect(),\n targetRect = targetNode.getBoundingClientRect(),\n shouldOpenAroundTarget = false,\n bounds = {\n left: parentRect.left + SELECT_EDGE_MARGIN,\n top: SELECT_EDGE_MARGIN,\n bottom: parentRect.height - SELECT_EDGE_MARGIN,\n right: parentRect.width - SELECT_EDGE_MARGIN - ($mdUtil.floatingScrollbars() ? 16 : 0)\n },\n spaceAvailable = {\n top: targetRect.top - bounds.top,\n left: targetRect.left - bounds.left,\n right: bounds.right - (targetRect.left + targetRect.width),\n bottom: bounds.bottom - (targetRect.top + targetRect.height)\n },\n maxWidth = parentRect.width - SELECT_EDGE_MARGIN * 2,\n selectedNode = selectNode.querySelector('md-option[selected]'),\n optionNodes = selectNode.getElementsByTagName('md-option'),\n optgroupNodes = selectNode.getElementsByTagName('md-optgroup'),\n isScrollable = calculateScrollable(element, contentNode),\n centeredNode;\n\n var loading = isPromiseLike(opts.loadingAsync);\n if (!loading) {\n // If a selected node, center around that\n if (selectedNode) {\n centeredNode = selectedNode;\n // If there are option groups, center around the first option group\n } else if (optgroupNodes.length) {\n centeredNode = optgroupNodes[0];\n // Otherwise - if we are not loading async - center around the first optionNode\n } else if (optionNodes.length) {\n centeredNode = optionNodes[0];\n // In case there are no options, center on whatever's in there... (eg progress indicator)\n } else {\n centeredNode = contentNode.firstElementChild || contentNode;\n }\n } else {\n // If loading, center on progress indicator\n centeredNode = contentNode.firstElementChild || contentNode;\n }\n\n if (contentNode.offsetWidth > maxWidth) {\n contentNode.style['max-width'] = maxWidth + 'px';\n } else {\n contentNode.style.maxWidth = null;\n }\n if (shouldOpenAroundTarget) {\n contentNode.style['min-width'] = targetRect.width + 'px';\n }\n\n // Remove padding before we compute the position of the menu\n if (isScrollable) {\n selectNode.classList.add('md-overflow');\n }\n\n var focusedNode = centeredNode;\n if ((focusedNode.tagName || '').toUpperCase() === 'MD-OPTGROUP') {\n focusedNode = optionNodes[0] || contentNode.firstElementChild || contentNode;\n centeredNode = focusedNode;\n }\n // Cache for autoFocus()\n opts.focusedNode = focusedNode;\n\n // Get the selectMenuRect *after* max-width is possibly set above\n containerNode.style.display = 'block';\n var selectMenuRect = selectNode.getBoundingClientRect();\n var centeredRect = getOffsetRect(centeredNode);\n\n if (centeredNode) {\n var centeredStyle = $window.getComputedStyle(centeredNode);\n centeredRect.paddingLeft = parseInt(centeredStyle.paddingLeft, 10) || 0;\n centeredRect.paddingRight = parseInt(centeredStyle.paddingRight, 10) || 0;\n }\n\n if (isScrollable) {\n var scrollBuffer = contentNode.offsetHeight / 2;\n contentNode.scrollTop = centeredRect.top + centeredRect.height / 2 - scrollBuffer;\n\n if (spaceAvailable.top < scrollBuffer) {\n contentNode.scrollTop = Math.min(\n centeredRect.top,\n contentNode.scrollTop + scrollBuffer - spaceAvailable.top\n );\n } else if (spaceAvailable.bottom < scrollBuffer) {\n contentNode.scrollTop = Math.max(\n centeredRect.top + centeredRect.height - selectMenuRect.height,\n contentNode.scrollTop - scrollBuffer + spaceAvailable.bottom\n );\n }\n }\n\n var left, top, transformOrigin, minWidth;\n if (shouldOpenAroundTarget) {\n left = targetRect.left;\n top = targetRect.top + targetRect.height;\n transformOrigin = '50% 0';\n if (top + selectMenuRect.height > bounds.bottom) {\n top = targetRect.top - selectMenuRect.height;\n transformOrigin = '50% 100%';\n }\n } else {\n left = (targetRect.left + centeredRect.left - centeredRect.paddingLeft) + 2;\n top = Math.floor(targetRect.top + targetRect.height / 2 - centeredRect.height / 2 -\n centeredRect.top + contentNode.scrollTop) + 2;\n\n transformOrigin = (centeredRect.left + targetRect.width / 2) + 'px ' +\n (centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';\n\n minWidth = Math.min(targetRect.width + centeredRect.paddingLeft + centeredRect.paddingRight, maxWidth);\n }\n\n // Keep left and top within the window\n var containerRect = containerNode.getBoundingClientRect();\n var scaleX = Math.round(100 * Math.min(targetRect.width / selectMenuRect.width, 1.0)) / 100;\n var scaleY = Math.round(100 * Math.min(targetRect.height / selectMenuRect.height, 1.0)) / 100;\n\n return {\n container: {\n element: angular.element(containerNode),\n styles: {\n left: Math.floor(clamp(bounds.left, left, bounds.right - containerRect.width)),\n top: Math.floor(clamp(bounds.top, top, bounds.bottom - containerRect.height)),\n 'min-width': minWidth\n }\n },\n dropDown: {\n element: angular.element(selectNode),\n styles: {\n transformOrigin: transformOrigin,\n transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : \"\"\n }\n }\n };\n\n }\n\n }\n\n function isPromiseLike(obj) {\n return obj && angular.isFunction(obj.then);\n }\n\n function clamp(min, n, max) {\n return Math.max(min, Math.min(n, max));\n }\n\n function getOffsetRect(node) {\n return node ? {\n left: node.offsetLeft,\n top: node.offsetTop,\n width: node.offsetWidth,\n height: node.offsetHeight\n } : {left: 0, top: 0, width: 0, height: 0};\n }\n\n function calculateScrollable(element, contentNode) {\n var isScrollable = false;\n\n try {\n var oldDisplay = element[0].style.display;\n\n // Set the element's display to block so that this calculation is correct\n element[0].style.display = 'block';\n\n isScrollable = contentNode.scrollHeight > contentNode.offsetHeight;\n\n // Reset it back afterwards\n element[0].style.display = oldDisplay;\n } finally {\n // Nothing to do\n }\n return isScrollable;\n }\n}\nSelectProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.showHide\n */\n\n// Add additional handlers to ng-show and ng-hide that notify directives\n// contained within that they should recompute their size.\n// These run in addition to Angular's built-in ng-hide and ng-show directives.\nangular.module('material.components.showHide', [\n 'material.core'\n])\n .directive('ngShow', createDirective('ngShow', true))\n .directive('ngHide', createDirective('ngHide', false));\n\n\nfunction createDirective(name, targetValue) {\n return ['$mdUtil', function($mdUtil) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function($scope, $element, $attr) {\n var unregister = $scope.$on('$md-resize-enable', function() {\n unregister();\n\n $scope.$watch($attr[name], function(value) {\n if (!!value === targetValue) {\n $mdUtil.nextTick(function() {\n $scope.$broadcast('$md-resize');\n });\n $mdUtil.dom.animator.waitTransitionEnd($element).then(function() {\n $scope.$broadcast('$md-resize');\n });\n }\n });\n });\n }\n };\n }];\n}\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.sidenav\n *\n * @description\n * A Sidenav QP component.\n */\nangular\n .module('material.components.sidenav', [\n 'material.core',\n 'material.components.backdrop'\n ])\n .factory('$mdSidenav', SidenavService )\n .directive('mdSidenav', SidenavDirective)\n .directive('mdSidenavFocus', SidenavFocusDirective)\n .controller('$mdSidenavController', SidenavController);\n\n\n/**\n * @ngdoc service\n * @name $mdSidenav\n * @module material.components.sidenav\n *\n * @description\n * `$mdSidenav` makes it easy to interact with multiple sidenavs\n * in an app.\n *\n * @usage\n * <hljs lang=\"js\">\n * // Async lookup for sidenav instance; will resolve when the instance is available\n * $mdSidenav(componentId).then(function(instance) {\n * $log.debug( componentId + \"is now ready\" );\n * });\n * // Async toggle the given sidenav;\n * // when instance is known ready and lazy lookup is not needed.\n * $mdSidenav(componentId)\n * .toggle()\n * .then(function(){\n * $log.debug('toggled');\n * });\n * // Async open the given sidenav\n * $mdSidenav(componentId)\n * .open()\n * .then(function(){\n * $log.debug('opened');\n * });\n * // Async close the given sidenav\n * $mdSidenav(componentId)\n * .close()\n * .then(function(){\n * $log.debug('closed');\n * });\n * // Sync check to see if the specified sidenav is set to be open\n * $mdSidenav(componentId).isOpen();\n * // Sync check to whether given sidenav is locked open\n * // If this is true, the sidenav will be open regardless of close()\n * $mdSidenav(componentId).isLockedOpen();\n * </hljs>\n */\nfunction SidenavService($mdComponentRegistry, $q) {\n return function(handle) {\n\n // Lookup the controller instance for the specified sidNav instance\n var self;\n var errorMsg = \"SideNav '\" + handle + \"' is not available!\";\n var instance = $mdComponentRegistry.get(handle);\n\n if(!instance) {\n $mdComponentRegistry.notFoundError(handle);\n }\n\n return self = {\n // -----------------\n // Sync methods\n // -----------------\n isOpen: function() {\n return instance && instance.isOpen();\n },\n isLockedOpen: function() {\n return instance && instance.isLockedOpen();\n },\n // -----------------\n // Async methods\n // -----------------\n toggle: function() {\n return instance ? instance.toggle() : $q.reject(errorMsg);\n },\n open: function() {\n return instance ? instance.open() : $q.reject(errorMsg);\n },\n close: function() {\n return instance ? instance.close() : $q.reject(errorMsg);\n },\n then : function( callbackFn ) {\n var promise = instance ? $q.when(instance) : waitForInstance();\n return promise.then( callbackFn || angular.noop );\n }\n };\n\n /**\n * Deferred lookup of component instance using $component registry\n */\n function waitForInstance() {\n return $mdComponentRegistry\n .when(handle)\n .then(function( it ){\n instance = it;\n return it;\n });\n }\n };\n}\nSidenavService.$inject = [\"$mdComponentRegistry\", \"$q\"];\n/**\n * @ngdoc directive\n * @name mdSidenavFocus\n * @module material.components.sidenav\n *\n * @restrict A\n *\n * @description\n * `mdSidenavFocus` provides a way to specify the focused element when a sidenav opens.\n * This is completely optional, as the sidenav itself is focused by default.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-sidenav>\n * <form>\n * <md-input-container>\n * <label for=\"testInput\">Label</label>\n * <input id=\"testInput\" type=\"text\" md-sidenav-focus>\n * </md-input-container>\n * </form>\n * </md-sidenav>\n * </hljs>\n **/\nfunction SidenavFocusDirective() {\n return {\n restrict: 'A',\n require: '^mdSidenav',\n link: function(scope, element, attr, sidenavCtrl) {\n // @see $mdUtil.findFocusTarget(...)\n }\n };\n}\n/**\n * @ngdoc directive\n * @name mdSidenav\n * @module material.components.sidenav\n * @restrict E\n *\n * @description\n *\n * A Sidenav component that can be opened and closed programatically.\n *\n * By default, upon opening it will slide out on top of the main content area.\n *\n * For keyboard and screen reader accessibility, focus is sent to the sidenav wrapper by default.\n * It can be overridden with the `md-autofocus` directive on the child element you want focused.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div layout=\"row\" ng-controller=\"MyController\">\n * <md-sidenav md-component-id=\"left\" class=\"md-sidenav-left\">\n * Left Nav!\n * </md-sidenav>\n *\n * <md-content>\n * Center Content\n * <md-button ng-click=\"openLeftMenu()\">\n * Open Left Menu\n * </md-button>\n * </md-content>\n *\n * <md-sidenav md-component-id=\"right\"\n * md-is-locked-open=\"$mdMedia('min-width: 333px')\"\n * class=\"md-sidenav-right\">\n * <form>\n * <md-input-container>\n * <label for=\"testInput\">Test input</label>\n * <input id=\"testInput\" type=\"text\"\n * ng-model=\"data\" md-autofocus>\n * </md-input-container>\n * </form>\n * </md-sidenav>\n * </div>\n * </hljs>\n *\n * <hljs lang=\"js\">\n * var app = angular.module('myApp', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdSidenav) {\n * $scope.openLeftMenu = function() {\n * $mdSidenav('left').toggle();\n * };\n * });\n * </hljs>\n *\n * @param {expression=} md-is-open A model bound to whether the sidenav is opened.\n * @param {string=} md-component-id componentId to use with $mdSidenav service.\n * @param {expression=} md-is-locked-open When this expression evalutes to true,\n * the sidenav 'locks open': it falls into the content's flow instead\n * of appearing over it. This overrides the `md-is-open` attribute.\n *\n * The $mdMedia() service is exposed to the is-locked-open attribute, which\n * can be given a media query or one of the `sm`, `gt-sm`, `md`, `gt-md`, `lg` or `gt-lg` presets.\n * Examples:\n *\n * - `<md-sidenav md-is-locked-open=\"shouldLockOpen\"></md-sidenav>`\n * - `<md-sidenav md-is-locked-open=\"$mdMedia('min-width: 1000px')\"></md-sidenav>`\n * - `<md-sidenav md-is-locked-open=\"$mdMedia('sm')\"></md-sidenav>` (locks open on small screens)\n */\nfunction SidenavDirective($mdMedia, $mdUtil, $mdConstant, $mdTheming, $animate, $compile, $parse, $log, $q, $document) {\n return {\n restrict: 'E',\n scope: {\n isOpen: '=?mdIsOpen'\n },\n controller: '$mdSidenavController',\n compile: function(element) {\n element.addClass('md-closed');\n element.attr('tabIndex', '-1');\n return postLink;\n }\n };\n\n /**\n * Directive Post Link function...\n */\n function postLink(scope, element, attr, sidenavCtrl) {\n var lastParentOverFlow;\n var triggeringElement = null;\n var promise = $q.when(true);\n\n var isLockedOpenParsed = $parse(attr.mdIsLockedOpen);\n var isLocked = function() {\n return isLockedOpenParsed(scope.$parent, {\n $media: function(arg) {\n $log.warn(\"$media is deprecated for is-locked-open. Use $mdMedia instead.\");\n return $mdMedia(arg);\n },\n $mdMedia: $mdMedia\n });\n };\n var backdrop = $mdUtil.createBackdrop(scope, \"md-sidenav-backdrop md-opaque ng-enter\");\n\n $mdTheming(element);\n\n // The backdrop should inherit the sidenavs theme,\n // because the backdrop will take its parent theme by default.\n $mdTheming.inherit(backdrop, element);\n\n element.on('$destroy', function() {\n backdrop.remove();\n sidenavCtrl.destroy();\n });\n\n scope.$on('$destroy', function(){\n backdrop.remove()\n });\n\n scope.$watch(isLocked, updateIsLocked);\n scope.$watch('isOpen', updateIsOpen);\n\n\n // Publish special accessor for the Controller instance\n sidenavCtrl.$toggleOpen = toggleOpen;\n\n /**\n * Toggle the DOM classes to indicate `locked`\n * @param isLocked\n */\n function updateIsLocked(isLocked, oldValue) {\n scope.isLockedOpen = isLocked;\n if (isLocked === oldValue) {\n element.toggleClass('md-locked-open', !!isLocked);\n } else {\n $animate[isLocked ? 'addClass' : 'removeClass'](element, 'md-locked-open');\n }\n backdrop.toggleClass('md-locked-open', !!isLocked);\n }\n\n /**\n * Toggle the SideNav view and attach/detach listeners\n * @param isOpen\n */\n function updateIsOpen(isOpen) {\n // Support deprecated md-sidenav-focus attribute as fallback\n var focusEl = $mdUtil.findFocusTarget(element) || $mdUtil.findFocusTarget(element,'[md-sidenav-focus]') || element;\n var parent = element.parent();\n\n parent[isOpen ? 'on' : 'off']('keydown', onKeyDown);\n backdrop[isOpen ? 'on' : 'off']('click', close);\n\n if ( isOpen ) {\n // Capture upon opening..\n triggeringElement = $document[0].activeElement;\n }\n\n disableParentScroll(isOpen);\n\n return promise = $q.all([\n isOpen ? $animate.enter(backdrop, parent) : $animate.leave(backdrop),\n $animate[isOpen ? 'removeClass' : 'addClass'](element, 'md-closed')\n ])\n .then(function() {\n // Perform focus when animations are ALL done...\n if (scope.isOpen) {\n focusEl && focusEl.focus();\n }\n });\n }\n\n /**\n * Prevent parent scrolling (when the SideNav is open)\n */\n function disableParentScroll(disabled) {\n var parent = element.parent();\n if ( disabled && !lastParentOverFlow ) {\n\n lastParentOverFlow = parent.css('overflow');\n parent.css('overflow', 'hidden');\n\n } else if (angular.isDefined(lastParentOverFlow)) {\n\n parent.css('overflow', lastParentOverFlow);\n lastParentOverFlow = undefined;\n\n }\n }\n\n /**\n * Toggle the sideNav view and publish a promise to be resolved when\n * the view animation finishes.\n *\n * @param isOpen\n * @returns {*}\n */\n function toggleOpen( isOpen ) {\n if (scope.isOpen == isOpen ) {\n\n return $q.when(true);\n\n } else {\n return $q(function(resolve){\n // Toggle value to force an async `updateIsOpen()` to run\n scope.isOpen = isOpen;\n\n $mdUtil.nextTick(function() {\n // When the current `updateIsOpen()` animation finishes\n promise.then(function(result) {\n\n if ( !scope.isOpen ) {\n // reset focus to originating element (if available) upon close\n triggeringElement && triggeringElement.focus();\n triggeringElement = null;\n }\n\n resolve(result);\n });\n });\n\n });\n\n }\n }\n\n /**\n * Auto-close sideNav when the `escape` key is pressed.\n * @param evt\n */\n function onKeyDown(ev) {\n var isEscape = (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE);\n return isEscape ? close(ev) : $q.when(true);\n }\n\n /**\n * With backdrop `clicks` or `escape` key-press, immediately\n * apply the CSS close transition... Then notify the controller\n * to close() and perform its own actions.\n */\n function close(ev) {\n ev.preventDefault();\n\n return sidenavCtrl.close();\n }\n\n }\n}\nSidenavDirective.$inject = [\"$mdMedia\", \"$mdUtil\", \"$mdConstant\", \"$mdTheming\", \"$animate\", \"$compile\", \"$parse\", \"$log\", \"$q\", \"$document\"];\n\n/*\n * @private\n * @ngdoc controller\n * @name SidenavController\n * @module material.components.sidenav\n *\n */\nfunction SidenavController($scope, $element, $attrs, $mdComponentRegistry, $q) {\n\n var self = this;\n\n // Use Default internal method until overridden by directive postLink\n\n // Synchronous getters\n self.isOpen = function() { return !!$scope.isOpen; };\n self.isLockedOpen = function() { return !!$scope.isLockedOpen; };\n\n // Async actions\n self.open = function() { return self.$toggleOpen( true ); };\n self.close = function() { return self.$toggleOpen( false ); };\n self.toggle = function() { return self.$toggleOpen( !$scope.isOpen ); };\n self.$toggleOpen = function(value) { return $q.when($scope.isOpen = value); };\n\n self.destroy = $mdComponentRegistry.register(self, $attrs.mdComponentId);\n}\nSidenavController.$inject = [\"$scope\", \"$element\", \"$attrs\", \"$mdComponentRegistry\", \"$q\"];\n\n})();\n(function(){\n\"use strict\";\n\n /**\n * @ngdoc module\n * @name material.components.slider\n */\n angular.module('material.components.slider', [\n 'material.core'\n ])\n .directive('mdSlider', SliderDirective);\n\n/**\n * @ngdoc directive\n * @name mdSlider\n * @module material.components.slider\n * @restrict E\n * @description\n * The `<md-slider>` component allows the user to choose from a range of\n * values.\n *\n * As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)\n * the slider is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * It has two modes: 'normal' mode, where the user slides between a wide range\n * of values, and 'discrete' mode, where the user slides between only a few\n * select values.\n *\n * To enable discrete mode, add the `md-discrete` attribute to a slider,\n * and use the `step` attribute to change the distance between\n * values the user is allowed to pick.\n *\n * @usage\n * <h4>Normal Mode</h4>\n * <hljs lang=\"html\">\n * <md-slider ng-model=\"myValue\" min=\"5\" max=\"500\">\n * </md-slider>\n * </hljs>\n * <h4>Discrete Mode</h4>\n * <hljs lang=\"html\">\n * <md-slider md-discrete ng-model=\"myDiscreteValue\" step=\"10\" min=\"10\" max=\"130\">\n * </md-slider>\n * </hljs>\n *\n * @param {boolean=} md-discrete Whether to enable discrete mode.\n * @param {number=} step The distance between values the user is allowed to pick. Default 1.\n * @param {number=} min The minimum value the user is allowed to pick. Default 0.\n * @param {number=} max The maximum value the user is allowed to pick. Default 100.\n */\nfunction SliderDirective($$rAF, $window, $mdAria, $mdUtil, $mdConstant, $mdTheming, $mdGesture, $parse, $log) {\n return {\n scope: {},\n require: '?ngModel',\n template:\n '<div class=\"md-slider-wrapper\">' +\n '<div class=\"md-track-container\">' +\n '<div class=\"md-track\"></div>' +\n '<div class=\"md-track md-track-fill\"></div>' +\n '<div class=\"md-track-ticks\"></div>' +\n '</div>' +\n '<div class=\"md-thumb-container\">' +\n '<div class=\"md-thumb\"></div>' +\n '<div class=\"md-focus-thumb\"></div>' +\n '<div class=\"md-focus-ring\"></div>' +\n '<div class=\"md-sign\">' +\n '<span class=\"md-thumb-text\"></span>' +\n '</div>' +\n '<div class=\"md-disabled-thumb\"></div>' +\n '</div>' +\n '</div>',\n compile: compile\n };\n\n // **********************************************************\n // Private Methods\n // **********************************************************\n\n function compile (tElement, tAttrs) {\n if (!tAttrs.tabindex) tElement.attr('tabindex', 0);\n tElement.attr('role', 'slider');\n\n $mdAria.expect(tElement, 'aria-label');\n\n return postLink;\n }\n\n function postLink(scope, element, attr, ngModelCtrl) {\n $mdTheming(element);\n ngModelCtrl = ngModelCtrl || {\n // Mock ngModelController if it doesn't exist to give us\n // the minimum functionality needed\n $setViewValue: function(val) {\n this.$viewValue = val;\n this.$viewChangeListeners.forEach(function(cb) { cb(); });\n },\n $parsers: [],\n $formatters: [],\n $viewChangeListeners: []\n };\n\n var isDisabled = false;\n\n attr.$observe('disabled', function (value) {\n isDisabled = $mdUtil.parseAttributeBoolean(value, false);\n updateAriaDisabled();\n });\n\n var thumb = angular.element(element[0].querySelector('.md-thumb'));\n var thumbText = angular.element(element[0].querySelector('.md-thumb-text'));\n var thumbContainer = thumb.parent();\n var trackContainer = angular.element(element[0].querySelector('.md-track-container'));\n var activeTrack = angular.element(element[0].querySelector('.md-track-fill'));\n var tickContainer = angular.element(element[0].querySelector('.md-track-ticks'));\n var throttledRefreshDimensions = $mdUtil.throttle(refreshSliderDimensions, 5000);\n\n // Default values, overridable by attrs\n angular.isDefined(attr.min) ? attr.$observe('min', updateMin) : updateMin(0);\n angular.isDefined(attr.max) ? attr.$observe('max', updateMax) : updateMax(100);\n angular.isDefined(attr.step)? attr.$observe('step', updateStep) : updateStep(1);\n\n $mdGesture.register(element, 'drag');\n\n element\n .on('keydown', keydownListener)\n .on('$md.pressdown', onPressDown)\n .on('$md.pressup', onPressUp)\n .on('$md.dragstart', onDragStart)\n .on('$md.drag', onDrag)\n .on('$md.dragend', onDragEnd);\n\n // On resize, recalculate the slider's dimensions and re-render\n function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }\n setTimeout(updateAll, 0);\n\n var debouncedUpdateAll = $$rAF.throttle(updateAll);\n angular.element($window).on('resize', debouncedUpdateAll);\n\n scope.$on('$destroy', function() {\n angular.element($window).off('resize', debouncedUpdateAll);\n });\n\n ngModelCtrl.$render = ngModelRender;\n ngModelCtrl.$viewChangeListeners.push(ngModelRender);\n ngModelCtrl.$formatters.push(minMaxValidator);\n ngModelCtrl.$formatters.push(stepValidator);\n\n /**\n * Attributes\n */\n var min;\n var max;\n var step;\n function updateMin(value) {\n min = parseFloat(value);\n element.attr('aria-valuemin', value);\n updateAll();\n }\n function updateMax(value) {\n max = parseFloat(value);\n element.attr('aria-valuemax', value);\n updateAll();\n }\n function updateStep(value) {\n step = parseFloat(value);\n redrawTicks();\n }\n function updateAriaDisabled() {\n element.attr('aria-disabled', !!isDisabled);\n }\n\n // Draw the ticks with canvas.\n // The alternative to drawing ticks with canvas is to draw one element for each tick,\n // which could quickly become a performance bottleneck.\n var tickCanvas, tickCtx;\n function redrawTicks() {\n if (!angular.isDefined(attr.mdDiscrete)) return;\n if ( angular.isUndefined(step) ) return;\n\n if ( step <= 0 ) {\n var msg = 'Slider step value must be greater than zero when in discrete mode';\n $log.error(msg);\n throw new Error(msg);\n }\n\n var numSteps = Math.floor( (max - min) / step );\n if (!tickCanvas) {\n tickCanvas = angular.element('<canvas>').css('position', 'absolute');\n tickContainer.append(tickCanvas);\n\n var trackTicksStyle = $window.getComputedStyle(tickContainer[0]);\n tickCtx = tickCanvas[0].getContext('2d');\n tickCtx.fillStyle = trackTicksStyle.backgroundColor || 'black';\n }\n\n var dimensions = getSliderDimensions();\n tickCanvas[0].width = dimensions.width;\n tickCanvas[0].height = dimensions.height;\n\n var distance;\n for (var i = 0; i <= numSteps; i++) {\n distance = Math.floor(dimensions.width * (i / numSteps));\n tickCtx.fillRect(distance - 1, 0, 2, dimensions.height);\n }\n }\n\n\n /**\n * Refreshing Dimensions\n */\n var sliderDimensions = {};\n refreshSliderDimensions();\n function refreshSliderDimensions() {\n sliderDimensions = trackContainer[0].getBoundingClientRect();\n }\n function getSliderDimensions() {\n throttledRefreshDimensions();\n return sliderDimensions;\n }\n\n /**\n * left/right arrow listener\n */\n function keydownListener(ev) {\n if (isDisabled) return;\n\n var changeAmount;\n if (ev.keyCode === $mdConstant.KEY_CODE.LEFT_ARROW) {\n changeAmount = -step;\n } else if (ev.keyCode === $mdConstant.KEY_CODE.RIGHT_ARROW) {\n changeAmount = step;\n }\n if (changeAmount) {\n if (ev.metaKey || ev.ctrlKey || ev.altKey) {\n changeAmount *= 4;\n }\n ev.preventDefault();\n ev.stopPropagation();\n scope.$evalAsync(function() {\n setModelValue(ngModelCtrl.$viewValue + changeAmount);\n });\n }\n }\n\n /**\n * ngModel setters and validators\n */\n function setModelValue(value) {\n ngModelCtrl.$setViewValue( minMaxValidator(stepValidator(value)) );\n }\n function ngModelRender() {\n if (isNaN(ngModelCtrl.$viewValue)) {\n ngModelCtrl.$viewValue = ngModelCtrl.$modelValue;\n }\n\n var percent = (ngModelCtrl.$viewValue - min) / (max - min);\n scope.modelValue = ngModelCtrl.$viewValue;\n element.attr('aria-valuenow', ngModelCtrl.$viewValue);\n setSliderPercent(percent);\n thumbText.text( ngModelCtrl.$viewValue );\n }\n\n function minMaxValidator(value) {\n if (angular.isNumber(value)) {\n return Math.max(min, Math.min(max, value));\n }\n }\n function stepValidator(value) {\n if (angular.isNumber(value)) {\n var formattedValue = (Math.round((value - min) / step) * step + min);\n // Format to 3 digits after the decimal point - fixes #2015.\n return (Math.round(formattedValue * 1000) / 1000);\n }\n }\n\n /**\n * @param percent 0-1\n */\n function setSliderPercent(percent) {\n\n percent = clamp(percent);\n\n var percentStr = (percent * 100) + '%';\n\n activeTrack.css('width', percentStr);\n thumbContainer.css('left',percentStr);\n\n element.toggleClass('md-min', percent === 0);\n element.toggleClass('md-max', percent === 1);\n }\n\n\n /**\n * Slide listeners\n */\n var isDragging = false;\n var isDiscrete = angular.isDefined(attr.mdDiscrete);\n\n function onPressDown(ev) {\n if (isDisabled) return;\n\n element.addClass('md-active');\n element[0].focus();\n refreshSliderDimensions();\n\n var exactVal = percentToValue( positionToPercent( ev.pointer.x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n scope.$apply(function() {\n setModelValue( closestVal );\n setSliderPercent( valueToPercent(closestVal));\n });\n }\n function onPressUp(ev) {\n if (isDisabled) return;\n\n element.removeClass('md-dragging md-active');\n\n var exactVal = percentToValue( positionToPercent( ev.pointer.x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n scope.$apply(function() {\n setModelValue(closestVal);\n ngModelRender();\n });\n }\n function onDragStart(ev) {\n if (isDisabled) return;\n isDragging = true;\n ev.stopPropagation();\n\n element.addClass('md-dragging');\n setSliderFromEvent(ev);\n }\n function onDrag(ev) {\n if (!isDragging) return;\n ev.stopPropagation();\n setSliderFromEvent(ev);\n }\n function onDragEnd(ev) {\n if (!isDragging) return;\n ev.stopPropagation();\n isDragging = false;\n }\n\n function setSliderFromEvent(ev) {\n // While panning discrete, update only the\n // visual positioning but not the model value.\n if ( isDiscrete ) adjustThumbPosition( ev.pointer.x );\n else doSlide( ev.pointer.x );\n }\n\n /**\n * Slide the UI by changing the model value\n * @param x\n */\n function doSlide( x ) {\n scope.$evalAsync( function() {\n setModelValue( percentToValue( positionToPercent(x) ));\n });\n }\n\n /**\n * Slide the UI without changing the model (while dragging/panning)\n * @param x\n */\n function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }\n\n /**\n * Clamps the value to be between 0 and 1.\n * @param {number} value The value to clamp.\n * @returns {number}\n */\n function clamp(value) {\n return Math.max(0, Math.min(value || 0, 1));\n }\n\n /**\n * Convert horizontal position on slider to percentage value of offset from beginning...\n * @param x\n * @returns {number}\n */\n function positionToPercent( x ) {\n return Math.max(0, Math.min(1, (x - sliderDimensions.left) / (sliderDimensions.width)));\n }\n\n /**\n * Convert percentage offset on slide to equivalent model value\n * @param percent\n * @returns {*}\n */\n function percentToValue( percent ) {\n return (min + percent * (max - min));\n }\n\n function valueToPercent( val ) {\n return (val - min)/(max - min);\n }\n }\n}\nSliderDirective.$inject = [\"$$rAF\", \"$window\", \"$mdAria\", \"$mdUtil\", \"$mdConstant\", \"$mdTheming\", \"$mdGesture\", \"$parse\", \"$log\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.sticky\n * @description\n * Sticky effects for md\n *\n */\nangular\n .module('material.components.sticky', [\n 'material.core',\n 'material.components.content'\n ])\n .factory('$mdSticky', MdSticky);\n\n/**\n * @ngdoc service\n * @name $mdSticky\n * @module material.components.sticky\n *\n * @description\n * The `$mdSticky`service provides a mixin to make elements sticky.\n *\n * By default the `$mdSticky` service compiles the cloned element, when not specified through the `elementClone`\n * parameter, in the same scope as the actual element lives.\n *\n *\n * <h3>Notes</h3>\n * When using an element which is containing a compiled directive, which changed its DOM structure during compilation,\n * you should compile the clone yourself using the plain template.<br/><br/>\n * See the right usage below:\n * <hljs lang=\"js\">\n * angular.module('myModule')\n * .directive('stickySelect', function($mdSticky, $compile) {\n * var SELECT_TEMPLATE =\n * '<md-select ng-model=\"selected\">' +\n * '<md-option>Option 1</md-option>' +\n * '</md-select>';\n *\n * return {\n * restrict: 'E',\n * replace: true,\n * template: SELECT_TEMPLATE,\n * link: function(scope,element) {\n * $mdSticky(scope, element, $compile(SELECT_TEMPLATE)(scope));\n * }\n * };\n * });\n * </hljs>\n *\n * @usage\n * <hljs lang=\"js\">\n * angular.module('myModule')\n * .directive('stickyText', function($mdSticky, $compile) {\n * return {\n * restrict: 'E',\n * template: '<span>Sticky Text</span>',\n * link: function(scope,element) {\n * $mdSticky(scope, element);\n * }\n * };\n * });\n * </hljs>\n *\n * @returns A `$mdSticky` function that takes three arguments:\n * - `scope`\n * - `element`: The element that will be 'sticky'\n * - `elementClone`: A clone of the element, that will be shown\n * when the user starts scrolling past the original element.\n * If not provided, it will use the result of `element.clone()` and compiles it in the given scope.\n */\nfunction MdSticky($document, $mdConstant, $$rAF, $mdUtil, $compile) {\n\n var browserStickySupport = checkStickySupport();\n\n /**\n * Registers an element as sticky, used internally by directives to register themselves\n */\n return function registerStickyElement(scope, element, stickyClone) {\n var contentCtrl = element.controller('mdContent');\n if (!contentCtrl) return;\n\n if (browserStickySupport) {\n element.css({\n position: browserStickySupport,\n top: 0,\n 'z-index': 2\n });\n } else {\n var $$sticky = contentCtrl.$element.data('$$sticky');\n if (!$$sticky) {\n $$sticky = setupSticky(contentCtrl);\n contentCtrl.$element.data('$$sticky', $$sticky);\n }\n\n // Compile our cloned element, when cloned in this service, into the given scope.\n var cloneElement = stickyClone || $compile(element.clone())(scope);\n\n var deregister = $$sticky.add(element, cloneElement);\n scope.$on('$destroy', deregister);\n }\n };\n\n function setupSticky(contentCtrl) {\n var contentEl = contentCtrl.$element;\n\n // Refresh elements is very expensive, so we use the debounced\n // version when possible.\n var debouncedRefreshElements = $$rAF.throttle(refreshElements);\n\n // setupAugmentedScrollEvents gives us `$scrollstart` and `$scroll`,\n // more reliable than `scroll` on android.\n setupAugmentedScrollEvents(contentEl);\n contentEl.on('$scrollstart', debouncedRefreshElements);\n contentEl.on('$scroll', onScroll);\n\n var self;\n return self = {\n prev: null,\n current: null, //the currently stickied item\n next: null,\n items: [],\n add: add,\n refreshElements: refreshElements\n };\n\n /***************\n * Public\n ***************/\n // Add an element and its sticky clone to this content's sticky collection\n function add(element, stickyClone) {\n stickyClone.addClass('md-sticky-clone');\n\n var item = {\n element: element,\n clone: stickyClone\n };\n self.items.push(item);\n\n $mdUtil.nextTick(function() {\n contentEl.prepend(item.clone);\n });\n\n debouncedRefreshElements();\n\n return function remove() {\n self.items.forEach(function(item, index) {\n if (item.element[0] === element[0]) {\n self.items.splice(index, 1);\n item.clone.remove();\n }\n });\n debouncedRefreshElements();\n };\n }\n\n function refreshElements() {\n // Sort our collection of elements by their current position in the DOM.\n // We need to do this because our elements' order of being added may not\n // be the same as their order of display.\n self.items.forEach(refreshPosition);\n self.items = self.items.sort(function(a, b) {\n return a.top < b.top ? -1 : 1;\n });\n\n // Find which item in the list should be active, \n // based upon the content's current scroll position\n var item;\n var currentScrollTop = contentEl.prop('scrollTop');\n for (var i = self.items.length - 1; i >= 0; i--) {\n if (currentScrollTop > self.items[i].top) {\n item = self.items[i];\n break;\n }\n }\n setCurrentItem(item);\n }\n\n /***************\n * Private\n ***************/\n\n // Find the `top` of an item relative to the content element,\n // and also the height.\n function refreshPosition(item) {\n // Find the top of an item by adding to the offsetHeight until we reach the \n // content element.\n var current = item.element[0];\n item.top = 0;\n item.left = 0;\n while (current && current !== contentEl[0]) {\n item.top += current.offsetTop;\n item.left += current.offsetLeft;\n if ( current.offsetParent ){\n item.right += current.offsetParent.offsetWidth - current.offsetWidth - current.offsetLeft; //Compute offsetRight\n }\n current = current.offsetParent;\n }\n item.height = item.element.prop('offsetHeight');\n item.clone.css('margin-left', item.left + 'px');\n if ($mdUtil.floatingScrollbars()) {\n item.clone.css('margin-right', '0');\n }\n }\n\n // As we scroll, push in and select the correct sticky element.\n function onScroll() {\n var scrollTop = contentEl.prop('scrollTop');\n var isScrollingDown = scrollTop > (onScroll.prevScrollTop || 0);\n\n // Store the previous scroll so we know which direction we are scrolling\n onScroll.prevScrollTop = scrollTop;\n\n //\n // AT TOP (not scrolling)\n //\n if (scrollTop === 0) {\n // If we're at the top, just clear the current item and return\n setCurrentItem(null);\n return;\n }\n\n //\n // SCROLLING DOWN (going towards the next item)\n //\n if (isScrollingDown) {\n\n // If we've scrolled down past the next item's position, sticky it and return\n if (self.next && self.next.top <= scrollTop) {\n setCurrentItem(self.next);\n return;\n }\n\n // If the next item is close to the current one, push the current one up out of the way\n if (self.current && self.next && self.next.top - scrollTop <= self.next.height) {\n translate(self.current, scrollTop + (self.next.top - self.next.height - scrollTop));\n return;\n }\n }\n\n //\n // SCROLLING UP (not at the top & not scrolling down; must be scrolling up)\n //\n if (!isScrollingDown) {\n\n // If we've scrolled up past the previous item's position, sticky it and return\n if (self.current && self.prev && scrollTop < self.current.top) {\n setCurrentItem(self.prev);\n return;\n }\n\n // If the next item is close to the current one, pull the current one down into view\n if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {\n translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));\n return;\n }\n }\n\n //\n // Otherwise, just move the current item to the proper place (scrolling up or down)\n //\n if (self.current) {\n translate(self.current, scrollTop);\n }\n }\n\n function setCurrentItem(item) {\n if (self.current === item) return;\n // Deactivate currently active item\n if (self.current) {\n translate(self.current, null);\n setStickyState(self.current, null);\n }\n\n // Activate new item if given\n if (item) {\n setStickyState(item, 'active');\n }\n\n self.current = item;\n var index = self.items.indexOf(item);\n // If index === -1, index + 1 = 0. It works out.\n self.next = self.items[index + 1];\n self.prev = self.items[index - 1];\n setStickyState(self.next, 'next');\n setStickyState(self.prev, 'prev');\n }\n\n function setStickyState(item, state) {\n if (!item || item.state === state) return;\n if (item.state) {\n item.clone.attr('sticky-prev-state', item.state);\n item.element.attr('sticky-prev-state', item.state);\n }\n item.clone.attr('sticky-state', state);\n item.element.attr('sticky-state', state);\n item.state = state;\n }\n\n function translate(item, amount) {\n if (!item) return;\n if (amount === null || amount === undefined) {\n if (item.translateY) {\n item.translateY = null;\n item.clone.css($mdConstant.CSS.TRANSFORM, '');\n }\n } else {\n item.translateY = amount;\n item.clone.css(\n $mdConstant.CSS.TRANSFORM,\n 'translate3d(' + item.left + 'px,' + amount + 'px,0)'\n );\n }\n }\n }\n\n // Function to check for browser sticky support\n function checkStickySupport($el) {\n var stickyProp;\n var testEl = angular.element('<div>');\n $document[0].body.appendChild(testEl[0]);\n\n var stickyProps = ['sticky', '-webkit-sticky'];\n for (var i = 0; i < stickyProps.length; ++i) {\n testEl.css({position: stickyProps[i], top: 0, 'z-index': 2});\n if (testEl.css('position') == stickyProps[i]) {\n stickyProp = stickyProps[i];\n break;\n }\n }\n testEl.remove();\n return stickyProp;\n }\n\n // Android 4.4 don't accurately give scroll events.\n // To fix this problem, we setup a fake scroll event. We say:\n // > If a scroll or touchmove event has happened in the last DELAY milliseconds, \n // then send a `$scroll` event every animationFrame.\n // Additionally, we add $scrollstart and $scrollend events.\n function setupAugmentedScrollEvents(element) {\n var SCROLL_END_DELAY = 200;\n var isScrolling;\n var lastScrollTime;\n element.on('scroll touchmove', function() {\n if (!isScrolling) {\n isScrolling = true;\n $$rAF.throttle(loopScrollEvent);\n element.triggerHandler('$scrollstart');\n }\n element.triggerHandler('$scroll');\n lastScrollTime = +$mdUtil.now();\n });\n\n function loopScrollEvent() {\n if (+$mdUtil.now() - lastScrollTime > SCROLL_END_DELAY) {\n isScrolling = false;\n element.triggerHandler('$scrollend');\n } else {\n element.triggerHandler('$scroll');\n $$rAF.throttle(loopScrollEvent);\n }\n }\n }\n\n}\nMdSticky.$inject = [\"$document\", \"$mdConstant\", \"$$rAF\", \"$mdUtil\", \"$compile\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.subheader\n * @description\n * SubHeader module\n *\n * Subheaders are special list tiles that delineate distinct sections of a\n * list or grid list and are typically related to the current filtering or\n * sorting criteria. Subheader tiles are either displayed inline with tiles or\n * can be associated with content, for example, in an adjacent column.\n *\n * Upon scrolling, subheaders remain pinned to the top of the screen and remain\n * pinned until pushed on or off screen by the next subheader. @see [Material\n * Design Specifications](https://www.google.com/design/spec/components/subheaders.html)\n *\n * > To improve the visual grouping of content, use the system color for your subheaders.\n *\n */\nangular\n .module('material.components.subheader', [\n 'material.core',\n 'material.components.sticky'\n ])\n .directive('mdSubheader', MdSubheaderDirective);\n\n/**\n * @ngdoc directive\n * @name mdSubheader\n * @module material.components.subheader\n *\n * @restrict E\n *\n * @description\n * The `<md-subheader>` directive is a subheader for a section. By default it is sticky.\n * You can make it not sticky by applying the `md-no-sticky` class to the subheader.\n *\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-subheader>Online Friends</md-subheader>\n * </hljs>\n */\n\nfunction MdSubheaderDirective($mdSticky, $compile, $mdTheming, $mdUtil) {\n return {\n restrict: 'E',\n replace: true,\n transclude: true,\n template: (\n '<div class=\"md-subheader\">' +\n ' <div class=\"md-subheader-inner\">' +\n ' <span class=\"md-subheader-content\"></span>' +\n ' </div>' +\n '</div>'\n ),\n link: function postLink(scope, element, attr, controllers, transclude) {\n $mdTheming(element);\n var outerHTML = element[0].outerHTML;\n\n function getContent(el) {\n return angular.element(el[0].querySelector('.md-subheader-content'));\n }\n\n // Transclude the user-given contents of the subheader\n // the conventional way.\n transclude(scope, function(clone) {\n getContent(element).append(clone);\n });\n\n // Create another clone, that uses the outer and inner contents\n // of the element, that will be 'stickied' as the user scrolls.\n if (!element.hasClass('md-no-sticky')) {\n transclude(scope, function(clone) {\n // If the user adds an ng-if or ng-repeat directly to the md-subheader element, the\n // compiled clone below will only be a comment tag (since they replace their elements with\n // a comment) which cannot be properly passed to the $mdSticky; so we wrap it in our own\n // DIV to ensure we have something $mdSticky can use\n var wrapperHtml = '<div class=\"md-subheader-wrapper\">' + outerHTML + '</div>';\n var stickyClone = $compile(wrapperHtml)(scope);\n\n // Append the sticky\n $mdSticky(scope, element, stickyClone);\n\n // Delay initialization until after any `ng-if`/`ng-repeat`/etc has finished before\n // attempting to create the clone\n $mdUtil.nextTick(function() {\n getContent(stickyClone).append(clone);\n });\n });\n }\n }\n }\n}\nMdSubheaderDirective.$inject = [\"$mdSticky\", \"$compile\", \"$mdTheming\", \"$mdUtil\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.swipe\n * @description Swipe module!\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeLeft\n *\n * @restrict A\n *\n * @description\n * The md-swipe-left directive allows you to specify custom behavior when an element is swiped\n * left.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-left=\"onSwipeLeft()\">Swipe me left!</div>\n * </hljs>\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeRight\n *\n * @restrict A\n *\n * @description\n * The md-swipe-right directive allows you to specify custom behavior when an element is swiped\n * right.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-right=\"onSwipeRight()\">Swipe me right!</div>\n * </hljs>\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeUp\n *\n * @restrict A\n *\n * @description\n * The md-swipe-up directive allows you to specify custom behavior when an element is swiped\n * up.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-up=\"onSwipeUp()\">Swipe me up!</div>\n * </hljs>\n */\n/**\n * @ngdoc directive\n * @module material.components.swipe\n * @name mdSwipeDown\n *\n * @restrict A\n *\n * @description\n * The md-swipe-down directive allows you to specify custom behavior when an element is swiped\n * down.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div md-swipe-down=\"onSwipDown()\">Swipe me down!</div>\n * </hljs>\n */\n\nangular.module('material.components.swipe', ['material.core'])\n .directive('mdSwipeLeft', getDirective('SwipeLeft'))\n .directive('mdSwipeRight', getDirective('SwipeRight'))\n .directive('mdSwipeUp', getDirective('SwipeUp'))\n .directive('mdSwipeDown', getDirective('SwipeDown'));\n\nfunction getDirective(name) {\n var directiveName = 'md' + name;\n var eventName = '$md.' + name.toLowerCase();\n\n DirectiveFactory.$inject = [\"$parse\"];\n return DirectiveFactory;\n\n /* @ngInject */\n function DirectiveFactory($parse) {\n return { restrict: 'A', link: postLink };\n function postLink(scope, element, attr) {\n var fn = $parse(attr[directiveName]);\n element.on(eventName, function(ev) {\n scope.$apply(function() { fn(scope, { $event: ev }); });\n });\n }\n }\n}\n\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @private\n * @ngdoc module\n * @name material.components.switch\n */\n\nangular.module('material.components.switch', [\n 'material.core',\n 'material.components.checkbox'\n])\n .directive('mdSwitch', MdSwitch);\n\n/**\n * @private\n * @ngdoc directive\n * @module material.components.switch\n * @name mdSwitch\n * @restrict E\n *\n * The switch directive is used very much like the normal [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D).\n *\n * As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)\n * the switch is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * @param {string} ng-model Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ng-true-value The value to which the expression should be set when selected.\n * @param {expression=} ng-false-value The value to which the expression should be set when not selected.\n * @param {string=} ng-change Angular expression to be executed when input changes due to user interaction with the input element.\n * @param {expression=} ng-disabled En/Disable based on the expression.\n * @param {boolean=} md-no-ink Use of attribute indicates use of ripple ink effects.\n * @param {string=} aria-label Publish the button label used by screen-readers for accessibility. Defaults to the switch's text.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-switch ng-model=\"isActive\" aria-label=\"Finished?\">\n * Finished ?\n * </md-switch>\n *\n * <md-switch md-no-ink ng-model=\"hasInk\" aria-label=\"No Ink Effects\">\n * No Ink Effects\n * </md-switch>\n *\n * <md-switch ng-disabled=\"true\" ng-model=\"isDisabled\" aria-label=\"Disabled\">\n * Disabled\n * </md-switch>\n *\n * </hljs>\n */\nfunction MdSwitch(mdCheckboxDirective, $mdUtil, $mdConstant, $parse, $$rAF, $mdGesture) {\n var checkboxDirective = mdCheckboxDirective[0];\n\n return {\n restrict: 'E',\n priority: 210, // Run before ngAria\n transclude: true,\n template:\n '<div class=\"md-container\">' +\n '<div class=\"md-bar\"></div>' +\n '<div class=\"md-thumb-container\">' +\n '<div class=\"md-thumb\" md-ink-ripple md-ink-ripple-checkbox></div>' +\n '</div>'+\n '</div>' +\n '<div ng-transclude class=\"md-label\"></div>',\n require: '?ngModel',\n compile: mdSwitchCompile\n };\n\n function mdSwitchCompile(element, attr) {\n var checkboxLink = checkboxDirective.compile(element, attr);\n // No transition on initial load.\n element.addClass('md-dragging');\n\n return function (scope, element, attr, ngModel) {\n ngModel = ngModel || $mdUtil.fakeNgModel();\n\n var disabledGetter = null;\n if (attr.disabled != null) {\n disabledGetter = function() { return true; };\n } else if (attr.ngDisabled) {\n disabledGetter = $parse(attr.ngDisabled);\n }\n\n var thumbContainer = angular.element(element[0].querySelector('.md-thumb-container'));\n var switchContainer = angular.element(element[0].querySelector('.md-container'));\n\n // no transition on initial load\n $$rAF(function() {\n element.removeClass('md-dragging');\n });\n\n checkboxLink(scope, element, attr, ngModel);\n\n if (disabledGetter) {\n scope.$watch(disabledGetter, function(isDisabled) {\n element.attr('tabindex', isDisabled ? -1 : 0);\n });\n }\n\n // These events are triggered by setup drag\n $mdGesture.register(switchContainer, 'drag');\n switchContainer\n .on('$md.dragstart', onDragStart)\n .on('$md.drag', onDrag)\n .on('$md.dragend', onDragEnd);\n\n var drag;\n function onDragStart(ev) {\n // Don't go if the switch is disabled.\n if (disabledGetter && disabledGetter(scope)) return;\n ev.stopPropagation();\n\n element.addClass('md-dragging');\n drag = {width: thumbContainer.prop('offsetWidth')};\n element.removeClass('transition');\n }\n\n function onDrag(ev) {\n if (!drag) return;\n ev.stopPropagation();\n ev.srcEvent && ev.srcEvent.preventDefault();\n\n var percent = ev.pointer.distanceX / drag.width;\n\n //if checked, start from right. else, start from left\n var translate = ngModel.$viewValue ? 1 + percent : percent;\n // Make sure the switch stays inside its bounds, 0-1%\n translate = Math.max(0, Math.min(1, translate));\n\n thumbContainer.css($mdConstant.CSS.TRANSFORM, 'translate3d(' + (100*translate) + '%,0,0)');\n drag.translate = translate;\n }\n\n function onDragEnd(ev) {\n if (!drag) return;\n ev.stopPropagation();\n\n element.removeClass('md-dragging');\n thumbContainer.css($mdConstant.CSS.TRANSFORM, '');\n\n // We changed if there is no distance (this is a click a click),\n // or if the drag distance is >50% of the total.\n var isChanged = ngModel.$viewValue ? drag.translate > 0.5 : drag.translate < 0.5;\n if (isChanged) {\n applyModelValue(!ngModel.$viewValue);\n }\n drag = null;\n }\n\n function applyModelValue(newValue) {\n scope.$apply(function() {\n ngModel.$setViewValue(newValue);\n ngModel.$render();\n });\n }\n\n };\n }\n\n\n}\nMdSwitch.$inject = [\"mdCheckboxDirective\", \"$mdUtil\", \"$mdConstant\", \"$parse\", \"$$rAF\", \"$mdGesture\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.toast\n * @description\n * Toast\n */\nangular.module('material.components.toast', [\n 'material.core',\n 'material.components.button'\n])\n .directive('mdToast', MdToastDirective)\n .provider('$mdToast', MdToastProvider);\n\n/* @ngInject */\nfunction MdToastDirective($mdToast) {\n return {\n restrict: 'E',\n link: function postLink(scope, element, attr) {\n // When navigation force destroys an interimElement, then\n // listen and $destroy() that interim instance...\n scope.$on('$destroy', function() {\n $mdToast.destroy();\n });\n }\n };\n}\nMdToastDirective.$inject = [\"$mdToast\"];\n\n/**\n * @ngdoc service\n * @name $mdToast\n * @module material.components.toast\n *\n * @description\n * `$mdToast` is a service to build a toast notification on any position\n * on the screen with an optional duration, and provides a simple promise API.\n *\n * The toast will be always positioned at the `bottom`, when the screen size is\n * between `600px` and `959px` (`sm` breakpoint)\n *\n * ## Restrictions on custom toasts\n * - The toast's template must have an outer `<md-toast>` element.\n * - For a toast action, use element with class `md-action`.\n * - Add the class `md-capsule` for curved corners.\n *\n * ## Parent container notes\n *\n * The toast is positioned using absolute positioning relative to it's first non-static parent\n * container. Thus, if the requested parent container uses static positioning, we will temporarily\n * set it's positioning to `relative` while the toast is visible and reset it when the toast is\n * hidden.\n *\n * Because of this, it is usually best to ensure that the parent container has a fixed height and\n * prevents scrolling by setting the `overflow: hidden;` style. Since the position is based off of\n * the parent's height, the toast may be mispositioned if you allow the parent to scroll.\n *\n * You can, however, have a scrollable element inside of the container; just make sure the\n * container itself does not scroll.\n *\n * <hljs lang=\"html\">\n * <div layout-fill id=\"toast-container\">\n * <md-content>\n * I can have lots of content and scroll!\n * </md-content>\n * </div>\n * </hljs>\n *\n * @usage\n * <hljs lang=\"html\">\n * <div ng-controller=\"MyController\">\n * <md-button ng-click=\"openToast()\">\n * Open a Toast!\n * </md-button>\n * </div>\n * </hljs>\n *\n * <hljs lang=\"js\">\n * var app = angular.module('app', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdToast) {\n * $scope.openToast = function($event) {\n * $mdToast.show($mdToast.simple().textContent('Hello!'));\n * // Could also do $mdToast.showSimple('Hello');\n * };\n * });\n * </hljs>\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#showSimple\n * \n * @param {string} message The message to display inside the toast\n * @description\n * Convenience method which builds and shows a simple toast.\n *\n * @returns {promise} A promise that can be resolved with `$mdToast.hide()` or\n * rejected with `$mdToast.cancel()`.\n *\n */\n\n /**\n * @ngdoc method\n * @name $mdToast#simple\n *\n * @description\n * Builds a preconfigured toast.\n *\n * @returns {obj} a `$mdToastPreset` with the following chainable configuration methods.\n *\n * _**Note:** These configuration methods are provided in addition to the methods provided by\n * the `build()` and `show()` methods below._\n *\n * - `.textContent(string)` - Sets the toast content to the specified string.\n *\n * - `.action(string)` - Adds an action button. If clicked, the promise (returned from `show()`)\n * will resolve with the value `'ok'`; otherwise, it is resolved with `true` after a `hideDelay`\n * timeout.\n *\n * - `.highlightAction(boolean)` - Whether or not the action button will have an additional\n * highlight class.\n *\n * - `.capsule(boolean)` - Whether or not to add the `md-capsule` class to the toast to provide\n * rounded corners.\n *\n * - `.theme(string)` - Sets the theme on the toast to the requested theme. Default is\n * `$mdThemingProvider`'s default.\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#updateTextContent\n *\n * @description\n * Updates the content of an existing toast. Useful for updating things like counts, etc.\n *\n */\n\n /**\n * @ngdoc method\n * @name $mdToast#build\n *\n * @description\n * Creates a custom `$mdToastPreset` that you can configure.\n *\n * @returns {obj} a `$mdToastPreset` with the chainable configuration methods for shows' options (see below).\n */\n\n /**\n * @ngdoc method\n * @name $mdToast#show\n *\n * @description Shows the toast.\n *\n * @param {object} optionsOrPreset Either provide an `$mdToastPreset` returned from `simple()`\n * and `build()`, or an options object with the following properties:\n *\n * - `templateUrl` - `{string=}`: The url of an html template file that will\n * be used as the content of the toast. Restrictions: the template must\n * have an outer `md-toast` element.\n * - `template` - `{string=}`: Same as templateUrl, except this is an actual\n * template string.\n * - `autoWrap` - `{boolean=}`: Whether or not to automatically wrap the template content with a\n * `<div class=\"md-toast-content\">` if one is not provided. Defaults to true. Can be disabled if you provide a\n * custom toast directive.\n * - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified, it will create a new child scope.\n * This scope will be destroyed when the toast is removed unless `preserveScope` is set to true.\n * - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false\n * - `hideDelay` - `{number=}`: How many milliseconds the toast should stay\n * active before automatically closing. Set to 0 or false to have the toast stay open until\n * closed manually. Default: 3000.\n * - `position` - `{string=}`: Where to place the toast. Available: any combination\n * of 'bottom', 'left', 'top', 'right'. Default: 'bottom left'.\n * - `controller` - `{string=}`: The controller to associate with this toast.\n * The controller will be injected the local `$mdToast.hide( )`, which is a function\n * used to hide the toast.\n * - `locals` - `{string=}`: An object containing key/value pairs. The keys will\n * be used as names of values to inject into the controller. For example,\n * `locals: {three: 3}` would inject `three` into the controller with the value\n * of 3.\n * - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.\n * - `resolve` - `{object=}`: Similar to locals, except it takes promises as values\n * and the toast will not open until the promises resolve.\n * - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n * - `parent` - `{element=}`: The element to append the toast to. Defaults to appending\n * to the root element of the application.\n *\n * @returns {promise} A promise that can be resolved with `$mdToast.hide()` or\n * rejected with `$mdToast.cancel()`. `$mdToast.hide()` will resolve either with a Boolean\n * value == 'true' or the value passed as an argument to `$mdToast.hide()`.\n * And `$mdToast.cancel()` will resolve the promise with a Boolean value == 'false'\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#hide\n *\n * @description\n * Hide an existing toast and resolve the promise returned from `$mdToast.show()`.\n *\n * @param {*=} response An argument for the resolved promise.\n *\n * @returns {promise} a promise that is called when the existing element is removed from the DOM.\n * The promise is resolved with either a Boolean value == 'true' or the value passed as the\n * argument to `.hide()`.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdToast#cancel\n *\n * @description\n * `DEPRECATED` - The promise returned from opening a toast is used only to notify about the closing of the toast.\n * As such, there isn't any reason to also allow that promise to be rejected,\n * since it's not clear what the difference between resolve and reject would be.\n *\n * Hide the existing toast and reject the promise returned from\n * `$mdToast.show()`.\n *\n * @param {*=} response An argument for the rejected promise.\n *\n * @returns {promise} a promise that is called when the existing element is removed from the DOM\n * The promise is resolved with a Boolean value == 'false'.\n *\n */\n\nfunction MdToastProvider($$interimElementProvider) {\n // Differentiate promise resolves: hide timeout (value == true) and hide action clicks (value == ok).\n var ACTION_RESOLVE = 'ok';\n\n var activeToastContent;\n var $mdToast = $$interimElementProvider('$mdToast')\n .setDefaults({\n methods: ['position', 'hideDelay', 'capsule', 'parent' ],\n options: toastDefaultOptions\n })\n .addPreset('simple', {\n argOption: 'textContent',\n methods: ['textContent', 'content', 'action', 'highlightAction', 'theme', 'parent'],\n options: /* @ngInject */ [\"$mdToast\", \"$mdTheming\", function($mdToast, $mdTheming) {\n var opts = {\n template:\n '<md-toast md-theme=\"{{ toast.theme }}\" ng-class=\"{\\'md-capsule\\': toast.capsule}\">' +\n ' <div class=\"md-toast-content\">' +\n ' <span flex role=\"alert\" aria-relevant=\"all\" aria-atomic=\"true\">' +\n ' {{ toast.content }}' +\n ' </span>' +\n ' <md-button class=\"md-action\" ng-if=\"toast.action\" ng-click=\"toast.resolve()\" ng-class=\"{\\'md-highlight\\': toast.highlightAction}\">' +\n ' {{ toast.action }}' +\n ' </md-button>' +\n ' </div>' +\n '</md-toast>',\n controller: /* @ngInject */ [\"$scope\", function mdToastCtrl($scope) {\n var self = this;\n $scope.$watch(function() { return activeToastContent; }, function() {\n self.content = activeToastContent;\n });\n this.resolve = function() {\n $mdToast.hide( ACTION_RESOLVE );\n };\n }],\n theme: $mdTheming.defaultTheme(),\n controllerAs: 'toast',\n bindToController: true\n };\n return opts;\n }]\n })\n .addMethod('updateTextContent', updateTextContent)\n .addMethod('updateContent', updateTextContent);\n\n function updateTextContent(newContent) {\n activeToastContent = newContent;\n }\n\n toastDefaultOptions.$inject = [\"$animate\", \"$mdToast\", \"$mdUtil\", \"$mdMedia\"];\n return $mdToast;\n\n /* @ngInject */\n function toastDefaultOptions($animate, $mdToast, $mdUtil, $mdMedia) {\n var SWIPE_EVENTS = '$md.swipeleft $md.swiperight $md.swipeup $md.swipedown';\n return {\n onShow: onShow,\n onRemove: onRemove,\n position: 'bottom left',\n themable: true,\n hideDelay: 3000,\n autoWrap: true,\n transformTemplate: function(template, options) {\n var shouldAddWrapper = options.autoWrap && template && !/md-toast-content/g.test(template);\n\n if (shouldAddWrapper) {\n // Root element of template will be <md-toast>. We need to wrap all of its content inside of\n // of <div class=\"md-toast-content\">. All templates provided here should be static, developer-controlled\n // content (meaning we're not attempting to guard against XSS).\n var templateRoot = document.createElement('md-template');\n templateRoot.innerHTML = template;\n\n for (var i = 0; i < templateRoot.children.length; i++) {\n if (templateRoot.children[i].nodeName === 'MD-TOAST') {\n var wrapper = angular.element('<div class=\"md-toast-content\">');\n wrapper.append(templateRoot.children[i].children);\n templateRoot.children[i].appendChild(wrapper[0]);\n }\n }\n\n\n return templateRoot.outerHTML;\n }\n\n return template || '';\n }\n };\n\n function onShow(scope, element, options) {\n activeToastContent = options.textContent || options.content; // support deprecated #content method\n\n var isSmScreen = !$mdMedia('gt-sm');\n\n element = $mdUtil.extractElementByName(element, 'md-toast', true);\n options.element = element;\n\n options.onSwipe = function(ev, gesture) {\n //Add the relevant swipe class to the element so it can animate correctly\n var swipe = ev.type.replace('$md.','');\n var direction = swipe.replace('swipe', '');\n\n // If the swipe direction is down/up but the toast came from top/bottom don't fade away\n // Unless the screen is small, then the toast always on bottom\n if ((direction === 'down' && options.position.indexOf('top') != -1 && !isSmScreen) ||\n (direction === 'up' && (options.position.indexOf('bottom') != -1 || isSmScreen))) {\n return;\n }\n\n if ((direction === 'left' || direction === 'right') && isSmScreen) {\n return;\n }\n\n element.addClass('md-' + swipe);\n $mdUtil.nextTick($mdToast.cancel);\n };\n options.openClass = toastOpenClass(options.position);\n\n\n // 'top left' -> 'md-top md-left'\n options.parent.addClass(options.openClass);\n\n // static is the default position\n if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) {\n options.parent.css('position', 'relative');\n }\n\n element.on(SWIPE_EVENTS, options.onSwipe);\n element.addClass(isSmScreen ? 'md-bottom' : options.position.split(' ').map(function(pos) {\n return 'md-' + pos;\n }).join(' '));\n\n if (options.parent) options.parent.addClass('md-toast-animating');\n return $animate.enter(element, options.parent).then(function() {\n if (options.parent) options.parent.removeClass('md-toast-animating');\n });\n }\n\n function onRemove(scope, element, options) {\n element.off(SWIPE_EVENTS, options.onSwipe);\n if (options.parent) options.parent.addClass('md-toast-animating');\n if (options.openClass) options.parent.removeClass(options.openClass);\n\n return ((options.$destroy == true) ? element.remove() : $animate.leave(element))\n .then(function () {\n if (options.parent) options.parent.removeClass('md-toast-animating');\n if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) {\n options.parent.css('position', '');\n }\n });\n }\n\n function toastOpenClass(position) {\n if (!$mdMedia('gt-sm')) {\n return 'md-toast-open-bottom';\n }\n\n return 'md-toast-open-' +\n (position.indexOf('top') > -1 ? 'top' : 'bottom');\n }\n }\n\n}\nMdToastProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.tabs\n * @description\n *\n * Tabs, created with the `<md-tabs>` directive provide *tabbed* navigation with different styles.\n * The Tabs component consists of clickable tabs that are aligned horizontally side-by-side.\n *\n * Features include support for:\n *\n * - static or dynamic tabs,\n * - responsive designs,\n * - accessibility support (ARIA),\n * - tab pagination,\n * - external or internal tab content,\n * - focus indicators and arrow-key navigations,\n * - programmatic lookup and access to tab controllers, and\n * - dynamic transitions through different tab contents.\n *\n */\n/*\n * @see js folder for tabs implementation\n */\nangular.module('material.components.tabs', [\n 'material.core',\n 'material.components.icon'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.toolbar\n */\nangular.module('material.components.toolbar', [\n 'material.core',\n 'material.components.content'\n])\n .directive('mdToolbar', mdToolbarDirective);\n\n/**\n * @ngdoc directive\n * @name mdToolbar\n * @module material.components.toolbar\n * @restrict E\n * @description\n * `md-toolbar` is used to place a toolbar in your app.\n *\n * Toolbars are usually used above a content area to display the title of the\n * current page, and show relevant action buttons for that page.\n *\n * You can change the height of the toolbar by adding either the\n * `md-medium-tall` or `md-tall` class to the toolbar.\n *\n * @usage\n * <hljs lang=\"html\">\n * <div layout=\"column\" layout-fill>\n * <md-toolbar>\n *\n * <div class=\"md-toolbar-tools\">\n * <span>My App's Title</span>\n *\n * <!-- fill up the space between left and right area -->\n * <span flex></span>\n *\n * <md-button>\n * Right Bar Button\n * </md-button>\n * </div>\n *\n * </md-toolbar>\n * <md-content>\n * Hello!\n * </md-content>\n * </div>\n * </hljs>\n *\n * @param {boolean=} md-scroll-shrink Whether the header should shrink away as\n * the user scrolls down, and reveal itself as the user scrolls up.\n *\n * _**Note (1):** for scrollShrink to work, the toolbar must be a sibling of a\n * `md-content` element, placed before it. See the scroll shrink demo._\n *\n * _**Note (2):** The `md-scroll-shrink` attribute is only parsed on component\n * initialization, it does not watch for scope changes._\n *\n *\n * @param {number=} md-shrink-speed-factor How much to change the speed of the toolbar's\n * shrinking by. For example, if 0.25 is given then the toolbar will shrink\n * at one fourth the rate at which the user scrolls down. Default 0.5.\n */\n\nfunction mdToolbarDirective($$rAF, $mdConstant, $mdUtil, $mdTheming, $animate) {\n var translateY = angular.bind(null, $mdUtil.supplant, 'translate3d(0,{0}px,0)');\n\n return {\n template: '',\n\n restrict: 'E',\n\n link: function(scope, element, attr) {\n\n $mdTheming(element);\n\n if (angular.isDefined(attr.mdScrollShrink)) {\n setupScrollShrink();\n }\n\n function setupScrollShrink() {\n\n var toolbarHeight;\n var contentElement;\n var disableScrollShrink = angular.noop;\n\n // Current \"y\" position of scroll\n // Store the last scroll top position\n var y = 0;\n var prevScrollTop = 0;\n var shrinkSpeedFactor = attr.mdShrinkSpeedFactor || 0.5;\n\n var debouncedContentScroll = $$rAF.throttle(onContentScroll);\n var debouncedUpdateHeight = $mdUtil.debounce(updateToolbarHeight, 5 * 1000);\n\n // Wait for $mdContentLoaded event from mdContent directive.\n // If the mdContent element is a sibling of our toolbar, hook it up\n // to scroll events.\n\n scope.$on('$mdContentLoaded', onMdContentLoad);\n\n // If the toolbar is used inside an ng-if statement, we may miss the\n // $mdContentLoaded event, so we attempt to fake it if we have a\n // md-content close enough.\n\n attr.$observe('mdScrollShrink', onChangeScrollShrink);\n\n // If the toolbar has ngShow or ngHide we need to update height immediately as it changed\n // and not wait for $mdUtil.debounce to happen\n\n if (attr.ngShow) { scope.$watch(attr.ngShow, updateToolbarHeight); }\n if (attr.ngHide) { scope.$watch(attr.ngHide, updateToolbarHeight); }\n\n // If the scope is destroyed (which could happen with ng-if), make sure\n // to disable scroll shrinking again\n\n scope.$on('$destroy', disableScrollShrink);\n\n /**\n *\n */\n function onChangeScrollShrink(shrinkWithScroll) {\n var closestContent = element.parent().find('md-content');\n\n // If we have a content element, fake the call; this might still fail\n // if the content element isn't a sibling of the toolbar\n\n if (!contentElement && closestContent.length) {\n onMdContentLoad(null, closestContent);\n }\n\n // Evaluate the expression\n shrinkWithScroll = scope.$eval(shrinkWithScroll);\n\n // Disable only if the attribute's expression evaluates to false\n if (shrinkWithScroll === false) {\n disableScrollShrink();\n } else {\n disableScrollShrink = enableScrollShrink();\n }\n }\n\n /**\n *\n */\n function onMdContentLoad($event, newContentEl) {\n // Toolbar and content must be siblings\n if (newContentEl && element.parent()[0] === newContentEl.parent()[0]) {\n // unhook old content event listener if exists\n if (contentElement) {\n contentElement.off('scroll', debouncedContentScroll);\n }\n\n contentElement = newContentEl;\n disableScrollShrink = enableScrollShrink();\n }\n }\n\n /**\n *\n */\n function onContentScroll(e) {\n var scrollTop = e ? e.target.scrollTop : prevScrollTop;\n\n debouncedUpdateHeight();\n\n y = Math.min(\n toolbarHeight / shrinkSpeedFactor,\n Math.max(0, y + scrollTop - prevScrollTop)\n );\n\n element.css($mdConstant.CSS.TRANSFORM, translateY([-y * shrinkSpeedFactor]));\n contentElement.css($mdConstant.CSS.TRANSFORM, translateY([(toolbarHeight - y) * shrinkSpeedFactor]));\n\n prevScrollTop = scrollTop;\n\n $mdUtil.nextTick(function() {\n var hasWhiteFrame = element.hasClass('md-whiteframe-z1');\n\n if (hasWhiteFrame && !y) {\n $animate.removeClass(element, 'md-whiteframe-z1');\n } else if (!hasWhiteFrame && y) {\n $animate.addClass(element, 'md-whiteframe-z1');\n }\n });\n\n }\n\n /**\n *\n */\n function enableScrollShrink() {\n if (!contentElement) return angular.noop; // no md-content\n\n contentElement.on('scroll', debouncedContentScroll);\n contentElement.attr('scroll-shrink', 'true');\n\n $$rAF(updateToolbarHeight);\n\n return function disableScrollShrink() {\n contentElement.off('scroll', debouncedContentScroll);\n contentElement.attr('scroll-shrink', 'false');\n\n $$rAF(updateToolbarHeight);\n }\n }\n\n /**\n *\n */\n function updateToolbarHeight() {\n toolbarHeight = element.prop('offsetHeight');\n // Add a negative margin-top the size of the toolbar to the content el.\n // The content will start transformed down the toolbarHeight amount,\n // so everything looks normal.\n //\n // As the user scrolls down, the content will be transformed up slowly\n // to put the content underneath where the toolbar was.\n var margin = (-toolbarHeight * shrinkSpeedFactor) + 'px';\n\n contentElement.css({\n \"margin-top\": margin,\n \"margin-bottom\": margin\n });\n\n onContentScroll();\n }\n\n }\n\n }\n };\n\n}\nmdToolbarDirective.$inject = [\"$$rAF\", \"$mdConstant\", \"$mdUtil\", \"$mdTheming\", \"$animate\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.tooltip\n */\nangular\n .module('material.components.tooltip', [ 'material.core' ])\n .directive('mdTooltip', MdTooltipDirective);\n\n/**\n * @ngdoc directive\n * @name mdTooltip\n * @module material.components.tooltip\n * @description\n * Tooltips are used to describe elements that are interactive and primarily graphical (not textual).\n *\n * Place a `<md-tooltip>` as a child of the element it describes.\n *\n * A tooltip will activate when the user focuses, hovers over, or touches the parent.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-button class=\"md-fab md-accent\" aria-label=\"Play\">\n * <md-tooltip>\n * Play Music\n * </md-tooltip>\n * <md-icon icon=\"img/icons/ic_play_arrow_24px.svg\"></md-icon>\n * </md-button>\n * </hljs>\n *\n * @param {expression=} md-visible Boolean bound to whether the tooltip is currently visible.\n * @param {number=} md-delay How many milliseconds to wait to show the tooltip after the user focuses, hovers, or touches the parent. Defaults to 300ms.\n * @param {boolean=} md-autohide If present or provided with a boolean value, the tooltip will hide on mouse leave, regardless of focus\n * @param {string=} md-direction Which direction would you like the tooltip to go? Supports left, right, top, and bottom. Defaults to bottom.\n */\nfunction MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdTheming, $rootElement,\n $animate, $q) {\n\n var TOOLTIP_SHOW_DELAY = 0;\n var TOOLTIP_WINDOW_EDGE_SPACE = 8;\n\n return {\n restrict: 'E',\n transclude: true,\n priority:210, // Before ngAria\n template: '<div class=\"md-content\" ng-transclude></div>',\n scope: {\n delay: '=?mdDelay',\n visible: '=?mdVisible',\n autohide: '=?mdAutohide',\n direction: '@?mdDirection' // only expect raw or interpolated string value; not expression\n },\n link: postLink\n };\n\n function postLink(scope, element, attr) {\n\n $mdTheming(element);\n\n var parent = $mdUtil.getParentWithPointerEvents(element),\n content = angular.element(element[0].getElementsByClassName('md-content')[0]),\n tooltipParent = angular.element(document.body),\n debouncedOnResize = $$rAF.throttle(function () { updatePosition(); });\n\n if ($animate.pin) $animate.pin(element, parent);\n\n // Initialize element\n\n setDefaults();\n manipulateElement();\n bindEvents();\n\n // Default origin transform point is 'center top'\n // positionTooltip() is always relative to center top\n updateContentOrigin();\n\n configureWatchers();\n addAriaLabel();\n\n\n function setDefaults () {\n if (!angular.isDefined(attr.mdDelay)) scope.delay = TOOLTIP_SHOW_DELAY;\n }\n\n function updateContentOrigin() {\n var origin = 'center top';\n switch (scope.direction) {\n case 'left' : origin = 'right center'; break;\n case 'right' : origin = 'left center'; break;\n case 'top' : origin = 'center bottom'; break;\n case 'bottom': origin = 'center top'; break;\n }\n content.css('transform-origin', origin);\n }\n\n function configureWatchers () {\n scope.$on('$destroy', function() {\n scope.visible = false;\n element.remove();\n angular.element($window).off('resize', debouncedOnResize);\n });\n\n scope.$watch('visible', function (isVisible) {\n if (isVisible) showTooltip();\n else hideTooltip();\n });\n\n scope.$watch('direction', updatePosition );\n }\n\n function addAriaLabel () {\n if (!parent.attr('aria-label') && !parent.text().trim()) {\n parent.attr('aria-label', element.text().trim());\n }\n }\n\n function manipulateElement () {\n element.detach();\n element.attr('role', 'tooltip');\n }\n\n function bindEvents () {\n var mouseActive = false;\n\n var ngWindow = angular.element($window);\n\n // add an mutationObserver when there is support for it\n // and the need for it in the form of viable host(parent[0])\n if (parent[0] && 'MutationObserver' in $window) {\n // use an mutationObserver to tackle #2602\n var attributeObserver = new MutationObserver(function(mutations) {\n mutations\n .forEach(function (mutation) {\n if (mutation.attributeName === 'disabled' && parent[0].disabled) {\n setVisible(false);\n scope.$digest(); // make sure the elements gets updated\n }\n });\n });\n\n attributeObserver.observe(parent[0], { attributes: true});\n }\n\n // Store whether the element was focused when the window loses focus.\n var windowBlurHandler = function() {\n elementFocusedOnWindowBlur = document.activeElement === parent[0];\n };\n var elementFocusedOnWindowBlur = false;\n\n function windowScrollHandler() {\n setVisible(false);\n }\n \n ngWindow.on('blur', windowBlurHandler);\n ngWindow.on('resize', debouncedOnResize);\n document.addEventListener('scroll', windowScrollHandler, true);\n scope.$on('$destroy', function() {\n ngWindow.off('blur', windowBlurHandler);\n ngWindow.off('resize', debouncedOnResize);\n document.removeEventListener('scroll', windowScrollHandler, true);\n attributeObserver && attributeObserver.disconnect();\n });\n\n var enterHandler = function(e) {\n // Prevent the tooltip from showing when the window is receiving focus.\n if (e.type === 'focus' && elementFocusedOnWindowBlur) {\n elementFocusedOnWindowBlur = false;\n return;\n }\n parent.on('blur mouseleave touchend touchcancel', leaveHandler );\n setVisible(true);\n };\n var leaveHandler = function () {\n var autohide = scope.hasOwnProperty('autohide') ? scope.autohide : attr.hasOwnProperty('mdAutohide');\n if (autohide || mouseActive || ($document[0].activeElement !== parent[0]) ) {\n parent.off('blur mouseleave touchend touchcancel', leaveHandler );\n parent.triggerHandler(\"blur\");\n setVisible(false);\n }\n mouseActive = false;\n };\n\n // to avoid `synthetic clicks` we listen to mousedown instead of `click`\n parent.on('mousedown', function() { mouseActive = true; });\n parent.on('focus mouseenter touchstart', enterHandler );\n\n\n }\n\n function setVisible (value) {\n setVisible.value = !!value;\n if (!setVisible.queued) {\n if (value) {\n setVisible.queued = true;\n $timeout(function() {\n scope.visible = setVisible.value;\n setVisible.queued = false;\n }, scope.delay);\n } else {\n $mdUtil.nextTick(function() { scope.visible = false; });\n }\n }\n }\n\n function showTooltip() {\n // Insert the element before positioning it, so we can get the position\n // and check if we should display it\n tooltipParent.append(element);\n\n // Check if we should display it or not.\n // This handles hide-* and show-* along with any user defined css\n if ( $mdUtil.hasComputedStyle(element, 'display', 'none')) {\n scope.visible = false;\n element.detach();\n return;\n }\n\n updatePosition();\n\n angular.forEach([element, content], function (element) {\n $animate.addClass(element, 'md-show');\n });\n }\n\n function hideTooltip() {\n var promises = [];\n angular.forEach([element, content], function (it) {\n if (it.parent() && it.hasClass('md-show')) {\n promises.push($animate.removeClass(it, 'md-show'));\n }\n });\n\n $q.all(promises)\n .then(function () {\n if (!scope.visible) element.detach();\n });\n }\n\n function updatePosition() {\n if ( !scope.visible ) return;\n\n updateContentOrigin();\n positionTooltip();\n }\n\n function positionTooltip() {\n var tipRect = $mdUtil.offsetRect(element, tooltipParent);\n var parentRect = $mdUtil.offsetRect(parent, tooltipParent);\n var newPosition = getPosition(scope.direction);\n var offsetParent = element.prop('offsetParent');\n\n // If the user provided a direction, just nudge the tooltip onto the screen\n // Otherwise, recalculate based on 'top' since default is 'bottom'\n if (scope.direction) {\n newPosition = fitInParent(newPosition);\n } else if (offsetParent && newPosition.top > offsetParent.scrollHeight - tipRect.height - TOOLTIP_WINDOW_EDGE_SPACE) {\n newPosition = fitInParent(getPosition('top'));\n }\n\n element.css({\n left: newPosition.left + 'px',\n top: newPosition.top + 'px'\n });\n\n function fitInParent (pos) {\n var newPosition = { left: pos.left, top: pos.top };\n newPosition.left = Math.min( newPosition.left, tooltipParent.prop('scrollWidth') - tipRect.width - TOOLTIP_WINDOW_EDGE_SPACE );\n newPosition.left = Math.max( newPosition.left, TOOLTIP_WINDOW_EDGE_SPACE );\n newPosition.top = Math.min( newPosition.top, tooltipParent.prop('scrollHeight') - tipRect.height - TOOLTIP_WINDOW_EDGE_SPACE );\n newPosition.top = Math.max( newPosition.top, TOOLTIP_WINDOW_EDGE_SPACE );\n return newPosition;\n }\n\n function getPosition (dir) {\n return dir === 'left'\n ? { left: parentRect.left - tipRect.width - TOOLTIP_WINDOW_EDGE_SPACE,\n top: parentRect.top + parentRect.height / 2 - tipRect.height / 2 }\n : dir === 'right'\n ? { left: parentRect.left + parentRect.width + TOOLTIP_WINDOW_EDGE_SPACE,\n top: parentRect.top + parentRect.height / 2 - tipRect.height / 2 }\n : dir === 'top'\n ? { left: parentRect.left + parentRect.width / 2 - tipRect.width / 2,\n top: parentRect.top - tipRect.height - TOOLTIP_WINDOW_EDGE_SPACE }\n : { left: parentRect.left + parentRect.width / 2 - tipRect.width / 2,\n top: parentRect.top + parentRect.height + TOOLTIP_WINDOW_EDGE_SPACE };\n }\n }\n\n }\n\n}\nMdTooltipDirective.$inject = [\"$timeout\", \"$window\", \"$$rAF\", \"$document\", \"$mdUtil\", \"$mdTheming\", \"$rootElement\", \"$animate\", \"$q\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.virtualRepeat\n */\nangular.module('material.components.virtualRepeat', [\n 'material.core',\n 'material.components.showHide'\n])\n.directive('mdVirtualRepeatContainer', VirtualRepeatContainerDirective)\n.directive('mdVirtualRepeat', VirtualRepeatDirective);\n\n\n/**\n * @ngdoc directive\n * @name mdVirtualRepeatContainer\n * @module material.components.virtualRepeat\n * @restrict E\n * @description\n * `md-virtual-repeat-container` provides the scroll container for md-virtual-repeat.\n *\n * Virtual repeat is a limited substitute for ng-repeat that renders only\n * enough dom nodes to fill the container and recycling them as the user scrolls.\n *\n * @usage\n * <hljs lang=\"html\">\n *\n * <md-virtual-repeat-container md-top-index=\"topIndex\">\n * <div md-virtual-repeat=\"i in items\" md-item-size=\"20\">Hello {{i}}!</div>\n * </md-virtual-repeat-container>\n * </hljs>\n *\n * @param {number=} md-top-index Binds the index of the item that is at the top of the scroll\n * container to $scope. It can both read and set the scroll position.\n * @param {boolean=} md-orient-horizontal Whether the container should scroll horizontally\n * (defaults to orientation and scrolling vertically).\n * @param {boolean=} md-auto-shrink When present, the container will shrink to fit\n * the number of items when that number is less than its original size.\n * @param {number=} md-auto-shrink-min Minimum number of items that md-auto-shrink\n * will shrink to (default: 0).\n */\nfunction VirtualRepeatContainerDirective() {\n return {\n controller: VirtualRepeatContainerController,\n template: virtualRepeatContainerTemplate,\n compile: function virtualRepeatContainerCompile($element, $attrs) {\n $element\n .addClass('md-virtual-repeat-container')\n .addClass($attrs.hasOwnProperty('mdOrientHorizontal')\n ? 'md-orient-horizontal'\n : 'md-orient-vertical');\n }\n };\n}\n\n\nfunction virtualRepeatContainerTemplate($element) {\n return '<div class=\"md-virtual-repeat-scroller\">' +\n '<div class=\"md-virtual-repeat-sizer\"></div>' +\n '<div class=\"md-virtual-repeat-offsetter\">' +\n $element[0].innerHTML +\n '</div></div>';\n}\n\n/**\n * Maximum size, in pixels, that can be explicitly set to an element. The actual value varies\n * between browsers, but IE11 has the very lowest size at a mere 1,533,917px. Ideally we could\n * *compute* this value, but Firefox always reports an element to have a size of zero if it\n * goes over the max, meaning that we'd have to binary search for the value.\n * @const {number}\n */\nvar MAX_ELEMENT_SIZE = 1533917;\n\n/**\n * Number of additional elements to render above and below the visible area inside\n * of the virtual repeat container. A higher number results in less flicker when scrolling\n * very quickly in Safari, but comes with a higher rendering and dirty-checking cost.\n * @const {number}\n */\nvar NUM_EXTRA = 3;\n\n/** @ngInject */\nfunction VirtualRepeatContainerController(\n $$rAF, $mdUtil, $parse, $rootScope, $window, $scope, $element, $attrs) {\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$element = $element;\n this.$attrs = $attrs;\n\n /** @type {number} The width or height of the container */\n this.size = 0;\n /** @type {number} The scroll width or height of the scroller */\n this.scrollSize = 0;\n /** @type {number} The scrollLeft or scrollTop of the scroller */\n this.scrollOffset = 0;\n /** @type {boolean} Whether the scroller is oriented horizontally */\n this.horizontal = this.$attrs.hasOwnProperty('mdOrientHorizontal');\n /** @type {!VirtualRepeatController} The repeater inside of this container */\n this.repeater = null;\n /** @type {boolean} Whether auto-shrink is enabled */\n this.autoShrink = this.$attrs.hasOwnProperty('mdAutoShrink');\n /** @type {number} Minimum number of items to auto-shrink to */\n this.autoShrinkMin = parseInt(this.$attrs.mdAutoShrinkMin, 10) || 0;\n /** @type {?number} Original container size when shrank */\n this.originalSize = null;\n /** @type {number} Amount to offset the total scroll size by. */\n this.offsetSize = parseInt(this.$attrs.mdOffsetSize, 10) || 0;\n /** @type {?string} height or width element style on the container prior to auto-shrinking. */\n this.oldElementSize = null;\n\n if (this.$attrs.mdTopIndex) {\n /** @type {function(angular.Scope): number} Binds to topIndex on Angular scope */\n this.bindTopIndex = $parse(this.$attrs.mdTopIndex);\n /** @type {number} The index of the item that is at the top of the scroll container */\n this.topIndex = this.bindTopIndex(this.$scope);\n\n if (!angular.isDefined(this.topIndex)) {\n this.topIndex = 0;\n this.bindTopIndex.assign(this.$scope, 0);\n }\n\n this.$scope.$watch(this.bindTopIndex, angular.bind(this, function(newIndex) {\n if (newIndex !== this.topIndex) {\n this.scrollToIndex(newIndex);\n }\n }));\n } else {\n this.topIndex = 0;\n }\n\n this.scroller = $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0];\n this.sizer = this.scroller.getElementsByClassName('md-virtual-repeat-sizer')[0];\n this.offsetter = this.scroller.getElementsByClassName('md-virtual-repeat-offsetter')[0];\n\n // After the dom stablizes, measure the initial size of the container and\n // make a best effort at re-measuring as it changes.\n var boundUpdateSize = angular.bind(this, this.updateSize);\n\n $$rAF(angular.bind(this, function() {\n boundUpdateSize();\n\n var debouncedUpdateSize = $mdUtil.debounce(boundUpdateSize, 10, null, false);\n var jWindow = angular.element($window);\n\n // Make one more attempt to get the size if it is 0.\n // This is not by any means a perfect approach, but there's really no\n // silver bullet here.\n if (!this.size) {\n debouncedUpdateSize();\n }\n\n jWindow.on('resize', debouncedUpdateSize);\n $scope.$on('$destroy', function() {\n jWindow.off('resize', debouncedUpdateSize);\n });\n\n $scope.$emit('$md-resize-enable');\n $scope.$on('$md-resize', boundUpdateSize);\n }));\n}\nVirtualRepeatContainerController.$inject = [\"$$rAF\", \"$mdUtil\", \"$parse\", \"$rootScope\", \"$window\", \"$scope\", \"$element\", \"$attrs\"];\n\n\n/** Called by the md-virtual-repeat inside of the container at startup. */\nVirtualRepeatContainerController.prototype.register = function(repeaterCtrl) {\n this.repeater = repeaterCtrl;\n\n angular.element(this.scroller)\n .on('scroll wheel touchmove touchend', angular.bind(this, this.handleScroll_));\n};\n\n\n/** @return {boolean} Whether the container is configured for horizontal scrolling. */\nVirtualRepeatContainerController.prototype.isHorizontal = function() {\n return this.horizontal;\n};\n\n\n/** @return {number} The size (width or height) of the container. */\nVirtualRepeatContainerController.prototype.getSize = function() {\n return this.size;\n};\n\n\n/**\n * Resizes the container.\n * @private\n * @param {number} The new size to set.\n */\nVirtualRepeatContainerController.prototype.setSize_ = function(size) {\n var dimension = this.getDimensionName_();\n\n this.size = size;\n this.$element[0].style[dimension] = size + 'px';\n};\n\n\nVirtualRepeatContainerController.prototype.unsetSize_ = function() {\n this.$element[0].style[this.getDimensionName_()] = this.oldElementSize;\n this.oldElementSize = null;\n};\n\n\n/** Instructs the container to re-measure its size. */\nVirtualRepeatContainerController.prototype.updateSize = function() {\n if (this.originalSize) return;\n\n this.size = this.isHorizontal()\n ? this.$element[0].clientWidth\n : this.$element[0].clientHeight;\n\n // Recheck the scroll position after updating the size. This resolves\n // problems that can result if the scroll position was measured while the\n // element was display: none or detached from the document.\n this.handleScroll_();\n\n this.repeater && this.repeater.containerUpdated();\n};\n\n\n/** @return {number} The container's scrollHeight or scrollWidth. */\nVirtualRepeatContainerController.prototype.getScrollSize = function() {\n return this.scrollSize;\n};\n\n\nVirtualRepeatContainerController.prototype.getDimensionName_ = function() {\n return this.isHorizontal() ? 'width' : 'height';\n};\n\n\n/**\n * Sets the scroller element to the specified size.\n * @private\n * @param {number} size The new size.\n */\nVirtualRepeatContainerController.prototype.sizeScroller_ = function(size) {\n var dimension = this.getDimensionName_();\n var crossDimension = this.isHorizontal() ? 'height' : 'width';\n\n // Clear any existing dimensions.\n this.sizer.innerHTML = '';\n\n // If the size falls within the browser's maximum explicit size for a single element, we can\n // set the size and be done. Otherwise, we have to create children that add up the the desired\n // size.\n if (size < MAX_ELEMENT_SIZE) {\n this.sizer.style[dimension] = size + 'px';\n } else {\n this.sizer.style[dimension] = 'auto';\n this.sizer.style[crossDimension] = 'auto';\n\n // Divide the total size we have to render into N max-size pieces.\n var numChildren = Math.floor(size / MAX_ELEMENT_SIZE);\n\n // Element template to clone for each max-size piece.\n var sizerChild = document.createElement('div');\n sizerChild.style[dimension] = MAX_ELEMENT_SIZE + 'px';\n sizerChild.style[crossDimension] = '1px';\n\n for (var i = 0; i < numChildren; i++) {\n this.sizer.appendChild(sizerChild.cloneNode(false));\n }\n\n // Re-use the element template for the remainder.\n sizerChild.style[dimension] = (size - (numChildren * MAX_ELEMENT_SIZE)) + 'px';\n this.sizer.appendChild(sizerChild);\n }\n};\n\n\n/**\n * If auto-shrinking is enabled, shrinks or unshrinks as appropriate.\n * @private\n * @param {number} size The new size.\n */\nVirtualRepeatContainerController.prototype.autoShrink_ = function(size) {\n var shrinkSize = Math.max(size, this.autoShrinkMin * this.repeater.getItemSize());\n if (this.autoShrink && shrinkSize !== this.size) {\n if (this.oldElementSize === null) {\n this.oldElementSize = this.$element[0].style[this.getDimensionName_()];\n }\n\n var currentSize = this.originalSize || this.size;\n if (!currentSize || shrinkSize < currentSize) {\n if (!this.originalSize) {\n this.originalSize = this.size;\n }\n\n this.setSize_(shrinkSize);\n } else if (this.originalSize !== null) {\n this.unsetSize_();\n this.originalSize = null;\n this.updateSize();\n }\n\n this.repeater.containerUpdated();\n }\n};\n\n\n/**\n * Sets the scrollHeight or scrollWidth. Called by the repeater based on\n * its item count and item size.\n * @param {number} itemsSize The total size of the items.\n */\nVirtualRepeatContainerController.prototype.setScrollSize = function(itemsSize) {\n var size = itemsSize + this.offsetSize;\n if (this.scrollSize === size) return;\n\n this.sizeScroller_(size);\n this.autoShrink_(size);\n this.scrollSize = size;\n};\n\n\n/** @return {number} The container's current scroll offset. */\nVirtualRepeatContainerController.prototype.getScrollOffset = function() {\n return this.scrollOffset;\n};\n\n/**\n * Scrolls to a given scrollTop position.\n * @param {number} position\n */\nVirtualRepeatContainerController.prototype.scrollTo = function(position) {\n this.scroller[this.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = position;\n this.handleScroll_();\n};\n\n/**\n * Scrolls the item with the given index to the top of the scroll container.\n * @param {number} index\n */\nVirtualRepeatContainerController.prototype.scrollToIndex = function(index) {\n var itemSize = this.repeater.getItemSize();\n var itemsLength = this.repeater.itemsLength;\n if(index > itemsLength) {\n index = itemsLength - 1;\n }\n this.scrollTo(itemSize * index);\n};\n\nVirtualRepeatContainerController.prototype.resetScroll = function() {\n this.scrollTo(0);\n};\n\n\nVirtualRepeatContainerController.prototype.handleScroll_ = function() {\n var offset = this.isHorizontal() ? this.scroller.scrollLeft : this.scroller.scrollTop;\n if (offset === this.scrollOffset || offset > this.scrollSize - this.size) return;\n\n var itemSize = this.repeater.getItemSize();\n if (!itemSize) return;\n\n var numItems = Math.max(0, Math.floor(offset / itemSize) - NUM_EXTRA);\n\n var transform = (this.isHorizontal() ? 'translateX(' : 'translateY(') +\n (numItems * itemSize) + 'px)';\n\n this.scrollOffset = offset;\n this.offsetter.style.webkitTransform = transform;\n this.offsetter.style.transform = transform;\n\n if (this.bindTopIndex) {\n var topIndex = Math.floor(offset / itemSize);\n if (topIndex !== this.topIndex && topIndex < this.repeater.getItemCount()) {\n this.topIndex = topIndex;\n this.bindTopIndex.assign(this.$scope, topIndex);\n if (!this.$rootScope.$$phase) this.$scope.$digest();\n }\n }\n\n this.repeater.containerUpdated();\n};\n\n\n/**\n * @ngdoc directive\n * @name mdVirtualRepeat\n * @module material.components.virtualRepeat\n * @restrict A\n * @priority 1000\n * @description\n * `md-virtual-repeat` specifies an element to repeat using virtual scrolling.\n *\n * Virtual repeat is a limited substitute for ng-repeat that renders only\n * enough dom nodes to fill the container and recycling them as the user scrolls.\n * Arrays, but not objects are supported for iteration.\n * Track by, as alias, and (key, value) syntax are not supported.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-virtual-repeat-container>\n * <div md-virtual-repeat=\"i in items\">Hello {{i}}!</div>\n * </md-virtual-repeat-container>\n *\n * <md-virtual-repeat-container md-orient-horizontal>\n * <div md-virtual-repeat=\"i in items\" md-item-size=\"20\">Hello {{i}}!</div>\n * </md-virtual-repeat-container>\n * </hljs>\n *\n * @param {number=} md-item-size The height or width of the repeated elements (which must be\n * identical for each element). Optional. Will attempt to read the size from the dom if missing,\n * but still assumes that all repeated nodes have same height or width.\n * @param {string=} md-extra-name Evaluates to an additional name to which the current iterated item\n * can be assigned on the repeated scope (needed for use in `md-autocomplete`).\n * @param {boolean=} md-on-demand When present, treats the md-virtual-repeat argument as an object\n * that can fetch rows rather than an array.\n *\n * **NOTE:** This object must implement the following interface with two (2) methods:\n *\n * - `getItemAtIndex: function(index) [object]` The item at that index or null if it is not yet\n * loaded (it should start downloading the item in that case).\n * - `getLength: function() [number]` The data length to which the repeater container\n * should be sized. Ideally, when the count is known, this method should return it.\n * Otherwise, return a higher number than the currently loaded items to produce an\n * infinite-scroll behavior.\n */\nfunction VirtualRepeatDirective($parse) {\n return {\n controller: VirtualRepeatController,\n priority: 1000,\n require: ['mdVirtualRepeat', '^^mdVirtualRepeatContainer'],\n restrict: 'A',\n terminal: true,\n transclude: 'element',\n compile: function VirtualRepeatCompile($element, $attrs) {\n var expression = $attrs.mdVirtualRepeat;\n var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)\\s*$/);\n var repeatName = match[1];\n var repeatListExpression = $parse(match[2]);\n var extraName = $attrs.mdExtraName && $parse($attrs.mdExtraName);\n\n return function VirtualRepeatLink($scope, $element, $attrs, ctrl, $transclude) {\n ctrl[0].link_(ctrl[1], $transclude, repeatName, repeatListExpression, extraName);\n };\n }\n };\n}\nVirtualRepeatDirective.$inject = [\"$parse\"];\n\n\n/** @ngInject */\nfunction VirtualRepeatController($scope, $element, $attrs, $browser, $document, $rootScope,\n $$rAF) {\n this.$scope = $scope;\n this.$element = $element;\n this.$attrs = $attrs;\n this.$browser = $browser;\n this.$document = $document;\n this.$rootScope = $rootScope;\n this.$$rAF = $$rAF;\n\n /** @type {boolean} Whether we are in on-demand mode. */\n this.onDemand = $attrs.hasOwnProperty('mdOnDemand');\n /** @type {!Function} Backup reference to $browser.$$checkUrlChange */\n this.browserCheckUrlChange = $browser.$$checkUrlChange;\n /** @type {number} Most recent starting repeat index (based on scroll offset) */\n this.newStartIndex = 0;\n /** @type {number} Most recent ending repeat index (based on scroll offset) */\n this.newEndIndex = 0;\n /** @type {number} Most recent end visible index (based on scroll offset) */\n this.newVisibleEnd = 0;\n /** @type {number} Previous starting repeat index (based on scroll offset) */\n this.startIndex = 0;\n /** @type {number} Previous ending repeat index (based on scroll offset) */\n this.endIndex = 0;\n // TODO: measure width/height of first element from dom if not provided.\n // getComputedStyle?\n /** @type {?number} Height/width of repeated elements. */\n this.itemSize = $scope.$eval($attrs.mdItemSize) || null;\n\n /** @type {boolean} Whether this is the first time that items are rendered. */\n this.isFirstRender = true;\n\n /**\n * @private {boolean} Whether the items in the list are already being updated. Used to prevent\n * nested calls to virtualRepeatUpdate_.\n */\n this.isVirtualRepeatUpdating_ = false;\n\n /** @type {number} Most recently seen length of items. */\n this.itemsLength = 0;\n\n /**\n * @type {!Function} Unwatch callback for item size (when md-items-size is\n * not specified), or angular.noop otherwise.\n */\n this.unwatchItemSize_ = angular.noop;\n\n /**\n * Presently rendered blocks by repeat index.\n * @type {Object<number, !VirtualRepeatController.Block}\n */\n this.blocks = {};\n /** @type {Array<!VirtualRepeatController.Block>} A pool of presently unused blocks. */\n this.pooledBlocks = [];\n\n $scope.$on('$destroy', angular.bind(this, this.cleanupBlocks_));\n}\nVirtualRepeatController.$inject = [\"$scope\", \"$element\", \"$attrs\", \"$browser\", \"$document\", \"$rootScope\", \"$$rAF\"];\n\n\n/**\n * An object representing a repeated item.\n * @typedef {{element: !jqLite, new: boolean, scope: !angular.Scope}}\n */\nVirtualRepeatController.Block;\n\n\n/**\n * Called at startup by the md-virtual-repeat postLink function.\n * @param {!VirtualRepeatContainerController} container The container's controller.\n * @param {!Function} transclude The repeated element's bound transclude function.\n * @param {string} repeatName The left hand side of the repeat expression, indicating\n * the name for each item in the array.\n * @param {!Function} repeatListExpression A compiled expression based on the right hand side\n * of the repeat expression. Points to the array to repeat over.\n * @param {string|undefined} extraName The optional extra repeatName.\n */\nVirtualRepeatController.prototype.link_ =\n function(container, transclude, repeatName, repeatListExpression, extraName) {\n this.container = container;\n this.transclude = transclude;\n this.repeatName = repeatName;\n this.rawRepeatListExpression = repeatListExpression;\n this.extraName = extraName;\n this.sized = false;\n\n this.repeatListExpression = angular.bind(this, this.repeatListExpression_);\n\n this.container.register(this);\n};\n\n\n/** @private Cleans up unused blocks. */\nVirtualRepeatController.prototype.cleanupBlocks_ = function() {\n angular.forEach(this.pooledBlocks, function cleanupBlock(block) {\n block.element.remove();\n });\n};\n\n\n/** @private Attempts to set itemSize by measuring a repeated element in the dom */\nVirtualRepeatController.prototype.readItemSize_ = function() {\n if (this.itemSize) {\n // itemSize was successfully read in a different asynchronous call.\n return;\n }\n\n this.items = this.repeatListExpression(this.$scope);\n this.parentNode = this.$element[0].parentNode;\n var block = this.getBlock_(0);\n if (!block.element[0].parentNode) {\n this.parentNode.appendChild(block.element[0]);\n }\n\n this.itemSize = block.element[0][\n this.container.isHorizontal() ? 'offsetWidth' : 'offsetHeight'] || null;\n\n this.blocks[0] = block;\n this.poolBlock_(0);\n\n if (this.itemSize) {\n this.containerUpdated();\n }\n};\n\n\n/**\n * Returns the user-specified repeat list, transforming it into an array-like\n * object in the case of infinite scroll/dynamic load mode.\n * @param {!angular.Scope} The scope.\n * @return {!Array|!Object} An array or array-like object for iteration.\n */\nVirtualRepeatController.prototype.repeatListExpression_ = function(scope) {\n var repeatList = this.rawRepeatListExpression(scope);\n\n if (this.onDemand && repeatList) {\n var virtualList = new VirtualRepeatModelArrayLike(repeatList);\n virtualList.$$includeIndexes(this.newStartIndex, this.newVisibleEnd);\n return virtualList;\n } else {\n return repeatList;\n }\n};\n\n\n/**\n * Called by the container. Informs us that the containers scroll or size has\n * changed.\n */\nVirtualRepeatController.prototype.containerUpdated = function() {\n // If itemSize is unknown, attempt to measure it.\n if (!this.itemSize) {\n this.unwatchItemSize_ = this.$scope.$watchCollection(\n this.repeatListExpression,\n angular.bind(this, function(items) {\n if (items && items.length) {\n this.$$rAF(angular.bind(this, this.readItemSize_));\n }\n }));\n if (!this.$rootScope.$$phase) this.$scope.$digest();\n\n return;\n } else if (!this.sized) {\n this.items = this.repeatListExpression(this.$scope);\n }\n\n if (!this.sized) {\n this.unwatchItemSize_();\n this.sized = true;\n this.$scope.$watchCollection(this.repeatListExpression,\n angular.bind(this, function(items, oldItems) {\n if (!this.isVirtualRepeatUpdating_) {\n this.virtualRepeatUpdate_(items, oldItems);\n }\n }));\n }\n\n this.updateIndexes_();\n\n if (this.newStartIndex !== this.startIndex ||\n this.newEndIndex !== this.endIndex ||\n this.container.getScrollOffset() > this.container.getScrollSize()) {\n if (this.items instanceof VirtualRepeatModelArrayLike) {\n this.items.$$includeIndexes(this.newStartIndex, this.newEndIndex);\n }\n this.virtualRepeatUpdate_(this.items, this.items);\n }\n};\n\n\n/**\n * Called by the container. Returns the size of a single repeated item.\n * @return {?number} Size of a repeated item.\n */\nVirtualRepeatController.prototype.getItemSize = function() {\n return this.itemSize;\n};\n\n\n/**\n * Called by the container. Returns the size of a single repeated item.\n * @return {?number} Size of a repeated item.\n */\nVirtualRepeatController.prototype.getItemCount = function() {\n return this.itemsLength;\n};\n\n\n/**\n * Updates the order and visible offset of repeated blocks in response to scrolling\n * or items updates.\n * @private\n */\nVirtualRepeatController.prototype.virtualRepeatUpdate_ = function(items, oldItems) {\n this.isVirtualRepeatUpdating_ = true;\n\n var itemsLength = items && items.length || 0;\n var lengthChanged = false;\n\n // If the number of items shrank, scroll up to the top.\n if (this.items && itemsLength < this.items.length && this.container.getScrollOffset() !== 0) {\n this.items = items;\n this.container.resetScroll();\n return;\n }\n\n if (itemsLength !== this.itemsLength) {\n lengthChanged = true;\n this.itemsLength = itemsLength;\n }\n\n this.items = items;\n if (items !== oldItems || lengthChanged) {\n this.updateIndexes_();\n }\n\n this.parentNode = this.$element[0].parentNode;\n\n if (lengthChanged) {\n this.container.setScrollSize(itemsLength * this.itemSize);\n }\n\n if (this.isFirstRender) {\n this.isFirstRender = false;\n var startIndex = this.$attrs.mdStartIndex ?\n this.$scope.$eval(this.$attrs.mdStartIndex) :\n this.container.topIndex;\n this.container.scrollToIndex(startIndex);\n }\n\n // Detach and pool any blocks that are no longer in the viewport.\n Object.keys(this.blocks).forEach(function(blockIndex) {\n var index = parseInt(blockIndex, 10);\n if (index < this.newStartIndex || index >= this.newEndIndex) {\n this.poolBlock_(index);\n }\n }, this);\n\n // Add needed blocks.\n // For performance reasons, temporarily block browser url checks as we digest\n // the restored block scopes ($$checkUrlChange reads window.location to\n // check for changes and trigger route change, etc, which we don't need when\n // trying to scroll at 60fps).\n this.$browser.$$checkUrlChange = angular.noop;\n\n var i, block,\n newStartBlocks = [],\n newEndBlocks = [];\n\n // Collect blocks at the top.\n for (i = this.newStartIndex; i < this.newEndIndex && this.blocks[i] == null; i++) {\n block = this.getBlock_(i);\n this.updateBlock_(block, i);\n newStartBlocks.push(block);\n }\n\n // Update blocks that are already rendered.\n for (; this.blocks[i] != null; i++) {\n this.updateBlock_(this.blocks[i], i);\n }\n var maxIndex = i - 1;\n\n // Collect blocks at the end.\n for (; i < this.newEndIndex; i++) {\n block = this.getBlock_(i);\n this.updateBlock_(block, i);\n newEndBlocks.push(block);\n }\n\n // Attach collected blocks to the document.\n if (newStartBlocks.length) {\n this.parentNode.insertBefore(\n this.domFragmentFromBlocks_(newStartBlocks),\n this.$element[0].nextSibling);\n }\n if (newEndBlocks.length) {\n this.parentNode.insertBefore(\n this.domFragmentFromBlocks_(newEndBlocks),\n this.blocks[maxIndex] && this.blocks[maxIndex].element[0].nextSibling);\n }\n\n // Restore $$checkUrlChange.\n this.$browser.$$checkUrlChange = this.browserCheckUrlChange;\n\n this.startIndex = this.newStartIndex;\n this.endIndex = this.newEndIndex;\n\n this.isVirtualRepeatUpdating_ = false;\n};\n\n\n/**\n * @param {number} index Where the block is to be in the repeated list.\n * @return {!VirtualRepeatController.Block} A new or pooled block to place at the specified index.\n * @private\n */\nVirtualRepeatController.prototype.getBlock_ = function(index) {\n if (this.pooledBlocks.length) {\n return this.pooledBlocks.pop();\n }\n\n var block;\n this.transclude(angular.bind(this, function(clone, scope) {\n block = {\n element: clone,\n new: true,\n scope: scope\n };\n\n this.updateScope_(scope, index);\n this.parentNode.appendChild(clone[0]);\n }));\n\n return block;\n};\n\n\n/**\n * Updates and if not in a digest cycle, digests the specified block's scope to the data\n * at the specified index.\n * @param {!VirtualRepeatController.Block} block The block whose scope should be updated.\n * @param {number} index The index to set.\n * @private\n */\nVirtualRepeatController.prototype.updateBlock_ = function(block, index) {\n this.blocks[index] = block;\n\n if (!block.new &&\n (block.scope.$index === index && block.scope[this.repeatName] === this.items[index])) {\n return;\n }\n block.new = false;\n\n // Update and digest the block's scope.\n this.updateScope_(block.scope, index);\n\n // Perform digest before reattaching the block.\n // Any resulting synchronous dom mutations should be much faster as a result.\n // This might break some directives, but I'm going to try it for now.\n if (!this.$rootScope.$$phase) {\n block.scope.$digest();\n }\n};\n\n\n/**\n * Updates scope to the data at the specified index.\n * @param {!angular.Scope} scope The scope which should be updated.\n * @param {number} index The index to set.\n * @private\n */\nVirtualRepeatController.prototype.updateScope_ = function(scope, index) {\n scope.$index = index;\n scope[this.repeatName] = this.items && this.items[index];\n if (this.extraName) scope[this.extraName(this.$scope)] = this.items[index];\n};\n\n\n/**\n * Pools the block at the specified index (Pulls its element out of the dom and stores it).\n * @param {number} index The index at which the block to pool is stored.\n * @private\n */\nVirtualRepeatController.prototype.poolBlock_ = function(index) {\n this.pooledBlocks.push(this.blocks[index]);\n this.parentNode.removeChild(this.blocks[index].element[0]);\n delete this.blocks[index];\n};\n\n\n/**\n * Produces a dom fragment containing the elements from the list of blocks.\n * @param {!Array<!VirtualRepeatController.Block>} blocks The blocks whose elements\n * should be added to the document fragment.\n * @return {DocumentFragment}\n * @private\n */\nVirtualRepeatController.prototype.domFragmentFromBlocks_ = function(blocks) {\n var fragment = this.$document[0].createDocumentFragment();\n blocks.forEach(function(block) {\n fragment.appendChild(block.element[0]);\n });\n return fragment;\n};\n\n\n/**\n * Updates start and end indexes based on length of repeated items and container size.\n * @private\n */\nVirtualRepeatController.prototype.updateIndexes_ = function() {\n var itemsLength = this.items ? this.items.length : 0;\n var containerLength = Math.ceil(this.container.getSize() / this.itemSize);\n\n this.newStartIndex = Math.max(0, Math.min(\n itemsLength - containerLength,\n Math.floor(this.container.getScrollOffset() / this.itemSize)));\n this.newVisibleEnd = this.newStartIndex + containerLength + NUM_EXTRA;\n this.newEndIndex = Math.min(itemsLength, this.newVisibleEnd);\n this.newStartIndex = Math.max(0, this.newStartIndex - NUM_EXTRA);\n};\n\n/**\n * This VirtualRepeatModelArrayLike class enforces the interface requirements\n * for infinite scrolling within a mdVirtualRepeatContainer. An object with this\n * interface must implement the following interface with two (2) methods:\n *\n * getItemAtIndex: function(index) -> item at that index or null if it is not yet\n * loaded (It should start downloading the item in that case).\n *\n * getLength: function() -> number The data legnth to which the repeater container\n * should be sized. Ideally, when the count is known, this method should return it.\n * Otherwise, return a higher number than the currently loaded items to produce an\n * infinite-scroll behavior.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-virtual-repeat-container md-orient-horizontal>\n * <div md-virtual-repeat=\"i in items\" md-on-demand>\n * Hello {{i}}!\n * </div>\n * </md-virtual-repeat-container>\n * </hljs>\n *\n */\nfunction VirtualRepeatModelArrayLike(model) {\n if (!angular.isFunction(model.getItemAtIndex) ||\n !angular.isFunction(model.getLength)) {\n throw Error('When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement ' +\n 'functions getItemAtIndex() and getLength() ');\n }\n\n this.model = model;\n}\n\n\nVirtualRepeatModelArrayLike.prototype.$$includeIndexes = function(start, end) {\n for (var i = start; i < end; i++) {\n if (!this.hasOwnProperty(i)) {\n this[i] = this.model.getItemAtIndex(i);\n }\n }\n this.length = this.model.getLength();\n};\n\n\nfunction abstractMethod() {\n throw Error('Non-overridden abstract method called.');\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.whiteframe\n */\nangular\n .module('material.components.whiteframe', ['material.core'])\n .directive('mdWhiteframe', MdWhiteframeDirective);\n\n/**\n * @private\n * @ngdoc directive\n * @module material.components.whiteframe\n * @name mdWhiteframe\n * @restrict A\n *\n * @description\n * The md-whiteframe directive allows you to apply an elevation shadow to an element.\n *\n * The attribute values needs to be a number between 1 and 24.\n *\n * ### Notes\n * - If there is no value specified it defaults to 4dp.\n * - If the value is not valid it defaults to 4dp.\n\n * @usage\n * <hljs lang=\"html\">\n * <div md-whiteframe=\"3\">\n * <span>Elevation of 3dp</span>\n * </div>\n * </hljs>\n */\nfunction MdWhiteframeDirective($log) {\n var MIN_DP = 1;\n var MAX_DP = 24;\n var DEFAULT_DP = 4;\n\n return {\n restrict: 'A',\n link: postLink\n };\n\n function postLink(scope, element, attr) {\n var elevation = parseInt(attr.mdWhiteframe, 10) || DEFAULT_DP;\n\n if (elevation > MAX_DP || elevation < MIN_DP) {\n $log.warn('md-whiteframe attribute value is invalid. It should be a number between ' + MIN_DP + ' and ' + MAX_DP, element[0]);\n elevation = DEFAULT_DP;\n }\n\n element.addClass('md-whiteframe-' + elevation + 'dp');\n }\n}\nMdWhiteframeDirective.$inject = [\"$log\"];\n\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.autocomplete')\n .controller('MdAutocompleteCtrl', MdAutocompleteCtrl);\n\nvar ITEM_HEIGHT = 41,\n MAX_HEIGHT = 5.5 * ITEM_HEIGHT,\n MENU_PADDING = 8,\n INPUT_PADDING = 2; // Padding provided by `md-input-container`\n\nfunction MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming, $window,\n $animate, $rootElement, $attrs, $q) {\n //-- private variables\n var ctrl = this,\n itemParts = $scope.itemsExpr.split(/ in /i),\n itemExpr = itemParts[ 1 ],\n elements = null,\n cache = {},\n noBlur = false,\n selectedItemWatchers = [],\n hasFocus = false,\n lastCount = 0,\n fetchesInProgress = 0;\n\n //-- public variables with handlers\n defineProperty('hidden', handleHiddenChange, true);\n\n //-- public variables\n ctrl.scope = $scope;\n ctrl.parent = $scope.$parent;\n ctrl.itemName = itemParts[ 0 ];\n ctrl.matches = [];\n ctrl.loading = false;\n ctrl.hidden = true;\n ctrl.index = null;\n ctrl.messages = [];\n ctrl.id = $mdUtil.nextUid();\n ctrl.isDisabled = null;\n ctrl.isRequired = null;\n ctrl.isReadonly = null;\n ctrl.hasNotFound = false;\n\n //-- public methods\n ctrl.keydown = keydown;\n ctrl.blur = blur;\n ctrl.focus = focus;\n ctrl.clear = clearValue;\n ctrl.select = select;\n ctrl.listEnter = onListEnter;\n ctrl.listLeave = onListLeave;\n ctrl.mouseUp = onMouseup;\n ctrl.getCurrentDisplayValue = getCurrentDisplayValue;\n ctrl.registerSelectedItemWatcher = registerSelectedItemWatcher;\n ctrl.unregisterSelectedItemWatcher = unregisterSelectedItemWatcher;\n ctrl.notFoundVisible = notFoundVisible;\n ctrl.loadingIsVisible = loadingIsVisible;\n\n return init();\n\n //-- initialization methods\n\n /**\n * Initialize the controller, setup watchers, gather elements\n */\n function init () {\n $mdUtil.initOptionalProperties($scope, $attrs, { searchText: null, selectedItem: null });\n $mdTheming($element);\n configureWatchers();\n $mdUtil.nextTick(function () {\n gatherElements();\n moveDropdown();\n focusElement();\n $element.on('focus', focusElement);\n });\n }\n\n /**\n * Calculates the dropdown's position and applies the new styles to the menu element\n * @returns {*}\n */\n function positionDropdown () {\n if (!elements) return $mdUtil.nextTick(positionDropdown, false, $scope);\n var hrect = elements.wrap.getBoundingClientRect(),\n vrect = elements.snap.getBoundingClientRect(),\n root = elements.root.getBoundingClientRect(),\n top = vrect.bottom - root.top,\n bot = root.bottom - vrect.top,\n left = hrect.left - root.left,\n width = hrect.width,\n offset = getVerticalOffset(),\n styles;\n // Adjust the width to account for the padding provided by `md-input-container`\n if ($attrs.mdFloatingLabel) {\n left += INPUT_PADDING;\n width -= INPUT_PADDING * 2;\n }\n styles = {\n left: left + 'px',\n minWidth: width + 'px',\n maxWidth: Math.max(hrect.right - root.left, root.right - hrect.left) - MENU_PADDING + 'px'\n };\n if (top > bot && root.height - hrect.bottom - MENU_PADDING < MAX_HEIGHT) {\n styles.top = 'auto';\n styles.bottom = bot + 'px';\n styles.maxHeight = Math.min(MAX_HEIGHT, hrect.top - root.top - MENU_PADDING) + 'px';\n } else {\n styles.top = (top - offset) + 'px';\n styles.bottom = 'auto';\n styles.maxHeight = Math.min(MAX_HEIGHT, root.bottom + $mdUtil.scrollTop() - hrect.bottom - MENU_PADDING) + 'px';\n }\n\n elements.$.scrollContainer.css(styles);\n $mdUtil.nextTick(correctHorizontalAlignment, false);\n\n /**\n * Calculates the vertical offset for floating label examples to account for ngMessages\n * @returns {number}\n */\n function getVerticalOffset () {\n var offset = 0;\n var inputContainer = $element.find('md-input-container');\n if (inputContainer.length) {\n var input = inputContainer.find('input');\n offset = inputContainer.prop('offsetHeight');\n offset -= input.prop('offsetTop');\n offset -= input.prop('offsetHeight');\n // add in the height left up top for the floating label text\n offset += inputContainer.prop('offsetTop');\n }\n return offset;\n }\n\n /**\n * Makes sure that the menu doesn't go off of the screen on either side.\n */\n function correctHorizontalAlignment () {\n var dropdown = elements.scrollContainer.getBoundingClientRect(),\n styles = {};\n if (dropdown.right > root.right - MENU_PADDING) {\n styles.left = (hrect.right - dropdown.width) + 'px';\n }\n elements.$.scrollContainer.css(styles);\n }\n }\n\n /**\n * Moves the dropdown menu to the body tag in order to avoid z-index and overflow issues.\n */\n function moveDropdown () {\n if (!elements.$.root.length) return;\n $mdTheming(elements.$.scrollContainer);\n elements.$.scrollContainer.detach();\n elements.$.root.append(elements.$.scrollContainer);\n if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);\n }\n\n /**\n * Sends focus to the input element.\n */\n function focusElement () {\n if ($scope.autofocus) elements.input.focus();\n }\n\n /**\n * Sets up any watchers used by autocomplete\n */\n function configureWatchers () {\n var wait = parseInt($scope.delay, 10) || 0;\n $attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });\n $attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });\n $scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);\n $scope.$watch('selectedItem', selectedItemChange);\n angular.element($window).on('resize', positionDropdown);\n $scope.$on('$destroy', cleanup);\n }\n\n /**\n * Removes any events or leftover elements created by this controller\n */\n function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }\n\n /**\n * Gathers all of the elements needed for this controller\n */\n function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }\n\n /**\n * Finds the element that the menu will base its position on\n * @returns {*}\n */\n function getSnapTarget () {\n for (var element = $element; element.length; element = element.parent()) {\n if (angular.isDefined(element.attr('md-autocomplete-snap'))) return element[ 0 ];\n }\n return elements.wrap;\n }\n\n /**\n * Gathers angular-wrapped versions of each element\n * @param elements\n * @returns {{}}\n */\n function getAngularElements (elements) {\n var obj = {};\n for (var key in elements) {\n if (elements.hasOwnProperty(key)) obj[ key ] = angular.element(elements[ key ]);\n }\n return obj;\n }\n\n //-- event/change handlers\n\n /**\n * Handles changes to the `hidden` property.\n * @param hidden\n * @param oldHidden\n */\n function handleHiddenChange (hidden, oldHidden) {\n if (!hidden && oldHidden) {\n positionDropdown();\n\n if (elements) {\n $mdUtil.nextTick(function () {\n $mdUtil.disableScrollAround(elements.ul);\n }, false, $scope);\n }\n } else if (hidden && !oldHidden) {\n $mdUtil.nextTick(function () {\n $mdUtil.enableScrolling();\n }, false, $scope);\n }\n }\n\n /**\n * When the user mouses over the dropdown menu, ignore blur events.\n */\n function onListEnter () {\n noBlur = true;\n }\n\n /**\n * When the user's mouse leaves the menu, blur events may hide the menu again.\n */\n function onListLeave () {\n if (!hasFocus) elements.input.focus();\n noBlur = false;\n ctrl.hidden = shouldHide();\n }\n\n /**\n * When the mouse button is released, send focus back to the input field.\n */\n function onMouseup () {\n elements.input.focus();\n }\n\n /**\n * Handles changes to the selected item.\n * @param selectedItem\n * @param previousSelectedItem\n */\n function selectedItemChange (selectedItem, previousSelectedItem) {\n if (selectedItem) {\n getDisplayValue(selectedItem).then(function (val) {\n $scope.searchText = val;\n handleSelectedItemChange(selectedItem, previousSelectedItem);\n });\n }\n\n if (selectedItem !== previousSelectedItem) announceItemChange();\n }\n\n /**\n * Use the user-defined expression to announce changes each time a new item is selected\n */\n function announceItemChange () {\n angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n }\n\n /**\n * Use the user-defined expression to announce changes each time the search text is changed\n */\n function announceTextChange () {\n angular.isFunction($scope.textChange) && $scope.textChange();\n }\n\n /**\n * Calls any external watchers listening for the selected item. Used in conjunction with\n * `registerSelectedItemWatcher`.\n * @param selectedItem\n * @param previousSelectedItem\n */\n function handleSelectedItemChange (selectedItem, previousSelectedItem) {\n selectedItemWatchers.forEach(function (watcher) { watcher(selectedItem, previousSelectedItem); });\n }\n\n /**\n * Register a function to be called when the selected item changes.\n * @param cb\n */\n function registerSelectedItemWatcher (cb) {\n if (selectedItemWatchers.indexOf(cb) == -1) {\n selectedItemWatchers.push(cb);\n }\n }\n\n /**\n * Unregister a function previously registered for selected item changes.\n * @param cb\n */\n function unregisterSelectedItemWatcher (cb) {\n var i = selectedItemWatchers.indexOf(cb);\n if (i != -1) {\n selectedItemWatchers.splice(i, 1);\n }\n }\n\n /**\n * Handles changes to the searchText property.\n * @param searchText\n * @param previousSearchText\n */\n function handleSearchText (searchText, previousSearchText) {\n ctrl.index = getDefaultIndex();\n // do nothing on init\n if (searchText === previousSearchText) return;\n\n getDisplayValue($scope.selectedItem).then(function (val) {\n // clear selected item if search text no longer matches it\n if (searchText !== val) {\n $scope.selectedItem = null;\n\n // trigger change event if available\n if (searchText !== previousSearchText) announceTextChange();\n\n // cancel results if search text is not long enough\n if (!isMinLengthMet()) {\n ctrl.matches = [];\n setLoading(false);\n updateMessages();\n } else {\n handleQuery();\n }\n }\n });\n\n }\n\n /**\n * Handles input blur event, determines if the dropdown should hide.\n */\n function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }\n\n /**\n * Force blur on input element\n * @param forceBlur\n */\n function doBlur(forceBlur) {\n if (forceBlur) {\n noBlur = false;\n hasFocus = false;\n }\n elements.input.blur();\n }\n\n /**\n * Handles input focus event, determines if the dropdown should show.\n */\n function focus () {\n hasFocus = true;\n //-- if searchText is null, let's force it to be a string\n if (!angular.isString($scope.searchText)) $scope.searchText = '';\n ctrl.hidden = shouldHide();\n if (!ctrl.hidden) handleQuery();\n }\n\n /**\n * Handles keyboard input.\n * @param event\n */\n function keydown (event) {\n switch (event.keyCode) {\n case $mdConstant.KEY_CODE.DOWN_ARROW:\n if (ctrl.loading) return;\n event.stopPropagation();\n event.preventDefault();\n ctrl.index = Math.min(ctrl.index + 1, ctrl.matches.length - 1);\n updateScroll();\n updateMessages();\n break;\n case $mdConstant.KEY_CODE.UP_ARROW:\n if (ctrl.loading) return;\n event.stopPropagation();\n event.preventDefault();\n ctrl.index = ctrl.index < 0 ? ctrl.matches.length - 1 : Math.max(0, ctrl.index - 1);\n updateScroll();\n updateMessages();\n break;\n case $mdConstant.KEY_CODE.TAB:\n // If we hit tab, assume that we've left the list so it will close\n onListLeave();\n\n if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;\n select(ctrl.index);\n break;\n case $mdConstant.KEY_CODE.ENTER:\n if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;\n if (hasSelection()) return;\n event.stopPropagation();\n event.preventDefault();\n select(ctrl.index);\n break;\n case $mdConstant.KEY_CODE.ESCAPE:\n event.stopPropagation();\n event.preventDefault();\n clearValue();\n\n // Force the component to blur if they hit escape\n doBlur(true);\n\n break;\n default:\n }\n }\n\n //-- getters\n\n /**\n * Returns the minimum length needed to display the dropdown.\n * @returns {*}\n */\n function getMinLength () {\n return angular.isNumber($scope.minLength) ? $scope.minLength : 1;\n }\n\n /**\n * Returns the display value for an item.\n * @param item\n * @returns {*}\n */\n function getDisplayValue (item) {\n return $q.when(getItemText(item) || item);\n\n /**\n * Getter function to invoke user-defined expression (in the directive)\n * to convert your object to a single string.\n */\n function getItemText (item) {\n return (item && $scope.itemText) ? $scope.itemText(getItemAsNameVal(item)) : null;\n }\n }\n\n /**\n * Returns the locals object for compiling item templates.\n * @param item\n * @returns {{}}\n */\n function getItemAsNameVal (item) {\n if (!item) return undefined;\n\n var locals = {};\n if (ctrl.itemName) locals[ ctrl.itemName ] = item;\n\n return locals;\n }\n\n /**\n * Returns the default index based on whether or not autoselect is enabled.\n * @returns {number}\n */\n function getDefaultIndex () {\n return $scope.autoselect ? 0 : -1;\n }\n\n /**\n * Sets the loading parameter and updates the hidden state.\n * @param value {boolean} Whether or not the component is currently loading.\n */\n function setLoading(value) {\n if (ctrl.loading != value) {\n ctrl.loading = value;\n }\n\n // Always refresh the hidden variable as something else might have changed\n ctrl.hidden = shouldHide();\n }\n\n /**\n * Determines if the menu should be hidden.\n * @returns {boolean}\n */\n function shouldHide () {\n if (ctrl.loading && !hasMatches()) return true; // Hide while loading initial matches\n else if (hasSelection()) return true; // Hide if there is already a selection\n else if (!hasFocus) return true; // Hide if the input does not have focus\n else return !shouldShow(); // Defer to standard show logic\n }\n\n /**\n * Determines if the menu should be shown.\n * @returns {boolean}\n */\n function shouldShow() {\n return (isMinLengthMet() && hasMatches()) || notFoundVisible();\n }\n\n /**\n * Returns true if the search text has matches.\n * @returns {boolean}\n */\n function hasMatches() {\n return ctrl.matches.length ? true : false;\n }\n\n /**\n * Returns true if the autocomplete has a valid selection.\n * @returns {boolean}\n */\n function hasSelection() {\n return ctrl.scope.selectedItem ? true : false;\n }\n\n /**\n * Returns true if the loading indicator is, or should be, visible.\n * @returns {boolean}\n */\n function loadingIsVisible() {\n return ctrl.loading && !hasSelection();\n }\n\n /**\n * Returns the display value of the current item.\n * @returns {*}\n */\n function getCurrentDisplayValue () {\n return getDisplayValue(ctrl.matches[ ctrl.index ]);\n }\n\n /**\n * Determines if the minimum length is met by the search text.\n * @returns {*}\n */\n function isMinLengthMet () {\n return ($scope.searchText || '').length >= getMinLength();\n }\n\n //-- actions\n\n /**\n * Defines a public property with a handler and a default value.\n * @param key\n * @param handler\n * @param value\n */\n function defineProperty (key, handler, value) {\n Object.defineProperty(ctrl, key, {\n get: function () { return value; },\n set: function (newValue) {\n var oldValue = value;\n value = newValue;\n handler(newValue, oldValue);\n }\n });\n }\n\n /**\n * Selects the item at the given index.\n * @param index\n */\n function select (index) {\n //-- force form to update state for validation\n $mdUtil.nextTick(function () {\n getDisplayValue(ctrl.matches[ index ]).then(function (val) {\n var ngModel = elements.$.input.controller('ngModel');\n ngModel.$setViewValue(val);\n ngModel.$render();\n }).finally(function () {\n $scope.selectedItem = ctrl.matches[ index ];\n setLoading(false);\n });\n }, false);\n }\n\n /**\n * Clears the searchText value and selected item.\n */\n function clearValue () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occour when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n // Reset our variables\n ctrl.index = 0;\n ctrl.matches = [];\n $scope.searchText = '';\n\n // Per http://www.w3schools.com/jsref/event_oninput.asp\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('input', true, true, { value: $scope.searchText });\n elements.input.dispatchEvent(eventObj);\n\n elements.input.focus();\n }\n\n /**\n * Fetches the results for the provided search text.\n * @param searchText\n */\n function fetchResults (searchText) {\n var items = $scope.$parent.$eval(itemExpr),\n term = searchText.toLowerCase(),\n isList = angular.isArray(items),\n isPromise = !!items.then; // Every promise should contain a `then` property\n\n if (isList) handleResults(items);\n else if (isPromise) handleAsyncResults(items);\n\n function handleAsyncResults(items) {\n if ( !items ) return;\n\n items = $q.when(items);\n fetchesInProgress++;\n setLoading(true);\n\n $mdUtil.nextTick(function () {\n items\n .then(handleResults)\n .finally(function(){\n if (--fetchesInProgress === 0) {\n setLoading(false);\n }\n });\n },true, $scope);\n }\n\n function handleResults (matches) {\n cache[ term ] = matches;\n if ((searchText || '') !== ($scope.searchText || '')) return; //-- just cache the results if old request\n\n ctrl.matches = matches;\n ctrl.hidden = shouldHide();\n\n // If loading is in progress, then we'll end the progress. This is needed for example,\n // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.\n if (ctrl.loading) setLoading(false);\n\n if ($scope.selectOnMatch) selectItemOnMatch();\n\n updateMessages();\n positionDropdown();\n }\n }\n\n /**\n * Updates the ARIA messages\n */\n function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }\n\n /**\n * Returns the ARIA message for how many results match the current query.\n * @returns {*}\n */\n function getCountMessage () {\n if (lastCount === ctrl.matches.length) return '';\n lastCount = ctrl.matches.length;\n switch (ctrl.matches.length) {\n case 0:\n return 'There are no matches available.';\n case 1:\n return 'There is 1 match available.';\n default:\n return 'There are ' + ctrl.matches.length + ' matches available.';\n }\n }\n\n /**\n * Makes sure that the focused element is within view.\n */\n function updateScroll () {\n if (!elements.li[0]) return;\n var height = elements.li[0].offsetHeight,\n top = height * ctrl.index,\n bot = top + height,\n hgt = elements.scroller.clientHeight,\n scrollTop = elements.scroller.scrollTop;\n if (top < scrollTop) {\n scrollTo(top);\n } else if (bot > scrollTop + hgt) {\n scrollTo(bot - hgt);\n }\n }\n\n function isPromiseFetching() {\n return fetchesInProgress !== 0;\n }\n\n function scrollTo (offset) {\n elements.$.scrollContainer.controller('mdVirtualRepeatContainer').scrollTo(offset);\n }\n\n function notFoundVisible () {\n var textLength = (ctrl.scope.searchText || '').length;\n\n return ctrl.hasNotFound && !hasMatches() && (!ctrl.loading || isPromiseFetching()) && textLength >= getMinLength() && (hasFocus || noBlur) && !hasSelection();\n }\n\n /**\n * Starts the query to gather the results for the current searchText. Attempts to return cached\n * results first, then forwards the process to `fetchResults` if necessary.\n */\n function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }\n\n /**\n * If there is only one matching item and the search text matches its display value exactly,\n * automatically select that item. Note: This function is only called if the user uses the\n * `md-select-on-match` flag.\n */\n function selectItemOnMatch () {\n var searchText = $scope.searchText,\n matches = ctrl.matches,\n item = matches[ 0 ];\n if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {\n var isMatching = searchText == displayValue;\n if ($scope.matchInsensitive && !isMatching) {\n isMatching = searchText.toLowerCase() == displayValue.toLowerCase();\n }\n\n if (isMatching) select(0);\n });\n }\n\n}\nMdAutocompleteCtrl.$inject = [\"$scope\", \"$element\", \"$mdUtil\", \"$mdConstant\", \"$mdTheming\", \"$window\", \"$animate\", \"$rootElement\", \"$attrs\", \"$q\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.autocomplete')\n .directive('mdAutocomplete', MdAutocomplete);\n\n/**\n * @ngdoc directive\n * @name mdAutocomplete\n * @module material.components.autocomplete\n *\n * @description\n * `<md-autocomplete>` is a special input component with a drop-down of all possible matches to a\n * custom query. This component allows you to provide real-time suggestions as the user types\n * in the input area.\n *\n * To start, you will need to specify the required parameters and provide a template for your\n * results. The content inside `md-autocomplete` will be treated as a template.\n *\n * In more complex cases, you may want to include other content such as a message to display when\n * no matches were found. You can do this by wrapping your template in `md-item-template` and\n * adding a tag for `md-not-found`. An example of this is shown below.\n *\n * ### Validation\n *\n * You can use `ng-messages` to include validation the same way that you would normally validate;\n * however, if you want to replicate a standard input with a floating label, you will have to\n * do the following:\n *\n * - Make sure that your template is wrapped in `md-item-template`\n * - Add your `ng-messages` code inside of `md-autocomplete`\n * - Add your validation properties to `md-autocomplete` (ie. `required`)\n * - Add a `name` to `md-autocomplete` (to be used on the generated `input`)\n *\n * There is an example below of how this should look.\n *\n *\n * @param {expression} md-items An expression in the format of `item in items` to iterate over\n * matches for your search.\n * @param {expression=} md-selected-item-change An expression to be run each time a new item is\n * selected\n * @param {expression=} md-search-text-change An expression to be run each time the search text\n * updates\n * @param {expression=} md-search-text A model to bind the search query text to\n * @param {object=} md-selected-item A model to bind the selected item to\n * @param {expression=} md-item-text An expression that will convert your object to a single string.\n * @param {string=} placeholder Placeholder text that will be forwarded to the input.\n * @param {boolean=} md-no-cache Disables the internal caching that happens in autocomplete\n * @param {boolean=} ng-disabled Determines whether or not to disable the input field\n * @param {number=} md-min-length Specifies the minimum length of text before autocomplete will\n * make suggestions\n * @param {number=} md-delay Specifies the amount of time (in milliseconds) to wait before looking\n * for results\n * @param {boolean=} md-autofocus If true, the autocomplete will be automatically focused when a `$mdDialog`,\n * `$mdBottomsheet` or `$mdSidenav`, which contains the autocomplete, is opening. <br/><br/>\n * Also the autocomplete will immediately focus the input element.\n * @param {boolean=} md-no-asterisk When present, asterisk will not be appended to the floating label\n * @param {boolean=} md-autoselect If true, the first item will be selected by default\n * @param {string=} md-menu-class This will be applied to the dropdown menu for styling\n * @param {string=} md-floating-label This will add a floating label to autocomplete and wrap it in\n * `md-input-container`\n * @param {string=} md-input-name The name attribute given to the input element to be used with\n * FormController\n * @param {string=} md-select-on-focus When present the inputs text will be automatically selected\n * on focus.\n * @param {string=} md-input-id An ID to be added to the input element\n * @param {number=} md-input-minlength The minimum length for the input's value for validation\n * @param {number=} md-input-maxlength The maximum length for the input's value for validation\n * @param {boolean=} md-select-on-match When set, autocomplete will automatically select exact\n * the item if the search text is an exact match\n * @param {boolean=} md-match-case-insensitive When set and using `md-select-on-match`, autocomplete\n * will select on case-insensitive match\n *\n * @usage\n * ### Basic Example\n * <hljs lang=\"html\">\n * <md-autocomplete\n * md-selected-item=\"selectedItem\"\n * md-search-text=\"searchText\"\n * md-items=\"item in getMatches(searchText)\"\n * md-item-text=\"item.display\">\n * <span md-highlight-text=\"searchText\">{{item.display}}</span>\n * </md-autocomplete>\n * </hljs>\n *\n * ### Example with \"not found\" message\n * <hljs lang=\"html\">\n * <md-autocomplete\n * md-selected-item=\"selectedItem\"\n * md-search-text=\"searchText\"\n * md-items=\"item in getMatches(searchText)\"\n * md-item-text=\"item.display\">\n * <md-item-template>\n * <span md-highlight-text=\"searchText\">{{item.display}}</span>\n * </md-item-template>\n * <md-not-found>\n * No matches found.\n * </md-not-found>\n * </md-autocomplete>\n * </hljs>\n *\n * In this example, our code utilizes `md-item-template` and `md-not-found` to specify the\n * different parts that make up our component.\n *\n * ### Example with validation\n * <hljs lang=\"html\">\n * <form name=\"autocompleteForm\">\n * <md-autocomplete\n * required\n * md-input-name=\"autocomplete\"\n * md-selected-item=\"selectedItem\"\n * md-search-text=\"searchText\"\n * md-items=\"item in getMatches(searchText)\"\n * md-item-text=\"item.display\">\n * <md-item-template>\n * <span md-highlight-text=\"searchText\">{{item.display}}</span>\n * </md-item-template>\n * <div ng-messages=\"autocompleteForm.autocomplete.$error\">\n * <div ng-message=\"required\">This field is required</div>\n * </div>\n * </md-autocomplete>\n * </form>\n * </hljs>\n *\n * In this example, our code utilizes `md-item-template` and `md-not-found` to specify the\n * different parts that make up our component.\n */\n\nfunction MdAutocomplete () {\n\n return {\n controller: 'MdAutocompleteCtrl',\n controllerAs: '$mdAutocompleteCtrl',\n scope: {\n inputName: '@mdInputName',\n inputMinlength: '@mdInputMinlength',\n inputMaxlength: '@mdInputMaxlength',\n searchText: '=?mdSearchText',\n selectedItem: '=?mdSelectedItem',\n itemsExpr: '@mdItems',\n itemText: '&mdItemText',\n placeholder: '@placeholder',\n noCache: '=?mdNoCache',\n selectOnMatch: '=?mdSelectOnMatch',\n matchInsensitive: '=?mdMatchCaseInsensitive',\n itemChange: '&?mdSelectedItemChange',\n textChange: '&?mdSearchTextChange',\n minLength: '=?mdMinLength',\n delay: '=?mdDelay',\n autofocus: '=?mdAutofocus',\n floatingLabel: '@?mdFloatingLabel',\n autoselect: '=?mdAutoselect',\n menuClass: '@?mdMenuClass',\n inputId: '@?mdInputId'\n },\n link: function(scope, element, attrs, controller) {\n // Retrieve the state of using a md-not-found template by using our attribute, which will\n // be added to the element in the template function.\n controller.hasNotFound = !!element.attr('md-has-not-found');\n },\n template: function (element, attr) {\n var noItemsTemplate = getNoItemsTemplate(),\n itemTemplate = getItemTemplate(),\n leftover = element.html(),\n tabindex = attr.tabindex;\n\n // Set our attribute for the link function above which runs later.\n // We will set an attribute, because otherwise the stored variables will be trashed when\n // removing the element is hidden while retrieving the template. For example when using ngIf.\n if (noItemsTemplate) element.attr('md-has-not-found', true);\n\n // Always set our tabindex of the autocomplete directive to -1, because our input\n // will hold the actual tabindex.\n element.attr('tabindex', '-1');\n\n return '\\\n <md-autocomplete-wrap\\\n layout=\"row\"\\\n ng-class=\"{ \\'md-whiteframe-z1\\': !floatingLabel, \\'md-menu-showing\\': !$mdAutocompleteCtrl.hidden }\"\\\n role=\"listbox\">\\\n ' + getInputElement() + '\\\n <md-progress-linear\\\n class=\"' + (attr.mdFloatingLabel ? 'md-inline' : '') + '\"\\\n ng-if=\"$mdAutocompleteCtrl.loadingIsVisible()\"\\\n md-mode=\"indeterminate\"></md-progress-linear>\\\n <md-virtual-repeat-container\\\n md-auto-shrink\\\n md-auto-shrink-min=\"1\"\\\n ng-mouseenter=\"$mdAutocompleteCtrl.listEnter()\"\\\n ng-mouseleave=\"$mdAutocompleteCtrl.listLeave()\"\\\n ng-mouseup=\"$mdAutocompleteCtrl.mouseUp()\"\\\n ng-hide=\"$mdAutocompleteCtrl.hidden\"\\\n class=\"md-autocomplete-suggestions-container md-whiteframe-z1\"\\\n ng-class=\"{ \\'md-not-found\\': $mdAutocompleteCtrl.notFoundVisible() }\"\\\n role=\"presentation\">\\\n <ul class=\"md-autocomplete-suggestions\"\\\n ng-class=\"::menuClass\"\\\n id=\"ul-{{$mdAutocompleteCtrl.id}}\">\\\n <li md-virtual-repeat=\"item in $mdAutocompleteCtrl.matches\"\\\n ng-class=\"{ selected: $index === $mdAutocompleteCtrl.index }\"\\\n ng-click=\"$mdAutocompleteCtrl.select($index)\"\\\n md-extra-name=\"$mdAutocompleteCtrl.itemName\">\\\n ' + itemTemplate + '\\\n </li>' + noItemsTemplate + '\\\n </ul>\\\n </md-virtual-repeat-container>\\\n </md-autocomplete-wrap>\\\n <aria-status\\\n class=\"md-visually-hidden\"\\\n role=\"status\"\\\n aria-live=\"assertive\">\\\n <p ng-repeat=\"message in $mdAutocompleteCtrl.messages track by $index\" ng-if=\"message\">{{message}}</p>\\\n </aria-status>';\n\n function getItemTemplate() {\n var templateTag = element.find('md-item-template').detach(),\n html = templateTag.length ? templateTag.html() : element.html();\n if (!templateTag.length) element.empty();\n return '<md-autocomplete-parent-scope md-autocomplete-replace>' + html + '</md-autocomplete-parent-scope>';\n }\n\n function getNoItemsTemplate() {\n var templateTag = element.find('md-not-found').detach(),\n template = templateTag.length ? templateTag.html() : '';\n return template\n ? '<li ng-if=\"$mdAutocompleteCtrl.notFoundVisible()\"\\\n md-autocomplete-parent-scope>' + template + '</li>'\n : '';\n\n }\n\n function getInputElement () {\n if (attr.mdFloatingLabel) {\n return '\\\n <md-input-container flex ng-if=\"floatingLabel\">\\\n <label>{{floatingLabel}}</label>\\\n <input type=\"search\"\\\n ' + (tabindex != null ? 'tabindex=\"' + tabindex + '\"' : '') + '\\\n id=\"{{ inputId || \\'fl-input-\\' + $mdAutocompleteCtrl.id }}\"\\\n name=\"{{inputName}}\"\\\n autocomplete=\"off\"\\\n ng-required=\"$mdAutocompleteCtrl.isRequired\"\\\n ng-readonly=\"$mdAutocompleteCtrl.isReadonly\"\\\n ng-minlength=\"inputMinlength\"\\\n ng-maxlength=\"inputMaxlength\"\\\n ng-disabled=\"$mdAutocompleteCtrl.isDisabled\"\\\n ng-model=\"$mdAutocompleteCtrl.scope.searchText\"\\\n ng-keydown=\"$mdAutocompleteCtrl.keydown($event)\"\\\n ng-blur=\"$mdAutocompleteCtrl.blur()\"\\\n ' + (attr.mdNoAsterisk != null ? 'md-no-asterisk=\"' + attr.mdNoAsterisk + '\"' : '') + '\\\n ng-focus=\"$mdAutocompleteCtrl.focus()\"\\\n aria-owns=\"ul-{{$mdAutocompleteCtrl.id}}\"\\\n ' + (attr.mdSelectOnFocus != null ? 'md-select-on-focus=\"\"' : '') + '\\\n aria-label=\"{{floatingLabel}}\"\\\n aria-autocomplete=\"list\"\\\n aria-haspopup=\"true\"\\\n aria-activedescendant=\"\"\\\n aria-expanded=\"{{!$mdAutocompleteCtrl.hidden}}\"/>\\\n <div md-autocomplete-parent-scope md-autocomplete-replace>' + leftover + '</div>\\\n </md-input-container>';\n } else {\n return '\\\n <input flex type=\"search\"\\\n ' + (tabindex != null ? 'tabindex=\"' + tabindex + '\"' : '') + '\\\n id=\"{{ inputId || \\'input-\\' + $mdAutocompleteCtrl.id }}\"\\\n name=\"{{inputName}}\"\\\n ng-if=\"!floatingLabel\"\\\n autocomplete=\"off\"\\\n ng-required=\"$mdAutocompleteCtrl.isRequired\"\\\n ng-disabled=\"$mdAutocompleteCtrl.isDisabled\"\\\n ng-readonly=\"$mdAutocompleteCtrl.isReadonly\"\\\n ng-model=\"$mdAutocompleteCtrl.scope.searchText\"\\\n ng-keydown=\"$mdAutocompleteCtrl.keydown($event)\"\\\n ng-blur=\"$mdAutocompleteCtrl.blur()\"\\\n ng-focus=\"$mdAutocompleteCtrl.focus()\"\\\n placeholder=\"{{placeholder}}\"\\\n aria-owns=\"ul-{{$mdAutocompleteCtrl.id}}\"\\\n ' + (attr.mdSelectOnFocus != null ? 'md-select-on-focus=\"\"' : '') + '\\\n aria-label=\"{{placeholder}}\"\\\n aria-autocomplete=\"list\"\\\n aria-haspopup=\"true\"\\\n aria-activedescendant=\"\"\\\n aria-expanded=\"{{!$mdAutocompleteCtrl.hidden}}\"/>\\\n <button\\\n type=\"button\"\\\n tabindex=\"-1\"\\\n ng-if=\"$mdAutocompleteCtrl.scope.searchText && !$mdAutocompleteCtrl.isDisabled\"\\\n ng-click=\"$mdAutocompleteCtrl.clear()\">\\\n <md-icon md-svg-icon=\"md-close\"></md-icon>\\\n <span class=\"md-visually-hidden\">Clear</span>\\\n </button>\\\n ';\n }\n }\n }\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.autocomplete')\n .directive('mdAutocompleteParentScope', MdAutocompleteItemScopeDirective);\n\nfunction MdAutocompleteItemScopeDirective($compile, $mdUtil) {\n return {\n restrict: 'AE',\n compile: compile,\n terminal: true,\n transclude: 'element'\n };\n\n function compile(tElement, tAttr, transclude) {\n return function postLink(scope, element, attr) {\n var ctrl = scope.$mdAutocompleteCtrl;\n var newScope = ctrl.parent.$new();\n var itemName = ctrl.itemName;\n\n // Watch for changes to our scope's variables and copy them to the new scope\n watchVariable('$index', '$index');\n watchVariable('item', itemName);\n\n // Ensure that $digest calls on our scope trigger $digest on newScope.\n connectScopes();\n\n // Link the element against newScope.\n transclude(newScope, function(clone) {\n element.after(clone);\n });\n\n /**\n * Creates a watcher for variables that are copied from the parent scope\n * @param variable\n * @param alias\n */\n function watchVariable(variable, alias) {\n newScope[alias] = scope[variable];\n\n scope.$watch(variable, function(value) {\n $mdUtil.nextTick(function() {\n newScope[alias] = value;\n });\n });\n }\n\n /**\n * Creates watchers on scope and newScope that ensure that for any\n * $digest of scope, newScope is also $digested.\n */\n function connectScopes() {\n var scopeDigesting = false;\n var newScopeDigesting = false;\n\n scope.$watch(function() {\n if (newScopeDigesting || scopeDigesting) {\n return;\n }\n\n scopeDigesting = true;\n scope.$$postDigest(function() {\n if (!newScopeDigesting) {\n newScope.$digest();\n }\n\n scopeDigesting = newScopeDigesting = false;\n });\n });\n\n newScope.$watch(function() {\n newScopeDigesting = true;\n });\n }\n };\n }\n}\nMdAutocompleteItemScopeDirective.$inject = [\"$compile\", \"$mdUtil\"];\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.autocomplete')\n .controller('MdHighlightCtrl', MdHighlightCtrl);\n\nfunction MdHighlightCtrl ($scope, $element, $attrs) {\n this.init = init;\n\n function init (termExpr, unsafeTextExpr) {\n var text = null,\n regex = null,\n flags = $attrs.mdHighlightFlags || '',\n watcher = $scope.$watch(function($scope) {\n return {\n term: termExpr($scope),\n unsafeText: unsafeTextExpr($scope)\n };\n }, function (state, prevState) {\n if (text === null || state.unsafeText !== prevState.unsafeText) {\n text = angular.element('<div>').text(state.unsafeText).html()\n }\n if (regex === null || state.term !== prevState.term) {\n regex = getRegExp(state.term, flags);\n }\n\n $element.html(text.replace(regex, '<span class=\"highlight\">$&</span>'));\n }, true);\n $element.on('$destroy', watcher);\n }\n\n function sanitize (term) {\n return term && term.replace(/[\\\\\\^\\$\\*\\+\\?\\.\\(\\)\\|\\{}\\[\\]]/g, '\\\\$&');\n }\n\n function getRegExp (text, flags) {\n var str = '';\n if (flags.indexOf('^') >= 1) str += '^';\n str += text;\n if (flags.indexOf('$') >= 1) str += '$';\n return new RegExp(sanitize(str), flags.replace(/[\\$\\^]/g, ''));\n }\n}\nMdHighlightCtrl.$inject = [\"$scope\", \"$element\", \"$attrs\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.autocomplete')\n .directive('mdHighlightText', MdHighlight);\n\n/**\n * @ngdoc directive\n * @name mdHighlightText\n * @module material.components.autocomplete\n *\n * @description\n * The `md-highlight-text` directive allows you to specify text that should be highlighted within\n * an element. Highlighted text will be wrapped in `<span class=\"highlight\"></span>` which can\n * be styled through CSS. Please note that child elements may not be used with this directive.\n *\n * @param {string} md-highlight-text A model to be searched for\n * @param {string=} md-highlight-flags A list of flags (loosely based on JavaScript RexExp flags).\n * #### **Supported flags**:\n * - `g`: Find all matches within the provided text\n * - `i`: Ignore case when searching for matches\n * - `$`: Only match if the text ends with the search term\n * - `^`: Only match if the text begins with the search term\n *\n * @usage\n * <hljs lang=\"html\">\n * <input placeholder=\"Enter a search term...\" ng-model=\"searchTerm\" type=\"text\" />\n * <ul>\n * <li ng-repeat=\"result in results\" md-highlight-text=\"searchTerm\">\n * {{result.text}}\n * </li>\n * </ul>\n * </hljs>\n */\n\nfunction MdHighlight ($interpolate, $parse) {\n return {\n terminal: true,\n controller: 'MdHighlightCtrl',\n compile: function mdHighlightCompile(tElement, tAttr) {\n var termExpr = $parse(tAttr.mdHighlightText);\n var unsafeTextExpr = $interpolate(tElement.html());\n\n return function mdHighlightLink(scope, element, attr, ctrl) {\n ctrl.init(termExpr, unsafeTextExpr);\n };\n }\n };\n}\nMdHighlight.$inject = [\"$interpolate\", \"$parse\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.chips')\n .directive('mdChip', MdChip);\n\n/**\n * @ngdoc directive\n * @name mdChip\n * @module material.components.chips\n *\n * @description\n * `<md-chip>` is a component used within `<md-chips>` and is responsible for rendering individual\n * chips.\n *\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-chip>{{$chip}}</md-chip>\n * </hljs>\n *\n */\n\n// This hint text is hidden within a chip but used by screen readers to\n// inform the user how they can interact with a chip.\nvar DELETE_HINT_TEMPLATE = '\\\n <span ng-if=\"!$mdChipsCtrl.readonly\" class=\"md-visually-hidden\">\\\n {{$mdChipsCtrl.deleteHint}}\\\n </span>';\n\n/**\n * MDChip Directive Definition\n *\n * @param $mdTheming\n * @param $mdInkRipple\n * @ngInject\n */\nfunction MdChip($mdTheming, $mdUtil) {\n var hintTemplate = $mdUtil.processTemplate(DELETE_HINT_TEMPLATE);\n\n return {\n restrict: 'E',\n require: '^?mdChips',\n compile: compile\n };\n\n function compile(element, attr) {\n // Append the delete template\n element.append($mdUtil.processTemplate(hintTemplate));\n\n return function postLink(scope, element, attr, ctrl) {\n element.addClass('md-chip');\n $mdTheming(element);\n\n if (ctrl) angular.element(element[0].querySelector('.md-chip-content'))\n .on('blur', function () {\n ctrl.resetSelectedChip();\n ctrl.$scope.$applyAsync();\n });\n };\n }\n}\nMdChip.$inject = [\"$mdTheming\", \"$mdUtil\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.chips')\n .directive('mdChipRemove', MdChipRemove);\n\n/**\n * @ngdoc directive\n * @name mdChipRemove\n * @module material.components.chips\n *\n * @description\n * `<md-chip-remove>`\n * Designates an element to be used as the delete button for a chip. This\n * element is passed as a child of the `md-chips` element.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-chips><button md-chip-remove>DEL</button></md-chips>\n * </hljs>\n */\n\n\n/**\n * MdChipRemove Directive Definition.\n * \n * @param $compile\n * @param $timeout\n * @returns {{restrict: string, require: string[], link: Function, scope: boolean}}\n * @constructor\n */\nfunction MdChipRemove ($timeout) {\n return {\n restrict: 'A',\n require: '^mdChips',\n scope: false,\n link: postLink\n };\n\n function postLink(scope, element, attr, ctrl) {\n element.on('click', function(event) {\n scope.$apply(function() {\n ctrl.removeChip(scope.$$replacedScope.$index);\n });\n });\n\n // Child elements aren't available until after a $timeout tick as they are hidden by an\n // `ng-if`. see http://goo.gl/zIWfuw\n $timeout(function() {\n element.attr({ tabindex: -1, 'aria-hidden': true });\n element.find('button').attr('tabindex', '-1');\n });\n }\n}\nMdChipRemove.$inject = [\"$timeout\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.chips')\n .directive('mdChipTransclude', MdChipTransclude);\n\nfunction MdChipTransclude ($compile) {\n return {\n restrict: 'EA',\n terminal: true,\n link: link,\n scope: false\n };\n function link (scope, element, attr) {\n var ctrl = scope.$parent.$mdChipsCtrl,\n newScope = ctrl.parent.$new(false, ctrl.parent);\n newScope.$$replacedScope = scope;\n newScope.$chip = scope.$chip;\n newScope.$index = scope.$index;\n newScope.$mdChipsCtrl = ctrl;\n\n var newHtml = ctrl.$scope.$eval(attr.mdChipTransclude);\n\n element.html(newHtml);\n $compile(element.contents())(newScope);\n }\n}\nMdChipTransclude.$inject = [\"$compile\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.chips')\n .controller('MdChipsCtrl', MdChipsCtrl);\n\n/**\n * Controller for the MdChips component. Responsible for adding to and\n * removing from the list of chips, marking chips as selected, and binding to\n * the models of various input components.\n *\n * @param $scope\n * @param $mdConstant\n * @param $log\n * @param $element\n * @param $mdUtil\n * @constructor\n */\nfunction MdChipsCtrl ($scope, $mdConstant, $log, $element, $timeout, $mdUtil) {\n /** @type {$timeout} **/\n this.$timeout = $timeout;\n\n /** @type {Object} */\n this.$mdConstant = $mdConstant;\n\n /** @type {angular.$scope} */\n this.$scope = $scope;\n\n /** @type {angular.$scope} */\n this.parent = $scope.$parent;\n\n /** @type {$log} */\n this.$log = $log;\n\n /** @type {$element} */\n this.$element = $element;\n\n /** @type {angular.NgModelController} */\n this.ngModelCtrl = null;\n\n /** @type {angular.NgModelController} */\n this.userInputNgModelCtrl = null;\n\n /** @type {Element} */\n this.userInputElement = null;\n\n /** @type {Array.<Object>} */\n this.items = [];\n\n /** @type {number} */\n this.selectedChip = -1;\n\n /** @type {boolean} */\n this.hasAutocomplete = false;\n\n /** @type {string} */\n this.enableChipEdit = $mdUtil.parseAttributeBoolean(this.mdEnableChipEdit);\n\n /**\n * Hidden hint text for how to delete a chip. Used to give context to screen readers.\n * @type {string}\n */\n this.deleteHint = 'Press delete to remove this chip.';\n\n /**\n * Hidden label for the delete button. Used to give context to screen readers.\n * @type {string}\n */\n this.deleteButtonLabel = 'Remove';\n\n /**\n * Model used by the input element.\n * @type {string}\n */\n this.chipBuffer = '';\n\n /**\n * Whether to use the onAppend expression to transform the chip buffer\n * before appending it to the list.\n * @type {boolean}\n *\n *\n * @deprecated Will remove in 1.0.\n */\n this.useOnAppend = false;\n\n /**\n * Whether to use the transformChip expression to transform the chip buffer\n * before appending it to the list.\n * @type {boolean}\n */\n this.useTransformChip = false;\n\n /**\n * Whether to use the onAdd expression to notify of chip additions.\n * @type {boolean}\n */\n this.useOnAdd = false;\n\n /**\n * Whether to use the onRemove expression to notify of chip removals.\n * @type {boolean}\n */\n this.useOnRemove = false;\n\n /**\n * Whether to use the onSelect expression to notify the component's user\n * after selecting a chip from the list.\n * @type {boolean}\n */\n this.useOnSelect = false;\n}\nMdChipsCtrl.$inject = [\"$scope\", \"$mdConstant\", \"$log\", \"$element\", \"$timeout\", \"$mdUtil\"];\n\n/**\n * Handles the keydown event on the input element: by default <enter> appends\n * the buffer to the chip list, while backspace removes the last chip in the\n * list if the current buffer is empty.\n * @param event\n */\nMdChipsCtrl.prototype.inputKeydown = function(event) {\n var chipBuffer = this.getChipBuffer();\n\n // If we have an autocomplete, and it handled the event, we have nothing to do\n if (this.hasAutocomplete && event.isDefaultPrevented && event.isDefaultPrevented()) {\n return;\n }\n\n if (event.keyCode === this.$mdConstant.KEY_CODE.BACKSPACE) {\n if (chipBuffer) return;\n event.preventDefault();\n event.stopPropagation();\n if (this.items.length) this.selectAndFocusChipSafe(this.items.length - 1);\n return;\n }\n\n // By default <enter> appends the buffer to the chip list.\n if (!this.separatorKeys || this.separatorKeys.length < 1) {\n this.separatorKeys = [this.$mdConstant.KEY_CODE.ENTER];\n }\n\n // Support additional separator key codes in an array of `md-separator-keys`.\n if (this.separatorKeys.indexOf(event.keyCode) !== -1) {\n if ((this.hasAutocomplete && this.requireMatch) || !chipBuffer) return;\n event.preventDefault();\n\n // Only append the chip and reset the chip buffer if the max chips limit isn't reached.\n if (this.hasMaxChipsReached()) return;\n\n this.appendChip(chipBuffer.trim());\n this.resetChipBuffer();\n }\n};\n\n\n/**\n * Updates the content of the chip at given index\n * @param chipIndex\n * @param chipContents\n */\nMdChipsCtrl.prototype.updateChipContents = function(chipIndex, chipContents){\n if(chipIndex >= 0 && chipIndex < this.items.length) {\n this.items[chipIndex] = chipContents;\n this.ngModelCtrl.$setDirty();\n }\n};\n\n\n/**\n * Returns true if a chip is currently being edited. False otherwise.\n * @return {boolean}\n */\nMdChipsCtrl.prototype.isEditingChip = function(){\n return !!this.$element[0].getElementsByClassName('md-chip-editing').length;\n};\n\n\n/**\n * Handles the keydown event on the chip elements: backspace removes the selected chip, arrow\n * keys switch which chips is active\n * @param event\n */\nMdChipsCtrl.prototype.chipKeydown = function (event) {\n if (this.getChipBuffer()) return;\n if (this.isEditingChip()) return;\n \n switch (event.keyCode) {\n case this.$mdConstant.KEY_CODE.BACKSPACE:\n case this.$mdConstant.KEY_CODE.DELETE:\n if (this.selectedChip < 0) return;\n event.preventDefault();\n this.removeAndSelectAdjacentChip(this.selectedChip);\n break;\n case this.$mdConstant.KEY_CODE.LEFT_ARROW:\n event.preventDefault();\n if (this.selectedChip < 0) this.selectedChip = this.items.length;\n if (this.items.length) this.selectAndFocusChipSafe(this.selectedChip - 1);\n break;\n case this.$mdConstant.KEY_CODE.RIGHT_ARROW:\n event.preventDefault();\n this.selectAndFocusChipSafe(this.selectedChip + 1);\n break;\n case this.$mdConstant.KEY_CODE.ESCAPE:\n case this.$mdConstant.KEY_CODE.TAB:\n if (this.selectedChip < 0) return;\n event.preventDefault();\n this.onFocus();\n break;\n }\n};\n\n/**\n * Get the input's placeholder - uses `placeholder` when list is empty and `secondary-placeholder`\n * when the list is non-empty. If `secondary-placeholder` is not provided, `placeholder` is used\n * always.\n */\nMdChipsCtrl.prototype.getPlaceholder = function() {\n // Allow `secondary-placeholder` to be blank.\n var useSecondary = (this.items.length &&\n (this.secondaryPlaceholder == '' || this.secondaryPlaceholder));\n return useSecondary ? this.secondaryPlaceholder : this.placeholder;\n};\n\n/**\n * Removes chip at {@code index} and selects the adjacent chip.\n * @param index\n */\nMdChipsCtrl.prototype.removeAndSelectAdjacentChip = function(index) {\n var selIndex = this.getAdjacentChipIndex(index);\n this.removeChip(index);\n this.$timeout(angular.bind(this, function () {\n this.selectAndFocusChipSafe(selIndex);\n }));\n};\n\n/**\n * Sets the selected chip index to -1.\n */\nMdChipsCtrl.prototype.resetSelectedChip = function() {\n this.selectedChip = -1;\n};\n\n/**\n * Gets the index of an adjacent chip to select after deletion. Adjacency is\n * determined as the next chip in the list, unless the target chip is the\n * last in the list, then it is the chip immediately preceding the target. If\n * there is only one item in the list, -1 is returned (select none).\n * The number returned is the index to select AFTER the target has been\n * removed.\n * If the current chip is not selected, then -1 is returned to select none.\n */\nMdChipsCtrl.prototype.getAdjacentChipIndex = function(index) {\n var len = this.items.length - 1;\n return (len == 0) ? -1 :\n (index == len) ? index -1 : index;\n};\n\n/**\n * Append the contents of the buffer to the chip list. This method will first\n * call out to the md-transform-chip method, if provided.\n *\n * @param newChip\n */\nMdChipsCtrl.prototype.appendChip = function(newChip) {\n if (this.useTransformChip && this.transformChip) {\n var transformedChip = this.transformChip({'$chip': newChip});\n\n // Check to make sure the chip is defined before assigning it, otherwise, we'll just assume\n // they want the string version.\n if (angular.isDefined(transformedChip)) {\n newChip = transformedChip;\n }\n }\n\n // If items contains an identical object to newChip, do not append\n if (angular.isObject(newChip)){\n var identical = this.items.some(function(item){\n return angular.equals(newChip, item);\n });\n if (identical) return;\n }\n\n // Check for a null (but not undefined), or existing chip and cancel appending\n if (newChip == null || this.items.indexOf(newChip) + 1) return;\n\n // Append the new chip onto our list\n var index = this.items.push(newChip);\n\n // Update model validation\n this.ngModelCtrl.$setDirty();\n this.validateModel();\n\n // If they provide the md-on-add attribute, notify them of the chip addition\n if (this.useOnAdd && this.onAdd) {\n this.onAdd({ '$chip': newChip, '$index': index });\n }\n};\n\n/**\n * Sets whether to use the md-on-append expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onAppend}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n *\n * @deprecated\n *\n * TODO: Remove deprecated md-on-append functionality in 1.0\n */\nMdChipsCtrl.prototype.useOnAppendExpression = function() {\n this.$log.warn(\"md-on-append is deprecated; please use md-transform-chip or md-on-add instead\");\n if (!this.useTransformChip || !this.transformChip) {\n this.useTransformChip = true;\n this.transformChip = this.onAppend;\n }\n};\n\n/**\n * Sets whether to use the md-transform-chip expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code transformChip}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useTransformChipExpression = function() {\n this.useTransformChip = true;\n};\n\n/**\n * Sets whether to use the md-on-add expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onAdd}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useOnAddExpression = function() {\n this.useOnAdd = true;\n};\n\n/**\n * Sets whether to use the md-on-remove expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onRemove}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useOnRemoveExpression = function() {\n this.useOnRemove = true;\n};\n\n/*\n * Sets whether to use the md-on-select expression. This expression is\n * bound to scope and controller in {@code MdChipsDirective} as\n * {@code onSelect}. Due to the nature of directive scope bindings, the\n * controller cannot know on its own/from the scope whether an expression was\n * actually provided.\n */\nMdChipsCtrl.prototype.useOnSelectExpression = function() {\n this.useOnSelect = true;\n};\n\n/**\n * Gets the input buffer. The input buffer can be the model bound to the\n * default input item {@code this.chipBuffer}, the {@code selectedItem}\n * model of an {@code md-autocomplete}, or, through some magic, the model\n * bound to any inpput or text area element found within a\n * {@code md-input-container} element.\n * @return {Object|string}\n */\nMdChipsCtrl.prototype.getChipBuffer = function() {\n return !this.userInputElement ? this.chipBuffer :\n this.userInputNgModelCtrl ? this.userInputNgModelCtrl.$viewValue :\n this.userInputElement[0].value;\n};\n\n/**\n * Resets the input buffer for either the internal input or user provided input element.\n */\nMdChipsCtrl.prototype.resetChipBuffer = function() {\n if (this.userInputElement) {\n if (this.userInputNgModelCtrl) {\n this.userInputNgModelCtrl.$setViewValue('');\n this.userInputNgModelCtrl.$render();\n } else {\n this.userInputElement[0].value = '';\n }\n } else {\n this.chipBuffer = '';\n }\n};\n\nMdChipsCtrl.prototype.hasMaxChipsReached = function() {\n if (angular.isString(this.maxChips)) this.maxChips = parseInt(this.maxChips, 10) || 0;\n\n return this.maxChips > 0 && this.items.length >= this.maxChips;\n};\n\n/**\n * Updates the validity properties for the ngModel.\n */\nMdChipsCtrl.prototype.validateModel = function() {\n this.ngModelCtrl.$setValidity('md-max-chips', !this.hasMaxChipsReached());\n};\n\n/**\n * Removes the chip at the given index.\n * @param index\n */\nMdChipsCtrl.prototype.removeChip = function(index) {\n var removed = this.items.splice(index, 1);\n\n // Update model validation\n this.ngModelCtrl.$setDirty();\n this.validateModel();\n\n if (removed && removed.length && this.useOnRemove && this.onRemove) {\n this.onRemove({ '$chip': removed[0], '$index': index });\n }\n};\n\nMdChipsCtrl.prototype.removeChipAndFocusInput = function (index) {\n this.removeChip(index);\n this.onFocus();\n};\n/**\n * Selects the chip at `index`,\n * @param index\n */\nMdChipsCtrl.prototype.selectAndFocusChipSafe = function(index) {\n if (!this.items.length) {\n this.selectChip(-1);\n this.onFocus();\n return;\n }\n if (index === this.items.length) return this.onFocus();\n index = Math.max(index, 0);\n index = Math.min(index, this.items.length - 1);\n this.selectChip(index);\n this.focusChip(index);\n};\n\n/**\n * Marks the chip at the given index as selected.\n * @param index\n */\nMdChipsCtrl.prototype.selectChip = function(index) {\n if (index >= -1 && index <= this.items.length) {\n this.selectedChip = index;\n\n // Fire the onSelect if provided\n if (this.useOnSelect && this.onSelect) {\n this.onSelect({'$chip': this.items[this.selectedChip] });\n }\n } else {\n this.$log.warn('Selected Chip index out of bounds; ignoring.');\n }\n};\n\n/**\n * Selects the chip at `index` and gives it focus.\n * @param index\n */\nMdChipsCtrl.prototype.selectAndFocusChip = function(index) {\n this.selectChip(index);\n if (index != -1) {\n this.focusChip(index);\n }\n};\n\n/**\n * Call `focus()` on the chip at `index`\n */\nMdChipsCtrl.prototype.focusChip = function(index) {\n this.$element[0].querySelector('md-chip[index=\"' + index + '\"] .md-chip-content').focus();\n};\n\n/**\n * Configures the required interactions with the ngModel Controller.\n * Specifically, set {@code this.items} to the {@code NgModelCtrl#$viewVale}.\n * @param ngModelCtrl\n */\nMdChipsCtrl.prototype.configureNgModel = function(ngModelCtrl) {\n this.ngModelCtrl = ngModelCtrl;\n\n var self = this;\n ngModelCtrl.$render = function() {\n // model is updated. do something.\n self.items = self.ngModelCtrl.$viewValue;\n };\n};\n\nMdChipsCtrl.prototype.onFocus = function () {\n var input = this.$element[0].querySelector('input');\n input && input.focus();\n this.resetSelectedChip();\n};\n\nMdChipsCtrl.prototype.onInputFocus = function () {\n this.inputHasFocus = true;\n this.resetSelectedChip();\n};\n\nMdChipsCtrl.prototype.onInputBlur = function () {\n this.inputHasFocus = false;\n};\n\n/**\n * Configure event bindings on a user-provided input element.\n * @param inputElement\n */\nMdChipsCtrl.prototype.configureUserInput = function(inputElement) {\n this.userInputElement = inputElement;\n\n // Find the NgModelCtrl for the input element\n var ngModelCtrl = inputElement.controller('ngModel');\n // `.controller` will look in the parent as well.\n if (ngModelCtrl != this.ngModelCtrl) {\n this.userInputNgModelCtrl = ngModelCtrl;\n }\n\n var scope = this.$scope;\n var ctrl = this;\n\n // Run all of the events using evalAsync because a focus may fire a blur in the same digest loop\n var scopeApplyFn = function(event, fn) {\n scope.$evalAsync(angular.bind(ctrl, fn, event));\n };\n\n // Bind to keydown and focus events of input\n inputElement\n .attr({ tabindex: 0 })\n .on('keydown', function(event) { scopeApplyFn(event, ctrl.inputKeydown) })\n .on('focus', function(event) { scopeApplyFn(event, ctrl.onInputFocus) })\n .on('blur', function(event) { scopeApplyFn(event, ctrl.onInputBlur) })\n};\n\nMdChipsCtrl.prototype.configureAutocomplete = function(ctrl) {\n if ( ctrl ) {\n this.hasAutocomplete = true;\n\n ctrl.registerSelectedItemWatcher(angular.bind(this, function (item) {\n if (item) {\n // Only append the chip and reset the chip buffer if the max chips limit isn't reached.\n if (this.hasMaxChipsReached()) return;\n\n this.appendChip(item);\n this.resetChipBuffer();\n }\n }));\n\n this.$element.find('input')\n .on('focus',angular.bind(this, this.onInputFocus) )\n .on('blur', angular.bind(this, this.onInputBlur) );\n }\n};\n\nMdChipsCtrl.prototype.hasFocus = function () {\n return this.inputHasFocus || this.selectedChip >= 0;\n};\n\n})();\n(function(){\n\"use strict\";\n\n angular\n .module('material.components.chips')\n .directive('mdChips', MdChips);\n\n /**\n * @ngdoc directive\n * @name mdChips\n * @module material.components.chips\n *\n * @description\n * `<md-chips>` is an input component for building lists of strings or objects. The list items are\n * displayed as 'chips'. This component can make use of an `<input>` element or an \n * `<md-autocomplete>` element.\n *\n * ### Custom templates\n * A custom template may be provided to render the content of each chip. This is achieved by\n * specifying an `<md-chip-template>` element containing the custom content as a child of\n * `<md-chips>`.\n *\n * Note: Any attributes on\n * `<md-chip-template>` will be dropped as only the innerHTML is used for the chip template. The\n * variables `$chip` and `$index` are available in the scope of `<md-chip-template>`, representing\n * the chip object and its index in the list of chips, respectively.\n * To override the chip delete control, include an element (ideally a button) with the attribute\n * `md-chip-remove`. A click listener to remove the chip will be added automatically. The element\n * is also placed as a sibling to the chip content (on which there are also click listeners) to\n * avoid a nested ng-click situation.\n *\n * <h3> Pending Features </h3>\n * <ul style=\"padding-left:20px;\">\n *\n * <ul>Style\n * <li>Colours for hover, press states (ripple?).</li>\n * </ul>\n *\n * <ul>Validation\n * <li>allow a validation callback</li>\n * <li>hilighting style for invalid chips</li>\n * </ul>\n *\n * <ul>Item mutation\n * <li>Support `\n * <md-chip-edit>` template, show/hide the edit element on tap/click? double tap/double\n * click?\n * </li>\n * </ul>\n *\n * <ul>Truncation and Disambiguation (?)\n * <li>Truncate chip text where possible, but do not truncate entries such that two are\n * indistinguishable.</li>\n * </ul>\n *\n * <ul>Drag and Drop\n * <li>Drag and drop chips between related `<md-chips>` elements.\n * </li>\n * </ul>\n * </ul>\n *\n * <span style=\"font-size:.8em;text-align:center\">\n * Warning: This component is a WORK IN PROGRESS. If you use it now,\n * it will probably break on you in the future.\n * </span>\n *\n * @param {string=|object=} ng-model A model to bind the list of items to\n * @param {string=} placeholder Placeholder text that will be forwarded to the input.\n * @param {string=} secondary-placeholder Placeholder text that will be forwarded to the input,\n * displayed when there is at least one item in the list\n * @param {boolean=} readonly Disables list manipulation (deleting or adding list items), hiding\n * the input and delete buttons\n * @param {number=} md-max-chips The maximum number of chips allowed to add through user input.\n * <br/><br/>The validation property `md-max-chips` can be used when the max chips\n * amount is reached.\n * @param {expression} md-transform-chip An expression of form `myFunction($chip)` that when called\n * expects one of the following return values:\n * - an object representing the `$chip` input string\n * - `undefined` to simply add the `$chip` input string, or\n * - `null` to prevent the chip from being appended\n * @param {expression=} md-on-add An expression which will be called when a chip has been\n * added.\n * @param {expression=} md-on-remove An expression which will be called when a chip has been\n * removed.\n * @param {expression=} md-on-select An expression which will be called when a chip is selected.\n * @param {boolean} md-require-match If true, and the chips template contains an autocomplete,\n * only allow selection of pre-defined chips (i.e. you cannot add new ones).\n * @param {string=} delete-hint A string read by screen readers instructing users that pressing\n * the delete key will remove the chip.\n * @param {string=} delete-button-label A label for the delete button. Also hidden and read by\n * screen readers.\n * @param {expression=} md-separator-keys An array of key codes used to separate chips.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-chips\n * ng-model=\"myItems\"\n * placeholder=\"Add an item\"\n * readonly=\"isReadOnly\">\n * </md-chips>\n * </hljs>\n *\n * <h3>Validation</h3>\n * When using [ngMessages](https://docs.angularjs.org/api/ngMessages), you can show errors based\n * on our custom validators.\n * <hljs lang=\"html\">\n * <form name=\"userForm\">\n * <md-chips\n * name=\"fruits\"\n * ng-model=\"myItems\"\n * placeholder=\"Add an item\"\n * md-max-chips=\"5\">\n * </md-chips>\n * <div ng-messages=\"userForm.fruits.$error\" ng-if=\"userForm.$dirty\">\n * <div ng-message=\"md-max-chips\">You reached the maximum amount of chips</div>\n * </div>\n * </form>\n * </hljs>\n *\n */\n\n\n var MD_CHIPS_TEMPLATE = '\\\n <md-chips-wrap\\\n ng-if=\"!$mdChipsCtrl.readonly || $mdChipsCtrl.items.length > 0\"\\\n ng-keydown=\"$mdChipsCtrl.chipKeydown($event)\"\\\n ng-class=\"{ \\'md-focused\\': $mdChipsCtrl.hasFocus(), \\'md-readonly\\': !$mdChipsCtrl.ngModelCtrl }\"\\\n class=\"md-chips\">\\\n <md-chip ng-repeat=\"$chip in $mdChipsCtrl.items\"\\\n index=\"{{$index}}\"\\\n ng-class=\"{\\'md-focused\\': $mdChipsCtrl.selectedChip == $index, \\'md-readonly\\': $mdChipsCtrl.readonly}\">\\\n <div class=\"md-chip-content\"\\\n tabindex=\"-1\"\\\n aria-hidden=\"true\"\\\n ng-click=\"!$mdChipsCtrl.readonly && $mdChipsCtrl.focusChip($index)\"\\\n ng-focus=\"!$mdChipsCtrl.readonly && $mdChipsCtrl.selectChip($index)\"\\\n md-chip-transclude=\"$mdChipsCtrl.chipContentsTemplate\"></div>\\\n <div ng-if=\"!$mdChipsCtrl.readonly\"\\\n class=\"md-chip-remove-container\"\\\n md-chip-transclude=\"$mdChipsCtrl.chipRemoveTemplate\"></div>\\\n </md-chip>\\\n <div ng-if=\"!$mdChipsCtrl.readonly && $mdChipsCtrl.ngModelCtrl\"\\\n class=\"md-chip-input-container\"\\\n md-chip-transclude=\"$mdChipsCtrl.chipInputTemplate\"></div>\\\n </div>\\\n </md-chips-wrap>';\n\n var CHIP_INPUT_TEMPLATE = '\\\n <input\\\n class=\"md-input\"\\\n tabindex=\"0\"\\\n placeholder=\"{{$mdChipsCtrl.getPlaceholder()}}\"\\\n aria-label=\"{{$mdChipsCtrl.getPlaceholder()}}\"\\\n ng-model=\"$mdChipsCtrl.chipBuffer\"\\\n ng-focus=\"$mdChipsCtrl.onInputFocus()\"\\\n ng-blur=\"$mdChipsCtrl.onInputBlur()\"\\\n ng-trim=\"false\"\\\n ng-keydown=\"$mdChipsCtrl.inputKeydown($event)\">';\n\n var CHIP_DEFAULT_TEMPLATE = '\\\n <span>{{$chip}}</span>';\n\n var CHIP_REMOVE_TEMPLATE = '\\\n <button\\\n class=\"md-chip-remove\"\\\n ng-if=\"!$mdChipsCtrl.readonly\"\\\n ng-click=\"$mdChipsCtrl.removeChipAndFocusInput($$replacedScope.$index)\"\\\n type=\"button\"\\\n aria-hidden=\"true\"\\\n tabindex=\"-1\">\\\n <md-icon md-svg-icon=\"md-close\"></md-icon>\\\n <span class=\"md-visually-hidden\">\\\n {{$mdChipsCtrl.deleteButtonLabel}}\\\n </span>\\\n </button>';\n\n /**\n * MDChips Directive Definition\n */\n function MdChips ($mdTheming, $mdUtil, $compile, $log, $timeout) {\n // Run our templates through $mdUtil.processTemplate() to allow custom start/end symbols\n var templates = getTemplates();\n\n return {\n template: function(element, attrs) {\n // Clone the element into an attribute. By prepending the attribute\n // name with '$', Angular won't write it into the DOM. The cloned\n // element propagates to the link function via the attrs argument,\n // where various contained-elements can be consumed.\n attrs['$mdUserTemplate'] = element.clone();\n return templates.chips;\n },\n require: ['mdChips'],\n restrict: 'E',\n controller: 'MdChipsCtrl',\n controllerAs: '$mdChipsCtrl',\n bindToController: true,\n compile: compile,\n scope: {\n readonly: '=readonly',\n placeholder: '@',\n secondaryPlaceholder: '@',\n maxChips: '@mdMaxChips',\n transformChip: '&mdTransformChip',\n onAppend: '&mdOnAppend',\n onAdd: '&mdOnAdd',\n onRemove: '&mdOnRemove',\n onSelect: '&mdOnSelect',\n deleteHint: '@',\n deleteButtonLabel: '@',\n separatorKeys: '=?mdSeparatorKeys',\n requireMatch: '=?mdRequireMatch'\n }\n };\n\n /**\n * Builds the final template for `md-chips` and returns the postLink function.\n *\n * Building the template involves 3 key components:\n * static chips\n * chip template\n * input control\n *\n * If no `ng-model` is provided, only the static chip work needs to be done.\n *\n * If no user-passed `md-chip-template` exists, the default template is used. This resulting\n * template is appended to the chip content element.\n *\n * The remove button may be overridden by passing an element with an md-chip-remove attribute.\n *\n * If an `input` or `md-autocomplete` element is provided by the caller, it is set aside for\n * transclusion later. The transclusion happens in `postLink` as the parent scope is required.\n * If no user input is provided, a default one is appended to the input container node in the\n * template.\n *\n * Static Chips (i.e. `md-chip` elements passed from the caller) are gathered and set aside for\n * transclusion in the `postLink` function.\n *\n *\n * @param element\n * @param attr\n * @returns {Function}\n */\n function compile(element, attr) {\n // Grab the user template from attr and reset the attribute to null.\n var userTemplate = attr['$mdUserTemplate'];\n attr['$mdUserTemplate'] = null;\n\n // Set the chip remove, chip contents and chip input templates. The link function will put\n // them on the scope for transclusion later.\n var chipRemoveTemplate = getTemplateByQuery('md-chips>*[md-chip-remove]') || templates.remove,\n chipContentsTemplate = getTemplateByQuery('md-chips>md-chip-template') || templates.default,\n chipInputTemplate = getTemplateByQuery('md-chips>md-autocomplete')\n || getTemplateByQuery('md-chips>input')\n || templates.input,\n staticChips = userTemplate.find('md-chip');\n\n // Warn of malformed template. See #2545\n if (userTemplate[0].querySelector('md-chip-template>*[md-chip-remove]')) {\n $log.warn('invalid placement of md-chip-remove within md-chip-template.');\n }\n\n function getTemplateByQuery (query) {\n if (!attr.ngModel) return;\n var element = userTemplate[0].querySelector(query);\n return element && element.outerHTML;\n }\n\n /**\n * Configures controller and transcludes.\n */\n return function postLink(scope, element, attrs, controllers) {\n $mdUtil.initOptionalProperties(scope, attr);\n\n $mdTheming(element);\n var mdChipsCtrl = controllers[0];\n mdChipsCtrl.chipContentsTemplate = chipContentsTemplate;\n mdChipsCtrl.chipRemoveTemplate = chipRemoveTemplate;\n mdChipsCtrl.chipInputTemplate = chipInputTemplate;\n\n element\n .attr({ 'aria-hidden': true, tabindex: -1 })\n .on('focus', function () { mdChipsCtrl.onFocus(); });\n\n if (attr.ngModel) {\n mdChipsCtrl.configureNgModel(element.controller('ngModel'));\n\n // If an `md-transform-chip` attribute was set, tell the controller to use the expression\n // before appending chips.\n if (attrs.mdTransformChip) mdChipsCtrl.useTransformChipExpression();\n\n // If an `md-on-append` attribute was set, tell the controller to use the expression\n // when appending chips.\n //\n // DEPRECATED: Will remove in official 1.0 release\n if (attrs.mdOnAppend) mdChipsCtrl.useOnAppendExpression();\n\n // If an `md-on-add` attribute was set, tell the controller to use the expression\n // when adding chips.\n if (attrs.mdOnAdd) mdChipsCtrl.useOnAddExpression();\n\n // If an `md-on-remove` attribute was set, tell the controller to use the expression\n // when removing chips.\n if (attrs.mdOnRemove) mdChipsCtrl.useOnRemoveExpression();\n\n // If an `md-on-select` attribute was set, tell the controller to use the expression\n // when selecting chips.\n if (attrs.mdOnSelect) mdChipsCtrl.useOnSelectExpression();\n\n // The md-autocomplete and input elements won't be compiled until after this directive\n // is complete (due to their nested nature). Wait a tick before looking for them to\n // configure the controller.\n if (chipInputTemplate != templates.input) {\n // The autocomplete will not appear until the readonly attribute is not true (i.e.\n // false or undefined), so we have to watch the readonly and then on the next tick\n // after the chip transclusion has run, we can configure the autocomplete and user\n // input.\n scope.$watch('$mdChipsCtrl.readonly', function(readonly) {\n if (!readonly) {\n $mdUtil.nextTick(function(){\n if (chipInputTemplate.indexOf('<md-autocomplete') === 0)\n mdChipsCtrl\n .configureAutocomplete(element.find('md-autocomplete')\n .controller('mdAutocomplete'));\n mdChipsCtrl.configureUserInput(element.find('input'));\n });\n }\n });\n }\n\n // At the next tick, if we find an input, make sure it has the md-input class\n $mdUtil.nextTick(function() {\n var input = element.find('input');\n\n input && input.toggleClass('md-input', true);\n });\n }\n\n // Compile with the parent's scope and prepend any static chips to the wrapper.\n if (staticChips.length > 0) {\n var compiledStaticChips = $compile(staticChips.clone())(scope.$parent);\n $timeout(function() { element.find('md-chips-wrap').prepend(compiledStaticChips); });\n }\n };\n }\n\n function getTemplates() {\n return {\n chips: $mdUtil.processTemplate(MD_CHIPS_TEMPLATE),\n input: $mdUtil.processTemplate(CHIP_INPUT_TEMPLATE),\n default: $mdUtil.processTemplate(CHIP_DEFAULT_TEMPLATE),\n remove: $mdUtil.processTemplate(CHIP_REMOVE_TEMPLATE)\n };\n }\n }\n MdChips.$inject = [\"$mdTheming\", \"$mdUtil\", \"$compile\", \"$log\", \"$timeout\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.chips')\n .controller('MdContactChipsCtrl', MdContactChipsCtrl);\n\n\n\n/**\n * Controller for the MdContactChips component\n * @constructor\n */\nfunction MdContactChipsCtrl () {\n /** @type {Object} */\n this.selectedItem = null;\n\n /** @type {string} */\n this.searchText = '';\n}\n\n\nMdContactChipsCtrl.prototype.queryContact = function(searchText) {\n var results = this.contactQuery({'$query': searchText});\n return this.filterSelected ?\n results.filter(angular.bind(this, this.filterSelectedContacts)) : results;\n};\n\n\nMdContactChipsCtrl.prototype.itemName = function(item) {\n return item[this.contactName];\n};\n\n\nMdContactChipsCtrl.prototype.filterSelectedContacts = function(contact) {\n return this.contacts.indexOf(contact) == -1;\n};\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.chips')\n .directive('mdContactChips', MdContactChips);\n\n/**\n * @ngdoc directive\n * @name mdContactChips\n * @module material.components.chips\n *\n * @description\n * `<md-contact-chips>` is an input component based on `md-chips` and makes use of an\n * `md-autocomplete` element. The component allows the caller to supply a query expression which\n * returns a list of possible contacts. The user can select one of these and add it to the list of\n * chips.\n *\n * You may also use the `md-highlight-text` directive along with its parameters to control the\n * appearance of the matched text inside of the contacts' autocomplete popup.\n *\n * @param {string=|object=} ng-model A model to bind the list of items to\n * @param {string=} placeholder Placeholder text that will be forwarded to the input.\n * @param {string=} secondary-placeholder Placeholder text that will be forwarded to the input,\n * displayed when there is at least on item in the list\n * @param {expression} md-contacts An expression expected to return contacts matching the search\n * test, `$query`. If this expression involves a promise, a loading bar is displayed while\n * waiting for it to resolve.\n * @param {string} md-contact-name The field name of the contact object representing the\n * contact's name.\n * @param {string} md-contact-email The field name of the contact object representing the\n * contact's email address.\n * @param {string} md-contact-image The field name of the contact object representing the\n * contact's image.\n *\n *\n * @param {expression=} filter-selected Whether to filter selected contacts from the list of\n * suggestions shown in the autocomplete. This attribute has been removed but may come back.\n *\n *\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-contact-chips\n * ng-model=\"ctrl.contacts\"\n * md-contacts=\"ctrl.querySearch($query)\"\n * md-contact-name=\"name\"\n * md-contact-image=\"image\"\n * md-contact-email=\"email\"\n * placeholder=\"To\">\n * </md-contact-chips>\n * </hljs>\n *\n */\n\n\nvar MD_CONTACT_CHIPS_TEMPLATE = '\\\n <md-chips class=\"md-contact-chips\"\\\n ng-model=\"$mdContactChipsCtrl.contacts\"\\\n md-require-match=\"$mdContactChipsCtrl.requireMatch\"\\\n md-autocomplete-snap>\\\n <md-autocomplete\\\n md-menu-class=\"md-contact-chips-suggestions\"\\\n md-selected-item=\"$mdContactChipsCtrl.selectedItem\"\\\n md-search-text=\"$mdContactChipsCtrl.searchText\"\\\n md-items=\"item in $mdContactChipsCtrl.queryContact($mdContactChipsCtrl.searchText)\"\\\n md-item-text=\"$mdContactChipsCtrl.itemName(item)\"\\\n md-no-cache=\"true\"\\\n md-autoselect\\\n placeholder=\"{{$mdContactChipsCtrl.contacts.length == 0 ?\\\n $mdContactChipsCtrl.placeholder : $mdContactChipsCtrl.secondaryPlaceholder}}\">\\\n <div class=\"md-contact-suggestion\">\\\n <img \\\n ng-src=\"{{item[$mdContactChipsCtrl.contactImage]}}\"\\\n alt=\"{{item[$mdContactChipsCtrl.contactName]}}\"\\\n ng-if=\"item[$mdContactChipsCtrl.contactImage]\" />\\\n <span class=\"md-contact-name\" md-highlight-text=\"$mdContactChipsCtrl.searchText\"\\\n md-highlight-flags=\"{{$mdContactChipsCtrl.highlightFlags}}\">\\\n {{item[$mdContactChipsCtrl.contactName]}}\\\n </span>\\\n <span class=\"md-contact-email\" >{{item[$mdContactChipsCtrl.contactEmail]}}</span>\\\n </div>\\\n </md-autocomplete>\\\n <md-chip-template>\\\n <div class=\"md-contact-avatar\">\\\n <img \\\n ng-src=\"{{$chip[$mdContactChipsCtrl.contactImage]}}\"\\\n alt=\"{{$chip[$mdContactChipsCtrl.contactName]}}\"\\\n ng-if=\"$chip[$mdContactChipsCtrl.contactImage]\" />\\\n </div>\\\n <div class=\"md-contact-name\">\\\n {{$chip[$mdContactChipsCtrl.contactName]}}\\\n </div>\\\n </md-chip-template>\\\n </md-chips>';\n\n\n/**\n * MDContactChips Directive Definition\n *\n * @param $mdTheming\n * @returns {*}\n * @ngInject\n */\nfunction MdContactChips($mdTheming, $mdUtil) {\n return {\n template: function(element, attrs) {\n return MD_CONTACT_CHIPS_TEMPLATE;\n },\n restrict: 'E',\n controller: 'MdContactChipsCtrl',\n controllerAs: '$mdContactChipsCtrl',\n bindToController: true,\n compile: compile,\n scope: {\n contactQuery: '&mdContacts',\n placeholder: '@',\n secondaryPlaceholder: '@',\n contactName: '@mdContactName',\n contactImage: '@mdContactImage',\n contactEmail: '@mdContactEmail',\n contacts: '=ngModel',\n requireMatch: '=?mdRequireMatch',\n highlightFlags: '@?mdHighlightFlags'\n }\n };\n\n function compile(element, attr) {\n return function postLink(scope, element, attrs, controllers) {\n\n $mdUtil.initOptionalProperties(scope, attr);\n $mdTheming(element);\n\n element.attr('tabindex', '-1');\n };\n }\n}\nMdContactChips.$inject = [\"$mdTheming\", \"$mdUtil\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.icon')\n .directive('mdIcon', ['$mdIcon', '$mdTheming', '$mdAria', mdIconDirective]);\n\n/**\n * @ngdoc directive\n * @name mdIcon\n * @module material.components.icon\n *\n * @restrict E\n *\n * @description\n * The `md-icon` directive makes it easier to use vector-based icons in your app (as opposed to\n * raster-based icons types like PNG). The directive supports both icon fonts and SVG icons.\n *\n * Icons should be consider view-only elements that should not be used directly as buttons; instead nest a `<md-icon>`\n * inside a `md-button` to add hover and click features.\n *\n * ### Icon fonts\n * Icon fonts are a technique in which you use a font where the glyphs in the font are\n * your icons instead of text. Benefits include a straightforward way to bundle everything into a\n * single HTTP request, simple scaling, easy color changing, and more.\n *\n * `md-icon` lets you consume an icon font by letting you reference specific icons in that font\n * by name rather than character code.\n *\n * ### SVG\n * For SVGs, the problem with using `<img>` or a CSS `background-image` is that you can't take\n * advantage of some SVG features, such as styling specific parts of the icon with CSS or SVG\n * animation.\n *\n * `md-icon` makes it easier to use SVG icons by *inlining* the SVG into an `<svg>` element in the\n * document. The most straightforward way of referencing an SVG icon is via URL, just like a\n * traditional `<img>`. `$mdIconProvider`, as a convenience, lets you _name_ an icon so you can\n * reference it by name instead of URL throughout your templates.\n *\n * Additionally, you may not want to make separate HTTP requests for every icon, so you can bundle\n * your SVG icons together and pre-load them with $mdIconProvider as an icon set. An icon set can\n * also be given a name, which acts as a namespace for individual icons, so you can reference them\n * like `\"social:cake\"`.\n *\n * When using SVGs, both external SVGs (via URLs) or sets of SVGs [from icon sets] can be\n * easily loaded and used.When use font-icons, developers must following three (3) simple steps:\n *\n * <ol>\n * <li>Load the font library. e.g.<br/>\n * <link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\"\n * rel=\"stylesheet\">\n * </li>\n * <li> Use either (a) font-icon class names or (b) font ligatures to render the font glyph by using its textual name</li>\n * <li> Use <md-icon md-font-icon=\"classname\" /> or <br/>\n * use <md-icon md-font-set=\"font library classname or alias\"> textual_name </md-icon> or <br/>\n * use <md-icon md-font-set=\"font library classname or alias\"> numerical_character_reference </md-icon>\n * </li>\n * </ol>\n *\n * Full details for these steps can be found:\n *\n * <ul>\n * <li>http://google.github.io/material-design-icons/</li>\n * <li>http://google.github.io/material-design-icons/#icon-font-for-the-web</li>\n * </ul>\n *\n * The Material Design icon style <code>.material-icons</code> and the icon font references are published in\n * Material Design Icons:\n *\n * <ul>\n * <li>http://www.google.com/design/icons/</li>\n * <li>https://www.google.com/design/icons/#ic_accessibility</li>\n * </ul>\n *\n * <h2 id=\"material_design_icons\">Material Design Icons</h2>\n * Using the Material Design Icon-Selector, developers can easily and quickly search for a Material Design font-icon and\n * determine its textual name and character reference code. Click on any icon to see the slide-up information\n * panel with details regarding a SVG download or information on the font-icon usage.\n *\n * <a href=\"https://www.google.com/design/icons/#ic_accessibility\" target=\"_blank\" style=\"border-bottom:none;\">\n * <img src=\"https://cloud.githubusercontent.com/assets/210413/7902490/fe8dd14c-0780-11e5-98fb-c821cc6475e6.png\"\n * aria-label=\"Material Design Icon-Selector\" style=\"max-width:75%;padding-left:10%\">\n * </a>\n *\n * <span class=\"image_caption\">\n * Click on the image above to link to the\n * <a href=\"https://www.google.com/design/icons/#ic_accessibility\" target=\"_blank\">Material Design Icon-Selector</a>.\n * </span>\n *\n * @param {string} md-font-icon String name of CSS icon associated with the font-face will be used\n * to render the icon. Requires the fonts and the named CSS styles to be preloaded.\n * @param {string} md-font-set CSS style name associated with the font library; which will be assigned as\n * the class for the font-icon ligature. This value may also be an alias that is used to lookup the classname;\n * internally use `$mdIconProvider.fontSet(<alias>)` to determine the style name.\n * @param {string} md-svg-src String URL (or expression) used to load, cache, and display an\n * external SVG.\n * @param {string} md-svg-icon md-svg-icon String name used for lookup of the icon from the internal cache;\n * interpolated strings or expressions may also be used. Specific set names can be used with\n * the syntax `<set name>:<icon name>`.<br/><br/>\n * To use icon sets, developers are required to pre-register the sets using the `$mdIconProvider` service.\n * @param {string=} aria-label Labels icon for accessibility. If an empty string is provided, icon\n * will be hidden from accessibility layer with `aria-hidden=\"true\"`. If there's no aria-label on the icon\n * nor a label on the parent element, a warning will be logged to the console.\n * @param {string=} alt Labels icon for accessibility. If an empty string is provided, icon\n * will be hidden from accessibility layer with `aria-hidden=\"true\"`. If there's no alt on the icon\n * nor a label on the parent element, a warning will be logged to the console.\n *\n * @usage\n * When using SVGs:\n * <hljs lang=\"html\">\n *\n * <!-- Icon ID; may contain optional icon set prefix; icons must registered using $mdIconProvider -->\n * <md-icon md-svg-icon=\"social:android\" aria-label=\"android \" ></md-icon>\n *\n * <!-- Icon urls; may be preloaded in templateCache -->\n * <md-icon md-svg-src=\"/android.svg\" aria-label=\"android \" ></md-icon>\n * <md-icon md-svg-src=\"{{ getAndroid() }}\" aria-label=\"android \" ></md-icon>\n *\n * </hljs>\n *\n * Use the <code>$mdIconProvider</code> to configure your application with\n * svg iconsets.\n *\n * <hljs lang=\"js\">\n * angular.module('appSvgIconSets', ['ngMaterial'])\n * .controller('DemoCtrl', function($scope) {})\n * .config(function($mdIconProvider) {\n * $mdIconProvider\n * .iconSet('social', 'img/icons/sets/social-icons.svg', 24)\n * .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n * });\n * </hljs>\n *\n *\n * When using Font Icons with classnames:\n * <hljs lang=\"html\">\n *\n * <md-icon md-font-icon=\"android\" aria-label=\"android\" ></md-icon>\n * <md-icon class=\"icon_home\" aria-label=\"Home\" ></md-icon>\n *\n * </hljs>\n *\n * When using Material Font Icons with ligatures:\n * <hljs lang=\"html\">\n * <!--\n * For Material Design Icons\n * The class '.material-icons' is auto-added if a style has NOT been specified\n * since `material-icons` is the default fontset. So your markup:\n * -->\n * <md-icon> face </md-icon>\n * <!-- becomes this at runtime: -->\n * <md-icon md-font-set=\"material-icons\"> face </md-icon>\n * <!-- If the fontset does not support ligature names, then we need to use the ligature unicode.-->\n * <md-icon>  </md-icon>\n * <!-- The class '.material-icons' must be manually added if other styles are also specified-->\n * <md-icon class=\"material-icons md-light md-48\"> face </md-icon>\n * </hljs>\n *\n * When using other Font-Icon libraries:\n *\n * <hljs lang=\"js\">\n * // Specify a font-icon style alias\n * angular.config(function($mdIconProvider) {\n * $mdIconProvider.fontSet('md', 'material-icons');\n * });\n * </hljs>\n *\n * <hljs lang=\"html\">\n * <md-icon md-font-set=\"md\">favorite</md-icon>\n * </hljs>\n *\n */\nfunction mdIconDirective($mdIcon, $mdTheming, $mdAria ) {\n\n return {\n restrict: 'E',\n link : postLink\n };\n\n\n /**\n * Directive postLink\n * Supports embedded SVGs, font-icons, & external SVGs\n */\n function postLink(scope, element, attr) {\n $mdTheming(element);\n\n prepareForFontIcon();\n\n // If using a font-icon, then the textual name of the icon itself\n // provides the aria-label.\n\n var label = attr.alt || attr.mdFontIcon || attr.mdSvgIcon || element.text();\n var attrName = attr.$normalize(attr.$attr.mdSvgIcon || attr.$attr.mdSvgSrc || '');\n\n if ( !attr['aria-label'] ) {\n\n if (label !== '' && !parentsHaveText() ) {\n\n $mdAria.expect(element, 'aria-label', label);\n $mdAria.expect(element, 'role', 'img');\n\n } else if ( !element.text() ) {\n // If not a font-icon with ligature, then\n // hide from the accessibility layer.\n\n $mdAria.expect(element, 'aria-hidden', 'true');\n }\n }\n\n if (attrName) {\n // Use either pre-configured SVG or URL source, respectively.\n attr.$observe(attrName, function(attrVal) {\n\n element.empty();\n if (attrVal) {\n $mdIcon(attrVal)\n .then(function(svg) {\n element.empty();\n element.append(svg);\n });\n }\n\n });\n }\n\n function parentsHaveText() {\n var parent = element.parent();\n if (parent.attr('aria-label') || parent.text()) {\n return true;\n }\n else if(parent.parent().attr('aria-label') || parent.parent().text()) {\n return true;\n }\n return false;\n }\n\n function prepareForFontIcon() {\n if (!attr.mdSvgIcon && !attr.mdSvgSrc) {\n if (attr.mdFontIcon) {\n element.addClass('md-font ' + attr.mdFontIcon);\n }\n element.addClass($mdIcon.fontSet(attr.mdFontSet));\n }\n }\n }\n}\n\n})();\n(function(){\n\"use strict\";\n\n angular\n .module('material.components.icon' )\n .provider('$mdIcon', MdIconProvider);\n\n /**\n * @ngdoc service\n * @name $mdIconProvider\n * @module material.components.icon\n *\n * @description\n * `$mdIconProvider` is used only to register icon IDs with URLs. These configuration features allow\n * icons and icon sets to be pre-registered and associated with source URLs **before** the `<md-icon />`\n * directives are compiled.\n *\n * If using font-icons, the developer is responsible for loading the fonts.\n *\n * If using SVGs, loading of the actual svg files are deferred to on-demand requests and are loaded\n * internally by the `$mdIcon` service using the `$http` service. When an SVG is requested by name/ID,\n * the `$mdIcon` service searches its registry for the associated source URL;\n * that URL is used to on-demand load and parse the SVG dynamically.\n *\n * **Notice:** Most font-icons libraries do not support ligatures (for example `fontawesome`).<br/>\n * In such cases you are not able to use the icon's ligature name - Like so:\n *\n * <hljs lang=\"html\">\n * <md-icon md-font-set=\"fa\">fa-bell</md-icon>\n * </hljs>\n *\n * You should instead use the given unicode, instead of the ligature name.\n *\n * <p ng-hide=\"true\"> ##// Notice we can't use a hljs element here, because the characters will be escaped.</p>\n * ```html\n * <md-icon md-font-set=\"fa\"></md-icon>\n * ```\n *\n * All unicode ligatures are prefixed with the `&#x` string.\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .defaultFontSet( 'fa' ) // This sets our default fontset className.\n * .defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons\n * .iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs\n * .icon('android', 'my/app/android.svg') // Register a specific icon (by name)\n * .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set\n * });\n * </hljs>\n *\n * SVG icons and icon sets can be easily pre-loaded and cached using either (a) a build process or (b) a runtime\n * **startup** process (shown below):\n *\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n *\n * // Register a default set of SVG icon definitions\n * $mdIconProvider.defaultIconSet('my/app/icons.svg')\n *\n * })\n * .run(function($http, $templateCache){\n *\n * // Pre-fetch icons sources by URL and cache in the $templateCache...\n * // subsequent $http calls will look there first.\n *\n * var urls = [ 'imy/app/icons.svg', 'img/icons/android.svg'];\n *\n * angular.forEach(urls, function(url) {\n * $http.get(url, {cache: $templateCache});\n * });\n *\n * });\n *\n * </hljs>\n *\n * NOTE: the loaded SVG data is subsequently cached internally for future requests.\n *\n */\n\n /**\n * @ngdoc method\n * @name $mdIconProvider#icon\n *\n * @description\n * Register a source URL for a specific icon name; the name may include optional 'icon set' name prefix.\n * These icons will later be retrieved from the cache using `$mdIcon( <icon name> )`\n *\n * @param {string} id Icon name/id used to register the icon\n * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the\n * data or as part of the lookup in `$templateCache` if pre-loading was configured.\n * @param {number=} viewBoxSize Sets the width and height the icon's viewBox.\n * It is ignored for icons with an existing viewBox. Default size is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .icon('android', 'my/app/android.svg') // Register a specific icon (by name)\n * .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set\n * });\n * </hljs>\n *\n */\n /**\n * @ngdoc method\n * @name $mdIconProvider#iconSet\n *\n * @description\n * Register a source URL for a 'named' set of icons; group of SVG definitions where each definition\n * has an icon id. Individual icons can be subsequently retrieved from this cached set using\n * `$mdIcon(<icon set name>:<icon name>)`\n *\n * @param {string} id Icon name/id used to register the iconset\n * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the\n * data or as part of the lookup in `$templateCache` if pre-loading was configured.\n * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set.\n * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.\n * Default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .iconSet('social', 'my/app/social.svg') // Register a named icon set\n * });\n * </hljs>\n *\n */\n /**\n * @ngdoc method\n * @name $mdIconProvider#defaultIconSet\n *\n * @description\n * Register a source URL for the default 'named' set of icons. Unless explicitly registered,\n * subsequent lookups of icons will failover to search this 'default' icon set.\n * Icon can be retrieved from this cached, default set using `$mdIcon(<name>)`\n *\n * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the\n * data or as part of the lookup in `$templateCache` if pre-loading was configured.\n * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set.\n * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.\n * Default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .defaultIconSet( 'my/app/social.svg' ) // Register a default icon set\n * });\n * </hljs>\n *\n */\n /**\n * @ngdoc method\n * @name $mdIconProvider#defaultFontSet\n *\n * @description\n * When using Font-Icons, Angular Material assumes the the Material Design icons will be used and automatically\n * configures the default font-set == 'material-icons'. Note that the font-set references the font-icon library\n * class style that should be applied to the `<md-icon>`.\n *\n * Configuring the default means that the attributes\n * `md-font-set=\"material-icons\"` or `class=\"material-icons\"` do not need to be explicitly declared on the\n * `<md-icon>` markup. For example:\n *\n * `<md-icon> face </md-icon>`\n * will render as\n * `<span class=\"material-icons\"> face </span>`, and\n *\n * `<md-icon md-font-set=\"fa\"> face </md-icon>`\n * will render as\n * `<span class=\"fa\"> face </span>`\n *\n * @param {string} name of the font-library style that should be applied to the md-icon DOM element\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n * $mdIconProvider.defaultFontSet( 'fa' );\n * });\n * </hljs>\n *\n */\n\n /**\n * @ngdoc method\n * @name $mdIconProvider#fontSet\n *\n * @description\n * When using a font set for `<md-icon>` you must specify the correct font classname in the `md-font-set`\n * attribute. If the fonset className is really long, your markup may become cluttered... an easy\n * solution is to define an `alias` for your fontset:\n *\n * @param {string} alias of the specified fontset.\n * @param {string} className of the fontset.\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n * // In this case, we set an alias for the `material-icons` fontset.\n * $mdIconProvider.fontSet('md', 'material-icons');\n * });\n * </hljs>\n *\n */\n\n /**\n * @ngdoc method\n * @name $mdIconProvider#defaultViewBoxSize\n *\n * @description\n * While `<md-icon />` markup can also be style with sizing CSS, this method configures\n * the default width **and** height used for all icons; unless overridden by specific CSS.\n * The default sizing is (24px, 24px).\n * @param {number=} viewBoxSize Sets the width and height of the viewBox for an icon or an icon set.\n * All icons in a set should be the same size. The default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * <hljs lang=\"js\">\n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .defaultViewBoxSize(36) // Register a default icon size (width == height)\n * });\n * </hljs>\n *\n */\n\n var config = {\n defaultViewBoxSize: 24,\n defaultFontSet: 'material-icons',\n fontSets : [ ]\n };\n\n function MdIconProvider() { }\n\n MdIconProvider.prototype = {\n icon : function (id, url, viewBoxSize) {\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n config[id] = new ConfigurationItem(url, viewBoxSize );\n return this;\n },\n\n iconSet : function (id, url, viewBoxSize) {\n config[id] = new ConfigurationItem(url, viewBoxSize );\n return this;\n },\n\n defaultIconSet : function (url, viewBoxSize) {\n var setName = '$default';\n\n if ( !config[setName] ) {\n config[setName] = new ConfigurationItem(url, viewBoxSize );\n }\n\n config[setName].viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n\n return this;\n },\n\n defaultViewBoxSize : function (viewBoxSize) {\n config.defaultViewBoxSize = viewBoxSize;\n return this;\n },\n\n /**\n * Register an alias name associated with a font-icon library style ;\n */\n fontSet : function fontSet(alias, className) {\n config.fontSets.push({\n alias : alias,\n fontSet : className || alias\n });\n return this;\n },\n\n /**\n * Specify a default style name associated with a font-icon library\n * fallback to Material Icons.\n *\n */\n defaultFontSet : function defaultFontSet(className) {\n config.defaultFontSet = !className ? '' : className;\n return this;\n },\n\n defaultIconSize : function defaultIconSize(iconSize) {\n config.defaultIconSize = iconSize;\n return this;\n },\n\n preloadIcons: function ($templateCache) {\n var iconProvider = this;\n var svgRegistry = [\n {\n id : 'md-tabs-arrow',\n url: 'md-tabs-arrow.svg',\n svg: '<svg version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 24 24\"><g><polygon points=\"15.4,7.4 14,6 8,12 14,18 15.4,16.6 10.8,12 \"/></g></svg>'\n },\n {\n id : 'md-close',\n url: 'md-close.svg',\n svg: '<svg version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 24 24\"><g><path d=\"M19 6.41l-1.41-1.41-5.59 5.59-5.59-5.59-1.41 1.41 5.59 5.59-5.59 5.59 1.41 1.41 5.59-5.59 5.59 5.59 1.41-1.41-5.59-5.59z\"/></g></svg>'\n },\n {\n id: 'md-cancel',\n url: 'md-cancel.svg',\n svg: '<svg version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 24 24\"><g><path d=\"M12 2c-5.53 0-10 4.47-10 10s4.47 10 10 10 10-4.47 10-10-4.47-10-10-10zm5 13.59l-1.41 1.41-3.59-3.59-3.59 3.59-1.41-1.41 3.59-3.59-3.59-3.59 1.41-1.41 3.59 3.59 3.59-3.59 1.41 1.41-3.59 3.59 3.59 3.59z\"/></g></svg>'\n },\n {\n id: 'md-menu',\n url: 'md-menu.svg',\n svg: '<svg version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 24 24\"><path d=\"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z\" /></svg>'\n },\n {\n id: 'md-toggle-arrow',\n url: 'md-toggle-arrow-svg',\n svg: '<svg version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 48 48\"><path d=\"M24 16l-12 12 2.83 2.83 9.17-9.17 9.17 9.17 2.83-2.83z\"/><path d=\"M0 0h48v48h-48z\" fill=\"none\"/></svg>'\n },\n {\n id: 'md-calendar',\n url: 'md-calendar.svg',\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z\"/></svg>'\n }\n ];\n\n svgRegistry.forEach(function(asset){\n iconProvider.icon(asset.id, asset.url);\n $templateCache.put(asset.url, asset.svg);\n });\n\n },\n\n $get : ['$http', '$q', '$log', '$templateCache', '$mdUtil', function($http, $q, $log, $templateCache, $mdUtil) {\n this.preloadIcons($templateCache);\n return MdIconService(config, $http, $q, $log, $templateCache, $mdUtil);\n }]\n };\n\n /**\n * Configuration item stored in the Icon registry; used for lookups\n * to load if not already cached in the `loaded` cache\n */\n function ConfigurationItem(url, viewBoxSize) {\n this.url = url;\n this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n }\n\n /**\n * @ngdoc service\n * @name $mdIcon\n * @module material.components.icon\n *\n * @description\n * The `$mdIcon` service is a function used to lookup SVG icons.\n *\n * @param {string} id Query value for a unique Id or URL. If the argument is a URL, then the service will retrieve the icon element\n * from its internal cache or load the icon and cache it first. If the value is not a URL-type string, then an ID lookup is\n * performed. The Id may be a unique icon ID or may include an iconSet ID prefix.\n *\n * For the **id** query to work properly, this means that all id-to-URL mappings must have been previously configured\n * using the `$mdIconProvider`.\n *\n * @returns {obj} Clone of the initial SVG DOM element; which was created from the SVG markup in the SVG data file.\n *\n * @usage\n * <hljs lang=\"js\">\n * function SomeDirective($mdIcon) {\n *\n * // See if the icon has already been loaded, if not\n * // then lookup the icon from the registry cache, load and cache\n * // it for future requests.\n * // NOTE: ID queries require configuration with $mdIconProvider\n *\n * $mdIcon('android').then(function(iconEl) { element.append(iconEl); });\n * $mdIcon('work:chair').then(function(iconEl) { element.append(iconEl); });\n *\n * // Load and cache the external SVG using a URL\n *\n * $mdIcon('img/icons/android.svg').then(function(iconEl) {\n * element.append(iconEl);\n * });\n * };\n * </hljs>\n *\n * NOTE: The `<md-icon /> ` directive internally uses the `$mdIcon` service to query, loaded, and instantiate\n * SVG DOM elements.\n */\n\n /* @ngInject */\n function MdIconService(config, $http, $q, $log, $templateCache, $mdUtil) {\n var iconCache = {};\n var urlRegex = /[-\\w@:%\\+.~#?&//=]{2,}\\.[a-z]{2,4}\\b(\\/[-\\w@:%\\+.~#?&//=]*)?/i;\n var dataUrlRegex = /^data:image\\/svg\\+xml[\\s*;\\w\\-\\=]*?(base64)?,(.*)$/i;\n\n Icon.prototype = { clone : cloneSVG, prepare: prepareAndStyle };\n getIcon.fontSet = findRegisteredFontSet;\n\n // Publish service...\n return getIcon;\n\n /**\n * Actual $mdIcon service is essentially a lookup function\n */\n function getIcon(id) {\n id = id || '';\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if ( iconCache[id] ) return $q.when( transformClone(iconCache[id]) );\n if ( urlRegex.test(id) || dataUrlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n var load = config[id] ? loadByID : loadFromIconSet;\n return load(id)\n .then( cacheIcon(id) );\n }\n\n /**\n * Lookup registered fontSet style using its alias...\n * If not found,\n */\n function findRegisteredFontSet(alias) {\n var useDefault = angular.isUndefined(alias) || !(alias && alias.length);\n if ( useDefault ) return config.defaultFontSet;\n\n var result = alias;\n angular.forEach(config.fontSets, function(it){\n if ( it.alias == alias ) result = it.fontSet || result;\n });\n\n return result;\n }\n\n function transformClone(cacheElement) {\n var clone = cacheElement.clone();\n var cacheSuffix = '_cache' + $mdUtil.nextUid();\n\n // We need to modify for each cached icon the id attributes.\n // This is needed because SVG id's are treated as normal DOM ids\n // and should not have a duplicated id.\n if (clone.id) clone.id += cacheSuffix;\n angular.forEach(clone.querySelectorAll('[id]'), function (item) {\n item.id += cacheSuffix;\n });\n\n return clone;\n }\n\n /**\n * Prepare and cache the loaded icon for the specified `id`\n */\n function cacheIcon( id ) {\n\n return function updateCache( icon ) {\n iconCache[id] = isIcon(icon) ? icon : new Icon(icon, config[id]);\n\n return iconCache[id].clone();\n };\n }\n\n /**\n * Lookup the configuration in the registry, if !registered throw an error\n * otherwise load the icon [on-demand] using the registered URL.\n *\n */\n function loadByID(id) {\n var iconConfig = config[id];\n return loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }\n\n /**\n * Loads the file as XML and uses querySelector( <id> ) to find\n * the desired node...\n */\n function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? announceIdNotFound(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return !icon ? announceIdNotFound(id) : new Icon(icon, iconSetConfig);\n }\n\n function announceIdNotFound(id) {\n var msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n\n return $q.reject(msg || id);\n }\n }\n\n /**\n * Load the icon by URL (may use the $templateCache).\n * Extract the data for later conversion to Icon\n */\n function loadByURL(url) {\n /* Load the icon from embedded data URL. */\n function loadByDataUrl(url) {\n var results = dataUrlRegex.exec(url);\n var isBase64 = /base64/i.test(url);\n var data = isBase64 ? window.atob(results[2]) : results[2];\n return $q.when(angular.element(data)[0]);\n }\n\n /* Load the icon by URL using HTTP. */\n function loadByHttpUrl(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('<div>').append(response.data).find('svg')[0];\n }).catch(announceNotFound);\n }\n\n return dataUrlRegex.test(url)\n ? loadByDataUrl(url)\n : loadByHttpUrl(url);\n }\n\n /**\n * Catch HTTP or generic errors not related to incorrect icon IDs.\n */\n function announceNotFound(err) {\n var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n $log.warn(msg);\n\n return $q.reject(msg);\n }\n\n /**\n * Check target signature to see if it is an Icon instance.\n */\n function isIcon(target) {\n return angular.isDefined(target.element) && angular.isDefined(target.config);\n }\n\n /**\n * Define the Icon class\n */\n function Icon(el, config) {\n if (el && el.tagName != 'svg') {\n el = angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el)[0];\n }\n\n // Inject the namespace if not available...\n if ( !el.getAttribute('xmlns') ) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }\n\n /**\n * Prepare the DOM element that will be cached in the\n * loaded iconCache store.\n */\n function prepareAndStyle() {\n var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;\n angular.forEach({\n 'fit' : '',\n 'height': '100%',\n 'width' : '100%',\n 'preserveAspectRatio': 'xMidYMid meet',\n 'viewBox' : this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize),\n 'focusable': false // Disable IE11s default behavior to make SVGs focusable\n }, function(val, attr) {\n this.element.setAttribute(attr, val);\n }, this);\n }\n\n /**\n * Clone the Icon DOM element.\n */\n function cloneSVG(){\n // If the element or any of its children have a style attribute, then a CSP policy without\n // 'unsafe-inline' in the style-src directive, will result in a violation.\n return this.element.cloneNode(true);\n }\n\n }\n MdIconService.$inject = [\"config\", \"$http\", \"$q\", \"$log\", \"$templateCache\", \"$mdUtil\"];\n\n})();\n(function(){\n\"use strict\";\n\n\n\nangular\n .module('material.components.menu')\n .controller('mdMenuCtrl', MenuController);\n\n/**\n * @ngInject\n */\nfunction MenuController($mdMenu, $attrs, $element, $scope, $mdUtil, $timeout, $rootScope, $q) {\n\n var menuContainer;\n var self = this;\n var triggerElement;\n\n this.nestLevel = parseInt($attrs.mdNestLevel, 10) || 0;\n\n /**\n * Called by our linking fn to provide access to the menu-content\n * element removed during link\n */\n this.init = function init(setMenuContainer, opts) {\n opts = opts || {};\n menuContainer = setMenuContainer;\n // Default element for ARIA attributes has the ngClick or ngMouseenter expression\n triggerElement = $element[0].querySelector('[ng-click],[ng-mouseenter]');\n triggerElement.setAttribute('aria-expanded', 'false');\n\n this.isInMenuBar = opts.isInMenuBar;\n this.nestedMenus = $mdUtil.nodesToArray(menuContainer[0].querySelectorAll('.md-nested-menu'));\n\n menuContainer.on('$mdInterimElementRemove', function() {\n self.isOpen = false;\n });\n\n var menuContainerId = 'menu_container_' + $mdUtil.nextUid();\n menuContainer.attr('id', menuContainerId);\n angular.element(triggerElement).attr({\n 'aria-owns': menuContainerId,\n 'aria-haspopup': 'true'\n });\n\n $scope.$on('$destroy', this.disableHoverListener);\n menuContainer.on('$destroy', function() {\n $mdMenu.destroy();\n });\n };\n\n var openMenuTimeout, menuItems, deregisterScopeListeners = [];\n this.enableHoverListener = function() {\n deregisterScopeListeners.push($rootScope.$on('$mdMenuOpen', function(event, el) {\n if (menuContainer[0].contains(el[0])) {\n self.currentlyOpenMenu = el.controller('mdMenu');\n self.isAlreadyOpening = false;\n self.currentlyOpenMenu.registerContainerProxy(self.triggerContainerProxy.bind(self));\n }\n }));\n deregisterScopeListeners.push($rootScope.$on('$mdMenuClose', function(event, el) {\n if (menuContainer[0].contains(el[0])) {\n self.currentlyOpenMenu = undefined;\n }\n }));\n menuItems = angular.element($mdUtil.nodesToArray(menuContainer[0].children[0].children));\n menuItems.on('mouseenter', self.handleMenuItemHover);\n menuItems.on('mouseleave', self.handleMenuItemMouseLeave);\n };\n\n this.disableHoverListener = function() {\n while (deregisterScopeListeners.length) {\n deregisterScopeListeners.shift()();\n }\n menuItems && menuItems.off('mouseenter', self.handleMenuItemHover);\n menuItems && menuItems.off('mouseleave', self.handleMenuMouseLeave);\n };\n\n this.handleMenuItemHover = function(event) {\n if (self.isAlreadyOpening) return;\n var nestedMenu = (\n event.target.querySelector('md-menu')\n || $mdUtil.getClosest(event.target, 'MD-MENU')\n );\n openMenuTimeout = $timeout(function() {\n if (nestedMenu) {\n nestedMenu = angular.element(nestedMenu).controller('mdMenu');\n }\n\n if (self.currentlyOpenMenu && self.currentlyOpenMenu != nestedMenu) {\n var closeTo = self.nestLevel + 1;\n self.currentlyOpenMenu.close(true, { closeTo: closeTo });\n self.isAlreadyOpening = true;\n nestedMenu.open();\n } else if (nestedMenu && !nestedMenu.isOpen && nestedMenu.open) {\n self.isAlreadyOpening = true;\n nestedMenu.open();\n }\n }, nestedMenu ? 100 : 250);\n var focusableTarget = event.currentTarget.querySelector('.md-button:not([disabled])');\n focusableTarget && focusableTarget.focus();\n };\n\n this.handleMenuItemMouseLeave = function() {\n if (openMenuTimeout) {\n $timeout.cancel(openMenuTimeout);\n openMenuTimeout = undefined;\n }\n };\n\n\n /**\n * Uses the $mdMenu interim element service to open the menu contents\n */\n this.open = function openMenu(ev) {\n ev && ev.stopPropagation();\n ev && ev.preventDefault();\n if (self.isOpen) return;\n self.enableHoverListener();\n self.isOpen = true;\n triggerElement = triggerElement || (ev ? ev.target : $element[0]);\n triggerElement.setAttribute('aria-expanded', 'true');\n $scope.$emit('$mdMenuOpen', $element);\n $mdMenu.show({\n scope: $scope,\n mdMenuCtrl: self,\n nestLevel: self.nestLevel,\n element: menuContainer,\n target: triggerElement,\n preserveElement: true,\n parent: 'body'\n }).finally(function() {\n triggerElement.setAttribute('aria-expanded', 'false');\n self.disableHoverListener();\n });\n };\n\n // Expose a open function to the child scope for html to use\n $scope.$mdOpenMenu = this.open;\n\n $scope.$watch(function() { return self.isOpen; }, function(isOpen) {\n if (isOpen) {\n menuContainer.attr('aria-hidden', 'false');\n $element[0].classList.add('md-open');\n angular.forEach(self.nestedMenus, function(el) {\n el.classList.remove('md-open');\n });\n } else {\n menuContainer.attr('aria-hidden', 'true');\n $element[0].classList.remove('md-open');\n }\n $scope.$mdMenuIsOpen = self.isOpen;\n });\n\n this.focusMenuContainer = function focusMenuContainer() {\n var focusTarget = menuContainer[0].querySelector('[md-menu-focus-target]');\n if (!focusTarget) focusTarget = menuContainer[0].querySelector('.md-button');\n focusTarget.focus();\n };\n\n this.registerContainerProxy = function registerContainerProxy(handler) {\n this.containerProxy = handler;\n };\n\n this.triggerContainerProxy = function triggerContainerProxy(ev) {\n this.containerProxy && this.containerProxy(ev);\n };\n\n this.destroy = function() {\n return self.isOpen ? $mdMenu.destroy() : $q.when(false);\n };\n\n // Use the $mdMenu interim element service to close the menu contents\n this.close = function closeMenu(skipFocus, closeOpts) {\n if ( !self.isOpen ) return;\n self.isOpen = false;\n\n var eventDetails = angular.extend({}, closeOpts, { skipFocus: skipFocus });\n $scope.$emit('$mdMenuClose', $element, eventDetails);\n $mdMenu.hide(null, closeOpts);\n\n if (!skipFocus) {\n var el = self.restoreFocusTo || $element.find('button')[0];\n if (el instanceof angular.element) el = el[0];\n if (el) el.focus();\n }\n };\n\n /**\n * Build a nice object out of our string attribute which specifies the\n * target mode for left and top positioning\n */\n this.positionMode = function positionMode() {\n var attachment = ($attrs.mdPositionMode || 'target').split(' ');\n\n // If attachment is a single item, duplicate it for our second value.\n // ie. 'target' -> 'target target'\n if (attachment.length == 1) {\n attachment.push(attachment[0]);\n }\n\n return {\n left: attachment[0],\n top: attachment[1]\n };\n };\n\n /**\n * Build a nice object out of our string attribute which specifies\n * the offset of top and left in pixels.\n */\n this.offsets = function offsets() {\n var position = ($attrs.mdOffset || '0 0').split(' ').map(parseFloat);\n if (position.length == 2) {\n return {\n left: position[0],\n top: position[1]\n };\n } else if (position.length == 1) {\n return {\n top: position[0],\n left: position[0]\n };\n } else {\n throw Error('Invalid offsets specified. Please follow format <x, y> or <n>');\n }\n };\n}\nMenuController.$inject = [\"$mdMenu\", \"$attrs\", \"$element\", \"$scope\", \"$mdUtil\", \"$timeout\", \"$rootScope\", \"$q\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc directive\n * @name mdMenu\n * @module material.components.menu\n * @restrict E\n * @description\n *\n * Menus are elements that open when clicked. They are useful for displaying\n * additional options within the context of an action.\n *\n * Every `md-menu` must specify exactly two child elements. The first element is what is\n * left in the DOM and is used to open the menu. This element is called the trigger element.\n * The trigger element's scope has access to `$mdOpenMenu($event)`\n * which it may call to open the menu. By passing $event as argument, the\n * corresponding event is stopped from propagating up the DOM-tree.\n *\n * The second element is the `md-menu-content` element which represents the\n * contents of the menu when it is open. Typically this will contain `md-menu-item`s,\n * but you can do custom content as well.\n *\n * <hljs lang=\"html\">\n * <md-menu>\n * <!-- Trigger element is a md-button with an icon -->\n * <md-button ng-click=\"$mdOpenMenu($event)\" class=\"md-icon-button\" aria-label=\"Open sample menu\">\n * <md-icon md-svg-icon=\"call:phone\"></md-icon>\n * </md-button>\n * <md-menu-content>\n * <md-menu-item><md-button ng-click=\"doSomething()\">Do Something</md-button></md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </hljs>\n\n * ## Sizing Menus\n *\n * The width of the menu when it is open may be specified by specifying a `width`\n * attribute on the `md-menu-content` element.\n * See the [Material Design Spec](http://www.google.com/design/spec/components/menus.html#menus-specs)\n * for more information.\n *\n *\n * ## Aligning Menus\n *\n * When a menu opens, it is important that the content aligns with the trigger element.\n * Failure to align menus can result in jarring experiences for users as content\n * suddenly shifts. To help with this, `md-menu` provides serveral APIs to help\n * with alignment.\n *\n * ### Target Mode\n *\n * By default, `md-menu` will attempt to align the `md-menu-content` by aligning\n * designated child elements in both the trigger and the menu content.\n *\n * To specify the alignment element in the `trigger` you can use the `md-menu-origin`\n * attribute on a child element. If no `md-menu-origin` is specified, the `md-menu`\n * will be used as the origin element.\n *\n * Similarly, the `md-menu-content` may specify a `md-menu-align-target` for a\n * `md-menu-item` to specify the node that it should try and align with.\n *\n * In this example code, we specify an icon to be our origin element, and an\n * icon in our menu content to be our alignment target. This ensures that both\n * icons are aligned when the menu opens.\n *\n * <hljs lang=\"html\">\n * <md-menu>\n * <md-button ng-click=\"$mdOpenMenu($event)\" class=\"md-icon-button\" aria-label=\"Open some menu\">\n * <md-icon md-menu-origin md-svg-icon=\"call:phone\"></md-icon>\n * </md-button>\n * <md-menu-content>\n * <md-menu-item>\n * <md-button ng-click=\"doSomething()\" aria-label=\"Do something\">\n * <md-icon md-menu-align-target md-svg-icon=\"call:phone\"></md-icon>\n * Do Something\n * </md-button>\n * </md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </hljs>\n *\n * Sometimes we want to specify alignment on the right side of an element, for example\n * if we have a menu on the right side a toolbar, we want to right align our menu content.\n *\n * We can specify the origin by using the `md-position-mode` attribute on both\n * the `x` and `y` axis. Right now only the `x-axis` has more than one option.\n * You may specify the default mode of `target target` or\n * `target-right target` to specify a right-oriented alignment target. See the\n * position section of the demos for more examples.\n *\n * ### Menu Offsets\n *\n * It is sometimes unavoidable to need to have a deeper level of control for\n * the positioning of a menu to ensure perfect alignment. `md-menu` provides\n * the `md-offset` attribute to allow pixel level specificty of adjusting the\n * exact positioning.\n *\n * This offset is provided in the format of `x y` or `n` where `n` will be used\n * in both the `x` and `y` axis.\n *\n * For example, to move a menu by `2px` from the top, we can use:\n * <hljs lang=\"html\">\n * <md-menu md-offset=\"2 0\">\n * <!-- menu-content -->\n * </md-menu>\n * </hljs>\n\n * ### Preventing close\n *\n * Sometimes you would like to be able to click on a menu item without having the menu\n * close. To do this, ngMaterial exposes the `md-prevent-menu-close` attribute which\n * can be added to a button inside a menu to stop the menu from automatically closing.\n * You can then close the menu programatically by injecting `$mdMenu` and calling \n * `$mdMenu.hide()`.\n *\n * <hljs lang=\"html\">\n * <md-menu-item>\n * <md-button ng-click=\"doSomething()\" aria-label=\"Do something\" md-prevent-menu-close=\"md-prevent-menu-close\">\n * <md-icon md-menu-align-target md-svg-icon=\"call:phone\"></md-icon>\n * Do Something\n * </md-button>\n * </md-menu-item>\n * </hljs>\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-menu>\n * <md-button ng-click=\"$mdOpenMenu($event)\" class=\"md-icon-button\">\n * <md-icon md-svg-icon=\"call:phone\"></md-icon>\n * </md-button>\n * <md-menu-content>\n * <md-menu-item><md-button ng-click=\"doSomething()\">Do Something</md-button></md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </hljs>\n *\n * @param {string} md-position-mode The position mode in the form of\n * `x`, `y`. Default value is `target`,`target`. Right now the `x` axis\n * also suppports `target-right`.\n * @param {string} md-offset An offset to apply to the dropdown after positioning\n * `x`, `y`. Default value is `0`,`0`.\n *\n */\n\nangular\n .module('material.components.menu')\n .directive('mdMenu', MenuDirective);\n\n/**\n * @ngInject\n */\nfunction MenuDirective($mdUtil) {\n var INVALID_PREFIX = 'Invalid HTML for md-menu: ';\n return {\n restrict: 'E',\n require: ['mdMenu', '?^mdMenuBar'],\n controller: 'mdMenuCtrl', // empty function to be built by link\n scope: true,\n compile: compile\n };\n\n function compile(templateElement) {\n templateElement.addClass('md-menu');\n var triggerElement = templateElement.children()[0];\n if (!triggerElement.hasAttribute('ng-click')) {\n triggerElement = triggerElement.querySelector('[ng-click],[ng-mouseenter]') || triggerElement;\n }\n if (triggerElement && (\n triggerElement.nodeName == 'MD-BUTTON' ||\n triggerElement.nodeName == 'BUTTON'\n ) && !triggerElement.hasAttribute('type')) {\n triggerElement.setAttribute('type', 'button');\n }\n\n if (templateElement.children().length != 2) {\n throw Error(INVALID_PREFIX + 'Expected two children elements.');\n }\n\n // Default element for ARIA attributes has the ngClick or ngMouseenter expression\n triggerElement && triggerElement.setAttribute('aria-haspopup', 'true');\n\n var nestedMenus = templateElement[0].querySelectorAll('md-menu');\n var nestingDepth = parseInt(templateElement[0].getAttribute('md-nest-level'), 10) || 0;\n if (nestedMenus) {\n angular.forEach($mdUtil.nodesToArray(nestedMenus), function(menuEl) {\n if (!menuEl.hasAttribute('md-position-mode')) {\n menuEl.setAttribute('md-position-mode', 'cascade');\n }\n menuEl.classList.add('md-nested-menu');\n menuEl.setAttribute('md-nest-level', nestingDepth + 1);\n });\n }\n return link;\n }\n\n function link(scope, element, attrs, ctrls) {\n var mdMenuCtrl = ctrls[0];\n var isInMenuBar = ctrls[1] != undefined;\n // Move everything into a md-menu-container and pass it to the controller\n var menuContainer = angular.element(\n '<div class=\"md-open-menu-container md-whiteframe-z2\"></div>'\n );\n var menuContents = element.children()[1];\n if (!menuContents.hasAttribute('role')) {\n menuContents.setAttribute('role', 'menu');\n }\n menuContainer.append(menuContents);\n\n element.on('$destroy', function() {\n menuContainer.remove();\n });\n\n element.append(menuContainer);\n menuContainer[0].style.display = 'none';\n mdMenuCtrl.init(menuContainer, { isInMenuBar: isInMenuBar });\n }\n}\nMenuDirective.$inject = [\"$mdUtil\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.menu')\n .provider('$mdMenu', MenuProvider);\n\n/*\n * Interim element provider for the menu.\n * Handles behavior for a menu while it is open, including:\n * - handling animating the menu opening/closing\n * - handling key/mouse events on the menu element\n * - handling enabling/disabling scroll while the menu is open\n * - handling redrawing during resizes and orientation changes\n *\n */\n\nfunction MenuProvider($$interimElementProvider) {\n var MENU_EDGE_MARGIN = 8;\n\n menuDefaultOptions.$inject = [\"$mdUtil\", \"$mdTheming\", \"$mdConstant\", \"$document\", \"$window\", \"$q\", \"$$rAF\", \"$animateCss\", \"$animate\"];\n return $$interimElementProvider('$mdMenu')\n .setDefaults({\n methods: ['target'],\n options: menuDefaultOptions\n });\n\n /* @ngInject */\n function menuDefaultOptions($mdUtil, $mdTheming, $mdConstant, $document, $window, $q, $$rAF, $animateCss, $animate) {\n var animator = $mdUtil.dom.animator;\n\n return {\n parent: 'body',\n onShow: onShow,\n onRemove: onRemove,\n hasBackdrop: true,\n disableParentScroll: true,\n skipCompile: true,\n preserveScope: true,\n skipHide: true,\n themable: true\n };\n\n /**\n * Show modal backdrop element...\n * @returns {function(): void} A function that removes this backdrop\n */\n function showBackdrop(scope, element, options) {\n if (options.nestLevel) return angular.noop;\n\n // If we are not within a dialog...\n if (options.disableParentScroll && !$mdUtil.getClosest(options.target, 'MD-DIALOG')) {\n // !! DO this before creating the backdrop; since disableScrollAround()\n // configures the scroll offset; which is used by mdBackDrop postLink()\n options.restoreScroll = $mdUtil.disableScrollAround(options.element, options.parent);\n } else {\n options.disableParentScroll = false;\n }\n\n if (options.hasBackdrop) {\n options.backdrop = $mdUtil.createBackdrop(scope, \"md-menu-backdrop md-click-catcher\");\n\n $animate.enter(options.backdrop, $document[0].body);\n }\n\n /**\n * Hide and destroys the backdrop created by showBackdrop()\n */\n return function hideBackdrop() {\n if (options.backdrop) options.backdrop.remove();\n if (options.disableParentScroll) options.restoreScroll();\n };\n }\n\n /**\n * Removing the menu element from the DOM and remove all associated event listeners\n * and backdrop\n */\n function onRemove(scope, element, opts) {\n opts.cleanupInteraction();\n opts.cleanupResizing();\n opts.hideBackdrop();\n\n // For navigation $destroy events, do a quick, non-animated removal,\n // but for normal closes (from clicks, etc) animate the removal\n\n return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then( detachAndClean );\n\n /**\n * For normal closes, animate the removal.\n * For forced closes (like $destroy events), skip the animations\n */\n function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }\n\n /**\n * Detach the element\n */\n function detachAndClean() {\n element.removeClass('md-active');\n detachElement(element, opts);\n opts.alreadyOpen = false;\n }\n\n }\n\n /**\n * Inserts and configures the staged Menu element into the DOM, positioning it,\n * and wiring up various interaction events\n */\n function onShow(scope, element, opts) {\n sanitizeAndConfigure(opts);\n\n // Wire up theming on our menu element\n $mdTheming.inherit(opts.menuContentEl, opts.target);\n\n // Register various listeners to move menu on resize/orientation change\n opts.cleanupResizing = startRepositioningOnResize();\n opts.hideBackdrop = showBackdrop(scope, element, opts);\n\n // Return the promise for when our menu is done animating in\n return showMenu()\n .then(function(response) {\n opts.alreadyOpen = true;\n opts.cleanupInteraction = activateInteraction();\n return response;\n });\n\n /**\n * Place the menu into the DOM and call positioning related functions\n */\n function showMenu() {\n opts.parent.append(element);\n element[0].style.display = '';\n\n return $q(function(resolve) {\n var position = calculateMenuPosition(element, opts);\n\n element.removeClass('md-leave');\n\n // Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n // to normal scale.\n $animateCss(element, {\n addClass: 'md-active',\n from: animator.toCss(position),\n to: animator.toCss({transform: ''})\n })\n .start()\n .then(resolve);\n\n });\n }\n\n /**\n * Check for valid opts and set some sane defaults\n */\n function sanitizeAndConfigure() {\n if (!opts.target) {\n throw Error(\n '$mdMenu.show() expected a target to animate from in options.target'\n );\n }\n angular.extend(opts, {\n alreadyOpen: false,\n isRemoved: false,\n target: angular.element(opts.target), //make sure it's not a naked dom node\n parent: angular.element(opts.parent),\n menuContentEl: angular.element(element[0].querySelector('md-menu-content'))\n });\n }\n\n /**\n * Configure various resize listeners for screen changes\n */\n function startRepositioningOnResize() {\n\n var repositionMenu = (function(target, options) {\n return $$rAF.throttle(function() {\n if (opts.isRemoved) return;\n var position = calculateMenuPosition(target, options);\n\n target.css(animator.toCss(position));\n });\n })(element, opts);\n\n $window.addEventListener('resize', repositionMenu);\n $window.addEventListener('orientationchange', repositionMenu);\n\n return function stopRepositioningOnResize() {\n\n // Disable resizing handlers\n $window.removeEventListener('resize', repositionMenu);\n $window.removeEventListener('orientationchange', repositionMenu);\n\n }\n }\n\n /**\n * Activate interaction on the menu. Wire up keyboard listerns for\n * clicks, keypresses, backdrop closing, etc.\n */\n function activateInteraction() {\n element.addClass('md-clickable');\n\n // close on backdrop click\n if (opts.backdrop) opts.backdrop.on('click', onBackdropClick);\n\n // Wire up keyboard listeners.\n // - Close on escape,\n // - focus next item on down arrow,\n // - focus prev item on up\n opts.menuContentEl.on('keydown', onMenuKeyDown);\n opts.menuContentEl[0].addEventListener('click', captureClickListener, true);\n\n // kick off initial focus in the menu on the first element\n var focusTarget = opts.menuContentEl[0].querySelector('[md-menu-focus-target]');\n if ( !focusTarget ) {\n var firstChild = opts.menuContentEl[0].firstElementChild;\n\n focusTarget = firstChild && (firstChild.querySelector('.md-button:not([disabled])') || firstChild.firstElementChild);\n }\n\n focusTarget && focusTarget.focus();\n\n return function cleanupInteraction() {\n element.removeClass('md-clickable');\n if (opts.backdrop) opts.backdrop.off('click', onBackdropClick);\n opts.menuContentEl.off('keydown', onMenuKeyDown);\n opts.menuContentEl[0].removeEventListener('click', captureClickListener, true);\n };\n\n // ************************************\n // internal functions\n // ************************************\n\n function onMenuKeyDown(ev) {\n var handled;\n switch (ev.keyCode) {\n case $mdConstant.KEY_CODE.ESCAPE:\n opts.mdMenuCtrl.close(false, { closeAll: true });\n handled = true;\n break;\n case $mdConstant.KEY_CODE.UP_ARROW:\n if (!focusMenuItem(ev, opts.menuContentEl, opts, -1) && !opts.nestLevel) {\n opts.mdMenuCtrl.triggerContainerProxy(ev);\n }\n handled = true;\n break;\n case $mdConstant.KEY_CODE.DOWN_ARROW:\n if (!focusMenuItem(ev, opts.menuContentEl, opts, 1) && !opts.nestLevel) {\n opts.mdMenuCtrl.triggerContainerProxy(ev);\n }\n handled = true;\n break;\n case $mdConstant.KEY_CODE.LEFT_ARROW:\n if (opts.nestLevel) {\n opts.mdMenuCtrl.close();\n } else {\n opts.mdMenuCtrl.triggerContainerProxy(ev);\n }\n handled = true;\n break;\n case $mdConstant.KEY_CODE.RIGHT_ARROW:\n var parentMenu = $mdUtil.getClosest(ev.target, 'MD-MENU');\n if (parentMenu && parentMenu != opts.parent[0]) {\n ev.target.click();\n } else {\n opts.mdMenuCtrl.triggerContainerProxy(ev);\n }\n handled = true;\n break;\n }\n if (handled) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n }\n }\n\n function onBackdropClick(e) {\n e.preventDefault();\n e.stopPropagation();\n scope.$apply(function() {\n opts.mdMenuCtrl.close(true, { closeAll: true });\n });\n }\n\n // Close menu on menu item click, if said menu-item is not disabled\n function captureClickListener(e) {\n var target = e.target;\n // Traverse up the event until we get to the menuContentEl to see if\n // there is an ng-click and that the ng-click is not disabled\n do {\n if (target == opts.menuContentEl[0]) return;\n if ((hasAnyAttribute(target, ['ng-click', 'ng-href', 'ui-sref']) ||\n target.nodeName == 'BUTTON' || target.nodeName == 'MD-BUTTON') && !hasAnyAttribute(target, ['md-prevent-menu-close'])) {\n var closestMenu = $mdUtil.getClosest(target, 'MD-MENU');\n if (!target.hasAttribute('disabled') && (!closestMenu || closestMenu == opts.parent[0])) {\n close();\n }\n break;\n }\n } while (target = target.parentNode)\n\n function close() {\n scope.$apply(function() {\n opts.mdMenuCtrl.close(true, { closeAll: true });\n });\n }\n\n function hasAnyAttribute(target, attrs) {\n if (!target) return false;\n for (var i = 0, attr; attr = attrs[i]; ++i) {\n var altForms = [attr, 'data-' + attr, 'x-' + attr];\n for (var j = 0, rawAttr; rawAttr = altForms[j]; ++j) {\n if (target.hasAttribute(rawAttr)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n\n opts.menuContentEl[0].addEventListener('click', captureClickListener, true);\n\n return function cleanupInteraction() {\n element.removeClass('md-clickable');\n opts.menuContentEl.off('keydown');\n opts.menuContentEl[0].removeEventListener('click', captureClickListener, true);\n };\n }\n }\n\n /**\n * Takes a keypress event and focuses the next/previous menu\n * item from the emitting element\n * @param {event} e - The origin keypress event\n * @param {angular.element} menuEl - The menu element\n * @param {object} opts - The interim element options for the mdMenu\n * @param {number} direction - The direction to move in (+1 = next, -1 = prev)\n */\n function focusMenuItem(e, menuEl, opts, direction) {\n var currentItem = $mdUtil.getClosest(e.target, 'MD-MENU-ITEM');\n\n var items = $mdUtil.nodesToArray(menuEl[0].children);\n var currentIndex = items.indexOf(currentItem);\n\n // Traverse through our elements in the specified direction (+/-1) and try to\n // focus them until we find one that accepts focus\n var didFocus;\n for (var i = currentIndex + direction; i >= 0 && i < items.length; i = i + direction) {\n var focusTarget = items[i].querySelector('.md-button');\n didFocus = attemptFocus(focusTarget);\n if (didFocus) {\n break;\n }\n }\n return didFocus;\n }\n\n /**\n * Attempts to focus an element. Checks whether that element is the currently\n * focused element after attempting.\n * @param {HTMLElement} el - the element to attempt focus on\n * @returns {bool} - whether the element was successfully focused\n */\n function attemptFocus(el) {\n if (el && el.getAttribute('tabindex') != -1) {\n el.focus();\n return ($document[0].activeElement == el);\n }\n }\n\n /**\n * Use browser to remove this element without triggering a $destroy event\n */\n function detachElement(element, opts) {\n if (!opts.preserveElement) {\n if (toNode(element).parentNode === toNode(opts.parent)) {\n toNode(opts.parent).removeChild(toNode(element));\n }\n } else {\n toNode(element).style.display = 'none';\n }\n }\n\n /**\n * Computes menu position and sets the style on the menu container\n * @param {HTMLElement} el - the menu container element\n * @param {object} opts - the interim element options object\n */\n function calculateMenuPosition(el, opts) {\n\n var containerNode = el[0],\n openMenuNode = el[0].firstElementChild,\n openMenuNodeRect = openMenuNode.getBoundingClientRect(),\n boundryNode = $document[0].body,\n boundryNodeRect = boundryNode.getBoundingClientRect();\n\n var menuStyle = $window.getComputedStyle(openMenuNode);\n\n var originNode = opts.target[0].querySelector('[md-menu-origin]') || opts.target[0],\n originNodeRect = originNode.getBoundingClientRect();\n\n var bounds = {\n left: boundryNodeRect.left + MENU_EDGE_MARGIN,\n top: Math.max(boundryNodeRect.top, 0) + MENU_EDGE_MARGIN,\n bottom: Math.max(boundryNodeRect.bottom, Math.max(boundryNodeRect.top, 0) + boundryNodeRect.height) - MENU_EDGE_MARGIN,\n right: boundryNodeRect.right - MENU_EDGE_MARGIN\n };\n\n var alignTarget, alignTargetRect = { top:0, left : 0, right:0, bottom:0 }, existingOffsets = { top:0, left : 0, right:0, bottom:0 };\n var positionMode = opts.mdMenuCtrl.positionMode();\n\n if (positionMode.top == 'target' || positionMode.left == 'target' || positionMode.left == 'target-right') {\n alignTarget = firstVisibleChild();\n if ( alignTarget ) {\n // TODO: Allow centering on an arbitrary node, for now center on first menu-item's child\n alignTarget = alignTarget.firstElementChild || alignTarget;\n alignTarget = alignTarget.querySelector('[md-menu-align-target]') || alignTarget;\n alignTargetRect = alignTarget.getBoundingClientRect();\n\n existingOffsets = {\n top: parseFloat(containerNode.style.top || 0),\n left: parseFloat(containerNode.style.left || 0)\n };\n }\n }\n\n var position = {};\n var transformOrigin = 'top ';\n\n switch (positionMode.top) {\n case 'target':\n position.top = existingOffsets.top + originNodeRect.top - alignTargetRect.top;\n break;\n case 'cascade':\n position.top = originNodeRect.top - parseFloat(menuStyle.paddingTop) - originNode.style.top;\n break;\n case 'bottom':\n position.top = originNodeRect.top + originNodeRect.height;\n break;\n default:\n throw new Error('Invalid target mode \"' + positionMode.top + '\" specified for md-menu on Y axis.');\n }\n\n switch (positionMode.left) {\n case 'target':\n position.left = existingOffsets.left + originNodeRect.left - alignTargetRect.left;\n transformOrigin += 'left';\n break;\n case 'target-right':\n position.left = originNodeRect.right - openMenuNodeRect.width + (openMenuNodeRect.right - alignTargetRect.right);\n transformOrigin += 'right';\n break;\n case 'cascade':\n var willFitRight = (originNodeRect.right + openMenuNodeRect.width) < bounds.right;\n position.left = willFitRight ? originNodeRect.right - originNode.style.left : originNodeRect.left - originNode.style.left - openMenuNodeRect.width;\n transformOrigin += willFitRight ? 'left' : 'right';\n break;\n case 'left':\n position.left = originNodeRect.left;\n transformOrigin += 'left';\n break;\n default:\n throw new Error('Invalid target mode \"' + positionMode.left + '\" specified for md-menu on X axis.');\n }\n\n var offsets = opts.mdMenuCtrl.offsets();\n position.top += offsets.top;\n position.left += offsets.left;\n\n clamp(position);\n\n var scaleX = Math.round(100 * Math.min(originNodeRect.width / containerNode.offsetWidth, 1.0)) / 100;\n var scaleY = Math.round(100 * Math.min(originNodeRect.height / containerNode.offsetHeight, 1.0)) / 100;\n\n return {\n top: Math.round(position.top),\n left: Math.round(position.left),\n // Animate a scale out if we aren't just repositioning\n transform: !opts.alreadyOpen ? $mdUtil.supplant('scale({0},{1})', [scaleX, scaleY]) : undefined,\n transformOrigin: transformOrigin\n };\n\n /**\n * Clamps the repositioning of the menu within the confines of\n * bounding element (often the screen/body)\n */\n function clamp(pos) {\n pos.top = Math.max(Math.min(pos.top, bounds.bottom - containerNode.offsetHeight), bounds.top);\n pos.left = Math.max(Math.min(pos.left, bounds.right - containerNode.offsetWidth), bounds.left);\n }\n\n /**\n * Gets the first visible child in the openMenuNode\n * Necessary incase menu nodes are being dynamically hidden\n */\n function firstVisibleChild() {\n for (var i = 0; i < openMenuNode.children.length; ++i) {\n if ($window.getComputedStyle(openMenuNode.children[i]).display != 'none') {\n return openMenuNode.children[i];\n }\n }\n }\n }\n }\n function toNode(el) {\n if (el instanceof angular.element) {\n el = el[0];\n }\n return el;\n }\n}\nMenuProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n\nangular\n .module('material.components.menuBar')\n .controller('MenuBarController', MenuBarController);\n\nvar BOUND_MENU_METHODS = ['handleKeyDown', 'handleMenuHover', 'scheduleOpenHoveredMenu', 'cancelScheduledOpen'];\n\n/**\n * @ngInject\n */\nfunction MenuBarController($scope, $rootScope, $element, $attrs, $mdConstant, $document, $mdUtil, $timeout) {\n this.$element = $element;\n this.$attrs = $attrs;\n this.$mdConstant = $mdConstant;\n this.$mdUtil = $mdUtil;\n this.$document = $document;\n this.$scope = $scope;\n this.$rootScope = $rootScope;\n this.$timeout = $timeout;\n\n var self = this;\n angular.forEach(BOUND_MENU_METHODS, function(methodName) {\n self[methodName] = angular.bind(self, self[methodName]);\n });\n}\nMenuBarController.$inject = [\"$scope\", \"$rootScope\", \"$element\", \"$attrs\", \"$mdConstant\", \"$document\", \"$mdUtil\", \"$timeout\"];\n\nMenuBarController.prototype.init = function() {\n var $element = this.$element;\n var $mdUtil = this.$mdUtil;\n var $scope = this.$scope;\n\n var self = this;\n var deregisterFns = [];\n $element.on('keydown', this.handleKeyDown);\n this.parentToolbar = $mdUtil.getClosest($element, 'MD-TOOLBAR');\n\n deregisterFns.push(this.$rootScope.$on('$mdMenuOpen', function(event, el) {\n if (self.getMenus().indexOf(el[0]) != -1) {\n $element[0].classList.add('md-open');\n el[0].classList.add('md-open');\n self.currentlyOpenMenu = el.controller('mdMenu');\n self.currentlyOpenMenu.registerContainerProxy(self.handleKeyDown);\n self.enableOpenOnHover();\n }\n }));\n\n deregisterFns.push(this.$rootScope.$on('$mdMenuClose', function(event, el, opts) {\n var rootMenus = self.getMenus();\n if (rootMenus.indexOf(el[0]) != -1) {\n $element[0].classList.remove('md-open');\n el[0].classList.remove('md-open');\n }\n\n if ($element[0].contains(el[0])) {\n var parentMenu = el[0];\n while (parentMenu && rootMenus.indexOf(parentMenu) == -1) {\n parentMenu = $mdUtil.getClosest(parentMenu, 'MD-MENU', true);\n }\n if (parentMenu) {\n if (!opts.skipFocus) parentMenu.querySelector('button:not([disabled])').focus();\n self.currentlyOpenMenu = undefined;\n self.disableOpenOnHover();\n self.setKeyboardMode(true);\n }\n }\n }));\n\n $scope.$on('$destroy', function() {\n while (deregisterFns.length) {\n deregisterFns.shift()();\n }\n });\n\n\n this.setKeyboardMode(true);\n};\n\nMenuBarController.prototype.setKeyboardMode = function(enabled) {\n if (enabled) this.$element[0].classList.add('md-keyboard-mode');\n else this.$element[0].classList.remove('md-keyboard-mode');\n};\n\nMenuBarController.prototype.enableOpenOnHover = function() {\n if (this.openOnHoverEnabled) return;\n this.openOnHoverEnabled = true;\n\n var parentToolbar;\n if (parentToolbar = this.parentToolbar) {\n parentToolbar.dataset.mdRestoreStyle = parentToolbar.getAttribute('style');\n parentToolbar.style.position = 'relative';\n parentToolbar.style.zIndex = 100;\n }\n angular\n .element(this.getMenus())\n .on('mouseenter', this.handleMenuHover);\n};\n\nMenuBarController.prototype.handleMenuHover = function(e) {\n this.setKeyboardMode(false);\n if (this.openOnHoverEnabled) {\n this.scheduleOpenHoveredMenu(e);\n }\n};\n\n\nMenuBarController.prototype.disableOpenOnHover = function() {\n if (!this.openOnHoverEnabled) return;\n this.openOnHoverEnabled = false;\n var parentToolbar;\n if (parentToolbar = this.parentToolbar) {\n parentToolbar.style.cssText = parentToolbar.dataset.mdRestoreStyle || '';\n }\n angular\n .element(this.getMenus())\n .off('mouseenter', this.handleMenuHover);\n};\n\nMenuBarController.prototype.scheduleOpenHoveredMenu = function(e) {\n var menuEl = angular.element(e.currentTarget);\n var menuCtrl = menuEl.controller('mdMenu');\n this.setKeyboardMode(false);\n this.scheduleOpenMenu(menuCtrl);\n};\n\nMenuBarController.prototype.scheduleOpenMenu = function(menuCtrl) {\n var self = this;\n var $timeout = this.$timeout;\n if (menuCtrl != self.currentlyOpenMenu) {\n $timeout.cancel(self.pendingMenuOpen);\n self.pendingMenuOpen = $timeout(function() {\n self.pendingMenuOpen = undefined;\n if (self.currentlyOpenMenu) {\n self.currentlyOpenMenu.close(true, { closeAll: true });\n }\n menuCtrl.open();\n }, 200, false);\n }\n};\n\nMenuBarController.prototype.handleKeyDown = function(e) {\n var keyCodes = this.$mdConstant.KEY_CODE;\n var currentMenu = this.currentlyOpenMenu;\n var wasOpen = currentMenu && currentMenu.isOpen;\n this.setKeyboardMode(true);\n var handled, newMenu, newMenuCtrl;\n switch (e.keyCode) {\n case keyCodes.DOWN_ARROW:\n if (currentMenu) {\n currentMenu.focusMenuContainer();\n } else {\n this.openFocusedMenu();\n }\n handled = true;\n break;\n case keyCodes.UP_ARROW:\n currentMenu && currentMenu.close();\n handled = true;\n break;\n case keyCodes.LEFT_ARROW:\n newMenu = this.focusMenu(-1);\n if (wasOpen) {\n newMenuCtrl = angular.element(newMenu).controller('mdMenu');\n this.scheduleOpenMenu(newMenuCtrl);\n }\n handled = true;\n break;\n case keyCodes.RIGHT_ARROW:\n newMenu = this.focusMenu(+1);\n if (wasOpen) {\n newMenuCtrl = angular.element(newMenu).controller('mdMenu');\n this.scheduleOpenMenu(newMenuCtrl);\n }\n handled = true;\n break;\n }\n if (handled) {\n e && e.preventDefault && e.preventDefault();\n e && e.stopImmediatePropagation && e.stopImmediatePropagation();\n }\n};\n\nMenuBarController.prototype.focusMenu = function(direction) {\n var menus = this.getMenus();\n var focusedIndex = this.getFocusedMenuIndex();\n\n if (focusedIndex == -1) { focusedIndex = this.getOpenMenuIndex(); }\n\n var changed = false;\n\n if (focusedIndex == -1) { focusedIndex = 0; changed = true; }\n else if (\n direction < 0 && focusedIndex > 0 ||\n direction > 0 && focusedIndex < menus.length - direction\n ) {\n focusedIndex += direction;\n changed = true;\n }\n if (changed) {\n menus[focusedIndex].querySelector('button').focus();\n return menus[focusedIndex];\n }\n};\n\nMenuBarController.prototype.openFocusedMenu = function() {\n var menu = this.getFocusedMenu();\n menu && angular.element(menu).controller('mdMenu').open();\n};\n\nMenuBarController.prototype.getMenus = function() {\n var $element = this.$element;\n return this.$mdUtil.nodesToArray($element[0].children)\n .filter(function(el) { return el.nodeName == 'MD-MENU'; });\n};\n\nMenuBarController.prototype.getFocusedMenu = function() {\n return this.getMenus()[this.getFocusedMenuIndex()];\n};\n\nMenuBarController.prototype.getFocusedMenuIndex = function() {\n var $mdUtil = this.$mdUtil;\n var focusedEl = $mdUtil.getClosest(\n this.$document[0].activeElement,\n 'MD-MENU'\n );\n if (!focusedEl) return -1;\n\n var focusedIndex = this.getMenus().indexOf(focusedEl);\n return focusedIndex;\n\n};\n\nMenuBarController.prototype.getOpenMenuIndex = function() {\n var menus = this.getMenus();\n for (var i = 0; i < menus.length; ++i) {\n if (menus[i].classList.contains('md-open')) return i;\n }\n return -1;\n};\n\n\n\n\n\n\n\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc directive\n * @name mdMenuBar\n * @module material.components.menu-bar\n * @restrict E\n * @description\n *\n * Menu bars are containers that hold multiple menus. They change the behavior and appearence\n * of the `md-menu` directive to behave similar to an operating system provided menu.\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-menu-bar>\n * <md-menu>\n * <button ng-click=\"$mdOpenMenu()\">\n * File\n * </button>\n * <md-menu-content>\n * <md-menu-item>\n * <md-button ng-click=\"ctrl.sampleAction('share', $event)\">\n * Share...\n * </md-button>\n * </md-menu-item>\n * <md-menu-divider></md-menu-divider>\n * <md-menu-item>\n * <md-menu-item>\n * <md-menu>\n * <md-button ng-click=\"$mdOpenMenu()\">New</md-button>\n * <md-menu-content>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Document', $event)\">Document</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Spreadsheet', $event)\">Spreadsheet</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Presentation', $event)\">Presentation</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Form', $event)\">Form</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Drawing', $event)\">Drawing</md-button></md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </md-menu-bar>\n * </hljs>\n *\n * ## Menu Bar Controls\n *\n * You may place `md-menu-items` that function as controls within menu bars.\n * There are two modes that are exposed via the `type` attribute of the `md-menu-item`.\n * `type=\"checkbox\"` will function as a boolean control for the `ng-model` attribute of the\n * `md-menu-item`. `type=\"radio\"` will function like a radio button, setting the `ngModel`\n * to the `string` value of the `value` attribute. If you need non-string values, you can use\n * `ng-value` to provide an expression (this is similar to how angular's native `input[type=radio]` works.\n *\n * <hljs lang=\"html\">\n * <md-menu-bar>\n * <md-menu>\n * <button ng-click=\"$mdOpenMenu()\">\n * Sample Menu\n * </button>\n * <md-menu-content>\n * <md-menu-item type=\"checkbox\" ng-model=\"settings.allowChanges\">Allow changes</md-menu-item>\n * <md-menu-divider></md-menu-divider>\n * <md-menu-item type=\"radio\" ng-model=\"settings.mode\" ng-value=\"1\">Mode 1</md-menu-item>\n * <md-menu-item type=\"radio\" ng-model=\"settings.mode\" ng-value=\"1\">Mode 2</md-menu-item>\n * <md-menu-item type=\"radio\" ng-model=\"settings.mode\" ng-value=\"1\">Mode 3</md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </md-menu-bar>\n * </hljs>\n *\n *\n * ### Nesting Menus\n *\n * Menus may be nested within menu bars. This is commonly called cascading menus.\n * To nest a menu place the nested menu inside the content of the `md-menu-item`.\n * <hljs lang=\"html\">\n * <md-menu-item>\n * <md-menu>\n * <button ng-click=\"$mdOpenMenu()\">New</md-button>\n * <md-menu-content>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Document', $event)\">Document</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Spreadsheet', $event)\">Spreadsheet</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Presentation', $event)\">Presentation</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Form', $event)\">Form</md-button></md-menu-item>\n * <md-menu-item><md-button ng-click=\"ctrl.sampleAction('New Drawing', $event)\">Drawing</md-button></md-menu-item>\n * </md-menu-content>\n * </md-menu>\n * </md-menu-item>\n * </hljs>\n *\n */\n\nangular\n .module('material.components.menuBar')\n .directive('mdMenuBar', MenuBarDirective);\n\n/* @ngInject */\nfunction MenuBarDirective($mdUtil, $mdTheming) {\n return {\n restrict: 'E',\n require: 'mdMenuBar',\n controller: 'MenuBarController',\n\n compile: function compile(templateEl, templateAttrs) {\n if (!templateAttrs.ariaRole) {\n templateEl[0].setAttribute('role', 'menubar');\n }\n angular.forEach(templateEl[0].children, function(menuEl) {\n if (menuEl.nodeName == 'MD-MENU') {\n if (!menuEl.hasAttribute('md-position-mode')) {\n menuEl.setAttribute('md-position-mode', 'left bottom');\n menuEl.querySelector('button,a').setAttribute('role', 'menuitem');\n }\n var contentEls = $mdUtil.nodesToArray(menuEl.querySelectorAll('md-menu-content'));\n angular.forEach(contentEls, function(contentEl) {\n contentEl.classList.add('md-menu-bar-menu');\n contentEl.classList.add('md-dense');\n if (!contentEl.hasAttribute('width')) {\n contentEl.setAttribute('width', 5);\n }\n });\n }\n });\n\n return function postLink(scope, el, attrs, ctrl) {\n $mdTheming(scope, el);\n ctrl.init();\n };\n }\n };\n\n}\nMenuBarDirective.$inject = [\"$mdUtil\", \"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n\nangular\n .module('material.components.menuBar')\n .directive('mdMenuDivider', MenuDividerDirective);\n\n\nfunction MenuDividerDirective() {\n return {\n restrict: 'E',\n compile: function(templateEl, templateAttrs) {\n if (!templateAttrs.role) {\n templateEl[0].setAttribute('role', 'separator');\n }\n }\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\n\nangular\n .module('material.components.menuBar')\n .controller('MenuItemController', MenuItemController);\n\n\n/**\n * @ngInject\n */\nfunction MenuItemController($scope, $element, $attrs) {\n this.$element = $element;\n this.$attrs = $attrs;\n this.$scope = $scope;\n}\nMenuItemController.$inject = [\"$scope\", \"$element\", \"$attrs\"];\n\nMenuItemController.prototype.init = function(ngModel) {\n var $element = this.$element;\n var $attrs = this.$attrs;\n\n this.ngModel = ngModel;\n if ($attrs.type == 'checkbox' || $attrs.type == 'radio') {\n this.mode = $attrs.type;\n this.iconEl = $element[0].children[0];\n this.buttonEl = $element[0].children[1];\n if (ngModel) {\n // Clear ngAria set attributes\n this.initClickListeners();\n }\n }\n};\n\n// ngAria auto sets attributes on a menu-item with a ngModel.\n// We don't want this because our content (buttons) get the focus\n// and set their own aria attributes appropritately. Having both\n// breaks NVDA / JAWS. This undeoes ngAria's attrs.\nMenuItemController.prototype.clearNgAria = function() {\n var el = this.$element[0];\n var clearAttrs = ['role', 'tabindex', 'aria-invalid', 'aria-checked'];\n angular.forEach(clearAttrs, function(attr) {\n el.removeAttribute(attr);\n });\n};\n\nMenuItemController.prototype.initClickListeners = function() {\n var self = this;\n var ngModel = this.ngModel;\n var $scope = this.$scope;\n var $attrs = this.$attrs;\n var $element = this.$element;\n var mode = this.mode;\n\n this.handleClick = angular.bind(this, this.handleClick);\n\n var icon = this.iconEl;\n var button = angular.element(this.buttonEl);\n var handleClick = this.handleClick;\n\n $attrs.$observe('disabled', setDisabled);\n setDisabled($attrs.disabled);\n\n ngModel.$render = function render() {\n self.clearNgAria();\n if (isSelected()) {\n icon.style.display = '';\n button.attr('aria-checked', 'true');\n } else {\n icon.style.display = 'none';\n button.attr('aria-checked', 'false');\n }\n };\n\n $scope.$$postDigest(ngModel.$render);\n\n function isSelected() {\n if (mode == 'radio') {\n var val = $attrs.ngValue ? $scope.$eval($attrs.ngValue) : $attrs.value;\n return ngModel.$modelValue == val;\n } else {\n return ngModel.$modelValue;\n }\n }\n\n function setDisabled(disabled) {\n if (disabled) {\n button.off('click', handleClick);\n } else {\n button.on('click', handleClick);\n }\n }\n};\n\nMenuItemController.prototype.handleClick = function(e) {\n var mode = this.mode;\n var ngModel = this.ngModel;\n var $attrs = this.$attrs;\n var newVal;\n if (mode == 'checkbox') {\n newVal = !ngModel.$modelValue;\n } else if (mode == 'radio') {\n newVal = $attrs.ngValue ? this.$scope.$eval($attrs.ngValue) : $attrs.value;\n }\n ngModel.$setViewValue(newVal);\n ngModel.$render();\n};\n\n})();\n(function(){\n\"use strict\";\n\n\nangular\n .module('material.components.menuBar')\n .directive('mdMenuItem', MenuItemDirective);\n\n /* @ngInject */\nfunction MenuItemDirective() {\n return {\n require: ['mdMenuItem', '?ngModel'],\n priority: 210, // ensure that our post link runs after ngAria\n compile: function(templateEl, templateAttrs) {\n if (templateAttrs.type == 'checkbox' || templateAttrs.type == 'radio') {\n var text = templateEl[0].textContent;\n var buttonEl = angular.element('<md-button type=\"button\"></md-button>');\n buttonEl.html(text);\n buttonEl.attr('tabindex', '0');\n\n templateEl.html('');\n templateEl.append(angular.element('<md-icon md-svg-icon=\"check\"></md-icon>'));\n templateEl.append(buttonEl);\n templateEl[0].classList.add('md-indent');\n\n setDefault('role', (templateAttrs.type == 'checkbox') ? 'menuitemcheckbox' : 'menuitemradio', buttonEl);\n angular.forEach(['ng-disabled'], moveAttrToButton);\n\n } else {\n setDefault('role', 'menuitem', templateEl[0].querySelector('md-button,button,a'));\n }\n\n\n return function(scope, el, attrs, ctrls) {\n var ctrl = ctrls[0];\n var ngModel = ctrls[1];\n ctrl.init(ngModel);\n };\n\n function setDefault(attr, val, el) {\n el = el || templateEl;\n if (el instanceof angular.element) {\n el = el[0];\n }\n if (!el.hasAttribute(attr)) {\n el.setAttribute(attr, val);\n }\n }\n\n function moveAttrToButton(attr) {\n if (templateEl[0].hasAttribute(attr)) {\n var val = templateEl[0].getAttribute(attr);\n buttonEl[0].setAttribute(attr, val);\n templateEl[0].removeAttribute(attr);\n }\n }\n },\n controller: 'MenuItemController'\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc directive\n * @name mdTab\n * @module material.components.tabs\n *\n * @restrict E\n *\n * @description\n * Use the `<md-tab>` a nested directive used within `<md-tabs>` to specify a tab with a **label** and optional *view content*.\n *\n * If the `label` attribute is not specified, then an optional `<md-tab-label>` tag can be used to specify more\n * complex tab header markup. If neither the **label** nor the **md-tab-label** are specified, then the nested\n * markup of the `<md-tab>` is used as the tab header markup.\n *\n * Please note that if you use `<md-tab-label>`, your content **MUST** be wrapped in the `<md-tab-body>` tag. This\n * is to define a clear separation between the tab content and the tab label.\n *\n * This container is used by the TabsController to show/hide the active tab's content view. This synchronization is\n * automatically managed by the internal TabsController whenever the tab selection changes. Selection changes can\n * be initiated via data binding changes, programmatic invocation, or user gestures.\n *\n * @param {string=} label Optional attribute to specify a simple string as the tab label\n * @param {boolean=} ng-disabled If present and expression evaluates to truthy, disabled tab selection.\n * @param {expression=} md-on-deselect Expression to be evaluated after the tab has been de-selected.\n * @param {expression=} md-on-select Expression to be evaluated after the tab has been selected.\n * @param {boolean=} md-active When true, sets the active tab. Note: There can only be one active tab at a time.\n *\n *\n * @usage\n *\n * <hljs lang=\"html\">\n * <md-tab label=\"\" ng-disabled md-on-select=\"\" md-on-deselect=\"\" >\n * <h3>My Tab content</h3>\n * </md-tab>\n *\n * <md-tab >\n * <md-tab-label>\n * <h3>My Tab content</h3>\n * </md-tab-label>\n * <md-tab-body>\n * <p>\n * Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,\n * totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae\n * dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,\n * sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.\n * </p>\n * </md-tab-body>\n * </md-tab>\n * </hljs>\n *\n */\nangular\n .module('material.components.tabs')\n .directive('mdTab', MdTab);\n\nfunction MdTab () {\n return {\n require: '^?mdTabs',\n terminal: true,\n compile: function (element, attr) {\n var label = firstChild(element, 'md-tab-label'),\n body = firstChild(element, 'md-tab-body');\n\n if (label.length == 0) {\n label = angular.element('<md-tab-label></md-tab-label>');\n if (attr.label) label.text(attr.label);\n else label.append(element.contents());\n\n if (body.length == 0) {\n var contents = element.contents().detach();\n body = angular.element('<md-tab-body></md-tab-body>');\n body.append(contents);\n }\n }\n\n element.append(label);\n if (body.html()) element.append(body);\n\n return postLink;\n },\n scope: {\n active: '=?mdActive',\n disabled: '=?ngDisabled',\n select: '&?mdOnSelect',\n deselect: '&?mdOnDeselect'\n }\n };\n\n function postLink (scope, element, attr, ctrl) {\n if (!ctrl) return;\n var index = ctrl.getTabElementIndex(element),\n body = firstChild(element, 'md-tab-body').remove(),\n label = firstChild(element, 'md-tab-label').remove(),\n data = ctrl.insertTab({\n scope: scope,\n parent: scope.$parent,\n index: index,\n element: element,\n template: body.html(),\n label: label.html()\n }, index);\n\n scope.select = scope.select || angular.noop;\n scope.deselect = scope.deselect || angular.noop;\n\n scope.$watch('active', function (active) { if (active) ctrl.select(data.getIndex(), true); });\n scope.$watch('disabled', function () { ctrl.refreshIndex(); });\n scope.$watch(\n function () {\n return ctrl.getTabElementIndex(element);\n },\n function (newIndex) {\n data.index = newIndex;\n ctrl.updateTabOrder();\n }\n );\n scope.$on('$destroy', function () { ctrl.removeTab(data); });\n }\n\n function firstChild (element, tagName) {\n var children = element[0].children;\n for (var i = 0, len = children.length; i < len; i++) {\n var child = children[i];\n if (child.tagName === tagName.toUpperCase()) return angular.element(child);\n }\n return angular.element();\n }\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.tabs')\n .directive('mdTabItem', MdTabItem);\n\nfunction MdTabItem () {\n return {\n require: '^?mdTabs',\n link: function link (scope, element, attr, ctrl) {\n if (!ctrl) return;\n ctrl.attachRipple(scope, element);\n }\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.tabs')\n .directive('mdTabLabel', MdTabLabel);\n\nfunction MdTabLabel () {\n return { terminal: true };\n}\n\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.components.tabs')\n .directive('mdTabScroll', MdTabScroll);\n\nfunction MdTabScroll ($parse) {\n return {\n restrict: 'A',\n compile: function ($element, attr) {\n var fn = $parse(attr.mdTabScroll, null, true);\n return function ngEventHandler (scope, element) {\n element.on('mousewheel', function (event) {\n scope.$apply(function () { fn(scope, { $event: event }); });\n });\n };\n }\n }\n}\nMdTabScroll.$inject = [\"$parse\"];\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.tabs')\n .controller('MdTabsController', MdTabsController);\n\n/**\n * @ngInject\n */\nfunction MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipple,\n $mdUtil, $animateCss, $attrs, $compile, $mdTheming) {\n // define private properties\n var ctrl = this,\n locked = false,\n elements = getElements(),\n queue = [],\n destroyed = false,\n loaded = false;\n\n // define one-way bindings\n defineOneWayBinding('stretchTabs', handleStretchTabs);\n\n // define public properties with change handlers\n defineProperty('focusIndex', handleFocusIndexChange, ctrl.selectedIndex || 0);\n defineProperty('offsetLeft', handleOffsetChange, 0);\n defineProperty('hasContent', handleHasContent, false);\n defineProperty('maxTabWidth', handleMaxTabWidth, getMaxTabWidth());\n defineProperty('shouldPaginate', handleShouldPaginate, false);\n\n // define boolean attributes\n defineBooleanAttribute('noInkBar', handleInkBar);\n defineBooleanAttribute('dynamicHeight', handleDynamicHeight);\n defineBooleanAttribute('noPagination');\n defineBooleanAttribute('swipeContent');\n defineBooleanAttribute('noDisconnect');\n defineBooleanAttribute('autoselect');\n defineBooleanAttribute('noSelectClick');\n defineBooleanAttribute('centerTabs', handleCenterTabs, false);\n defineBooleanAttribute('enableDisconnect');\n\n // define public properties\n ctrl.scope = $scope;\n ctrl.parent = $scope.$parent;\n ctrl.tabs = [];\n ctrl.lastSelectedIndex = null;\n ctrl.hasFocus = false;\n ctrl.lastClick = true;\n ctrl.shouldCenterTabs = shouldCenterTabs();\n\n // define public methods\n ctrl.updatePagination = $mdUtil.debounce(updatePagination, 100);\n ctrl.redirectFocus = redirectFocus;\n ctrl.attachRipple = attachRipple;\n ctrl.insertTab = insertTab;\n ctrl.removeTab = removeTab;\n ctrl.select = select;\n ctrl.scroll = scroll;\n ctrl.nextPage = nextPage;\n ctrl.previousPage = previousPage;\n ctrl.keydown = keydown;\n ctrl.canPageForward = canPageForward;\n ctrl.canPageBack = canPageBack;\n ctrl.refreshIndex = refreshIndex;\n ctrl.incrementIndex = incrementIndex;\n ctrl.getTabElementIndex = getTabElementIndex;\n ctrl.updateInkBarStyles = $mdUtil.debounce(updateInkBarStyles, 100);\n ctrl.updateTabOrder = $mdUtil.debounce(updateTabOrder, 100);\n\n init();\n\n /**\n * Perform initialization for the controller, setup events and watcher(s)\n */\n function init () {\n ctrl.selectedIndex = ctrl.selectedIndex || 0;\n compileTemplate();\n configureWatchers();\n bindEvents();\n $mdTheming($element);\n $mdUtil.nextTick(function () {\n updateHeightFromContent();\n adjustOffset();\n updateInkBarStyles();\n ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n loaded = true;\n updatePagination();\n });\n }\n\n /**\n * Compiles the template provided by the user. This is passed as an attribute from the tabs\n * directive's template function.\n */\n function compileTemplate () {\n var template = $attrs.$mdTabsTemplate,\n element = angular.element(elements.data);\n element.html(template);\n $compile(element.contents())(ctrl.parent);\n delete $attrs.$mdTabsTemplate;\n }\n\n /**\n * Binds events used by the tabs component.\n */\n function bindEvents () {\n angular.element($window).on('resize', handleWindowResize);\n $scope.$on('$destroy', cleanup);\n }\n\n /**\n * Configure watcher(s) used by Tabs\n */\n function configureWatchers () {\n $scope.$watch('$mdTabsCtrl.selectedIndex', handleSelectedIndexChange);\n }\n\n /**\n * Creates a one-way binding manually rather than relying on Angular's isolated scope\n * @param key\n * @param handler\n */\n function defineOneWayBinding (key, handler) {\n var attr = $attrs.$normalize('md-' + key);\n if (handler) defineProperty(key, handler);\n $attrs.$observe(attr, function (newValue) { ctrl[ key ] = newValue; });\n }\n\n /**\n * Defines boolean attributes with default value set to true. (ie. md-stretch-tabs with no value\n * will be treated as being truthy)\n * @param key\n * @param handler\n */\n function defineBooleanAttribute (key, handler) {\n var attr = $attrs.$normalize('md-' + key);\n if (handler) defineProperty(key, handler);\n if ($attrs.hasOwnProperty(attr)) updateValue($attrs[attr]);\n $attrs.$observe(attr, updateValue);\n function updateValue (newValue) {\n ctrl[ key ] = newValue !== 'false';\n }\n }\n\n /**\n * Remove any events defined by this controller\n */\n function cleanup () {\n destroyed = true;\n angular.element($window).off('resize', handleWindowResize);\n }\n\n // Change handlers\n\n /**\n * Toggles stretch tabs class and updates inkbar when tab stretching changes\n * @param stretchTabs\n */\n function handleStretchTabs (stretchTabs) {\n angular.element(elements.wrapper).toggleClass('md-stretch-tabs', shouldStretchTabs());\n updateInkBarStyles();\n }\n\n function handleCenterTabs (newValue) {\n ctrl.shouldCenterTabs = shouldCenterTabs();\n }\n\n function handleMaxTabWidth (newWidth, oldWidth) {\n if (newWidth !== oldWidth) {\n angular.forEach(elements.tabs, function(tab) {\n tab.style.maxWidth = newWidth + 'px';\n });\n $mdUtil.nextTick(ctrl.updateInkBarStyles);\n }\n }\n\n function handleShouldPaginate (newValue, oldValue) {\n if (newValue !== oldValue) {\n ctrl.maxTabWidth = getMaxTabWidth();\n ctrl.shouldCenterTabs = shouldCenterTabs();\n $mdUtil.nextTick(function () {\n ctrl.maxTabWidth = getMaxTabWidth();\n adjustOffset(ctrl.selectedIndex);\n });\n }\n }\n\n /**\n * Add/remove the `md-no-tab-content` class depending on `ctrl.hasContent`\n * @param hasContent\n */\n function handleHasContent (hasContent) {\n $element[ hasContent ? 'removeClass' : 'addClass' ]('md-no-tab-content');\n }\n\n /**\n * Apply ctrl.offsetLeft to the paging element when it changes\n * @param left\n */\n function handleOffsetChange (left) {\n var newValue = ctrl.shouldCenterTabs ? '' : '-' + left + 'px';\n angular.element(elements.paging).css($mdConstant.CSS.TRANSFORM, 'translate3d(' + newValue + ', 0, 0)');\n $scope.$broadcast('$mdTabsPaginationChanged');\n }\n\n /**\n * Update the UI whenever `ctrl.focusIndex` is updated\n * @param newIndex\n * @param oldIndex\n */\n function handleFocusIndexChange (newIndex, oldIndex) {\n if (newIndex === oldIndex) return;\n if (!elements.tabs[ newIndex ]) return;\n adjustOffset();\n redirectFocus();\n }\n\n /**\n * Update the UI whenever the selected index changes. Calls user-defined select/deselect methods.\n * @param newValue\n * @param oldValue\n */\n function handleSelectedIndexChange (newValue, oldValue) {\n if (newValue === oldValue) return;\n \n ctrl.selectedIndex = getNearestSafeIndex(newValue);\n ctrl.lastSelectedIndex = oldValue;\n ctrl.updateInkBarStyles();\n updateHeightFromContent();\n adjustOffset(newValue);\n $scope.$broadcast('$mdTabsChanged');\n ctrl.tabs[ oldValue ] && ctrl.tabs[ oldValue ].scope.deselect();\n ctrl.tabs[ newValue ] && ctrl.tabs[ newValue ].scope.select();\n }\n\n function getTabElementIndex(tabEl){\n var tabs = $element[0].getElementsByTagName('md-tab');\n return Array.prototype.indexOf.call(tabs, tabEl[0]);\n }\n\n /**\n * Queues up a call to `handleWindowResize` when a resize occurs while the tabs component is\n * hidden.\n */\n function handleResizeWhenVisible () {\n // if there is already a watcher waiting for resize, do nothing\n if (handleResizeWhenVisible.watcher) return;\n // otherwise, we will abuse the $watch function to check for visible\n handleResizeWhenVisible.watcher = $scope.$watch(function () {\n // since we are checking for DOM size, we use $mdUtil.nextTick() to wait for after the DOM updates\n $mdUtil.nextTick(function () {\n // if the watcher has already run (ie. multiple digests in one cycle), do nothing\n if (!handleResizeWhenVisible.watcher) return;\n\n if ($element.prop('offsetParent')) {\n handleResizeWhenVisible.watcher();\n handleResizeWhenVisible.watcher = null;\n\n handleWindowResize();\n }\n }, false);\n });\n }\n\n // Event handlers / actions\n\n /**\n * Handle user keyboard interactions\n * @param event\n */\n function keydown (event) {\n switch (event.keyCode) {\n case $mdConstant.KEY_CODE.LEFT_ARROW:\n event.preventDefault();\n incrementIndex(-1, true);\n break;\n case $mdConstant.KEY_CODE.RIGHT_ARROW:\n event.preventDefault();\n incrementIndex(1, true);\n break;\n case $mdConstant.KEY_CODE.SPACE:\n case $mdConstant.KEY_CODE.ENTER:\n event.preventDefault();\n if (!locked) ctrl.selectedIndex = ctrl.focusIndex;\n break;\n }\n ctrl.lastClick = false;\n }\n\n /**\n * Update the selected index. Triggers a click event on the original `md-tab` element in order\n * to fire user-added click events if canSkipClick or `md-no-select-click` are false.\n * @param index\n * @param canSkipClick Optionally allow not firing the click event if `md-no-select-click` is also true.\n */\n function select (index, canSkipClick) {\n if (!locked) ctrl.focusIndex = ctrl.selectedIndex = index;\n ctrl.lastClick = true;\n // skip the click event if noSelectClick is enabled\n if (canSkipClick && ctrl.noSelectClick) return;\n // nextTick is required to prevent errors in user-defined click events\n $mdUtil.nextTick(function () {\n ctrl.tabs[ index ].element.triggerHandler('click');\n }, false);\n }\n\n /**\n * When pagination is on, this makes sure the selected index is in view.\n * @param event\n */\n function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }\n\n /**\n * Slides the tabs over approximately one page forward.\n */\n function nextPage () {\n var viewportWidth = elements.canvas.clientWidth,\n totalWidth = viewportWidth + ctrl.offsetLeft,\n i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth > totalWidth) break;\n }\n ctrl.offsetLeft = fixOffset(tab.offsetLeft);\n }\n\n /**\n * Slides the tabs over approximately one page backward.\n */\n function previousPage () {\n var i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n }\n\n /**\n * Update size calculations when the window is resized.\n */\n function handleWindowResize () {\n ctrl.lastSelectedIndex = ctrl.selectedIndex;\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n $mdUtil.nextTick(function () {\n ctrl.updateInkBarStyles();\n updatePagination();\n });\n }\n\n function handleInkBar (hide) {\n angular.element(elements.inkBar).toggleClass('ng-hide', hide);\n }\n\n /**\n * Toggle dynamic height class when value changes\n * @param value\n */\n function handleDynamicHeight (value) {\n $element.toggleClass('md-dynamic-height', value);\n }\n\n /**\n * Remove a tab from the data and select the nearest valid tab.\n * @param tabData\n */\n function removeTab (tabData) {\n if (destroyed) return;\n var selectedIndex = ctrl.selectedIndex,\n tab = ctrl.tabs.splice(tabData.getIndex(), 1)[ 0 ];\n refreshIndex();\n // when removing a tab, if the selected index did not change, we have to manually trigger the\n // tab select/deselect events\n if (ctrl.selectedIndex === selectedIndex) {\n tab.scope.deselect();\n ctrl.tabs[ ctrl.selectedIndex ] && ctrl.tabs[ ctrl.selectedIndex ].scope.select();\n }\n $mdUtil.nextTick(function () {\n updatePagination();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft);\n });\n }\n\n /**\n * Create an entry in the tabs array for a new tab at the specified index.\n * @param tabData\n * @param index\n * @returns {*}\n */\n function insertTab (tabData, index) {\n var hasLoaded = loaded;\n var proto = {\n getIndex: function () { return ctrl.tabs.indexOf(tab); },\n isActive: function () { return this.getIndex() === ctrl.selectedIndex; },\n isLeft: function () { return this.getIndex() < ctrl.selectedIndex; },\n isRight: function () { return this.getIndex() > ctrl.selectedIndex; },\n shouldRender: function () { return !ctrl.noDisconnect || this.isActive(); },\n hasFocus: function () {\n return !ctrl.lastClick\n && ctrl.hasFocus && this.getIndex() === ctrl.focusIndex;\n },\n id: $mdUtil.nextUid()\n },\n tab = angular.extend(proto, tabData);\n if (angular.isDefined(index)) {\n ctrl.tabs.splice(index, 0, tab);\n } else {\n ctrl.tabs.push(tab);\n }\n processQueue();\n updateHasContent();\n $mdUtil.nextTick(function () {\n updatePagination();\n // if autoselect is enabled, select the newly added tab\n if (hasLoaded && ctrl.autoselect) $mdUtil.nextTick(function () {\n $mdUtil.nextTick(function () { select(ctrl.tabs.indexOf(tab)); });\n });\n });\n return tab;\n }\n\n // Getter methods\n\n /**\n * Gathers references to all of the DOM elements used by this controller.\n * @returns {{}}\n */\n function getElements () {\n var elements = {};\n\n // gather tab bar elements\n elements.wrapper = $element[ 0 ].getElementsByTagName('md-tabs-wrapper')[ 0 ];\n elements.data = $element[ 0 ].getElementsByTagName('md-tab-data')[ 0 ];\n elements.canvas = elements.wrapper.getElementsByTagName('md-tabs-canvas')[ 0 ];\n elements.paging = elements.canvas.getElementsByTagName('md-pagination-wrapper')[ 0 ];\n elements.tabs = elements.paging.getElementsByTagName('md-tab-item');\n elements.dummies = elements.canvas.getElementsByTagName('md-dummy-tab');\n elements.inkBar = elements.paging.getElementsByTagName('md-ink-bar')[ 0 ];\n\n // gather tab content elements\n elements.contentsWrapper = $element[ 0 ].getElementsByTagName('md-tabs-content-wrapper')[ 0 ];\n elements.contents = elements.contentsWrapper.getElementsByTagName('md-tab-content');\n\n return elements;\n }\n\n /**\n * Determines whether or not the left pagination arrow should be enabled.\n * @returns {boolean}\n */\n function canPageBack () {\n return ctrl.offsetLeft > 0;\n }\n\n /**\n * Determines whether or not the right pagination arrow should be enabled.\n * @returns {*|boolean}\n */\n function canPageForward () {\n var lastTab = elements.tabs[ elements.tabs.length - 1 ];\n return lastTab && lastTab.offsetLeft + lastTab.offsetWidth > elements.canvas.clientWidth +\n ctrl.offsetLeft;\n }\n\n /**\n * Determines if the UI should stretch the tabs to fill the available space.\n * @returns {*}\n */\n function shouldStretchTabs () {\n switch (ctrl.stretchTabs) {\n case 'always':\n return true;\n case 'never':\n return false;\n default:\n return !ctrl.shouldPaginate\n && $window.matchMedia('(max-width: 600px)').matches;\n }\n }\n\n /**\n * Determines if the tabs should appear centered.\n * @returns {string|boolean}\n */\n function shouldCenterTabs () {\n return ctrl.centerTabs && !ctrl.shouldPaginate;\n }\n\n /**\n * Determines if pagination is necessary to display the tabs within the available space.\n * @returns {boolean}\n */\n function shouldPaginate () {\n if (ctrl.noPagination || !loaded) return false;\n var canvasWidth = $element.prop('clientWidth');\n angular.forEach(getElements().dummies, function (tab) { canvasWidth -= tab.offsetWidth; });\n return canvasWidth < 0;\n }\n\n /**\n * Finds the nearest tab index that is available. This is primarily used for when the active\n * tab is removed.\n * @param newIndex\n * @returns {*}\n */\n function getNearestSafeIndex (newIndex) {\n if (newIndex === -1) return -1;\n var maxOffset = Math.max(ctrl.tabs.length - newIndex, newIndex),\n i, tab;\n for (i = 0; i <= maxOffset; i++) {\n tab = ctrl.tabs[ newIndex + i ];\n if (tab && (tab.scope.disabled !== true)) return tab.getIndex();\n tab = ctrl.tabs[ newIndex - i ];\n if (tab && (tab.scope.disabled !== true)) return tab.getIndex();\n }\n return newIndex;\n }\n\n // Utility methods\n\n /**\n * Defines a property using a getter and setter in order to trigger a change handler without\n * using `$watch` to observe changes.\n * @param key\n * @param handler\n * @param value\n */\n function defineProperty (key, handler, value) {\n Object.defineProperty(ctrl, key, {\n get: function () { return value; },\n set: function (newValue) {\n var oldValue = value;\n value = newValue;\n handler && handler(newValue, oldValue);\n }\n });\n }\n\n /**\n * Updates whether or not pagination should be displayed.\n */\n function updatePagination () {\n if (!shouldStretchTabs()) updatePagingWidth();\n ctrl.maxTabWidth = getMaxTabWidth();\n ctrl.shouldPaginate = shouldPaginate();\n }\n\n function updatePagingWidth() {\n var width = 1;\n angular.forEach(getElements().dummies, function (element) {\n //-- Uses the larger value between `getBoundingClientRect().width` and `offsetWidth`. This\n // prevents `offsetWidth` value from being rounded down and causing wrapping issues, but\n // also handles scenarios where `getBoundingClientRect()` is inaccurate (ie. tabs inside\n // of a dialog)\n width += Math.max(element.offsetWidth, element.getBoundingClientRect().width);\n });\n angular.element(elements.paging).css('width', Math.ceil(width) + 'px');\n }\n\n function getMaxTabWidth () {\n return $element.prop('clientWidth');\n }\n\n /**\n * Re-orders the tabs and updates the selected and focus indexes to their new positions.\n * This is triggered by `tabDirective.js` when the user's tabs have been re-ordered.\n */\n function updateTabOrder () {\n var selectedItem = ctrl.tabs[ ctrl.selectedIndex ],\n focusItem = ctrl.tabs[ ctrl.focusIndex ];\n ctrl.tabs = ctrl.tabs.sort(function (a, b) {\n return a.index - b.index;\n });\n ctrl.selectedIndex = ctrl.tabs.indexOf(selectedItem);\n ctrl.focusIndex = ctrl.tabs.indexOf(focusItem);\n }\n\n /**\n * This moves the selected or focus index left or right. This is used by the keydown handler.\n * @param inc\n */\n function incrementIndex (inc, focus) {\n var newIndex,\n key = focus ? 'focusIndex' : 'selectedIndex',\n index = ctrl[ key ];\n for (newIndex = index + inc;\n ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled;\n newIndex += inc) {}\n if (ctrl.tabs[ newIndex ]) {\n ctrl[ key ] = newIndex;\n }\n }\n\n /**\n * This is used to forward focus to dummy elements. This method is necessary to avoid animation\n * issues when attempting to focus an item that is out of view.\n */\n function redirectFocus () {\n getElements().dummies[ ctrl.focusIndex ].focus();\n }\n\n /**\n * Forces the pagination to move the focused tab into view.\n */\n function adjustOffset (index) {\n if (index == null) index = ctrl.focusIndex;\n if (!elements.tabs[ index ]) return;\n if (ctrl.shouldCenterTabs) return;\n var tab = elements.tabs[ index ],\n left = tab.offsetLeft,\n right = tab.offsetWidth + left;\n ctrl.offsetLeft = Math.max(ctrl.offsetLeft, fixOffset(right - elements.canvas.clientWidth + 32 * 2));\n ctrl.offsetLeft = Math.min(ctrl.offsetLeft, fixOffset(left));\n }\n\n /**\n * Iterates through all queued functions and clears the queue. This is used for functions that\n * are called before the UI is ready, such as size calculations.\n */\n function processQueue () {\n queue.forEach(function (func) { $mdUtil.nextTick(func); });\n queue = [];\n }\n\n /**\n * Determines if the tab content area is needed.\n */\n function updateHasContent () {\n var hasContent = false;\n angular.forEach(ctrl.tabs, function (tab) {\n if (tab.template) hasContent = true;\n });\n ctrl.hasContent = hasContent;\n }\n\n /**\n * Moves the indexes to their nearest valid values.\n */\n function refreshIndex () {\n ctrl.selectedIndex = getNearestSafeIndex(ctrl.selectedIndex);\n ctrl.focusIndex = getNearestSafeIndex(ctrl.focusIndex);\n }\n\n /**\n * Calculates the content height of the current tab.\n * @returns {*}\n */\n function updateHeightFromContent () {\n if (!ctrl.dynamicHeight) return $element.css('height', '');\n if (!ctrl.tabs.length) return queue.push(updateHeightFromContent);\n\n var tabContent = elements.contents[ ctrl.selectedIndex ],\n contentHeight = tabContent ? tabContent.offsetHeight : 0,\n tabsHeight = elements.wrapper.offsetHeight,\n newHeight = contentHeight + tabsHeight,\n currentHeight = $element.prop('clientHeight');\n\n if (currentHeight === newHeight) return;\n\n // Adjusts calculations for when the buttons are bottom-aligned since this relies on absolute\n // positioning. This should probably be cleaned up if a cleaner solution is possible.\n if ($element.attr('md-align-tabs') === 'bottom') {\n currentHeight -= tabsHeight;\n newHeight -= tabsHeight;\n // Need to include bottom border in these calculations\n if ($element.attr('md-border-bottom') !== undefined) ++currentHeight;\n }\n\n // Lock during animation so the user can't change tabs\n locked = true;\n\n var fromHeight = { height: currentHeight + 'px' },\n toHeight = { height: newHeight + 'px' };\n\n // Set the height to the current, specific pixel height to fix a bug on iOS where the height\n // first animates to 0, then back to the proper height causing a visual glitch\n $element.css(fromHeight);\n\n // Animate the height from the old to the new\n $animateCss($element, {\n from: fromHeight,\n to: toHeight,\n easing: 'cubic-bezier(0.35, 0, 0.25, 1)',\n duration: 0.5\n }).start().done(function () {\n // Then (to fix the same iOS issue as above), disable transitions and remove the specific\n // pixel height so the height can size with browser width/content changes, etc.\n $element.css({\n transition: 'none',\n height: ''\n });\n\n // In the next tick, re-allow transitions (if we do it all at once, $element.css is \"smart\"\n // enough to batch it for us instead of doing it immediately, which undoes the original\n // transition: none)\n $mdUtil.nextTick(function() {\n $element.css('transition', '');\n });\n\n // And unlock so tab changes can occur\n locked = false;\n });\n }\n\n /**\n * Repositions the ink bar to the selected tab.\n * @returns {*}\n */\n function updateInkBarStyles () {\n if (!elements.tabs[ ctrl.selectedIndex ]) {\n angular.element(elements.inkBar).css({ left: 'auto', right: 'auto' });\n return;\n }\n if (!ctrl.tabs.length) return queue.push(ctrl.updateInkBarStyles);\n // if the element is not visible, we will not be able to calculate sizes until it is\n // we should treat that as a resize event rather than just updating the ink bar\n if (!$element.prop('offsetParent')) return handleResizeWhenVisible();\n var index = ctrl.selectedIndex,\n totalWidth = elements.paging.offsetWidth,\n tab = elements.tabs[ index ],\n left = tab.offsetLeft,\n right = totalWidth - left - tab.offsetWidth,\n tabWidth;\n if (ctrl.shouldCenterTabs) {\n tabWidth = Array.prototype.slice.call(elements.tabs).reduce(function (value, element) {\n return value + element.offsetWidth;\n }, 0);\n if (totalWidth > tabWidth) $mdUtil.nextTick(updateInkBarStyles, false);\n }\n updateInkBarClassName();\n angular.element(elements.inkBar).css({ left: left + 'px', right: right + 'px' });\n }\n\n /**\n * Adds left/right classes so that the ink bar will animate properly.\n */\n function updateInkBarClassName () {\n var newIndex = ctrl.selectedIndex,\n oldIndex = ctrl.lastSelectedIndex,\n ink = angular.element(elements.inkBar);\n if (!angular.isNumber(oldIndex)) return;\n ink\n .toggleClass('md-left', newIndex < oldIndex)\n .toggleClass('md-right', newIndex > oldIndex);\n }\n\n /**\n * Takes an offset value and makes sure that it is within the min/max allowed values.\n * @param value\n * @returns {*}\n */\n function fixOffset (value) {\n if (!elements.tabs.length || !ctrl.shouldPaginate) return 0;\n var lastTab = elements.tabs[ elements.tabs.length - 1 ],\n totalWidth = lastTab.offsetLeft + lastTab.offsetWidth;\n value = Math.max(0, value);\n value = Math.min(totalWidth - elements.canvas.clientWidth, value);\n return value;\n }\n\n /**\n * Attaches a ripple to the tab item element.\n * @param scope\n * @param element\n */\n function attachRipple (scope, element) {\n var options = { colorElement: angular.element(elements.inkBar) };\n $mdTabInkRipple.attach(scope, element, options);\n }\n}\nMdTabsController.$inject = [\"$scope\", \"$element\", \"$window\", \"$mdConstant\", \"$mdTabInkRipple\", \"$mdUtil\", \"$animateCss\", \"$attrs\", \"$compile\", \"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc directive\n * @name mdTabs\n * @module material.components.tabs\n *\n * @restrict E\n *\n * @description\n * The `<md-tabs>` directive serves as the container for 1..n `<md-tab>` child directives to produces a Tabs components.\n * In turn, the nested `<md-tab>` directive is used to specify a tab label for the **header button** and a [optional] tab view\n * content that will be associated with each tab button.\n *\n * Below is the markup for its simplest usage:\n *\n * <hljs lang=\"html\">\n * <md-tabs>\n * <md-tab label=\"Tab #1\"></md-tab>\n * <md-tab label=\"Tab #2\"></md-tab>\n * <md-tab label=\"Tab #3\"></md-tab>\n * </md-tabs>\n * </hljs>\n *\n * Tabs supports three (3) usage scenarios:\n *\n * 1. Tabs (buttons only)\n * 2. Tabs with internal view content\n * 3. Tabs with external view content\n *\n * **Tab-only** support is useful when tab buttons are used for custom navigation regardless of any other components, content, or views.\n * **Tabs with internal views** are the traditional usages where each tab has associated view content and the view switching is managed internally by the Tabs component.\n * **Tabs with external view content** is often useful when content associated with each tab is independently managed and data-binding notifications announce tab selection changes.\n *\n * Additional features also include:\n *\n * * Content can include any markup.\n * * If a tab is disabled while active/selected, then the next tab will be auto-selected.\n *\n * ### Explanation of tab stretching\n *\n * Initially, tabs will have an inherent size. This size will either be defined by how much space is needed to accommodate their text or set by the user through CSS. Calculations will be based on this size.\n *\n * On mobile devices, tabs will be expanded to fill the available horizontal space. When this happens, all tabs will become the same size.\n *\n * On desktops, by default, stretching will never occur.\n *\n * This default behavior can be overridden through the `md-stretch-tabs` attribute. Here is a table showing when stretching will occur:\n *\n * `md-stretch-tabs` | mobile | desktop\n * ------------------|-----------|--------\n * `auto` | stretched | ---\n * `always` | stretched | stretched\n * `never` | --- | ---\n *\n * @param {integer=} md-selected Index of the active/selected tab\n * @param {boolean=} md-no-ink If present, disables ink ripple effects.\n * @param {boolean=} md-no-ink-bar If present, disables the selection ink bar.\n * @param {string=} md-align-tabs Attribute to indicate position of tab buttons: `bottom` or `top`; default is `top`\n * @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`, `always`, or `never`; default is `auto`\n * @param {boolean=} md-dynamic-height When enabled, the tab wrapper will resize based on the contents of the selected tab\n * @param {boolean=} md-border-bottom If present, shows a solid `1px` border between the tabs and their content\n * @param {boolean=} md-center-tabs When enabled, tabs will be centered provided there is no need for pagination\n * @param {boolean=} md-no-pagination When enabled, pagination will remain off\n * @param {boolean=} md-swipe-content When enabled, swipe gestures will be enabled for the content area to jump between tabs\n * @param {boolean=} md-enable-disconnect When enabled, scopes will be disconnected for tabs that are not being displayed. This provides a performance boost, but may also cause unexpected issues and is not recommended for most users.\n * @param {boolean=} md-autoselect When present, any tabs added after the initial load will be automatically selected\n * @param {boolean=} md-no-select-click When enabled, click events will not be fired when selecting tabs\n *\n * @usage\n * <hljs lang=\"html\">\n * <md-tabs md-selected=\"selectedIndex\" >\n * <img ng-src=\"img/angular.png\" class=\"centered\">\n * <md-tab\n * ng-repeat=\"tab in tabs | orderBy:predicate:reversed\"\n * md-on-select=\"onTabSelected(tab)\"\n * md-on-deselect=\"announceDeselected(tab)\"\n * ng-disabled=\"tab.disabled\">\n * <md-tab-label>\n * {{tab.title}}\n * <img src=\"img/removeTab.png\" ng-click=\"removeTab(tab)\" class=\"delete\">\n * </md-tab-label>\n * <md-tab-body>\n * {{tab.content}}\n * </md-tab-body>\n * </md-tab>\n * </md-tabs>\n * </hljs>\n *\n */\nangular\n .module('material.components.tabs')\n .directive('mdTabs', MdTabs);\n\nfunction MdTabs () {\n return {\n scope: {\n selectedIndex: '=?mdSelected'\n },\n template: function (element, attr) {\n attr[ \"$mdTabsTemplate\" ] = element.html();\n return '' +\n '<md-tabs-wrapper> ' +\n '<md-tab-data></md-tab-data> ' +\n '<md-prev-button ' +\n 'tabindex=\"-1\" ' +\n 'role=\"button\" ' +\n 'aria-label=\"Previous Page\" ' +\n 'aria-disabled=\"{{!$mdTabsCtrl.canPageBack()}}\" ' +\n 'ng-class=\"{ \\'md-disabled\\': !$mdTabsCtrl.canPageBack() }\" ' +\n 'ng-if=\"$mdTabsCtrl.shouldPaginate\" ' +\n 'ng-click=\"$mdTabsCtrl.previousPage()\"> ' +\n '<md-icon md-svg-icon=\"md-tabs-arrow\"></md-icon> ' +\n '</md-prev-button> ' +\n '<md-next-button ' +\n 'tabindex=\"-1\" ' +\n 'role=\"button\" ' +\n 'aria-label=\"Next Page\" ' +\n 'aria-disabled=\"{{!$mdTabsCtrl.canPageForward()}}\" ' +\n 'ng-class=\"{ \\'md-disabled\\': !$mdTabsCtrl.canPageForward() }\" ' +\n 'ng-if=\"$mdTabsCtrl.shouldPaginate\" ' +\n 'ng-click=\"$mdTabsCtrl.nextPage()\"> ' +\n '<md-icon md-svg-icon=\"md-tabs-arrow\"></md-icon> ' +\n '</md-next-button> ' +\n '<md-tabs-canvas ' +\n 'tabindex=\"{{ $mdTabsCtrl.hasFocus ? -1 : 0 }}\" ' +\n 'aria-activedescendant=\"tab-item-{{$mdTabsCtrl.tabs[$mdTabsCtrl.focusIndex].id}}\" ' +\n 'ng-focus=\"$mdTabsCtrl.redirectFocus()\" ' +\n 'ng-class=\"{ ' +\n '\\'md-paginated\\': $mdTabsCtrl.shouldPaginate, ' +\n '\\'md-center-tabs\\': $mdTabsCtrl.shouldCenterTabs ' +\n '}\" ' +\n 'ng-keydown=\"$mdTabsCtrl.keydown($event)\" ' +\n 'role=\"tablist\"> ' +\n '<md-pagination-wrapper ' +\n 'ng-class=\"{ \\'md-center-tabs\\': $mdTabsCtrl.shouldCenterTabs }\" ' +\n 'md-tab-scroll=\"$mdTabsCtrl.scroll($event)\"> ' +\n '<md-tab-item ' +\n 'tabindex=\"-1\" ' +\n 'class=\"md-tab\" ' +\n 'ng-repeat=\"tab in $mdTabsCtrl.tabs\" ' +\n 'role=\"tab\" ' +\n 'aria-controls=\"tab-content-{{::tab.id}}\" ' +\n 'aria-selected=\"{{tab.isActive()}}\" ' +\n 'aria-disabled=\"{{tab.scope.disabled || \\'false\\'}}\" ' +\n 'ng-click=\"$mdTabsCtrl.select(tab.getIndex())\" ' +\n 'ng-class=\"{ ' +\n '\\'md-active\\': tab.isActive(), ' +\n '\\'md-focused\\': tab.hasFocus(), ' +\n '\\'md-disabled\\': tab.scope.disabled ' +\n '}\" ' +\n 'ng-disabled=\"tab.scope.disabled\" ' +\n 'md-swipe-left=\"$mdTabsCtrl.nextPage()\" ' +\n 'md-swipe-right=\"$mdTabsCtrl.previousPage()\" ' +\n 'md-tabs-template=\"::tab.label\" ' +\n 'md-scope=\"::tab.parent\"></md-tab-item> ' +\n '<md-ink-bar></md-ink-bar> ' +\n '</md-pagination-wrapper> ' +\n '<div class=\"md-visually-hidden md-dummy-wrapper\"> ' +\n '<md-dummy-tab ' +\n 'class=\"md-tab\" ' +\n 'tabindex=\"-1\" ' +\n 'id=\"tab-item-{{::tab.id}}\" ' +\n 'role=\"tab\" ' +\n 'aria-controls=\"tab-content-{{::tab.id}}\" ' +\n 'aria-selected=\"{{tab.isActive()}}\" ' +\n 'aria-disabled=\"{{tab.scope.disabled || \\'false\\'}}\" ' +\n 'ng-focus=\"$mdTabsCtrl.hasFocus = true\" ' +\n 'ng-blur=\"$mdTabsCtrl.hasFocus = false\" ' +\n 'ng-repeat=\"tab in $mdTabsCtrl.tabs\" ' +\n 'md-tabs-template=\"::tab.label\" ' +\n 'md-scope=\"::tab.parent\"></md-dummy-tab> ' +\n '</div> ' +\n '</md-tabs-canvas> ' +\n '</md-tabs-wrapper> ' +\n '<md-tabs-content-wrapper ng-show=\"$mdTabsCtrl.hasContent && $mdTabsCtrl.selectedIndex >= 0\"> ' +\n '<md-tab-content ' +\n 'id=\"tab-content-{{::tab.id}}\" ' +\n 'role=\"tabpanel\" ' +\n 'aria-labelledby=\"tab-item-{{::tab.id}}\" ' +\n 'md-swipe-left=\"$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(1)\" ' +\n 'md-swipe-right=\"$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(-1)\" ' +\n 'ng-if=\"$mdTabsCtrl.hasContent\" ' +\n 'ng-repeat=\"(index, tab) in $mdTabsCtrl.tabs\" ' +\n 'ng-class=\"{ ' +\n '\\'md-no-transition\\': $mdTabsCtrl.lastSelectedIndex == null, ' +\n '\\'md-active\\': tab.isActive(), ' +\n '\\'md-left\\': tab.isLeft(), ' +\n '\\'md-right\\': tab.isRight(), ' +\n '\\'md-no-scroll\\': $mdTabsCtrl.dynamicHeight ' +\n '}\"> ' +\n '<div ' +\n 'md-tabs-template=\"::tab.template\" ' +\n 'md-connected-if=\"tab.isActive()\" ' +\n 'md-scope=\"::tab.parent\" ' +\n 'ng-if=\"$mdTabsCtrl.enableDisconnect || tab.shouldRender()\"></div> ' +\n '</md-tab-content> ' +\n '</md-tabs-content-wrapper>';\n },\n controller: 'MdTabsController',\n controllerAs: '$mdTabsCtrl',\n bindToController: true\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.components.tabs')\n .directive('mdTabsTemplate', MdTabsTemplate);\n\nfunction MdTabsTemplate ($compile, $mdUtil) {\n return {\n restrict: 'A',\n link: link,\n scope: {\n template: '=mdTabsTemplate',\n connected: '=?mdConnectedIf',\n compileScope: '=mdScope'\n },\n require: '^?mdTabs'\n };\n function link (scope, element, attr, ctrl) {\n if (!ctrl) return;\n var compileScope = ctrl.enableDisconnect ? scope.compileScope.$new() : scope.compileScope;\n element.html(scope.template);\n $compile(element.contents())(compileScope);\n element.on('DOMSubtreeModified', function () {\n ctrl.updatePagination();\n ctrl.updateInkBarStyles();\n });\n return $mdUtil.nextTick(handleScope);\n\n function handleScope () {\n scope.$watch('connected', function (value) { value === false ? disconnect() : reconnect(); });\n scope.$on('$destroy', reconnect);\n }\n\n function disconnect () {\n if (ctrl.enableDisconnect) $mdUtil.disconnectScope(compileScope);\n }\n\n function reconnect () {\n if (ctrl.enableDisconnect) $mdUtil.reconnectScope(compileScope);\n }\n }\n}\nMdTabsTemplate.$inject = [\"$compile\", \"$mdUtil\"];\n\n})();\n(function(){ \nangular.module(\"material.core\").constant(\"$MD_THEME_CSS\", \"/* Only used with Theme processes */html.md-THEME_NAME-theme, body.md-THEME_NAME-theme { color: '{{foreground-1}}'; background-color: '{{background-color}}'; }md-autocomplete.md-THEME_NAME-theme { background: '{{background-50}}'; } md-autocomplete.md-THEME_NAME-theme[disabled] { background: '{{background-100}}'; } md-autocomplete.md-THEME_NAME-theme button md-icon path { fill: '{{background-600}}'; } md-autocomplete.md-THEME_NAME-theme button:after { background: '{{background-600-0.3}}'; }.md-autocomplete-suggestions-container.md-THEME_NAME-theme { background: '{{background-50}}'; } .md-autocomplete-suggestions-container.md-THEME_NAME-theme li { color: '{{background-900}}'; } .md-autocomplete-suggestions-container.md-THEME_NAME-theme li .highlight { color: '{{background-600}}'; } .md-autocomplete-suggestions-container.md-THEME_NAME-theme li:hover, .md-autocomplete-suggestions-container.md-THEME_NAME-theme li.selected { background: '{{background-200}}'; }md-backdrop { background-color: '{{background-900-0.0}}'; } md-backdrop.md-opaque.md-THEME_NAME-theme { background-color: '{{background-900-1.0}}'; }md-bottom-sheet.md-THEME_NAME-theme { background-color: '{{background-50}}'; border-top-color: '{{background-300}}'; } md-bottom-sheet.md-THEME_NAME-theme.md-list md-list-item { color: '{{foreground-1}}'; } md-bottom-sheet.md-THEME_NAME-theme .md-subheader { background-color: '{{background-50}}'; } md-bottom-sheet.md-THEME_NAME-theme .md-subheader { color: '{{foreground-1}}'; }a.md-button.md-THEME_NAME-theme:not([disabled]):hover,.md-button.md-THEME_NAME-theme:not([disabled]):hover { background-color: '{{background-500-0.2}}'; }a.md-button.md-THEME_NAME-theme:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme:not([disabled]).md-focused { background-color: '{{background-500-0.2}}'; }a.md-button.md-THEME_NAME-theme:not([disabled]).md-icon-button:hover,.md-button.md-THEME_NAME-theme:not([disabled]).md-icon-button:hover { background-color: transparent; }a.md-button.md-THEME_NAME-theme.md-fab,.md-button.md-THEME_NAME-theme.md-fab { background-color: '{{accent-color}}'; color: '{{accent-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-fab md-icon, .md-button.md-THEME_NAME-theme.md-fab md-icon { color: '{{accent-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-fab:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-fab:not([disabled]):hover { background-color: '{{accent-color}}'; } a.md-button.md-THEME_NAME-theme.md-fab:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-fab:not([disabled]).md-focused { background-color: '{{accent-A700}}'; }a.md-button.md-THEME_NAME-theme.md-primary,.md-button.md-THEME_NAME-theme.md-primary { color: '{{primary-color}}'; } a.md-button.md-THEME_NAME-theme.md-primary.md-raised, a.md-button.md-THEME_NAME-theme.md-primary.md-fab, .md-button.md-THEME_NAME-theme.md-primary.md-raised, .md-button.md-THEME_NAME-theme.md-primary.md-fab { color: '{{primary-contrast}}'; background-color: '{{primary-color}}'; } a.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]) md-icon, a.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]) md-icon { color: '{{primary-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]):hover, a.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]):hover { background-color: '{{primary-color}}'; } a.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]).md-focused, a.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]).md-focused { background-color: '{{primary-600}}'; } a.md-button.md-THEME_NAME-theme.md-primary:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-primary:not([disabled]) md-icon { color: '{{primary-color}}'; }a.md-button.md-THEME_NAME-theme.md-fab,.md-button.md-THEME_NAME-theme.md-fab { background-color: '{{accent-color}}'; color: '{{accent-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-fab:not([disabled]) .md-icon, .md-button.md-THEME_NAME-theme.md-fab:not([disabled]) .md-icon { color: '{{accent-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-fab:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-fab:not([disabled]):hover { background-color: '{{accent-color}}'; } a.md-button.md-THEME_NAME-theme.md-fab:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-fab:not([disabled]).md-focused { background-color: '{{accent-A700}}'; }a.md-button.md-THEME_NAME-theme.md-raised,.md-button.md-THEME_NAME-theme.md-raised { color: '{{background-900}}'; background-color: '{{background-50}}'; } a.md-button.md-THEME_NAME-theme.md-raised:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-raised:not([disabled]) md-icon { color: '{{background-900}}'; } a.md-button.md-THEME_NAME-theme.md-raised:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-raised:not([disabled]):hover { background-color: '{{background-50}}'; } a.md-button.md-THEME_NAME-theme.md-raised:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-raised:not([disabled]).md-focused { background-color: '{{background-200}}'; }a.md-button.md-THEME_NAME-theme.md-warn,.md-button.md-THEME_NAME-theme.md-warn { color: '{{warn-color}}'; } a.md-button.md-THEME_NAME-theme.md-warn.md-raised, a.md-button.md-THEME_NAME-theme.md-warn.md-fab, .md-button.md-THEME_NAME-theme.md-warn.md-raised, .md-button.md-THEME_NAME-theme.md-warn.md-fab { color: '{{warn-contrast}}'; background-color: '{{warn-color}}'; } a.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]) md-icon, a.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]) md-icon { color: '{{warn-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]):hover, a.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]):hover { background-color: '{{warn-color}}'; } a.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]).md-focused, a.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]).md-focused { background-color: '{{warn-700}}'; } a.md-button.md-THEME_NAME-theme.md-warn:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-warn:not([disabled]) md-icon { color: '{{warn-color}}'; }a.md-button.md-THEME_NAME-theme.md-accent,.md-button.md-THEME_NAME-theme.md-accent { color: '{{accent-color}}'; } a.md-button.md-THEME_NAME-theme.md-accent.md-raised, a.md-button.md-THEME_NAME-theme.md-accent.md-fab, .md-button.md-THEME_NAME-theme.md-accent.md-raised, .md-button.md-THEME_NAME-theme.md-accent.md-fab { color: '{{accent-contrast}}'; background-color: '{{accent-color}}'; } a.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]) md-icon, a.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]) md-icon { color: '{{accent-contrast}}'; } a.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]):hover, a.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]):hover, .md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]):hover { background-color: '{{accent-color}}'; } a.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]).md-focused, a.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]).md-focused, .md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]).md-focused { background-color: '{{accent-700}}'; } a.md-button.md-THEME_NAME-theme.md-accent:not([disabled]) md-icon, .md-button.md-THEME_NAME-theme.md-accent:not([disabled]) md-icon { color: '{{accent-color}}'; }a.md-button.md-THEME_NAME-theme[disabled], a.md-button.md-THEME_NAME-theme.md-raised[disabled], a.md-button.md-THEME_NAME-theme.md-fab[disabled], a.md-button.md-THEME_NAME-theme.md-accent[disabled], a.md-button.md-THEME_NAME-theme.md-warn[disabled],.md-button.md-THEME_NAME-theme[disabled],.md-button.md-THEME_NAME-theme.md-raised[disabled],.md-button.md-THEME_NAME-theme.md-fab[disabled],.md-button.md-THEME_NAME-theme.md-accent[disabled],.md-button.md-THEME_NAME-theme.md-warn[disabled] { color: '{{foreground-3}}' !important; cursor: default; } a.md-button.md-THEME_NAME-theme[disabled] md-icon, a.md-button.md-THEME_NAME-theme.md-raised[disabled] md-icon, a.md-button.md-THEME_NAME-theme.md-fab[disabled] md-icon, a.md-button.md-THEME_NAME-theme.md-accent[disabled] md-icon, a.md-button.md-THEME_NAME-theme.md-warn[disabled] md-icon, .md-button.md-THEME_NAME-theme[disabled] md-icon, .md-button.md-THEME_NAME-theme.md-raised[disabled] md-icon, .md-button.md-THEME_NAME-theme.md-fab[disabled] md-icon, .md-button.md-THEME_NAME-theme.md-accent[disabled] md-icon, .md-button.md-THEME_NAME-theme.md-warn[disabled] md-icon { color: '{{foreground-3}}'; }a.md-button.md-THEME_NAME-theme.md-raised[disabled], a.md-button.md-THEME_NAME-theme.md-fab[disabled],.md-button.md-THEME_NAME-theme.md-raised[disabled],.md-button.md-THEME_NAME-theme.md-fab[disabled] { background-color: '{{foreground-4}}'; }a.md-button.md-THEME_NAME-theme[disabled],.md-button.md-THEME_NAME-theme[disabled] { background-color: transparent; }md-card.md-THEME_NAME-theme { background-color: '{{background-color}}'; border-radius: 2px; } md-card.md-THEME_NAME-theme .md-card-image { border-radius: 2px 2px 0 0; } md-card.md-THEME_NAME-theme md-card-header md-card-avatar md-icon { color: '{{background-color}}'; background-color: '{{foreground-3}}'; } md-card.md-THEME_NAME-theme md-card-header md-card-header-text .md-subhead { color: '{{foreground-2}}'; } md-card.md-THEME_NAME-theme md-card-title md-card-title-text:not(:only-child) .md-subhead { color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme .md-ripple { color: '{{accent-600}}'; }md-checkbox.md-THEME_NAME-theme.md-checked .md-ripple { color: '{{background-600}}'; }md-checkbox.md-THEME_NAME-theme.md-checked.md-focused .md-container:before { background-color: '{{accent-color-0.26}}'; }md-checkbox.md-THEME_NAME-theme .md-ink-ripple { color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme.md-checked .md-ink-ripple { color: '{{accent-color-0.87}}'; }md-checkbox.md-THEME_NAME-theme .md-icon { border-color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme.md-checked .md-icon { background-color: '{{accent-color-0.87}}'; }md-checkbox.md-THEME_NAME-theme.md-checked .md-icon:after { border-color: '{{accent-contrast-0.87}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ripple { color: '{{primary-600}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ripple { color: '{{background-600}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ink-ripple { color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple { color: '{{primary-color-0.87}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-icon { border-color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon { background-color: '{{primary-color-0.87}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked.md-focused .md-container:before { background-color: '{{primary-color-0.26}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon:after { border-color: '{{primary-contrast-0.87}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-indeterminate[disabled] .md-container { color: '{{foreground-3}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ripple { color: '{{warn-600}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ink-ripple { color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple { color: '{{warn-color-0.87}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-icon { border-color: '{{foreground-2}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon { background-color: '{{warn-color-0.87}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked.md-focused:not([disabled]) .md-container:before { background-color: '{{warn-color-0.26}}'; }md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon:after { border-color: '{{background-200}}'; }md-checkbox.md-THEME_NAME-theme[disabled] .md-icon { border-color: '{{foreground-3}}'; }md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon { background-color: '{{foreground-3}}'; }md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon:after { border-color: '{{background-200}}'; }md-checkbox.md-THEME_NAME-theme[disabled] .md-label { color: '{{foreground-3}}'; }md-chips.md-THEME_NAME-theme .md-chips { box-shadow: 0 1px '{{background-300}}'; } md-chips.md-THEME_NAME-theme .md-chips.md-focused { box-shadow: 0 2px '{{primary-color}}'; }md-chips.md-THEME_NAME-theme .md-chip { background: '{{background-300}}'; color: '{{background-800}}'; } md-chips.md-THEME_NAME-theme .md-chip.md-focused { background: '{{primary-color}}'; color: '{{primary-contrast}}'; } md-chips.md-THEME_NAME-theme .md-chip.md-focused md-icon { color: '{{primary-contrast}}'; }md-chips.md-THEME_NAME-theme md-chip-remove .md-button md-icon path { fill: '{{background-500}}'; }.md-contact-suggestion span.md-contact-email { color: '{{background-400}}'; }md-content.md-THEME_NAME-theme { color: '{{foreground-1}}'; background-color: '{{background-color}}'; }/** Theme styles for mdCalendar. */.md-calendar.md-THEME_NAME-theme { color: '{{foreground-1}}'; } .md-calendar.md-THEME_NAME-theme tr:last-child td { border-bottom-color: '{{background-200}}'; }.md-THEME_NAME-theme .md-calendar-day-header { background: '{{background-hue-1}}'; color: '{{foreground-1}}'; }.md-THEME_NAME-theme .md-calendar-date.md-calendar-date-today .md-calendar-date-selection-indicator { border: 1px solid '{{primary-500}}'; }.md-THEME_NAME-theme .md-calendar-date.md-calendar-date-today.md-calendar-date-disabled { color: '{{primary-500-0.6}}'; }.md-THEME_NAME-theme .md-calendar-date.md-focus .md-calendar-date-selection-indicator { background: '{{background-hue-1}}'; }.md-THEME_NAME-theme .md-calendar-date-selection-indicator:hover { background: '{{background-hue-1}}'; }.md-THEME_NAME-theme .md-calendar-date.md-calendar-selected-date .md-calendar-date-selection-indicator,.md-THEME_NAME-theme .md-calendar-date.md-focus.md-calendar-selected-date .md-calendar-date-selection-indicator { background: '{{primary-500}}'; color: '{{primary-500-contrast}}'; border-color: transparent; }.md-THEME_NAME-theme .md-calendar-date-disabled,.md-THEME_NAME-theme .md-calendar-month-label-disabled { color: '{{foreground-3}}'; }/** Theme styles for mdDatepicker. */md-datepicker.md-THEME_NAME-theme { background: '{{background-color}}'; }.md-THEME_NAME-theme .md-datepicker-input { color: '{{background-contrast}}'; background: '{{background-color}}'; } .md-THEME_NAME-theme .md-datepicker-input::-webkit-input-placeholder, .md-THEME_NAME-theme .md-datepicker-input::-moz-placeholder, .md-THEME_NAME-theme .md-datepicker-input:-moz-placeholder, .md-THEME_NAME-theme .md-datepicker-input:-ms-input-placeholder { color: \\\"{{foreground-3}}\\\"; }.md-THEME_NAME-theme .md-datepicker-input-container { border-bottom-color: '{{background-300}}'; } .md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused { border-bottom-color: '{{primary-500}}'; } .md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-invalid { border-bottom-color: '{{warn-A700}}'; }.md-THEME_NAME-theme .md-datepicker-calendar-pane { border-color: '{{background-300}}'; }.md-THEME_NAME-theme .md-datepicker-triangle-button .md-datepicker-expand-triangle { border-top-color: '{{foreground-3}}'; }.md-THEME_NAME-theme .md-datepicker-triangle-button:hover .md-datepicker-expand-triangle { border-top-color: '{{foreground-2}}'; }.md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon { fill: '{{primary-500}}'; }.md-THEME_NAME-theme .md-datepicker-calendar,.md-THEME_NAME-theme .md-datepicker-input-mask-opaque { background: '{{background-color}}'; }md-dialog.md-THEME_NAME-theme { border-radius: 4px; background-color: '{{background-color}}'; } md-dialog.md-THEME_NAME-theme.md-content-overflow .md-actions, md-dialog.md-THEME_NAME-theme.md-content-overflow md-dialog-actions { border-top-color: '{{foreground-4}}'; }md-divider.md-THEME_NAME-theme { border-top-color: '{{foreground-4}}'; }.layout-row > md-divider.md-THEME_NAME-theme { border-right-color: '{{foreground-4}}'; }md-icon.md-THEME_NAME-theme { color: '{{foreground-2}}'; } md-icon.md-THEME_NAME-theme.md-primary { color: '{{primary-color}}'; } md-icon.md-THEME_NAME-theme.md-accent { color: '{{accent-color}}'; } md-icon.md-THEME_NAME-theme.md-warn { color: '{{warn-color}}'; }md-input-container.md-THEME_NAME-theme .md-input { color: '{{foreground-1}}'; border-color: '{{foreground-4}}'; text-shadow: '{{foreground-shadow}}'; } md-input-container.md-THEME_NAME-theme .md-input::-webkit-input-placeholder, md-input-container.md-THEME_NAME-theme .md-input::-moz-placeholder, md-input-container.md-THEME_NAME-theme .md-input:-moz-placeholder, md-input-container.md-THEME_NAME-theme .md-input:-ms-input-placeholder { color: \\\"{{foreground-3}}\\\"; }md-input-container.md-THEME_NAME-theme > md-icon { color: '{{foreground-1}}'; }md-input-container.md-THEME_NAME-theme label,md-input-container.md-THEME_NAME-theme .md-placeholder { text-shadow: '{{foreground-shadow}}'; color: '{{foreground-3}}'; }md-input-container.md-THEME_NAME-theme ng-messages, md-input-container.md-THEME_NAME-theme [ng-messages],md-input-container.md-THEME_NAME-theme ng-message, md-input-container.md-THEME_NAME-theme data-ng-message, md-input-container.md-THEME_NAME-theme x-ng-message,md-input-container.md-THEME_NAME-theme [ng-message], md-input-container.md-THEME_NAME-theme [data-ng-message], md-input-container.md-THEME_NAME-theme [x-ng-message],md-input-container.md-THEME_NAME-theme [ng-message-exp], md-input-container.md-THEME_NAME-theme [data-ng-message-exp], md-input-container.md-THEME_NAME-theme [x-ng-message-exp] { color: '{{warn-A700}}'; } md-input-container.md-THEME_NAME-theme ng-messages .md-char-counter, md-input-container.md-THEME_NAME-theme [ng-messages] .md-char-counter, md-input-container.md-THEME_NAME-theme ng-message .md-char-counter, md-input-container.md-THEME_NAME-theme data-ng-message .md-char-counter, md-input-container.md-THEME_NAME-theme x-ng-message .md-char-counter, md-input-container.md-THEME_NAME-theme [ng-message] .md-char-counter, md-input-container.md-THEME_NAME-theme [data-ng-message] .md-char-counter, md-input-container.md-THEME_NAME-theme [x-ng-message] .md-char-counter, md-input-container.md-THEME_NAME-theme [ng-message-exp] .md-char-counter, md-input-container.md-THEME_NAME-theme [data-ng-message-exp] .md-char-counter, md-input-container.md-THEME_NAME-theme [x-ng-message-exp] .md-char-counter { color: '{{foreground-1}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-has-value label { color: '{{foreground-2}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused .md-input { border-color: '{{primary-500}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused label { color: '{{primary-500}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused md-icon { color: '{{primary-500}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent .md-input { border-color: '{{accent-500}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent label { color: '{{accent-500}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn .md-input { border-color: '{{warn-A700}}'; }md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn label { color: '{{warn-A700}}'; }md-input-container.md-THEME_NAME-theme.md-input-invalid .md-input { border-color: '{{warn-A700}}'; }md-input-container.md-THEME_NAME-theme.md-input-invalid.md-input-focused label { color: '{{warn-A700}}'; }md-input-container.md-THEME_NAME-theme.md-input-invalid ng-message, md-input-container.md-THEME_NAME-theme.md-input-invalid data-ng-message, md-input-container.md-THEME_NAME-theme.md-input-invalid x-ng-message,md-input-container.md-THEME_NAME-theme.md-input-invalid [ng-message], md-input-container.md-THEME_NAME-theme.md-input-invalid [data-ng-message], md-input-container.md-THEME_NAME-theme.md-input-invalid [x-ng-message],md-input-container.md-THEME_NAME-theme.md-input-invalid [ng-message-exp], md-input-container.md-THEME_NAME-theme.md-input-invalid [data-ng-message-exp], md-input-container.md-THEME_NAME-theme.md-input-invalid [x-ng-message-exp],md-input-container.md-THEME_NAME-theme.md-input-invalid .md-char-counter { color: '{{warn-A700}}'; }md-input-container.md-THEME_NAME-theme .md-input[disabled],md-input-container.md-THEME_NAME-theme .md-input [disabled] { border-bottom-color: transparent; color: '{{foreground-3}}'; background-image: linear-gradient(to right, \\\"{{foreground-3}}\\\" 0%, \\\"{{foreground-3}}\\\" 33%, transparent 0%); background-image: -ms-linear-gradient(left, transparent 0%, \\\"{{foreground-3}}\\\" 100%); }md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text h3, md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text h4,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text h3,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text h4 { color: '{{foreground-1}}'; }md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text p,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text p { color: '{{foreground-2}}'; }md-list.md-THEME_NAME-theme .md-proxy-focus.md-focused div.md-no-style { background-color: '{{background-100}}'; }md-list.md-THEME_NAME-theme md-list-item > .md-avatar-icon { background-color: '{{foreground-3}}'; color: '{{background-color}}'; }md-list.md-THEME_NAME-theme md-list-item > md-icon { color: '{{foreground-2}}'; } md-list.md-THEME_NAME-theme md-list-item > md-icon.md-highlight { color: '{{primary-color}}'; } md-list.md-THEME_NAME-theme md-list-item > md-icon.md-highlight.md-accent { color: '{{accent-color}}'; }md-menu-content.md-THEME_NAME-theme { background-color: '{{background-color}}'; } md-menu-content.md-THEME_NAME-theme md-menu-divider { background-color: '{{foreground-4}}'; }md-menu-bar.md-THEME_NAME-theme > button.md-button { color: '{{foreground-2}}'; border-radius: 2px; }md-menu-bar.md-THEME_NAME-theme md-menu.md-open > button, md-menu-bar.md-THEME_NAME-theme md-menu > button:focus { outline: none; background: '{{background-200}}'; }md-menu-bar.md-THEME_NAME-theme.md-open:not(.md-keyboard-mode) md-menu:hover > button { background-color: '{{ background-500-0.2}}'; }md-menu-bar.md-THEME_NAME-theme:not(.md-keyboard-mode):not(.md-open) md-menu button:hover,md-menu-bar.md-THEME_NAME-theme:not(.md-keyboard-mode):not(.md-open) md-menu button:focus { background: transparent; }md-menu-content.md-THEME_NAME-theme .md-menu > .md-button:after { color: '{{foreground-2}}'; }md-menu-content.md-THEME_NAME-theme .md-menu.md-open > .md-button { background-color: '{{ background-500-0.2}}'; }md-toolbar.md-THEME_NAME-theme.md-menu-toolbar { background-color: '{{background-color}}'; color: '{{foreground-1}}'; } md-toolbar.md-THEME_NAME-theme.md-menu-toolbar md-toolbar-filler { background-color: '{{primary-color}}'; color: '{{primary-contrast}}'; } md-toolbar.md-THEME_NAME-theme.md-menu-toolbar md-toolbar-filler md-icon { color: '{{primary-contrast}}'; }.md-panel { background-color: '{{background-900-0.0}}'; } .md-panel._md-panel-backdrop.md-THEME_NAME-theme { background-color: '{{background-900-1.0}}'; }md-progress-circular.md-THEME_NAME-theme { background-color: transparent; } md-progress-circular.md-THEME_NAME-theme .md-inner .md-gap { border-top-color: '{{primary-color}}'; border-bottom-color: '{{primary-color}}'; } md-progress-circular.md-THEME_NAME-theme .md-inner .md-left .md-half-circle, md-progress-circular.md-THEME_NAME-theme .md-inner .md-right .md-half-circle { border-top-color: '{{primary-color}}'; } md-progress-circular.md-THEME_NAME-theme .md-inner .md-right .md-half-circle { border-right-color: '{{primary-color}}'; } md-progress-circular.md-THEME_NAME-theme .md-inner .md-left .md-half-circle { border-left-color: '{{primary-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-warn .md-inner .md-gap { border-top-color: '{{warn-color}}'; border-bottom-color: '{{warn-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-warn .md-inner .md-left .md-half-circle, md-progress-circular.md-THEME_NAME-theme.md-warn .md-inner .md-right .md-half-circle { border-top-color: '{{warn-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-warn .md-inner .md-right .md-half-circle { border-right-color: '{{warn-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-warn .md-inner .md-left .md-half-circle { border-left-color: '{{warn-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-accent .md-inner .md-gap { border-top-color: '{{accent-color}}'; border-bottom-color: '{{accent-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-accent .md-inner .md-left .md-half-circle, md-progress-circular.md-THEME_NAME-theme.md-accent .md-inner .md-right .md-half-circle { border-top-color: '{{accent-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-accent .md-inner .md-right .md-half-circle { border-right-color: '{{accent-color}}'; } md-progress-circular.md-THEME_NAME-theme.md-accent .md-inner .md-left .md-half-circle { border-left-color: '{{accent-color}}'; }md-progress-linear.md-THEME_NAME-theme .md-container { background-color: '{{primary-100}}'; }md-progress-linear.md-THEME_NAME-theme .md-bar { background-color: '{{primary-color}}'; }md-progress-linear.md-THEME_NAME-theme.md-warn .md-container { background-color: '{{warn-100}}'; }md-progress-linear.md-THEME_NAME-theme.md-warn .md-bar { background-color: '{{warn-color}}'; }md-progress-linear.md-THEME_NAME-theme.md-accent .md-container { background-color: '{{accent-100}}'; }md-progress-linear.md-THEME_NAME-theme.md-accent .md-bar { background-color: '{{accent-color}}'; }md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-bar1 { background-color: '{{warn-100}}'; }md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-dashed:before { background: radial-gradient(\\\"{{warn-100}}\\\" 0%, \\\"{{warn-100}}\\\" 16%, transparent 42%); }md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-bar1 { background-color: '{{accent-100}}'; }md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-dashed:before { background: radial-gradient(\\\"{{accent-100}}\\\" 0%, \\\"{{accent-100}}\\\" 16%, transparent 42%); }md-radio-button.md-THEME_NAME-theme .md-off { border-color: '{{foreground-2}}'; }md-radio-button.md-THEME_NAME-theme .md-on { background-color: '{{accent-color-0.87}}'; }md-radio-button.md-THEME_NAME-theme.md-checked .md-off { border-color: '{{accent-color-0.87}}'; }md-radio-button.md-THEME_NAME-theme.md-checked .md-ink-ripple { color: '{{accent-color-0.87}}'; }md-radio-button.md-THEME_NAME-theme .md-container .md-ripple { color: '{{accent-600}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-on { background-color: '{{primary-color-0.87}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off { border-color: '{{primary-color-0.87}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple { color: '{{primary-color-0.87}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple { color: '{{primary-600}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-on { background-color: '{{warn-color-0.87}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off { border-color: '{{warn-color-0.87}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple { color: '{{warn-color-0.87}}'; }md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple, md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple { color: '{{warn-600}}'; }md-radio-group.md-THEME_NAME-theme[disabled],md-radio-button.md-THEME_NAME-theme[disabled] { color: '{{foreground-3}}'; } md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-off, md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-off { border-color: '{{foreground-3}}'; } md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-on, md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-on { border-color: '{{foreground-3}}'; }md-radio-group.md-THEME_NAME-theme .md-checked .md-ink-ripple { color: '{{accent-color-0.26}}'; }md-radio-group.md-THEME_NAME-theme.md-primary .md-checked:not([disabled]) .md-ink-ripple, md-radio-group.md-THEME_NAME-theme .md-checked:not([disabled]).md-primary .md-ink-ripple { color: '{{primary-color-0.26}}'; }md-radio-group.md-THEME_NAME-theme .md-checked.md-primary .md-ink-ripple { color: '{{warn-color-0.26}}'; }md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked .md-container:before { background-color: '{{accent-color-0.26}}'; }md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-primary .md-checked .md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-primary .md-container:before { background-color: '{{primary-color-0.26}}'; }md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-warn .md-checked .md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-warn .md-container:before { background-color: '{{warn-color-0.26}}'; }md-select.md-THEME_NAME-theme[disabled] .md-select-value { border-bottom-color: transparent; background-image: linear-gradient(to right, \\\"{{foreground-3}}\\\" 0%, \\\"{{foreground-3}}\\\" 33%, transparent 0%); background-image: -ms-linear-gradient(left, transparent 0%, \\\"{{foreground-3}}\\\" 100%); }md-select.md-THEME_NAME-theme .md-select-value { border-bottom-color: '{{foreground-4}}'; } md-select.md-THEME_NAME-theme .md-select-value.md-select-placeholder { color: '{{foreground-3}}'; }md-select.md-THEME_NAME-theme.ng-invalid.ng-dirty .md-select-value { color: '{{warn-A700}}' !important; border-bottom-color: '{{warn-A700}}' !important; }md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value { border-bottom-color: '{{primary-color}}'; color: '{{ foreground-1 }}'; } md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value.md-select-placeholder { color: '{{ foreground-1 }}'; }md-select.md-THEME_NAME-theme:not([disabled]):focus.md-accent .md-select-value { border-bottom-color: '{{accent-color}}'; }md-select.md-THEME_NAME-theme:not([disabled]):focus.md-warn .md-select-value { border-bottom-color: '{{warn-color}}'; }md-select.md-THEME_NAME-theme[disabled] .md-select-value { color: '{{foreground-3}}'; } md-select.md-THEME_NAME-theme[disabled] .md-select-value.md-select-placeholder { color: '{{foreground-3}}'; }md-select-menu.md-THEME_NAME-theme md-option[disabled] { color: '{{foreground-3}}'; }md-select-menu.md-THEME_NAME-theme md-optgroup { color: '{{foreground-2}}'; } md-select-menu.md-THEME_NAME-theme md-optgroup md-option { color: '{{foreground-1}}'; }md-select-menu.md-THEME_NAME-theme md-option[selected] { color: '{{primary-500}}'; } md-select-menu.md-THEME_NAME-theme md-option[selected]:focus { color: '{{primary-600}}'; } md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent { color: '{{accent-500}}'; } md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent:focus { color: '{{accent-600}}'; }md-select-menu.md-THEME_NAME-theme md-option:focus:not([disabled]):not([selected]) { background: '{{background-200}}'; }.md-checkbox-enabled.md-THEME_NAME-theme .md-ripple { color: '{{primary-600}}'; }.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-ripple { color: '{{background-600}}'; }.md-checkbox-enabled.md-THEME_NAME-theme .md-ink-ripple { color: '{{foreground-2}}'; }.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-ink-ripple { color: '{{primary-color-0.87}}'; }.md-checkbox-enabled.md-THEME_NAME-theme .md-icon { border-color: '{{foreground-2}}'; }.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-icon { background-color: '{{primary-color-0.87}}'; }.md-checkbox-enabled.md-THEME_NAME-theme[selected].md-focused .md-container:before { background-color: '{{primary-color-0.26}}'; }.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-icon:after { border-color: '{{primary-contrast-0.87}}'; }.md-checkbox-enabled.md-THEME_NAME-theme .md-indeterminate[disabled] .md-container { color: '{{foreground-3}}'; }.md-checkbox-enabled.md-THEME_NAME-theme md-option .md-text { color: '{{background-900-0.87}}'; }md-sidenav.md-THEME_NAME-theme { background-color: '{{background-color}}'; }md-slider.md-THEME_NAME-theme .md-track { background-color: '{{foreground-3}}'; }md-slider.md-THEME_NAME-theme .md-track-ticks { background-color: '{{foreground-4}}'; }md-slider.md-THEME_NAME-theme .md-focus-thumb { background-color: '{{foreground-2}}'; }md-slider.md-THEME_NAME-theme .md-focus-ring { background-color: '{{accent-color}}'; }md-slider.md-THEME_NAME-theme .md-disabled-thumb { border-color: '{{background-color}}'; }md-slider.md-THEME_NAME-theme.md-min .md-thumb:after { background-color: '{{background-color}}'; }md-slider.md-THEME_NAME-theme .md-track.md-track-fill { background-color: '{{accent-color}}'; }md-slider.md-THEME_NAME-theme .md-thumb:after { border-color: '{{accent-color}}'; background-color: '{{accent-color}}'; }md-slider.md-THEME_NAME-theme .md-sign { background-color: '{{accent-color}}'; } md-slider.md-THEME_NAME-theme .md-sign:after { border-top-color: '{{accent-color}}'; }md-slider.md-THEME_NAME-theme .md-thumb-text { color: '{{accent-contrast}}'; }md-slider.md-THEME_NAME-theme.md-warn .md-focus-ring { background-color: '{{warn-color}}'; }md-slider.md-THEME_NAME-theme.md-warn .md-track.md-track-fill { background-color: '{{warn-color}}'; }md-slider.md-THEME_NAME-theme.md-warn .md-thumb:after { border-color: '{{warn-color}}'; background-color: '{{warn-color}}'; }md-slider.md-THEME_NAME-theme.md-warn .md-sign { background-color: '{{warn-color}}'; } md-slider.md-THEME_NAME-theme.md-warn .md-sign:after { border-top-color: '{{warn-color}}'; }md-slider.md-THEME_NAME-theme.md-warn .md-thumb-text { color: '{{warn-contrast}}'; }md-slider.md-THEME_NAME-theme.md-primary .md-focus-ring { background-color: '{{primary-color}}'; }md-slider.md-THEME_NAME-theme.md-primary .md-track.md-track-fill { background-color: '{{primary-color}}'; }md-slider.md-THEME_NAME-theme.md-primary .md-thumb:after { border-color: '{{primary-color}}'; background-color: '{{primary-color}}'; }md-slider.md-THEME_NAME-theme.md-primary .md-sign { background-color: '{{primary-color}}'; } md-slider.md-THEME_NAME-theme.md-primary .md-sign:after { border-top-color: '{{primary-color}}'; }md-slider.md-THEME_NAME-theme.md-primary .md-thumb-text { color: '{{primary-contrast}}'; }md-slider.md-THEME_NAME-theme[disabled] .md-thumb:after { border-color: '{{foreground-3}}'; }md-slider.md-THEME_NAME-theme[disabled]:not(.md-min) .md-thumb:after { background-color: '{{foreground-3}}'; }.md-subheader.md-THEME_NAME-theme { color: '{{ foreground-2-0.23 }}'; background-color: '{{background-color}}'; } .md-subheader.md-THEME_NAME-theme.md-primary { color: '{{primary-color}}'; } .md-subheader.md-THEME_NAME-theme.md-accent { color: '{{accent-color}}'; } .md-subheader.md-THEME_NAME-theme.md-warn { color: '{{warn-color}}'; }md-switch.md-THEME_NAME-theme .md-ink-ripple { color: '{{background-500}}'; }md-switch.md-THEME_NAME-theme .md-thumb { background-color: '{{background-50}}'; }md-switch.md-THEME_NAME-theme .md-bar { background-color: '{{background-500}}'; }md-switch.md-THEME_NAME-theme.md-checked .md-ink-ripple { color: '{{accent-color}}'; }md-switch.md-THEME_NAME-theme.md-checked .md-thumb { background-color: '{{accent-color}}'; }md-switch.md-THEME_NAME-theme.md-checked .md-bar { background-color: '{{accent-color-0.5}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-focused .md-thumb:before { background-color: '{{accent-color-0.26}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-ink-ripple { color: '{{primary-color}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-thumb { background-color: '{{primary-color}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-bar { background-color: '{{primary-color-0.5}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-primary.md-focused .md-thumb:before { background-color: '{{primary-color-0.26}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-ink-ripple { color: '{{warn-color}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-thumb { background-color: '{{warn-color}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-bar { background-color: '{{warn-color-0.5}}'; }md-switch.md-THEME_NAME-theme.md-checked.md-warn.md-focused .md-thumb:before { background-color: '{{warn-color-0.26}}'; }md-switch.md-THEME_NAME-theme[disabled] .md-thumb { background-color: '{{background-400}}'; }md-switch.md-THEME_NAME-theme[disabled] .md-bar { background-color: '{{foreground-4}}'; }md-toast.md-THEME_NAME-theme .md-toast-content { background-color: #323232; color: '{{background-50}}'; } md-toast.md-THEME_NAME-theme .md-toast-content .md-button { color: '{{background-50}}'; } md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight { color: '{{primary-A200}}'; } md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-accent { color: '{{accent-A200}}'; } md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-warn { color: '{{warn-A200}}'; }md-tabs.md-THEME_NAME-theme md-tabs-wrapper { background-color: transparent; border-color: '{{foreground-4}}'; }md-tabs.md-THEME_NAME-theme .md-paginator md-icon { color: '{{primary-color}}'; }md-tabs.md-THEME_NAME-theme md-ink-bar { color: '{{accent-color}}'; background: '{{accent-color}}'; }md-tabs.md-THEME_NAME-theme .md-tab { color: '{{foreground-2}}'; } md-tabs.md-THEME_NAME-theme .md-tab[disabled], md-tabs.md-THEME_NAME-theme .md-tab[disabled] md-icon { color: '{{foreground-3}}'; } md-tabs.md-THEME_NAME-theme .md-tab.md-active, md-tabs.md-THEME_NAME-theme .md-tab.md-active md-icon, md-tabs.md-THEME_NAME-theme .md-tab.md-focused, md-tabs.md-THEME_NAME-theme .md-tab.md-focused md-icon { color: '{{primary-color}}'; } md-tabs.md-THEME_NAME-theme .md-tab.md-focused { background: '{{primary-color-0.1}}'; } md-tabs.md-THEME_NAME-theme .md-tab .md-ripple-container { color: '{{accent-100}}'; }md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper { background-color: '{{accent-color}}'; } md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) { color: '{{accent-100}}'; } md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: '{{accent-contrast}}'; } md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused { background: '{{accent-contrast-0.1}}'; } md-tabs.md-THEME_NAME-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-ink-bar { color: '{{primary-600-1}}'; background: '{{primary-600-1}}'; }md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper { background-color: '{{primary-color}}'; } md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) { color: '{{primary-100}}'; } md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: '{{primary-contrast}}'; } md-tabs.md-THEME_NAME-theme.md-primary > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused { background: '{{primary-contrast-0.1}}'; }md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper { background-color: '{{warn-color}}'; } md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) { color: '{{warn-100}}'; } md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: '{{warn-contrast}}'; } md-tabs.md-THEME_NAME-theme.md-warn > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused { background: '{{warn-contrast-0.1}}'; }md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper { background-color: '{{primary-color}}'; } md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) { color: '{{primary-100}}'; } md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: '{{primary-contrast}}'; } md-toolbar > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused { background: '{{primary-contrast-0.1}}'; }md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper { background-color: '{{accent-color}}'; } md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) { color: '{{accent-100}}'; } md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: '{{accent-contrast}}'; } md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused { background: '{{accent-contrast-0.1}}'; } md-toolbar.md-accent > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-ink-bar { color: '{{primary-600-1}}'; background: '{{primary-600-1}}'; }md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper { background-color: '{{warn-color}}'; } md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]) { color: '{{warn-100}}'; } md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: '{{warn-contrast}}'; } md-toolbar.md-warn > md-tabs.md-THEME_NAME-theme > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused { background: '{{warn-contrast-0.1}}'; }md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) { background-color: '{{primary-color}}'; color: '{{primary-contrast}}'; } md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) md-icon { color: '{{primary-contrast}}'; } md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) .md-button:not(.md-raised) { color: '{{primary-contrast}}'; } md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent { background-color: '{{accent-color}}'; color: '{{accent-contrast}}'; } md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-warn { background-color: '{{warn-color}}'; color: '{{warn-contrast}}'; }md-tooltip.md-THEME_NAME-theme { color: '{{background-A100}}'; } md-tooltip.md-THEME_NAME-theme .md-content { background-color: '{{foreground-2}}'; }\"); \n})();\n\n\n})(window, window.angular);;window.ngMaterial={version:{full: \"1.0.9\"}};\n/**\n * @license AngularJS v1.5.11\n * (c) 2010-2017 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\nvar $resourceMinErr = angular.$$minErr('$resource');\n\n// Helper functions and regex to lookup a dotted path on an object\n// stopping at undefined/null. The path must be composed of ASCII\n// identifiers (just like $parse)\nvar MEMBER_NAME_REGEX = /^(\\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;\n\nfunction isValidDottedPath(path) {\n return (path != null && path !== '' && path !== 'hasOwnProperty' &&\n MEMBER_NAME_REGEX.test('.' + path));\n}\n\nfunction lookupDottedPath(obj, path) {\n if (!isValidDottedPath(path)) {\n throw $resourceMinErr('badmember', 'Dotted member path \"@{0}\" is invalid.', path);\n }\n var keys = path.split('.');\n for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) {\n var key = keys[i];\n obj = (obj !== null) ? obj[key] : undefined;\n }\n return obj;\n}\n\n/**\n * Create a shallow copy of an object and clear other fields from the destination\n */\nfunction shallowClearAndCopy(src, dst) {\n dst = dst || {};\n\n angular.forEach(dst, function(value, key) {\n delete dst[key];\n });\n\n for (var key in src) {\n if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n\n return dst;\n}\n\n/**\n * @ngdoc module\n * @name ngResource\n * @description\n *\n * # ngResource\n *\n * The `ngResource` module provides interaction support with RESTful services\n * via the $resource service.\n *\n *\n * <div doc-module-components=\"ngResource\"></div>\n *\n * See {@link ngResource.$resourceProvider} and {@link ngResource.$resource} for usage.\n */\n\n/**\n * @ngdoc provider\n * @name $resourceProvider\n *\n * @description\n *\n * Use `$resourceProvider` to change the default behavior of the {@link ngResource.$resource}\n * service.\n *\n * ## Dependencies\n * Requires the {@link ngResource } module to be installed.\n *\n */\n\n/**\n * @ngdoc service\n * @name $resource\n * @requires $http\n * @requires ng.$log\n * @requires $q\n * @requires ng.$timeout\n *\n * @description\n * A factory which creates a resource object that lets you interact with\n * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.\n *\n * The returned resource object has action methods which provide high-level behaviors without\n * the need to interact with the low level {@link ng.$http $http} service.\n *\n * Requires the {@link ngResource `ngResource`} module to be installed.\n *\n * By default, trailing slashes will be stripped from the calculated URLs,\n * which can pose problems with server backends that do not expect that\n * behavior. This can be disabled by configuring the `$resourceProvider` like\n * this:\n *\n * ```js\n app.config(['$resourceProvider', function($resourceProvider) {\n // Don't strip trailing slashes from calculated URLs\n $resourceProvider.defaults.stripTrailingSlashes = false;\n }]);\n * ```\n *\n * @param {string} url A parameterized URL template with parameters prefixed by `:` as in\n * `/user/:username`. If you are using a URL with a port number (e.g.\n * `http://example.com:8080/api`), it will be respected.\n *\n * If you are using a url with a suffix, just add the suffix, like this:\n * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`\n * or even `$resource('http://example.com/resource/:resource_id.:format')`\n * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be\n * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you\n * can escape it with `/\\.`.\n *\n * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in\n * `actions` methods. If a parameter value is a function, it will be called every time\n * a param value needs to be obtained for a request (unless the param was overridden). The function\n * will be passed the current data value as an argument.\n *\n * Each key value in the parameter object is first bound to url template if present and then any\n * excess keys are appended to the url search query after the `?`.\n *\n * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in\n * URL `/path/greet?salutation=Hello`.\n *\n * If the parameter value is prefixed with `@`, then the value for that parameter will be\n * extracted from the corresponding property on the `data` object (provided when calling a\n * \"non-GET\" action method).\n * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of\n * `someParam` will be `data.someProp`.\n * Note that the parameter will be ignored, when calling a \"GET\" action method (i.e. an action\n * method that does not accept a request body)\n *\n * @param {Object.<Object>=} actions Hash with declaration of custom actions that should extend\n * the default set of resource actions. The declaration should be created in the format of {@link\n * ng.$http#usage $http.config}:\n *\n * {action1: {method:?, params:?, isArray:?, headers:?, ...},\n * action2: {method:?, params:?, isArray:?, headers:?, ...},\n * ...}\n *\n * Where:\n *\n * - **`action`** – {string} – The name of action. This name becomes the name of the method on\n * your resource object.\n * - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,\n * `DELETE`, `JSONP`, etc).\n * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of\n * the parameter value is a function, it will be called every time when a param value needs to\n * be obtained for a request (unless the param was overridden). The function will be passed the\n * current data value as an argument.\n * - **`url`** – {string} – action specific `url` override. The url templating is supported just\n * like for the resource-level urls.\n * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,\n * see `returns` section.\n * - **`transformRequest`** –\n * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –\n * transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * By default, transformRequest will contain one function that checks if the request data is\n * an object and serializes it using `angular.toJson`. To prevent this behavior, set\n * `transformRequest` to an empty array: `transformRequest: []`\n * - **`transformResponse`** –\n * `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –\n * transform function or an array of such functions. The transform function takes the http\n * response body, headers and status and returns its transformed (typically deserialized)\n * version.\n * By default, transformResponse will contain one function that checks if the response looks\n * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior,\n * set `transformResponse` to an empty array: `transformResponse: []`\n * - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the\n * GET request, otherwise if a cache instance built with\n * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for\n * caching.\n * - **`timeout`** – `{number}` – timeout in milliseconds.<br />\n * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are\n * **not** supported in $resource, because the same value would be used for multiple requests.\n * If you are looking for a way to cancel requests, you should use the `cancellable` option.\n * - **`cancellable`** – `{boolean}` – if set to true, the request made by a \"non-instance\" call\n * will be cancelled (if not already completed) by calling `$cancelRequest()` on the call's\n * return value. Calling `$cancelRequest()` for a non-cancellable or an already\n * completed/cancelled request will have no effect.<br />\n * - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the\n * XHR object. See\n * [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)\n * for more information.\n * - **`responseType`** - `{string}` - see\n * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).\n * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -\n * `response` and `responseError`. Both `response` and `responseError` interceptors get called\n * with `http response` object. See {@link ng.$http $http interceptors}.\n *\n * @param {Object} options Hash with custom settings that should extend the\n * default `$resourceProvider` behavior. The supported options are:\n *\n * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing\n * slashes from any calculated URL will be stripped. (Defaults to true.)\n * - **`cancellable`** – {boolean} – If true, the request made by a \"non-instance\" call will be\n * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return value.\n * This can be overwritten per action. (Defaults to false.)\n *\n * @returns {Object} A resource \"class\" object with methods for the default set of resource actions\n * optionally extended with custom `actions`. The default set contains these actions:\n * ```js\n * { 'get': {method:'GET'},\n * 'save': {method:'POST'},\n * 'query': {method:'GET', isArray:true},\n * 'remove': {method:'DELETE'},\n * 'delete': {method:'DELETE'} };\n * ```\n *\n * Calling these methods invoke an {@link ng.$http} with the specified http method,\n * destination and parameters. When the data is returned from the server then the object is an\n * instance of the resource class. The actions `save`, `remove` and `delete` are available on it\n * as methods with the `$` prefix. This allows you to easily perform CRUD operations (create,\n * read, update, delete) on server-side data like this:\n * ```js\n * var User = $resource('/user/:userId', {userId:'@id'});\n * var user = User.get({userId:123}, function() {\n * user.abc = true;\n * user.$save();\n * });\n * ```\n *\n * It is important to realize that invoking a $resource object method immediately returns an\n * empty reference (object or array depending on `isArray`). Once the data is returned from the\n * server the existing reference is populated with the actual data. This is a useful trick since\n * usually the resource is assigned to a model which is then rendered by the view. Having an empty\n * object results in no rendering, once the data arrives from the server then the object is\n * populated with the data and the view automatically re-renders itself showing the new data. This\n * means that in most cases one never has to write a callback function for the action methods.\n *\n * The action methods on the class object or instance object can be invoked with the following\n * parameters:\n *\n * - HTTP GET \"class\" actions: `Resource.action([parameters], [success], [error])`\n * - non-GET \"class\" actions: `Resource.action([parameters], postData, [success], [error])`\n * - non-GET instance actions: `instance.$action([parameters], [success], [error])`\n *\n *\n * Success callback is called with (value (Object|Array), responseHeaders (Function),\n * status (number), statusText (string)) arguments, where the value is the populated resource\n * instance or collection object. The error callback is called with (httpResponse) argument.\n *\n * Class actions return empty instance (with additional properties below).\n * Instance actions return promise of the action.\n *\n * The Resource instances and collections have these additional properties:\n *\n * - `$promise`: the {@link ng.$q promise} of the original server interaction that created this\n * instance or collection.\n *\n * On success, the promise is resolved with the same resource instance or collection object,\n * updated with data from server. This makes it easy to use in\n * {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view\n * rendering until the resource(s) are loaded.\n *\n * On failure, the promise is rejected with the {@link ng.$http http response} object, without\n * the `resource` property.\n *\n * If an interceptor object was provided, the promise will instead be resolved with the value\n * returned by the interceptor.\n *\n * - `$resolved`: `true` after first server interaction is completed (either with success or\n * rejection), `false` before that. Knowing if the Resource has been resolved is useful in\n * data-binding.\n *\n * The Resource instances and collections have these additional methods:\n *\n * - `$cancelRequest`: If there is a cancellable, pending request related to the instance or\n * collection, calling this method will abort the request.\n *\n * The Resource instances have these additional methods:\n *\n * - `toJSON`: It returns a simple object without any of the extra properties added as part of\n * the Resource API. This object can be serialized through {@link angular.toJson} safely\n * without attaching Angular-specific fields. Notice that `JSON.stringify` (and\n * `angular.toJson`) automatically use this method when serializing a Resource instance\n * (see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior)).\n *\n * @example\n *\n * # Credit card resource\n *\n * ```js\n // Define CreditCard class\n var CreditCard = $resource('/user/:userId/card/:cardId',\n {userId:123, cardId:'@id'}, {\n charge: {method:'POST', params:{charge:true}}\n });\n\n // We can retrieve a collection from the server\n var cards = CreditCard.query(function() {\n // GET: /user/123/card\n // server returns: [ {id:456, number:'1234', name:'Smith'} ];\n\n var card = cards[0];\n // each item is an instance of CreditCard\n expect(card instanceof CreditCard).toEqual(true);\n card.name = \"J. Smith\";\n // non GET methods are mapped onto the instances\n card.$save();\n // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}\n // server returns: {id:456, number:'1234', name: 'J. Smith'};\n\n // our custom method is mapped as well.\n card.$charge({amount:9.99});\n // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}\n });\n\n // we can create an instance as well\n var newCard = new CreditCard({number:'0123'});\n newCard.name = \"Mike Smith\";\n newCard.$save();\n // POST: /user/123/card {number:'0123', name:'Mike Smith'}\n // server returns: {id:789, number:'0123', name: 'Mike Smith'};\n expect(newCard.id).toEqual(789);\n * ```\n *\n * The object returned from this function execution is a resource \"class\" which has \"static\" method\n * for each action in the definition.\n *\n * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and\n * `headers`.\n *\n * @example\n *\n * # User resource\n *\n * When the data is returned from the server then the object is an instance of the resource type and\n * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD\n * operations (create, read, update, delete) on server-side data.\n\n ```js\n var User = $resource('/user/:userId', {userId:'@id'});\n User.get({userId:123}, function(user) {\n user.abc = true;\n user.$save();\n });\n ```\n *\n * It's worth noting that the success callback for `get`, `query` and other methods gets passed\n * in the response that came from the server as well as $http header getter function, so one\n * could rewrite the above example and get access to http headers as:\n *\n ```js\n var User = $resource('/user/:userId', {userId:'@id'});\n User.get({userId:123}, function(user, getResponseHeaders){\n user.abc = true;\n user.$save(function(user, putResponseHeaders) {\n //user => saved user object\n //putResponseHeaders => $http header getter\n });\n });\n ```\n *\n * You can also access the raw `$http` promise via the `$promise` property on the object returned\n *\n ```\n var User = $resource('/user/:userId', {userId:'@id'});\n User.get({userId:123})\n .$promise.then(function(user) {\n $scope.user = user;\n });\n ```\n *\n * @example\n *\n * # Creating a custom 'PUT' request\n *\n * In this example we create a custom method on our resource to make a PUT request\n * ```js\n * var app = angular.module('app', ['ngResource', 'ngRoute']);\n *\n * // Some APIs expect a PUT request in the format URL/object/ID\n * // Here we are creating an 'update' method\n * app.factory('Notes', ['$resource', function($resource) {\n * return $resource('/notes/:id', null,\n * {\n * 'update': { method:'PUT' }\n * });\n * }]);\n *\n * // In our controller we get the ID from the URL using ngRoute and $routeParams\n * // We pass in $routeParams and our Notes factory along with $scope\n * app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',\n function($scope, $routeParams, Notes) {\n * // First get a note object from the factory\n * var note = Notes.get({ id:$routeParams.id });\n * $id = note.id;\n *\n * // Now call update passing in the ID first then the object you are updating\n * Notes.update({ id:$id }, note);\n *\n * // This will PUT /notes/ID with the note object in the request payload\n * }]);\n * ```\n *\n * @example\n *\n * # Cancelling requests\n *\n * If an action's configuration specifies that it is cancellable, you can cancel the request related\n * to an instance or collection (as long as it is a result of a \"non-instance\" call):\n *\n ```js\n // ...defining the `Hotel` resource...\n var Hotel = $resource('/api/hotel/:id', {id: '@id'}, {\n // Let's make the `query()` method cancellable\n query: {method: 'get', isArray: true, cancellable: true}\n });\n\n // ...somewhere in the PlanVacationController...\n ...\n this.onDestinationChanged = function onDestinationChanged(destination) {\n // We don't care about any pending request for hotels\n // in a different destination any more\n this.availableHotels.$cancelRequest();\n\n // Let's query for hotels in '<destination>'\n // (calls: /api/hotel?location=<destination>)\n this.availableHotels = Hotel.query({location: destination});\n };\n ```\n *\n */\nangular.module('ngResource', ['ng']).\n provider('$resource', function ResourceProvider() {\n var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\\/\\/[^/]*/;\n\n var provider = this;\n\n /**\n * @ngdoc property\n * @name $resourceProvider#defaults\n * @description\n * Object containing default options used when creating `$resource` instances.\n *\n * The default values satisfy a wide range of usecases, but you may choose to overwrite any of\n * them to further customize your instances. The available properties are:\n *\n * - **stripTrailingSlashes** – `{boolean}` – If true, then the trailing slashes from any\n * calculated URL will be stripped.<br />\n * (Defaults to true.)\n * - **cancellable** – `{boolean}` – If true, the request made by a \"non-instance\" call will be\n * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return\n * value. For more details, see {@link ngResource.$resource}. This can be overwritten per\n * resource class or action.<br />\n * (Defaults to false.)\n * - **actions** - `{Object.<Object>}` - A hash with default actions declarations. Actions are\n * high-level methods corresponding to RESTful actions/methods on resources. An action may\n * specify what HTTP method to use, what URL to hit, if the return value will be a single\n * object or a collection (array) of objects etc. For more details, see\n * {@link ngResource.$resource}. The actions can also be enhanced or overwritten per resource\n * class.<br />\n * The default actions are:\n * ```js\n * {\n * get: {method: 'GET'},\n * save: {method: 'POST'},\n * query: {method: 'GET', isArray: true},\n * remove: {method: 'DELETE'},\n * delete: {method: 'DELETE'}\n * }\n * ```\n *\n * #### Example\n *\n * For example, you can specify a new `update` action that uses the `PUT` HTTP verb:\n *\n * ```js\n * angular.\n * module('myApp').\n * config(['$resourceProvider', function ($resourceProvider) {\n * $resourceProvider.defaults.actions.update = {\n * method: 'PUT'\n * };\n * });\n * ```\n *\n * Or you can even overwrite the whole `actions` list and specify your own:\n *\n * ```js\n * angular.\n * module('myApp').\n * config(['$resourceProvider', function ($resourceProvider) {\n * $resourceProvider.defaults.actions = {\n * create: {method: 'POST'},\n * get: {method: 'GET'},\n * getAll: {method: 'GET', isArray:true},\n * update: {method: 'PUT'},\n * delete: {method: 'DELETE'}\n * };\n * });\n * ```\n *\n */\n this.defaults = {\n // Strip slashes by default\n stripTrailingSlashes: true,\n\n // Make non-instance requests cancellable (via `$cancelRequest()`)\n cancellable: false,\n\n // Default actions configuration\n actions: {\n 'get': {method: 'GET'},\n 'save': {method: 'POST'},\n 'query': {method: 'GET', isArray: true},\n 'remove': {method: 'DELETE'},\n 'delete': {method: 'DELETE'}\n }\n };\n\n this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) {\n\n var noop = angular.noop,\n forEach = angular.forEach,\n extend = angular.extend,\n copy = angular.copy,\n isArray = angular.isArray,\n isDefined = angular.isDefined,\n isFunction = angular.isFunction,\n isNumber = angular.isNumber;\n\n /**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set\n * (pchar) allowed in path segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\n function encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n }\n\n\n /**\n * This method is intended for encoding *key* or *value* parts of query component. We need a\n * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't\n * have to be encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\n function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n }\n\n function Route(template, defaults) {\n this.template = template;\n this.defaults = extend({}, provider.defaults, defaults);\n this.urlParams = {};\n }\n\n Route.prototype = {\n setUrlParams: function(config, params, actionUrl) {\n var self = this,\n url = actionUrl || self.template,\n val,\n encodedVal,\n protocolAndDomain = '';\n\n var urlParams = self.urlParams = {};\n forEach(url.split(/\\W/), function(param) {\n if (param === 'hasOwnProperty') {\n throw $resourceMinErr('badname', 'hasOwnProperty is not a valid parameter name.');\n }\n if (!(new RegExp('^\\\\d+$').test(param)) && param &&\n (new RegExp('(^|[^\\\\\\\\]):' + param + '(\\\\W|$)').test(url))) {\n urlParams[param] = {\n isQueryParamValue: (new RegExp('\\\\?.*=:' + param + '(?:\\\\W|$)')).test(url)\n };\n }\n });\n url = url.replace(/\\\\:/g, ':');\n url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) {\n protocolAndDomain = match;\n return '';\n });\n\n params = params || {};\n forEach(self.urlParams, function(paramInfo, urlParam) {\n val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];\n if (isDefined(val) && val !== null) {\n if (paramInfo.isQueryParamValue) {\n encodedVal = encodeUriQuery(val, true);\n } else {\n encodedVal = encodeUriSegment(val);\n }\n url = url.replace(new RegExp(':' + urlParam + '(\\\\W|$)', 'g'), function(match, p1) {\n return encodedVal + p1;\n });\n } else {\n url = url.replace(new RegExp('(/?):' + urlParam + '(\\\\W|$)', 'g'), function(match,\n leadingSlashes, tail) {\n if (tail.charAt(0) === '/') {\n return tail;\n } else {\n return leadingSlashes + tail;\n }\n });\n }\n });\n\n // strip trailing slashes and set the url (unless this behavior is specifically disabled)\n if (self.defaults.stripTrailingSlashes) {\n url = url.replace(/\\/+$/, '') || '/';\n }\n\n // then replace collapse `/.` if found in the last URL path segment before the query\n // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`\n url = url.replace(/\\/\\.(?=\\w+($|\\?))/, '.');\n // replace escaped `/\\.` with `/.`\n config.url = protocolAndDomain + url.replace(/\\/\\\\\\./, '/.');\n\n\n // set params - delegate param encoding to $http\n forEach(params, function(value, key) {\n if (!self.urlParams[key]) {\n config.params = config.params || {};\n config.params[key] = value;\n }\n });\n }\n };\n\n\n function resourceFactory(url, paramDefaults, actions, options) {\n var route = new Route(url, options);\n\n actions = extend({}, provider.defaults.actions, actions);\n\n function extractParams(data, actionParams) {\n var ids = {};\n actionParams = extend({}, paramDefaults, actionParams);\n forEach(actionParams, function(value, key) {\n if (isFunction(value)) { value = value(data); }\n ids[key] = value && value.charAt && value.charAt(0) === '@' ?\n lookupDottedPath(data, value.substr(1)) : value;\n });\n return ids;\n }\n\n function defaultResponseInterceptor(response) {\n return response.resource;\n }\n\n function Resource(value) {\n shallowClearAndCopy(value || {}, this);\n }\n\n Resource.prototype.toJSON = function() {\n var data = extend({}, this);\n delete data.$promise;\n delete data.$resolved;\n delete data.$cancelRequest;\n return data;\n };\n\n forEach(actions, function(action, name) {\n var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);\n var numericTimeout = action.timeout;\n var cancellable = isDefined(action.cancellable) ?\n action.cancellable : route.defaults.cancellable;\n\n if (numericTimeout && !isNumber(numericTimeout)) {\n $log.debug('ngResource:\\n' +\n ' Only numeric values are allowed as `timeout`.\\n' +\n ' Promises are not supported in $resource, because the same value would ' +\n 'be used for multiple requests. If you are looking for a way to cancel ' +\n 'requests, you should use the `cancellable` option.');\n delete action.timeout;\n numericTimeout = null;\n }\n\n Resource[name] = function(a1, a2, a3, a4) {\n var params = {}, data, success, error;\n\n switch (arguments.length) {\n case 4:\n error = a4;\n success = a3;\n // falls through\n case 3:\n case 2:\n if (isFunction(a2)) {\n if (isFunction(a1)) {\n success = a1;\n error = a2;\n break;\n }\n\n success = a2;\n error = a3;\n // falls through\n } else {\n params = a1;\n data = a2;\n success = a3;\n break;\n }\n // falls through\n case 1:\n if (isFunction(a1)) success = a1;\n else if (hasBody) data = a1;\n else params = a1;\n break;\n case 0: break;\n default:\n throw $resourceMinErr('badargs',\n 'Expected up to 4 arguments [params, data, success, error], got {0} arguments',\n arguments.length);\n }\n\n var isInstanceCall = this instanceof Resource;\n var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));\n var httpConfig = {};\n var responseInterceptor = action.interceptor && action.interceptor.response ||\n defaultResponseInterceptor;\n var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||\n undefined;\n var timeoutDeferred;\n var numericTimeoutPromise;\n\n forEach(action, function(value, key) {\n switch (key) {\n default:\n httpConfig[key] = copy(value);\n break;\n case 'params':\n case 'isArray':\n case 'interceptor':\n case 'cancellable':\n break;\n }\n });\n\n if (!isInstanceCall && cancellable) {\n timeoutDeferred = $q.defer();\n httpConfig.timeout = timeoutDeferred.promise;\n\n if (numericTimeout) {\n numericTimeoutPromise = $timeout(timeoutDeferred.resolve, numericTimeout);\n }\n }\n\n if (hasBody) httpConfig.data = data;\n route.setUrlParams(httpConfig,\n extend({}, extractParams(data, action.params || {}), params),\n action.url);\n\n var promise = $http(httpConfig).then(function(response) {\n var data = response.data;\n\n if (data) {\n // Need to convert action.isArray to boolean in case it is undefined\n if (isArray(data) !== (!!action.isArray)) {\n throw $resourceMinErr('badcfg',\n 'Error in resource configuration for action `{0}`. Expected response to ' +\n 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',\n isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);\n }\n if (action.isArray) {\n value.length = 0;\n forEach(data, function(item) {\n if (typeof item === 'object') {\n value.push(new Resource(item));\n } else {\n // Valid JSON values may be string literals, and these should not be converted\n // into objects. These items will not have access to the Resource prototype\n // methods, but unfortunately there\n value.push(item);\n }\n });\n } else {\n var promise = value.$promise; // Save the promise\n shallowClearAndCopy(data, value);\n value.$promise = promise; // Restore the promise\n }\n }\n response.resource = value;\n\n return response;\n }, function(response) {\n (error || noop)(response);\n return $q.reject(response);\n });\n\n promise['finally'](function() {\n value.$resolved = true;\n if (!isInstanceCall && cancellable) {\n value.$cancelRequest = noop;\n $timeout.cancel(numericTimeoutPromise);\n timeoutDeferred = numericTimeoutPromise = httpConfig.timeout = null;\n }\n });\n\n promise = promise.then(\n function(response) {\n var value = responseInterceptor(response);\n (success || noop)(value, response.headers, response.status, response.statusText);\n return value;\n },\n responseErrorInterceptor);\n\n if (!isInstanceCall) {\n // we are creating instance / collection\n // - set the initial promise\n // - return the instance / collection\n value.$promise = promise;\n value.$resolved = false;\n if (cancellable) value.$cancelRequest = timeoutDeferred.resolve;\n\n return value;\n }\n\n // instance call\n return promise;\n };\n\n\n Resource.prototype['$' + name] = function(params, success, error) {\n if (isFunction(params)) {\n error = success; success = params; params = {};\n }\n var result = Resource[name].call(this, params, this, success, error);\n return result.$promise || result;\n };\n });\n\n Resource.bind = function(additionalParamDefaults) {\n var extendedParamDefaults = extend({}, paramDefaults, additionalParamDefaults);\n return resourceFactory(url, extendedParamDefaults, actions, options);\n };\n\n return Resource;\n }\n\n return resourceFactory;\n }];\n });\n\n\n})(window, window.angular);\n\n/*!\n * jQuery Mousewheel 3.1.13\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license\n * http://jquery.org/license\n */\n\n(function (factory) {\n if ( typeof define === 'function' && define.amd ) {\n // AMD. Register as an anonymous module.\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // Node/CommonJS style for Browserify\n module.exports = factory;\n } else {\n // Browser globals\n factory(jQuery);\n }\n}(function ($) {\n\n var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],\n toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?\n ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],\n slice = Array.prototype.slice,\n nullLowestDeltaTimeout, lowestDelta;\n\n if ( $.event.fixHooks ) {\n for ( var i = toFix.length; i; ) {\n $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;\n }\n }\n\n var special = $.event.special.mousewheel = {\n version: '3.1.12',\n\n setup: function() {\n if ( this.addEventListener ) {\n for ( var i = toBind.length; i; ) {\n this.addEventListener( toBind[--i], handler, false );\n }\n } else {\n this.onmousewheel = handler;\n }\n // Store the line height and page height for this particular element\n $.data(this, 'mousewheel-line-height', special.getLineHeight(this));\n $.data(this, 'mousewheel-page-height', special.getPageHeight(this));\n },\n\n teardown: function() {\n if ( this.removeEventListener ) {\n for ( var i = toBind.length; i; ) {\n this.removeEventListener( toBind[--i], handler, false );\n }\n } else {\n this.onmousewheel = null;\n }\n // Clean up the data we added to the element\n $.removeData(this, 'mousewheel-line-height');\n $.removeData(this, 'mousewheel-page-height');\n },\n\n getLineHeight: function(elem) {\n var $elem = $(elem),\n $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();\n if (!$parent.length) {\n $parent = $('body');\n }\n return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;\n },\n\n getPageHeight: function(elem) {\n return $(elem).height();\n },\n\n settings: {\n adjustOldDeltas: true, // see shouldAdjustOldDeltas() below\n normalizeOffset: true // calls getBoundingClientRect for each event\n }\n };\n\n $.fn.extend({\n mousewheel: function(fn) {\n return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');\n },\n\n unmousewheel: function(fn) {\n return this.unbind('mousewheel', fn);\n }\n });\n\n\n function handler(event) {\n var orgEvent = event || window.event,\n args = slice.call(arguments, 1),\n delta = 0,\n deltaX = 0,\n deltaY = 0,\n absDelta = 0,\n offsetX = 0,\n offsetY = 0;\n event = $.event.fix(orgEvent);\n event.type = 'mousewheel';\n\n // Old school scrollwheel delta\n if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }\n if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }\n if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }\n if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }\n\n // Firefox < 17 horizontal scrolling related to DOMMouseScroll event\n if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {\n deltaX = deltaY * -1;\n deltaY = 0;\n }\n\n // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy\n delta = deltaY === 0 ? deltaX : deltaY;\n\n // New school wheel delta (wheel event)\n if ( 'deltaY' in orgEvent ) {\n deltaY = orgEvent.deltaY * -1;\n delta = deltaY;\n }\n if ( 'deltaX' in orgEvent ) {\n deltaX = orgEvent.deltaX;\n if ( deltaY === 0 ) { delta = deltaX * -1; }\n }\n\n // No change actually happened, no reason to go any further\n if ( deltaY === 0 && deltaX === 0 ) { return; }\n\n // Need to convert lines and pages to pixels if we aren't already in pixels\n // There are three delta modes:\n // * deltaMode 0 is by pixels, nothing to do\n // * deltaMode 1 is by lines\n // * deltaMode 2 is by pages\n if ( orgEvent.deltaMode === 1 ) {\n var lineHeight = $.data(this, 'mousewheel-line-height');\n delta *= lineHeight;\n deltaY *= lineHeight;\n deltaX *= lineHeight;\n } else if ( orgEvent.deltaMode === 2 ) {\n var pageHeight = $.data(this, 'mousewheel-page-height');\n delta *= pageHeight;\n deltaY *= pageHeight;\n deltaX *= pageHeight;\n }\n\n // Store lowest absolute delta to normalize the delta values\n absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );\n\n if ( !lowestDelta || absDelta < lowestDelta ) {\n lowestDelta = absDelta;\n\n // Adjust older deltas if necessary\n if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {\n lowestDelta /= 40;\n }\n }\n\n // Adjust older deltas if necessary\n if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {\n // Divide all the things by 40!\n delta /= 40;\n deltaX /= 40;\n deltaY /= 40;\n }\n\n // Get a whole, normalized value for the deltas\n delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);\n deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);\n deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);\n\n // Normalise offsetX and offsetY properties\n if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {\n var boundingRect = this.getBoundingClientRect();\n offsetX = event.clientX - boundingRect.left;\n offsetY = event.clientY - boundingRect.top;\n }\n\n // Add information to the event object\n event.deltaX = deltaX;\n event.deltaY = deltaY;\n event.deltaFactor = lowestDelta;\n event.offsetX = offsetX;\n event.offsetY = offsetY;\n // Go ahead and set deltaMode to 0 since we converted to pixels\n // Although this is a little odd since we overwrite the deltaX/Y\n // properties with normalized deltas.\n event.deltaMode = 0;\n\n // Add event and delta to the front of the arguments\n args.unshift(event, delta, deltaX, deltaY);\n\n // Clearout lowestDelta after sometime to better\n // handle multiple device types that give different\n // a different lowestDelta\n // Ex: trackpad = 3 and mouse wheel = 120\n if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }\n nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);\n\n return ($.event.dispatch || $.event.handle).apply(this, args);\n }\n\n function nullLowestDelta() {\n lowestDelta = null;\n }\n\n function shouldAdjustOldDeltas(orgEvent, absDelta) {\n // If this is an older event and the delta is divisable by 120,\n // then we are assuming that the browser is treating this as an\n // older mouse wheel event and that we should divide the deltas\n // by 40 to try and get a more usable deltaFactor.\n // Side note, this actually impacts the reported scroll distance\n // in older browsers and can cause scrolling to be slower than native.\n // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.\n return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;\n }\n\n}));\n\n/*\n== malihu jquery custom scrollbar plugin == \nVersion: 3.1.5 \nPlugin URI: http://manos.malihu.gr/jquery-custom-content-scroller \nAuthor: malihu\nAuthor URI: http://manos.malihu.gr\nLicense: MIT License (MIT)\n*/\n\n/*\nCopyright Manos Malihutsakis (email: manos@malihu.gr)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n/*\nThe code below is fairly long, fully commented and should be normally used in development. \nFor production, use either the minified jquery.mCustomScrollbar.min.js script or \nthe production-ready jquery.mCustomScrollbar.concat.min.js which contains the plugin \nand dependencies (minified). \n*/\n\n(function(factory){\n\tif(typeof define===\"function\" && define.amd){\n\t\tdefine([\"jquery\"],factory);\n\t}else if(typeof module!==\"undefined\" && module.exports){\n\t\tmodule.exports=factory;\n\t}else{\n\t\tfactory(jQuery,window,document);\n\t}\n}(function($){\n(function(init){\n\tvar _rjs=typeof define===\"function\" && define.amd, /* RequireJS */\n\t\t_njs=typeof module !== \"undefined\" && module.exports, /* NodeJS */\n\t\t_dlp=(\"https:\"==document.location.protocol) ? \"https:\" : \"http:\", /* location protocol */\n\t\t_url=\"cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js\";\n\tif(!_rjs){\n\t\tif(_njs){\n\t\t\trequire(\"jquery-mousewheel\")($);\n\t\t}else{\n\t\t\t/* load jquery-mousewheel plugin (via CDN) if it's not present or not loaded via RequireJS \n\t\t\t(works when mCustomScrollbar fn is called on window load) */\n\t\t\t$.event.special.mousewheel || $(\"head\").append(decodeURI(\"%3Cscript src=\"+_dlp+\"//\"+_url+\"%3E%3C/script%3E\"));\n\t\t}\n\t}\n\tinit();\n}(function(){\n\t\n\t/* \n\t----------------------------------------\n\tPLUGIN NAMESPACE, PREFIX, DEFAULT SELECTOR(S) \n\t----------------------------------------\n\t*/\n\t\n\tvar pluginNS=\"mCustomScrollbar\",\n\t\tpluginPfx=\"mCS\",\n\t\tdefaultSelector=\".mCustomScrollbar\",\n\t\n\t\n\t\t\n\t\n\t\n\t/* \n\t----------------------------------------\n\tDEFAULT OPTIONS \n\t----------------------------------------\n\t*/\n\t\n\t\tdefaults={\n\t\t\t/*\n\t\t\tset element/content width/height programmatically \n\t\t\tvalues: boolean, pixels, percentage \n\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t-------------------------------------\n\t\t\t\tsetWidth\t\t\t\t\tfalse\n\t\t\t\tsetHeight\t\t\t\t\tfalse\n\t\t\t*/\n\t\t\t/*\n\t\t\tset the initial css top property of content \n\t\t\tvalues: string (e.g. \"-100px\", \"10%\" etc.)\n\t\t\t*/\n\t\t\tsetTop:0,\n\t\t\t/*\n\t\t\tset the initial css left property of content \n\t\t\tvalues: string (e.g. \"-100px\", \"10%\" etc.)\n\t\t\t*/\n\t\t\tsetLeft:0,\n\t\t\t/* \n\t\t\tscrollbar axis (vertical and/or horizontal scrollbars) \n\t\t\tvalues (string): \"y\", \"x\", \"yx\"\n\t\t\t*/\n\t\t\taxis:\"y\",\n\t\t\t/*\n\t\t\tposition of scrollbar relative to content \n\t\t\tvalues (string): \"inside\", \"outside\" (\"outside\" requires elements with position:relative)\n\t\t\t*/\n\t\t\tscrollbarPosition:\"inside\",\n\t\t\t/*\n\t\t\tscrolling inertia\n\t\t\tvalues: integer (milliseconds)\n\t\t\t*/\n\t\t\tscrollInertia:950,\n\t\t\t/* \n\t\t\tauto-adjust scrollbar dragger length\n\t\t\tvalues: boolean\n\t\t\t*/\n\t\t\tautoDraggerLength:true,\n\t\t\t/*\n\t\t\tauto-hide scrollbar when idle \n\t\t\tvalues: boolean\n\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t-------------------------------------\n\t\t\t\tautoHideScrollbar\t\t\tfalse\n\t\t\t*/\n\t\t\t/*\n\t\t\tauto-expands scrollbar on mouse-over and dragging\n\t\t\tvalues: boolean\n\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t-------------------------------------\n\t\t\t\tautoExpandScrollbar\t\t\tfalse\n\t\t\t*/\n\t\t\t/*\n\t\t\talways show scrollbar, even when there's nothing to scroll \n\t\t\tvalues: integer (0=disable, 1=always show dragger rail and buttons, 2=always show dragger rail, dragger and buttons), boolean\n\t\t\t*/\n\t\t\talwaysShowScrollbar:0,\n\t\t\t/*\n\t\t\tscrolling always snaps to a multiple of this number in pixels\n\t\t\tvalues: integer, array ([y,x])\n\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t-------------------------------------\n\t\t\t\tsnapAmount\t\t\t\t\tnull\n\t\t\t*/\n\t\t\t/*\n\t\t\twhen snapping, snap with this number in pixels as an offset \n\t\t\tvalues: integer\n\t\t\t*/\n\t\t\tsnapOffset:0,\n\t\t\t/* \n\t\t\tmouse-wheel scrolling\n\t\t\t*/\n\t\t\tmouseWheel:{\n\t\t\t\t/* \n\t\t\t\tenable mouse-wheel scrolling\n\t\t\t\tvalues: boolean\n\t\t\t\t*/\n\t\t\t\tenable:true,\n\t\t\t\t/* \n\t\t\t\tscrolling amount in pixels\n\t\t\t\tvalues: \"auto\", integer \n\t\t\t\t*/\n\t\t\t\tscrollAmount:\"auto\",\n\t\t\t\t/* \n\t\t\t\tmouse-wheel scrolling axis \n\t\t\t\tthe default scrolling direction when both vertical and horizontal scrollbars are present \n\t\t\t\tvalues (string): \"y\", \"x\" \n\t\t\t\t*/\n\t\t\t\taxis:\"y\",\n\t\t\t\t/* \n\t\t\t\tprevent the default behaviour which automatically scrolls the parent element(s) when end of scrolling is reached \n\t\t\t\tvalues: boolean\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tpreventDefault\t\t\t\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tthe reported mouse-wheel delta value. The number of lines (translated to pixels) one wheel notch scrolls. \n\t\t\t\tvalues: \"auto\", integer \n\t\t\t\t\"auto\" uses the default OS/browser value \n\t\t\t\t*/\n\t\t\t\tdeltaFactor:\"auto\",\n\t\t\t\t/*\n\t\t\t\tnormalize mouse-wheel delta to -1 or 1 (disables mouse-wheel acceleration) \n\t\t\t\tvalues: boolean\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tnormalizeDelta\t\t\t\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tinvert mouse-wheel scrolling direction \n\t\t\t\tvalues: boolean\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tinvert\t\t\t\t\t\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tthe tags that disable mouse-wheel when cursor is over them\n\t\t\t\t*/\n\t\t\t\tdisableOver:[\"select\",\"option\",\"keygen\",\"datalist\",\"textarea\"]\n\t\t\t},\n\t\t\t/* \n\t\t\tscrollbar buttons\n\t\t\t*/\n\t\t\tscrollButtons:{ \n\t\t\t\t/*\n\t\t\t\tenable scrollbar buttons\n\t\t\t\tvalues: boolean\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tenable\t\t\t\t\t\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tscrollbar buttons scrolling type \n\t\t\t\tvalues (string): \"stepless\", \"stepped\"\n\t\t\t\t*/\n\t\t\t\tscrollType:\"stepless\",\n\t\t\t\t/*\n\t\t\t\tscrolling amount in pixels\n\t\t\t\tvalues: \"auto\", integer \n\t\t\t\t*/\n\t\t\t\tscrollAmount:\"auto\"\n\t\t\t\t/*\n\t\t\t\ttabindex of the scrollbar buttons\n\t\t\t\tvalues: false, integer\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\ttabindex\t\t\t\t\tnull\n\t\t\t\t*/\n\t\t\t},\n\t\t\t/* \n\t\t\tkeyboard scrolling\n\t\t\t*/\n\t\t\tkeyboard:{ \n\t\t\t\t/*\n\t\t\t\tenable scrolling via keyboard\n\t\t\t\tvalues: boolean\n\t\t\t\t*/\n\t\t\t\tenable:true,\n\t\t\t\t/*\n\t\t\t\tkeyboard scrolling type \n\t\t\t\tvalues (string): \"stepless\", \"stepped\"\n\t\t\t\t*/\n\t\t\t\tscrollType:\"stepless\",\n\t\t\t\t/*\n\t\t\t\tscrolling amount in pixels\n\t\t\t\tvalues: \"auto\", integer \n\t\t\t\t*/\n\t\t\t\tscrollAmount:\"auto\"\n\t\t\t},\n\t\t\t/*\n\t\t\tenable content touch-swipe scrolling \n\t\t\tvalues: boolean, integer, string (number)\n\t\t\tinteger values define the axis-specific minimum amount required for scrolling momentum\n\t\t\t*/\n\t\t\tcontentTouchScroll:25,\n\t\t\t/*\n\t\t\tenable/disable document (default) touch-swipe scrolling \n\t\t\t*/\n\t\t\tdocumentTouchScroll:true,\n\t\t\t/*\n\t\t\tadvanced option parameters\n\t\t\t*/\n\t\t\tadvanced:{\n\t\t\t\t/*\n\t\t\t\tauto-expand content horizontally (for \"x\" or \"yx\" axis) \n\t\t\t\tvalues: boolean, integer (the value 2 forces the non scrollHeight/scrollWidth method, the value 3 forces the scrollHeight/scrollWidth method)\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tautoExpandHorizontalScroll\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tauto-scroll to elements with focus\n\t\t\t\t*/\n\t\t\t\tautoScrollOnFocus:\"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']\",\n\t\t\t\t/*\n\t\t\t\tauto-update scrollbars on content, element or viewport resize \n\t\t\t\tshould be true for fluid layouts/elements, adding/removing content dynamically, hiding/showing elements, content with images etc. \n\t\t\t\tvalues: boolean\n\t\t\t\t*/\n\t\t\t\tupdateOnContentResize:true,\n\t\t\t\t/*\n\t\t\t\tauto-update scrollbars each time each image inside the element is fully loaded \n\t\t\t\tvalues: \"auto\", boolean\n\t\t\t\t*/\n\t\t\t\tupdateOnImageLoad:\"auto\",\n\t\t\t\t/*\n\t\t\t\tauto-update scrollbars based on the amount and size changes of specific selectors \n\t\t\t\tuseful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size \n\t\t\t\tvalues: boolean, string (e.g. \"ul li\" will auto-update scrollbars each time list-items inside the element are changed) \n\t\t\t\ta value of true (boolean) will auto-update scrollbars each time any element is changed\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tupdateOnSelectorChange\t\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\textra selectors that'll allow scrollbar dragging upon mousemove/up, pointermove/up, touchend etc. (e.g. \"selector-1, selector-2\")\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\textraDraggableSelectors\t\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\textra selectors that'll release scrollbar dragging upon mouseup, pointerup, touchend etc. (e.g. \"selector-1, selector-2\")\n\t\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\treleaseDraggableSelectors\tnull\n\t\t\t\t*/\n\t\t\t\t/*\n\t\t\t\tauto-update timeout \n\t\t\t\tvalues: integer (milliseconds)\n\t\t\t\t*/\n\t\t\t\tautoUpdateTimeout:60\n\t\t\t},\n\t\t\t/* \n\t\t\tscrollbar theme \n\t\t\tvalues: string (see CSS/plugin URI for a list of ready-to-use themes)\n\t\t\t*/\n\t\t\ttheme:\"light\",\n\t\t\t/*\n\t\t\tuser defined callback functions\n\t\t\t*/\n\t\t\tcallbacks:{\n\t\t\t\t/*\n\t\t\t\tAvailable callbacks: \n\t\t\t\t\tcallback\t\t\t\t\tdefault\n\t\t\t\t\t-------------------------------------\n\t\t\t\t\tonCreate\t\t\t\t\tnull\n\t\t\t\t\tonInit\t\t\t\t\t\tnull\n\t\t\t\t\tonScrollStart\t\t\t\tnull\n\t\t\t\t\tonScroll\t\t\t\t\tnull\n\t\t\t\t\tonTotalScroll\t\t\t\tnull\n\t\t\t\t\tonTotalScrollBack\t\t\tnull\n\t\t\t\t\twhileScrolling\t\t\t\tnull\n\t\t\t\t\tonOverflowY\t\t\t\t\tnull\n\t\t\t\t\tonOverflowX\t\t\t\t\tnull\n\t\t\t\t\tonOverflowYNone\t\t\t\tnull\n\t\t\t\t\tonOverflowXNone\t\t\t\tnull\n\t\t\t\t\tonImageLoad\t\t\t\t\tnull\n\t\t\t\t\tonSelectorChange\t\t\tnull\n\t\t\t\t\tonBeforeUpdate\t\t\t\tnull\n\t\t\t\t\tonUpdate\t\t\t\t\tnull\n\t\t\t\t*/\n\t\t\t\tonTotalScrollOffset:0,\n\t\t\t\tonTotalScrollBackOffset:0,\n\t\t\t\talwaysTriggerOffsets:true\n\t\t\t}\n\t\t\t/*\n\t\t\tadd scrollbar(s) on all elements matching the current selector, now and in the future \n\t\t\tvalues: boolean, string \n\t\t\tstring values: \"on\" (enable), \"once\" (disable after first invocation), \"off\" (disable)\n\t\t\tliveSelector values: string (selector)\n\t\t\t\toption\t\t\t\t\t\tdefault\n\t\t\t\t-------------------------------------\n\t\t\t\tlive\t\t\t\t\t\tfalse\n\t\t\t\tliveSelector\t\t\t\tnull\n\t\t\t*/\n\t\t},\n\t\n\t\n\t\n\t\n\t\n\t/* \n\t----------------------------------------\n\tVARS, CONSTANTS \n\t----------------------------------------\n\t*/\n\t\n\t\ttotalInstances=0, /* plugin instances amount */\n\t\tliveTimers={}, /* live option timers */\n\t\toldIE=(window.attachEvent && !window.addEventListener) ? 1 : 0, /* detect IE < 9 */\n\t\ttouchActive=false,touchable, /* global touch vars (for touch and pointer events) */\n\t\t/* general plugin classes */\n\t\tclasses=[\n\t\t\t\"mCSB_dragger_onDrag\",\"mCSB_scrollTools_onDrag\",\"mCS_img_loaded\",\"mCS_disabled\",\"mCS_destroyed\",\"mCS_no_scrollbar\",\n\t\t\t\"mCS-autoHide\",\"mCS-dir-rtl\",\"mCS_no_scrollbar_y\",\"mCS_no_scrollbar_x\",\"mCS_y_hidden\",\"mCS_x_hidden\",\"mCSB_draggerContainer\",\n\t\t\t\"mCSB_buttonUp\",\"mCSB_buttonDown\",\"mCSB_buttonLeft\",\"mCSB_buttonRight\"\n\t\t],\n\t\t\n\t\n\t\n\t\n\t\n\t/* \n\t----------------------------------------\n\tMETHODS \n\t----------------------------------------\n\t*/\n\t\n\t\tmethods={\n\t\t\t\n\t\t\t/* \n\t\t\tplugin initialization method \n\t\t\tcreates the scrollbar(s), plugin data object and options\n\t\t\t----------------------------------------\n\t\t\t*/\n\t\t\t\n\t\t\tinit:function(options){\n\t\t\t\t\n\t\t\t\tvar options=$.extend(true,{},defaults,options),\n\t\t\t\t\tselector=_selector.call(this); /* validate selector */\n\t\t\t\t\n\t\t\t\t/* \n\t\t\t\tif live option is enabled, monitor for elements matching the current selector and \n\t\t\t\tapply scrollbar(s) when found (now and in the future) \n\t\t\t\t*/\n\t\t\t\tif(options.live){\n\t\t\t\t\tvar liveSelector=options.liveSelector || this.selector || defaultSelector, /* live selector(s) */\n\t\t\t\t\t\t$liveSelector=$(liveSelector); /* live selector(s) as jquery object */\n\t\t\t\t\tif(options.live===\"off\"){\n\t\t\t\t\t\t/* \n\t\t\t\t\t\tdisable live if requested \n\t\t\t\t\t\tusage: $(selector).mCustomScrollbar({live:\"off\"}); \n\t\t\t\t\t\t*/\n\t\t\t\t\t\tremoveLiveTimers(liveSelector);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tliveTimers[liveSelector]=setTimeout(function(){\n\t\t\t\t\t\t/* call mCustomScrollbar fn on live selector(s) every half-second */\n\t\t\t\t\t\t$liveSelector.mCustomScrollbar(options);\n\t\t\t\t\t\tif(options.live===\"once\" && $liveSelector.length){\n\t\t\t\t\t\t\t/* disable live after first invocation */\n\t\t\t\t\t\t\tremoveLiveTimers(liveSelector);\n\t\t\t\t\t\t}\n\t\t\t\t\t},500);\n\t\t\t\t}else{\n\t\t\t\t\tremoveLiveTimers(liveSelector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* options backward compatibility (for versions < 3.0.0) and normalization */\n\t\t\t\toptions.setWidth=(options.set_width) ? options.set_width : options.setWidth;\n\t\t\t\toptions.setHeight=(options.set_height) ? options.set_height : options.setHeight;\n\t\t\t\toptions.axis=(options.horizontalScroll) ? \"x\" : _findAxis(options.axis);\n\t\t\t\toptions.scrollInertia=options.scrollInertia>0 && options.scrollInertia<17 ? 17 : options.scrollInertia;\n\t\t\t\tif(typeof options.mouseWheel!==\"object\" && options.mouseWheel==true){ /* old school mouseWheel option (non-object) */\n\t\t\t\t\toptions.mouseWheel={enable:true,scrollAmount:\"auto\",axis:\"y\",preventDefault:false,deltaFactor:\"auto\",normalizeDelta:false,invert:false}\n\t\t\t\t}\n\t\t\t\toptions.mouseWheel.scrollAmount=!options.mouseWheelPixels ? options.mouseWheel.scrollAmount : options.mouseWheelPixels;\n\t\t\t\toptions.mouseWheel.normalizeDelta=!options.advanced.normalizeMouseWheelDelta ? options.mouseWheel.normalizeDelta : options.advanced.normalizeMouseWheelDelta;\n\t\t\t\toptions.scrollButtons.scrollType=_findScrollButtonsType(options.scrollButtons.scrollType); \n\t\t\t\t\n\t\t\t\t_theme(options); /* theme-specific options */\n\t\t\t\t\n\t\t\t\t/* plugin constructor */\n\t\t\t\treturn $(selector).each(function(){\n\t\t\t\t\t\n\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\n\t\t\t\t\tif(!$this.data(pluginPfx)){ /* prevent multiple instantiations */\n\t\t\t\t\t\n\t\t\t\t\t\t/* store options and create objects in jquery data */\n\t\t\t\t\t\t$this.data(pluginPfx,{\n\t\t\t\t\t\t\tidx:++totalInstances, /* instance index */\n\t\t\t\t\t\t\topt:options, /* options */\n\t\t\t\t\t\t\tscrollRatio:{y:null,x:null}, /* scrollbar to content ratio */\n\t\t\t\t\t\t\toverflowed:null, /* overflowed axis */\n\t\t\t\t\t\t\tcontentReset:{y:null,x:null}, /* object to check when content resets */\n\t\t\t\t\t\t\tbindEvents:false, /* object to check if events are bound */\n\t\t\t\t\t\t\ttweenRunning:false, /* object to check if tween is running */\n\t\t\t\t\t\t\tsequential:{}, /* sequential scrolling object */\n\t\t\t\t\t\t\tlangDir:$this.css(\"direction\"), /* detect/store direction (ltr or rtl) */\n\t\t\t\t\t\t\tcbOffsets:null, /* object to check whether callback offsets always trigger */\n\t\t\t\t\t\t\t/* \n\t\t\t\t\t\t\tobject to check how scrolling events where last triggered \n\t\t\t\t\t\t\t\"internal\" (default - triggered by this script), \"external\" (triggered by other scripts, e.g. via scrollTo method) \n\t\t\t\t\t\t\tusage: object.data(\"mCS\").trigger\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\ttrigger:null,\n\t\t\t\t\t\t\t/* \n\t\t\t\t\t\t\tobject to check for changes in elements in order to call the update method automatically \n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tpoll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\t\t\t\t/* HTML data attributes */\n\t\t\t\t\t\t\thtmlDataAxis=$this.data(\"mcs-axis\"),htmlDataSbPos=$this.data(\"mcs-scrollbar-position\"),htmlDataTheme=$this.data(\"mcs-theme\");\n\t\t\t\t\t\t \n\t\t\t\t\t\tif(htmlDataAxis){o.axis=htmlDataAxis;} /* usage example: data-mcs-axis=\"y\" */\n\t\t\t\t\t\tif(htmlDataSbPos){o.scrollbarPosition=htmlDataSbPos;} /* usage example: data-mcs-scrollbar-position=\"outside\" */\n\t\t\t\t\t\tif(htmlDataTheme){ /* usage example: data-mcs-theme=\"minimal\" */\n\t\t\t\t\t\t\to.theme=htmlDataTheme;\n\t\t\t\t\t\t\t_theme(o); /* theme-specific options */\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t_pluginMarkup.call(this); /* add plugin markup */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(d && o.callbacks.onCreate && typeof o.callbacks.onCreate===\"function\"){o.callbacks.onCreate.call(this);} /* callbacks: onCreate */\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#mCSB_\"+d.idx+\"_container img:not(.\"+classes[2]+\")\").addClass(classes[2]); /* flag loaded images */\n\t\t\t\t\t\t\n\t\t\t\t\t\tmethods.update.call(null,$this); /* call the update method */\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t},\n\t\t\t/* ---------------------------------------- */\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/* \n\t\t\tplugin update method \n\t\t\tupdates content and scrollbar(s) values, events and status \n\t\t\t----------------------------------------\n\t\t\tusage: $(selector).mCustomScrollbar(\"update\");\n\t\t\t*/\n\t\t\t\n\t\t\tupdate:function(el,cb){\n\t\t\t\t\n\t\t\t\tvar selector=el || _selector.call(this); /* validate selector */\n\t\t\t\t\n\t\t\t\treturn $(selector).each(function(){\n\t\t\t\t\t\n\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\n\t\t\t\t\tif($this.data(pluginPfx)){ /* check if plugin has initialized */\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\t\t\t\tmCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!mCSB_container.length){return;}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(d.tweenRunning){_stop($this);} /* stop any running tweens while updating */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(cb && d && o.callbacks.onBeforeUpdate && typeof o.callbacks.onBeforeUpdate===\"function\"){o.callbacks.onBeforeUpdate.call(this);} /* callbacks: onBeforeUpdate */\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* if element was disabled or destroyed, remove class(es) */\n\t\t\t\t\t\tif($this.hasClass(classes[3])){$this.removeClass(classes[3]);}\n\t\t\t\t\t\tif($this.hasClass(classes[4])){$this.removeClass(classes[4]);}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* css flexbox fix, detect/set max-height */\n\t\t\t\t\t\tmCustomScrollBox.css(\"max-height\",\"none\");\n\t\t\t\t\t\tif(mCustomScrollBox.height()!==$this.height()){mCustomScrollBox.css(\"max-height\",$this.height());}\n\t\t\t\t\t\t\n\t\t\t\t\t\t_expandContentHorizontally.call(this); /* expand content horizontally */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(o.axis!==\"y\" && !o.advanced.autoExpandHorizontalScroll){\n\t\t\t\t\t\t\tmCSB_container.css(\"width\",_contentWidth(mCSB_container));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\td.overflowed=_overflowed.call(this); /* determine if scrolling is required */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_scrollbarVisibility.call(this); /* show/hide scrollbar(s) */\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* auto-adjust scrollbar dragger length analogous to content */\n\t\t\t\t\t\tif(o.autoDraggerLength){_setDraggerLength.call(this);}\n\t\t\t\t\t\t\n\t\t\t\t\t\t_scrollRatio.call(this); /* calculate and store scrollbar to content ratio */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_bindEvents.call(this); /* bind scrollbar events */\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* reset scrolling position and/or events */\n\t\t\t\t\t\tvar to=[Math.abs(mCSB_container[0].offsetTop),Math.abs(mCSB_container[0].offsetLeft)];\n\t\t\t\t\t\tif(o.axis!==\"x\"){ /* y/yx axis */\n\t\t\t\t\t\t\tif(!d.overflowed[0]){ /* y scrolling is not required */\n\t\t\t\t\t\t\t\t_resetContentPosition.call(this); /* reset content position */\n\t\t\t\t\t\t\t\tif(o.axis===\"y\"){\n\t\t\t\t\t\t\t\t\t_unbindEvents.call(this);\n\t\t\t\t\t\t\t\t}else if(o.axis===\"yx\" && d.overflowed[1]){\n\t\t\t\t\t\t\t\t\t_scrollTo($this,to[1].toString(),{dir:\"x\",dur:0,overwrite:\"none\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else if(mCSB_dragger[0].height()>mCSB_dragger[0].parent().height()){\n\t\t\t\t\t\t\t\t_resetContentPosition.call(this); /* reset content position */\n\t\t\t\t\t\t\t}else{ /* y scrolling is required */\n\t\t\t\t\t\t\t\t_scrollTo($this,to[0].toString(),{dir:\"y\",dur:0,overwrite:\"none\"});\n\t\t\t\t\t\t\t\td.contentReset.y=null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(o.axis!==\"y\"){ /* x/yx axis */\n\t\t\t\t\t\t\tif(!d.overflowed[1]){ /* x scrolling is not required */\n\t\t\t\t\t\t\t\t_resetContentPosition.call(this); /* reset content position */\n\t\t\t\t\t\t\t\tif(o.axis===\"x\"){\n\t\t\t\t\t\t\t\t\t_unbindEvents.call(this);\n\t\t\t\t\t\t\t\t}else if(o.axis===\"yx\" && d.overflowed[0]){\n\t\t\t\t\t\t\t\t\t_scrollTo($this,to[0].toString(),{dir:\"y\",dur:0,overwrite:\"none\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else if(mCSB_dragger[1].width()>mCSB_dragger[1].parent().width()){\n\t\t\t\t\t\t\t\t_resetContentPosition.call(this); /* reset content position */\n\t\t\t\t\t\t\t}else{ /* x scrolling is required */\n\t\t\t\t\t\t\t\t_scrollTo($this,to[1].toString(),{dir:\"x\",dur:0,overwrite:\"none\"});\n\t\t\t\t\t\t\t\td.contentReset.x=null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* callbacks: onImageLoad, onSelectorChange, onUpdate */\n\t\t\t\t\t\tif(cb && d){\n\t\t\t\t\t\t\tif(cb===2 && o.callbacks.onImageLoad && typeof o.callbacks.onImageLoad===\"function\"){\n\t\t\t\t\t\t\t\to.callbacks.onImageLoad.call(this);\n\t\t\t\t\t\t\t}else if(cb===3 && o.callbacks.onSelectorChange && typeof o.callbacks.onSelectorChange===\"function\"){\n\t\t\t\t\t\t\t\to.callbacks.onSelectorChange.call(this);\n\t\t\t\t\t\t\t}else if(o.callbacks.onUpdate && typeof o.callbacks.onUpdate===\"function\"){\n\t\t\t\t\t\t\t\to.callbacks.onUpdate.call(this);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t_autoUpdate.call(this); /* initialize automatic updating (for dynamic content, fluid layouts etc.) */\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t},\n\t\t\t/* ---------------------------------------- */\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/* \n\t\t\tplugin scrollTo method \n\t\t\ttriggers a scrolling event to a specific value\n\t\t\t----------------------------------------\n\t\t\tusage: $(selector).mCustomScrollbar(\"scrollTo\",value,options);\n\t\t\t*/\n\t\t\n\t\t\tscrollTo:function(val,options){\n\t\t\t\t\n\t\t\t\t/* prevent silly things like $(selector).mCustomScrollbar(\"scrollTo\",undefined); */\n\t\t\t\tif(typeof val==\"undefined\" || val==null){return;}\n\t\t\t\t\n\t\t\t\tvar selector=_selector.call(this); /* validate selector */\n\t\t\t\t\n\t\t\t\treturn $(selector).each(function(){\n\t\t\t\t\t\n\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\n\t\t\t\t\tif($this.data(pluginPfx)){ /* check if plugin has initialized */\n\t\t\t\t\t\n\t\t\t\t\t\tvar d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\t\t\t\t/* method default options */\n\t\t\t\t\t\t\tmethodDefaults={\n\t\t\t\t\t\t\t\ttrigger:\"external\", /* method is by default triggered externally (e.g. from other scripts) */\n\t\t\t\t\t\t\t\tscrollInertia:o.scrollInertia, /* scrolling inertia (animation duration) */\n\t\t\t\t\t\t\t\tscrollEasing:\"mcsEaseInOut\", /* animation easing */\n\t\t\t\t\t\t\t\tmoveDragger:false, /* move dragger instead of content */\n\t\t\t\t\t\t\t\ttimeout:60, /* scroll-to delay */\n\t\t\t\t\t\t\t\tcallbacks:true, /* enable/disable callbacks */\n\t\t\t\t\t\t\t\tonStart:true,\n\t\t\t\t\t\t\t\tonUpdate:true,\n\t\t\t\t\t\t\t\tonComplete:true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmethodOptions=$.extend(true,{},methodDefaults,options),\n\t\t\t\t\t\t\tto=_arr.call(this,val),dur=methodOptions.scrollInertia>0 && methodOptions.scrollInertia<17 ? 17 : methodOptions.scrollInertia;\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* translate yx values to actual scroll-to positions */\n\t\t\t\t\t\tto[0]=_to.call(this,to[0],\"y\");\n\t\t\t\t\t\tto[1]=_to.call(this,to[1],\"x\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* \n\t\t\t\t\t\tcheck if scroll-to value moves the dragger instead of content. \n\t\t\t\t\t\tOnly pixel values apply on dragger (e.g. 100, \"100px\", \"-=100\" etc.) \n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif(methodOptions.moveDragger){\n\t\t\t\t\t\t\tto[0]*=d.scrollRatio.y;\n\t\t\t\t\t\t\tto[1]*=d.scrollRatio.x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tmethodOptions.dur=_isTabHidden() ? 0 : dur; //skip animations if browser tab is hidden\n\t\t\t\t\t\t\n\t\t\t\t\t\tsetTimeout(function(){ \n\t\t\t\t\t\t\t/* do the scrolling */\n\t\t\t\t\t\t\tif(to[0]!==null && typeof to[0]!==\"undefined\" && o.axis!==\"x\" && d.overflowed[0]){ /* scroll y */\n\t\t\t\t\t\t\t\tmethodOptions.dir=\"y\";\n\t\t\t\t\t\t\t\tmethodOptions.overwrite=\"all\";\n\t\t\t\t\t\t\t\t_scrollTo($this,to[0].toString(),methodOptions);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(to[1]!==null && typeof to[1]!==\"undefined\" && o.axis!==\"y\" && d.overflowed[1]){ /* scroll x */\n\t\t\t\t\t\t\t\tmethodOptions.dir=\"x\";\n\t\t\t\t\t\t\t\tmethodOptions.overwrite=\"none\";\n\t\t\t\t\t\t\t\t_scrollTo($this,to[1].toString(),methodOptions);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},methodOptions.timeout);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t},\n\t\t\t/* ---------------------------------------- */\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\tplugin stop method \n\t\t\tstops scrolling animation\n\t\t\t----------------------------------------\n\t\t\tusage: $(selector).mCustomScrollbar(\"stop\");\n\t\t\t*/\n\t\t\tstop:function(){\n\t\t\t\t\n\t\t\t\tvar selector=_selector.call(this); /* validate selector */\n\t\t\t\t\n\t\t\t\treturn $(selector).each(function(){\n\t\t\t\t\t\n\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\n\t\t\t\t\tif($this.data(pluginPfx)){ /* check if plugin has initialized */\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t_stop($this);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t},\n\t\t\t/* ---------------------------------------- */\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\tplugin disable method \n\t\t\ttemporarily disables the scrollbar(s) \n\t\t\t----------------------------------------\n\t\t\tusage: $(selector).mCustomScrollbar(\"disable\",reset); \n\t\t\treset (boolean): resets content position to 0 \n\t\t\t*/\n\t\t\tdisable:function(r){\n\t\t\t\t\n\t\t\t\tvar selector=_selector.call(this); /* validate selector */\n\t\t\t\t\n\t\t\t\treturn $(selector).each(function(){\n\t\t\t\t\t\n\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\n\t\t\t\t\tif($this.data(pluginPfx)){ /* check if plugin has initialized */\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar d=$this.data(pluginPfx);\n\t\t\t\t\t\t\n\t\t\t\t\t\t_autoUpdate.call(this,\"remove\"); /* remove automatic updating */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_unbindEvents.call(this); /* unbind events */\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(r){_resetContentPosition.call(this);} /* reset content position */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_scrollbarVisibility.call(this,true); /* show/hide scrollbar(s) */\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this.addClass(classes[3]); /* add disable class */\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t},\n\t\t\t/* ---------------------------------------- */\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\tplugin destroy method \n\t\t\tcompletely removes the scrollbar(s) and returns the element to its original state\n\t\t\t----------------------------------------\n\t\t\tusage: $(selector).mCustomScrollbar(\"destroy\"); \n\t\t\t*/\n\t\t\tdestroy:function(){\n\t\t\t\t\n\t\t\t\tvar selector=_selector.call(this); /* validate selector */\n\t\t\t\t\n\t\t\t\treturn $(selector).each(function(){\n\t\t\t\t\t\n\t\t\t\t\tvar $this=$(this);\n\t\t\t\t\t\n\t\t\t\t\tif($this.data(pluginPfx)){ /* check if plugin has initialized */\n\t\t\t\t\t\n\t\t\t\t\t\tvar d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\t\t\t\tscrollbar=$(\".mCSB_\"+d.idx+\"_scrollbar\");\n\t\t\t\t\t\n\t\t\t\t\t\tif(o.live){removeLiveTimers(o.liveSelector || $(selector).selector);} /* remove live timers */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_autoUpdate.call(this,\"remove\"); /* remove automatic updating */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_unbindEvents.call(this); /* unbind events */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_resetContentPosition.call(this); /* reset content position */\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this.removeData(pluginPfx); /* remove plugin data object */\n\t\t\t\t\t\t\n\t\t\t\t\t\t_delete(this,\"mcs\"); /* delete callbacks object */\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* remove plugin markup */\n\t\t\t\t\t\tscrollbar.remove(); /* remove scrollbar(s) first (those can be either inside or outside plugin's inner wrapper) */\n\t\t\t\t\t\tmCSB_container.find(\"img.\"+classes[2]).removeClass(classes[2]); /* remove loaded images flag */\n\t\t\t\t\t\tmCustomScrollBox.replaceWith(mCSB_container.contents()); /* replace plugin's inner wrapper with the original content */\n\t\t\t\t\t\t/* remove plugin classes from the element and add destroy class */\n\t\t\t\t\t\t$this.removeClass(pluginNS+\" _\"+pluginPfx+\"_\"+d.idx+\" \"+classes[6]+\" \"+classes[7]+\" \"+classes[5]+\" \"+classes[3]).addClass(classes[4]);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t\t/* ---------------------------------------- */\n\t\t\t\n\t\t},\n\t\n\t\n\t\n\t\n\t\t\n\t/* \n\t----------------------------------------\n\tFUNCTIONS\n\t----------------------------------------\n\t*/\n\t\n\t\t/* validates selector (if selector is invalid or undefined uses the default one) */\n\t\t_selector=function(){\n\t\t\treturn (typeof $(this)!==\"object\" || $(this).length<1) ? defaultSelector : this;\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* changes options according to theme */\n\t\t_theme=function(obj){\n\t\t\tvar fixedSizeScrollbarThemes=[\"rounded\",\"rounded-dark\",\"rounded-dots\",\"rounded-dots-dark\"],\n\t\t\t\tnonExpandedScrollbarThemes=[\"rounded-dots\",\"rounded-dots-dark\",\"3d\",\"3d-dark\",\"3d-thick\",\"3d-thick-dark\",\"inset\",\"inset-dark\",\"inset-2\",\"inset-2-dark\",\"inset-3\",\"inset-3-dark\"],\n\t\t\t\tdisabledScrollButtonsThemes=[\"minimal\",\"minimal-dark\"],\n\t\t\t\tenabledAutoHideScrollbarThemes=[\"minimal\",\"minimal-dark\"],\n\t\t\t\tscrollbarPositionOutsideThemes=[\"minimal\",\"minimal-dark\"];\n\t\t\tobj.autoDraggerLength=$.inArray(obj.theme,fixedSizeScrollbarThemes) > -1 ? false : obj.autoDraggerLength;\n\t\t\tobj.autoExpandScrollbar=$.inArray(obj.theme,nonExpandedScrollbarThemes) > -1 ? false : obj.autoExpandScrollbar;\n\t\t\tobj.scrollButtons.enable=$.inArray(obj.theme,disabledScrollButtonsThemes) > -1 ? false : obj.scrollButtons.enable;\n\t\t\tobj.autoHideScrollbar=$.inArray(obj.theme,enabledAutoHideScrollbarThemes) > -1 ? true : obj.autoHideScrollbar;\n\t\t\tobj.scrollbarPosition=$.inArray(obj.theme,scrollbarPositionOutsideThemes) > -1 ? \"outside\" : obj.scrollbarPosition;\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* live option timers removal */\n\t\tremoveLiveTimers=function(selector){\n\t\t\tif(liveTimers[selector]){\n\t\t\t\tclearTimeout(liveTimers[selector]);\n\t\t\t\t_delete(liveTimers,selector);\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* normalizes axis option to valid values: \"y\", \"x\", \"yx\" */\n\t\t_findAxis=function(val){\n\t\t\treturn (val===\"yx\" || val===\"xy\" || val===\"auto\") ? \"yx\" : (val===\"x\" || val===\"horizontal\") ? \"x\" : \"y\";\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* normalizes scrollButtons.scrollType option to valid values: \"stepless\", \"stepped\" */\n\t\t_findScrollButtonsType=function(val){\n\t\t\treturn (val===\"stepped\" || val===\"pixels\" || val===\"step\" || val===\"click\") ? \"stepped\" : \"stepless\";\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* generates plugin markup */\n\t\t_pluginMarkup=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\texpandClass=o.autoExpandScrollbar ? \" \"+classes[1]+\"_expand\" : \"\",\n\t\t\t\tscrollbar=[\"<div id='mCSB_\"+d.idx+\"_scrollbar_vertical' class='mCSB_scrollTools mCSB_\"+d.idx+\"_scrollbar mCS-\"+o.theme+\" mCSB_scrollTools_vertical\"+expandClass+\"'><div class='\"+classes[12]+\"'><div id='mCSB_\"+d.idx+\"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>\",\"<div id='mCSB_\"+d.idx+\"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_\"+d.idx+\"_scrollbar mCS-\"+o.theme+\" mCSB_scrollTools_horizontal\"+expandClass+\"'><div class='\"+classes[12]+\"'><div id='mCSB_\"+d.idx+\"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>\"],\n\t\t\t\twrapperClass=o.axis===\"yx\" ? \"mCSB_vertical_horizontal\" : o.axis===\"x\" ? \"mCSB_horizontal\" : \"mCSB_vertical\",\n\t\t\t\tscrollbars=o.axis===\"yx\" ? scrollbar[0]+scrollbar[1] : o.axis===\"x\" ? scrollbar[1] : scrollbar[0],\n\t\t\t\tcontentWrapper=o.axis===\"yx\" ? \"<div id='mCSB_\"+d.idx+\"_container_wrapper' class='mCSB_container_wrapper' />\" : \"\",\n\t\t\t\tautoHideClass=o.autoHideScrollbar ? \" \"+classes[6] : \"\",\n\t\t\t\tscrollbarDirClass=(o.axis!==\"x\" && d.langDir===\"rtl\") ? \" \"+classes[7] : \"\";\n\t\t\tif(o.setWidth){$this.css(\"width\",o.setWidth);} /* set element width */\n\t\t\tif(o.setHeight){$this.css(\"height\",o.setHeight);} /* set element height */\n\t\t\to.setLeft=(o.axis!==\"y\" && d.langDir===\"rtl\") ? \"989999px\" : o.setLeft; /* adjust left position for rtl direction */\n\t\t\t$this.addClass(pluginNS+\" _\"+pluginPfx+\"_\"+d.idx+autoHideClass+scrollbarDirClass).wrapInner(\"<div id='mCSB_\"+d.idx+\"' class='mCustomScrollBox mCS-\"+o.theme+\" \"+wrapperClass+\"'><div id='mCSB_\"+d.idx+\"_container' class='mCSB_container' style='position:relative; top:\"+o.setTop+\"; left:\"+o.setLeft+\";' dir='\"+d.langDir+\"' /></div>\");\n\t\t\tvar mCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\");\n\t\t\tif(o.axis!==\"y\" && !o.advanced.autoExpandHorizontalScroll){\n\t\t\t\tmCSB_container.css(\"width\",_contentWidth(mCSB_container));\n\t\t\t}\n\t\t\tif(o.scrollbarPosition===\"outside\"){\n\t\t\t\tif($this.css(\"position\")===\"static\"){ /* requires elements with non-static position */\n\t\t\t\t\t$this.css(\"position\",\"relative\");\n\t\t\t\t}\n\t\t\t\t$this.css(\"overflow\",\"visible\");\n\t\t\t\tmCustomScrollBox.addClass(\"mCSB_outside\").after(scrollbars);\n\t\t\t}else{\n\t\t\t\tmCustomScrollBox.addClass(\"mCSB_inside\").append(scrollbars);\n\t\t\t\tmCSB_container.wrap(contentWrapper);\n\t\t\t}\n\t\t\t_scrollButtons.call(this); /* add scrollbar buttons */\n\t\t\t/* minimum dragger length */\n\t\t\tvar mCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")];\n\t\t\tmCSB_dragger[0].css(\"min-height\",mCSB_dragger[0].height());\n\t\t\tmCSB_dragger[1].css(\"min-width\",mCSB_dragger[1].width());\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* calculates content width */\n\t\t_contentWidth=function(el){\n\t\t\tvar val=[el[0].scrollWidth,Math.max.apply(Math,el.children().map(function(){return $(this).outerWidth(true);}).get())],w=el.parent().width();\n\t\t\treturn val[0]>w ? val[0] : val[1]>w ? val[1] : \"100%\";\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* expands content horizontally */\n\t\t_expandContentHorizontally=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\");\n\t\t\tif(o.advanced.autoExpandHorizontalScroll && o.axis!==\"y\"){\n\t\t\t\t/* calculate scrollWidth */\n\t\t\t\tmCSB_container.css({\"width\":\"auto\",\"min-width\":0,\"overflow-x\":\"scroll\"});\n\t\t\t\tvar w=Math.ceil(mCSB_container[0].scrollWidth);\n\t\t\t\tif(o.advanced.autoExpandHorizontalScroll===3 || (o.advanced.autoExpandHorizontalScroll!==2 && w>mCSB_container.parent().width())){\n\t\t\t\t\tmCSB_container.css({\"width\":w,\"min-width\":\"100%\",\"overflow-x\":\"inherit\"});\n\t\t\t\t}else{\n\t\t\t\t\t/* \n\t\t\t\t\twrap content with an infinite width div and set its position to absolute and width to auto. \n\t\t\t\t\tSetting width to auto before calculating the actual width is important! \n\t\t\t\t\tWe must let the browser set the width as browser zoom values are impossible to calculate.\n\t\t\t\t\t*/\n\t\t\t\t\tmCSB_container.css({\"overflow-x\":\"inherit\",\"position\":\"absolute\"})\n\t\t\t\t\t\t.wrap(\"<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />\")\n\t\t\t\t\t\t.css({ /* set actual width, original position and un-wrap */\n\t\t\t\t\t\t\t/* \n\t\t\t\t\t\t\tget the exact width (with decimals) and then round-up. \n\t\t\t\t\t\t\tUsing jquery outerWidth() will round the width value which will mess up with inner elements that have non-integer width\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\"width\":(Math.ceil(mCSB_container[0].getBoundingClientRect().right+0.4)-Math.floor(mCSB_container[0].getBoundingClientRect().left)),\n\t\t\t\t\t\t\t\"min-width\":\"100%\",\n\t\t\t\t\t\t\t\"position\":\"relative\"\n\t\t\t\t\t\t}).unwrap();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* adds scrollbar buttons */\n\t\t_scrollButtons=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tmCSB_scrollTools=$(\".mCSB_\"+d.idx+\"_scrollbar:first\"),\n\t\t\t\ttabindex=!_isNumeric(o.scrollButtons.tabindex) ? \"\" : \"tabindex='\"+o.scrollButtons.tabindex+\"'\",\n\t\t\t\tbtnHTML=[\n\t\t\t\t\t\"<a href='#' class='\"+classes[13]+\"' \"+tabindex+\" />\",\n\t\t\t\t\t\"<a href='#' class='\"+classes[14]+\"' \"+tabindex+\" />\",\n\t\t\t\t\t\"<a href='#' class='\"+classes[15]+\"' \"+tabindex+\" />\",\n\t\t\t\t\t\"<a href='#' class='\"+classes[16]+\"' \"+tabindex+\" />\"\n\t\t\t\t],\n\t\t\t\tbtn=[(o.axis===\"x\" ? btnHTML[2] : btnHTML[0]),(o.axis===\"x\" ? btnHTML[3] : btnHTML[1]),btnHTML[2],btnHTML[3]];\n\t\t\tif(o.scrollButtons.enable){\n\t\t\t\tmCSB_scrollTools.prepend(btn[0]).append(btn[1]).next(\".mCSB_scrollTools\").prepend(btn[2]).append(btn[3]);\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* auto-adjusts scrollbar dragger length */\n\t\t_setDraggerLength=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tmCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")],\n\t\t\t\tratio=[mCustomScrollBox.height()/mCSB_container.outerHeight(false),mCustomScrollBox.width()/mCSB_container.outerWidth(false)],\n\t\t\t\tl=[\n\t\t\t\t\tparseInt(mCSB_dragger[0].css(\"min-height\")),Math.round(ratio[0]*mCSB_dragger[0].parent().height()),\n\t\t\t\t\tparseInt(mCSB_dragger[1].css(\"min-width\")),Math.round(ratio[1]*mCSB_dragger[1].parent().width())\n\t\t\t\t],\n\t\t\t\th=oldIE && (l[1]<l[0]) ? l[0] : l[1],w=oldIE && (l[3]<l[2]) ? l[2] : l[3];\n\t\t\tmCSB_dragger[0].css({\n\t\t\t\t\"height\":h,\"max-height\":(mCSB_dragger[0].parent().height()-10)\n\t\t\t}).find(\".mCSB_dragger_bar\").css({\"line-height\":l[0]+\"px\"});\n\t\t\tmCSB_dragger[1].css({\n\t\t\t\t\"width\":w,\"max-width\":(mCSB_dragger[1].parent().width()-10)\n\t\t\t});\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* calculates scrollbar to content ratio */\n\t\t_scrollRatio=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tmCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")],\n\t\t\t\tscrollAmount=[mCSB_container.outerHeight(false)-mCustomScrollBox.height(),mCSB_container.outerWidth(false)-mCustomScrollBox.width()],\n\t\t\t\tratio=[\n\t\t\t\t\tscrollAmount[0]/(mCSB_dragger[0].parent().height()-mCSB_dragger[0].height()),\n\t\t\t\t\tscrollAmount[1]/(mCSB_dragger[1].parent().width()-mCSB_dragger[1].width())\n\t\t\t\t];\n\t\t\td.scrollRatio={y:ratio[0],x:ratio[1]};\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* toggles scrolling classes */\n\t\t_onDragClasses=function(el,action,xpnd){\n\t\t\tvar expandClass=xpnd ? classes[0]+\"_expanded\" : \"\",\n\t\t\t\tscrollbar=el.closest(\".mCSB_scrollTools\");\n\t\t\tif(action===\"active\"){\n\t\t\t\tel.toggleClass(classes[0]+\" \"+expandClass); scrollbar.toggleClass(classes[1]); \n\t\t\t\tel[0]._draggable=el[0]._draggable ? 0 : 1;\n\t\t\t}else{\n\t\t\t\tif(!el[0]._draggable){\n\t\t\t\t\tif(action===\"hide\"){\n\t\t\t\t\t\tel.removeClass(classes[0]); scrollbar.removeClass(classes[1]);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tel.addClass(classes[0]); scrollbar.addClass(classes[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* checks if content overflows its container to determine if scrolling is required */\n\t\t_overflowed=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tcontentHeight=d.overflowed==null ? mCSB_container.height() : mCSB_container.outerHeight(false),\n\t\t\t\tcontentWidth=d.overflowed==null ? mCSB_container.width() : mCSB_container.outerWidth(false),\n\t\t\t\th=mCSB_container[0].scrollHeight,w=mCSB_container[0].scrollWidth;\n\t\t\tif(h>contentHeight){contentHeight=h;}\n\t\t\tif(w>contentWidth){contentWidth=w;}\n\t\t\treturn [contentHeight>mCustomScrollBox.height(),contentWidth>mCustomScrollBox.width()];\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* resets content position to 0 */\n\t\t_resetContentPosition=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tmCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")];\n\t\t\t_stop($this); /* stop any current scrolling before resetting */\n\t\t\tif((o.axis!==\"x\" && !d.overflowed[0]) || (o.axis===\"y\" && d.overflowed[0])){ /* reset y */\n\t\t\t\tmCSB_dragger[0].add(mCSB_container).css(\"top\",0);\n\t\t\t\t_scrollTo($this,\"_resetY\");\n\t\t\t}\n\t\t\tif((o.axis!==\"y\" && !d.overflowed[1]) || (o.axis===\"x\" && d.overflowed[1])){ /* reset x */\n\t\t\t\tvar cx=dx=0;\n\t\t\t\tif(d.langDir===\"rtl\"){ /* adjust left position for rtl direction */\n\t\t\t\t\tcx=mCustomScrollBox.width()-mCSB_container.outerWidth(false);\n\t\t\t\t\tdx=Math.abs(cx/d.scrollRatio.x);\n\t\t\t\t}\n\t\t\t\tmCSB_container.css(\"left\",cx);\n\t\t\t\tmCSB_dragger[1].css(\"left\",dx);\n\t\t\t\t_scrollTo($this,\"_resetX\");\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* binds scrollbar events */\n\t\t_bindEvents=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt;\n\t\t\tif(!d.bindEvents){ /* check if events are already bound */\n\t\t\t\t_draggable.call(this);\n\t\t\t\tif(o.contentTouchScroll){_contentDraggable.call(this);}\n\t\t\t\t_selectable.call(this);\n\t\t\t\tif(o.mouseWheel.enable){ /* bind mousewheel fn when plugin is available */\n\t\t\t\t\tfunction _mwt(){\n\t\t\t\t\t\tmousewheelTimeout=setTimeout(function(){\n\t\t\t\t\t\t\tif(!$.event.special.mousewheel){\n\t\t\t\t\t\t\t\t_mwt();\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tclearTimeout(mousewheelTimeout);\n\t\t\t\t\t\t\t\t_mousewheel.call($this[0]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},100);\n\t\t\t\t\t}\n\t\t\t\t\tvar mousewheelTimeout;\n\t\t\t\t\t_mwt();\n\t\t\t\t}\n\t\t\t\t_draggerRail.call(this);\n\t\t\t\t_wrapperScroll.call(this);\n\t\t\t\tif(o.advanced.autoScrollOnFocus){_focus.call(this);}\n\t\t\t\tif(o.scrollButtons.enable){_buttons.call(this);}\n\t\t\t\tif(o.keyboard.enable){_keyboard.call(this);}\n\t\t\t\td.bindEvents=true;\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* unbinds scrollbar events */\n\t\t_unbindEvents=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tsb=\".mCSB_\"+d.idx+\"_scrollbar\",\n\t\t\t\tsel=$(\"#mCSB_\"+d.idx+\",#mCSB_\"+d.idx+\"_container,#mCSB_\"+d.idx+\"_container_wrapper,\"+sb+\" .\"+classes[12]+\",#mCSB_\"+d.idx+\"_dragger_vertical,#mCSB_\"+d.idx+\"_dragger_horizontal,\"+sb+\">a\"),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\");\n\t\t\tif(o.advanced.releaseDraggableSelectors){sel.add($(o.advanced.releaseDraggableSelectors));}\n\t\t\tif(o.advanced.extraDraggableSelectors){sel.add($(o.advanced.extraDraggableSelectors));}\n\t\t\tif(d.bindEvents){ /* check if events are bound */\n\t\t\t\t/* unbind namespaced events from document/selectors */\n\t\t\t\t$(document).add($(!_canAccessIFrame() || top.document)).unbind(\".\"+namespace);\n\t\t\t\tsel.each(function(){\n\t\t\t\t\t$(this).unbind(\".\"+namespace);\n\t\t\t\t});\n\t\t\t\t/* clear and delete timeouts/objects */\n\t\t\t\tclearTimeout($this[0]._focusTimeout); _delete($this[0],\"_focusTimeout\");\n\t\t\t\tclearTimeout(d.sequential.step); _delete(d.sequential,\"step\");\n\t\t\t\tclearTimeout(mCSB_container[0].onCompleteTimeout); _delete(mCSB_container[0],\"onCompleteTimeout\");\n\t\t\t\td.bindEvents=false;\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* toggles scrollbar visibility */\n\t\t_scrollbarVisibility=function(disabled){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tcontentWrapper=$(\"#mCSB_\"+d.idx+\"_container_wrapper\"),\n\t\t\t\tcontent=contentWrapper.length ? contentWrapper : $(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tscrollbar=[$(\"#mCSB_\"+d.idx+\"_scrollbar_vertical\"),$(\"#mCSB_\"+d.idx+\"_scrollbar_horizontal\")],\n\t\t\t\tmCSB_dragger=[scrollbar[0].find(\".mCSB_dragger\"),scrollbar[1].find(\".mCSB_dragger\")];\n\t\t\tif(o.axis!==\"x\"){\n\t\t\t\tif(d.overflowed[0] && !disabled){\n\t\t\t\t\tscrollbar[0].add(mCSB_dragger[0]).add(scrollbar[0].children(\"a\")).css(\"display\",\"block\");\n\t\t\t\t\tcontent.removeClass(classes[8]+\" \"+classes[10]);\n\t\t\t\t}else{\n\t\t\t\t\tif(o.alwaysShowScrollbar){\n\t\t\t\t\t\tif(o.alwaysShowScrollbar!==2){mCSB_dragger[0].css(\"display\",\"none\");}\n\t\t\t\t\t\tcontent.removeClass(classes[10]);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tscrollbar[0].css(\"display\",\"none\");\n\t\t\t\t\t\tcontent.addClass(classes[10]);\n\t\t\t\t\t}\n\t\t\t\t\tcontent.addClass(classes[8]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(o.axis!==\"y\"){\n\t\t\t\tif(d.overflowed[1] && !disabled){\n\t\t\t\t\tscrollbar[1].add(mCSB_dragger[1]).add(scrollbar[1].children(\"a\")).css(\"display\",\"block\");\n\t\t\t\t\tcontent.removeClass(classes[9]+\" \"+classes[11]);\n\t\t\t\t}else{\n\t\t\t\t\tif(o.alwaysShowScrollbar){\n\t\t\t\t\t\tif(o.alwaysShowScrollbar!==2){mCSB_dragger[1].css(\"display\",\"none\");}\n\t\t\t\t\t\tcontent.removeClass(classes[11]);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tscrollbar[1].css(\"display\",\"none\");\n\t\t\t\t\t\tcontent.addClass(classes[11]);\n\t\t\t\t\t}\n\t\t\t\t\tcontent.addClass(classes[9]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!d.overflowed[0] && !d.overflowed[1]){\n\t\t\t\t$this.addClass(classes[5]);\n\t\t\t}else{\n\t\t\t\t$this.removeClass(classes[5]);\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* returns input coordinates of pointer, touch and mouse events (relative to document) */\n\t\t_coordinates=function(e){\n\t\t\tvar t=e.type,o=e.target.ownerDocument!==document && frameElement!==null ? [$(frameElement).offset().top,$(frameElement).offset().left] : null,\n\t\t\t\tio=_canAccessIFrame() && e.target.ownerDocument!==top.document && frameElement!==null ? [$(e.view.frameElement).offset().top,$(e.view.frameElement).offset().left] : [0,0];\n\t\t\tswitch(t){\n\t\t\t\tcase \"pointerdown\": case \"MSPointerDown\": case \"pointermove\": case \"MSPointerMove\": case \"pointerup\": case \"MSPointerUp\":\n\t\t\t\t\treturn o ? [e.originalEvent.pageY-o[0]+io[0],e.originalEvent.pageX-o[1]+io[1],false] : [e.originalEvent.pageY,e.originalEvent.pageX,false];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"touchstart\": case \"touchmove\": case \"touchend\":\n\t\t\t\t\tvar touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0],\n\t\t\t\t\t\ttouches=e.originalEvent.touches.length || e.originalEvent.changedTouches.length;\n\t\t\t\t\treturn e.target.ownerDocument!==document ? [touch.screenY,touch.screenX,touches>1] : [touch.pageY,touch.pageX,touches>1];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn o ? [e.pageY-o[0]+io[0],e.pageX-o[1]+io[1],false] : [e.pageY,e.pageX,false];\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tSCROLLBAR DRAG EVENTS\n\t\tscrolls content via scrollbar dragging \n\t\t*/\n\t\t_draggable=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tdraggerId=[\"mCSB_\"+d.idx+\"_dragger_vertical\",\"mCSB_\"+d.idx+\"_dragger_horizontal\"],\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tmCSB_dragger=$(\"#\"+draggerId[0]+\",#\"+draggerId[1]),\n\t\t\t\tdraggable,dragY,dragX,\n\t\t\t\trds=o.advanced.releaseDraggableSelectors ? mCSB_dragger.add($(o.advanced.releaseDraggableSelectors)) : mCSB_dragger,\n\t\t\t\teds=o.advanced.extraDraggableSelectors ? $(!_canAccessIFrame() || top.document).add($(o.advanced.extraDraggableSelectors)) : $(!_canAccessIFrame() || top.document);\n\t\t\tmCSB_dragger.bind(\"contextmenu.\"+namespace,function(e){\n\t\t\t\te.preventDefault(); //prevent right click\n\t\t\t}).bind(\"mousedown.\"+namespace+\" touchstart.\"+namespace+\" pointerdown.\"+namespace+\" MSPointerDown.\"+namespace,function(e){\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\te.preventDefault();\n\t\t\t\tif(!_mouseBtnLeft(e)){return;} /* left mouse button only */\n\t\t\t\ttouchActive=true;\n\t\t\t\tif(oldIE){document.onselectstart=function(){return false;}} /* disable text selection for IE < 9 */\n\t\t\t\t_iframe.call(mCSB_container,false); /* enable scrollbar dragging over iframes by disabling their events */\n\t\t\t\t_stop($this);\n\t\t\t\tdraggable=$(this);\n\t\t\t\tvar offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left,\n\t\t\t\t\th=draggable.height()+offset.top,w=draggable.width()+offset.left;\n\t\t\t\tif(y<h && y>0 && x<w && x>0){\n\t\t\t\t\tdragY=y; \n\t\t\t\t\tdragX=x;\n\t\t\t\t}\n\t\t\t\t_onDragClasses(draggable,\"active\",o.autoExpandScrollbar); \n\t\t\t}).bind(\"touchmove.\"+namespace,function(e){\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\te.preventDefault();\n\t\t\t\tvar offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left;\n\t\t\t\t_drag(dragY,dragX,y,x);\n\t\t\t});\n\t\t\t$(document).add(eds).bind(\"mousemove.\"+namespace+\" pointermove.\"+namespace+\" MSPointerMove.\"+namespace,function(e){\n\t\t\t\tif(draggable){\n\t\t\t\t\tvar offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left;\n\t\t\t\t\tif(dragY===y && dragX===x){return;} /* has it really moved? */\n\t\t\t\t\t_drag(dragY,dragX,y,x);\n\t\t\t\t}\n\t\t\t}).add(rds).bind(\"mouseup.\"+namespace+\" touchend.\"+namespace+\" pointerup.\"+namespace+\" MSPointerUp.\"+namespace,function(e){\n\t\t\t\tif(draggable){\n\t\t\t\t\t_onDragClasses(draggable,\"active\",o.autoExpandScrollbar); \n\t\t\t\t\tdraggable=null;\n\t\t\t\t}\n\t\t\t\ttouchActive=false;\n\t\t\t\tif(oldIE){document.onselectstart=null;} /* enable text selection for IE < 9 */\n\t\t\t\t_iframe.call(mCSB_container,true); /* enable iframes events */\n\t\t\t});\n\t\t\tfunction _drag(dragY,dragX,y,x){\n\t\t\t\tmCSB_container[0].idleTimer=o.scrollInertia<233 ? 250 : 0;\n\t\t\t\tif(draggable.attr(\"id\")===draggerId[1]){\n\t\t\t\t\tvar dir=\"x\",to=((draggable[0].offsetLeft-dragX)+x)*d.scrollRatio.x;\n\t\t\t\t}else{\n\t\t\t\t\tvar dir=\"y\",to=((draggable[0].offsetTop-dragY)+y)*d.scrollRatio.y;\n\t\t\t\t}\n\t\t\t\t_scrollTo($this,to.toString(),{dir:dir,drag:true});\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tTOUCH SWIPE EVENTS\n\t\tscrolls content via touch swipe \n\t\tEmulates the native touch-swipe scrolling with momentum found in iOS, Android and WP devices \n\t\t*/\n\t\t_contentDraggable=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tmCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")],\n\t\t\t\tdraggable,dragY,dragX,touchStartY,touchStartX,touchMoveY=[],touchMoveX=[],startTime,runningTime,endTime,distance,speed,amount,\n\t\t\t\tdurA=0,durB,overwrite=o.axis===\"yx\" ? \"none\" : \"all\",touchIntent=[],touchDrag,docDrag,\n\t\t\t\tiframe=mCSB_container.find(\"iframe\"),\n\t\t\t\tevents=[\n\t\t\t\t\t\"touchstart.\"+namespace+\" pointerdown.\"+namespace+\" MSPointerDown.\"+namespace, //start\n\t\t\t\t\t\"touchmove.\"+namespace+\" pointermove.\"+namespace+\" MSPointerMove.\"+namespace, //move\n\t\t\t\t\t\"touchend.\"+namespace+\" pointerup.\"+namespace+\" MSPointerUp.\"+namespace //end\n\t\t\t\t],\n\t\t\t\ttouchAction=document.body.style.touchAction!==undefined && document.body.style.touchAction!==\"\";\n\t\t\tmCSB_container.bind(events[0],function(e){\n\t\t\t\t_onTouchstart(e);\n\t\t\t}).bind(events[1],function(e){\n\t\t\t\t_onTouchmove(e);\n\t\t\t});\n\t\t\tmCustomScrollBox.bind(events[0],function(e){\n\t\t\t\t_onTouchstart2(e);\n\t\t\t}).bind(events[2],function(e){\n\t\t\t\t_onTouchend(e);\n\t\t\t});\n\t\t\tif(iframe.length){\n\t\t\t\tiframe.each(function(){\n\t\t\t\t\t$(this).bind(\"load\",function(){\n\t\t\t\t\t\t/* bind events on accessible iframes */\n\t\t\t\t\t\tif(_canAccessIFrame(this)){\n\t\t\t\t\t\t\t$(this.contentDocument || this.contentWindow.document).bind(events[0],function(e){\n\t\t\t\t\t\t\t\t_onTouchstart(e);\n\t\t\t\t\t\t\t\t_onTouchstart2(e);\n\t\t\t\t\t\t\t}).bind(events[1],function(e){\n\t\t\t\t\t\t\t\t_onTouchmove(e);\n\t\t\t\t\t\t\t}).bind(events[2],function(e){\n\t\t\t\t\t\t\t\t_onTouchend(e);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\tfunction _onTouchstart(e){\n\t\t\t\tif(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}\n\t\t\t\ttouchable=1; touchDrag=0; docDrag=0; draggable=1;\n\t\t\t\t$this.removeClass(\"mCS_touch_action\");\n\t\t\t\tvar offset=mCSB_container.offset();\n\t\t\t\tdragY=_coordinates(e)[0]-offset.top;\n\t\t\t\tdragX=_coordinates(e)[1]-offset.left;\n\t\t\t\ttouchIntent=[_coordinates(e)[0],_coordinates(e)[1]];\n\t\t\t}\n\t\t\tfunction _onTouchmove(e){\n\t\t\t\tif(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){return;}\n\t\t\t\tif(!o.documentTouchScroll){e.preventDefault();} \n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\tif(docDrag && !touchDrag){return;}\n\t\t\t\tif(draggable){\n\t\t\t\t\trunningTime=_getTime();\n\t\t\t\t\tvar offset=mCustomScrollBox.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left,\n\t\t\t\t\t\teasing=\"mcsLinearOut\";\n\t\t\t\t\ttouchMoveY.push(y);\n\t\t\t\t\ttouchMoveX.push(x);\n\t\t\t\t\ttouchIntent[2]=Math.abs(_coordinates(e)[0]-touchIntent[0]); touchIntent[3]=Math.abs(_coordinates(e)[1]-touchIntent[1]);\n\t\t\t\t\tif(d.overflowed[0]){\n\t\t\t\t\t\tvar limit=mCSB_dragger[0].parent().height()-mCSB_dragger[0].height(),\n\t\t\t\t\t\t\tprevent=((dragY-y)>0 && (y-dragY)>-(limit*d.scrollRatio.y) && (touchIntent[3]*2<touchIntent[2] || o.axis===\"yx\"));\n\t\t\t\t\t}\n\t\t\t\t\tif(d.overflowed[1]){\n\t\t\t\t\t\tvar limitX=mCSB_dragger[1].parent().width()-mCSB_dragger[1].width(),\n\t\t\t\t\t\t\tpreventX=((dragX-x)>0 && (x-dragX)>-(limitX*d.scrollRatio.x) && (touchIntent[2]*2<touchIntent[3] || o.axis===\"yx\"));\n\t\t\t\t\t}\n\t\t\t\t\tif(prevent || preventX){ /* prevent native document scrolling */\n\t\t\t\t\t\tif(!touchAction){e.preventDefault();} \n\t\t\t\t\t\ttouchDrag=1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdocDrag=1;\n\t\t\t\t\t\t$this.addClass(\"mCS_touch_action\");\n\t\t\t\t\t}\n\t\t\t\t\tif(touchAction){e.preventDefault();} \n\t\t\t\t\tamount=o.axis===\"yx\" ? [(dragY-y),(dragX-x)] : o.axis===\"x\" ? [null,(dragX-x)] : [(dragY-y),null];\n\t\t\t\t\tmCSB_container[0].idleTimer=250;\n\t\t\t\t\tif(d.overflowed[0]){_drag(amount[0],durA,easing,\"y\",\"all\",true);}\n\t\t\t\t\tif(d.overflowed[1]){_drag(amount[1],durA,easing,\"x\",overwrite,true);}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction _onTouchstart2(e){\n\t\t\t\tif(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}\n\t\t\t\ttouchable=1;\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t_stop($this);\n\t\t\t\tstartTime=_getTime();\n\t\t\t\tvar offset=mCustomScrollBox.offset();\n\t\t\t\ttouchStartY=_coordinates(e)[0]-offset.top;\n\t\t\t\ttouchStartX=_coordinates(e)[1]-offset.left;\n\t\t\t\ttouchMoveY=[]; touchMoveX=[];\n\t\t\t}\n\t\t\tfunction _onTouchend(e){\n\t\t\t\tif(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){return;}\n\t\t\t\tdraggable=0;\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\ttouchDrag=0; docDrag=0;\n\t\t\t\tendTime=_getTime();\n\t\t\t\tvar offset=mCustomScrollBox.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left;\n\t\t\t\tif((endTime-runningTime)>30){return;}\n\t\t\t\tspeed=1000/(endTime-startTime);\n\t\t\t\tvar easing=\"mcsEaseOut\",slow=speed<2.5,\n\t\t\t\t\tdiff=slow ? [touchMoveY[touchMoveY.length-2],touchMoveX[touchMoveX.length-2]] : [0,0];\n\t\t\t\tdistance=slow ? [(y-diff[0]),(x-diff[1])] : [y-touchStartY,x-touchStartX];\n\t\t\t\tvar absDistance=[Math.abs(distance[0]),Math.abs(distance[1])];\n\t\t\t\tspeed=slow ? [Math.abs(distance[0]/4),Math.abs(distance[1]/4)] : [speed,speed];\n\t\t\t\tvar a=[\n\t\t\t\t\tMath.abs(mCSB_container[0].offsetTop)-(distance[0]*_m((absDistance[0]/speed[0]),speed[0])),\n\t\t\t\t\tMath.abs(mCSB_container[0].offsetLeft)-(distance[1]*_m((absDistance[1]/speed[1]),speed[1]))\n\t\t\t\t];\n\t\t\t\tamount=o.axis===\"yx\" ? [a[0],a[1]] : o.axis===\"x\" ? [null,a[1]] : [a[0],null];\n\t\t\t\tdurB=[(absDistance[0]*4)+o.scrollInertia,(absDistance[1]*4)+o.scrollInertia];\n\t\t\t\tvar md=parseInt(o.contentTouchScroll) || 0; /* absolute minimum distance required */\n\t\t\t\tamount[0]=absDistance[0]>md ? amount[0] : 0;\n\t\t\t\tamount[1]=absDistance[1]>md ? amount[1] : 0;\n\t\t\t\tif(d.overflowed[0]){_drag(amount[0],durB[0],easing,\"y\",overwrite,false);}\n\t\t\t\tif(d.overflowed[1]){_drag(amount[1],durB[1],easing,\"x\",overwrite,false);}\n\t\t\t}\n\t\t\tfunction _m(ds,s){\n\t\t\t\tvar r=[s*1.5,s*2,s/1.5,s/2];\n\t\t\t\tif(ds>90){\n\t\t\t\t\treturn s>4 ? r[0] : r[3];\n\t\t\t\t}else if(ds>60){\n\t\t\t\t\treturn s>3 ? r[3] : r[2];\n\t\t\t\t}else if(ds>30){\n\t\t\t\t\treturn s>8 ? r[1] : s>6 ? r[0] : s>4 ? s : r[2];\n\t\t\t\t}else{\n\t\t\t\t\treturn s>8 ? s : r[3];\n\t\t\t\t}\n\t\t\t}\n\t\t\tfunction _drag(amount,dur,easing,dir,overwrite,drag){\n\t\t\t\tif(!amount){return;}\n\t\t\t\t_scrollTo($this,amount.toString(),{dur:dur,scrollEasing:easing,dir:dir,overwrite:overwrite,drag:drag});\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tSELECT TEXT EVENTS \n\t\tscrolls content when text is selected \n\t\t*/\n\t\t_selectable=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,seq=d.sequential,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\twrapper=mCSB_container.parent(),\n\t\t\t\taction;\n\t\t\tmCSB_container.bind(\"mousedown.\"+namespace,function(e){\n\t\t\t\tif(touchable){return;}\n\t\t\t\tif(!action){action=1; touchActive=true;}\n\t\t\t}).add(document).bind(\"mousemove.\"+namespace,function(e){\n\t\t\t\tif(!touchable && action && _sel()){\n\t\t\t\t\tvar offset=mCSB_container.offset(),\n\t\t\t\t\t\ty=_coordinates(e)[0]-offset.top+mCSB_container[0].offsetTop,x=_coordinates(e)[1]-offset.left+mCSB_container[0].offsetLeft;\n\t\t\t\t\tif(y>0 && y<wrapper.height() && x>0 && x<wrapper.width()){\n\t\t\t\t\t\tif(seq.step){_seq(\"off\",null,\"stepped\");}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(o.axis!==\"x\" && d.overflowed[0]){\n\t\t\t\t\t\t\tif(y<0){\n\t\t\t\t\t\t\t\t_seq(\"on\",38);\n\t\t\t\t\t\t\t}else if(y>wrapper.height()){\n\t\t\t\t\t\t\t\t_seq(\"on\",40);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(o.axis!==\"y\" && d.overflowed[1]){\n\t\t\t\t\t\t\tif(x<0){\n\t\t\t\t\t\t\t\t_seq(\"on\",37);\n\t\t\t\t\t\t\t}else if(x>wrapper.width()){\n\t\t\t\t\t\t\t\t_seq(\"on\",39);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}).bind(\"mouseup.\"+namespace+\" dragend.\"+namespace,function(e){\n\t\t\t\tif(touchable){return;}\n\t\t\t\tif(action){action=0; _seq(\"off\",null);}\n\t\t\t\ttouchActive=false;\n\t\t\t});\n\t\t\tfunction _sel(){\n\t\t\t\treturn \twindow.getSelection ? window.getSelection().toString() : \n\t\t\t\t\t\tdocument.selection && document.selection.type!=\"Control\" ? document.selection.createRange().text : 0;\n\t\t\t}\n\t\t\tfunction _seq(a,c,s){\n\t\t\t\tseq.type=s && action ? \"stepped\" : \"stepless\";\n\t\t\t\tseq.scrollAmount=10;\n\t\t\t\t_sequentialScroll($this,a,c,\"mcsLinearOut\",s ? 60 : null);\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tMOUSE WHEEL EVENT\n\t\tscrolls content via mouse-wheel \n\t\tvia mouse-wheel plugin (https://github.com/brandonaaron/jquery-mousewheel)\n\t\t*/\n\t\t_mousewheel=function(){\n\t\t\tif(!$(this).data(pluginPfx)){return;} /* Check if the scrollbar is ready to use mousewheel events (issue: #185) */\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_dragger=[$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\")],\n\t\t\t\tiframe=$(\"#mCSB_\"+d.idx+\"_container\").find(\"iframe\");\n\t\t\tif(iframe.length){\n\t\t\t\tiframe.each(function(){\n\t\t\t\t\t$(this).bind(\"load\",function(){\n\t\t\t\t\t\t/* bind events on accessible iframes */\n\t\t\t\t\t\tif(_canAccessIFrame(this)){\n\t\t\t\t\t\t\t$(this.contentDocument || this.contentWindow.document).bind(\"mousewheel.\"+namespace,function(e,delta){\n\t\t\t\t\t\t\t\t_onMousewheel(e,delta);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\tmCustomScrollBox.bind(\"mousewheel.\"+namespace,function(e,delta){\n\t\t\t\t_onMousewheel(e,delta);\n\t\t\t});\n\t\t\tfunction _onMousewheel(e,delta){\n\t\t\t\t_stop($this);\n\t\t\t\tif(_disableMousewheel($this,e.target)){return;} /* disables mouse-wheel when hovering specific elements */\n\t\t\t\tvar deltaFactor=o.mouseWheel.deltaFactor!==\"auto\" ? parseInt(o.mouseWheel.deltaFactor) : (oldIE && e.deltaFactor<100) ? 100 : e.deltaFactor || 100,\n\t\t\t\t\tdur=o.scrollInertia;\n\t\t\t\tif(o.axis===\"x\" || o.mouseWheel.axis===\"x\"){\n\t\t\t\t\tvar dir=\"x\",\n\t\t\t\t\t\tpx=[Math.round(deltaFactor*d.scrollRatio.x),parseInt(o.mouseWheel.scrollAmount)],\n\t\t\t\t\t\tamount=o.mouseWheel.scrollAmount!==\"auto\" ? px[1] : px[0]>=mCustomScrollBox.width() ? mCustomScrollBox.width()*0.9 : px[0],\n\t\t\t\t\t\tcontentPos=Math.abs($(\"#mCSB_\"+d.idx+\"_container\")[0].offsetLeft),\n\t\t\t\t\t\tdraggerPos=mCSB_dragger[1][0].offsetLeft,\n\t\t\t\t\t\tlimit=mCSB_dragger[1].parent().width()-mCSB_dragger[1].width(),\n\t\t\t\t\t\tdlt=o.mouseWheel.axis===\"y\" ? (e.deltaY || delta) : e.deltaX;\n\t\t\t\t}else{\n\t\t\t\t\tvar dir=\"y\",\n\t\t\t\t\t\tpx=[Math.round(deltaFactor*d.scrollRatio.y),parseInt(o.mouseWheel.scrollAmount)],\n\t\t\t\t\t\tamount=o.mouseWheel.scrollAmount!==\"auto\" ? px[1] : px[0]>=mCustomScrollBox.height() ? mCustomScrollBox.height()*0.9 : px[0],\n\t\t\t\t\t\tcontentPos=Math.abs($(\"#mCSB_\"+d.idx+\"_container\")[0].offsetTop),\n\t\t\t\t\t\tdraggerPos=mCSB_dragger[0][0].offsetTop,\n\t\t\t\t\t\tlimit=mCSB_dragger[0].parent().height()-mCSB_dragger[0].height(),\n\t\t\t\t\t\tdlt=e.deltaY || delta;\n\t\t\t\t}\n\t\t\t\tif((dir===\"y\" && !d.overflowed[0]) || (dir===\"x\" && !d.overflowed[1])){return;}\n\t\t\t\tif(o.mouseWheel.invert || e.webkitDirectionInvertedFromDevice){dlt=-dlt;}\n\t\t\t\tif(o.mouseWheel.normalizeDelta){dlt=dlt<0 ? -1 : 1;}\n\t\t\t\tif((dlt>0 && draggerPos!==0) || (dlt<0 && draggerPos!==limit) || o.mouseWheel.preventDefault){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t}\n\t\t\t\tif(e.deltaFactor<5 && !o.mouseWheel.normalizeDelta){\n\t\t\t\t\t//very low deltaFactor values mean some kind of delta acceleration (e.g. osx trackpad), so adjusting scrolling accordingly\n\t\t\t\t\tamount=e.deltaFactor; dur=17;\n\t\t\t\t}\n\t\t\t\t_scrollTo($this,(contentPos-(dlt*amount)).toString(),{dir:dir,dur:dur});\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* checks if iframe can be accessed */\n\t\t_canAccessIFrameCache=new Object(),\n\t\t_canAccessIFrame=function(iframe){\n\t\t var result=false,cacheKey=false,html=null;\n\t\t if(iframe===undefined){\n\t\t\t\tcacheKey=\"#empty\";\n\t\t }else if($(iframe).attr(\"id\")!==undefined){\n\t\t\t\tcacheKey=$(iframe).attr(\"id\");\n\t\t }\n\t\t\tif(cacheKey!==false && _canAccessIFrameCache[cacheKey]!==undefined){\n\t\t\t\treturn _canAccessIFrameCache[cacheKey];\n\t\t\t}\n\t\t\tif(!iframe){\n\t\t\t\ttry{\n\t\t\t\t\tvar doc=top.document;\n\t\t\t\t\thtml=doc.body.innerHTML;\n\t\t\t\t}catch(err){/* do nothing */}\n\t\t\t\tresult=(html!==null);\n\t\t\t}else{\n\t\t\t\ttry{\n\t\t\t\t\tvar doc=iframe.contentDocument || iframe.contentWindow.document;\n\t\t\t\t\thtml=doc.body.innerHTML;\n\t\t\t\t}catch(err){/* do nothing */}\n\t\t\t\tresult=(html!==null);\n\t\t\t}\n\t\t\tif(cacheKey!==false){_canAccessIFrameCache[cacheKey]=result;}\n\t\t\treturn result;\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* switches iframe's pointer-events property (drag, mousewheel etc. over cross-domain iframes) */\n\t\t_iframe=function(evt){\n\t\t\tvar el=this.find(\"iframe\");\n\t\t\tif(!el.length){return;} /* check if content contains iframes */\n\t\t\tvar val=!evt ? \"none\" : \"auto\";\n\t\t\tel.css(\"pointer-events\",val); /* for IE11, iframe's display property should not be \"block\" */\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* disables mouse-wheel when hovering specific elements like select, datalist etc. */\n\t\t_disableMousewheel=function(el,target){\n\t\t\tvar tag=target.nodeName.toLowerCase(),\n\t\t\t\ttags=el.data(pluginPfx).opt.mouseWheel.disableOver,\n\t\t\t\t/* elements that require focus */\n\t\t\t\tfocusTags=[\"select\",\"textarea\"];\n\t\t\treturn $.inArray(tag,tags) > -1 && !($.inArray(tag,focusTags) > -1 && !$(target).is(\":focus\"));\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tDRAGGER RAIL CLICK EVENT\n\t\tscrolls content via dragger rail \n\t\t*/\n\t\t_draggerRail=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\twrapper=mCSB_container.parent(),\n\t\t\t\tmCSB_draggerContainer=$(\".mCSB_\"+d.idx+\"_scrollbar .\"+classes[12]),\n\t\t\t\tclickable;\n\t\t\tmCSB_draggerContainer.bind(\"mousedown.\"+namespace+\" touchstart.\"+namespace+\" pointerdown.\"+namespace+\" MSPointerDown.\"+namespace,function(e){\n\t\t\t\ttouchActive=true;\n\t\t\t\tif(!$(e.target).hasClass(\"mCSB_dragger\")){clickable=1;}\n\t\t\t}).bind(\"touchend.\"+namespace+\" pointerup.\"+namespace+\" MSPointerUp.\"+namespace,function(e){\n\t\t\t\ttouchActive=false;\n\t\t\t}).bind(\"click.\"+namespace,function(e){\n\t\t\t\tif(!clickable){return;}\n\t\t\t\tclickable=0;\n\t\t\t\tif($(e.target).hasClass(classes[12]) || $(e.target).hasClass(\"mCSB_draggerRail\")){\n\t\t\t\t\t_stop($this);\n\t\t\t\t\tvar el=$(this),mCSB_dragger=el.find(\".mCSB_dragger\");\n\t\t\t\t\tif(el.parent(\".mCSB_scrollTools_horizontal\").length>0){\n\t\t\t\t\t\tif(!d.overflowed[1]){return;}\n\t\t\t\t\t\tvar dir=\"x\",\n\t\t\t\t\t\t\tclickDir=e.pageX>mCSB_dragger.offset().left ? -1 : 1,\n\t\t\t\t\t\t\tto=Math.abs(mCSB_container[0].offsetLeft)-(clickDir*(wrapper.width()*0.9));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(!d.overflowed[0]){return;}\n\t\t\t\t\t\tvar dir=\"y\",\n\t\t\t\t\t\t\tclickDir=e.pageY>mCSB_dragger.offset().top ? -1 : 1,\n\t\t\t\t\t\t\tto=Math.abs(mCSB_container[0].offsetTop)-(clickDir*(wrapper.height()*0.9));\n\t\t\t\t\t}\n\t\t\t\t\t_scrollTo($this,to.toString(),{dir:dir,scrollEasing:\"mcsEaseInOut\"});\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tFOCUS EVENT\n\t\tscrolls content via element focus (e.g. clicking an input, pressing TAB key etc.)\n\t\t*/\n\t\t_focus=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\twrapper=mCSB_container.parent();\n\t\t\tmCSB_container.bind(\"focusin.\"+namespace,function(e){\n\t\t\t\tvar el=$(document.activeElement),\n\t\t\t\t\tnested=mCSB_container.find(\".mCustomScrollBox\").length,\n\t\t\t\t\tdur=0;\n\t\t\t\tif(!el.is(o.advanced.autoScrollOnFocus)){return;}\n\t\t\t\t_stop($this);\n\t\t\t\tclearTimeout($this[0]._focusTimeout);\n\t\t\t\t$this[0]._focusTimer=nested ? (dur+17)*nested : 0;\n\t\t\t\t$this[0]._focusTimeout=setTimeout(function(){\n\t\t\t\t\tvar\tto=[_childPos(el)[0],_childPos(el)[1]],\n\t\t\t\t\t\tcontentPos=[mCSB_container[0].offsetTop,mCSB_container[0].offsetLeft],\n\t\t\t\t\t\tisVisible=[\n\t\t\t\t\t\t\t(contentPos[0]+to[0]>=0 && contentPos[0]+to[0]<wrapper.height()-el.outerHeight(false)),\n\t\t\t\t\t\t\t(contentPos[1]+to[1]>=0 && contentPos[0]+to[1]<wrapper.width()-el.outerWidth(false))\n\t\t\t\t\t\t],\n\t\t\t\t\t\toverwrite=(o.axis===\"yx\" && !isVisible[0] && !isVisible[1]) ? \"none\" : \"all\";\n\t\t\t\t\tif(o.axis!==\"x\" && !isVisible[0]){\n\t\t\t\t\t\t_scrollTo($this,to[0].toString(),{dir:\"y\",scrollEasing:\"mcsEaseInOut\",overwrite:overwrite,dur:dur});\n\t\t\t\t\t}\n\t\t\t\t\tif(o.axis!==\"y\" && !isVisible[1]){\n\t\t\t\t\t\t_scrollTo($this,to[1].toString(),{dir:\"x\",scrollEasing:\"mcsEaseInOut\",overwrite:overwrite,dur:dur});\n\t\t\t\t\t}\n\t\t\t\t},$this[0]._focusTimer);\n\t\t\t});\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* sets content wrapper scrollTop/scrollLeft always to 0 */\n\t\t_wrapperScroll=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\twrapper=$(\"#mCSB_\"+d.idx+\"_container\").parent();\n\t\t\twrapper.bind(\"scroll.\"+namespace,function(e){\n\t\t\t\tif(wrapper.scrollTop()!==0 || wrapper.scrollLeft()!==0){\n\t\t\t\t\t$(\".mCSB_\"+d.idx+\"_scrollbar\").css(\"visibility\",\"hidden\"); /* hide scrollbar(s) */\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tBUTTONS EVENTS\n\t\tscrolls content via up, down, left and right buttons \n\t\t*/\n\t\t_buttons=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,seq=d.sequential,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tsel=\".mCSB_\"+d.idx+\"_scrollbar\",\n\t\t\t\tbtn=$(sel+\">a\");\n\t\t\tbtn.bind(\"contextmenu.\"+namespace,function(e){\n\t\t\t\te.preventDefault(); //prevent right click\n\t\t\t}).bind(\"mousedown.\"+namespace+\" touchstart.\"+namespace+\" pointerdown.\"+namespace+\" MSPointerDown.\"+namespace+\" mouseup.\"+namespace+\" touchend.\"+namespace+\" pointerup.\"+namespace+\" MSPointerUp.\"+namespace+\" mouseout.\"+namespace+\" pointerout.\"+namespace+\" MSPointerOut.\"+namespace+\" click.\"+namespace,function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tif(!_mouseBtnLeft(e)){return;} /* left mouse button only */\n\t\t\t\tvar btnClass=$(this).attr(\"class\");\n\t\t\t\tseq.type=o.scrollButtons.scrollType;\n\t\t\t\tswitch(e.type){\n\t\t\t\t\tcase \"mousedown\": case \"touchstart\": case \"pointerdown\": case \"MSPointerDown\":\n\t\t\t\t\t\tif(seq.type===\"stepped\"){return;}\n\t\t\t\t\t\ttouchActive=true;\n\t\t\t\t\t\td.tweenRunning=false;\n\t\t\t\t\t\t_seq(\"on\",btnClass);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"mouseup\": case \"touchend\": case \"pointerup\": case \"MSPointerUp\":\n\t\t\t\t\tcase \"mouseout\": case \"pointerout\": case \"MSPointerOut\":\n\t\t\t\t\t\tif(seq.type===\"stepped\"){return;}\n\t\t\t\t\t\ttouchActive=false;\n\t\t\t\t\t\tif(seq.dir){_seq(\"off\",btnClass);}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"click\":\n\t\t\t\t\t\tif(seq.type!==\"stepped\" || d.tweenRunning){return;}\n\t\t\t\t\t\t_seq(\"on\",btnClass);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfunction _seq(a,c){\n\t\t\t\t\tseq.scrollAmount=o.scrollButtons.scrollAmount;\n\t\t\t\t\t_sequentialScroll($this,a,c);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tKEYBOARD EVENTS\n\t\tscrolls content via keyboard \n\t\tKeys: up arrow, down arrow, left arrow, right arrow, PgUp, PgDn, Home, End\n\t\t*/\n\t\t_keyboard=function(){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,seq=d.sequential,\n\t\t\t\tnamespace=pluginPfx+\"_\"+d.idx,\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\twrapper=mCSB_container.parent(),\n\t\t\t\teditables=\"input,textarea,select,datalist,keygen,[contenteditable='true']\",\n\t\t\t\tiframe=mCSB_container.find(\"iframe\"),\n\t\t\t\tevents=[\"blur.\"+namespace+\" keydown.\"+namespace+\" keyup.\"+namespace];\n\t\t\tif(iframe.length){\n\t\t\t\tiframe.each(function(){\n\t\t\t\t\t$(this).bind(\"load\",function(){\n\t\t\t\t\t\t/* bind events on accessible iframes */\n\t\t\t\t\t\tif(_canAccessIFrame(this)){\n\t\t\t\t\t\t\t$(this.contentDocument || this.contentWindow.document).bind(events[0],function(e){\n\t\t\t\t\t\t\t\t_onKeyboard(e);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\tmCustomScrollBox.attr(\"tabindex\",\"0\").bind(events[0],function(e){\n\t\t\t\t_onKeyboard(e);\n\t\t\t});\n\t\t\tfunction _onKeyboard(e){\n\t\t\t\tswitch(e.type){\n\t\t\t\t\tcase \"blur\":\n\t\t\t\t\t\tif(d.tweenRunning && seq.dir){_seq(\"off\",null);}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"keydown\": case \"keyup\":\n\t\t\t\t\t\tvar code=e.keyCode ? e.keyCode : e.which,action=\"on\";\n\t\t\t\t\t\tif((o.axis!==\"x\" && (code===38 || code===40)) || (o.axis!==\"y\" && (code===37 || code===39))){\n\t\t\t\t\t\t\t/* up (38), down (40), left (37), right (39) arrows */\n\t\t\t\t\t\t\tif(((code===38 || code===40) && !d.overflowed[0]) || ((code===37 || code===39) && !d.overflowed[1])){return;}\n\t\t\t\t\t\t\tif(e.type===\"keyup\"){action=\"off\";}\n\t\t\t\t\t\t\tif(!$(document.activeElement).is(editables)){\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t_seq(action,code);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(code===33 || code===34){\n\t\t\t\t\t\t\t/* PgUp (33), PgDn (34) */\n\t\t\t\t\t\t\tif(d.overflowed[0] || d.overflowed[1]){\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(e.type===\"keyup\"){\n\t\t\t\t\t\t\t\t_stop($this);\n\t\t\t\t\t\t\t\tvar keyboardDir=code===34 ? -1 : 1;\n\t\t\t\t\t\t\t\tif(o.axis===\"x\" || (o.axis===\"yx\" && d.overflowed[1] && !d.overflowed[0])){\n\t\t\t\t\t\t\t\t\tvar dir=\"x\",to=Math.abs(mCSB_container[0].offsetLeft)-(keyboardDir*(wrapper.width()*0.9));\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tvar dir=\"y\",to=Math.abs(mCSB_container[0].offsetTop)-(keyboardDir*(wrapper.height()*0.9));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t_scrollTo($this,to.toString(),{dir:dir,scrollEasing:\"mcsEaseInOut\"});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(code===35 || code===36){\n\t\t\t\t\t\t\t/* End (35), Home (36) */\n\t\t\t\t\t\t\tif(!$(document.activeElement).is(editables)){\n\t\t\t\t\t\t\t\tif(d.overflowed[0] || d.overflowed[1]){\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(e.type===\"keyup\"){\n\t\t\t\t\t\t\t\t\tif(o.axis===\"x\" || (o.axis===\"yx\" && d.overflowed[1] && !d.overflowed[0])){\n\t\t\t\t\t\t\t\t\t\tvar dir=\"x\",to=code===35 ? Math.abs(wrapper.width()-mCSB_container.outerWidth(false)) : 0;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tvar dir=\"y\",to=code===35 ? Math.abs(wrapper.height()-mCSB_container.outerHeight(false)) : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t_scrollTo($this,to.toString(),{dir:dir,scrollEasing:\"mcsEaseInOut\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfunction _seq(a,c){\n\t\t\t\t\tseq.type=o.keyboard.scrollType;\n\t\t\t\t\tseq.scrollAmount=o.keyboard.scrollAmount;\n\t\t\t\t\tif(seq.type===\"stepped\" && d.tweenRunning){return;}\n\t\t\t\t\t_sequentialScroll($this,a,c);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* scrolls content sequentially (used when scrolling via buttons, keyboard arrows etc.) */\n\t\t_sequentialScroll=function(el,action,trigger,e,s){\n\t\t\tvar d=el.data(pluginPfx),o=d.opt,seq=d.sequential,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\tonce=seq.type===\"stepped\" ? true : false,\n\t\t\t\tsteplessSpeed=o.scrollInertia < 26 ? 26 : o.scrollInertia, /* 26/1.5=17 */\n\t\t\t\tsteppedSpeed=o.scrollInertia < 1 ? 17 : o.scrollInertia;\n\t\t\tswitch(action){\n\t\t\t\tcase \"on\":\n\t\t\t\t\tseq.dir=[\n\t\t\t\t\t\t(trigger===classes[16] || trigger===classes[15] || trigger===39 || trigger===37 ? \"x\" : \"y\"),\n\t\t\t\t\t\t(trigger===classes[13] || trigger===classes[15] || trigger===38 || trigger===37 ? -1 : 1)\n\t\t\t\t\t];\n\t\t\t\t\t_stop(el);\n\t\t\t\t\tif(_isNumeric(trigger) && seq.type===\"stepped\"){return;}\n\t\t\t\t\t_on(once);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"off\":\n\t\t\t\t\t_off();\n\t\t\t\t\tif(once || (d.tweenRunning && seq.dir)){\n\t\t\t\t\t\t_on(true);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t/* starts sequence */\n\t\t\tfunction _on(once){\n\t\t\t\tif(o.snapAmount){seq.scrollAmount=!(o.snapAmount instanceof Array) ? o.snapAmount : seq.dir[0]===\"x\" ? o.snapAmount[1] : o.snapAmount[0];} /* scrolling snapping */\n\t\t\t\tvar c=seq.type!==\"stepped\", /* continuous scrolling */\n\t\t\t\t\tt=s ? s : !once ? 1000/60 : c ? steplessSpeed/1.5 : steppedSpeed, /* timer */\n\t\t\t\t\tm=!once ? 2.5 : c ? 7.5 : 40, /* multiplier */\n\t\t\t\t\tcontentPos=[Math.abs(mCSB_container[0].offsetTop),Math.abs(mCSB_container[0].offsetLeft)],\n\t\t\t\t\tratio=[d.scrollRatio.y>10 ? 10 : d.scrollRatio.y,d.scrollRatio.x>10 ? 10 : d.scrollRatio.x],\n\t\t\t\t\tamount=seq.dir[0]===\"x\" ? contentPos[1]+(seq.dir[1]*(ratio[1]*m)) : contentPos[0]+(seq.dir[1]*(ratio[0]*m)),\n\t\t\t\t\tpx=seq.dir[0]===\"x\" ? contentPos[1]+(seq.dir[1]*parseInt(seq.scrollAmount)) : contentPos[0]+(seq.dir[1]*parseInt(seq.scrollAmount)),\n\t\t\t\t\tto=seq.scrollAmount!==\"auto\" ? px : amount,\n\t\t\t\t\teasing=e ? e : !once ? \"mcsLinear\" : c ? \"mcsLinearOut\" : \"mcsEaseInOut\",\n\t\t\t\t\tonComplete=!once ? false : true;\n\t\t\t\tif(once && t<17){\n\t\t\t\t\tto=seq.dir[0]===\"x\" ? contentPos[1] : contentPos[0];\n\t\t\t\t}\n\t\t\t\t_scrollTo(el,to.toString(),{dir:seq.dir[0],scrollEasing:easing,dur:t,onComplete:onComplete});\n\t\t\t\tif(once){\n\t\t\t\t\tseq.dir=false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tclearTimeout(seq.step);\n\t\t\t\tseq.step=setTimeout(function(){\n\t\t\t\t\t_on();\n\t\t\t\t},t);\n\t\t\t}\n\t\t\t/* stops sequence */\n\t\t\tfunction _off(){\n\t\t\t\tclearTimeout(seq.step);\n\t\t\t\t_delete(seq,\"step\");\n\t\t\t\t_stop(el);\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* returns a yx array from value */\n\t\t_arr=function(val){\n\t\t\tvar o=$(this).data(pluginPfx).opt,vals=[];\n\t\t\tif(typeof val===\"function\"){val=val();} /* check if the value is a single anonymous function */\n\t\t\t/* check if value is object or array, its length and create an array with yx values */\n\t\t\tif(!(val instanceof Array)){ /* object value (e.g. {y:\"100\",x:\"100\"}, 100 etc.) */\n\t\t\t\tvals[0]=val.y ? val.y : val.x || o.axis===\"x\" ? null : val;\n\t\t\t\tvals[1]=val.x ? val.x : val.y || o.axis===\"y\" ? null : val;\n\t\t\t}else{ /* array value (e.g. [100,100]) */\n\t\t\t\tvals=val.length>1 ? [val[0],val[1]] : o.axis===\"x\" ? [null,val[0]] : [val[0],null];\n\t\t\t}\n\t\t\t/* check if array values are anonymous functions */\n\t\t\tif(typeof vals[0]===\"function\"){vals[0]=vals[0]();}\n\t\t\tif(typeof vals[1]===\"function\"){vals[1]=vals[1]();}\n\t\t\treturn vals;\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* translates values (e.g. \"top\", 100, \"100px\", \"#id\") to actual scroll-to positions */\n\t\t_to=function(val,dir){\n\t\t\tif(val==null || typeof val==\"undefined\"){return;}\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\twrapper=mCSB_container.parent(),\n\t\t\t\tt=typeof val;\n\t\t\tif(!dir){dir=o.axis===\"x\" ? \"x\" : \"y\";}\n\t\t\tvar contentLength=dir===\"x\" ? mCSB_container.outerWidth(false)-wrapper.width() : mCSB_container.outerHeight(false)-wrapper.height(),\n\t\t\t\tcontentPos=dir===\"x\" ? mCSB_container[0].offsetLeft : mCSB_container[0].offsetTop,\n\t\t\t\tcssProp=dir===\"x\" ? \"left\" : \"top\";\n\t\t\tswitch(t){\n\t\t\t\tcase \"function\": /* this currently is not used. Consider removing it */\n\t\t\t\t\treturn val();\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"object\": /* js/jquery object */\n\t\t\t\t\tvar obj=val.jquery ? val : $(val);\n\t\t\t\t\tif(!obj.length){return;}\n\t\t\t\t\treturn dir===\"x\" ? _childPos(obj)[1] : _childPos(obj)[0];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"string\": case \"number\":\n\t\t\t\t\tif(_isNumeric(val)){ /* numeric value */\n\t\t\t\t\t\treturn Math.abs(val);\n\t\t\t\t\t}else if(val.indexOf(\"%\")!==-1){ /* percentage value */\n\t\t\t\t\t\treturn Math.abs(contentLength*parseInt(val)/100);\n\t\t\t\t\t}else if(val.indexOf(\"-=\")!==-1){ /* decrease value */\n\t\t\t\t\t\treturn Math.abs(contentPos-parseInt(val.split(\"-=\")[1]));\n\t\t\t\t\t}else if(val.indexOf(\"+=\")!==-1){ /* inrease value */\n\t\t\t\t\t\tvar p=(contentPos+parseInt(val.split(\"+=\")[1]));\n\t\t\t\t\t\treturn p>=0 ? 0 : Math.abs(p);\n\t\t\t\t\t}else if(val.indexOf(\"px\")!==-1 && _isNumeric(val.split(\"px\")[0])){ /* pixels string value (e.g. \"100px\") */\n\t\t\t\t\t\treturn Math.abs(val.split(\"px\")[0]);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(val===\"top\" || val===\"left\"){ /* special strings */\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}else if(val===\"bottom\"){\n\t\t\t\t\t\t\treturn Math.abs(wrapper.height()-mCSB_container.outerHeight(false));\n\t\t\t\t\t\t}else if(val===\"right\"){\n\t\t\t\t\t\t\treturn Math.abs(wrapper.width()-mCSB_container.outerWidth(false));\n\t\t\t\t\t\t}else if(val===\"first\" || val===\"last\"){\n\t\t\t\t\t\t\tvar obj=mCSB_container.find(\":\"+val);\n\t\t\t\t\t\t\treturn dir===\"x\" ? _childPos(obj)[1] : _childPos(obj)[0];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif($(val).length){ /* jquery selector */\n\t\t\t\t\t\t\t\treturn dir===\"x\" ? _childPos($(val))[1] : _childPos($(val))[0];\n\t\t\t\t\t\t\t}else{ /* other values (e.g. \"100em\") */\n\t\t\t\t\t\t\t\tmCSB_container.css(cssProp,val);\n\t\t\t\t\t\t\t\tmethods.update.call(null,$this[0]);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* calls the update method automatically */\n\t\t_autoUpdate=function(rem){\n\t\t\tvar $this=$(this),d=$this.data(pluginPfx),o=d.opt,\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\");\n\t\t\tif(rem){\n\t\t\t\t/* \n\t\t\t\tremoves autoUpdate timer \n\t\t\t\tusage: _autoUpdate.call(this,\"remove\");\n\t\t\t\t*/\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\t_delete(mCSB_container[0],\"autoUpdate\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tupd();\n\t\t\tfunction upd(){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tif($this.parents(\"html\").length===0){\n\t\t\t\t\t/* check element in dom tree */\n\t\t\t\t\t$this=null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tmCSB_container[0].autoUpdate=setTimeout(function(){\n\t\t\t\t\t/* update on specific selector(s) length and size change */\n\t\t\t\t\tif(o.advanced.updateOnSelectorChange){\n\t\t\t\t\t\td.poll.change.n=sizesSum();\n\t\t\t\t\t\tif(d.poll.change.n!==d.poll.change.o){\n\t\t\t\t\t\t\td.poll.change.o=d.poll.change.n;\n\t\t\t\t\t\t\tdoUpd(3);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/* update on main element and scrollbar size changes */\n\t\t\t\t\tif(o.advanced.updateOnContentResize){\n\t\t\t\t\t\td.poll.size.n=$this[0].scrollHeight+$this[0].scrollWidth+mCSB_container[0].offsetHeight+$this[0].offsetHeight+$this[0].offsetWidth;\n\t\t\t\t\t\tif(d.poll.size.n!==d.poll.size.o){\n\t\t\t\t\t\t\td.poll.size.o=d.poll.size.n;\n\t\t\t\t\t\t\tdoUpd(1);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/* update on image load */\n\t\t\t\t\tif(o.advanced.updateOnImageLoad){\n\t\t\t\t\t\tif(!(o.advanced.updateOnImageLoad===\"auto\" && o.axis===\"y\")){ //by default, it doesn't run on vertical content\n\t\t\t\t\t\t\td.poll.img.n=mCSB_container.find(\"img\").length;\n\t\t\t\t\t\t\tif(d.poll.img.n!==d.poll.img.o){\n\t\t\t\t\t\t\t\td.poll.img.o=d.poll.img.n;\n\t\t\t\t\t\t\t\tmCSB_container.find(\"img\").each(function(){\n\t\t\t\t\t\t\t\t\timgLoader(this);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(o.advanced.updateOnSelectorChange || o.advanced.updateOnContentResize || o.advanced.updateOnImageLoad){upd();}\n\t\t\t\t},o.advanced.autoUpdateTimeout);\n\t\t\t}\n\t\t\t/* a tiny image loader */\n\t\t\tfunction imgLoader(el){\n\t\t\t\tif($(el).hasClass(classes[2])){doUpd(); return;}\n\t\t\t\tvar img=new Image();\n\t\t\t\tfunction createDelegate(contextObject,delegateMethod){\n\t\t\t\t\treturn function(){return delegateMethod.apply(contextObject,arguments);}\n\t\t\t\t}\n\t\t\t\tfunction imgOnLoad(){\n\t\t\t\t\tthis.onload=null;\n\t\t\t\t\t$(el).addClass(classes[2]);\n\t\t\t\t\tdoUpd(2);\n\t\t\t\t}\n\t\t\t\timg.onload=createDelegate(img,imgOnLoad);\n\t\t\t\timg.src=el.src;\n\t\t\t}\n\t\t\t/* returns the total height and width sum of all elements matching the selector */\n\t\t\tfunction sizesSum(){\n\t\t\t\tif(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange=\"*\";}\n\t\t\t\tvar total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange);\n\t\t\t\tif(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=this.offsetHeight+this.offsetWidth;});}\n\t\t\t\treturn total;\n\t\t\t}\n\t\t\t/* calls the update method */\n\t\t\tfunction doUpd(cb){\n\t\t\t\tclearTimeout(mCSB_container[0].autoUpdate);\n\t\t\t\tmethods.update.call(null,$this[0],cb);\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* snaps scrolling to a multiple of a pixels number */\n\t\t_snapAmount=function(to,amount,offset){\n\t\t\treturn (Math.round(to/amount)*amount-offset); \n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* stops content and scrollbar animations */\n\t\t_stop=function(el){\n\t\t\tvar d=el.data(pluginPfx),\n\t\t\t\tsel=$(\"#mCSB_\"+d.idx+\"_container,#mCSB_\"+d.idx+\"_container_wrapper,#mCSB_\"+d.idx+\"_dragger_vertical,#mCSB_\"+d.idx+\"_dragger_horizontal\");\n\t\t\tsel.each(function(){\n\t\t\t\t_stopTween.call(this);\n\t\t\t});\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tANIMATES CONTENT \n\t\tThis is where the actual scrolling happens\n\t\t*/\n\t\t_scrollTo=function(el,to,options){\n\t\t\tvar d=el.data(pluginPfx),o=d.opt,\n\t\t\t\tdefaults={\n\t\t\t\t\ttrigger:\"internal\",\n\t\t\t\t\tdir:\"y\",\n\t\t\t\t\tscrollEasing:\"mcsEaseOut\",\n\t\t\t\t\tdrag:false,\n\t\t\t\t\tdur:o.scrollInertia,\n\t\t\t\t\toverwrite:\"all\",\n\t\t\t\t\tcallbacks:true,\n\t\t\t\t\tonStart:true,\n\t\t\t\t\tonUpdate:true,\n\t\t\t\t\tonComplete:true\n\t\t\t\t},\n\t\t\t\toptions=$.extend(defaults,options),\n\t\t\t\tdur=[options.dur,(options.drag ? 0 : options.dur)],\n\t\t\t\tmCustomScrollBox=$(\"#mCSB_\"+d.idx),\n\t\t\t\tmCSB_container=$(\"#mCSB_\"+d.idx+\"_container\"),\n\t\t\t\twrapper=mCSB_container.parent(),\n\t\t\t\ttotalScrollOffsets=o.callbacks.onTotalScrollOffset ? _arr.call(el,o.callbacks.onTotalScrollOffset) : [0,0],\n\t\t\t\ttotalScrollBackOffsets=o.callbacks.onTotalScrollBackOffset ? _arr.call(el,o.callbacks.onTotalScrollBackOffset) : [0,0];\n\t\t\td.trigger=options.trigger;\n\t\t\tif(wrapper.scrollTop()!==0 || wrapper.scrollLeft()!==0){ /* always reset scrollTop/Left */\n\t\t\t\t$(\".mCSB_\"+d.idx+\"_scrollbar\").css(\"visibility\",\"visible\");\n\t\t\t\twrapper.scrollTop(0).scrollLeft(0);\n\t\t\t}\n\t\t\tif(to===\"_resetY\" && !d.contentReset.y){\n\t\t\t\t/* callbacks: onOverflowYNone */\n\t\t\t\tif(_cb(\"onOverflowYNone\")){o.callbacks.onOverflowYNone.call(el[0]);}\n\t\t\t\td.contentReset.y=1;\n\t\t\t}\n\t\t\tif(to===\"_resetX\" && !d.contentReset.x){\n\t\t\t\t/* callbacks: onOverflowXNone */\n\t\t\t\tif(_cb(\"onOverflowXNone\")){o.callbacks.onOverflowXNone.call(el[0]);}\n\t\t\t\td.contentReset.x=1;\n\t\t\t}\n\t\t\tif(to===\"_resetY\" || to===\"_resetX\"){return;}\n\t\t\tif((d.contentReset.y || !el[0].mcs) && d.overflowed[0]){\n\t\t\t\t/* callbacks: onOverflowY */\n\t\t\t\tif(_cb(\"onOverflowY\")){o.callbacks.onOverflowY.call(el[0]);}\n\t\t\t\td.contentReset.x=null;\n\t\t\t}\n\t\t\tif((d.contentReset.x || !el[0].mcs) && d.overflowed[1]){\n\t\t\t\t/* callbacks: onOverflowX */\n\t\t\t\tif(_cb(\"onOverflowX\")){o.callbacks.onOverflowX.call(el[0]);}\n\t\t\t\td.contentReset.x=null;\n\t\t\t}\n\t\t\tif(o.snapAmount){ /* scrolling snapping */\n\t\t\t\tvar snapAmount=!(o.snapAmount instanceof Array) ? o.snapAmount : options.dir===\"x\" ? o.snapAmount[1] : o.snapAmount[0];\n\t\t\t\tto=_snapAmount(to,snapAmount,o.snapOffset);\n\t\t\t}\n\t\t\tswitch(options.dir){\n\t\t\t\tcase \"x\":\n\t\t\t\t\tvar mCSB_dragger=$(\"#mCSB_\"+d.idx+\"_dragger_horizontal\"),\n\t\t\t\t\t\tproperty=\"left\",\n\t\t\t\t\t\tcontentPos=mCSB_container[0].offsetLeft,\n\t\t\t\t\t\tlimit=[\n\t\t\t\t\t\t\tmCustomScrollBox.width()-mCSB_container.outerWidth(false),\n\t\t\t\t\t\t\tmCSB_dragger.parent().width()-mCSB_dragger.width()\n\t\t\t\t\t\t],\n\t\t\t\t\t\tscrollTo=[to,to===0 ? 0 : (to/d.scrollRatio.x)],\n\t\t\t\t\t\ttso=totalScrollOffsets[1],\n\t\t\t\t\t\ttsbo=totalScrollBackOffsets[1],\n\t\t\t\t\t\ttotalScrollOffset=tso>0 ? tso/d.scrollRatio.x : 0,\n\t\t\t\t\t\ttotalScrollBackOffset=tsbo>0 ? tsbo/d.scrollRatio.x : 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"y\":\n\t\t\t\t\tvar mCSB_dragger=$(\"#mCSB_\"+d.idx+\"_dragger_vertical\"),\n\t\t\t\t\t\tproperty=\"top\",\n\t\t\t\t\t\tcontentPos=mCSB_container[0].offsetTop,\n\t\t\t\t\t\tlimit=[\n\t\t\t\t\t\t\tmCustomScrollBox.height()-mCSB_container.outerHeight(false),\n\t\t\t\t\t\t\tmCSB_dragger.parent().height()-mCSB_dragger.height()\n\t\t\t\t\t\t],\n\t\t\t\t\t\tscrollTo=[to,to===0 ? 0 : (to/d.scrollRatio.y)],\n\t\t\t\t\t\ttso=totalScrollOffsets[0],\n\t\t\t\t\t\ttsbo=totalScrollBackOffsets[0],\n\t\t\t\t\t\ttotalScrollOffset=tso>0 ? tso/d.scrollRatio.y : 0,\n\t\t\t\t\t\ttotalScrollBackOffset=tsbo>0 ? tsbo/d.scrollRatio.y : 0;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(scrollTo[1]<0 || (scrollTo[0]===0 && scrollTo[1]===0)){\n\t\t\t\tscrollTo=[0,0];\n\t\t\t}else if(scrollTo[1]>=limit[1]){\n\t\t\t\tscrollTo=[limit[0],limit[1]];\n\t\t\t}else{\n\t\t\t\tscrollTo[0]=-scrollTo[0];\n\t\t\t}\n\t\t\tif(!el[0].mcs){\n\t\t\t\t_mcs(); /* init mcs object (once) to make it available before callbacks */\n\t\t\t\tif(_cb(\"onInit\")){o.callbacks.onInit.call(el[0]);} /* callbacks: onInit */\n\t\t\t}\n\t\t\tclearTimeout(mCSB_container[0].onCompleteTimeout);\n\t\t\t_tweenTo(mCSB_dragger[0],property,Math.round(scrollTo[1]),dur[1],options.scrollEasing);\n\t\t\tif(!d.tweenRunning && ((contentPos===0 && scrollTo[0]>=0) || (contentPos===limit[0] && scrollTo[0]<=limit[0]))){return;}\n\t\t\t_tweenTo(mCSB_container[0],property,Math.round(scrollTo[0]),dur[0],options.scrollEasing,options.overwrite,{\n\t\t\t\tonStart:function(){\n\t\t\t\t\tif(options.callbacks && options.onStart && !d.tweenRunning){\n\t\t\t\t\t\t/* callbacks: onScrollStart */\n\t\t\t\t\t\tif(_cb(\"onScrollStart\")){_mcs(); o.callbacks.onScrollStart.call(el[0]);}\n\t\t\t\t\t\td.tweenRunning=true;\n\t\t\t\t\t\t_onDragClasses(mCSB_dragger);\n\t\t\t\t\t\td.cbOffsets=_cbOffsets();\n\t\t\t\t\t}\n\t\t\t\t},onUpdate:function(){\n\t\t\t\t\tif(options.callbacks && options.onUpdate){\n\t\t\t\t\t\t/* callbacks: whileScrolling */\n\t\t\t\t\t\tif(_cb(\"whileScrolling\")){_mcs(); o.callbacks.whileScrolling.call(el[0]);}\n\t\t\t\t\t}\n\t\t\t\t},onComplete:function(){\n\t\t\t\t\tif(options.callbacks && options.onComplete){\n\t\t\t\t\t\tif(o.axis===\"yx\"){clearTimeout(mCSB_container[0].onCompleteTimeout);}\n\t\t\t\t\t\tvar t=mCSB_container[0].idleTimer || 0;\n\t\t\t\t\t\tmCSB_container[0].onCompleteTimeout=setTimeout(function(){\n\t\t\t\t\t\t\t/* callbacks: onScroll, onTotalScroll, onTotalScrollBack */\n\t\t\t\t\t\t\tif(_cb(\"onScroll\")){_mcs(); o.callbacks.onScroll.call(el[0]);}\n\t\t\t\t\t\t\tif(_cb(\"onTotalScroll\") && scrollTo[1]>=limit[1]-totalScrollOffset && d.cbOffsets[0]){_mcs(); o.callbacks.onTotalScroll.call(el[0]);}\n\t\t\t\t\t\t\tif(_cb(\"onTotalScrollBack\") && scrollTo[1]<=totalScrollBackOffset && d.cbOffsets[1]){_mcs(); o.callbacks.onTotalScrollBack.call(el[0]);}\n\t\t\t\t\t\t\td.tweenRunning=false;\n\t\t\t\t\t\t\tmCSB_container[0].idleTimer=0;\n\t\t\t\t\t\t\t_onDragClasses(mCSB_dragger,\"hide\");\n\t\t\t\t\t\t},t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t/* checks if callback function exists */\n\t\t\tfunction _cb(cb){\n\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t}\n\t\t\t/* checks whether callback offsets always trigger */\n\t\t\tfunction _cbOffsets(){\n\t\t\t\treturn [o.callbacks.alwaysTriggerOffsets || contentPos>=limit[0]+tso,o.callbacks.alwaysTriggerOffsets || contentPos<=-tsbo];\n\t\t\t}\n\t\t\t/* \n\t\t\tpopulates object with useful values for the user \n\t\t\tvalues: \n\t\t\t\tcontent: this.mcs.content\n\t\t\t\tcontent top position: this.mcs.top \n\t\t\t\tcontent left position: this.mcs.left \n\t\t\t\tdragger top position: this.mcs.draggerTop \n\t\t\t\tdragger left position: this.mcs.draggerLeft \n\t\t\t\tscrolling y percentage: this.mcs.topPct \n\t\t\t\tscrolling x percentage: this.mcs.leftPct \n\t\t\t\tscrolling direction: this.mcs.direction\n\t\t\t*/\n\t\t\tfunction _mcs(){\n\t\t\t\tvar cp=[mCSB_container[0].offsetTop,mCSB_container[0].offsetLeft], /* content position */\n\t\t\t\t\tdp=[mCSB_dragger[0].offsetTop,mCSB_dragger[0].offsetLeft], /* dragger position */\n\t\t\t\t\tcl=[mCSB_container.outerHeight(false),mCSB_container.outerWidth(false)], /* content length */\n\t\t\t\t\tpl=[mCustomScrollBox.height(),mCustomScrollBox.width()]; /* content parent length */\n\t\t\t\tel[0].mcs={\n\t\t\t\t\tcontent:mCSB_container, /* original content wrapper as jquery object */\n\t\t\t\t\ttop:cp[0],left:cp[1],draggerTop:dp[0],draggerLeft:dp[1],\n\t\t\t\t\ttopPct:Math.round((100*Math.abs(cp[0]))/(Math.abs(cl[0])-pl[0])),leftPct:Math.round((100*Math.abs(cp[1]))/(Math.abs(cl[1])-pl[1])),\n\t\t\t\t\tdirection:options.dir\n\t\t\t\t};\n\t\t\t\t/* \n\t\t\t\tthis refers to the original element containing the scrollbar(s)\n\t\t\t\tusage: this.mcs.top, this.mcs.leftPct etc. \n\t\t\t\t*/\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* \n\t\tCUSTOM JAVASCRIPT ANIMATION TWEEN \n\t\tLighter and faster than jquery animate() and css transitions \n\t\tAnimates top/left properties and includes easings \n\t\t*/\n\t\t_tweenTo=function(el,prop,to,duration,easing,overwrite,callbacks){\n\t\t\tif(!el._mTween){el._mTween={top:{},left:{}};}\n\t\t\tvar callbacks=callbacks || {},\n\t\t\t\tonStart=callbacks.onStart || function(){},onUpdate=callbacks.onUpdate || function(){},onComplete=callbacks.onComplete || function(){},\n\t\t\t\tstartTime=_getTime(),_delay,progress=0,from=el.offsetTop,elStyle=el.style,_request,tobj=el._mTween[prop];\n\t\t\tif(prop===\"left\"){from=el.offsetLeft;}\n\t\t\tvar diff=to-from;\n\t\t\ttobj.stop=0;\n\t\t\tif(overwrite!==\"none\"){_cancelTween();}\n\t\t\t_startTween();\n\t\t\tfunction _step(){\n\t\t\t\tif(tobj.stop){return;}\n\t\t\t\tif(!progress){onStart.call();}\n\t\t\t\tprogress=_getTime()-startTime;\n\t\t\t\t_tween();\n\t\t\t\tif(progress>=tobj.time){\n\t\t\t\t\ttobj.time=(progress>tobj.time) ? progress+_delay-(progress-tobj.time) : progress+_delay-1;\n\t\t\t\t\tif(tobj.time<progress+1){tobj.time=progress+1;}\n\t\t\t\t}\n\t\t\t\tif(tobj.time<duration){tobj.id=_request(_step);}else{onComplete.call();}\n\t\t\t}\n\t\t\tfunction _tween(){\n\t\t\t\tif(duration>0){\n\t\t\t\t\ttobj.currVal=_ease(tobj.time,from,diff,duration,easing);\n\t\t\t\t\telStyle[prop]=Math.round(tobj.currVal)+\"px\";\n\t\t\t\t}else{\n\t\t\t\t\telStyle[prop]=to+\"px\";\n\t\t\t\t}\n\t\t\t\tonUpdate.call();\n\t\t\t}\n\t\t\tfunction _startTween(){\n\t\t\t\t_delay=1000/60;\n\t\t\t\ttobj.time=progress+_delay;\n\t\t\t\t_request=(!window.requestAnimationFrame) ? function(f){_tween(); return setTimeout(f,0.01);} : window.requestAnimationFrame;\n\t\t\t\ttobj.id=_request(_step);\n\t\t\t}\n\t\t\tfunction _cancelTween(){\n\t\t\t\tif(tobj.id==null){return;}\n\t\t\t\tif(!window.requestAnimationFrame){clearTimeout(tobj.id);\n\t\t\t\t}else{window.cancelAnimationFrame(tobj.id);}\n\t\t\t\ttobj.id=null;\n\t\t\t}\n\t\t\tfunction _ease(t,b,c,d,type){\n\t\t\t\tswitch(type){\n\t\t\t\t\tcase \"linear\": case \"mcsLinear\":\n\t\t\t\t\t\treturn c*t/d + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"mcsLinearOut\":\n\t\t\t\t\t\tt/=d; t--; return c * Math.sqrt(1 - t*t) + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"easeInOutSmooth\":\n\t\t\t\t\t\tt/=d/2;\n\t\t\t\t\t\tif(t<1) return c/2*t*t + b;\n\t\t\t\t\t\tt--;\n\t\t\t\t\t\treturn -c/2 * (t*(t-2) - 1) + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"easeInOutStrong\":\n\t\t\t\t\t\tt/=d/2;\n\t\t\t\t\t\tif(t<1) return c/2 * Math.pow( 2, 10 * (t - 1) ) + b;\n\t\t\t\t\t\tt--;\n\t\t\t\t\t\treturn c/2 * ( -Math.pow( 2, -10 * t) + 2 ) + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"easeInOut\": case \"mcsEaseInOut\":\n\t\t\t\t\t\tt/=d/2;\n\t\t\t\t\t\tif(t<1) return c/2*t*t*t + b;\n\t\t\t\t\t\tt-=2;\n\t\t\t\t\t\treturn c/2*(t*t*t + 2) + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"easeOutSmooth\":\n\t\t\t\t\t\tt/=d; t--;\n\t\t\t\t\t\treturn -c * (t*t*t*t - 1) + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"easeOutStrong\":\n\t\t\t\t\t\treturn c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"easeOut\": case \"mcsEaseOut\": default:\n\t\t\t\t\t\tvar ts=(t/=d)*t,tc=ts*t;\n\t\t\t\t\t\treturn b+c*(0.499999999999997*tc*ts + -2.5*ts*ts + 5.5*tc + -6.5*ts + 4*t);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* returns current time */\n\t\t_getTime=function(){\n\t\t\tif(window.performance && window.performance.now){\n\t\t\t\treturn window.performance.now();\n\t\t\t}else{\n\t\t\t\tif(window.performance && window.performance.webkitNow){\n\t\t\t\t\treturn window.performance.webkitNow();\n\t\t\t\t}else{\n\t\t\t\t\tif(Date.now){return Date.now();}else{return new Date().getTime();}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* stops a tween */\n\t\t_stopTween=function(){\n\t\t\tvar el=this;\n\t\t\tif(!el._mTween){el._mTween={top:{},left:{}};}\n\t\t\tvar props=[\"top\",\"left\"];\n\t\t\tfor(var i=0; i<props.length; i++){\n\t\t\t\tvar prop=props[i];\n\t\t\t\tif(el._mTween[prop].id){\n\t\t\t\t\tif(!window.requestAnimationFrame){clearTimeout(el._mTween[prop].id);\n\t\t\t\t\t}else{window.cancelAnimationFrame(el._mTween[prop].id);}\n\t\t\t\t\tel._mTween[prop].id=null;\n\t\t\t\t\tel._mTween[prop].stop=1;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* deletes a property (avoiding the exception thrown by IE) */\n\t\t_delete=function(c,m){\n\t\t\ttry{delete c[m];}catch(e){c[m]=null;}\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* detects left mouse button */\n\t\t_mouseBtnLeft=function(e){\n\t\t\treturn !(e.which && e.which!==1);\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* detects if pointer type event is touch */\n\t\t_pointerTouch=function(e){\n\t\t\tvar t=e.originalEvent.pointerType;\n\t\t\treturn !(t && t!==\"touch\" && t!==2);\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* checks if value is numeric */\n\t\t_isNumeric=function(val){\n\t\t\treturn !isNaN(parseFloat(val)) && isFinite(val);\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* returns element position according to content */\n\t\t_childPos=function(el){\n\t\t\tvar p=el.parents(\".mCSB_container\");\n\t\t\treturn [el.offset().top-p.offset().top,el.offset().left-p.offset().left];\n\t\t},\n\t\t/* -------------------- */\n\t\t\n\t\t\n\t\t/* checks if browser tab is hidden/inactive via Page Visibility API */\n\t\t_isTabHidden=function(){\n\t\t\tvar prop=_getHiddenProp();\n\t\t\tif(!prop) return false;\n\t\t\treturn document[prop];\n\t\t\tfunction _getHiddenProp(){\n\t\t\t\tvar pfx=[\"webkit\",\"moz\",\"ms\",\"o\"];\n\t\t\t\tif(\"hidden\" in document) return \"hidden\"; //natively supported\n\t\t\t\tfor(var i=0; i<pfx.length; i++){ //prefixed\n\t\t\t\t if((pfx[i]+\"Hidden\") in document) \n\t\t\t\t return pfx[i]+\"Hidden\";\n\t\t\t\t}\n\t\t\t\treturn null; //not supported\n\t\t\t}\n\t\t};\n\t\t/* -------------------- */\n\t\t\n\t\n\t\n\t\n\t\n\t/* \n\t----------------------------------------\n\tPLUGIN SETUP \n\t----------------------------------------\n\t*/\n\t\n\t/* plugin constructor functions */\n\t$.fn[pluginNS]=function(method){ /* usage: $(selector).mCustomScrollbar(); */\n\t\tif(methods[method]){\n\t\t\treturn methods[method].apply(this,Array.prototype.slice.call(arguments,1));\n\t\t}else if(typeof method===\"object\" || !method){\n\t\t\treturn methods.init.apply(this,arguments);\n\t\t}else{\n\t\t\t$.error(\"Method \"+method+\" does not exist\");\n\t\t}\n\t};\n\t$[pluginNS]=function(method){ /* usage: $.mCustomScrollbar(); */\n\t\tif(methods[method]){\n\t\t\treturn methods[method].apply(this,Array.prototype.slice.call(arguments,1));\n\t\t}else if(typeof method===\"object\" || !method){\n\t\t\treturn methods.init.apply(this,arguments);\n\t\t}else{\n\t\t\t$.error(\"Method \"+method+\" does not exist\");\n\t\t}\n\t};\n\t\n\t/* \n\tallow setting plugin default options. \n\tusage: $.mCustomScrollbar.defaults.scrollInertia=500; \n\tto apply any changed default options on default selectors (below), use inside document ready fn \n\te.g.: $(document).ready(function(){ $.mCustomScrollbar.defaults.scrollInertia=500; });\n\t*/\n\t$[pluginNS].defaults=defaults;\n\t\n\t/* \n\tadd window object (window.mCustomScrollbar) \n\tusage: if(window.mCustomScrollbar){console.log(\"custom scrollbar plugin loaded\");}\n\t*/\n\twindow[pluginNS]=true;\n\t\n\t$(window).bind(\"load\",function(){\n\t\t\n\t\t$(defaultSelector)[pluginNS](); /* add scrollbars automatically on default selector */\n\t\t\n\t\t/* extend jQuery expressions */\n\t\t$.extend($.expr[\":\"],{\n\t\t\t/* checks if element is within scrollable viewport */\n\t\t\tmcsInView:$.expr[\":\"].mcsInView || function(el){\n\t\t\t\tvar $el=$(el),content=$el.parents(\".mCSB_container\"),wrapper,cPos;\n\t\t\t\tif(!content.length){return;}\n\t\t\t\twrapper=content.parent();\n\t\t\t\tcPos=[content[0].offsetTop,content[0].offsetLeft];\n\t\t\t\treturn \tcPos[0]+_childPos($el)[0]>=0 && cPos[0]+_childPos($el)[0]<wrapper.height()-$el.outerHeight(false) && \n\t\t\t\t\t\tcPos[1]+_childPos($el)[1]>=0 && cPos[1]+_childPos($el)[1]<wrapper.width()-$el.outerWidth(false);\n\t\t\t},\n\t\t\t/* checks if element or part of element is in view of scrollable viewport */\n\t\t\tmcsInSight:$.expr[\":\"].mcsInSight || function(el,i,m){\n\t\t\t\tvar $el=$(el),elD,content=$el.parents(\".mCSB_container\"),wrapperView,pos,wrapperViewPct,\n\t\t\t\t\tpctVals=m[3]===\"exact\" ? [[1,0],[1,0]] : [[0.9,0.1],[0.6,0.4]];\n\t\t\t\tif(!content.length){return;}\n\t\t\t\telD=[$el.outerHeight(false),$el.outerWidth(false)];\n\t\t\t\tpos=[content[0].offsetTop+_childPos($el)[0],content[0].offsetLeft+_childPos($el)[1]];\n\t\t\t\twrapperView=[content.parent()[0].offsetHeight,content.parent()[0].offsetWidth];\n\t\t\t\twrapperViewPct=[elD[0]<wrapperView[0] ? pctVals[0] : pctVals[1],elD[1]<wrapperView[1] ? pctVals[0] : pctVals[1]];\n\t\t\t\treturn \tpos[0]-(wrapperView[0]*wrapperViewPct[0][0])<0 && pos[0]+elD[0]-(wrapperView[0]*wrapperViewPct[0][1])>=0 && \n\t\t\t\t\t\tpos[1]-(wrapperView[1]*wrapperViewPct[1][0])<0 && pos[1]+elD[1]-(wrapperView[1]*wrapperViewPct[1][1])>=0;\n\t\t\t},\n\t\t\t/* checks if element is overflowed having visible scrollbar(s) */\n\t\t\tmcsOverflow:$.expr[\":\"].mcsOverflow || function(el){\n\t\t\t\tvar d=$(el).data(pluginPfx);\n\t\t\t\tif(!d){return;}\n\t\t\t\treturn d.overflowed[0] || d.overflowed[1];\n\t\t\t}\n\t\t});\n\t\n\t});\n\n}))}));\n!function(){\"use strict\";function a(){this.defaults={scrollButtons:{enable:!0},axis:\"yx\"},$.mCustomScrollbar.defaults.scrollButtons=this.defaults.scrollButtons,$.mCustomScrollbar.defaults.axis=this.defaults.axis,this.$get=function(){return{defaults:this.defaults}}}function b(a){return{scope:{ngScrollbarsConfig:\"&\",ngScrollbarsUpdate:\"=?\",element:\"=?\"},link:function(b,c,d){b.ngScrollbarsUpdate=function(){c.mCustomScrollbar.apply(c,arguments)},b.elem=c;var e=a.defaults,f=$.mCustomScrollbar.defaults,g=b.ngScrollbarsConfig();g||(g={});for(var h in e)if(e.hasOwnProperty(h))switch(h){case\"scrollButtons\":g.hasOwnProperty(h)||(f.scrollButtons=e[h]);break;case\"axis\":g.hasOwnProperty(h)||(f.axis=e[h]);break;default:g.hasOwnProperty(h)||(g[h]=e[h])}c.mCustomScrollbar(g)}}}angular.module(\"ngScrollbars\",[]).provider(\"ScrollBars\",a).directive(\"ngScrollbars\",b),a.$inject=[],b.$inject=[\"ScrollBars\"]}();\n/**\n * x is a value between 0 and 1, indicating where in the animation you are.\n */\nvar duScrollDefaultEasing = function (x) {\n 'use strict';\n\n if(x < 0.5) {\n return Math.pow(x*2, 2)/2;\n }\n return 1-Math.pow((1-x)*2, 2)/2;\n};\n\nvar duScroll = angular.module('duScroll', [\n 'duScroll.scrollspy',\n 'duScroll.smoothScroll',\n 'duScroll.scrollContainer',\n 'duScroll.spyContext',\n 'duScroll.scrollHelpers'\n])\n //Default animation duration for smoothScroll directive\n .value('duScrollDuration', 350)\n //Scrollspy debounce interval, set to 0 to disable\n .value('duScrollSpyWait', 100)\n //Scrollspy forced refresh interval, use if your content changes or reflows without scrolling.\n //0 to disable\n .value('duScrollSpyRefreshInterval', 0)\n //Wether or not multiple scrollspies can be active at once\n .value('duScrollGreedy', false)\n //Default offset for smoothScroll directive\n .value('duScrollOffset', 0)\n //Default easing function for scroll animation\n .value('duScrollEasing', duScrollDefaultEasing)\n //Which events on the container (such as body) should cancel scroll animations\n .value('duScrollCancelOnEvents', 'scroll mousedown mousewheel touchmove keydown')\n //Whether or not to activate the last scrollspy, when page/container bottom is reached\n .value('duScrollBottomSpy', false)\n //Active class name\n .value('duScrollActiveClass', 'active');\n\nif (typeof module !== 'undefined' && module && module.exports) {\n module.exports = duScroll;\n}\n\n\nangular.module('duScroll.scrollHelpers', ['duScroll.requestAnimation'])\n.run([\"$window\", \"$q\", \"cancelAnimation\", \"requestAnimation\", \"duScrollEasing\", \"duScrollDuration\", \"duScrollOffset\", \"duScrollCancelOnEvents\", function($window, $q, cancelAnimation, requestAnimation, duScrollEasing, duScrollDuration, duScrollOffset, duScrollCancelOnEvents) {\n 'use strict';\n\n var proto = {};\n\n var isDocument = function(el) {\n return (typeof HTMLDocument !== 'undefined' && el instanceof HTMLDocument) || (el.nodeType && el.nodeType === el.DOCUMENT_NODE);\n };\n\n var isElement = function(el) {\n return (typeof HTMLElement !== 'undefined' && el instanceof HTMLElement) || (el.nodeType && el.nodeType === el.ELEMENT_NODE);\n };\n\n var unwrap = function(el) {\n return isElement(el) || isDocument(el) ? el : el[0];\n };\n\n proto.duScrollTo = function(left, top, duration, easing) {\n var aliasFn;\n if(angular.isElement(left)) {\n aliasFn = this.duScrollToElement;\n } else if(angular.isDefined(duration)) {\n aliasFn = this.duScrollToAnimated;\n }\n if(aliasFn) {\n return aliasFn.apply(this, arguments);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollTo(left, top);\n }\n el.scrollLeft = left;\n el.scrollTop = top;\n };\n\n var scrollAnimation, deferred;\n proto.duScrollToAnimated = function(left, top, duration, easing) {\n if(duration && !easing) {\n easing = duScrollEasing;\n }\n var startLeft = this.duScrollLeft(),\n startTop = this.duScrollTop(),\n deltaLeft = Math.round(left - startLeft),\n deltaTop = Math.round(top - startTop);\n\n var startTime = null, progress = 0;\n var el = this;\n\n var cancelScrollAnimation = function($event) {\n if (!$event || (progress && $event.which > 0)) {\n if(duScrollCancelOnEvents) {\n el.unbind(duScrollCancelOnEvents, cancelScrollAnimation);\n }\n cancelAnimation(scrollAnimation);\n deferred.reject();\n scrollAnimation = null;\n }\n };\n\n if(scrollAnimation) {\n cancelScrollAnimation();\n }\n deferred = $q.defer();\n\n if(duration === 0 || (!deltaLeft && !deltaTop)) {\n if(duration === 0) {\n el.duScrollTo(left, top);\n }\n deferred.resolve();\n return deferred.promise;\n }\n\n var animationStep = function(timestamp) {\n if (startTime === null) {\n startTime = timestamp;\n }\n\n progress = timestamp - startTime;\n var percent = (progress >= duration ? 1 : easing(progress/duration));\n\n el.scrollTo(\n startLeft + Math.ceil(deltaLeft * percent),\n startTop + Math.ceil(deltaTop * percent)\n );\n if(percent < 1) {\n scrollAnimation = requestAnimation(animationStep);\n } else {\n if(duScrollCancelOnEvents) {\n el.unbind(duScrollCancelOnEvents, cancelScrollAnimation);\n }\n scrollAnimation = null;\n deferred.resolve();\n }\n };\n\n //Fix random mobile safari bug when scrolling to top by hitting status bar\n el.duScrollTo(startLeft, startTop);\n\n if(duScrollCancelOnEvents) {\n el.bind(duScrollCancelOnEvents, cancelScrollAnimation);\n }\n\n scrollAnimation = requestAnimation(animationStep);\n return deferred.promise;\n };\n\n proto.duScrollToElement = function(target, offset, duration, easing) {\n var el = unwrap(this);\n if(!angular.isNumber(offset) || isNaN(offset)) {\n offset = duScrollOffset;\n }\n var top = this.duScrollTop() + unwrap(target).getBoundingClientRect().top - offset;\n if(isElement(el)) {\n top -= el.getBoundingClientRect().top;\n }\n return this.duScrollTo(0, top, duration, easing);\n };\n\n proto.duScrollLeft = function(value, duration, easing) {\n if(angular.isNumber(value)) {\n return this.duScrollTo(value, this.duScrollTop(), duration, easing);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;\n }\n return el.scrollLeft;\n };\n proto.duScrollTop = function(value, duration, easing) {\n if(angular.isNumber(value)) {\n return this.duScrollTo(this.duScrollLeft(), value, duration, easing);\n }\n var el = unwrap(this);\n if(isDocument(el)) {\n return $window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;\n }\n return el.scrollTop;\n };\n\n proto.duScrollToElementAnimated = function(target, offset, duration, easing) {\n return this.duScrollToElement(target, offset, duration || duScrollDuration, easing);\n };\n\n proto.duScrollTopAnimated = function(top, duration, easing) {\n return this.duScrollTop(top, duration || duScrollDuration, easing);\n };\n\n proto.duScrollLeftAnimated = function(left, duration, easing) {\n return this.duScrollLeft(left, duration || duScrollDuration, easing);\n };\n\n angular.forEach(proto, function(fn, key) {\n angular.element.prototype[key] = fn;\n\n //Remove prefix if not already claimed by jQuery / ui.utils\n var unprefixed = key.replace(/^duScroll/, 'scroll');\n if(angular.isUndefined(angular.element.prototype[unprefixed])) {\n angular.element.prototype[unprefixed] = fn;\n }\n });\n\n}]);\n\n\n//Adapted from https://gist.github.com/paulirish/1579671\nangular.module('duScroll.polyfill', [])\n.factory('polyfill', [\"$window\", function($window) {\n 'use strict';\n\n var vendors = ['webkit', 'moz', 'o', 'ms'];\n\n return function(fnName, fallback) {\n if($window[fnName]) {\n return $window[fnName];\n }\n var suffix = fnName.substr(0, 1).toUpperCase() + fnName.substr(1);\n for(var key, i = 0; i < vendors.length; i++) {\n key = vendors[i]+suffix;\n if($window[key]) {\n return $window[key];\n }\n }\n return fallback;\n };\n}]);\n\nangular.module('duScroll.requestAnimation', ['duScroll.polyfill'])\n.factory('requestAnimation', [\"polyfill\", \"$timeout\", function(polyfill, $timeout) {\n 'use strict';\n\n var lastTime = 0;\n var fallback = function(callback, element) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = $timeout(function() { callback(currTime + timeToCall); },\n timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n\n return polyfill('requestAnimationFrame', fallback);\n}])\n.factory('cancelAnimation', [\"polyfill\", \"$timeout\", function(polyfill, $timeout) {\n 'use strict';\n\n var fallback = function(promise) {\n $timeout.cancel(promise);\n };\n\n return polyfill('cancelAnimationFrame', fallback);\n}]);\n\n\nangular.module('duScroll.spyAPI', ['duScroll.scrollContainerAPI'])\n.factory('spyAPI', [\"$rootScope\", \"$timeout\", \"$interval\", \"$window\", \"$document\", \"scrollContainerAPI\", \"duScrollGreedy\", \"duScrollSpyWait\", \"duScrollSpyRefreshInterval\", \"duScrollBottomSpy\", \"duScrollActiveClass\", function($rootScope, $timeout, $interval, $window, $document, scrollContainerAPI, duScrollGreedy, duScrollSpyWait, duScrollSpyRefreshInterval, duScrollBottomSpy, duScrollActiveClass) {\n 'use strict';\n\n var createScrollHandler = function(context) {\n var timer = false, queued = false;\n var handler = function() {\n queued = false;\n var container = context.container,\n containerEl = container[0],\n containerOffset = 0,\n bottomReached;\n\n if (typeof HTMLElement !== 'undefined' && containerEl instanceof HTMLElement || containerEl.nodeType && containerEl.nodeType === containerEl.ELEMENT_NODE) {\n containerOffset = containerEl.getBoundingClientRect().top;\n bottomReached = Math.round(containerEl.scrollTop + containerEl.clientHeight) >= containerEl.scrollHeight;\n } else {\n var documentScrollHeight = $document[0].body.scrollHeight || $document[0].documentElement.scrollHeight; // documentElement for IE11\n bottomReached = Math.round($window.pageYOffset + $window.innerHeight) >= documentScrollHeight;\n }\n var compareProperty = (duScrollBottomSpy && bottomReached ? 'bottom' : 'top');\n\n var i, currentlyActive, toBeActive, spies, spy, pos;\n spies = context.spies;\n currentlyActive = context.currentlyActive;\n toBeActive = undefined;\n\n for(i = 0; i < spies.length; i++) {\n spy = spies[i];\n pos = spy.getTargetPosition();\n if (!pos || !spy.$element) continue;\n\n if((duScrollBottomSpy && bottomReached) || (pos.top + spy.offset - containerOffset < 20 && (duScrollGreedy || pos.top*-1 + containerOffset) < pos.height)) {\n //Find the one closest the viewport top or the page bottom if it's reached\n if(!toBeActive || toBeActive[compareProperty] < pos[compareProperty]) {\n toBeActive = {\n spy: spy\n };\n toBeActive[compareProperty] = pos[compareProperty];\n }\n }\n }\n\n if(toBeActive) {\n toBeActive = toBeActive.spy;\n }\n if(currentlyActive === toBeActive || (duScrollGreedy && !toBeActive)) return;\n if(currentlyActive && currentlyActive.$element) {\n currentlyActive.$element.removeClass(duScrollActiveClass);\n $rootScope.$broadcast(\n 'duScrollspy:becameInactive',\n currentlyActive.$element,\n angular.element(currentlyActive.getTargetElement())\n );\n }\n if(toBeActive) {\n toBeActive.$element.addClass(duScrollActiveClass);\n $rootScope.$broadcast(\n 'duScrollspy:becameActive',\n toBeActive.$element,\n angular.element(toBeActive.getTargetElement())\n );\n }\n context.currentlyActive = toBeActive;\n };\n\n if(!duScrollSpyWait) {\n return handler;\n }\n\n //Debounce for potential performance savings\n return function() {\n if(!timer) {\n handler();\n timer = $timeout(function() {\n timer = false;\n if(queued) {\n handler();\n }\n }, duScrollSpyWait, false);\n } else {\n queued = true;\n }\n };\n };\n\n var contexts = {};\n\n var createContext = function($scope) {\n var id = $scope.$id;\n var context = {\n spies: []\n };\n\n context.handler = createScrollHandler(context);\n contexts[id] = context;\n\n $scope.$on('$destroy', function() {\n destroyContext($scope);\n });\n\n return id;\n };\n\n var destroyContext = function($scope) {\n var id = $scope.$id;\n var context = contexts[id], container = context.container;\n if(context.intervalPromise) {\n $interval.cancel(context.intervalPromise);\n }\n if(container) {\n container.off('scroll', context.handler);\n }\n delete contexts[id];\n };\n\n var defaultContextId = createContext($rootScope);\n\n var getContextForScope = function(scope) {\n if(contexts[scope.$id]) {\n return contexts[scope.$id];\n }\n if(scope.$parent) {\n return getContextForScope(scope.$parent);\n }\n return contexts[defaultContextId];\n };\n\n var getContextForSpy = function(spy) {\n var context, contextId, scope = spy.$scope;\n if(scope) {\n return getContextForScope(scope);\n }\n //No scope, most likely destroyed\n for(contextId in contexts) {\n context = contexts[contextId];\n if(context.spies.indexOf(spy) !== -1) {\n return context;\n }\n }\n };\n\n var isElementInDocument = function(element) {\n while (element.parentNode) {\n element = element.parentNode;\n if (element === document) {\n return true;\n }\n }\n return false;\n };\n\n var addSpy = function(spy) {\n var context = getContextForSpy(spy);\n if (!context) return;\n context.spies.push(spy);\n if (!context.container || !isElementInDocument(context.container)) {\n if(context.container) {\n context.container.off('scroll', context.handler);\n }\n context.container = scrollContainerAPI.getContainer(spy.$scope);\n if (duScrollSpyRefreshInterval && !context.intervalPromise) {\n context.intervalPromise = $interval(context.handler, duScrollSpyRefreshInterval, 0, false);\n }\n context.container.on('scroll', context.handler).triggerHandler('scroll');\n }\n };\n\n var removeSpy = function(spy) {\n var context = getContextForSpy(spy);\n if(spy === context.currentlyActive) {\n $rootScope.$broadcast('duScrollspy:becameInactive', context.currentlyActive.$element);\n context.currentlyActive = null;\n }\n var i = context.spies.indexOf(spy);\n if(i !== -1) {\n context.spies.splice(i, 1);\n }\n\t\tspy.$element = null;\n };\n\n return {\n addSpy: addSpy,\n removeSpy: removeSpy,\n createContext: createContext,\n destroyContext: destroyContext,\n getContextForScope: getContextForScope\n };\n}]);\n\n\nangular.module('duScroll.scrollContainerAPI', [])\n.factory('scrollContainerAPI', [\"$document\", function($document) {\n 'use strict';\n\n var containers = {};\n\n var setContainer = function(scope, element) {\n var id = scope.$id;\n containers[id] = element;\n return id;\n };\n\n var getContainerId = function(scope) {\n if(containers[scope.$id]) {\n return scope.$id;\n }\n if(scope.$parent) {\n return getContainerId(scope.$parent);\n }\n return;\n };\n\n var getContainer = function(scope) {\n var id = getContainerId(scope);\n return id ? containers[id] : $document;\n };\n\n var removeContainer = function(scope) {\n var id = getContainerId(scope);\n if(id) {\n delete containers[id];\n }\n };\n\n return {\n getContainerId: getContainerId,\n getContainer: getContainer,\n setContainer: setContainer,\n removeContainer: removeContainer\n };\n}]);\n\n\nangular.module('duScroll.smoothScroll', ['duScroll.scrollHelpers', 'duScroll.scrollContainerAPI'])\n.directive('duSmoothScroll', [\"duScrollDuration\", \"duScrollOffset\", \"scrollContainerAPI\", function(duScrollDuration, duScrollOffset, scrollContainerAPI) {\n 'use strict';\n\n return {\n link : function($scope, $element, $attr) {\n $element.on('click', function(e) {\n if((!$attr.href || $attr.href.indexOf('#') === -1) && $attr.duSmoothScroll === '') return;\n\n var id = $attr.href ? $attr.href.replace(/.*(?=#[^\\s]+$)/, '').substring(1) : $attr.duSmoothScroll;\n\n var target = document.getElementById(id) || document.getElementsByName(id)[0];\n if(!target || !target.getBoundingClientRect) return;\n\n if (e.stopPropagation) e.stopPropagation();\n if (e.preventDefault) e.preventDefault();\n\n var offset = $attr.offset ? parseInt($attr.offset, 10) : duScrollOffset;\n var duration = $attr.duration ? parseInt($attr.duration, 10) : duScrollDuration;\n var container = scrollContainerAPI.getContainer($scope);\n\n container.duScrollToElement(\n angular.element(target),\n isNaN(offset) ? 0 : offset,\n isNaN(duration) ? 0 : duration\n );\n });\n }\n };\n}]);\n\n\nangular.module('duScroll.spyContext', ['duScroll.spyAPI'])\n.directive('duSpyContext', [\"spyAPI\", function(spyAPI) {\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function compile(tElement, tAttrs, transclude) {\n return {\n pre: function preLink($scope, iElement, iAttrs, controller) {\n spyAPI.createContext($scope);\n }\n };\n }\n };\n}]);\n\n\nangular.module('duScroll.scrollContainer', ['duScroll.scrollContainerAPI'])\n.directive('duScrollContainer', [\"scrollContainerAPI\", function(scrollContainerAPI){\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function compile(tElement, tAttrs, transclude) {\n return {\n pre: function preLink($scope, iElement, iAttrs, controller) {\n iAttrs.$observe('duScrollContainer', function(element) {\n if(angular.isString(element)) {\n element = document.getElementById(element);\n }\n\n element = (angular.isElement(element) ? angular.element(element) : iElement);\n scrollContainerAPI.setContainer($scope, element);\n $scope.$on('$destroy', function() {\n scrollContainerAPI.removeContainer($scope);\n });\n });\n }\n };\n }\n };\n}]);\n\n\nangular.module('duScroll.scrollspy', ['duScroll.spyAPI'])\n.directive('duScrollspy', [\"spyAPI\", \"duScrollOffset\", \"$timeout\", \"$rootScope\", function(spyAPI, duScrollOffset, $timeout, $rootScope) {\n 'use strict';\n\n var Spy = function(targetElementOrId, $scope, $element, offset) {\n if(angular.isElement(targetElementOrId)) {\n this.target = targetElementOrId;\n } else if(angular.isString(targetElementOrId)) {\n this.targetId = targetElementOrId;\n }\n this.$scope = $scope;\n this.$element = $element;\n this.offset = offset;\n };\n\n Spy.prototype.getTargetElement = function() {\n if (!this.target && this.targetId) {\n this.target = document.getElementById(this.targetId) || document.getElementsByName(this.targetId)[0];\n }\n return this.target;\n };\n\n Spy.prototype.getTargetPosition = function() {\n var target = this.getTargetElement();\n if(target) {\n return target.getBoundingClientRect();\n }\n };\n\n Spy.prototype.flushTargetCache = function() {\n if(this.targetId) {\n this.target = undefined;\n }\n };\n\n return {\n link: function ($scope, $element, $attr) {\n var href = $attr.ngHref || $attr.href;\n var targetId;\n\n if (href && href.indexOf('#') !== -1) {\n targetId = href.replace(/.*(?=#[^\\s]+$)/, '').substring(1);\n } else if($attr.duScrollspy) {\n targetId = $attr.duScrollspy;\n } else if($attr.duSmoothScroll) {\n targetId = $attr.duSmoothScroll;\n }\n if(!targetId) return;\n\n // Run this in the next execution loop so that the scroll context has a chance\n // to initialize\n var timeoutPromise = $timeout(function() {\n var spy = new Spy(targetId, $scope, $element, -($attr.offset ? parseInt($attr.offset, 10) : duScrollOffset));\n spyAPI.addSpy(spy);\n\n $scope.$on('$locationChangeSuccess', spy.flushTargetCache.bind(spy));\n var deregisterOnStateChange = $rootScope.$on('$stateChangeSuccess', spy.flushTargetCache.bind(spy));\n $scope.$on('$destroy', function() {\n spyAPI.removeSpy(spy);\n deregisterOnStateChange();\n });\n }, 0, false);\n $scope.$on('$destroy', function() {$timeout.cancel(timeoutPromise);});\n }\n };\n}]);\n\n(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\nangular.module('nemLogging', []);\n\nangular.module('nemLogging').provider('nemDebug', function (){\n var ourDebug = null;\n ourDebug = require('debug');\n\n this.$get = function(){\n //avail as service\n return ourDebug;\n };\n\n //avail at provider, config time\n this.debug = ourDebug;\n\n return this;\n});\nvar bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n slice = [].slice;\n\nangular.module('nemLogging').provider('nemSimpleLogger', [\n 'nemDebugProvider', function(nemDebugProvider) {\n var LEVELS, Logger, _debugCache, _fns, _isValidLogObject, _maybeExecLevel, _wrapDebug, i, key, len, nemDebug, val;\n nemDebug = nemDebugProvider.debug;\n _debugCache = {};\n _fns = ['debug', 'info', 'warn', 'error', 'log'];\n LEVELS = {};\n for (key = i = 0, len = _fns.length; i < len; key = ++i) {\n val = _fns[key];\n LEVELS[val] = key;\n }\n _maybeExecLevel = function(level, current, fn) {\n if (level >= current) {\n return fn();\n }\n };\n _isValidLogObject = function(logObject) {\n var isValid, j, len1;\n isValid = false;\n if (!logObject) {\n return isValid;\n }\n for (j = 0, len1 = _fns.length; j < len1; j++) {\n val = _fns[j];\n isValid = (logObject[val] != null) && typeof logObject[val] === 'function';\n if (!isValid) {\n break;\n }\n }\n return isValid;\n };\n\n /*\n Overide logeObject.debug with a nemDebug instance\n see: https://github.com/visionmedia/debug/blob/master/Readme.md\n */\n _wrapDebug = function(namespace, logObject) {\n var debugInstance, j, len1, newLogger;\n if (_debugCache[namespace] == null) {\n _debugCache[namespace] = nemDebug(namespace);\n }\n debugInstance = _debugCache[namespace];\n newLogger = {};\n for (j = 0, len1 = _fns.length; j < len1; j++) {\n val = _fns[j];\n newLogger[val] = val === 'debug' ? debugInstance : logObject[val];\n }\n return newLogger;\n };\n Logger = (function() {\n function Logger($log1) {\n var fn1, j, len1, level, logFns;\n this.$log = $log1;\n this.spawn = bind(this.spawn, this);\n if (!this.$log) {\n throw 'internalLogger undefined';\n }\n if (!_isValidLogObject(this.$log)) {\n throw '@$log is invalid';\n }\n this.doLog = true;\n logFns = {};\n fn1 = (function(_this) {\n return function(level) {\n logFns[level] = function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n if (_this.doLog) {\n return _maybeExecLevel(LEVELS[level], _this.currentLevel, function() {\n var ref;\n return (ref = _this.$log)[level].apply(ref, args);\n });\n }\n };\n return _this[level] = logFns[level];\n };\n })(this);\n for (j = 0, len1 = _fns.length; j < len1; j++) {\n level = _fns[j];\n fn1(level);\n }\n this.LEVELS = LEVELS;\n this.currentLevel = LEVELS.error;\n }\n\n Logger.prototype.spawn = function(newInternalLogger) {\n if (typeof newInternalLogger === 'string') {\n if (!_isValidLogObject(this.$log)) {\n throw '@$log is invalid';\n }\n if (!nemDebug) {\n throw 'nemDebug is undefined this is probably the light version of this library sep debug logggers is not supported!';\n }\n return _wrapDebug(newInternalLogger, this.$log);\n }\n return new Logger(newInternalLogger || this.$log);\n };\n\n return Logger;\n\n })();\n this.decorator = [\n '$log', function($delegate) {\n var log;\n log = new Logger($delegate);\n log.currentLevel = LEVELS.debug;\n return log;\n }\n ];\n this.$get = [\n '$log', function($log) {\n return new Logger($log);\n }\n ];\n return this;\n }\n]);\n\n},{\"debug\":2}],2:[function(require,module,exports){\n\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n},{\"./debug\":3}],3:[function(require,module,exports){\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n},{\"ms\":4}],4:[function(require,module,exports){\n/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} options\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options){\n options = options || {};\n if ('string' == typeof val) return parse(val);\n return options.long\n ? long(val)\n : short(val);\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = '' + str;\n if (str.length > 10000) return;\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n if (!match) return;\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction short(ms) {\n if (ms >= d) return Math.round(ms / d) + 'd';\n if (ms >= h) return Math.round(ms / h) + 'h';\n if (ms >= m) return Math.round(ms / m) + 'm';\n if (ms >= s) return Math.round(ms / s) + 's';\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction long(ms) {\n return plural(ms, d, 'day')\n || plural(ms, h, 'hour')\n || plural(ms, m, 'minute')\n || plural(ms, s, 'second')\n || ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) return;\n if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n},{}]},{},[1]);\n\n/**\n * @license\n * Lodash <https://lodash.com/>\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.20';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g,\n reTrimStart = /^\\s+/,\n reTrimEnd = /\\s+$/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '<p>' + func(text) + '</p>';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '<p>fred, barney, & pebbles</p>'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<b><%- value %></b>');\n * compiled({ 'value': '<script>' });\n * // => '<b><script></b>'\n *\n * // Use the \"evaluate\" delimiter to execute JavaScript and generate HTML.\n * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the internal `print` function in \"evaluate\" delimiters.\n * var compiled = _.template('<% print(\"hello \" + user); %>!');\n * compiled({ 'user': 'barney' });\n * // => 'hello barney!'\n *\n * // Use the ES template literal delimiter as an \"interpolate\" delimiter.\n * // Disable support by replacing the \"interpolate\" delimiter.\n * var compiled = _.template('hello ${ user }!');\n * compiled({ 'user': 'pebbles' });\n * // => 'hello pebbles!'\n *\n * // Use backslashes to treat delimiters as plain text.\n * var compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\n * compiled({ 'value': 'ignored' });\n * // => '<%- value %>'\n *\n * // Use the `imports` option to import `jQuery` as `jq`.\n * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\n * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the `sourceURL` option to specify a custom sourceURL for the template.\n * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\n * compiled(data);\n * // => Find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector.\n *\n * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.\n * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\n * compiled.source;\n * // => function(data) {\n * // var __t, __p = '';\n * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n * // return __p;\n * // }\n *\n * // Use custom template delimiters.\n * _.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\n * var compiled = _.template('hello {{ user }}!');\n * compiled({ 'user': 'mustache' });\n * // => 'hello mustache!'\n *\n * // Use the `source` property to inline compiled templates for meaningful\n * // line numbers in error messages and stack traces.\n * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\\\n * var JST = {\\\n * \"main\": ' + _.template(mainText).source + '\\\n * };\\\n * ');\n */\n function template(string, options, guard) {\n // Based on John Resig's `tmpl` implementation\n // (http://ejohn.org/blog/javascript-micro-templating/)\n // and Laura Doktorova's doT.js (https://github.com/olado/doT).\n var settings = lodash.templateSettings;\n\n if (guard && isIterateeCall(string, options, guard)) {\n options = undefined;\n }\n string = toString(string);\n options = assignInWith({}, options, settings, customDefaultsAssignIn);\n\n var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),\n importsKeys = keys(imports),\n importsValues = baseValues(imports, importsKeys);\n\n var isEscaping,\n isEvaluating,\n index = 0,\n interpolate = options.interpolate || reNoMatch,\n source = \"__p += '\";\n\n // Compile the regexp to match each delimiter.\n var reDelimiters = RegExp(\n (options.escape || reNoMatch).source + '|' +\n interpolate.source + '|' +\n (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n (options.evaluate || reNoMatch).source + '|$'\n , 'g');\n\n // Use a sourceURL for easier debugging.\n // The sourceURL gets injected into the source that's eval-ed, so be careful\n // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in\n // and escape the comment, thus injecting code that gets evaled.\n var sourceURL = '//# sourceURL=' +\n (hasOwnProperty.call(options, 'sourceURL')\n ? (options.sourceURL + '').replace(/\\s/g, ' ')\n : ('lodash.templateSources[' + (++templateCounter) + ']')\n ) + '\\n';\n\n string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n interpolateValue || (interpolateValue = esTemplateValue);\n\n // Escape characters that can't be included in string literals.\n source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n // Replace delimiters with snippets.\n if (escapeValue) {\n isEscaping = true;\n source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n }\n if (evaluateValue) {\n isEvaluating = true;\n source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n }\n if (interpolateValue) {\n source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n }\n index = offset + match.length;\n\n // The JS engine embedded in Adobe products needs `match` returned in\n // order to produce the correct `offset` value.\n return match;\n });\n\n source += \"';\\n\";\n\n // If `variable` is not specified wrap a with-statement around the generated\n // code to add the data object to the top of the scope chain.\n var variable = hasOwnProperty.call(options, 'variable') && options.variable;\n if (!variable) {\n source = 'with (obj) {\\n' + source + '\\n}\\n';\n }\n // Cleanup code by stripping empty strings.\n source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n .replace(reEmptyStringMiddle, '$1')\n .replace(reEmptyStringTrailing, '$1;');\n\n // Frame code as the function body.\n source = 'function(' + (variable || 'obj') + ') {\\n' +\n (variable\n ? ''\n : 'obj || (obj = {});\\n'\n ) +\n \"var __t, __p = ''\" +\n (isEscaping\n ? ', __e = _.escape'\n : ''\n ) +\n (isEvaluating\n ? ', __j = Array.prototype.join;\\n' +\n \"function print() { __p += __j.call(arguments, '') }\\n\"\n : ';\\n'\n ) +\n source +\n 'return __p\\n}';\n\n var result = attempt(function() {\n return Function(importsKeys, sourceURL + 'return ' + source)\n .apply(undefined, importsValues);\n });\n\n // Provide the compiled function's source by its `toString` method or\n // the `source` property as a convenience for inlining compiled templates.\n result.source = source;\n if (isError(result)) {\n throw result;\n }\n return result;\n }\n\n /**\n * Converts `string`, as a whole, to lower case just like\n * [String#toLowerCase](https://mdn.io/toLowerCase).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.toLower('--Foo-Bar--');\n * // => '--foo-bar--'\n *\n * _.toLower('fooBar');\n * // => 'foobar'\n *\n * _.toLower('__FOO_BAR__');\n * // => '__foo_bar__'\n */\n function toLower(value) {\n return toString(value).toLowerCase();\n }\n\n /**\n * Converts `string`, as a whole, to upper case just like\n * [String#toUpperCase](https://mdn.io/toUpperCase).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the upper cased string.\n * @example\n *\n * _.toUpper('--foo-bar--');\n * // => '--FOO-BAR--'\n *\n * _.toUpper('fooBar');\n * // => 'FOOBAR'\n *\n * _.toUpper('__foo_bar__');\n * // => '__FOO_BAR__'\n */\n function toUpper(value) {\n return toString(value).toUpperCase();\n }\n\n /**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n function trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrim, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n }\n\n /**\n * Removes trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimEnd(' abc ');\n * // => ' abc'\n *\n * _.trimEnd('-_-abc-_-', '_-');\n * // => '-_-abc'\n */\n function trimEnd(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrimEnd, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;\n\n return castSlice(strSymbols, 0, end).join('');\n }\n\n /**\n * Removes leading whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimStart(' abc ');\n * // => 'abc '\n *\n * _.trimStart('-_-abc-_-', '_-');\n * // => 'abc-_-'\n */\n function trimStart(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrimStart, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n start = charsStartIndex(strSymbols, stringToArray(chars));\n\n return castSlice(strSymbols, start).join('');\n }\n\n /**\n * Truncates `string` if it's longer than the given maximum string length.\n * The last characters of the truncated string are replaced with the omission\n * string which defaults to \"...\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to truncate.\n * @param {Object} [options={}] The options object.\n * @param {number} [options.length=30] The maximum string length.\n * @param {string} [options.omission='...'] The string to indicate text is omitted.\n * @param {RegExp|string} [options.separator] The separator pattern to truncate to.\n * @returns {string} Returns the truncated string.\n * @example\n *\n * _.truncate('hi-diddly-ho there, neighborino');\n * // => 'hi-diddly-ho there, neighbo...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': ' '\n * });\n * // => 'hi-diddly-ho there,...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': /,? +/\n * });\n * // => 'hi-diddly-ho there...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'omission': ' [...]'\n * });\n * // => 'hi-diddly-ho there, neig [...]'\n */\n function truncate(string, options) {\n var length = DEFAULT_TRUNC_LENGTH,\n omission = DEFAULT_TRUNC_OMISSION;\n\n if (isObject(options)) {\n var separator = 'separator' in options ? options.separator : separator;\n length = 'length' in options ? toInteger(options.length) : length;\n omission = 'omission' in options ? baseToString(options.omission) : omission;\n }\n string = toString(string);\n\n var strLength = string.length;\n if (hasUnicode(string)) {\n var strSymbols = stringToArray(string);\n strLength = strSymbols.length;\n }\n if (length >= strLength) {\n return string;\n }\n var end = length - stringSize(omission);\n if (end < 1) {\n return omission;\n }\n var result = strSymbols\n ? castSlice(strSymbols, 0, end).join('')\n : string.slice(0, end);\n\n if (separator === undefined) {\n return result + omission;\n }\n if (strSymbols) {\n end += (result.length - end);\n }\n if (isRegExp(separator)) {\n if (string.slice(end).search(separator)) {\n var match,\n substring = result;\n\n if (!separator.global) {\n separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');\n }\n separator.lastIndex = 0;\n while ((match = separator.exec(substring))) {\n var newEnd = match.index;\n }\n result = result.slice(0, newEnd === undefined ? end : newEnd);\n }\n } else if (string.indexOf(baseToString(separator), end) != end) {\n var index = result.lastIndexOf(separator);\n if (index > -1) {\n result = result.slice(0, index);\n }\n }\n return result + omission;\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, and `'` in `string` to\n * their corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional\n * HTML entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @since 0.6.0\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /**\n * Converts `string`, as space separated words, to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the upper cased string.\n * @example\n *\n * _.upperCase('--foo-bar');\n * // => 'FOO BAR'\n *\n * _.upperCase('fooBar');\n * // => 'FOO BAR'\n *\n * _.upperCase('__foo_bar__');\n * // => 'FOO BAR'\n */\n var upperCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toUpperCase();\n });\n\n /**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\n var upperFirst = createCaseFirst('toUpperCase');\n\n /**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\n function words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\n var attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n });\n\n /**\n * Binds methods of an object to the object itself, overwriting the existing\n * method.\n *\n * **Note:** This method doesn't set the \"length\" property of bound functions.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} methodNames The object method names to bind.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'click': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view, ['click']);\n * jQuery(element).on('click', view.click);\n * // => Logs 'clicked docs' when clicked.\n */\n var bindAll = flatRest(function(object, methodNames) {\n arrayEach(methodNames, function(key) {\n key = toKey(key);\n baseAssignValue(object, key, bind(object[key], object));\n });\n return object;\n });\n\n /**\n * Creates a function that iterates over `pairs` and invokes the corresponding\n * function of the first predicate to return truthy. The predicate-function\n * pairs are invoked with the `this` binding and arguments of the created\n * function.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Array} pairs The predicate-function pairs.\n * @returns {Function} Returns the new composite function.\n * @example\n *\n * var func = _.cond([\n * [_.matches({ 'a': 1 }), _.constant('matches A')],\n * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n * [_.stubTrue, _.constant('no match')]\n * ]);\n *\n * func({ 'a': 1, 'b': 2 });\n * // => 'matches A'\n *\n * func({ 'a': 0, 'b': 1 });\n * // => 'matches B'\n *\n * func({ 'a': '1', 'b': '2' });\n * // => 'no match'\n */\n function cond(pairs) {\n var length = pairs == null ? 0 : pairs.length,\n toIteratee = getIteratee();\n\n pairs = !length ? [] : arrayMap(pairs, function(pair) {\n if (typeof pair[1] != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return [toIteratee(pair[0]), pair[1]];\n });\n\n return baseRest(function(args) {\n var index = -1;\n while (++index < length) {\n var pair = pairs[index];\n if (apply(pair[0], this, args)) {\n return apply(pair[1], this, args);\n }\n }\n });\n }\n\n /**\n * Creates a function that invokes the predicate properties of `source` with\n * the corresponding property values of a given object, returning `true` if\n * all predicates return truthy, else `false`.\n *\n * **Note:** The created function is equivalent to `_.conformsTo` with\n * `source` partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 2, 'b': 1 },\n * { 'a': 1, 'b': 2 }\n * ];\n *\n * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));\n * // => [{ 'a': 1, 'b': 2 }]\n */\n function conforms(source) {\n return baseConforms(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\n function defaultTo(value, defaultValue) {\n return (value == null || value !== value) ? defaultValue : value;\n }\n\n /**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\n var flow = createFlow();\n\n /**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\n var flowRight = createFlow(true);\n\n /**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between the\n * value at `path` of a given object to `srcValue`, returning `true` if the\n * object value is equivalent, else `false`.\n *\n * **Note:** Partial comparisons will match empty array and empty object\n * `srcValue` values against any array or object value, respectively. See\n * `_.isEqual` for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.find(objects, _.matchesProperty('a', 4));\n * // => { 'a': 4, 'b': 5, 'c': 6 }\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that invokes the method at `path` of a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': _.constant(2) } },\n * { 'a': { 'b': _.constant(1) } }\n * ];\n *\n * _.map(objects, _.method('a.b'));\n * // => [2, 1]\n *\n * _.map(objects, _.method(['a', 'b']));\n * // => [2, 1]\n */\n var method = baseRest(function(path, args) {\n return function(object) {\n return baseInvoke(object, path, args);\n };\n });\n\n /**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path of `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\n var methodOf = baseRest(function(object, args) {\n return function(path) {\n return baseInvoke(object, path, args);\n };\n });\n\n /**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\n function mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n if (options == null &&\n !(isObject(source) && (methodNames.length || !props.length))) {\n options = source;\n source = object;\n object = this;\n methodNames = baseFunctions(source, keys(source));\n }\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n }\n\n /**\n * Reverts the `_` variable to its previous value and returns a reference to\n * the `lodash` function.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @returns {Function} Returns the `lodash` function.\n * @example\n *\n * var lodash = _.noConflict();\n */\n function noConflict() {\n if (root._ === this) {\n root._ = oldDash;\n }\n return this;\n }\n\n /**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\n function noop() {\n // No operation performed.\n }\n\n /**\n * Creates a function that gets the argument at index `n`. If `n` is negative,\n * the nth argument from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [n=0] The index of the argument to return.\n * @returns {Function} Returns the new pass-thru function.\n * @example\n *\n * var func = _.nthArg(1);\n * func('a', 'b', 'c', 'd');\n * // => 'b'\n *\n * var func = _.nthArg(-2);\n * func('a', 'b', 'c', 'd');\n * // => 'c'\n */\n function nthArg(n) {\n n = toInteger(n);\n return baseRest(function(args) {\n return baseNth(args, n);\n });\n }\n\n /**\n * Creates a function that invokes `iteratees` with the arguments it receives\n * and returns their results.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.over([Math.max, Math.min]);\n *\n * func(1, 2, 3, 4);\n * // => [4, 1]\n */\n var over = createOver(arrayMap);\n\n /**\n * Creates a function that checks if **all** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overEvery([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => false\n *\n * func(NaN);\n * // => false\n */\n var overEvery = createOver(arrayEvery);\n\n /**\n * Creates a function that checks if **any** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overSome([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => true\n *\n * func(NaN);\n * // => false\n *\n * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])\n * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])\n */\n var overSome = createOver(arraySome);\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n }\n\n /**\n * The opposite of `_.property`; this method creates a function that returns\n * the value at a given path of `object`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\n function propertyOf(object) {\n return function(path) {\n return object == null ? undefined : baseGet(object, path);\n };\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /**\n * This method is like `_.range` except that it populates values in\n * descending order.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.range\n * @example\n *\n * _.rangeRight(4);\n * // => [3, 2, 1, 0]\n *\n * _.rangeRight(-4);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 5);\n * // => [4, 3, 2, 1]\n *\n * _.rangeRight(0, 20, 5);\n * // => [15, 10, 5, 0]\n *\n * _.rangeRight(0, -4, -1);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.rangeRight(0);\n * // => []\n */\n var rangeRight = createRange(true);\n\n /**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\n function stubArray() {\n return [];\n }\n\n /**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\n function stubFalse() {\n return false;\n }\n\n /**\n * This method returns a new empty object.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Object} Returns the new empty object.\n * @example\n *\n * var objects = _.times(2, _.stubObject);\n *\n * console.log(objects);\n * // => [{}, {}]\n *\n * console.log(objects[0] === objects[1]);\n * // => false\n */\n function stubObject() {\n return {};\n }\n\n /**\n * This method returns an empty string.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {string} Returns the empty string.\n * @example\n *\n * _.times(2, _.stubString);\n * // => ['', '']\n */\n function stubString() {\n return '';\n }\n\n /**\n * This method returns `true`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `true`.\n * @example\n *\n * _.times(2, _.stubTrue);\n * // => [true, true]\n */\n function stubTrue() {\n return true;\n }\n\n /**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\n function times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = getIteratee(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n }\n\n /**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\n function toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n }\n\n /**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\n function uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Adds two numbers.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {number} augend The first number in an addition.\n * @param {number} addend The second number in an addition.\n * @returns {number} Returns the total.\n * @example\n *\n * _.add(6, 4);\n * // => 10\n */\n var add = createMathOperation(function(augend, addend) {\n return augend + addend;\n }, 0);\n\n /**\n * Computes `number` rounded up to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round up.\n * @param {number} [precision=0] The precision to round up to.\n * @returns {number} Returns the rounded up number.\n * @example\n *\n * _.ceil(4.006);\n * // => 5\n *\n * _.ceil(6.004, 2);\n * // => 6.01\n *\n * _.ceil(6040, -2);\n * // => 6100\n */\n var ceil = createRound('ceil');\n\n /**\n * Divide two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} dividend The first number in a division.\n * @param {number} divisor The second number in a division.\n * @returns {number} Returns the quotient.\n * @example\n *\n * _.divide(6, 4);\n * // => 1.5\n */\n var divide = createMathOperation(function(dividend, divisor) {\n return dividend / divisor;\n }, 1);\n\n /**\n * Computes `number` rounded down to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round down.\n * @param {number} [precision=0] The precision to round down to.\n * @returns {number} Returns the rounded down number.\n * @example\n *\n * _.floor(4.006);\n * // => 4\n *\n * _.floor(0.046, 2);\n * // => 0.04\n *\n * _.floor(4060, -2);\n * // => 4000\n */\n var floor = createRound('floor');\n\n /**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\n function max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n }\n\n /**\n * This method is like `_.max` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n function maxBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)\n : undefined;\n }\n\n /**\n * Computes the mean of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the mean.\n * @example\n *\n * _.mean([4, 2, 8, 6]);\n * // => 5\n */\n function mean(array) {\n return baseMean(array, identity);\n }\n\n /**\n * This method is like `_.mean` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be averaged.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the mean.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.meanBy(objects, function(o) { return o.n; });\n * // => 5\n *\n * // The `_.property` iteratee shorthand.\n * _.meanBy(objects, 'n');\n * // => 5\n */\n function meanBy(array, iteratee) {\n return baseMean(array, getIteratee(iteratee, 2));\n }\n\n /**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\n function min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n }\n\n /**\n * This method is like `_.min` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * // The `_.property` iteratee shorthand.\n * _.minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n function minBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)\n : undefined;\n }\n\n /**\n * Multiply two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} multiplier The first number in a multiplication.\n * @param {number} multiplicand The second number in a multiplication.\n * @returns {number} Returns the product.\n * @example\n *\n * _.multiply(6, 4);\n * // => 24\n */\n var multiply = createMathOperation(function(multiplier, multiplicand) {\n return multiplier * multiplicand;\n }, 1);\n\n /**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\n var round = createRound('round');\n\n /**\n * Subtract two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {number} minuend The first number in a subtraction.\n * @param {number} subtrahend The second number in a subtraction.\n * @returns {number} Returns the difference.\n * @example\n *\n * _.subtract(6, 4);\n * // => 2\n */\n var subtract = createMathOperation(function(minuend, subtrahend) {\n return minuend - subtrahend;\n }, 0);\n\n /**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\n function sum(array) {\n return (array && array.length)\n ? baseSum(array, identity)\n : 0;\n }\n\n /**\n * This method is like `_.sum` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be summed.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the sum.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.sumBy(objects, function(o) { return o.n; });\n * // => 20\n *\n * // The `_.property` iteratee shorthand.\n * _.sumBy(objects, 'n');\n * // => 20\n */\n function sumBy(array, iteratee) {\n return (array && array.length)\n ? baseSum(array, getIteratee(iteratee, 2))\n : 0;\n }\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return wrapped values in chain sequences.\n lodash.after = after;\n lodash.ary = ary;\n lodash.assign = assign;\n lodash.assignIn = assignIn;\n lodash.assignInWith = assignInWith;\n lodash.assignWith = assignWith;\n lodash.at = at;\n lodash.before = before;\n lodash.bind = bind;\n lodash.bindAll = bindAll;\n lodash.bindKey = bindKey;\n lodash.castArray = castArray;\n lodash.chain = chain;\n lodash.chunk = chunk;\n lodash.compact = compact;\n lodash.concat = concat;\n lodash.cond = cond;\n lodash.conforms = conforms;\n lodash.constant = constant;\n lodash.countBy = countBy;\n lodash.create = create;\n lodash.curry = curry;\n lodash.curryRight = curryRight;\n lodash.debounce = debounce;\n lodash.defaults = defaults;\n lodash.defaultsDeep = defaultsDeep;\n lodash.defer = defer;\n lodash.delay = delay;\n lodash.difference = difference;\n lodash.differenceBy = differenceBy;\n lodash.differenceWith = differenceWith;\n lodash.drop = drop;\n lodash.dropRight = dropRight;\n lodash.dropRightWhile = dropRightWhile;\n lodash.dropWhile = dropWhile;\n lodash.fill = fill;\n lodash.filter = filter;\n lodash.flatMap = flatMap;\n lodash.flatMapDeep = flatMapDeep;\n lodash.flatMapDepth = flatMapDepth;\n lodash.flatten = flatten;\n lodash.flattenDeep = flattenDeep;\n lodash.flattenDepth = flattenDepth;\n lodash.flip = flip;\n lodash.flow = flow;\n lodash.flowRight = flowRight;\n lodash.fromPairs = fromPairs;\n lodash.functions = functions;\n lodash.functionsIn = functionsIn;\n lodash.groupBy = groupBy;\n lodash.initial = initial;\n lodash.intersection = intersection;\n lodash.intersectionBy = intersectionBy;\n lodash.intersectionWith = intersectionWith;\n lodash.invert = invert;\n lodash.invertBy = invertBy;\n lodash.invokeMap = invokeMap;\n lodash.iteratee = iteratee;\n lodash.keyBy = keyBy;\n lodash.keys = keys;\n lodash.keysIn = keysIn;\n lodash.map = map;\n lodash.mapKeys = mapKeys;\n lodash.mapValues = mapValues;\n lodash.matches = matches;\n lodash.matchesProperty = matchesProperty;\n lodash.memoize = memoize;\n lodash.merge = merge;\n lodash.mergeWith = mergeWith;\n lodash.method = method;\n lodash.methodOf = methodOf;\n lodash.mixin = mixin;\n lodash.negate = negate;\n lodash.nthArg = nthArg;\n lodash.omit = omit;\n lodash.omitBy = omitBy;\n lodash.once = once;\n lodash.orderBy = orderBy;\n lodash.over = over;\n lodash.overArgs = overArgs;\n lodash.overEvery = overEvery;\n lodash.overSome = overSome;\n lodash.partial = partial;\n lodash.partialRight = partialRight;\n lodash.partition = partition;\n lodash.pick = pick;\n lodash.pickBy = pickBy;\n lodash.property = property;\n lodash.propertyOf = propertyOf;\n lodash.pull = pull;\n lodash.pullAll = pullAll;\n lodash.pullAllBy = pullAllBy;\n lodash.pullAllWith = pullAllWith;\n lodash.pullAt = pullAt;\n lodash.range = range;\n lodash.rangeRight = rangeRight;\n lodash.rearg = rearg;\n lodash.reject = reject;\n lodash.remove = remove;\n lodash.rest = rest;\n lodash.reverse = reverse;\n lodash.sampleSize = sampleSize;\n lodash.set = set;\n lodash.setWith = setWith;\n lodash.shuffle = shuffle;\n lodash.slice = slice;\n lodash.sortBy = sortBy;\n lodash.sortedUniq = sortedUniq;\n lodash.sortedUniqBy = sortedUniqBy;\n lodash.split = split;\n lodash.spread = spread;\n lodash.tail = tail;\n lodash.take = take;\n lodash.takeRight = takeRight;\n lodash.takeRightWhile = takeRightWhile;\n lodash.takeWhile = takeWhile;\n lodash.tap = tap;\n lodash.throttle = throttle;\n lodash.thru = thru;\n lodash.toArray = toArray;\n lodash.toPairs = toPairs;\n lodash.toPairsIn = toPairsIn;\n lodash.toPath = toPath;\n lodash.toPlainObject = toPlainObject;\n lodash.transform = transform;\n lodash.unary = unary;\n lodash.union = union;\n lodash.unionBy = unionBy;\n lodash.unionWith = unionWith;\n lodash.uniq = uniq;\n lodash.uniqBy = uniqBy;\n lodash.uniqWith = uniqWith;\n lodash.unset = unset;\n lodash.unzip = unzip;\n lodash.unzipWith = unzipWith;\n lodash.update = update;\n lodash.updateWith = updateWith;\n lodash.values = values;\n lodash.valuesIn = valuesIn;\n lodash.without = without;\n lodash.words = words;\n lodash.wrap = wrap;\n lodash.xor = xor;\n lodash.xorBy = xorBy;\n lodash.xorWith = xorWith;\n lodash.zip = zip;\n lodash.zipObject = zipObject;\n lodash.zipObjectDeep = zipObjectDeep;\n lodash.zipWith = zipWith;\n\n // Add aliases.\n lodash.entries = toPairs;\n lodash.entriesIn = toPairsIn;\n lodash.extend = assignIn;\n lodash.extendWith = assignInWith;\n\n // Add methods to `lodash.prototype`.\n mixin(lodash, lodash);\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return unwrapped values in chain sequences.\n lodash.add = add;\n lodash.attempt = attempt;\n lodash.camelCase = camelCase;\n lodash.capitalize = capitalize;\n lodash.ceil = ceil;\n lodash.clamp = clamp;\n lodash.clone = clone;\n lodash.cloneDeep = cloneDeep;\n lodash.cloneDeepWith = cloneDeepWith;\n lodash.cloneWith = cloneWith;\n lodash.conformsTo = conformsTo;\n lodash.deburr = deburr;\n lodash.defaultTo = defaultTo;\n lodash.divide = divide;\n lodash.endsWith = endsWith;\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.every = every;\n lodash.find = find;\n lodash.findIndex = findIndex;\n lodash.findKey = findKey;\n lodash.findLast = findLast;\n lodash.findLastIndex = findLastIndex;\n lodash.findLastKey = findLastKey;\n lodash.floor = floor;\n lodash.forEach = forEach;\n lodash.forEachRight = forEachRight;\n lodash.forIn = forIn;\n lodash.forInRight = forInRight;\n lodash.forOwn = forOwn;\n lodash.forOwnRight = forOwnRight;\n lodash.get = get;\n lodash.gt = gt;\n lodash.gte = gte;\n lodash.has = has;\n lodash.hasIn = hasIn;\n lodash.head = head;\n lodash.identity = identity;\n lodash.includes = includes;\n lodash.indexOf = indexOf;\n lodash.inRange = inRange;\n lodash.invoke = invoke;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayBuffer = isArrayBuffer;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBoolean = isBoolean;\n lodash.isBuffer = isBuffer;\n lodash.isDate = isDate;\n lodash.isElement = isElement;\n lodash.isEmpty = isEmpty;\n lodash.isEqual = isEqual;\n lodash.isEqualWith = isEqualWith;\n lodash.isError = isError;\n lodash.isFinite = isFinite;\n lodash.isFunction = isFunction;\n lodash.isInteger = isInteger;\n lodash.isLength = isLength;\n lodash.isMap = isMap;\n lodash.isMatch = isMatch;\n lodash.isMatchWith = isMatchWith;\n lodash.isNaN = isNaN;\n lodash.isNative = isNative;\n lodash.isNil = isNil;\n lodash.isNull = isNull;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isPlainObject = isPlainObject;\n lodash.isRegExp = isRegExp;\n lodash.isSafeInteger = isSafeInteger;\n lodash.isSet = isSet;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.isWeakMap = isWeakMap;\n lodash.isWeakSet = isWeakSet;\n lodash.join = join;\n lodash.kebabCase = kebabCase;\n lodash.last = last;\n lodash.lastIndexOf = lastIndexOf;\n lodash.lowerCase = lowerCase;\n lodash.lowerFirst = lowerFirst;\n lodash.lt = lt;\n lodash.lte = lte;\n lodash.max = max;\n lodash.maxBy = maxBy;\n lodash.mean = mean;\n lodash.meanBy = meanBy;\n lodash.min = min;\n lodash.minBy = minBy;\n lodash.stubArray = stubArray;\n lodash.stubFalse = stubFalse;\n lodash.stubObject = stubObject;\n lodash.stubString = stubString;\n lodash.stubTrue = stubTrue;\n lodash.multiply = multiply;\n lodash.nth = nth;\n lodash.noConflict = noConflict;\n lodash.noop = noop;\n lodash.now = now;\n lodash.pad = pad;\n lodash.padEnd = padEnd;\n lodash.padStart = padStart;\n lodash.parseInt = parseInt;\n lodash.random = random;\n lodash.reduce = reduce;\n lodash.reduceRight = reduceRight;\n lodash.repeat = repeat;\n lodash.replace = replace;\n lodash.result = result;\n lodash.round = round;\n lodash.runInContext = runInContext;\n lodash.sample = sample;\n lodash.size = size;\n lodash.snakeCase = snakeCase;\n lodash.some = some;\n lodash.sortedIndex = sortedIndex;\n lodash.sortedIndexBy = sortedIndexBy;\n lodash.sortedIndexOf = sortedIndexOf;\n lodash.sortedLastIndex = sortedLastIndex;\n lodash.sortedLastIndexBy = sortedLastIndexBy;\n lodash.sortedLastIndexOf = sortedLastIndexOf;\n lodash.startCase = startCase;\n lodash.startsWith = startsWith;\n lodash.subtract = subtract;\n lodash.sum = sum;\n lodash.sumBy = sumBy;\n lodash.template = template;\n lodash.times = times;\n lodash.toFinite = toFinite;\n lodash.toInteger = toInteger;\n lodash.toLength = toLength;\n lodash.toLower = toLower;\n lodash.toNumber = toNumber;\n lodash.toSafeInteger = toSafeInteger;\n lodash.toString = toString;\n lodash.toUpper = toUpper;\n lodash.trim = trim;\n lodash.trimEnd = trimEnd;\n lodash.trimStart = trimStart;\n lodash.truncate = truncate;\n lodash.unescape = unescape;\n lodash.uniqueId = uniqueId;\n lodash.upperCase = upperCase;\n lodash.upperFirst = upperFirst;\n\n // Add aliases.\n lodash.each = forEach;\n lodash.eachRight = forEachRight;\n lodash.first = head;\n\n mixin(lodash, (function() {\n var source = {};\n baseForOwn(lodash, function(func, methodName) {\n if (!hasOwnProperty.call(lodash.prototype, methodName)) {\n source[methodName] = func;\n }\n });\n return source;\n }()), { 'chain': false });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n // Assign default placeholders.\n arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {\n lodash[methodName].placeholder = lodash;\n });\n\n // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n arrayEach(['drop', 'take'], function(methodName, index) {\n LazyWrapper.prototype[methodName] = function(n) {\n n = n === undefined ? 1 : nativeMax(toInteger(n), 0);\n\n var result = (this.__filtered__ && !index)\n ? new LazyWrapper(this)\n : this.clone();\n\n if (result.__filtered__) {\n result.__takeCount__ = nativeMin(n, result.__takeCount__);\n } else {\n result.__views__.push({\n 'size': nativeMin(n, MAX_ARRAY_LENGTH),\n 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')\n });\n }\n return result;\n };\n\n LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n return this.reverse()[methodName](n).reverse();\n };\n });\n\n // Add `LazyWrapper` methods that accept an `iteratee` value.\n arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n var type = index + 1,\n isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;\n\n LazyWrapper.prototype[methodName] = function(iteratee) {\n var result = this.clone();\n result.__iteratees__.push({\n 'iteratee': getIteratee(iteratee, 3),\n 'type': type\n });\n result.__filtered__ = result.__filtered__ || isFilter;\n return result;\n };\n });\n\n // Add `LazyWrapper` methods for `_.head` and `_.last`.\n arrayEach(['head', 'last'], function(methodName, index) {\n var takeName = 'take' + (index ? 'Right' : '');\n\n LazyWrapper.prototype[methodName] = function() {\n return this[takeName](1).value()[0];\n };\n });\n\n // Add `LazyWrapper` methods for `_.initial` and `_.tail`.\n arrayEach(['initial', 'tail'], function(methodName, index) {\n var dropName = 'drop' + (index ? '' : 'Right');\n\n LazyWrapper.prototype[methodName] = function() {\n return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n };\n });\n\n LazyWrapper.prototype.compact = function() {\n return this.filter(identity);\n };\n\n LazyWrapper.prototype.find = function(predicate) {\n return this.filter(predicate).head();\n };\n\n LazyWrapper.prototype.findLast = function(predicate) {\n return this.reverse().find(predicate);\n };\n\n LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {\n if (typeof path == 'function') {\n return new LazyWrapper(this);\n }\n return this.map(function(value) {\n return baseInvoke(value, path, args);\n });\n });\n\n LazyWrapper.prototype.reject = function(predicate) {\n return this.filter(negate(getIteratee(predicate)));\n };\n\n LazyWrapper.prototype.slice = function(start, end) {\n start = toInteger(start);\n\n var result = this;\n if (result.__filtered__ && (start > 0 || end < 0)) {\n return new LazyWrapper(result);\n }\n if (start < 0) {\n result = result.takeRight(-start);\n } else if (start) {\n result = result.drop(start);\n }\n if (end !== undefined) {\n end = toInteger(end);\n result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n }\n return result;\n };\n\n LazyWrapper.prototype.takeRightWhile = function(predicate) {\n return this.reverse().takeWhile(predicate).reverse();\n };\n\n LazyWrapper.prototype.toArray = function() {\n return this.take(MAX_ARRAY_LENGTH);\n };\n\n // Add `LazyWrapper` methods to `lodash.prototype`.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),\n isTaker = /^(?:head|last)$/.test(methodName),\n lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],\n retUnwrapped = isTaker || /^find/.test(methodName);\n\n if (!lodashFunc) {\n return;\n }\n lodash.prototype[methodName] = function() {\n var value = this.__wrapped__,\n args = isTaker ? [1] : arguments,\n isLazy = value instanceof LazyWrapper,\n iteratee = args[0],\n useLazy = isLazy || isArray(value);\n\n var interceptor = function(value) {\n var result = lodashFunc.apply(lodash, arrayPush([value], args));\n return (isTaker && chainAll) ? result[0] : result;\n };\n\n if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n isLazy = useLazy = false;\n }\n var chainAll = this.__chain__,\n isHybrid = !!this.__actions__.length,\n isUnwrapped = retUnwrapped && !chainAll,\n onlyLazy = isLazy && !isHybrid;\n\n if (!retUnwrapped && useLazy) {\n value = onlyLazy ? value : new LazyWrapper(this);\n var result = func.apply(value, args);\n result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n return new LodashWrapper(result, chainAll);\n }\n if (isUnwrapped && onlyLazy) {\n return func.apply(this, args);\n }\n result = this.thru(interceptor);\n return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;\n };\n });\n\n // Add `Array` methods to `lodash.prototype`.\n arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {\n var func = arrayProto[methodName],\n chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n retUnwrapped = /^(?:pop|shift)$/.test(methodName);\n\n lodash.prototype[methodName] = function() {\n var args = arguments;\n if (retUnwrapped && !this.__chain__) {\n var value = this.value();\n return func.apply(isArray(value) ? value : [], args);\n }\n return this[chainName](function(value) {\n return func.apply(isArray(value) ? value : [], args);\n });\n };\n });\n\n // Map minified method names to their real names.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var lodashFunc = lodash[methodName];\n if (lodashFunc) {\n var key = lodashFunc.name + '';\n if (!hasOwnProperty.call(realNames, key)) {\n realNames[key] = [];\n }\n realNames[key].push({ 'name': methodName, 'func': lodashFunc });\n }\n });\n\n realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{\n 'name': 'wrapper',\n 'func': undefined\n }];\n\n // Add methods to `LazyWrapper`.\n LazyWrapper.prototype.clone = lazyClone;\n LazyWrapper.prototype.reverse = lazyReverse;\n LazyWrapper.prototype.value = lazyValue;\n\n // Add chain sequence methods to the `lodash` wrapper.\n lodash.prototype.at = wrapperAt;\n lodash.prototype.chain = wrapperChain;\n lodash.prototype.commit = wrapperCommit;\n lodash.prototype.next = wrapperNext;\n lodash.prototype.plant = wrapperPlant;\n lodash.prototype.reverse = wrapperReverse;\n lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;\n\n // Add lazy aliases.\n lodash.prototype.first = lodash.prototype.head;\n\n if (symIterator) {\n lodash.prototype[symIterator] = wrapperToIterator;\n }\n return lodash;\n });\n\n /*--------------------------------------------------------------------------*/\n\n // Export lodash.\n var _ = runInContext();\n\n // Some AMD build optimizers, like r.js, check for condition patterns like:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Expose Lodash on the global object to prevent errors when Lodash is\n // loaded by a script tag in the presence of an AMD loader.\n // See http://requirejs.org/docs/errors.html#mismatch for more details.\n // Use `_.noConflict` to remove Lodash from the global object.\n root._ = _;\n\n // Define as an anonymous module so, through path mapping, it can be\n // referenced as the \"underscore\" module.\n define(function() {\n return _;\n });\n }\n // Check for `exports` after `define` in case a build optimizer adds it.\n else if (freeModule) {\n // Export for Node.js.\n (freeModule.exports = _)._ = _;\n // Export for CommonJS support.\n freeExports._ = _;\n }\n else {\n // Export to the global object.\n root._ = _;\n }\n}.call(this));\n\n/*! angular-google-maps 2.3.2 2016-02-11\n * AngularJS directives for Google Maps\n * git: https://github.com/angular-ui/angular-google-maps.git\n */\n;\n(function( window, angular, undefined ){\n 'use strict';\n/*\n!\nThe MIT License\n\nCopyright (c) 2010-2013 Google, Inc. http://angularjs.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the 'Software'), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nangular-google-maps\nhttps://github.com/angular-ui/angular-google-maps\n\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps.providers', ['nemLogging']);\n\n angular.module('uiGmapgoogle-maps.wrapped', []);\n\n angular.module('uiGmapgoogle-maps.extensions', ['uiGmapgoogle-maps.wrapped', 'uiGmapgoogle-maps.providers']);\n\n angular.module('uiGmapgoogle-maps.directives.api.utils', ['uiGmapgoogle-maps.extensions']);\n\n angular.module('uiGmapgoogle-maps.directives.api.managers', []);\n\n angular.module('uiGmapgoogle-maps.directives.api.options', ['uiGmapgoogle-maps.directives.api.utils']);\n\n angular.module('uiGmapgoogle-maps.directives.api.options.builders', []);\n\n angular.module('uiGmapgoogle-maps.directives.api.models.child', ['uiGmapgoogle-maps.directives.api.utils', 'uiGmapgoogle-maps.directives.api.options', 'uiGmapgoogle-maps.directives.api.options.builders']);\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent', ['uiGmapgoogle-maps.directives.api.managers', 'uiGmapgoogle-maps.directives.api.models.child', 'uiGmapgoogle-maps.providers']);\n\n angular.module('uiGmapgoogle-maps.directives.api', ['uiGmapgoogle-maps.directives.api.models.parent']);\n\n angular.module('uiGmapgoogle-maps', ['uiGmapgoogle-maps.directives.api', 'uiGmapgoogle-maps.providers']);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.providers').factory('uiGmapMapScriptLoader', [\n '$q', 'uiGmapuuid', function($q, uuid) {\n var getScriptUrl, includeScript, isGoogleMapsLoaded, scriptId, usedConfiguration;\n scriptId = void 0;\n usedConfiguration = void 0;\n getScriptUrl = function(options) {\n if (options.china) {\n return 'http://maps.google.cn/maps/api/js?';\n } else {\n if (options.transport === 'auto') {\n return '//maps.googleapis.com/maps/api/js?';\n } else {\n return options.transport + '://maps.googleapis.com/maps/api/js?';\n }\n }\n };\n includeScript = function(options) {\n var omitOptions, query, script, scriptElem;\n omitOptions = ['transport', 'isGoogleMapsForWork', 'china', 'preventLoad'];\n if (options.isGoogleMapsForWork) {\n omitOptions.push('key');\n }\n query = _.map(_.omit(options, omitOptions), function(v, k) {\n return k + '=' + v;\n });\n if (scriptId) {\n scriptElem = document.getElementById(scriptId);\n scriptElem.parentNode.removeChild(scriptElem);\n }\n query = query.join('&');\n script = document.createElement('script');\n script.id = scriptId = \"ui_gmap_map_load_\" + (uuid.generate());\n script.type = 'text/javascript';\n script.src = getScriptUrl(options) + query;\n return document.body.appendChild(script);\n };\n isGoogleMapsLoaded = function() {\n return angular.isDefined(window.google) && angular.isDefined(window.google.maps);\n };\n return {\n load: function(options) {\n var deferred, randomizedFunctionName;\n deferred = $q.defer();\n if (isGoogleMapsLoaded()) {\n deferred.resolve(window.google.maps);\n return deferred.promise;\n }\n randomizedFunctionName = options.callback = 'onGoogleMapsReady' + Math.round(Math.random() * 1000);\n window[randomizedFunctionName] = function() {\n window[randomizedFunctionName] = null;\n deferred.resolve(window.google.maps);\n };\n if (window.navigator.connection && window.Connection && window.navigator.connection.type === window.Connection.NONE && !options.preventLoad) {\n document.addEventListener('online', function() {\n if (!isGoogleMapsLoaded()) {\n return includeScript(options);\n }\n });\n } else if (!options.preventLoad) {\n includeScript(options);\n }\n usedConfiguration = options;\n usedConfiguration.randomizedFunctionName = randomizedFunctionName;\n return deferred.promise;\n },\n manualLoad: function() {\n var config;\n config = usedConfiguration;\n if (!isGoogleMapsLoaded()) {\n return includeScript(config);\n } else {\n if (window[config.randomizedFunctionName]) {\n return window[config.randomizedFunctionName]();\n }\n }\n }\n };\n }\n ]).provider('uiGmapGoogleMapApi', function() {\n this.options = {\n transport: 'https',\n isGoogleMapsForWork: false,\n china: false,\n v: '3',\n libraries: '',\n language: 'en',\n preventLoad: false\n };\n this.configure = function(options) {\n angular.extend(this.options, options);\n };\n this.$get = [\n 'uiGmapMapScriptLoader', (function(_this) {\n return function(loader) {\n return loader.load(_this.options);\n };\n })(this)\n ];\n return this;\n }).service('uiGmapGoogleMapApiManualLoader', [\n 'uiGmapMapScriptLoader', function(loader) {\n return {\n load: function() {\n loader.manualLoad();\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.extensions').service('uiGmapExtendGWin', function() {\n return {\n init: _.once(function() {\n var uiGmapInfoBox;\n if (!(google || (typeof google !== \"undefined\" && google !== null ? google.maps : void 0) || (google.maps.InfoWindow != null))) {\n return;\n }\n google.maps.InfoWindow.prototype._open = google.maps.InfoWindow.prototype.open;\n google.maps.InfoWindow.prototype._close = google.maps.InfoWindow.prototype.close;\n google.maps.InfoWindow.prototype._isOpen = false;\n google.maps.InfoWindow.prototype.open = function(map, anchor, recurse) {\n if (recurse != null) {\n return;\n }\n this._isOpen = true;\n this._open(map, anchor, true);\n };\n google.maps.InfoWindow.prototype.close = function(recurse) {\n if (recurse != null) {\n return;\n }\n this._isOpen = false;\n this._close(true);\n };\n google.maps.InfoWindow.prototype.isOpen = function(val) {\n if (val == null) {\n val = void 0;\n }\n if (val == null) {\n return this._isOpen;\n } else {\n return this._isOpen = val;\n }\n };\n\n /*\n Do the same for InfoBox\n TODO: Clean this up so the logic is defined once, wait until develop becomes master as this will be easier\n */\n if (window.InfoBox) {\n window.InfoBox.prototype._open = window.InfoBox.prototype.open;\n window.InfoBox.prototype._close = window.InfoBox.prototype.close;\n window.InfoBox.prototype._isOpen = false;\n window.InfoBox.prototype.open = function(map, anchor) {\n this._isOpen = true;\n this._open(map, anchor);\n };\n window.InfoBox.prototype.close = function() {\n this._isOpen = false;\n this._close();\n };\n window.InfoBox.prototype.isOpen = function(val) {\n if (val == null) {\n val = void 0;\n }\n if (val == null) {\n return this._isOpen;\n } else {\n return this._isOpen = val;\n }\n };\n uiGmapInfoBox = (function(superClass) {\n extend(uiGmapInfoBox, superClass);\n\n function uiGmapInfoBox(opts) {\n this.getOrigCloseBoxImg_ = bind(this.getOrigCloseBoxImg_, this);\n this.getCloseBoxDiv_ = bind(this.getCloseBoxDiv_, this);\n var box;\n box = new window.InfoBox(opts);\n _.extend(this, box);\n if (opts.closeBoxDiv != null) {\n this.closeBoxDiv_ = opts.closeBoxDiv;\n }\n }\n\n uiGmapInfoBox.prototype.getCloseBoxDiv_ = function() {\n return this.closeBoxDiv_;\n };\n\n uiGmapInfoBox.prototype.getCloseBoxImg_ = function() {\n var div, img;\n div = this.getCloseBoxDiv_();\n img = this.getOrigCloseBoxImg_();\n return div || img;\n };\n\n uiGmapInfoBox.prototype.getOrigCloseBoxImg_ = function() {\n var img;\n img = \"\";\n if (this.closeBoxURL_ !== \"\") {\n img = \"<img\";\n img += \" src='\" + this.closeBoxURL_ + \"'\";\n img += \" align=right\";\n img += \" style='\";\n img += \" position: relative;\";\n img += \" cursor: pointer;\";\n img += \" margin: \" + this.closeBoxMargin_ + \";\";\n img += \"'>\";\n }\n return img;\n };\n\n return uiGmapInfoBox;\n\n })(window.InfoBox);\n window.uiGmapInfoBox = uiGmapInfoBox;\n }\n if (window.MarkerLabel_) {\n return window.MarkerLabel_.prototype.setContent = function() {\n var content;\n content = this.marker_.get('labelContent');\n if (!content || _.isEqual(this.oldContent, content)) {\n return;\n }\n if (typeof (content != null ? content.nodeType : void 0) === 'undefined') {\n this.labelDiv_.innerHTML = content;\n this.eventDiv_.innerHTML = this.labelDiv_.innerHTML;\n this.oldContent = content;\n } else {\n this.labelDiv_.innerHTML = '';\n this.labelDiv_.appendChild(content);\n content = content.cloneNode(true);\n this.labelDiv_.innerHTML = '';\n this.eventDiv_.appendChild(content);\n this.oldContent = content;\n }\n };\n }\n })\n };\n });\n\n}).call(this);\n;\n/*global _:true, angular:true */\n\n(function() {\n angular.module('uiGmapgoogle-maps.extensions').service('uiGmapLodash', function() {\n var baseGet, baseToString, fixLodash, get, reEscapeChar, rePropName, toObject, toPath;\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\n\\\\]|\\\\.)*?)\\2)\\]/g;\n reEscapeChar = /\\\\(\\\\)?/g;\n\n /*\n For Lodash 4 compatibility (some aliases are removed)\n */\n fixLodash = function(arg) {\n var isProto, missingName, swapName;\n missingName = arg.missingName, swapName = arg.swapName, isProto = arg.isProto;\n if (_[missingName] == null) {\n _[missingName] = _[swapName];\n if (isProto) {\n return _.prototype[missingName] = _[swapName];\n }\n }\n };\n [\n {\n missingName: 'contains',\n swapName: 'includes',\n isProto: true\n }, {\n missingName: 'includes',\n swapName: 'contains',\n isProto: true\n }, {\n missingName: 'object',\n swapName: 'zipObject'\n }, {\n missingName: 'zipObject',\n swapName: 'object'\n }, {\n missingName: 'all',\n swapName: 'every'\n }, {\n missingName: 'every',\n swapName: 'all'\n }, {\n missingName: 'any',\n swapName: 'some'\n }, {\n missingName: 'some',\n swapName: 'any'\n }, {\n missingName: 'first',\n swapName: 'head'\n }, {\n missingName: 'head',\n swapName: 'first'\n }\n ].forEach(function(toMonkeyPatch) {\n return fixLodash(toMonkeyPatch);\n });\n if (_.get == null) {\n\n /**\n * Converts `value` to an object if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Object} Returns the object.\n */\n toObject = function(value) {\n if (_.isObject(value)) {\n return value;\n } else {\n return Object(value);\n }\n };\n\n /**\n * Converts `value` to a string if it's not one. An empty string is returned\n * for `null` or `undefined` values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n baseToString = function(value) {\n if (value === null) {\n return '';\n } else {\n return value + '';\n }\n };\n\n /**\n * Converts `value` to property path array if it's not one.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {Array} Returns the property path array.\n */\n toPath = function(value) {\n var result;\n if (_.isArray(value)) {\n return value;\n }\n result = [];\n baseToString(value).replace(rePropName, function(match, number, quote, string) {\n result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);\n });\n return result;\n };\n\n /**\n * The base implementation of `get` without support for string paths\n * and default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path of the property to get.\n * @param {string} [pathKey] The key representation of path.\n * @returns {*} Returns the resolved value.\n */\n baseGet = function(object, path, pathKey) {\n var index, length;\n if (object === null) {\n return;\n }\n if (pathKey !== void 0 && pathKey in toObject(object)) {\n path = [pathKey];\n }\n index = 0;\n length = path.length;\n while (!_.isUndefined(object) && index < length) {\n object = object[path[index++]];\n }\n if (index && index === length) {\n return object;\n } else {\n return void 0;\n }\n };\n\n /**\n * Gets the property value at `path` of `object`. If the resolved value is\n * `undefined` the `defaultValue` is used in its place.\n *\n * @static\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n get = function(object, path, defaultValue) {\n var result;\n result = object === null ? void 0 : baseGet(object, toPath(path), path + '');\n if (result === void 0) {\n return defaultValue;\n } else {\n return result;\n }\n };\n _.get = get;\n }\n\n /*\n Author Nick McCready\n Intersection of Objects if the arrays have something in common each intersecting object will be returned\n in an new array.\n */\n this.intersectionObjects = function(array1, array2, comparison) {\n var res;\n if (comparison == null) {\n comparison = void 0;\n }\n res = _.map(array1, function(obj1) {\n return _.find(array2, function(obj2) {\n if (comparison != null) {\n return comparison(obj1, obj2);\n } else {\n return _.isEqual(obj1, obj2);\n }\n });\n });\n return _.filter(res, function(o) {\n return o != null;\n });\n };\n this.containsObject = _.includeObject = function(obj, target, comparison) {\n if (comparison == null) {\n comparison = void 0;\n }\n if (obj === null) {\n return false;\n }\n return _.some(obj, function(value) {\n if (comparison != null) {\n return comparison(value, target);\n } else {\n return _.isEqual(value, target);\n }\n });\n };\n this.differenceObjects = function(array1, array2, comparison) {\n if (comparison == null) {\n comparison = void 0;\n }\n return _.filter(array1, (function(_this) {\n return function(value) {\n return !_this.containsObject(array2, value, comparison);\n };\n })(this));\n };\n this.withoutObjects = this.differenceObjects;\n this.indexOfObject = function(array, item, comparison, isSorted) {\n var i, length;\n if (array == null) {\n return -1;\n }\n i = 0;\n length = array.length;\n if (isSorted) {\n if (typeof isSorted === \"number\") {\n i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);\n } else {\n i = _.sortedIndex(array, item);\n return (array[i] === item ? i : -1);\n }\n }\n while (i < length) {\n if (comparison != null) {\n if (comparison(array[i], item)) {\n return i;\n }\n } else {\n if (_.isEqual(array[i], item)) {\n return i;\n }\n }\n i++;\n }\n return -1;\n };\n this.isNullOrUndefined = function(thing) {\n return _.isNull(thing || _.isUndefined(thing));\n };\n return this;\n });\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.extensions').factory('uiGmapString', function() {\n return function(str) {\n this.contains = function(value, fromIndex) {\n return str.indexOf(value, fromIndex) !== -1;\n };\n return this;\n };\n });\n\n}).call(this);\n;\n/*global _:true,angular:true, */\n\n(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmap_sync', [\n function() {\n return {\n fakePromise: function() {\n var _cb;\n _cb = void 0;\n return {\n then: function(cb) {\n return _cb = cb;\n },\n resolve: function() {\n return _cb.apply(void 0, arguments);\n }\n };\n }\n };\n }\n ]).service('uiGmap_async', [\n '$timeout', 'uiGmapPromise', 'uiGmapLogger', '$q', 'uiGmapDataStructures', 'uiGmapGmapUtil', function($timeout, uiGmapPromise, $log, $q, uiGmapDataStructures, uiGmapGmapUtil) {\n var ExposedPromise, PromiseQueueManager, SniffedPromise, _getIterateeValue, _ignoreFields, defaultChunkSize, doChunk, doSkippPromise, each, errorObject, getArrayAndKeys, isInProgress, kickPromise, logTryCatch, managePromiseQueue, map, maybeCancelPromises, promiseStatus, promiseTypes, tryCatch;\n promiseTypes = uiGmapPromise.promiseTypes;\n isInProgress = uiGmapPromise.isInProgress;\n promiseStatus = uiGmapPromise.promiseStatus;\n ExposedPromise = uiGmapPromise.ExposedPromise;\n SniffedPromise = uiGmapPromise.SniffedPromise;\n kickPromise = function(sniffedPromise, cancelCb) {\n var promise;\n promise = sniffedPromise.promise();\n promise.promiseType = sniffedPromise.promiseType;\n if (promise.$$state) {\n $log.debug(\"promiseType: \" + promise.promiseType + \", state: \" + (promiseStatus(promise.$$state.status)));\n }\n promise.cancelCb = cancelCb;\n return promise;\n };\n doSkippPromise = function(sniffedPromise, lastPromise) {\n if (sniffedPromise.promiseType === promiseTypes.create && lastPromise.promiseType !== promiseTypes[\"delete\"] && lastPromise.promiseType !== promiseTypes.init) {\n $log.debug(\"lastPromise.promiseType \" + lastPromise.promiseType + \", newPromiseType: \" + sniffedPromise.promiseType + \", SKIPPED MUST COME AFTER DELETE ONLY\");\n return true;\n }\n return false;\n };\n maybeCancelPromises = function(queue, sniffedPromise, lastPromise) {\n var first;\n if (sniffedPromise.promiseType === promiseTypes[\"delete\"] && lastPromise.promiseType !== promiseTypes[\"delete\"]) {\n if ((lastPromise.cancelCb != null) && _.isFunction(lastPromise.cancelCb) && isInProgress(lastPromise)) {\n $log.debug(\"promiseType: \" + sniffedPromise.promiseType + \", CANCELING LAST PROMISE type: \" + lastPromise.promiseType);\n lastPromise.cancelCb('cancel safe');\n first = queue.peek();\n if ((first != null) && isInProgress(first)) {\n if (first.hasOwnProperty(\"cancelCb\") && _.isFunction(first.cancelCb)) {\n $log.debug(\"promiseType: \" + first.promiseType + \", CANCELING FIRST PROMISE type: \" + first.promiseType);\n return first.cancelCb('cancel safe');\n } else {\n return $log.warn('first promise was not cancelable');\n }\n }\n }\n }\n };\n\n /*\n From a High Level:\n This is a SniffedPromiseQueueManager (looking to rename) where the queue is existingPiecesObj.existingPieces.\n This is a function and should not be considered a class.\n So it is run to manage the state (cancel, skip, link) as needed.\n Purpose:\n The whole point is to check if there is existing async work going on. If so we wait on it.\n \n arguments:\n - existingPiecesObj = Queue<Promises>\n - sniffedPromise = object wrapper holding a function to a pending (function) promise (promise: fnPromise)\n with its intended type.\n - cancelCb = callback which accepts a string, this string is intended to be returned at the end of _async.each iterator\n \n Where the cancelCb passed msg is 'cancel safe' _async.each will drop out and fall through. Thus canceling the promise\n gracefully without messing up state.\n \n Synopsis:\n \n - Promises have been broken down to 4 states create, update,delete (3 main) and init. (Helps boil down problems in ordering)\n where (init) is special to indicate that it is one of the first or to allow a create promise to work beyond being after a delete\n \n - Every Promise that comes in is enqueued and linked to the last promise in the queue.\n \n - A promise can be skipped or canceled to save cycles.\n \n Saved Cycles:\n - Skipped - This will only happen if async work comes in out of order. Where a pending create promise (un-executed) comes in\n after a delete promise.\n - Canceled - Where an incoming promise (un-executed promise) is of type delete and the any lastPromise is not a delete type.\n \n \n NOTE:\n - You should not muck with existingPieces as its state is dependent on this functional loop.\n - PromiseQueueManager should not be thought of as a class that has a life expectancy (it has none). It's sole\n purpose is to link, skip, and kill promises. It also manages the promise queue existingPieces.\n */\n PromiseQueueManager = function(existingPiecesObj, sniffedPromise, cancelCb) {\n var lastPromise, newPromise;\n if (!existingPiecesObj.existingPieces) {\n existingPiecesObj.existingPieces = new uiGmapDataStructures.Queue();\n return existingPiecesObj.existingPieces.enqueue(kickPromise(sniffedPromise, cancelCb));\n } else {\n lastPromise = _.last(existingPiecesObj.existingPieces._content);\n if (doSkippPromise(sniffedPromise, lastPromise)) {\n return;\n }\n maybeCancelPromises(existingPiecesObj.existingPieces, sniffedPromise, lastPromise);\n newPromise = ExposedPromise(lastPromise[\"finally\"](function() {\n return kickPromise(sniffedPromise, cancelCb);\n }));\n newPromise.cancelCb = cancelCb;\n newPromise.promiseType = sniffedPromise.promiseType;\n existingPiecesObj.existingPieces.enqueue(newPromise);\n return lastPromise[\"finally\"](function() {\n return existingPiecesObj.existingPieces.dequeue();\n });\n }\n };\n managePromiseQueue = function(objectToLock, promiseType, msg, cancelCb, fnPromise) {\n var cancelLogger;\n if (msg == null) {\n msg = '';\n }\n cancelLogger = function(msg) {\n $log.debug(msg + \": \" + msg);\n if ((cancelCb != null) && _.isFunction(cancelCb)) {\n return cancelCb(msg);\n }\n };\n return PromiseQueueManager(objectToLock, SniffedPromise(fnPromise, promiseType), cancelLogger);\n };\n defaultChunkSize = 80;\n errorObject = {\n value: null\n };\n tryCatch = function(fn, ctx, args) {\n var e, error1;\n try {\n return fn.apply(ctx, args);\n } catch (error1) {\n e = error1;\n errorObject.value = e;\n return errorObject;\n }\n };\n logTryCatch = function(fn, ctx, deferred, args) {\n var msg, result;\n result = tryCatch(fn, ctx, args);\n if (result === errorObject) {\n msg = \"error within chunking iterator: \" + errorObject.value;\n $log.error(msg);\n deferred.reject(msg);\n }\n if (result === 'cancel safe') {\n return false;\n }\n return true;\n };\n _getIterateeValue = function(collection, array, index) {\n var _isArray, valOrKey;\n _isArray = collection === array;\n valOrKey = array[index];\n if (_isArray) {\n return valOrKey;\n }\n return collection[valOrKey];\n };\n _ignoreFields = ['length', 'forEach', 'map'];\n getArrayAndKeys = function(collection, keys, bailOutCb, cb) {\n var array, propName, val;\n if (angular.isArray(collection)) {\n array = collection;\n } else {\n if (keys) {\n array = keys;\n } else {\n array = [];\n for (propName in collection) {\n val = collection[propName];\n if (collection.hasOwnProperty(propName) && !_.includes(_ignoreFields, propName)) {\n array.push(propName);\n }\n }\n }\n }\n if (cb == null) {\n cb = bailOutCb;\n }\n if (angular.isArray(array) && !(array != null ? array.length : void 0)) {\n if (cb !== bailOutCb) {\n return bailOutCb();\n }\n }\n return cb(array, keys);\n };\n\n /*\n Author: Nicholas McCready & jfriend00\n _async handles things asynchronous-like :), to allow the UI to be free'd to do other things\n Code taken from http://stackoverflow.com/questions/10344498/best-way-to-iterate-over-an-array-without-blocking-the-ui\n \n The design of any functionality of _async is to be like lodash/underscore and replicate it but call things\n asynchronously underneath. Each should be sufficient for most things to be derived from.\n \n Optional Asynchronous Chunking via promises.\n */\n doChunk = function(collection, chunkSizeOrDontChunk, pauseMilli, chunkCb, pauseCb, overallD, index, _keys) {\n return getArrayAndKeys(collection, _keys, function(array, keys) {\n var cnt, i, keepGoing, val;\n if (chunkSizeOrDontChunk && chunkSizeOrDontChunk < array.length) {\n cnt = chunkSizeOrDontChunk;\n } else {\n cnt = array.length;\n }\n i = index;\n keepGoing = true;\n while (keepGoing && cnt-- && i < (array ? array.length : i + 1)) {\n val = _getIterateeValue(collection, array, i);\n keepGoing = angular.isFunction(val) ? true : logTryCatch(chunkCb, void 0, overallD, [val, i]);\n ++i;\n }\n if (array) {\n if (keepGoing && i < array.length) {\n index = i;\n if (chunkSizeOrDontChunk) {\n if ((pauseCb != null) && _.isFunction(pauseCb)) {\n logTryCatch(pauseCb, void 0, overallD, []);\n }\n return $timeout(function() {\n return doChunk(collection, chunkSizeOrDontChunk, pauseMilli, chunkCb, pauseCb, overallD, index, keys);\n }, pauseMilli, false);\n }\n } else {\n return overallD.resolve();\n }\n }\n });\n };\n each = function(collection, chunk, chunkSizeOrDontChunk, pauseCb, index, pauseMilli, _keys) {\n var error, overallD, ret;\n if (chunkSizeOrDontChunk == null) {\n chunkSizeOrDontChunk = defaultChunkSize;\n }\n if (index == null) {\n index = 0;\n }\n if (pauseMilli == null) {\n pauseMilli = 1;\n }\n ret = void 0;\n overallD = uiGmapPromise.defer();\n ret = overallD.promise;\n if (!pauseMilli) {\n error = 'pause (delay) must be set from _async!';\n $log.error(error);\n overallD.reject(error);\n return ret;\n }\n return getArrayAndKeys(collection, _keys, function() {\n overallD.resolve();\n return ret;\n }, function(array, keys) {\n doChunk(collection, chunkSizeOrDontChunk, pauseMilli, chunk, pauseCb, overallD, index, keys);\n return ret;\n });\n };\n map = function(collection, iterator, chunkSizeOrDontChunk, pauseCb, index, pauseMilli, _keys) {\n var results;\n results = [];\n return getArrayAndKeys(collection, _keys, function() {\n return uiGmapPromise.resolve(results);\n }, function(array, keys) {\n return each(collection, function(o) {\n return results.push(iterator(o));\n }, chunkSizeOrDontChunk, pauseCb, index, pauseMilli, keys).then(function() {\n return results;\n });\n });\n };\n return {\n each: each,\n map: map,\n managePromiseQueue: managePromiseQueue,\n promiseLock: managePromiseQueue,\n defaultChunkSize: defaultChunkSize,\n getArrayAndKeys: getArrayAndKeys,\n chunkSizeFrom: function(fromSize, ret) {\n if (ret == null) {\n ret = void 0;\n }\n if (_.isNumber(fromSize)) {\n ret = fromSize;\n }\n if (uiGmapGmapUtil.isFalse(fromSize) || fromSize === false) {\n ret = false;\n }\n return ret;\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\n angular.module('uiGmapgoogle-maps.directives.api.utils').factory('uiGmapBaseObject', function() {\n var BaseObject, baseObjectKeywords;\n baseObjectKeywords = ['extended', 'included'];\n BaseObject = (function() {\n function BaseObject() {}\n\n BaseObject.extend = function(obj) {\n var key, ref, value;\n for (key in obj) {\n value = obj[key];\n if (indexOf.call(baseObjectKeywords, key) < 0) {\n this[key] = value;\n }\n }\n if ((ref = obj.extended) != null) {\n ref.apply(this);\n }\n return this;\n };\n\n BaseObject.include = function(obj) {\n var key, ref, value;\n for (key in obj) {\n value = obj[key];\n if (indexOf.call(baseObjectKeywords, key) < 0) {\n this.prototype[key] = value;\n }\n }\n if ((ref = obj.included) != null) {\n ref.apply(this);\n }\n return this;\n };\n\n return BaseObject;\n\n })();\n return BaseObject;\n });\n\n}).call(this);\n;\n/*\n Useful function callbacks that should be defined at later time.\n Mainly to be used for specs to verify creation / linking.\n\n This is to lead a common design in notifying child stuff.\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').factory('uiGmapChildEvents', function() {\n return {\n onChildCreation: function(child) {}\n };\n });\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapCtrlHandle', [\n '$q', function($q) {\n var CtrlHandle;\n return CtrlHandle = {\n handle: function($scope, $element) {\n $scope.$on('$destroy', function() {\n return CtrlHandle.handle($scope);\n });\n $scope.deferred = $q.defer();\n return {\n getScope: function() {\n return $scope;\n }\n };\n },\n mapPromise: function(scope, ctrl) {\n var mapScope;\n mapScope = ctrl.getScope();\n mapScope.deferred.promise.then(function(map) {\n return scope.map = map;\n });\n return mapScope.deferred.promise;\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module(\"uiGmapgoogle-maps.directives.api.utils\").service(\"uiGmapEventsHelper\", [\n \"uiGmapLogger\", function($log) {\n var _getEventsObj, _hasEvents;\n _hasEvents = function(obj) {\n return angular.isDefined(obj.events) && (obj.events != null) && angular.isObject(obj.events);\n };\n _getEventsObj = function(scope, model) {\n if (_hasEvents(scope)) {\n return scope;\n }\n if (_hasEvents(model)) {\n return model;\n }\n };\n return {\n setEvents: function(gObject, scope, model, ignores) {\n var eventObj;\n eventObj = _getEventsObj(scope, model);\n if (eventObj != null) {\n return _.compact(_.map(eventObj.events, function(eventHandler, eventName) {\n var doIgnore;\n if (ignores) {\n doIgnore = _(ignores).includes(eventName);\n }\n if (eventObj.events.hasOwnProperty(eventName) && angular.isFunction(eventObj.events[eventName]) && !doIgnore) {\n return google.maps.event.addListener(gObject, eventName, function() {\n if (!scope.$evalAsync) {\n scope.$evalAsync = function() {};\n }\n return scope.$evalAsync(eventHandler.apply(scope, [gObject, eventName, model, arguments]));\n });\n }\n }));\n }\n },\n removeEvents: function(listeners) {\n var key, l;\n if (!listeners) {\n return;\n }\n for (key in listeners) {\n l = listeners[key];\n if (l && listeners.hasOwnProperty(key)) {\n google.maps.event.removeListener(l);\n }\n }\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapFitHelper', [\n 'uiGmapLogger', function($log) {\n return {\n fit: function(markersOrPoints, gMap) {\n var bounds, everSet, key, markerOrPoint, point;\n if (gMap && (markersOrPoints != null ? markersOrPoints.length : void 0)) {\n bounds = new google.maps.LatLngBounds();\n everSet = false;\n for (key in markersOrPoints) {\n markerOrPoint = markersOrPoints[key];\n if (markerOrPoint) {\n if (!everSet) {\n everSet = true;\n }\n point = _.isFunction(markerOrPoint.getPosition) ? markerOrPoint.getPosition() : markerOrPoint;\n }\n bounds.extend(point);\n }\n if (everSet) {\n return gMap.fitBounds(bounds);\n }\n }\n }\n };\n }\n ]);\n\n}).call(this);\n;\n/*global _:true, angular:true, google:true */\n\n(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapGmapUtil', [\n 'uiGmapLogger', '$compile', function(Logger, $compile) {\n var _isFalse, _isTruthy, getCoords, getLatitude, getLongitude, validateCoords;\n _isTruthy = function(value, bool, optionsArray) {\n return value === bool || optionsArray.indexOf(value) !== -1;\n };\n _isFalse = function(value) {\n return _isTruthy(value, false, ['false', 'FALSE', 0, 'n', 'N', 'no', 'NO']);\n };\n getLatitude = function(value) {\n if (Array.isArray(value) && value.length === 2) {\n return value[1];\n } else if (angular.isDefined(value.type) && value.type === 'Point') {\n return value.coordinates[1];\n } else {\n return value.latitude;\n }\n };\n getLongitude = function(value) {\n if (Array.isArray(value) && value.length === 2) {\n return value[0];\n } else if (angular.isDefined(value.type) && value.type === 'Point') {\n return value.coordinates[0];\n } else {\n return value.longitude;\n }\n };\n getCoords = function(value) {\n if (!value) {\n return;\n }\n if (Array.isArray(value) && value.length === 2) {\n return new google.maps.LatLng(value[1], value[0]);\n } else if (angular.isDefined(value.type) && value.type === 'Point') {\n return new google.maps.LatLng(value.coordinates[1], value.coordinates[0]);\n } else {\n return new google.maps.LatLng(value.latitude, value.longitude);\n }\n };\n validateCoords = function(coords) {\n if (angular.isUndefined(coords)) {\n return false;\n }\n if (_.isArray(coords)) {\n if (coords.length === 2) {\n return true;\n }\n } else if ((coords != null) && (coords != null ? coords.type : void 0)) {\n if (coords.type === 'Point' && _.isArray(coords.coordinates) && coords.coordinates.length === 2) {\n return true;\n }\n }\n if (coords && angular.isDefined((coords != null ? coords.latitude : void 0) && angular.isDefined(coords != null ? coords.longitude : void 0))) {\n return true;\n }\n return false;\n };\n return {\n setCoordsFromEvent: function(prevValue, newLatLon) {\n if (!prevValue) {\n return;\n }\n if (Array.isArray(prevValue) && prevValue.length === 2) {\n prevValue[1] = newLatLon.lat();\n prevValue[0] = newLatLon.lng();\n } else if (angular.isDefined(prevValue.type) && prevValue.type === 'Point') {\n prevValue.coordinates[1] = newLatLon.lat();\n prevValue.coordinates[0] = newLatLon.lng();\n } else {\n prevValue.latitude = newLatLon.lat();\n prevValue.longitude = newLatLon.lng();\n }\n return prevValue;\n },\n getLabelPositionPoint: function(anchor) {\n var xPos, yPos;\n if (anchor === void 0) {\n return void 0;\n }\n anchor = /^([-\\d\\.]+)\\s([-\\d\\.]+)$/.exec(anchor);\n xPos = parseFloat(anchor[1]);\n yPos = parseFloat(anchor[2]);\n if ((xPos != null) && (yPos != null)) {\n return new google.maps.Point(xPos, yPos);\n }\n },\n createWindowOptions: function(gMarker, scope, content, defaults) {\n var options;\n if ((content != null) && (defaults != null) && ($compile != null)) {\n options = angular.extend({}, defaults, {\n content: this.buildContent(scope, defaults, content),\n position: defaults.position != null ? defaults.position : angular.isObject(gMarker) ? gMarker.getPosition() : getCoords(scope.coords)\n });\n if ((gMarker != null) && ((options != null ? options.pixelOffset : void 0) == null)) {\n if (options.boxClass == null) {\n\n } else {\n options.pixelOffset = {\n height: 0,\n width: -2\n };\n }\n }\n return options;\n } else {\n if (!defaults) {\n Logger.error('infoWindow defaults not defined');\n if (!content) {\n return Logger.error('infoWindow content not defined');\n }\n } else {\n return defaults;\n }\n }\n },\n buildContent: function(scope, defaults, content) {\n var parsed, ret;\n if (defaults.content != null) {\n ret = defaults.content;\n } else {\n if ($compile != null) {\n content = content.replace(/^\\s+|\\s+$/g, '');\n parsed = content === '' ? '' : $compile(content)(scope);\n if (parsed.length > 0) {\n ret = parsed[0];\n }\n } else {\n ret = content;\n }\n }\n return ret;\n },\n defaultDelay: 50,\n isTrue: function(value) {\n return _isTruthy(value, true, ['true', 'TRUE', 1, 'y', 'Y', 'yes', 'YES']);\n },\n isFalse: _isFalse,\n isFalsy: function(value) {\n return _isTruthy(value, false, [void 0, null]) || _isFalse(value);\n },\n getCoords: getCoords,\n validateCoords: validateCoords,\n equalCoords: function(coord1, coord2) {\n return getLatitude(coord1) === getLatitude(coord2) && getLongitude(coord1) === getLongitude(coord2);\n },\n validatePath: function(path) {\n var array, i, polygon, trackMaxVertices;\n i = 0;\n if (angular.isUndefined(path.type)) {\n if (!Array.isArray(path) || path.length < 2) {\n return false;\n }\n while (i < path.length) {\n if (!((angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) || (typeof path[i].lat === 'function' && typeof path[i].lng === 'function'))) {\n return false;\n }\n i++;\n }\n return true;\n } else {\n if (angular.isUndefined(path.coordinates)) {\n return false;\n }\n if (path.type === 'Polygon') {\n if (path.coordinates[0].length < 4) {\n return false;\n }\n array = path.coordinates[0];\n } else if (path.type === 'MultiPolygon') {\n trackMaxVertices = {\n max: 0,\n index: 0\n };\n _.forEach(path.coordinates, function(polygon, index) {\n if (polygon[0].length > this.max) {\n this.max = polygon[0].length;\n return this.index = index;\n }\n }, trackMaxVertices);\n polygon = path.coordinates[trackMaxVertices.index];\n array = polygon[0];\n if (array.length < 4) {\n return false;\n }\n } else if (path.type === 'LineString') {\n if (path.coordinates.length < 2) {\n return false;\n }\n array = path.coordinates;\n } else {\n return false;\n }\n while (i < array.length) {\n if (array[i].length !== 2) {\n return false;\n }\n i++;\n }\n return true;\n }\n },\n convertPathPoints: function(path) {\n var array, i, latlng, result, trackMaxVertices;\n i = 0;\n result = new google.maps.MVCArray();\n if (angular.isUndefined(path.type)) {\n while (i < path.length) {\n latlng;\n if (angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) {\n latlng = new google.maps.LatLng(path[i].latitude, path[i].longitude);\n } else if (typeof path[i].lat === 'function' && typeof path[i].lng === 'function') {\n latlng = path[i];\n }\n result.push(latlng);\n i++;\n }\n } else {\n array;\n if (path.type === 'Polygon') {\n array = path.coordinates[0];\n } else if (path.type === 'MultiPolygon') {\n trackMaxVertices = {\n max: 0,\n index: 0\n };\n _.forEach(path.coordinates, function(polygon, index) {\n if (polygon[0].length > this.max) {\n this.max = polygon[0].length;\n return this.index = index;\n }\n }, trackMaxVertices);\n array = path.coordinates[trackMaxVertices.index][0];\n } else if (path.type === 'LineString') {\n array = path.coordinates;\n }\n while (i < array.length) {\n result.push(new google.maps.LatLng(array[i][1], array[i][0]));\n i++;\n }\n }\n return result;\n },\n getPath: function(object, key) {\n var obj;\n if ((key == null) || !_.isString(key)) {\n return key;\n }\n obj = object;\n _.each(key.split('.'), function(value) {\n if (obj) {\n return obj = obj[value];\n }\n });\n return obj;\n },\n validateBoundPoints: function(bounds) {\n if (angular.isUndefined(bounds.sw.latitude) || angular.isUndefined(bounds.sw.longitude) || angular.isUndefined(bounds.ne.latitude) || angular.isUndefined(bounds.ne.longitude)) {\n return false;\n }\n return true;\n },\n convertBoundPoints: function(bounds) {\n var result;\n result = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.sw.latitude, bounds.sw.longitude), new google.maps.LatLng(bounds.ne.latitude, bounds.ne.longitude));\n return result;\n },\n fitMapBounds: function(map, bounds) {\n return map.fitBounds(bounds);\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapIsReady', [\n '$q', '$timeout', function($q, $timeout) {\n var _checkIfReady, _ctr, _promises, _proms;\n _ctr = 0;\n _proms = [];\n _promises = function() {\n return $q.all(_proms);\n };\n _checkIfReady = function(deferred, expectedInstances, retriesLeft) {\n return $timeout(function() {\n if (retriesLeft <= 0) {\n deferred.reject('Your maps are not found we have checked the maximum amount of times. :)');\n return;\n }\n if (_ctr !== expectedInstances) {\n _checkIfReady(deferred, expectedInstances, retriesLeft - 1);\n } else {\n deferred.resolve(_promises());\n }\n }, 100);\n };\n return {\n spawn: function() {\n var d;\n d = $q.defer();\n _proms.push(d.promise);\n _ctr += 1;\n return {\n instance: _ctr,\n deferred: d\n };\n },\n promises: _promises,\n instances: function() {\n return _ctr;\n },\n promise: function(expectedInstances, numRetries) {\n var d;\n if (expectedInstances == null) {\n expectedInstances = 1;\n }\n if (numRetries == null) {\n numRetries = 50;\n }\n d = $q.defer();\n _checkIfReady(d, expectedInstances, numRetries);\n return d.promise;\n },\n reset: function() {\n _ctr = 0;\n _proms.length = 0;\n },\n decrement: function() {\n if (_ctr > 0) {\n _ctr -= 1;\n }\n if (_proms.length) {\n _proms.length -= 1;\n }\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api.utils\").factory(\"uiGmapLinked\", [\n \"uiGmapBaseObject\", function(BaseObject) {\n var Linked;\n Linked = (function(superClass) {\n extend(Linked, superClass);\n\n function Linked(scope, element, attrs, ctrls) {\n this.scope = scope;\n this.element = element;\n this.attrs = attrs;\n this.ctrls = ctrls;\n }\n\n return Linked;\n\n })(BaseObject);\n return Linked;\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapLogger', [\n 'nemSimpleLogger', function(nemSimpleLogger) {\n return nemSimpleLogger.spawn();\n }\n ]);\n\n}).call(this);\n;\n/*global _:true, angular:true */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.utils').factory('uiGmapModelKey', [\n 'uiGmapBaseObject', 'uiGmapGmapUtil', function(BaseObject, GmapUtil) {\n return (function(superClass) {\n extend(_Class, superClass);\n\n function _Class(scope1, _interface) {\n this.scope = scope1;\n this[\"interface\"] = _interface != null ? _interface : {\n scopeKeys: []\n };\n this.modelsLength = bind(this.modelsLength, this);\n this.updateChild = bind(this.updateChild, this);\n this.destroy = bind(this.destroy, this);\n this.setChildScope = bind(this.setChildScope, this);\n this.getChanges = bind(this.getChanges, this);\n this.getProp = bind(this.getProp, this);\n this.setIdKey = bind(this.setIdKey, this);\n this.modelKeyComparison = bind(this.modelKeyComparison, this);\n _Class.__super__.constructor.call(this);\n this.defaultIdKey = 'id';\n this.idKey = void 0;\n }\n\n _Class.prototype.evalModelHandle = function(model, modelKey) {\n if ((model == null) || (modelKey == null)) {\n return;\n }\n if (modelKey === 'self') {\n return model;\n } else {\n if (_.isFunction(modelKey)) {\n modelKey = modelKey();\n }\n return GmapUtil.getPath(model, modelKey);\n }\n };\n\n _Class.prototype.modelKeyComparison = function(model1, model2) {\n var coord1, coord2, hasCoords, isEqual, scope, without;\n hasCoords = this[\"interface\"].scopeKeys.indexOf('coords') >= 0;\n if (hasCoords && (this.scope.coords != null) || !hasCoords) {\n scope = this.scope;\n }\n if (scope == null) {\n throw 'No scope set!';\n }\n if (hasCoords) {\n coord1 = this.scopeOrModelVal('coords', scope, model1);\n coord2 = this.scopeOrModelVal('coords', scope, model2);\n isEqual = GmapUtil.equalCoords(coord1, coord2);\n if (!isEqual) {\n return isEqual;\n }\n }\n without = _.without(this[\"interface\"].scopeKeys, 'coords');\n isEqual = _.every(without, (function(_this) {\n return function(k) {\n return _this.scopeOrModelVal(scope[k], scope, model1) === _this.scopeOrModelVal(scope[k], scope, model2);\n };\n })(this));\n return isEqual;\n };\n\n _Class.prototype.setIdKey = function(scope) {\n return this.idKey = scope.idKey != null ? scope.idKey : this.defaultIdKey;\n };\n\n _Class.prototype.setVal = function(model, key, newValue) {\n this.modelOrKey(model, key = newValue);\n return model;\n };\n\n _Class.prototype.modelOrKey = function(model, key) {\n if (key == null) {\n return;\n }\n if (key !== 'self') {\n return GmapUtil.getPath(model, key);\n }\n return model;\n };\n\n _Class.prototype.getProp = function(propName, scope, model) {\n return this.scopeOrModelVal(propName, scope, model);\n };\n\n\n /*\n For the cases were watching a large object we only want to know the list of props\n that actually changed.\n Also we want to limit the amount of props we analyze to whitelisted props that are\n actually tracked by scope. (should make things faster with whitelisted)\n */\n\n _Class.prototype.getChanges = function(now, prev, whitelistedProps) {\n var c, changes, prop;\n if (whitelistedProps) {\n prev = _.pick(prev, whitelistedProps);\n now = _.pick(now, whitelistedProps);\n }\n changes = {};\n prop = {};\n c = {};\n for (prop in now) {\n if (!prev || prev[prop] !== now[prop]) {\n if (_.isArray(now[prop])) {\n changes[prop] = now[prop];\n } else if (_.isObject(now[prop])) {\n c = this.getChanges(now[prop], (prev ? prev[prop] : null));\n if (!_.isEmpty(c)) {\n changes[prop] = c;\n }\n } else {\n changes[prop] = now[prop];\n }\n }\n }\n return changes;\n };\n\n _Class.prototype.scopeOrModelVal = function(key, scope, model, doWrap) {\n var maybeWrap, modelKey, modelProp, scopeProp;\n if (doWrap == null) {\n doWrap = false;\n }\n maybeWrap = function(isScope, ret, doWrap) {\n if (doWrap == null) {\n doWrap = false;\n }\n if (doWrap) {\n return {\n isScope: isScope,\n value: ret\n };\n }\n return ret;\n };\n scopeProp = _.get(scope, key);\n if (_.isFunction(scopeProp)) {\n return maybeWrap(true, scopeProp(model), doWrap);\n }\n if (_.isObject(scopeProp)) {\n return maybeWrap(true, scopeProp, doWrap);\n }\n if (!_.isString(scopeProp)) {\n return maybeWrap(true, scopeProp, doWrap);\n }\n modelKey = scopeProp;\n if (!modelKey) {\n modelProp = _.get(model, key);\n } else {\n modelProp = modelKey === 'self' ? model : _.get(model, modelKey);\n }\n if (_.isFunction(modelProp)) {\n return maybeWrap(false, modelProp(), doWrap);\n }\n return maybeWrap(false, modelProp, doWrap);\n };\n\n _Class.prototype.setChildScope = function(keys, childScope, model) {\n var isScopeObj, key, name, newValue;\n for (key in keys) {\n name = keys[key];\n isScopeObj = this.scopeOrModelVal(name, childScope, model, true);\n if ((isScopeObj != null ? isScopeObj.value : void 0) != null) {\n newValue = isScopeObj.value;\n if (newValue !== childScope[name]) {\n childScope[name] = newValue;\n }\n }\n }\n return childScope.model = model;\n };\n\n _Class.prototype.onDestroy = function(scope) {};\n\n _Class.prototype.destroy = function(manualOverride) {\n var ref;\n if (manualOverride == null) {\n manualOverride = false;\n }\n if ((this.scope != null) && !((ref = this.scope) != null ? ref.$$destroyed : void 0) && (this.needToManualDestroy || manualOverride)) {\n return this.scope.$destroy();\n } else {\n return this.clean();\n }\n };\n\n _Class.prototype.updateChild = function(child, model) {\n if (model[this.idKey] == null) {\n this.$log.error(\"Model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.\");\n return;\n }\n return child.updateModel(model);\n };\n\n _Class.prototype.modelsLength = function(arrayOrObjModels) {\n var len, toCheck;\n if (arrayOrObjModels == null) {\n arrayOrObjModels = void 0;\n }\n len = 0;\n toCheck = arrayOrObjModels ? arrayOrObjModels : this.scope.models;\n if (toCheck == null) {\n return len;\n }\n if (angular.isArray(toCheck) || (toCheck.length != null)) {\n len = toCheck.length;\n } else {\n len = Object.keys(toCheck).length;\n }\n return len;\n };\n\n return _Class;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').factory('uiGmapModelsWatcher', [\n 'uiGmapLogger', 'uiGmap_async', '$q', 'uiGmapPromise', function(Logger, _async, $q, uiGmapPromise) {\n return {\n didQueueInitPromise: function(existingPiecesObj, scope) {\n if (scope.models.length === 0) {\n _async.promiseLock(existingPiecesObj, uiGmapPromise.promiseTypes.init, null, null, (function() {\n return uiGmapPromise.resolve();\n }));\n return true;\n }\n return false;\n },\n figureOutState: function(idKey, scope, childObjects, comparison, callBack) {\n var adds, children, mappedScopeModelIds, removals, updates;\n adds = [];\n mappedScopeModelIds = {};\n removals = [];\n updates = [];\n scope.models.forEach(function(m) {\n var child;\n if (m[idKey] != null) {\n mappedScopeModelIds[m[idKey]] = {};\n if (childObjects.get(m[idKey]) == null) {\n return adds.push(m);\n } else {\n child = childObjects.get(m[idKey]);\n if (!comparison(m, child.clonedModel, scope)) {\n return updates.push({\n model: m,\n child: child\n });\n }\n }\n } else {\n return Logger.error(' id missing for model #{m.toString()},\\ncan not use do comparison/insertion');\n }\n });\n children = childObjects.values();\n children.forEach(function(c) {\n var id;\n if (c == null) {\n Logger.error('child undefined in ModelsWatcher.');\n return;\n }\n if (c.model == null) {\n Logger.error('child.model undefined in ModelsWatcher.');\n return;\n }\n id = c.model[idKey];\n if (mappedScopeModelIds[id] == null) {\n return removals.push(c);\n }\n });\n return {\n adds: adds,\n removals: removals,\n updates: updates\n };\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.utils').service('uiGmapPromise', [\n '$q', '$timeout', 'uiGmapLogger', function($q, $timeout, $log) {\n var ExposedPromise, SniffedPromise, defer, isInProgress, isResolved, promise, promiseStatus, promiseStatuses, promiseTypes, resolve, strPromiseStatuses;\n promiseTypes = {\n create: 'create',\n update: 'update',\n \"delete\": 'delete',\n init: 'init'\n };\n promiseStatuses = {\n IN_PROGRESS: 0,\n RESOLVED: 1,\n REJECTED: 2\n };\n strPromiseStatuses = (function() {\n var obj;\n obj = {};\n obj[\"\" + promiseStatuses.IN_PROGRESS] = 'in-progress';\n obj[\"\" + promiseStatuses.RESOLVED] = 'resolved';\n obj[\"\" + promiseStatuses.REJECTED] = 'rejected';\n return obj;\n })();\n isInProgress = function(promise) {\n if (promise.$$state) {\n return promise.$$state.status === promiseStatuses.IN_PROGRESS;\n }\n if (!promise.hasOwnProperty(\"$$v\")) {\n return true;\n }\n };\n isResolved = function(promise) {\n if (promise.$$state) {\n return promise.$$state.status === promiseStatuses.RESOLVED;\n }\n if (promise.hasOwnProperty(\"$$v\")) {\n return true;\n }\n };\n promiseStatus = function(status) {\n return strPromiseStatuses[status] || 'done w error';\n };\n ExposedPromise = function(promise) {\n var cancelDeferred, combined, wrapped;\n cancelDeferred = $q.defer();\n combined = $q.all([promise, cancelDeferred.promise]);\n wrapped = $q.defer();\n promise.then(cancelDeferred.resolve, (function() {}), function(notify) {\n cancelDeferred.notify(notify);\n return wrapped.notify(notify);\n });\n combined.then(function(successes) {\n return wrapped.resolve(successes[0] || successes[1]);\n }, function(error) {\n return wrapped.reject(error);\n });\n wrapped.promise.cancel = function(reason) {\n if (reason == null) {\n reason = 'canceled';\n }\n return cancelDeferred.reject(reason);\n };\n wrapped.promise.notify = function(msg) {\n if (msg == null) {\n msg = 'cancel safe';\n }\n wrapped.notify(msg);\n if (promise.hasOwnProperty('notify')) {\n return promise.notify(msg);\n }\n };\n if (promise.promiseType != null) {\n wrapped.promise.promiseType = promise.promiseType;\n }\n return wrapped.promise;\n };\n SniffedPromise = function(fnPromise, promiseType) {\n return {\n promise: fnPromise,\n promiseType: promiseType\n };\n };\n defer = function() {\n return $q.defer();\n };\n resolve = function() {\n var d;\n d = $q.defer();\n d.resolve.apply(void 0, arguments);\n return d.promise;\n };\n promise = function(fnToWrap) {\n var d;\n if (!_.isFunction(fnToWrap)) {\n $log.error(\"uiGmapPromise.promise() only accepts functions\");\n return;\n }\n d = $q.defer();\n $timeout(function() {\n var result;\n result = fnToWrap();\n return d.resolve(result);\n });\n return d.promise;\n };\n return {\n defer: defer,\n promise: promise,\n resolve: resolve,\n promiseTypes: promiseTypes,\n isInProgress: isInProgress,\n isResolved: isResolved,\n promiseStatus: promiseStatus,\n ExposedPromise: ExposedPromise,\n SniffedPromise: SniffedPromise\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module(\"uiGmapgoogle-maps.directives.api.utils\").factory(\"uiGmapPropMap\", function() {\n\n /*\n Simple Object Map with a length property to make it easy to track length/size\n */\n var PropMap;\n return PropMap = (function() {\n function PropMap() {\n this.removeAll = bind(this.removeAll, this);\n this.slice = bind(this.slice, this);\n this.push = bind(this.push, this);\n this.keys = bind(this.keys, this);\n this.values = bind(this.values, this);\n this.remove = bind(this.remove, this);\n this.put = bind(this.put, this);\n this.stateChanged = bind(this.stateChanged, this);\n this.get = bind(this.get, this);\n this.length = 0;\n this.dict = {};\n this.didValsStateChange = false;\n this.didKeysStateChange = false;\n this.allVals = [];\n this.allKeys = [];\n }\n\n PropMap.prototype.get = function(key) {\n return this.dict[key];\n };\n\n PropMap.prototype.stateChanged = function() {\n this.didValsStateChange = true;\n return this.didKeysStateChange = true;\n };\n\n PropMap.prototype.put = function(key, value) {\n if (this.get(key) == null) {\n this.length++;\n }\n this.stateChanged();\n return this.dict[key] = value;\n };\n\n PropMap.prototype.remove = function(key, isSafe) {\n var value;\n if (isSafe == null) {\n isSafe = false;\n }\n if (isSafe && !this.get(key)) {\n return void 0;\n }\n value = this.dict[key];\n delete this.dict[key];\n this.length--;\n this.stateChanged();\n return value;\n };\n\n PropMap.prototype.valuesOrKeys = function(str) {\n var keys, vals;\n if (str == null) {\n str = 'Keys';\n }\n if (!this[\"did\" + str + \"StateChange\"]) {\n return this['all' + str];\n }\n vals = [];\n keys = [];\n _.each(this.dict, function(v, k) {\n vals.push(v);\n return keys.push(k);\n });\n this.didKeysStateChange = false;\n this.didValsStateChange = false;\n this.allVals = vals;\n this.allKeys = keys;\n return this['all' + str];\n };\n\n PropMap.prototype.values = function() {\n return this.valuesOrKeys('Vals');\n };\n\n PropMap.prototype.keys = function() {\n return this.valuesOrKeys();\n };\n\n PropMap.prototype.push = function(obj, key) {\n if (key == null) {\n key = \"key\";\n }\n return this.put(obj[key], obj);\n };\n\n PropMap.prototype.slice = function() {\n return this.keys().map((function(_this) {\n return function(k) {\n return _this.remove(k);\n };\n })(this));\n };\n\n PropMap.prototype.removeAll = function() {\n return this.slice();\n };\n\n PropMap.prototype.each = function(cb) {\n return _.each(this.dict, function(v, k) {\n return cb(v);\n });\n };\n\n PropMap.prototype.map = function(cb) {\n return _.map(this.dict, function(v, k) {\n return cb(v);\n });\n };\n\n return PropMap;\n\n })();\n });\n\n}).call(this);\n;\n/*globals angular,_ */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps.directives.api.utils\").factory(\"uiGmapPropertyAction\", [\n \"uiGmapLogger\", function(Logger) {\n var PropertyAction;\n PropertyAction = function(setterFn) {\n this.setIfChange = function(callingKey) {\n return function(newVal, oldVal) {\n if (!_.isEqual(oldVal, newVal)) {\n return setterFn(callingKey, newVal);\n }\n };\n };\n this.sic = this.setIfChange;\n return this;\n };\n return PropertyAction;\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module('uiGmapgoogle-maps.directives.api.managers').factory('uiGmapClustererMarkerManager', [\n 'uiGmapLogger', 'uiGmapFitHelper', 'uiGmapPropMap', 'uiGmapEventsHelper', function($log, FitHelper, PropMap, EventsHelper) {\n var ClustererMarkerManager;\n ClustererMarkerManager = (function() {\n ClustererMarkerManager.type = 'ClustererMarkerManager';\n\n function ClustererMarkerManager(gMap, opt_markers, opt_options, opt_events) {\n if (opt_markers == null) {\n opt_markers = {};\n }\n this.opt_options = opt_options != null ? opt_options : {};\n this.opt_events = opt_events;\n this.checkSync = bind(this.checkSync, this);\n this.getGMarkers = bind(this.getGMarkers, this);\n this.fit = bind(this.fit, this);\n this.destroy = bind(this.destroy, this);\n this.attachEvents = bind(this.attachEvents, this);\n this.clear = bind(this.clear, this);\n this.draw = bind(this.draw, this);\n this.removeMany = bind(this.removeMany, this);\n this.remove = bind(this.remove, this);\n this.addMany = bind(this.addMany, this);\n this.update = bind(this.update, this);\n this.add = bind(this.add, this);\n this.type = ClustererMarkerManager.type;\n this.clusterer = new NgMapMarkerClusterer(gMap, opt_markers, this.opt_options);\n this.propMapGMarkers = new PropMap();\n this.attachEvents(this.opt_events, 'opt_events');\n this.clusterer.setIgnoreHidden(true);\n this.noDrawOnSingleAddRemoves = true;\n $log.info(this);\n }\n\n ClustererMarkerManager.prototype.checkKey = function(gMarker) {\n var msg;\n if (gMarker.key == null) {\n msg = 'gMarker.key undefined and it is REQUIRED!!';\n return $log.error(msg);\n }\n };\n\n ClustererMarkerManager.prototype.add = function(gMarker) {\n this.checkKey(gMarker);\n this.clusterer.addMarker(gMarker, this.noDrawOnSingleAddRemoves);\n this.propMapGMarkers.put(gMarker.key, gMarker);\n return this.checkSync();\n };\n\n ClustererMarkerManager.prototype.update = function(gMarker) {\n this.remove(gMarker);\n return this.add(gMarker);\n };\n\n ClustererMarkerManager.prototype.addMany = function(gMarkers) {\n return gMarkers.forEach((function(_this) {\n return function(gMarker) {\n return _this.add(gMarker);\n };\n })(this));\n };\n\n ClustererMarkerManager.prototype.remove = function(gMarker) {\n var exists;\n this.checkKey(gMarker);\n exists = this.propMapGMarkers.get(gMarker.key);\n if (exists) {\n this.clusterer.removeMarker(gMarker, this.noDrawOnSingleAddRemoves);\n this.propMapGMarkers.remove(gMarker.key);\n }\n return this.checkSync();\n };\n\n ClustererMarkerManager.prototype.removeMany = function(gMarkers) {\n return gMarkers.forEach((function(_this) {\n return function(gMarker) {\n return _this.remove(gMarker);\n };\n })(this));\n };\n\n ClustererMarkerManager.prototype.draw = function() {\n return this.clusterer.repaint();\n };\n\n ClustererMarkerManager.prototype.clear = function() {\n this.removeMany(this.getGMarkers());\n return this.clusterer.repaint();\n };\n\n ClustererMarkerManager.prototype.attachEvents = function(options, optionsName) {\n var eventHandler, eventName, results;\n this.listeners = [];\n if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {\n results = [];\n for (eventName in options) {\n eventHandler = options[eventName];\n if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {\n $log.info(optionsName + \": Attaching event: \" + eventName + \" to clusterer\");\n results.push(this.listeners.push(google.maps.event.addListener(this.clusterer, eventName, options[eventName])));\n } else {\n results.push(void 0);\n }\n }\n return results;\n }\n };\n\n ClustererMarkerManager.prototype.clearEvents = function() {\n EventsHelper.removeEvents(this.listeners);\n return this.listeners = [];\n };\n\n ClustererMarkerManager.prototype.destroy = function() {\n this.clearEvents();\n return this.clear();\n };\n\n ClustererMarkerManager.prototype.fit = function() {\n return FitHelper.fit(this.getGMarkers(), this.clusterer.getMap());\n };\n\n ClustererMarkerManager.prototype.getGMarkers = function() {\n return this.clusterer.getMarkers().values();\n };\n\n ClustererMarkerManager.prototype.checkSync = function() {};\n\n return ClustererMarkerManager;\n\n })();\n return ClustererMarkerManager;\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.managers').service('uiGmapGoogleMapObjectManager', [\n function() {\n var _availableInstances, _usedInstances;\n _availableInstances = [];\n _usedInstances = [];\n return {\n createMapInstance: function(parentElement, options) {\n var instance;\n instance = null;\n if (_availableInstances.length === 0) {\n instance = new google.maps.Map(parentElement, options);\n _usedInstances.push(instance);\n } else {\n instance = _availableInstances.pop();\n angular.element(parentElement).append(instance.getDiv());\n instance.setOptions(options);\n _usedInstances.push(instance);\n }\n return instance;\n },\n recycleMapInstance: function(instance) {\n var index;\n index = _usedInstances.indexOf(instance);\n if (index < 0) {\n throw new Error('Expected map instance to be a previously used instance');\n }\n _usedInstances.splice(index, 1);\n return _availableInstances.push(instance);\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module(\"uiGmapgoogle-maps.directives.api.managers\").factory(\"uiGmapMarkerManager\", [\n \"uiGmapLogger\", \"uiGmapFitHelper\", \"uiGmapPropMap\", function(Logger, FitHelper, PropMap) {\n var MarkerManager;\n MarkerManager = (function() {\n MarkerManager.type = 'MarkerManager';\n\n function MarkerManager(gMap, opt_markers, opt_options) {\n this.getGMarkers = bind(this.getGMarkers, this);\n this.fit = bind(this.fit, this);\n this.handleOptDraw = bind(this.handleOptDraw, this);\n this.clear = bind(this.clear, this);\n this.destroy = bind(this.destroy, this);\n this.draw = bind(this.draw, this);\n this.removeMany = bind(this.removeMany, this);\n this.remove = bind(this.remove, this);\n this.addMany = bind(this.addMany, this);\n this.update = bind(this.update, this);\n this.add = bind(this.add, this);\n this.type = MarkerManager.type;\n this.gMap = gMap;\n this.gMarkers = new PropMap();\n this.$log = Logger;\n this.$log.info(this);\n }\n\n MarkerManager.prototype.add = function(gMarker, optDraw) {\n var exists, msg;\n if (optDraw == null) {\n optDraw = true;\n }\n if (gMarker.key == null) {\n msg = \"gMarker.key undefined and it is REQUIRED!!\";\n Logger.error(msg);\n throw msg;\n }\n exists = this.gMarkers.get(gMarker.key);\n if (!exists) {\n this.handleOptDraw(gMarker, optDraw, true);\n return this.gMarkers.put(gMarker.key, gMarker);\n }\n };\n\n MarkerManager.prototype.update = function(gMarker, optDraw) {\n if (optDraw == null) {\n optDraw = true;\n }\n this.remove(gMarker, optDraw);\n return this.add(gMarker, optDraw);\n };\n\n MarkerManager.prototype.addMany = function(gMarkers) {\n return gMarkers.forEach((function(_this) {\n return function(gMarker) {\n return _this.add(gMarker);\n };\n })(this));\n };\n\n MarkerManager.prototype.remove = function(gMarker, optDraw) {\n if (optDraw == null) {\n optDraw = true;\n }\n this.handleOptDraw(gMarker, optDraw, false);\n if (this.gMarkers.get(gMarker.key)) {\n return this.gMarkers.remove(gMarker.key);\n }\n };\n\n MarkerManager.prototype.removeMany = function(gMarkers) {\n return gMarkers.forEach((function(_this) {\n return function(marker) {\n return _this.remove(marker);\n };\n })(this));\n };\n\n MarkerManager.prototype.draw = function() {\n var deletes;\n deletes = [];\n this.gMarkers.each((function(_this) {\n return function(gMarker) {\n if (!gMarker.isDrawn) {\n if (gMarker.doAdd) {\n gMarker.setMap(_this.gMap);\n return gMarker.isDrawn = true;\n } else {\n return deletes.push(gMarker);\n }\n }\n };\n })(this));\n return deletes.forEach((function(_this) {\n return function(gMarker) {\n gMarker.isDrawn = false;\n return _this.remove(gMarker, true);\n };\n })(this));\n };\n\n MarkerManager.prototype.destroy = function() {\n return this.clear();\n };\n\n MarkerManager.prototype.clear = function() {\n this.gMarkers.each(function(gMarker) {\n return gMarker.setMap(null);\n });\n delete this.gMarkers;\n return this.gMarkers = new PropMap();\n };\n\n MarkerManager.prototype.handleOptDraw = function(gMarker, optDraw, doAdd) {\n if (optDraw === true) {\n if (doAdd) {\n gMarker.setMap(this.gMap);\n } else {\n gMarker.setMap(null);\n }\n return gMarker.isDrawn = true;\n } else {\n gMarker.isDrawn = false;\n return gMarker.doAdd = doAdd;\n }\n };\n\n MarkerManager.prototype.fit = function() {\n return FitHelper.fit(this.getGMarkers(), this.gMap);\n };\n\n MarkerManager.prototype.getGMarkers = function() {\n return this.gMarkers.values();\n };\n\n return MarkerManager;\n\n })();\n return MarkerManager;\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module('uiGmapgoogle-maps.directives.api.managers').factory('uiGmapSpiderfierMarkerManager', [\n 'uiGmapLogger', 'uiGmapFitHelper', 'uiGmapPropMap', 'uiGmapMarkerSpiderfier', function($log, FitHelper, PropMap, MarkerSpiderfier) {\n var SpiderfierMarkerManager;\n return SpiderfierMarkerManager = (function() {\n SpiderfierMarkerManager.type = 'SpiderfierMarkerManager';\n\n function SpiderfierMarkerManager(gMap, opt_markers, opt_options, opt_events, scope) {\n if (opt_markers == null) {\n opt_markers = {};\n }\n this.opt_options = opt_options != null ? opt_options : {};\n this.opt_events = opt_events;\n this.scope = scope;\n this.checkSync = bind(this.checkSync, this);\n this.isSpiderfied = bind(this.isSpiderfied, this);\n this.getGMarkers = bind(this.getGMarkers, this);\n this.fit = bind(this.fit, this);\n this.destroy = bind(this.destroy, this);\n this.attachEvents = bind(this.attachEvents, this);\n this.clear = bind(this.clear, this);\n this.draw = bind(this.draw, this);\n this.removeMany = bind(this.removeMany, this);\n this.remove = bind(this.remove, this);\n this.addMany = bind(this.addMany, this);\n this.update = bind(this.update, this);\n this.add = bind(this.add, this);\n this.type = SpiderfierMarkerManager.type;\n this.markerSpiderfier = new MarkerSpiderfier(gMap, this.opt_options);\n this.propMapGMarkers = new PropMap();\n this.attachEvents(this.opt_events, 'opt_events');\n this.noDrawOnSingleAddRemoves = true;\n $log.info(this);\n }\n\n SpiderfierMarkerManager.prototype.checkKey = function(gMarker) {\n var msg;\n if (gMarker.key == null) {\n msg = 'gMarker.key undefined and it is REQUIRED!!';\n return $log.error(msg);\n }\n };\n\n SpiderfierMarkerManager.prototype.add = function(gMarker) {\n gMarker.setMap(this.markerSpiderfier.map);\n this.checkKey(gMarker);\n this.markerSpiderfier.addMarker(gMarker, this.noDrawOnSingleAddRemoves);\n this.propMapGMarkers.put(gMarker.key, gMarker);\n return this.checkSync();\n };\n\n SpiderfierMarkerManager.prototype.update = function(gMarker) {\n this.remove(gMarker);\n return this.add(gMarker);\n };\n\n SpiderfierMarkerManager.prototype.addMany = function(gMarkers) {\n return gMarkers.forEach((function(_this) {\n return function(gMarker) {\n return _this.add(gMarker);\n };\n })(this));\n };\n\n SpiderfierMarkerManager.prototype.remove = function(gMarker) {\n var exists;\n this.checkKey(gMarker);\n exists = this.propMapGMarkers.get(gMarker.key);\n if (exists) {\n gMarker.setMap(null);\n this.markerSpiderfier.removeMarker(gMarker, this.noDrawOnSingleAddRemoves);\n this.propMapGMarkers.remove(gMarker.key);\n }\n return this.checkSync();\n };\n\n SpiderfierMarkerManager.prototype.removeMany = function(gMarkers) {\n return gMarkers.forEach((function(_this) {\n return function(gMarker) {\n return _this.remove(gMarker);\n };\n })(this));\n };\n\n SpiderfierMarkerManager.prototype.draw = function() {};\n\n SpiderfierMarkerManager.prototype.clear = function() {\n return this.removeMany(this.getGMarkers());\n };\n\n SpiderfierMarkerManager.prototype.attachEvents = function(options, optionsName) {\n if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {\n return _.each(options, (function(_this) {\n return function(eventHandler, eventName) {\n if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {\n $log.info(optionsName + \": Attaching event: \" + eventName + \" to markerSpiderfier\");\n return _this.markerSpiderfier.addListener(eventName, function() {\n if (eventName === 'spiderfy' || eventName === 'unspiderfy') {\n return _this.scope.$evalAsync(options[eventName].apply(options, arguments));\n } else {\n return _this.scope.$evalAsync(options[eventName].apply(options, [arguments[0], eventName, arguments[0].model, arguments]));\n }\n });\n }\n };\n })(this));\n }\n };\n\n SpiderfierMarkerManager.prototype.clearEvents = function(options, optionsName) {\n var eventHandler, eventName;\n if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {\n for (eventName in options) {\n eventHandler = options[eventName];\n if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {\n $log.info(optionsName + \": Clearing event: \" + eventName + \" to markerSpiderfier\");\n this.markerSpiderfier.clearListeners(eventName);\n }\n }\n }\n };\n\n SpiderfierMarkerManager.prototype.destroy = function() {\n this.clearEvents(this.opt_events, 'opt_events');\n return this.clear();\n };\n\n SpiderfierMarkerManager.prototype.fit = function() {\n return FitHelper.fit(this.getGMarkers(), this.markerSpiderfier.map);\n };\n\n SpiderfierMarkerManager.prototype.getGMarkers = function() {\n return this.markerSpiderfier.getMarkers();\n };\n\n SpiderfierMarkerManager.prototype.isSpiderfied = function() {\n return _.find(this.getGMarkers(), function(gMarker) {\n return (gMarker != null ? gMarker._omsData : void 0) != null;\n });\n };\n\n SpiderfierMarkerManager.prototype.checkSync = function() {};\n\n return SpiderfierMarkerManager;\n\n })();\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps').factory('uiGmapadd-events', [\n '$timeout', function($timeout) {\n var addEvent, addEvents;\n addEvent = function(target, eventName, handler) {\n return google.maps.event.addListener(target, eventName, function() {\n handler.apply(this, arguments);\n return $timeout((function() {}), true);\n });\n };\n addEvents = function(target, eventName, handler) {\n var remove;\n if (handler) {\n return addEvent(target, eventName, handler);\n }\n remove = [];\n angular.forEach(eventName, function(_handler, key) {\n return remove.push(addEvent(target, key, _handler));\n });\n return function() {\n angular.forEach(remove, function(listener) {\n return google.maps.event.removeListener(listener);\n });\n return remove = null;\n };\n };\n return addEvents;\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps').factory('uiGmaparray-sync', [\n 'uiGmapadd-events', function(mapEvents) {\n return function(mapArray, scope, pathEval, pathChangedFn) {\n var geojsonArray, geojsonHandlers, geojsonWatcher, isSetFromScope, legacyHandlers, legacyWatcher, mapArrayListener, scopePath, watchListener;\n isSetFromScope = false;\n scopePath = scope.$eval(pathEval);\n if (!scope[\"static\"]) {\n legacyHandlers = {\n set_at: function(index) {\n var value;\n if (isSetFromScope) {\n return;\n }\n value = mapArray.getAt(index);\n if (!value) {\n return;\n }\n if (!value.lng || !value.lat) {\n return scopePath[index] = value;\n } else {\n scopePath[index].latitude = value.lat();\n return scopePath[index].longitude = value.lng();\n }\n },\n insert_at: function(index) {\n var value;\n if (isSetFromScope) {\n return;\n }\n value = mapArray.getAt(index);\n if (!value) {\n return;\n }\n if (!value.lng || !value.lat) {\n return scopePath.splice(index, 0, value);\n } else {\n return scopePath.splice(index, 0, {\n latitude: value.lat(),\n longitude: value.lng()\n });\n }\n },\n remove_at: function(index) {\n if (isSetFromScope) {\n return;\n }\n return scopePath.splice(index, 1);\n }\n };\n geojsonArray;\n if (scopePath.type === 'Polygon') {\n geojsonArray = scopePath.coordinates[0];\n } else if (scopePath.type === 'LineString') {\n geojsonArray = scopePath.coordinates;\n }\n geojsonHandlers = {\n set_at: function(index) {\n var value;\n if (isSetFromScope) {\n return;\n }\n value = mapArray.getAt(index);\n if (!(value && value.lng && value.lat)) {\n return;\n }\n geojsonArray[index][1] = value.lat();\n return geojsonArray[index][0] = value.lng();\n },\n insert_at: function(index) {\n var value;\n if (isSetFromScope) {\n return;\n }\n value = mapArray.getAt(index);\n if (!value) {\n return;\n }\n if (!value.lng || !value.lat) {\n return;\n }\n return geojsonArray.splice(index, 0, [value.lng(), value.lat()]);\n },\n remove_at: function(index) {\n if (isSetFromScope) {\n return;\n }\n return geojsonArray.splice(index, 1);\n }\n };\n mapArrayListener = mapEvents(mapArray, angular.isUndefined(scopePath.type) ? legacyHandlers : geojsonHandlers);\n }\n legacyWatcher = function(newPath) {\n var changed, i, l, newLength, newValue, oldArray, oldLength, oldValue;\n isSetFromScope = true;\n oldArray = mapArray;\n changed = false;\n if (newPath) {\n i = 0;\n oldLength = oldArray.getLength();\n newLength = newPath.length;\n l = Math.min(oldLength, newLength);\n newValue = void 0;\n while (i < l) {\n oldValue = oldArray.getAt(i);\n newValue = newPath[i];\n if (typeof newValue.equals === 'function') {\n if (!newValue.equals(oldValue)) {\n oldArray.setAt(i, newValue);\n changed = true;\n }\n } else {\n if ((oldValue.lat() !== newValue.latitude) || (oldValue.lng() !== newValue.longitude)) {\n oldArray.setAt(i, new google.maps.LatLng(newValue.latitude, newValue.longitude));\n changed = true;\n }\n }\n i++;\n }\n while (i < newLength) {\n newValue = newPath[i];\n if (typeof newValue.lat === 'function' && typeof newValue.lng === 'function') {\n oldArray.push(newValue);\n } else {\n oldArray.push(new google.maps.LatLng(newValue.latitude, newValue.longitude));\n }\n changed = true;\n i++;\n }\n while (i < oldLength) {\n oldArray.pop();\n changed = true;\n i++;\n }\n }\n isSetFromScope = false;\n if (changed) {\n return pathChangedFn(oldArray);\n }\n };\n geojsonWatcher = function(newPath) {\n var array, changed, i, l, newLength, newValue, oldArray, oldLength, oldValue;\n isSetFromScope = true;\n oldArray = mapArray;\n changed = false;\n if (newPath) {\n array;\n if (scopePath.type === 'Polygon') {\n array = newPath.coordinates[0];\n } else if (scopePath.type === 'LineString') {\n array = newPath.coordinates;\n }\n i = 0;\n oldLength = oldArray.getLength();\n newLength = array.length;\n l = Math.min(oldLength, newLength);\n newValue = void 0;\n while (i < l) {\n oldValue = oldArray.getAt(i);\n newValue = array[i];\n if ((oldValue.lat() !== newValue[1]) || (oldValue.lng() !== newValue[0])) {\n oldArray.setAt(i, new google.maps.LatLng(newValue[1], newValue[0]));\n changed = true;\n }\n i++;\n }\n while (i < newLength) {\n newValue = array[i];\n oldArray.push(new google.maps.LatLng(newValue[1], newValue[0]));\n changed = true;\n i++;\n }\n while (i < oldLength) {\n oldArray.pop();\n changed = true;\n i++;\n }\n }\n isSetFromScope = false;\n if (changed) {\n return pathChangedFn(oldArray);\n }\n };\n watchListener;\n if (!scope[\"static\"]) {\n if (angular.isUndefined(scopePath.type)) {\n watchListener = scope.$watchCollection(pathEval, legacyWatcher);\n } else {\n watchListener = scope.$watch(pathEval, geojsonWatcher, true);\n }\n }\n return function() {\n if (mapArrayListener) {\n mapArrayListener();\n mapArrayListener = null;\n }\n if (watchListener) {\n watchListener();\n return watchListener = null;\n }\n };\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module(\"uiGmapgoogle-maps.directives.api.utils\").factory(\"uiGmapChromeFixes\", [\n '$timeout', function($timeout) {\n return {\n maybeRepaint: function(el) {\n if (el) {\n el.style.opacity = 0.9;\n return $timeout(function() {\n return el.style.opacity = 1;\n });\n }\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps').service('uiGmapObjectIterators', function() {\n var _ignores, _iterators, _slapForEach, _slapMap;\n _ignores = ['length', 'forEach', 'map'];\n _iterators = [];\n _slapForEach = function(object) {\n object.forEach = function(cb) {\n return _.each(_.omit(object, _ignores), function(val) {\n if (!_.isFunction(val)) {\n return cb(val);\n }\n });\n };\n return object;\n };\n _iterators.push(_slapForEach);\n _slapMap = function(object) {\n object.map = function(cb) {\n return _.map(_.omit(object, _ignores), function(val) {\n if (!_.isFunction(val)) {\n return cb(val);\n }\n });\n };\n return object;\n };\n _iterators.push(_slapMap);\n return {\n slapMap: _slapMap,\n slapForEach: _slapForEach,\n slapAll: function(object) {\n _iterators.forEach(function(it) {\n return it(object);\n });\n return object;\n }\n };\n });\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.options.builders').service('uiGmapCommonOptionsBuilder', [\n 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapModelKey', function(BaseObject, $log, ModelKey) {\n var CommonOptionsBuilder;\n return CommonOptionsBuilder = (function(superClass) {\n extend(CommonOptionsBuilder, superClass);\n\n function CommonOptionsBuilder() {\n this.watchProps = bind(this.watchProps, this);\n this.buildOpts = bind(this.buildOpts, this);\n return CommonOptionsBuilder.__super__.constructor.apply(this, arguments);\n }\n\n CommonOptionsBuilder.prototype.props = [\n 'clickable', 'draggable', 'editable', 'visible', {\n prop: 'stroke',\n isColl: true\n }\n ];\n\n CommonOptionsBuilder.prototype.getCorrectModel = function(scope) {\n if (angular.isDefined(scope != null ? scope.model : void 0)) {\n return scope.model;\n } else {\n return scope;\n }\n };\n\n CommonOptionsBuilder.prototype.buildOpts = function(customOpts, cachedEval, forEachOpts) {\n var model, opts, stroke;\n if (customOpts == null) {\n customOpts = {};\n }\n if (forEachOpts == null) {\n forEachOpts = {};\n }\n if (!this.scope) {\n $log.error('this.scope not defined in CommonOptionsBuilder can not buildOpts');\n return;\n }\n if (!this.gMap) {\n $log.error('this.map not defined in CommonOptionsBuilder can not buildOpts');\n return;\n }\n model = this.getCorrectModel(this.scope);\n stroke = this.scopeOrModelVal('stroke', this.scope, model);\n opts = angular.extend(customOpts, this.DEFAULTS, {\n map: this.gMap,\n strokeColor: stroke != null ? stroke.color : void 0,\n strokeOpacity: stroke != null ? stroke.opacity : void 0,\n strokeWeight: stroke != null ? stroke.weight : void 0\n });\n angular.forEach(angular.extend(forEachOpts, {\n clickable: true,\n draggable: false,\n editable: false,\n \"static\": false,\n fit: false,\n visible: true,\n zIndex: 0,\n icons: []\n }), (function(_this) {\n return function(defaultValue, key) {\n var val;\n val = cachedEval ? cachedEval[key] : _this.scopeOrModelVal(key, _this.scope, model);\n if (angular.isUndefined(val)) {\n return opts[key] = defaultValue;\n } else {\n return opts[key] = model[key];\n }\n };\n })(this));\n if (opts[\"static\"]) {\n opts.editable = false;\n }\n return opts;\n };\n\n CommonOptionsBuilder.prototype.watchProps = function(props) {\n if (props == null) {\n props = this.props;\n }\n return props.forEach((function(_this) {\n return function(prop) {\n if ((_this.attrs[prop] != null) || (_this.attrs[prop != null ? prop.prop : void 0] != null)) {\n if (prop != null ? prop.isColl : void 0) {\n return _this.scope.$watchCollection(prop.prop, _this.setMyOptions);\n } else {\n return _this.scope.$watch(prop, _this.setMyOptions);\n }\n }\n };\n })(this));\n };\n\n return CommonOptionsBuilder;\n\n })(ModelKey);\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.options.builders').factory('uiGmapPolylineOptionsBuilder', [\n 'uiGmapCommonOptionsBuilder', function(CommonOptionsBuilder) {\n var PolylineOptionsBuilder;\n return PolylineOptionsBuilder = (function(superClass) {\n extend(PolylineOptionsBuilder, superClass);\n\n function PolylineOptionsBuilder() {\n return PolylineOptionsBuilder.__super__.constructor.apply(this, arguments);\n }\n\n PolylineOptionsBuilder.prototype.buildOpts = function(pathPoints, cachedEval) {\n return PolylineOptionsBuilder.__super__.buildOpts.call(this, {\n path: pathPoints\n }, cachedEval, {\n geodesic: false\n });\n };\n\n return PolylineOptionsBuilder;\n\n })(CommonOptionsBuilder);\n }\n ]).factory('uiGmapShapeOptionsBuilder', [\n 'uiGmapCommonOptionsBuilder', function(CommonOptionsBuilder) {\n var ShapeOptionsBuilder;\n return ShapeOptionsBuilder = (function(superClass) {\n extend(ShapeOptionsBuilder, superClass);\n\n function ShapeOptionsBuilder() {\n return ShapeOptionsBuilder.__super__.constructor.apply(this, arguments);\n }\n\n ShapeOptionsBuilder.prototype.buildOpts = function(customOpts, cachedEval, forEachOpts) {\n var fill, model;\n model = this.getCorrectModel(this.scope);\n fill = cachedEval ? cachedEval['fill'] : this.scopeOrModelVal('fill', this.scope, model);\n customOpts = angular.extend(customOpts, {\n fillColor: fill != null ? fill.color : void 0,\n fillOpacity: fill != null ? fill.opacity : void 0\n });\n return ShapeOptionsBuilder.__super__.buildOpts.call(this, customOpts, cachedEval, forEachOpts);\n };\n\n return ShapeOptionsBuilder;\n\n })(CommonOptionsBuilder);\n }\n ]).factory('uiGmapPolygonOptionsBuilder', [\n 'uiGmapShapeOptionsBuilder', function(ShapeOptionsBuilder) {\n var PolygonOptionsBuilder;\n return PolygonOptionsBuilder = (function(superClass) {\n extend(PolygonOptionsBuilder, superClass);\n\n function PolygonOptionsBuilder() {\n return PolygonOptionsBuilder.__super__.constructor.apply(this, arguments);\n }\n\n PolygonOptionsBuilder.prototype.buildOpts = function(pathPoints, cachedEval) {\n return PolygonOptionsBuilder.__super__.buildOpts.call(this, {\n path: pathPoints\n }, cachedEval, {\n geodesic: false\n });\n };\n\n return PolygonOptionsBuilder;\n\n })(ShapeOptionsBuilder);\n }\n ]).factory('uiGmapRectangleOptionsBuilder', [\n 'uiGmapShapeOptionsBuilder', function(ShapeOptionsBuilder) {\n var RectangleOptionsBuilder;\n return RectangleOptionsBuilder = (function(superClass) {\n extend(RectangleOptionsBuilder, superClass);\n\n function RectangleOptionsBuilder() {\n return RectangleOptionsBuilder.__super__.constructor.apply(this, arguments);\n }\n\n RectangleOptionsBuilder.prototype.buildOpts = function(bounds, cachedEval) {\n return RectangleOptionsBuilder.__super__.buildOpts.call(this, {\n bounds: bounds\n }, cachedEval);\n };\n\n return RectangleOptionsBuilder;\n\n })(ShapeOptionsBuilder);\n }\n ]).factory('uiGmapCircleOptionsBuilder', [\n 'uiGmapShapeOptionsBuilder', function(ShapeOptionsBuilder) {\n var CircleOptionsBuilder;\n return CircleOptionsBuilder = (function(superClass) {\n extend(CircleOptionsBuilder, superClass);\n\n function CircleOptionsBuilder() {\n return CircleOptionsBuilder.__super__.constructor.apply(this, arguments);\n }\n\n CircleOptionsBuilder.prototype.buildOpts = function(center, radius, cachedEval) {\n return CircleOptionsBuilder.__super__.buildOpts.call(this, {\n center: center,\n radius: radius\n }, cachedEval);\n };\n\n return CircleOptionsBuilder;\n\n })(ShapeOptionsBuilder);\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api.options').service('uiGmapMarkerOptions', [\n 'uiGmapLogger', 'uiGmapGmapUtil', function($log, GmapUtil) {\n return _.extend(GmapUtil, {\n createOptions: function(coords, icon, defaults, map) {\n var opts;\n if (defaults == null) {\n defaults = {};\n }\n opts = angular.extend({}, defaults, {\n position: defaults.position != null ? defaults.position : GmapUtil.getCoords(coords),\n visible: defaults.visible != null ? defaults.visible : GmapUtil.validateCoords(coords)\n });\n if ((defaults.icon != null) || (icon != null)) {\n opts = angular.extend(opts, {\n icon: defaults.icon != null ? defaults.icon : icon\n });\n }\n if (map != null) {\n opts.map = map;\n }\n return opts;\n },\n isLabel: function(options) {\n if (options == null) {\n return false;\n }\n return (options.labelContent != null) || (options.labelAnchor != null) || (options.labelClass != null) || (options.labelStyle != null) || (options.labelVisible != null);\n }\n });\n }\n ]);\n\n}).call(this);\n;\n/*global _,angular */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapBasePolyChildModel', [\n 'uiGmapLogger', '$timeout', 'uiGmaparray-sync', 'uiGmapGmapUtil', 'uiGmapEventsHelper', function($log, $timeout, arraySync, GmapUtil, EventsHelper) {\n return function(Builder, gFactory) {\n var BasePolyChildModel;\n return BasePolyChildModel = (function(superClass) {\n extend(BasePolyChildModel, superClass);\n\n BasePolyChildModel.include(GmapUtil);\n\n function BasePolyChildModel(arg) {\n var create, gObjectChangeCb, ref;\n this.scope = arg.scope, this.attrs = arg.attrs, this.gMap = arg.gMap, this.defaults = arg.defaults, this.model = arg.model, gObjectChangeCb = arg.gObjectChangeCb, this.isScopeModel = (ref = arg.isScopeModel) != null ? ref : false;\n this.clean = bind(this.clean, this);\n if (this.isScopeModel) {\n this.clonedModel = _.clone(this.model, true);\n }\n this.isDragging = false;\n this.internalEvents = {\n dragend: (function(_this) {\n return function() {\n return _.defer(function() {\n return _this.isDragging = false;\n });\n };\n })(this),\n dragstart: (function(_this) {\n return function() {\n return _this.isDragging = true;\n };\n })(this)\n };\n create = (function(_this) {\n return function() {\n var maybeCachedEval;\n if (_this.isDragging) {\n return;\n }\n _this.pathPoints = _this.convertPathPoints(_this.scope.path);\n if (_this.gObject != null) {\n _this.clean();\n }\n if (_this.scope.model != null) {\n maybeCachedEval = _this.scope;\n }\n if (_this.pathPoints.length > 0) {\n _this.gObject = gFactory(_this.buildOpts(_this.pathPoints, maybeCachedEval));\n }\n if (_this.gObject) {\n arraySync(_this.gObject.getPath(), _this.scope, 'path', function(pathPoints) {\n _this.pathPoints = pathPoints;\n if (gObjectChangeCb != null) {\n return gObjectChangeCb();\n }\n });\n if (angular.isDefined(_this.scope.events) && angular.isObject(_this.scope.events)) {\n _this.listeners = _this.model ? EventsHelper.setEvents(_this.gObject, _this.scope, _this.model) : EventsHelper.setEvents(_this.gObject, _this.scope, _this.scope);\n }\n return _this.internalListeners = _this.model ? EventsHelper.setEvents(_this.gObject, {\n events: _this.internalEvents\n }, _this.model) : EventsHelper.setEvents(_this.gObject, {\n events: _this.internalEvents\n }, _this.scope);\n }\n };\n })(this);\n create();\n this.scope.$watch('path', (function(_this) {\n return function(newValue, oldValue) {\n if (!_.isEqual(newValue, oldValue) || !_this.gObject) {\n return create();\n }\n };\n })(this), true);\n if (!this.scope[\"static\"] && angular.isDefined(this.scope.editable)) {\n this.scope.$watch('editable', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n newValue = !_this.isFalse(newValue);\n return (ref1 = _this.gObject) != null ? ref1.setEditable(newValue) : void 0;\n }\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.draggable)) {\n this.scope.$watch('draggable', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n newValue = !_this.isFalse(newValue);\n return (ref1 = _this.gObject) != null ? ref1.setDraggable(newValue) : void 0;\n }\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.visible)) {\n this.scope.$watch('visible', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n newValue = !_this.isFalse(newValue);\n }\n return (ref1 = _this.gObject) != null ? ref1.setVisible(newValue) : void 0;\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.geodesic)) {\n this.scope.$watch('geodesic', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n newValue = !_this.isFalse(newValue);\n return (ref1 = _this.gObject) != null ? ref1.setOptions(_this.buildOpts(_this.gObject.getPath())) : void 0;\n }\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.stroke) && angular.isDefined(this.scope.stroke.weight)) {\n this.scope.$watch('stroke.weight', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n return (ref1 = _this.gObject) != null ? ref1.setOptions(_this.buildOpts(_this.gObject.getPath())) : void 0;\n }\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.stroke) && angular.isDefined(this.scope.stroke.color)) {\n this.scope.$watch('stroke.color', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n return (ref1 = _this.gObject) != null ? ref1.setOptions(_this.buildOpts(_this.gObject.getPath())) : void 0;\n }\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.stroke) && angular.isDefined(this.scope.stroke.opacity)) {\n this.scope.$watch('stroke.opacity', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n return (ref1 = _this.gObject) != null ? ref1.setOptions(_this.buildOpts(_this.gObject.getPath())) : void 0;\n }\n };\n })(this), true);\n }\n if (angular.isDefined(this.scope.icons)) {\n this.scope.$watch('icons', (function(_this) {\n return function(newValue, oldValue) {\n var ref1;\n if (newValue !== oldValue) {\n return (ref1 = _this.gObject) != null ? ref1.setOptions(_this.buildOpts(_this.gObject.getPath())) : void 0;\n }\n };\n })(this), true);\n }\n this.scope.$on('$destroy', (function(_this) {\n return function() {\n _this.clean();\n return _this.scope = null;\n };\n })(this));\n if (angular.isDefined(this.scope.fill) && angular.isDefined(this.scope.fill.color)) {\n this.scope.$watch('fill.color', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.gObject.setOptions(_this.buildOpts(_this.gObject.getPath()));\n }\n };\n })(this));\n }\n if (angular.isDefined(this.scope.fill) && angular.isDefined(this.scope.fill.opacity)) {\n this.scope.$watch('fill.opacity', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.gObject.setOptions(_this.buildOpts(_this.gObject.getPath()));\n }\n };\n })(this));\n }\n if (angular.isDefined(this.scope.zIndex)) {\n this.scope.$watch('zIndex', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.gObject.setOptions(_this.buildOpts(_this.gObject.getPath()));\n }\n };\n })(this));\n }\n }\n\n BasePolyChildModel.prototype.clean = function() {\n var ref;\n EventsHelper.removeEvents(this.listeners);\n EventsHelper.removeEvents(this.internalListeners);\n if ((ref = this.gObject) != null) {\n ref.setMap(null);\n }\n return this.gObject = null;\n };\n\n return BasePolyChildModel;\n\n })(Builder);\n };\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicholas McCready - https://twitter.com/nmccready\nOriginal idea from: http://stackoverflow.com/questions/22758950/google-map-drawing-freehand , &\n http://jsfiddle.net/YsQdh/88/\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps.directives.api.models.child').factory('uiGmapDrawFreeHandChildModel', [\n 'uiGmapLogger', '$q', function($log, $q) {\n var drawFreeHand, freeHandMgr;\n drawFreeHand = function(map, polys, done) {\n var move, poly;\n poly = new google.maps.Polyline({\n map: map,\n clickable: false\n });\n move = google.maps.event.addListener(map, 'mousemove', function(e) {\n return poly.getPath().push(e.latLng);\n });\n google.maps.event.addListenerOnce(map, 'mouseup', function(e) {\n var path;\n google.maps.event.removeListener(move);\n path = poly.getPath();\n poly.setMap(null);\n polys.push(new google.maps.Polygon({\n map: map,\n path: path\n }));\n poly = null;\n google.maps.event.clearListeners(map.getDiv(), 'mousedown');\n return done();\n });\n return void 0;\n };\n freeHandMgr = function(map1, scope) {\n var disableMap, enableMap;\n this.map = map1;\n disableMap = (function(_this) {\n return function() {\n var mapOptions;\n mapOptions = {\n draggable: false,\n disableDefaultUI: true,\n scrollwheel: false,\n disableDoubleClickZoom: false\n };\n $log.info('disabling map move');\n return _this.map.setOptions(mapOptions);\n };\n })(this);\n enableMap = (function(_this) {\n return function() {\n var mapOptions, ref;\n mapOptions = {\n draggable: true,\n disableDefaultUI: false,\n scrollwheel: true,\n disableDoubleClickZoom: true\n };\n if ((ref = _this.deferred) != null) {\n ref.resolve();\n }\n return _.defer(function() {\n return _this.map.setOptions(_.extend(mapOptions, scope.options));\n });\n };\n })(this);\n this.engage = (function(_this) {\n return function(polys1) {\n _this.polys = polys1;\n _this.deferred = $q.defer();\n disableMap();\n $log.info('DrawFreeHandChildModel is engaged (drawing).');\n google.maps.event.addDomListener(_this.map.getDiv(), 'mousedown', function(e) {\n return drawFreeHand(_this.map, _this.polys, enableMap);\n });\n return _this.deferred.promise;\n };\n })(this);\n return this;\n };\n return freeHandMgr;\n }\n ]);\n\n}).call(this);\n;\n/*global _:true,angular:true,google:true, RichMarker:true */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.child').factory('uiGmapMarkerChildModel', [\n 'uiGmapModelKey', 'uiGmapGmapUtil', 'uiGmapLogger', 'uiGmapEventsHelper', 'uiGmapPropertyAction', 'uiGmapMarkerOptions', 'uiGmapIMarker', 'uiGmapMarkerManager', 'uiGmapPromise', function(ModelKey, GmapUtil, $log, EventsHelper, PropertyAction, MarkerOptions, IMarker, MarkerManager, uiGmapPromise) {\n var MarkerChildModel;\n MarkerChildModel = (function(superClass) {\n var destroy;\n\n extend(MarkerChildModel, superClass);\n\n MarkerChildModel.include(GmapUtil);\n\n MarkerChildModel.include(EventsHelper);\n\n MarkerChildModel.include(MarkerOptions);\n\n destroy = function(child) {\n if ((child != null ? child.gObject : void 0) != null) {\n child.removeEvents(child.externalListeners);\n child.removeEvents(child.internalListeners);\n if (child != null ? child.gObject : void 0) {\n if (child.removeFromManager) {\n child.gManager.remove(child.gObject);\n }\n child.gObject.setMap(null);\n return child.gObject = null;\n }\n }\n };\n\n function MarkerChildModel(opts) {\n this.internalEvents = bind(this.internalEvents, this);\n this.setLabelOptions = bind(this.setLabelOptions, this);\n this.setOptions = bind(this.setOptions, this);\n this.setIcon = bind(this.setIcon, this);\n this.setCoords = bind(this.setCoords, this);\n this.isNotValid = bind(this.isNotValid, this);\n this.maybeSetScopeValue = bind(this.maybeSetScopeValue, this);\n this.createMarker = bind(this.createMarker, this);\n this.setMyScope = bind(this.setMyScope, this);\n this.updateModel = bind(this.updateModel, this);\n this.handleModelChanges = bind(this.handleModelChanges, this);\n this.destroy = bind(this.destroy, this);\n var action, ref, ref1, ref2, ref3, ref4, scope;\n scope = opts.scope, this.model = opts.model, this.keys = opts.keys, this.gMap = opts.gMap, this.defaults = (ref = opts.defaults) != null ? ref : {}, this.doClick = opts.doClick, this.gManager = opts.gManager, this.doDrawSelf = (ref1 = opts.doDrawSelf) != null ? ref1 : true, this.trackModel = (ref2 = opts.trackModel) != null ? ref2 : true, this.needRedraw = (ref3 = opts.needRedraw) != null ? ref3 : false, this.isScopeModel = (ref4 = opts.isScopeModel) != null ? ref4 : false;\n if (this.isScopeModel) {\n this.clonedModel = _.clone(this.model, true);\n }\n this.deferred = uiGmapPromise.defer();\n _.each(this.keys, (function(_this) {\n return function(v, k) {\n var keyValue;\n keyValue = _this.keys[k];\n if ((keyValue != null) && !_.isFunction(keyValue) && _.isString(keyValue)) {\n return _this[k + 'Key'] = keyValue;\n }\n };\n })(this));\n this.idKey = this.idKeyKey || 'id';\n if (this.model[this.idKey] != null) {\n this.id = this.model[this.idKey];\n }\n MarkerChildModel.__super__.constructor.call(this, scope);\n this.scope.getGMarker = (function(_this) {\n return function() {\n return _this.gObject;\n };\n })(this);\n this.firstTime = true;\n if (this.trackModel) {\n this.scope.model = this.model;\n this.scope.$watch('model', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.handleModelChanges(newValue, oldValue);\n }\n };\n })(this), true);\n } else {\n action = new PropertyAction((function(_this) {\n return function(calledKey) {\n if (_.isFunction(calledKey)) {\n calledKey = 'all';\n }\n if (!_this.firstTime) {\n return _this.setMyScope(calledKey, scope);\n }\n };\n })(this), false);\n _.each(this.keys, function(v, k) {\n return scope.$watch(k, action.sic(k), true);\n });\n }\n this.scope.$on('$destroy', (function(_this) {\n return function() {\n return destroy(_this);\n };\n })(this));\n this.createMarker(this.model);\n $log.info(this);\n }\n\n MarkerChildModel.prototype.destroy = function(removeFromManager) {\n if (removeFromManager == null) {\n removeFromManager = true;\n }\n this.removeFromManager = removeFromManager;\n return this.scope.$destroy();\n };\n\n MarkerChildModel.prototype.handleModelChanges = function(newValue, oldValue) {\n var changes, ctr, len;\n changes = this.getChanges(newValue, oldValue, IMarker.keys);\n if (!this.firstTime) {\n ctr = 0;\n len = _.keys(changes).length;\n return _.each(changes, (function(_this) {\n return function(v, k) {\n var doDraw;\n ctr += 1;\n doDraw = len === ctr;\n _this.setMyScope(k, newValue, oldValue, false, true, doDraw);\n return _this.needRedraw = true;\n };\n })(this));\n }\n };\n\n MarkerChildModel.prototype.updateModel = function(model) {\n if (this.isScopeModel) {\n this.clonedModel = _.clone(model, true);\n }\n return this.setMyScope('all', model, this.model);\n };\n\n MarkerChildModel.prototype.renderGMarker = function(doDraw, validCb) {\n var coords, isSpiderfied, ref;\n if (doDraw == null) {\n doDraw = true;\n }\n coords = this.getProp('coords', this.scope, this.model);\n if (((ref = this.gManager) != null ? ref.isSpiderfied : void 0) != null) {\n isSpiderfied = this.gManager.isSpiderfied();\n }\n if (coords != null) {\n if (!this.validateCoords(coords)) {\n $log.debug('MarkerChild does not have coords yet. They may be defined later.');\n return;\n }\n if (validCb != null) {\n validCb();\n }\n if (doDraw && this.gObject) {\n this.gManager.add(this.gObject);\n }\n if (isSpiderfied) {\n return this.gManager.markerSpiderfier.spiderListener(this.gObject, window.event);\n }\n } else {\n if (doDraw && this.gObject) {\n return this.gManager.remove(this.gObject);\n }\n }\n };\n\n MarkerChildModel.prototype.setMyScope = function(thingThatChanged, model, oldModel, isInit, doDraw) {\n var justCreated;\n if (oldModel == null) {\n oldModel = void 0;\n }\n if (isInit == null) {\n isInit = false;\n }\n if (doDraw == null) {\n doDraw = true;\n }\n if (model == null) {\n model = this.model;\n } else {\n this.model = model;\n }\n if (!this.gObject) {\n this.setOptions(this.scope, doDraw);\n justCreated = true;\n }\n switch (thingThatChanged) {\n case 'all':\n return _.each(this.keys, (function(_this) {\n return function(v, k) {\n return _this.setMyScope(k, model, oldModel, isInit, doDraw);\n };\n })(this));\n case 'icon':\n return this.maybeSetScopeValue({\n gSetter: this.setIcon,\n doDraw: doDraw\n });\n case 'coords':\n return this.maybeSetScopeValue({\n gSetter: this.setCoords,\n doDraw: doDraw\n });\n case 'options':\n if (!justCreated) {\n return this.createMarker(model, oldModel, isInit, doDraw);\n }\n }\n };\n\n MarkerChildModel.prototype.createMarker = function(model, oldModel, isInit, doDraw) {\n if (oldModel == null) {\n oldModel = void 0;\n }\n if (isInit == null) {\n isInit = false;\n }\n if (doDraw == null) {\n doDraw = true;\n }\n this.maybeSetScopeValue({\n gSetter: this.setOptions,\n doDraw: doDraw\n });\n return this.firstTime = false;\n };\n\n MarkerChildModel.prototype.maybeSetScopeValue = function(arg) {\n var doDraw, gSetter, ref;\n gSetter = arg.gSetter, doDraw = (ref = arg.doDraw) != null ? ref : true;\n if (gSetter != null) {\n gSetter(this.scope, doDraw);\n }\n if (this.doDrawSelf && doDraw) {\n return this.gManager.draw();\n }\n };\n\n MarkerChildModel.prototype.isNotValid = function(scope, doCheckGmarker) {\n var hasIdenticalScopes, hasNoGmarker;\n if (doCheckGmarker == null) {\n doCheckGmarker = true;\n }\n hasNoGmarker = !doCheckGmarker ? false : this.gObject === void 0;\n hasIdenticalScopes = !this.trackModel ? scope.$id !== this.scope.$id : false;\n return hasIdenticalScopes || hasNoGmarker;\n };\n\n MarkerChildModel.prototype.setCoords = function(scope, doDraw) {\n if (doDraw == null) {\n doDraw = true;\n }\n if (this.isNotValid(scope) || (this.gObject == null)) {\n return;\n }\n return this.renderGMarker(doDraw, (function(_this) {\n return function() {\n var newGValue, newModelVal, oldGValue;\n newModelVal = _this.getProp('coords', scope, _this.model);\n newGValue = _this.getCoords(newModelVal);\n oldGValue = _this.gObject.getPosition();\n if ((oldGValue != null) && (newGValue != null)) {\n if (newGValue.lng() === oldGValue.lng() && newGValue.lat() === oldGValue.lat()) {\n return;\n }\n }\n _this.gObject.setPosition(newGValue);\n return _this.gObject.setVisible(_this.validateCoords(newModelVal));\n };\n })(this));\n };\n\n MarkerChildModel.prototype.setIcon = function(scope, doDraw) {\n if (doDraw == null) {\n doDraw = true;\n }\n if (this.isNotValid(scope) || (this.gObject == null)) {\n return;\n }\n return this.renderGMarker(doDraw, (function(_this) {\n return function() {\n var coords, newValue, oldValue;\n oldValue = _this.gObject.getIcon();\n newValue = _this.getProp('icon', scope, _this.model);\n if (oldValue === newValue) {\n return;\n }\n _this.gObject.setIcon(newValue);\n coords = _this.getProp('coords', scope, _this.model);\n _this.gObject.setPosition(_this.getCoords(coords));\n return _this.gObject.setVisible(_this.validateCoords(coords));\n };\n })(this));\n };\n\n MarkerChildModel.prototype.setOptions = function(scope, doDraw) {\n var ref;\n if (doDraw == null) {\n doDraw = true;\n }\n if (this.isNotValid(scope, false)) {\n return;\n }\n this.renderGMarker(doDraw, (function(_this) {\n return function() {\n var _options, coords, icon;\n coords = _this.getProp('coords', scope, _this.model);\n icon = _this.getProp('icon', scope, _this.model);\n _options = _this.getProp('options', scope, _this.model);\n _this.opts = _this.createOptions(coords, icon, _options);\n if (_this.isLabel(_this.gObject) !== _this.isLabel(_this.opts) && (_this.gObject != null)) {\n _this.gManager.remove(_this.gObject);\n _this.gObject = void 0;\n }\n if (_this.gObject != null) {\n _this.gObject.setOptions(_this.setLabelOptions(_this.opts));\n }\n if (!_this.gObject) {\n if (_this.isLabel(_this.opts)) {\n _this.gObject = new MarkerWithLabel(_this.setLabelOptions(_this.opts));\n } else if (_this.opts.content) {\n _this.gObject = new RichMarker(_this.opts);\n _this.gObject.getIcon = _this.gObject.getContent;\n _this.gObject.setIcon = _this.gObject.setContent;\n } else {\n _this.gObject = new google.maps.Marker(_this.opts);\n }\n _.extend(_this.gObject, {\n model: _this.model\n });\n }\n if (_this.externalListeners) {\n _this.removeEvents(_this.externalListeners);\n }\n if (_this.internalListeners) {\n _this.removeEvents(_this.internalListeners);\n }\n _this.externalListeners = _this.setEvents(_this.gObject, _this.scope, _this.model, ['dragend']);\n _this.internalListeners = _this.setEvents(_this.gObject, {\n events: _this.internalEvents(),\n $evalAsync: function() {}\n }, _this.model);\n if (_this.id != null) {\n return _this.gObject.key = _this.id;\n }\n };\n })(this));\n if (this.gObject && (this.gObject.getMap() || this.gManager.type !== MarkerManager.type)) {\n this.deferred.resolve(this.gObject);\n } else {\n if (!this.gObject) {\n return this.deferred.reject('gObject is null');\n }\n if (!(((ref = this.gObject) != null ? ref.getMap() : void 0) && this.gManager.type === MarkerManager.type)) {\n $log.debug('gObject has no map yet');\n this.deferred.resolve(this.gObject);\n }\n }\n if (this.model[this.fitKey]) {\n return this.gManager.fit();\n }\n };\n\n MarkerChildModel.prototype.setLabelOptions = function(opts) {\n if (opts.labelAnchor) {\n opts.labelAnchor = this.getLabelPositionPoint(opts.labelAnchor);\n }\n return opts;\n };\n\n MarkerChildModel.prototype.internalEvents = function() {\n return {\n dragend: (function(_this) {\n return function(marker, eventName, model, mousearg) {\n var events, modelToSet, newCoords;\n modelToSet = _this.trackModel ? _this.scope.model : _this.model;\n newCoords = _this.setCoordsFromEvent(_this.modelOrKey(modelToSet, _this.coordsKey), _this.gObject.getPosition());\n modelToSet = _this.setVal(model, _this.coordsKey, newCoords);\n events = _this.scope.events;\n if ((events != null ? events.dragend : void 0) != null) {\n events.dragend(marker, eventName, modelToSet, mousearg);\n }\n return _this.scope.$apply();\n };\n })(this),\n click: (function(_this) {\n return function(marker, eventName, model, mousearg) {\n var click;\n click = _this.getProp('click', _this.scope, _this.model);\n if (_this.doClick && angular.isFunction(click)) {\n return _this.scope.$evalAsync(click(marker, eventName, _this.model, mousearg));\n }\n };\n })(this)\n };\n };\n\n return MarkerChildModel;\n\n })(ModelKey);\n return MarkerChildModel;\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolygonChildModel', [\n 'uiGmapBasePolyChildModel', 'uiGmapPolygonOptionsBuilder', function(BaseGen, Builder) {\n var PolygonChildModel, base, gFactory;\n gFactory = function(opts) {\n return new google.maps.Polygon(opts);\n };\n base = new BaseGen(Builder, gFactory);\n return PolygonChildModel = (function(superClass) {\n extend(PolygonChildModel, superClass);\n\n function PolygonChildModel() {\n return PolygonChildModel.__super__.constructor.apply(this, arguments);\n }\n\n return PolygonChildModel;\n\n })(base);\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolylineChildModel', [\n 'uiGmapBasePolyChildModel', 'uiGmapPolylineOptionsBuilder', function(BaseGen, Builder) {\n var PolylineChildModel, base, gFactory;\n gFactory = function(opts) {\n return new google.maps.Polyline(opts);\n };\n base = BaseGen(Builder, gFactory);\n return PolylineChildModel = (function(superClass) {\n extend(PolylineChildModel, superClass);\n\n function PolylineChildModel() {\n return PolylineChildModel.__super__.constructor.apply(this, arguments);\n }\n\n return PolylineChildModel;\n\n })(base);\n }\n ]);\n\n}).call(this);\n;\n/*global _:true,angular:true,google:true */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.child').factory('uiGmapWindowChildModel', [\n 'uiGmapBaseObject', 'uiGmapGmapUtil', 'uiGmapLogger', '$compile', '$http', '$templateCache', 'uiGmapChromeFixes', 'uiGmapEventsHelper', function(BaseObject, GmapUtil, $log, $compile, $http, $templateCache, ChromeFixes, EventsHelper) {\n var WindowChildModel;\n WindowChildModel = (function(superClass) {\n extend(WindowChildModel, superClass);\n\n WindowChildModel.include(GmapUtil);\n\n WindowChildModel.include(EventsHelper);\n\n function WindowChildModel(opts) {\n this.updateModel = bind(this.updateModel, this);\n this.destroy = bind(this.destroy, this);\n this.remove = bind(this.remove, this);\n this.getLatestPosition = bind(this.getLatestPosition, this);\n this.hideWindow = bind(this.hideWindow, this);\n this.showWindow = bind(this.showWindow, this);\n this.handleClick = bind(this.handleClick, this);\n this.watchOptions = bind(this.watchOptions, this);\n this.watchCoords = bind(this.watchCoords, this);\n this.createGWin = bind(this.createGWin, this);\n this.watchElement = bind(this.watchElement, this);\n this.watchAndDoShow = bind(this.watchAndDoShow, this);\n this.doShow = bind(this.doShow, this);\n var maybeMarker, ref, ref1, ref2, ref3;\n this.model = (ref = opts.model) != null ? ref : {}, this.scope = opts.scope, this.opts = opts.opts, this.isIconVisibleOnClick = opts.isIconVisibleOnClick, this.gMap = opts.gMap, this.markerScope = opts.markerScope, this.element = opts.element, this.needToManualDestroy = (ref1 = opts.needToManualDestroy) != null ? ref1 : false, this.markerIsVisibleAfterWindowClose = (ref2 = opts.markerIsVisibleAfterWindowClose) != null ? ref2 : true, this.isScopeModel = (ref3 = opts.isScopeModel) != null ? ref3 : false;\n if (this.isScopeModel) {\n this.clonedModel = _.clone(this.model, true);\n }\n this.getGmarker = function() {\n var ref4, ref5;\n if (((ref4 = this.markerScope) != null ? ref4['getGMarker'] : void 0) != null) {\n return (ref5 = this.markerScope) != null ? ref5.getGMarker() : void 0;\n }\n };\n this.listeners = [];\n this.createGWin();\n maybeMarker = this.getGmarker();\n if (maybeMarker != null) {\n maybeMarker.setClickable(true);\n }\n this.watchElement();\n this.watchOptions();\n this.watchCoords();\n this.watchAndDoShow();\n this.scope.$on('$destroy', (function(_this) {\n return function() {\n return _this.destroy();\n };\n })(this));\n $log.info(this);\n }\n\n WindowChildModel.prototype.doShow = function(wasOpen) {\n if (this.scope.show === true || wasOpen) {\n return this.showWindow();\n } else {\n return this.hideWindow();\n }\n };\n\n WindowChildModel.prototype.watchAndDoShow = function() {\n if (this.model.show != null) {\n this.scope.show = this.model.show;\n }\n this.scope.$watch('show', this.doShow, true);\n return this.doShow();\n };\n\n WindowChildModel.prototype.watchElement = function() {\n return this.scope.$watch((function(_this) {\n return function() {\n var ref, wasOpen;\n if (!(_this.element || _this.html)) {\n return;\n }\n if (_this.html !== _this.element.html() && _this.gObject) {\n if ((ref = _this.opts) != null) {\n ref.content = void 0;\n }\n wasOpen = _this.gObject.isOpen();\n _this.remove();\n return _this.createGWin(wasOpen);\n }\n };\n })(this));\n };\n\n WindowChildModel.prototype.createGWin = function(isOpen) {\n var _opts, defaults, maybeMarker, ref, ref1;\n if (isOpen == null) {\n isOpen = false;\n }\n maybeMarker = this.getGmarker();\n defaults = {};\n if (this.opts != null) {\n if (this.scope.coords) {\n this.opts.position = this.getCoords(this.scope.coords);\n }\n defaults = this.opts;\n }\n if (this.element) {\n this.html = _.isObject(this.element) ? this.element.html() : this.element;\n }\n _opts = this.scope.options ? this.scope.options : defaults;\n this.opts = this.createWindowOptions(maybeMarker, this.markerScope || this.scope, this.html, _opts);\n if (this.opts != null) {\n if (!this.gObject) {\n if (this.opts.boxClass && (window.InfoBox && typeof window.InfoBox === 'function')) {\n this.gObject = new window.InfoBox(this.opts);\n } else {\n this.gObject = new google.maps.InfoWindow(this.opts);\n }\n this.listeners.push(google.maps.event.addListener(this.gObject, 'domready', function() {\n return ChromeFixes.maybeRepaint(this.content);\n }));\n this.listeners.push(google.maps.event.addListener(this.gObject, 'closeclick', (function(_this) {\n return function() {\n if (maybeMarker) {\n maybeMarker.setAnimation(_this.oldMarkerAnimation);\n if (_this.markerIsVisibleAfterWindowClose) {\n _.delay(function() {\n maybeMarker.setVisible(false);\n return maybeMarker.setVisible(_this.markerIsVisibleAfterWindowClose);\n }, 250);\n }\n }\n _this.gObject.close();\n _this.model.show = false;\n if (_this.scope.closeClick != null) {\n return _this.scope.$evalAsync(_this.scope.closeClick());\n } else {\n return _this.scope.$evalAsync();\n }\n };\n })(this)));\n }\n this.gObject.setContent(this.opts.content);\n this.handleClick(((ref = this.scope) != null ? (ref1 = ref.options) != null ? ref1.forceClick : void 0 : void 0) || isOpen);\n return this.doShow(this.gObject.isOpen());\n }\n };\n\n WindowChildModel.prototype.watchCoords = function() {\n var scope;\n scope = this.markerScope != null ? this.markerScope : this.scope;\n return scope.$watch('coords', (function(_this) {\n return function(newValue, oldValue) {\n var pos;\n if (newValue !== oldValue) {\n if (newValue == null) {\n _this.hideWindow();\n } else if (!_this.validateCoords(newValue)) {\n $log.error(\"WindowChildMarker cannot render marker as scope.coords as no position on marker: \" + (JSON.stringify(_this.model)));\n return;\n }\n pos = _this.getCoords(newValue);\n _this.doShow();\n _this.gObject.setPosition(pos);\n if (_this.opts) {\n return _this.opts.position = pos;\n }\n }\n };\n })(this), true);\n };\n\n WindowChildModel.prototype.watchOptions = function() {\n return this.scope.$watch('options', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n _this.opts = newValue;\n if (_this.gObject != null) {\n _this.gObject.setOptions(_this.opts);\n if ((_this.opts.visible != null) && _this.opts.visible) {\n return _this.showWindow();\n } else if (_this.opts.visible != null) {\n return _this.hideWindow();\n }\n }\n }\n };\n })(this), true);\n };\n\n WindowChildModel.prototype.handleClick = function(forceClick) {\n var click, maybeMarker;\n if (this.gObject == null) {\n return;\n }\n maybeMarker = this.getGmarker();\n click = (function(_this) {\n return function() {\n if (_this.gObject == null) {\n _this.createGWin();\n }\n _this.showWindow();\n if (maybeMarker != null) {\n _this.initialMarkerVisibility = maybeMarker.getVisible();\n _this.oldMarkerAnimation = maybeMarker.getAnimation();\n return maybeMarker.setVisible(_this.isIconVisibleOnClick);\n }\n };\n })(this);\n if (forceClick) {\n click();\n }\n if (maybeMarker) {\n return this.listeners = this.listeners.concat(this.setEvents(maybeMarker, {\n events: {\n click: click\n }\n }, this.model));\n }\n };\n\n WindowChildModel.prototype.showWindow = function() {\n var compiled, show, templateScope;\n if (this.gObject == null) {\n return;\n }\n templateScope = null;\n show = (function(_this) {\n return function() {\n var isOpen, maybeMarker, pos;\n if (!_this.gObject.isOpen()) {\n maybeMarker = _this.getGmarker();\n if ((_this.gObject != null) && (_this.gObject.getPosition != null)) {\n pos = _this.gObject.getPosition();\n }\n if (maybeMarker) {\n pos = maybeMarker.getPosition();\n }\n if (!pos) {\n return;\n }\n _this.gObject.open(_this.gMap, maybeMarker);\n isOpen = _this.gObject.isOpen();\n if (_this.model.show !== isOpen) {\n return _this.model.show = isOpen;\n }\n }\n };\n })(this);\n if (this.scope.templateUrl) {\n $http.get(this.scope.templateUrl, {\n cache: $templateCache\n }).then((function(_this) {\n return function(content) {\n var compiled;\n templateScope = _this.scope.$new();\n if (angular.isDefined(_this.scope.templateParameter)) {\n templateScope.parameter = _this.scope.templateParameter;\n }\n compiled = $compile(content.data)(templateScope);\n _this.gObject.setContent(compiled[0]);\n return show();\n };\n })(this));\n } else if (this.scope.template) {\n templateScope = this.scope.$new();\n if (angular.isDefined(this.scope.templateParameter)) {\n templateScope.parameter = this.scope.templateParameter;\n }\n compiled = $compile(this.scope.template)(templateScope);\n this.gObject.setContent(compiled[0]);\n show();\n } else {\n show();\n }\n return this.scope.$on('destroy', function() {\n return templateScope.$destroy();\n });\n };\n\n WindowChildModel.prototype.hideWindow = function() {\n if ((this.gObject != null) && this.gObject.isOpen()) {\n return this.gObject.close();\n }\n };\n\n WindowChildModel.prototype.getLatestPosition = function(overridePos) {\n var maybeMarker;\n maybeMarker = this.getGmarker();\n if ((this.gObject != null) && (maybeMarker != null) && !overridePos) {\n return this.gObject.setPosition(maybeMarker.getPosition());\n } else {\n if (overridePos) {\n return this.gObject.setPosition(overridePos);\n }\n }\n };\n\n WindowChildModel.prototype.remove = function() {\n this.hideWindow();\n this.removeEvents(this.listeners);\n this.listeners.length = 0;\n delete this.gObject;\n return delete this.opts;\n };\n\n WindowChildModel.prototype.destroy = function(manualOverride) {\n var ref;\n if (manualOverride == null) {\n manualOverride = false;\n }\n this.remove();\n if (((this.scope != null) && !((ref = this.scope) != null ? ref.$$destroyed : void 0)) && (this.needToManualDestroy || manualOverride)) {\n return this.scope.$destroy();\n }\n };\n\n WindowChildModel.prototype.updateModel = function(model) {\n if (this.isScopeModel) {\n this.clonedModel = _.clone(model, true);\n }\n return _.extend(this.model, this.clonedModel || model);\n };\n\n return WindowChildModel;\n\n })(BaseObject);\n return WindowChildModel;\n }\n ]);\n\n}).call(this);\n;\n/*global _, angular */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapBasePolysParentModel', [\n '$timeout', 'uiGmapLogger', 'uiGmapModelKey', 'uiGmapModelsWatcher', 'uiGmapPropMap', 'uiGmap_async', 'uiGmapPromise', 'uiGmapFitHelper', function($timeout, $log, ModelKey, ModelsWatcher, PropMap, _async, uiGmapPromise, FitHelper) {\n return function(IPoly, PolyChildModel, gObjectName) {\n var BasePolysParentModel;\n return BasePolysParentModel = (function(superClass) {\n extend(BasePolysParentModel, superClass);\n\n BasePolysParentModel.include(ModelsWatcher);\n\n function BasePolysParentModel(scope, element, attrs, gMap1, defaults) {\n this.element = element;\n this.attrs = attrs;\n this.gMap = gMap1;\n this.defaults = defaults;\n this.maybeFit = bind(this.maybeFit, this);\n this.createChild = bind(this.createChild, this);\n this.pieceMeal = bind(this.pieceMeal, this);\n this.createAllNew = bind(this.createAllNew, this);\n this.watchIdKey = bind(this.watchIdKey, this);\n this.createChildScopes = bind(this.createChildScopes, this);\n this.watchDestroy = bind(this.watchDestroy, this);\n this.onDestroy = bind(this.onDestroy, this);\n this.rebuildAll = bind(this.rebuildAll, this);\n this.doINeedToWipe = bind(this.doINeedToWipe, this);\n this.watchModels = bind(this.watchModels, this);\n BasePolysParentModel.__super__.constructor.call(this, scope);\n this[\"interface\"] = IPoly;\n this.$log = $log;\n this.plurals = new PropMap();\n _.each(IPoly.scopeKeys, (function(_this) {\n return function(name) {\n return _this[name + 'Key'] = void 0;\n };\n })(this));\n this.models = void 0;\n this.firstTime = true;\n this.$log.info(this);\n this.createChildScopes();\n }\n\n BasePolysParentModel.prototype.watchModels = function(scope) {\n\n /*\n This was watchCollection but not all model changes were being caught.\n TODO: Make the directive flexible in overriding whether we watch models (and depth) via watch or watchColleciton.\n */\n return scope.$watch('models', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n if (_this.doINeedToWipe(newValue) || scope.doRebuildAll) {\n return _this.rebuildAll(scope, true, true);\n } else {\n return _this.createChildScopes(false);\n }\n }\n };\n })(this), true);\n };\n\n BasePolysParentModel.prototype.doINeedToWipe = function(newValue) {\n var newValueIsEmpty;\n newValueIsEmpty = newValue != null ? newValue.length === 0 : true;\n return this.plurals.length > 0 && newValueIsEmpty;\n };\n\n BasePolysParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) {\n return this.onDestroy(doDelete).then((function(_this) {\n return function() {\n if (doCreate) {\n return _this.createChildScopes();\n }\n };\n })(this));\n };\n\n BasePolysParentModel.prototype.onDestroy = function() {\n BasePolysParentModel.__super__.onDestroy.call(this, this.scope);\n return _async.promiseLock(this, uiGmapPromise.promiseTypes[\"delete\"], void 0, void 0, (function(_this) {\n return function() {\n return _async.each(_this.plurals.values(), function(child) {\n return child.destroy(true);\n }, _async.chunkSizeFrom(_this.scope.cleanchunk, false)).then(function() {\n var ref;\n return (ref = _this.plurals) != null ? ref.removeAll() : void 0;\n });\n };\n })(this));\n };\n\n BasePolysParentModel.prototype.watchDestroy = function(scope) {\n return scope.$on('$destroy', (function(_this) {\n return function() {\n return _this.rebuildAll(scope, false, true);\n };\n })(this));\n };\n\n BasePolysParentModel.prototype.createChildScopes = function(isCreatingFromScratch) {\n if (isCreatingFromScratch == null) {\n isCreatingFromScratch = true;\n }\n if (angular.isUndefined(this.scope.models)) {\n this.$log.error(\"No models to create \" + gObjectName + \"s from! I Need direct models!\");\n return;\n }\n if ((this.gMap == null) || (this.scope.models == null)) {\n return;\n }\n this.watchIdKey(this.scope);\n if (isCreatingFromScratch) {\n return this.createAllNew(this.scope, false);\n } else {\n return this.pieceMeal(this.scope, false);\n }\n };\n\n BasePolysParentModel.prototype.watchIdKey = function(scope) {\n this.setIdKey(scope);\n return scope.$watch('idKey', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue && (newValue == null)) {\n _this.idKey = newValue;\n return _this.rebuildAll(scope, true, true);\n }\n };\n })(this));\n };\n\n BasePolysParentModel.prototype.createAllNew = function(scope, isArray) {\n var maybeCanceled;\n if (isArray == null) {\n isArray = false;\n }\n this.models = scope.models;\n if (this.firstTime) {\n this.watchModels(scope);\n this.watchDestroy(scope);\n }\n if (this.didQueueInitPromise(this, scope)) {\n return;\n }\n maybeCanceled = null;\n return _async.promiseLock(this, uiGmapPromise.promiseTypes.create, 'createAllNew', (function(canceledMsg) {\n return maybeCanceled = canceledMsg;\n }), (function(_this) {\n return function() {\n return _async.map(scope.models, function(model) {\n var child;\n child = _this.createChild(model, _this.gMap);\n if (maybeCanceled) {\n $log.debug('createNew should fall through safely');\n child.isEnabled = false;\n }\n maybeCanceled;\n return child.pathPoints.getArray();\n }, _async.chunkSizeFrom(scope.chunk)).then(function(pathPoints) {\n _this.maybeFit(pathPoints);\n return _this.firstTime = false;\n });\n };\n })(this));\n };\n\n BasePolysParentModel.prototype.pieceMeal = function(scope, isArray) {\n var maybeCanceled, payload;\n if (isArray == null) {\n isArray = true;\n }\n if (scope.$$destroyed) {\n return;\n }\n maybeCanceled = null;\n payload = null;\n this.models = scope.models;\n if ((scope != null) && this.modelsLength() && this.plurals.length) {\n return _async.promiseLock(this, uiGmapPromise.promiseTypes.update, 'pieceMeal', (function(canceledMsg) {\n return maybeCanceled = canceledMsg;\n }), (function(_this) {\n return function() {\n return uiGmapPromise.promise(function() {\n return _this.figureOutState(_this.idKey, scope, _this.plurals, _this.modelKeyComparison);\n }).then(function(state) {\n payload = state;\n if (payload.updates.length) {\n _async.each(payload.updates, function(obj) {\n _.extend(obj.child.scope, obj.model);\n return obj.child.model = obj.model;\n });\n }\n return _async.each(payload.removals, function(child) {\n if (child != null) {\n child.destroy();\n _this.plurals.remove(child.model[_this.idKey]);\n return maybeCanceled;\n }\n }, _async.chunkSizeFrom(scope.chunk));\n }).then(function() {\n return _async.each(payload.adds, function(modelToAdd) {\n if (maybeCanceled) {\n $log.debug('pieceMeal should fall through safely');\n }\n _this.createChild(modelToAdd, _this.gMap);\n return maybeCanceled;\n }, _async.chunkSizeFrom(scope.chunk)).then(function() {\n return _this.maybeFit();\n });\n });\n };\n })(this));\n } else {\n this.inProgress = false;\n return this.rebuildAll(this.scope, true, true);\n }\n };\n\n BasePolysParentModel.prototype.createChild = function(model, gMap) {\n var child, childScope;\n childScope = this.scope.$new(false);\n this.setChildScope(IPoly.scopeKeys, childScope, model);\n childScope.$watch('model', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.setChildScope(childScope, newValue);\n }\n };\n })(this), true);\n childScope[\"static\"] = this.scope[\"static\"];\n child = new PolyChildModel({\n isScopeModel: true,\n scope: childScope,\n attrs: this.attrs,\n gMap: gMap,\n defaults: this.defaults,\n model: model,\n gObjectChangeCb: (function(_this) {\n return function() {\n return _this.maybeFit();\n };\n })(this)\n });\n if (model[this.idKey] == null) {\n this.$log.error(gObjectName + \" model has no id to assign a child to.\\nThis is required for performance. Please assign id,\\nor redirect id to a different key.\");\n return;\n }\n this.plurals.put(model[this.idKey], child);\n return child;\n };\n\n BasePolysParentModel.prototype.maybeFit = function(pathPoints) {\n if (pathPoints == null) {\n pathPoints = this.plurals.map(function(p) {\n return p.pathPoints;\n });\n }\n if (this.scope.fit) {\n pathPoints = _.flatten(pathPoints);\n return FitHelper.fit(pathPoints, this.gMap);\n }\n };\n\n return BasePolysParentModel;\n\n })(ModelKey);\n };\n }\n ]);\n\n}).call(this);\n;\n/*globals angular, _, google */\n\n(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapCircleParentModel', [\n 'uiGmapLogger', '$timeout', 'uiGmapGmapUtil', 'uiGmapEventsHelper', 'uiGmapCircleOptionsBuilder', function($log, $timeout, GmapUtil, EventsHelper, Builder) {\n var CircleParentModel, _settingFromDirective;\n _settingFromDirective = function(scope, fn) {\n scope.settingFromDirective = true;\n fn();\n return $timeout(function() {\n return scope.settingFromDirective = false;\n });\n };\n return CircleParentModel = (function(superClass) {\n extend(CircleParentModel, superClass);\n\n CircleParentModel.include(GmapUtil);\n\n CircleParentModel.include(EventsHelper);\n\n function CircleParentModel(scope, element, attrs, gMap, DEFAULTS) {\n var clean, gObject, lastRadius;\n this.attrs = attrs;\n this.gMap = gMap;\n this.DEFAULTS = DEFAULTS;\n this.scope = scope;\n lastRadius = null;\n clean = (function(_this) {\n return function() {\n lastRadius = null;\n if (_this.listeners != null) {\n _this.removeEvents(_this.listeners);\n return _this.listeners = void 0;\n }\n };\n })(this);\n gObject = new google.maps.Circle(this.buildOpts(GmapUtil.getCoords(scope.center), scope.radius));\n this.setMyOptions = (function(_this) {\n return function(newVals, oldVals) {\n if (scope.settingFromDirective) {\n return;\n }\n if (!(_.isEqual(newVals, oldVals) && newVals === oldVals && ((newVals != null) && (oldVals != null) ? newVals.coordinates === oldVals.coordinates : true))) {\n return gObject.setOptions(_this.buildOpts(GmapUtil.getCoords(scope.center), scope.radius));\n }\n };\n })(this);\n this.props = this.props.concat([\n {\n prop: 'center',\n isColl: true\n }, {\n prop: 'fill',\n isColl: true\n }, 'radius', 'zIndex'\n ]);\n this.watchProps();\n if (this.scope.control != null) {\n this.scope.control.getCircle = function() {\n return gObject;\n };\n }\n clean();\n this.listeners = this.setEvents(gObject, scope, scope, ['radius_changed']) || [];\n this.listeners.push(google.maps.event.addListener(gObject, 'radius_changed', function() {\n\n /*\n possible google bug, and or because a circle has two radii\n radius_changed appears to fire twice (original and new) which is not too helpful\n therefore we will check for radius changes manually and bail out if nothing has changed\n */\n var newRadius, work;\n newRadius = gObject.getRadius();\n if (newRadius === lastRadius) {\n return;\n }\n lastRadius = newRadius;\n work = function() {\n return _settingFromDirective(scope, function() {\n var ref, ref1;\n if (newRadius !== scope.radius) {\n scope.radius = newRadius;\n }\n if (((ref = scope.events) != null ? ref.radius_changed : void 0) && _.isFunction((ref1 = scope.events) != null ? ref1.radius_changed : void 0)) {\n return scope.events.radius_changed(gObject, 'radius_changed', scope, arguments);\n }\n });\n };\n if (!angular.mock) {\n return scope.$evalAsync(function() {\n return work();\n });\n } else {\n return work();\n }\n }));\n this.listeners.push(google.maps.event.addListener(gObject, 'center_changed', function() {\n return scope.$evalAsync(function() {\n return _settingFromDirective(scope, function() {\n if (angular.isDefined(scope.center.type)) {\n scope.center.coordinates[1] = gObject.getCenter().lat();\n return scope.center.coordinates[0] = gObject.getCenter().lng();\n } else {\n scope.center.latitude = gObject.getCenter().lat();\n return scope.center.longitude = gObject.getCenter().lng();\n }\n });\n });\n }));\n scope.$on('$destroy', function() {\n clean();\n return gObject.setMap(null);\n });\n $log.info(this);\n }\n\n return CircleParentModel;\n\n })(Builder);\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapDrawingManagerParentModel', [\n 'uiGmapLogger', '$timeout', 'uiGmapBaseObject', 'uiGmapEventsHelper', function($log, $timeout, BaseObject, EventsHelper) {\n var DrawingManagerParentModel;\n return DrawingManagerParentModel = (function(superClass) {\n extend(DrawingManagerParentModel, superClass);\n\n DrawingManagerParentModel.include(EventsHelper);\n\n function DrawingManagerParentModel(scope, element, attrs, map) {\n var gObject, listeners;\n this.scope = scope;\n this.attrs = attrs;\n this.map = map;\n gObject = new google.maps.drawing.DrawingManager(this.scope.options);\n gObject.setMap(this.map);\n listeners = void 0;\n if (this.scope.control != null) {\n this.scope.control.getDrawingManager = function() {\n return gObject;\n };\n }\n if (!this.scope[\"static\"] && this.scope.options) {\n this.scope.$watch('options', function(newValue) {\n return gObject != null ? gObject.setOptions(newValue) : void 0;\n }, true);\n }\n if (this.scope.events != null) {\n listeners = this.setEvents(gObject, this.scope, this.scope);\n this.scope.$watch('events', (function(_this) {\n return function(newValue, oldValue) {\n if (!_.isEqual(newValue, oldValue)) {\n if (listeners != null) {\n _this.removeEvents(listeners);\n }\n return listeners = _this.setEvents(gObject, _this.scope, _this.scope);\n }\n };\n })(this));\n }\n this.scope.$on('$destroy', (function(_this) {\n return function() {\n if (listeners != null) {\n _this.removeEvents(listeners);\n }\n gObject.setMap(null);\n return gObject = null;\n };\n })(this));\n }\n\n return DrawingManagerParentModel;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;\n/*\n\t- interface for all markers to derrive from\n \t- to enforce a minimum set of requirements\n \t\t- attributes\n \t\t\t- coords\n \t\t\t- icon\n\t\t- implementation needed on watches\n */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api.models.parent\").factory(\"uiGmapIMarkerParentModel\", [\n \"uiGmapModelKey\", \"uiGmapLogger\", function(ModelKey, Logger) {\n var IMarkerParentModel;\n IMarkerParentModel = (function(superClass) {\n extend(IMarkerParentModel, superClass);\n\n IMarkerParentModel.prototype.DEFAULTS = {};\n\n function IMarkerParentModel(scope1, element, attrs, map) {\n this.scope = scope1;\n this.element = element;\n this.attrs = attrs;\n this.map = map;\n this.onWatch = bind(this.onWatch, this);\n this.watch = bind(this.watch, this);\n this.validateScope = bind(this.validateScope, this);\n IMarkerParentModel.__super__.constructor.call(this, this.scope);\n this.$log = Logger;\n if (!this.validateScope(this.scope)) {\n throw new String(\"Unable to construct IMarkerParentModel due to invalid scope\");\n }\n this.doClick = angular.isDefined(this.attrs.click);\n if (this.scope.options != null) {\n this.DEFAULTS = this.scope.options;\n }\n this.watch('coords', this.scope);\n this.watch('icon', this.scope);\n this.watch('options', this.scope);\n this.scope.$on(\"$destroy\", (function(_this) {\n return function() {\n return _this.onDestroy(_this.scope);\n };\n })(this));\n }\n\n IMarkerParentModel.prototype.validateScope = function(scope) {\n var ret;\n if (scope == null) {\n this.$log.error(this.constructor.name + \": invalid scope used\");\n return false;\n }\n ret = scope.coords != null;\n if (!ret) {\n this.$log.error(this.constructor.name + \": no valid coords attribute found\");\n return false;\n }\n return ret;\n };\n\n IMarkerParentModel.prototype.watch = function(propNameToWatch, scope, equalityCheck) {\n if (equalityCheck == null) {\n equalityCheck = true;\n }\n return scope.$watch(propNameToWatch, (function(_this) {\n return function(newValue, oldValue) {\n if (!_.isEqual(newValue, oldValue)) {\n return _this.onWatch(propNameToWatch, scope, newValue, oldValue);\n }\n };\n })(this), equalityCheck);\n };\n\n IMarkerParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) {};\n\n return IMarkerParentModel;\n\n })(ModelKey);\n return IMarkerParentModel;\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api.models.parent\").factory(\"uiGmapIWindowParentModel\", [\n \"uiGmapModelKey\", \"uiGmapGmapUtil\", \"uiGmapLogger\", function(ModelKey, GmapUtil, Logger) {\n var IWindowParentModel;\n return IWindowParentModel = (function(superClass) {\n extend(IWindowParentModel, superClass);\n\n IWindowParentModel.include(GmapUtil);\n\n function IWindowParentModel(scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache) {\n IWindowParentModel.__super__.constructor.call(this, scope);\n this.$log = Logger;\n this.$timeout = $timeout;\n this.$compile = $compile;\n this.$http = $http;\n this.$templateCache = $templateCache;\n this.DEFAULTS = {};\n if (scope.options != null) {\n this.DEFAULTS = scope.options;\n }\n }\n\n IWindowParentModel.prototype.getItem = function(scope, modelsPropToIterate, index) {\n if (modelsPropToIterate === 'models') {\n return scope[modelsPropToIterate][index];\n }\n return scope[modelsPropToIterate].get(index);\n };\n\n return IWindowParentModel;\n\n })(ModelKey);\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapLayerParentModel', [\n 'uiGmapBaseObject', 'uiGmapLogger', '$timeout', function(BaseObject, Logger, $timeout) {\n var LayerParentModel;\n LayerParentModel = (function(superClass) {\n extend(LayerParentModel, superClass);\n\n function LayerParentModel(scope, element, attrs, gMap, onLayerCreated, $log) {\n this.scope = scope;\n this.element = element;\n this.attrs = attrs;\n this.gMap = gMap;\n this.onLayerCreated = onLayerCreated != null ? onLayerCreated : void 0;\n this.$log = $log != null ? $log : Logger;\n this.createGoogleLayer = bind(this.createGoogleLayer, this);\n if (this.attrs.type == null) {\n this.$log.info('type attribute for the layer directive is mandatory. Layer creation aborted!!');\n return;\n }\n this.createGoogleLayer();\n this.doShow = true;\n if (angular.isDefined(this.attrs.show)) {\n this.doShow = this.scope.show;\n }\n if (this.doShow && (this.gMap != null)) {\n this.gObject.setMap(this.gMap);\n }\n this.scope.$watch('show', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n _this.doShow = newValue;\n if (newValue) {\n return _this.gObject.setMap(_this.gMap);\n } else {\n return _this.gObject.setMap(null);\n }\n }\n };\n })(this), true);\n this.scope.$watch('options', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue && _this.doShow) {\n return _this.gObject.setOptions(newValue);\n }\n };\n })(this), true);\n this.scope.$on('$destroy', (function(_this) {\n return function() {\n return _this.gObject.setMap(null);\n };\n })(this));\n }\n\n LayerParentModel.prototype.createGoogleLayer = function() {\n var base;\n if (this.attrs.options == null) {\n this.gObject = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type]() : new google.maps[this.attrs.namespace][this.attrs.type]();\n } else {\n this.gObject = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type](this.scope.options) : new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options);\n }\n if ((this.gObject != null) && this.doShow) {\n this.gObject.setMap(this.gMap);\n }\n if ((this.gObject != null) && (this.onLayerCreated != null)) {\n return typeof (base = this.onLayerCreated(this.scope, this.gObject)) === \"function\" ? base(this.gObject) : void 0;\n }\n };\n\n return LayerParentModel;\n\n })(BaseObject);\n return LayerParentModel;\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapMapTypeParentModel', [\n 'uiGmapBaseObject', 'uiGmapLogger', function(BaseObject, Logger) {\n var MapTypeParentModel;\n MapTypeParentModel = (function(superClass) {\n extend(MapTypeParentModel, superClass);\n\n function MapTypeParentModel(scope, element, attrs, gMap, $log) {\n this.scope = scope;\n this.element = element;\n this.attrs = attrs;\n this.gMap = gMap;\n this.$log = $log != null ? $log : Logger;\n this.hideOverlay = bind(this.hideOverlay, this);\n this.showOverlay = bind(this.showOverlay, this);\n this.refreshMapType = bind(this.refreshMapType, this);\n this.createMapType = bind(this.createMapType, this);\n if (this.attrs.options == null) {\n this.$log.info('options attribute for the map-type directive is mandatory. Map type creation aborted!!');\n return;\n }\n this.id = this.gMap.overlayMapTypesCount = this.gMap.overlayMapTypesCount + 1 || 0;\n this.doShow = true;\n this.createMapType();\n if (angular.isDefined(this.attrs.show)) {\n this.doShow = this.scope.show;\n }\n if (this.doShow && (this.gMap != null)) {\n this.showOverlay();\n }\n this.scope.$watch('show', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n _this.doShow = newValue;\n if (newValue) {\n return _this.showOverlay();\n } else {\n return _this.hideOverlay();\n }\n }\n };\n })(this), true);\n this.scope.$watchCollection('options', (function(_this) {\n return function(newValue, oldValue) {\n var different, mapTypeProps;\n if (!_.isEqual(newValue, oldValue)) {\n mapTypeProps = ['tileSize', 'maxZoom', 'minZoom', 'name', 'alt'];\n different = _.some(mapTypeProps, function(prop) {\n return !oldValue || !newValue || !_.isEqual(newValue[prop], oldValue[prop]);\n });\n if (different) {\n return _this.refreshMapType();\n }\n }\n };\n })(this));\n if (angular.isDefined(this.attrs.refresh)) {\n this.scope.$watch('refresh', (function(_this) {\n return function(newValue, oldValue) {\n if (!_.isEqual(newValue, oldValue)) {\n return _this.refreshMapType();\n }\n };\n })(this), true);\n }\n this.scope.$on('$destroy', (function(_this) {\n return function() {\n _this.hideOverlay();\n return _this.mapType = null;\n };\n })(this));\n }\n\n MapTypeParentModel.prototype.createMapType = function() {\n if (this.scope.options.getTile != null) {\n this.mapType = this.scope.options;\n } else if (this.scope.options.getTileUrl != null) {\n this.mapType = new google.maps.ImageMapType(this.scope.options);\n } else {\n this.$log.info('options should provide either getTile or getTileUrl methods. Map type creation aborted!!');\n return;\n }\n if (this.attrs.id && this.scope.id) {\n this.gMap.mapTypes.set(this.scope.id, this.mapType);\n if (!angular.isDefined(this.attrs.show)) {\n this.doShow = false;\n }\n }\n return this.mapType.layerId = this.id;\n };\n\n MapTypeParentModel.prototype.refreshMapType = function() {\n this.hideOverlay();\n this.mapType = null;\n this.createMapType();\n if (this.doShow && (this.gMap != null)) {\n return this.showOverlay();\n }\n };\n\n MapTypeParentModel.prototype.showOverlay = function() {\n return this.gMap.overlayMapTypes.push(this.mapType);\n };\n\n MapTypeParentModel.prototype.hideOverlay = function() {\n var found;\n found = false;\n return this.gMap.overlayMapTypes.forEach((function(_this) {\n return function(mapType, index) {\n if (!found && mapType.layerId === _this.id) {\n found = true;\n _this.gMap.overlayMapTypes.removeAt(index);\n }\n };\n })(this));\n };\n\n return MapTypeParentModel;\n\n })(BaseObject);\n return MapTypeParentModel;\n }\n ]);\n\n}).call(this);\n;\n/*global _:true,angular:true, */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api.models.parent\").factory(\"uiGmapMarkersParentModel\", [\n \"uiGmapIMarkerParentModel\", \"uiGmapModelsWatcher\", \"uiGmapPropMap\", \"uiGmapMarkerChildModel\", \"uiGmap_async\", \"uiGmapClustererMarkerManager\", \"uiGmapMarkerManager\", \"$timeout\", \"uiGmapIMarker\", \"uiGmapPromise\", \"uiGmapGmapUtil\", \"uiGmapLogger\", \"uiGmapSpiderfierMarkerManager\", function(IMarkerParentModel, ModelsWatcher, PropMap, MarkerChildModel, _async, ClustererMarkerManager, MarkerManager, $timeout, IMarker, uiGmapPromise, GmapUtil, $log, SpiderfierMarkerManager) {\n var MarkersParentModel, _setPlurals;\n _setPlurals = function(val, objToSet) {\n objToSet.plurals = new PropMap();\n objToSet.scope.plurals = objToSet.plurals;\n return objToSet;\n };\n MarkersParentModel = (function(superClass) {\n extend(MarkersParentModel, superClass);\n\n MarkersParentModel.include(GmapUtil);\n\n MarkersParentModel.include(ModelsWatcher);\n\n function MarkersParentModel(scope, element, attrs, map) {\n this.maybeExecMappedEvent = bind(this.maybeExecMappedEvent, this);\n this.onDestroy = bind(this.onDestroy, this);\n this.newChildMarker = bind(this.newChildMarker, this);\n this.pieceMeal = bind(this.pieceMeal, this);\n this.rebuildAll = bind(this.rebuildAll, this);\n this.createAllNew = bind(this.createAllNew, this);\n this.bindToTypeEvents = bind(this.bindToTypeEvents, this);\n this.createChildScopes = bind(this.createChildScopes, this);\n this.validateScope = bind(this.validateScope, this);\n this.onWatch = bind(this.onWatch, this);\n MarkersParentModel.__super__.constructor.call(this, scope, element, attrs, map);\n this[\"interface\"] = IMarker;\n _setPlurals(new PropMap(), this);\n this.scope.pluralsUpdate = {\n updateCtr: 0\n };\n this.$log.info(this);\n this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false;\n this.setIdKey(this.scope);\n this.scope.$watch('doRebuildAll', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.doRebuildAll = newValue;\n }\n };\n })(this));\n if (!this.modelsLength()) {\n this.modelsRendered = false;\n }\n this.scope.$watch('models', (function(_this) {\n return function(newValue, oldValue) {\n if (!_.isEqual(newValue, oldValue) || !_this.modelsRendered) {\n if (newValue.length === 0 && oldValue.length === 0) {\n return;\n }\n _this.modelsRendered = true;\n return _this.onWatch('models', _this.scope, newValue, oldValue);\n }\n };\n })(this), !this.isTrue(attrs.modelsbyref));\n this.watch('doCluster', this.scope);\n this.watch('type', this.scope);\n this.watch('clusterOptions', this.scope);\n this.watch('clusterEvents', this.scope);\n this.watch('typeOptions', this.scope);\n this.watch('typeEvents', this.scope);\n this.watch('fit', this.scope);\n this.watch('idKey', this.scope);\n this.gManager = void 0;\n this.createAllNew(this.scope);\n }\n\n MarkersParentModel.prototype.onWatch = function(propNameToWatch, scope, newValue, oldValue) {\n if (propNameToWatch === \"idKey\" && newValue !== oldValue) {\n this.idKey = newValue;\n }\n if (this.doRebuildAll || (propNameToWatch === 'doCluster' || propNameToWatch === 'type')) {\n return this.rebuildAll(scope);\n } else {\n return this.pieceMeal(scope);\n }\n };\n\n MarkersParentModel.prototype.validateScope = function(scope) {\n var modelsNotDefined;\n modelsNotDefined = angular.isUndefined(scope.models) || scope.models === void 0;\n if (modelsNotDefined) {\n this.$log.error(this.constructor.name + \": no valid models attribute found\");\n }\n return MarkersParentModel.__super__.validateScope.call(this, scope) || modelsNotDefined;\n };\n\n\n /*\n Not used internally by this parent\n created for consistency for external control in the API\n */\n\n MarkersParentModel.prototype.createChildScopes = function(isCreatingFromScratch) {\n if ((this.gMap == null) || (this.scope.models == null)) {\n return;\n }\n if (isCreatingFromScratch) {\n return this.createAllNew(this.scope, false);\n } else {\n return this.pieceMeal(this.scope, false);\n }\n };\n\n MarkersParentModel.prototype.bindToTypeEvents = function(typeEvents, events) {\n var internalHandles, self;\n if (events == null) {\n events = ['click', 'mouseout', 'mouseover'];\n }\n\n /*\n You should only be binding to events that produce groups/clusters of somthing.\n Otherwise use the orginal event handle.\n For Example: Click on a cluster pushes a cluster/group obj through which has getMarkers\n However Spiderfy's click is for a single marker so this is not ideal for that.\n */\n self = this;\n if (!this.origTypeEvents) {\n this.origTypeEvents = {};\n _.each(events, (function(_this) {\n return function(eventName) {\n return _this.origTypeEvents[eventName] = typeEvents != null ? typeEvents[eventName] : void 0;\n };\n })(this));\n } else {\n angular.extend(typeEvents, this.origTypeEvents);\n }\n internalHandles = {};\n _.each(events, function(eventName) {\n return internalHandles[eventName] = function(group) {\n return self.maybeExecMappedEvent(group, eventName);\n };\n });\n return angular.extend(typeEvents, internalHandles);\n };\n\n MarkersParentModel.prototype.createAllNew = function(scope) {\n var isSpiderfied, maybeCanceled, typeEvents, typeOptions;\n if (this.gManager != null) {\n if (this.gManager instanceof SpiderfierMarkerManager) {\n isSpiderfied = this.gManager.isSpiderfied();\n }\n this.gManager.clear();\n delete this.gManager;\n }\n typeEvents = scope.typeEvents || scope.clusterEvents;\n typeOptions = scope.typeOptions || scope.clusterOptions;\n if (scope.doCluster || scope.type === 'cluster') {\n if (typeEvents != null) {\n this.bindToTypeEvents(typeEvents);\n }\n this.gManager = new ClustererMarkerManager(this.map, void 0, typeOptions, typeEvents);\n } else if (scope.type === 'spider') {\n if (typeEvents != null) {\n this.bindToTypeEvents(typeEvents, ['spiderfy', 'unspiderfy']);\n }\n this.gManager = new SpiderfierMarkerManager(this.map, void 0, typeOptions, typeEvents, this.scope);\n if (isSpiderfied) {\n this.gManager.spiderfy();\n }\n } else {\n this.gManager = new MarkerManager(this.map);\n }\n if (this.didQueueInitPromise(this, scope)) {\n return;\n }\n maybeCanceled = null;\n return _async.promiseLock(this, uiGmapPromise.promiseTypes.create, 'createAllNew', (function(canceledMsg) {\n return maybeCanceled = canceledMsg;\n }), (function(_this) {\n return function() {\n return _async.each(scope.models, function(model) {\n _this.newChildMarker(model, scope);\n return maybeCanceled;\n }, _async.chunkSizeFrom(scope.chunk)).then(function() {\n _this.modelsRendered = true;\n if (scope.fit) {\n _this.gManager.fit();\n }\n _this.gManager.draw();\n return _this.scope.pluralsUpdate.updateCtr += 1;\n }, _async.chunkSizeFrom(scope.chunk));\n };\n })(this));\n };\n\n MarkersParentModel.prototype.rebuildAll = function(scope) {\n var ref;\n if (!scope.doRebuild && scope.doRebuild !== void 0) {\n return;\n }\n if ((ref = this.scope.plurals) != null ? ref.length : void 0) {\n return this.onDestroy(scope).then((function(_this) {\n return function() {\n return _this.createAllNew(scope);\n };\n })(this));\n } else {\n return this.createAllNew(scope);\n }\n };\n\n MarkersParentModel.prototype.pieceMeal = function(scope) {\n var maybeCanceled, payload;\n if (scope.$$destroyed) {\n return;\n }\n maybeCanceled = null;\n payload = null;\n if (this.modelsLength() && this.scope.plurals.length) {\n return _async.promiseLock(this, uiGmapPromise.promiseTypes.update, 'pieceMeal', (function(canceledMsg) {\n return maybeCanceled = canceledMsg;\n }), (function(_this) {\n return function() {\n return uiGmapPromise.promise((function() {\n return _this.figureOutState(_this.idKey, scope, _this.scope.plurals, _this.modelKeyComparison);\n })).then(function(state) {\n payload = state;\n return _async.each(payload.removals, function(child) {\n if (child != null) {\n if (child.destroy != null) {\n child.destroy();\n }\n _this.scope.plurals.remove(child.id);\n return maybeCanceled;\n }\n }, _async.chunkSizeFrom(scope.chunk));\n }).then(function() {\n return _async.each(payload.adds, function(modelToAdd) {\n _this.newChildMarker(modelToAdd, scope);\n return maybeCanceled;\n }, _async.chunkSizeFrom(scope.chunk));\n }).then(function() {\n return _async.each(payload.updates, function(update) {\n _this.updateChild(update.child, update.model);\n return maybeCanceled;\n }, _async.chunkSizeFrom(scope.chunk));\n }).then(function() {\n if (payload.adds.length > 0 || payload.removals.length > 0 || payload.updates.length > 0) {\n scope.plurals = _this.scope.plurals;\n if (scope.fit) {\n _this.gManager.fit();\n }\n _this.gManager.draw();\n }\n return _this.scope.pluralsUpdate.updateCtr += 1;\n });\n };\n })(this));\n } else {\n this.inProgress = false;\n return this.rebuildAll(scope);\n }\n };\n\n MarkersParentModel.prototype.newChildMarker = function(model, scope) {\n var child, childScope, keys;\n if (!model) {\n throw 'model undefined';\n }\n if (model[this.idKey] == null) {\n this.$log.error(\"Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.\");\n return;\n }\n this.$log.info('child', child, 'markers', this.scope.markerModels);\n childScope = scope.$new(false);\n childScope.events = scope.events;\n keys = {};\n IMarker.scopeKeys.forEach(function(k) {\n return keys[k] = scope[k];\n });\n child = new MarkerChildModel({\n scope: childScope,\n model: model,\n keys: keys,\n gMap: this.map,\n defaults: this.DEFAULTS,\n doClick: this.doClick,\n gManager: this.gManager,\n doDrawSelf: false,\n isScopeModel: true\n });\n this.scope.plurals.put(model[this.idKey], child);\n return child;\n };\n\n MarkersParentModel.prototype.onDestroy = function(scope) {\n MarkersParentModel.__super__.onDestroy.call(this, scope);\n return _async.promiseLock(this, uiGmapPromise.promiseTypes[\"delete\"], void 0, void 0, (function(_this) {\n return function() {\n return _async.each(_this.scope.plurals.values(), function(model) {\n if (model != null) {\n return model.destroy(false);\n }\n }, _async.chunkSizeFrom(_this.scope.cleanchunk, false)).then(function() {\n if (_this.gManager != null) {\n _this.gManager.destroy();\n }\n _this.plurals.removeAll();\n if (_this.plurals !== _this.scope.plurals) {\n console.error('plurals out of sync for MarkersParentModel');\n }\n return _this.scope.pluralsUpdate.updateCtr += 1;\n });\n };\n })(this));\n };\n\n MarkersParentModel.prototype.maybeExecMappedEvent = function(group, fnName) {\n var pair, typeEvents;\n if (this.scope.$$destroyed) {\n return;\n }\n typeEvents = this.scope.typeEvents || this.scope.clusterEvents;\n if (_.isFunction(typeEvents != null ? typeEvents[fnName] : void 0)) {\n pair = this.mapTypeToPlurals(group);\n if (this.origTypeEvents[fnName]) {\n return this.origTypeEvents[fnName](pair.group, pair.mapped);\n }\n }\n };\n\n MarkersParentModel.prototype.mapTypeToPlurals = function(group) {\n var arrayToMap, mapped, ref;\n if (_.isArray(group)) {\n arrayToMap = group;\n } else if (_.isFunction(group.getMarkers)) {\n arrayToMap = group.getMarkers();\n }\n if (arrayToMap == null) {\n $log.error(\"Unable to map event as we cannot find the array group to map\");\n return;\n }\n if ((ref = this.scope.plurals.values()) != null ? ref.length : void 0) {\n mapped = arrayToMap.map((function(_this) {\n return function(g) {\n return _this.scope.plurals.get(g.key).model;\n };\n })(this));\n } else {\n mapped = [];\n }\n return {\n cluster: group,\n mapped: mapped,\n group: group\n };\n };\n\n MarkersParentModel.prototype.getItem = function(scope, modelsPropToIterate, index) {\n if (modelsPropToIterate === 'models') {\n return scope[modelsPropToIterate][index];\n }\n return scope[modelsPropToIterate].get(index);\n };\n\n return MarkersParentModel;\n\n })(IMarkerParentModel);\n return MarkersParentModel;\n }\n ]);\n\n}).call(this);\n;(function() {\n ['Polygon', 'Polyline'].forEach(function(name) {\n return angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory(\"uiGmap\" + name + \"sParentModel\", [\n 'uiGmapBasePolysParentModel', \"uiGmap\" + name + \"ChildModel\", \"uiGmapI\" + name, function(BasePolysParentModel, ChildModel, IPoly) {\n return BasePolysParentModel(IPoly, ChildModel, name);\n }\n ]);\n });\n\n}).call(this);\n;\n/*globals angular, _, google */\n\n(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapRectangleParentModel', [\n 'uiGmapLogger', 'uiGmapGmapUtil', 'uiGmapEventsHelper', 'uiGmapRectangleOptionsBuilder', function($log, GmapUtil, EventsHelper, Builder) {\n var RectangleParentModel;\n return RectangleParentModel = (function(superClass) {\n extend(RectangleParentModel, superClass);\n\n RectangleParentModel.include(GmapUtil);\n\n RectangleParentModel.include(EventsHelper);\n\n function RectangleParentModel(scope, element, attrs, gMap, DEFAULTS) {\n var bounds, clear, createBounds, dragging, fit, gObject, init, listeners, myListeners, settingBoundsFromScope, updateBounds;\n this.scope = scope;\n this.attrs = attrs;\n this.gMap = gMap;\n this.DEFAULTS = DEFAULTS;\n bounds = void 0;\n dragging = false;\n myListeners = [];\n listeners = void 0;\n fit = (function(_this) {\n return function() {\n if (_this.isTrue(_this.attrs.fit)) {\n return _this.fitMapBounds(_this.gMap, bounds);\n }\n };\n })(this);\n createBounds = (function(_this) {\n return function() {\n var ref, ref1, ref2;\n if ((_this.scope.bounds != null) && (((ref = _this.scope.bounds) != null ? ref.sw : void 0) != null) && (((ref1 = _this.scope.bounds) != null ? ref1.ne : void 0) != null) && _this.validateBoundPoints(_this.scope.bounds)) {\n bounds = _this.convertBoundPoints(_this.scope.bounds);\n return $log.info(\"new new bounds created: \" + (JSON.stringify(bounds)));\n } else if ((_this.scope.bounds.getNorthEast != null) && (_this.scope.bounds.getSouthWest != null)) {\n return bounds = _this.scope.bounds;\n } else {\n if (_this.scope.bounds != null) {\n return $log.error(\"Invalid bounds for newValue: \" + (JSON.stringify((ref2 = _this.scope) != null ? ref2.bounds : void 0)));\n }\n }\n };\n })(this);\n createBounds();\n gObject = new google.maps.Rectangle(this.buildOpts(bounds));\n $log.info(\"gObject (rectangle) created: \" + gObject);\n settingBoundsFromScope = false;\n updateBounds = (function(_this) {\n return function() {\n var b, ne, sw;\n b = gObject.getBounds();\n ne = b.getNorthEast();\n sw = b.getSouthWest();\n if (settingBoundsFromScope) {\n return;\n }\n return _this.scope.$evalAsync(function(s) {\n if ((s.bounds != null) && (s.bounds.sw != null) && (s.bounds.ne != null)) {\n s.bounds.ne = {\n latitude: ne.lat(),\n longitude: ne.lng()\n };\n s.bounds.sw = {\n latitude: sw.lat(),\n longitude: sw.lng()\n };\n }\n if ((s.bounds.getNorthEast != null) && (s.bounds.getSouthWest != null)) {\n return s.bounds = b;\n }\n });\n };\n })(this);\n init = (function(_this) {\n return function() {\n fit();\n _this.removeEvents(myListeners);\n myListeners.push(google.maps.event.addListener(gObject, 'dragstart', function() {\n return dragging = true;\n }));\n myListeners.push(google.maps.event.addListener(gObject, 'dragend', function() {\n dragging = false;\n return updateBounds();\n }));\n return myListeners.push(google.maps.event.addListener(gObject, 'bounds_changed', function() {\n if (dragging) {\n return;\n }\n return updateBounds();\n }));\n };\n })(this);\n clear = (function(_this) {\n return function() {\n _this.removeEvents(myListeners);\n if (listeners != null) {\n _this.removeEvents(listeners);\n }\n return gObject.setMap(null);\n };\n })(this);\n if (bounds != null) {\n init();\n }\n this.scope.$watch('bounds', (function(newValue, oldValue) {\n var isNew;\n if (_.isEqual(newValue, oldValue) && (bounds != null) || dragging) {\n return;\n }\n settingBoundsFromScope = true;\n if (newValue == null) {\n clear();\n return;\n }\n if (bounds == null) {\n isNew = true;\n } else {\n fit();\n }\n createBounds();\n gObject.setBounds(bounds);\n settingBoundsFromScope = false;\n if (isNew && (bounds != null)) {\n return init();\n }\n }), true);\n this.setMyOptions = (function(_this) {\n return function(newVals, oldVals) {\n if (!_.isEqual(newVals, oldVals)) {\n if ((bounds != null) && (newVals != null)) {\n return gObject.setOptions(_this.buildOpts(bounds));\n }\n }\n };\n })(this);\n this.props.push('bounds');\n this.watchProps(this.props);\n if (this.attrs.events != null) {\n listeners = this.setEvents(gObject, this.scope, this.scope);\n this.scope.$watch('events', (function(_this) {\n return function(newValue, oldValue) {\n if (!_.isEqual(newValue, oldValue)) {\n if (listeners != null) {\n _this.removeEvents(listeners);\n }\n return listeners = _this.setEvents(gObject, _this.scope, _this.scope);\n }\n };\n })(this));\n }\n this.scope.$on('$destroy', function() {\n return clear();\n });\n $log.info(this);\n }\n\n return RectangleParentModel;\n\n })(Builder);\n }\n ]);\n\n}).call(this);\n;\n/*global angular:true, google:true */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapSearchBoxParentModel', [\n 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapEventsHelper', function(BaseObject, Logger, EventsHelper) {\n var SearchBoxParentModel;\n SearchBoxParentModel = (function(superClass) {\n extend(SearchBoxParentModel, superClass);\n\n SearchBoxParentModel.include(EventsHelper);\n\n function SearchBoxParentModel(scope, element, attrs, gMap, ctrlPosition, template, $log) {\n var controlDiv;\n this.scope = scope;\n this.element = element;\n this.attrs = attrs;\n this.gMap = gMap;\n this.ctrlPosition = ctrlPosition;\n this.template = template;\n this.$log = $log != null ? $log : Logger;\n this.setVisibility = bind(this.setVisibility, this);\n this.getBounds = bind(this.getBounds, this);\n this.setBounds = bind(this.setBounds, this);\n this.createSearchBox = bind(this.createSearchBox, this);\n this.addToParentDiv = bind(this.addToParentDiv, this);\n this.addAsMapControl = bind(this.addAsMapControl, this);\n this.init = bind(this.init, this);\n if (this.attrs.template == null) {\n this.$log.error('template attribute for the search-box directive is mandatory. Places Search Box creation aborted!!');\n return;\n }\n if (angular.isUndefined(this.scope.options)) {\n this.scope.options = {};\n this.scope.options.visible = true;\n }\n if (angular.isUndefined(this.scope.options.visible)) {\n this.scope.options.visible = true;\n }\n if (angular.isUndefined(this.scope.options.autocomplete)) {\n this.scope.options.autocomplete = false;\n }\n this.visible = this.scope.options.visible;\n this.autocomplete = this.scope.options.autocomplete;\n controlDiv = angular.element('<div></div>');\n controlDiv.append(this.template);\n this.input = controlDiv.find('input')[0];\n this.init();\n }\n\n SearchBoxParentModel.prototype.init = function() {\n this.createSearchBox();\n this.scope.$watch('options', (function(_this) {\n return function(newValue, oldValue) {\n if (angular.isObject(newValue)) {\n if (newValue.bounds != null) {\n _this.setBounds(newValue.bounds);\n }\n if (newValue.visible != null) {\n if (_this.visible !== newValue.visible) {\n return _this.setVisibility(newValue.visible);\n }\n }\n }\n };\n })(this), true);\n if (this.attrs.parentdiv != null) {\n this.addToParentDiv();\n } else {\n this.addAsMapControl();\n }\n if (!this.visible) {\n this.setVisibility(this.visible);\n }\n if (this.autocomplete) {\n this.listener = google.maps.event.addListener(this.gObject, 'place_changed', (function(_this) {\n return function() {\n return _this.places = _this.gObject.getPlace();\n };\n })(this));\n } else {\n this.listener = google.maps.event.addListener(this.gObject, 'places_changed', (function(_this) {\n return function() {\n return _this.places = _this.gObject.getPlaces();\n };\n })(this));\n }\n this.listeners = this.setEvents(this.gObject, this.scope, this.scope);\n this.$log.info(this);\n this.scope.$on('$stateChangeSuccess', (function(_this) {\n return function() {\n if (_this.attrs.parentdiv != null) {\n return _this.addToParentDiv();\n }\n };\n })(this));\n return this.scope.$on('$destroy', (function(_this) {\n return function() {\n return _this.gObject = null;\n };\n })(this));\n };\n\n SearchBoxParentModel.prototype.addAsMapControl = function() {\n return this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input);\n };\n\n SearchBoxParentModel.prototype.addToParentDiv = function() {\n var ref;\n this.parentDiv = angular.element(document.getElementById(this.scope.parentdiv));\n if ((ref = this.parentDiv) != null ? ref.length : void 0) {\n return this.parentDiv.append(this.input);\n }\n };\n\n SearchBoxParentModel.prototype.createSearchBox = function() {\n if (this.autocomplete) {\n return this.gObject = new google.maps.places.Autocomplete(this.input, this.scope.options);\n } else {\n return this.gObject = new google.maps.places.SearchBox(this.input, this.scope.options);\n }\n };\n\n SearchBoxParentModel.prototype.setBounds = function(bounds) {\n if (angular.isUndefined(bounds.isEmpty)) {\n this.$log.error('Error: SearchBoxParentModel setBounds. Bounds not an instance of LatLngBounds.');\n } else {\n if (bounds.isEmpty() === false) {\n if (this.gObject != null) {\n return this.gObject.setBounds(bounds);\n }\n }\n }\n };\n\n SearchBoxParentModel.prototype.getBounds = function() {\n return this.gObject.getBounds();\n };\n\n SearchBoxParentModel.prototype.setVisibility = function(val) {\n if (this.attrs.parentdiv != null) {\n if (val === false) {\n this.parentDiv.addClass(\"ng-hide\");\n } else {\n this.parentDiv.removeClass(\"ng-hide\");\n }\n } else {\n if (val === false) {\n this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].clear();\n } else {\n this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input);\n }\n }\n return this.visible = val;\n };\n\n return SearchBoxParentModel;\n\n })(BaseObject);\n return SearchBoxParentModel;\n }\n ]);\n\n}).call(this);\n;\n/*global _,angular */\n\n\n/*\n\tWindowsChildModel generator where there are many ChildModels to a parent.\n */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapWindowsParentModel', [\n 'uiGmapIWindowParentModel', 'uiGmapModelsWatcher', 'uiGmapPropMap', 'uiGmapWindowChildModel', 'uiGmapLinked', 'uiGmap_async', 'uiGmapLogger', '$timeout', '$compile', '$http', '$templateCache', '$interpolate', 'uiGmapPromise', 'uiGmapIWindow', 'uiGmapGmapUtil', function(IWindowParentModel, ModelsWatcher, PropMap, WindowChildModel, Linked, _async, $log, $timeout, $compile, $http, $templateCache, $interpolate, uiGmapPromise, IWindow, GmapUtil) {\n var WindowsParentModel;\n WindowsParentModel = (function(superClass) {\n extend(WindowsParentModel, superClass);\n\n WindowsParentModel.include(ModelsWatcher);\n\n function WindowsParentModel(scope, element, attrs, ctrls, gMap1, markersScope) {\n this.gMap = gMap1;\n this.markersScope = markersScope;\n this.modelKeyComparison = bind(this.modelKeyComparison, this);\n this.interpolateContent = bind(this.interpolateContent, this);\n this.setChildScope = bind(this.setChildScope, this);\n this.createWindow = bind(this.createWindow, this);\n this.setContentKeys = bind(this.setContentKeys, this);\n this.pieceMeal = bind(this.pieceMeal, this);\n this.createAllNew = bind(this.createAllNew, this);\n this.watchIdKey = bind(this.watchIdKey, this);\n this.createChildScopes = bind(this.createChildScopes, this);\n this.watchOurScope = bind(this.watchOurScope, this);\n this.watchDestroy = bind(this.watchDestroy, this);\n this.onDestroy = bind(this.onDestroy, this);\n this.rebuildAll = bind(this.rebuildAll, this);\n this.doINeedToWipe = bind(this.doINeedToWipe, this);\n this.watchModels = bind(this.watchModels, this);\n this.go = bind(this.go, this);\n WindowsParentModel.__super__.constructor.call(this, scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache);\n this[\"interface\"] = IWindow;\n this.plurals = new PropMap();\n _.each(IWindow.scopeKeys, (function(_this) {\n return function(name) {\n return _this[name + 'Key'] = void 0;\n };\n })(this));\n this.linked = new Linked(scope, element, attrs, ctrls);\n this.contentKeys = void 0;\n this.isIconVisibleOnClick = void 0;\n this.firstTime = true;\n this.firstWatchModels = true;\n this.$log.info(self);\n this.parentScope = void 0;\n this.go(scope);\n }\n\n WindowsParentModel.prototype.go = function(scope) {\n this.watchOurScope(scope);\n this.doRebuildAll = this.scope.doRebuildAll != null ? this.scope.doRebuildAll : false;\n scope.$watch('doRebuildAll', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.doRebuildAll = newValue;\n }\n };\n })(this));\n return this.createChildScopes();\n };\n\n WindowsParentModel.prototype.watchModels = function(scope) {\n var itemToWatch;\n itemToWatch = this.markersScope != null ? 'pluralsUpdate' : 'models';\n return scope.$watch(itemToWatch, (function(_this) {\n return function(newValue, oldValue) {\n var doScratch;\n if (!_.isEqual(newValue, oldValue) || _this.firstWatchModels) {\n _this.firstWatchModels = false;\n if (_this.doRebuildAll || _this.doINeedToWipe(scope.models)) {\n return _this.rebuildAll(scope, true, true);\n } else {\n doScratch = _this.plurals.length === 0;\n if (_this.existingPieces != null) {\n return _.last(_this.existingPieces._content).then(function() {\n return _this.createChildScopes(doScratch);\n });\n } else {\n return _this.createChildScopes(doScratch);\n }\n }\n }\n };\n })(this), true);\n };\n\n WindowsParentModel.prototype.doINeedToWipe = function(newValue) {\n var newValueIsEmpty;\n newValueIsEmpty = newValue != null ? newValue.length === 0 : true;\n return this.plurals.length > 0 && newValueIsEmpty;\n };\n\n WindowsParentModel.prototype.rebuildAll = function(scope, doCreate, doDelete) {\n return this.onDestroy(doDelete).then((function(_this) {\n return function() {\n if (doCreate) {\n return _this.createChildScopes();\n }\n };\n })(this));\n };\n\n WindowsParentModel.prototype.onDestroy = function(scope) {\n WindowsParentModel.__super__.onDestroy.call(this, this.scope);\n return _async.promiseLock(this, uiGmapPromise.promiseTypes[\"delete\"], void 0, void 0, (function(_this) {\n return function() {\n return _async.each(_this.plurals.values(), function(child) {\n return child.destroy(true);\n }, _async.chunkSizeFrom(_this.scope.cleanchunk, false)).then(function() {\n var ref;\n return (ref = _this.plurals) != null ? ref.removeAll() : void 0;\n });\n };\n })(this));\n };\n\n WindowsParentModel.prototype.watchDestroy = function(scope) {\n return scope.$on('$destroy', (function(_this) {\n return function() {\n _this.firstWatchModels = true;\n _this.firstTime = true;\n return _this.rebuildAll(scope, false, true);\n };\n })(this));\n };\n\n WindowsParentModel.prototype.watchOurScope = function(scope) {\n return _.each(IWindow.scopeKeys, (function(_this) {\n return function(name) {\n var nameKey;\n nameKey = name + 'Key';\n return _this[nameKey] = typeof scope[name] === 'function' ? scope[name]() : scope[name];\n };\n })(this));\n };\n\n WindowsParentModel.prototype.createChildScopes = function(isCreatingFromScratch) {\n var modelsNotDefined, ref, ref1;\n if (isCreatingFromScratch == null) {\n isCreatingFromScratch = true;\n }\n\n /*\n being that we cannot tell the difference in Key String vs. a normal value string (TemplateUrl)\n we will assume that all scope values are string expressions either pointing to a key (propName) or using\n 'self' to point the model as container/object of interest.\n \n This may force redundant information into the model, but this appears to be the most flexible approach.\n */\n this.isIconVisibleOnClick = true;\n if (angular.isDefined(this.linked.attrs.isiconvisibleonclick)) {\n this.isIconVisibleOnClick = this.linked.scope.isIconVisibleOnClick;\n }\n modelsNotDefined = angular.isUndefined(this.linked.scope.models);\n if (modelsNotDefined && (this.markersScope === void 0 || (((ref = this.markersScope) != null ? ref.plurals : void 0) === void 0 || ((ref1 = this.markersScope) != null ? ref1.models : void 0) === void 0))) {\n this.$log.error('No models to create windows from! Need direct models or models derived from markers!');\n return;\n }\n if (this.gMap != null) {\n if (this.linked.scope.models != null) {\n this.watchIdKey(this.linked.scope);\n if (isCreatingFromScratch) {\n return this.createAllNew(this.linked.scope, false);\n } else {\n return this.pieceMeal(this.linked.scope, false);\n }\n } else {\n this.parentScope = this.markersScope;\n this.watchIdKey(this.parentScope);\n if (isCreatingFromScratch) {\n return this.createAllNew(this.markersScope, true, 'plurals', false);\n } else {\n return this.pieceMeal(this.markersScope, true, 'plurals', false);\n }\n }\n }\n };\n\n WindowsParentModel.prototype.watchIdKey = function(scope) {\n this.setIdKey(scope);\n return scope.$watch('idKey', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue && (newValue == null)) {\n _this.idKey = newValue;\n return _this.rebuildAll(scope, true, true);\n }\n };\n })(this));\n };\n\n WindowsParentModel.prototype.createAllNew = function(scope, hasGMarker, modelsPropToIterate, isArray) {\n var maybeCanceled;\n if (modelsPropToIterate == null) {\n modelsPropToIterate = 'models';\n }\n if (isArray == null) {\n isArray = false;\n }\n if (this.firstTime) {\n this.watchModels(scope);\n this.watchDestroy(scope);\n }\n this.setContentKeys(scope.models);\n if (this.didQueueInitPromise(this, scope)) {\n return;\n }\n maybeCanceled = null;\n return _async.promiseLock(this, uiGmapPromise.promiseTypes.create, 'createAllNew', (function(canceledMsg) {\n return maybeCanceled = canceledMsg;\n }), (function(_this) {\n return function() {\n return _async.each(scope.models, function(model) {\n var gMarker, ref;\n gMarker = hasGMarker ? (ref = _this.getItem(scope, modelsPropToIterate, model[_this.idKey])) != null ? ref.gObject : void 0 : void 0;\n if (!maybeCanceled) {\n if (!gMarker && _this.markersScope) {\n $log.error('Unable to get gMarker from markersScope!');\n }\n _this.createWindow(model, gMarker, _this.gMap);\n }\n return maybeCanceled;\n }, _async.chunkSizeFrom(scope.chunk)).then(function() {\n return _this.firstTime = false;\n });\n };\n })(this));\n };\n\n WindowsParentModel.prototype.pieceMeal = function(scope, hasGMarker, modelsPropToIterate, isArray) {\n var maybeCanceled, payload;\n if (modelsPropToIterate == null) {\n modelsPropToIterate = 'models';\n }\n if (isArray == null) {\n isArray = true;\n }\n if (scope.$$destroyed) {\n return;\n }\n maybeCanceled = null;\n payload = null;\n if ((scope != null) && this.modelsLength() && this.plurals.length) {\n return _async.promiseLock(this, uiGmapPromise.promiseTypes.update, 'pieceMeal', (function(canceledMsg) {\n return maybeCanceled = canceledMsg;\n }), (function(_this) {\n return function() {\n return uiGmapPromise.promise((function() {\n return _this.figureOutState(_this.idKey, scope, _this.plurals, _this.modelKeyComparison);\n })).then(function(state) {\n payload = state;\n return _async.each(payload.removals, function(child) {\n if (child != null) {\n _this.plurals.remove(child.id);\n if (child.destroy != null) {\n child.destroy(true);\n }\n return maybeCanceled;\n }\n }, _async.chunkSizeFrom(scope.chunk));\n }).then(function() {\n return _async.each(payload.adds, function(modelToAdd) {\n var gMarker, ref;\n gMarker = (ref = _this.getItem(scope, modelsPropToIterate, modelToAdd[_this.idKey])) != null ? ref.gObject : void 0;\n if (!gMarker) {\n throw 'Gmarker undefined';\n }\n _this.createWindow(modelToAdd, gMarker, _this.gMap);\n return maybeCanceled;\n });\n }).then(function() {\n return _async.each(payload.updates, function(update) {\n _this.updateChild(update.child, update.model);\n return maybeCanceled;\n }, _async.chunkSizeFrom(scope.chunk));\n });\n };\n })(this));\n } else {\n $log.debug('pieceMeal: rebuildAll');\n return this.rebuildAll(this.scope, true, true);\n }\n };\n\n WindowsParentModel.prototype.setContentKeys = function(models) {\n if (this.modelsLength(models)) {\n return this.contentKeys = Object.keys(models[0]);\n }\n };\n\n WindowsParentModel.prototype.createWindow = function(model, gMarker, gMap) {\n var child, childScope, fakeElement, opts, ref, ref1;\n childScope = this.linked.scope.$new(false);\n this.setChildScope(childScope, model);\n childScope.$watch('model', (function(_this) {\n return function(newValue, oldValue) {\n if (newValue !== oldValue) {\n return _this.setChildScope(childScope, newValue);\n }\n };\n })(this), true);\n fakeElement = {\n html: (function(_this) {\n return function() {\n return _this.interpolateContent(_this.linked.element.html(), model);\n };\n })(this)\n };\n this.DEFAULTS = this.scopeOrModelVal(this.optionsKey, this.scope, model) || {};\n opts = this.createWindowOptions(gMarker, childScope, fakeElement.html(), this.DEFAULTS);\n child = new WindowChildModel({\n model: model,\n scope: childScope,\n opts: opts,\n isIconVisibleOnClick: this.isIconVisibleOnClick,\n gMap: gMap,\n markerScope: (ref = this.markersScope) != null ? (ref1 = ref.plurals.get(model[this.idKey])) != null ? ref1.scope : void 0 : void 0,\n element: fakeElement,\n needToManualDestroy: false,\n markerIsVisibleAfterWindowClose: true,\n isScopeModel: true\n });\n if (model[this.idKey] == null) {\n this.$log.error('Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key.');\n return;\n }\n this.plurals.put(model[this.idKey], child);\n return child;\n };\n\n WindowsParentModel.prototype.setChildScope = function(childScope, model) {\n _.each(IWindow.scopeKeys, (function(_this) {\n return function(name) {\n var nameKey, newValue;\n nameKey = name + 'Key';\n newValue = _this[nameKey] === 'self' ? model : model[_this[nameKey]];\n if (newValue !== childScope[name]) {\n return childScope[name] = newValue;\n }\n };\n })(this));\n return childScope.model = model;\n };\n\n WindowsParentModel.prototype.interpolateContent = function(content, model) {\n var exp, i, interpModel, key, len, ref;\n if (this.contentKeys === void 0 || this.contentKeys.length === 0) {\n return;\n }\n exp = $interpolate(content);\n interpModel = {};\n ref = this.contentKeys;\n for (i = 0, len = ref.length; i < len; i++) {\n key = ref[i];\n interpModel[key] = model[key];\n }\n return exp(interpModel);\n };\n\n WindowsParentModel.prototype.modelKeyComparison = function(model1, model2) {\n var isEqual, scope;\n scope = this.scope.coords != null ? this.scope : this.parentScope;\n if (scope == null) {\n throw 'No scope or parentScope set!';\n }\n isEqual = GmapUtil.equalCoords(this.evalModelHandle(model1, scope.coords), this.evalModelHandle(model2, scope.coords));\n if (!isEqual) {\n return isEqual;\n }\n isEqual = _.every(_.without(this[\"interface\"].scopeKeys, 'coords'), (function(_this) {\n return function(k) {\n return _this.evalModelHandle(model1, scope[k]) === _this.evalModelHandle(model2, scope[k]);\n };\n })(this));\n return isEqual;\n };\n\n return WindowsParentModel;\n\n })(IWindowParentModel);\n return WindowsParentModel;\n }\n ]);\n\n}).call(this);\n;\n/*global angular, _ */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps.directives.api\").factory(\"uiGmapCircle\", [\n \"uiGmapICircle\", \"uiGmapCircleParentModel\", function(ICircle, CircleParentModel) {\n return _.extend(ICircle, {\n link: function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then(function(gMap) {\n return new CircleParentModel(scope, element, attrs, gMap);\n });\n }\n });\n }\n ]);\n\n}).call(this);\n;(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api\").factory(\"uiGmapControl\", [\n \"uiGmapIControl\", \"$http\", \"$templateCache\", \"$compile\", \"$controller\", 'uiGmapGoogleMapApi', function(IControl, $http, $templateCache, $compile, $controller, GoogleMapApi) {\n var Control;\n return Control = (function(superClass) {\n extend(Control, superClass);\n\n function Control() {\n this.link = bind(this.link, this);\n Control.__super__.constructor.call(this);\n }\n\n Control.prototype.link = function(scope, element, attrs, ctrl) {\n return GoogleMapApi.then((function(_this) {\n return function(maps) {\n var index, position;\n if (angular.isUndefined(scope.template)) {\n _this.$log.error('mapControl: could not find a valid template property');\n return;\n }\n index = angular.isDefined(scope.index && !isNaN(parseInt(scope.index))) ? parseInt(scope.index) : void 0;\n position = angular.isDefined(scope.position) ? scope.position.toUpperCase().replace(/-/g, '_') : 'TOP_CENTER';\n if (!maps.ControlPosition[position]) {\n _this.$log.error('mapControl: invalid position property');\n return;\n }\n return IControl.mapPromise(scope, ctrl).then(function(map) {\n var control, controlDiv;\n control = void 0;\n controlDiv = angular.element('<div></div>');\n return $http.get(scope.template, {\n cache: $templateCache\n }).success(function(template) {\n var templateCtrl, templateScope;\n templateScope = scope.$new();\n controlDiv.append(template);\n if (angular.isDefined(scope.controller)) {\n templateCtrl = $controller(scope.controller, {\n $scope: templateScope\n });\n controlDiv.children().data('$ngControllerController', templateCtrl);\n }\n control = $compile(controlDiv.children())(templateScope);\n if (index) {\n return control[0].index = index;\n }\n }).error(function(error) {\n return _this.$log.error('mapControl: template could not be found');\n }).then(function() {\n return map.controls[google.maps.ControlPosition[position]].push(control[0]);\n });\n });\n };\n })(this));\n };\n\n return Control;\n\n })(IControl);\n }\n ]);\n\n}).call(this);\n;\n/*globals angular, _ */\n\n(function() {\n angular.module('uiGmapgoogle-maps.directives.api').service('uiGmapDragZoom', [\n 'uiGmapCtrlHandle', 'uiGmapPropertyAction', function(CtrlHandle, PropertyAction) {\n return {\n restrict: 'EMA',\n transclude: true,\n template: '<div class=\"angular-google-map-dragzoom\" ng-transclude style=\"display: none\"></div>',\n require: '^' + 'uiGmapGoogleMap',\n scope: {\n keyboardkey: '=',\n options: '=',\n spec: '='\n },\n controller: [\n '$scope', '$element', function($scope, $element) {\n $scope.ctrlType = 'uiGmapDragZoom';\n return _.extend(this, CtrlHandle.handle($scope, $element));\n }\n ],\n link: function(scope, element, attrs, ctrl) {\n return CtrlHandle.mapPromise(scope, ctrl).then(function(map) {\n var enableKeyDragZoom, setKeyAction, setOptionsAction;\n enableKeyDragZoom = function(opts) {\n return map.enableKeyDragZoom(opts);\n };\n setKeyAction = new PropertyAction(function(key, newVal) {\n if (newVal) {\n return enableKeyDragZoom({\n key: newVal\n });\n } else {\n return enableKeyDragZoom();\n }\n });\n setOptionsAction = new PropertyAction(function(key, newVal) {\n if (newVal) {\n return enableKeyDragZoom(newVal);\n }\n });\n scope.$watch('keyboardkey', setKeyAction.sic('keyboardkey'));\n setKeyAction.sic(scope.keyboardkey);\n scope.$watch('options', setOptionsAction.sic('options'));\n return setOptionsAction.sic(scope.options);\n });\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module(\"uiGmapgoogle-maps.directives.api\").factory(\"uiGmapDrawingManager\", [\n \"uiGmapIDrawingManager\", \"uiGmapDrawingManagerParentModel\", function(IDrawingManager, DrawingManagerParentModel) {\n return _.extend(IDrawingManager, {\n link: function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then(function(map) {\n return new DrawingManagerParentModel(scope, element, attrs, map);\n });\n }\n });\n }\n ]);\n\n}).call(this);\n;\n/*\n - Link up Polygons to be sent back to a controller\n - inject the draw function into a controllers scope so that controller can call the directive to draw on demand\n - draw function creates the DrawFreeHandChildModel which manages itself\n */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapApiFreeDrawPolygons', [\n 'uiGmapLogger', 'uiGmapBaseObject', 'uiGmapCtrlHandle', 'uiGmapDrawFreeHandChildModel', 'uiGmapLodash', function($log, BaseObject, CtrlHandle, DrawFreeHandChildModel, uiGmapLodash) {\n var FreeDrawPolygons;\n return FreeDrawPolygons = (function(superClass) {\n extend(FreeDrawPolygons, superClass);\n\n function FreeDrawPolygons() {\n this.link = bind(this.link, this);\n return FreeDrawPolygons.__super__.constructor.apply(this, arguments);\n }\n\n FreeDrawPolygons.include(CtrlHandle);\n\n FreeDrawPolygons.prototype.restrict = 'EMA';\n\n FreeDrawPolygons.prototype.replace = true;\n\n FreeDrawPolygons.prototype.require = '^' + 'uiGmapGoogleMap';\n\n FreeDrawPolygons.prototype.scope = {\n polygons: '=',\n draw: '='\n };\n\n FreeDrawPolygons.prototype.link = function(scope, element, attrs, ctrl) {\n return this.mapPromise(scope, ctrl).then((function(_this) {\n return function(map) {\n var freeHand, listener;\n if (!scope.polygons) {\n return $log.error('No polygons to bind to!');\n }\n if (!_.isArray(scope.polygons)) {\n return $log.error('Free Draw Polygons must be of type Array!');\n }\n freeHand = new DrawFreeHandChildModel(map, ctrl.getScope());\n listener = void 0;\n return scope.draw = function() {\n if (typeof listener === \"function\") {\n listener();\n }\n return freeHand.engage(scope.polygons).then(function() {\n var firstTime;\n firstTime = true;\n return listener = scope.$watchCollection('polygons', function(newValue, oldValue) {\n var removals;\n if (firstTime || newValue === oldValue) {\n firstTime = false;\n return;\n }\n removals = uiGmapLodash.differenceObjects(oldValue, newValue);\n return removals.forEach(function(p) {\n return p.setMap(null);\n });\n });\n });\n };\n };\n })(this));\n };\n\n return FreeDrawPolygons;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module(\"uiGmapgoogle-maps.directives.api\").service(\"uiGmapICircle\", [\n function() {\n var DEFAULTS;\n DEFAULTS = {};\n return {\n restrict: \"EA\",\n replace: true,\n require: '^' + 'uiGmapGoogleMap',\n scope: {\n center: \"=center\",\n radius: \"=radius\",\n stroke: \"=stroke\",\n fill: \"=fill\",\n clickable: \"=\",\n draggable: \"=\",\n editable: \"=\",\n geodesic: \"=\",\n icons: \"=icons\",\n visible: \"=\",\n events: \"=\",\n control: \"=\",\n zIndex: \"=zindex\"\n }\n };\n }\n ]);\n\n}).call(this);\n;\n/*\n - interface for all controls to derive from\n - to enforce a minimum set of requirements\n\t- attributes\n\t\t- template\n\t\t- position\n\t\t- controller\n\t\t- index\n */\n\n(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api\").factory(\"uiGmapIControl\", [\n \"uiGmapBaseObject\", \"uiGmapLogger\", \"uiGmapCtrlHandle\", function(BaseObject, Logger, CtrlHandle) {\n var IControl;\n return IControl = (function(superClass) {\n extend(IControl, superClass);\n\n IControl.extend(CtrlHandle);\n\n function IControl() {\n this.restrict = 'EA';\n this.replace = true;\n this.require = '^' + 'uiGmapGoogleMap';\n this.scope = {\n template: '@template',\n position: '@position',\n controller: '@controller',\n index: '@index'\n };\n this.$log = Logger;\n }\n\n IControl.prototype.link = function(scope, element, attrs, ctrl) {\n throw new Exception(\"Not implemented!!\");\n };\n\n return IControl;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api').service('uiGmapIDrawingManager', [\n function() {\n return {\n restrict: 'EA',\n replace: true,\n require: '^' + 'uiGmapGoogleMap',\n scope: {\n \"static\": '@',\n control: '=',\n options: '=',\n events: '='\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIMarker', [\n 'uiGmapBaseObject', 'uiGmapCtrlHandle', function(BaseObject, CtrlHandle) {\n var IMarker;\n return IMarker = (function(superClass) {\n extend(IMarker, superClass);\n\n IMarker.scope = {\n coords: '=coords',\n icon: '=icon',\n click: '&click',\n options: '=options',\n events: '=events',\n fit: '=fit',\n idKey: '=idkey',\n control: '=control'\n };\n\n IMarker.scopeKeys = _.keys(IMarker.scope);\n\n IMarker.keys = IMarker.scopeKeys;\n\n IMarker.extend(CtrlHandle);\n\n function IMarker() {\n this.restrict = 'EMA';\n this.require = '^' + 'uiGmapGoogleMap';\n this.priority = -1;\n this.transclude = true;\n this.replace = true;\n this.scope = _.extend(this.scope || {}, IMarker.scope);\n }\n\n return IMarker;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIPolygon', [\n 'uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapCtrlHandle', function(GmapUtil, BaseObject, Logger, CtrlHandle) {\n var IPolygon;\n return IPolygon = (function(superClass) {\n extend(IPolygon, superClass);\n\n IPolygon.scope = {\n path: '=path',\n stroke: '=stroke',\n clickable: '=',\n draggable: '=',\n editable: '=',\n geodesic: '=',\n fill: '=',\n icons: '=icons',\n visible: '=',\n \"static\": '=',\n events: '=',\n zIndex: '=zindex',\n fit: '=',\n control: '=control'\n };\n\n IPolygon.scopeKeys = _.keys(IPolygon.scope);\n\n IPolygon.include(GmapUtil);\n\n IPolygon.extend(CtrlHandle);\n\n function IPolygon() {}\n\n IPolygon.prototype.restrict = 'EMA';\n\n IPolygon.prototype.replace = true;\n\n IPolygon.prototype.require = '^' + 'uiGmapGoogleMap';\n\n IPolygon.prototype.scope = IPolygon.scope;\n\n IPolygon.prototype.DEFAULTS = {};\n\n IPolygon.prototype.$log = Logger;\n\n return IPolygon;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIPolyline', [\n 'uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapCtrlHandle', function(GmapUtil, BaseObject, Logger, CtrlHandle) {\n var IPolyline;\n return IPolyline = (function(superClass) {\n extend(IPolyline, superClass);\n\n IPolyline.scope = {\n path: '=',\n stroke: '=',\n clickable: '=',\n draggable: '=',\n editable: '=',\n geodesic: '=',\n icons: '=',\n visible: '=',\n \"static\": '=',\n fit: '=',\n events: '=',\n zIndex: '=zindex'\n };\n\n IPolyline.scopeKeys = _.keys(IPolyline.scope);\n\n IPolyline.include(GmapUtil);\n\n IPolyline.extend(CtrlHandle);\n\n function IPolyline() {}\n\n IPolyline.prototype.restrict = 'EMA';\n\n IPolyline.prototype.replace = true;\n\n IPolyline.prototype.require = '^' + 'uiGmapGoogleMap';\n\n IPolyline.prototype.scope = IPolyline.scope;\n\n IPolyline.prototype.DEFAULTS = {};\n\n IPolyline.prototype.$log = Logger;\n\n return IPolyline;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api').service('uiGmapIRectangle', [\n function() {\n 'use strict';\n var DEFAULTS;\n DEFAULTS = {};\n return {\n restrict: 'EMA',\n require: '^' + 'uiGmapGoogleMap',\n replace: true,\n scope: {\n bounds: '=',\n stroke: '=',\n clickable: '=',\n draggable: '=',\n editable: '=',\n fill: '=',\n visible: '=',\n events: '='\n }\n };\n }\n ]);\n\n}).call(this);\n;(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIWindow', [\n 'uiGmapBaseObject', 'uiGmapChildEvents', 'uiGmapCtrlHandle', function(BaseObject, ChildEvents, CtrlHandle) {\n var IWindow;\n return IWindow = (function(superClass) {\n extend(IWindow, superClass);\n\n IWindow.scope = {\n coords: '=coords',\n template: '=template',\n templateUrl: '=templateurl',\n templateParameter: '=templateparameter',\n isIconVisibleOnClick: '=isiconvisibleonclick',\n closeClick: '&closeclick',\n options: '=options',\n control: '=control',\n show: '=show'\n };\n\n IWindow.scopeKeys = _.keys(IWindow.scope);\n\n IWindow.include(ChildEvents);\n\n IWindow.extend(CtrlHandle);\n\n function IWindow() {\n this.restrict = 'EMA';\n this.template = void 0;\n this.transclude = true;\n this.priority = -100;\n this.require = '^' + 'uiGmapGoogleMap';\n this.replace = true;\n this.scope = _.extend(this.scope || {}, IWindow.scope);\n }\n\n return IWindow;\n\n })(BaseObject);\n }\n ]);\n\n}).call(this);\n;\n/*globals angular,_,google */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapMap', ['$timeout', '$q', '$log', 'uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapCtrlHandle', 'uiGmapIsReady', 'uiGmapuuid', 'uiGmapExtendGWin', 'uiGmapExtendMarkerClusterer', 'uiGmapGoogleMapsUtilV3', 'uiGmapGoogleMapApi', 'uiGmapEventsHelper', 'uiGmapGoogleMapObjectManager', function($timeout, $q, $log, uiGmapGmapUtil, uiGmapBaseObject, uiGmapCtrlHandle, uiGmapIsReady, uiGmapuuid, uiGmapExtendGWin, uiGmapExtendMarkerClusterer, uiGmapGoogleMapsUtilV3, uiGmapGoogleMapApi, uiGmapEventsHelper, uiGmapGoogleMapObjectManager) {\n var DEFAULTS, Map, initializeItems;\n DEFAULTS = void 0;\n initializeItems = [uiGmapGoogleMapsUtilV3, uiGmapExtendGWin, uiGmapExtendMarkerClusterer];\n return Map = (function(superClass) {\n extend(Map, superClass);\n\n Map.include(uiGmapGmapUtil);\n\n function Map() {\n this.link = bind(this.link, this);\n var ctrlFn;\n ctrlFn = function($scope) {\n var ctrlObj, retCtrl;\n retCtrl = void 0;\n $scope.$on('$destroy', function() {\n return uiGmapIsReady.decrement();\n });\n ctrlObj = uiGmapCtrlHandle.handle($scope);\n $scope.ctrlType = 'Map';\n $scope.deferred.promise.then(function() {\n return initializeItems.forEach(function(i) {\n return i.init();\n });\n });\n ctrlObj.getMap = function() {\n return $scope.map;\n };\n retCtrl = _.extend(this, ctrlObj);\n return retCtrl;\n };\n this.controller = ['$scope', ctrlFn];\n }\n\n Map.prototype.restrict = 'EMA';\n\n Map.prototype.transclude = true;\n\n Map.prototype.replace = false;\n\n Map.prototype.template = \"<div class=\\\"angular-google-map\\\"><div class=\\\"angular-google-map-container\\\">\\n</div><div ng-transclude style=\\\"display: none\\\"></div></div>\";\n\n Map.prototype.scope = {\n center: '=',\n zoom: '=',\n dragging: '=',\n control: '=',\n options: '=',\n events: '=',\n eventOpts: '=',\n styles: '=',\n bounds: '=',\n update: '='\n };\n\n Map.prototype.link = function(scope, element, attrs) {\n var listeners, unbindCenterWatch;\n listeners = [];\n scope.$on('$destroy', function() {\n uiGmapEventsHelper.removeEvents(listeners);\n if (attrs.recycleMapInstance === 'true' && scope.map) {\n uiGmapGoogleMapObjectManager.recycleMapInstance(scope.map);\n return scope.map = null;\n }\n });\n scope.idleAndZoomChanged = false;\n if (scope.center == null) {\n unbindCenterWatch = scope.$watch('center', (function(_this) {\n return function() {\n if (!scope.center) {\n return;\n }\n unbindCenterWatch();\n return _this.link(scope, element, attrs);\n };\n })(this));\n return;\n }\n return uiGmapGoogleMapApi.then((function(_this) {\n return function(maps) {\n var _gMap, customListeners, disabledEvents, dragging, el, eventName, getEventHandler, mapOptions, maybeHookToEvent, opts, ref, resolveSpawned, settingFromDirective, spawned, type, updateCenter, zoomPromise;\n DEFAULTS = {\n mapTypeId: maps.MapTypeId.ROADMAP\n };\n spawned = uiGmapIsReady.spawn();\n resolveSpawned = function() {\n return spawned.deferred.resolve({\n instance: spawned.instance,\n map: _gMap\n });\n };\n if (!_this.validateCoords(scope.center)) {\n $log.error('angular-google-maps: could not find a valid center property');\n return;\n }\n if (!angular.isDefined(scope.zoom)) {\n $log.error('angular-google-maps: map zoom property not set');\n return;\n }\n el = angular.element(element);\n el.addClass('angular-google-map');\n opts = {\n options: {}\n };\n if (attrs.options) {\n opts.options = scope.options;\n }\n if (attrs.styles) {\n opts.styles = scope.styles;\n }\n if (attrs.type) {\n type = attrs.type.toUpperCase();\n if (google.maps.MapTypeId.hasOwnProperty(type)) {\n opts.mapTypeId = google.maps.MapTypeId[attrs.type.toUpperCase()];\n } else {\n $log.error(\"angular-google-maps: invalid map type '\" + attrs.type + \"'\");\n }\n }\n mapOptions = angular.extend({}, DEFAULTS, opts, {\n center: _this.getCoords(scope.center),\n zoom: scope.zoom,\n bounds: scope.bounds\n });\n if (attrs.recycleMapInstance === 'true') {\n _gMap = uiGmapGoogleMapObjectManager.createMapInstance(el.find('div')[1], mapOptions);\n } else {\n _gMap = new google.maps.Map(el.find('div')[1], mapOptions);\n }\n _gMap['uiGmap_id'] = uiGmapuuid.generate();\n dragging = false;\n listeners.push(google.maps.event.addListenerOnce(_gMap, 'idle', function() {\n scope.deferred.resolve(_gMap);\n return resolveSpawned();\n }));\n disabledEvents = attrs.events && (((ref = scope.events) != null ? ref.blacklist : void 0) != null) ? scope.events.blacklist : [];\n if (_.isString(disabledEvents)) {\n disabledEvents = [disabledEvents];\n }\n maybeHookToEvent = function(eventName, fn, prefn) {\n if (!_.includes(disabledEvents, eventName)) {\n if (prefn) {\n prefn();\n }\n return listeners.push(google.maps.event.addListener(_gMap, eventName, function() {\n var ref1;\n if (!((ref1 = scope.update) != null ? ref1.lazy : void 0)) {\n return fn();\n }\n }));\n }\n };\n if (!_.includes(disabledEvents, 'all')) {\n maybeHookToEvent('dragstart', function() {\n dragging = true;\n return scope.$evalAsync(function(s) {\n if (s.dragging != null) {\n return s.dragging = dragging;\n }\n });\n });\n maybeHookToEvent('dragend', function() {\n dragging = false;\n return scope.$evalAsync(function(s) {\n if (s.dragging != null) {\n return s.dragging = dragging;\n }\n });\n });\n updateCenter = function(c, s) {\n if (c == null) {\n c = _gMap.center;\n }\n if (s == null) {\n s = scope;\n }\n if (_.includes(disabledEvents, 'center')) {\n return;\n }\n if (angular.isDefined(s.center.type)) {\n if (s.center.coordinates[1] !== c.lat()) {\n s.center.coordinates[1] = c.lat();\n }\n if (s.center.coordinates[0] !== c.lng()) {\n return s.center.coordinates[0] = c.lng();\n }\n } else {\n if (s.center.latitude !== c.lat()) {\n s.center.latitude = c.lat();\n }\n if (s.center.longitude !== c.lng()) {\n return s.center.longitude = c.lng();\n }\n }\n };\n settingFromDirective = false;\n maybeHookToEvent('idle', function() {\n var b, ne, sw;\n b = _gMap.getBounds();\n ne = b.getNorthEast();\n sw = b.getSouthWest();\n settingFromDirective = true;\n return scope.$evalAsync(function(s) {\n updateCenter();\n if (!_.isUndefined(s.bounds) && !_.includes(disabledEvents, 'bounds')) {\n s.bounds.northeast = {\n latitude: ne.lat(),\n longitude: ne.lng()\n };\n s.bounds.southwest = {\n latitude: sw.lat(),\n longitude: sw.lng()\n };\n }\n if (!_.includes(disabledEvents, 'zoom')) {\n s.zoom = _gMap.zoom;\n scope.idleAndZoomChanged = !scope.idleAndZoomChanged;\n }\n return settingFromDirective = false;\n });\n });\n }\n if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) {\n getEventHandler = function(eventName) {\n return function() {\n return scope.events[eventName].apply(scope, [_gMap, eventName, arguments]);\n };\n };\n customListeners = [];\n for (eventName in scope.events) {\n if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) {\n customListeners.push(google.maps.event.addListener(_gMap, eventName, getEventHandler(eventName)));\n }\n }\n listeners.concat(customListeners);\n }\n _gMap.getOptions = function() {\n return mapOptions;\n };\n scope.map = _gMap;\n if ((attrs.control != null) && (scope.control != null)) {\n scope.control.refresh = function(maybeCoords) {\n var coords, ref1, ref2;\n if (_gMap == null) {\n return;\n }\n if (((typeof google !== \"undefined\" && google !== null ? (ref1 = google.maps) != null ? (ref2 = ref1.event) != null ? ref2.trigger : void 0 : void 0 : void 0) != null) && (_gMap != null)) {\n google.maps.event.trigger(_gMap, 'resize');\n }\n if (((maybeCoords != null ? maybeCoords.latitude : void 0) != null) && ((maybeCoords != null ? maybeCoords.longitude : void 0) != null)) {\n coords = _this.getCoords(maybeCoords);\n if (_this.isTrue(attrs.pan)) {\n return _gMap.panTo(coords);\n } else {\n return _gMap.setCenter(coords);\n }\n }\n };\n scope.control.getGMap = function() {\n return _gMap;\n };\n scope.control.getMapOptions = function() {\n return mapOptions;\n };\n scope.control.getCustomEventListeners = function() {\n return customListeners;\n };\n scope.control.removeEvents = function(yourListeners) {\n return uiGmapEventsHelper.removeEvents(yourListeners);\n };\n }\n scope.$watch('center', function(newValue, oldValue) {\n var coords;\n if (newValue === oldValue || settingFromDirective) {\n return;\n }\n coords = _this.getCoords(scope.center);\n if (coords.lat() === _gMap.center.lat() && coords.lng() === _gMap.center.lng()) {\n return;\n }\n if (!dragging) {\n if (!_this.validateCoords(newValue)) {\n $log.error(\"Invalid center for newValue: \" + (JSON.stringify(newValue)));\n }\n if (_this.isTrue(attrs.pan) && scope.zoom === _gMap.zoom) {\n return _gMap.panTo(coords);\n } else {\n return _gMap.setCenter(coords);\n }\n }\n }, true);\n zoomPromise = null;\n scope.$watch('zoom', function(newValue, oldValue) {\n var ref1, ref2;\n if (newValue == null) {\n return;\n }\n if (_.isEqual(newValue, oldValue) || (_gMap != null ? _gMap.getZoom() : void 0) === (scope != null ? scope.zoom : void 0) || settingFromDirective) {\n return;\n }\n if (zoomPromise != null) {\n $timeout.cancel(zoomPromise);\n }\n return zoomPromise = $timeout(function() {\n return _gMap.setZoom(newValue);\n }, ((ref1 = scope.eventOpts) != null ? (ref2 = ref1.debounce) != null ? ref2.zoomMs : void 0 : void 0) + 20, false);\n });\n scope.$watch('bounds', function(newValue, oldValue) {\n var bounds, ne, ref1, ref2, ref3, ref4, sw;\n if (newValue === oldValue) {\n return;\n }\n if (((newValue != null ? (ref1 = newValue.northeast) != null ? ref1.latitude : void 0 : void 0) == null) || ((newValue != null ? (ref2 = newValue.northeast) != null ? ref2.longitude : void 0 : void 0) == null) || ((newValue != null ? (ref3 = newValue.southwest) != null ? ref3.latitude : void 0 : void 0) == null) || ((newValue != null ? (ref4 = newValue.southwest) != null ? ref4.longitude : void 0 : void 0) == null)) {\n $log.error(\"Invalid map bounds for new value: \" + (JSON.stringify(newValue)));\n return;\n }\n ne = new google.maps.LatLng(newValue.northeast.latitude, newValue.northeast.longitude);\n sw = new google.maps.LatLng(newValue.southwest.latitude, newValue.southwest.longitude);\n bounds = new google.maps.LatLngBounds(sw, ne);\n return _gMap.fitBounds(bounds);\n });\n return ['options', 'styles'].forEach(function(toWatch) {\n return scope.$watch(toWatch, function(newValue, oldValue) {\n if (_.isEqual(newValue, oldValue)) {\n return;\n }\n if (toWatch === 'options') {\n opts.options = newValue;\n } else {\n opts.options[toWatch] = newValue;\n }\n if (_gMap != null) {\n return _gMap.setOptions(opts);\n }\n }, true);\n });\n };\n })(this));\n };\n\n return Map;\n\n })(uiGmapBaseObject);\n }]);\n\n}).call(this);\n;\n/*global _:true,angular:true */\n\n(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api\").factory(\"uiGmapMarker\", [\n \"uiGmapIMarker\", \"uiGmapMarkerChildModel\", \"uiGmapMarkerManager\", \"uiGmapLogger\", function(IMarker, MarkerChildModel, MarkerManager, $log) {\n var Marker;\n return Marker = (function(superClass) {\n extend(Marker, superClass);\n\n function Marker() {\n Marker.__super__.constructor.call(this);\n this.template = '<span class=\"angular-google-map-marker\" ng-transclude></span>';\n $log.info(this);\n }\n\n Marker.prototype.controller = [\n '$scope', '$element', function($scope, $element) {\n $scope.ctrlType = 'Marker';\n return _.extend(this, IMarker.handle($scope, $element));\n }\n ];\n\n Marker.prototype.link = function(scope, element, attrs, ctrl) {\n var mapPromise;\n mapPromise = IMarker.mapPromise(scope, ctrl);\n mapPromise.then(function(gMap) {\n var gManager, keys, m;\n gManager = new MarkerManager(gMap);\n keys = _.object(IMarker.keys, IMarker.keys);\n m = new MarkerChildModel({\n scope: scope,\n model: scope,\n keys: keys,\n gMap: gMap,\n doClick: true,\n gManager: gManager,\n doDrawSelf: false,\n trackModel: false\n });\n m.deferred.promise.then(function(gMarker) {\n return scope.deferred.resolve(gMarker);\n });\n if (scope.control != null) {\n return scope.control.getGMarkers = gManager.getGMarkers;\n }\n });\n return scope.$on('$destroy', function() {\n var gManager;\n if (typeof gManager !== \"undefined\" && gManager !== null) {\n gManager.clear();\n }\n return gManager = null;\n });\n };\n\n return Marker;\n\n })(IMarker);\n }\n ]);\n\n}).call(this);\n;\n/*global _:true,angular:true */\n\n(function() {\n var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module(\"uiGmapgoogle-maps.directives.api\").factory(\"uiGmapMarkers\", [\n \"uiGmapIMarker\", \"uiGmapPlural\", \"uiGmapMarkersParentModel\", \"uiGmap_sync\", \"uiGmapLogger\", function(IMarker, Plural, MarkersParentModel, _sync, $log) {\n var Markers;\n return Markers = (function(superClass) {\n extend(Markers, superClass);\n\n function Markers() {\n Markers.__super__.constructor.call(this);\n this.template = '<span class=\"angular-google-map-markers\" ng-transclude></span>';\n Plural.extend(this, {\n doCluster: '=?docluster',\n clusterOptions: '=clusteroptions',\n clusterEvents: '=clusterevents',\n modelsByRef: '=modelsbyref',\n type: '=?type',\n typeOptions: '=?typeoptions',\n typeEvents: '=?typeevents'\n });\n $log.info(this);\n }\n\n Markers.prototype.controller = [\n '$scope', '$element', function($scope, $element) {\n $scope.ctrlType = 'Markers';\n return _.extend(this, IMarker.handle($scope, $element));\n }\n ];\n\n Markers.prototype.link = function(scope, element, attrs, ctrl) {\n var parentModel, ready;\n parentModel = void 0;\n ready = function() {\n return scope.deferred.resolve();\n };\n return IMarker.mapPromise(scope, ctrl).then(function(map) {\n var mapScope;\n mapScope = ctrl.getScope();\n mapScope.$watch('idleAndZoomChanged', function() {\n return _.defer(parentModel.gManager.draw);\n });\n parentModel = new MarkersParentModel(scope, element, attrs, map);\n Plural.link(scope, parentModel);\n if (scope.control != null) {\n scope.control.getGMarkers = function() {\n var ref;\n return (ref = parentModel.gManager) != null ? ref.getGMarkers() : void 0;\n };\n scope.control.getChildMarkers = function() {\n return parentModel.plurals;\n };\n }\n return _.last(parentModel.existingPieces._content).then(function() {\n return ready();\n });\n });\n };\n\n return Markers;\n\n })(IMarker);\n }\n ]);\n\n}).call(this);\n;\n/*global angular */\n\n(function() {\n angular.module('uiGmapgoogle-maps.directives.api').service('uiGmapPlural', [\n function() {\n var _initControl;\n _initControl = function(scope, parent) {\n if (scope.control == null) {\n return;\n }\n scope.control.updateModels = function(models) {\n scope.models = models;\n return parent.createChildScopes(false);\n };\n scope.control.newModels = function(models) {\n scope.models = models;\n return parent.rebuildAll(scope, true, true);\n };\n scope.control.clean = function() {\n return parent.rebuildAll(scope, false, true);\n };\n scope.control.getPlurals = function() {\n return parent.plurals;\n };\n scope.control.getManager = function() {\n return parent.gManager;\n };\n scope.control.hasManager = function() {\n return (parent.gManager != null) === true;\n };\n return scope.control.managerDraw = function() {\n var ref;\n if (scope.control.hasManager()) {\n return (ref = scope.control.getManager()) != null ? ref.draw() : void 0;\n }\n };\n };\n return {\n extend: function(obj, obj2) {\n return _.extend(obj.scope || {}, obj2 || {}, {\n idKey: '=idkey',\n doRebuildAll: '=dorebuildall',\n models: '=models',\n chunk: '=chunk',\n cleanchunk: '=cleanchunk',\n control: '=control'\n });\n },\n link: function(scope, parent) {\n return _initControl(scope, parent);\n }\n };\n }\n ]);\n\n}).call(this);\n;\n/*global angular */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolygon', [\n 'uiGmapIPolygon', '$timeout', 'uiGmapPolygonChildModel', function(IPolygon, $timeout, PolygonChild) {\n var Polygon;\n return Polygon = (function(superClass) {\n extend(Polygon, superClass);\n\n function Polygon() {\n this.link = bind(this.link, this);\n return Polygon.__super__.constructor.apply(this, arguments);\n }\n\n Polygon.prototype.link = function(scope, element, attrs, mapCtrl) {\n var children, promise;\n children = [];\n promise = IPolygon.mapPromise(scope, mapCtrl);\n if (scope.control != null) {\n scope.control.getInstance = this;\n scope.control.polygons = children;\n scope.control.promise = promise;\n }\n return promise.then((function(_this) {\n return function(gMap) {\n return children.push(new PolygonChild({\n scope: scope,\n attrs: attrs,\n gMap: gMap,\n defaults: _this.DEFAULTS\n }));\n };\n })(this));\n };\n\n return Polygon;\n\n })(IPolygon);\n }\n ]);\n\n}).call(this);\n;\n/*global angular:true */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolygons', [\n 'uiGmapIPolygon', '$timeout', 'uiGmapPolygonsParentModel', 'uiGmapPlural', function(Interface, $timeout, ParentModel, Plural) {\n var Polygons;\n return Polygons = (function(superClass) {\n extend(Polygons, superClass);\n\n function Polygons() {\n this.link = bind(this.link, this);\n Polygons.__super__.constructor.call(this);\n Plural.extend(this);\n this.$log.info(this);\n }\n\n Polygons.prototype.link = function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then((function(_this) {\n return function(map) {\n if (angular.isUndefined(scope.path) || scope.path === null) {\n _this.$log.warn('polygons: no valid path attribute found');\n }\n if (!scope.models) {\n _this.$log.warn('polygons: no models found to create from');\n }\n return Plural.link(scope, new ParentModel(scope, element, attrs, map, _this.DEFAULTS));\n };\n })(this));\n };\n\n return Polygons;\n\n })(Interface);\n }\n ]);\n\n}).call(this);\n;\n/*global angular */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolyline', [\n 'uiGmapIPolyline', '$timeout', 'uiGmapPolylineChildModel', function(IPolyline, $timeout, PolylineChildModel) {\n var Polyline;\n return Polyline = (function(superClass) {\n extend(Polyline, superClass);\n\n function Polyline() {\n this.link = bind(this.link, this);\n return Polyline.__super__.constructor.apply(this, arguments);\n }\n\n Polyline.prototype.link = function(scope, element, attrs, mapCtrl) {\n return IPolyline.mapPromise(scope, mapCtrl).then((function(_this) {\n return function(gMap) {\n if (angular.isUndefined(scope.path) || scope.path === null || !_this.validatePath(scope.path)) {\n _this.$log.warn('polyline: no valid path attribute found');\n }\n return new PolylineChildModel({\n scope: scope,\n attrs: attrs,\n gMap: gMap,\n defaults: _this.DEFAULTS\n });\n };\n })(this));\n };\n\n return Polyline;\n\n })(IPolyline);\n }\n ]);\n\n}).call(this);\n;\n/*global angular */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolylines', [\n 'uiGmapIPolyline', '$timeout', 'uiGmapPolylinesParentModel', 'uiGmapPlural', function(IPolyline, $timeout, PolylinesParentModel, Plural) {\n var Polylines;\n return Polylines = (function(superClass) {\n extend(Polylines, superClass);\n\n function Polylines() {\n this.link = bind(this.link, this);\n Polylines.__super__.constructor.call(this);\n Plural.extend(this);\n this.$log.info(this);\n }\n\n Polylines.prototype.link = function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then((function(_this) {\n return function(gMap) {\n if (angular.isUndefined(scope.path) || scope.path === null) {\n _this.$log.warn('polylines: no valid path attribute found');\n }\n if (!scope.models) {\n _this.$log.warn('polylines: no models found to create from');\n }\n return Plural.link(scope, new PolylinesParentModel(scope, element, attrs, gMap, _this.DEFAULTS));\n };\n })(this));\n };\n\n return Polylines;\n\n })(IPolyline);\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapRectangle', [\n 'uiGmapLogger', 'uiGmapGmapUtil', 'uiGmapIRectangle', 'uiGmapRectangleParentModel', function($log, GmapUtil, IRectangle, RectangleParentModel) {\n return _.extend(IRectangle, {\n link: function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then(function(gMap) {\n return new RectangleParentModel(scope, element, attrs, gMap);\n });\n }\n });\n }\n ]);\n\n}).call(this);\n;\n/*global angular:true */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapWindow', [\n 'uiGmapIWindow', 'uiGmapGmapUtil', 'uiGmapWindowChildModel', 'uiGmapLodash', 'uiGmapLogger', function(IWindow, GmapUtil, WindowChildModel, uiGmapLodash, $log) {\n var Window;\n return Window = (function(superClass) {\n extend(Window, superClass);\n\n Window.include(GmapUtil);\n\n function Window() {\n this.link = bind(this.link, this);\n Window.__super__.constructor.call(this);\n this.require = ['^' + 'uiGmapGoogleMap', '^?' + 'uiGmapMarker'];\n this.template = '<span class=\"angular-google-maps-window\" ng-transclude></span>';\n $log.debug(this);\n this.childWindows = [];\n }\n\n Window.prototype.link = function(scope, element, attrs, ctrls) {\n var markerCtrl, markerScope;\n markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0;\n markerScope = markerCtrl != null ? markerCtrl.getScope() : void 0;\n this.mapPromise = IWindow.mapPromise(scope, ctrls[0]);\n return this.mapPromise.then((function(_this) {\n return function(gMap) {\n var isIconVisibleOnClick;\n isIconVisibleOnClick = true;\n if (angular.isDefined(attrs.isiconvisibleonclick)) {\n isIconVisibleOnClick = scope.isIconVisibleOnClick;\n }\n if (!markerCtrl) {\n _this.init(scope, element, isIconVisibleOnClick, gMap);\n return;\n }\n return markerScope.deferred.promise.then(function(gMarker) {\n return _this.init(scope, element, isIconVisibleOnClick, gMap, markerScope);\n });\n };\n })(this));\n };\n\n Window.prototype.init = function(scope, element, isIconVisibleOnClick, gMap, markerScope) {\n var childWindow, defaults, gMarker, hasScopeCoords, opts;\n defaults = scope.options != null ? scope.options : {};\n hasScopeCoords = (scope != null) && this.validateCoords(scope.coords);\n if ((markerScope != null ? markerScope['getGMarker'] : void 0) != null) {\n gMarker = markerScope.getGMarker();\n }\n opts = hasScopeCoords ? this.createWindowOptions(gMarker, scope, element.html(), defaults) : defaults;\n if (gMap != null) {\n childWindow = new WindowChildModel({\n scope: scope,\n opts: opts,\n isIconVisibleOnClick: isIconVisibleOnClick,\n gMap: gMap,\n markerScope: markerScope,\n element: element\n });\n this.childWindows.push(childWindow);\n scope.$on('$destroy', (function(_this) {\n return function() {\n _this.childWindows = uiGmapLodash.withoutObjects(_this.childWindows, [childWindow], function(child1, child2) {\n return child1.scope.$id === child2.scope.$id;\n });\n return _this.childWindows.length = 0;\n };\n })(this));\n }\n if (scope.control != null) {\n scope.control.getGWindows = (function(_this) {\n return function() {\n return _this.childWindows.map(function(child) {\n return child.gObject;\n });\n };\n })(this);\n scope.control.getChildWindows = (function(_this) {\n return function() {\n return _this.childWindows;\n };\n })(this);\n scope.control.getPlurals = scope.control.getChildWindows;\n scope.control.showWindow = (function(_this) {\n return function() {\n return _this.childWindows.map(function(child) {\n return child.showWindow();\n });\n };\n })(this);\n scope.control.hideWindow = (function(_this) {\n return function() {\n return _this.childWindows.map(function(child) {\n return child.hideWindow();\n });\n };\n })(this);\n }\n if ((this.onChildCreation != null) && (childWindow != null)) {\n return this.onChildCreation(childWindow);\n }\n };\n\n return Window;\n\n })(IWindow);\n }\n ]);\n\n}).call(this);\n;\n/*global angular */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n hasProp = {}.hasOwnProperty;\n\n angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapWindows', [\n 'uiGmapIWindow', 'uiGmapPlural', 'uiGmapWindowsParentModel', 'uiGmapPromise', 'uiGmapLogger', function(IWindow, Plural, WindowsParentModel, uiGmapPromise, $log) {\n\n /*\n Windows directive where many windows map to the models property\n */\n var Windows;\n return Windows = (function(superClass) {\n extend(Windows, superClass);\n\n function Windows() {\n this.link = bind(this.link, this);\n Windows.__super__.constructor.call(this);\n this.require = ['^' + 'uiGmapGoogleMap', '^?' + 'uiGmapMarkers'];\n this.template = '<span class=\"angular-google-maps-windows\" ng-transclude></span>';\n Plural.extend(this);\n $log.debug(this);\n }\n\n Windows.prototype.link = function(scope, element, attrs, ctrls) {\n var mapScope, markerCtrl, markerScope;\n mapScope = ctrls[0].getScope();\n markerCtrl = ctrls.length > 1 && (ctrls[1] != null) ? ctrls[1] : void 0;\n markerScope = markerCtrl != null ? markerCtrl.getScope() : void 0;\n return mapScope.deferred.promise.then((function(_this) {\n return function(map) {\n var promise, ref;\n promise = (markerScope != null ? (ref = markerScope.deferred) != null ? ref.promise : void 0 : void 0) || uiGmapPromise.resolve();\n return promise.then(function() {\n var pieces, ref1;\n pieces = (ref1 = _this.parentModel) != null ? ref1.existingPieces : void 0;\n if (pieces) {\n return pieces.then(function() {\n return _this.init(scope, element, attrs, ctrls, map, markerScope);\n });\n } else {\n return _this.init(scope, element, attrs, ctrls, map, markerScope);\n }\n });\n };\n })(this));\n };\n\n Windows.prototype.init = function(scope, element, attrs, ctrls, map, additionalScope) {\n var parentModel;\n parentModel = new WindowsParentModel(scope, element, attrs, ctrls, map, additionalScope);\n Plural.link(scope, parentModel);\n if (scope.control != null) {\n scope.control.getGWindows = function() {\n return parentModel.plurals.map(function(child) {\n return child.gObject;\n });\n };\n return scope.control.getChildWindows = function() {\n return parentModel.plurals;\n };\n }\n };\n\n return Windows;\n\n })(IWindow);\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\nNick Baugh - https://github.com/niftylettuce\n */\n\n\n/*globals angular */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapGoogleMap\", ['uiGmapMap', function(uiGmapMap) {\n return new uiGmapMap();\n }]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n\n/*\nMap marker directive\n\nThis directive is used to create a marker on an existing map.\nThis directive creates a new scope.\n\n{attribute coords required} object containing latitude and longitude properties\n{attribute icon optional} string url to image used for marker icon\n{attribute animate optional} if set to false, the marker won't be animated (on by default)\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapMarker', [\n '$timeout', 'uiGmapMarker', function($timeout, Marker) {\n return new Marker($timeout);\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n\n/*\nMap marker directive\n\nThis directive is used to create a marker on an existing map.\nThis directive creates a new scope.\n\n{attribute coords required} object containing latitude and longitude properties\n{attribute icon optional} string url to image used for marker icon\n{attribute animate optional} if set to false, the marker won't be animated (on by default)\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapMarkers', [\n '$timeout', 'uiGmapMarkers', function($timeout, Markers) {\n return new Markers($timeout);\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\nRick Huizinga - https://plus.google.com/+RickHuizinga\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapPolygon', [\n 'uiGmapPolygon', function(Polygon) {\n return new Polygon();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nJulian Popescu - https://github.com/jpopesculian\nRick Huizinga - https://plus.google.com/+RickHuizinga\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive(\"uiGmapCircle\", [\n \"uiGmapCircle\", function(Circle) {\n return Circle;\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapPolyline\", [\n \"uiGmapPolyline\", function(Polyline) {\n return new Polyline();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapPolylines', [\n 'uiGmapPolylines', function(Polylines) {\n return new Polylines();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\nChentsu Lin - https://github.com/ChenTsuLin\n */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapRectangle\", [\n \"uiGmapLogger\", \"uiGmapRectangle\", function($log, Rectangle) {\n return Rectangle;\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n\n/*\nMap info window directive\n\nThis directive is used to create an info window on an existing map.\nThis directive creates a new scope.\n\n{attribute coords required} object containing latitude and longitude properties\n{attribute show optional} map will show when this expression returns true\n */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapWindow\", [\n \"$timeout\", \"$compile\", \"$http\", \"$templateCache\", \"uiGmapWindow\", function($timeout, $compile, $http, $templateCache, Window) {\n return new Window($timeout, $compile, $http, $templateCache);\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\n */\n\n\n/*\nMap info window directive\n\nThis directive is used to create an info window on an existing map.\nThis directive creates a new scope.\n\n{attribute coords required} object containing latitude and longitude properties\n{attribute show optional} map will show when this expression returns true\n */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapWindows\", [\n \"$timeout\", \"$compile\", \"$http\", \"$templateCache\", \"$interpolate\", \"uiGmapWindows\", function($timeout, $compile, $http, $templateCache, $interpolate, Windows) {\n return new Windows($timeout, $compile, $http, $templateCache, $interpolate);\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors:\n- Nicolas Laplante https://plus.google.com/108189012221374960701\n- Nicholas McCready - https://twitter.com/nmccready\n */\n\n\n/*\nMap Layer directive\n\nThis directive is used to create any type of Layer from the google maps sdk.\nThis directive creates a new scope.\n\n{attribute show optional} true (default) shows the trafficlayer otherwise it is hidden\n */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module('uiGmapgoogle-maps').directive('uiGmapLayer', [\n '$timeout', 'uiGmapLogger', 'uiGmapLayerParentModel', function($timeout, Logger, LayerParentModel) {\n var Layer;\n Layer = (function() {\n function Layer() {\n this.link = bind(this.link, this);\n this.$log = Logger;\n this.restrict = 'EMA';\n this.require = '^' + 'uiGmapGoogleMap';\n this.priority = -1;\n this.transclude = true;\n this.template = '<span class=\\'angular-google-map-layer\\' ng-transclude></span>';\n this.replace = true;\n this.scope = {\n show: '=show',\n type: '=type',\n namespace: '=namespace',\n options: '=options',\n onCreated: '&oncreated'\n };\n }\n\n Layer.prototype.link = function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then((function(_this) {\n return function(map) {\n if (scope.onCreated != null) {\n return new LayerParentModel(scope, element, attrs, map, scope.onCreated);\n } else {\n return new LayerParentModel(scope, element, attrs, map);\n }\n };\n })(this));\n };\n\n return Layer;\n\n })();\n return new Layer();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nAdam Kreitals, kreitals@hotmail.com\n */\n\n\n/*\nmapControl directive\n\nThis directive is used to create a custom control element on an existing map.\nThis directive creates a new scope.\n\n{attribute template required} \tstring url of the template to be used for the control\n{attribute position optional} \tstring position of the control of the form top-left or TOP_LEFT defaults to TOP_CENTER\n{attribute controller optional}\tstring controller to be applied to the template\n{attribute index optional}\t\tnumber index for controlling the order of similarly positioned mapControl elements\n */\n\n(function() {\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapMapControl\", [\n \"uiGmapControl\", function(Control) {\n return new Control();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicholas McCready - https://twitter.com/nmccready\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapDragZoom', [\n 'uiGmapDragZoom', function(DragZoom) {\n return DragZoom;\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps').directive(\"uiGmapDrawingManager\", [\n \"uiGmapDrawingManager\", function(DrawingManager) {\n return DrawingManager;\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicholas McCready - https://twitter.com/nmccready\n * Brunt of the work is in DrawFreeHandChildModel\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapFreeDrawPolygons', [\n 'uiGmapApiFreeDrawPolygons', function(FreeDrawPolygons) {\n return new FreeDrawPolygons();\n }\n ]);\n\n}).call(this);\n;\n/*\nMap Layer directive\n\nThis directive is used to create any type of Layer from the google maps sdk.\nThis directive creates a new scope.\n\n{attribute show optional} true (default) shows the trafficlayer otherwise it is hidden\n */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module(\"uiGmapgoogle-maps\").directive(\"uiGmapMapType\", [\n \"$timeout\", \"uiGmapLogger\", \"uiGmapMapTypeParentModel\", function($timeout, Logger, MapTypeParentModel) {\n var MapType;\n MapType = (function() {\n function MapType() {\n this.link = bind(this.link, this);\n this.$log = Logger;\n this.restrict = \"EMA\";\n this.require = '^' + 'uiGmapGoogleMap';\n this.priority = -1;\n this.transclude = true;\n this.template = '<span class=\\\"angular-google-map-layer\\\" ng-transclude></span>';\n this.replace = true;\n this.scope = {\n show: \"=show\",\n options: '=options',\n refresh: '=refresh',\n id: '@'\n };\n }\n\n MapType.prototype.link = function(scope, element, attrs, mapCtrl) {\n return mapCtrl.getScope().deferred.promise.then((function(_this) {\n return function(map) {\n return new MapTypeParentModel(scope, element, attrs, map);\n };\n })(this));\n };\n\n return MapType;\n\n })();\n return new MapType();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors\nNicolas Laplante - https://plus.google.com/108189012221374960701\nNicholas McCready - https://twitter.com/nmccready\nRick Huizinga - https://plus.google.com/+RickHuizinga\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapPolygons', [\n 'uiGmapPolygons', function(Polygons) {\n return new Polygons();\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors:\n- Nicolas Laplante https://plus.google.com/108189012221374960701\n- Nicholas McCready - https://twitter.com/nmccready\n- Carrie Kengle - http://about.me/carrie\n */\n\n\n/*\nPlaces Search Box directive\n\nThis directive is used to create a Places Search Box.\nThis directive creates a new scope.\n\n{attribute input required} HTMLInputElement\n{attribute options optional} The options that can be set on a SearchBox object (google.maps.places.SearchBoxOptions object specification)\n */\n\n(function() {\n var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n angular.module('uiGmapgoogle-maps').directive('uiGmapSearchBox', [\n 'uiGmapGoogleMapApi', 'uiGmapLogger', 'uiGmapSearchBoxParentModel', '$http', '$templateCache', '$compile', function(GoogleMapApi, Logger, SearchBoxParentModel, $http, $templateCache, $compile) {\n var SearchBox;\n SearchBox = (function() {\n SearchBox.prototype.require = 'ngModel';\n\n function SearchBox() {\n this.link = bind(this.link, this);\n this.$log = Logger;\n this.restrict = 'EMA';\n this.require = '^' + 'uiGmapGoogleMap';\n this.priority = -1;\n this.transclude = true;\n this.template = '<span class=\\'angular-google-map-search\\' ng-transclude></span>';\n this.replace = true;\n this.scope = {\n template: '=template',\n events: '=events',\n position: '=?position',\n options: '=?options',\n parentdiv: '=?parentdiv',\n ngModel: \"=?\"\n };\n }\n\n SearchBox.prototype.link = function(scope, element, attrs, mapCtrl) {\n return GoogleMapApi.then((function(_this) {\n return function(maps) {\n if (scope.template == null) {\n $templateCache.put('uigmap-searchbox-default.tpl.html', '<input type=\"text\">');\n scope.template = 'uigmap-searchbox-default.tpl.html';\n }\n return $http.get(scope.template, {\n cache: $templateCache\n }).success(function(template) {\n if (angular.isUndefined(scope.events)) {\n _this.$log.error('searchBox: the events property is required');\n return;\n }\n return mapCtrl.getScope().deferred.promise.then(function(map) {\n var ctrlPosition;\n ctrlPosition = angular.isDefined(scope.position) ? scope.position.toUpperCase().replace(/-/g, '_') : 'TOP_LEFT';\n if (!maps.ControlPosition[ctrlPosition]) {\n _this.$log.error('searchBox: invalid position property');\n return;\n }\n return new SearchBoxParentModel(scope, element, attrs, map, ctrlPosition, $compile(template)(scope));\n });\n });\n };\n })(this));\n };\n\n return SearchBox;\n\n })();\n return new SearchBox();\n }\n ]);\n\n}).call(this);\n;(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapShow', [\n '$animate', 'uiGmapLogger', function($animate, $log) {\n return {\n scope: {\n 'uiGmapShow': '=',\n 'uiGmapAfterShow': '&',\n 'uiGmapAfterHide': '&'\n },\n link: function(scope, element) {\n var angular_post_1_3_handle, angular_pre_1_3_handle, handle;\n angular_post_1_3_handle = function(animateAction, cb) {\n return $animate[animateAction](element, 'ng-hide').then(function() {\n return cb();\n });\n };\n angular_pre_1_3_handle = function(animateAction, cb) {\n return $animate[animateAction](element, 'ng-hide', cb);\n };\n handle = function(animateAction, cb) {\n if (angular.version.major > 1) {\n return $log.error(\"uiGmapShow is not supported for Angular Major greater than 1.\\nYour Major is \" + angular.version.major + \"\\\"\");\n }\n if (angular.version.major === 1 && angular.version.minor < 3) {\n return angular_pre_1_3_handle(animateAction, cb);\n }\n return angular_post_1_3_handle(animateAction, cb);\n };\n return scope.$watch('uiGmapShow', function(show) {\n if (show) {\n handle('removeClass', scope.uiGmapAfterShow);\n }\n if (!show) {\n return handle('addClass', scope.uiGmapAfterHide);\n }\n });\n }\n };\n }\n ]);\n\n}).call(this);\n;\n/*\n@authors:\n- Nicholas McCready - https://twitter.com/nmccready\n */\n\n\n/*\nStreetViewPanorama Directive to care of basic initialization of StreetViewPanorama\n */\n\n(function() {\n angular.module('uiGmapgoogle-maps').directive('uiGmapStreetViewPanorama', [\n 'uiGmapGoogleMapApi', 'uiGmapLogger', 'uiGmapGmapUtil', 'uiGmapEventsHelper', function(GoogleMapApi, $log, GmapUtil, EventsHelper) {\n var name;\n name = 'uiGmapStreetViewPanorama';\n return {\n restrict: 'EMA',\n template: '<div class=\"angular-google-map-street-view-panorama\"></div>',\n replace: true,\n scope: {\n focalcoord: '=',\n radius: '=?',\n events: '=?',\n options: '=?',\n control: '=?',\n povoptions: '=?',\n imagestatus: '='\n },\n link: function(scope, element, attrs) {\n return GoogleMapApi.then((function(_this) {\n return function(maps) {\n var clean, create, didCreateOptionsFromDirective, firstTime, handleSettings, listeners, opts, pano, povOpts, sv;\n pano = void 0;\n sv = void 0;\n didCreateOptionsFromDirective = false;\n listeners = void 0;\n opts = null;\n povOpts = null;\n clean = function() {\n EventsHelper.removeEvents(listeners);\n if (pano != null) {\n pano.unbind('position');\n pano.setVisible(false);\n }\n if (sv != null) {\n if ((sv != null ? sv.setVisible : void 0) != null) {\n sv.setVisible(false);\n }\n return sv = void 0;\n }\n };\n handleSettings = function(perspectivePoint, focalPoint) {\n var heading;\n heading = google.maps.geometry.spherical.computeHeading(perspectivePoint, focalPoint);\n didCreateOptionsFromDirective = true;\n scope.radius = scope.radius || 50;\n povOpts = angular.extend({\n heading: heading,\n zoom: 1,\n pitch: 0\n }, scope.povoptions || {});\n opts = opts = angular.extend({\n navigationControl: false,\n addressControl: false,\n linksControl: false,\n position: perspectivePoint,\n pov: povOpts,\n visible: true\n }, scope.options || {});\n return didCreateOptionsFromDirective = false;\n };\n create = function() {\n var focalPoint;\n if (!scope.focalcoord) {\n $log.error(name + \": focalCoord needs to be defined\");\n return;\n }\n if (!scope.radius) {\n $log.error(name + \": needs a radius to set the camera view from its focal target.\");\n return;\n }\n clean();\n if (sv == null) {\n sv = new google.maps.StreetViewService();\n }\n if (scope.events) {\n listeners = EventsHelper.setEvents(sv, scope, scope);\n }\n focalPoint = GmapUtil.getCoords(scope.focalcoord);\n return sv.getPanoramaByLocation(focalPoint, scope.radius, function(streetViewPanoramaData, status) {\n var ele, perspectivePoint, ref;\n if (scope.imagestatus != null) {\n scope.imagestatus = status;\n }\n if (((ref = scope.events) != null ? ref.image_status_changed : void 0) != null) {\n scope.events.image_status_changed(sv, 'image_status_changed', scope, status);\n }\n if (status === \"OK\") {\n perspectivePoint = streetViewPanoramaData.location.latLng;\n handleSettings(perspectivePoint, focalPoint);\n ele = element[0];\n return pano = new google.maps.StreetViewPanorama(ele, opts);\n }\n });\n };\n if (scope.control != null) {\n scope.control.getOptions = function() {\n return opts;\n };\n scope.control.getPovOptions = function() {\n return povOpts;\n };\n scope.control.getGObject = function() {\n return sv;\n };\n scope.control.getGPano = function() {\n return pano;\n };\n }\n scope.$watch('options', function(newValue, oldValue) {\n if (newValue === oldValue || newValue === opts || didCreateOptionsFromDirective) {\n return;\n }\n return create();\n });\n firstTime = true;\n scope.$watch('focalcoord', function(newValue, oldValue) {\n if (newValue === oldValue && !firstTime) {\n return;\n }\n if (newValue == null) {\n return;\n }\n firstTime = false;\n return create();\n });\n return scope.$on('$destroy', function() {\n return clean();\n });\n };\n })(this));\n }\n };\n }\n ]);\n\n}).call(this);\n;angular.module('uiGmapgoogle-maps.wrapped')\n.service('uiGmapuuid', function() {\n //BEGIN REPLACE\n /* istanbul ignore next */\n /*\n Version: core-1.0\n The MIT License: Copyright (c) 2012 LiosK.\n*/\nfunction UUID(){}UUID.generate=function(){var a=UUID._gri,b=UUID._ha;return b(a(32),8)+\"-\"+b(a(16),4)+\"-\"+b(16384|a(12),4)+\"-\"+b(32768|a(14),4)+\"-\"+b(a(48),12)};UUID._gri=function(a){return 0>a?NaN:30>=a?0|Math.random()*(1<<a):53>=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<<a-30)):NaN};UUID._ha=function(a,b){for(var c=a.toString(16),d=b-c.length,e=\"0\";0<d;d>>>=1,e+=e)d&1&&(c=e+c);return c};\n\n //END REPLACE\nreturn UUID;\n});\n;// wrap the utility libraries needed in ./lib\n// http://google-maps-utility-library-v3.googlecode.com/svn/\nangular.module('uiGmapgoogle-maps.wrapped')\n.service('uiGmapGoogleMapsUtilV3', function () {\n return {\n init: _.once(function () {\n //BEGIN REPLACE\n /* istanbul ignore next */\n +function(){\n /**\n * @name InfoBox\n * @version 1.1.13 [March 19, 2014]\n * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)\n * @copyright Copyright 2010 Gary Little [gary at luxcentral.com]\n * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class.\n * <p>\n * An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several\n * additional properties for advanced styling. An InfoBox can also be used as a map label.\n * <p>\n * An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>.\n */\n\n/*!\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*jslint browser:true */\n/*global google */\n\n/**\n * @name InfoBoxOptions\n * @class This class represents the optional parameter passed to the {@link InfoBox} constructor.\n * @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node).\n * @property {boolean} [disableAutoPan=false] Disable auto-pan on <tt>open</tt>.\n * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.\n * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox\n * (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>)\n * to the map pixel corresponding to <tt>position</tt>.\n * @property {LatLng} position The geographic location at which to display the InfoBox.\n * @property {number} zIndex The CSS z-index style value for the InfoBox.\n * Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property.\n * @property {string} [boxClass=\"infoBox\"] The name of the CSS class defining the styles for the InfoBox container.\n * @property {Object} [boxStyle] An object literal whose properties define specific CSS\n * style values to be applied to the InfoBox. Style values defined here override those that may\n * be defined in the <code>boxClass</code> style sheet. If this property is changed after the\n * InfoBox has been created, all previously set styles (except those defined in the style sheet)\n * are removed from the InfoBox before the new style values are applied.\n * @property {string} closeBoxMargin The CSS margin style value for the close box.\n * The default is \"2px\" (a 2-pixel margin on all sides).\n * @property {string} closeBoxURL The URL of the image representing the close box.\n * Note: The default is the URL for Google's standard close box.\n * Set this property to \"\" if no close box is required.\n * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the\n * map edge after an auto-pan.\n * @property {boolean} [isHidden=false] Hide the InfoBox on <tt>open</tt>.\n * [Deprecated in favor of the <tt>visible</tt> property.]\n * @property {boolean} [visible=true] Show the InfoBox on <tt>open</tt>.\n * @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the <code>position</code>\n * location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned).\n * @property {string} pane The pane where the InfoBox is to appear (default is \"floatPane\").\n * Set the pane to \"mapPane\" if the InfoBox is being used as a map label.\n * Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object.\n * @property {boolean} enableEventPropagation Propagate mousedown, mousemove, mouseover, mouseout,\n * mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox\n * (default is <tt>false</tt> to mimic the behavior of a <tt>google.maps.InfoWindow</tt>). Set\n * this property to <tt>true</tt> if the InfoBox is being used as a map label.\n */\n\n/**\n * Creates an InfoBox with the options specified in {@link InfoBoxOptions}.\n * Call <tt>InfoBox.open</tt> to add the box to the map.\n * @constructor\n * @param {InfoBoxOptions} [opt_opts]\n */\nfunction InfoBox(opt_opts) {\n\n opt_opts = opt_opts || {};\n\n google.maps.OverlayView.apply(this, arguments);\n\n // Standard options (in common with google.maps.InfoWindow):\n //\n this.content_ = opt_opts.content || \"\";\n this.disableAutoPan_ = opt_opts.disableAutoPan || false;\n this.maxWidth_ = opt_opts.maxWidth || 0;\n this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0);\n this.position_ = opt_opts.position || new google.maps.LatLng(0, 0);\n this.zIndex_ = opt_opts.zIndex || null;\n\n // Additional options (unique to InfoBox):\n //\n this.boxClass_ = opt_opts.boxClass || \"infoBox\";\n this.boxStyle_ = opt_opts.boxStyle || {};\n this.closeBoxMargin_ = opt_opts.closeBoxMargin || \"2px\";\n this.closeBoxURL_ = opt_opts.closeBoxURL || \"http://www.google.com/intl/en_us/mapfiles/close.gif\";\n if (opt_opts.closeBoxURL === \"\") {\n this.closeBoxURL_ = \"\";\n }\n this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1);\n\n if (typeof opt_opts.visible === \"undefined\") {\n if (typeof opt_opts.isHidden === \"undefined\") {\n opt_opts.visible = true;\n } else {\n opt_opts.visible = !opt_opts.isHidden;\n }\n }\n this.isHidden_ = !opt_opts.visible;\n\n this.alignBottom_ = opt_opts.alignBottom || false;\n this.pane_ = opt_opts.pane || \"floatPane\";\n this.enableEventPropagation_ = opt_opts.enableEventPropagation || false;\n\n this.div_ = null;\n this.closeListener_ = null;\n this.moveListener_ = null;\n this.contextListener_ = null;\n this.eventListeners_ = null;\n this.fixedWidthSet_ = null;\n}\n\n/* InfoBox extends OverlayView in the Google Maps API v3.\n */\nInfoBox.prototype = new google.maps.OverlayView();\n\n/**\n * Creates the DIV representing the InfoBox.\n * @private\n */\nInfoBox.prototype.createInfoBoxDiv_ = function () {\n\n var i;\n var events;\n var bw;\n var me = this;\n\n // This handler prevents an event in the InfoBox from being passed on to the map.\n //\n var cancelHandler = function (e) {\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n };\n\n // This handler ignores the current event in the InfoBox and conditionally prevents\n // the event from being passed on to the map. It is used for the contextmenu event.\n //\n var ignoreHandler = function (e) {\n\n e.returnValue = false;\n\n if (e.preventDefault) {\n\n e.preventDefault();\n }\n\n if (!me.enableEventPropagation_) {\n\n cancelHandler(e);\n }\n };\n\n if (!this.div_) {\n\n this.div_ = document.createElement(\"div\");\n\n this.setBoxStyle_();\n\n if (typeof this.content_.nodeType === \"undefined\") {\n this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;\n } else {\n this.div_.innerHTML = this.getCloseBoxImg_();\n this.div_.appendChild(this.content_);\n }\n\n // Add the InfoBox DIV to the DOM\n this.getPanes()[this.pane_].appendChild(this.div_);\n\n this.addClickHandler_();\n\n if (this.div_.style.width) {\n\n this.fixedWidthSet_ = true;\n\n } else {\n\n if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) {\n\n this.div_.style.width = this.maxWidth_;\n this.div_.style.overflow = \"auto\";\n this.fixedWidthSet_ = true;\n\n } else { // The following code is needed to overcome problems with MSIE\n\n bw = this.getBoxWidths_();\n\n this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + \"px\";\n this.fixedWidthSet_ = false;\n }\n }\n\n this.panBox_(this.disableAutoPan_);\n\n if (!this.enableEventPropagation_) {\n\n this.eventListeners_ = [];\n\n // Cancel event propagation.\n //\n // Note: mousemove not included (to resolve Issue 152)\n events = [\"mousedown\", \"mouseover\", \"mouseout\", \"mouseup\",\n \"click\", \"dblclick\", \"touchstart\", \"touchend\", \"touchmove\"];\n\n for (i = 0; i < events.length; i++) {\n\n this.eventListeners_.push(google.maps.event.addDomListener(this.div_, events[i], cancelHandler));\n }\n \n // Workaround for Google bug that causes the cursor to change to a pointer\n // when the mouse moves over a marker underneath InfoBox.\n this.eventListeners_.push(google.maps.event.addDomListener(this.div_, \"mouseover\", function (e) {\n this.style.cursor = \"default\";\n }));\n }\n\n this.contextListener_ = google.maps.event.addDomListener(this.div_, \"contextmenu\", ignoreHandler);\n\n /**\n * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.\n * @name InfoBox#domready\n * @event\n */\n google.maps.event.trigger(this, \"domready\");\n }\n};\n\n/**\n * Returns the HTML <IMG> tag for the close box.\n * @private\n */\nInfoBox.prototype.getCloseBoxImg_ = function () {\n\n var img = \"\";\n\n if (this.closeBoxURL_ !== \"\") {\n\n img = \"<img\";\n img += \" src='\" + this.closeBoxURL_ + \"'\";\n img += \" align=right\"; // Do this because Opera chokes on style='float: right;'\n img += \" style='\";\n img += \" position: relative;\"; // Required by MSIE\n img += \" cursor: pointer;\";\n img += \" margin: \" + this.closeBoxMargin_ + \";\";\n img += \"'>\";\n }\n\n return img;\n};\n\n/**\n * Adds the click handler to the InfoBox close box.\n * @private\n */\nInfoBox.prototype.addClickHandler_ = function () {\n\n var closeBox;\n\n if (this.closeBoxURL_ !== \"\") {\n\n closeBox = this.div_.firstChild;\n this.closeListener_ = google.maps.event.addDomListener(closeBox, \"click\", this.getCloseClickHandler_());\n\n } else {\n\n this.closeListener_ = null;\n }\n};\n\n/**\n * Returns the function to call when the user clicks the close box of an InfoBox.\n * @private\n */\nInfoBox.prototype.getCloseClickHandler_ = function () {\n\n var me = this;\n\n return function (e) {\n\n // 1.0.3 fix: Always prevent propagation of a close box click to the map:\n e.cancelBubble = true;\n\n if (e.stopPropagation) {\n\n e.stopPropagation();\n }\n\n /**\n * This event is fired when the InfoBox's close box is clicked.\n * @name InfoBox#closeclick\n * @event\n */\n google.maps.event.trigger(me, \"closeclick\");\n\n me.close();\n };\n};\n\n/**\n * Pans the map so that the InfoBox appears entirely within the map's visible area.\n * @private\n */\nInfoBox.prototype.panBox_ = function (disablePan) {\n\n var map;\n var bounds;\n var xOffset = 0, yOffset = 0;\n\n if (!disablePan) {\n\n map = this.getMap();\n\n if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama\n\n if (!map.getBounds().contains(this.position_)) {\n // Marker not in visible area of map, so set center\n // of map to the marker position first.\n map.setCenter(this.position_);\n }\n\n bounds = map.getBounds();\n\n var mapDiv = map.getDiv();\n var mapWidth = mapDiv.offsetWidth;\n var mapHeight = mapDiv.offsetHeight;\n var iwOffsetX = this.pixelOffset_.width;\n var iwOffsetY = this.pixelOffset_.height;\n var iwWidth = this.div_.offsetWidth;\n var iwHeight = this.div_.offsetHeight;\n var padX = this.infoBoxClearance_.width;\n var padY = this.infoBoxClearance_.height;\n var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_);\n\n if (pixPosition.x < (-iwOffsetX + padX)) {\n xOffset = pixPosition.x + iwOffsetX - padX;\n } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {\n xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;\n }\n if (this.alignBottom_) {\n if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {\n yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;\n } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {\n yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;\n }\n } else {\n if (pixPosition.y < (-iwOffsetY + padY)) {\n yOffset = pixPosition.y + iwOffsetY - padY;\n } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {\n yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;\n }\n }\n\n if (!(xOffset === 0 && yOffset === 0)) {\n\n // Move the map to the shifted center.\n //\n var c = map.getCenter();\n map.panBy(xOffset, yOffset);\n }\n }\n }\n};\n\n/**\n * Sets the style of the InfoBox by setting the style sheet and applying\n * other specific styles requested.\n * @private\n */\nInfoBox.prototype.setBoxStyle_ = function () {\n\n var i, boxStyle;\n\n if (this.div_) {\n\n // Apply style values from the style sheet defined in the boxClass parameter:\n this.div_.className = this.boxClass_;\n\n // Clear existing inline style values:\n this.div_.style.cssText = \"\";\n\n // Apply style values defined in the boxStyle parameter:\n boxStyle = this.boxStyle_;\n for (i in boxStyle) {\n\n if (boxStyle.hasOwnProperty(i)) {\n\n this.div_.style[i] = boxStyle[i];\n }\n }\n\n // Fix for iOS disappearing InfoBox problem.\n // See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad\n this.div_.style.WebkitTransform = \"translateZ(0)\";\n\n // Fix up opacity style for benefit of MSIE:\n //\n if (typeof this.div_.style.opacity !== \"undefined\" && this.div_.style.opacity !== \"\") {\n // See http://www.quirksmode.org/css/opacity.html\n this.div_.style.MsFilter = \"\\\"progid:DXImageTransform.Microsoft.Alpha(Opacity=\" + (this.div_.style.opacity * 100) + \")\\\"\";\n this.div_.style.filter = \"alpha(opacity=\" + (this.div_.style.opacity * 100) + \")\";\n }\n\n // Apply required styles:\n //\n this.div_.style.position = \"absolute\";\n this.div_.style.visibility = 'hidden';\n if (this.zIndex_ !== null) {\n\n this.div_.style.zIndex = this.zIndex_;\n }\n }\n};\n\n/**\n * Get the widths of the borders of the InfoBox.\n * @private\n * @return {Object} widths object (top, bottom left, right)\n */\nInfoBox.prototype.getBoxWidths_ = function () {\n\n var computedStyle;\n var bw = {top: 0, bottom: 0, left: 0, right: 0};\n var box = this.div_;\n\n if (document.defaultView && document.defaultView.getComputedStyle) {\n\n computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, \"\");\n\n if (computedStyle) {\n\n // The computed styles are always in pixel units (good!)\n bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;\n bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;\n bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;\n bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;\n }\n\n } else if (document.documentElement.currentStyle) { // MSIE\n\n if (box.currentStyle) {\n\n // The current styles may not be in pixel units, but assume they are (bad!)\n bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0;\n bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0;\n bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0;\n bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0;\n }\n }\n\n return bw;\n};\n\n/**\n * Invoked when <tt>close</tt> is called. Do not call it directly.\n */\nInfoBox.prototype.onRemove = function () {\n\n if (this.div_) {\n\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n/**\n * Draws the InfoBox based on the current map projection and zoom level.\n */\nInfoBox.prototype.draw = function () {\n\n this.createInfoBoxDiv_();\n\n var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_);\n\n this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + \"px\";\n \n if (this.alignBottom_) {\n this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + \"px\";\n } else {\n this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + \"px\";\n }\n\n if (this.isHidden_) {\n\n this.div_.style.visibility = \"hidden\";\n\n } else {\n\n this.div_.style.visibility = \"visible\";\n }\n};\n\n/**\n * Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>,\n * <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt>\n * properties have no affect until the current InfoBox is <tt>close</tt>d and a new one\n * is <tt>open</tt>ed.\n * @param {InfoBoxOptions} opt_opts\n */\nInfoBox.prototype.setOptions = function (opt_opts) {\n if (typeof opt_opts.boxClass !== \"undefined\") { // Must be first\n\n this.boxClass_ = opt_opts.boxClass;\n this.setBoxStyle_();\n }\n if (typeof opt_opts.boxStyle !== \"undefined\") { // Must be second\n\n this.boxStyle_ = opt_opts.boxStyle;\n this.setBoxStyle_();\n }\n if (typeof opt_opts.content !== \"undefined\") {\n\n this.setContent(opt_opts.content);\n }\n if (typeof opt_opts.disableAutoPan !== \"undefined\") {\n\n this.disableAutoPan_ = opt_opts.disableAutoPan;\n }\n if (typeof opt_opts.maxWidth !== \"undefined\") {\n\n this.maxWidth_ = opt_opts.maxWidth;\n }\n if (typeof opt_opts.pixelOffset !== \"undefined\") {\n\n this.pixelOffset_ = opt_opts.pixelOffset;\n }\n if (typeof opt_opts.alignBottom !== \"undefined\") {\n\n this.alignBottom_ = opt_opts.alignBottom;\n }\n if (typeof opt_opts.position !== \"undefined\") {\n\n this.setPosition(opt_opts.position);\n }\n if (typeof opt_opts.zIndex !== \"undefined\") {\n\n this.setZIndex(opt_opts.zIndex);\n }\n if (typeof opt_opts.closeBoxMargin !== \"undefined\") {\n\n this.closeBoxMargin_ = opt_opts.closeBoxMargin;\n }\n if (typeof opt_opts.closeBoxURL !== \"undefined\") {\n\n this.closeBoxURL_ = opt_opts.closeBoxURL;\n }\n if (typeof opt_opts.infoBoxClearance !== \"undefined\") {\n\n this.infoBoxClearance_ = opt_opts.infoBoxClearance;\n }\n if (typeof opt_opts.isHidden !== \"undefined\") {\n\n this.isHidden_ = opt_opts.isHidden;\n }\n if (typeof opt_opts.visible !== \"undefined\") {\n\n this.isHidden_ = !opt_opts.visible;\n }\n if (typeof opt_opts.enableEventPropagation !== \"undefined\") {\n\n this.enableEventPropagation_ = opt_opts.enableEventPropagation;\n }\n\n if (this.div_) {\n\n this.draw();\n }\n};\n\n/**\n * Sets the content of the InfoBox.\n * The content can be plain text or an HTML DOM node.\n * @param {string|Node} content\n */\nInfoBox.prototype.setContent = function (content) {\n this.content_ = content;\n\n if (this.div_) {\n\n if (this.closeListener_) {\n\n google.maps.event.removeListener(this.closeListener_);\n this.closeListener_ = null;\n }\n\n // Odd code required to make things work with MSIE.\n //\n if (!this.fixedWidthSet_) {\n\n this.div_.style.width = \"\";\n }\n\n if (typeof content.nodeType === \"undefined\") {\n this.div_.innerHTML = this.getCloseBoxImg_() + content;\n } else {\n this.div_.innerHTML = this.getCloseBoxImg_();\n this.div_.appendChild(content);\n }\n\n // Perverse code required to make things work with MSIE.\n // (Ensures the close box does, in fact, float to the right.)\n //\n if (!this.fixedWidthSet_) {\n this.div_.style.width = this.div_.offsetWidth + \"px\";\n if (typeof content.nodeType === \"undefined\") {\n this.div_.innerHTML = this.getCloseBoxImg_() + content;\n } else {\n this.div_.innerHTML = this.getCloseBoxImg_();\n this.div_.appendChild(content);\n }\n }\n\n this.addClickHandler_();\n }\n\n /**\n * This event is fired when the content of the InfoBox changes.\n * @name InfoBox#content_changed\n * @event\n */\n google.maps.event.trigger(this, \"content_changed\");\n};\n\n/**\n * Sets the geographic location of the InfoBox.\n * @param {LatLng} latlng\n */\nInfoBox.prototype.setPosition = function (latlng) {\n\n this.position_ = latlng;\n\n if (this.div_) {\n\n this.draw();\n }\n\n /**\n * This event is fired when the position of the InfoBox changes.\n * @name InfoBox#position_changed\n * @event\n */\n google.maps.event.trigger(this, \"position_changed\");\n};\n\n/**\n * Sets the zIndex style for the InfoBox.\n * @param {number} index\n */\nInfoBox.prototype.setZIndex = function (index) {\n\n this.zIndex_ = index;\n\n if (this.div_) {\n\n this.div_.style.zIndex = index;\n }\n\n /**\n * This event is fired when the zIndex of the InfoBox changes.\n * @name InfoBox#zindex_changed\n * @event\n */\n google.maps.event.trigger(this, \"zindex_changed\");\n};\n\n/**\n * Sets the visibility of the InfoBox.\n * @param {boolean} isVisible\n */\nInfoBox.prototype.setVisible = function (isVisible) {\n\n this.isHidden_ = !isVisible;\n if (this.div_) {\n this.div_.style.visibility = (this.isHidden_ ? \"hidden\" : \"visible\");\n }\n};\n\n/**\n * Returns the content of the InfoBox.\n * @returns {string}\n */\nInfoBox.prototype.getContent = function () {\n\n return this.content_;\n};\n\n/**\n * Returns the geographic location of the InfoBox.\n * @returns {LatLng}\n */\nInfoBox.prototype.getPosition = function () {\n\n return this.position_;\n};\n\n/**\n * Returns the zIndex for the InfoBox.\n * @returns {number}\n */\nInfoBox.prototype.getZIndex = function () {\n\n return this.zIndex_;\n};\n\n/**\n * Returns a flag indicating whether the InfoBox is visible.\n * @returns {boolean}\n */\nInfoBox.prototype.getVisible = function () {\n\n var isVisible;\n\n if ((typeof this.getMap() === \"undefined\") || (this.getMap() === null)) {\n isVisible = false;\n } else {\n isVisible = !this.isHidden_;\n }\n return isVisible;\n};\n\n/**\n * Shows the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.]\n */\nInfoBox.prototype.show = function () {\n\n this.isHidden_ = false;\n if (this.div_) {\n this.div_.style.visibility = \"visible\";\n }\n};\n\n/**\n * Hides the InfoBox. [Deprecated; use <tt>setVisible</tt> instead.]\n */\nInfoBox.prototype.hide = function () {\n\n this.isHidden_ = true;\n if (this.div_) {\n this.div_.style.visibility = \"hidden\";\n }\n};\n\n/**\n * Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt>\n * (usually a <tt>google.maps.Marker</tt>) is specified, the position\n * of the InfoBox is set to the position of the <tt>anchor</tt>. If the\n * anchor is dragged to a new location, the InfoBox moves as well.\n * @param {Map|StreetViewPanorama} map\n * @param {MVCObject} [anchor]\n */\nInfoBox.prototype.open = function (map, anchor) {\n\n var me = this;\n\n if (anchor) {\n\n this.position_ = anchor.getPosition();\n this.moveListener_ = google.maps.event.addListener(anchor, \"position_changed\", function () {\n me.setPosition(this.getPosition());\n });\n }\n\n this.setMap(map);\n\n if (this.div_) {\n\n this.panBox_();\n }\n};\n\n/**\n * Removes the InfoBox from the map.\n */\nInfoBox.prototype.close = function () {\n\n var i;\n\n if (this.closeListener_) {\n\n google.maps.event.removeListener(this.closeListener_);\n this.closeListener_ = null;\n }\n\n if (this.eventListeners_) {\n \n for (i = 0; i < this.eventListeners_.length; i++) {\n\n google.maps.event.removeListener(this.eventListeners_[i]);\n }\n this.eventListeners_ = null;\n }\n\n if (this.moveListener_) {\n\n google.maps.event.removeListener(this.moveListener_);\n this.moveListener_ = null;\n }\n\n if (this.contextListener_) {\n\n google.maps.event.removeListener(this.contextListener_);\n this.contextListener_ = null;\n }\n\n this.setMap(null);\n};\n\n/**\n * @name KeyDragZoom for V3\n * @version 2.0.9 [December 17, 2012] NOT YET RELEASED\n * @author: Nianwei Liu [nianwei at gmail dot com] & Gary Little [gary at luxcentral dot com]\n * @fileoverview This library adds a drag zoom capability to a V3 Google map.\n * When drag zoom is enabled, holding down a designated hot key <code>(shift | ctrl | alt)</code>\n * while dragging a box around an area of interest will zoom the map in to that area when\n * the mouse button is released. Optionally, a visual control can also be supplied for turning\n * a drag zoom operation on and off.\n * Only one line of code is needed: <code>google.maps.Map.enableKeyDragZoom();</code>\n * <p>\n * NOTE: Do not use Ctrl as the hot key with Google Maps JavaScript API V3 since, unlike with V2,\n * it causes a context menu to appear when running on the Macintosh.\n * <p>\n * Note that if the map's container has a border around it, the border widths must be specified\n * in pixel units (or as thin, medium, or thick). This is required because of an MSIE limitation.\n * <p>NL: 2009-05-28: initial port to core API V3.\n * <br>NL: 2009-11-02: added a temp fix for -moz-transform for FF3.5.x using code from Paul Kulchenko (http://notebook.kulchenko.com/maps/gridmove).\n * <br>NL: 2010-02-02: added a fix for IE flickering on divs onmousemove, caused by scroll value when get mouse position.\n * <br>GL: 2010-06-15: added a visual control option.\n */\n/*!\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n(function () {\n /*jslint browser:true */\n /*global window,google */\n /* Utility functions use \"var funName=function()\" syntax to allow use of the */\n /* Dean Edwards Packer compression tool (with Shrink variables, without Base62 encode). */\n\n /**\n * Converts \"thin\", \"medium\", and \"thick\" to pixel widths\n * in an MSIE environment. Not called for other browsers\n * because getComputedStyle() returns pixel widths automatically.\n * @param {string} widthValue The value of the border width parameter.\n */\n var toPixels = function (widthValue) {\n var px;\n switch (widthValue) {\n case \"thin\":\n px = \"2px\";\n break;\n case \"medium\":\n px = \"4px\";\n break;\n case \"thick\":\n px = \"6px\";\n break;\n default:\n px = widthValue;\n }\n return px;\n };\n /**\n * Get the widths of the borders of an HTML element.\n *\n * @param {Node} h The HTML element.\n * @return {Object} The width object {top, bottom left, right}.\n */\n var getBorderWidths = function (h) {\n var computedStyle;\n var bw = {};\n if (document.defaultView && document.defaultView.getComputedStyle) {\n computedStyle = h.ownerDocument.defaultView.getComputedStyle(h, \"\");\n if (computedStyle) {\n // The computed styles are always in pixel units (good!)\n bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;\n bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;\n bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;\n bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;\n return bw;\n }\n } else if (document.documentElement.currentStyle) { // MSIE\n if (h.currentStyle) {\n // The current styles may not be in pixel units so try to convert (bad!)\n bw.top = parseInt(toPixels(h.currentStyle.borderTopWidth), 10) || 0;\n bw.bottom = parseInt(toPixels(h.currentStyle.borderBottomWidth), 10) || 0;\n bw.left = parseInt(toPixels(h.currentStyle.borderLeftWidth), 10) || 0;\n bw.right = parseInt(toPixels(h.currentStyle.borderRightWidth), 10) || 0;\n return bw;\n }\n }\n // Shouldn't get this far for any modern browser\n bw.top = parseInt(h.style[\"border-top-width\"], 10) || 0;\n bw.bottom = parseInt(h.style[\"border-bottom-width\"], 10) || 0;\n bw.left = parseInt(h.style[\"border-left-width\"], 10) || 0;\n bw.right = parseInt(h.style[\"border-right-width\"], 10) || 0;\n return bw;\n };\n\n // Page scroll values for use by getMousePosition. To prevent flickering on MSIE\n // they are calculated only when the document actually scrolls, not every time the\n // mouse moves (as they would be if they were calculated inside getMousePosition).\n var scroll = {\n x: 0,\n y: 0\n };\n var getScrollValue = function (e) {\n scroll.x = (typeof document.documentElement.scrollLeft !== \"undefined\" ? document.documentElement.scrollLeft : document.body.scrollLeft);\n scroll.y = (typeof document.documentElement.scrollTop !== \"undefined\" ? document.documentElement.scrollTop : document.body.scrollTop);\n };\n getScrollValue();\n\n /**\n * Get the position of the mouse relative to the document.\n * @param {Event} e The mouse event.\n * @return {Object} The position object {left, top}.\n */\n var getMousePosition = function (e) {\n var posX = 0, posY = 0;\n e = e || window.event;\n if (typeof e.pageX !== \"undefined\") {\n posX = e.pageX;\n posY = e.pageY;\n } else if (typeof e.clientX !== \"undefined\") { // MSIE\n posX = e.clientX + scroll.x;\n posY = e.clientY + scroll.y;\n }\n return {\n left: posX,\n top: posY\n };\n };\n /**\n * Get the position of an HTML element relative to the document.\n * @param {Node} h The HTML element.\n * @return {Object} The position object {left, top}.\n */\n var getElementPosition = function (h) {\n var posX = h.offsetLeft;\n var posY = h.offsetTop;\n var parent = h.offsetParent;\n // Add offsets for all ancestors in the hierarchy\n while (parent !== null) {\n // Adjust for scrolling elements which may affect the map position.\n //\n // See http://www.howtocreate.co.uk/tutorials/javascript/browserspecific\n //\n // \"...make sure that every element [on a Web page] with an overflow\n // of anything other than visible also has a position style set to\n // something other than the default static...\"\n if (parent !== document.body && parent !== document.documentElement) {\n posX -= parent.scrollLeft;\n posY -= parent.scrollTop;\n }\n // See http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/4cb86c0c1037a5e5\n // Example: http://notebook.kulchenko.com/maps/gridmove\n var m = parent;\n // This is the \"normal\" way to get offset information:\n var moffx = m.offsetLeft;\n var moffy = m.offsetTop;\n // This covers those cases where a transform is used:\n if (!moffx && !moffy && window.getComputedStyle) {\n var matrix = document.defaultView.getComputedStyle(m, null).MozTransform ||\n document.defaultView.getComputedStyle(m, null).WebkitTransform;\n if (matrix) {\n if (typeof matrix === \"string\") {\n var parms = matrix.split(\",\");\n moffx += parseInt(parms[4], 10) || 0;\n moffy += parseInt(parms[5], 10) || 0;\n }\n }\n }\n posX += moffx;\n posY += moffy;\n parent = parent.offsetParent;\n }\n return {\n left: posX,\n top: posY\n };\n };\n /**\n * Set the properties of an object to those from another object.\n * @param {Object} obj The target object.\n * @param {Object} vals The source object.\n */\n var setVals = function (obj, vals) {\n if (obj && vals) {\n for (var x in vals) {\n if (vals.hasOwnProperty(x)) {\n obj[x] = vals[x];\n }\n }\n }\n return obj;\n };\n /**\n * Set the opacity. If op is not passed in, this function just performs an MSIE fix.\n * @param {Node} h The HTML element.\n * @param {number} op The opacity value (0-1).\n */\n var setOpacity = function (h, op) {\n if (typeof op !== \"undefined\") {\n h.style.opacity = op;\n }\n if (typeof h.style.opacity !== \"undefined\" && h.style.opacity !== \"\") {\n h.style.filter = \"alpha(opacity=\" + (h.style.opacity * 100) + \")\";\n }\n };\n /**\n * @name KeyDragZoomOptions\n * @class This class represents the optional parameter passed into <code>google.maps.Map.enableKeyDragZoom</code>.\n * @property {string} [key=\"shift\"] The hot key to hold down to activate a drag zoom, <code>shift | ctrl | alt</code>.\n * NOTE: Do not use Ctrl as the hot key with Google Maps JavaScript API V3 since, unlike with V2,\n * it causes a context menu to appear when running on the Macintosh. Also note that the\n * <code>alt</code> hot key refers to the Option key on a Macintosh.\n * @property {Object} [boxStyle={border: \"4px solid #736AFF\"}]\n * An object literal defining the CSS styles of the zoom box.\n * Border widths must be specified in pixel units (or as thin, medium, or thick).\n * @property {Object} [veilStyle={backgroundColor: \"gray\", opacity: 0.25, cursor: \"crosshair\"}]\n * An object literal defining the CSS styles of the veil pane which covers the map when a drag\n * zoom is activated. The previous name for this property was <code>paneStyle</code> but the use\n * of this name is now deprecated.\n * @property {boolean} [noZoom=false] A flag indicating whether to disable zooming after an area is\n * selected. Set this to <code>true</code> to allow KeyDragZoom to be used as a simple area\n * selection tool.\n * @property {boolean} [visualEnabled=false] A flag indicating whether a visual control is to be used.\n * @property {string} [visualClass=\"\"] The name of the CSS class defining the styles for the visual\n * control. To prevent the visual control from being printed, set this property to the name of\n * a class, defined inside a <code>@media print</code> rule, which sets the CSS\n * <code>display</code> style to <code>none</code>.\n * @property {ControlPosition} [visualPosition=google.maps.ControlPosition.LEFT_TOP]\n * The position of the visual control.\n * @property {Size} [visualPositionOffset=google.maps.Size(35, 0)] The width and height values\n * provided by this property are the offsets (in pixels) from the location at which the control\n * would normally be drawn to the desired drawing location.\n * @property {number} [visualPositionIndex=null] The index of the visual control.\n * The index is for controlling the placement of the control relative to other controls at the\n * position given by <code>visualPosition</code>; controls with a lower index are placed first.\n * Use a negative value to place the control <i>before</i> any default controls. No index is\n * generally required.\n * @property {String} [visualSprite=\"http://maps.gstatic.com/mapfiles/ftr/controls/dragzoom_btn.png\"]\n * The URL of the sprite image used for showing the visual control in the on, off, and hot\n * (i.e., when the mouse is over the control) states. The three images within the sprite must\n * be the same size and arranged in on-hot-off order in a single row with no spaces between images.\n * @property {Size} [visualSize=google.maps.Size(20, 20)] The width and height values provided by\n * this property are the size (in pixels) of each of the images within <code>visualSprite</code>.\n * @property {Object} [visualTips={off: \"Turn on drag zoom mode\", on: \"Turn off drag zoom mode\"}]\n * An object literal defining the help tips that appear when\n * the mouse moves over the visual control. The <code>off</code> property is the tip to be shown\n * when the control is off and the <code>on</code> property is the tip to be shown when the\n * control is on.\n */\n /**\n * @name DragZoom\n * @class This class represents a drag zoom object for a map. The object is activated by holding down the hot key\n * or by turning on the visual control.\n * This object is created when <code>google.maps.Map.enableKeyDragZoom</code> is called; it cannot be created directly.\n * Use <code>google.maps.Map.getDragZoomObject</code> to gain access to this object in order to attach event listeners.\n * @param {Map} map The map to which the DragZoom object is to be attached.\n * @param {KeyDragZoomOptions} [opt_zoomOpts] The optional parameters.\n */\n function DragZoom(map, opt_zoomOpts) {\n var me = this;\n var ov = new google.maps.OverlayView();\n ov.onAdd = function () {\n me.init_(map, opt_zoomOpts);\n };\n ov.draw = function () {\n };\n ov.onRemove = function () {\n };\n ov.setMap(map);\n this.prjov_ = ov;\n }\n /**\n * Initialize the tool.\n * @param {Map} map The map to which the DragZoom object is to be attached.\n * @param {KeyDragZoomOptions} [opt_zoomOpts] The optional parameters.\n */\n DragZoom.prototype.init_ = function (map, opt_zoomOpts) {\n var i;\n var me = this;\n this.map_ = map;\n opt_zoomOpts = opt_zoomOpts || {};\n this.key_ = opt_zoomOpts.key || \"shift\";\n this.key_ = this.key_.toLowerCase();\n this.borderWidths_ = getBorderWidths(this.map_.getDiv());\n this.veilDiv_ = [];\n for (i = 0; i < 4; i++) {\n this.veilDiv_[i] = document.createElement(\"div\");\n // Prevents selection of other elements on the webpage\n // when a drag zoom operation is in progress:\n this.veilDiv_[i].onselectstart = function () {\n return false;\n };\n // Apply default style values for the veil:\n setVals(this.veilDiv_[i].style, {\n backgroundColor: \"gray\",\n opacity: 0.25,\n cursor: \"crosshair\"\n });\n // Apply style values specified in veilStyle parameter:\n setVals(this.veilDiv_[i].style, opt_zoomOpts.paneStyle); // Old option name was \"paneStyle\"\n setVals(this.veilDiv_[i].style, opt_zoomOpts.veilStyle); // New name is \"veilStyle\"\n // Apply mandatory style values:\n setVals(this.veilDiv_[i].style, {\n position: \"absolute\",\n overflow: \"hidden\",\n display: \"none\"\n });\n // Workaround for Firefox Shift-Click problem:\n if (this.key_ === \"shift\") {\n this.veilDiv_[i].style.MozUserSelect = \"none\";\n }\n setOpacity(this.veilDiv_[i]);\n // An IE fix: If the background is transparent it cannot capture mousedown\n // events, so if it is, change the background to white with 0 opacity.\n if (this.veilDiv_[i].style.backgroundColor === \"transparent\") {\n this.veilDiv_[i].style.backgroundColor = \"white\";\n setOpacity(this.veilDiv_[i], 0);\n }\n this.map_.getDiv().appendChild(this.veilDiv_[i]);\n }\n\n this.noZoom_ = opt_zoomOpts.noZoom || false;\n this.visualEnabled_ = opt_zoomOpts.visualEnabled || false;\n this.visualClass_ = opt_zoomOpts.visualClass || \"\";\n this.visualPosition_ = opt_zoomOpts.visualPosition || google.maps.ControlPosition.LEFT_TOP;\n this.visualPositionOffset_ = opt_zoomOpts.visualPositionOffset || new google.maps.Size(35, 0);\n this.visualPositionIndex_ = opt_zoomOpts.visualPositionIndex || null;\n this.visualSprite_ = opt_zoomOpts.visualSprite || \"http\" + (document.location.protocol === \"https:\" ? \"s\" : \"\") + \"://maps.gstatic.com/mapfiles/ftr/controls/dragzoom_btn.png\";\n this.visualSize_ = opt_zoomOpts.visualSize || new google.maps.Size(20, 20);\n this.visualTips_ = opt_zoomOpts.visualTips || {};\n this.visualTips_.off = this.visualTips_.off || \"Turn on drag zoom mode\";\n this.visualTips_.on = this.visualTips_.on || \"Turn off drag zoom mode\";\n\n this.boxDiv_ = document.createElement(\"div\");\n // Apply default style values for the zoom box:\n setVals(this.boxDiv_.style, {\n border: \"4px solid #736AFF\"\n });\n // Apply style values specified in boxStyle parameter:\n setVals(this.boxDiv_.style, opt_zoomOpts.boxStyle);\n // Apply mandatory style values:\n setVals(this.boxDiv_.style, {\n position: \"absolute\",\n display: \"none\"\n });\n setOpacity(this.boxDiv_);\n this.map_.getDiv().appendChild(this.boxDiv_);\n this.boxBorderWidths_ = getBorderWidths(this.boxDiv_);\n\n this.listeners_ = [\n google.maps.event.addDomListener(document, \"keydown\", function (e) {\n me.onKeyDown_(e);\n }),\n google.maps.event.addDomListener(document, \"keyup\", function (e) {\n me.onKeyUp_(e);\n }),\n google.maps.event.addDomListener(this.veilDiv_[0], \"mousedown\", function (e) {\n me.onMouseDown_(e);\n }),\n google.maps.event.addDomListener(this.veilDiv_[1], \"mousedown\", function (e) {\n me.onMouseDown_(e);\n }),\n google.maps.event.addDomListener(this.veilDiv_[2], \"mousedown\", function (e) {\n me.onMouseDown_(e);\n }),\n google.maps.event.addDomListener(this.veilDiv_[3], \"mousedown\", function (e) {\n me.onMouseDown_(e);\n }),\n google.maps.event.addDomListener(document, \"mousedown\", function (e) {\n me.onMouseDownDocument_(e);\n }),\n google.maps.event.addDomListener(document, \"mousemove\", function (e) {\n me.onMouseMove_(e);\n }),\n google.maps.event.addDomListener(document, \"mouseup\", function (e) {\n me.onMouseUp_(e);\n }),\n google.maps.event.addDomListener(window, \"scroll\", getScrollValue)\n ];\n\n this.hotKeyDown_ = false;\n this.mouseDown_ = false;\n this.dragging_ = false;\n this.startPt_ = null;\n this.endPt_ = null;\n this.mapWidth_ = null;\n this.mapHeight_ = null;\n this.mousePosn_ = null;\n this.mapPosn_ = null;\n\n if (this.visualEnabled_) {\n this.buttonDiv_ = this.initControl_(this.visualPositionOffset_);\n if (this.visualPositionIndex_ !== null) {\n this.buttonDiv_.index = this.visualPositionIndex_;\n }\n this.map_.controls[this.visualPosition_].push(this.buttonDiv_);\n this.controlIndex_ = this.map_.controls[this.visualPosition_].length - 1;\n }\n };\n /**\n * Initializes the visual control and returns its DOM element.\n * @param {Size} offset The offset of the control from its normal position.\n * @return {Node} The DOM element containing the visual control.\n */\n DragZoom.prototype.initControl_ = function (offset) {\n var control;\n var image;\n var me = this;\n \n control = document.createElement(\"div\");\n control.className = this.visualClass_;\n control.style.position = \"relative\";\n control.style.overflow = \"hidden\";\n control.style.height = this.visualSize_.height + \"px\";\n control.style.width = this.visualSize_.width + \"px\";\n control.title = this.visualTips_.off;\n image = document.createElement(\"img\");\n image.src = this.visualSprite_;\n image.style.position = \"absolute\";\n image.style.left = -(this.visualSize_.width * 2) + \"px\";\n image.style.top = 0 + \"px\";\n control.appendChild(image);\n control.onclick = function (e) {\n me.hotKeyDown_ = !me.hotKeyDown_;\n if (me.hotKeyDown_) {\n me.buttonDiv_.firstChild.style.left = -(me.visualSize_.width * 0) + \"px\";\n me.buttonDiv_.title = me.visualTips_.on;\n me.activatedByControl_ = true;\n google.maps.event.trigger(me, \"activate\");\n } else {\n me.buttonDiv_.firstChild.style.left = -(me.visualSize_.width * 2) + \"px\";\n me.buttonDiv_.title = me.visualTips_.off;\n google.maps.event.trigger(me, \"deactivate\");\n }\n me.onMouseMove_(e); // Updates the veil\n };\n control.onmouseover = function () {\n me.buttonDiv_.firstChild.style.left = -(me.visualSize_.width * 1) + \"px\";\n };\n control.onmouseout = function () {\n if (me.hotKeyDown_) {\n me.buttonDiv_.firstChild.style.left = -(me.visualSize_.width * 0) + \"px\";\n me.buttonDiv_.title = me.visualTips_.on;\n } else {\n me.buttonDiv_.firstChild.style.left = -(me.visualSize_.width * 2) + \"px\";\n me.buttonDiv_.title = me.visualTips_.off;\n }\n };\n control.ondragstart = function () {\n return false;\n };\n setVals(control.style, {\n cursor: \"pointer\",\n marginTop: offset.height + \"px\",\n marginLeft: offset.width + \"px\"\n });\n return control;\n };\n /**\n * Returns <code>true</code> if the hot key is being pressed when an event occurs.\n * @param {Event} e The keyboard event.\n * @return {boolean} Flag indicating whether the hot key is down.\n */\n DragZoom.prototype.isHotKeyDown_ = function (e) {\n var isHot;\n e = e || window.event;\n isHot = (e.shiftKey && this.key_ === \"shift\") || (e.altKey && this.key_ === \"alt\") || (e.ctrlKey && this.key_ === \"ctrl\");\n if (!isHot) {\n // Need to look at keyCode for Opera because it\n // doesn't set the shiftKey, altKey, ctrlKey properties\n // unless a non-modifier event is being reported.\n //\n // See http://cross-browser.com/x/examples/shift_mode.php\n // Also see http://unixpapa.com/js/key.html\n switch (e.keyCode) {\n case 16:\n if (this.key_ === \"shift\") {\n isHot = true;\n }\n break;\n case 17:\n if (this.key_ === \"ctrl\") {\n isHot = true;\n }\n break;\n case 18:\n if (this.key_ === \"alt\") {\n isHot = true;\n }\n break;\n }\n }\n return isHot;\n };\n /**\n * Returns <code>true</code> if the mouse is on top of the map div.\n * The position is captured in onMouseMove_.\n * @return {boolean}\n */\n DragZoom.prototype.isMouseOnMap_ = function () {\n var mousePosn = this.mousePosn_;\n if (mousePosn) {\n var mapPosn = this.mapPosn_;\n var mapDiv = this.map_.getDiv();\n return mousePosn.left > mapPosn.left && mousePosn.left < (mapPosn.left + mapDiv.offsetWidth) &&\n mousePosn.top > mapPosn.top && mousePosn.top < (mapPosn.top + mapDiv.offsetHeight);\n } else {\n // if user never moved mouse\n return false;\n }\n };\n /**\n * Show the veil if the hot key is down and the mouse is over the map,\n * otherwise hide the veil.\n */\n DragZoom.prototype.setVeilVisibility_ = function () {\n var i;\n if (this.map_ && this.hotKeyDown_ && this.isMouseOnMap_()) {\n var mapDiv = this.map_.getDiv();\n this.mapWidth_ = mapDiv.offsetWidth - (this.borderWidths_.left + this.borderWidths_.right);\n this.mapHeight_ = mapDiv.offsetHeight - (this.borderWidths_.top + this.borderWidths_.bottom);\n if (this.activatedByControl_) { // Veil covers entire map (except control)\n var left = parseInt(this.buttonDiv_.style.left, 10) + this.visualPositionOffset_.width;\n var top = parseInt(this.buttonDiv_.style.top, 10) + this.visualPositionOffset_.height;\n var width = this.visualSize_.width;\n var height = this.visualSize_.height;\n // Left veil rectangle:\n this.veilDiv_[0].style.top = \"0px\";\n this.veilDiv_[0].style.left = \"0px\";\n this.veilDiv_[0].style.width = left + \"px\";\n this.veilDiv_[0].style.height = this.mapHeight_ + \"px\";\n // Right veil rectangle:\n this.veilDiv_[1].style.top = \"0px\";\n this.veilDiv_[1].style.left = (left + width) + \"px\";\n this.veilDiv_[1].style.width = (this.mapWidth_ - (left + width)) + \"px\";\n this.veilDiv_[1].style.height = this.mapHeight_ + \"px\";\n // Top veil rectangle:\n this.veilDiv_[2].style.top = \"0px\";\n this.veilDiv_[2].style.left = left + \"px\";\n this.veilDiv_[2].style.width = width + \"px\";\n this.veilDiv_[2].style.height = top + \"px\";\n // Bottom veil rectangle:\n this.veilDiv_[3].style.top = (top + height) + \"px\";\n this.veilDiv_[3].style.left = left + \"px\";\n this.veilDiv_[3].style.width = width + \"px\";\n this.veilDiv_[3].style.height = (this.mapHeight_ - (top + height)) + \"px\";\n for (i = 0; i < this.veilDiv_.length; i++) {\n this.veilDiv_[i].style.display = \"block\";\n }\n } else {\n this.veilDiv_[0].style.left = \"0px\";\n this.veilDiv_[0].style.top = \"0px\";\n this.veilDiv_[0].style.width = this.mapWidth_ + \"px\";\n this.veilDiv_[0].style.height = this.mapHeight_ + \"px\";\n for (i = 1; i < this.veilDiv_.length; i++) {\n this.veilDiv_[i].style.width = \"0px\";\n this.veilDiv_[i].style.height = \"0px\";\n }\n for (i = 0; i < this.veilDiv_.length; i++) {\n this.veilDiv_[i].style.display = \"block\";\n }\n }\n } else {\n for (i = 0; i < this.veilDiv_.length; i++) {\n this.veilDiv_[i].style.display = \"none\";\n }\n }\n };\n /**\n * Handle key down. Show the veil if the hot key has been pressed.\n * @param {Event} e The keyboard event.\n */\n DragZoom.prototype.onKeyDown_ = function (e) {\n if (this.map_ && !this.hotKeyDown_ && this.isHotKeyDown_(e)) {\n this.mapPosn_ = getElementPosition(this.map_.getDiv());\n this.hotKeyDown_ = true;\n this.activatedByControl_ = false;\n this.setVeilVisibility_();\n /**\n * This event is fired when the hot key is pressed.\n * @name DragZoom#activate\n * @event\n */\n google.maps.event.trigger(this, \"activate\");\n }\n };\n /**\n * Get the <code>google.maps.Point</code> of the mouse position.\n * @param {Event} e The mouse event.\n * @return {Point} The mouse position.\n */\n DragZoom.prototype.getMousePoint_ = function (e) {\n var mousePosn = getMousePosition(e);\n var p = new google.maps.Point();\n p.x = mousePosn.left - this.mapPosn_.left - this.borderWidths_.left;\n p.y = mousePosn.top - this.mapPosn_.top - this.borderWidths_.top;\n p.x = Math.min(p.x, this.mapWidth_);\n p.y = Math.min(p.y, this.mapHeight_);\n p.x = Math.max(p.x, 0);\n p.y = Math.max(p.y, 0);\n return p;\n };\n /**\n * Handle mouse down.\n * @param {Event} e The mouse event.\n */\n DragZoom.prototype.onMouseDown_ = function (e) {\n if (this.map_ && this.hotKeyDown_) {\n this.mapPosn_ = getElementPosition(this.map_.getDiv());\n this.dragging_ = true;\n this.startPt_ = this.endPt_ = this.getMousePoint_(e);\n this.boxDiv_.style.width = this.boxDiv_.style.height = \"0px\";\n var prj = this.prjov_.getProjection();\n var latlng = prj.fromContainerPixelToLatLng(this.startPt_);\n /**\n * This event is fired when the drag operation begins.\n * The parameter passed is the geographic position of the starting point.\n * @name DragZoom#dragstart\n * @param {LatLng} latlng The geographic position of the starting point.\n * @event\n */\n google.maps.event.trigger(this, \"dragstart\", latlng);\n }\n };\n /**\n * Handle mouse down at the document level.\n * @param {Event} e The mouse event.\n */\n DragZoom.prototype.onMouseDownDocument_ = function (e) {\n this.mouseDown_ = true;\n };\n /**\n * Handle mouse move.\n * @param {Event} e The mouse event.\n */\n DragZoom.prototype.onMouseMove_ = function (e) {\n this.mousePosn_ = getMousePosition(e);\n if (this.dragging_) {\n this.endPt_ = this.getMousePoint_(e);\n var left = Math.min(this.startPt_.x, this.endPt_.x);\n var top = Math.min(this.startPt_.y, this.endPt_.y);\n var width = Math.abs(this.startPt_.x - this.endPt_.x);\n var height = Math.abs(this.startPt_.y - this.endPt_.y);\n // For benefit of MSIE 7/8 ensure following values are not negative:\n var boxWidth = Math.max(0, width - (this.boxBorderWidths_.left + this.boxBorderWidths_.right));\n var boxHeight = Math.max(0, height - (this.boxBorderWidths_.top + this.boxBorderWidths_.bottom));\n // Left veil rectangle:\n this.veilDiv_[0].style.top = \"0px\";\n this.veilDiv_[0].style.left = \"0px\";\n this.veilDiv_[0].style.width = left + \"px\";\n this.veilDiv_[0].style.height = this.mapHeight_ + \"px\";\n // Right veil rectangle:\n this.veilDiv_[1].style.top = \"0px\";\n this.veilDiv_[1].style.left = (left + width) + \"px\";\n this.veilDiv_[1].style.width = (this.mapWidth_ - (left + width)) + \"px\";\n this.veilDiv_[1].style.height = this.mapHeight_ + \"px\";\n // Top veil rectangle:\n this.veilDiv_[2].style.top = \"0px\";\n this.veilDiv_[2].style.left = left + \"px\";\n this.veilDiv_[2].style.width = width + \"px\";\n this.veilDiv_[2].style.height = top + \"px\";\n // Bottom veil rectangle:\n this.veilDiv_[3].style.top = (top + height) + \"px\";\n this.veilDiv_[3].style.left = left + \"px\";\n this.veilDiv_[3].style.width = width + \"px\";\n this.veilDiv_[3].style.height = (this.mapHeight_ - (top + height)) + \"px\";\n // Selection rectangle:\n this.boxDiv_.style.top = top + \"px\";\n this.boxDiv_.style.left = left + \"px\";\n this.boxDiv_.style.width = boxWidth + \"px\";\n this.boxDiv_.style.height = boxHeight + \"px\";\n this.boxDiv_.style.display = \"block\";\n /**\n * This event is fired repeatedly while the user drags a box across the area of interest.\n * The southwest and northeast point are passed as parameters of type <code>google.maps.Point</code>\n * (for performance reasons), relative to the map container. Also passed is the projection object\n * so that the event listener, if necessary, can convert the pixel positions to geographic\n * coordinates using <code>google.maps.MapCanvasProjection.fromContainerPixelToLatLng</code>.\n * @name DragZoom#drag\n * @param {Point} southwestPixel The southwest point of the selection area.\n * @param {Point} northeastPixel The northeast point of the selection area.\n * @param {MapCanvasProjection} prj The projection object.\n * @event\n */\n google.maps.event.trigger(this, \"drag\", new google.maps.Point(left, top + height), new google.maps.Point(left + width, top), this.prjov_.getProjection());\n } else if (!this.mouseDown_) {\n this.mapPosn_ = getElementPosition(this.map_.getDiv());\n this.setVeilVisibility_();\n }\n };\n /**\n * Handle mouse up.\n * @param {Event} e The mouse event.\n */\n DragZoom.prototype.onMouseUp_ = function (e) {\n var z;\n var me = this;\n this.mouseDown_ = false;\n if (this.dragging_) {\n if ((this.getMousePoint_(e).x === this.startPt_.x) && (this.getMousePoint_(e).y === this.startPt_.y)) {\n this.onKeyUp_(e); // Cancel event\n return;\n }\n var left = Math.min(this.startPt_.x, this.endPt_.x);\n var top = Math.min(this.startPt_.y, this.endPt_.y);\n var width = Math.abs(this.startPt_.x - this.endPt_.x);\n var height = Math.abs(this.startPt_.y - this.endPt_.y);\n // Google Maps API bug: setCenter() doesn't work as expected if the map has a\n // border on the left or top. The code here includes a workaround for this problem.\n var kGoogleCenteringBug = true;\n if (kGoogleCenteringBug) {\n left += this.borderWidths_.left;\n top += this.borderWidths_.top;\n }\n\n var prj = this.prjov_.getProjection();\n var sw = prj.fromContainerPixelToLatLng(new google.maps.Point(left, top + height));\n var ne = prj.fromContainerPixelToLatLng(new google.maps.Point(left + width, top));\n var bnds = new google.maps.LatLngBounds(sw, ne);\n\n if (this.noZoom_) {\n this.boxDiv_.style.display = \"none\";\n } else {\n // Sometimes fitBounds causes a zoom OUT, so restore original zoom level if this happens.\n z = this.map_.getZoom();\n this.map_.fitBounds(bnds);\n if (this.map_.getZoom() < z) {\n this.map_.setZoom(z);\n }\n\n // Redraw box after zoom:\n var swPt = prj.fromLatLngToContainerPixel(sw);\n var nePt = prj.fromLatLngToContainerPixel(ne);\n if (kGoogleCenteringBug) {\n swPt.x -= this.borderWidths_.left;\n swPt.y -= this.borderWidths_.top;\n nePt.x -= this.borderWidths_.left;\n nePt.y -= this.borderWidths_.top;\n }\n this.boxDiv_.style.left = swPt.x + \"px\";\n this.boxDiv_.style.top = nePt.y + \"px\";\n this.boxDiv_.style.width = (Math.abs(nePt.x - swPt.x) - (this.boxBorderWidths_.left + this.boxBorderWidths_.right)) + \"px\";\n this.boxDiv_.style.height = (Math.abs(nePt.y - swPt.y) - (this.boxBorderWidths_.top + this.boxBorderWidths_.bottom)) + \"px\";\n // Hide box asynchronously after 1 second:\n setTimeout(function () {\n me.boxDiv_.style.display = \"none\";\n }, 1000);\n }\n this.dragging_ = false;\n this.onMouseMove_(e); // Updates the veil\n /**\n * This event is fired when the drag operation ends.\n * The parameter passed is the geographic bounds of the selected area.\n * Note that this event is <i>not</i> fired if the hot key is released before the drag operation ends.\n * @name DragZoom#dragend\n * @param {LatLngBounds} bnds The geographic bounds of the selected area.\n * @event\n */\n google.maps.event.trigger(this, \"dragend\", bnds);\n // if the hot key isn't down, the drag zoom must have been activated by turning\n // on the visual control. In this case, finish up by simulating a key up event.\n if (!this.isHotKeyDown_(e)) {\n this.onKeyUp_(e);\n }\n }\n };\n /**\n * Handle key up.\n * @param {Event} e The keyboard event.\n */\n DragZoom.prototype.onKeyUp_ = function (e) {\n var i;\n var left, top, width, height, prj, sw, ne;\n var bnds = null;\n if (this.map_ && this.hotKeyDown_) {\n this.hotKeyDown_ = false;\n if (this.dragging_) {\n this.boxDiv_.style.display = \"none\";\n this.dragging_ = false;\n // Calculate the bounds when drag zoom was cancelled\n left = Math.min(this.startPt_.x, this.endPt_.x);\n top = Math.min(this.startPt_.y, this.endPt_.y);\n width = Math.abs(this.startPt_.x - this.endPt_.x);\n height = Math.abs(this.startPt_.y - this.endPt_.y);\n prj = this.prjov_.getProjection();\n sw = prj.fromContainerPixelToLatLng(new google.maps.Point(left, top + height));\n ne = prj.fromContainerPixelToLatLng(new google.maps.Point(left + width, top));\n bnds = new google.maps.LatLngBounds(sw, ne);\n }\n for (i = 0; i < this.veilDiv_.length; i++) {\n this.veilDiv_[i].style.display = \"none\";\n }\n if (this.visualEnabled_) {\n this.buttonDiv_.firstChild.style.left = -(this.visualSize_.width * 2) + \"px\";\n this.buttonDiv_.title = this.visualTips_.off;\n this.buttonDiv_.style.display = \"\";\n }\n /**\n * This event is fired when the hot key is released.\n * The parameter passed is the geographic bounds of the selected area immediately\n * before the hot key was released.\n * @name DragZoom#deactivate\n * @param {LatLngBounds} bnds The geographic bounds of the selected area immediately\n * before the hot key was released.\n * @event\n */\n google.maps.event.trigger(this, \"deactivate\", bnds);\n }\n };\n /**\n * @name google.maps.Map\n * @class These are new methods added to the Google Maps JavaScript API V3's\n * <a href=\"http://code.google.com/apis/maps/documentation/javascript/reference.html#Map\">Map</a>\n * class.\n */\n /**\n * Enables drag zoom. The user can zoom to an area of interest by holding down the hot key\n * <code>(shift | ctrl | alt )</code> while dragging a box around the area or by turning\n * on the visual control then dragging a box around the area.\n * @param {KeyDragZoomOptions} opt_zoomOpts The optional parameters.\n */\n google.maps.Map.prototype.enableKeyDragZoom = function (opt_zoomOpts) {\n this.dragZoom_ = new DragZoom(this, opt_zoomOpts);\n };\n /**\n * Disables drag zoom.\n */\n google.maps.Map.prototype.disableKeyDragZoom = function () {\n var i;\n var d = this.dragZoom_;\n if (d) {\n for (i = 0; i < d.listeners_.length; ++i) {\n google.maps.event.removeListener(d.listeners_[i]);\n }\n this.getDiv().removeChild(d.boxDiv_);\n for (i = 0; i < d.veilDiv_.length; i++) {\n this.getDiv().removeChild(d.veilDiv_[i]);\n }\n if (d.visualEnabled_) {\n // Remove the custom control:\n this.controls[d.visualPosition_].removeAt(d.controlIndex_);\n }\n d.prjov_.setMap(null);\n this.dragZoom_ = null;\n }\n };\n /**\n * Returns <code>true</code> if the drag zoom feature has been enabled.\n * @return {boolean}\n */\n google.maps.Map.prototype.keyDragZoomEnabled = function () {\n return this.dragZoom_ !== null;\n };\n /**\n * Returns the DragZoom object which is created when <code>google.maps.Map.enableKeyDragZoom</code> is called.\n * With this object you can use <code>google.maps.event.addListener</code> to attach event listeners\n * for the \"activate\", \"deactivate\", \"dragstart\", \"drag\", and \"dragend\" events.\n * @return {DragZoom}\n */\n google.maps.Map.prototype.getDragZoomObject = function () {\n return this.dragZoom_;\n };\n})();\n/**\n * @name MarkerClustererPlus for Google Maps V3\n * @version 2.1.1 [November 4, 2013]\n * @author Gary Little\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of markers.\n * <p>\n * This is an enhanced V3 implementation of the\n * <a href=\"http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/\"\n * >V2 MarkerClusterer</a> by Xiaoxi Wu. It is based on the\n * <a href=\"http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/\"\n * >V3 MarkerClusterer</a> port by Luke Mahe. MarkerClustererPlus was created by Gary Little.\n * <p>\n * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It\n * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>,\n * and <code>calculator</code> properties as well as support for four more events. It also allows\n * greater control over the styling of the text that appears on the cluster marker. The\n * documentation has been significantly improved and the overall code has been simplified and\n * polished. Very large numbers of markers can now be managed without causing Javascript timeout\n * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been\n * deprecated. The new name is <code>click</code>, so please change your application code now.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @name ClusterIconStyle\n * @class This class represents the object for values in the <code>styles</code> array passed\n * to the {@link MarkerClusterer} constructor. The element in this array that is used to\n * style the cluster icon is determined by calling the <code>calculator</code> function.\n *\n * @property {string} url The URL of the cluster icon image file. Required.\n * @property {number} height The display height (in pixels) of the cluster icon. Required.\n * @property {number} width The display width (in pixels) of the cluster icon. Required.\n * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to\n * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code>\n * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code>\n * increases to the right of center. The default is <code>[0, 0]</code>.\n * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the\n * spot on the cluster icon that is to be aligned with the cluster position. The format is\n * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and\n * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default\n * anchor position is the center of the cluster icon.\n * @property {string} [textColor=\"black\"] The color of the label text shown on the\n * cluster icon.\n * @property {number} [textSize=11] The size (in pixels) of the label text shown on the\n * cluster icon.\n * @property {string} [textDecoration=\"none\"] The value of the CSS <code>text-decoration</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontWeight=\"bold\"] The value of the CSS <code>font-weight</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontStyle=\"normal\"] The value of the CSS <code>font-style</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontFamily=\"Arial,sans-serif\"] The value of the CSS <code>font-family</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [backgroundPosition=\"0 0\"] The position of the cluster icon image\n * within the image defined by <code>url</code>. The format is <code>\"xpos ypos\"</code>\n * (the same format as for the CSS <code>background-position</code> property). You must set\n * this property appropriately when the image defined by <code>url</code> represents a sprite\n * containing multiple images. Note that the position <i>must</i> be specified in px units.\n */\n/**\n * @name ClusterIconInfo\n * @class This class is an object containing general information about a cluster icon. This is\n * the object that a <code>calculator</code> function returns.\n *\n * @property {string} text The text of the label to be shown on the cluster icon.\n * @property {number} index The index plus 1 of the element in the <code>styles</code>\n * array to be used to style the cluster icon.\n * @property {string} title The tooltip to display when the mouse moves over the cluster icon.\n * If this value is <code>undefined</code> or <code>\"\"</code>, <code>title</code> is set to the\n * value of the <code>title</code> property passed to the MarkerClusterer.\n */\n/**\n * A cluster icon.\n *\n * @constructor\n * @extends google.maps.OverlayView\n * @param {Cluster} cluster The cluster with which the icon is to be associated.\n * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons\n * to use for various cluster sizes.\n * @private\n */\nfunction ClusterIcon(cluster, styles) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cluster_ = cluster;\n this.className_ = cluster.getMarkerClusterer().getClusterClass();\n this.styles_ = styles;\n this.center_ = null;\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Adds the icon to the DOM.\n */\nClusterIcon.prototype.onAdd = function () {\n var cClusterIcon = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n\n this.div_ = document.createElement(\"div\");\n this.div_.className = this.className_;\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\n\n // Fix for Issue 157\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n\n google.maps.event.addDomListener(this.div_, \"mousedown\", function () {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n\n google.maps.event.addDomListener(this.div_, \"click\", function (e) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var theBounds;\n var mz;\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(mc, \"click\", cClusterIcon.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", cClusterIcon.cluster_); // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n mz = mc.getMaxZoom();\n theBounds = cClusterIcon.cluster_.getBounds();\n mc.getMap().fitBounds(theBounds);\n // There is a fix for Issue 170 here:\n setTimeout(function () {\n mc.getMap().fitBounds(theBounds);\n // Don't zoom beyond the max zoom level\n if (mz !== null && (mc.getMap().getZoom() > mz)) {\n mc.getMap().setZoom(mz + 1);\n }\n }, 100);\n }\n\n // Prevent event propagation to the map:\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseover\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseover\", cClusterIcon.cluster_);\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseout\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseout\", cClusterIcon.cluster_);\n });\n};\n\n\n/**\n * Removes the icon from the DOM.\n */\nClusterIcon.prototype.onRemove = function () {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Draws the icon.\n */\nClusterIcon.prototype.draw = function () {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n }\n};\n\n\n/**\n * Hides the icon.\n */\nClusterIcon.prototype.hide = function () {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n this.visible_ = false;\n};\n\n\n/**\n * Positions and shows the icon.\n */\nClusterIcon.prototype.show = function () {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].trim(), 10);\n var spriteV = parseInt(bp[1].trim(), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"<img src='\" + this.url_ + \"' style='position: absolute; top: \" + spriteV + \"px; left: \" + spriteH + \"px; \";\n if (!this.cluster_.getMarkerClusterer().enableRetinaIcons_) {\n img += \"clip: rect(\" + (-1 * spriteV) + \"px, \" + ((-1 * spriteH) + this.width_) + \"px, \" +\n ((-1 * spriteV) + this.height_) + \"px, \" + (-1 * spriteH) + \"px);\";\n }\n img += \"'>\";\n this.div_.innerHTML = img + \"<div style='\" +\n \"position: absolute;\" +\n \"top: \" + this.anchorText_[0] + \"px;\" +\n \"left: \" + this.anchorText_[1] + \"px;\" +\n \"color: \" + this.textColor_ + \";\" +\n \"font-size: \" + this.textSize_ + \"px;\" +\n \"font-family: \" + this.fontFamily_ + \";\" +\n \"font-weight: \" + this.fontWeight_ + \";\" +\n \"font-style: \" + this.fontStyle_ + \";\" +\n \"text-decoration: \" + this.textDecoration_ + \";\" +\n \"text-align: center;\" +\n \"width: \" + this.width_ + \"px;\" +\n \"line-height:\" + this.height_ + \"px;\" +\n \"'>\" + this.sums_.text + \"</div>\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n};\n\n\n/**\n * Sets the icon styles to the appropriate element in the styles array.\n *\n * @param {ClusterIconInfo} sums The icon label text and styles index.\n */\nClusterIcon.prototype.useStyle = function (sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style.url;\n this.height_ = style.height;\n this.width_ = style.width;\n this.anchorText_ = style.anchorText || [0, 0];\n this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];\n this.textColor_ = style.textColor || \"black\";\n this.textSize_ = style.textSize || 11;\n this.textDecoration_ = style.textDecoration || \"none\";\n this.fontWeight_ = style.fontWeight || \"bold\";\n this.fontStyle_ = style.fontStyle || \"normal\";\n this.fontFamily_ = style.fontFamily || \"Arial,sans-serif\";\n this.backgroundPosition_ = style.backgroundPosition || \"0 0\";\n};\n\n\n/**\n * Sets the position at which to center the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function (center) {\n this.center_ = center;\n};\n\n\n/**\n * Creates the cssText style parameter based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position of the icon.\n * @return {string} The CSS style text.\n */\nClusterIcon.prototype.createCss = function (pos) {\n var style = [];\n style.push(\"cursor: pointer;\");\n style.push(\"position: absolute; top: \" + pos.y + \"px; left: \" + pos.x + \"px;\");\n style.push(\"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\");\n return style.join(\"\");\n};\n\n\n/**\n * Returns the position at which to place the DIV depending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n */\nClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon_[1];\n pos.y -= this.anchorIcon_[0];\n pos.x = parseInt(pos.x, 10);\n pos.y = parseInt(pos.y, 10);\n return pos;\n};\n\n\n/**\n * Creates a single cluster that manages a group of proximate markers.\n * Used internally, do not call this constructor directly.\n * @constructor\n * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this\n * cluster is associated.\n */\nfunction Cluster(mc) {\n this.markerClusterer_ = mc;\n this.map_ = mc.getMap();\n this.gridSize_ = mc.getGridSize();\n this.minClusterSize_ = mc.getMinimumClusterSize();\n this.averageCenter_ = mc.getAverageCenter();\n this.markers_ = [];\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());\n}\n\n\n/**\n * Returns the number of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {number} The number of markers in the cluster.\n */\nCluster.prototype.getSize = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the array of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {Array} The array of markers in the cluster.\n */\nCluster.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {google.maps.LatLng} The center of the cluster.\n */\nCluster.prototype.getCenter = function () {\n return this.center_;\n};\n\n\n/**\n * Returns the map with which the cluster is associated.\n *\n * @return {google.maps.Map} The map.\n * @ignore\n */\nCluster.prototype.getMap = function () {\n return this.map_;\n};\n\n\n/**\n * Returns the <code>MarkerClusterer</code> object with which the cluster is associated.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n * @ignore\n */\nCluster.prototype.getMarkerClusterer = function () {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\nCluster.prototype.getBounds = function () {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster from the map.\n *\n * @ignore\n */\nCluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n};\n\n\n/**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\nCluster.prototype.addMarker = function (marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n this.updateIcon_();\n return true;\n};\n\n\n/**\n * Determines if a marker lies within the cluster's bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n * @ignore\n */\nCluster.prototype.isMarkerInClusterBounds = function (marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Calculates the extended bounds of the cluster with the grid.\n */\nCluster.prototype.calculateBounds_ = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Updates the cluster icon.\n */\nCluster.prototype.updateIcon_ = function () {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\nCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n var i;\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) !== -1;\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * @name MarkerClustererOptions\n * @class This class represents the optional parameter passed to\n * the {@link MarkerClusterer} constructor.\n * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.\n * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or\n * <code>null</code> if clustering is to be enabled at all zoom levels.\n * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is\n * clicked. You may want to set this to <code>false</code> if you have installed a handler\n * for the <code>click</code> event and it deals with zooming on its own.\n * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be\n * the average position of all markers in the cluster. If set to <code>false</code>, the\n * cluster marker is positioned at the location of the first marker added to the cluster.\n * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster\n * before the markers are hidden and a cluster marker appears.\n * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You\n * may want to set this to <code>true</code> to ensure that hidden markers are not included\n * in the marker count that appears on a cluster marker (this count is the value of the\n * <code>text</code> property of the result returned by the default <code>calculator</code>).\n * If set to <code>true</code> and you change the visibility of a marker being clustered, be\n * sure to also call <code>MarkerClusterer.repaint()</code>.\n * @property {string} [title=\"\"] The tooltip to display when the mouse moves over a cluster\n * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a\n * different tooltip for each cluster marker.)\n * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine\n * the text to be displayed on a cluster marker and the index indicating which style to use\n * for the cluster marker. The input parameters for the function are (1) the array of markers\n * represented by a cluster marker and (2) the number of cluster icon styles. It returns a\n * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a\n * <code>text</code> property which is the number of markers in the cluster and an\n * <code>index</code> property which is one higher than the lowest integer such that\n * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles\n * array, whichever is less. The <code>styles</code> array element used has an index of\n * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a\n * <code>text</code> value of <code>\"125\"</code> and an <code>index</code> of <code>3</code>\n * for a cluster icon representing 125 markers so the element used in the <code>styles</code>\n * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code>\n * property that contains the text of the tooltip to be used for the cluster marker. If\n * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code>\n * property for the MarkerClusterer.\n * @property {string} [clusterClass=\"cluster\"] The name of the CSS class defining general styles\n * for the cluster markers. Use this class to define CSS styles that are not set up by the code\n * that processes the <code>styles</code> array.\n * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles\n * of the cluster markers to be used. The element to be used to style a given cluster marker\n * is determined by the function defined by the <code>calculator</code> property.\n * The default is an array of {@link ClusterIconStyle} elements whose properties are derived\n * from the values for <code>imagePath</code>, <code>imageExtension</code>, and\n * <code>imageSizes</code>.\n * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that\n * have sizes that are some multiple (typically double) of their actual display size. Icons such\n * as these look better when viewed on high-resolution monitors such as Apple's Retina displays.\n * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons.\n * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the\n * number of markers to be processed in a single batch when using a browser other than\n * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).\n * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is\n * being used, markers are processed in several batches with a small delay inserted between\n * each batch in an attempt to avoid Javascript timeout errors. Set this property to the\n * number of markers to be processed in a single batch; select as high a number as you can\n * without causing a timeout error in the browser. This number might need to be as low as 100\n * if 15,000 markers are being managed, for example.\n * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]\n * The full URL of the root name of the group of image files to use for cluster icons.\n * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code>\n * where n is the image file number (1, 2, etc.).\n * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]\n * The extension name for the cluster icon image files (e.g., <code>\"png\"</code> or\n * <code>\"jpg\"</code>).\n * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]\n * An array of numbers containing the widths of the group of\n * <code>imagePath</code>n.<code>imageExtension</code> image files.\n * (The images are assumed to be square.)\n */\n/**\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\n * @constructor\n * @extends google.maps.OverlayView\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster.\n * @param {MarkerClustererOptions} [opt_options] The optional parameters.\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n\n opt_markers = opt_markers || [];\n opt_options = opt_options || {};\n\n this.markers_ = [];\n this.clusters_ = [];\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n\n this.gridSize_ = opt_options.gridSize || 60;\n this.minClusterSize_ = opt_options.minimumClusterSize || 2;\n this.maxZoom_ = opt_options.maxZoom || null;\n this.styles_ = opt_options.styles || [];\n this.title_ = opt_options.title || \"\";\n this.zoomOnClick_ = true;\n if (opt_options.zoomOnClick !== undefined) {\n this.zoomOnClick_ = opt_options.zoomOnClick;\n }\n this.averageCenter_ = false;\n if (opt_options.averageCenter !== undefined) {\n this.averageCenter_ = opt_options.averageCenter;\n }\n this.ignoreHidden_ = false;\n if (opt_options.ignoreHidden !== undefined) {\n this.ignoreHidden_ = opt_options.ignoreHidden;\n }\n this.enableRetinaIcons_ = false;\n if (opt_options.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons_ = opt_options.enableRetinaIcons;\n }\n this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;\n this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;\n this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;\n this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n this.clusterClass_ = opt_options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize_ = this.batchSizeIE_;\n }\n\n this.setupStyles_();\n\n this.addMarkers(opt_markers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Implementation of the onAdd interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function () {\n var cMarkerClusterer = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n\n this.repaint();\n\n // Add the map event listeners\n this.listeners_ = [\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", function () {\n cMarkerClusterer.resetViewport_(false);\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (this.getZoom() === (this.get(\"minZoom\") || 0) || this.getZoom() === this.get(\"maxZoom\")) {\n google.maps.event.trigger(this, \"idle\");\n }\n }),\n google.maps.event.addListener(this.getMap(), \"idle\", function () {\n cMarkerClusterer.redraw_();\n })\n ];\n};\n\n\n/**\n * Implementation of the onRemove interface method.\n * Removes map event listeners and all cluster icons from the DOM.\n * All managed markers are also put back on the map.\n * @ignore\n */\nMarkerClusterer.prototype.onRemove = function () {\n var i;\n\n // Put all the managed markers back on the map:\n for (i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n }\n\n // Remove all clusters:\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Remove map event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n this.listeners_ = [];\n\n this.activeMap_ = null;\n this.ready_ = false;\n};\n\n\n/**\n * Implementation of the draw interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function () {};\n\n\n/**\n * Sets up the styles object.\n */\nMarkerClusterer.prototype.setupStyles_ = function () {\n var i, size;\n if (this.styles_.length > 0) {\n return;\n }\n\n for (i = 0; i < this.imageSizes_.length; i++) {\n size = this.imageSizes_[i];\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n\n/**\n * Fits the map to the bounds of the markers managed by the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function () {\n var i;\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n\n this.getMap().fitBounds(bounds);\n};\n\n\n/**\n * Returns the value of the <code>gridSize</code> property.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function () {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the value of the <code>gridSize</code> property.\n *\n * @param {number} gridSize The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize_ = gridSize;\n};\n\n\n/**\n * Returns the value of the <code>minimumClusterSize</code> property.\n *\n * @return {number} The minimum cluster size.\n */\nMarkerClusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the value of the <code>minimumClusterSize</code> property.\n *\n * @param {number} minimumClusterSize The minimum cluster size.\n */\nMarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n};\n\n\n/**\n * Returns the value of the <code>maxZoom</code> property.\n *\n * @return {number} The maximum zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function () {\n return this.maxZoom_;\n};\n\n\n/**\n * Sets the value of the <code>maxZoom</code> property.\n *\n * @param {number} maxZoom The maximum zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Returns the value of the <code>styles</code> property.\n *\n * @return {Array} The array of styles defining the cluster markers to be used.\n */\nMarkerClusterer.prototype.getStyles = function () {\n return this.styles_;\n};\n\n\n/**\n * Sets the value of the <code>styles</code> property.\n *\n * @param {Array.<ClusterIconStyle>} styles The array of styles to use.\n */\nMarkerClusterer.prototype.setStyles = function (styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Returns the value of the <code>title</code> property.\n *\n * @return {string} The content of the title text.\n */\nMarkerClusterer.prototype.getTitle = function () {\n return this.title_;\n};\n\n\n/**\n * Sets the value of the <code>title</code> property.\n *\n * @param {string} title The value of the title property.\n */\nMarkerClusterer.prototype.setTitle = function (title) {\n this.title_ = title;\n};\n\n\n/**\n * Returns the value of the <code>zoomOnClick</code> property.\n *\n * @return {boolean} True if zoomOnClick property is set.\n */\nMarkerClusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick_;\n};\n\n\n/**\n * Sets the value of the <code>zoomOnClick</code> property.\n *\n * @param {boolean} zoomOnClick The value of the zoomOnClick property.\n */\nMarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n};\n\n\n/**\n * Returns the value of the <code>averageCenter</code> property.\n *\n * @return {boolean} True if averageCenter property is set.\n */\nMarkerClusterer.prototype.getAverageCenter = function () {\n return this.averageCenter_;\n};\n\n\n/**\n * Sets the value of the <code>averageCenter</code> property.\n *\n * @param {boolean} averageCenter The value of the averageCenter property.\n */\nMarkerClusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter_ = averageCenter;\n};\n\n\n/**\n * Returns the value of the <code>ignoreHidden</code> property.\n *\n * @return {boolean} True if ignoreHidden property is set.\n */\nMarkerClusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden_;\n};\n\n\n/**\n * Sets the value of the <code>ignoreHidden</code> property.\n *\n * @param {boolean} ignoreHidden The value of the ignoreHidden property.\n */\nMarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n};\n\n\n/**\n * Returns the value of the <code>enableRetinaIcons</code> property.\n *\n * @return {boolean} True if enableRetinaIcons property is set.\n */\nMarkerClusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons_;\n};\n\n\n/**\n * Sets the value of the <code>enableRetinaIcons</code> property.\n *\n * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.\n */\nMarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n};\n\n\n/**\n * Returns the value of the <code>imageExtension</code> property.\n *\n * @return {string} The value of the imageExtension property.\n */\nMarkerClusterer.prototype.getImageExtension = function () {\n return this.imageExtension_;\n};\n\n\n/**\n * Sets the value of the <code>imageExtension</code> property.\n *\n * @param {string} imageExtension The value of the imageExtension property.\n */\nMarkerClusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension_ = imageExtension;\n};\n\n\n/**\n * Returns the value of the <code>imagePath</code> property.\n *\n * @return {string} The value of the imagePath property.\n */\nMarkerClusterer.prototype.getImagePath = function () {\n return this.imagePath_;\n};\n\n\n/**\n * Sets the value of the <code>imagePath</code> property.\n *\n * @param {string} imagePath The value of the imagePath property.\n */\nMarkerClusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath_ = imagePath;\n};\n\n\n/**\n * Returns the value of the <code>imageSizes</code> property.\n *\n * @return {Array} The value of the imageSizes property.\n */\nMarkerClusterer.prototype.getImageSizes = function () {\n return this.imageSizes_;\n};\n\n\n/**\n * Sets the value of the <code>imageSizes</code> property.\n *\n * @param {Array} imageSizes The value of the imageSizes property.\n */\nMarkerClusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes_ = imageSizes;\n};\n\n\n/**\n * Returns the value of the <code>calculator</code> property.\n *\n * @return {function} the value of the calculator property.\n */\nMarkerClusterer.prototype.getCalculator = function () {\n return this.calculator_;\n};\n\n\n/**\n * Sets the value of the <code>calculator</code> property.\n *\n * @param {function(Array.<google.maps.Marker>, number)} calculator The value\n * of the calculator property.\n */\nMarkerClusterer.prototype.setCalculator = function (calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Returns the value of the <code>batchSizeIE</code> property.\n *\n * @return {number} the value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE_;\n};\n\n\n/**\n * Sets the value of the <code>batchSizeIE</code> property.\n *\n * @param {number} batchSizeIE The value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n};\n\n\n/**\n * Returns the value of the <code>clusterClass</code> property.\n *\n * @return {string} the value of the clusterClass property.\n */\nMarkerClusterer.prototype.getClusterClass = function () {\n return this.clusterClass_;\n};\n\n\n/**\n * Sets the value of the <code>clusterClass</code> property.\n *\n * @param {string} clusterClass The value of the clusterClass property.\n */\nMarkerClusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass_ = clusterClass;\n};\n\n\n/**\n * Returns the array of markers managed by the clusterer.\n *\n * @return {Array} The array of markers managed by the clusterer.\n */\nMarkerClusterer.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers managed by the clusterer.\n *\n * @return {number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the current array of clusters formed by the clusterer.\n *\n * @return {Array} The array of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getClusters = function () {\n return this.clusters_;\n};\n\n\n/**\n * Returns the number of clusters formed by the clusterer.\n *\n * @return {number} The number of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getTotalClusters = function () {\n return this.clusters_.length;\n};\n\n\n/**\n * Adds a marker to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {\n var key;\n for (key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo_(markers[key]);\n }\n } \n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n var cMarkerClusterer = this;\n google.maps.event.addListener(marker, \"dragend\", function () {\n if (cMarkerClusterer.ready_) {\n this.isAdded = false;\n cMarkerClusterer.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers_.push(marker);\n};\n\n\n/**\n * Removes a marker from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the\n * marker was removed from the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if the marker was removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes an array of markers from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers\n * were removed from the clusterer.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if markers were removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {\n var i, r;\n var removed = false;\n\n for (i = 0; i < markers.length; i++) {\n r = this.removeMarker_(markers[i]);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n */\nMarkerClusterer.prototype.removeMarker_ = function (marker) {\n var i;\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n};\n\n\n/**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = [];\n};\n\n\n/**\n * Recalculates and redraws all the marker clusters from scratch.\n * Call this after changing any properties.\n */\nMarkerClusterer.prototype.repaint = function () {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_();\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function () {\n var i;\n for (i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n};\n\n\n/**\n * Returns the current bounds extended by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n * @ignore\n */\nMarkerClusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Redraws all the clusters.\n */\nMarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n};\n\n\n/**\n * Removes all clusters from the map. The markers are also removed from the map\n * if <code>opt_hide</code> is set to <code>true</code>.\n *\n * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers\n * from the map.\n */\nMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n for (i = 0; i < this.markers_.length; i++) {\n marker = this.markers_[i];\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Determines if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\nMarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>MarkerClusterer</code> begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (i = iFirst; i < iLast; i++) {\n marker = this.markers_[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function () {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the <code>MarkerClusterer</code> stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringend\", this);\n }\n};\n\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function (obj1, obj2) {\n return (function (object) {\n var property;\n for (property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * The default function for determining the label text and style\n * for a cluster icon.\n *\n * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster.\n * @param {number} numStyles The number of marker styles available.\n * @return {ClusterIconInfo} The information resource for the cluster.\n * @constant\n * @ignore\n */\nMarkerClusterer.CALCULATOR = function (markers, numStyles) {\n var index = 0;\n var title = \"\";\n var count = markers.length.toString();\n\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index,\n title: title\n };\n};\n\n\n/**\n * The number of markers to process in one batch.\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE = 2000;\n\n\n/**\n * The number of markers to process in one batch (IE only).\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE_IE = 500;\n\n\n/**\n * The default root name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_PATH = \"http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m\";\n\n\n/**\n * The default extension name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\n\n\n/**\n * The default array of sizes for the marker cluster images.\n *\n * @type {Array.<number>}\n * @constant\n */\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\n/**\n * @name MarkerWithLabel for V3\n * @version 1.1.10 [April 8, 2014]\n * @author Gary Little (inspired by code from Marc Ridey of Google).\n * @copyright Copyright 2012 Gary Little [gary at luxcentral.com]\n * @fileoverview MarkerWithLabel extends the Google Maps JavaScript API V3\n * <code>google.maps.Marker</code> class.\n * <p>\n * MarkerWithLabel allows you to define markers with associated labels. As you would expect,\n * if the marker is draggable, so too will be the label. In addition, a marker with a label\n * responds to all mouse events in the same manner as a regular marker. It also fires mouse\n * events and \"property changed\" events just as a regular marker would. Version 1.1 adds\n * support for the raiseOnDrag feature introduced in API V3.3.\n * <p>\n * If you drag a marker by its label, you can cancel the drag and return the marker to its\n * original position by pressing the <code>Esc</code> key. This doesn't work if you drag the marker\n * itself because this feature is not (yet) supported in the <code>google.maps.Marker</code> class.\n */\n\n/*!\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*jslint browser:true */\n/*global document,google */\n\n/**\n * @param {Function} childCtor Child class.\n * @param {Function} parentCtor Parent class.\n * @private\n */\nfunction inherits(childCtor, parentCtor) {\n /* @constructor */\n function tempCtor() {}\n tempCtor.prototype = parentCtor.prototype;\n childCtor.superClass_ = parentCtor.prototype;\n childCtor.prototype = new tempCtor();\n /* @override */\n childCtor.prototype.constructor = childCtor;\n}\n\n/**\n * This constructor creates a label and associates it with a marker.\n * It is for the private use of the MarkerWithLabel class.\n * @constructor\n * @param {Marker} marker The marker with which the label is to be associated.\n * @param {string} crossURL The URL of the cross image =.\n * @param {string} handCursor The URL of the hand cursor.\n * @private\n */\nfunction MarkerLabel_(marker, crossURL, handCursorURL) {\n this.marker_ = marker;\n this.handCursorURL_ = marker.handCursorURL;\n\n this.labelDiv_ = document.createElement(\"div\");\n this.labelDiv_.style.cssText = \"position: absolute; overflow: hidden;\";\n\n // Set up the DIV for handling mouse events in the label. This DIV forms a transparent veil\n // in the \"overlayMouseTarget\" pane, a veil that covers just the label. This is done so that\n // events can be captured even if the label is in the shadow of a google.maps.InfoWindow.\n // Code is included here to ensure the veil is always exactly the same size as the label.\n this.eventDiv_ = document.createElement(\"div\");\n this.eventDiv_.style.cssText = this.labelDiv_.style.cssText;\n\n // This is needed for proper behavior on MSIE:\n this.eventDiv_.setAttribute(\"onselectstart\", \"return false;\");\n this.eventDiv_.setAttribute(\"ondragstart\", \"return false;\");\n\n // Get the DIV for the \"X\" to be displayed when the marker is raised.\n this.crossDiv_ = MarkerLabel_.getSharedCross(crossURL);\n}\n\ninherits(MarkerLabel_, google.maps.OverlayView);\n\n/**\n * Returns the DIV for the cross used when dragging a marker when the\n * raiseOnDrag parameter set to true. One cross is shared with all markers.\n * @param {string} crossURL The URL of the cross image =.\n * @private\n */\nMarkerLabel_.getSharedCross = function (crossURL) {\n var div;\n if (typeof MarkerLabel_.getSharedCross.crossDiv === \"undefined\") {\n div = document.createElement(\"img\");\n div.style.cssText = \"position: absolute; z-index: 1000002; display: none;\";\n // Hopefully Google never changes the standard \"X\" attributes:\n div.style.marginLeft = \"-8px\";\n div.style.marginTop = \"-9px\";\n div.src = crossURL;\n MarkerLabel_.getSharedCross.crossDiv = div;\n }\n return MarkerLabel_.getSharedCross.crossDiv;\n};\n\n/**\n * Adds the DIV representing the label to the DOM. This method is called\n * automatically when the marker's <code>setMap</code> method is called.\n * @private\n */\nMarkerLabel_.prototype.onAdd = function () {\n var me = this;\n var cMouseIsDown = false;\n var cDraggingLabel = false;\n var cSavedZIndex;\n var cLatOffset, cLngOffset;\n var cIgnoreClick;\n var cRaiseEnabled;\n var cStartPosition;\n var cStartCenter;\n // Constants:\n var cRaiseOffset = 20;\n var cDraggingCursor = \"url(\" + this.handCursorURL_ + \")\";\n\n // Stops all processing of an event.\n //\n var cAbortEvent = function (e) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n };\n\n var cStopBounce = function () {\n me.marker_.setAnimation(null);\n };\n\n this.getPanes().overlayImage.appendChild(this.labelDiv_);\n this.getPanes().overlayMouseTarget.appendChild(this.eventDiv_);\n // One cross is shared with all markers, so only add it once:\n if (typeof MarkerLabel_.getSharedCross.processed === \"undefined\") {\n this.getPanes().overlayImage.appendChild(this.crossDiv_);\n MarkerLabel_.getSharedCross.processed = true;\n }\n\n this.listeners_ = [\n google.maps.event.addDomListener(this.eventDiv_, \"mouseover\", function (e) {\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\n this.style.cursor = \"pointer\";\n google.maps.event.trigger(me.marker_, \"mouseover\", e);\n }\n }),\n google.maps.event.addDomListener(this.eventDiv_, \"mouseout\", function (e) {\n if ((me.marker_.getDraggable() || me.marker_.getClickable()) && !cDraggingLabel) {\n this.style.cursor = me.marker_.getCursor();\n google.maps.event.trigger(me.marker_, \"mouseout\", e);\n }\n }),\n google.maps.event.addDomListener(this.eventDiv_, \"mousedown\", function (e) {\n cDraggingLabel = false;\n if (me.marker_.getDraggable()) {\n cMouseIsDown = true;\n this.style.cursor = cDraggingCursor;\n }\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\n google.maps.event.trigger(me.marker_, \"mousedown\", e);\n cAbortEvent(e); // Prevent map pan when starting a drag on a label\n }\n }),\n google.maps.event.addDomListener(document, \"mouseup\", function (mEvent) {\n var position;\n if (cMouseIsDown) {\n cMouseIsDown = false;\n me.eventDiv_.style.cursor = \"pointer\";\n google.maps.event.trigger(me.marker_, \"mouseup\", mEvent);\n }\n if (cDraggingLabel) {\n if (cRaiseEnabled) { // Lower the marker & label\n position = me.getProjection().fromLatLngToDivPixel(me.marker_.getPosition());\n position.y += cRaiseOffset;\n me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));\n // This is not the same bouncing style as when the marker portion is dragged,\n // but it will have to do:\n try { // Will fail if running Google Maps API earlier than V3.3\n me.marker_.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(cStopBounce, 1406);\n } catch (e) {}\n }\n me.crossDiv_.style.display = \"none\";\n me.marker_.setZIndex(cSavedZIndex);\n cIgnoreClick = true; // Set flag to ignore the click event reported after a label drag\n cDraggingLabel = false;\n mEvent.latLng = me.marker_.getPosition();\n google.maps.event.trigger(me.marker_, \"dragend\", mEvent);\n }\n }),\n google.maps.event.addListener(me.marker_.getMap(), \"mousemove\", function (mEvent) {\n var position;\n if (cMouseIsDown) {\n if (cDraggingLabel) {\n // Change the reported location from the mouse position to the marker position:\n mEvent.latLng = new google.maps.LatLng(mEvent.latLng.lat() - cLatOffset, mEvent.latLng.lng() - cLngOffset);\n position = me.getProjection().fromLatLngToDivPixel(mEvent.latLng);\n if (cRaiseEnabled) {\n me.crossDiv_.style.left = position.x + \"px\";\n me.crossDiv_.style.top = position.y + \"px\";\n me.crossDiv_.style.display = \"\";\n position.y -= cRaiseOffset;\n }\n me.marker_.setPosition(me.getProjection().fromDivPixelToLatLng(position));\n if (cRaiseEnabled) { // Don't raise the veil; this hack needed to make MSIE act properly\n me.eventDiv_.style.top = (position.y + cRaiseOffset) + \"px\";\n }\n google.maps.event.trigger(me.marker_, \"drag\", mEvent);\n } else {\n // Calculate offsets from the click point to the marker position:\n cLatOffset = mEvent.latLng.lat() - me.marker_.getPosition().lat();\n cLngOffset = mEvent.latLng.lng() - me.marker_.getPosition().lng();\n cSavedZIndex = me.marker_.getZIndex();\n cStartPosition = me.marker_.getPosition();\n cStartCenter = me.marker_.getMap().getCenter();\n cRaiseEnabled = me.marker_.get(\"raiseOnDrag\");\n cDraggingLabel = true;\n me.marker_.setZIndex(1000000); // Moves the marker & label to the foreground during a drag\n mEvent.latLng = me.marker_.getPosition();\n google.maps.event.trigger(me.marker_, \"dragstart\", mEvent);\n }\n }\n }),\n google.maps.event.addDomListener(document, \"keydown\", function (e) {\n if (cDraggingLabel) {\n if (e.keyCode === 27) { // Esc key\n cRaiseEnabled = false;\n me.marker_.setPosition(cStartPosition);\n me.marker_.getMap().setCenter(cStartCenter);\n google.maps.event.trigger(document, \"mouseup\", e);\n }\n }\n }),\n google.maps.event.addDomListener(this.eventDiv_, \"click\", function (e) {\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\n if (cIgnoreClick) { // Ignore the click reported when a label drag ends\n cIgnoreClick = false;\n } else {\n google.maps.event.trigger(me.marker_, \"click\", e);\n cAbortEvent(e); // Prevent click from being passed on to map\n }\n }\n }),\n google.maps.event.addDomListener(this.eventDiv_, \"dblclick\", function (e) {\n if (me.marker_.getDraggable() || me.marker_.getClickable()) {\n google.maps.event.trigger(me.marker_, \"dblclick\", e);\n cAbortEvent(e); // Prevent map zoom when double-clicking on a label\n }\n }),\n google.maps.event.addListener(this.marker_, \"dragstart\", function (mEvent) {\n if (!cDraggingLabel) {\n cRaiseEnabled = this.get(\"raiseOnDrag\");\n }\n }),\n google.maps.event.addListener(this.marker_, \"drag\", function (mEvent) {\n if (!cDraggingLabel) {\n if (cRaiseEnabled) {\n me.setPosition(cRaiseOffset);\n // During a drag, the marker's z-index is temporarily set to 1000000 to\n // ensure it appears above all other markers. Also set the label's z-index\n // to 1000000 (plus or minus 1 depending on whether the label is supposed\n // to be above or below the marker).\n me.labelDiv_.style.zIndex = 1000000 + (this.get(\"labelInBackground\") ? -1 : +1);\n }\n }\n }),\n google.maps.event.addListener(this.marker_, \"dragend\", function (mEvent) {\n if (!cDraggingLabel) {\n if (cRaiseEnabled) {\n me.setPosition(0); // Also restores z-index of label\n }\n }\n }),\n google.maps.event.addListener(this.marker_, \"position_changed\", function () {\n me.setPosition();\n }),\n google.maps.event.addListener(this.marker_, \"zindex_changed\", function () {\n me.setZIndex();\n }),\n google.maps.event.addListener(this.marker_, \"visible_changed\", function () {\n me.setVisible();\n }),\n google.maps.event.addListener(this.marker_, \"labelvisible_changed\", function () {\n me.setVisible();\n }),\n google.maps.event.addListener(this.marker_, \"title_changed\", function () {\n me.setTitle();\n }),\n google.maps.event.addListener(this.marker_, \"labelcontent_changed\", function () {\n me.setContent();\n }),\n google.maps.event.addListener(this.marker_, \"labelanchor_changed\", function () {\n me.setAnchor();\n }),\n google.maps.event.addListener(this.marker_, \"labelclass_changed\", function () {\n me.setStyles();\n }),\n google.maps.event.addListener(this.marker_, \"labelstyle_changed\", function () {\n me.setStyles();\n })\n ];\n};\n\n/**\n * Removes the DIV for the label from the DOM. It also removes all event handlers.\n * This method is called automatically when the marker's <code>setMap(null)</code>\n * method is called.\n * @private\n */\nMarkerLabel_.prototype.onRemove = function () {\n var i;\n this.labelDiv_.parentNode.removeChild(this.labelDiv_);\n this.eventDiv_.parentNode.removeChild(this.eventDiv_);\n\n // Remove event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n};\n\n/**\n * Draws the label on the map.\n * @private\n */\nMarkerLabel_.prototype.draw = function () {\n this.setContent();\n this.setTitle();\n this.setStyles();\n};\n\n/**\n * Sets the content of the label.\n * The content can be plain text or an HTML DOM node.\n * @private\n */\nMarkerLabel_.prototype.setContent = function () {\n var content = this.marker_.get(\"labelContent\");\n if (typeof content.nodeType === \"undefined\") {\n this.labelDiv_.innerHTML = content;\n this.eventDiv_.innerHTML = this.labelDiv_.innerHTML;\n } else {\n this.labelDiv_.innerHTML = \"\"; // Remove current content\n this.labelDiv_.appendChild(content);\n content = content.cloneNode(true);\n this.eventDiv_.innerHTML = \"\"; // Remove current content\n this.eventDiv_.appendChild(content);\n }\n};\n\n/**\n * Sets the content of the tool tip for the label. It is\n * always set to be the same as for the marker itself.\n * @private\n */\nMarkerLabel_.prototype.setTitle = function () {\n this.eventDiv_.title = this.marker_.getTitle() || \"\";\n};\n\n/**\n * Sets the style of the label by setting the style sheet and applying\n * other specific styles requested.\n * @private\n */\nMarkerLabel_.prototype.setStyles = function () {\n var i, labelStyle;\n\n // Apply style values from the style sheet defined in the labelClass parameter:\n this.labelDiv_.className = this.marker_.get(\"labelClass\");\n this.eventDiv_.className = this.labelDiv_.className;\n\n // Clear existing inline style values:\n this.labelDiv_.style.cssText = \"\";\n this.eventDiv_.style.cssText = \"\";\n // Apply style values defined in the labelStyle parameter:\n labelStyle = this.marker_.get(\"labelStyle\");\n for (i in labelStyle) {\n if (labelStyle.hasOwnProperty(i)) {\n this.labelDiv_.style[i] = labelStyle[i];\n this.eventDiv_.style[i] = labelStyle[i];\n }\n }\n this.setMandatoryStyles();\n};\n\n/**\n * Sets the mandatory styles to the DIV representing the label as well as to the\n * associated event DIV. This includes setting the DIV position, z-index, and visibility.\n * @private\n */\nMarkerLabel_.prototype.setMandatoryStyles = function () {\n this.labelDiv_.style.position = \"absolute\";\n this.labelDiv_.style.overflow = \"hidden\";\n // Make sure the opacity setting causes the desired effect on MSIE:\n if (typeof this.labelDiv_.style.opacity !== \"undefined\" && this.labelDiv_.style.opacity !== \"\") {\n this.labelDiv_.style.MsFilter = \"\\\"progid:DXImageTransform.Microsoft.Alpha(opacity=\" + (this.labelDiv_.style.opacity * 100) + \")\\\"\";\n this.labelDiv_.style.filter = \"alpha(opacity=\" + (this.labelDiv_.style.opacity * 100) + \")\";\n }\n\n this.eventDiv_.style.position = this.labelDiv_.style.position;\n this.eventDiv_.style.overflow = this.labelDiv_.style.overflow;\n this.eventDiv_.style.opacity = 0.01; // Don't use 0; DIV won't be clickable on MSIE\n this.eventDiv_.style.MsFilter = \"\\\"progid:DXImageTransform.Microsoft.Alpha(opacity=1)\\\"\";\n this.eventDiv_.style.filter = \"alpha(opacity=1)\"; // For MSIE\n\n this.setAnchor();\n this.setPosition(); // This also updates z-index, if necessary.\n this.setVisible();\n};\n\n/**\n * Sets the anchor point of the label.\n * @private\n */\nMarkerLabel_.prototype.setAnchor = function () {\n var anchor = this.marker_.get(\"labelAnchor\");\n this.labelDiv_.style.marginLeft = -anchor.x + \"px\";\n this.labelDiv_.style.marginTop = -anchor.y + \"px\";\n this.eventDiv_.style.marginLeft = -anchor.x + \"px\";\n this.eventDiv_.style.marginTop = -anchor.y + \"px\";\n};\n\n/**\n * Sets the position of the label. The z-index is also updated, if necessary.\n * @private\n */\nMarkerLabel_.prototype.setPosition = function (yOffset) {\n var position = this.getProjection().fromLatLngToDivPixel(this.marker_.getPosition());\n if (typeof yOffset === \"undefined\") {\n yOffset = 0;\n }\n this.labelDiv_.style.left = Math.round(position.x) + \"px\";\n this.labelDiv_.style.top = Math.round(position.y - yOffset) + \"px\";\n this.eventDiv_.style.left = this.labelDiv_.style.left;\n this.eventDiv_.style.top = this.labelDiv_.style.top;\n\n this.setZIndex();\n};\n\n/**\n * Sets the z-index of the label. If the marker's z-index property has not been defined, the z-index\n * of the label is set to the vertical coordinate of the label. This is in keeping with the default\n * stacking order for Google Maps: markers to the south are in front of markers to the north.\n * @private\n */\nMarkerLabel_.prototype.setZIndex = function () {\n var zAdjust = (this.marker_.get(\"labelInBackground\") ? -1 : +1);\n if (typeof this.marker_.getZIndex() === \"undefined\") {\n this.labelDiv_.style.zIndex = parseInt(this.labelDiv_.style.top, 10) + zAdjust;\n this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;\n } else {\n this.labelDiv_.style.zIndex = this.marker_.getZIndex() + zAdjust;\n this.eventDiv_.style.zIndex = this.labelDiv_.style.zIndex;\n }\n};\n\n/**\n * Sets the visibility of the label. The label is visible only if the marker itself is\n * visible (i.e., its visible property is true) and the labelVisible property is true.\n * @private\n */\nMarkerLabel_.prototype.setVisible = function () {\n if (this.marker_.get(\"labelVisible\")) {\n this.labelDiv_.style.display = this.marker_.getVisible() ? \"block\" : \"none\";\n } else {\n this.labelDiv_.style.display = \"none\";\n }\n this.eventDiv_.style.display = this.labelDiv_.style.display;\n};\n\n/**\n * @name MarkerWithLabelOptions\n * @class This class represents the optional parameter passed to the {@link MarkerWithLabel} constructor.\n * The properties available are the same as for <code>google.maps.Marker</code> with the addition\n * of the properties listed below. To change any of these additional properties after the labeled\n * marker has been created, call <code>google.maps.Marker.set(propertyName, propertyValue)</code>.\n * <p>\n * When any of these properties changes, a property changed event is fired. The names of these\n * events are derived from the name of the property and are of the form <code>propertyname_changed</code>.\n * For example, if the content of the label changes, a <code>labelcontent_changed</code> event\n * is fired.\n * <p>\n * @property {string|Node} [labelContent] The content of the label (plain text or an HTML DOM node).\n * @property {Point} [labelAnchor] By default, a label is drawn with its anchor point at (0,0) so\n * that its top left corner is positioned at the anchor point of the associated marker. Use this\n * property to change the anchor point of the label. For example, to center a 50px-wide label\n * beneath a marker, specify a <code>labelAnchor</code> of <code>google.maps.Point(25, 0)</code>.\n * (Note: x-values increase to the right and y-values increase to the top.)\n * @property {string} [labelClass] The name of the CSS class defining the styles for the label.\n * Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>,\n * <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and\n * <code>marginTop</code> are ignored; these styles are for internal use only.\n * @property {Object} [labelStyle] An object literal whose properties define specific CSS\n * style values to be applied to the label. Style values defined here override those that may\n * be defined in the <code>labelClass</code> style sheet. If this property is changed after the\n * label has been created, all previously set styles (except those defined in the style sheet)\n * are removed from the label before the new style values are applied.\n * Note that style values for <code>position</code>, <code>overflow</code>, <code>top</code>,\n * <code>left</code>, <code>zIndex</code>, <code>display</code>, <code>marginLeft</code>, and\n * <code>marginTop</code> are ignored; these styles are for internal use only.\n * @property {boolean} [labelInBackground] A flag indicating whether a label that overlaps its\n * associated marker should appear in the background (i.e., in a plane below the marker).\n * The default is <code>false</code>, which causes the label to appear in the foreground.\n * @property {boolean} [labelVisible] A flag indicating whether the label is to be visible.\n * The default is <code>true</code>. Note that even if <code>labelVisible</code> is\n * <code>true</code>, the label will <i>not</i> be visible unless the associated marker is also\n * visible (i.e., unless the marker's <code>visible</code> property is <code>true</code>).\n * @property {boolean} [raiseOnDrag] A flag indicating whether the label and marker are to be\n * raised when the marker is dragged. The default is <code>true</code>. If a draggable marker is\n * being created and a version of Google Maps API earlier than V3.3 is being used, this property\n * must be set to <code>false</code>.\n * @property {boolean} [optimized] A flag indicating whether rendering is to be optimized for the\n * marker. <b>Important: The optimized rendering technique is not supported by MarkerWithLabel,\n * so the value of this parameter is always forced to <code>false</code>.\n * @property {string} [crossImage=\"http://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png\"]\n * The URL of the cross image to be displayed while dragging a marker.\n * @property {string} [handCursor=\"http://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur\"]\n * The URL of the cursor to be displayed while dragging a marker.\n */\n/**\n * Creates a MarkerWithLabel with the options specified in {@link MarkerWithLabelOptions}.\n * @constructor\n * @param {MarkerWithLabelOptions} [opt_options] The optional parameters.\n */\nfunction MarkerWithLabel(opt_options) {\n opt_options = opt_options || {};\n opt_options.labelContent = opt_options.labelContent || \"\";\n opt_options.labelAnchor = opt_options.labelAnchor || new google.maps.Point(0, 0);\n opt_options.labelClass = opt_options.labelClass || \"markerLabels\";\n opt_options.labelStyle = opt_options.labelStyle || {};\n opt_options.labelInBackground = opt_options.labelInBackground || false;\n if (typeof opt_options.labelVisible === \"undefined\") {\n opt_options.labelVisible = true;\n }\n if (typeof opt_options.raiseOnDrag === \"undefined\") {\n opt_options.raiseOnDrag = true;\n }\n if (typeof opt_options.clickable === \"undefined\") {\n opt_options.clickable = true;\n }\n if (typeof opt_options.draggable === \"undefined\") {\n opt_options.draggable = false;\n }\n if (typeof opt_options.optimized === \"undefined\") {\n opt_options.optimized = false;\n }\n opt_options.crossImage = opt_options.crossImage || \"http\" + (document.location.protocol === \"https:\" ? \"s\" : \"\") + \"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png\";\n opt_options.handCursor = opt_options.handCursor || \"http\" + (document.location.protocol === \"https:\" ? \"s\" : \"\") + \"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur\";\n opt_options.optimized = false; // Optimized rendering is not supported\n\n this.label = new MarkerLabel_(this, opt_options.crossImage, opt_options.handCursor); // Bind the label to the marker\n\n // Call the parent constructor. It calls Marker.setValues to initialize, so all\n // the new parameters are conveniently saved and can be accessed with get/set.\n // Marker.set triggers a property changed event (called \"propertyname_changed\")\n // that the marker label listens for in order to react to state changes.\n google.maps.Marker.apply(this, arguments);\n}\n\ninherits(MarkerWithLabel, google.maps.Marker);\n\n/**\n * Overrides the standard Marker setMap function.\n * @param {Map} theMap The map to which the marker is to be added.\n * @private\n */\nMarkerWithLabel.prototype.setMap = function (theMap) {\n\n // Call the inherited function...\n google.maps.Marker.prototype.setMap.apply(this, arguments);\n\n // ... then deal with the label:\n this.label.setMap(theMap);\n};\n\n// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/maps/google_maps_api_v3.js\n// @output_wrapper (function() {%output%})();\n// ==/ClosureCompiler==\n\n/**\n * @license\n * Copyright 2013 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A RichMarker that allows any HTML/DOM to be added to a map and be draggable.\n *\n * @param {Object.<string, *>=} opt_options Optional properties to set.\n * @extends {google.maps.OverlayView}\n * @constructor\n */\nfunction RichMarker(opt_options) {\n var options = opt_options || {};\n\n /**\n * @type {boolean}\n * @private\n */\n this.ready_ = false;\n\n /**\n * @type {boolean}\n * @private\n */\n this.dragging_ = false;\n\n if (opt_options['visible'] == undefined) {\n opt_options['visible'] = true;\n }\n\n if (opt_options['shadow'] == undefined) {\n opt_options['shadow'] = '7px -3px 5px rgba(88,88,88,0.7)';\n }\n\n if (opt_options['anchor'] == undefined) {\n opt_options['anchor'] = RichMarkerPosition['BOTTOM'];\n }\n\n this.setValues(options);\n}\nRichMarker.prototype = new google.maps.OverlayView();\nwindow['RichMarker'] = RichMarker;\n\n\n/**\n * Returns the current visibility state of the marker.\n *\n * @return {boolean} The visiblity of the marker.\n */\nRichMarker.prototype.getVisible = function() {\n return /** @type {boolean} */ (this.get('visible'));\n};\nRichMarker.prototype['getVisible'] = RichMarker.prototype.getVisible;\n\n\n/**\n * Sets the visiblility state of the marker.\n *\n * @param {boolean} visible The visiblilty of the marker.\n */\nRichMarker.prototype.setVisible = function(visible) {\n this.set('visible', visible);\n};\nRichMarker.prototype['setVisible'] = RichMarker.prototype.setVisible;\n\n\n/**\n * The visible changed event.\n */\nRichMarker.prototype.visible_changed = function() {\n if (this.ready_) {\n this.markerWrapper_.style['display'] = this.getVisible() ? '' : 'none';\n this.draw();\n }\n};\nRichMarker.prototype['visible_changed'] = RichMarker.prototype.visible_changed;\n\n\n/**\n * Sets the marker to be flat.\n *\n * @param {boolean} flat If the marker is to be flat or not.\n */\nRichMarker.prototype.setFlat = function(flat) {\n this.set('flat', !!flat);\n};\nRichMarker.prototype['setFlat'] = RichMarker.prototype.setFlat;\n\n\n/**\n * If the makrer is flat or not.\n *\n * @return {boolean} True the marker is flat.\n */\nRichMarker.prototype.getFlat = function() {\n return /** @type {boolean} */ (this.get('flat'));\n};\nRichMarker.prototype['getFlat'] = RichMarker.prototype.getFlat;\n\n\n/**\n * Get the width of the marker.\n *\n * @return {Number} The width of the marker.\n */\nRichMarker.prototype.getWidth = function() {\n return /** @type {Number} */ (this.get('width'));\n};\nRichMarker.prototype['getWidth'] = RichMarker.prototype.getWidth;\n\n\n/**\n * Get the height of the marker.\n *\n * @return {Number} The height of the marker.\n */\nRichMarker.prototype.getHeight = function() {\n return /** @type {Number} */ (this.get('height'));\n};\nRichMarker.prototype['getHeight'] = RichMarker.prototype.getHeight;\n\n\n/**\n * Sets the marker's box shadow.\n *\n * @param {string} shadow The box shadow to set.\n */\nRichMarker.prototype.setShadow = function(shadow) {\n this.set('shadow', shadow);\n this.flat_changed();\n};\nRichMarker.prototype['setShadow'] = RichMarker.prototype.setShadow;\n\n\n/**\n * Gets the marker's box shadow.\n *\n * @return {string} The box shadow.\n */\nRichMarker.prototype.getShadow = function() {\n return /** @type {string} */ (this.get('shadow'));\n};\nRichMarker.prototype['getShadow'] = RichMarker.prototype.getShadow;\n\n\n/**\n * Flat changed event.\n */\nRichMarker.prototype.flat_changed = function() {\n if (!this.ready_) {\n return;\n }\n\n this.markerWrapper_.style['boxShadow'] =\n this.markerWrapper_.style['webkitBoxShadow'] =\n this.markerWrapper_.style['MozBoxShadow'] =\n this.getFlat() ? '' : this.getShadow();\n};\nRichMarker.prototype['flat_changed'] = RichMarker.prototype.flat_changed;\n\n\n/**\n * Sets the zIndex of the marker.\n *\n * @param {Number} index The index to set.\n */\nRichMarker.prototype.setZIndex = function(index) {\n this.set('zIndex', index);\n};\nRichMarker.prototype['setZIndex'] = RichMarker.prototype.setZIndex;\n\n\n/**\n * Gets the zIndex of the marker.\n *\n * @return {Number} The zIndex of the marker.\n */\nRichMarker.prototype.getZIndex = function() {\n return /** @type {Number} */ (this.get('zIndex'));\n};\nRichMarker.prototype['getZIndex'] = RichMarker.prototype.getZIndex;\n\n\n/**\n * zIndex changed event.\n */\nRichMarker.prototype.zIndex_changed = function() {\n if (this.getZIndex() && this.ready_) {\n this.markerWrapper_.style.zIndex = this.getZIndex();\n }\n};\nRichMarker.prototype['zIndex_changed'] = RichMarker.prototype.zIndex_changed;\n\n/**\n * Whether the marker is draggable or not.\n *\n * @return {boolean} True if the marker is draggable.\n */\nRichMarker.prototype.getDraggable = function() {\n return /** @type {boolean} */ (this.get('draggable'));\n};\nRichMarker.prototype['getDraggable'] = RichMarker.prototype.getDraggable;\n\n\n/**\n * Sets the marker to be draggable or not.\n *\n * @param {boolean} draggable If the marker is draggable or not.\n */\nRichMarker.prototype.setDraggable = function(draggable) {\n this.set('draggable', !!draggable);\n};\nRichMarker.prototype['setDraggable'] = RichMarker.prototype.setDraggable;\n\n\n/**\n * Draggable property changed callback.\n */\nRichMarker.prototype.draggable_changed = function() {\n if (this.ready_) {\n if (this.getDraggable()) {\n this.addDragging_(this.markerWrapper_);\n } else {\n this.removeDragListeners_();\n }\n }\n};\nRichMarker.prototype['draggable_changed'] =\n RichMarker.prototype.draggable_changed;\n\n\n/**\n * Gets the postiton of the marker.\n *\n * @return {google.maps.LatLng} The position of the marker.\n */\nRichMarker.prototype.getPosition = function() {\n return /** @type {google.maps.LatLng} */ (this.get('position'));\n};\nRichMarker.prototype['getPosition'] = RichMarker.prototype.getPosition;\n\n\n/**\n * Sets the position of the marker.\n *\n * @param {google.maps.LatLng} position The position to set.\n */\nRichMarker.prototype.setPosition = function(position) {\n this.set('position', position);\n};\nRichMarker.prototype['setPosition'] = RichMarker.prototype.setPosition;\n\n\n/**\n * Position changed event.\n */\nRichMarker.prototype.position_changed = function() {\n this.draw();\n};\nRichMarker.prototype['position_changed'] =\n RichMarker.prototype.position_changed;\n\n\n/**\n * Gets the anchor.\n *\n * @return {google.maps.Size} The position of the anchor.\n */\nRichMarker.prototype.getAnchor = function() {\n return /** @type {google.maps.Size} */ (this.get('anchor'));\n};\nRichMarker.prototype['getAnchor'] = RichMarker.prototype.getAnchor;\n\n\n/**\n * Sets the anchor.\n *\n * @param {RichMarkerPosition|google.maps.Size} anchor The anchor to set.\n */\nRichMarker.prototype.setAnchor = function(anchor) {\n this.set('anchor', anchor);\n};\nRichMarker.prototype['setAnchor'] = RichMarker.prototype.setAnchor;\n\n\n/**\n * Anchor changed event.\n */\nRichMarker.prototype.anchor_changed = function() {\n this.draw();\n};\nRichMarker.prototype['anchor_changed'] = RichMarker.prototype.anchor_changed;\n\n\n/**\n * Converts a HTML string to a document fragment.\n *\n * @param {string} htmlString The HTML string to convert.\n * @return {Node} A HTML document fragment.\n * @private\n */\nRichMarker.prototype.htmlToDocumentFragment_ = function(htmlString) {\n var tempDiv = document.createElement('DIV');\n tempDiv.innerHTML = htmlString;\n if (tempDiv.childNodes.length == 1) {\n return /** @type {!Node} */ (tempDiv.removeChild(tempDiv.firstChild));\n } else {\n var fragment = document.createDocumentFragment();\n while (tempDiv.firstChild) {\n fragment.appendChild(tempDiv.firstChild);\n }\n return fragment;\n }\n};\n\n\n/**\n * Removes all children from the node.\n *\n * @param {Node} node The node to remove all children from.\n * @private\n */\nRichMarker.prototype.removeChildren_ = function(node) {\n if (!node) {\n return;\n }\n\n var child;\n while (child = node.firstChild) {\n node.removeChild(child);\n }\n};\n\n\n/**\n * Sets the content of the marker.\n *\n * @param {string|Node} content The content to set.\n */\nRichMarker.prototype.setContent = function(content) {\n this.set('content', content);\n};\nRichMarker.prototype['setContent'] = RichMarker.prototype.setContent;\n\n\n/**\n * Get the content of the marker.\n *\n * @return {string|Node} The marker content.\n */\nRichMarker.prototype.getContent = function() {\n return /** @type {Node|string} */ (this.get('content'));\n};\nRichMarker.prototype['getContent'] = RichMarker.prototype.getContent;\n\n\n/**\n * Sets the marker content and adds loading events to images\n */\nRichMarker.prototype.content_changed = function() {\n if (!this.markerContent_) {\n // Marker content area doesnt exist.\n return;\n }\n\n this.removeChildren_(this.markerContent_);\n var content = this.getContent();\n if (content) {\n if (typeof content == 'string') {\n content = content.replace(/^\\s*([\\S\\s]*)\\b\\s*$/, '$1');\n content = this.htmlToDocumentFragment_(content);\n }\n this.markerContent_.appendChild(content);\n\n var that = this;\n var images = this.markerContent_.getElementsByTagName('IMG');\n for (var i = 0, image; image = images[i]; i++) {\n // By default, a browser lets a image be dragged outside of the browser,\n // so by calling preventDefault we stop this behaviour and allow the image\n // to be dragged around the map and now out of the browser and onto the\n // desktop.\n google.maps.event.addDomListener(image, 'mousedown', function(e) {\n if (that.getDraggable()) {\n if (e.preventDefault) {\n e.preventDefault();\n }\n e.returnValue = false;\n }\n });\n\n // Because we don't know the size of an image till it loads, add a\n // listener to the image load so the marker can resize and reposition\n // itself to be the correct height.\n google.maps.event.addDomListener(image, 'load', function() {\n that.draw();\n });\n }\n\n google.maps.event.trigger(this, 'domready');\n }\n\n if (this.ready_) {\n this.draw();\n }\n};\nRichMarker.prototype['content_changed'] = RichMarker.prototype.content_changed;\n\n/**\n * Sets the cursor.\n *\n * @param {string} whichCursor What cursor to show.\n * @private\n */\nRichMarker.prototype.setCursor_ = function(whichCursor) {\n if (!this.ready_) {\n return;\n }\n\n var cursor = '';\n if (navigator.userAgent.indexOf('Gecko/') !== -1) {\n // Moz has some nice cursors :)\n if (whichCursor == 'dragging') {\n cursor = '-moz-grabbing';\n }\n\n if (whichCursor == 'dragready') {\n cursor = '-moz-grab';\n }\n\n if (whichCursor == 'draggable') {\n cursor = 'pointer';\n }\n } else {\n if (whichCursor == 'dragging' || whichCursor == 'dragready') {\n cursor = 'move';\n }\n\n if (whichCursor == 'draggable') {\n cursor = 'pointer';\n }\n }\n\n if (this.markerWrapper_.style.cursor != cursor) {\n this.markerWrapper_.style.cursor = cursor;\n }\n};\n\n/**\n * Start dragging.\n *\n * @param {Event} e The event.\n */\nRichMarker.prototype.startDrag = function(e) {\n if (!this.getDraggable()) {\n return;\n }\n\n if (!this.dragging_) {\n this.dragging_ = true;\n var map = this.getMap();\n this.mapDraggable_ = map.get('draggable');\n map.set('draggable', false);\n\n // Store the current mouse position\n this.mouseX_ = e.clientX;\n this.mouseY_ = e.clientY;\n\n this.setCursor_('dragready');\n\n // Stop the text from being selectable while being dragged\n this.markerWrapper_.style['MozUserSelect'] = 'none';\n this.markerWrapper_.style['KhtmlUserSelect'] = 'none';\n this.markerWrapper_.style['WebkitUserSelect'] = 'none';\n\n this.markerWrapper_['unselectable'] = 'on';\n this.markerWrapper_['onselectstart'] = function() {\n return false;\n };\n\n this.addDraggingListeners_();\n\n google.maps.event.trigger(this, 'dragstart');\n }\n};\n\n\n/**\n * Stop dragging.\n */\nRichMarker.prototype.stopDrag = function() {\n if (!this.getDraggable()) {\n return;\n }\n\n if (this.dragging_) {\n this.dragging_ = false;\n this.getMap().set('draggable', this.mapDraggable_);\n this.mouseX_ = this.mouseY_ = this.mapDraggable_ = null;\n\n // Allow the text to be selectable again\n this.markerWrapper_.style['MozUserSelect'] = '';\n this.markerWrapper_.style['KhtmlUserSelect'] = '';\n this.markerWrapper_.style['WebkitUserSelect'] = '';\n this.markerWrapper_['unselectable'] = 'off';\n this.markerWrapper_['onselectstart'] = function() {};\n\n this.removeDraggingListeners_();\n\n this.setCursor_('draggable');\n google.maps.event.trigger(this, 'dragend');\n\n this.draw();\n }\n};\n\n\n/**\n * Handles the drag event.\n *\n * @param {Event} e The event.\n */\nRichMarker.prototype.drag = function(e) {\n if (!this.getDraggable() || !this.dragging_) {\n // This object isn't draggable or we have stopped dragging\n this.stopDrag();\n return;\n }\n\n var dx = this.mouseX_ - e.clientX;\n var dy = this.mouseY_ - e.clientY;\n\n this.mouseX_ = e.clientX;\n this.mouseY_ = e.clientY;\n\n var left = parseInt(this.markerWrapper_.style['left'], 10) - dx;\n var top = parseInt(this.markerWrapper_.style['top'], 10) - dy;\n\n this.markerWrapper_.style['left'] = left + 'px';\n this.markerWrapper_.style['top'] = top + 'px';\n\n var offset = this.getOffset_();\n\n // Set the position property and adjust for the anchor offset\n var point = new google.maps.Point(left - offset.width, top - offset.height);\n var projection = this.getProjection();\n this.setPosition(projection.fromDivPixelToLatLng(point));\n\n this.setCursor_('dragging');\n google.maps.event.trigger(this, 'drag');\n};\n\n\n/**\n * Removes the drag listeners associated with the marker.\n *\n * @private\n */\nRichMarker.prototype.removeDragListeners_ = function() {\n if (this.draggableListener_) {\n google.maps.event.removeListener(this.draggableListener_);\n delete this.draggableListener_;\n }\n this.setCursor_('');\n};\n\n\n/**\n * Add dragability events to the marker.\n *\n * @param {Node} node The node to apply dragging to.\n * @private\n */\nRichMarker.prototype.addDragging_ = function(node) {\n if (!node) {\n return;\n }\n\n var that = this;\n this.draggableListener_ =\n google.maps.event.addDomListener(node, 'mousedown', function(e) {\n that.startDrag(e);\n });\n\n this.setCursor_('draggable');\n};\n\n\n/**\n * Add dragging listeners.\n *\n * @private\n */\nRichMarker.prototype.addDraggingListeners_ = function() {\n var that = this;\n if (this.markerWrapper_.setCapture) {\n this.markerWrapper_.setCapture(true);\n this.draggingListeners_ = [\n google.maps.event.addDomListener(this.markerWrapper_, 'mousemove', function(e) {\n that.drag(e);\n }, true),\n google.maps.event.addDomListener(this.markerWrapper_, 'mouseup', function() {\n that.stopDrag();\n that.markerWrapper_.releaseCapture();\n }, true)\n ];\n } else {\n this.draggingListeners_ = [\n google.maps.event.addDomListener(window, 'mousemove', function(e) {\n that.drag(e);\n }, true),\n google.maps.event.addDomListener(window, 'mouseup', function() {\n that.stopDrag();\n }, true)\n ];\n }\n};\n\n\n/**\n * Remove dragging listeners.\n *\n * @private\n */\nRichMarker.prototype.removeDraggingListeners_ = function() {\n if (this.draggingListeners_) {\n for (var i = 0, listener; listener = this.draggingListeners_[i]; i++) {\n google.maps.event.removeListener(listener);\n }\n this.draggingListeners_.length = 0;\n }\n};\n\n\n/**\n * Get the anchor offset.\n *\n * @return {google.maps.Size} The size offset.\n * @private\n */\nRichMarker.prototype.getOffset_ = function() {\n var anchor = this.getAnchor();\n if (typeof anchor == 'object') {\n return /** @type {google.maps.Size} */ (anchor);\n }\n\n var offset = new google.maps.Size(0, 0);\n if (!this.markerContent_) {\n return offset;\n }\n\n var width = this.markerContent_.offsetWidth;\n var height = this.markerContent_.offsetHeight;\n\n switch (anchor) {\n case RichMarkerPosition['TOP_LEFT']:\n break;\n case RichMarkerPosition['TOP']:\n offset.width = -width / 2;\n break;\n case RichMarkerPosition['TOP_RIGHT']:\n offset.width = -width;\n break;\n case RichMarkerPosition['LEFT']:\n offset.height = -height / 2;\n break;\n case RichMarkerPosition['MIDDLE']:\n offset.width = -width / 2;\n offset.height = -height / 2;\n break;\n case RichMarkerPosition['RIGHT']:\n offset.width = -width;\n offset.height = -height / 2;\n break;\n case RichMarkerPosition['BOTTOM_LEFT']:\n offset.height = -height;\n break;\n case RichMarkerPosition['BOTTOM']:\n offset.width = -width / 2;\n offset.height = -height;\n break;\n case RichMarkerPosition['BOTTOM_RIGHT']:\n offset.width = -width;\n offset.height = -height;\n break;\n }\n\n return offset;\n};\n\n\n/**\n * Adding the marker to a map.\n * Implementing the interface.\n */\nRichMarker.prototype.onAdd = function() {\n if (!this.markerWrapper_) {\n this.markerWrapper_ = document.createElement('DIV');\n this.markerWrapper_.style['position'] = 'absolute';\n }\n\n if (this.getZIndex()) {\n this.markerWrapper_.style['zIndex'] = this.getZIndex();\n }\n\n this.markerWrapper_.style['display'] = this.getVisible() ? '' : 'none';\n\n if (!this.markerContent_) {\n this.markerContent_ = document.createElement('DIV');\n this.markerWrapper_.appendChild(this.markerContent_);\n\n var that = this;\n google.maps.event.addDomListener(this.markerContent_, 'click', function(e) {\n google.maps.event.trigger(that, 'click');\n });\n google.maps.event.addDomListener(this.markerContent_, 'mouseover', function(e) {\n google.maps.event.trigger(that, 'mouseover');\n });\n google.maps.event.addDomListener(this.markerContent_, 'mouseout', function(e) {\n google.maps.event.trigger(that, 'mouseout');\n });\n }\n\n this.ready_ = true;\n this.content_changed();\n this.flat_changed();\n this.draggable_changed();\n\n var panes = this.getPanes();\n if (panes) {\n panes.overlayMouseTarget.appendChild(this.markerWrapper_);\n }\n\n google.maps.event.trigger(this, 'ready');\n};\nRichMarker.prototype['onAdd'] = RichMarker.prototype.onAdd;\n\n\n/**\n * Impelementing the interface.\n */\nRichMarker.prototype.draw = function() {\n if (!this.ready_ || this.dragging_) {\n return;\n }\n\n var projection = this.getProjection();\n\n if (!projection) {\n // The map projection is not ready yet so do nothing\n return;\n }\n\n var latLng = /** @type {google.maps.LatLng} */ (this.get('position'));\n var pos = projection.fromLatLngToDivPixel(latLng);\n\n var offset = this.getOffset_();\n this.markerWrapper_.style['top'] = (pos.y + offset.height) + 'px';\n this.markerWrapper_.style['left'] = (pos.x + offset.width) + 'px';\n\n var height = this.markerContent_.offsetHeight;\n var width = this.markerContent_.offsetWidth;\n\n if (width != this.get('width')) {\n this.set('width', width);\n }\n\n if (height != this.get('height')) {\n this.set('height', height);\n }\n};\nRichMarker.prototype['draw'] = RichMarker.prototype.draw;\n\n\n/**\n * Removing a marker from the map.\n * Implementing the interface.\n */\nRichMarker.prototype.onRemove = function() {\n if (this.markerWrapper_ && this.markerWrapper_.parentNode) {\n this.markerWrapper_.parentNode.removeChild(this.markerWrapper_);\n }\n this.removeDragListeners_();\n};\nRichMarker.prototype['onRemove'] = RichMarker.prototype.onRemove;\n\n\n/**\n * RichMarker Anchor positions\n * @enum {number}\n */\nvar RichMarkerPosition = {\n 'TOP_LEFT': 1,\n 'TOP': 2,\n 'TOP_RIGHT': 3,\n 'LEFT': 4,\n 'MIDDLE': 5,\n 'RIGHT': 6,\n 'BOTTOM_LEFT': 7,\n 'BOTTOM': 8,\n 'BOTTOM_RIGHT': 9\n};\nwindow['RichMarkerPosition'] = RichMarkerPosition;\n\n\n //TODO: export / passthese on in the service instead of window\n window.InfoBox = InfoBox;\n window.Cluster = Cluster;\n window.ClusterIcon = ClusterIcon;\n window.MarkerClusterer = MarkerClusterer;\n window.MarkerLabel_ = MarkerLabel_;\n window.MarkerWithLabel = MarkerWithLabel;\n window.RichMarker = RichMarker;\n }();\n //END REPLACE\n })\n };\n});\n;/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* istanbul ignore next */\n\tangular.module('uiGmapgoogle-maps.wrapped')\n\t.service('uiGmapDataStructures', function() {\n\treturn {\n\t Graph: __webpack_require__(1).Graph,\n\t Queue: __webpack_require__(1).Queue\n\t};\n\t});\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t(function() {\n\t module.exports = {\n\t Graph: __webpack_require__(2),\n\t Heap: __webpack_require__(3),\n\t LinkedList: __webpack_require__(4),\n\t Map: __webpack_require__(5),\n\t Queue: __webpack_require__(6),\n\t RedBlackTree: __webpack_require__(7),\n\t Trie: __webpack_require__(8)\n\t };\n\n\t}).call(this);\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t/*\n\tGraph implemented as a modified incidence list. O(1) for every typical\n\toperation except `removeNode()` at O(E) where E is the number of edges.\n\n\t## Overview example:\n\n\t```js\n\tvar graph = new Graph;\n\tgraph.addNode('A'); // => a node object. For more info, log the output or check\n\t // the documentation for addNode\n\tgraph.addNode('B');\n\tgraph.addNode('C');\n\tgraph.addEdge('A', 'C'); // => an edge object\n\tgraph.addEdge('A', 'B');\n\tgraph.getEdge('B', 'A'); // => undefined. Directed edge!\n\tgraph.getEdge('A', 'B'); // => the edge object previously added\n\tgraph.getEdge('A', 'B').weight = 2 // weight is the only built-in handy property\n\t // of an edge object. Feel free to attach\n\t // other properties\n\tgraph.getInEdgesOf('B'); // => array of edge objects, in this case only one;\n\t // connecting A to B\n\tgraph.getOutEdgesOf('A'); // => array of edge objects, one to B and one to C\n\tgraph.getAllEdgesOf('A'); // => all the in and out edges. Edge directed toward\n\t // the node itself are only counted once\n\tforEachNode(function(nodeObject) {\n\t console.log(node);\n\t});\n\tforEachEdge(function(edgeObject) {\n\t console.log(edgeObject);\n\t});\n\tgraph.removeNode('C'); // => 'C'. The edge between A and C also removed\n\tgraph.removeEdge('A', 'B'); // => the edge object removed\n\t```\n\n\t## Properties:\n\n\t- nodeSize: total number of nodes.\n\t- edgeSize: total number of edges.\n\t*/\n\n\n\t(function() {\n\t var Graph,\n\t __hasProp = {}.hasOwnProperty;\n\n\t Graph = (function() {\n\t function Graph() {\n\t this._nodes = {};\n\t this.nodeSize = 0;\n\t this.edgeSize = 0;\n\t }\n\n\t Graph.prototype.addNode = function(id) {\n\t /*\n\t The `id` is a unique identifier for the node, and should **not** change\n\t after it's added. It will be used for adding, retrieving and deleting\n\t related edges too.\n\t \n\t **Note** that, internally, the ids are kept in an object. JavaScript's\n\t object hashes the id `'2'` and `2` to the same key, so please stick to a\n\t simple id data type such as number or string.\n\t \n\t _Returns:_ the node object. Feel free to attach additional custom properties\n\t on it for graph algorithms' needs. **Undefined if node id already exists**,\n\t as to avoid accidental overrides.\n\t */\n\n\t if (!this._nodes[id]) {\n\t this.nodeSize++;\n\t return this._nodes[id] = {\n\t _outEdges: {},\n\t _inEdges: {}\n\t };\n\t }\n\t };\n\n\t Graph.prototype.getNode = function(id) {\n\t /*\n\t _Returns:_ the node object. Feel free to attach additional custom properties\n\t on it for graph algorithms' needs.\n\t */\n\n\t return this._nodes[id];\n\t };\n\n\t Graph.prototype.removeNode = function(id) {\n\t /*\n\t _Returns:_ the node object removed, or undefined if it didn't exist in the\n\t first place.\n\t */\n\n\t var inEdgeId, nodeToRemove, outEdgeId, _ref, _ref1;\n\t nodeToRemove = this._nodes[id];\n\t if (!nodeToRemove) {\n\t return;\n\t } else {\n\t _ref = nodeToRemove._outEdges;\n\t for (outEdgeId in _ref) {\n\t if (!__hasProp.call(_ref, outEdgeId)) continue;\n\t this.removeEdge(id, outEdgeId);\n\t }\n\t _ref1 = nodeToRemove._inEdges;\n\t for (inEdgeId in _ref1) {\n\t if (!__hasProp.call(_ref1, inEdgeId)) continue;\n\t this.removeEdge(inEdgeId, id);\n\t }\n\t this.nodeSize--;\n\t delete this._nodes[id];\n\t }\n\t return nodeToRemove;\n\t };\n\n\t Graph.prototype.addEdge = function(fromId, toId, weight) {\n\t var edgeToAdd, fromNode, toNode;\n\t if (weight == null) {\n\t weight = 1;\n\t }\n\t /*\n\t `fromId` and `toId` are the node id specified when it was created using\n\t `addNode()`. `weight` is optional and defaults to 1. Ignoring it effectively\n\t makes this an unweighted graph. Under the hood, `weight` is just a normal\n\t property of the edge object.\n\t \n\t _Returns:_ the edge object created. Feel free to attach additional custom\n\t properties on it for graph algorithms' needs. **Or undefined** if the nodes\n\t of id `fromId` or `toId` aren't found, or if an edge already exists between\n\t the two nodes.\n\t */\n\n\t if (this.getEdge(fromId, toId)) {\n\t return;\n\t }\n\t fromNode = this._nodes[fromId];\n\t toNode = this._nodes[toId];\n\t if (!fromNode || !toNode) {\n\t return;\n\t }\n\t edgeToAdd = {\n\t weight: weight\n\t };\n\t fromNode._outEdges[toId] = edgeToAdd;\n\t toNode._inEdges[fromId] = edgeToAdd;\n\t this.edgeSize++;\n\t return edgeToAdd;\n\t };\n\n\t Graph.prototype.getEdge = function(fromId, toId) {\n\t /*\n\t _Returns:_ the edge object, or undefined if the nodes of id `fromId` or\n\t `toId` aren't found.\n\t */\n\n\t var fromNode, toNode;\n\t fromNode = this._nodes[fromId];\n\t toNode = this._nodes[toId];\n\t if (!fromNode || !toNode) {\n\n\t } else {\n\t return fromNode._outEdges[toId];\n\t }\n\t };\n\n\t Graph.prototype.removeEdge = function(fromId, toId) {\n\t /*\n\t _Returns:_ the edge object removed, or undefined of edge wasn't found.\n\t */\n\n\t var edgeToDelete, fromNode, toNode;\n\t fromNode = this._nodes[fromId];\n\t toNode = this._nodes[toId];\n\t edgeToDelete = this.getEdge(fromId, toId);\n\t if (!edgeToDelete) {\n\t return;\n\t }\n\t delete fromNode._outEdges[toId];\n\t delete toNode._inEdges[fromId];\n\t this.edgeSize--;\n\t return edgeToDelete;\n\t };\n\n\t Graph.prototype.getInEdgesOf = function(nodeId) {\n\t /*\n\t _Returns:_ an array of edge objects that are directed toward the node, or\n\t empty array if no such edge or node exists.\n\t */\n\n\t var fromId, inEdges, toNode, _ref;\n\t toNode = this._nodes[nodeId];\n\t inEdges = [];\n\t _ref = toNode != null ? toNode._inEdges : void 0;\n\t for (fromId in _ref) {\n\t if (!__hasProp.call(_ref, fromId)) continue;\n\t inEdges.push(this.getEdge(fromId, nodeId));\n\t }\n\t return inEdges;\n\t };\n\n\t Graph.prototype.getOutEdgesOf = function(nodeId) {\n\t /*\n\t _Returns:_ an array of edge objects that go out of the node, or empty array\n\t if no such edge or node exists.\n\t */\n\n\t var fromNode, outEdges, toId, _ref;\n\t fromNode = this._nodes[nodeId];\n\t outEdges = [];\n\t _ref = fromNode != null ? fromNode._outEdges : void 0;\n\t for (toId in _ref) {\n\t if (!__hasProp.call(_ref, toId)) continue;\n\t outEdges.push(this.getEdge(nodeId, toId));\n\t }\n\t return outEdges;\n\t };\n\n\t Graph.prototype.getAllEdgesOf = function(nodeId) {\n\t /*\n\t **Note:** not the same as concatenating `getInEdgesOf()` and\n\t `getOutEdgesOf()`. Some nodes might have an edge pointing toward itself.\n\t This method solves that duplication.\n\t \n\t _Returns:_ an array of edge objects linked to the node, no matter if they're\n\t outgoing or coming. Duplicate edge created by self-pointing nodes are\n\t removed. Only one copy stays. Empty array if node has no edge.\n\t */\n\n\t var i, inEdges, outEdges, selfEdge, _i, _ref, _ref1;\n\t inEdges = this.getInEdgesOf(nodeId);\n\t outEdges = this.getOutEdgesOf(nodeId);\n\t if (inEdges.length === 0) {\n\t return outEdges;\n\t }\n\t selfEdge = this.getEdge(nodeId, nodeId);\n\t for (i = _i = 0, _ref = inEdges.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {\n\t if (inEdges[i] === selfEdge) {\n\t _ref1 = [inEdges[inEdges.length - 1], inEdges[i]], inEdges[i] = _ref1[0], inEdges[inEdges.length - 1] = _ref1[1];\n\t inEdges.pop();\n\t break;\n\t }\n\t }\n\t return inEdges.concat(outEdges);\n\t };\n\n\t Graph.prototype.forEachNode = function(operation) {\n\t /*\n\t Traverse through the graph in an arbitrary manner, visiting each node once.\n\t Pass a function of the form `fn(nodeObject, nodeId)`.\n\t \n\t _Returns:_ undefined.\n\t */\n\n\t var nodeId, nodeObject, _ref;\n\t _ref = this._nodes;\n\t for (nodeId in _ref) {\n\t if (!__hasProp.call(_ref, nodeId)) continue;\n\t nodeObject = _ref[nodeId];\n\t operation(nodeObject, nodeId);\n\t }\n\t };\n\n\t Graph.prototype.forEachEdge = function(operation) {\n\t /*\n\t Traverse through the graph in an arbitrary manner, visiting each edge once.\n\t Pass a function of the form `fn(edgeObject)`.\n\t \n\t _Returns:_ undefined.\n\t */\n\n\t var edgeObject, nodeId, nodeObject, toId, _ref, _ref1;\n\t _ref = this._nodes;\n\t for (nodeId in _ref) {\n\t if (!__hasProp.call(_ref, nodeId)) continue;\n\t nodeObject = _ref[nodeId];\n\t _ref1 = nodeObject._outEdges;\n\t for (toId in _ref1) {\n\t if (!__hasProp.call(_ref1, toId)) continue;\n\t edgeObject = _ref1[toId];\n\t operation(edgeObject);\n\t }\n\t }\n\t };\n\n\t return Graph;\n\n\t })();\n\n\t module.exports = Graph;\n\n\t}).call(this);\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t/*\n\tMinimum heap, i.e. smallest node at root.\n\n\t**Note:** does not accept null or undefined. This is by design. Those values\n\tcause comparison problems and might report false negative during extraction.\n\n\t## Overview example:\n\n\t```js\n\tvar heap = new Heap([5, 6, 3, 4]);\n\theap.add(10); // => 10\n\theap.removeMin(); // => 3\n\theap.peekMin(); // => 4\n\t```\n\n\t## Properties:\n\n\t- size: total number of items.\n\t*/\n\n\n\t(function() {\n\t var Heap, _leftChild, _parent, _rightChild;\n\n\t Heap = (function() {\n\t function Heap(dataToHeapify) {\n\t var i, item, _i, _j, _len, _ref;\n\t if (dataToHeapify == null) {\n\t dataToHeapify = [];\n\t }\n\t /*\n\t Pass an optional array to be heapified. Takes only O(n) time.\n\t */\n\n\t this._data = [void 0];\n\t for (_i = 0, _len = dataToHeapify.length; _i < _len; _i++) {\n\t item = dataToHeapify[_i];\n\t if (item != null) {\n\t this._data.push(item);\n\t }\n\t }\n\t if (this._data.length > 1) {\n\t for (i = _j = 2, _ref = this._data.length; 2 <= _ref ? _j < _ref : _j > _ref; i = 2 <= _ref ? ++_j : --_j) {\n\t this._upHeap(i);\n\t }\n\t }\n\t this.size = this._data.length - 1;\n\t }\n\n\t Heap.prototype.add = function(value) {\n\t /*\n\t **Remember:** rejects null and undefined for mentioned reasons.\n\t \n\t _Returns:_ the value added.\n\t */\n\n\t if (value == null) {\n\t return;\n\t }\n\t this._data.push(value);\n\t this._upHeap(this._data.length - 1);\n\t this.size++;\n\t return value;\n\t };\n\n\t Heap.prototype.removeMin = function() {\n\t /*\n\t _Returns:_ the smallest item (the root).\n\t */\n\n\t var min;\n\t if (this._data.length === 1) {\n\t return;\n\t }\n\t this.size--;\n\t if (this._data.length === 2) {\n\t return this._data.pop();\n\t }\n\t min = this._data[1];\n\t this._data[1] = this._data.pop();\n\t this._downHeap();\n\t return min;\n\t };\n\n\t Heap.prototype.peekMin = function() {\n\t /*\n\t Check the smallest item without removing it.\n\t \n\t _Returns:_ the smallest item (the root).\n\t */\n\n\t return this._data[1];\n\t };\n\n\t Heap.prototype._upHeap = function(index) {\n\t var valueHolder, _ref;\n\t valueHolder = this._data[index];\n\t while (this._data[index] < this._data[_parent(index)] && index > 1) {\n\t _ref = [this._data[_parent(index)], this._data[index]], this._data[index] = _ref[0], this._data[_parent(index)] = _ref[1];\n\t index = _parent(index);\n\t }\n\t };\n\n\t Heap.prototype._downHeap = function() {\n\t var currentIndex, smallerChildIndex, _ref;\n\t currentIndex = 1;\n\t while (_leftChild(currentIndex < this._data.length)) {\n\t smallerChildIndex = _leftChild(currentIndex);\n\t if (smallerChildIndex < this._data.length - 1) {\n\t if (this._data[_rightChild(currentIndex)] < this._data[smallerChildIndex]) {\n\t smallerChildIndex = _rightChild(currentIndex);\n\t }\n\t }\n\t if (this._data[smallerChildIndex] < this._data[currentIndex]) {\n\t _ref = [this._data[currentIndex], this._data[smallerChildIndex]], this._data[smallerChildIndex] = _ref[0], this._data[currentIndex] = _ref[1];\n\t currentIndex = smallerChildIndex;\n\t } else {\n\t break;\n\t }\n\t }\n\t };\n\n\t return Heap;\n\n\t })();\n\n\t _parent = function(index) {\n\t return index >> 1;\n\t };\n\n\t _leftChild = function(index) {\n\t return index << 1;\n\t };\n\n\t _rightChild = function(index) {\n\t return (index << 1) + 1;\n\t };\n\n\t module.exports = Heap;\n\n\t}).call(this);\n\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t/*\n\tDoubly Linked.\n\n\t## Overview example:\n\n\t```js\n\tvar list = new LinkedList([5, 4, 9]);\n\tlist.add(12); // => 12\n\tlist.head.next.value; // => 4\n\tlist.tail.value; // => 12\n\tlist.at(-1); // => 12\n\tlist.removeAt(2); // => 9\n\tlist.remove(4); // => 4\n\tlist.indexOf(5); // => 0\n\tlist.add(5, 1); // => 5. Second 5 at position 1.\n\tlist.indexOf(5, 1); // => 1\n\t```\n\n\t## Properties:\n\n\t- head: first item.\n\t- tail: last item.\n\t- size: total number of items.\n\t- item.value: value passed to the item when calling `add()`.\n\t- item.prev: previous item.\n\t- item.next: next item.\n\t*/\n\n\n\t(function() {\n\t var LinkedList;\n\n\t LinkedList = (function() {\n\t function LinkedList(valuesToAdd) {\n\t var value, _i, _len;\n\t if (valuesToAdd == null) {\n\t valuesToAdd = [];\n\t }\n\t /*\n\t Can pass an array of elements to link together during `new LinkedList()`\n\t initiation.\n\t */\n\n\t this.head = {\n\t prev: void 0,\n\t value: void 0,\n\t next: void 0\n\t };\n\t this.tail = {\n\t prev: void 0,\n\t value: void 0,\n\t next: void 0\n\t };\n\t this.size = 0;\n\t for (_i = 0, _len = valuesToAdd.length; _i < _len; _i++) {\n\t value = valuesToAdd[_i];\n\t this.add(value);\n\t }\n\t }\n\n\t LinkedList.prototype.at = function(position) {\n\t /*\n\t Get the item at `position` (optional). Accepts negative index:\n\t \n\t ```js\n\t myList.at(-1); // Returns the last element.\n\t ```\n\t However, passing a negative index that surpasses the boundary will return\n\t undefined:\n\t \n\t ```js\n\t myList = new LinkedList([2, 6, 8, 3])\n\t myList.at(-5); // Undefined.\n\t myList.at(-4); // 2.\n\t ```\n\t _Returns:_ item gotten, or undefined if not found.\n\t */\n\n\t var currentNode, i, _i, _j, _ref;\n\t if (!((-this.size <= position && position < this.size))) {\n\t return;\n\t }\n\t position = this._adjust(position);\n\t if (position * 2 < this.size) {\n\t currentNode = this.head;\n\t for (i = _i = 1; _i <= position; i = _i += 1) {\n\t currentNode = currentNode.next;\n\t }\n\t } else {\n\t currentNode = this.tail;\n\t for (i = _j = 1, _ref = this.size - position - 1; _j <= _ref; i = _j += 1) {\n\t currentNode = currentNode.prev;\n\t }\n\t }\n\t return currentNode;\n\t };\n\n\t LinkedList.prototype.add = function(value, position) {\n\t var currentNode, nodeToAdd, _ref, _ref1, _ref2;\n\t if (position == null) {\n\t position = this.size;\n\t }\n\t /*\n\t Add a new item at `position` (optional). Defaults to adding at the end.\n\t `position`, just like in `at()`, can be negative (within the negative\n\t boundary). Position specifies the place the value's going to be, and the old\n\t node will be pushed higher. `add(-2)` on list of size 7 is the same as\n\t `add(5)`.\n\t \n\t _Returns:_ item added.\n\t */\n\n\t if (!((-this.size <= position && position <= this.size))) {\n\t return;\n\t }\n\t nodeToAdd = {\n\t value: value\n\t };\n\t position = this._adjust(position);\n\t if (this.size === 0) {\n\t this.head = nodeToAdd;\n\t } else {\n\t if (position === 0) {\n\t _ref = [nodeToAdd, this.head, nodeToAdd], this.head.prev = _ref[0], nodeToAdd.next = _ref[1], this.head = _ref[2];\n\t } else {\n\t currentNode = this.at(position - 1);\n\t _ref1 = [currentNode.next, nodeToAdd, nodeToAdd, currentNode], nodeToAdd.next = _ref1[0], (_ref2 = currentNode.next) != null ? _ref2.prev = _ref1[1] : void 0, currentNode.next = _ref1[2], nodeToAdd.prev = _ref1[3];\n\t }\n\t }\n\t if (position === this.size) {\n\t this.tail = nodeToAdd;\n\t }\n\t this.size++;\n\t return value;\n\t };\n\n\t LinkedList.prototype.removeAt = function(position) {\n\t var currentNode, valueToReturn, _ref;\n\t if (position == null) {\n\t position = this.size - 1;\n\t }\n\t /*\n\t Remove an item at index `position` (optional). Defaults to the last item.\n\t Index can be negative (within the boundary).\n\t \n\t _Returns:_ item removed.\n\t */\n\n\t if (!((-this.size <= position && position < this.size))) {\n\t return;\n\t }\n\t if (this.size === 0) {\n\t return;\n\t }\n\t position = this._adjust(position);\n\t if (this.size === 1) {\n\t valueToReturn = this.head.value;\n\t this.head.value = this.tail.value = void 0;\n\t } else {\n\t if (position === 0) {\n\t valueToReturn = this.head.value;\n\t this.head = this.head.next;\n\t this.head.prev = void 0;\n\t } else {\n\t currentNode = this.at(position);\n\t valueToReturn = currentNode.value;\n\t currentNode.prev.next = currentNode.next;\n\t if ((_ref = currentNode.next) != null) {\n\t _ref.prev = currentNode.prev;\n\t }\n\t if (position === this.size - 1) {\n\t this.tail = currentNode.prev;\n\t }\n\t }\n\t }\n\t this.size--;\n\t return valueToReturn;\n\t };\n\n\t LinkedList.prototype.remove = function(value) {\n\t /*\n\t Remove the item using its value instead of position. **Will remove the fist\n\t occurrence of `value`.**\n\t \n\t _Returns:_ the value, or undefined if value's not found.\n\t */\n\n\t var currentNode;\n\t if (value == null) {\n\t return;\n\t }\n\t currentNode = this.head;\n\t while (currentNode && currentNode.value !== value) {\n\t currentNode = currentNode.next;\n\t }\n\t if (!currentNode) {\n\t return;\n\t }\n\t if (this.size === 1) {\n\t this.head.value = this.tail.value = void 0;\n\t } else if (currentNode === this.head) {\n\t this.head = this.head.next;\n\t this.head.prev = void 0;\n\t } else if (currentNode === this.tail) {\n\t this.tail = this.tail.prev;\n\t this.tail.next = void 0;\n\t } else {\n\t currentNode.prev.next = currentNode.next;\n\t currentNode.next.prev = currentNode.prev;\n\t }\n\t this.size--;\n\t return value;\n\t };\n\n\t LinkedList.prototype.indexOf = function(value, startingPosition) {\n\t var currentNode, position;\n\t if (startingPosition == null) {\n\t startingPosition = 0;\n\t }\n\t /*\n\t Find the index of an item, similarly to `array.indexOf()`. Defaults to start\n\t searching from the beginning, by can start at another position by passing\n\t `startingPosition`. This parameter can also be negative; but unlike the\n\t other methods of this class, `startingPosition` (optional) can be as small\n\t as desired; a value of -999 for a list of size 5 will start searching\n\t normally, at the beginning.\n\t \n\t **Note:** searches forwardly, **not** backwardly, i.e:\n\t \n\t ```js\n\t var myList = new LinkedList([2, 3, 1, 4, 3, 5])\n\t myList.indexOf(3, -3); // Returns 4, not 1\n\t ```\n\t _Returns:_ index of item found, or -1 if not found.\n\t */\n\n\t if (((this.head.value == null) && !this.head.next) || startingPosition >= this.size) {\n\t return -1;\n\t }\n\t startingPosition = Math.max(0, this._adjust(startingPosition));\n\t currentNode = this.at(startingPosition);\n\t position = startingPosition;\n\t while (currentNode) {\n\t if (currentNode.value === value) {\n\t break;\n\t }\n\t currentNode = currentNode.next;\n\t position++;\n\t }\n\t if (position === this.size) {\n\t return -1;\n\t } else {\n\t return position;\n\t }\n\t };\n\n\t LinkedList.prototype._adjust = function(position) {\n\t if (position < 0) {\n\t return this.size + position;\n\t } else {\n\t return position;\n\t }\n\t };\n\n\t return LinkedList;\n\n\t })();\n\n\t module.exports = LinkedList;\n\n\t}).call(this);\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t/*\n\tKind of a stopgap measure for the upcoming [JavaScript\n\tMap](http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets)\n\n\t**Note:** due to JavaScript's limitations, hashing something other than Boolean,\n\tNumber, String, Undefined, Null, RegExp, Function requires a hack that inserts a\n\thidden unique property into the object. This means `set`, `get`, `has` and\n\t`delete` must employ the same object, and not a mere identical copy as in the\n\tcase of, say, a string.\n\n\t## Overview example:\n\n\t```js\n\tvar map = new Map({'alice': 'wonderland', 20: 'ok'});\n\tmap.set('20', 5); // => 5\n\tmap.get('20'); // => 5\n\tmap.has('alice'); // => true\n\tmap.delete(20) // => true\n\tvar arr = [1, 2];\n\tmap.add(arr, 'goody'); // => 'goody'\n\tmap.has(arr); // => true\n\tmap.has([1, 2]); // => false. Needs to compare by reference\n\tmap.forEach(function(key, value) {\n\t console.log(key, value);\n\t});\n\t```\n\n\t## Properties:\n\n\t- size: The total number of `(key, value)` pairs.\n\t*/\n\n\n\t(function() {\n\t var Map, SPECIAL_TYPE_KEY_PREFIX, _extractDataType, _isSpecialType,\n\t __hasProp = {}.hasOwnProperty;\n\n\t SPECIAL_TYPE_KEY_PREFIX = '_mapId_';\n\n\t Map = (function() {\n\t Map._mapIdTracker = 0;\n\n\t Map._newMapId = function() {\n\t return this._mapIdTracker++;\n\t };\n\n\t function Map(objectToMap) {\n\t /*\n\t Pass an optional object whose (key, value) pair will be hashed. **Careful**\n\t not to pass something like {5: 'hi', '5': 'hello'}, since JavaScript's\n\t native object behavior will crush the first 5 property before it gets to\n\t constructor.\n\t */\n\n\t var key, value;\n\t this._content = {};\n\t this._itemId = 0;\n\t this._id = Map._newMapId();\n\t this.size = 0;\n\t for (key in objectToMap) {\n\t if (!__hasProp.call(objectToMap, key)) continue;\n\t value = objectToMap[key];\n\t this.set(key, value);\n\t }\n\t }\n\n\t Map.prototype.hash = function(key, makeHash) {\n\t var propertyForMap, type;\n\t if (makeHash == null) {\n\t makeHash = false;\n\t }\n\t /*\n\t The hash function for hashing keys is public. Feel free to replace it with\n\t your own. The `makeHash` parameter is optional and accepts a boolean\n\t (defaults to `false`) indicating whether or not to produce a new hash (for\n\t the first use, naturally).\n\t \n\t _Returns:_ the hash.\n\t */\n\n\t type = _extractDataType(key);\n\t if (_isSpecialType(key)) {\n\t propertyForMap = SPECIAL_TYPE_KEY_PREFIX + this._id;\n\t if (makeHash && !key[propertyForMap]) {\n\t key[propertyForMap] = this._itemId++;\n\t }\n\t return propertyForMap + '_' + key[propertyForMap];\n\t } else {\n\t return type + '_' + key;\n\t }\n\t };\n\n\t Map.prototype.set = function(key, value) {\n\t /*\n\t _Returns:_ value.\n\t */\n\n\t if (!this.has(key)) {\n\t this.size++;\n\t }\n\t this._content[this.hash(key, true)] = [value, key];\n\t return value;\n\t };\n\n\t Map.prototype.get = function(key) {\n\t /*\n\t _Returns:_ value corresponding to the key, or undefined if not found.\n\t */\n\n\t var _ref;\n\t return (_ref = this._content[this.hash(key)]) != null ? _ref[0] : void 0;\n\t };\n\n\t Map.prototype.has = function(key) {\n\t /*\n\t Check whether a value exists for the key.\n\t \n\t _Returns:_ true or false.\n\t */\n\n\t return this.hash(key) in this._content;\n\t };\n\n\t Map.prototype[\"delete\"] = function(key) {\n\t /*\n\t Remove the (key, value) pair.\n\t \n\t _Returns:_ **true or false**. Unlike most of this library, this method\n\t doesn't return the deleted value. This is so that it conforms to the future\n\t JavaScript `map.delete()`'s behavior.\n\t */\n\n\t var hashedKey;\n\t hashedKey = this.hash(key);\n\t if (hashedKey in this._content) {\n\t delete this._content[hashedKey];\n\t if (_isSpecialType(key)) {\n\t delete key[SPECIAL_TYPE_KEY_PREFIX + this._id];\n\t }\n\t this.size--;\n\t return true;\n\t }\n\t return false;\n\t };\n\n\t Map.prototype.forEach = function(operation) {\n\t /*\n\t Traverse through the map. Pass a function of the form `fn(key, value)`.\n\t \n\t _Returns:_ undefined.\n\t */\n\n\t var key, value, _ref;\n\t _ref = this._content;\n\t for (key in _ref) {\n\t if (!__hasProp.call(_ref, key)) continue;\n\t value = _ref[key];\n\t operation(value[1], value[0]);\n\t }\n\t };\n\n\t return Map;\n\n\t })();\n\n\t _isSpecialType = function(key) {\n\t var simpleHashableTypes, simpleType, type, _i, _len;\n\t simpleHashableTypes = ['Boolean', 'Number', 'String', 'Undefined', 'Null', 'RegExp', 'Function'];\n\t type = _extractDataType(key);\n\t for (_i = 0, _len = simpleHashableTypes.length; _i < _len; _i++) {\n\t simpleType = simpleHashableTypes[_i];\n\t if (type === simpleType) {\n\t return false;\n\t }\n\t }\n\t return true;\n\t };\n\n\t _extractDataType = function(type) {\n\t return Object.prototype.toString.apply(type).match(/\\[object (.+)\\]/)[1];\n\t };\n\n\t module.exports = Map;\n\n\t}).call(this);\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t/*\n\tAmortized O(1) dequeue!\n\n\t## Overview example:\n\n\t```js\n\tvar queue = new Queue([1, 6, 4]);\n\tqueue.enqueue(10); // => 10\n\tqueue.dequeue(); // => 1\n\tqueue.dequeue(); // => 6\n\tqueue.dequeue(); // => 4\n\tqueue.peek(); // => 10\n\tqueue.dequeue(); // => 10\n\tqueue.peek(); // => undefined\n\t```\n\n\t## Properties:\n\n\t- size: The total number of items.\n\t*/\n\n\n\t(function() {\n\t var Queue;\n\n\t Queue = (function() {\n\t function Queue(initialArray) {\n\t if (initialArray == null) {\n\t initialArray = [];\n\t }\n\t /*\n\t Pass an optional array to be transformed into a queue. The item at index 0\n\t is the first to be dequeued.\n\t */\n\n\t this._content = initialArray;\n\t this._dequeueIndex = 0;\n\t this.size = this._content.length;\n\t }\n\n\t Queue.prototype.enqueue = function(item) {\n\t /*\n\t _Returns:_ the item.\n\t */\n\n\t this.size++;\n\t this._content.push(item);\n\t return item;\n\t };\n\n\t Queue.prototype.dequeue = function() {\n\t /*\n\t _Returns:_ the dequeued item.\n\t */\n\n\t var itemToDequeue;\n\t if (this.size === 0) {\n\t return;\n\t }\n\t this.size--;\n\t itemToDequeue = this._content[this._dequeueIndex];\n\t this._dequeueIndex++;\n\t if (this._dequeueIndex * 2 > this._content.length) {\n\t this._content = this._content.slice(this._dequeueIndex);\n\t this._dequeueIndex = 0;\n\t }\n\t return itemToDequeue;\n\t };\n\n\t Queue.prototype.peek = function() {\n\t /*\n\t Check the next item to be dequeued, without removing it.\n\t \n\t _Returns:_ the item.\n\t */\n\n\t return this._content[this._dequeueIndex];\n\t };\n\n\t return Queue;\n\n\t })();\n\n\t module.exports = Queue;\n\n\t}).call(this);\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t/*\n\tCredit to Wikipedia's article on [Red-black\n\ttree](http://en.wikipedia.org/wiki/Red–black_tree)\n\n\t**Note:** doesn't handle duplicate entries, undefined and null. This is by\n\tdesign.\n\n\t## Overview example:\n\n\t```js\n\tvar rbt = new RedBlackTree([7, 5, 1, 8]);\n\trbt.add(2); // => 2\n\trbt.add(10); // => 10\n\trbt.has(5); // => true\n\trbt.peekMin(); // => 1\n\trbt.peekMax(); // => 10\n\trbt.removeMin(); // => 1\n\trbt.removeMax(); // => 10\n\trbt.remove(8); // => 8\n\t```\n\n\t## Properties:\n\n\t- size: The total number of items.\n\t*/\n\n\n\t(function() {\n\t var BLACK, NODE_FOUND, NODE_TOO_BIG, NODE_TOO_SMALL, RED, RedBlackTree, STOP_SEARCHING, _findNode, _grandParentOf, _isLeft, _leftOrRight, _peekMaxNode, _peekMinNode, _siblingOf, _uncleOf;\n\n\t NODE_FOUND = 0;\n\n\t NODE_TOO_BIG = 1;\n\n\t NODE_TOO_SMALL = 2;\n\n\t STOP_SEARCHING = 3;\n\n\t RED = 1;\n\n\t BLACK = 2;\n\n\t RedBlackTree = (function() {\n\t function RedBlackTree(valuesToAdd) {\n\t var value, _i, _len;\n\t if (valuesToAdd == null) {\n\t valuesToAdd = [];\n\t }\n\t /*\n\t Pass an optional array to be turned into binary tree. **Note:** does not\n\t accept duplicate, undefined and null.\n\t */\n\n\t this._root;\n\t this.size = 0;\n\t for (_i = 0, _len = valuesToAdd.length; _i < _len; _i++) {\n\t value = valuesToAdd[_i];\n\t if (value != null) {\n\t this.add(value);\n\t }\n\t }\n\t }\n\n\t RedBlackTree.prototype.add = function(value) {\n\t /*\n\t Again, make sure to not pass a value already in the tree, or undefined, or\n\t null.\n\t \n\t _Returns:_ value added.\n\t */\n\n\t var currentNode, foundNode, nodeToInsert, _ref;\n\t if (value == null) {\n\t return;\n\t }\n\t this.size++;\n\t nodeToInsert = {\n\t value: value,\n\t _color: RED\n\t };\n\t if (!this._root) {\n\t this._root = nodeToInsert;\n\t } else {\n\t foundNode = _findNode(this._root, function(node) {\n\t if (value === node.value) {\n\t return NODE_FOUND;\n\t } else {\n\t if (value < node.value) {\n\t if (node._left) {\n\t return NODE_TOO_BIG;\n\t } else {\n\t nodeToInsert._parent = node;\n\t node._left = nodeToInsert;\n\t return STOP_SEARCHING;\n\t }\n\t } else {\n\t if (node._right) {\n\t return NODE_TOO_SMALL;\n\t } else {\n\t nodeToInsert._parent = node;\n\t node._right = nodeToInsert;\n\t return STOP_SEARCHING;\n\t }\n\t }\n\t }\n\t });\n\t if (foundNode != null) {\n\t return;\n\t }\n\t }\n\t currentNode = nodeToInsert;\n\t while (true) {\n\t if (currentNode === this._root) {\n\t currentNode._color = BLACK;\n\t break;\n\t }\n\t if (currentNode._parent._color === BLACK) {\n\t break;\n\t }\n\t if (((_ref = _uncleOf(currentNode)) != null ? _ref._color : void 0) === RED) {\n\t currentNode._parent._color = BLACK;\n\t _uncleOf(currentNode)._color = BLACK;\n\t _grandParentOf(currentNode)._color = RED;\n\t currentNode = _grandParentOf(currentNode);\n\t continue;\n\t }\n\t if (!_isLeft(currentNode) && _isLeft(currentNode._parent)) {\n\t this._rotateLeft(currentNode._parent);\n\t currentNode = currentNode._left;\n\t } else if (_isLeft(currentNode) && !_isLeft(currentNode._parent)) {\n\t this._rotateRight(currentNode._parent);\n\t currentNode = currentNode._right;\n\t }\n\t currentNode._parent._color = BLACK;\n\t _grandParentOf(currentNode)._color = RED;\n\t if (_isLeft(currentNode)) {\n\t this._rotateRight(_grandParentOf(currentNode));\n\t } else {\n\t this._rotateLeft(_grandParentOf(currentNode));\n\t }\n\t break;\n\t }\n\t return value;\n\t };\n\n\t RedBlackTree.prototype.has = function(value) {\n\t /*\n\t _Returns:_ true or false.\n\t */\n\n\t var foundNode;\n\t foundNode = _findNode(this._root, function(node) {\n\t if (value === node.value) {\n\t return NODE_FOUND;\n\t } else if (value < node.value) {\n\t return NODE_TOO_BIG;\n\t } else {\n\t return NODE_TOO_SMALL;\n\t }\n\t });\n\t if (foundNode) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t };\n\n\t RedBlackTree.prototype.peekMin = function() {\n\t /*\n\t Check the minimum value without removing it.\n\t \n\t _Returns:_ the minimum value.\n\t */\n\n\t var _ref;\n\t return (_ref = _peekMinNode(this._root)) != null ? _ref.value : void 0;\n\t };\n\n\t RedBlackTree.prototype.peekMax = function() {\n\t /*\n\t Check the maximum value without removing it.\n\t \n\t _Returns:_ the maximum value.\n\t */\n\n\t var _ref;\n\t return (_ref = _peekMaxNode(this._root)) != null ? _ref.value : void 0;\n\t };\n\n\t RedBlackTree.prototype.remove = function(value) {\n\t /*\n\t _Returns:_ the value removed, or undefined if the value's not found.\n\t */\n\n\t var foundNode;\n\t foundNode = _findNode(this._root, function(node) {\n\t if (value === node.value) {\n\t return NODE_FOUND;\n\t } else if (value < node.value) {\n\t return NODE_TOO_BIG;\n\t } else {\n\t return NODE_TOO_SMALL;\n\t }\n\t });\n\t if (!foundNode) {\n\t return;\n\t }\n\t this._removeNode(this._root, foundNode);\n\t this.size--;\n\t return value;\n\t };\n\n\t RedBlackTree.prototype.removeMin = function() {\n\t /*\n\t _Returns:_ smallest item removed, or undefined if tree's empty.\n\t */\n\n\t var nodeToRemove, valueToReturn;\n\t nodeToRemove = _peekMinNode(this._root);\n\t if (!nodeToRemove) {\n\t return;\n\t }\n\t valueToReturn = nodeToRemove.value;\n\t this._removeNode(this._root, nodeToRemove);\n\t return valueToReturn;\n\t };\n\n\t RedBlackTree.prototype.removeMax = function() {\n\t /*\n\t _Returns:_ biggest item removed, or undefined if tree's empty.\n\t */\n\n\t var nodeToRemove, valueToReturn;\n\t nodeToRemove = _peekMaxNode(this._root);\n\t if (!nodeToRemove) {\n\t return;\n\t }\n\t valueToReturn = nodeToRemove.value;\n\t this._removeNode(this._root, nodeToRemove);\n\t return valueToReturn;\n\t };\n\n\t RedBlackTree.prototype._removeNode = function(root, node) {\n\t var sibling, successor, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;\n\t if (node._left && node._right) {\n\t successor = _peekMinNode(node._right);\n\t node.value = successor.value;\n\t node = successor;\n\t }\n\t successor = node._left || node._right;\n\t if (!successor) {\n\t successor = {\n\t color: BLACK,\n\t _right: void 0,\n\t _left: void 0,\n\t isLeaf: true\n\t };\n\t }\n\t successor._parent = node._parent;\n\t if ((_ref = node._parent) != null) {\n\t _ref[_leftOrRight(node)] = successor;\n\t }\n\t if (node._color === BLACK) {\n\t if (successor._color === RED) {\n\t successor._color = BLACK;\n\t if (!successor._parent) {\n\t this._root = successor;\n\t }\n\t } else {\n\t while (true) {\n\t if (!successor._parent) {\n\t if (!successor.isLeaf) {\n\t this._root = successor;\n\t } else {\n\t this._root = void 0;\n\t }\n\t break;\n\t }\n\t sibling = _siblingOf(successor);\n\t if ((sibling != null ? sibling._color : void 0) === RED) {\n\t successor._parent._color = RED;\n\t sibling._color = BLACK;\n\t if (_isLeft(successor)) {\n\t this._rotateLeft(successor._parent);\n\t } else {\n\t this._rotateRight(successor._parent);\n\t }\n\t }\n\t sibling = _siblingOf(successor);\n\t if (successor._parent._color === BLACK && (!sibling || (sibling._color === BLACK && (!sibling._left || sibling._left._color === BLACK) && (!sibling._right || sibling._right._color === BLACK)))) {\n\t if (sibling != null) {\n\t sibling._color = RED;\n\t }\n\t if (successor.isLeaf) {\n\t successor._parent[_leftOrRight(successor)] = void 0;\n\t }\n\t successor = successor._parent;\n\t continue;\n\t }\n\t if (successor._parent._color === RED && (!sibling || (sibling._color === BLACK && (!sibling._left || ((_ref1 = sibling._left) != null ? _ref1._color : void 0) === BLACK) && (!sibling._right || ((_ref2 = sibling._right) != null ? _ref2._color : void 0) === BLACK)))) {\n\t if (sibling != null) {\n\t sibling._color = RED;\n\t }\n\t successor._parent._color = BLACK;\n\t break;\n\t }\n\t if ((sibling != null ? sibling._color : void 0) === BLACK) {\n\t if (_isLeft(successor) && (!sibling._right || sibling._right._color === BLACK) && ((_ref3 = sibling._left) != null ? _ref3._color : void 0) === RED) {\n\t sibling._color = RED;\n\t if ((_ref4 = sibling._left) != null) {\n\t _ref4._color = BLACK;\n\t }\n\t this._rotateRight(sibling);\n\t } else if (!_isLeft(successor) && (!sibling._left || sibling._left._color === BLACK) && ((_ref5 = sibling._right) != null ? _ref5._color : void 0) === RED) {\n\t sibling._color = RED;\n\t if ((_ref6 = sibling._right) != null) {\n\t _ref6._color = BLACK;\n\t }\n\t this._rotateLeft(sibling);\n\t }\n\t break;\n\t }\n\t sibling = _siblingOf(successor);\n\t sibling._color = successor._parent._color;\n\t if (_isLeft(successor)) {\n\t sibling._right._color = BLACK;\n\t this._rotateRight(successor._parent);\n\t } else {\n\t sibling._left._color = BLACK;\n\t this._rotateLeft(successor._parent);\n\t }\n\t }\n\t }\n\t }\n\t if (successor.isLeaf) {\n\t return (_ref7 = successor._parent) != null ? _ref7[_leftOrRight(successor)] = void 0 : void 0;\n\t }\n\t };\n\n\t RedBlackTree.prototype._rotateLeft = function(node) {\n\t var _ref, _ref1;\n\t if ((_ref = node._parent) != null) {\n\t _ref[_leftOrRight(node)] = node._right;\n\t }\n\t node._right._parent = node._parent;\n\t node._parent = node._right;\n\t node._right = node._right._left;\n\t node._parent._left = node;\n\t if ((_ref1 = node._right) != null) {\n\t _ref1._parent = node;\n\t }\n\t if (node._parent._parent == null) {\n\t return this._root = node._parent;\n\t }\n\t };\n\n\t RedBlackTree.prototype._rotateRight = function(node) {\n\t var _ref, _ref1;\n\t if ((_ref = node._parent) != null) {\n\t _ref[_leftOrRight(node)] = node._left;\n\t }\n\t node._left._parent = node._parent;\n\t node._parent = node._left;\n\t node._left = node._left._right;\n\t node._parent._right = node;\n\t if ((_ref1 = node._left) != null) {\n\t _ref1._parent = node;\n\t }\n\t if (node._parent._parent == null) {\n\t return this._root = node._parent;\n\t }\n\t };\n\n\t return RedBlackTree;\n\n\t })();\n\n\t _isLeft = function(node) {\n\t return node === node._parent._left;\n\t };\n\n\t _leftOrRight = function(node) {\n\t if (_isLeft(node)) {\n\t return '_left';\n\t } else {\n\t return '_right';\n\t }\n\t };\n\n\t _findNode = function(startingNode, comparator) {\n\t var comparisonResult, currentNode, foundNode;\n\t currentNode = startingNode;\n\t foundNode = void 0;\n\t while (currentNode) {\n\t comparisonResult = comparator(currentNode);\n\t if (comparisonResult === NODE_FOUND) {\n\t foundNode = currentNode;\n\t break;\n\t }\n\t if (comparisonResult === NODE_TOO_BIG) {\n\t currentNode = currentNode._left;\n\t } else if (comparisonResult === NODE_TOO_SMALL) {\n\t currentNode = currentNode._right;\n\t } else if (comparisonResult === STOP_SEARCHING) {\n\t break;\n\t }\n\t }\n\t return foundNode;\n\t };\n\n\t _peekMinNode = function(startingNode) {\n\t return _findNode(startingNode, function(node) {\n\t if (node._left) {\n\t return NODE_TOO_BIG;\n\t } else {\n\t return NODE_FOUND;\n\t }\n\t });\n\t };\n\n\t _peekMaxNode = function(startingNode) {\n\t return _findNode(startingNode, function(node) {\n\t if (node._right) {\n\t return NODE_TOO_SMALL;\n\t } else {\n\t return NODE_FOUND;\n\t }\n\t });\n\t };\n\n\t _grandParentOf = function(node) {\n\t var _ref;\n\t return (_ref = node._parent) != null ? _ref._parent : void 0;\n\t };\n\n\t _uncleOf = function(node) {\n\t if (!_grandParentOf(node)) {\n\t return;\n\t }\n\t if (_isLeft(node._parent)) {\n\t return _grandParentOf(node)._right;\n\t } else {\n\t return _grandParentOf(node)._left;\n\t }\n\t };\n\n\t _siblingOf = function(node) {\n\t if (_isLeft(node)) {\n\t return node._parent._right;\n\t } else {\n\t return node._parent._left;\n\t }\n\t };\n\n\t module.exports = RedBlackTree;\n\n\t}).call(this);\n\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\tGood for fast insertion/removal/lookup of strings.\n\n\t## Overview example:\n\n\t```js\n\tvar trie = new Trie(['bear', 'beer']);\n\ttrie.add('hello'); // => 'hello'\n\ttrie.add('helloha!'); // => 'helloha!'\n\ttrie.has('bears'); // => false\n\ttrie.longestPrefixOf('beatrice'); // => 'bea'\n\ttrie.wordsWithPrefix('hel'); // => ['hello', 'helloha!']\n\ttrie.remove('beers'); // => undefined. 'beer' still exists\n\ttrie.remove('Beer') // => undefined. Case-sensitive\n\ttrie.remove('beer') // => 'beer'. Removed\n\t```\n\n\t## Properties:\n\n\t- size: The total number of words.\n\t*/\n\n\n\t(function() {\n\t var Queue, Trie, WORD_END, _hasAtLeastNChildren,\n\t __hasProp = {}.hasOwnProperty;\n\n\t Queue = __webpack_require__(6);\n\n\t WORD_END = 'end';\n\n\t Trie = (function() {\n\t function Trie(words) {\n\t var word, _i, _len;\n\t if (words == null) {\n\t words = [];\n\t }\n\t /*\n\t Pass an optional array of strings to be inserted initially.\n\t */\n\n\t this._root = {};\n\t this.size = 0;\n\t for (_i = 0, _len = words.length; _i < _len; _i++) {\n\t word = words[_i];\n\t this.add(word);\n\t }\n\t }\n\n\t Trie.prototype.add = function(word) {\n\t /*\n\t Add a whole string to the trie.\n\t \n\t _Returns:_ the word added. Will return undefined (without adding the value)\n\t if the word passed is null or undefined.\n\t */\n\n\t var currentNode, letter, _i, _len;\n\t if (word == null) {\n\t return;\n\t }\n\t this.size++;\n\t currentNode = this._root;\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\n\t letter = word[_i];\n\t if (currentNode[letter] == null) {\n\t currentNode[letter] = {};\n\t }\n\t currentNode = currentNode[letter];\n\t }\n\t currentNode[WORD_END] = true;\n\t return word;\n\t };\n\n\t Trie.prototype.has = function(word) {\n\t /*\n\t __Returns:_ true or false.\n\t */\n\n\t var currentNode, letter, _i, _len;\n\t if (word == null) {\n\t return false;\n\t }\n\t currentNode = this._root;\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\n\t letter = word[_i];\n\t if (currentNode[letter] == null) {\n\t return false;\n\t }\n\t currentNode = currentNode[letter];\n\t }\n\t if (currentNode[WORD_END]) {\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t };\n\n\t Trie.prototype.longestPrefixOf = function(word) {\n\t /*\n\t Find all words containing the prefix. The word itself counts as a prefix.\n\t \n\t ```js\n\t var trie = new Trie;\n\t trie.add('hello');\n\t trie.longestPrefixOf('he'); // 'he'\n\t trie.longestPrefixOf('hello'); // 'hello'\n\t trie.longestPrefixOf('helloha!'); // 'hello'\n\t ```\n\t \n\t _Returns:_ the prefix string, or empty string if no prefix found.\n\t */\n\n\t var currentNode, letter, prefix, _i, _len;\n\t if (word == null) {\n\t return '';\n\t }\n\t currentNode = this._root;\n\t prefix = '';\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\n\t letter = word[_i];\n\t if (currentNode[letter] == null) {\n\t break;\n\t }\n\t prefix += letter;\n\t currentNode = currentNode[letter];\n\t }\n\t return prefix;\n\t };\n\n\t Trie.prototype.wordsWithPrefix = function(prefix) {\n\t /*\n\t Find all words containing the prefix. The word itself counts as a prefix.\n\t **Watch out for edge cases.**\n\t \n\t ```js\n\t var trie = new Trie;\n\t trie.wordsWithPrefix(''); // []. Check later case below.\n\t trie.add('');\n\t trie.wordsWithPrefix(''); // ['']\n\t trie.add('he');\n\t trie.add('hello');\n\t trie.add('hell');\n\t trie.add('bear');\n\t trie.add('z');\n\t trie.add('zebra');\n\t trie.wordsWithPrefix('hel'); // ['hell', 'hello']\n\t ```\n\t \n\t _Returns:_ an array of strings, or empty array if no word found.\n\t */\n\n\t var accumulatedLetters, currentNode, letter, node, queue, subNode, words, _i, _len, _ref;\n\t if (prefix == null) {\n\t return [];\n\t }\n\t (prefix != null) || (prefix = '');\n\t words = [];\n\t currentNode = this._root;\n\t for (_i = 0, _len = prefix.length; _i < _len; _i++) {\n\t letter = prefix[_i];\n\t currentNode = currentNode[letter];\n\t if (currentNode == null) {\n\t return [];\n\t }\n\t }\n\t queue = new Queue();\n\t queue.enqueue([currentNode, '']);\n\t while (queue.size !== 0) {\n\t _ref = queue.dequeue(), node = _ref[0], accumulatedLetters = _ref[1];\n\t if (node[WORD_END]) {\n\t words.push(prefix + accumulatedLetters);\n\t }\n\t for (letter in node) {\n\t if (!__hasProp.call(node, letter)) continue;\n\t subNode = node[letter];\n\t queue.enqueue([subNode, accumulatedLetters + letter]);\n\t }\n\t }\n\t return words;\n\t };\n\n\t Trie.prototype.remove = function(word) {\n\t /*\n\t _Returns:_ the string removed, or undefined if the word in its whole doesn't\n\t exist. **Note:** this means removing `beers` when only `beer` exists will\n\t return undefined and conserve `beer`.\n\t */\n\n\t var currentNode, i, letter, prefix, _i, _j, _len, _ref;\n\t if (word == null) {\n\t return;\n\t }\n\t currentNode = this._root;\n\t prefix = [];\n\t for (_i = 0, _len = word.length; _i < _len; _i++) {\n\t letter = word[_i];\n\t if (currentNode[letter] == null) {\n\t return;\n\t }\n\t currentNode = currentNode[letter];\n\t prefix.push([letter, currentNode]);\n\t }\n\t if (!currentNode[WORD_END]) {\n\t return;\n\t }\n\t this.size--;\n\t delete currentNode[WORD_END];\n\t if (_hasAtLeastNChildren(currentNode, 1)) {\n\t return word;\n\t }\n\t for (i = _j = _ref = prefix.length - 1; _ref <= 1 ? _j <= 1 : _j >= 1; i = _ref <= 1 ? ++_j : --_j) {\n\t if (!_hasAtLeastNChildren(prefix[i][1], 1)) {\n\t delete prefix[i - 1][1][prefix[i][0]];\n\t } else {\n\t break;\n\t }\n\t }\n\t if (!_hasAtLeastNChildren(this._root[prefix[0][0]], 1)) {\n\t delete this._root[prefix[0][0]];\n\t }\n\t return word;\n\t };\n\n\t return Trie;\n\n\t })();\n\n\t _hasAtLeastNChildren = function(node, n) {\n\t var child, childCount;\n\t if (n === 0) {\n\t return true;\n\t }\n\t childCount = 0;\n\t for (child in node) {\n\t if (!__hasProp.call(node, child)) continue;\n\t childCount++;\n\t if (childCount >= n) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t };\n\n\t module.exports = Trie;\n\n\t}).call(this);\n\n\n/***/ }\n/******/ ]);;angular.module('uiGmapgoogle-maps.wrapped')\n.service('uiGmapMarkerSpiderfier', [ 'uiGmapGoogleMapApi', function(GoogleMapApi) {\n var self = this;\n /* istanbul ignore next */\n +function(){\n \n/** @preserve OverlappingMarkerSpiderfier\nhttps://github.com/jawj/OverlappingMarkerSpiderfier\nCopyright (c) 2011 - 2013 George MacKerron\nReleased under the MIT licence: http://opensource.org/licenses/mit-license\nNote: The Google Maps API v3 must be included *before* this code\n */\nvar hasProp = {}.hasOwnProperty,\n slice = [].slice;\n\nthis['OverlappingMarkerSpiderfier'] = (function() {\n var ge, gm, j, lcH, lcU, len, mt, p, ref, twoPi, x;\n\n p = _Class.prototype;\n\n ref = [_Class, p];\n for (j = 0, len = ref.length; j < len; j++) {\n x = ref[j];\n x['VERSION'] = '0.3.3';\n }\n\n gm = void 0;\n\n ge = void 0;\n\n mt = void 0;\n\n twoPi = Math.PI * 2;\n\n p['keepSpiderfied'] = false;\n\n p['markersWontHide'] = false;\n\n p['markersWontMove'] = false;\n\n p['nearbyDistance'] = 20;\n\n p['circleSpiralSwitchover'] = 9;\n\n p['circleFootSeparation'] = 23;\n\n p['circleStartAngle'] = twoPi / 12;\n\n p['spiralFootSeparation'] = 26;\n\n p['spiralLengthStart'] = 11;\n\n p['spiralLengthFactor'] = 4;\n\n p['spiderfiedZIndex'] = 1000;\n\n p['usualLegZIndex'] = 10;\n\n p['highlightedLegZIndex'] = 20;\n\n p['event'] = 'click';\n\n p['minZoomLevel'] = false;\n\n p['legWeight'] = 1.5;\n\n p['legColors'] = {\n 'usual': {},\n 'highlighted': {}\n };\n\n lcU = p['legColors']['usual'];\n\n lcH = p['legColors']['highlighted'];\n\n _Class['initializeGoogleMaps'] = function(google) {\n gm = google.maps;\n ge = gm.event;\n mt = gm.MapTypeId;\n lcU[mt.HYBRID] = lcU[mt.SATELLITE] = '#fff';\n lcH[mt.HYBRID] = lcH[mt.SATELLITE] = '#f00';\n lcU[mt.TERRAIN] = lcU[mt.ROADMAP] = '#444';\n lcH[mt.TERRAIN] = lcH[mt.ROADMAP] = '#f00';\n this.ProjHelper = function(map) {\n return this.setMap(map);\n };\n this.ProjHelper.prototype = new gm.OverlayView();\n return this.ProjHelper.prototype['draw'] = function() {};\n };\n\n function _Class(map1, opts) {\n var e, k, l, len1, ref1, v;\n this.map = map1;\n if (opts == null) {\n opts = {};\n }\n for (k in opts) {\n if (!hasProp.call(opts, k)) continue;\n v = opts[k];\n this[k] = v;\n }\n this.projHelper = new this.constructor.ProjHelper(this.map);\n this.initMarkerArrays();\n this.listeners = {};\n ref1 = ['click', 'zoom_changed', 'maptypeid_changed'];\n for (l = 0, len1 = ref1.length; l < len1; l++) {\n e = ref1[l];\n ge.addListener(this.map, e, (function(_this) {\n return function() {\n return _this['unspiderfy']();\n };\n })(this));\n }\n }\n\n p.initMarkerArrays = function() {\n this.markers = [];\n return this.markerListenerRefs = [];\n };\n\n p['addMarker'] = function(marker) {\n var listenerRefs;\n if (marker['_oms'] != null) {\n return this;\n }\n marker['_oms'] = true;\n listenerRefs = [\n ge.addListener(marker, this['event'], (function(_this) {\n return function(event) {\n return _this.spiderListener(marker, event);\n };\n })(this))\n ];\n if (!this['markersWontHide']) {\n listenerRefs.push(ge.addListener(marker, 'visible_changed', (function(_this) {\n return function() {\n return _this.markerChangeListener(marker, false);\n };\n })(this)));\n }\n if (!this['markersWontMove']) {\n listenerRefs.push(ge.addListener(marker, 'position_changed', (function(_this) {\n return function() {\n return _this.markerChangeListener(marker, true);\n };\n })(this)));\n }\n this.markerListenerRefs.push(listenerRefs);\n this.markers.push(marker);\n return this;\n };\n\n p.markerChangeListener = function(marker, positionChanged) {\n if ((marker['_omsData'] != null) && (positionChanged || !marker.getVisible()) && !((this.spiderfying != null) || (this.unspiderfying != null))) {\n return this['unspiderfy'](positionChanged ? marker : null);\n }\n };\n\n p['getMarkers'] = function() {\n return this.markers.slice(0);\n };\n\n p['removeMarker'] = function(marker) {\n var i, l, len1, listenerRef, listenerRefs;\n if (marker['_omsData'] != null) {\n this['unspiderfy']();\n }\n i = this.arrIndexOf(this.markers, marker);\n if (i < 0) {\n return this;\n }\n listenerRefs = this.markerListenerRefs.splice(i, 1)[0];\n for (l = 0, len1 = listenerRefs.length; l < len1; l++) {\n listenerRef = listenerRefs[l];\n ge.removeListener(listenerRef);\n }\n delete marker['_oms'];\n this.markers.splice(i, 1);\n return this;\n };\n\n p['clearMarkers'] = function() {\n var i, l, len1, len2, listenerRef, listenerRefs, marker, n, ref1;\n this['unspiderfy']();\n ref1 = this.markers;\n for (i = l = 0, len1 = ref1.length; l < len1; i = ++l) {\n marker = ref1[i];\n listenerRefs = this.markerListenerRefs[i];\n for (n = 0, len2 = listenerRefs.length; n < len2; n++) {\n listenerRef = listenerRefs[n];\n ge.removeListener(listenerRef);\n }\n delete marker['_oms'];\n }\n this.initMarkerArrays();\n return this;\n };\n\n p['addListener'] = function(event, func) {\n var base;\n ((base = this.listeners)[event] != null ? base[event] : base[event] = []).push(func);\n return this;\n };\n\n p['removeListener'] = function(event, func) {\n var i;\n i = this.arrIndexOf(this.listeners[event], func);\n if (!(i < 0)) {\n this.listeners[event].splice(i, 1);\n }\n return this;\n };\n\n p['clearListeners'] = function(event) {\n this.listeners[event] = [];\n return this;\n };\n\n p.trigger = function() {\n var args, event, func, l, len1, ref1, ref2, results;\n event = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];\n ref2 = (ref1 = this.listeners[event]) != null ? ref1 : [];\n results = [];\n for (l = 0, len1 = ref2.length; l < len1; l++) {\n func = ref2[l];\n results.push(func.apply(null, args));\n }\n return results;\n };\n\n p.generatePtsCircle = function(count, centerPt) {\n var angle, angleStep, circumference, i, l, legLength, ref1, results;\n circumference = this['circleFootSeparation'] * (2 + count);\n legLength = circumference / twoPi;\n angleStep = twoPi / count;\n results = [];\n for (i = l = 0, ref1 = count; 0 <= ref1 ? l < ref1 : l > ref1; i = 0 <= ref1 ? ++l : --l) {\n angle = this['circleStartAngle'] + i * angleStep;\n results.push(new gm.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle)));\n }\n return results;\n };\n\n p.generatePtsSpiral = function(count, centerPt) {\n var angle, i, l, legLength, pt, ref1, results;\n legLength = this['spiralLengthStart'];\n angle = 0;\n results = [];\n for (i = l = 0, ref1 = count; 0 <= ref1 ? l < ref1 : l > ref1; i = 0 <= ref1 ? ++l : --l) {\n angle += this['spiralFootSeparation'] / legLength + i * 0.0005;\n pt = new gm.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle));\n legLength += twoPi * this['spiralLengthFactor'] / angle;\n results.push(pt);\n }\n return results;\n };\n\n p.spiderListener = function(marker, event) {\n var $this, clear, l, len1, m, mPt, markerPt, markerSpiderfied, nDist, nearbyMarkerData, nonNearbyMarkers, pxSq, ref1;\n markerSpiderfied = marker['_omsData'] != null;\n if (!(markerSpiderfied && this['keepSpiderfied'])) {\n if (this['event'] === 'mouseover') {\n $this = this;\n clear = function() {\n return $this['unspiderfy']();\n };\n window.clearTimeout(p.timeout);\n p.timeout = setTimeout(clear, 3000);\n } else {\n this['unspiderfy']();\n }\n }\n if (markerSpiderfied || this.map.getStreetView().getVisible() || this.map.getMapTypeId() === 'GoogleEarthAPI') {\n return this.trigger('click', marker, event);\n } else {\n nearbyMarkerData = [];\n nonNearbyMarkers = [];\n nDist = this['nearbyDistance'];\n pxSq = nDist * nDist;\n markerPt = this.llToPt(marker.position);\n ref1 = this.markers;\n for (l = 0, len1 = ref1.length; l < len1; l++) {\n m = ref1[l];\n if (!((m.map != null) && m.getVisible())) {\n continue;\n }\n mPt = this.llToPt(m.position);\n if (this.ptDistanceSq(mPt, markerPt) < pxSq) {\n nearbyMarkerData.push({\n marker: m,\n markerPt: mPt\n });\n } else {\n nonNearbyMarkers.push(m);\n }\n }\n if (nearbyMarkerData.length === 1) {\n return this.trigger('click', marker, event);\n } else {\n return this.spiderfy(nearbyMarkerData, nonNearbyMarkers);\n }\n }\n };\n\n p['markersNearMarker'] = function(marker, firstOnly) {\n var l, len1, m, mPt, markerPt, markers, nDist, pxSq, ref1, ref2, ref3;\n if (firstOnly == null) {\n firstOnly = false;\n }\n if (this.projHelper.getProjection() == null) {\n throw \"Must wait for 'idle' event on map before calling markersNearMarker\";\n }\n nDist = this['nearbyDistance'];\n pxSq = nDist * nDist;\n markerPt = this.llToPt(marker.position);\n markers = [];\n ref1 = this.markers;\n for (l = 0, len1 = ref1.length; l < len1; l++) {\n m = ref1[l];\n if (m === marker || (m.map == null) || !m.getVisible()) {\n continue;\n }\n mPt = this.llToPt((ref2 = (ref3 = m['_omsData']) != null ? ref3.usualPosition : void 0) != null ? ref2 : m.position);\n if (this.ptDistanceSq(mPt, markerPt) < pxSq) {\n markers.push(m);\n if (firstOnly) {\n break;\n }\n }\n }\n return markers;\n };\n\n p['markersNearAnyOtherMarker'] = function() {\n var i, i1, i2, l, len1, len2, len3, m, m1, m1Data, m2, m2Data, mData, n, nDist, pxSq, q, ref1, ref2, ref3, results;\n if (this.projHelper.getProjection() == null) {\n throw \"Must wait for 'idle' event on map before calling markersNearAnyOtherMarker\";\n }\n nDist = this['nearbyDistance'];\n pxSq = nDist * nDist;\n mData = (function() {\n var l, len1, ref1, ref2, ref3, results;\n ref1 = this.markers;\n results = [];\n for (l = 0, len1 = ref1.length; l < len1; l++) {\n m = ref1[l];\n results.push({\n pt: this.llToPt((ref2 = (ref3 = m['_omsData']) != null ? ref3.usualPosition : void 0) != null ? ref2 : m.position),\n willSpiderfy: false\n });\n }\n return results;\n }).call(this);\n ref1 = this.markers;\n for (i1 = l = 0, len1 = ref1.length; l < len1; i1 = ++l) {\n m1 = ref1[i1];\n if (!((m1.map != null) && m1.getVisible())) {\n continue;\n }\n m1Data = mData[i1];\n if (m1Data.willSpiderfy) {\n continue;\n }\n ref2 = this.markers;\n for (i2 = n = 0, len2 = ref2.length; n < len2; i2 = ++n) {\n m2 = ref2[i2];\n if (i2 === i1) {\n continue;\n }\n if (!((m2.map != null) && m2.getVisible())) {\n continue;\n }\n m2Data = mData[i2];\n if (i2 < i1 && !m2Data.willSpiderfy) {\n continue;\n }\n if (this.ptDistanceSq(m1Data.pt, m2Data.pt) < pxSq) {\n m1Data.willSpiderfy = m2Data.willSpiderfy = true;\n break;\n }\n }\n }\n ref3 = this.markers;\n results = [];\n for (i = q = 0, len3 = ref3.length; q < len3; i = ++q) {\n m = ref3[i];\n if (mData[i].willSpiderfy) {\n results.push(m);\n }\n }\n return results;\n };\n\n p.makeHighlightListenerFuncs = function(marker) {\n return {\n highlight: (function(_this) {\n return function() {\n return marker['_omsData'].leg.setOptions({\n strokeColor: _this['legColors']['highlighted'][_this.map.mapTypeId],\n zIndex: _this['highlightedLegZIndex']\n });\n };\n })(this),\n unhighlight: (function(_this) {\n return function() {\n return marker['_omsData'].leg.setOptions({\n strokeColor: _this['legColors']['usual'][_this.map.mapTypeId],\n zIndex: _this['usualLegZIndex']\n });\n };\n })(this)\n };\n };\n\n p.spiderfy = function(markerData, nonNearbyMarkers) {\n var bodyPt, footLl, footPt, footPts, highlightListenerFuncs, leg, marker, md, nearestMarkerDatum, numFeet, spiderfiedMarkers;\n if (this['minZoomLevel'] && this.map.getZoom() < this['minZoomLevel']) {\n return false;\n }\n this.spiderfying = true;\n numFeet = markerData.length;\n bodyPt = this.ptAverage((function() {\n var l, len1, results;\n results = [];\n for (l = 0, len1 = markerData.length; l < len1; l++) {\n md = markerData[l];\n results.push(md.markerPt);\n }\n return results;\n })());\n footPts = numFeet >= this['circleSpiralSwitchover'] ? this.generatePtsSpiral(numFeet, bodyPt).reverse() : this.generatePtsCircle(numFeet, bodyPt);\n spiderfiedMarkers = (function() {\n var l, len1, results;\n results = [];\n for (l = 0, len1 = footPts.length; l < len1; l++) {\n footPt = footPts[l];\n footLl = this.ptToLl(footPt);\n nearestMarkerDatum = this.minExtract(markerData, (function(_this) {\n return function(md) {\n return _this.ptDistanceSq(md.markerPt, footPt);\n };\n })(this));\n marker = nearestMarkerDatum.marker;\n leg = new gm.Polyline({\n map: this.map,\n path: [marker.position, footLl],\n strokeColor: this['legColors']['usual'][this.map.mapTypeId],\n strokeWeight: this['legWeight'],\n zIndex: this['usualLegZIndex']\n });\n marker['_omsData'] = {\n usualPosition: marker.position,\n leg: leg\n };\n if (this['legColors']['highlighted'][this.map.mapTypeId] !== this['legColors']['usual'][this.map.mapTypeId]) {\n highlightListenerFuncs = this.makeHighlightListenerFuncs(marker);\n marker['_omsData'].hightlightListeners = {\n highlight: ge.addListener(marker, 'mouseover', highlightListenerFuncs.highlight),\n unhighlight: ge.addListener(marker, 'mouseout', highlightListenerFuncs.unhighlight)\n };\n }\n marker.setPosition(footLl);\n marker.setZIndex(Math.round(this['spiderfiedZIndex'] + footPt.y));\n results.push(marker);\n }\n return results;\n }).call(this);\n delete this.spiderfying;\n this.spiderfied = true;\n return this.trigger('spiderfy', spiderfiedMarkers, nonNearbyMarkers);\n };\n\n p['unspiderfy'] = function(markerNotToMove) {\n var l, len1, listeners, marker, nonNearbyMarkers, ref1, unspiderfiedMarkers;\n if (markerNotToMove == null) {\n markerNotToMove = null;\n }\n if (this.spiderfied == null) {\n return this;\n }\n this.unspiderfying = true;\n unspiderfiedMarkers = [];\n nonNearbyMarkers = [];\n ref1 = this.markers;\n for (l = 0, len1 = ref1.length; l < len1; l++) {\n marker = ref1[l];\n if (marker['_omsData'] != null) {\n marker['_omsData'].leg.setMap(null);\n if (marker !== markerNotToMove) {\n marker.setPosition(marker['_omsData'].usualPosition);\n }\n marker.setZIndex(null);\n listeners = marker['_omsData'].hightlightListeners;\n if (listeners != null) {\n ge.removeListener(listeners.highlight);\n ge.removeListener(listeners.unhighlight);\n }\n delete marker['_omsData'];\n unspiderfiedMarkers.push(marker);\n } else {\n nonNearbyMarkers.push(marker);\n }\n }\n delete this.unspiderfying;\n delete this.spiderfied;\n this.trigger('unspiderfy', unspiderfiedMarkers, nonNearbyMarkers);\n return this;\n };\n\n p.ptDistanceSq = function(pt1, pt2) {\n var dx, dy;\n dx = pt1.x - pt2.x;\n dy = pt1.y - pt2.y;\n return dx * dx + dy * dy;\n };\n\n p.ptAverage = function(pts) {\n var l, len1, numPts, pt, sumX, sumY;\n sumX = sumY = 0;\n for (l = 0, len1 = pts.length; l < len1; l++) {\n pt = pts[l];\n sumX += pt.x;\n sumY += pt.y;\n }\n numPts = pts.length;\n return new gm.Point(sumX / numPts, sumY / numPts);\n };\n\n p.llToPt = function(ll) {\n return this.projHelper.getProjection().fromLatLngToDivPixel(ll);\n };\n\n p.ptToLl = function(pt) {\n return this.projHelper.getProjection().fromDivPixelToLatLng(pt);\n };\n\n p.minExtract = function(set, func) {\n var bestIndex, bestVal, index, item, l, len1, val;\n for (index = l = 0, len1 = set.length; l < len1; index = ++l) {\n item = set[index];\n val = func(item);\n if ((typeof bestIndex === \"undefined\" || bestIndex === null) || val < bestVal) {\n bestVal = val;\n bestIndex = index;\n }\n }\n return set.splice(bestIndex, 1)[0];\n };\n\n p.arrIndexOf = function(arr, obj) {\n var i, l, len1, o;\n if (arr.indexOf != null) {\n return arr.indexOf(obj);\n }\n for (i = l = 0, len1 = arr.length; l < len1; i = ++l) {\n o = arr[i];\n if (o === obj) {\n return i;\n }\n }\n return -1;\n };\n\n return _Class;\n\n})();\n\n }.apply(self);\n\n GoogleMapApi.then(function(){\n self.OverlappingMarkerSpiderfier.initializeGoogleMaps(window.google);\n });\n return this.OverlappingMarkerSpiderfier;\n}]);\n;/**\n * Performance overrides on MarkerClusterer custom to Angular Google Maps\n *\n * Created by Petr Bruna ccg1415 and Nick McCready on 7/13/14.\n */\nangular.module('uiGmapgoogle-maps.extensions')\n.service('uiGmapExtendMarkerClusterer',['uiGmapLodash', 'uiGmapPropMap', function (uiGmapLodash, PropMap) {\n return {\n init: _.once(function () {\n (function () {\n var __hasProp = {}.hasOwnProperty,\n __extends = function (child, parent) {\n for (var key in parent) {\n if (__hasProp.call(parent, key)) child[key] = parent[key];\n }\n function ctor() {\n this.constructor = child;\n }\n\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n child.__super__ = parent.prototype;\n return child;\n };\n\n window.NgMapCluster = (function (_super) {\n __extends(NgMapCluster, _super);\n\n function NgMapCluster(opts) {\n NgMapCluster.__super__.constructor.call(this, opts);\n this.markers_ = new PropMap();\n }\n\n /**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\n NgMapCluster.prototype.addMarker = function (marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n var oldMarker = this.markers_.get(marker.key);\n if (oldMarker.getPosition().lat() == marker.getPosition().lat() && oldMarker.getPosition().lon() == marker.getPosition().lon()) //if nothing has changed\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n this.markers_.each(function (m) {\n m.setMap(null);\n });\n } else {\n marker.setMap(null);\n }\n\n //this.updateIcon_();\n return true;\n };\n\n /**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\n NgMapCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n return uiGmapLodash.isNullOrUndefined(this.markers_.get(marker.key));\n };\n\n\n /**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\n NgMapCluster.prototype.getBounds = function () {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.getMarkers().each(function(m){\n bounds.extend(m.getPosition());\n });\n return bounds;\n };\n\n\n /**\n * Removes the cluster from the map.\n *\n * @ignore\n */\n NgMapCluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = new PropMap();\n delete this.markers_;\n };\n\n\n return NgMapCluster;\n\n })(Cluster);\n\n\n window.NgMapMarkerClusterer = (function (_super) {\n __extends(NgMapMarkerClusterer, _super);\n\n function NgMapMarkerClusterer(map, opt_markers, opt_options) {\n NgMapMarkerClusterer.__super__.constructor.call(this, map, opt_markers, opt_options);\n this.markers_ = new PropMap();\n }\n\n /**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\n NgMapMarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = new PropMap();\n };\n /**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n */\n NgMapMarkerClusterer.prototype.removeMarker_ = function (marker) {\n if (!this.markers_.get(marker.key)) {\n return false;\n }\n marker.setMap(null);\n this.markers_.remove(marker.key); // Remove the marker from the list of managed markers\n return true;\n };\n\n /**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\n NgMapMarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>MarkerClusterer</code> begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringbegin', this);\n\n if (typeof this.timerRefStatic !== 'undefined') {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n var _ms = this.markers_.values();\n for (i = iFirst; i < iLast; i++) {\n marker = _ms[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function () {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n // custom addition by ui-gmap\n // update icon for all clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].updateIcon_();\n }\n\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the <code>MarkerClusterer</code> stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringend', this);\n }\n };\n\n /**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\n NgMapMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new NgMapCluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n };\n\n /**\n * Redraws all the clusters.\n */\n NgMapMarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n };\n\n\n /**\n * Removes all clusters from the map. The markers are also removed from the map\n * if <code>opt_hide</code> is set to <code>true</code>.\n *\n * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers\n * from the map.\n */\n NgMapMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n this.markers_.each(function (marker) {\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n });\n };\n\n /**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\n NgMapMarkerClusterer.prototype.extend = function (obj1, obj2) {\n return (function (object) {\n var property;\n for (property in object.prototype) {\n if (property !== 'constructor')\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n };\n ////////////////////////////////////////////////////////////////////////////////\n /*\n Other overrides relevant to MarkerClusterPlus\n */\n ////////////////////////////////////////////////////////////////////////////////\n /**\n * Positions and shows the icon.\n */\n ClusterIcon.prototype.show = function () {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].trim(), 10);\n var spriteV = parseInt(bp[1].trim(), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"<img src='\" + this.url_ + \"' style='position: absolute; top: \" + spriteV + \"px; left: \" + spriteH + \"px; \";\n if (!this.cluster_.getMarkerClusterer().enableRetinaIcons_) {\n img += \"clip: rect(\" + (-1 * spriteV) + \"px, \" + ((-1 * spriteH) + this.width_) + \"px, \" +\n ((-1 * spriteV) + this.height_) + \"px, \" + (-1 * spriteH) + \"px);\";\n }\n // ADDED FOR RETINA SUPPORT\n else {\n img += \"width: \" + this.width_ + \"px;\" + \"height: \" + this.height_ + \"px;\";\n }\n // END ADD\n img += \"'>\";\n this.div_.innerHTML = img + \"<div style='\" +\n \"position: absolute;\" +\n \"top: \" + this.anchorText_[0] + \"px;\" +\n \"left: \" + this.anchorText_[1] + \"px;\" +\n \"color: \" + this.textColor_ + \";\" +\n \"font-size: \" + this.textSize_ + \"px;\" +\n \"font-family: \" + this.fontFamily_ + \";\" +\n \"font-weight: \" + this.fontWeight_ + \";\" +\n \"font-style: \" + this.fontStyle_ + \";\" +\n \"text-decoration: \" + this.textDecoration_ + \";\" +\n \"text-align: center;\" +\n \"width: \" + this.width_ + \"px;\" +\n \"line-height:\" + this.height_ + \"px;\" +\n \"'>\" + this.sums_.text + \"</div>\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n };\n //END OTHER OVERRIDES\n ////////////////////////////////////////////////////////////////////////////////\n\n return NgMapMarkerClusterer;\n\n })(MarkerClusterer);\n }).call(this);\n })\n };\n}]);\n}( window,angular));\n/*\n _ _ _ _\n ___| (_) ___| | __ (_)___\n/ __| | |/ __| |/ / | / __|\n\\__ \\ | | (__| < _ | \\__ \\\n|___/_|_|\\___|_|\\_(_)/ |___/\n |__/\n\n Version: 1.6.0\n Author: Ken Wheeler\n Website: http://kenwheeler.github.io\n Docs: http://kenwheeler.github.io/slick\n Repo: http://github.com/kenwheeler/slick\n Issues: http://github.com/kenwheeler/slick/issues\n\n */\n/* global window, document, define, jQuery, setInterval, clearInterval */\n(function(factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], factory);\n } else if (typeof exports !== 'undefined') {\n module.exports = factory(require('jquery'));\n } else {\n factory(jQuery);\n }\n\n}(function($) {\n 'use strict';\n var Slick = window.Slick || {};\n\n Slick = (function() {\n\n var instanceUid = 0;\n\n function Slick(element, settings) {\n\n var _ = this, dataSettings;\n\n _.defaults = {\n accessibility: true,\n adaptiveHeight: false,\n appendArrows: $(element),\n appendDots: $(element),\n arrows: true,\n asNavFor: null,\n prevArrow: '<button type=\"button\" data-role=\"none\" class=\"slick-prev\" aria-label=\"Previous\" tabindex=\"0\" role=\"button\">Previous</button>',\n nextArrow: '<button type=\"button\" data-role=\"none\" class=\"slick-next\" aria-label=\"Next\" tabindex=\"0\" role=\"button\">Next</button>',\n autoplay: false,\n autoplaySpeed: 3000,\n centerMode: false,\n centerPadding: '50px',\n cssEase: 'ease',\n customPaging: function(slider, i) {\n return $('<button type=\"button\" data-role=\"none\" role=\"button\" tabindex=\"0\" />').text(i + 1);\n },\n dots: false,\n dotsClass: 'slick-dots',\n draggable: true,\n easing: 'linear',\n edgeFriction: 0.35,\n fade: false,\n focusOnSelect: false,\n infinite: true,\n initialSlide: 0,\n lazyLoad: 'ondemand',\n mobileFirst: false,\n pauseOnHover: true,\n pauseOnFocus: true,\n pauseOnDotsHover: false,\n respondTo: 'window',\n responsive: null,\n rows: 1,\n rtl: false,\n slide: '',\n slidesPerRow: 1,\n slidesToShow: 1,\n slidesToScroll: 1,\n speed: 500,\n swipe: true,\n swipeToSlide: false,\n touchMove: true,\n touchThreshold: 5,\n useCSS: true,\n useTransform: true,\n variableWidth: false,\n vertical: false,\n verticalSwiping: false,\n waitForAnimate: true,\n zIndex: 1000\n };\n\n _.initials = {\n animating: false,\n dragging: false,\n autoPlayTimer: null,\n currentDirection: 0,\n currentLeft: null,\n currentSlide: 0,\n direction: 1,\n $dots: null,\n listWidth: null,\n listHeight: null,\n loadIndex: 0,\n $nextArrow: null,\n $prevArrow: null,\n slideCount: null,\n slideWidth: null,\n $slideTrack: null,\n $slides: null,\n sliding: false,\n slideOffset: 0,\n swipeLeft: null,\n $list: null,\n touchObject: {},\n transformsEnabled: false,\n unslicked: false\n };\n\n $.extend(_, _.initials);\n\n _.activeBreakpoint = null;\n _.animType = null;\n _.animProp = null;\n _.breakpoints = [];\n _.breakpointSettings = [];\n _.cssTransitions = false;\n _.focussed = false;\n _.interrupted = false;\n _.hidden = 'hidden';\n _.paused = true;\n _.positionProp = null;\n _.respondTo = null;\n _.rowCount = 1;\n _.shouldClick = true;\n _.$slider = $(element);\n _.$slidesCache = null;\n _.transformType = null;\n _.transitionType = null;\n _.visibilityChange = 'visibilitychange';\n _.windowWidth = 0;\n _.windowTimer = null;\n\n dataSettings = $(element).data('slick') || {};\n\n _.options = $.extend({}, _.defaults, settings, dataSettings);\n\n _.currentSlide = _.options.initialSlide;\n\n _.originalSettings = _.options;\n\n if (typeof document.mozHidden !== 'undefined') {\n _.hidden = 'mozHidden';\n _.visibilityChange = 'mozvisibilitychange';\n } else if (typeof document.webkitHidden !== 'undefined') {\n _.hidden = 'webkitHidden';\n _.visibilityChange = 'webkitvisibilitychange';\n }\n\n _.autoPlay = $.proxy(_.autoPlay, _);\n _.autoPlayClear = $.proxy(_.autoPlayClear, _);\n _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);\n _.changeSlide = $.proxy(_.changeSlide, _);\n _.clickHandler = $.proxy(_.clickHandler, _);\n _.selectHandler = $.proxy(_.selectHandler, _);\n _.setPosition = $.proxy(_.setPosition, _);\n _.swipeHandler = $.proxy(_.swipeHandler, _);\n _.dragHandler = $.proxy(_.dragHandler, _);\n _.keyHandler = $.proxy(_.keyHandler, _);\n\n _.instanceUid = instanceUid++;\n\n // A simple way to check for HTML strings\n // Strict HTML recognition (must start with <)\n // Extracted from jQuery v1.11 source\n _.htmlExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*)$/;\n\n\n _.registerBreakpoints();\n _.init(true);\n\n }\n\n return Slick;\n\n }());\n\n Slick.prototype.activateADA = function() {\n var _ = this;\n\n _.$slideTrack.find('.slick-active').attr({\n 'aria-hidden': 'false'\n }).find('a, input, button, select').attr({\n 'tabindex': '0'\n });\n\n };\n\n Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {\n\n var _ = this;\n\n if (typeof(index) === 'boolean') {\n addBefore = index;\n index = null;\n } else if (index < 0 || (index >= _.slideCount)) {\n return false;\n }\n\n _.unload();\n\n if (typeof(index) === 'number') {\n if (index === 0 && _.$slides.length === 0) {\n $(markup).appendTo(_.$slideTrack);\n } else if (addBefore) {\n $(markup).insertBefore(_.$slides.eq(index));\n } else {\n $(markup).insertAfter(_.$slides.eq(index));\n }\n } else {\n if (addBefore === true) {\n $(markup).prependTo(_.$slideTrack);\n } else {\n $(markup).appendTo(_.$slideTrack);\n }\n }\n\n _.$slides = _.$slideTrack.children(this.options.slide);\n\n _.$slideTrack.children(this.options.slide).detach();\n\n _.$slideTrack.append(_.$slides);\n\n _.$slides.each(function(index, element) {\n $(element).attr('data-slick-index', index);\n });\n\n _.$slidesCache = _.$slides;\n\n _.reinit();\n\n };\n\n Slick.prototype.animateHeight = function() {\n var _ = this;\n if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {\n var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);\n _.$list.animate({\n height: targetHeight\n }, _.options.speed);\n }\n };\n\n Slick.prototype.animateSlide = function(targetLeft, callback) {\n\n var animProps = {},\n _ = this;\n\n _.animateHeight();\n\n if (_.options.rtl === true && _.options.vertical === false) {\n targetLeft = -targetLeft;\n }\n if (_.transformsEnabled === false) {\n if (_.options.vertical === false) {\n _.$slideTrack.animate({\n left: targetLeft\n }, _.options.speed, _.options.easing, callback);\n } else {\n _.$slideTrack.animate({\n top: targetLeft\n }, _.options.speed, _.options.easing, callback);\n }\n\n } else {\n\n if (_.cssTransitions === false) {\n if (_.options.rtl === true) {\n _.currentLeft = -(_.currentLeft);\n }\n $({\n animStart: _.currentLeft\n }).animate({\n animStart: targetLeft\n }, {\n duration: _.options.speed,\n easing: _.options.easing,\n step: function(now) {\n now = Math.ceil(now);\n if (_.options.vertical === false) {\n animProps[_.animType] = 'translate(' +\n now + 'px, 0px)';\n _.$slideTrack.css(animProps);\n } else {\n animProps[_.animType] = 'translate(0px,' +\n now + 'px)';\n _.$slideTrack.css(animProps);\n }\n },\n complete: function() {\n if (callback) {\n callback.call();\n }\n }\n });\n\n } else {\n\n _.applyTransition();\n targetLeft = Math.ceil(targetLeft);\n\n if (_.options.vertical === false) {\n animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';\n } else {\n animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';\n }\n _.$slideTrack.css(animProps);\n\n if (callback) {\n setTimeout(function() {\n\n _.disableTransition();\n\n callback.call();\n }, _.options.speed);\n }\n\n }\n\n }\n\n };\n\n Slick.prototype.getNavTarget = function() {\n\n var _ = this,\n asNavFor = _.options.asNavFor;\n\n if ( asNavFor && asNavFor !== null ) {\n asNavFor = $(asNavFor).not(_.$slider);\n }\n\n return asNavFor;\n\n };\n\n Slick.prototype.asNavFor = function(index) {\n\n var _ = this,\n asNavFor = _.getNavTarget();\n\n if ( asNavFor !== null && typeof asNavFor === 'object' ) {\n asNavFor.each(function() {\n var target = $(this).slick('getSlick');\n if(!target.unslicked) {\n target.slideHandler(index, true);\n }\n });\n }\n\n };\n\n Slick.prototype.applyTransition = function(slide) {\n\n var _ = this,\n transition = {};\n\n if (_.options.fade === false) {\n transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;\n } else {\n transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;\n }\n\n if (_.options.fade === false) {\n _.$slideTrack.css(transition);\n } else {\n _.$slides.eq(slide).css(transition);\n }\n\n };\n\n Slick.prototype.autoPlay = function() {\n\n var _ = this;\n\n _.autoPlayClear();\n\n if ( _.slideCount > _.options.slidesToShow ) {\n _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );\n }\n\n };\n\n Slick.prototype.autoPlayClear = function() {\n\n var _ = this;\n\n if (_.autoPlayTimer) {\n clearInterval(_.autoPlayTimer);\n }\n\n };\n\n Slick.prototype.autoPlayIterator = function() {\n\n var _ = this,\n slideTo = _.currentSlide + _.options.slidesToScroll;\n\n if ( !_.paused && !_.interrupted && !_.focussed ) {\n\n if ( _.options.infinite === false ) {\n\n if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {\n _.direction = 0;\n }\n\n else if ( _.direction === 0 ) {\n\n slideTo = _.currentSlide - _.options.slidesToScroll;\n\n if ( _.currentSlide - 1 === 0 ) {\n _.direction = 1;\n }\n\n }\n\n }\n\n _.slideHandler( slideTo );\n\n }\n\n };\n\n Slick.prototype.buildArrows = function() {\n\n var _ = this;\n\n if (_.options.arrows === true ) {\n\n _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');\n _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');\n\n if( _.slideCount > _.options.slidesToShow ) {\n\n _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');\n _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');\n\n if (_.htmlExpr.test(_.options.prevArrow)) {\n _.$prevArrow.prependTo(_.options.appendArrows);\n }\n\n if (_.htmlExpr.test(_.options.nextArrow)) {\n _.$nextArrow.appendTo(_.options.appendArrows);\n }\n\n if (_.options.infinite !== true) {\n _.$prevArrow\n .addClass('slick-disabled')\n .attr('aria-disabled', 'true');\n }\n\n } else {\n\n _.$prevArrow.add( _.$nextArrow )\n\n .addClass('slick-hidden')\n .attr({\n 'aria-disabled': 'true',\n 'tabindex': '-1'\n });\n\n }\n\n }\n\n };\n\n Slick.prototype.buildDots = function() {\n\n var _ = this,\n i, dot;\n\n if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {\n\n _.$slider.addClass('slick-dotted');\n\n dot = $('<ul />').addClass(_.options.dotsClass);\n\n for (i = 0; i <= _.getDotCount(); i += 1) {\n dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));\n }\n\n _.$dots = dot.appendTo(_.options.appendDots);\n\n _.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');\n\n }\n\n };\n\n Slick.prototype.buildOut = function() {\n\n var _ = this;\n\n _.$slides =\n _.$slider\n .children( _.options.slide + ':not(.slick-cloned)')\n .addClass('slick-slide');\n\n _.slideCount = _.$slides.length;\n\n _.$slides.each(function(index, element) {\n $(element)\n .attr('data-slick-index', index)\n .data('originalStyling', $(element).attr('style') || '');\n });\n\n _.$slider.addClass('slick-slider');\n\n _.$slideTrack = (_.slideCount === 0) ?\n $('<div class=\"slick-track\"/>').appendTo(_.$slider) :\n _.$slides.wrapAll('<div class=\"slick-track\"/>').parent();\n\n _.$list = _.$slideTrack.wrap(\n '<div aria-live=\"polite\" class=\"slick-list\"/>').parent();\n _.$slideTrack.css('opacity', 0);\n\n if (_.options.centerMode === true || _.options.swipeToSlide === true) {\n _.options.slidesToScroll = 1;\n }\n\n $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');\n\n _.setupInfinite();\n\n _.buildArrows();\n\n _.buildDots();\n\n _.updateDots();\n\n\n _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);\n\n if (_.options.draggable === true) {\n _.$list.addClass('draggable');\n }\n\n };\n\n Slick.prototype.buildRows = function() {\n\n var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;\n\n newSlides = document.createDocumentFragment();\n originalSlides = _.$slider.children();\n\n if(_.options.rows > 1) {\n\n slidesPerSection = _.options.slidesPerRow * _.options.rows;\n numOfSlides = Math.ceil(\n originalSlides.length / slidesPerSection\n );\n\n for(a = 0; a < numOfSlides; a++){\n var slide = document.createElement('div');\n for(b = 0; b < _.options.rows; b++) {\n var row = document.createElement('div');\n for(c = 0; c < _.options.slidesPerRow; c++) {\n var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));\n if (originalSlides.get(target)) {\n row.appendChild(originalSlides.get(target));\n }\n }\n slide.appendChild(row);\n }\n newSlides.appendChild(slide);\n }\n\n _.$slider.empty().append(newSlides);\n _.$slider.children().children().children()\n .css({\n 'width':(100 / _.options.slidesPerRow) + '%',\n 'display': 'inline-block'\n });\n\n }\n\n };\n\n Slick.prototype.checkResponsive = function(initial, forceUpdate) {\n\n var _ = this,\n breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;\n var sliderWidth = _.$slider.width();\n var windowWidth = window.innerWidth || $(window).width();\n\n if (_.respondTo === 'window') {\n respondToWidth = windowWidth;\n } else if (_.respondTo === 'slider') {\n respondToWidth = sliderWidth;\n } else if (_.respondTo === 'min') {\n respondToWidth = Math.min(windowWidth, sliderWidth);\n }\n\n if ( _.options.responsive &&\n _.options.responsive.length &&\n _.options.responsive !== null) {\n\n targetBreakpoint = null;\n\n for (breakpoint in _.breakpoints) {\n if (_.breakpoints.hasOwnProperty(breakpoint)) {\n if (_.originalSettings.mobileFirst === false) {\n if (respondToWidth < _.breakpoints[breakpoint]) {\n targetBreakpoint = _.breakpoints[breakpoint];\n }\n } else {\n if (respondToWidth > _.breakpoints[breakpoint]) {\n targetBreakpoint = _.breakpoints[breakpoint];\n }\n }\n }\n }\n\n if (targetBreakpoint !== null) {\n if (_.activeBreakpoint !== null) {\n if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {\n _.activeBreakpoint =\n targetBreakpoint;\n if (_.breakpointSettings[targetBreakpoint] === 'unslick') {\n _.unslick(targetBreakpoint);\n } else {\n _.options = $.extend({}, _.originalSettings,\n _.breakpointSettings[\n targetBreakpoint]);\n if (initial === true) {\n _.currentSlide = _.options.initialSlide;\n }\n _.refresh(initial);\n }\n triggerBreakpoint = targetBreakpoint;\n }\n } else {\n _.activeBreakpoint = targetBreakpoint;\n if (_.breakpointSettings[targetBreakpoint] === 'unslick') {\n _.unslick(targetBreakpoint);\n } else {\n _.options = $.extend({}, _.originalSettings,\n _.breakpointSettings[\n targetBreakpoint]);\n if (initial === true) {\n _.currentSlide = _.options.initialSlide;\n }\n _.refresh(initial);\n }\n triggerBreakpoint = targetBreakpoint;\n }\n } else {\n if (_.activeBreakpoint !== null) {\n _.activeBreakpoint = null;\n _.options = _.originalSettings;\n if (initial === true) {\n _.currentSlide = _.options.initialSlide;\n }\n _.refresh(initial);\n triggerBreakpoint = targetBreakpoint;\n }\n }\n\n // only trigger breakpoints during an actual break. not on initialize.\n if( !initial && triggerBreakpoint !== false ) {\n _.$slider.trigger('breakpoint', [_, triggerBreakpoint]);\n }\n }\n\n };\n\n Slick.prototype.changeSlide = function(event, dontAnimate) {\n\n var _ = this,\n $target = $(event.currentTarget),\n indexOffset, slideOffset, unevenOffset;\n\n // If target is a link, prevent default action.\n if($target.is('a')) {\n event.preventDefault();\n }\n\n // If target is not the <li> element (ie: a child), find the <li>.\n if(!$target.is('li')) {\n $target = $target.closest('li');\n }\n\n unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);\n indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;\n\n switch (event.data.message) {\n\n case 'previous':\n slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;\n if (_.slideCount > _.options.slidesToShow) {\n _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);\n }\n break;\n\n case 'next':\n slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;\n if (_.slideCount > _.options.slidesToShow) {\n _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);\n }\n break;\n\n case 'index':\n var index = event.data.index === 0 ? 0 :\n event.data.index || $target.index() * _.options.slidesToScroll;\n\n _.slideHandler(_.checkNavigable(index), false, dontAnimate);\n $target.children().trigger('focus');\n break;\n\n default:\n return;\n }\n\n };\n\n Slick.prototype.checkNavigable = function(index) {\n\n var _ = this,\n navigables, prevNavigable;\n\n navigables = _.getNavigableIndexes();\n prevNavigable = 0;\n if (index > navigables[navigables.length - 1]) {\n index = navigables[navigables.length - 1];\n } else {\n for (var n in navigables) {\n if (index < navigables[n]) {\n index = prevNavigable;\n break;\n }\n prevNavigable = navigables[n];\n }\n }\n\n return index;\n };\n\n Slick.prototype.cleanUpEvents = function() {\n\n var _ = this;\n\n if (_.options.dots && _.$dots !== null) {\n\n $('li', _.$dots)\n .off('click.slick', _.changeSlide)\n .off('mouseenter.slick', $.proxy(_.interrupt, _, true))\n .off('mouseleave.slick', $.proxy(_.interrupt, _, false));\n\n }\n\n _.$slider.off('focus.slick blur.slick');\n\n if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {\n _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);\n _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);\n }\n\n _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);\n _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);\n _.$list.off('touchend.slick mouseup.slick', _.swipeHandler);\n _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);\n\n _.$list.off('click.slick', _.clickHandler);\n\n $(document).off(_.visibilityChange, _.visibility);\n\n _.cleanUpSlideEvents();\n\n if (_.options.accessibility === true) {\n _.$list.off('keydown.slick', _.keyHandler);\n }\n\n if (_.options.focusOnSelect === true) {\n $(_.$slideTrack).children().off('click.slick', _.selectHandler);\n }\n\n $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);\n\n $(window).off('resize.slick.slick-' + _.instanceUid, _.resize);\n\n $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);\n\n $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);\n $(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);\n\n };\n\n Slick.prototype.cleanUpSlideEvents = function() {\n\n var _ = this;\n\n _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));\n _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));\n\n };\n\n Slick.prototype.cleanUpRows = function() {\n\n var _ = this, originalSlides;\n\n if(_.options.rows > 1) {\n originalSlides = _.$slides.children().children();\n originalSlides.removeAttr('style');\n _.$slider.empty().append(originalSlides);\n }\n\n };\n\n Slick.prototype.clickHandler = function(event) {\n\n var _ = this;\n\n if (_.shouldClick === false) {\n event.stopImmediatePropagation();\n event.stopPropagation();\n event.preventDefault();\n }\n\n };\n\n Slick.prototype.destroy = function(refresh) {\n\n var _ = this;\n\n _.autoPlayClear();\n\n _.touchObject = {};\n\n _.cleanUpEvents();\n\n $('.slick-cloned', _.$slider).detach();\n\n if (_.$dots) {\n _.$dots.remove();\n }\n\n\n if ( _.$prevArrow && _.$prevArrow.length ) {\n\n _.$prevArrow\n .removeClass('slick-disabled slick-arrow slick-hidden')\n .removeAttr('aria-hidden aria-disabled tabindex')\n .css('display','');\n\n if ( _.htmlExpr.test( _.options.prevArrow )) {\n _.$prevArrow.remove();\n }\n }\n\n if ( _.$nextArrow && _.$nextArrow.length ) {\n\n _.$nextArrow\n .removeClass('slick-disabled slick-arrow slick-hidden')\n .removeAttr('aria-hidden aria-disabled tabindex')\n .css('display','');\n\n if ( _.htmlExpr.test( _.options.nextArrow )) {\n _.$nextArrow.remove();\n }\n\n }\n\n\n if (_.$slides) {\n\n _.$slides\n .removeClass('slick-slide slick-active slick-center slick-visible slick-current')\n .removeAttr('aria-hidden')\n .removeAttr('data-slick-index')\n .each(function(){\n $(this).attr('style', $(this).data('originalStyling'));\n });\n\n _.$slideTrack.children(this.options.slide).detach();\n\n _.$slideTrack.detach();\n\n _.$list.detach();\n\n _.$slider.append(_.$slides);\n }\n\n _.cleanUpRows();\n\n _.$slider.removeClass('slick-slider');\n _.$slider.removeClass('slick-initialized');\n _.$slider.removeClass('slick-dotted');\n\n _.unslicked = true;\n\n if(!refresh) {\n _.$slider.trigger('destroy', [_]);\n }\n\n };\n\n Slick.prototype.disableTransition = function(slide) {\n\n var _ = this,\n transition = {};\n\n transition[_.transitionType] = '';\n\n if (_.options.fade === false) {\n _.$slideTrack.css(transition);\n } else {\n _.$slides.eq(slide).css(transition);\n }\n\n };\n\n Slick.prototype.fadeSlide = function(slideIndex, callback) {\n\n var _ = this;\n\n if (_.cssTransitions === false) {\n\n _.$slides.eq(slideIndex).css({\n zIndex: _.options.zIndex\n });\n\n _.$slides.eq(slideIndex).animate({\n opacity: 1\n }, _.options.speed, _.options.easing, callback);\n\n } else {\n\n _.applyTransition(slideIndex);\n\n _.$slides.eq(slideIndex).css({\n opacity: 1,\n zIndex: _.options.zIndex\n });\n\n if (callback) {\n setTimeout(function() {\n\n _.disableTransition(slideIndex);\n\n callback.call();\n }, _.options.speed);\n }\n\n }\n\n };\n\n Slick.prototype.fadeSlideOut = function(slideIndex) {\n\n var _ = this;\n\n if (_.cssTransitions === false) {\n\n _.$slides.eq(slideIndex).animate({\n opacity: 0,\n zIndex: _.options.zIndex - 2\n }, _.options.speed, _.options.easing);\n\n } else {\n\n _.applyTransition(slideIndex);\n\n _.$slides.eq(slideIndex).css({\n opacity: 0,\n zIndex: _.options.zIndex - 2\n });\n\n }\n\n };\n\n Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {\n\n var _ = this;\n\n if (filter !== null) {\n\n _.$slidesCache = _.$slides;\n\n _.unload();\n\n _.$slideTrack.children(this.options.slide).detach();\n\n _.$slidesCache.filter(filter).appendTo(_.$slideTrack);\n\n _.reinit();\n\n }\n\n };\n\n Slick.prototype.focusHandler = function() {\n\n var _ = this;\n\n _.$slider\n .off('focus.slick blur.slick')\n .on('focus.slick blur.slick',\n '*:not(.slick-arrow)', function(event) {\n\n event.stopImmediatePropagation();\n var $sf = $(this);\n\n setTimeout(function() {\n\n if( _.options.pauseOnFocus ) {\n _.focussed = $sf.is(':focus');\n _.autoPlay();\n }\n\n }, 0);\n\n });\n };\n\n Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {\n\n var _ = this;\n return _.currentSlide;\n\n };\n\n Slick.prototype.getDotCount = function() {\n\n var _ = this;\n\n var breakPoint = 0;\n var counter = 0;\n var pagerQty = 0;\n\n if (_.options.infinite === true) {\n while (breakPoint < _.slideCount) {\n ++pagerQty;\n breakPoint = counter + _.options.slidesToScroll;\n counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;\n }\n } else if (_.options.centerMode === true) {\n pagerQty = _.slideCount;\n } else if(!_.options.asNavFor) {\n pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);\n }else {\n while (breakPoint < _.slideCount) {\n ++pagerQty;\n breakPoint = counter + _.options.slidesToScroll;\n counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;\n }\n }\n\n return pagerQty - 1;\n\n };\n\n Slick.prototype.getLeft = function(slideIndex) {\n\n var _ = this,\n targetLeft,\n verticalHeight,\n verticalOffset = 0,\n targetSlide;\n\n _.slideOffset = 0;\n verticalHeight = _.$slides.first().outerHeight(true);\n\n if (_.options.infinite === true) {\n if (_.slideCount > _.options.slidesToShow) {\n _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;\n verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;\n }\n if (_.slideCount % _.options.slidesToScroll !== 0) {\n if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {\n if (slideIndex > _.slideCount) {\n _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;\n verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;\n } else {\n _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;\n verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;\n }\n }\n }\n } else {\n if (slideIndex + _.options.slidesToShow > _.slideCount) {\n _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;\n verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;\n }\n }\n\n if (_.slideCount <= _.options.slidesToShow) {\n _.slideOffset = 0;\n verticalOffset = 0;\n }\n\n if (_.options.centerMode === true && _.options.infinite === true) {\n _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;\n } else if (_.options.centerMode === true) {\n _.slideOffset = 0;\n _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);\n }\n\n if (_.options.vertical === false) {\n targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;\n } else {\n targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;\n }\n\n if (_.options.variableWidth === true) {\n\n if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {\n targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);\n } else {\n targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);\n }\n\n if (_.options.rtl === true) {\n if (targetSlide[0]) {\n targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;\n } else {\n targetLeft = 0;\n }\n } else {\n targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;\n }\n\n if (_.options.centerMode === true) {\n if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {\n targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);\n } else {\n targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);\n }\n\n if (_.options.rtl === true) {\n if (targetSlide[0]) {\n targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;\n } else {\n targetLeft = 0;\n }\n } else {\n targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;\n }\n\n targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;\n }\n }\n\n return targetLeft;\n\n };\n\n Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {\n\n var _ = this;\n\n return _.options[option];\n\n };\n\n Slick.prototype.getNavigableIndexes = function() {\n\n var _ = this,\n breakPoint = 0,\n counter = 0,\n indexes = [],\n max;\n\n if (_.options.infinite === false) {\n max = _.slideCount;\n } else {\n breakPoint = _.options.slidesToScroll * -1;\n counter = _.options.slidesToScroll * -1;\n max = _.slideCount * 2;\n }\n\n while (breakPoint < max) {\n indexes.push(breakPoint);\n breakPoint = counter + _.options.slidesToScroll;\n counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;\n }\n\n return indexes;\n\n };\n\n Slick.prototype.getSlick = function() {\n\n return this;\n\n };\n\n Slick.prototype.getSlideCount = function() {\n\n var _ = this,\n slidesTraversed, swipedSlide, centerOffset;\n\n centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;\n\n if (_.options.swipeToSlide === true) {\n _.$slideTrack.find('.slick-slide').each(function(index, slide) {\n if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {\n swipedSlide = slide;\n return false;\n }\n });\n\n slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;\n\n return slidesTraversed;\n\n } else {\n return _.options.slidesToScroll;\n }\n\n };\n\n Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {\n\n var _ = this;\n\n _.changeSlide({\n data: {\n message: 'index',\n index: parseInt(slide)\n }\n }, dontAnimate);\n\n };\n\n Slick.prototype.init = function(creation) {\n\n var _ = this;\n\n if (!$(_.$slider).hasClass('slick-initialized')) {\n\n $(_.$slider).addClass('slick-initialized');\n\n _.buildRows();\n _.buildOut();\n _.setProps();\n _.startLoad();\n _.loadSlider();\n _.initializeEvents();\n _.updateArrows();\n _.updateDots();\n _.checkResponsive(true);\n _.focusHandler();\n\n }\n\n if (creation) {\n _.$slider.trigger('init', [_]);\n }\n\n if (_.options.accessibility === true) {\n _.initADA();\n }\n\n if ( _.options.autoplay ) {\n\n _.paused = false;\n _.autoPlay();\n\n }\n\n };\n\n Slick.prototype.initADA = function() {\n var _ = this;\n _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({\n 'aria-hidden': 'true',\n 'tabindex': '-1'\n }).find('a, input, button, select').attr({\n 'tabindex': '-1'\n });\n\n _.$slideTrack.attr('role', 'listbox');\n\n _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {\n $(this).attr({\n 'role': 'option',\n 'aria-describedby': 'slick-slide' + _.instanceUid + i + ''\n });\n });\n\n if (_.$dots !== null) {\n _.$dots.attr('role', 'tablist').find('li').each(function(i) {\n $(this).attr({\n 'role': 'presentation',\n 'aria-selected': 'false',\n 'aria-controls': 'navigation' + _.instanceUid + i + '',\n 'id': 'slick-slide' + _.instanceUid + i + ''\n });\n })\n .first().attr('aria-selected', 'true').end()\n .find('button').attr('role', 'button').end()\n .closest('div').attr('role', 'toolbar');\n }\n _.activateADA();\n\n };\n\n Slick.prototype.initArrowEvents = function() {\n\n var _ = this;\n\n if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {\n _.$prevArrow\n .off('click.slick')\n .on('click.slick', {\n message: 'previous'\n }, _.changeSlide);\n _.$nextArrow\n .off('click.slick')\n .on('click.slick', {\n message: 'next'\n }, _.changeSlide);\n }\n\n };\n\n Slick.prototype.initDotEvents = function() {\n\n var _ = this;\n\n if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {\n $('li', _.$dots).on('click.slick', {\n message: 'index'\n }, _.changeSlide);\n }\n\n if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {\n\n $('li', _.$dots)\n .on('mouseenter.slick', $.proxy(_.interrupt, _, true))\n .on('mouseleave.slick', $.proxy(_.interrupt, _, false));\n\n }\n\n };\n\n Slick.prototype.initSlideEvents = function() {\n\n var _ = this;\n\n if ( _.options.pauseOnHover ) {\n\n _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));\n _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));\n\n }\n\n };\n\n Slick.prototype.initializeEvents = function() {\n\n var _ = this;\n\n _.initArrowEvents();\n\n _.initDotEvents();\n _.initSlideEvents();\n\n _.$list.on('touchstart.slick mousedown.slick', {\n action: 'start'\n }, _.swipeHandler);\n _.$list.on('touchmove.slick mousemove.slick', {\n action: 'move'\n }, _.swipeHandler);\n _.$list.on('touchend.slick mouseup.slick', {\n action: 'end'\n }, _.swipeHandler);\n _.$list.on('touchcancel.slick mouseleave.slick', {\n action: 'end'\n }, _.swipeHandler);\n\n _.$list.on('click.slick', _.clickHandler);\n\n $(document).on(_.visibilityChange, $.proxy(_.visibility, _));\n\n if (_.options.accessibility === true) {\n _.$list.on('keydown.slick', _.keyHandler);\n }\n\n if (_.options.focusOnSelect === true) {\n $(_.$slideTrack).children().on('click.slick', _.selectHandler);\n }\n\n $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));\n\n $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));\n\n $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);\n\n $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);\n $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);\n\n };\n\n Slick.prototype.initUI = function() {\n\n var _ = this;\n\n if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {\n\n _.$prevArrow.show();\n _.$nextArrow.show();\n\n }\n\n if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {\n\n _.$dots.show();\n\n }\n\n };\n\n Slick.prototype.keyHandler = function(event) {\n\n var _ = this;\n //Dont slide if the cursor is inside the form fields and arrow keys are pressed\n if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {\n if (event.keyCode === 37 && _.options.accessibility === true) {\n _.changeSlide({\n data: {\n message: _.options.rtl === true ? 'next' : 'previous'\n }\n });\n } else if (event.keyCode === 39 && _.options.accessibility === true) {\n _.changeSlide({\n data: {\n message: _.options.rtl === true ? 'previous' : 'next'\n }\n });\n }\n }\n\n };\n\n Slick.prototype.lazyLoad = function() {\n\n var _ = this,\n loadRange, cloneRange, rangeStart, rangeEnd;\n\n function loadImages(imagesScope) {\n\n $('img[data-lazy]', imagesScope).each(function() {\n\n var image = $(this),\n imageSource = $(this).attr('data-lazy'),\n imageToLoad = document.createElement('img');\n\n imageToLoad.onload = function() {\n\n image\n .animate({ opacity: 0 }, 100, function() {\n image\n .attr('src', imageSource)\n .animate({ opacity: 1 }, 200, function() {\n image\n .removeAttr('data-lazy')\n .removeClass('slick-loading');\n });\n _.$slider.trigger('lazyLoaded', [_, image, imageSource]);\n });\n\n };\n\n imageToLoad.onerror = function() {\n\n image\n .removeAttr( 'data-lazy' )\n .removeClass( 'slick-loading' )\n .addClass( 'slick-lazyload-error' );\n\n _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);\n\n };\n\n imageToLoad.src = imageSource;\n\n });\n\n }\n\n if (_.options.centerMode === true) {\n if (_.options.infinite === true) {\n rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);\n rangeEnd = rangeStart + _.options.slidesToShow + 2;\n } else {\n rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));\n rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;\n }\n } else {\n rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;\n rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);\n if (_.options.fade === true) {\n if (rangeStart > 0) rangeStart--;\n if (rangeEnd <= _.slideCount) rangeEnd++;\n }\n }\n\n loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);\n loadImages(loadRange);\n\n if (_.slideCount <= _.options.slidesToShow) {\n cloneRange = _.$slider.find('.slick-slide');\n loadImages(cloneRange);\n } else\n if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {\n cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);\n loadImages(cloneRange);\n } else if (_.currentSlide === 0) {\n cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);\n loadImages(cloneRange);\n }\n\n };\n\n Slick.prototype.loadSlider = function() {\n\n var _ = this;\n\n _.setPosition();\n\n _.$slideTrack.css({\n opacity: 1\n });\n\n _.$slider.removeClass('slick-loading');\n\n _.initUI();\n\n if (_.options.lazyLoad === 'progressive') {\n _.progressiveLazyLoad();\n }\n\n };\n\n Slick.prototype.next = Slick.prototype.slickNext = function() {\n\n var _ = this;\n\n _.changeSlide({\n data: {\n message: 'next'\n }\n });\n\n };\n\n Slick.prototype.orientationChange = function() {\n\n var _ = this;\n\n _.checkResponsive();\n _.setPosition();\n\n };\n\n Slick.prototype.pause = Slick.prototype.slickPause = function() {\n\n var _ = this;\n\n _.autoPlayClear();\n _.paused = true;\n\n };\n\n Slick.prototype.play = Slick.prototype.slickPlay = function() {\n\n var _ = this;\n\n _.autoPlay();\n _.options.autoplay = true;\n _.paused = false;\n _.focussed = false;\n _.interrupted = false;\n\n };\n\n Slick.prototype.postSlide = function(index) {\n\n var _ = this;\n\n if( !_.unslicked ) {\n\n _.$slider.trigger('afterChange', [_, index]);\n\n _.animating = false;\n\n _.setPosition();\n\n _.swipeLeft = null;\n\n if ( _.options.autoplay ) {\n _.autoPlay();\n }\n\n if (_.options.accessibility === true) {\n _.initADA();\n }\n\n }\n\n };\n\n Slick.prototype.prev = Slick.prototype.slickPrev = function() {\n\n var _ = this;\n\n _.changeSlide({\n data: {\n message: 'previous'\n }\n });\n\n };\n\n Slick.prototype.preventDefault = function(event) {\n\n event.preventDefault();\n\n };\n\n Slick.prototype.progressiveLazyLoad = function( tryCount ) {\n\n tryCount = tryCount || 1;\n\n var _ = this,\n $imgsToLoad = $( 'img[data-lazy]', _.$slider ),\n image,\n imageSource,\n imageToLoad;\n\n if ( $imgsToLoad.length ) {\n\n image = $imgsToLoad.first();\n imageSource = image.attr('data-lazy');\n imageToLoad = document.createElement('img');\n\n imageToLoad.onload = function() {\n\n image\n .attr( 'src', imageSource )\n .removeAttr('data-lazy')\n .removeClass('slick-loading');\n\n if ( _.options.adaptiveHeight === true ) {\n _.setPosition();\n }\n\n _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);\n _.progressiveLazyLoad();\n\n };\n\n imageToLoad.onerror = function() {\n\n if ( tryCount < 3 ) {\n\n /**\n * try to load the image 3 times,\n * leave a slight delay so we don't get\n * servers blocking the request.\n */\n setTimeout( function() {\n _.progressiveLazyLoad( tryCount + 1 );\n }, 500 );\n\n } else {\n\n image\n .removeAttr( 'data-lazy' )\n .removeClass( 'slick-loading' )\n .addClass( 'slick-lazyload-error' );\n\n _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);\n\n _.progressiveLazyLoad();\n\n }\n\n };\n\n imageToLoad.src = imageSource;\n\n } else {\n\n _.$slider.trigger('allImagesLoaded', [ _ ]);\n\n }\n\n };\n\n Slick.prototype.refresh = function( initializing ) {\n\n var _ = this, currentSlide, lastVisibleIndex;\n\n lastVisibleIndex = _.slideCount - _.options.slidesToShow;\n\n // in non-infinite sliders, we don't want to go past the\n // last visible index.\n if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {\n _.currentSlide = lastVisibleIndex;\n }\n\n // if less slides than to show, go to start.\n if ( _.slideCount <= _.options.slidesToShow ) {\n _.currentSlide = 0;\n\n }\n\n currentSlide = _.currentSlide;\n\n _.destroy(true);\n\n $.extend(_, _.initials, { currentSlide: currentSlide });\n\n _.init();\n\n if( !initializing ) {\n\n _.changeSlide({\n data: {\n message: 'index',\n index: currentSlide\n }\n }, false);\n\n }\n\n };\n\n Slick.prototype.registerBreakpoints = function() {\n\n var _ = this, breakpoint, currentBreakpoint, l,\n responsiveSettings = _.options.responsive || null;\n\n if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {\n\n _.respondTo = _.options.respondTo || 'window';\n\n for ( breakpoint in responsiveSettings ) {\n\n l = _.breakpoints.length-1;\n currentBreakpoint = responsiveSettings[breakpoint].breakpoint;\n\n if (responsiveSettings.hasOwnProperty(breakpoint)) {\n\n // loop through the breakpoints and cut out any existing\n // ones with the same breakpoint number, we don't want dupes.\n while( l >= 0 ) {\n if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {\n _.breakpoints.splice(l,1);\n }\n l--;\n }\n\n _.breakpoints.push(currentBreakpoint);\n _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;\n\n }\n\n }\n\n _.breakpoints.sort(function(a, b) {\n return ( _.options.mobileFirst ) ? a-b : b-a;\n });\n\n }\n\n };\n\n Slick.prototype.reinit = function() {\n\n var _ = this;\n\n _.$slides =\n _.$slideTrack\n .children(_.options.slide)\n .addClass('slick-slide');\n\n _.slideCount = _.$slides.length;\n\n if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {\n _.currentSlide = _.currentSlide - _.options.slidesToScroll;\n }\n\n if (_.slideCount <= _.options.slidesToShow) {\n _.currentSlide = 0;\n }\n\n _.registerBreakpoints();\n\n _.setProps();\n _.setupInfinite();\n _.buildArrows();\n _.updateArrows();\n _.initArrowEvents();\n _.buildDots();\n _.updateDots();\n _.initDotEvents();\n _.cleanUpSlideEvents();\n _.initSlideEvents();\n\n _.checkResponsive(false, true);\n\n if (_.options.focusOnSelect === true) {\n $(_.$slideTrack).children().on('click.slick', _.selectHandler);\n }\n\n _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);\n\n _.setPosition();\n _.focusHandler();\n\n _.paused = !_.options.autoplay;\n _.autoPlay();\n\n _.$slider.trigger('reInit', [_]);\n\n };\n\n Slick.prototype.resize = function() {\n\n var _ = this;\n\n if ($(window).width() !== _.windowWidth) {\n clearTimeout(_.windowDelay);\n _.windowDelay = window.setTimeout(function() {\n _.windowWidth = $(window).width();\n _.checkResponsive();\n if( !_.unslicked ) { _.setPosition(); }\n }, 50);\n }\n };\n\n Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {\n\n var _ = this;\n\n if (typeof(index) === 'boolean') {\n removeBefore = index;\n index = removeBefore === true ? 0 : _.slideCount - 1;\n } else {\n index = removeBefore === true ? --index : index;\n }\n\n if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {\n return false;\n }\n\n _.unload();\n\n if (removeAll === true) {\n _.$slideTrack.children().remove();\n } else {\n _.$slideTrack.children(this.options.slide).eq(index).remove();\n }\n\n _.$slides = _.$slideTrack.children(this.options.slide);\n\n _.$slideTrack.children(this.options.slide).detach();\n\n _.$slideTrack.append(_.$slides);\n\n _.$slidesCache = _.$slides;\n\n _.reinit();\n\n };\n\n Slick.prototype.setCSS = function(position) {\n\n var _ = this,\n positionProps = {},\n x, y;\n\n if (_.options.rtl === true) {\n position = -position;\n }\n x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';\n y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';\n\n positionProps[_.positionProp] = position;\n\n if (_.transformsEnabled === false) {\n _.$slideTrack.css(positionProps);\n } else {\n positionProps = {};\n if (_.cssTransitions === false) {\n positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';\n _.$slideTrack.css(positionProps);\n } else {\n positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';\n _.$slideTrack.css(positionProps);\n }\n }\n\n };\n\n Slick.prototype.setDimensions = function() {\n\n var _ = this;\n\n if (_.options.vertical === false) {\n if (_.options.centerMode === true) {\n _.$list.css({\n padding: ('0px ' + _.options.centerPadding)\n });\n }\n } else {\n _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);\n if (_.options.centerMode === true) {\n _.$list.css({\n padding: (_.options.centerPadding + ' 0px')\n });\n }\n }\n\n _.listWidth = _.$list.width();\n _.listHeight = _.$list.height();\n\n\n if (_.options.vertical === false && _.options.variableWidth === false) {\n _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);\n _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));\n\n } else if (_.options.variableWidth === true) {\n _.$slideTrack.width(5000 * _.slideCount);\n } else {\n _.slideWidth = Math.ceil(_.listWidth);\n _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));\n }\n\n var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();\n if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);\n\n };\n\n Slick.prototype.setFade = function() {\n\n var _ = this,\n targetLeft;\n\n _.$slides.each(function(index, element) {\n targetLeft = (_.slideWidth * index) * -1;\n if (_.options.rtl === true) {\n $(element).css({\n position: 'relative',\n right: targetLeft,\n top: 0,\n zIndex: _.options.zIndex - 2,\n opacity: 0\n });\n } else {\n $(element).css({\n position: 'relative',\n left: targetLeft,\n top: 0,\n zIndex: _.options.zIndex - 2,\n opacity: 0\n });\n }\n });\n\n _.$slides.eq(_.currentSlide).css({\n zIndex: _.options.zIndex - 1,\n opacity: 1\n });\n\n };\n\n Slick.prototype.setHeight = function() {\n\n var _ = this;\n\n if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {\n var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);\n _.$list.css('height', targetHeight);\n }\n\n };\n\n Slick.prototype.setOption =\n Slick.prototype.slickSetOption = function() {\n\n /**\n * accepts arguments in format of:\n *\n * - for changing a single option's value:\n * .slick(\"setOption\", option, value, refresh )\n *\n * - for changing a set of responsive options:\n * .slick(\"setOption\", 'responsive', [{}, ...], refresh )\n *\n * - for updating multiple values at once (not responsive)\n * .slick(\"setOption\", { 'option': value, ... }, refresh )\n */\n\n var _ = this, l, item, option, value, refresh = false, type;\n\n if( $.type( arguments[0] ) === 'object' ) {\n\n option = arguments[0];\n refresh = arguments[1];\n type = 'multiple';\n\n } else if ( $.type( arguments[0] ) === 'string' ) {\n\n option = arguments[0];\n value = arguments[1];\n refresh = arguments[2];\n\n if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {\n\n type = 'responsive';\n\n } else if ( typeof arguments[1] !== 'undefined' ) {\n\n type = 'single';\n\n }\n\n }\n\n if ( type === 'single' ) {\n\n _.options[option] = value;\n\n\n } else if ( type === 'multiple' ) {\n\n $.each( option , function( opt, val ) {\n\n _.options[opt] = val;\n\n });\n\n\n } else if ( type === 'responsive' ) {\n\n for ( item in value ) {\n\n if( $.type( _.options.responsive ) !== 'array' ) {\n\n _.options.responsive = [ value[item] ];\n\n } else {\n\n l = _.options.responsive.length-1;\n\n // loop through the responsive object and splice out duplicates.\n while( l >= 0 ) {\n\n if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {\n\n _.options.responsive.splice(l,1);\n\n }\n\n l--;\n\n }\n\n _.options.responsive.push( value[item] );\n\n }\n\n }\n\n }\n\n if ( refresh ) {\n\n _.unload();\n _.reinit();\n\n }\n\n };\n\n Slick.prototype.setPosition = function() {\n\n var _ = this;\n\n _.setDimensions();\n\n _.setHeight();\n\n if (_.options.fade === false) {\n _.setCSS(_.getLeft(_.currentSlide));\n } else {\n _.setFade();\n }\n\n _.$slider.trigger('setPosition', [_]);\n\n };\n\n Slick.prototype.setProps = function() {\n\n var _ = this,\n bodyStyle = document.body.style;\n\n _.positionProp = _.options.vertical === true ? 'top' : 'left';\n\n if (_.positionProp === 'top') {\n _.$slider.addClass('slick-vertical');\n } else {\n _.$slider.removeClass('slick-vertical');\n }\n\n if (bodyStyle.WebkitTransition !== undefined ||\n bodyStyle.MozTransition !== undefined ||\n bodyStyle.msTransition !== undefined) {\n if (_.options.useCSS === true) {\n _.cssTransitions = true;\n }\n }\n\n if ( _.options.fade ) {\n if ( typeof _.options.zIndex === 'number' ) {\n if( _.options.zIndex < 3 ) {\n _.options.zIndex = 3;\n }\n } else {\n _.options.zIndex = _.defaults.zIndex;\n }\n }\n\n if (bodyStyle.OTransform !== undefined) {\n _.animType = 'OTransform';\n _.transformType = '-o-transform';\n _.transitionType = 'OTransition';\n if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;\n }\n if (bodyStyle.MozTransform !== undefined) {\n _.animType = 'MozTransform';\n _.transformType = '-moz-transform';\n _.transitionType = 'MozTransition';\n if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;\n }\n if (bodyStyle.webkitTransform !== undefined) {\n _.animType = 'webkitTransform';\n _.transformType = '-webkit-transform';\n _.transitionType = 'webkitTransition';\n if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;\n }\n if (bodyStyle.msTransform !== undefined) {\n _.animType = 'msTransform';\n _.transformType = '-ms-transform';\n _.transitionType = 'msTransition';\n if (bodyStyle.msTransform === undefined) _.animType = false;\n }\n if (bodyStyle.transform !== undefined && _.animType !== false) {\n _.animType = 'transform';\n _.transformType = 'transform';\n _.transitionType = 'transition';\n }\n _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);\n };\n\n\n Slick.prototype.setSlideClasses = function(index) {\n\n var _ = this,\n centerOffset, allSlides, indexOffset, remainder;\n\n allSlides = _.$slider\n .find('.slick-slide')\n .removeClass('slick-active slick-center slick-current')\n .attr('aria-hidden', 'true');\n\n _.$slides\n .eq(index)\n .addClass('slick-current');\n\n if (_.options.centerMode === true) {\n\n centerOffset = Math.floor(_.options.slidesToShow / 2);\n\n if (_.options.infinite === true) {\n\n if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {\n\n _.$slides\n .slice(index - centerOffset, index + centerOffset + 1)\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n } else {\n\n indexOffset = _.options.slidesToShow + index;\n allSlides\n .slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n }\n\n if (index === 0) {\n\n allSlides\n .eq(allSlides.length - 1 - _.options.slidesToShow)\n .addClass('slick-center');\n\n } else if (index === _.slideCount - 1) {\n\n allSlides\n .eq(_.options.slidesToShow)\n .addClass('slick-center');\n\n }\n\n }\n\n _.$slides\n .eq(index)\n .addClass('slick-center');\n\n } else {\n\n if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {\n\n _.$slides\n .slice(index, index + _.options.slidesToShow)\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n } else if (allSlides.length <= _.options.slidesToShow) {\n\n allSlides\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n } else {\n\n remainder = _.slideCount % _.options.slidesToShow;\n indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;\n\n if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {\n\n allSlides\n .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n } else {\n\n allSlides\n .slice(indexOffset, indexOffset + _.options.slidesToShow)\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n }\n\n }\n\n }\n\n if (_.options.lazyLoad === 'ondemand') {\n _.lazyLoad();\n }\n\n };\n\n Slick.prototype.setupInfinite = function() {\n\n var _ = this,\n i, slideIndex, infiniteCount;\n\n if (_.options.fade === true) {\n _.options.centerMode = false;\n }\n\n if (_.options.infinite === true && _.options.fade === false) {\n\n slideIndex = null;\n\n if (_.slideCount > _.options.slidesToShow) {\n\n if (_.options.centerMode === true) {\n infiniteCount = _.options.slidesToShow + 1;\n } else {\n infiniteCount = _.options.slidesToShow;\n }\n\n for (i = _.slideCount; i > (_.slideCount -\n infiniteCount); i -= 1) {\n slideIndex = i - 1;\n $(_.$slides[slideIndex]).clone(true).attr('id', '')\n .attr('data-slick-index', slideIndex - _.slideCount)\n .prependTo(_.$slideTrack).addClass('slick-cloned');\n }\n for (i = 0; i < infiniteCount; i += 1) {\n slideIndex = i;\n $(_.$slides[slideIndex]).clone(true).attr('id', '')\n .attr('data-slick-index', slideIndex + _.slideCount)\n .appendTo(_.$slideTrack).addClass('slick-cloned');\n }\n _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {\n $(this).attr('id', '');\n });\n\n }\n\n }\n\n };\n\n Slick.prototype.interrupt = function( toggle ) {\n\n var _ = this;\n\n if( !toggle ) {\n _.autoPlay();\n }\n _.interrupted = toggle;\n\n };\n\n Slick.prototype.selectHandler = function(event) {\n\n var _ = this;\n\n var targetElement =\n $(event.target).is('.slick-slide') ?\n $(event.target) :\n $(event.target).parents('.slick-slide');\n\n var index = parseInt(targetElement.attr('data-slick-index'));\n\n if (!index) index = 0;\n\n if (_.slideCount <= _.options.slidesToShow) {\n\n _.setSlideClasses(index);\n _.asNavFor(index);\n return;\n\n }\n\n _.slideHandler(index);\n\n };\n\n Slick.prototype.slideHandler = function(index, sync, dontAnimate) {\n\n var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,\n _ = this, navTarget;\n\n sync = sync || false;\n\n if (_.animating === true && _.options.waitForAnimate === true) {\n return;\n }\n\n if (_.options.fade === true && _.currentSlide === index) {\n return;\n }\n\n if (_.slideCount <= _.options.slidesToShow) {\n return;\n }\n\n if (sync === false) {\n _.asNavFor(index);\n }\n\n targetSlide = index;\n targetLeft = _.getLeft(targetSlide);\n slideLeft = _.getLeft(_.currentSlide);\n\n _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;\n\n if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {\n if (_.options.fade === false) {\n targetSlide = _.currentSlide;\n if (dontAnimate !== true) {\n _.animateSlide(slideLeft, function() {\n _.postSlide(targetSlide);\n });\n } else {\n _.postSlide(targetSlide);\n }\n }\n return;\n } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {\n if (_.options.fade === false) {\n targetSlide = _.currentSlide;\n if (dontAnimate !== true) {\n _.animateSlide(slideLeft, function() {\n _.postSlide(targetSlide);\n });\n } else {\n _.postSlide(targetSlide);\n }\n }\n return;\n }\n\n if ( _.options.autoplay ) {\n clearInterval(_.autoPlayTimer);\n }\n\n if (targetSlide < 0) {\n if (_.slideCount % _.options.slidesToScroll !== 0) {\n animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);\n } else {\n animSlide = _.slideCount + targetSlide;\n }\n } else if (targetSlide >= _.slideCount) {\n if (_.slideCount % _.options.slidesToScroll !== 0) {\n animSlide = 0;\n } else {\n animSlide = targetSlide - _.slideCount;\n }\n } else {\n animSlide = targetSlide;\n }\n\n _.animating = true;\n\n _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);\n\n oldSlide = _.currentSlide;\n _.currentSlide = animSlide;\n\n _.setSlideClasses(_.currentSlide);\n\n if ( _.options.asNavFor ) {\n\n navTarget = _.getNavTarget();\n navTarget = navTarget.slick('getSlick');\n\n if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {\n navTarget.setSlideClasses(_.currentSlide);\n }\n\n }\n\n _.updateDots();\n _.updateArrows();\n\n if (_.options.fade === true) {\n if (dontAnimate !== true) {\n\n _.fadeSlideOut(oldSlide);\n\n _.fadeSlide(animSlide, function() {\n _.postSlide(animSlide);\n });\n\n } else {\n _.postSlide(animSlide);\n }\n _.animateHeight();\n return;\n }\n\n if (dontAnimate !== true) {\n _.animateSlide(targetLeft, function() {\n _.postSlide(animSlide);\n });\n } else {\n _.postSlide(animSlide);\n }\n\n };\n\n Slick.prototype.startLoad = function() {\n\n var _ = this;\n\n if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {\n\n _.$prevArrow.hide();\n _.$nextArrow.hide();\n\n }\n\n if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {\n\n _.$dots.hide();\n\n }\n\n _.$slider.addClass('slick-loading');\n\n };\n\n Slick.prototype.swipeDirection = function() {\n\n var xDist, yDist, r, swipeAngle, _ = this;\n\n xDist = _.touchObject.startX - _.touchObject.curX;\n yDist = _.touchObject.startY - _.touchObject.curY;\n r = Math.atan2(yDist, xDist);\n\n swipeAngle = Math.round(r * 180 / Math.PI);\n if (swipeAngle < 0) {\n swipeAngle = 360 - Math.abs(swipeAngle);\n }\n\n if ((swipeAngle <= 45) && (swipeAngle >= 0)) {\n return (_.options.rtl === false ? 'left' : 'right');\n }\n if ((swipeAngle <= 360) && (swipeAngle >= 315)) {\n return (_.options.rtl === false ? 'left' : 'right');\n }\n if ((swipeAngle >= 135) && (swipeAngle <= 225)) {\n return (_.options.rtl === false ? 'right' : 'left');\n }\n if (_.options.verticalSwiping === true) {\n if ((swipeAngle >= 35) && (swipeAngle <= 135)) {\n return 'down';\n } else {\n return 'up';\n }\n }\n\n return 'vertical';\n\n };\n\n Slick.prototype.swipeEnd = function(event) {\n\n var _ = this,\n slideCount,\n direction;\n\n _.dragging = false;\n _.interrupted = false;\n _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;\n\n if ( _.touchObject.curX === undefined ) {\n return false;\n }\n\n if ( _.touchObject.edgeHit === true ) {\n _.$slider.trigger('edge', [_, _.swipeDirection() ]);\n }\n\n if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {\n\n direction = _.swipeDirection();\n\n switch ( direction ) {\n\n case 'left':\n case 'down':\n\n slideCount =\n _.options.swipeToSlide ?\n _.checkNavigable( _.currentSlide + _.getSlideCount() ) :\n _.currentSlide + _.getSlideCount();\n\n _.currentDirection = 0;\n\n break;\n\n case 'right':\n case 'up':\n\n slideCount =\n _.options.swipeToSlide ?\n _.checkNavigable( _.currentSlide - _.getSlideCount() ) :\n _.currentSlide - _.getSlideCount();\n\n _.currentDirection = 1;\n\n break;\n\n default:\n\n\n }\n\n if( direction != 'vertical' ) {\n\n _.slideHandler( slideCount );\n _.touchObject = {};\n _.$slider.trigger('swipe', [_, direction ]);\n\n }\n\n } else {\n\n if ( _.touchObject.startX !== _.touchObject.curX ) {\n\n _.slideHandler( _.currentSlide );\n _.touchObject = {};\n\n }\n\n }\n\n };\n\n Slick.prototype.swipeHandler = function(event) {\n\n var _ = this;\n\n if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {\n return;\n } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {\n return;\n }\n\n _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?\n event.originalEvent.touches.length : 1;\n\n _.touchObject.minSwipe = _.listWidth / _.options\n .touchThreshold;\n\n if (_.options.verticalSwiping === true) {\n _.touchObject.minSwipe = _.listHeight / _.options\n .touchThreshold;\n }\n\n switch (event.data.action) {\n\n case 'start':\n _.swipeStart(event);\n break;\n\n case 'move':\n _.swipeMove(event);\n break;\n\n case 'end':\n _.swipeEnd(event);\n break;\n\n }\n\n };\n\n Slick.prototype.swipeMove = function(event) {\n\n var _ = this,\n edgeWasHit = false,\n curLeft, swipeDirection, swipeLength, positionOffset, touches;\n\n touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;\n\n if (!_.dragging || touches && touches.length !== 1) {\n return false;\n }\n\n curLeft = _.getLeft(_.currentSlide);\n\n _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;\n _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;\n\n _.touchObject.swipeLength = Math.round(Math.sqrt(\n Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));\n\n if (_.options.verticalSwiping === true) {\n _.touchObject.swipeLength = Math.round(Math.sqrt(\n Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));\n }\n\n swipeDirection = _.swipeDirection();\n\n if (swipeDirection === 'vertical') {\n return;\n }\n\n if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {\n event.preventDefault();\n }\n\n positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);\n if (_.options.verticalSwiping === true) {\n positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;\n }\n\n\n swipeLength = _.touchObject.swipeLength;\n\n _.touchObject.edgeHit = false;\n\n if (_.options.infinite === false) {\n if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {\n swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;\n _.touchObject.edgeHit = true;\n }\n }\n\n if (_.options.vertical === false) {\n _.swipeLeft = curLeft + swipeLength * positionOffset;\n } else {\n _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;\n }\n if (_.options.verticalSwiping === true) {\n _.swipeLeft = curLeft + swipeLength * positionOffset;\n }\n\n if (_.options.fade === true || _.options.touchMove === false) {\n return false;\n }\n\n if (_.animating === true) {\n _.swipeLeft = null;\n return false;\n }\n\n _.setCSS(_.swipeLeft);\n\n };\n\n Slick.prototype.swipeStart = function(event) {\n\n var _ = this,\n touches;\n\n _.interrupted = true;\n\n if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {\n _.touchObject = {};\n return false;\n }\n\n if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {\n touches = event.originalEvent.touches[0];\n }\n\n _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;\n _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;\n\n _.dragging = true;\n\n };\n\n Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {\n\n var _ = this;\n\n if (_.$slidesCache !== null) {\n\n _.unload();\n\n _.$slideTrack.children(this.options.slide).detach();\n\n _.$slidesCache.appendTo(_.$slideTrack);\n\n _.reinit();\n\n }\n\n };\n\n Slick.prototype.unload = function() {\n\n var _ = this;\n\n $('.slick-cloned', _.$slider).remove();\n\n if (_.$dots) {\n _.$dots.remove();\n }\n\n if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {\n _.$prevArrow.remove();\n }\n\n if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {\n _.$nextArrow.remove();\n }\n\n _.$slides\n .removeClass('slick-slide slick-active slick-visible slick-current')\n .attr('aria-hidden', 'true')\n .css('width', '');\n\n };\n\n Slick.prototype.unslick = function(fromBreakpoint) {\n\n var _ = this;\n _.$slider.trigger('unslick', [_, fromBreakpoint]);\n _.destroy();\n\n };\n\n Slick.prototype.updateArrows = function() {\n\n var _ = this,\n centerOffset;\n\n centerOffset = Math.floor(_.options.slidesToShow / 2);\n\n if ( _.options.arrows === true &&\n _.slideCount > _.options.slidesToShow &&\n !_.options.infinite ) {\n\n _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');\n _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');\n\n if (_.currentSlide === 0) {\n\n _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');\n _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');\n\n } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {\n\n _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');\n _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');\n\n } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {\n\n _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');\n _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');\n\n }\n\n }\n\n };\n\n Slick.prototype.updateDots = function() {\n\n var _ = this;\n\n if (_.$dots !== null) {\n\n _.$dots\n .find('li')\n .removeClass('slick-active')\n .attr('aria-hidden', 'true');\n\n _.$dots\n .find('li')\n .eq(Math.floor(_.currentSlide / _.options.slidesToScroll))\n .addClass('slick-active')\n .attr('aria-hidden', 'false');\n\n }\n\n };\n\n Slick.prototype.visibility = function() {\n\n var _ = this;\n\n if ( _.options.autoplay ) {\n\n if ( document[_.hidden] ) {\n\n _.interrupted = true;\n\n } else {\n\n _.interrupted = false;\n\n }\n\n }\n\n };\n\n $.fn.slick = function() {\n var _ = this,\n opt = arguments[0],\n args = Array.prototype.slice.call(arguments, 1),\n l = _.length,\n i,\n ret;\n for (i = 0; i < l; i++) {\n if (typeof opt == 'object' || typeof opt == 'undefined')\n _[i].slick = new Slick(_[i], opt);\n else\n ret = _[i].slick[opt].apply(_[i].slick, args);\n if (typeof ret != 'undefined') return ret;\n }\n return _;\n };\n\n}));\n\n/*!\n * angular-slick-carousel\n * DevMark <hc.devmark@gmail.com>\n * https://github.com/devmark/angular-slick-carousel\n * Version: 3.1.7 - 2016-08-04T06:17:55.528Z\n * License: MIT\n */\n\n\n'use strict';\n\nangular\n .module('slickCarousel', [])\n //global config\n .constant('slickCarouselConfig', {\n method: {},\n event: {}\n })\n .directive('slick', [\n '$timeout', 'slickCarouselConfig', function ($timeout, slickCarouselConfig) {\n var slickMethodList, slickEventList;\n slickMethodList = ['slickGoTo', 'slickNext', 'slickPrev', 'slickPause', 'slickPlay', 'slickAdd', 'slickRemove', 'slickFilter', 'slickUnfilter', 'unslick'];\n slickEventList = ['afterChange', 'beforeChange', 'breakpoint', 'destroy', 'edge', 'init', 'reInit', 'setPosition', 'swipe', 'lazyLoaded', 'lazyLoadError'];\n\n return {\n scope: {\n settings: '=',\n enabled: '@',\n accessibility: '@',\n adaptiveHeight: '@',\n autoplay: '@',\n autoplaySpeed: '@',\n arrows: '@',\n asNavFor: '@',\n appendArrows: '@',\n prevArrow: '@',\n nextArrow: '@',\n centerMode: '@',\n centerPadding: '@',\n cssEase: '@',\n customPaging: '&',\n dots: '@',\n draggable: '@',\n fade: '@',\n focusOnSelect: '@',\n easing: '@',\n edgeFriction: '@',\n infinite: '@',\n initialSlide: '@',\n lazyLoad: '@',\n mobileFirst: '@',\n pauseOnHover: '@',\n pauseOnDotsHover: '@',\n respondTo: '@',\n responsive: '=?',\n rows: '@',\n slide: '@',\n slidesPerRow: '@',\n slidesToShow: '@',\n slidesToScroll: '@',\n speed: '@',\n swipe: '@',\n swipeToSlide: '@',\n touchMove: '@',\n touchThreshold: '@',\n useCSS: '@',\n variableWidth: '@',\n vertical: '@',\n verticalSwiping: '@',\n rtl: '@'\n },\n restrict: 'AE',\n link: function (scope, element, attr) {\n //hide slider\n angular.element(element).css('display', 'none');\n\n var options, initOptions, destroy, init, destroyAndInit, currentIndex;\n\n initOptions = function () {\n options = angular.extend(angular.copy(slickCarouselConfig), {\n enabled: scope.enabled !== 'false',\n accessibility: scope.accessibility !== 'false',\n adaptiveHeight: scope.adaptiveHeight === 'true',\n autoplay: scope.autoplay === 'true',\n autoplaySpeed: scope.autoplaySpeed != null ? parseInt(scope.autoplaySpeed, 10) : 3000,\n arrows: scope.arrows !== 'false',\n asNavFor: scope.asNavFor ? scope.asNavFor : void 0,\n appendArrows: scope.appendArrows ? angular.element(scope.appendArrows) : angular.element(element),\n prevArrow: scope.prevArrow ? angular.element(scope.prevArrow) : void 0,\n nextArrow: scope.nextArrow ? angular.element(scope.nextArrow) : void 0,\n centerMode: scope.centerMode === 'true',\n centerPadding: scope.centerPadding || '50px',\n cssEase: scope.cssEase || 'ease',\n customPaging: attr.customPaging ? function (slick, index) {\n return scope.customPaging({slick: slick, index: index});\n } : void 0,\n dots: scope.dots === 'true',\n draggable: scope.draggable !== 'false',\n fade: scope.fade === 'true',\n focusOnSelect: scope.focusOnSelect === 'true',\n easing: scope.easing || 'linear',\n edgeFriction: scope.edgeFriction || 0.15,\n infinite: scope.infinite !== 'false',\n initialSlide: parseInt(scope.initialSlide) || 0,\n lazyLoad: scope.lazyLoad || 'ondemand',\n mobileFirst: scope.mobileFirst === 'true',\n pauseOnHover: scope.pauseOnHover !== 'false',\n pauseOnDotsHover: scope.pauseOnDotsHover === \"true\",\n respondTo: scope.respondTo != null ? scope.respondTo : 'window',\n responsive: scope.responsive || void 0,\n rows: scope.rows != null ? parseInt(scope.rows, 10) : 1,\n slide: scope.slide || '',\n slidesPerRow: scope.slidesPerRow != null ? parseInt(scope.slidesPerRow, 10) : 1,\n slidesToShow: scope.slidesToShow != null ? parseInt(scope.slidesToShow, 10) : 1,\n slidesToScroll: scope.slidesToScroll != null ? parseInt(scope.slidesToScroll, 10) : 1,\n speed: scope.speed != null ? parseInt(scope.speed, 10) : 300,\n swipe: scope.swipe !== 'false',\n swipeToSlide: scope.swipeToSlide === 'true',\n touchMove: scope.touchMove !== 'false',\n touchThreshold: scope.touchThreshold ? parseInt(scope.touchThreshold, 10) : 5,\n useCSS: scope.useCSS !== 'false',\n variableWidth: scope.variableWidth === 'true',\n vertical: scope.vertical === 'true',\n verticalSwiping: scope.verticalSwiping === 'true',\n rtl: scope.rtl === 'true'\n }, scope.settings);\n\n };\n\n destroy = function () {\n var slickness = angular.element(element);\n if (slickness.hasClass('slick-initialized')) {\n slickness.remove('slick-list');\n slickness.slick('unslick');\n }\n\n return slickness;\n };\n\n init = function () {\n initOptions();\n\n var slickness = angular.element(element);\n\n if (angular.element(element).hasClass('slick-initialized')) {\n if (options.enabled) {\n return slickness.slick('getSlick');\n } else {\n destroy();\n }\n } else {\n if (!options.enabled) {\n return;\n }\n // Event\n slickness.on('init', function (event, slick) {\n if (typeof options.event.init !== 'undefined') {\n options.event.init(event, slick);\n }\n if (typeof currentIndex !== 'undefined') {\n return slick.slideHandler(currentIndex);\n }\n });\n\n $timeout(function () {\n angular.element(element).css('display', 'block');\n slickness.not('.slick-initialized').slick(options);\n });\n }\n\n scope.internalControl = options.method || {};\n\n // Method\n slickMethodList.forEach(function (value) {\n scope.internalControl[value] = function () {\n var args;\n args = Array.prototype.slice.call(arguments);\n args.unshift(value);\n slickness.slick.apply(element, args);\n };\n });\n\n // Event\n slickness.on('afterChange', function (event, slick, currentSlide) {\n currentIndex = currentSlide;\n if (typeof options.event.afterChange !== 'undefined') {\n $timeout(function () {\n scope.$apply(function () {\n options.event.afterChange(event, slick, currentSlide);\n });\n });\n }\n });\n\n slickness.on('beforeChange', function (event, slick, currentSlide, nextSlide) {\n if (typeof options.event.beforeChange !== 'undefined') {\n $timeout(function () {\n $timeout(function () {\n scope.$apply(function () {\n options.event.beforeChange(event, slick, currentSlide, nextSlide);\n });\n });\n });\n }\n });\n\n slickness.on('reInit', function (event, slick) {\n if (typeof options.event.reInit !== 'undefined') {\n $timeout(function () {\n scope.$apply(function () {\n options.event.reInit(event, slick);\n });\n });\n }\n });\n\n if (typeof options.event.breakpoint !== 'undefined') {\n slickness.on('breakpoint', function (event, slick, breakpoint) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.breakpoint(event, slick, breakpoint);\n });\n });\n });\n }\n if (typeof options.event.destroy !== 'undefined') {\n slickness.on('destroy', function (event, slick) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.destroy(event, slick);\n });\n });\n });\n }\n if (typeof options.event.edge !== 'undefined') {\n slickness.on('edge', function (event, slick, direction) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.edge(event, slick, direction);\n });\n });\n });\n }\n\n if (typeof options.event.setPosition !== 'undefined') {\n slickness.on('setPosition', function (event, slick) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.setPosition(event, slick);\n });\n });\n });\n }\n if (typeof options.event.swipe !== 'undefined') {\n slickness.on('swipe', function (event, slick, direction) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.swipe(event, slick, direction);\n });\n });\n });\n }\n if (typeof options.event.lazyLoaded !== 'undefined') {\n slickness.on('lazyLoaded', function (event, slick, image, imageSource) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.lazyLoaded(event, slick, image, imageSource);\n });\n });\n });\n }\n if (typeof options.event.lazyLoadError !== 'undefined') {\n slickness.on('lazyLoadError', function (event, slick, image, imageSource) {\n $timeout(function () {\n scope.$apply(function () {\n options.event.lazyLoadError(event, slick, image, imageSource);\n });\n });\n });\n }\n };\n\n destroyAndInit = function () {\n destroy();\n init();\n };\n\n element.one('$destroy', function () {\n destroy();\n });\n\n return scope.$watch('settings', function (newVal, oldVal) {\n if (newVal !== null) {\n return destroyAndInit();\n }\n }, true);\n\n }\n };\n }\n ]);\n\n/**\n * An Angular module that gives you access to the browsers local storage\n * @version v0.2.6 - 2016-03-16\n * @link https://github.com/grevory/angular-local-storage\n * @author grevory <greg@gregpike.ca>\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n(function (window, angular) {\nvar isDefined = angular.isDefined,\n isUndefined = angular.isUndefined,\n isNumber = angular.isNumber,\n isObject = angular.isObject,\n isArray = angular.isArray,\n extend = angular.extend,\n toJson = angular.toJson;\n\nangular\n .module('LocalStorageModule', [])\n .provider('localStorageService', function() {\n // You should set a prefix to avoid overwriting any local storage variables from the rest of your app\n // e.g. localStorageServiceProvider.setPrefix('yourAppName');\n // With provider you can use config as this:\n // myApp.config(function (localStorageServiceProvider) {\n // localStorageServiceProvider.prefix = 'yourAppName';\n // });\n this.prefix = 'ls';\n\n // You could change web storage type localstorage or sessionStorage\n this.storageType = 'localStorage';\n\n // Cookie options (usually in case of fallback)\n // expiry = Number of days before cookies expire // 0 = Does not expire\n // path = The web path the cookie represents\n this.cookie = {\n expiry: 30,\n path: '/'\n };\n\n // Send signals for each of the following actions?\n this.notify = {\n setItem: true,\n removeItem: false\n };\n\n // Setter for the prefix\n this.setPrefix = function(prefix) {\n this.prefix = prefix;\n return this;\n };\n\n // Setter for the storageType\n this.setStorageType = function(storageType) {\n this.storageType = storageType;\n return this;\n };\n\n // Setter for cookie config\n this.setStorageCookie = function(exp, path) {\n this.cookie.expiry = exp;\n this.cookie.path = path;\n return this;\n };\n\n // Setter for cookie domain\n this.setStorageCookieDomain = function(domain) {\n this.cookie.domain = domain;\n return this;\n };\n\n // Setter for notification config\n // itemSet & itemRemove should be booleans\n this.setNotify = function(itemSet, itemRemove) {\n this.notify = {\n setItem: itemSet,\n removeItem: itemRemove\n };\n return this;\n };\n\n this.$get = ['$rootScope', '$window', '$document', '$parse', function($rootScope, $window, $document, $parse) {\n var self = this;\n var prefix = self.prefix;\n var cookie = self.cookie;\n var notify = self.notify;\n var storageType = self.storageType;\n var webStorage;\n\n // When Angular's $document is not available\n if (!$document) {\n $document = document;\n } else if ($document[0]) {\n $document = $document[0];\n }\n\n // If there is a prefix set in the config lets use that with an appended period for readability\n if (prefix.substr(-1) !== '.') {\n prefix = !!prefix ? prefix + '.' : '';\n }\n var deriveQualifiedKey = function(key) {\n return prefix + key;\n };\n // Checks the browser to see if local storage is supported\n var browserSupportsLocalStorage = (function () {\n try {\n var supported = (storageType in $window && $window[storageType] !== null);\n\n // When Safari (OS X or iOS) is in private browsing mode, it appears as though localStorage\n // is available, but trying to call .setItem throws an exception.\n //\n // \"QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage\n // that exceeded the quota.\"\n var key = deriveQualifiedKey('__' + Math.round(Math.random() * 1e7));\n if (supported) {\n webStorage = $window[storageType];\n webStorage.setItem(key, '');\n webStorage.removeItem(key);\n }\n\n return supported;\n } catch (e) {\n storageType = 'cookie';\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);\n return false;\n }\n }());\n\n // Directly adds a value to local storage\n // If local storage is not available in the browser use cookies\n // Example use: localStorageService.add('library','angular');\n var addToLocalStorage = function (key, value) {\n // Let's convert undefined values to null to get the value consistent\n if (isUndefined(value)) {\n value = null;\n } else {\n value = toJson(value);\n }\n\n // If this browser does not support local storage use cookies\n if (!browserSupportsLocalStorage || self.storageType === 'cookie') {\n if (!browserSupportsLocalStorage) {\n $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');\n }\n\n if (notify.setItem) {\n $rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: 'cookie'});\n }\n return addToCookies(key, value);\n }\n\n try {\n if (webStorage) {\n webStorage.setItem(deriveQualifiedKey(key), value);\n }\n if (notify.setItem) {\n $rootScope.$broadcast('LocalStorageModule.notification.setitem', {key: key, newvalue: value, storageType: self.storageType});\n }\n } catch (e) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);\n return addToCookies(key, value);\n }\n return true;\n };\n\n // Directly get a value from local storage\n // Example use: localStorageService.get('library'); // returns 'angular'\n var getFromLocalStorage = function (key) {\n\n if (!browserSupportsLocalStorage || self.storageType === 'cookie') {\n if (!browserSupportsLocalStorage) {\n $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');\n }\n\n return getFromCookies(key);\n }\n\n var item = webStorage ? webStorage.getItem(deriveQualifiedKey(key)) : null;\n // angular.toJson will convert null to 'null', so a proper conversion is needed\n // FIXME not a perfect solution, since a valid 'null' string can't be stored\n if (!item || item === 'null') {\n return null;\n }\n\n try {\n return JSON.parse(item);\n } catch (e) {\n return item;\n }\n };\n\n // Remove an item from local storage\n // Example use: localStorageService.remove('library'); // removes the key/value pair of library='angular'\n var removeFromLocalStorage = function () {\n var i, key;\n for (i=0; i<arguments.length; i++) {\n key = arguments[i];\n if (!browserSupportsLocalStorage || self.storageType === 'cookie') {\n if (!browserSupportsLocalStorage) {\n $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');\n }\n\n if (notify.removeItem) {\n $rootScope.$broadcast('LocalStorageModule.notification.removeitem', {key: key, storageType: 'cookie'});\n }\n removeFromCookies(key);\n }\n else {\n try {\n webStorage.removeItem(deriveQualifiedKey(key));\n if (notify.removeItem) {\n $rootScope.$broadcast('LocalStorageModule.notification.removeitem', {\n key: key,\n storageType: self.storageType\n });\n }\n } catch (e) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);\n removeFromCookies(key);\n }\n }\n }\n };\n\n // Return array of keys for local storage\n // Example use: var keys = localStorageService.keys()\n var getKeysForLocalStorage = function () {\n\n if (!browserSupportsLocalStorage) {\n $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');\n return [];\n }\n\n var prefixLength = prefix.length;\n var keys = [];\n for (var key in webStorage) {\n // Only return keys that are for this app\n if (key.substr(0, prefixLength) === prefix) {\n try {\n keys.push(key.substr(prefixLength));\n } catch (e) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.Description);\n return [];\n }\n }\n }\n return keys;\n };\n\n // Remove all data for this app from local storage\n // Also optionally takes a regular expression string and removes the matching key-value pairs\n // Example use: localStorageService.clearAll();\n // Should be used mostly for development purposes\n var clearAllFromLocalStorage = function (regularExpression) {\n\n // Setting both regular expressions independently\n // Empty strings result in catchall RegExp\n var prefixRegex = !!prefix ? new RegExp('^' + prefix) : new RegExp();\n var testRegex = !!regularExpression ? new RegExp(regularExpression) : new RegExp();\n\n if (!browserSupportsLocalStorage || self.storageType === 'cookie') {\n if (!browserSupportsLocalStorage) {\n $rootScope.$broadcast('LocalStorageModule.notification.warning', 'LOCAL_STORAGE_NOT_SUPPORTED');\n }\n return clearAllFromCookies();\n }\n\n var prefixLength = prefix.length;\n\n for (var key in webStorage) {\n // Only remove items that are for this app and match the regular expression\n if (prefixRegex.test(key) && testRegex.test(key.substr(prefixLength))) {\n try {\n removeFromLocalStorage(key.substr(prefixLength));\n } catch (e) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);\n return clearAllFromCookies();\n }\n }\n }\n return true;\n };\n\n // Checks the browser to see if cookies are supported\n var browserSupportsCookies = (function() {\n try {\n return $window.navigator.cookieEnabled ||\n (\"cookie\" in $document && ($document.cookie.length > 0 ||\n ($document.cookie = \"test\").indexOf.call($document.cookie, \"test\") > -1));\n } catch (e) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);\n return false;\n }\n }());\n\n // Directly adds a value to cookies\n // Typically used as a fallback is local storage is not available in the browser\n // Example use: localStorageService.cookie.add('library','angular');\n var addToCookies = function (key, value, daysToExpiry) {\n\n if (isUndefined(value)) {\n return false;\n } else if(isArray(value) || isObject(value)) {\n value = toJson(value);\n }\n\n if (!browserSupportsCookies) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', 'COOKIES_NOT_SUPPORTED');\n return false;\n }\n\n try {\n var expiry = '',\n expiryDate = new Date(),\n cookieDomain = '';\n\n if (value === null) {\n // Mark that the cookie has expired one day ago\n expiryDate.setTime(expiryDate.getTime() + (-1 * 24 * 60 * 60 * 1000));\n expiry = \"; expires=\" + expiryDate.toGMTString();\n value = '';\n } else if (isNumber(daysToExpiry) && daysToExpiry !== 0) {\n expiryDate.setTime(expiryDate.getTime() + (daysToExpiry * 24 * 60 * 60 * 1000));\n expiry = \"; expires=\" + expiryDate.toGMTString();\n } else if (cookie.expiry !== 0) {\n expiryDate.setTime(expiryDate.getTime() + (cookie.expiry * 24 * 60 * 60 * 1000));\n expiry = \"; expires=\" + expiryDate.toGMTString();\n }\n if (!!key) {\n var cookiePath = \"; path=\" + cookie.path;\n if(cookie.domain){\n cookieDomain = \"; domain=\" + cookie.domain;\n }\n $document.cookie = deriveQualifiedKey(key) + \"=\" + encodeURIComponent(value) + expiry + cookiePath + cookieDomain;\n }\n } catch (e) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', e.message);\n return false;\n }\n return true;\n };\n\n // Directly get a value from a cookie\n // Example use: localStorageService.cookie.get('library'); // returns 'angular'\n var getFromCookies = function (key) {\n if (!browserSupportsCookies) {\n $rootScope.$broadcast('LocalStorageModule.notification.error', 'COOKIES_NOT_SUPPORTED');\n return false;\n }\n\n var cookies = $document.cookie && $document.cookie.split(';') || [];\n for(var i=0; i < cookies.length; i++) {\n var thisCookie = cookies[i];\n while (thisCookie.charAt(0) === ' ') {\n thisCookie = thisCookie.substring(1,thisCookie.length);\n }\n if (thisCookie.indexOf(deriveQualifiedKey(key) + '=') === 0) {\n var storedValues = decodeURIComponent(thisCookie.substring(prefix.length + key.length + 1, thisCookie.length));\n try {\n return JSON.parse(storedValues);\n } catch(e) {\n return storedValues;\n }\n }\n }\n return null;\n };\n\n var removeFromCookies = function (key) {\n addToCookies(key,null);\n };\n\n var clearAllFromCookies = function () {\n var thisCookie = null, thisKey = null;\n var prefixLength = prefix.length;\n var cookies = $document.cookie.split(';');\n for(var i = 0; i < cookies.length; i++) {\n thisCookie = cookies[i];\n\n while (thisCookie.charAt(0) === ' ') {\n thisCookie = thisCookie.substring(1, thisCookie.length);\n }\n\n var key = thisCookie.substring(prefixLength, thisCookie.indexOf('='));\n removeFromCookies(key);\n }\n };\n\n var getStorageType = function() {\n return storageType;\n };\n\n // Add a listener on scope variable to save its changes to local storage\n // Return a function which when called cancels binding\n var bindToScope = function(scope, key, def, lsKey) {\n lsKey = lsKey || key;\n var value = getFromLocalStorage(lsKey);\n\n if (value === null && isDefined(def)) {\n value = def;\n } else if (isObject(value) && isObject(def)) {\n value = extend(value, def);\n }\n\n $parse(key).assign(scope, value);\n\n return scope.$watch(key, function(newVal) {\n addToLocalStorage(lsKey, newVal);\n }, isObject(scope[key]));\n };\n\n // Return localStorageService.length\n // ignore keys that not owned\n var lengthOfLocalStorage = function() {\n var count = 0;\n var storage = $window[storageType];\n for(var i = 0; i < storage.length; i++) {\n if(storage.key(i).indexOf(prefix) === 0 ) {\n count++;\n }\n }\n return count;\n };\n\n return {\n isSupported: browserSupportsLocalStorage,\n getStorageType: getStorageType,\n set: addToLocalStorage,\n add: addToLocalStorage, //DEPRECATED\n get: getFromLocalStorage,\n keys: getKeysForLocalStorage,\n remove: removeFromLocalStorage,\n clearAll: clearAllFromLocalStorage,\n bind: bindToScope,\n deriveKey: deriveQualifiedKey,\n length: lengthOfLocalStorage,\n cookie: {\n isSupported: browserSupportsCookies,\n set: addToCookies,\n add: addToCookies, //DEPRECATED\n get: getFromCookies,\n remove: removeFromCookies,\n clearAll: clearAllFromCookies\n }\n };\n }];\n });\n})(window, window.angular);"],"sourceRoot":"/source/"}