{"version":3,"sources":["vendor.js"],"names":["definition","bootstrap","exports","module","define","amd","ses","ok","makeQ","window","self","Error","global","previousQ","Q","noConflict","this","hasStacks","e","stack","qFileName","qStartingLine","captureLine","noop","nextTick","head","task","next","tail","flushing","requestTick","isNodeJS","laterQueue","flush","domain","enter","runSingle","length","pop","exit","setTimeout","process","toString","setImmediate","bind","MessageChannel","channel","port1","onmessage","requestPortTick","port2","postMessage","runAfter","push","call","Function","uncurryThis","f","apply","arguments","QReturnValue","array_slice","Array","prototype","slice","array_reduce","reduce","callback","basis","index","TypeError","array_indexOf","indexOf","value","i","array_map","map","thisp","collect","undefined","object_create","Object","create","Type","object_defineProperty","defineProperty","obj","prop","descriptor","object_hasOwnProperty","hasOwnProperty","object_keys","keys","object","key","object_toString","isStopIteration","exception","ReturnValue","makeStackTraceLong","error","promise","stacks","p","source","__minimumStackCounter__","stackCounter","configurable","unshift","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","join","filterStackString","stackLine","getFileNameAndLineNumber","attempt1","exec","Number","attempt2","attempt3","fileNameAndLineNumber","fileName","lineNumber","qEndingLine","Promise","isPromiseAlike","deferred","defer","then","resolve","reject","notify","coerce","fulfill","longStackSupport","longStackCounter","resolvedPromise","messages","progressListeners","promiseDispatch","op","operands","args","valueOf","nearerValue","nearer","isPromise","inspect","state","substring","become","newPromise","message","reason","progress","progressListener","resolver","race","answerPs","len","fallback","result","inspected","when","fulfilled","rejected","progressed","env","Q_DEBUG","makeNodeResolver","all","passByCopy","x","y","that","spread","makePromise","done","_fulfilled","newException","_rejected","newValue","threw","_progressed","onerror","tap","fcall","thenResolve","thenReject","isPending","isFulfilled","isRejected","name","alternative","unhandledReasons","unhandledRejections","reportedUnhandledRejections","trackUnhandledRejections","resetUnhandledRejections","rejection","at","emit","atReport","splice","untrackRejection","trackRejection","get","set","rhs","delete","post","dispatch","promises","pendingCount","snapshot","any","prev","current","err","allResolved","getUnhandledReasons","stopUnhandledRejectionTracking","master","isDef","array","async","makeGenerator","continuer","verb","arg","StopIteration","generator","errback","spawn","promised","del","mapply","send","mcall","invoke","fapply","fbind","concat","console","warn","allSettled","regardless","fail","fin","onUnhandledError","timeout","ms","timeoutId","code","clearTimeout","delay","nfapply","nodeArgs","nfcall","nfbind","denodeify","baseArgs","nbind","bound","nmapply","npost","nsend","nmcall","ninvoke","nodeify","nodeback","factory","document","w","noGlobal","arr","getProto","getPrototypeOf","class2type","hasOwn","fnToString","ObjectFunctionString","support","isFunction","nodeType","isWindow","preservedScriptAttributes","type","src","noModule","DOMEval","doc","node","script","createElement","text","appendChild","parentNode","removeChild","toType","version","jQuery","selector","context","fn","init","rtrim","isArrayLike","jquery","constructor","toArray","num","pushStack","elems","ret","merge","prevObject","each","elem","first","eq","last","j","end","sort","extend","options","copy","copyIsArray","clone","target","deep","isPlainObject","isArray","expando","Math","random","replace","isReady","msg","proto","Ctor","isEmptyObject","globalEval","trim","makeArray","results","inArray","second","grep","invert","matches","callbackExpect","guid","Symbol","iterator","toLowerCase","Sizzle","Expr","getText","isXML","tokenize","compile","select","outermostContext","sortInput","hasDuplicate","setDocument","docElem","documentIsHTML","rbuggyQSA","rbuggyMatches","contains","Date","preferredDoc","dirruns","classCache","createCache","tokenCache","compilerCache","sortOrder","a","b","push_native","list","booleans","whitespace","identifier","attributes","pseudos","rwhitespace","RegExp","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rnative","rquickExpr","rsibling","runescape","funescape","_","escaped","escapedWhitespace","high","String","fromCharCode","rcssescape","fcssescape","ch","asCodePoint","charCodeAt","unloadHandler","disabledAncestor","addCombinator","disabled","dir","childNodes","els","seed","m","nid","match","groups","newSelector","newContext","ownerDocument","getElementById","id","getElementsByTagName","getElementsByClassName","qsa","test","nodeName","getAttribute","setAttribute","toSelector","testContext","querySelectorAll","qsaError","removeAttribute","cache","cacheLength","shift","markFunction","assert","el","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createDisabledPseudo","isDisabled","createPositionalPseudo","argument","matchIndexes","documentElement","hasCompare","subWindow","defaultView","top","addEventListener","attachEvent","className","createComment","getById","getElementsByName","filter","attrId","find","getAttributeNode","tag","tmp","innerHTML","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","expr","elements","attr","val","specified","escape","sel","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","firstChild","nodeValue","selectors","createPseudo","relative","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","what","simple","forward","ofType","xml","uniqueCache","outerCache","nodeIndex","start","parent","useCache","lastChild","uniqueID","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","location","root","focus","activeElement","hasFocus","href","tabIndex","enabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","tokens","combinator","base","skip","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","contexts","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","filters","parseOnly","soFar","preFilters","cached","setMatchers","elementMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","matcherFromGroupMatchers","token","compiled","defaultValue","unique","isXMLDoc","escapeSelector","until","truncate","is","siblings","n","rneedsContext","rsingleTag","winnow","qualifier","rootjQuery","parseHTML","ready","rparentsprev","guaranteedUnique","children","contents","sibling","targets","l","closest","prevAll","add","addBack","parents","parentsUntil","nextAll","nextUntil","prevUntil","contentDocument","content","reverse","rnothtmlwhite","Identity","v","Thrower","ex","adoptValue","noValue","method","Callbacks","flag","createOptions","firing","memory","fired","locked","queue","firingIndex","fire","once","stopOnFalse","remove","disable","lock","fireWith","Deferred","func","tuples","always","catch","pipe","fns","newDefer","tuple","returned","onFulfilled","onRejected","onProgress","maxDepth","depth","special","mightThrow","notifyWith","resolveWith","exceptionHook","stackTrace","rejectWith","getStackHook","stateString","singleValue","remaining","resolveContexts","resolveValues","updateFunc","rerrorNames","readyException","readyList","completed","removeEventListener","readyWait","wait","readyState","doScroll","access","chainable","emptyGet","raw","bulk","rmsPrefix","rdashAlpha","fcamelCase","letter","toUpperCase","camelCase","string","acceptData","owner","Data","uid","data","hasData","dataPriv","dataUser","rbrace","rmultiDash","dataAttr","JSON","parse","getData","removeData","_data","_removeData","dequeue","startLength","hooks","_queueHooks","stop","setter","clearQueue","count","pnum","rcssNum","cssExpand","isHiddenWithinTree","style","display","css","swap","old","adjustCSS","valueParts","tween","adjusted","scale","maxIterations","currentValue","initial","unit","cssNumber","initialInUnit","defaultDisplayMap","getDefaultDisplay","body","showHide","show","values","hide","toggle","rcheckableType","rtagName","rscriptType","wrapMap","option","thead","col","tr","td","_default","getAll","setGlobalEval","refElements","optgroup","tbody","tfoot","colgroup","caption","th","div","rhtml","buildFragment","scripts","selection","ignored","wrap","fragment","createDocumentFragment","nodes","htmlPrefilter","createTextNode","checkClone","cloneNode","noCloneChecked","rkeyEvent","rmouseEvent","rtypenamespace","returnTrue","returnFalse","safeActiveElement","on","types","one","origFn","event","off","handleObjIn","eventHandle","events","t","handleObj","handlers","namespaces","origType","elemData","handle","triggered","delegateType","bindType","namespace","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","nativeEvent","handlerQueue","fix","delegateTarget","preDispatch","isPropagationStopped","currentTarget","isImmediatePropagationStopped","rnamespace","preventDefault","stopPropagation","postDispatch","matchedHandlers","matchedSelectors","addProp","hook","Event","enumerable","originalEvent","writable","load","noBubble","trigger","blur","click","beforeunload","returnValue","props","isDefaultPrevented","defaultPrevented","relatedTarget","timeStamp","now","isSimulated","stopImmediatePropagation","altKey","bubbles","cancelable","changedTouches","ctrlKey","detail","eventPhase","metaKey","pageX","pageY","shiftKey","view","char","charCode","keyCode","buttons","clientX","clientY","offsetX","offsetY","pointerId","pointerType","screenX","screenY","targetTouches","toElement","touches","which","mouseenter","mouseleave","pointerenter","pointerleave","orig","related","rxhtmlTag","rnoInnerhtml","rchecked","rcleanScript","manipulationTarget","disableScript","restoreScript","cloneCopyEvent","dest","pdataOld","pdataCur","udataOld","udataCur","fixInput","domManip","collection","hasScripts","iNoClone","valueIsFunction","html","_evalUrl","keepData","cleanData","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","detach","append","prepend","insertBefore","before","after","replaceWith","replaceChild","appendTo","prependTo","insertAfter","replaceAll","original","insert","rnumnonpx","getStyles","opener","getComputedStyle","rboxStyle","curCSS","computed","width","minWidth","maxWidth","getPropertyValue","pixelBoxStyles","addGetHookIf","conditionFn","hookFn","computeStyleTests","container","cssText","divStyle","pixelPositionVal","reliableMarginLeftVal","roundPixelMeasures","marginLeft","right","pixelBoxStylesVal","boxSizingReliableVal","position","scrollboxSizeVal","offsetWidth","measure","round","parseFloat","backgroundClip","clearCloneStyle","boxSizingReliable","pixelPosition","reliableMarginLeft","scrollboxSize","rdisplayswap","rcustomProp","cssShow","visibility","cssNormalTransform","letterSpacing","fontWeight","cssPrefixes","emptyStyle","finalPropName","cssProps","capName","vendorPropName","setPositiveNumber","subtract","max","boxModelAdjustment","dimension","box","isBorderBox","styles","computedVal","extra","delta","ceil","getWidthOrHeight","valueIsBorderBox","Tween","easing","cssHooks","opacity","animationIterationCount","columnCount","fillOpacity","flexGrow","flexShrink","lineHeight","order","orphans","widows","zIndex","zoom","origName","isCustomProp","setProperty","isFinite","getClientRects","getBoundingClientRect","left","margin","padding","border","prefix","suffix","expand","expanded","parts","propHooks","run","percent","eased","duration","pos","step","fx","scrollTop","scrollLeft","linear","swing","cos","PI","fxNow","inProgress","rfxtypes","rrun","schedule","hidden","requestAnimationFrame","interval","tick","createFxNow","genFx","includeWidth","height","createTween","animation","Animation","tweeners","properties","stopped","prefilters","currentTime","startTime","tweens","opts","specialEasing","originalProperties","originalOptions","gotoEnd","propFilter","complete","timer","anim","tweener","oldfire","propTween","restoreDisplay","isBox","dataShow","unqueued","overflow","overflowX","overflowY","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","slow","fast","time","checkOn","optSelected","radioValue","boolHook","removeAttr","nType","attrHooks","attrNames","getter","lowercaseName","rfocusable","rclickable","stripAndCollapse","getClass","classesToArray","removeProp","propFix","tabindex","parseInt","for","class","addClass","classes","curValue","clazz","finalValue","removeClass","toggleClass","stateVal","isValidValue","classNames","hasClass","rreturn","valHooks","optionSet","focusin","rfocusMorph","stopPropagationCallback","onlyHandlers","bubbleType","ontype","lastElement","eventPath","isTrigger","parentWindow","simulate","triggerHandler","attaches","nonce","rquery","parseXML","DOMParser","parseFromString","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","traditional","param","s","valueOrFunction","encodeURIComponent","serialize","serializeArray","r20","rhash","rantiCache","rheaders","rnoContent","rprotocol","transports","allTypes","originAnchor","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","jqXHR","seekingTransport","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","active","lastModified","etag","url","isLocal","protocol","processData","contentType","accepts","json","responseFields","converters","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","urlAnchor","fireGlobals","uncached","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","getAllResponseHeaders","setRequestHeader","overrideMimeType","mimeType","status","abort","statusText","finalText","crossDomain","host","hasContent","ifModified","headers","beforeSend","success","nativeStatusText","responses","isSuccess","response","modified","ct","finalDataType","firstDataType","ajaxHandleResponses","conv2","conv","dataFilter","throws","ajaxConvert","getJSON","getScript","wrapAll","firstElementChild","wrapInner","htmlIsFunction","unwrap","visible","offsetHeight","xhr","XMLHttpRequest","xhrSuccessStatus","xhrSupported","cors","errorCallback","open","username","xhrFields","onload","onabort","ontimeout","onreadystatechange","responseType","responseText","binary","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","createHTMLDocument","implementation","keepScripts","parsed","params","animated","offset","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","curElem","using","rect","win","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","hover","fnOver","fnOut","unbind","delegate","undelegate","proxy","holdReady","hold","parseJSON","isNumeric","isNaN","_jQuery","_$","$","ui","widgetUuid","widgetSlice","widget","existingConstructor","basePrototype","proxiedPrototype","fullName","Widget","element","_createWidget","_proto","_childConstructors","_super","_superApply","__super","__superApply","widgetEventPrefix","widgetName","widgetFullName","child","childPrototype","bridge","inputIndex","inputLength","isMethodCall","methodValue","instance","charAt","_init","defaultElement","uuid","eventNamespace","bindings","hoverable","focusable","classesElementLookup","_on","destroy","_getCreateOptions","_create","_setOptionDisabled","_trigger","_getCreateEventData","_destroy","_removeClass","curOption","_setOptions","_setOption","_setOptionClasses","classKey","currentElements","_classes","_toggleClass","enable","full","processClassString","checkOption","_untrackClassesElement","_addClass","suppressDisabledCheck","delegateElement","handlerProxy","eventName","_off","_delay","_hoverable","_focusable","focusout","defaultEffect","hasOptions","effect","effectName","effects","dataName","disableSelection","eventType","enableSelection","scrollParent","includeHidden","excludeStaticParent","overflowRegex","ie","navigator","userAgent","mouseHandled","cancel","distance","_mouseInit","_mouseDown","started","_mouseDestroy","_mouseMoveDelegate","_mouseUpDelegate","_mouseMoved","_mouseStarted","_mouseUp","_mouseDownEvent","btnIsLeft","elIsCancel","_mouseCapture","mouseDelayMet","_mouseDelayTimer","_mouseDistanceMet","_mouseDelayMet","_mouseStart","_mouseMove","documentMode","ignoreMissingWhich","_mouseDrag","_mouseStop","abs","plugin","plugins","allowDisconnected","mouse","alsoResize","animateDuration","animateEasing","aspectRatio","autoHide","containment","ghost","grid","handles","helper","maxHeight","minHeight","resize","_num","_isNumber","_hasScroll","scroll","margins","o","_aspectRatio","originalElement","_proportionallyResizeElements","_helper","outerWidth","outerHeight","resizable","elementIsWrapper","marginTop","marginRight","marginBottom","originalResizeStyle","_proportionallyResize","_setupHandles","_handles","resizing","wrapper","exp","_removeHandles","hname","axis","se","sw","ne","nw","_renderAxis","padPos","padWrapper","mousedown","capture","curleft","curtop","cursor","_renderProxy","size","originalSize","sizeDiff","originalPosition","originalMousePosition","_propagate","smp","dx","dy","_change","_updatePrevProperties","_updateVirtualBoundaries","_updateRatio","_respectSize","_updateCache","_applyChanges","pr","ista","soffseth","soffsetw","prevPosition","prevSize","forceAspectRatio","pMinWidth","pMaxWidth","pMinHeight","pMaxHeight","Infinity","_vBoundaries","cpos","csize","ismaxw","ismaxh","isminw","isminh","dw","dh","cw","_getPaddingPlusBorderDimensions","widths","borders","paddings","prel","outerDimensions","elementOffset","cs","co","oc","ce","containerElement","containerOffset","containerPosition","parentData","scrollHeight","containerSize","innerHeight","innerWidth","scrollWidth","hoset","isParent","isOffsetRelative","cp","pRatio","cop","continueResize","ho","h","os","sum","uiBackCompat","gridX","gridY","ox","oy","newWidth","newHeight","isMaxWidth","isMaxHeight","isMinWidth","isMinHeight","connectWith","cursorAt","dropOnEmpty","forcePlaceholderSize","forceHelperSize","items","placeholder","revert","scrollSensitivity","scrollSpeed","scope","tolerance","activate","beforeStop","change","deactivate","out","over","receive","update","_isOverAxis","reference","_isFloating","item","containerCache","refresh","_setHandleClassName","overrideHandle","currentItem","validHandle","reverting","_refreshItems","_removeCurrentsFromItems","noActivation","currentContainer","refreshPositions","_createHelper","_cacheHelperProportions","_cacheMargins","_getParentOffset","_getRelativeOffset","cssPosition","_generatePosition","originalPageX","originalPageY","_adjustOffsetFromHelper","domPosition","_createPlaceholder","_setContainment","storedCursor","storedStylesheet","_storedOpacity","_storedZIndex","tagName","overflowOffset","_uiHash","_preserveHelperProportions","containers","ddmanager","dropBehaviour","prepareOffsets","dragging","itemElement","intersection","scrolled","positionAbs","_convertPositionTo","lastPositionAbs","_intersectsWithPointer","direction","_intersectsWithSides","_rearrange","_contactContainers","drag","noPropagation","drop","_clear","_storedCSS","_noFinalSort","_getItemsAsjQuery","connected","str","res","attribute","expression","_intersectsWith","x1","x2","helperProportions","y1","y2","r","dyClick","dxClick","isOverElementHeight","isOverElementWidth","isOverElement","forcePointerForContainers","floating","verticalDirection","horizontalDirection","_getDragVerticalDirection","_getDragHorizontalDirection","isOverBottomHalf","isOverRightHalf","_connectWith","inst","queries","addItems","targetData","_queries","queriesLength","toleranceElement","custom","refreshContainers","_createTrPlaceholder","sourceTr","targetTr","dist","itemWithLeastDistance","posProperty","sizeProperty","nearBottom","innermostContainer","innermostIndex","bottom","po","d","mod","scrollIsRootNode","hardRefresh","counter","delayedTriggers","delayEvent","fromOutside","c","cancelHelperRemoval","_inst","sender","baseEasings","dataSpace","dataSpaceStyle","dataSpaceAnimated","colors","rplusequals","stringParsers","re","execResult","space","color","Color","green","blue","alpha","spaces","rgba","red","hsla","hue","saturation","lightness","propTypes","byte","floor","degrees","supportElem","clamp","allowEmpty","def","stringParse","_rgba","parser","spaceName","transparent","hue2rgb","q","backgroundColor","from","same","localCache","isCache","_space","used","transition","other","startColor","startValue","endValue","blend","opaque","rgb","toRgbaString","toHslaString","toHexString","includeAlpha","g","min","local","vtype","_hsla","colorInit","borderColor","part","names","aqua","black","fuchsia","gray","lime","maroon","navy","olive","purple","silver","teal","white","yellow","classAnimationActions","shorthandStyles","borderBottom","borderLeft","borderRight","borderTop","borderWidth","getElementStyles","currentStyle","setAttr","animateClass","applyClassChange","baseClass","allAnimations","action","oldStyle","newStyle","styleDifference","styleInfo","dfd","force","switchClass","_normalizeArguments","standardAnimationOption","parseClip","save","restore","setMode","mode","createWrapper","float","fontSize","background","removeWrapper","scaledDimensions","clipToBox","clip","queueLength","saveStyle","restoreStyle","getBaseline","origin","createPlaceholder","removePlaceholder","dataKey","cleanUp","setTransition","factor","cssUnit","effectMethod","defaultMode","queueName","modes","normalizedMode","cssClip","clipObj","transfer","targetFixed","fixTop","fixLeft","endPosition","startPosition","clipInit","pow","Sine","Circ","sqrt","Elastic","sin","Back","Bounce","pow2","bounce","easeIn","upAnim","downAnim","refValue","times","anims","ref","motion","queuelen","require","minicolors","panel","showSpeed","hideSpeed","move","wx","wy","phi","picker","animationSpeed","atan2","animationEasing","updateFromControl","getCoords","brightness","hex","swatch","slider","opacitySlider","gridPicker","sliderPicker","opacityPicker","gridPos","sliderPos","opacityPos","control","keepWithin","hsb2hex","convertCase","letterCase","toFixed","doChange","updateFromInput","preserveInputValue","hsb","parseHex","rgb2hsb","hex2rgb","hex2hsb","lastChange","changeDelay","t1","t2","t3","hsb2rgb","nr","defaults","dataUris","inline","theme","rgbObject","rgbString","touch","touchHandled","mouseProto","_touchStart","_touchMoved","simulateMouseEvent","_touchMove","_touchEnd","touchstart","touchmove","touchend","simulatedType","simulatedEvent","createEvent","initMouseEvent","dispatchEvent","minErrConfig","objectMaxDepth","errorHandlingConfig","config","isObject","isDefined","isValidObjectMaxDepth","NaN","isNumber","minErr","ErrorConstructor","regex","errRegExp","paramPrefix","template","templateArgs","sliceArgs","toDebugString","REGEX_STRING_REGEXP","VALIDITY_STATE_PROPERTY","lowercase","isString","uppercase","msie","jqLite","angularModule","ngMinErr","angular","forEach","isPrimitive","isBlankObject","forEachSorted","reverseParams","iteratorFn","nextUid","setHashKey","$$hashKey","baseExtend","dst","objs","ii","jj","isDate","isRegExp","isElement","toInt","isNumberNaN","inherit","identity","valueFn","hasCustomToString","isUndefined","$inject","isError","isScope","$evalAsync","$watch","isBoolean","isPromiseLike","TYPED_ARRAY_REGEXP","escapeForRegexp","nodeName_","includes","arrayRemove","destination","stackSource","stackDest","copyRecurse","copyElement","needsRecurse","buffer","byteOffset","copied","ArrayBuffer","byteLength","Uint8Array","lastIndex","copyType","simpleCompare","equals","o1","o2","keySet","getTime","createMap","csp","rules","ngCspElement","querySelector","ngCspAttribute","noUnsafeEval","noInlineStyle","jq","name_","ngAttrPrefixes","array1","array2","startIndex","curryArgs","toJsonReplacer","toJson","pretty","stringify","fromJson","ALL_COLONS","timezoneToOffset","timezone","requestedTimezoneOffset","addDateMinutes","date","minutes","setMinutes","getMinutes","convertTimezoneToLocal","dateTimezoneOffset","getTimezoneOffset","startingTag","elemHtml","NODE_TYPE_TEXT","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","toKeyValue","arrayValue","encodeUriQuery","encodeUriSegment","pctEncodeSpaces","isAutoBootstrapAllowed","currentScript","HTMLScriptElement","SVGScriptElement","getNamedItem","every","link","allowAutoBootstrap","angularInit","appElement","hasAttribute","candidate","strictDi","ngAttr","getNgAttribute","modules","doBootstrap","injector","$provide","debugInfoEnabled","$compileProvider","createInjector","$apply","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","reload","getTestability","rootElement","SNAKE_CASE_REGEXP","snake_case","separator","bindJQueryFired","assertArg","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","path","bindFnToScope","lastInstance","getBlockNodes","blockNodes","endNode","shallowCopy","seen","serializeObject","major","minor","dot","codeName","JQLite","jqCache","jqId","DASH_LOWERCASE_REGEXP","MS_HACK_REGEXP","MOUSE_EVENT_MAP","jqLiteMinErr","fnCamelCaseReplace","kebabToCamel","SINGLE_TAG_REGEXP","HTML_REGEXP","TAG_NAME_REGEXP","XHTML_TAG_REGEXP","jqLiteIsTextNode","jqLiteAcceptsData","jqLiteBuildFragment","jqLiteContains","Node","argIsString","jqLiteAddNodes","jqLiteReady","jqLiteClone","jqLiteDealoc","onlyDescendants","jqLiteOff","unsupported","expandoStore","jqLiteExpandoStore","removeHandler","listenerFns","jqLiteRemoveData","expandoId","ng339","$destroy","createIfNecessary","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","jqLiteRemoveClass","cssClasses","existingClasses","newClasses","cssClass","jqLiteAddClass","jqLiteController","jqLiteInheritedData","jqLiteEmpty","jqLiteRemove","JQLitePrototype","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","ALIASED_ATTR","ngMinlength","ngMaxlength","ngMin","ngMax","ngPattern","ngStep","getBooleanAttrName","booleanAttr","defaultHandlerWrapper","specialMouseHandlerWrapper","$$jqLiteProvider","$get","hashKey","nextUidFn","objType","inheritedData","isolateScope","controller","cssKebabToCamel","lowercasedName","isBooleanAttr","$dv","multiple","arg1","arg2","nodeCount","eventHandler","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","handlerWrapper","specialHandlerWrapper","createEventHandler","addHandler","noEventListener","onFn","replaceNode","wrapNode","newElement","condition","classCondition","nextElementSibling","extraParameters","dummyEvent","eventFnsCopy","handlerArgs","arg3","nanKey","NgMapShim","_keys","_values","_lastKey","_lastIndex","_idx","_transformKey","NgMap","$$MapProvider","ARROW_ARG","FN_ARGS","FN_ARG_SPLIT","FN_ARG","STRIP_COMMENTS","$injectorMinErr","stringifyFn","extractArgs","fnText","modulesToLoad","INSTANTIATING","providerSuffix","loadedModules","providerCache","provider","supportObject","service","$injector","instantiate","constant","instanceCache","decorator","serviceName","decorFn","origProvider","providerInjector","orig$get","origInstance","instanceInjector","$delegate","createInternalInjector","caller","protoInstanceInjector","runBlocks","loadModules","loadNewModules","mods","provider_","enforceReturnValue","factoryFn","enforce","moduleFn","requires","_runBlocks","runInvokeQueue","_invokeQueue","_configBlocks","invokeArgs","getService","injectionArgs","locals","$$annotate","$$ngIsClass","isClass","ctor","annotate","$AnchorScrollProvider","autoScrollingEnabled","disableAutoScrolling","$window","$location","$rootScope","scrollIntoView","yOffset","getYOffset","elemTop","scrollBy","elm","some","newVal","oldVal","anonFn","underscore","$animateMinErr","NG_ANIMATE_CLASSNAME","mergeClasses","prepareAnimateOptions","$$CoreAnimateJsProvider","$$CoreAnimateQueueProvider","postDigestQueue","postDigestElements","$$AnimateRunner","pin","domOperation","classesAdded","updateData","classesRemoved","$$postDigest","handleCSSClassChanges","addRemoveClassesPostDigest","runner","changed","existing","klass","splitClasses","toAdd","toRemove","$AnimateProvider","classNameFilter","customFilter","$$registeredAnimations","register","substr","filterFn","reservedRegex","$$animateQueue","domInsert","parentElement","afterElement","afterNode","extractElementNode","previousElementSibling","leave","addclass","setClass","tempClasses","$$AnimateAsyncRunFactoryProvider","$$rAF","waitQueue","waitForTick","passed","$$AnimateRunnerFactoryProvider","$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout","AnimateRunner","setHost","rafTick","_doneCallbacks","_tick","timeoutTick","_state","chain","runners","getPromise","resolveHandler","rejectHandler","finally","pause","resume","_resolve","$CoreAnimateCssProvider","initialOptions","$$prepared","cleanupStyles","closed","applyAnimationContents","Browser","$log","history","pendingDeferIds","isMock","outstandingRequestCount","outstandingRequestCallbacks","completeOutstandingRequest","$$completeOutstandingRequest","$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","cachedState","lastHistoryState","lastBrowserUrl","baseElement","pendingLocation","getCurrentState","cacheState","sameState","sameBase","stripHash","getHash","urlChangeListeners","urlChangeInit","cacheStateAndFireUrlChange","fireStateOrUrlChange","lastCachedState","prevLastHistoryState","listener","onUrlChange","$$applicationDestroyed","$$checkUrlChange","baseHref","deferId","$BrowserProvider","$document","$CacheFactoryProvider","caches","cacheFactory","cacheId","stats","capacity","MAX_VALUE","lruHash","freshEnd","staleEnd","put","lruEntry","removeAll","info","entry","nextEntry","prevEntry","$TemplateCacheProvider","$cacheFactory","$compileMinErr","_UNINITIALIZED_VALUE","$CompileProvider","$$sanitizeUriProvider","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","makeMap","REQUIRE_PREFIX_REGEXP","EVENT_HANDLER_ATTR_REGEXP","bindingCache","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","scopeName","optional","attrName","parseDirectiveBindings","directive","bindToController","registerDirective","directiveFactory","assertValidDirectiveName","$exceptionHandler","directives","priority","getDirectiveRequire","restrict","getDirectiveRestrict","$$moduleName","component","registerComponent","makeInjectable","tElement","tAttrs","$element","$attrs","templateUrl","ddo","controllerAs","identifierForController","transclude","aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","preAssignBindingsEnabled","strictComponentBindingsEnabled","TTL","onChangesTtl","commentDirectivesEnabledConfig","commentDirectivesEnabled","cssClassDirectivesEnabledConfig","cssClassDirectivesEnabled","$interpolate","$templateRequest","$parse","$controller","$sce","$animate","$$sanitizeUri","onChangesQueue","SIMPLE_ATTR_NAME","specialAttrHolder","flushOnChangesQueue","Attributes","attributesToCopy","$attr","$$element","safeAddClass","$normalize","directiveNormalize","$addClass","classVal","$removeClass","$updateClass","oldClasses","tokenDifference","$set","writeAttr","booleanKey","aliasedKey","observer","trimmedSrcset","rawUris","nbrUrisWith2parts","innerIdx","lastTuple","removeNamedItem","setNamedItem","setSpecialAttr","$$observers","$observe","listeners","$$inter","startSymbol","endSymbol","denormalizeTemplate","NG_ATTR_BINDING","MULTI_ELEMENT_DIR_RE","$$addBindingInfo","binding","$$addBindingClass","$$addScopeInfo","isolated","noTemplate","$$addScopeClass","$$createComment","comment","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","compositeLinkFn","compileNodes","cloneConnectFn","needsNewScope","$parent","$new","$linkNode","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","wrapTemplate","controllerName","nodeList","$rootElement","nodeLinkFn","childLinkFn","linkFnFound","nodeLinkFnFound","linkFns","notLiveList","mergeConsecutiveTextNodes","collectDirectives","applyDirectivesToNode","terminal","transcludeOnThisElement","templateOnThisElement","childScope","childBoundTranscludeFn","stableNodeList","nodeListLength","createBoundTranscludeFn","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","boundSlots","$$slots","slotName","attrsMap","addDirective","nName","ngAttrName","isNgAttr","nAttrs","attrStartName","attrEndName","PREFIX_REGEXP","multiElementMatch","directiveIsMultiElement","addAttrInterpolateDirective","animVal","interpolateFn","templateNode","templateNodeParent","hasCompileParent","expressions","addTextInterpolateDirective","collectCommentDirectives","byPriority","groupScan","attrStart","attrEnd","groupElementsLinkFnWrapper","linkFn","compilationGenerator","eager","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","$template","directiveValue","terminalPriority","newScopeDirective","controllerDirectives","newIsolateScopeDirective","templateDirective","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","hasElementTranscludeDirective","$compileNode","replaceDirective","childTranscludeFn","didScanForMultipleTransclusion","mightHaveMultipleTransclusionError","$$start","$$end","assertNoDuplicate","$$tlb","candidateDirective","scanningIndex","$$parentNode","slots","slotMap","filledSlots","elementSelector","filled","$$isolateScope","$$newScope","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectiveScope","mergeTemplateAttributes","compileTemplateUrl","$$originalDirective","addLinkFns","pre","cloneAndAnnotateFn","linkNode","controllerScope","elementControllers","scopeBindingInfo","cloneAttachFn","scopeToChild","slotTranscludeFn","isSlotFilled","controllerKey","$scope","$transclude","controllerInstance","setupControllers","$$isolateBindings","initializeDirectiveBindings","removeWatches","$on","controllerDirective","$$bindings","bindingInfo","controllerResult","getControllers","$onChanges","initialChanges","$onInit","$doCheck","$onDestroy","invokeLinkFn","$postLink","inheritType","property","newScope","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","linkQueue","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","ignoreChildLinkFn","previousDirective","wrapModuleNameIfDefined","moduleName","trustedContext","attrNormalizedName","HTML","RESOURCE_URL","getTrustedContext","mustHaveExpression","allOrNothing","$$scope","oldValue","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","annotation","strictBindingsCheck","changes","removeWatchCollection","recordChanges","previousValue","triggerOnChangesHook","SimpleChange","lastValue","parentGet","parentSet","removeWatch","literal","assign","parentValueWatch","parentValue","$stateful","$watchCollection","deepWatch","initialValue","previous","isFirstChange","SPECIAL_CHARS_REGEXP","str1","str2","tokens1","tokens2","outer","jqNodes","$controllerMinErr","CNTRL_REG","ident","$ControllerProvider","globals","allowGlobals","later","controllerPrototype","addIdentifier","$DocumentProvider","$$IsDocumentHiddenProvider","changeListener","$ExceptionHandlerProvider","cause","$$ForceReflowProvider","domNode","APPLICATION_JSON","CONTENT_TYPE_APPLICATION_JSON","JSON_START","JSON_ENDS","JSON_PROTECTION_PREFIX","$httpMinErr","serializeValue","toISOString","$HttpParamSerializerProvider","$HttpParamSerializerJQLikeProvider","toSerialize","topLevel","defaultHttpResponseTransform","tempData","hasJsonContentType","jsonStart","parseHeaders","fillInParsed","headerVal","headerKey","headersGetter","headersObj","transformData","$HttpProvider","transformResponse","transformRequest","isBlob","isFormData","common","Accept","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","jsonpCallbackParam","useApplyAsync","interceptorFactories","interceptors","xsrfWhitelistedOrigins","$browser","$httpBackend","$$cookieReader","defaultCache","reversedInterceptors","interceptorFactory","parsedAllowedOriginUrls","urlIsAllowedOrigin","originUrl","urlResolve","requestUrl","parsedUrl","urlsAreSameOrigin","$http","requestConfig","defHeaderName","lowercaseDefHeaderName","reqHeaderName","defHeaders","reqHeaders","defaultHeadersIteration","headerContent","processedHeaders","headerFn","executeHeaderFns","mergeHeaders","requestInterceptors","responseInterceptors","interceptor","request","requestError","responseError","chainInterceptors","reqData","withCredentials","cachedResp","isJsonp","getTrustedResourceUrl","serializedParams","buildUrl","cbKey","sanitizeJsonpCallbackParam","pendingRequests","removePendingReq","resolvePromiseWithResult","resolvePromise","xsrfValue","createApplyHandlers","eventHandlers","uploadEventHandlers","applyHandlers","callEventHandler","$applyAsync","$$phase","headersString","xhrStatus","resolveHttpPromise","sendReq","thenFn","rejectFn","resp","createShortMethods","createShortMethodsWithData","$xhrFactoryProvider","$HttpBackendProvider","$jsonpCallbacks","$xhrFactory","createXhr","$browserDefer","callbacks","rawDocument","callbackPath","createCallback","jsonpDone","jsonpReq","getResponse","completeRequest","removeCallback","abortedByTimeout","requestAborted","requestTimeout","upload","timeoutRequest","$$timeoutId","wasCalled","createHttpBackend","$interpolateMinErr","$InterpolateProvider","startSymbolLength","endSymbolLength","escapedStartRegexp","escapedEndRegexp","unescapeText","constantWatchDelegate","objectEquality","constantInterp","unwatch","$$watchDelegate","endIndex","parseFns","textLength","expressionPositions","parseStringifyInterceptor","throwNoconcat","compute","getValue","getTrusted","interr","$watchGroup","oldValues","currValue","$IntervalProvider","$$q","intervals","invokeApply","hasParams","setInterval","clearInterval","iteration","skipApply","$$intervalId","markQExceptionHandled","$jsonpCallbacksProvider","callbackMap","callbackId","$$counter","called","PATH_MATCH","DEFAULT_PORTS","http","https","ftp","$locationMinErr","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","$$protocol","$$host","hostname","$$port","port","DOUBLE_SLASH_REGEX","parseAppUrl","html5Mode","prefixed","pathname","$$path","decodePath","$$search","search","$$hash","startsWith","stripBaseUrl","trimEmptyHash","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","pathUrl","$$compose","$$url","$$absUrl","$$urlUpdatedByLocation","$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutHashUrl","withoutBaseUrl","firstPathSegmentMatch","windowsFilePathExp","removeWindowsDriveName","LocationHashbangInHtml5Url","locationPrototype","$$replace","absUrl","locationGetter","locationGetterSetter","paramValue","preprocess","$LocationProvider","requireBase","rewriteLinks","LocationMode","initialUrl","lastIndexOf","stripFile","$$state","IGNORE_URI_REGEXP","setBrowserUrlWithFallback","oldUrl","oldState","absHref","initializing","newUrl","newState","$broadcast","afterLocationChange","$digest","currentReplace","urlOrStateChanged","$LogProvider","debug","debugEnabled","formatStackTrace","log","consoleLog","formatError","sourceURL","logFn","Location","$parseMinErr","objectValueOf","getStringValue","OPERATORS","ESCAPE","Lexer","lex","readString","peek","readNumber","isIdentifierStart","peekMultichar","readIdent","isWhitespace","ch2","ch3","op1","op2","op3","throwError","chars","codePointAt","isValidIdentifierStart","isIdentifierContinue","isValidIdentifierContinue","cp1","cp2","isExpOperator","colStr","number","peekCh","quote","rawString","AST","lexer","ifDefined","plusFn","Program","ExpressionStatement","AssignmentExpression","ConditionalExpression","LogicalExpression","BinaryExpression","UnaryExpression","CallExpression","MemberExpression","Identifier","Literal","ArrayExpression","Property","ObjectExpression","ThisExpression","LocalsExpression","NGValueParameter","ast","program","expressionStatement","expect","filterChain","assignment","ternary","isAssignable","alternate","consequent","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","primary","arrayDeclaration","selfReferential","literals","callee","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","$locals","findConstantAndWatchExpressions","$filter","parentIsPure","allConstants","argsToWatch","isStatelessFilter","astIsPure","isPure","toWatch","filterName","isStateless","getInputs","lastExpression","assignableAST","ASTCompiler","ASTInterpreter","Parser","astCompiler","getValueOf","$ParseProvider","identStart","identContinue","true","false","null","addLiteral","literalName","literalValue","setIdentifierFns","identifierStart","identifierContinue","$parseOptions","$$getAst","getAst","interceptorFn","parsedExpression","cacheKey","oneTime","oneTimeLiteralWatchDelegate","oneTimeWatchDelegate","inputs","inputsWatchDelegate","addInterceptor","expressionInputDirtyCheck","oldValueOfValue","compareObjectIdentity","prettyPrintExpression","lastResult","inputExpressions","oldInputValueOf","newInputValue","oldInputValueOfValues","oldInputValues","oneTimeListener","isAllDefined","allDefined","watchDelegate","useInputs","$QProvider","errorOnUnhandledRejections","qFactory","$$QProvider","exceptionHandler","$qMinErr","queueSize","checkQueue","rejectPromise","notifyPromise","processChecks","toCheck","isStateExceptionHandled","markQStateExceptionHandled","errorMessage","scheduleProcessQueue","pending","processScheduled","$$passToExceptionHandler","processQueue","$$reject","$$resolve","doReject","handleCallback","callbackOutput","progressBack","$Q","pur","$$RAFProvider","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","supported","$RootScopeProvider","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","destroyChildScope","$event","currentScope","cleanUpScope","$$childHead","$$nextSibling","$$prevSibling","$$childTail","$root","$$watchers","Scope","$id","$$suspended","$$listeners","$$listenerCount","$$watchersCount","isolate","$$ChildScope","ChildScope","createChildScopeClass","watchExp","watcher","initWatchVal","$$digestWatchIndex","incrementWatchersCount","watchExpressions","newValues","deregisterFns","changeReactionScheduled","firstRun","shouldCall","watchGroupAction","unwatchFn","$watchCollectionInterceptor","veryOldValue","trackVeryOldValue","changeDetected","changeDetector","internalArray","internalObject","initRun","oldLength","_value","newLength","newItem","oldItem","watch","watchers","dirty","logIdx","asyncTask","ttl","watchLog","beginPhase","flushApplyAsync","asyncQueuePosition","asyncQueue","traverseScopesLoop","clearPhase","postDigestQueuePosition","$suspend","$isSuspended","$resume","decrementListenerCount","$eval","applyAsyncQueue","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","phase","$$SanitizeUriProvider","uri","isImage","normalizedVal","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","stringEscapeFn","stringEscapeRegex","lhs","isLiteral","isConstant","$sceMinErr","SCE_CONTEXTS","CSS","URL","JS","UNDERSCORE_LOWERCASE_REGEXP","snakeToCamel","adjustMatchers","adjustedMatchers","adjustMatcher","$SceDelegateProvider","resourceUrlWhitelist","resourceUrlBlacklist","htmlSanitizer","matchUrl","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","trustedValueHolderBase","byType","trustAs","Constructor","maybeTrusted","allowed","isResourceUrlAllowedByPolicy","$SceProvider","$sceDelegate","sce","isEnabled","parseAs","enumValue","lName","$SnifferProvider","eventSupport","hasHistoryPushState","chrome","app","runtime","pushState","android","boxee","bodyStyle","transitions","animations","hasEvent","divElm","$templateRequestMinErr","$TemplateRequestProvider","httpOptions","$templateCache","handleRequestFn","tpl","ignoreRequestError","totalPendingRequests","transformer","$$TestabilityProvider","testability","opt_exactMatch","dataBinding","bindingName","prefixes","$TimeoutProvider","deferreds","urlParsingNode","url1","url2","$WindowProvider","$$CookieReader","lastCookies","lastCookieString","safeDecodeURIComponent","cookieArray","cookie","currentCookieString","safeGetCookie","$$CookieReaderProvider","$FilterProvider","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","anyPropertyKey","predicateFn","matchAgainstAnyProp","getTypeForFilter","shouldMatchPrimitives","actual","expected","deepCompare","createPredicateFn","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","currencySymbolRe","formatNumber","GROUP_SEP","DECIMAL_SEP","groupSep","decimalSep","parsedNumber","isInfinity","isZero","numStr","formattedText","digits","numberOfIntegerDigits","zeros","exponent","MAX_DIGITS","minFrac","fractionLen","roundAt","digit","k","carry","reduceRight","roundNumber","integerLen","decimals","lgSize","gSize","negPre","negSuf","posPre","posSuf","padNumber","negWrap","neg","dateGetter","dateStrGetter","shortForm","standAlone","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","weekGetter","datetime","firstThurs","getFullYear","getMonth","getDate","eraGetter","ERAS","DATE_FORMATS","yyyy","yy","MMMM","MMM","MM","M","LLLL","dd","HH","H","hh","mm","ss","sss","EEEE","EEE","getHours","AMPMS","Z","zone","paddedZone","ww","G","GG","GGG","GGGG","ERANAMES","DATE_FORMATS_SPLIT","NUMBER_STRING","R_ISO8601_STR","format","DATETIME_FORMATS","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","jsonStringToDate","spacing","limit","begin","sliceFn","sortPredicate","reverseOrder","compareFn","predicates","predicate","descending","defaultCompare","compareValues","tieBreaker","predicateValues","objectValue","getPredicateValue","v1","v2","type1","type2","value1","value2","ngDirective","htmlAnchorDirective","xlinkHref","ngAttributeAliasDirectives","propName","normalized","defaultLinkFn","ngModel","htmlAttr","nullFormCtrl","$addControl","$$renameControl","$name","$removeControl","$setValidity","$setDirty","$setPristine","$setSubmitted","PENDING_CLASS","SUBMITTED_CLASS","FormController","$$controls","$error","$$success","$pending","ngForm","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","$$animate","setupValidity","$rollbackViewValue","$commitViewValue","newName","oldName","PRISTINE_CLASS","DIRTY_CLASS","$setUntouched","addSetValidityMethod","unset","formDirectiveFactory","isNgForm","formElement","VALID_CLASS","nameAttr","ctrls","handleFormSubmission","getSetter","formDirective","ngFormDirective","$$classCache","INVALID_CLASS","cachedToggleClass","ctrl","switchValue","toggleValidationCss","validationErrorKey","isValid","combinedState","createAndSet","isObjectEmpty","unsetAndCleanup","ISO_DATE_REGEXP","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","DATE_REGEXP","DATETIMELOCAL_REGEXP","WEEK_REGEXP","MONTH_REGEXP","TIME_REGEXP","PARTIAL_VALIDATION_TYPES","inputType","baseInputType","stringBasedInputType","createDateInputType","createDateParser","week","isoWeek","existingDate","hours","seconds","milliseconds","addDays","getSeconds","getMilliseconds","month","minVal","maxVal","badInputChecker","numberFormatterParser","$validators","$isEmpty","parseNumberAttrVal","$validate","stepVal","modelValue","viewValue","isValidForStep","$$parserName","email","doTrim","ngTrim","ev","$setViewValue","$render","$viewValue","range","supportsRange","$$hasNativeValidators","validity","hasMinAttr","hasMaxAttr","hasStepAttr","originalRender","rangeUnderflow","rangeOverflow","setInitialValueAndObserver","$modelValue","elVal","stepMismatch","htmlAttrName","changeFn","trueValue","parseConstantExpr","ngTrueValue","falseValue","ngFalseValue","$formatters","$parsers","composing","deferListener","origValue","origBadInput","badInput","origTypeMismatch","typeMismatch","mapping","iso","parseDate","previousDate","previousTimezone","parseDateAndConvertTimeZoneToLocal","ngModelMinErr","isValidDate","$options","getOption","parseObservedDateValue","parsedDate","isNumberInteger","countDecimals","numString","decimalSymbolIndex","stepBase","isNonIntegerValue","isNonIntegerStepBase","isNonIntegerStep","valueDecimals","stepBaseDecimals","stepDecimals","decimalCount","multiplier","parseFn","inputDirective","CONSTANT_VALUE_REGEXP","ngValueDirective","updateElementValue","propValue","tplAttr","ngValue","ngBindDirective","$compile","templateElement","ngBind","ngBindTemplateDirective","ngBindTemplate","ngBindHtmlDirective","ngBindHtmlGetter","ngBindHtml","ngBindHtmlWatch","getTrustedHtml","ngChangeDirective","$viewChangeListeners","ngChange","classDirective","indexWatchExpression","oldClassString","isOneTime","watchExpression","toFlatValue","toClassString","watchAction","newClassValue","newClassString","ngClassWatchAction","classCounts","oldModulo","digestClassCounts","classArray","classesToUpdate","oldClassArray","newClassArray","toRemoveArray","arrayDifference","toAddArray","toRemoveString","toAddString","updateClasses","$index","newModulo","classString","removeClasses","classValue","flatValue","hasUndefined","ngClassDirective","ngClassOddDirective","ngClassEvenDirective","ngCloakDirective","ngControllerDirective","ngEventDirectives","forceAsyncEvents","ngIfDirective","block","previousElements","ngIf","ngIncludeDirective","$anchorScroll","srcExp","ngInclude","onloadExp","autoScrollExp","autoscroll","previousElement","currentElement","changeCounter","cleanupLastIncludeContent","afterAnimation","thisChangeId","ngIncludeFillContentDirective","ngInitDirective","ngInit","ngListDirective","ngList","trimValues","UNTOUCHED_CLASS","TOUCHED_CLASS","EMPTY_CLASS","NOT_EMPTY_CLASS","NgModelController","$$rawModelValue","$asyncValidators","$untouched","$touched","defaultModelOptions","$$updateEvents","$$updateEventHandler","$$parsedNgModel","$$parsedNgModelAssign","$$ngModelGet","$$ngModelSet","$$pendingDebounce","$$parserValid","$$currentValidationRunId","$$attr","$$timeout","$$exceptionHandler","$$setModelValue","$$initGetterSetters","invokeModelGetter","invokeModelSetter","$$$p","$$updateEmptyClasses","$setTouched","$$lastCommittedViewValue","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","doneCallback","validatorPromises","localValidationRunId","errorKey","setValidity","processParseErrors","syncValidatorsValid","validator","Boolean","processSyncValidators","validationDone","$$parseAndValidate","writeToModelIfNeeded","$$debounceViewValueCommit","debounceDelay","$overrideModelOptions","createChild","$$setUpdateOnEvents","$processModelValue","$$format","formatters","ngModelDirective","modelCtrl","formCtrl","optionsCtrl","setTouched","DEFAULT_REGEXP","ModelOptions","$$options","inheritAll","updateOnDefault","updateOn","debounce","getterSetter","ngModelOptionsDirective","NgModelOptionsController","$$attrs","parentOptions","parentCtrl","modelOptionsDefinition","ngModelOptions","ngNonBindableDirective","ngOptionsMinErr","NG_OPTIONS_REGEXP","ngOptionsDirective","optionTemplate","optGroupTemplate","selectElement","registerOption","selectCtrl","ngModelCtrl","hasEmptyOption","emptyOption","providedEmptyOption","ngOptions","optionsExp","valueName","keyName","selectAs","trackBy","viewValueFn","trackByFn","getTrackByValueFn","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","Option","selectValue","label","group","getOptionValuesKeys","optionValues","optionValuesKeys","itemKey","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","parseOptionsExpression","listFragment","addOptionElement","optionElement","updateOptionElement","getAndUpdateSelectedOption","generateUnknownOptionValue","writeValue","selectedOptions","readValue","selectedValues","selections","selectedOption","removeUnknownOption","selectUnknownOrEmptyOption","unselectEmptyOption","optionScope","optionEl","needsRerender","$isEmptyOptionSelected","groupElementMap","groupElement","nextValue","ngPluralizeDirective","BRACE","IS_WHEN","lastCount","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","updateElementText","newText","attributeName","tmpMatch","whenKey","countIsNaN","pluralCat","whenExpFn","ngRepeatDirective","NG_REMOVED","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","getBlockStart","getBlockEnd","ngRepeat","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","ngShowDirective","ngShow","ngHideDirective","ngHide","ngStyleDirective","ngStyle","newStyles","oldStyles","ngSwitchDirective","cases","ngSwitchController","watchExpr","ngSwitch","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","selectedTransclude","caseElement","selectedScope","anchor","ngSwitchWhenDirective","ngSwitchWhen","ngSwitchWhenSeparator","whenCase","ngSwitchDefaultDirective","ngTranscludeMinErr","ngTranscludeDirective","fallbackLinkFn","ngTransclude","ngTranscludeSlot","useFallbackContent","notWhitespace","scriptDirective","noopNgModelController","setOptionSelectedStatus","SelectController","optionsMap","unknownOption","renderUnknownOption","unknownVal","updateUnknownOption","selectEmptyOption","realVal","hasOption","currentlySelectedOption","hashedVal","addOption","scheduleRender","removeOption","$hasEmptyOption","$isUnknownOptionSelected","renderScheduled","updateScheduled","scheduleViewValueUpdate","renderAfter","optionAttrs","interpolateValueFn","interpolateTextFn","removal","previouslySelected","removeValue","selectDirective","shouldBeSelected","lastView","lastViewRef","optionDirective","selectCtrlName","requiredDirective","required","patternDirective","patternExp","maxlengthDirective","maxlength","intVal","minlengthDirective","minlength","originalCleanData","jqName","bindJQuery","$$minErr","$$csp","$$encodeUriSegment","$$encodeUriQuery","$$stringify","ensure","configFn","invokeQueue","configBlocks","invokeLater","moduleInstance","invokeLaterAndSetModuleName","insertMethod","recipeName","factoryFunction","setupModuleLoader","textarea","form","ngClass","ngClassEven","ngClassOdd","ngCloak","ngController","ngNonBindable","ngPluralize","ngSwitchDefault","ngRequired","$animateCss","$$animateJs","$$forceReflow","$interval","$httpParamSerializer","$httpParamSerializerJQLike","$$testability","$$jqLite","$$Map","angularVersion","publishExternalAPI","PLURAL_CATEGORY","DAY","FIRSTDAYOFWEEK","MONTH","SHORTDAY","SHORTMONTH","STANDALONEMONTH","WEEKENDRANGE","fullDate","longDate","medium","mediumDate","mediumTime","short","shortDate","shortTime","minInt","localeID","opt_precision","vf","getDecimals","getVF","TRANSITION_PROP","TRANSITIONEND_EVENT","ANIMATION_PROP","ANIMATIONEND_EVENT","ADD_CLASS_SUFFIX","REMOVE_CLASS_SUFFIX","NG_ANIMATE_CHILDREN_DATA","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","DURATION_KEY","PROPERTY_KEY","DELAY_KEY","TIMING_KEY","ANIMATION_DELAY_PROP","ANIMATION_DURATION_PROP","TRANSITION_DELAY_PROP","TRANSITION_DURATION_PROP","pendClasses","isPrefix","stripCommentsFromElement","applyAnimationClassesFactory","$$addClass","$$removeClass","prepareAnimationOptions","$$domOperationFired","applyAnimationStyles","applyAnimationFromStyles","applyAnimationToStyles","mergeAnimationDetails","oldAnimation","newAnimation","newOptions","ADD_CLASS","REMOVE_CLASS","flags","splitClassesToLookup","allow","resolveElementClasses","preparationClasses","concatWithSpace","realDomOperation","getDomNode","blockTransitions","applyInlineStyle","blockKeyframeAnimations","applyBlock","styleTuple","$$AnimateChildrenDirective","ngAnimateChildren","setData","ANIMATE_TIMER_KEY","ONE_SECOND","DETECT_CSS_PROPERTIES","transitionDuration","transitionDelay","transitionProperty","animationDuration","animationDelay","DETECT_STAGGER_CSS_PROPERTIES","getCssDelayStyle","isKeyframeAnimation","computeCssStyles","detectedStyles","formalStyleName","actualStyleName","maxValue","truthyTimingValue","getCssTransitionDurationStyle","applyOnlyDuration","createLocalCacheLookup","total","registerRestorableStyles","backup","$AnimateCssProvider","$animateProvider","gcsLookup","gcsStaggerLookup","$$rAFScheduler","applyAnimationClasses","parentCounter","gcsHashFn","extraClasses","KEY","rafWaitQueue","waitUntilQuiet","pageWidth","computeTimings","timings","computeCachedCssStyles","aD","tD","maxDelay","maxDuration","restoreStyles","closeAndReturnNoopAnimator","animationClosed","animationPaused","animationCompleted","runnerHost","maxDelayTime","maxDurationTime","temporaryStyles","packageStyles","structuralClassName","addRemoveClassName","structural","applyClassesEarly","stagger","fullClassName","activeClasses","hasToStyles","keyframeStyle","staggerVal","staggerClassName","computeCachedCssStaggerStyles","$$skipPreparationClasses","transitionStyle","durationStyle","itemIndex","staggerIndex","isFirst","skipBlocking","relativeDelay","delayStyle","hasTransitions","hasAnimations","hasTransitionAll","applyTransitionDuration","applyAnimationDuration","applyTransitionDelay","applyAnimationDelay","recalculateTimingStyles","blockTransition","blockKeyframeAnimation","applyBlocking","$$willAnimate","endFn","cancelFn","close","removeProperty","onDone","onAnimationProgress","animationTimerData","$manualTimeStamp","elapsedTime","playPause","playAnimation","maxStagger","triggerAnimationStart","easeProp","easeVal","timerTime","endTime","animationsData","setupFallbackTimer","currentTimerData","expectedEndTime","onAnimationExpired","$$AnimateCssDriverProvider","$$animationProvider","drivers","NG_ANIMATE_SHIM_CLASS_NAME","NG_ANIMATE_ANCHOR_CLASS_NAME","NG_OUT_ANCHOR_CLASS_NAME","bodyNode","rootNode","rootBodyElement","animationDetails","anchors","fromAnimation","prepareRegularAnimation","toAnimation","anchorAnimations","animator","outAnchor","inAnchor","startingClasses","filterCssClasses","getClassVal","animatorIn","animatorOut","prepareOutAnimation","prepareInAnimation","startingAnimator","currentAnimation","calculateAnchorStyles","coords","endingClasses","getUniqueValues","NG_IN_ANCHOR_CLASS_NAME","prepareAnchoredAnimation","animationRunners","prepareFromToAnchorAnimation","$$AnimateJsProvider","afterFn","beforeFn","classesToAdd","classesToRemove","lookupAnimations","packageAnimations","closeActiveAnimations","applyOptions","endAnimations","onComplete","cancelled","executeAnimationFn","groupEventedAnimations","fnName","operations","ani","endProgressCb","resolved","onAnimationComplete","animateFn","flagMap","animationFactory","$$AnimateJsDriverProvider","prepareAnimation","endFnFactory","NG_ANIMATE_ATTR_NAME","NG_ANIMATE_PIN_DATA","$$AnimateQueueProvider","hasMatchingClasses","currentClassString","currentClassMap","makeTruthyCssClassMap","isAllowed","ruleType","previousAnimation","hasAnimationClasses","and","nA","nR","cA","cR","$$animation","activeAnimationsLookup","disabledElementsLookup","animationsEnabled","deregisterWatch","isEmpty","callbackRegistry","isAnimatableByFilter","isAnimatableClassName","normalizeAnimationDetails","filterFromRegistry","matchContainer","matchCallback","containerNode","cleanupEventListeners","entries","runInNextPostDigestOrNow","postDigestCalled","isStructural","documentHidden","skipAnimations","existingAnimation","hasExistingAnimation","animateChildren","bodyNodeDetected","rootNodeDetected","parentAnimationDetected","elementDisabled","parentHost","details","parentNodeDisabled","areAnimationsAllowed","notifyProgress","closeChildAnimations","applyGeneratedPreparationClasses","isValidAnimation","clearElementAnimationState","markElementAnimationState","animationCancelled","realRunner","targetParentNode","targetNode","findCallbacks","clearGeneratedClasses","queueAnimation","argCount","hasElement","$$AnimationProvider","NG_ANIMATE_REF_ATTR","RUNNER_STORAGE_KEY","getRunner","animationQueue","setRunner","prepareClassName","beforeStart","handleDestroyedElement","groupedAnimations","preparedAnimations","refLookup","enterOrMove","anchorNodes","SELECTOR","getAnchorNodes","animationID","usedIndicesLookup","anchorGroups","lookupKey","cssClassesIntersection","in","indexKey","groupAnimations","toBeSortedAnimations","animationEntry","startAnimationFn","closeFn","operation","driverName","driver","invokeFirstDriver","animationRunner","newRunner","updateAnimationRunners","tree","lookup","processNode","remainingLevelEntries","nextLevelEntries","row","childEntry","flatten","processed","parentEntry","elementNode","sortAnimations","aa","removeRunner","previousScope","ngAnimateSwap","scheduler","tasks","$$CookieWriter","cookiePath","expires","toUTCString","cookieLength","secure","buildCookieString","calcOptions","$$cookieWriter","getObject","putObject","$cookies","$sanitizeMinErr","START_TAG_REGEXP","END_TAG_REGEXP","ATTR_REGEXP","BEGIN_TAG_REGEXP","BEGING_END_TAGE_REGEXP","COMMENT_REGEXP","DOCTYPE_REGEXP","CDATA_REGEXP","SURROGATE_PAIR_REGEXP","NON_ALPHANUMERIC_REGEXP","voidElements","optionalEndTagBlockElements","optionalEndTagInlineElements","optionalEndTagElements","blockElements","inlineElements","svgElements","specialElements","validElements","uriAttrs","htmlAttrs","svgAttrs","validAttrs","hiddenPre","spaceRe","decodeEntities","spaceBefore","spaceAfter","encodeEntities","htmlSanitizeWriter","buf","uriValidator","ignore","lkey","parseEndTag","parseStartTag","rest","doubleQuotedValue","singleQuotedValue","unquotedValue","htmlParser","$sanitize","LINKY_URL_REGEXP","MAILTO_REGEXP","addText","addLink","ngTouch","makeSwipeDirective","$swipe","startCoords","valid","swipeHandler","pointerTypes","deltaY","deltaX","validSwipe","POINTER_EVENTS","getCoordinates","getEvents","totalX","totalY","lastPos","lastPreventedTime","touchCoordinates","lastLabelClickCoordinates","ACTIVE_CLASS_NAME","checkAllowableRegions","onClick","onTouchStart","tapElement","touchStartX","touchStartY","clickHandler","ngClick","tapping","resetState","srcElement","preventGhostClick","onclick","ng_from_import","ng_from_global","ng","curry","initial_args","func_args_length","curried","compose","funcs","_i","propEq","_val","fn1","fn2","or","struct","Glob","glob","regexpString","seg","fromString","StateObject","stateDecl","isStateClass","__stateObjectCache","nameGlob","fqn","parameters","matchingKeys","parameter","isState","toStr","tis","isNullOrUndefined","isInjectable","val$$1","notImplemented","fnname","services","angular$1","cb","_this","_extend","_equals","createProxyFunctions","fnNames","latebind","bindFunction","acc","_inArray","removeFrom","_removeFrom","pushTo","_pushTo","deregAll","functions","defaultsList","_defaultsList","defaultVals","pick","mergeR","memo","ancestors","propNames","objCopy","_prop","omit","pluck","accept","mapObj","allTrueR","anyTrueR","unnestR","flattenR","pushR","uniqR","unnest","assertPredicate","assertFn","assertMap","predicateOrMap","errMsg","pairs","arrayTuples","maxArrayLen","_loop_1","applyPairs","keyValTuple","toObj","a1","a2","tup","RejectType","silenceUncaughtInPromise","silentRejection","Queue","_items","_limit","_evictListeners","onEvict","enqueue","evict","clear","peekTail","peekHead","Rejection","isRejectionPromise","_transitionRejection","superseded","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","_a","toPromise","uiViewString","uiview","creationContext","$type","normalizedCat","Category","consoletable","table","TransitionHookPhase","TransitionHookScope","_tid","_rid","transLbl","trans","Trace","_enabled","approximateDigests","_set","categories","category","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","HOOK","functionToString","registeredHook","maxLength","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","resolvable","traceError","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","padString","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","VIEWCONFIG","uivheader","_b","uiView","viewConfig","uiv","cfg","viewDecl","$context","localeCompare","traceViewServiceEvent","$uiViewName","$uiViewContextAnchor","viewConfigString","traceViewServiceUIViewEvent","trace","TargetState","_stateRegistry","_identifier","_params","_options","_definition","$state","exists","stateName","withState","withParams","newParams","withOptions","newOpts","defaultOptions","traceData","TransitionHook","stateContext","isSuperseded","hookPhase","RUN","isActive","waitFor","nextHook","invokeHook","invokeHooks","remainingHooks","runAllHooks","logError","router","stateService","defaultErrorHandler","_deregistered","notCurrent","getNotCurrentRejection","handleError","getErrorHandler","handleResult","getResultHandler","synchronous","invokeLimit","invokeCount","deregister","handleHookResult","isTargetState","_disposed","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","matchCriteria","removeHookFromRegistry","_matchingNodes","matching","_getDefaultMatchCriteria","_pluginapi","_getPathTypes","_getMatchingNodes","treeChanges","criteria","mn","pathtype","isStateHook","STATE","makeEvent","registry","transitionService","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","HookBuilder","buildHooksForPhase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","baseHookOptions","criteriaMatchPath","transitionHook","reverseDepthSort","depthDelta","tupleSort","reverseSort","isCreate","CREATE","$transitions","reg","getHooks","ParamType","encode","decode","$subPattern","sub","$asArray","isSearch","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","paramTypeFn","wrapperFn","dynamic","$arrayMode","DefType","unwrapShorthand","getStaticDefaultValue","isShorthand","$$fn","Param","urlMatcherFactory","urlType","paramTypes","CONFIG","PATH","SEARCH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","isOptional","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","configuredKeys","getReplace","inherit$$1","values$$1","paramValues","params_1","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","getDefaultValue","encoded","PathNode","stateOrNode","paramSchema","resolvables","views","applyRawParams","pDef","paramDef","paramsFn","PathUtils","makeTargetState","buildPath","targetState","toParams","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","$view","states","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","exiting","entering","keep","nonDynamicParams","retainedWithToParams","retainedNode","cloned","pathA","pathB","nodeA","nodeB","elementIdx","defaultResolvePolicy","Resolvable","resolveFn","deps","policy","getPolicy","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","maybeWaitForRx","observable$","take","getDependencies","resolvedDeps","resolvedValue","fromData","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","RXWAIT","ALL_WHENS","EAGER_WHENS","NATIVE_INJECTOR_TOKEN","ResolveContext","_path","getTokens","getResolvable","subContext","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","getResult","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","stateSelf","Transition","_deferred","_hookBuilder","_targetState","_transitionCount","_treeChanges","createTransitionHookRegFns","onCreateHooks","onBefore","onStart","onExit","onRetain","onEnter","onFinish","onSuccess","onError","hookName","enteringStates","$from","$to","freeze","pathName","getResolveTokens","addResolvable","topath","redirectedFrom","originalTransition","rf","redirect","redirects","redirectOpts","newTransition","originalEnteringNodes","redirectEnteringNodes","_changedParams","tc","nodeSchemas","schema","toVals","fromVals","_ignoredReason","newTC","pendTC","getHooksFor","allBeforeHooks","BEFORE","lastStartedTransitionId","transitionHistory","allRunHooks","SUCCESS","_error","abstract","paramDefs","invalidParams","fromStateOrName","toStateOrName","avoidEmptyHash","diToken","kebobString","$1","fnStr","namedFunctionMatch","_fn","stringifyPatternFn","isRejection","stringifyPattern","beforeAfterSubstr","hostRegex","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","joinNeighborsR","makeDefaultType","ParamTypes","typeQueue","defaultTypes","dispose","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","query","int","StateParams","$inherit","$current","parentParams","inherited","inheritList","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","root$$1","stateDec","parseUrl","paramMap","paramConfig","reloadOnSearch","isMatcher","navigable","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","getToken","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","resolveObj","objects2Tuples","StateBuilder","paramFactory","builders","parentName","urlParams","nonUrlParams","fromConfig","builder","build","parentFn","StateMatcher","_states","isRelative","stateOrName","matchGlob","isStr","baseState","splitName","pathLength","relName","StateQueueManager","$registry","$urlRouter","registered","previousQueueLength","getState","name_1","orphanIdx","existingState","existingFutureState","attachRoute","rule","urlRuleFactory","StateRegistry","_router","stateQueue","urlRouter","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","all$$1","getChildren","_children","deregistered","$ur","removeRule","deregisteredStates","found","quoteRegExp","surroundPattern","splitOnSlash","UrlMatcher","pattern$$1","_cache","_segments","_compiled","strict","caseInsensitive","matchArray","segment","searchPlaceholder","patterns","checkParamErrors","nameValidator","matchDetails","fromSearch","_pattern","encodeDashes","pathSegmentsAndParams","queryParams","weights","weightsA","weightsB","padVal","padArrays","cmp","_pairs","reverseString","allReversed","allParams","pathParams","searchParams","nPathSegments","urlm","findParam","urlMatchers","getDetails","pathString","queryString","paramDetails","UrlMatcherFactory","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","_getConfig","strictMode","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","BaseUrlRule","urlMatcher","_handler","matchPriority","transitionTo","sticky","isUrlRule","defaultRuleSortFn","prioritySort","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRouter","_sortFn","_rules","interceptDeferred","_id","_sorted","listen","_otherwiseFn","stableSort","ensureSorted","arrOfWrapper","wrapperA","wrapperB","cmpDiff","best","weight","sync","$url","urlService","newurl","go","applyResult","_stopFn","onChange","read","locationService","absolute","isHtml5","appendBasePath","slash","cfgPort","otherwise","handlerFn","getHandlerFn","urlParts","deferIntercept","ViewService","_uiViews","_viewConfigs","_viewConfigFactories","_listeners","_rootViewContext","_viewConfigFactory","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","uiViewName","uiViewContextAnchor","relativeViewNameSugar","anchorState","_rootContext","viewType","cfgFactory","cfgs","deactivateViewConfig","activateViewConfig","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","configUpdated","allTuples","registerUIView","uiViews","available","vc","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","UIRouterGlobals","successfulTransitions","makeStub","locationServicesFns","locationConfigFns","umfFns","rulesFns","syncFns","UrlService","lateBind","locationServices","locationConfig","umf","locationServiceStub","locationConfigStub","_routerInstance","UIRouter","_disposables","viewService","TransitionService","stateRegistry","StateService","_plugins","disposable","pluginInstance","getPlugin","pluginName","addCoreResolvables","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirectTo","makeEnterExitRetainHook","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","lazyLoadHook","lazyLoad","lazyLoadState","lazyLoadFn","TransitionEventType","hookOrder","ignoredHook","ignoredReason","invalidTransitionHook","defaultTransOpts","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","_definePathType","cmpByPhase","hookScope","addCoreResolves","registerIgnoredTransitionHook","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","registerLazyLoadHook","invalidCallbacks","_defaultErrorHandler","$error$","boundFns","_handleInvalidTargetState","toState","latestThing","latest","callbackQueue","checkForRedirect","invokeNextCallback","nextCallback","onInvalid","transOpts","getCurrentPath","latestSuccess","currentPath","rejectedTransitionHandler","isLatest","errorHandler","transitionToPromise","include","lossy","nav","ARGUMENT_NAMES","ensureExist","keyValsToObjectR","accum","getParams","parseUrl$1","orEmptyString","beforehash","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","uiRouter","configuration","extendStatics","BaseLocationServices","fireAfterUpdate","_listener","_get","_location","_history","__extends","setPrototypeOf","__proto__","__","HashLocationService","title","__extends$1","MemoryLocationService","_url","__extends$2","PushStateLocationService","_config","_getBasePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","MemoryLocationConfig","_baseHref","_port","_protocol","_host","_hashPrefix","newval","BrowserLocationConfig","_isHtml5","newprefix","applyDocumentBaseHref","baseTag","servicesPlugin","hashLocationPlugin","pushStateLocationPlugin","memoryLocationPlugin","UIRouterPluginBase","getNg1ViewConfigFactory","templateFactory","Ng1ViewConfig","hasAnyKey","ng1ViewsBuilder","compKeys","nonCompKeys","allViewKeys","viewsObject","$default","resolveAs","id$1","loaded","getTemplate","makeComponentTemplate","getController","controllerProvider","providerFn","TemplateFactory","_useHttp","useHttpService","asTemplate","asComponent","fromUrl","templateProvider","fromProvider","componentProvider","fromComponentProvider","kebob","kebobed","cmpDefs","getBindings","getComponentBindings","resolveName","kebobName","scopeBindings","bindingsObj","StateProvider","getStateHookBuilder","stateObject","$state$","$transition$","Ng1LocationServices","$locationProvider","_urlListeners","_lp","monkeyPatchPathParameterType","pathType","_runtimeServices","_loc","_browser","UrlRouterProvider","_urlRouter","injectableHandler","$match","$stateParams","ruleFn","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","stateProvider","ng1LocationService","getProviderFor","$urp","runBlock","$uiRouter","watchDigests","urlRouterProvider","$urlMatcherFactory","uiSrefDirective","uiStateDirective","uiSrefActiveDirective","ctx","parseStateRef","paramsOnly","paramExpr","$uiView","processedDef","uiState","uiStateOpts","defaultOpts","uiStateParams","getTypeInfo","isSvg","isForm","isAnchor","clickable","clickHook","getDef","transition_1","ignorePreventDefaultCount_1","bindEvents","events_1","event_1","events_2","event_2","$IsStateFilter","isFilter","$IncludedByStateFilter","includesFilter","$ViewDirectiveFill","getControllerAs","getResolveAs","$cfg","resolveCtx","registerControllerCallbacks","cmp_1","tagRegexp_1","deregisterWatch_1","directiveEl","ctrlInstance","uiSrefActive","unlinkInfoFn","rawDef","uiSref","$$addStateInfo","uiSrefOpts","inputAttrs","watchDeregFns","field","activeEqClass","deregisterStatesChangedListener","deregisterOnStartListener","deregisterStateChangeSuccessListener","uiSrefActiveEq","updateAfterTransition","handleStatesChanged","setStatesFromDefinitionObject","statesDefinition","activeClass","addStateForClass","addState","stateParams","stateInfo","getClasses","stateList","allClasses","fuzzyClasses","exactClasses","addClasses","cls","$uiViewScroll","rootData","previousEl","currentEl","unregister","renderer","activeUIView","config1","config2","updateView","fromParentTagConfig","fromParentTag","animEnter","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","_viewData_1","cleanupLastView","hasComponentImpl","_uiCanExitId","viewState","hookOptions","uiOnParamsChanged","viewCreationTrans_1","fromParams","toSchema","fromSchema","changedToParams","changedKeys_1","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","ids","useAnchorScroll","default","core","uiSortableConfig","uiSortable","savedNodes","combineCallbacks","secondIsFunc","getSortableWidgetInstance","patchSortableOption","afterStop","wrappers","patchUISortableOptions","oldOpts","sortableWidgetInstance","optsDiff","directiveOpts","sortable","userProvidedHelper","$el","getSortingHelper","helperOption","isCustomHelperUsed","hasSortingHelper","getItemIndex","wireUp","model","sourceList","sourceModel","_isCanceled","isCanceled","_isCustomHelperUsed","_connectedSortables","_getElementContext","elementScopes","getElementContext","isSourceContext","savedNodesOrigin","elementContext","getPlaceholderElement","excludes","notCssSelector","getPlaceholderExcludesludes","received","dropindex","droptarget","droptargetList","droptargetContext","droptargetModel","sortingHelper","moved","wasMoved","attrHandlerFn","attrHandler","inner","oldItemSortable","_restore","innerResult","initIfEnabled","cancelWatcher","cancelTimeout","minDurationPromise","activationDelayPromise","tracked","minDuration","activationDelay","tracking","trackingCount","createPromise","startMinDuration","addPromise","$promise","$httpProvider","promiseTracker","tracker","$promiseTrackerDeferred","regModules","regInvokes","regConfigs","recordDeclarations","broadcast","justLoaded","$controllerProvider","$filterProvider","providers","moduleCache","moduleConfig","NG_APP_CLASS_REGEXP","jasmine","mocha","mock","addReg","mainModule","hashCode","_register","registerModules","tempRunBlocks","getModuleName","newModule","ngModuleFct","rerun","reconfig","getInstanceInjector","_registerInvokeList","invokeList","newInvoke","onInvoke","invokeName","signature","isNew","callInvoke","fct","invoked","jlen","moduleExists","filesCache","_broadcast","_$log","_getFilesCache","toggleWatch","getModuleConfig","setModuleConfig","getModules","isLoaded","modulesNames","moduleLoaded","_getModuleName","_getModule","_loadDependencies","localParams","loadedModule","promisesList","getRequires","requireEntry","files","filesLoader","inject","_addToLoadList","loadNext","requireModule","bootstrapFct","$ocLazyLoad","ocLazyLoad","useCssLoadPatch","buildElement","cacheBuster","dc","rel","serie","insertBeforeElem","ua","platform","appVersion","iOSVersion","androidVersion","versionMatch","tries","sheet","cssRules","cssFiles","templatesFiles","jsFiles","cachePromise","pushFile","file_type","jsLoader","cssDeferred","cssLoader","templatesDeferred","templatesLoader","jsDeferred","originalModule","errText","originalParams","deferredList","ocLazyLoadLoader","searchElement","fromIndex","O"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;CA4BA,SAAWA,GACP,aAQA,GAAyB,mBAAdC,UACPA,UAAU,UAAWD,QAGlB,GAAuB,iBAAZE,SAA0C,iBAAXC,OAC7CA,OAAOD,QAAUF,SAGd,GAAsB,mBAAXI,QAAyBA,OAAOC,IAC9CD,OAAOJ,QAGJ,GAAmB,oBAARM,IAAqB,CACnC,IAAKA,IAAIC,KACL,OAEAD,IAAIE,MAAQR,MAIb,CAAA,GAAsB,oBAAXS,QAA0C,oBAATC,KAkB/C,MAAM,IAAIC,MAAM,iEAfhB,IAAIC,EAA2B,oBAAXH,OAAyBA,OAASC,KAIlDG,EAAYD,EAAOE,EACvBF,EAAOE,EAAId,IAIXY,EAAOE,EAAEC,WAAa,WAElB,OADAH,EAAOE,EAAID,EACJG,OA3CnB,EAkDG,WACH,aAEA,IAAIC,GAAY,EAChB,IACI,MAAM,IAAIN,MACZ,MAAOO,GACLD,IAAcC,EAAEC,MAKpB,IACI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EAAInyG,GAAK,CAaR,GAAImyG,KAAKq2E,GAAKA,EAAEr2E,KAAOm2E,EACf,OAAOn2E,EAEfA,IAER,OAAQ","file":"vendor.min.js","sourcesContent":["// vim:ts=4:sts=4:sw=4:\n/*!\n *\n * Copyright 2009-2017 Kris Kowal under the terms of the MIT\n * license found at https://github.com/kriskowal/q/blob/v1/LICENSE\n *\n * With parts by Tyler Close\n * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found\n * at http://www.opensource.org/licenses/mit-license.html\n * Forked at ref_send.js version: 2009-05-11\n *\n * With parts by Mark Miller\n * Copyright (C) 2011 Google Inc.\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(function (definition) {\n \"use strict\";\n\n // This file will function properly as a \n * \n * \n * \n * ```\n *\n * @param {DOMElement} element DOM element which is the root of AngularJS application.\n * @param {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(//,'>'));\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 AngularJS on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of AngularJS 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 // AngularJS 1.2+ requires jQuery 1.7+ for on()/off() support.\n // AngularJS 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 AngularJS {@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.} */\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 AngularJS\n * modules.\n * All modules (AngularJS 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.=} 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.>} */\n var invokeQueue = [];\n\n /** @type {!Array.} */\n var configBlocks = [];\n\n /** @type {!Array.} */\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 AngularJS 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 *
\n * **Note:** Filter names must be valid AngularJS {@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 *
\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 configure services by injecting their\n * {@link angular.Module#provider `providers`}, e.g. for adding routes to the\n * {@link ngRoute.$routeProvider $routeProvider}.\n *\n * Note that you can only inject {@link angular.Module#provider `providers`} and\n * {@link angular.Module#constant `constants`} into this function.\n *\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.10',\n major: 1,\n minor: 6,\n dot: 10,\n codeName: 'crystalline-persuasion'\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.10' });\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 AngularJS'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 * AngularJS 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 *
**Note:** All element references in AngularJS 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.
\n *\n *
**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()`.
\n *\n * ## AngularJS'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/) - Contrary to jQuery, this doesn't clone elements\n * so will not work correctly when invoked on a jqLite object containing more than one DOM node\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 * AngularJS 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, ''],\n\n 'thead': [1, '', '
'],\n 'col': [2, '', '
'],\n 'tr': [2, '', '
'],\n 'td': [3, '', '
'],\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>') + 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 var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, ' ');\n var newClasses = existingClasses;\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n newClasses = newClasses.replace(' ' + cssClass + ' ', ' ');\n });\n\n if (newClasses !== existingClasses) {\n element.setAttribute('class', trim(newClasses));\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 var newClasses = existingClasses;\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n if (newClasses.indexOf(' ' + cssClass + ' ') === -1) {\n newClasses += cssClass + ' ';\n }\n });\n\n if (newClasses !== existingClasses) {\n element.setAttribute('class', trim(newClasses));\n }\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.} 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 AngularJS app\n * from outside AngularJS. 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 = $('
{{content.label}}
');\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.} 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.} 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.} The names of the services which the function requires.\n */\n/**\n * @ngdoc method\n * @name $injector#loadNewModules\n *\n * @description\n *\n * **This is a dangerous API, which you use at your own risk!**\n *\n * Add the specified modules to the current injector.\n *\n * This method will add each of the injectables to the injector and execute all of the config and run\n * blocks for each module passed to the method.\n *\n * If a module has already been loaded into the injector then it will not be loaded again.\n *\n * * The application developer is responsible for loading the code containing the modules; and for\n * ensuring that lazy scripts are not downloaded and executed more often that desired.\n * * Previously compiled HTML will not be affected by newly loaded directives, filters and components.\n * * Modules cannot be unloaded.\n *\n * You can use {@link $injector#modules `$injector.modules`} to check whether a module has been loaded\n * into the injector, which may indicate whether the script has been executed already.\n *\n * @example\n * Here is an example of loading a bundle of modules, with a utility method called `getScript`:\n *\n * ```javascript\n * app.factory('loadModule', function($injector) {\n * return function loadModule(moduleName, bundleUrl) {\n * return getScript(bundleUrl).then(function() { $injector.loadNewModules([moduleName]); });\n * };\n * })\n * ```\n *\n * @param {Array=} mods 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 */\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 AngularJS **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 * It is possible to inject other providers into the provider function,\n * but the injected provider must have been defined before the one that requires it.\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.} $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.} 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 AngularJS {@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 AngularJS {@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.} 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 instanceInjector.loadNewModules = function(mods) {\n forEach(loadModules(mods), function(fn) { if (fn) instanceInjector.invoke(fn); });\n };\n\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.
\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.

\n * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n * a number representing the offset (in pixels).

\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.
\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 *
\n *
\n * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n * not some child element.\n *
\n *\n * @example\n \n \n
\n Go to bottom\n You're at the bottom!\n
\n
\n \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 \n \n #scrollArea {\n height: 280px;\n overflow: auto;\n }\n\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n \n
\n *\n *
\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 \n \n \n
\n Anchor {{x}} of 5\n
\n
\n \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 \n \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 \n
\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 *
\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 *
\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 AngularJS 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 `` 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 * 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 AngularJS:\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 AngularJS 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 AngularJS.\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 \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 \n \n
\n \n \n \n\n

Cached Values

\n
\n \n : \n \n
\n\n

Cache Info

\n
\n \n : \n \n
\n
\n
\n \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 \n \n p {\n margin: 10px 0 3px;\n }\n \n
\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 $templateRequest $templateRequest} and the {@link ng.directive:script script}\n * directive to cache 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 *
    \n *
  • **id**: the id of the cache instance
  • \n *
  • **size**: the number of entries kept in the cache instance
  • \n *
  • **...**: any additional properties from the options object when creating the\n * cache.
  • \n *
\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 * `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the\n * {@link ng.$cacheFactory $cacheFactory}.\n *\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, by using {@link $templateRequest},\n * or by consuming the `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n * \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} (e.g.\n * element with {@link ngApp} 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 */\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 *
\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 *
\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 *
\n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n *
\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}: '
', // 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 *
\n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n *
\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 AngularJS 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 AngularJS'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 life-cycle hooks in the new Angular\n * The new Angular also uses life-cycle hooks for its components. While the AngularJS 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 AngularJS to Angular:\n *\n * * AngularJS hooks are prefixed with `$`, such as `$onInit`. Angular hooks are prefixed with `ng`, such as `ngOnInit`.\n * * AngularJS hooks can be defined on the controller prototype or added to the controller inside its constructor.\n * In Angular 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 AngularJS than you would to\n * `ngDoCheck` in Angular.\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 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 * \n * \n * angular.module('do-check-module', [])\n * .component('app', {\n * template:\n * 'Month: ' +\n * 'Date: {{ $ctrl.date }}' +\n * '',\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 * '
{{ $ctrl.log | json }}
',\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 *
\n * \n * \n * \n *
\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 * \n * \n *
\n * \n * \n *
{{ items }}
\n * \n *
\n *
\n * \n * angular.module('do-check-module', [])\n * .component('test', {\n * bindings: { items: '<' },\n * template:\n * '
{{ $ctrl.log | json }}
',\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 *
\n *
\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 `` 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 `` 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 `` and directive definition of\n * `scope: { localModel:'` 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 *
\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 *
\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 ``).\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): ``\n * * `A` - Attribute (default): `
`\n * * `C` - Class: `
`\n * * `M` - Comment: ``\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 `` and ``.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n * top-level elements such as `` or ``.\n * * `svg` - The root nodes in the template are SVG elements (excluding ``).\n * * `math` - The root nodes in the template are MathML elements (excluding ``).\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 `
{{delete_str}}
`.\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`\n *
\n * **Note:** `replace` is deprecated in AngularJS and has been removed in the new Angular (v2+).\n *
\n *\n * Specifies 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 *
\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 *
\n\n *
\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 *
\n *\n *
\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 *
\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 *
\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 *
\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 `` 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 *
\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 *
\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 *
\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 *
\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 *
\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 *
\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 *
\n *
\n *
\n *
\n *
\n *
\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 *
\n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n *
\n *\n \n \n \n
\n
\n
\n
\n
\n
\n \n it('should auto compile', function() {\n var textarea = $('textarea');\n var output = $('div[compile]');\n // The initial state reads 'Hello AngularJS'.\n expect(output.getText()).toBe('Hello AngularJS');\n textarea.clear();\n textarea.sendKeys('{{name}}!');\n expect(output.getText()).toBe('AngularJS!');\n });\n \n
\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 *
\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 *
\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:
`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 * AngularJS 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('

{{total}}

')(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('

{{total}}

'),\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 AngularJS 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 * @knownIssue\n\n ### Issues with `replace: true`\n *\n *
\n * **Note**: {@link $compile#-replace- `replace: true`} is deprecated and not recommended to use,\n * mainly due to the issues listed here. It has been completely removed in the new Angular.\n *
\n *\n * #### Attribute values are not merged\n *\n * When a `replace` directive encounters the same attribute on the original and the replace node,\n * it will simply deduplicate the attribute and join the values with a space or with a `;` in case of\n * the `style` attribute.\n * ```html\n * Original Node: \n * Replace Template: \n * Result: \n * ```\n *\n * That means attributes that contain AngularJS expressions will not be merged correctly, e.g.\n * {@link ngShow} or {@link ngClass} will cause a {@link $parse} error:\n *\n * ```html\n * Original Node: \n * Replace Template: \n * Result: \n * ```\n *\n * See issue [#5695](https://github.com/angular/angular.js/issues/5695).\n *\n * #### Directives are not deduplicated before compilation\n *\n * When the original node and the replace template declare the same directive(s), they will be\n * {@link guide/compiler#double-compilation-and-how-to-avoid-it compiled twice} because the compiler\n * does not deduplicate them. In many cases, this is not noticable, but e.g. {@link ngModel} will\n * attach `$formatters` and `$parsers` twice.\n *\n * See issue [#2573](https://github.com/angular/angular.js/issues/2573).\n *\n * #### `transclude: element` in the replace template root can have\n * unexpected effects\n *\n * When the replace template has a directive at the root node that uses\n * {@link $compile#-transclude- `transclude: element`}, e.g.\n * {@link ngIf} or {@link ngRepeat}, the DOM structure or scope inheritance can be incorrect.\n * See the following issues:\n *\n * - Incorrect scope on replaced element:\n * [#9837](https://github.com/angular/angular.js/issues/9837)\n * - Different DOM between `template` and `templateUrl`:\n * [#10612](https://github.com/angular/angular.js/issues/14326)\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*([\\w$]*)$/;\n\n var bindings = createMap();\n\n forEach(scope, function(definition, scopeName) {\n definition = definition.trim();\n\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. ngBind which\n * will match as ng-bind), 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 ``),\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=}` - 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: '
My name is {{$ctrl.name}}
',\n * controller: function() {\n * this.name = 'shahar';\n * }\n * });\n *\n * myMod.component('myComp', {\n * template: '
My name is {{$ctrl.name}}
',\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 *
\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 AngularJS 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 * * `ng-scope` and `ng-isolated-scope` CSS classes\n * * `$binding` data property containing an array of the binding expressions\n * * Data properties used by the {@link angular.element#methods `scope()`/`isolateScope()` methods} to return\n * the element's scope.\n * * Placeholder comments will contain information about what directive and binding caused the placeholder.\n * E.g. ``.\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 for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\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 = (value == null) ? 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) {\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 = '';\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('
').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: \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.} preLinkFns\n * @param {Array.} 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 + '';\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 .\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 AngularJS'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 AngularJS 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, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\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 AngularJS:\n *\n * ```\n * \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 AngularJS 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 \n \n
\n

$document title:

\n

window.document title:

\n
\n
\n \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 \n
\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 AngularJS 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 *
\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.)} 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}` - 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)}` -\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)}` -\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 /**\n * @ngdoc property\n * @name $httpProvider#xsrfWhitelistedOrigins\n * @description\n *\n * Array containing URLs whose origins are trusted to receive the XSRF token. See the\n * {@link ng.$http#security-considerations Security Considerations} sections for more details on\n * XSRF.\n *\n * **Note:** An \"origin\" consists of the [URI scheme](https://en.wikipedia.org/wiki/URI_scheme),\n * the [hostname](https://en.wikipedia.org/wiki/Hostname) and the\n * [port number](https://en.wikipedia.org/wiki/Port_(computer_networking). For `http:` and\n * `https:`, the port number can be omitted if using th default ports (80 and 443 respectively).\n * Examples: `http://example.com`, `https://api.example.com:9876`\n *\n *
\n * It is not possible to whitelist specific URLs/paths. The `path`, `query` and `fragment` parts\n * of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be\n * treated as `https://foo.com`, meaning that **all** requests to URLs starting with\n * `https://foo.com/` will include the XSRF token.\n *
\n *\n * @example\n *\n * ```js\n * // App served from `https://example.com/`.\n * angular.\n * module('xsrfWhitelistedOriginsExample', []).\n * config(['$httpProvider', function($httpProvider) {\n * $httpProvider.xsrfWhitelistedOrigins.push('https://api.example.com');\n * }]).\n * run(['$http', function($http) {\n * // The XSRF token will be sent.\n * $http.get('https://api.example.com/preferences').then(...);\n *\n * // The XSRF token will NOT be sent.\n * $http.get('https://stats.example.com/activity').then(...);\n * }]);\n * ```\n */\n var xsrfWhitelistedOrigins = this.xsrfWhitelistedOrigins = [];\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 * A function to check request URLs against a list of allowed origins.\n */\n var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfWhitelistedOrigins);\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 AngularJS 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} that is\n * resolved (request success) or rejected (request failure) with a\n * {@link ng.$http#$http-returns response} object.\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 *\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 * - Accept: application/json, text/plain, \\*/\\*\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 *
\n * **Note:** AngularJS 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 *
\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 * AngularJS 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. AngularJS 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 * AngularJS 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 * AngularJS 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. AngularJS 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 (by default `X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read\n * the cookie, your server can be assured that the XHR came from JavaScript running on your\n * domain.\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 the `X-XSRF-TOKEN` HTTP header, and therefore be\n * sure that only JavaScript running on your domain could have sent the request. The token must\n * be 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 header will — by default — **not** be set for cross-domain requests. This\n * prevents unauthorized servers (e.g. malicious or compromised 3rd-party APIs) from gaining\n * access to your users' XSRF tokens and exposing them to Cross Site Request Forgery. If you\n * want to, you can whitelist additional origins to also receive the XSRF token, by adding them\n * to {@link ng.$httpProvider#xsrfWhitelistedOrigins xsrfWhitelistedOrigins}. This might be\n * useful, for example, if your application, served from `example.com`, needs to access your API\n * at `api.example.com`.\n * See {@link ng.$httpProvider#xsrfWhitelistedOrigins $httpProvider.xsrfWhitelistedOrigins} for\n * more details.\n *\n *
\n * **Warning**
\n * Only whitelist origins that you have control over and make sure you understand the\n * implications of doing so.\n *
\n *\n * The name of the cookie and the header can be specified using the `xsrfCookieName` and\n * `xsrfHeaderName` properties of either `$httpProvider.defaults` at config-time,\n * `$http.defaults` at run-time, or the per-request config object.\n *\n * In order to prevent collisions in environments where multiple AngularJS apps share the\n * same domain or subdomain, we recommend that each application uses a unique cookie name.\n *\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.}` – 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.}` –\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.}` –\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}` - 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 *\n * A numerical timeout or a promise returned from {@link ng.$timeout $timeout}, will set\n * the `xhrStatus` in the {@link $http#$http-returns response} to \"timeout\", and any other\n * resolved promise will set it to \"abort\", following standard XMLHttpRequest behavior.\n *\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} A {@link ng.$q `Promise}` that will be resolved (request success)\n * or rejected (request failure) with a response object.\n *\n * The response object has these properties:\n *\n * - **data** – `{string|Object}` – The response body transformed with\n * the transform 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\n * to generate the request.\n * - **statusText** – `{string}` – HTTP status text of the response.\n * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest\n * (`complete`, `error`, `timeout` or `abort`).\n *\n *\n * A response status code between 200 and 299 is considered a success status\n * and will result in the success callback being called. Any response status\n * code outside of that range is considered an error status and will result\n * in the error callback being called.\n * Also, status codes less than -1 are normalized to zero. -1 usually means\n * the request was aborted, e.g. using a `config.timeout`. More information\n * about the status might be available in the `xhrStatus` property.\n *\n * Note that if the response is a redirect, XMLHttpRequest will transparently\n * follow it, meaning that the outcome (success or error) will be determined\n * by the final response status code.\n *\n *\n * @property {Array.} 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\n\n
\n \n \n
\n \n \n \n
http status code: {{status}}
\n
http response data: {{data}}
\n
\n
\n\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\n\n Hello, $http!\n\n\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\n
\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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 * You should avoid generating the URL for the JSONP request from user provided data.\n * Provide additional query parameters via `params` property of the `config` parameter, rather than\n * modifying the URL itself.\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 *
\n * You can no longer use the `JSON_CALLBACK` string as a placeholder for specifying where the callback\n * parameter value should go.\n *
\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\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 = urlIsAllowedOrigin(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, cbKey) {\n var parts = url.split('?');\n if (parts.length > 2) {\n // Throw if the url contains more than one `?` query indicator\n throw $httpMinErr('badjsonp', 'Illegal use more than one \"?\", in url, \"{1}\"', url);\n }\n var params = parseKeyValue(parts[1]);\n forEach(params, function(value, key) {\n if (value === 'JSON_CALLBACK') {\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 if (key === cbKey) {\n // Throw if the callback param was already provided\n throw $httpMinErr('badjsonp', 'Illegal use of callback param, \"{0}\", in url, \"{1}\"', cbKey, url);\n }\n });\n\n // Add in the JSON_CALLBACK callback param value\n url += ((url.indexOf('?') === -1) ? '?' : '&') + cbKey + '=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 var abortedByTimeout = false;\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, '', abortedByTimeout ? 'timeout' : '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.ontimeout = requestTimeout;\n xhr.onabort = requestAborted;\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 // Since we are using xhr.abort() when a request times out, we have to set a flag that\n // indicates to requestAborted if the request timed out or was aborted.\n //\n // http.timeout = numerical timeout timeout\n // http.timeout = $timeout timeout\n // http.timeout = promise abort\n // xhr.abort() abort (The xhr object is normally inaccessible, but\n // can be exposed with the xhrFactory)\n if (timeout > 0) {\n var timeoutId = $browserDefer(function() {\n timeoutRequest('timeout');\n }, timeout);\n } else if (isPromiseLike(timeout)) {\n timeout.then(function() {\n timeoutRequest(isDefined(timeout.$$timeoutId) ? 'timeout' : 'abort');\n });\n }\n\n function timeoutRequest(reason) {\n abortedByTimeout = reason === 'timeout';\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 *
\n * This feature is sometimes used to mix different markup languages, e.g. to wrap an AngularJS\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 AngularJS\n * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)\n * security bugs!\n *
\n *\n * @example\n\n\n\n
\n //demo.label//\n
\n
\n\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\n
\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:'AngularJS'})).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 = 'AngularJS';\n * expect(exp(context)).toEqual('Hello AngularJS!');\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 * \n * \n *
\n *

{{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n *

\n *

{{username}} 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.

\n *

Instead, the result of the attempted script injection is visible, and can be removed\n * from the database by an administrator.

\n *
\n *
\n *
\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 *
\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 listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\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 * AngularJS'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 *
\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 *
\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 * \n * \n * \n *\n *
\n *
\n *
\n * Current time is: \n *
\n * Blood 1 : {{blood_1}}\n * Blood 2 : {{blood_2}}\n * \n * \n * \n *
\n *
\n *\n *
\n *
\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 AngularJS 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 // decode forward slashes to prevent them from being double encoded\n segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/'));\n }\n\n return segments.join('/');\n}\n\nfunction decodePath(path, html5Mode) {\n var segments = path.split('/'),\n i = segments.length;\n\n while (i--) {\n segments[i] = decodeURIComponent(segments[i]);\n if (html5Mode) {\n // encode forward slashes to prevent them from being mistaken for path separators\n segments[i] = segments[i].replace(/\\//g, '%2F');\n }\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, html5Mode) {\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 var path = prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname;\n locationObj.$$path = decodePath(path, html5Mode);\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, true);\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, false);\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 AngularJS, 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-AngularJS 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.|Object.>} 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|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 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 `` 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 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 AngularJS 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 \n \n angular.module('logExample', [])\n .controller('LogController', ['$scope', '$log', function($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }]);\n \n \n
\n

Reload this page with open console, enter text and hit the log button...

\n \n \n \n \n \n \n
\n
\n
\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 AngularJS Expressions\n// ------------------------------\n// AngularJS 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 AngularJS 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.getAst(text);\n var fn = this.astCompiler.compile(ast.ast);\n fn.literal = isLiteral(ast.ast);\n fn.constant = isConstant(ast.ast);\n fn.oneTime = ast.oneTime;\n return fn;\n },\n\n getAst: function(exp) {\n var oneTime = false;\n exp = exp.trim();\n\n if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n oneTime = true;\n exp = exp.substring(2);\n }\n return {\n ast: this.ast.ast(exp),\n oneTime: oneTime\n };\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 AngularJS {@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:'AngularJS'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('AngularJS');\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 AngularJS 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 $parse.$$getAst = $$getAst;\n return $parse;\n\n function $parse(exp, interceptorFn) {\n var parsedExpression, 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 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 (parsedExpression.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 $$getAst(exp) {\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n return parser.getAst(exp).ast;\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 AngularJS, 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 // This error is explicitly marked for being passed to the $exceptionHandler\n if (e && e.$$passToExceptionHandler === true) {\n exceptionHandler(e);\n }\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.|Object.} 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.|Object.} 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 this.$$suspended = false;\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.=} providers Map of service factory which need to be\n * provided for the current scope. Defaults to {@link ng}.\n * @param {Object.=} 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.$$suspended = 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 var fn = isFunction(listener) ? listener : noop;\n\n if (get.$$watchDelegate) {\n return get.$$watchDelegate(this, fn, objectEquality, get, watchExp);\n }\n var scope = this,\n array = scope.$$watchers,\n watcher = {\n fn: fn,\n last: initWatchVal,\n get: get,\n exp: prettyPrintExpression || watchExp,\n eq: !!objectEquality\n };\n\n lastDirtyWatch = null;\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.} 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.$$suspended && 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 // (though it differs due to having the extra check for $$suspended and does not\n // check $$listenerCount)\n if (!(next = ((!current.$$suspended && 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 * @ngdoc method\n * @name $rootScope.Scope#$suspend\n * @kind function\n *\n * @description\n * Suspend watchers of this scope subtree so that they will not be invoked during digest.\n *\n * This can be used to optimize your application when you know that running those watchers\n * is redundant.\n *\n * **Warning**\n *\n * Suspending scopes from the digest cycle can have unwanted and difficult to debug results.\n * Only use this approach if you are confident that you know what you are doing and have\n * ample tests to ensure that bindings get updated as you expect.\n *\n * Some of the things to consider are:\n *\n * * Any external event on a directive/component will not trigger a digest while the hosting\n * scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`.\n * * Transcluded content exists on a scope that inherits from outside a directive but exists\n * as a child of the directive's containing scope. If the containing scope is suspended the\n * transcluded scope will also be suspended, even if the scope from which the transcluded\n * scope inherits is not suspended.\n * * Multiple directives trying to manage the suspended status of a scope can confuse each other:\n * * A call to `$suspend()` on an already suspended scope is a no-op.\n * * A call to `$resume()` on a non-suspended scope is a no-op.\n * * If two directives suspend a scope, then one of them resumes the scope, the scope will no\n * longer be suspended. This could result in the other directive believing a scope to be\n * suspended when it is not.\n * * If a parent scope is suspended then all its descendants will be also excluded from future\n * digests whether or not they have been suspended themselves. Note that this also applies to\n * isolate child scopes.\n * * Calling `$digest()` directly on a descendant of a suspended scope will still run the watchers\n * for that scope and its descendants. When digesting we only check whether the current scope is\n * locally suspended, rather than checking whether it has a suspended ancestor.\n * * Calling `$resume()` on a scope that has a suspended ancestor will not cause the scope to be\n * included in future digests until all its ancestors have been resumed.\n * * Resolved promises, e.g. from explicit `$q` deferreds and `$http` calls, trigger `$apply()`\n * against the `$rootScope` and so will still trigger a global digest even if the promise was\n * initiated by a component that lives on a suspended scope.\n */\n $suspend: function() {\n this.$$suspended = true;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$isSuspended\n * @kind function\n *\n * @description\n * Call this method to determine if this scope has been explicitly suspended. It will not\n * tell you whether an ancestor has been suspended.\n * To determine if this scope will be excluded from a digest triggered at the $rootScope,\n * for example, you must check all its ancestors:\n *\n * ```\n * function isExcludedFromDigest(scope) {\n * while(scope) {\n * if (scope.$isSuspended()) return true;\n * scope = scope.$parent;\n * }\n * return false;\n * ```\n *\n * Be aware that a scope may not be included in digests if it has a suspended ancestor,\n * even if `$isSuspended()` returns false.\n *\n * @returns true if the current scope has been suspended.\n */\n $isSuspended: function() {\n return this.$$suspended;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$resume\n * @kind function\n *\n * @description\n * Resume watchers of this scope subtree in case it was suspended.\n *\n * See {@link $rootScope.Scope#$suspend} for information about the dangers of using this approach.\n */\n $resume: function() {\n this.$$suspended = false;\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 AngularJS\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 AngularJS 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 AngularJS 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 AngularJS from outside of the AngularJS\n * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n * Because we are calling into the AngularJS 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: Pseudo-Code of `$apply()`**\n *\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 AngularJS 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 AngularJS 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 // Use delete in the hope of the browser deallocating the memory for the array entry,\n // while not shifting the array indexes of other listeners.\n // See issue https://github.com/angular/angular.js/issues/16135\n delete namedListeners[indexOfListener];\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 break;\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 and\n // does not check $$suspended)\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 AngularJS 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?|s?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 && uri.trim()).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 *
\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 *
\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 AngularJS, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**: Consider the following case.
\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 *
\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 *
\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.

\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.

\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 *

\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 * \n *

\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, AngularJS 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 * `
implicitly trusted'\">
`) 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 * \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 (`
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}
\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 * \n * \n *
\n *

\n * User comments
\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 *
\n *
\n * {{userComment.name}}:\n * \n *
\n *
\n *
\n *
\n *
\n *\n * \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 * 'Hover over this text.');\n * }]);\n * \n *\n * \n * [\n * { \"name\": \"Alice\",\n * \"htmlComment\":\n * \"Is anyone reading this?\"\n * },\n * { \"name\": \"Bob\",\n * \"htmlComment\": \"Yes! Am I the only other one?\"\n * }\n * ]\n * \n *\n * \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('Is anyone reading this?');\n * });\n *\n * it('should NOT sanitize explicitly trusted values', function() {\n * expect(element(by.id('explicitlyTrustedHtml')).getAttribute('innerHTML')).toBe(\n * 'Hover over this text.');\n * });\n * });\n * \n *
\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 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 AngularJS {@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 * `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such\n * as {@link ngInclude} to download and cache templates.\n *\n * 3rd party modules should use `$templateRequest` if their services or directives are loading\n * templates.\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 AngularJS 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 * AngularJS'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|object} url The URL to be parsed. If `url` is not a string, it will be returned\n * unchanged.\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 if (!isString(url)) return url;\n\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\n * 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 return urlsAreSameOrigin(requestUrl, originUrl);\n}\n\n/**\n * Create a function that can check a URL's origin against a list of allowed/whitelisted origins.\n * The current location's origin is implicitly trusted.\n *\n * @param {string[]} whitelistedOriginUrls - A list of URLs (strings), whose origins are trusted.\n *\n * @returns {Function} - A function that receives a URL (string or parsed URL object) and returns\n * whether it is of an allowed origin.\n */\nfunction urlIsAllowedOriginFactory(whitelistedOriginUrls) {\n var parsedAllowedOriginUrls = [originUrl].concat(whitelistedOriginUrls.map(urlResolve));\n\n /**\n * Check whether the specified URL (string or parsed URL object) has an origin that is allowed\n * based on a list of whitelisted-origin URLs. The current location's origin is implicitly\n * trusted.\n *\n * @param {string|Object} requestUrl - The URL to be checked (provided as a string that will be\n * resolved or a parsed URL object).\n *\n * @returns {boolean} - Whether the specified URL is of an allowed origin.\n */\n return function urlIsAllowedOrigin(requestUrl) {\n var parsedUrl = urlResolve(requestUrl);\n return parsedAllowedOriginUrls.some(urlsAreSameOrigin.bind(null, parsedUrl));\n };\n}\n\n/**\n * Determine if two URLs share the same origin.\n *\n * @param {string|Object} url1 - First URL to compare as a string or a normalized URL in the form of\n * a dictionary object returned by `urlResolve()`.\n * @param {string|object} url2 - Second URL to compare as a string or a normalized URL in the form\n * of a dictionary object returned by `urlResolve()`.\n *\n * @returns {boolean} - True if both URLs have the same origin, and false otherwise.\n */\nfunction urlsAreSameOrigin(url1, url2) {\n url1 = urlResolve(url1);\n url2 = urlResolve(url2);\n\n return (url1.protocol === url2.protocol &&\n url1.host === url2.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 AngularJS 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 \n \n \n
\n \n \n
\n
\n \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 \n
\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 *
\n * **Note:** Filter names must be valid AngularJS {@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 *
\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 AngularJS filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the AngularJS 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. AngularJS 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 \n \n
\n

{{ originalText }}

\n

{{ filteredText }}

\n
\n
\n\n \n angular.module('filterExample', [])\n .controller('MainCtrl', function($scope, $filter) {\n $scope.originalText = 'hello';\n $scope.filteredText = $filter('uppercase')($scope.originalText);\n });\n \n
\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 *
\n * **Note:** Filter names must be valid AngularJS {@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 *
\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 *
\n * **Note**: If the array contains objects that reference themselves, filtering is not possible.\n *
\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 \n \n
\n\n \n \n \n \n \n \n \n
NamePhone
{{friend.name}}{{friend.phone}}
\n
\n
\n
\n
\n
\n \n \n \n \n \n \n
NamePhone
{{friendObj.name}}{{friendObj.phone}}
\n
\n \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 \n
\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 \n \n \n
\n
\n default currency symbol ($): {{amount | currency}}
\n custom currency identifier (USD$): {{amount | currency:\"USD$\"}}
\n no fractions (0): {{amount | currency:\"USD$\":0}}\n
\n
\n \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 \n
\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 the currency symbol is empty, trim whitespace around the symbol\n var currencySymbolRe = !currencySymbol ? /\\s*\\u00A4\\s*/g : /\\u00A4/g;\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(currencySymbolRe, 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 \n \n \n
\n
\n Default formatting: {{val | number}}
\n No fractions: {{val | number:0}}
\n Negative number: {{-val | number:4}}\n
\n
\n \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 \n
\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 \n \n {{1288323623006 | date:'medium'}}:\n {{1288323623006 | date:'medium'}}
\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
\n {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
\n {{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}:\n {{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}
\n
\n \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 \n
\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 \n \n
{{ {'name':'value'} | json }}
\n
{{ {'name':'value'} | json:4 }}
\n
\n \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 \n
\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 \n \n \n
\n \n

{{title}}

\n \n

{{title | uppercase}}

\n
\n
\n
\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 \n \n \n
\n \n

Output numbers: {{ numbers | limitTo:numLimit }}

\n \n

Output letters: {{ letters | limitTo:letterLimit }}

\n \n

Output long number: {{ longNumber | limitTo:longNumberLimit }}

\n
\n
\n \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 \n
\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.
\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.
\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.)=} 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 AngularJS 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.
\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`.)
\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 \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
NamePhone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
\n
\n
\n \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 \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 \n \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 \n
\n *
\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 \n \n
\n
Sort by = {{propertyName}}; reverse = {{reverse}}
\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
{{friend.name}}{{friend.phone}}{{friend.age}}
\n
\n
\n \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 \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\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \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 \n
\n *
\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 \n \n
\n
Sort by = {{propertyName}}; reverse = {{reverse}}
\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
{{friend.name}}{{friend.phone}}{{friend.age}}
\n
\n
\n \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 \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\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \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 \n
\n *
\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 \n \n
\n
\n

Locale-sensitive Comparator

\n \n \n \n \n \n \n \n \n \n
NameFavorite Letter
{{friend.name}}{{friend.favoriteLetter}}
\n
\n
\n

Default Comparator

\n \n \n \n \n \n \n \n \n \n
NameFavorite Letter
{{friend.name}}{{friend.favoriteLetter}}
\n
\n
\n
\n \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 \n \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 \n \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 \n
\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 AngularJS markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * AngularJS has a chance to replace the `{{hash}}` markup with its\n * value. Until AngularJS 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 * link1\n * ```\n *\n * The correct way to write it:\n * ```html\n * link1\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 \n \n
\n link 1 (link, don't reload)
\n link 2 (link, don't reload)
\n link 3 (link, reload!)
\n anchor (link, don't reload)
\n anchor (no link)
\n link (link, change location)\n
\n \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 AngularJS 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 AngularJS 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 \n
\n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS 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 AngularJS replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"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 AngularJS 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 AngularJS replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"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 \n \n
\n \n
\n \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 \n
\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 \n \n
\n \n
\n \n it('should check both checkBoxes', function() {\n expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy();\n element(by.model('leader')).click();\n expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy();\n });\n \n
\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 \n \n
\n \n
\n \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 \n
\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 *
\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 *
\n *\n * @example\n \n \n
\n \n
\n \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 \n
\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 \n \n
\n
\n List\n
    \n
  • Apple
  • \n
  • Orange
  • \n
  • Durian
  • \n
\n
\n
\n \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 \n
\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 `
` 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 AngularJS, 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 `` elements, so\n * AngularJS 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 AngularJS 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, AngularJS prevents the default action (form submission to the server) unless the\n * `` 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 * @animations\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 *
\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 * 
\n *\n * @example\n \n \n \n \n \n userType: \n Required!
\n userType = {{userType}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n \n
\n \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 \n
\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 AngularJS data binding, inherited by most of the `input` elements.\n *\n *\n * @param {string} ngModel Assignable AngularJS 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 AngularJS 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$')`.
\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 AngularJS 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 AngularJS 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 \n \n \n
\n \n
\n \n Required!\n \n Single word only!\n
\n text = {{example.text}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 AngularJS 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 AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"yyyy-MM-dd\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 AngularJS 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 AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 AngularJS 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 AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"HH:mm:ss\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 AngularJS 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 AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"yyyy-Www\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 AngularJS 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 AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid month!\n
\n value = {{example.value | date: \"yyyy-MM\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 *
\n * The model must always be of type `number` otherwise AngularJS 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 *
\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 AngularJS 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 AngularJS 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$')`.
\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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Not valid number!\n
\n value = {{example.value}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \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 \n
\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 *
\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 *
\n *\n * @param {string} ngModel Assignable AngularJS 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 AngularJS 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$')`.
\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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n
\n \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 \n
\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 *
\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 *
\n *\n * @param {string} ngModel Assignable AngularJS 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 AngularJS 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$')`.
\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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Not valid email!\n
\n text = {{email.text}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n myForm.$error.email = {{!!myForm.$error.email}}
\n
\n
\n \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 \n
\n */\n 'email': emailInputType,\n\n\n /**\n * @ngdoc input\n * @name input[radio]\n *\n * @description\n * HTML radio button.\n *\n * **Note:**
\n * All inputs controlled by {@link ngModel ngModel} (including those of type `radio`) will use the\n * value of their `name` attribute to determine the property under which their\n * {@link ngModel.NgModelController NgModelController} will be published on the parent\n * {@link form.FormController FormController}. Thus, if you use the same `name` for multiple\n * inputs of a form (e.g. a group of radio inputs), only _one_ `NgModelController` will be\n * published on the parent `FormController` under that name. The rest of the controllers will\n * continue to work as expected, but you won't be able to access them as properties on the parent\n * `FormController`.\n *\n *
\n *

\n * In plain HTML forms, the `name` attribute is used to identify groups of radio inputs, so\n * that the browser can manage their state (checked/unchecked) based on the state of other\n * inputs in the same group.\n *

\n *

\n * In AngularJS forms, this is not necessary. The input's state will be updated based on the\n * value of the underlying model data.\n *

\n *
\n *\n *
\n * If you omit the `name` attribute on a radio input, `ngModel` will automatically assign it a\n * unique name.\n *
\n *\n * @param {string} ngModel Assignable AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue AngularJS 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 \n \n \n
\n
\n
\n
\n color = {{color.name | json}}
\n
\n Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n
\n \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 \n
\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 AngularJS:\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 ``,\n * if the application sets `model.value = null`, the browser will set the input to `'50'`.\n * AngularJS 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, AngularJS 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 AngularJS 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 AngularJS 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 AngularJS 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 \n \n \n
\n\n Model as range: \n
\n Model as number:
\n Min:
\n Max:
\n value = {{value}}
\n myForm.range.$valid = {{myForm.range.$valid}}
\n myForm.range.$error = {{myForm.range.$error}}\n
\n
\n
\n\n * ## Range Input with ngMin & ngMax attributes\n\n * @example\n \n \n \n
\n Model as range: \n
\n Model as number:
\n Min:
\n Max:
\n value = {{value}}
\n myForm.range.$valid = {{myForm.range.$valid}}
\n myForm.range.$error = {{myForm.range.$error}}\n
\n
\n
\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 AngularJS 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 AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n
\n
\n value1 = {{checkboxModel.value1}}
\n value2 = {{checkboxModel.value2}}
\n
\n
\n \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 \n
\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 // Support: IE9+\n element.on('compositionupdate', function(ev) {\n // End composition when ev.data is empty string on 'compositionupdate' event.\n // When the input de-focusses (e.g. by clicking away), IE triggers 'compositionupdate'\n // instead of 'compositionend'.\n if (isUndefined(ev.data) || ev.data === '') {\n composing = false;\n }\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\", \"cut\" and \"drop\" events to catch it\n if ($sniffer.hasEvent('paste')) {\n element.on('paste cut drop', 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 previousDate;\n var previousTimezone;\n\n ctrl.$$parserName = type;\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n\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 return parseDateAndConvertTimeZoneToLocal(value, previousDate);\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 var timezone = ctrl.$options.getOption('timezone');\n if (timezone) {\n previousTimezone = timezone;\n previousDate = convertTimezoneToLocal(previousDate, timezone, true);\n }\n return $filter('date')(value, format, timezone);\n } else {\n previousDate = null;\n previousTimezone = 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) ? parseDateAndConvertTimeZoneToLocal(val) || undefined : val;\n }\n\n function parseDateAndConvertTimeZoneToLocal(value, previousDate) {\n var timezone = ctrl.$options.getOption('timezone');\n\n if (previousTimezone && previousTimezone !== timezone) {\n // If the timezone has changed, adjust the previousDate to the default timezone\n // so that the new date is converted with the correct timezone offset\n previousDate = addDateMinutes(previousDate, timezoneToOffset(previousTimezone));\n }\n\n var parsedDate = parseDate(value, previousDate);\n\n if (!isNaN(parsedDate) && timezone) {\n parsedDate = convertTimezoneToLocal(parsedDate, timezone);\n }\n return parsedDate;\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 AngularJS 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 AngularJS 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 AngularJS 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$')`.
\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 AngularJS 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 AngularJS will not automatically trim the input.\n *\n * @knownIssue\n *\n * When specifying the `placeholder` attribute of `\n *
{{ list | json }}
\n * \n * \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 * \n * \n *\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 * @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.} $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.} $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.} $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.} $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.} $viewChangeListeners Array of functions to execute whenever\n * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change\n * to {@link ngModel.NgModelController#$modelValue `$modelValue`}.\n * 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 * AngularJS 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. ``).\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 * \n \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 \n \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
behind\n // If strip-br attribute is provided then we strip this out\n if (attrs.stripBr && html === '
') {\n html = '';\n }\n ngModel.$setViewValue(html);\n }\n }\n };\n }]);\n
\n \n
\n
Change me!
\n Required!\n
\n \n
\n
\n \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 \n *
\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 this.$$updateEvents = '';\n // Attach the correct context to the event handler function for updateOn\n this.$$updateEventHandler = this.$$updateEventHandler.bind(this);\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 AngularJS'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\n * \n * \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 * \n * \n *
\n *

Both of these inputs are only updated if they are blurred. Hitting escape should\n * empty them. Follow these steps and observe the difference:

\n *
    \n *
  1. Type something in the input. You will see that the model is not yet updated
  2. \n *
  3. Press the Escape key.\n *
      \n *
    1. 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 *
    2. \n *
    3. 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 *
    4. \n *
    \n *
  4. \n *
\n *\n *
\n *
\n *

Without $rollbackViewValue():

\n * \n * value1: \"{{ model.value1 }}\"\n *
\n *\n *
\n *

With $rollbackViewValue():

\n * \n * value2: \"{{ model.value2 }}\"\n *
\n *
\n *
\n *
\n \n div {\n display: table-cell;\n }\n div:nth-child(1) {\n padding-right: 30px;\n }\n\n \n *
\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 *
\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 *
\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 *
\n * **Note:** this function only affects the options set on the `ngModelController`,\n * and not the options on the {@link ngModelOptions} directive from which they might have been\n * obtained initially.\n *
\n *\n *
\n * **Note:** it is not possible to override the `getterSetter` option.\n *
\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 this.$$setUpdateOnEvents();\n },\n\n /**\n * @ngdoc method\n *\n * @name ngModel.NgModelController#$processModelValue\n\n * @description\n *\n * Runs the model -> view pipeline on the current\n * {@link ngModel.NgModelController#$modelValue $modelValue}.\n *\n * The following actions are performed by this method:\n *\n * - the `$modelValue` is run through the {@link ngModel.NgModelController#$formatters $formatters}\n * and the result is set to the {@link ngModel.NgModelController#$viewValue $viewValue}\n * - the `ng-empty` or `ng-not-empty` class is set on the element\n * - if the `$viewValue` has changed:\n * - {@link ngModel.NgModelController#$render $render} is called on the control\n * - the {@link ngModel.NgModelController#$validators $validators} are run and\n * the validation status is set.\n *\n * This method is called by ngModel internally when the bound scope value changes.\n * Application developers usually do not have to call this function themselves.\n *\n * This function can be used when the `$viewValue` or the rendered DOM value are not correctly\n * formatted and the `$modelValue` must be run through the `$formatters` again.\n *\n * @example\n * Consider a text input with an autocomplete list (for fruit), where the items are\n * objects with a name and an id.\n * A user enters `ap` and then selects `Apricot` from the list.\n * Based on this, the autocomplete widget will call `$setViewValue({name: 'Apricot', id: 443})`,\n * but the rendered value will still be `ap`.\n * The widget can then call `ctrl.$processModelValue()` to run the model -> view\n * pipeline again, which formats the object to the string `Apricot`,\n * then updates the `$viewValue`, and finally renders it in the DOM.\n *\n * \n \n
\n
\n Search Fruit:\n \n
\n
\n Model:
\n
{{selectedFruit | json}}
\n
\n
\n
\n \n angular.module('inputExample', [])\n .controller('inputController', function($scope) {\n $scope.items = [\n {name: 'Apricot', id: 443},\n {name: 'Clementine', id: 972},\n {name: 'Durian', id: 169},\n {name: 'Jackfruit', id: 982},\n {name: 'Strawberry', id: 863}\n ];\n })\n .component('basicAutocomplete', {\n bindings: {\n items: '<',\n onSelect: '&'\n },\n templateUrl: 'autocomplete.html',\n controller: function($element, $scope) {\n var that = this;\n var ngModel;\n\n that.$postLink = function() {\n ngModel = $element.find('input').controller('ngModel');\n\n ngModel.$formatters.push(function(value) {\n return (value && value.name) || value;\n });\n\n ngModel.$parsers.push(function(value) {\n var match = value;\n for (var i = 0; i < that.items.length; i++) {\n if (that.items[i].name === value) {\n match = that.items[i];\n break;\n }\n }\n\n return match;\n });\n };\n\n that.selectItem = function(item) {\n ngModel.$setViewValue(item);\n ngModel.$processModelValue();\n that.onSelect({item: item});\n };\n }\n });\n \n \n
\n \n
    \n
  • \n \n
  • \n
\n
\n
\n *
\n *\n */\n $processModelValue: function() {\n var viewValue = this.$$format();\n\n if (this.$viewValue !== viewValue) {\n this.$$updateEmptyClasses(viewValue);\n this.$viewValue = this.$$lastCommittedViewValue = viewValue;\n this.$render();\n // It is possible that model and view value have been updated during render\n this.$$runValidators(this.$modelValue, this.$viewValue, noop);\n }\n },\n\n /**\n * This method is called internally to run the $formatters on the $modelValue\n */\n $$format: function() {\n var formatters = this.$formatters,\n idx = formatters.length;\n\n var viewValue = this.$modelValue;\n while (idx--) {\n viewValue = formatters[idx](viewValue);\n }\n\n return viewValue;\n },\n\n /**\n * This method is called internally when the bound scope value changes.\n */\n $$setModelValue: function(modelValue) {\n this.$modelValue = this.$$rawModelValue = modelValue;\n this.$$parserValid = undefined;\n this.$processModelValue();\n },\n\n $$setUpdateOnEvents: function() {\n if (this.$$updateEvents) {\n this.$$element.off(this.$$updateEvents, this.$$updateEventHandler);\n }\n\n this.$$updateEvents = this.$options.getOption('updateOn');\n if (this.$$updateEvents) {\n this.$$element.on(this.$$updateEvents, this.$$updateEventHandler);\n }\n },\n\n $$updateEventHandler: function(ev) {\n this.$$debounceViewValueCommit(ev && ev.type);\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 // This cannot be moved to the action function, because it would not catch the\n // case where the model is changed in the ngChange function or the model setter\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.$$setModelValue(modelValue);\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 AngularJS 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 * @restrict A\n * @priority 1\n * @param {expression} ngModel assignable {@link guide/expression Expression} to bind to.\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 * @animations\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 *
\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 * 
\n *\n * @example\n * ### Basic Usage\n * \n \n \n \n

\n Update input to see transitions when valid/invalid.\n Integer is a valid value.\n

\n
\n \n
\n
\n *
\n *\n * @example\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 *
\n * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more\n * frequently than other parts of your code.\n *
\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 `
`, which will enable this behavior for all ``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 * \n \n
\n \n \n \n
user.name = 
\n
\n
\n \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 \n *
\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 modelCtrl.$$setUpdateOnEvents();\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 * @restrict A\n * @priority 10\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 AngularJS expression. This expression should evaluate to an object, whose properties contain\n * the settings. For example: `
\n *
\n * \n *
\n *
\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 *
\n *
\n * \n *
\n *
\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 `
` 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 * ### Overriding immediate updates\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 * \n * \n *
\n *
\n *
\n *
\n *
\n *
user.name = 
\n *
\n *
\n * \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 * \n * \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 * \n *
\n *\n * ### Debouncing updates\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 * \n * \n *
\n *
\n * Name:\n * \n *
\n *
\n *
user.name = 
\n *
\n *
\n * \n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say' };\n * }]);\n * \n *
\n *\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 * \n * \n *
\n *
\n * \n *
\n *
user.name = 
\n *
\n *
\n * \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 * \n *
\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 *\n * ## Programmatically changing options\n *\n * The `ngModelOptions` expression is only evaluated once when the directive is linked; it is not\n * watched for changes. However, it is possible to override the options on a single\n * {@link ngModel.NgModelController} instance with\n * {@link ngModel.NgModelController#$overrideModelOptions `NgModelController#$overrideModelOptions()`}.\n *\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. These are the events that are bound to\n * the control, and when fired, update the `$viewValue` via `$setViewValue`.\n *\n * `ngModelOptions` considers every event that is not listed in `updateOn` a \"default\" event,\n * since different control types use different default events.\n *\n * See also the section {@link ngModelOptions#triggering-and-debouncing-model-updates\n * Triggering and debouncing model updates}.\n *\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 click',\n * debounce: { 'default': 500, 'blur': 0 }\n * }\"\n * ```\n *\n * \"default\" also applies to all events that are listed in `updateOn` but are not\n * listed in `debounce`, i.e. \"click\" would also be debounced by 500 milliseconds.\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 * ``, ``, ... . 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 * Note that changing the timezone will have no effect on the current date, and is only applied after\n * the next input / model change.\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 * @element ANY\n *\n * @description\n * The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current\n * DOM element, including directives on the element itself that have a lower priority than\n * `ngNonBindable`. This is useful if the element contains what appears to be AngularJS directives\n * and bindings but which should be ignored by AngularJS. This could be the case if you have a site\n * that displays snippets of code, for instance.\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 \n \n
Normal: {{1 + 2}}
\n
Ignored: {{1 + 2}}
\n
\n \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 \n
\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 ``\n * DOM element.\n * * `disable`: The result of this expression will be used to disable the rendered `\n * \n *
\n *\n *
\n *
\n *
\n * singleSelect = {{data.singleSelect}}\n *\n *
\n *
\n *
\n * multipleSelect = {{data.multipleSelect}}
\n * \n *
\n * \n * \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 * \n *\n *\n * @example\n * ### Using `ngRepeat` to generate `select` options\n * \n * \n *
\n *
\n * \n * \n *
\n *
\n * model = {{data.model}}
\n *
\n *
\n * \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 * \n *
\n *\n * @example\n * ### Using `ngValue` to bind the model to an array of objects\n * \n * \n *
\n *
\n * \n * \n *
\n *
\n *
model = {{data.model | json}}

\n *
\n *
\n * \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 * \n *
\n *\n * @example\n * ### Using `select` with `ngOptions` and setting a default value\n * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples.\n *\n * \n * \n *
\n *
\n * \n * \n *
\n *
\n * option = {{data.selectedOption}}
\n *
\n *
\n * \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 * \n *
\n *\n * @example\n * ### Binding `select` to a non-string value via `ngModel` parsing / formatting\n *\n * \n * \n * \n * {{ model }}\n * \n * \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 * \n * \n * it('should initialize to model', function() {\n * expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two');\n * });\n * \n * \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 * @param {expression} ngRequired AngularJS expression. If it evaluates to `true`, it sets the\n * `required` attribute to the element and adds the `required`\n * {@link ngModel.NgModelController#$validators `validator`}.\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 AngularJS 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 * \n * \n * \n *
\n *
\n * \n * \n *
\n * \n *
\n *
\n * required error set? = {{form.input.$error.required}}
\n * model = {{model}}\n *
\n *
\n *
\n * \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 * \n *
\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 * @restrict A\n *\n * @param {expression|RegExp} ngPattern AngularJS expression that must evaluate to a `RegExp` or a `String`\n * parsable into a `RegExp`, or a `RegExp` literal. See above for\n * more details.\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 from the `ngPattern` attribute value:\n * - the value is an AngularJS expression:\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 * - If the value is a RegExp literal, e.g. `ngPattern=\"/^\\d+$/\"`, it is used directly.\n *\n *
\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 *
\n *\n *
\n * **Note:** This directive is also added when the plain `pattern` attribute is used, with two\n * differences:\n *
    \n *
  1. \n * `ngPattern` does not set the `pattern` attribute and therefore HTML5 constraint validation is\n * not available.\n *
  2. \n *
  3. \n * The `ngPattern` attribute must be an expression, while the `pattern` value must be\n * interpolated.\n *
  4. \n *
\n *
\n *\n * @example\n * \n * \n * \n *
\n *
\n * \n * \n *
\n * \n *
\n *
\n * input valid? = {{form.input.$valid}}
\n * model = {{model}}\n *
\n *
\n *
\n * \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 * \n *
\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 * @restrict A\n *\n * @param {expression} ngMaxlength AngularJS expression that must evaluate to a `Number` or `String`\n * parsable into a `Number`. Used as value for the `maxlength`\n * {@link ngModel.NgModelController#$validators validator}.\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 AngularJS expression given in the\n * `ngMaxlength` attribute value.\n *\n *
\n * **Note:** This directive is also added when the plain `maxlength` attribute is used, with two\n * differences:\n *
    \n *
  1. \n * `ngMaxlength` does not set the `maxlength` attribute and therefore HTML5 constraint\n * validation is not available.\n *
  2. \n *
  3. \n * The `ngMaxlength` attribute must be an expression, while the `maxlength` value must be\n * interpolated.\n *
  4. \n *
\n *
\n *\n * @example\n * \n * \n * \n *
\n *
\n * \n * \n *
\n * \n *
\n *
\n * input valid? = {{form.input.$valid}}
\n * model = {{model}}\n *
\n *
\n *
\n * \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 * \n *
\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 * @restrict A\n *\n * @param {expression} ngMinlength AngularJS expression that must evaluate to a `Number` or `String`\n * parsable into a `Number`. Used as value for the `minlength`\n * {@link ngModel.NgModelController#$validators validator}.\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 AngularJS expression given in the\n * `ngMinlength` attribute value.\n *\n *
\n * **Note:** This directive is also added when the plain `minlength` attribute is used, with two\n * differences:\n *
    \n *
  1. \n * `ngMinlength` does not set the `minlength` attribute and therefore HTML5 constraint\n * validation is not available.\n *
  2. \n *
  3. \n * The `ngMinlength` value must be an expression, while the `minlength` value must be\n * interpolated.\n *
  4. \n *
\n *
\n *\n * @example\n * \n * \n * \n *
\n *
\n * \n * \n *
\n * \n *
\n *
\n * input valid? = {{form.input.$valid}}
\n * model = {{model}}\n *
\n *
\n *
\n * \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 * \n *
\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 AngularJS 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('');\n/**\n * @license AngularJS v1.6.10\n * (c) 2010-2018 Google, Inc. 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(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 blockTransitions(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\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 $$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 * \n \n
\n \n \n
\n
\n
\n List of items:\n
Item {{item}}
\n
\n
\n
\n
\n \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 \n \n angular.module('ngAnimateChildren', ['ngAnimate'])\n .controller('MainController', function MainController() {\n this.animateChildren = false;\n this.enterElement = false;\n });\n \n
\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 * \n *
\n * This element will go BOOM\n *
\n * \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\nfunction createLocalCacheLookup() {\n var cache = Object.create(null);\n return {\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) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value };\n } else {\n cache[key].total++;\n }\n }\n };\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 var gcsLookup = createLocalCacheLookup();\n var gcsStaggerLookup = createLocalCacheLookup();\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n var parentCounter = 0;\n function gcsHashFn(node, extraClasses) {\n var KEY = '$$ngAnimateParentKey';\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;\n }\n\n function computeCachedCssStyles(node, className, cacheKey, properties) {\n var timings = gcsLookup.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 // 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 gcsLookup.put(cacheKey, timings);\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\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 (gcsLookup.count(cacheKey) > 0) {\n stagger = gcsStaggerLookup.get(cacheKey);\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 gcsStaggerLookup.put(cacheKey, stagger);\n }\n }\n\n return stagger || {};\n }\n\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n gcsLookup.flush();\n gcsStaggerLookup.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) {\n var timings = computeCachedCssStyles(node, className, cacheKey, 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 activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\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 cacheKey, stagger;\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 cacheKey = gcsHashFn(node, fullClassName);\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 : gcsLookup.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 blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey);\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 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 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 (!options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n $$jqLite.removeClass(element, activeClasses);\n\n blockKeyframeAnimations(node, false);\n 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 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 = gcsHashFn(node, fullClassName);\n\n timings = computeTimings(node, fullClassName, cacheKey);\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 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 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\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 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');\n close();\n if (documentHidden) notifyProgress(runner, event, 'close');\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(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', {});\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', {});\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/* 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\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',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler) {\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 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.fn);\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 setRunner(element, runner);\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 var prepareClassName;\n if (isStructural) {\n prepareClassName = 'ng-' + event + PREPARE_CLASS_SUFFIX;\n $$jqLite.addClass(element, prepareClassName);\n }\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 toBeSortedAnimations.push({\n domNode: getDomNode(animationEntry.from ? animationEntry.from.element : animationEntry.element),\n fn: function triggerAnimationStart() {\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 var startAnimationFn, closeFn = animationEntry.close;\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 $$rAFScheduler(sortAnimations(toBeSortedAnimations));\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 element.addClass(NG_ANIMATE_CLASSNAME);\n if (tempClasses) {\n $$jqLite.addClass(element, tempClasses);\n }\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 element.removeClass(NG_ANIMATE_CLASSNAME);\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 * \n * \n *
\n *
\n * {{ number }}\n *
\n *
\n *
\n * \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 * \n * \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 * \n *
\n */\nvar ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $rootScope) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 600, // we use 600 here to ensure that the directive is caught before others\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 previousScope = scope.$new();\n $transclude(previousScope, function(element) {\n previousElement = element;\n $animate.enter(element, 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:ngRepeat#animations ngRepeat} | enter, leave and move |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |\n * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |\n * | {@link ng.directive:form#animations form} & {@link ng.directive:ngModel#animations ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |\n * | {@link module:ngMessages#animations ngMessage} | enter and leave |\n *\n * (More information can be found by visiting each the documentation associated with each directive.)\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 *
\n * Fade me in out\n *
\n * \n * \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 *
\n * Show and hide me\n *
\n * \n *\n * \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 *
\n * Highlight this box\n *
\n * \n *\n * \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 *
\n *
\n *
\n *
\n *
\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 *\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 *
\n * {{ item }}\n *
\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 *
\n * this box is moody\n *
\n * \n * \n * \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 *
\n * Slide in and out\n *
\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 * \n *
\n *
\n *\n * \n * \n * \n * \n *\n * \n * \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 \n \n Home\n
\n
\n
\n
\n
\n \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 \n \n

Welcome to the home page

\n

Please click on an element

\n \n {{ record.title }}\n \n
\n \n
\n {{ profile.title }}\n
\n
\n \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 \n
\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 `` 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 * Hi there\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.6.10' })\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\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.6.10\n * (c) 2010-2018 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngCookies\n * @description\n *\n * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.\n *\n * See {@link ngCookies.$cookies `$cookies`} for usage.\n */\n\n\nangular.module('ngCookies', ['ng']).\n info({ angularVersion: '1.6.10' }).\n /**\n * @ngdoc provider\n * @name $cookiesProvider\n * @description\n * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.\n * */\n provider('$cookies', [/** @this */function $CookiesProvider() {\n /**\n * @ngdoc property\n * @name $cookiesProvider#defaults\n * @description\n *\n * Object containing default options to pass when setting cookies.\n *\n * The object may have following properties:\n *\n * - **path** - `{string}` - The cookie will be available only for this path and its\n * sub-paths. By default, this is the URL that appears in your `` tag.\n * - **domain** - `{string}` - The cookie will be available only for this domain and\n * its sub-domains. For security reasons the user agent will not accept the cookie\n * if the current domain is not a sub-domain of this domain or equal to it.\n * - **expires** - `{string|Date}` - String of the form \"Wdy, DD Mon YYYY HH:MM:SS GMT\"\n * or a Date object indicating the exact date/time this cookie will expire.\n * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a\n * secured connection.\n *\n * Note: By default, the address that appears in your `` tag will be used as the path.\n * This is important so that cookies will be visible for all routes when html5mode is enabled.\n *\n * @example\n *\n * ```js\n * angular.module('cookiesProviderExample', ['ngCookies'])\n * .config(['$cookiesProvider', function($cookiesProvider) {\n * // Setting default options\n * $cookiesProvider.defaults.domain = 'foo.com';\n * $cookiesProvider.defaults.secure = true;\n * }]);\n * ```\n **/\n var defaults = this.defaults = {};\n\n function calcOptions(options) {\n return options ? angular.extend({}, defaults, options) : defaults;\n }\n\n /**\n * @ngdoc service\n * @name $cookies\n *\n * @description\n * Provides read/write access to browser's cookies.\n *\n *
\n * Up until AngularJS 1.3, `$cookies` exposed properties that represented the\n * current browser cookie values. In version 1.4, this behavior has changed, and\n * `$cookies` now provides a standard api of getters, setters etc.\n *
\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * @example\n *\n * ```js\n * angular.module('cookiesExample', ['ngCookies'])\n * .controller('ExampleController', ['$cookies', function($cookies) {\n * // Retrieving a cookie\n * var favoriteCookie = $cookies.get('myFavorite');\n * // Setting a cookie\n * $cookies.put('myFavorite', 'oatmeal');\n * }]);\n * ```\n */\n this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {\n return {\n /**\n * @ngdoc method\n * @name $cookies#get\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {string} Raw cookie value.\n */\n get: function(key) {\n return $$cookieReader()[key];\n },\n\n /**\n * @ngdoc method\n * @name $cookies#getObject\n *\n * @description\n * Returns the deserialized value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value.\n */\n getObject: function(key) {\n var value = this.get(key);\n return value ? angular.fromJson(value) : value;\n },\n\n /**\n * @ngdoc method\n * @name $cookies#getAll\n *\n * @description\n * Returns a key value object with all the cookies\n *\n * @returns {Object} All cookies\n */\n getAll: function() {\n return $$cookieReader();\n },\n\n /**\n * @ngdoc method\n * @name $cookies#put\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {string} value Raw value to be stored.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n put: function(key, value, options) {\n $$cookieWriter(key, value, calcOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $cookies#putObject\n *\n * @description\n * Serializes and sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n putObject: function(key, value, options) {\n this.put(key, angular.toJson(value), options);\n },\n\n /**\n * @ngdoc method\n * @name $cookies#remove\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n remove: function(key, options) {\n $$cookieWriter(key, undefined, calcOptions(options));\n }\n };\n }];\n }]);\n\nangular.module('ngCookies').\n/**\n * @ngdoc service\n * @name $cookieStore\n * @deprecated\n * sinceVersion=\"v1.4.0\"\n * Please use the {@link ngCookies.$cookies `$cookies`} service instead.\n *\n * @requires $cookies\n *\n * @description\n * Provides a key-value (string-object) storage, that is backed by session cookies.\n * Objects put or retrieved from this storage are automatically serialized or\n * deserialized by AngularJS's `toJson`/`fromJson`.\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * @example\n *\n * ```js\n * angular.module('cookieStoreExample', ['ngCookies'])\n * .controller('ExampleController', ['$cookieStore', function($cookieStore) {\n * // Put cookie\n * $cookieStore.put('myFavorite','oatmeal');\n * // Get cookie\n * var favoriteCookie = $cookieStore.get('myFavorite');\n * // Removing a cookie\n * $cookieStore.remove('myFavorite');\n * }]);\n * ```\n */\n factory('$cookieStore', ['$cookies', function($cookies) {\n\n return {\n /**\n * @ngdoc method\n * @name $cookieStore#get\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.\n */\n get: function(key) {\n return $cookies.getObject(key);\n },\n\n /**\n * @ngdoc method\n * @name $cookieStore#put\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n */\n put: function(key, value) {\n $cookies.putObject(key, value);\n },\n\n /**\n * @ngdoc method\n * @name $cookieStore#remove\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n */\n remove: function(key) {\n $cookies.remove(key);\n }\n };\n\n }]);\n\n/**\n * @name $$cookieWriter\n * @requires $document\n *\n * @description\n * This is a private service for writing cookies\n *\n * @param {string} name Cookie name\n * @param {string=} value Cookie value (if undefined, cookie will be deleted)\n * @param {Object=} options Object with options that need to be stored for the cookie.\n */\nfunction $$CookieWriter($document, $log, $browser) {\n var cookiePath = $browser.baseHref();\n var rawDocument = $document[0];\n\n function buildCookieString(name, value, options) {\n var path, expires;\n options = options || {};\n expires = options.expires;\n path = angular.isDefined(options.path) ? options.path : cookiePath;\n if (angular.isUndefined(value)) {\n expires = 'Thu, 01 Jan 1970 00:00:00 GMT';\n value = '';\n }\n if (angular.isString(expires)) {\n expires = new Date(expires);\n }\n\n var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);\n str += path ? ';path=' + path : '';\n str += options.domain ? ';domain=' + options.domain : '';\n str += expires ? ';expires=' + expires.toUTCString() : '';\n str += options.secure ? ';secure' : '';\n\n // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:\n // - 300 cookies\n // - 20 cookies per unique domain\n // - 4096 bytes per cookie\n var cookieLength = str.length + 1;\n if (cookieLength > 4096) {\n $log.warn('Cookie \\'' + name +\n '\\' possibly not set or overflowed because it was too large (' +\n cookieLength + ' > 4096 bytes)!');\n }\n\n return str;\n }\n\n return function(name, value, options) {\n rawDocument.cookie = buildCookieString(name, value, options);\n };\n}\n\n$$CookieWriter.$inject = ['$document', '$log', '$browser'];\n\nangular.module('ngCookies').provider('$$cookieWriter', /** @this */ function $$CookieWriterProvider() {\n this.$get = $$CookieWriter;\n});\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.3.10\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\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 *
\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 \n \n \n
\n Snippet: \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
DirectiveHowSourceRendered
ng-bind-htmlAutomatically uses $sanitize
<div ng-bind-html=\"snippet\">
</div>
ng-bind-htmlBypass $sanitize by explicitly trusting the dangerous value\n
<div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\">\n</div>
\n
ng-bindAutomatically escapes
<div ng-bind=\"snippet\">
</div>
\n
\n
\n \n it('should sanitize the html snippet by default', function() {\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('

an html\\nclick here\\nsnippet

');\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(\"

an html\\n\" +\n \"click here\\n\" +\n \"snippet

\");\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 text');\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('new text');\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(\n 'new text');\n expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(\n \"new <b onclick=\\\"alert(1)\\\">text</b>\");\n });\n
\n
\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 = /^/g,\n DOCTYPE_REGEXP = /]*?)>/i,\n CDATA_REGEXP = //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\nvar svgElements = makeMap(\"animate,animateColor,animateMotion,animateTransform,circle,defs,\" +\n \"desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,\" +\n \"line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,\" +\n \"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,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 'attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,' +\n 'color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,' +\n 'font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,' +\n 'gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,' +\n 'keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,' +\n 'markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,' +\n 'overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,' +\n 'repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,' +\n 'stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,' +\n 'stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,' +\n 'stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,' +\n 'underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,' +\n 'viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,' +\n 'xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,' +\n 'zoomAndPan');\n\nvar validAttrs = angular.extend({},\n uriAttrs,\n svgAttrs,\n htmlAttrs);\n\nfunction makeMap(str) {\n var obj = {}, items = str.split(','), i;\n for (i = 0; i < items.length; i++) obj[items[i]] = true;\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(\"\", 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 html = html.replace(new RegExp(\"(.*)<\\\\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 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)\n break;\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\");\nvar spaceRe = /^(\\s*)([\\s\\S]*?)(\\s*)$/;\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 // Note: IE8 does not preserve spaces at the start/end of innerHTML\n // so we must capture them and reattach them afterward\n var parts = spaceRe.exec(value);\n var spaceBefore = parts[1];\n var spaceAfter = parts[3];\n var content = parts[2];\n if (content) {\n hiddenPre.innerHTML=content.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 }\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 \n *\n * @example\n \n \n \n
\n Snippet: \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FilterSourceRendered
linky filter\n
<div ng-bind-html=\"snippet | linky\">
</div>
\n
\n
\n
linky target\n
<div ng-bind-html=\"snippetWithTarget | linky:'_blank'\">
</div>
\n
\n
\n
no filter
<div ng-bind=\"snippet\">
</div>
\n \n \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 \n \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.;,(){}<>\"”’]/,\n MAILTO_REGEXP = /^mailto:/;\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('');\n addText(text);\n html.push('');\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n/**\n * @license AngularJS v1.3.10\n * (c) 2010-2014 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular, undefined) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngTouch\n * @description\n *\n * # ngTouch\n *\n * The `ngTouch` module provides touch events and other helpers for touch-enabled devices.\n * The implementation is based on jQuery Mobile touch event handling\n * ([jquerymobile.com](http://jquerymobile.com/)).\n *\n *\n * See {@link ngTouch.$swipe `$swipe`} for usage.\n *\n *
\n *\n */\n\n// define ngTouch module\n/* global -ngTouch */\nvar ngTouch = angular.module('ngTouch', []);\n\n/* global ngTouch: false */\n\n /**\n * @ngdoc service\n * @name $swipe\n *\n * @description\n * The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe\n * behavior, to make implementing swipe-related directives more convenient.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * `$swipe` is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`, and by\n * `ngCarousel` in a separate component.\n *\n * # Usage\n * The `$swipe` service is an object with a single method: `bind`. `bind` takes an element\n * which is to be watched for swipes, and an object with four handler functions. See the\n * documentation for `bind` below.\n */\n\nngTouch.factory('$swipe', [function() {\n // The total distance in any direction before we make the call on swipe vs. scroll.\n var MOVE_BUFFER_RADIUS = 10;\n\n var POINTER_EVENTS = {\n 'mouse': {\n start: 'mousedown',\n move: 'mousemove',\n end: 'mouseup'\n },\n 'touch': {\n start: 'touchstart',\n move: 'touchmove',\n end: 'touchend',\n cancel: 'touchcancel'\n }\n };\n\n function getCoordinates(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var e = (event.changedTouches && event.changedTouches[0]) ||\n (event.originalEvent && event.originalEvent.changedTouches &&\n event.originalEvent.changedTouches[0]) ||\n touches[0].originalEvent || touches[0];\n\n return {\n x: e.clientX,\n y: e.clientY\n };\n }\n\n function getEvents(pointerTypes, eventType) {\n var res = [];\n angular.forEach(pointerTypes, function(pointerType) {\n var eventName = POINTER_EVENTS[pointerType][eventType];\n if (eventName) {\n res.push(eventName);\n }\n });\n return res.join(' ');\n }\n\n return {\n /**\n * @ngdoc method\n * @name $swipe#bind\n *\n * @description\n * The main method of `$swipe`. It takes an element to be watched for swipe motions, and an\n * object containing event handlers.\n * The pointer types that should be used can be specified via the optional\n * third argument, which is an array of strings `'mouse'` and `'touch'`. By default,\n * `$swipe` will listen for `mouse` and `touch` events.\n *\n * The four events are `start`, `move`, `end`, and `cancel`. `start`, `move`, and `end`\n * receive as a parameter a coordinates object of the form `{ x: 150, y: 310 }`.\n *\n * `start` is called on either `mousedown` or `touchstart`. After this event, `$swipe` is\n * watching for `touchmove` or `mousemove` events. These events are ignored until the total\n * distance moved in either dimension exceeds a small threshold.\n *\n * Once this threshold is exceeded, either the horizontal or vertical delta is greater.\n * - If the horizontal distance is greater, this is a swipe and `move` and `end` events follow.\n * - If the vertical distance is greater, this is a scroll, and we let the browser take over.\n * A `cancel` event is sent.\n *\n * `move` is called on `mousemove` and `touchmove` after the above logic has determined that\n * a swipe is in progress.\n *\n * `end` is called when a swipe is successfully completed with a `touchend` or `mouseup`.\n *\n * `cancel` is called either on a `touchcancel` from the browser, or when we begin scrolling\n * as described above.\n *\n */\n bind: function(element, eventHandlers, pointerTypes) {\n // Absolute total movement, used to control swipe vs. scroll.\n var totalX, totalY;\n // Coordinates of the start position.\n var startCoords;\n // Last event's position.\n var lastPos;\n // Whether a swipe is active.\n var active = false;\n\n pointerTypes = pointerTypes || ['mouse', 'touch'];\n element.on(getEvents(pointerTypes, 'start'), function(event) {\n startCoords = getCoordinates(event);\n active = true;\n totalX = 0;\n totalY = 0;\n lastPos = startCoords;\n eventHandlers['start'] && eventHandlers['start'](startCoords, event);\n });\n var events = getEvents(pointerTypes, 'cancel');\n if (events) {\n element.on(events, function(event) {\n active = false;\n eventHandlers['cancel'] && eventHandlers['cancel'](event);\n });\n }\n\n element.on(getEvents(pointerTypes, 'move'), function(event) {\n if (!active) return;\n\n // Android will send a touchcancel if it thinks we're starting to scroll.\n // So when the total distance (+ or - or both) exceeds 10px in either direction,\n // we either:\n // - On totalX > totalY, we send preventDefault() and treat this as a swipe.\n // - On totalY > totalX, we let the browser handle it as a scroll.\n\n if (!startCoords) return;\n var coords = getCoordinates(event);\n\n totalX += Math.abs(coords.x - lastPos.x);\n totalY += Math.abs(coords.y - lastPos.y);\n\n lastPos = coords;\n\n if (totalX < MOVE_BUFFER_RADIUS && totalY < MOVE_BUFFER_RADIUS) {\n return;\n }\n\n // One of totalX or totalY has exceeded the buffer, so decide on swipe vs. scroll.\n if (totalY > totalX) {\n // Allow native scrolling to take over.\n active = false;\n eventHandlers['cancel'] && eventHandlers['cancel'](event);\n return;\n } else {\n // Prevent the browser from scrolling.\n event.preventDefault();\n eventHandlers['move'] && eventHandlers['move'](coords, event);\n }\n });\n\n element.on(getEvents(pointerTypes, 'end'), function(event) {\n if (!active) return;\n active = false;\n eventHandlers['end'] && eventHandlers['end'](getCoordinates(event), event);\n });\n }\n };\n}]);\n\n/* global ngTouch: false */\n\n/**\n * @ngdoc directive\n * @name ngClick\n *\n * @description\n * A more powerful replacement for the default ngClick designed to be used on touchscreen\n * devices. Most mobile browsers wait about 300ms after a tap-and-release before sending\n * the click event. This version handles them immediately, and then prevents the\n * following click event from propagating.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * This directive can fall back to using an ordinary click event, and so works on desktop\n * browsers as well as mobile.\n *\n * This directive also sets the CSS class `ng-click-active` while the element is being held\n * down (by a mouse click or touch) so you can restyle the depressed element if you wish.\n *\n * @element ANY\n * @param {expression} ngClick {@link guide/expression Expression} to evaluate\n * upon tap. (Event object is available as `$event`)\n *\n * @example\n \n \n \n count: {{ count }}\n \n \n angular.module('ngClickExample', ['ngTouch']);\n \n \n */\n\nngTouch.config(['$provide', function($provide) {\n $provide.decorator('ngClickDirective', ['$delegate', function($delegate) {\n // drop the default ngClick directive\n $delegate.shift();\n return $delegate;\n }]);\n}]);\n\nngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',\n function($parse, $timeout, $rootElement) {\n var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag.\n var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers.\n var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click\n var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks.\n\n var ACTIVE_CLASS_NAME = 'ng-click-active';\n var lastPreventedTime;\n var touchCoordinates;\n var lastLabelClickCoordinates;\n\n\n // TAP EVENTS AND GHOST CLICKS\n //\n // Why tap events?\n // Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're\n // double-tapping, and then fire a click event.\n //\n // This delay sucks and makes mobile apps feel unresponsive.\n // So we detect touchstart, touchmove, touchcancel and touchend ourselves and determine when\n // the user has tapped on something.\n //\n // What happens when the browser then generates a click event?\n // The browser, of course, also detects the tap and fires a click after a delay. This results in\n // tapping/clicking twice. We do \"clickbusting\" to prevent it.\n //\n // How does it work?\n // We attach global touchstart and click handlers, that run during the capture (early) phase.\n // So the sequence for a tap is:\n // - global touchstart: Sets an \"allowable region\" at the point touched.\n // - element's touchstart: Starts a touch\n // (- touchmove or touchcancel ends the touch, no click follows)\n // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold\n // too long) and fires the user's tap handler. The touchend also calls preventGhostClick().\n // - preventGhostClick() removes the allowable region the global touchstart created.\n // - The browser generates a click event.\n // - The global click handler catches the click, and checks whether it was in an allowable region.\n // - If preventGhostClick was called, the region will have been removed, the click is busted.\n // - If the region is still there, the click proceeds normally. Therefore clicks on links and\n // other elements without ngTap on them work normally.\n //\n // This is an ugly, terrible hack!\n // Yeah, tell me about it. The alternatives are using the slow click events, or making our users\n // deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular\n // encapsulates this ugly logic away from the user.\n //\n // Why not just put click handlers on the element?\n // We do that too, just to be sure. If the tap event caused the DOM to change,\n // it is possible another element is now in that position. To take account for these possibly\n // distinct elements, the handlers are global and care only about coordinates.\n\n // Checks if the coordinates are close enough to be within the region.\n function hit(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD;\n }\n\n // Checks a list of allowable regions against a click location.\n // Returns true if the click should be allowed.\n // Splices out the allowable region from the list after it has been used.\n function checkAllowableRegions(touchCoordinates, x, y) {\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) {\n touchCoordinates.splice(i, i + 2);\n return true; // allowable region\n }\n }\n return false; // No allowable region; bust it.\n }\n\n // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick\n // was called recently.\n function onClick(event) {\n if (Date.now() - lastPreventedTime > PREVENT_DURATION) {\n return; // Too old.\n }\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label\n // and on the input element). Depending on the exact browser, this second click we don't want\n // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label\n // click event\n if (x < 1 && y < 1) {\n return; // offscreen\n }\n if (lastLabelClickCoordinates &&\n lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) {\n return; // input click triggered by label click\n }\n // reset label click coordinates on first subsequent click\n if (lastLabelClickCoordinates) {\n lastLabelClickCoordinates = null;\n }\n // remember label click coordinates to prevent click busting of trigger click event on input\n if (event.target.tagName.toLowerCase() === 'label') {\n lastLabelClickCoordinates = [x, y];\n }\n\n // Look for an allowable region containing this click.\n // If we find one, that means it was created by touchstart and not removed by\n // preventGhostClick, so we don't bust it.\n if (checkAllowableRegions(touchCoordinates, x, y)) {\n return;\n }\n\n // If we didn't find an allowable region, bust the click.\n event.stopPropagation();\n event.preventDefault();\n\n // Blur focused form elements\n event.target && event.target.blur();\n }\n\n\n // Global touchstart handler that creates an allowable region for a click event.\n // This allowable region can be removed by preventGhostClick if we want to bust it.\n function onTouchStart(event) {\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var x = touches[0].clientX;\n var y = touches[0].clientY;\n touchCoordinates.push(x, y);\n\n $timeout(function() {\n // Remove the allowable region.\n for (var i = 0; i < touchCoordinates.length; i += 2) {\n if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {\n touchCoordinates.splice(i, i + 2);\n return;\n }\n }\n }, PREVENT_DURATION, false);\n }\n\n // On the first call, attaches some event handlers. Then whenever it gets called, it creates a\n // zone around the touchstart where clicks will get busted.\n function preventGhostClick(x, y) {\n if (!touchCoordinates) {\n $rootElement[0].addEventListener('click', onClick, true);\n $rootElement[0].addEventListener('touchstart', onTouchStart, true);\n touchCoordinates = [];\n }\n\n lastPreventedTime = Date.now();\n\n checkAllowableRegions(touchCoordinates, x, y);\n }\n\n // Actual linking function.\n return function(scope, element, attr) {\n var clickHandler = $parse(attr.ngClick),\n tapping = false,\n tapElement, // Used to blur the element after a tap.\n startTime, // Used to check if the tap was held too long.\n touchStartX,\n touchStartY;\n\n function resetState() {\n tapping = false;\n element.removeClass(ACTIVE_CLASS_NAME);\n }\n\n element.on('touchstart', function(event) {\n tapping = true;\n tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement.\n // Hack for Safari, which can target text nodes instead of containers.\n if (tapElement.nodeType == 3) {\n tapElement = tapElement.parentNode;\n }\n\n element.addClass(ACTIVE_CLASS_NAME);\n\n startTime = Date.now();\n\n var touches = event.touches && event.touches.length ? event.touches : [event];\n var e = touches[0].originalEvent || touches[0];\n touchStartX = e.clientX;\n touchStartY = e.clientY;\n });\n\n element.on('touchmove', function(event) {\n resetState();\n });\n\n element.on('touchcancel', function(event) {\n resetState();\n });\n\n element.on('touchend', function(event) {\n var diff = Date.now() - startTime;\n\n var touches = (event.changedTouches && event.changedTouches.length) ? event.changedTouches :\n ((event.touches && event.touches.length) ? event.touches : [event]);\n var e = touches[0].originalEvent || touches[0];\n var x = e.clientX;\n var y = e.clientY;\n var dist = Math.sqrt(Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2));\n\n if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) {\n // Call preventGhostClick so the clickbuster will catch the corresponding click.\n preventGhostClick(x, y);\n\n // Blur the focused element (the button, probably) before firing the callback.\n // This doesn't work perfectly on Android Chrome, but seems to work elsewhere.\n // I couldn't get anything to work reliably on Android Chrome.\n if (tapElement) {\n tapElement.blur();\n }\n\n if (!angular.isDefined(attr.disabled) || attr.disabled === false) {\n element.triggerHandler('click', [event]);\n }\n }\n\n resetState();\n });\n\n // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click\n // something else nearby.\n element.onclick = function(event) { };\n\n // Actual click handler.\n // There are three different kinds of clicks, only two of which reach this point.\n // - On desktop browsers without touch events, their clicks will always come here.\n // - On mobile browsers, the simulated \"fast\" click will call this.\n // - But the browser's follow-up slow click will be \"busted\" before it reaches this handler.\n // Therefore it's safe to use this directive on both mobile and desktop.\n element.on('click', function(event, touchend) {\n scope.$apply(function() {\n clickHandler(scope, {$event: (touchend || event)});\n });\n });\n\n element.on('mousedown', function(event) {\n element.addClass(ACTIVE_CLASS_NAME);\n });\n\n element.on('mousemove mouseup', function(event) {\n element.removeClass(ACTIVE_CLASS_NAME);\n });\n\n };\n}]);\n\n/* global ngTouch: false */\n\n/**\n * @ngdoc directive\n * @name ngSwipeLeft\n *\n * @description\n * Specify custom behavior when an element is swiped to the left on a touchscreen device.\n * A leftward swipe is a quick, right-to-left slide of the finger.\n * Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag\n * too.\n *\n * To disable the mouse click and drag functionality, add `ng-swipe-disable-mouse` to\n * the `ng-swipe-left` or `ng-swipe-right` DOM Element.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * @element ANY\n * @param {expression} ngSwipeLeft {@link guide/expression Expression} to evaluate\n * upon left swipe. (Event object is available as `$event`)\n *\n * @example\n \n \n
\n Some list content, like an email in the inbox\n
\n
\n \n \n
\n
\n \n angular.module('ngSwipeLeftExample', ['ngTouch']);\n \n
\n */\n\n/**\n * @ngdoc directive\n * @name ngSwipeRight\n *\n * @description\n * Specify custom behavior when an element is swiped to the right on a touchscreen device.\n * A rightward swipe is a quick, left-to-right slide of the finger.\n * Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag\n * too.\n *\n * Requires the {@link ngTouch `ngTouch`} module to be installed.\n *\n * @element ANY\n * @param {expression} ngSwipeRight {@link guide/expression Expression} to evaluate\n * upon right swipe. (Event object is available as `$event`)\n *\n * @example\n \n \n
\n Some list content, like an email in the inbox\n
\n
\n \n \n
\n
\n \n angular.module('ngSwipeRightExample', ['ngTouch']);\n \n
\n */\n\nfunction makeSwipeDirective(directiveName, direction, eventName) {\n ngTouch.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {\n // The maximum vertical delta for a swipe should be less than 75px.\n var MAX_VERTICAL_DISTANCE = 75;\n // Vertical distance should not be more than a fraction of the horizontal distance.\n var MAX_VERTICAL_RATIO = 0.3;\n // At least a 30px lateral motion is necessary for a swipe.\n var MIN_HORIZONTAL_DISTANCE = 30;\n\n return function(scope, element, attr) {\n var swipeHandler = $parse(attr[directiveName]);\n\n var startCoords, valid;\n\n function validSwipe(coords) {\n // Check that it's within the coordinates.\n // Absolute vertical distance must be within tolerances.\n // Horizontal distance, we take the current X - the starting X.\n // This is negative for leftward swipes and positive for rightward swipes.\n // After multiplying by the direction (-1 for left, +1 for right), legal swipes\n // (ie. same direction as the directive wants) will have a positive delta and\n // illegal ones a negative delta.\n // Therefore this delta must be positive, and larger than the minimum.\n if (!startCoords) return false;\n var deltaY = Math.abs(coords.y - startCoords.y);\n var deltaX = (coords.x - startCoords.x) * direction;\n return valid && // Short circuit for already-invalidated swipes.\n deltaY < MAX_VERTICAL_DISTANCE &&\n deltaX > 0 &&\n deltaX > MIN_HORIZONTAL_DISTANCE &&\n deltaY / deltaX < MAX_VERTICAL_RATIO;\n }\n\n var pointerTypes = ['touch'];\n if (!angular.isDefined(attr['ngSwipeDisableMouse'])) {\n pointerTypes.push('mouse');\n }\n $swipe.bind(element, {\n 'start': function(coords, event) {\n startCoords = coords;\n valid = true;\n },\n 'cancel': function(event) {\n valid = false;\n },\n 'end': function(coords, event) {\n if (validSwipe(coords)) {\n scope.$apply(function() {\n element.triggerHandler(eventName);\n swipeHandler(scope, {$event: event});\n });\n }\n }\n }, pointerTypes);\n };\n }]);\n}\n\n// Left is negative X-coordinate, right is positive.\nmakeSwipeDirective('ngSwipeLeft', -1, 'swipeleft');\nmakeSwipeDirective('ngSwipeRight', 1, 'swiperight');\n\n\n\n})(window, window.angular);\n\n/**\n * State-based routing for AngularJS 1.x\n * NOTICE: This monolithic bundle also bundles the @uirouter/core code.\n * This causes it to be incompatible with plugins that depend on @uirouter/core.\n * We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead.\n * For more information, see https://ui-router.github.io/blog/uirouter-for-angularjs-umd-bundles\n * @version v1.0.14\n * @link https://ui-router.github.io\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('angular')) :\n\ttypeof define === 'function' && define.amd ? define(['exports', 'angular'], factory) :\n\t(factory((global['@uirouter/angularjs'] = {}),global.angular));\n}(this, (function (exports,ng_from_import) { 'use strict';\n\nvar ng_from_global = angular;\nvar ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;\n\n/**\n * Higher order functions\n *\n * These utility functions are exported, but are subject to change without notice.\n *\n * @module common_hof\n */ /** */\n/**\n * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.\n *\n * Given a function with N parameters, returns a new function that supports partial application.\n * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,\n * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to\n * accept more parameters until all N parameters have been supplied.\n *\n *\n * This contrived example uses a partially applied function as an predicate, which returns true\n * if an object is found in both arrays.\n * @example\n * ```\n * // returns true if an object is in both of the two arrays\n * function inBoth(array1, array2, object) {\n * return array1.indexOf(object) !== -1 &&\n * array2.indexOf(object) !== 1;\n * }\n * let obj1, obj2, obj3, obj4, obj5, obj6, obj7\n * let foos = [obj1, obj3]\n * let bars = [obj3, obj4, obj5]\n *\n * // A curried \"copy\" of inBoth\n * let curriedInBoth = curry(inBoth);\n * // Partially apply both the array1 and array2\n * let inFoosAndBars = curriedInBoth(foos, bars);\n *\n * // Supply the final argument; since all arguments are\n * // supplied, the original inBoth function is then called.\n * let obj1InBoth = inFoosAndBars(obj1); // false\n *\n * // Use the inFoosAndBars as a predicate.\n * // Filter, on each iteration, supplies the final argument\n * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];\n * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]\n *\n * ```\n *\n * Stolen from: http://stackoverflow.com/questions/4394747/javascript-curry-function\n *\n * @param fn\n * @returns {*|function(): (*|any)}\n */\nfunction curry(fn) {\n var initial_args = [].slice.apply(arguments, [1]);\n var func_args_length = fn.length;\n function curried(args) {\n if (args.length >= func_args_length)\n return fn.apply(null, args);\n return function () {\n return curried(args.concat([].slice.apply(arguments)));\n };\n }\n return curried(initial_args);\n}\n/**\n * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left\n * given: f(x), g(x), h(x)\n * let composed = compose(f,g,h)\n * then, composed is: f(g(h(x)))\n */\nfunction compose() {\n var args = arguments;\n var start = args.length - 1;\n return function () {\n var i = start, result = args[start].apply(this, arguments);\n while (i--)\n result = args[i].call(this, result);\n return result;\n };\n}\n/**\n * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right\n * given: f(x), g(x), h(x)\n * let piped = pipe(f,g,h);\n * then, piped is: h(g(f(x)))\n */\nfunction pipe() {\n var funcs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n funcs[_i] = arguments[_i];\n }\n return compose.apply(null, [].slice.call(arguments).reverse());\n}\n/**\n * Given a property name, returns a function that returns that property from an object\n * let obj = { foo: 1, name: \"blarg\" };\n * let getName = prop(\"name\");\n * getName(obj) === \"blarg\"\n */\nvar prop = function (name) {\n return function (obj) { return obj && obj[name]; };\n};\n/**\n * Given a property name and a value, returns a function that returns a boolean based on whether\n * the passed object has a property that matches the value\n * let obj = { foo: 1, name: \"blarg\" };\n * let getName = propEq(\"name\", \"blarg\");\n * getName(obj) === true\n */\nvar propEq = curry(function (name, _val, obj) { return obj && obj[name] === _val; });\n/**\n * Given a dotted property name, returns a function that returns a nested property from an object, or undefined\n * let obj = { id: 1, nestedObj: { foo: 1, name: \"blarg\" }, };\n * let getName = prop(\"nestedObj.name\");\n * getName(obj) === \"blarg\"\n * let propNotFound = prop(\"this.property.doesnt.exist\");\n * propNotFound(obj) === undefined\n */\nvar parse = function (name) {\n return pipe.apply(null, name.split('.').map(prop));\n};\n/**\n * Given a function that returns a truthy or falsey value, returns a\n * function that returns the opposite (falsey or truthy) value given the same inputs\n */\nvar not = function (fn) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return !fn.apply(null, args);\n };\n};\n/**\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\n * if both functions return truthy for the given arguments\n */\nfunction and(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) && fn2.apply(null, args);\n };\n}\n/**\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\n * if at least one of the functions returns truthy for the given arguments\n */\nfunction or(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) || fn2.apply(null, args);\n };\n}\n/**\n * Check if all the elements of an array match a predicate function\n *\n * @param fn1 a predicate function `fn1`\n * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array\n */\nvar all = function (fn1) {\n return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); };\n};\n// tslint:disable-next-line:variable-name\nvar any = function (fn1) {\n return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); };\n};\n/** Given a class, returns a Predicate function that returns true if the object is of that class */\nvar is = function (ctor) {\n return function (obj) {\n return (obj != null && obj.constructor === ctor || obj instanceof ctor);\n };\n};\n/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */\nvar eq = function (value) { return function (other) {\n return value === other;\n}; };\n/** Given a value, returns a function which returns the value */\nvar val = function (v) { return function () { return v; }; };\nfunction invoke(fnName, args) {\n return function (obj) {\n return obj[fnName].apply(obj, args);\n };\n}\n/**\n * Sorta like Pattern Matching (a functional programming conditional construct)\n *\n * See http://c2.com/cgi/wiki?PatternMatching\n *\n * This is a conditional construct which allows a series of predicates and output functions\n * to be checked and then applied. Each predicate receives the input. If the predicate\n * returns truthy, then its matching output function (mapping function) is provided with\n * the input and, then the result is returned.\n *\n * Each combination (2-tuple) of predicate + output function should be placed in an array\n * of size 2: [ predicate, mapFn ]\n *\n * These 2-tuples should be put in an outer array.\n *\n * @example\n * ```\n *\n * // Here's a 2-tuple where the first element is the isString predicate\n * // and the second element is a function that returns a description of the input\n * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];\n *\n * // Second tuple: predicate \"isNumber\", mapfn returns a description\n * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];\n *\n * let third = [ (input) => input === null, (input) => `Oh, null...` ];\n *\n * let fourth = [ (input) => input === undefined, (input) => `notdefined` ];\n *\n * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);\n *\n * console.log(descriptionOf(undefined)); // 'notdefined'\n * console.log(descriptionOf(55)); // '(55) That's a number!'\n * console.log(descriptionOf(\"foo\")); // 'Here's your string foo'\n * ```\n *\n * @param struct A 2D array. Each element of the array should be an array, a 2-tuple,\n * with a Predicate and a mapping/output function\n * @returns {function(any): *}\n */\nfunction pattern(struct) {\n return function (x) {\n for (var i = 0; i < struct.length; i++) {\n if (struct[i][0](x))\n return struct[i][1](x);\n }\n };\n}\n\n/**\n * @coreapi\n * @module core\n */\n/**\n * Matches state names using glob-like pattern strings.\n *\n * Globs can be used in specific APIs including:\n *\n * - [[StateService.is]]\n * - [[StateService.includes]]\n * - The first argument to Hook Registration functions like [[TransitionService.onStart]]\n * - [[HookMatchCriteria]] and [[HookMatchCriterion]]\n *\n * A `Glob` string is a pattern which matches state names.\n * Nested state names are split into segments (separated by a dot) when processing.\n * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz']\n *\n * Globs work according to the following rules:\n *\n * ### Exact match:\n *\n * The glob `'A.B'` matches the state named exactly `'A.B'`.\n *\n * | Glob |Matches states named|Does not match state named|\n * |:------------|:--------------------|:---------------------|\n * | `'A'` | `'A'` | `'B'` , `'A.C'` |\n * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` |\n * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`|\n *\n * ### Single star (`*`)\n *\n * A single star (`*`) is a wildcard that matches exactly one segment.\n *\n * | Glob |Matches states named |Does not match state named |\n * |:------------|:---------------------|:--------------------------|\n * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` |\n * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` |\n * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`|\n *\n * ### Double star (`**`)\n *\n * A double star (`'**'`) is a wildcard that matches *zero or more segments*\n *\n * | Glob |Matches states named |Does not match state named |\n * |:------------|:----------------------------------------------|:----------------------------------|\n * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) |\n * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` |\n * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` |\n * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` |\n *\n */\nvar Glob = /** @class */ (function () {\n function Glob(text) {\n this.text = text;\n this.glob = text.split('.');\n var regexpString = this.text.split('.')\n .map(function (seg) {\n if (seg === '**')\n return '(?:|(?:\\\\.[^.]*)*)';\n if (seg === '*')\n return '\\\\.[^.]*';\n return '\\\\.' + seg;\n }).join('');\n this.regexp = new RegExp('^' + regexpString + '$');\n }\n /** Returns true if the string has glob-like characters in it */\n Glob.is = function (text) {\n return !!/[!,*]+/.exec(text);\n };\n /** Returns a glob from the string, or null if the string isn't Glob-like */\n Glob.fromString = function (text) {\n return Glob.is(text) ? new Glob(text) : null;\n };\n Glob.prototype.matches = function (name) {\n return this.regexp.test('.' + name);\n };\n return Glob;\n}());\n\n/**\n * Internal representation of a UI-Router state.\n *\n * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]].\n *\n * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object.\n *\n * This class prototypally inherits from the corresponding [[StateDeclaration]].\n * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].\n */\nvar StateObject = /** @class */ (function () {\n /** @deprecated use State.create() */\n function StateObject(config) {\n return StateObject.create(config || {});\n }\n /**\n * Create a state object to put the private/internal implementation details onto.\n * The object's prototype chain looks like:\n * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)\n *\n * @param stateDecl the user-supplied State Declaration\n * @returns {StateObject} an internal State object\n */\n StateObject.create = function (stateDecl) {\n stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl;\n var state = inherit(inherit(stateDecl, StateObject.prototype));\n stateDecl.$$state = function () { return state; };\n state.self = stateDecl;\n state.__stateObjectCache = {\n nameGlob: Glob.fromString(state.name),\n };\n return state;\n };\n /**\n * Returns true if the provided parameter is the same state.\n *\n * Compares the identity of the state against the passed value, which is either an object\n * reference to the actual `State` instance, the original definition object passed to\n * `$stateProvider.state()`, or the fully-qualified name.\n *\n * @param ref Can be one of (a) a `State` instance, (b) an object that was passed\n * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.\n * @returns Returns `true` if `ref` matches the current `State` instance.\n */\n StateObject.prototype.is = function (ref) {\n return this === ref || this.self === ref || this.fqn() === ref;\n };\n /**\n * @deprecated this does not properly handle dot notation\n * @returns Returns a dot-separated name of the state.\n */\n StateObject.prototype.fqn = function () {\n if (!this.parent || !(this.parent instanceof this.constructor))\n return this.name;\n var name = this.parent.fqn();\n return name ? name + '.' + this.name : this.name;\n };\n /**\n * Returns the root node of this state's tree.\n *\n * @returns The root of this state's tree.\n */\n StateObject.prototype.root = function () {\n return this.parent && this.parent.root() || this;\n };\n /**\n * Gets the state's `Param` objects\n *\n * Gets the list of [[Param]] objects owned by the state.\n * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.\n * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object\n *\n * @param opts options\n */\n StateObject.prototype.parameters = function (opts) {\n opts = defaults(opts, { inherit: true, matchingKeys: null });\n var inherited = opts.inherit && this.parent && this.parent.parameters() || [];\n return inherited.concat(values(this.params))\n .filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); });\n };\n /**\n * Returns a single [[Param]] that is owned by the state\n *\n * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.\n * @param id the name of the [[Param]] to return\n * @param opts options\n */\n StateObject.prototype.parameter = function (id, opts) {\n if (opts === void 0) { opts = {}; }\n return (this.url && this.url.parameter(id, opts) ||\n find(values(this.params), propEq('id', id)) ||\n opts.inherit && this.parent && this.parent.parameter(id));\n };\n StateObject.prototype.toString = function () {\n return this.fqn();\n };\n /** Predicate which returns true if the object is an class with @State() decorator */\n StateObject.isStateClass = function (stateDecl) {\n return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;\n };\n /** Predicate which returns true if the object is an internal [[StateObject]] object */\n StateObject.isState = function (obj) {\n return isObject(obj['__stateObjectCache']);\n };\n return StateObject;\n}());\n\n/** Predicates\n *\n * These predicates return true/false based on the input.\n * Although these functions are exported, they are subject to change without notice.\n *\n * @module common_predicates\n */\n/** */\nvar toStr = Object.prototype.toString;\nvar tis = function (t) { return function (x) { return typeof (x) === t; }; };\nvar isUndefined = tis('undefined');\nvar isDefined = not(isUndefined);\nvar isNull = function (o) { return o === null; };\nvar isNullOrUndefined = or(isNull, isUndefined);\nvar isFunction = tis('function');\nvar isNumber = tis('number');\nvar isString = tis('string');\nvar isObject = function (x) { return x !== null && typeof x === 'object'; };\nvar isArray = Array.isArray;\nvar isDate = (function (x) { return toStr.call(x) === '[object Date]'; });\nvar isRegExp = (function (x) { return toStr.call(x) === '[object RegExp]'; });\nvar isState = StateObject.isState;\n/**\n * Predicate which checks if a value is injectable\n *\n * A value is \"injectable\" if it is a function, or if it is an ng1 array-notation-style array\n * where all the elements in the array are Strings, except the last one, which is a Function\n */\nfunction isInjectable(val$$1) {\n if (isArray(val$$1) && val$$1.length) {\n var head = val$$1.slice(0, -1), tail = val$$1.slice(-1);\n return !(head.filter(not(isString)).length || tail.filter(not(isFunction)).length);\n }\n return isFunction(val$$1);\n}\n/**\n * Predicate which checks if a value looks like a Promise\n *\n * It is probably a Promise if it's an object, and it has a `then` property which is a Function\n */\nvar isPromise = and(isObject, pipe(prop('then'), isFunction));\n\nvar notImplemented = function (fnname) { return function () {\n throw new Error(fnname + \"(): No coreservices implementation for UI-Router is loaded.\");\n}; };\nvar services = {\n $q: undefined,\n $injector: undefined,\n};\n\n/**\n * Random utility functions used in the UI-Router code\n *\n * These functions are exported, but are subject to change without notice.\n *\n * @preferred\n * @module common\n */\n/** for typedoc */\nvar root = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global) || undefined;\nvar angular$1 = root.angular || {};\nvar fromJson = angular$1.fromJson || JSON.parse.bind(JSON);\nvar toJson = angular$1.toJson || JSON.stringify.bind(JSON);\nvar forEach = angular$1.forEach || _forEach;\nvar extend = Object.assign || _extend;\nvar equals = angular$1.equals || _equals;\nfunction identity(x) { return x; }\nfunction noop() { }\n/**\n * Builds proxy functions on the `to` object which pass through to the `from` object.\n *\n * For each key in `fnNames`, creates a proxy function on the `to` object.\n * The proxy function calls the real function on the `from` object.\n *\n *\n * #### Example:\n * This example creates an new class instance whose functions are prebound to the new'd object.\n * ```js\n * class Foo {\n * constructor(data) {\n * // Binds all functions from Foo.prototype to 'this',\n * // then copies them to 'this'\n * bindFunctions(Foo.prototype, this, this);\n * this.data = data;\n * }\n *\n * log() {\n * console.log(this.data);\n * }\n * }\n *\n * let myFoo = new Foo([1,2,3]);\n * var logit = myFoo.log;\n * logit(); // logs [1, 2, 3] from the myFoo 'this' instance\n * ```\n *\n * #### Example:\n * This example creates a bound version of a service function, and copies it to another object\n * ```\n *\n * var SomeService = {\n * this.data = [3, 4, 5];\n * this.log = function() {\n * console.log(this.data);\n * }\n * }\n *\n * // Constructor fn\n * function OtherThing() {\n * // Binds all functions from SomeService to SomeService,\n * // then copies them to 'this'\n * bindFunctions(SomeService, this, SomeService);\n * }\n *\n * let myOtherThing = new OtherThing();\n * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'\n * ```\n *\n * @param source A function that returns the source object which contains the original functions to be bound\n * @param target A function that returns the target object which will receive the bound functions\n * @param bind A function that returns the object which the functions will be bound to\n * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object)\n * @param latebind If true, the binding of the function is delayed until the first time it's invoked\n */\nfunction createProxyFunctions(source, target, bind, fnNames, latebind) {\n if (latebind === void 0) { latebind = false; }\n var bindFunction = function (fnName) {\n return source()[fnName].bind(bind());\n };\n var makeLateRebindFn = function (fnName) { return function lateRebindFunction() {\n target[fnName] = bindFunction(fnName);\n return target[fnName].apply(null, arguments);\n }; };\n fnNames = fnNames || Object.keys(source());\n return fnNames.reduce(function (acc, name) {\n acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);\n return acc;\n }, target);\n}\n/**\n * prototypal inheritance helper.\n * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it\n */\nvar inherit = function (parent, extra) {\n return extend(Object.create(parent), extra);\n};\n/** Given an array, returns true if the object is found in the array, (using indexOf) */\nvar inArray = curry(_inArray);\nfunction _inArray(array, obj) {\n return array.indexOf(obj) !== -1;\n}\n/**\n * Given an array, and an item, if the item is found in the array, it removes it (in-place).\n * The same array is returned\n */\nvar removeFrom = curry(_removeFrom);\nfunction _removeFrom(array, obj) {\n var idx = array.indexOf(obj);\n if (idx >= 0)\n array.splice(idx, 1);\n return array;\n}\n/** pushes a values to an array and returns the value */\nvar pushTo = curry(_pushTo);\nfunction _pushTo(arr, val$$1) {\n return (arr.push(val$$1), val$$1);\n}\n/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */\nvar deregAll = function (functions) {\n return functions.slice().forEach(function (fn) {\n typeof fn === 'function' && fn();\n removeFrom(functions, fn);\n });\n};\n/**\n * Applies a set of defaults to an options object. The options object is filtered\n * to only those properties of the objects in the defaultsList.\n * Earlier objects in the defaultsList take precedence when applying defaults.\n */\nfunction defaults(opts) {\n var defaultsList = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n defaultsList[_i - 1] = arguments[_i];\n }\n var _defaultsList = defaultsList.concat({}).reverse();\n var defaultVals = extend.apply(null, _defaultsList);\n return extend({}, defaultVals, pick(opts || {}, Object.keys(defaultVals)));\n}\n/** Reduce function that merges each element of the list into a single object, using extend */\nvar mergeR = function (memo, item) { return extend(memo, item); };\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 for (var n in first.path) {\n if (first.path[n] !== second.path[n])\n break;\n path.push(first.path[n]);\n }\n return path;\n}\n/**\n * Return a copy of the object only containing the whitelisted properties.\n *\n * #### Example:\n * ```\n * var foo = { a: 1, b: 2, c: 3 };\n * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }\n * ```\n * @param obj the source object\n * @param propNames an Array of strings, which are the whitelisted property names\n */\nfunction pick(obj, propNames) {\n var objCopy = {};\n for (var _prop in obj) {\n if (propNames.indexOf(_prop) !== -1) {\n objCopy[_prop] = obj[_prop];\n }\n }\n return objCopy;\n}\n/**\n * Return a copy of the object omitting the blacklisted properties.\n *\n * @example\n * ```\n *\n * var foo = { a: 1, b: 2, c: 3 };\n * var ab = omit(foo, ['a', 'b']); // { c: 3 }\n * ```\n * @param obj the source object\n * @param propNames an Array of strings, which are the blacklisted property names\n */\nfunction omit(obj, propNames) {\n return Object.keys(obj)\n .filter(not(inArray(propNames)))\n .reduce(function (acc, key) { return (acc[key] = obj[key], acc); }, {});\n}\n/**\n * Maps an array, or object to a property (by name)\n */\nfunction pluck(collection, propName) {\n return map(collection, prop(propName));\n}\n/** Filters an Array or an Object's properties based on a predicate */\nfunction filter(collection, callback) {\n var arr = isArray(collection), result = arr ? [] : {};\n var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return result[key] = x; };\n forEach(collection, function (item, i) {\n if (callback(item, i))\n accept(item, i);\n });\n return result;\n}\n/** Finds an object from an array, or a property of an object, that matches a predicate */\nfunction find(collection, callback) {\n var result;\n forEach(collection, function (item, i) {\n if (result)\n return;\n if (callback(item, i))\n result = item;\n });\n return result;\n}\n/** Given an object, returns a new object, where each property is transformed by the callback function */\nvar mapObj = map;\n/** Maps an array or object properties using a callback function */\nfunction map(collection, callback, target) {\n target = target || (isArray(collection) ? [] : {});\n forEach(collection, function (item, i) { return target[i] = callback(item, i); });\n return target;\n}\n/**\n * Given an object, return its enumerable property values\n *\n * @example\n * ```\n *\n * let foo = { a: 1, b: 2, c: 3 }\n * let vals = values(foo); // [ 1, 2, 3 ]\n * ```\n */\nvar values = function (obj) {\n return Object.keys(obj).map(function (key) { return obj[key]; });\n};\n/**\n * Reduce function that returns true if all of the values are truthy.\n *\n * @example\n * ```\n *\n * let vals = [ 1, true, {}, \"hello world\"];\n * vals.reduce(allTrueR, true); // true\n *\n * vals.push(0);\n * vals.reduce(allTrueR, true); // false\n * ```\n */\nvar allTrueR = function (memo, elem) { return memo && elem; };\n/**\n * Reduce function that returns true if any of the values are truthy.\n *\n * * @example\n * ```\n *\n * let vals = [ 0, null, undefined ];\n * vals.reduce(anyTrueR, true); // false\n *\n * vals.push(\"hello world\");\n * vals.reduce(anyTrueR, true); // true\n * ```\n */\nvar anyTrueR = function (memo, elem) { return memo || elem; };\n/**\n * Reduce function which un-nests a single level of arrays\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\n * ```\n */\nvar unnestR = function (memo, elem) { return memo.concat(elem); };\n/**\n * Reduce function which recursively un-nests all arrays\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\n * ```\n */\nvar flattenR = function (memo, elem) {\n return isArray(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem);\n};\n/**\n * Reduce function that pushes an object to an array, then returns the array.\n * Mostly just for [[flattenR]] and [[uniqR]]\n */\nfunction pushR(arr, obj) {\n arr.push(obj);\n return arr;\n}\n/** Reduce function that filters out duplicates */\nvar uniqR = function (acc, token) {\n return inArray(acc, token) ? acc : pushR(acc, token);\n};\n/**\n * Return a new array with a single level of arrays unnested.\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * unnest(input) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\n * ```\n */\nvar unnest = function (arr) { return arr.reduce(unnestR, []); };\n/**\n * Return a completely flattened version of an array.\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * flatten(input) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\n * ```\n */\nvar flatten = function (arr) { return arr.reduce(flattenR, []); };\n/**\n * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.\n * @example\n * ```\n *\n * let isNumber = (obj) => typeof(obj) === 'number';\n * let allNumbers = [ 1, 2, 3, 4, 5 ];\n * allNumbers.filter(assertPredicate(isNumber)); //OK\n *\n * let oneString = [ 1, 2, 3, 4, \"5\" ];\n * oneString.filter(assertPredicate(isNumber, \"Not all numbers\")); // throws Error(\"\"Not all numbers\"\");\n * ```\n */\nvar assertPredicate = assertFn;\n/**\n * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test.\n * @example\n * ```\n *\n * var data = { foo: 1, bar: 2 };\n *\n * let keys = [ 'foo', 'bar' ]\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\n * // values is [1, 2]\n *\n * let keys = [ 'foo', 'bar', 'baz' ]\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\n * // throws Error(\"Key not found\")\n * ```\n */\nvar assertMap = assertFn;\nfunction assertFn(predicateOrMap, errMsg) {\n if (errMsg === void 0) { errMsg = 'assert failure'; }\n return function (obj) {\n var result = predicateOrMap(obj);\n if (!result) {\n throw new Error(isFunction(errMsg) ? errMsg(obj) : errMsg);\n }\n return result;\n };\n}\n/**\n * Like _.pairs: Given an object, returns an array of key/value pairs\n *\n * @example\n * ```\n *\n * pairs({ foo: \"FOO\", bar: \"BAR }) // [ [ \"foo\", \"FOO\" ], [ \"bar\": \"BAR\" ] ]\n * ```\n */\nvar pairs = function (obj) {\n return Object.keys(obj).map(function (key) { return [key, obj[key]]; });\n};\n/**\n * Given two or more parallel arrays, returns an array of tuples where\n * each tuple is composed of [ a[i], b[i], ... z[i] ]\n *\n * @example\n * ```\n *\n * let foo = [ 0, 2, 4, 6 ];\n * let bar = [ 1, 3, 5, 7 ];\n * let baz = [ 10, 30, 50, 70 ];\n * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]\n * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]\n * ```\n */\nfunction arrayTuples() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 0)\n return [];\n var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER\n var result = [];\n var _loop_1 = function (i) {\n // This is a hot function\n // Unroll when there are 1-4 arguments\n switch (args.length) {\n case 1:\n result.push([args[0][i]]);\n break;\n case 2:\n result.push([args[0][i], args[1][i]]);\n break;\n case 3:\n result.push([args[0][i], args[1][i], args[2][i]]);\n break;\n case 4:\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\n break;\n default:\n result.push(args.map(function (array) { return array[i]; }));\n break;\n }\n };\n for (var i = 0; i < maxArrayLen; i++) {\n _loop_1(i);\n }\n return result;\n}\n/**\n * Reduce function which builds an object from an array of [key, value] pairs.\n *\n * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration.\n *\n * Each keyValueTuple should be an array with values [ key: string, value: any ]\n *\n * @example\n * ```\n *\n * var pairs = [ [\"fookey\", \"fooval\"], [\"barkey\", \"barval\"] ]\n *\n * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {})\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\n *\n * // Or, more simply:\n * var pairsToObj = pairs.reduce(applyPairs, {})\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\n * ```\n */\nfunction applyPairs(memo, keyValTuple) {\n var key, value;\n if (isArray(keyValTuple))\n key = keyValTuple[0], value = keyValTuple[1];\n if (!isString(key))\n throw new Error('invalid parameters to applyPairs');\n memo[key] = value;\n return memo;\n}\n/** Get the last element of an array */\nfunction tail(arr) {\n return arr.length && arr[arr.length - 1] || undefined;\n}\n/**\n * shallow copy from src to dest\n */\nfunction copy(src, dest) {\n if (dest)\n Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n if (!dest)\n dest = {};\n return extend(dest, src);\n}\n/** Naive forEach implementation works with Objects or Arrays */\nfunction _forEach(obj, cb, _this) {\n if (isArray(obj))\n return obj.forEach(cb, _this);\n Object.keys(obj).forEach(function (key) { return cb(obj[key], key); });\n}\nfunction _extend(toObj) {\n for (var i = 1; i < arguments.length; i++) {\n var obj = arguments[i];\n if (!obj)\n continue;\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; j++) {\n toObj[keys[j]] = obj[keys[j]];\n }\n }\n return toObj;\n}\nfunction _equals(o1, o2) {\n if (o1 === o2)\n return true;\n if (o1 === null || o2 === null)\n return false;\n if (o1 !== o1 && o2 !== o2)\n return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2;\n if (t1 !== t2 || t1 !== 'object')\n return false;\n var tup = [o1, o2];\n if (all(isArray)(tup))\n return _arraysEq(o1, o2);\n if (all(isDate)(tup))\n return o1.getTime() === o2.getTime();\n if (all(isRegExp)(tup))\n return o1.toString() === o2.toString();\n if (all(isFunction)(tup))\n return true; // meh\n var predicates = [isFunction, isArray, isDate, isRegExp];\n if (predicates.map(any).reduce(function (b, fn) { return b || !!fn(tup); }, false))\n return false;\n var keys = {};\n for (var key in o1) {\n if (!_equals(o1[key], o2[key]))\n return false;\n keys[key] = true;\n }\n for (var key in o2) {\n if (!keys[key])\n return false;\n }\n return true;\n}\nfunction _arraysEq(a1, a2) {\n if (a1.length !== a2.length)\n return false;\n return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true);\n}\n// issue #2676\nvar silenceUncaughtInPromise = function (promise) {\n return promise.catch(function (e) { return 0; }) && promise;\n};\nvar silentRejection = function (error) {\n return silenceUncaughtInPromise(services.$q.reject(error));\n};\n\n/**\n * @module common\n */\n/** for typedoc */\nvar Queue = /** @class */ (function () {\n function Queue(_items, _limit) {\n if (_items === void 0) { _items = []; }\n if (_limit === void 0) { _limit = null; }\n this._items = _items;\n this._limit = _limit;\n this._evictListeners = [];\n this.onEvict = pushTo(this._evictListeners);\n }\n Queue.prototype.enqueue = function (item) {\n var items = this._items;\n items.push(item);\n if (this._limit && items.length > this._limit)\n this.evict();\n return item;\n };\n Queue.prototype.evict = function () {\n var item = this._items.shift();\n this._evictListeners.forEach(function (fn) { return fn(item); });\n return item;\n };\n Queue.prototype.dequeue = function () {\n if (this.size())\n return this._items.splice(0, 1)[0];\n };\n Queue.prototype.clear = function () {\n var current = this._items;\n this._items = [];\n return current;\n };\n Queue.prototype.size = function () {\n return this._items.length;\n };\n Queue.prototype.remove = function (item) {\n var idx = this._items.indexOf(item);\n return idx > -1 && this._items.splice(idx, 1)[0];\n };\n Queue.prototype.peekTail = function () {\n return this._items[this._items.length - 1];\n };\n Queue.prototype.peekHead = function () {\n if (this.size())\n return this._items[0];\n };\n return Queue;\n}());\n\n/**\n * @coreapi\n * @module transition\n */ /** for typedoc */\n\n(function (RejectType) {\n RejectType[RejectType[\"SUPERSEDED\"] = 2] = \"SUPERSEDED\";\n RejectType[RejectType[\"ABORTED\"] = 3] = \"ABORTED\";\n RejectType[RejectType[\"INVALID\"] = 4] = \"INVALID\";\n RejectType[RejectType[\"IGNORED\"] = 5] = \"IGNORED\";\n RejectType[RejectType[\"ERROR\"] = 6] = \"ERROR\";\n})(exports.RejectType || (exports.RejectType = {}));\n/** @hidden */\nvar id = 0;\nvar Rejection = /** @class */ (function () {\n function Rejection(type, message, detail) {\n this.$id = id++;\n this.type = type;\n this.message = message;\n this.detail = detail;\n }\n /** Returns true if the obj is a rejected promise created from the `asPromise` factory */\n Rejection.isRejectionPromise = function (obj) {\n return obj && (typeof obj.then === 'function') && is(Rejection)(obj._transitionRejection);\n };\n /** Returns a Rejection due to transition superseded */\n Rejection.superseded = function (detail, options) {\n var message = 'The transition has been superseded by a different transition';\n var rejection = new Rejection(exports.RejectType.SUPERSEDED, message, detail);\n if (options && options.redirected) {\n rejection.redirected = true;\n }\n return rejection;\n };\n /** Returns a Rejection due to redirected transition */\n Rejection.redirected = function (detail) {\n return Rejection.superseded(detail, { redirected: true });\n };\n /** Returns a Rejection due to invalid transition */\n Rejection.invalid = function (detail) {\n var message = 'This transition is invalid';\n return new Rejection(exports.RejectType.INVALID, message, detail);\n };\n /** Returns a Rejection due to ignored transition */\n Rejection.ignored = function (detail) {\n var message = 'The transition was ignored';\n return new Rejection(exports.RejectType.IGNORED, message, detail);\n };\n /** Returns a Rejection due to aborted transition */\n Rejection.aborted = function (detail) {\n var message = 'The transition has been aborted';\n return new Rejection(exports.RejectType.ABORTED, message, detail);\n };\n /** Returns a Rejection due to aborted transition */\n Rejection.errored = function (detail) {\n var message = 'The transition errored';\n return new Rejection(exports.RejectType.ERROR, message, detail);\n };\n /**\n * Returns a Rejection\n *\n * Normalizes a value as a Rejection.\n * If the value is already a Rejection, returns it.\n * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR).\n *\n * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection.\n */\n Rejection.normalize = function (detail) {\n return is(Rejection)(detail) ? detail : Rejection.errored(detail);\n };\n Rejection.prototype.toString = function () {\n var detailString = function (d) {\n return d && d.toString !== Object.prototype.toString ? d.toString() : stringify(d);\n };\n var detail = detailString(this.detail);\n var _a = this, $id = _a.$id, type = _a.type, message = _a.message;\n return \"Transition Rejection($id: \" + $id + \" type: \" + type + \", message: \" + message + \", detail: \" + detail + \")\";\n };\n Rejection.prototype.toPromise = function () {\n return extend(silentRejection(this), { _transitionRejection: this });\n };\n return Rejection;\n}());\n\n/**\n * # Transition tracing (debug)\n *\n * Enable transition tracing to print transition information to the console,\n * in order to help debug your application.\n * Tracing logs detailed information about each Transition to your console.\n *\n * To enable tracing, import the [[Trace]] singleton and enable one or more categories.\n *\n * ### ES6\n * ```js\n * import {trace} from \"ui-router-ng2\"; // or \"angular-ui-router\"\n * trace.enable(1, 5); // TRANSITION and VIEWCONFIG\n * ```\n *\n * ### CJS\n * ```js\n * let trace = require(\"angular-ui-router\").trace; // or \"ui-router-ng2\"\n * trace.enable(\"TRANSITION\", \"VIEWCONFIG\");\n * ```\n *\n * ### Globals\n * ```js\n * let trace = window[\"angular-ui-router\"].trace; // or \"ui-router-ng2\"\n * trace.enable(); // Trace everything (very verbose)\n * ```\n *\n * ### Angular 1:\n * ```js\n * app.run($trace => $trace.enable());\n * ```\n *\n * @coreapi\n * @module trace\n */\n/* tslint:disable:no-console */\n/** @hidden */\nfunction uiViewString(uiview) {\n if (!uiview)\n return 'ui-view (defunct)';\n var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';\n return \"[ui-view#\" + uiview.id + \" \" + uiview.$type + \":\" + uiview.fqn + \" (\" + uiview.name + \"@\" + state + \")]\";\n}\n/** @hidden */\nvar viewConfigString = function (viewConfig) {\n var view = viewConfig.viewDecl;\n var state = view.$context.name || '(root)';\n return \"[View#\" + viewConfig.$id + \" from '\" + state + \"' state]: target ui-view: '\" + view.$uiViewName + \"@\" + view.$uiViewContextAnchor + \"'\";\n};\n/** @hidden */\nfunction normalizedCat(input) {\n return isNumber(input) ? exports.Category[input] : exports.Category[exports.Category[input]];\n}\n/** @hidden */\nvar consoleLog = Function.prototype.bind.call(console.log, console);\n/** @hidden */\nvar consoletable = isFunction(console.table) ? console.table.bind(console) : consoleLog.bind(console);\n/**\n * Trace categories Enum\n *\n * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]\n *\n * `trace.enable(Category.TRANSITION)`\n *\n * These can also be provided using a matching string, or position ordinal\n *\n * `trace.enable(\"TRANSITION\")`\n *\n * `trace.enable(1)`\n */\n\n(function (Category) {\n Category[Category[\"RESOLVE\"] = 0] = \"RESOLVE\";\n Category[Category[\"TRANSITION\"] = 1] = \"TRANSITION\";\n Category[Category[\"HOOK\"] = 2] = \"HOOK\";\n Category[Category[\"UIVIEW\"] = 3] = \"UIVIEW\";\n Category[Category[\"VIEWCONFIG\"] = 4] = \"VIEWCONFIG\";\n})(exports.Category || (exports.Category = {}));\n/** @hidden */\nvar _tid = parse('$id');\n/** @hidden */\nvar _rid = parse('router.$id');\n/** @hidden */\nvar transLbl = function (trans) { return \"Transition #\" + _tid(trans) + \"-\" + _rid(trans); };\n/**\n * Prints UI-Router Transition trace information to the console.\n */\nvar Trace = /** @class */ (function () {\n /** @hidden */\n function Trace() {\n /** @hidden */\n this._enabled = {};\n this.approximateDigests = 0;\n }\n /** @hidden */\n Trace.prototype._set = function (enabled, categories) {\n var _this = this;\n if (!categories.length) {\n categories = Object.keys(exports.Category)\n .map(function (k) { return parseInt(k, 10); })\n .filter(function (k) { return !isNaN(k); })\n .map(function (key) { return exports.Category[key]; });\n }\n categories.map(normalizedCat).forEach(function (category) { return _this._enabled[category] = enabled; });\n };\n Trace.prototype.enable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(true, categories);\n };\n Trace.prototype.disable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(false, categories);\n };\n /**\n * Retrieves the enabled stateus of a [[Category]]\n *\n * ```js\n * trace.enabled(\"VIEWCONFIG\"); // true or false\n * ```\n *\n * @returns boolean true if the category is enabled\n */\n Trace.prototype.enabled = function (category) {\n return !!this._enabled[normalizedCat(category)];\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceTransitionStart = function (trans) {\n if (!this.enabled(exports.Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": Started -> \" + stringify(trans));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceTransitionIgnored = function (trans) {\n if (!this.enabled(exports.Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": Ignored <> \" + stringify(trans));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceHookInvocation = function (step, trans, options) {\n if (!this.enabled(exports.Category.HOOK))\n return;\n var event = parse('traceData.hookType')(options) || 'internal', context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown', name = functionToString(step.registeredHook.callback);\n console.log(transLbl(trans) + \": Hook -> \" + event + \" context: \" + context + \", \" + maxLength(200, name));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) {\n if (!this.enabled(exports.Category.HOOK))\n return;\n console.log(transLbl(trans) + \": <- Hook returned: \" + maxLength(200, stringify(hookResult)));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceResolvePath = function (path, when, trans) {\n if (!this.enabled(exports.Category.RESOLVE))\n return;\n console.log(transLbl(trans) + \": Resolving \" + path + \" (\" + when + \")\");\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceResolvableResolved = function (resolvable, trans) {\n if (!this.enabled(exports.Category.RESOLVE))\n return;\n console.log(transLbl(trans) + \": <- Resolved \" + resolvable + \" to: \" + maxLength(200, stringify(resolvable.data)));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceError = function (reason, trans) {\n if (!this.enabled(exports.Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": <- Rejected \" + stringify(trans) + \", reason: \" + reason);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceSuccess = function (finalState, trans) {\n if (!this.enabled(exports.Category.TRANSITION))\n return;\n console.log(transLbl(trans) + \": <- Success \" + stringify(trans) + \", final state: \" + finalState.name);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceUIViewEvent = function (event, viewData, extra) {\n if (extra === void 0) { extra = ''; }\n if (!this.enabled(exports.Category.UIVIEW))\n return;\n console.log(\"ui-view: \" + padString(30, event) + \" \" + uiViewString(viewData) + extra);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) {\n if (!this.enabled(exports.Category.UIVIEW))\n return;\n this.traceUIViewEvent('Updating', viewData, \" with ViewConfig from context='\" + context + \"'\");\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceUIViewFill = function (viewData, html) {\n if (!this.enabled(exports.Category.UIVIEW))\n return;\n this.traceUIViewEvent('Fill', viewData, \" with: \" + maxLength(200, html));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceViewSync = function (pairs) {\n if (!this.enabled(exports.Category.VIEWCONFIG))\n return;\n var uivheader = 'uiview component fqn';\n var cfgheader = 'view config state (view name)';\n var mapping = pairs.map(function (_a) {\n var uiView = _a.uiView, viewConfig = _a.viewConfig;\n var uiv = uiView && uiView.fqn;\n var cfg = viewConfig && viewConfig.viewDecl.$context.name + \": (\" + viewConfig.viewDecl.$name + \")\";\n return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b;\n var _b;\n }).sort(function (a, b) { return (a[uivheader] || '').localeCompare(b[uivheader] || ''); });\n consoletable(mapping);\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceViewServiceEvent = function (event, viewConfig) {\n if (!this.enabled(exports.Category.VIEWCONFIG))\n return;\n console.log(\"VIEWCONFIG: \" + event + \" \" + viewConfigString(viewConfig));\n };\n /** @internalapi called by ui-router code */\n Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) {\n if (!this.enabled(exports.Category.VIEWCONFIG))\n return;\n console.log(\"VIEWCONFIG: \" + event + \" \" + uiViewString(viewData));\n };\n return Trace;\n}());\n/**\n * The [[Trace]] singleton\n *\n * #### Example:\n * ```js\n * import {trace} from \"angular-ui-router\";\n * trace.enable(1, 5);\n * ```\n */\nvar trace = new Trace();\n\n(function (TransitionHookPhase) {\n TransitionHookPhase[TransitionHookPhase[\"CREATE\"] = 0] = \"CREATE\";\n TransitionHookPhase[TransitionHookPhase[\"BEFORE\"] = 1] = \"BEFORE\";\n TransitionHookPhase[TransitionHookPhase[\"RUN\"] = 2] = \"RUN\";\n TransitionHookPhase[TransitionHookPhase[\"SUCCESS\"] = 3] = \"SUCCESS\";\n TransitionHookPhase[TransitionHookPhase[\"ERROR\"] = 4] = \"ERROR\";\n})(exports.TransitionHookPhase || (exports.TransitionHookPhase = {}));\n\n(function (TransitionHookScope) {\n TransitionHookScope[TransitionHookScope[\"TRANSITION\"] = 0] = \"TRANSITION\";\n TransitionHookScope[TransitionHookScope[\"STATE\"] = 1] = \"STATE\";\n})(exports.TransitionHookScope || (exports.TransitionHookScope = {}));\n\n/**\n * @coreapi\n * @module state\n */ /** for typedoc */\n/**\n * Encapsulate the target (destination) state/params/options of a [[Transition]].\n *\n * This class is frequently used to redirect a transition to a new destination.\n *\n * See:\n *\n * - [[HookResult]]\n * - [[TransitionHookFn]]\n * - [[TransitionService.onStart]]\n *\n * To create a `TargetState`, use [[StateService.target]].\n *\n * ---\n *\n * This class wraps:\n *\n * 1) an identifier for a state\n * 2) a set of parameters\n * 3) and transition options\n * 4) the registered state object (the [[StateDeclaration]])\n *\n * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can\n * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string).\n * The `TargetState` class normalizes those options.\n *\n * A `TargetState` may be valid (the state being targeted exists in the registry)\n * or invalid (the state being targeted is not registered).\n */\nvar TargetState = /** @class */ (function () {\n /**\n * The TargetState constructor\n *\n * Note: Do not construct a `TargetState` manually.\n * To create a `TargetState`, use the [[StateService.target]] factory method.\n *\n * @param _stateRegistry The StateRegistry to use to look up the _definition\n * @param _identifier An identifier for a state.\n * Either a fully-qualified state name, or the object used to define the state.\n * @param _params Parameters for the target state\n * @param _options Transition options.\n *\n * @internalapi\n */\n function TargetState(_stateRegistry, _identifier, _params, _options) {\n this._stateRegistry = _stateRegistry;\n this._identifier = _identifier;\n this._identifier = _identifier;\n this._params = extend({}, _params || {});\n this._options = extend({}, _options || {});\n this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative);\n }\n /** The name of the state this object targets */\n TargetState.prototype.name = function () {\n return this._definition && this._definition.name || this._identifier;\n };\n /** The identifier used when creating this TargetState */\n TargetState.prototype.identifier = function () {\n return this._identifier;\n };\n /** The target parameter values */\n TargetState.prototype.params = function () {\n return this._params;\n };\n /** The internal state object (if it was found) */\n TargetState.prototype.$state = function () {\n return this._definition;\n };\n /** The internal state declaration (if it was found) */\n TargetState.prototype.state = function () {\n return this._definition && this._definition.self;\n };\n /** The target options */\n TargetState.prototype.options = function () {\n return this._options;\n };\n /** True if the target state was found */\n TargetState.prototype.exists = function () {\n return !!(this._definition && this._definition.self);\n };\n /** True if the object is valid */\n TargetState.prototype.valid = function () {\n return !this.error();\n };\n /** If the object is invalid, returns the reason why */\n TargetState.prototype.error = function () {\n var base = this.options().relative;\n if (!this._definition && !!base) {\n var stateName = base.name ? base.name : base;\n return \"Could not resolve '\" + this.name() + \"' from state '\" + stateName + \"'\";\n }\n if (!this._definition)\n return \"No such state '\" + this.name() + \"'\";\n if (!this._definition.self)\n return \"State '\" + this.name() + \"' has an invalid definition\";\n };\n TargetState.prototype.toString = function () {\n return \"'\" + this.name() + \"'\" + stringify(this.params());\n };\n /**\n * Returns a copy of this TargetState which targets a different state.\n * The new TargetState has the same parameter values and transition options.\n *\n * @param state The new state that should be targeted\n */\n TargetState.prototype.withState = function (state) {\n return new TargetState(this._stateRegistry, state, this._params, this._options);\n };\n /**\n * Returns a copy of this TargetState, using the specified parameter values.\n *\n * @param params the new parameter values to use\n * @param replace When false (default) the new parameter values will be merged with the current values.\n * When true the parameter values will be used instead of the current values.\n */\n TargetState.prototype.withParams = function (params, replace) {\n if (replace === void 0) { replace = false; }\n var newParams = replace ? params : extend({}, this._params, params);\n return new TargetState(this._stateRegistry, this._identifier, newParams, this._options);\n };\n /**\n * Returns a copy of this TargetState, using the specified Transition Options.\n *\n * @param options the new options to use\n * @param replace When false (default) the new options will be merged with the current options.\n * When true the options will be used instead of the current options.\n */\n TargetState.prototype.withOptions = function (options, replace) {\n if (replace === void 0) { replace = false; }\n var newOpts = replace ? options : extend({}, this._options, options);\n return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts);\n };\n /** Returns true if the object has a state property that might be a state or state name */\n TargetState.isDef = function (obj) {\n return obj && obj.state && (isString(obj.state) || isString(obj.state.name));\n };\n return TargetState;\n}());\n\n/**\n * @coreapi\n * @module transition\n */\n/** for typedoc */\nvar defaultOptions = {\n current: noop,\n transition: null,\n traceData: {},\n bind: null,\n};\n/** @hidden */\nvar TransitionHook = /** @class */ (function () {\n function TransitionHook(transition, stateContext, registeredHook, options) {\n var _this = this;\n this.transition = transition;\n this.stateContext = stateContext;\n this.registeredHook = registeredHook;\n this.options = options;\n this.isSuperseded = function () {\n return _this.type.hookPhase === exports.TransitionHookPhase.RUN && !_this.options.transition.isActive();\n };\n this.options = defaults(options, defaultOptions);\n this.type = registeredHook.eventType;\n }\n /**\n * Chains together an array of TransitionHooks.\n *\n * Given a list of [[TransitionHook]] objects, chains them together.\n * Each hook is invoked after the previous one completes.\n *\n * #### Example:\n * ```js\n * var hooks: TransitionHook[] = getHooks();\n * let promise: Promise = TransitionHook.chain(hooks);\n *\n * promise.then(handleSuccess, handleError);\n * ```\n *\n * @param hooks the list of hooks to chain together\n * @param waitFor if provided, the chain is `.then()`'ed off this promise\n * @returns a `Promise` for sequentially invoking the hooks (in order)\n */\n TransitionHook.chain = function (hooks, waitFor) {\n // Chain the next hook off the previous\n var createHookChainR = function (prev, nextHook) {\n return prev.then(function () { return nextHook.invokeHook(); });\n };\n return hooks.reduce(createHookChainR, waitFor || services.$q.when());\n };\n /**\n * Invokes all the provided TransitionHooks, in order.\n * Each hook's return value is checked.\n * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.\n * If no hook returns a promise, then all hooks are processed synchronously.\n *\n * @param hooks the list of TransitionHooks to invoke\n * @param doneCallback a callback that is invoked after all the hooks have successfully completed\n *\n * @returns a promise for the async result, or the result of the callback\n */\n TransitionHook.invokeHooks = function (hooks, doneCallback) {\n for (var idx = 0; idx < hooks.length; idx++) {\n var hookResult = hooks[idx].invokeHook();\n if (isPromise(hookResult)) {\n var remainingHooks = hooks.slice(idx + 1);\n return TransitionHook.chain(remainingHooks, hookResult)\n .then(doneCallback);\n }\n }\n return doneCallback();\n };\n /**\n * Run all TransitionHooks, ignoring their return value.\n */\n TransitionHook.runAllHooks = function (hooks) {\n hooks.forEach(function (hook) { return hook.invokeHook(); });\n };\n TransitionHook.prototype.logError = function (err) {\n this.transition.router.stateService.defaultErrorHandler()(err);\n };\n TransitionHook.prototype.invokeHook = function () {\n var _this = this;\n var hook = this.registeredHook;\n if (hook._deregistered)\n return;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent)\n return notCurrent;\n var options = this.options;\n trace.traceHookInvocation(this, this.transition, options);\n var invokeCallback = function () {\n return hook.callback.call(options.bind, _this.transition, _this.stateContext);\n };\n var normalizeErr = function (err) {\n return Rejection.normalize(err).toPromise();\n };\n var handleError = function (err) {\n return hook.eventType.getErrorHandler(_this)(err);\n };\n var handleResult = function (result) {\n return hook.eventType.getResultHandler(_this)(result);\n };\n try {\n var result = invokeCallback();\n if (!this.type.synchronous && isPromise(result)) {\n return result.catch(normalizeErr)\n .then(handleResult, handleError);\n }\n else {\n return handleResult(result);\n }\n }\n catch (err) {\n // If callback throws (synchronously)\n return handleError(Rejection.normalize(err));\n }\n finally {\n if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {\n hook.deregister();\n }\n }\n };\n /**\n * This method handles the return value of a Transition Hook.\n *\n * A hook can return false (cancel), a TargetState (redirect),\n * or a promise (which may later resolve to false or a redirect)\n *\n * This also handles \"transition superseded\" -- when a new transition\n * was started while the hook was still running\n */\n TransitionHook.prototype.handleHookResult = function (result) {\n var _this = this;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent)\n return notCurrent;\n // Hook returned a promise\n if (isPromise(result)) {\n // Wait for the promise, then reprocess with the resulting value\n return result.then(function (val$$1) { return _this.handleHookResult(val$$1); });\n }\n trace.traceHookResult(result, this.transition, this.options);\n // Hook returned false\n if (result === false) {\n // Abort this Transition\n return Rejection.aborted('Hook aborted transition').toPromise();\n }\n var isTargetState = is(TargetState);\n // hook returned a TargetState\n if (isTargetState(result)) {\n // Halt the current Transition and redirect (a new Transition) to the TargetState.\n return Rejection.redirected(result).toPromise();\n }\n };\n /**\n * Return a Rejection promise if the transition is no longer current due\n * to a stopped router (disposed), or a new transition has started and superseded this one.\n */\n TransitionHook.prototype.getNotCurrentRejection = function () {\n var router = this.transition.router;\n // The router is stopped\n if (router._disposed) {\n return Rejection.aborted(\"UIRouter instance #\" + router.$id + \" has been stopped (disposed)\").toPromise();\n }\n if (this.transition._aborted) {\n return Rejection.aborted().toPromise();\n }\n // This transition is no longer current.\n // Another transition started while this hook was still running.\n if (this.isSuperseded()) {\n // Abort this transition\n return Rejection.superseded(this.options.current()).toPromise();\n }\n };\n TransitionHook.prototype.toString = function () {\n var _a = this, options = _a.options, registeredHook = _a.registeredHook;\n var event = parse('traceData.hookType')(options) || 'internal', context = parse('traceData.context.state.name')(options) || parse('traceData.context')(options) || 'unknown', name = fnToString(registeredHook.callback);\n return event + \" context: \" + context + \", \" + maxLength(200, name);\n };\n /**\n * These GetResultHandler(s) are used by [[invokeHook]] below\n * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])\n */\n TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {\n return hook.handleHookResult(result);\n }; };\n /**\n * If the result is a promise rejection, log it.\n * Otherwise, ignore the result.\n */\n TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {\n isPromise(result) && result.catch(function (err) {\n return hook.logError(Rejection.normalize(err));\n });\n return undefined;\n }; };\n /**\n * These GetErrorHandler(s) are used by [[invokeHook]] below\n * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])\n */\n TransitionHook.LOG_ERROR = function (hook) { return function (error) {\n return hook.logError(error);\n }; };\n TransitionHook.REJECT_ERROR = function (hook) { return function (error) {\n return silentRejection(error);\n }; };\n TransitionHook.THROW_ERROR = function (hook) { return function (error) {\n throw error;\n }; };\n return TransitionHook;\n}());\n\n/**\n * @coreapi\n * @module transition\n */ /** for typedoc */\n/**\n * Determines if the given state matches the matchCriteria\n *\n * @hidden\n *\n * @param state a State Object to test against\n * @param criterion\n * - If a string, matchState uses the string as a glob-matcher against the state name\n * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name\n * and returns a positive match if any of the globs match.\n * - If a function, matchState calls the function with the state and returns true if the function's result is truthy.\n * @returns {boolean}\n */\nfunction matchState(state, criterion) {\n var toMatch = isString(criterion) ? [criterion] : criterion;\n function matchGlobs(_state) {\n var globStrings = toMatch;\n for (var i = 0; i < globStrings.length; i++) {\n var glob = new Glob(globStrings[i]);\n if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) {\n return true;\n }\n }\n return false;\n }\n var matchFn = (isFunction(toMatch) ? toMatch : matchGlobs);\n return !!matchFn(state);\n}\n/**\n * @internalapi\n * The registration data for a registered transition hook\n */\nvar RegisteredHook = /** @class */ (function () {\n function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) {\n if (options === void 0) { options = {}; }\n this.tranSvc = tranSvc;\n this.eventType = eventType;\n this.callback = callback;\n this.matchCriteria = matchCriteria;\n this.removeHookFromRegistry = removeHookFromRegistry;\n this.invokeCount = 0;\n this._deregistered = false;\n this.priority = options.priority || 0;\n this.bind = options.bind || null;\n this.invokeLimit = options.invokeLimit;\n }\n /**\n * Gets the matching [[PathNode]]s\n *\n * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing\n * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes.\n *\n * Returning `null` is significant to distinguish between the default\n * \"match-all criterion value\" of `true` compared to a `() => true` function,\n * when the nodes is an empty array.\n *\n * This is useful to allow a transition match criteria of `entering: true`\n * to still match a transition, even when `entering === []`. Contrast that\n * with `entering: (state) => true` which only matches when a state is actually\n * being entered.\n */\n RegisteredHook.prototype._matchingNodes = function (nodes, criterion) {\n if (criterion === true)\n return nodes;\n var matching = nodes.filter(function (node) { return matchState(node.state, criterion); });\n return matching.length ? matching : null;\n };\n /**\n * Gets the default match criteria (all `true`)\n *\n * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:\n *\n * ```js\n * {\n * to: true,\n * from: true,\n * entering: true,\n * exiting: true,\n * retained: true,\n * }\n */\n RegisteredHook.prototype._getDefaultMatchCriteria = function () {\n return mapObj(this.tranSvc._pluginapi._getPathTypes(), function () { return true; });\n };\n /**\n * Gets matching nodes as [[IMatchingNodes]]\n *\n * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to:\n *\n * ```js\n * let matches: IMatchingNodes = {\n * to: _matchingNodes([tail(treeChanges.to)], mc.to),\n * from: _matchingNodes([tail(treeChanges.from)], mc.from),\n * exiting: _matchingNodes(treeChanges.exiting, mc.exiting),\n * retained: _matchingNodes(treeChanges.retained, mc.retained),\n * entering: _matchingNodes(treeChanges.entering, mc.entering),\n * };\n * ```\n */\n RegisteredHook.prototype._getMatchingNodes = function (treeChanges) {\n var _this = this;\n var criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria);\n var paths = values(this.tranSvc._pluginapi._getPathTypes());\n return paths.reduce(function (mn, pathtype) {\n // STATE scope criteria matches against every node in the path.\n // TRANSITION scope criteria matches against only the last node in the path\n var isStateHook = pathtype.scope === exports.TransitionHookScope.STATE;\n var path = treeChanges[pathtype.name] || [];\n var nodes = isStateHook ? path : [tail(path)];\n mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name]);\n return mn;\n }, {});\n };\n /**\n * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]\n *\n * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values\n * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering)\n */\n RegisteredHook.prototype.matches = function (treeChanges) {\n var matches = this._getMatchingNodes(treeChanges);\n // Check if all the criteria matched the TreeChanges object\n var allMatched = values(matches).every(identity);\n return allMatched ? matches : null;\n };\n RegisteredHook.prototype.deregister = function () {\n this.removeHookFromRegistry(this);\n this._deregistered = true;\n };\n return RegisteredHook;\n}());\n/** @hidden Return a registration function of the requested type. */\nfunction makeEvent(registry, transitionService, eventType) {\n // Create the object which holds the registered transition hooks.\n var _registeredHooks = registry._registeredHooks = (registry._registeredHooks || {});\n var hooks = _registeredHooks[eventType.name] = [];\n var removeHookFn = removeFrom(hooks);\n // Create hook registration function on the IHookRegistry for the event\n registry[eventType.name] = hookRegistrationFn;\n function hookRegistrationFn(matchObject, callback, options) {\n if (options === void 0) { options = {}; }\n var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, removeHookFn, options);\n hooks.push(registeredHook);\n return registeredHook.deregister.bind(registeredHook);\n }\n return hookRegistrationFn;\n}\n\n/**\n * @coreapi\n * @module transition\n */ /** for typedoc */\n/**\n * This class returns applicable TransitionHooks for a specific Transition instance.\n *\n * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g.\n * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is\n * determined by the type of hook)\n *\n * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition.\n *\n * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder\n * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private\n * in the Transition class, so we must also provide the Transition's _treeChanges)\n *\n */\nvar HookBuilder = /** @class */ (function () {\n function HookBuilder(transition) {\n this.transition = transition;\n }\n HookBuilder.prototype.buildHooksForPhase = function (phase) {\n var _this = this;\n var $transitions = this.transition.router.transitionService;\n return $transitions._pluginapi._getEvents(phase)\n .map(function (type) { return _this.buildHooks(type); })\n .reduce(unnestR, [])\n .filter(identity);\n };\n /**\n * Returns an array of newly built TransitionHook objects.\n *\n * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]].\n * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s)\n * - For each of the [[PathNode]]s, creates a TransitionHook\n *\n * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'.\n */\n HookBuilder.prototype.buildHooks = function (hookType) {\n var transition = this.transition;\n var treeChanges = transition.treeChanges();\n // Find all the matching registered hooks for a given hook type\n var matchingHooks = this.getMatchingHooks(hookType, treeChanges);\n if (!matchingHooks)\n return [];\n var baseHookOptions = {\n transition: transition,\n current: transition.options().current,\n };\n var makeTransitionHooks = function (hook) {\n // Fetch the Nodes that caused this hook to match.\n var matches = hook.matches(treeChanges);\n // Select the PathNode[] that will be used as TransitionHook context objects\n var matchingNodes = matches[hookType.criteriaMatchPath.name];\n // Return an array of HookTuples\n return matchingNodes.map(function (node) {\n var _options = extend({\n bind: hook.bind,\n traceData: { hookType: hookType.name, context: node },\n }, baseHookOptions);\n var state = hookType.criteriaMatchPath.scope === exports.TransitionHookScope.STATE ? node.state.self : null;\n var transitionHook = new TransitionHook(transition, state, hook, _options);\n return { hook: hook, node: node, transitionHook: transitionHook };\n });\n };\n return matchingHooks.map(makeTransitionHooks)\n .reduce(unnestR, [])\n .sort(tupleSort(hookType.reverseSort))\n .map(function (tuple) { return tuple.transitionHook; });\n };\n /**\n * Finds all RegisteredHooks from:\n * - The Transition object instance hook registry\n * - The TransitionService ($transitions) global hook registry\n *\n * which matched:\n * - the eventType\n * - the matchCriteria (to, from, exiting, retained, entering)\n *\n * @returns an array of matched [[RegisteredHook]]s\n */\n HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges) {\n var isCreate = hookType.hookPhase === exports.TransitionHookPhase.CREATE;\n // Instance and Global hook registries\n var $transitions = this.transition.router.transitionService;\n var registries = isCreate ? [$transitions] : [this.transition, $transitions];\n return registries.map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries\n .filter(assertPredicate(isArray, \"broken event named: \" + hookType.name)) // Sanity check\n .reduce(unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array\n .filter(function (hook) { return hook.matches(treeChanges); }); // Only those satisfying matchCriteria\n };\n return HookBuilder;\n}());\n/**\n * A factory for a sort function for HookTuples.\n *\n * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares\n * the EventHook priority.\n *\n * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth\n * @returns a tuple sort function\n */\nfunction tupleSort(reverseDepthSort) {\n if (reverseDepthSort === void 0) { reverseDepthSort = false; }\n return function nodeDepthThenPriority(l, r) {\n var factor = reverseDepthSort ? -1 : 1;\n var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor;\n return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority;\n };\n}\n\n/**\n * @coreapi\n * @module params\n */\n/** */\n/**\n * An internal class which implements [[ParamTypeDefinition]].\n *\n * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types.\n * When a param type definition is registered, an instance of this class is created internally.\n *\n * This class has naive implementations for all the [[ParamTypeDefinition]] methods.\n *\n * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values.\n *\n * #### Example:\n * ```js\n * var paramTypeDef = {\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 *\n * var paramType = new ParamType(paramTypeDef);\n * ```\n * @internalapi\n */\nvar ParamType = /** @class */ (function () {\n /**\n * @param def A configuration object which contains the custom type definition. The object's\n * properties will override the default methods and/or pattern in `ParamType`'s public interface.\n * @returns a new ParamType object\n */\n function ParamType(def) {\n /** @inheritdoc */\n this.pattern = /.*/;\n /** @inheritdoc */\n this.inherit = true;\n extend(this, def);\n }\n // consider these four methods to be \"abstract methods\" that should be overridden\n /** @inheritdoc */\n ParamType.prototype.is = function (val, key) { return true; };\n /** @inheritdoc */\n ParamType.prototype.encode = function (val, key) { return val; };\n /** @inheritdoc */\n ParamType.prototype.decode = function (val, key) { return val; };\n /** @inheritdoc */\n ParamType.prototype.equals = function (a, b) { return a == b; }; // tslint:disable-line:triple-equals\n ParamType.prototype.$subPattern = function () {\n var sub = this.pattern.toString();\n return sub.substr(1, sub.length - 2);\n };\n ParamType.prototype.toString = function () {\n return \"{ParamType:\" + this.name + \"}\";\n };\n /** Given an encoded string, or a decoded object, returns a decoded object */\n ParamType.prototype.$normalize = function (val) {\n return this.is(val) ? val : this.decode(val);\n };\n /**\n * Wraps an existing custom ParamType as an array of ParamType, 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 */\n ParamType.prototype.$asArray = function (mode, isSearch) {\n if (!mode)\n return this;\n if (mode === 'auto' && !isSearch)\n throw new Error(\"'auto' array mode is for query parameters only\");\n return new ArrayType(this, mode);\n };\n return ParamType;\n}());\n/**\n * Wraps up a `ParamType` object to handle array values.\n * @internalapi\n */\nfunction ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return isArray(val) ? val : (isDefined(val) ? [val] : []);\n }\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 // 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)\n return val;\n var arr = arrayWrap(val);\n var result = map(arr, callback);\n return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\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)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n extend(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode,\n });\n}\n\n/**\n * @coreapi\n * @module params\n */ /** for typedoc */\n/** @hidden */\nvar hasOwn = Object.prototype.hasOwnProperty;\n/** @hidden */\nvar isShorthand = function (cfg) {\n return ['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0;\n};\n/** @internalapi */\n\n(function (DefType) {\n DefType[DefType[\"PATH\"] = 0] = \"PATH\";\n DefType[DefType[\"SEARCH\"] = 1] = \"SEARCH\";\n DefType[DefType[\"CONFIG\"] = 2] = \"CONFIG\";\n})(exports.DefType || (exports.DefType = {}));\n/** @hidden */\nfunction unwrapShorthand(cfg) {\n cfg = isShorthand(cfg) && { value: cfg } || cfg;\n getStaticDefaultValue['__cacheable'] = true;\n function getStaticDefaultValue() {\n return cfg.value;\n }\n return extend(cfg, {\n $$fn: isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue,\n });\n}\n/** @hidden */\nfunction getType(cfg, urlType, location, id, paramTypes) {\n if (cfg.type && urlType && urlType.name !== 'string')\n throw new Error(\"Param '\" + id + \"' has two type configurations.\");\n if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type))\n return paramTypes.type(cfg.type);\n if (urlType)\n return urlType;\n if (!cfg.type) {\n var type = location === exports.DefType.CONFIG ? 'any' :\n location === exports.DefType.PATH ? 'path' :\n location === exports.DefType.SEARCH ? 'query' : 'string';\n return paramTypes.type(type);\n }\n return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type);\n}\n/**\n * @internalapi\n * returns false, true, or the squash value to indicate the \"default parameter url squash policy\".\n */\nfunction getSquashPolicy(config, isOptional, defaultPolicy) {\n var squash = config.squash;\n if (!isOptional || squash === false)\n return false;\n if (!isDefined(squash) || squash == null)\n return defaultPolicy;\n if (squash === true || isString(squash))\n return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n}\n/** @internalapi */\nfunction getReplace(config, arrayMode, isOptional, squash) {\n var defaultPolicy = [\n { from: '', to: (isOptional || arrayMode ? undefined : '') },\n { from: null, to: (isOptional || arrayMode ? undefined : '') },\n ];\n var replace = isArray(config.replace) ? config.replace : [];\n if (isString(squash))\n replace.push({ from: squash, to: undefined });\n var configuredKeys = map(replace, prop('from'));\n return filter(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace);\n}\n/** @internalapi */\nvar Param = /** @class */ (function () {\n function Param(id, type, config, location, urlMatcherFactory) {\n config = unwrapShorthand(config);\n type = getType(config, type, location, id, urlMatcherFactory.paramTypes);\n var arrayMode = getArrayMode();\n type = arrayMode ? type.$asArray(arrayMode, location === exports.DefType.SEARCH) : type;\n var isOptional = config.value !== undefined || location === exports.DefType.SEARCH;\n var dynamic = isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic;\n var raw = isDefined(config.raw) ? !!config.raw : !!type.raw;\n var squash = getSquashPolicy(config, isOptional, urlMatcherFactory.defaultSquashPolicy());\n var replace = getReplace(config, arrayMode, isOptional, squash);\n var inherit$$1 = isDefined(config.inherit) ? !!config.inherit : !!type.inherit;\n // array config: param name (param[]) overrides default settings. explicit config overrides param name.\n function getArrayMode() {\n var arrayDefaults = { array: (location === exports.DefType.SEARCH ? 'auto' : false) };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return extend(arrayDefaults, arrayParamNomenclature, config).array;\n }\n extend(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit$$1, array: arrayMode, config: config });\n }\n Param.values = function (params, values$$1) {\n if (values$$1 === void 0) { values$$1 = {}; }\n var paramValues = {};\n for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {\n var param = params_1[_i];\n paramValues[param.id] = param.value(values$$1[param.id]);\n }\n return paramValues;\n };\n /**\n * Finds [[Param]] objects which have different param values\n *\n * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects\n *\n * @param params: The list of Param objects to filter\n * @param values1: The first set of parameter values\n * @param values2: the second set of parameter values\n *\n * @returns any Param objects whose values were different between values1 and values2\n */\n Param.changed = function (params, values1, values2) {\n if (values1 === void 0) { values1 = {}; }\n if (values2 === void 0) { values2 = {}; }\n return params.filter(function (param) { return !param.type.equals(values1[param.id], values2[param.id]); });\n };\n /**\n * Checks if two param value objects are equal (for a set of [[Param]] objects)\n *\n * @param params The list of [[Param]] objects to check\n * @param values1 The first set of param values\n * @param values2 The second set of param values\n *\n * @returns true if the param values in values1 and values2 are equal\n */\n Param.equals = function (params, values1, values2) {\n if (values1 === void 0) { values1 = {}; }\n if (values2 === void 0) { values2 = {}; }\n return Param.changed(params, values1, values2).length === 0;\n };\n /** Returns true if a the parameter values are valid, according to the Param definitions */\n Param.validates = function (params, values$$1) {\n if (values$$1 === void 0) { values$$1 = {}; }\n return params.map(function (param) { return param.validates(values$$1[param.id]); }).reduce(allTrueR, true);\n };\n Param.prototype.isDefaultValue = function (value) {\n return this.isOptional && this.type.equals(this.value(), value);\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 Param.prototype.value = function (value) {\n var _this = this;\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n var getDefaultValue = function () {\n if (_this._defaultValueCache)\n return _this._defaultValueCache.defaultValue;\n if (!services.$injector)\n throw new Error('Injectable functions cannot be called at configuration time');\n var defaultValue = services.$injector.invoke(_this.config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + _this.id + \"' is not an instance of ParamType (\" + _this.type.name + \")\");\n if (_this.config.$$fn['__cacheable']) {\n _this._defaultValueCache = { defaultValue: defaultValue };\n }\n return defaultValue;\n };\n var replaceSpecialValues = function (val$$1) {\n for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) {\n var tuple = _a[_i];\n if (tuple.from === val$$1)\n return tuple.to;\n }\n return val$$1;\n };\n value = replaceSpecialValues(value);\n return isUndefined(value) ? getDefaultValue() : this.type.$normalize(value);\n };\n Param.prototype.isSearch = function () {\n return this.location === exports.DefType.SEARCH;\n };\n Param.prototype.validates = function (value) {\n // There was no parameter value, but the param is optional\n if ((isUndefined(value) || value === null) && this.isOptional)\n return true;\n // The value was not of the correct ParamType, and could not be decoded to the correct ParamType\n var normalized = this.type.$normalize(value);\n if (!this.type.is(normalized))\n return false;\n // The value was of the correct type, but when encoded, did not match the ParamType's regexp\n var encoded = this.type.encode(normalized);\n return !(isString(encoded) && !this.type.pattern.exec(encoded));\n };\n Param.prototype.toString = function () {\n return \"{Param:\" + this.id + \" \" + this.type + \" squash: '\" + this.squash + \"' optional: \" + this.isOptional + \"}\";\n };\n return Param;\n}());\n\n/** @module path */ /** for typedoc */\n/**\n * @internalapi\n *\n * A node in a [[TreeChanges]] path\n *\n * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path.\n * Each PathNode corresponds to a state being entered, exited, or retained.\n * The stateful information includes parameter values and resolve data.\n */\nvar PathNode = /** @class */ (function () {\n function PathNode(stateOrNode) {\n if (stateOrNode instanceof PathNode) {\n var node = stateOrNode;\n this.state = node.state;\n this.paramSchema = node.paramSchema.slice();\n this.paramValues = extend({}, node.paramValues);\n this.resolvables = node.resolvables.slice();\n this.views = node.views && node.views.slice();\n }\n else {\n var state = stateOrNode;\n this.state = state;\n this.paramSchema = state.parameters({ inherit: false });\n this.paramValues = {};\n this.resolvables = state.resolvables.map(function (res) { return res.clone(); });\n }\n }\n PathNode.prototype.clone = function () {\n return new PathNode(this);\n };\n /** Sets [[paramValues]] for the node, from the values of an object hash */\n PathNode.prototype.applyRawParams = function (params) {\n var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; };\n this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return applyPairs(memo, getParamVal(pDef)); }, {});\n return this;\n };\n /** Gets a specific [[Param]] metadata that belongs to the node */\n PathNode.prototype.parameter = function (name) {\n return find(this.paramSchema, propEq('id', name));\n };\n /**\n * @returns true if the state and parameter values for another PathNode are\n * equal to the state and param values for this PathNode\n */\n PathNode.prototype.equals = function (node, paramsFn) {\n var diff = this.diff(node, paramsFn);\n return diff && diff.length === 0;\n };\n /**\n * Finds Params with different parameter values on another PathNode.\n *\n * Given another node (of the same state), finds the parameter values which differ.\n * Returns the [[Param]] (schema objects) whose parameter values differ.\n *\n * Given another node for a different state, returns `false`\n *\n * @param node The node to compare to\n * @param paramsFn A function that returns which parameters should be compared.\n * @returns The [[Param]]s which differ, or null if the two nodes are for different states\n */\n PathNode.prototype.diff = function (node, paramsFn) {\n if (this.state !== node.state)\n return false;\n var params = paramsFn ? paramsFn(this) : this.paramSchema;\n return Param.changed(params, this.paramValues, node.paramValues);\n };\n /**\n * Returns a clone of the PathNode\n * @deprecated use instance method `node.clone()`\n */\n PathNode.clone = function (node) { return node.clone(); };\n return PathNode;\n}());\n\n/** @module path */ /** for typedoc */\n/**\n * This class contains functions which convert TargetStates, Nodes and paths from one type to another.\n */\nvar PathUtils = /** @class */ (function () {\n function PathUtils() {\n }\n /** Given a PathNode[], create an TargetState */\n PathUtils.makeTargetState = function (registry, path) {\n var state = tail(path).state;\n return new TargetState(registry, state, path.map(prop('paramValues')).reduce(mergeR, {}), {});\n };\n PathUtils.buildPath = function (targetState) {\n var toParams = targetState.params();\n return targetState.$state().path.map(function (state) { return new PathNode(state).applyRawParams(toParams); });\n };\n /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */\n PathUtils.buildToPath = function (fromPath, targetState) {\n var toPath = PathUtils.buildPath(targetState);\n if (targetState.options().inherit) {\n return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params()));\n }\n return toPath;\n };\n /**\n * Creates ViewConfig objects and adds to nodes.\n *\n * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state\n */\n PathUtils.applyViewConfigs = function ($view, path, states) {\n // Only apply the viewConfigs to the nodes for the given states\n path.filter(function (node) { return inArray(states, node.state); }).forEach(function (node) {\n var viewDecls = values(node.state.views || {});\n var subPath = PathUtils.subPath(path, function (n) { return n === node; });\n var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); });\n node.views = viewConfigs.reduce(unnestR, []);\n });\n };\n /**\n * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath\n *\n * For a parameter in a node to be inherited from the from path:\n * - The toPath's node must have a matching node in the fromPath (by state).\n * - The parameter name must not be found in the toKeys parameter array.\n *\n * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some\n * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,\n * it is not inherited from the fromPath.\n */\n PathUtils.inheritParams = function (fromPath, toPath, toKeys) {\n if (toKeys === void 0) { toKeys = []; }\n function nodeParamVals(path, state) {\n var node = find(path, propEq('state', state));\n return extend({}, node && node.paramValues);\n }\n var noInherit = fromPath.map(function (node) { return node.paramSchema; })\n .reduce(unnestR, [])\n .filter(function (param) { return !param.inherit; })\n .map(prop('id'));\n /**\n * Given an [[PathNode]] \"toNode\", return a new [[PathNode]] with param values inherited from the\n * matching node in fromPath. Only inherit keys that aren't found in \"toKeys\" from the node in \"fromPath\"\"\n */\n function makeInheritedParamsNode(toNode) {\n // All param values for the node (may include default key/vals, when key was not found in toParams)\n var toParamVals = extend({}, toNode && toNode.paramValues);\n // limited to only those keys found in toParams\n var incomingParamVals = pick(toParamVals, toKeys);\n toParamVals = omit(toParamVals, toKeys);\n var fromParamVals = omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit);\n // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals\n var ownParamVals = extend(toParamVals, fromParamVals, incomingParamVals);\n return new PathNode(toNode.state).applyRawParams(ownParamVals);\n }\n // The param keys specified by the incoming toParams\n return toPath.map(makeInheritedParamsNode);\n };\n /**\n * Computes the tree changes (entering, exiting) between a fromPath and toPath.\n */\n PathUtils.treeChanges = function (fromPath, toPath, reloadState) {\n var max = Math.min(fromPath.length, toPath.length);\n var keep = 0;\n var nodesMatch = function (node1, node2) {\n return node1.equals(node2, PathUtils.nonDynamicParams);\n };\n while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) {\n keep++;\n }\n /** Given a retained node, return a new node which uses the to node's param values */\n function applyToParams(retainedNode, idx) {\n var cloned = retainedNode.clone();\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }\n var from, retained, exiting, entering, to;\n from = fromPath;\n retained = from.slice(0, keep);\n exiting = from.slice(keep);\n // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped\n var retainedWithToParams = retained.map(applyToParams);\n entering = toPath.slice(keep);\n to = (retainedWithToParams).concat(entering);\n return { from: from, to: to, retained: retained, retainedWithToParams: retainedWithToParams, exiting: exiting, entering: entering };\n };\n /**\n * Returns a new path which is: the subpath of the first path which matches the second path.\n *\n * The new path starts from root and contains any nodes that match the nodes in the second path.\n * It stops before the first non-matching node.\n *\n * Nodes are compared using their state property and their parameter values.\n * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.\n *\n * @param pathA the first path\n * @param pathB the second path\n * @param paramsFn a function which returns the parameters to consider when comparing\n *\n * @returns an array of PathNodes from the first path which match the nodes in the second path\n */\n PathUtils.matching = function (pathA, pathB, paramsFn) {\n var done = false;\n var tuples = arrayTuples(pathA, pathB);\n return tuples.reduce(function (matching, _a) {\n var nodeA = _a[0], nodeB = _a[1];\n done = done || !nodeA.equals(nodeB, paramsFn);\n return done ? matching : matching.concat(nodeA);\n }, []);\n };\n /**\n * Returns true if two paths are identical.\n *\n * @param pathA\n * @param pathB\n * @param paramsFn a function which returns the parameters to consider when comparing\n * @returns true if the the states and parameter values for both paths are identical\n */\n PathUtils.equals = function (pathA, pathB, paramsFn) {\n return pathA.length === pathB.length &&\n PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length;\n };\n /**\n * Return a subpath of a path, which stops at the first matching node\n *\n * Given an array of nodes, returns a subset of the array starting from the first node,\n * stopping when the first node matches the predicate.\n *\n * @param path a path of [[PathNode]]s\n * @param predicate a [[Predicate]] fn that matches [[PathNode]]s\n * @returns a subpath up to the matching node, or undefined if no match is found\n */\n PathUtils.subPath = function (path, predicate) {\n var node = find(path, predicate);\n var elementIdx = path.indexOf(node);\n return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);\n };\n PathUtils.nonDynamicParams = function (node) {\n return node.state.parameters({ inherit: false })\n .filter(function (param) { return !param.dynamic; });\n };\n /** Gets the raw parameter values from a path */\n PathUtils.paramValues = function (path) {\n return path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});\n };\n return PathUtils;\n}());\n\n/**\n * @coreapi\n * @module resolve\n */ /** for typedoc */\n// TODO: explicitly make this user configurable\nvar defaultResolvePolicy = {\n when: 'LAZY',\n async: 'WAIT',\n};\n/**\n * The basic building block for the resolve system.\n *\n * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise),\n * and the unwrapped-when-complete (.data) result of the resolveFn.\n *\n * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the\n * resolveFn) and returns the resulting promise.\n *\n * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first\n * parameter to those fns.\n */\nvar Resolvable = /** @class */ (function () {\n function Resolvable(arg1, resolveFn, deps, policy, data) {\n this.resolved = false;\n this.promise = undefined;\n if (arg1 instanceof Resolvable) {\n extend(this, arg1);\n }\n else if (isFunction(resolveFn)) {\n if (isNullOrUndefined(arg1))\n throw new Error('new Resolvable(): token argument is required');\n if (!isFunction(resolveFn))\n throw new Error('new Resolvable(): resolveFn argument must be a function');\n this.token = arg1;\n this.policy = policy;\n this.resolveFn = resolveFn;\n this.deps = deps || [];\n this.data = data;\n this.resolved = data !== undefined;\n this.promise = this.resolved ? services.$q.when(this.data) : undefined;\n }\n else if (isObject(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) {\n var literal = arg1;\n return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data);\n }\n }\n Resolvable.prototype.getPolicy = function (state) {\n var thisPolicy = this.policy || {};\n var statePolicy = state && state.resolvePolicy || {};\n return {\n when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,\n async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,\n };\n };\n /**\n * Asynchronously resolve this Resolvable's data\n *\n * Given a ResolveContext that this Resolvable is found in:\n * Wait for this Resolvable's dependencies, then invoke this Resolvable's function\n * and update the Resolvable's state\n */\n Resolvable.prototype.resolve = function (resolveContext, trans) {\n var _this = this;\n var $q = services.$q;\n // Gets all dependencies from ResolveContext and wait for them to be resolved\n var getResolvableDependencies = function () {\n return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) {\n return resolvable.get(resolveContext, trans);\n }));\n };\n // Invokes the resolve function passing the resolved dependencies as arguments\n var invokeResolveFn = function (resolvedDeps) {\n return _this.resolveFn.apply(null, resolvedDeps);\n };\n /**\n * For RXWAIT policy:\n *\n * Given an observable returned from a resolve function:\n * - enables .cache() mode (this allows multicast subscribers)\n * - then calls toPromise() (this triggers subscribe() and thus fetches)\n * - Waits for the promise, then return the cached observable (not the first emitted value).\n */\n var waitForRx = function (observable$) {\n var cached = observable$.cache(1);\n return cached.take(1).toPromise().then(function () { return cached; });\n };\n // If the resolve policy is RXWAIT, wait for the observable to emit something. otherwise pass through.\n var node = resolveContext.findNode(this);\n var state = node && node.state;\n var maybeWaitForRx = this.getPolicy(state).async === 'RXWAIT' ? waitForRx : identity;\n // After the final value has been resolved, update the state of the Resolvable\n var applyResolvedValue = function (resolvedValue) {\n _this.data = resolvedValue;\n _this.resolved = true;\n _this.resolveFn = null;\n trace.traceResolvableResolved(_this, trans);\n return _this.data;\n };\n // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick.\n return this.promise = $q.when()\n .then(getResolvableDependencies)\n .then(invokeResolveFn)\n .then(maybeWaitForRx)\n .then(applyResolvedValue);\n };\n /**\n * Gets a promise for this Resolvable's data.\n *\n * Fetches the data and returns a promise.\n * Returns the existing promise if it has already been fetched once.\n */\n Resolvable.prototype.get = function (resolveContext, trans) {\n return this.promise || this.resolve(resolveContext, trans);\n };\n Resolvable.prototype.toString = function () {\n return \"Resolvable(token: \" + stringify(this.token) + \", requires: [\" + this.deps.map(stringify) + \"])\";\n };\n Resolvable.prototype.clone = function () {\n return new Resolvable(this);\n };\n Resolvable.fromData = function (token, data) {\n return new Resolvable(token, function () { return data; }, null, null, data);\n };\n return Resolvable;\n}());\n\n/** @internalapi */\nvar resolvePolicies = {\n when: {\n LAZY: 'LAZY',\n EAGER: 'EAGER',\n },\n async: {\n WAIT: 'WAIT',\n NOWAIT: 'NOWAIT',\n RXWAIT: 'RXWAIT',\n },\n};\n\n/** @module resolve */\n/** for typedoc */\nvar whens = resolvePolicies.when;\nvar ALL_WHENS = [whens.EAGER, whens.LAZY];\nvar EAGER_WHENS = [whens.EAGER];\n// tslint:disable-next-line:no-inferrable-types\nvar NATIVE_INJECTOR_TOKEN = 'Native Injector';\n/**\n * Encapsulates Dependency Injection for a path of nodes\n *\n * UI-Router states are organized as a tree.\n * A nested state has a path of ancestors to the root of the tree.\n * When a state is being activated, each element in the path is wrapped as a [[PathNode]].\n * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.\n *\n * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.\n */\nvar ResolveContext = /** @class */ (function () {\n function ResolveContext(_path) {\n this._path = _path;\n }\n /** Gets all the tokens found in the resolve context, de-duplicated */\n ResolveContext.prototype.getTokens = function () {\n return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(uniqR, []);\n };\n /**\n * Gets the Resolvable that matches the token\n *\n * Gets the last Resolvable that matches the token in this context, or undefined.\n * Throws an error if it doesn't exist in the ResolveContext\n */\n ResolveContext.prototype.getResolvable = function (token) {\n var matching = this._path.map(function (node) { return node.resolvables; })\n .reduce(unnestR, [])\n .filter(function (r) { return r.token === token; });\n return tail(matching);\n };\n /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */\n ResolveContext.prototype.getPolicy = function (resolvable) {\n var node = this.findNode(resolvable);\n return resolvable.getPolicy(node.state);\n };\n /**\n * Returns a ResolveContext that includes a portion of this one\n *\n * Given a state, this method creates a new ResolveContext from this one.\n * The new context starts at the first node (root) and stops at the node for the `state` parameter.\n *\n * #### Why\n *\n * When a transition is created, the nodes in the \"To Path\" are injected from a ResolveContext.\n * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.\n * The \"To State\" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).\n * This method is used to create a narrower context when injecting ancestor nodes.\n *\n * @example\n * `let ABCD = new ResolveContext([A, B, C, D]);`\n *\n * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:\n * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.\n * However, `B` should only be able to access resolvables from `A`, `B`.\n *\n * When resolving for the `B` node, first take the full \"To Path\" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.\n * `let AB = ABCD.subcontext(a)`\n */\n ResolveContext.prototype.subContext = function (state) {\n return new ResolveContext(PathUtils.subPath(this._path, function (node) { return node.state === state; }));\n };\n /**\n * Adds Resolvables to the node that matches the state\n *\n * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).\n * The resolvable is added to the node matching the `state` parameter.\n *\n * These new resolvables are not automatically fetched.\n * The calling code should either fetch them, fetch something that depends on them,\n * or rely on [[resolvePath]] being called when some state is being entered.\n *\n * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.\n *\n * @param newResolvables the new Resolvables\n * @param state Used to find the node to put the resolvable on\n */\n ResolveContext.prototype.addResolvables = function (newResolvables, state) {\n var node = find(this._path, propEq('state', state));\n var keys = newResolvables.map(function (r) { return r.token; });\n node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables);\n };\n /**\n * Returns a promise for an array of resolved path Element promises\n *\n * @param when\n * @param trans\n * @returns {Promise|any}\n */\n ResolveContext.prototype.resolvePath = function (when, trans) {\n var _this = this;\n if (when === void 0) { when = 'LAZY'; }\n // This option determines which 'when' policy Resolvables we are about to fetch.\n var whenOption = inArray(ALL_WHENS, when) ? when : 'LAZY';\n // If the caller specified EAGER, only the EAGER Resolvables are fetched.\n // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.`\n var matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;\n // get the subpath to the state argument, if provided\n trace.traceResolvePath(this._path, when, trans);\n var matchesPolicy = function (acceptedVals, whenOrAsync) {\n return function (resolvable) {\n return inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]);\n };\n };\n // Trigger all the (matching) Resolvables in the path\n // Reduce all the \"WAIT\" Resolvables into an array\n var promises = this._path.reduce(function (acc, node) {\n var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));\n var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));\n var wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async')));\n // For the matching Resolvables, start their async fetch process.\n var subContext = _this.subContext(node.state);\n var getResult = function (r) { return r.get(subContext, trans)\n .then(function (value) { return ({ token: r.token, value: value }); }); };\n nowait.forEach(getResult);\n return acc.concat(wait.map(getResult));\n }, []);\n // Wait for all the \"WAIT\" resolvables\n return services.$q.all(promises);\n };\n ResolveContext.prototype.injector = function () {\n return this._injector || (this._injector = new UIInjectorImpl(this));\n };\n ResolveContext.prototype.findNode = function (resolvable) {\n return find(this._path, function (node) { return inArray(node.resolvables, resolvable); });\n };\n /**\n * Gets the async dependencies of a Resolvable\n *\n * Given a Resolvable, returns its dependencies as a Resolvable[]\n */\n ResolveContext.prototype.getDependencies = function (resolvable) {\n var _this = this;\n var node = this.findNode(resolvable);\n // Find which other resolvables are \"visible\" to the `resolvable` argument\n // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path)\n var subPath = PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path;\n var availableResolvables = subPath\n .reduce(function (acc, _node) { return acc.concat(_node.resolvables); }, []) // all of subpath's resolvables\n .filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument\n var getDependency = function (token) {\n var matching = availableResolvables.filter(function (r) { return r.token === token; });\n if (matching.length)\n return tail(matching);\n var fromInjector = _this.injector().getNative(token);\n if (isUndefined(fromInjector)) {\n throw new Error('Could not find Dependency Injection token: ' + stringify(token));\n }\n return new Resolvable(token, function () { return fromInjector; }, [], fromInjector);\n };\n return resolvable.deps.map(getDependency);\n };\n return ResolveContext;\n}());\nvar UIInjectorImpl = /** @class */ (function () {\n function UIInjectorImpl(context) {\n this.context = context;\n this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector;\n }\n UIInjectorImpl.prototype.get = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable) {\n if (this.context.getPolicy(resolvable).async === 'NOWAIT') {\n return resolvable.get(this.context);\n }\n if (!resolvable.resolved) {\n throw new Error('Resolvable async .get() not complete:' + stringify(resolvable.token));\n }\n return resolvable.data;\n }\n return this.getNative(token);\n };\n UIInjectorImpl.prototype.getAsync = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable)\n return resolvable.get(this.context);\n return services.$q.when(this.native.get(token));\n };\n UIInjectorImpl.prototype.getNative = function (token) {\n return this.native && this.native.get(token);\n };\n return UIInjectorImpl;\n}());\n\n/**\n * @coreapi\n * @module transition\n */\n/** for typedoc */\n/** @hidden */\nvar stateSelf = prop('self');\n/**\n * Represents a transition between two states.\n *\n * When navigating to a state, we are transitioning **from** the current state **to** the new state.\n *\n * This object contains all contextual information about the to/from states, parameters, resolves.\n * It has information about all states being entered and exited as a result of the transition.\n */\nvar Transition = /** @class */ (function () {\n /**\n * Creates a new Transition object.\n *\n * If the target state is not valid, an error is thrown.\n *\n * @internalapi\n *\n * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`\n * encapsulates the \"from state\".\n * @param targetState The target state and parameters being transitioned to (also, the transition options)\n * @param router The [[UIRouter]] instance\n */\n function Transition(fromPath, targetState, router) {\n var _this = this;\n /** @hidden */\n this._deferred = services.$q.defer();\n /**\n * This promise is resolved or rejected based on the outcome of the Transition.\n *\n * When the transition is successful, the promise is resolved\n * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error\n */\n this.promise = this._deferred.promise;\n /** @hidden Holds the hook registration functions such as those passed to Transition.onStart() */\n this._registeredHooks = {};\n /** @hidden */\n this._hookBuilder = new HookBuilder(this);\n /** Checks if this transition is currently active/running. */\n this.isActive = function () {\n return _this.router.globals.transition === _this;\n };\n this.router = router;\n this._targetState = targetState;\n if (!targetState.valid()) {\n throw new Error(targetState.error());\n }\n // current() is assumed to come from targetState.options, but provide a naive implementation otherwise.\n this._options = extend({ current: val(this) }, targetState.options());\n this.$id = router.transitionService._transitionCount++;\n var toPath = PathUtils.buildToPath(fromPath, targetState);\n this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);\n this.createTransitionHookRegFns();\n var onCreateHooks = this._hookBuilder.buildHooksForPhase(exports.TransitionHookPhase.CREATE);\n TransitionHook.invokeHooks(onCreateHooks, function () { return null; });\n this.applyViewConfigs(router);\n }\n /** @hidden */\n Transition.prototype.onBefore = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onStart = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onExit = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onRetain = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onEnter = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onFinish = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onSuccess = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n Transition.prototype.onError = function (criteria, callback, options) { return; };\n /** @hidden\n * Creates the transition-level hook registration functions\n * (which can then be used to register hooks)\n */\n Transition.prototype.createTransitionHookRegFns = function () {\n var _this = this;\n this.router.transitionService._pluginapi._getEvents()\n .filter(function (type) { return type.hookPhase !== exports.TransitionHookPhase.CREATE; })\n .forEach(function (type) { return makeEvent(_this, _this.router.transitionService, type); });\n };\n /** @internalapi */\n Transition.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n Transition.prototype.applyViewConfigs = function (router) {\n var enteringStates = this._treeChanges.entering.map(function (node) { return node.state; });\n PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);\n };\n /**\n * @internalapi\n *\n * @returns the internal from [State] object\n */\n Transition.prototype.$from = function () {\n return tail(this._treeChanges.from).state;\n };\n /**\n * @internalapi\n *\n * @returns the internal to [State] object\n */\n Transition.prototype.$to = function () {\n return tail(this._treeChanges.to).state;\n };\n /**\n * Returns the \"from state\"\n *\n * Returns the state that the transition is coming *from*.\n *\n * @returns The state declaration object for the Transition's (\"from state\").\n */\n Transition.prototype.from = function () {\n return this.$from().self;\n };\n /**\n * Returns the \"to state\"\n *\n * Returns the state that the transition is going *to*.\n *\n * @returns The state declaration object for the Transition's target state (\"to state\").\n */\n Transition.prototype.to = function () {\n return this.$to().self;\n };\n /**\n * Gets the Target State\n *\n * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.\n *\n * @returns the [[TargetState]] of this Transition\n */\n Transition.prototype.targetState = function () {\n return this._targetState;\n };\n /**\n * Determines whether two transitions are equivalent.\n * @deprecated\n */\n Transition.prototype.is = function (compare) {\n if (compare instanceof Transition) {\n // TODO: Also compare parameters\n return this.is({ to: compare.$to().name, from: compare.$from().name });\n }\n return !((compare.to && !matchState(this.$to(), compare.to)) ||\n (compare.from && !matchState(this.$from(), compare.from)));\n };\n Transition.prototype.params = function (pathname) {\n if (pathname === void 0) { pathname = 'to'; }\n return Object.freeze(this._treeChanges[pathname].map(prop('paramValues')).reduce(mergeR, {}));\n };\n /**\n * Creates a [[UIInjector]] Dependency Injector\n *\n * Returns a Dependency Injector for the Transition's target state (to state).\n * The injector provides resolve values which the target state has access to.\n *\n * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).\n *\n * #### Example:\n * ```js\n * .onEnter({ entering: 'myState' }, trans => {\n * var myResolveValue = trans.injector().get('myResolve');\n * // Inject a global service from the global/native injector (if it exists)\n * var MyService = trans.injector().get('MyService');\n * })\n * ```\n *\n * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.\n * You can use [[UIInjector.getAsync]] to get a promise for the data.\n * #### Example:\n * ```js\n * .onBefore({}, trans => {\n * return trans.injector().getAsync('myResolve').then(myResolveValue =>\n * return myResolveValue !== 'ABORT';\n * });\n * });\n * ```\n *\n * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.\n * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.\n * #### Example:\n * ```js\n * .onEnter({ to: 'foo.bar' }, trans => {\n * // returns result of `foo` state's `myResolve` resolve\n * // even though `foo.bar` also has a `myResolve` resolve\n * var fooData = trans.injector('foo').get('myResolve');\n * });\n * ```\n *\n * If you need resolve data from the exiting states, pass `'from'` as `pathName`.\n * The resolve data from the `from` path will be returned.\n * #### Example:\n * ```js\n * .onExit({ exiting: 'foo.bar' }, trans => {\n * // Gets the resolve value of `myResolve` from the state being exited\n * var fooData = trans.injector(null, 'from').get('myResolve');\n * });\n * ```\n *\n *\n * @param state Limits the resolves provided to only the resolves the provided state has access to.\n * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.\n *\n * @returns a [[UIInjector]]\n */\n Transition.prototype.injector = function (state, pathName) {\n if (pathName === void 0) { pathName = 'to'; }\n var path = this._treeChanges[pathName];\n if (state)\n path = PathUtils.subPath(path, function (node) { return node.state === state || node.state.name === state; });\n return new ResolveContext(path).injector();\n };\n /**\n * Gets all available resolve tokens (keys)\n *\n * This method can be used in conjunction with [[injector]] to inspect the resolve values\n * available to the Transition.\n *\n * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states\n * in the Transition's [[TreeChanges.to]] path.\n *\n * #### Example:\n * This example logs all resolve values\n * ```js\n * let tokens = trans.getResolveTokens();\n * tokens.forEach(token => console.log(token + \" = \" + trans.injector().get(token)));\n * ```\n *\n * #### Example:\n * This example creates promises for each resolve value.\n * This triggers fetches of resolves (if any have not yet been fetched).\n * When all promises have all settled, it logs the resolve values.\n * ```js\n * let tokens = trans.getResolveTokens();\n * let promise = tokens.map(token => trans.injector().getAsync(token));\n * Promise.all(promises).then(values => console.log(\"Resolved values: \" + values));\n * ```\n *\n * Note: Angular 1 users whould use `$q.all()`\n *\n * @param pathname resolve context's path name (e.g., `to` or `from`)\n *\n * @returns an array of resolve tokens (keys)\n */\n Transition.prototype.getResolveTokens = function (pathname) {\n if (pathname === void 0) { pathname = 'to'; }\n return new ResolveContext(this._treeChanges[pathname]).getTokens();\n };\n /**\n * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.\n *\n * Allows a transition hook to dynamically add a Resolvable to this Transition.\n *\n * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).\n *\n * If a `state` argument is provided, the Resolvable is processed when that state is being entered.\n * If no `state` is provided then the root state is used.\n * If the given `state` has already been entered, the Resolvable is processed when any child state is entered.\n * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition.\n *\n * The `state` argument also scopes the resolved data.\n * The resolved data is available from the injector for that `state` and any children states.\n *\n * #### Example:\n * ```js\n * transitionService.onBefore({}, transition => {\n * transition.addResolvable({\n * token: 'myResolve',\n * deps: ['MyService'],\n * resolveFn: myService => myService.getData()\n * });\n * });\n * ```\n *\n * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])\n * @param state the state in the \"to path\" which should receive the new resolve (otherwise, the root state)\n */\n Transition.prototype.addResolvable = function (resolvable, state) {\n if (state === void 0) { state = ''; }\n resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable);\n var stateName = (typeof state === 'string') ? state : state.name;\n var topath = this._treeChanges.to;\n var targetNode = find(topath, function (node) { return node.state.name === stateName; });\n var resolveContext = new ResolveContext(topath);\n resolveContext.addResolvables([resolvable], targetNode.state);\n };\n /**\n * Gets the transition from which this transition was redirected.\n *\n * If the current transition is a redirect, this method returns the transition that was redirected.\n *\n * #### Example:\n * ```js\n * let transitionA = $state.go('A').transition\n * transitionA.onStart({}, () => $state.target('B'));\n * $transitions.onSuccess({ to: 'B' }, (trans) => {\n * trans.to().name === 'B'; // true\n * trans.redirectedFrom() === transitionA; // true\n * });\n * ```\n *\n * @returns The previous Transition, or null if this Transition is not the result of a redirection\n */\n Transition.prototype.redirectedFrom = function () {\n return this._options.redirectedFrom || null;\n };\n /**\n * Gets the original transition in a redirect chain\n *\n * A transition might belong to a long chain of multiple redirects.\n * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.\n *\n * #### Example:\n * ```js\n * // states\n * registry.register({ name: 'A', redirectTo: 'B' });\n * registry.register({ name: 'B', redirectTo: 'C' });\n * registry.register({ name: 'C', redirectTo: 'D' });\n * registry.register({ name: 'D' });\n *\n * let transitionA = $state.go('A').transition\n *\n * $transitions.onSuccess({ to: 'D' }, (trans) => {\n * trans.to().name === 'D'; // true\n * trans.redirectedFrom().to().name === 'C'; // true\n * trans.originalTransition() === transitionA; // true\n * trans.originalTransition().to().name === 'A'; // true\n * });\n * ```\n *\n * @returns The original Transition that started a redirect chain\n */\n Transition.prototype.originalTransition = function () {\n var rf = this.redirectedFrom();\n return (rf && rf.originalTransition()) || this;\n };\n /**\n * Get the transition options\n *\n * @returns the options for this Transition.\n */\n Transition.prototype.options = function () {\n return this._options;\n };\n /**\n * Gets the states being entered.\n *\n * @returns an array of states that will be entered during this transition.\n */\n Transition.prototype.entering = function () {\n return map(this._treeChanges.entering, prop('state')).map(stateSelf);\n };\n /**\n * Gets the states being exited.\n *\n * @returns an array of states that will be exited during this transition.\n */\n Transition.prototype.exiting = function () {\n return map(this._treeChanges.exiting, prop('state')).map(stateSelf).reverse();\n };\n /**\n * Gets the states being retained.\n *\n * @returns an array of states that are already entered from a previous Transition, that will not be\n * exited during this Transition\n */\n Transition.prototype.retained = function () {\n return map(this._treeChanges.retained, prop('state')).map(stateSelf);\n };\n /**\n * Get the [[ViewConfig]]s associated with this Transition\n *\n * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.\n * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., \"to\" or \"entering\").\n *\n * @param pathname the name of the path to fetch views for:\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\n * @param state If provided, only returns the `ViewConfig`s for a single state in the path\n *\n * @returns a list of ViewConfig objects for the given path.\n */\n Transition.prototype.views = function (pathname, state) {\n if (pathname === void 0) { pathname = 'entering'; }\n var path = this._treeChanges[pathname];\n path = !state ? path : path.filter(propEq('state', state));\n return path.map(prop('views')).filter(identity).reduce(unnestR, []);\n };\n Transition.prototype.treeChanges = function (pathname) {\n return pathname ? this._treeChanges[pathname] : this._treeChanges;\n };\n /**\n * Creates a new transition that is a redirection of the current one.\n *\n * This transition can be returned from a [[TransitionService]] hook to\n * redirect a transition to a new state and/or set of parameters.\n *\n * @internalapi\n *\n * @returns Returns a new [[Transition]] instance.\n */\n Transition.prototype.redirect = function (targetState) {\n var redirects = 1, trans = this;\n // tslint:disable-next-line:no-conditional-assignment\n while ((trans = trans.redirectedFrom()) != null) {\n if (++redirects > 20)\n throw new Error(\"Too many consecutive Transition redirects (20+)\");\n }\n var redirectOpts = { redirectedFrom: this, source: 'redirect' };\n // If the original transition was caused by URL sync, then use { location: 'replace' }\n // on the new transition (unless the target state explicitly specifies location: false).\n // This causes the original url to be replaced with the url for the redirect target\n // so the original url disappears from the browser history.\n if (this.options().source === 'url' && targetState.options().location !== false) {\n redirectOpts.location = 'replace';\n }\n var newOptions = extend({}, this.options(), targetState.options(), redirectOpts);\n targetState = targetState.withOptions(newOptions, true);\n var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);\n var originalEnteringNodes = this._treeChanges.entering;\n var redirectEnteringNodes = newTransition._treeChanges.entering;\n // --- Re-use resolve data from original transition ---\n // When redirecting from a parent state to a child state where the parent parameter values haven't changed\n // (because of the redirect), the resolves fetched by the original transition are still valid in the\n // redirected transition.\n //\n // This allows you to define a redirect on a parent state which depends on an async resolve value.\n // You can wait for the resolve, then redirect to a child state based on the result.\n // The redirected transition does not have to re-fetch the resolve.\n // ---------------------------------------------------------\n var nodeIsReloading = function (reloadState) { return function (node) {\n return reloadState && node.state.includes[reloadState.name];\n }; };\n // Find any \"entering\" nodes in the redirect path that match the original path and aren't being reloaded\n var matchingEnteringNodes = PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, PathUtils.nonDynamicParams)\n .filter(not(nodeIsReloading(targetState.options().reloadState)));\n // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes.\n matchingEnteringNodes.forEach(function (node, idx) {\n node.resolvables = originalEnteringNodes[idx].resolvables;\n });\n return newTransition;\n };\n /** @hidden If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */\n Transition.prototype._changedParams = function () {\n var tc = this._treeChanges;\n /** Return undefined if it's not a \"dynamic\" transition, for the following reasons */\n // If user explicitly wants a reload\n if (this._options.reload)\n return undefined;\n // If any states are exiting or entering\n if (tc.exiting.length || tc.entering.length)\n return undefined;\n // If to/from path lengths differ\n if (tc.to.length !== tc.from.length)\n return undefined;\n // If the to/from paths are different\n var pathsDiffer = arrayTuples(tc.to, tc.from)\n .map(function (tuple) { return tuple[0].state !== tuple[1].state; })\n .reduce(anyTrueR, false);\n if (pathsDiffer)\n return undefined;\n // Find any parameter values that differ\n var nodeSchemas = tc.to.map(function (node) { return node.paramSchema; });\n var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1];\n var tuples = arrayTuples(nodeSchemas, toValues, fromValues);\n return tuples.map(function (_a) {\n var schema = _a[0], toVals = _a[1], fromVals = _a[2];\n return Param.changed(schema, toVals, fromVals);\n }).reduce(unnestR, []);\n };\n /**\n * Returns true if the transition is dynamic.\n *\n * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.\n *\n * @returns true if the Transition is dynamic\n */\n Transition.prototype.dynamic = function () {\n var changes = this._changedParams();\n return !changes ? false : changes.map(function (x) { return x.dynamic; }).reduce(anyTrueR, false);\n };\n /**\n * Returns true if the transition is ignored.\n *\n * A transition is ignored if no states are entered nor exited, and no parameter values have changed.\n *\n * @returns true if the Transition is ignored.\n */\n Transition.prototype.ignored = function () {\n return !!this._ignoredReason();\n };\n /** @hidden */\n Transition.prototype._ignoredReason = function () {\n var pending = this.router.globals.transition;\n var reloadState = this._options.reloadState;\n var same = function (pathA, pathB) {\n if (pathA.length !== pathB.length)\n return false;\n var matching = PathUtils.matching(pathA, pathB);\n return pathA.length === matching.filter(function (node) { return !reloadState || !node.state.includes[reloadState.name]; }).length;\n };\n var newTC = this.treeChanges();\n var pendTC = pending && pending.treeChanges();\n if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting))\n return 'SameAsPending';\n if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to))\n return 'SameAsCurrent';\n };\n /**\n * Runs the transition\n *\n * This method is generally called from the [[StateService.transitionTo]]\n *\n * @internalapi\n *\n * @returns a promise for a successful transition.\n */\n Transition.prototype.run = function () {\n var _this = this;\n var runAllHooks = TransitionHook.runAllHooks;\n // Gets transition hooks array for the given phase\n var getHooksFor = function (phase) {\n return _this._hookBuilder.buildHooksForPhase(phase);\n };\n // When the chain is complete, then resolve or reject the deferred\n var transitionSuccess = function () {\n trace.traceSuccess(_this.$to(), _this);\n _this.success = true;\n _this._deferred.resolve(_this.to());\n runAllHooks(getHooksFor(exports.TransitionHookPhase.SUCCESS));\n };\n var transitionError = function (reason) {\n trace.traceError(reason, _this);\n _this.success = false;\n _this._deferred.reject(reason);\n _this._error = reason;\n runAllHooks(getHooksFor(exports.TransitionHookPhase.ERROR));\n };\n var runTransition = function () {\n // Wait to build the RUN hook chain until the BEFORE hooks are done\n // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object.\n var allRunHooks = getHooksFor(exports.TransitionHookPhase.RUN);\n var done = function () { return services.$q.when(undefined); };\n return TransitionHook.invokeHooks(allRunHooks, done);\n };\n var startTransition = function () {\n var globals = _this.router.globals;\n globals.lastStartedTransitionId = _this.$id;\n globals.transition = _this;\n globals.transitionHistory.enqueue(_this);\n trace.traceTransitionStart(_this);\n return services.$q.when(undefined);\n };\n var allBeforeHooks = getHooksFor(exports.TransitionHookPhase.BEFORE);\n TransitionHook.invokeHooks(allBeforeHooks, startTransition)\n .then(runTransition)\n .then(transitionSuccess, transitionError);\n return this.promise;\n };\n /**\n * Checks if the Transition is valid\n *\n * @returns true if the Transition is valid\n */\n Transition.prototype.valid = function () {\n return !this.error() || this.success !== undefined;\n };\n /**\n * Aborts this transition\n *\n * Imperative API to abort a Transition.\n * This only applies to Transitions that are not yet complete.\n */\n Transition.prototype.abort = function () {\n // Do not set flag if the transition is already complete\n if (isUndefined(this.success)) {\n this._aborted = true;\n }\n };\n /**\n * The Transition error reason.\n *\n * If the transition is invalid (and could not be run), returns the reason the transition is invalid.\n * If the transition was valid and ran, but was not successful, returns the reason the transition failed.\n *\n * @returns an error message explaining why the transition is invalid, or the reason the transition failed.\n */\n Transition.prototype.error = function () {\n var state = this.$to();\n if (state.self.abstract)\n return \"Cannot transition to abstract state '\" + state.name + \"'\";\n var paramDefs = state.parameters(), values$$1 = this.params();\n var invalidParams = paramDefs.filter(function (param) { return !param.validates(values$$1[param.id]); });\n if (invalidParams.length) {\n return \"Param values not valid for state '\" + state.name + \"'. Invalid params: [ \" + invalidParams.map(function (param) { return param.id; }).join(', ') + \" ]\";\n }\n if (this.success === false)\n return this._error;\n };\n /**\n * A string representation of the Transition\n *\n * @returns A string representation of the Transition\n */\n Transition.prototype.toString = function () {\n var fromStateOrName = this.from();\n var toStateOrName = this.to();\n var avoidEmptyHash = function (params) {\n return (params['#'] !== null && params['#'] !== undefined) ? params : omit(params, ['#']);\n };\n // (X) means the to state is invalid.\n var id = this.$id, from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = stringify(avoidEmptyHash(this.params()));\n return \"Transition#\" + id + \"( '\" + from + \"'\" + fromParams + \" -> \" + toValid + \"'\" + to + \"'\" + toParams + \" )\";\n };\n /** @hidden */\n Transition.diToken = Transition;\n return Transition;\n}());\n\n/**\n * Functions that manipulate strings\n *\n * Although these functions are exported, they are subject to change without notice.\n *\n * @module common_strings\n */ /** */\n/**\n * Returns a string shortened to a maximum length\n *\n * If the string is already less than the `max` length, return the string.\n * Else return the string, shortened to `max - 3` and append three dots (\"...\").\n *\n * @param max the maximum length of the string to return\n * @param str the input string\n */\nfunction maxLength(max, str) {\n if (str.length <= max)\n return str;\n return str.substr(0, max - 3) + '...';\n}\n/**\n * Returns a string, with spaces added to the end, up to a desired str length\n *\n * If the string is already longer than the desired length, return the string.\n * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.\n *\n * @param length the desired length of the string to return\n * @param str the input string\n */\nfunction padString(length, str) {\n while (str.length < length)\n str += ' ';\n return str;\n}\nfunction kebobString(camelCase) {\n return camelCase\n .replace(/^([A-Z])/, function ($1) { return $1.toLowerCase(); }) // replace first char\n .replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); }); // replace rest\n}\nfunction functionToString(fn) {\n var fnStr = fnToString(fn);\n var namedFunctionMatch = fnStr.match(/^(function [^ ]+\\([^)]*\\))/);\n var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr;\n var fnName = fn['name'] || '';\n if (fnName && toStr.match(/function \\(/)) {\n return 'function ' + fnName + toStr.substr(9);\n }\n return toStr;\n}\nfunction fnToString(fn) {\n var _fn = isArray(fn) ? fn.slice(-1)[0] : fn;\n return _fn && _fn.toString() || 'undefined';\n}\nvar stringifyPatternFn = null;\nvar stringifyPattern = function (value) {\n var isRejection = Rejection.isRejectionPromise;\n stringifyPatternFn = stringifyPatternFn || pattern([\n [not(isDefined), val('undefined')],\n [isNull, val('null')],\n [isPromise, val('[Promise]')],\n [isRejection, function (x) { return x._transitionRejection.toString(); }],\n [is(Rejection), invoke('toString')],\n [is(Transition), invoke('toString')],\n [is(Resolvable), invoke('toString')],\n [isInjectable, functionToString],\n [val(true), identity],\n ]);\n return stringifyPatternFn(value);\n};\nfunction stringify(o) {\n var seen = [];\n function format(value) {\n if (isObject(value)) {\n if (seen.indexOf(value) !== -1)\n return '[circular ref]';\n seen.push(value);\n }\n return stringifyPattern(value);\n }\n return JSON.stringify(o, function (key, value) { return format(value); }).replace(/\\\\\"/g, '\"');\n}\n/** Returns a function that splits a string on a character or substring */\nvar beforeAfterSubstr = function (char) { return function (str) {\n if (!str)\n return ['', ''];\n var idx = str.indexOf(char);\n if (idx === -1)\n return [str, ''];\n return [str.substr(0, idx), str.substr(idx + 1)];\n}; };\nvar hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/');\nvar stripLastPathElement = function (str) { return str.replace(/\\/[^/]*$/, ''); };\nvar splitHash = beforeAfterSubstr('#');\nvar splitQuery = beforeAfterSubstr('?');\nvar splitEqual = beforeAfterSubstr('=');\nvar trimHashVal = function (str) { return str ? str.replace(/^#/, '') : ''; };\n/**\n * Splits on a delimiter, but returns the delimiters in the array\n *\n * #### Example:\n * ```js\n * var splitOnSlashes = splitOnDelim('/');\n * splitOnSlashes(\"/foo\"); // [\"/\", \"foo\"]\n * splitOnSlashes(\"/foo/\"); // [\"/\", \"foo\", \"/\"]\n * ```\n */\nfunction splitOnDelim(delim) {\n var re = new RegExp('(' + delim + ')', 'g');\n return function (str) {\n return str.split(re).filter(identity);\n };\n}\n/**\n * Reduce fn that joins neighboring strings\n *\n * Given an array of strings, returns a new array\n * where all neighboring strings have been joined.\n *\n * #### Example:\n * ```js\n * let arr = [\"foo\", \"bar\", 1, \"baz\", \"\", \"qux\" ];\n * arr.reduce(joinNeighborsR, []) // [\"foobar\", 1, \"bazqux\" ]\n * ```\n */\nfunction joinNeighborsR(acc, x) {\n if (isString(tail(acc)) && isString(x))\n return acc.slice(0, -1).concat(tail(acc) + x);\n return pushR(acc, x);\n}\n\n/** @module common */ /** for typedoc */\n\n/**\n * @coreapi\n * @module params\n */\n/** */\n/**\n * A registry for parameter types.\n *\n * This registry manages the built-in (and custom) parameter types.\n *\n * The built-in parameter types are:\n *\n * - [[string]]\n * - [[path]]\n * - [[query]]\n * - [[hash]]\n * - [[int]]\n * - [[bool]]\n * - [[date]]\n * - [[json]]\n * - [[any]]\n */\nvar ParamTypes = /** @class */ (function () {\n /** @internalapi */\n function ParamTypes() {\n /** @hidden */\n this.enqueue = true;\n /** @hidden */\n this.typeQueue = [];\n /** @internalapi */\n this.defaultTypes = pick(ParamTypes.prototype, ['hash', 'string', 'query', 'path', 'int', 'bool', 'date', 'json', 'any']);\n // Register default types. Store them in the prototype of this.types.\n var makeType = function (definition, name) {\n return new ParamType(extend({ name: name }, definition));\n };\n this.types = inherit(map(this.defaultTypes, makeType), {});\n }\n /** @internalapi */\n ParamTypes.prototype.dispose = function () {\n this.types = {};\n };\n /**\n * Registers a parameter type\n *\n * End users should call [[UrlMatcherFactory.type]], which delegates to this method.\n */\n ParamTypes.prototype.type = function (name, definition, definitionFn) {\n if (!isDefined(definition))\n return this.types[name];\n if (this.types.hasOwnProperty(name))\n throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n this.types[name] = new ParamType(extend({ name: name }, definition));\n if (definitionFn) {\n this.typeQueue.push({ name: name, def: definitionFn });\n if (!this.enqueue)\n this._flushTypeQueue();\n }\n return this;\n };\n /** @internalapi */\n ParamTypes.prototype._flushTypeQueue = function () {\n while (this.typeQueue.length) {\n var type = this.typeQueue.shift();\n if (type.pattern)\n throw new Error(\"You cannot override a type's .pattern at runtime.\");\n extend(this.types[type.name], services.$injector.invoke(type.def));\n }\n };\n return ParamTypes;\n}());\n/** @hidden */\nfunction initDefaultTypes() {\n var makeDefaultType = function (def) {\n var valToString = function (val$$1) {\n return val$$1 != null ? val$$1.toString() : val$$1;\n };\n var defaultTypeBase = {\n encode: valToString,\n decode: valToString,\n is: is(String),\n pattern: /.*/,\n // tslint:disable-next-line:triple-equals\n equals: function (a, b) { return a == b; },\n };\n return extend({}, defaultTypeBase, def);\n };\n // Default Parameter Type Definitions\n extend(ParamTypes.prototype, {\n string: makeDefaultType({}),\n path: makeDefaultType({\n pattern: /[^/]*/,\n }),\n query: makeDefaultType({}),\n hash: makeDefaultType({\n inherit: false,\n }),\n int: makeDefaultType({\n decode: function (val$$1) { return parseInt(val$$1, 10); },\n is: function (val$$1) {\n return !isNullOrUndefined(val$$1) && this.decode(val$$1.toString()) === val$$1;\n },\n pattern: /-?\\d+/,\n }),\n bool: makeDefaultType({\n encode: function (val$$1) { return val$$1 && 1 || 0; },\n decode: function (val$$1) { return parseInt(val$$1, 10) !== 0; },\n is: is(Boolean),\n pattern: /0|1/,\n }),\n date: makeDefaultType({\n encode: function (val$$1) {\n return !this.is(val$$1) ? undefined : [\n val$$1.getFullYear(),\n ('0' + (val$$1.getMonth() + 1)).slice(-2),\n ('0' + val$$1.getDate()).slice(-2),\n ].join('-');\n },\n decode: function (val$$1) {\n if (this.is(val$$1))\n return val$$1;\n var match = this.capture.exec(val$$1);\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n },\n is: function (val$$1) { return val$$1 instanceof Date && !isNaN(val$$1.valueOf()); },\n equals: function (l, r) {\n return ['getFullYear', 'getMonth', 'getDate']\n .reduce(function (acc, fn) { return acc && l[fn]() === r[fn](); }, true);\n },\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: makeDefaultType({\n encode: toJson,\n decode: fromJson,\n is: is(Object),\n equals: equals,\n pattern: /[^/]*/,\n }),\n // does not encode/decode\n any: makeDefaultType({\n encode: identity,\n decode: identity,\n is: function () { return true; },\n equals: equals,\n }),\n });\n}\ninitDefaultTypes();\n\n/**\n * @coreapi\n * @module params\n */\n/** */\n/** @internalapi */\nvar StateParams = /** @class */ (function () {\n function StateParams(params) {\n if (params === void 0) { params = {}; }\n extend(this, params);\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} 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 */\n StateParams.prototype.$inherit = function (newParams, $current, $to) {\n var parentParams;\n var parents = ancestors($current, $to), inherited = {}, inheritList = [];\n for (var i in parents) {\n if (!parents[i] || !parents[i].params)\n continue;\n parentParams = Object.keys(parents[i].params);\n if (!parentParams.length)\n continue;\n for (var j in parentParams) {\n if (inheritList.indexOf(parentParams[j]) >= 0)\n continue;\n inheritList.push(parentParams[j]);\n inherited[parentParams[j]] = this[parentParams[j]];\n }\n }\n return extend({}, inherited, newParams);\n };\n return StateParams;\n}());\n\n/** @module path */ /** for typedoc */\n\n/** @module resolve */ /** for typedoc */\n\n/** @module state */ /** for typedoc */\nvar parseUrl = function (url) {\n if (!isString(url))\n return false;\n var root$$1 = url.charAt(0) === '^';\n return { val: root$$1 ? url.substring(1) : url, root: root$$1 };\n};\nfunction nameBuilder(state) {\n return state.name;\n}\nfunction selfBuilder(state) {\n state.self.$$state = function () { return state; };\n return state.self;\n}\nfunction dataBuilder(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}\nvar getUrlBuilder = function ($urlMatcherFactoryProvider, root$$1) {\n return function urlBuilder(state) {\n var stateDec = state;\n // For future states, i.e., states whose name ends with `.**`,\n // match anything that starts with the url prefix\n if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\\.\\*\\*$/)) {\n stateDec.url += '{remainder:any}'; // match any path (.*)\n }\n var parsed = parseUrl(stateDec.url), parent = state.parent;\n var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, {\n params: state.params || {},\n paramMap: function (paramConfig, isSearch) {\n if (stateDec.reloadOnSearch === false && isSearch)\n paramConfig = extend(paramConfig || {}, { dynamic: true });\n return paramConfig;\n },\n });\n if (!url)\n return null;\n if (!$urlMatcherFactoryProvider.isMatcher(url))\n throw new Error(\"Invalid url '\" + url + \"' in state '\" + state + \"'\");\n return (parsed && parsed.root) ? url : ((parent && parent.navigable) || root$$1()).url.append(url);\n };\n};\nvar getNavigableBuilder = function (isRoot) {\n return function navigableBuilder(state) {\n return !isRoot(state) && state.url ? state : (state.parent ? state.parent.navigable : null);\n };\n};\nvar getParamsBuilder = function (paramFactory) {\n return function paramsBuilder(state) {\n var makeConfigParam = function (config, id) { return paramFactory.fromConfig(id, null, config); };\n var urlParams = (state.url && state.url.parameters({ inherit: false })) || [];\n var nonUrlParams = values(mapObj(omit(state.params || {}, urlParams.map(prop('id'))), makeConfigParam));\n return urlParams.concat(nonUrlParams).map(function (p) { return [p.id, p]; }).reduce(applyPairs, {});\n };\n};\nfunction pathBuilder(state) {\n return state.parent ? state.parent.path.concat(state) : /*root*/ [state];\n}\nfunction includesBuilder(state) {\n var includes = state.parent ? extend({}, state.parent.includes) : {};\n includes[state.name] = true;\n return includes;\n}\n/**\n * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * validates the `resolve` property and converts it to a [[Resolvable]] array.\n *\n * resolve: input value can be:\n *\n * {\n * // analyzed but not injected\n * myFooResolve: function() { return \"myFooData\"; },\n *\n * // function.toString() parsed, \"DependencyName\" dep as string (not min-safe)\n * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() },\n *\n * // Array split; \"DependencyName\" dep as string\n * myBazResolve: [ \"DependencyName\", function(dep) { return dep.fetchSomethingAsPromise() },\n *\n * // Array split; DependencyType dep as token (compared using ===)\n * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() },\n *\n * // val.$inject used as deps\n * // where:\n * // corgeResolve.$inject = [\"DependencyName\"];\n * // function corgeResolve(dep) { dep.fetchSometingAsPromise() }\n * // then \"DependencyName\" dep as string\n * myCorgeResolve: corgeResolve,\n *\n * // inject service by name\n * // When a string is found, desugar creating a resolve that injects the named service\n * myGraultResolve: \"SomeService\"\n * }\n *\n * or:\n *\n * [\n * new Resolvable(\"myFooResolve\", function() { return \"myFooData\" }),\n * new Resolvable(\"myBarResolve\", function(dep) { return dep.fetchSomethingAsPromise() }, [ \"DependencyName\" ]),\n * { provide: \"myBazResolve\", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ \"DependencyName\" ] }\n * ]\n */\nfunction resolvablesBuilder(state) {\n /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */\n var objects2Tuples = function (resolveObj, resolvePolicies) {\n return Object.keys(resolveObj || {}).map(function (token) { return ({ token: token, val: resolveObj[token], deps: undefined, policy: resolvePolicies[token] }); });\n };\n /** fetch DI annotations from a function or ng1-style array */\n var annotate = function (fn) {\n var $injector = services.$injector;\n // ng1 doesn't have an $injector until runtime.\n // If the $injector doesn't exist, use \"deferred\" literal as a\n // marker indicating they should be annotated when runtime starts\n return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || 'deferred';\n };\n /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */\n var isResolveLiteral = function (obj) { return !!(obj.token && obj.resolveFn); };\n /** true if the object looks like a provide literal, or a ng2 Provider */\n var isLikeNg2Provider = function (obj) { return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass)); };\n /** true if the object looks like a tuple from obj2Tuples */\n var isTupleFromObj = function (obj) { return !!(obj && obj.val && (isString(obj.val) || isArray(obj.val) || isFunction(obj.val))); };\n /** extracts the token from a Provider or provide literal */\n var getToken = function (p) { return p.provide || p.token; };\n /** Given a literal resolve or provider object, returns a Resolvable */\n var literal2Resolvable = pattern([\n [prop('resolveFn'), function (p) { return new Resolvable(getToken(p), p.resolveFn, p.deps, p.policy); }],\n [prop('useFactory'), function (p) { return new Resolvable(getToken(p), p.useFactory, (p.deps || p.dependencies), p.policy); }],\n [prop('useClass'), function (p) { return new Resolvable(getToken(p), function () { return new p.useClass(); }, [], p.policy); }],\n [prop('useValue'), function (p) { return new Resolvable(getToken(p), function () { return p.useValue; }, [], p.policy, p.useValue); }],\n [prop('useExisting'), function (p) { return new Resolvable(getToken(p), identity, [p.useExisting], p.policy); }],\n ]);\n var tuple2Resolvable = pattern([\n [pipe(prop('val'), isString), function (tuple) { return new Resolvable(tuple.token, identity, [tuple.val], tuple.policy); }],\n [pipe(prop('val'), isArray), function (tuple) { return new Resolvable(tuple.token, tail(tuple.val), tuple.val.slice(0, -1), tuple.policy); }],\n [pipe(prop('val'), isFunction), function (tuple) { return new Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }],\n ]);\n var item2Resolvable = pattern([\n [is(Resolvable), function (r) { return r; }],\n [isResolveLiteral, literal2Resolvable],\n [isLikeNg2Provider, literal2Resolvable],\n [isTupleFromObj, tuple2Resolvable],\n [val(true), function (obj) { throw new Error('Invalid resolve value: ' + stringify(obj)); }],\n ]);\n // If resolveBlock is already an array, use it as-is.\n // Otherwise, assume it's an object and convert to an Array of tuples\n var decl = state.resolve;\n var items = isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {});\n return items.map(item2Resolvable);\n}\n/**\n * @internalapi A internal global service\n *\n * StateBuilder is a factory for the internal [[StateObject]] objects.\n *\n * When you register a state with the [[StateRegistry]], you register a plain old javascript object which\n * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding\n * [[StateObject]] object, which has an API and is used internally.\n *\n * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function\n * using the [[builder]] method.\n */\nvar StateBuilder = /** @class */ (function () {\n function StateBuilder(matcher, urlMatcherFactory) {\n this.matcher = matcher;\n var self = this;\n var root$$1 = function () { return matcher.find(''); };\n var isRoot = function (state) { return state.name === ''; };\n function parentBuilder(state) {\n if (isRoot(state))\n return null;\n return matcher.find(self.parentName(state)) || root$$1();\n }\n this.builders = {\n name: [nameBuilder],\n self: [selfBuilder],\n parent: [parentBuilder],\n data: [dataBuilder],\n // Build a URLMatcher if necessary, either via a relative or absolute URL\n url: [getUrlBuilder(urlMatcherFactory, root$$1)],\n // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n navigable: [getNavigableBuilder(isRoot)],\n params: [getParamsBuilder(urlMatcherFactory.paramFactory)],\n // Each framework-specific ui-router implementation should define its own `views` builder\n // e.g., src/ng1/statebuilders/views.ts\n views: [],\n // Keep a full path from the root down to this state as this is needed for state activation.\n path: [pathBuilder],\n // Speed up $state.includes() as it's used a lot\n includes: [includesBuilder],\n resolvables: [resolvablesBuilder],\n };\n }\n /**\n * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).\n * More than one BuilderFunction can be registered for a given property.\n *\n * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.\n *\n * @param name The name of the State property being registered for.\n * @param fn The BuilderFunction which will be used to build the State property\n * @returns a function which deregisters the BuilderFunction\n */\n StateBuilder.prototype.builder = function (name, fn) {\n var builders = this.builders;\n var array = builders[name] || [];\n // Backwards compat: if only one builder exists, return it, else return whole arary.\n if (isString(name) && !isDefined(fn))\n return array.length > 1 ? array : array[0];\n if (!isString(name) || !isFunction(fn))\n return;\n builders[name] = array;\n builders[name].push(fn);\n return function () { return builders[name].splice(builders[name].indexOf(fn, 1)) && null; };\n };\n /**\n * Builds all of the properties on an essentially blank State object, returning a State object which has all its\n * properties and API built.\n *\n * @param state an uninitialized State object\n * @returns the built State object\n */\n StateBuilder.prototype.build = function (state) {\n var _a = this, matcher = _a.matcher, builders = _a.builders;\n var parent = this.parentName(state);\n if (parent && !matcher.find(parent, undefined, false)) {\n return null;\n }\n for (var key in builders) {\n if (!builders.hasOwnProperty(key))\n continue;\n var chain = builders[key].reduce(function (parentFn, step) { return function (_state) { return step(_state, parentFn); }; }, noop);\n state[key] = chain(state);\n }\n return state;\n };\n StateBuilder.prototype.parentName = function (state) {\n // name = 'foo.bar.baz.**'\n var name = state.name || '';\n // segments = ['foo', 'bar', 'baz', '.**']\n var segments = name.split('.');\n // segments = ['foo', 'bar', 'baz']\n var lastSegment = segments.pop();\n // segments = ['foo', 'bar'] (ignore .** segment for future states)\n if (lastSegment === '**')\n segments.pop();\n if (segments.length) {\n if (state.parent) {\n throw new Error(\"States that specify the 'parent:' property should not have a '.' in their name (\" + name + \")\");\n }\n // 'foo.bar'\n return segments.join('.');\n }\n if (!state.parent)\n return '';\n return isString(state.parent) ? state.parent : state.parent.name;\n };\n StateBuilder.prototype.name = function (state) {\n var name = state.name;\n if (name.indexOf('.') !== -1 || !state.parent)\n return name;\n var parentName = isString(state.parent) ? state.parent : state.parent.name;\n return parentName ? parentName + '.' + name : name;\n };\n return StateBuilder;\n}());\n\n/** @module state */ /** for typedoc */\nvar StateMatcher = /** @class */ (function () {\n function StateMatcher(_states) {\n this._states = _states;\n }\n StateMatcher.prototype.isRelative = function (stateName) {\n stateName = stateName || '';\n return stateName.indexOf('.') === 0 || stateName.indexOf('^') === 0;\n };\n StateMatcher.prototype.find = function (stateOrName, base, matchGlob) {\n if (matchGlob === void 0) { matchGlob = true; }\n if (!stateOrName && stateOrName !== '')\n return undefined;\n var isStr = isString(stateOrName);\n var name = isStr ? stateOrName : stateOrName.name;\n if (this.isRelative(name))\n name = this.resolvePath(name, base);\n var state = this._states[name];\n if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n return state;\n }\n else if (isStr && matchGlob) {\n var _states = values(this._states);\n var matches = _states.filter(function (_state) {\n return _state.__stateObjectCache.nameGlob &&\n _state.__stateObjectCache.nameGlob.matches(name);\n });\n if (matches.length > 1) {\n // tslint:disable-next-line:no-console\n console.log(\"stateMatcher.find: Found multiple matches for \" + name + \" using glob: \", matches.map(function (match) { return match.name; }));\n }\n return matches[0];\n }\n return undefined;\n };\n StateMatcher.prototype.resolvePath = function (name, base) {\n if (!base)\n throw new Error(\"No reference point given for path '\" + name + \"'\");\n var baseState = this.find(base);\n var splitName = name.split('.');\n var pathLength = splitName.length;\n var i = 0, current = baseState;\n for (; i < pathLength; i++) {\n if (splitName[i] === '' && i === 0) {\n current = baseState;\n continue;\n }\n if (splitName[i] === '^') {\n if (!current.parent)\n throw new Error(\"Path '\" + name + \"' not valid for state '\" + baseState.name + \"'\");\n current = current.parent;\n continue;\n }\n break;\n }\n var relName = splitName.slice(i).join('.');\n return current.name + (current.name && relName ? '.' : '') + relName;\n };\n return StateMatcher;\n}());\n\n/** @module state */ /** for typedoc */\n/** @internalapi */\nvar StateQueueManager = /** @class */ (function () {\n function StateQueueManager($registry, $urlRouter, states, builder, listeners) {\n this.$registry = $registry;\n this.$urlRouter = $urlRouter;\n this.states = states;\n this.builder = builder;\n this.listeners = listeners;\n this.queue = [];\n this.matcher = $registry.matcher;\n }\n /** @internalapi */\n StateQueueManager.prototype.dispose = function () {\n this.queue = [];\n };\n StateQueueManager.prototype.register = function (stateDecl) {\n var queue = this.queue;\n var state = StateObject.create(stateDecl);\n var name = state.name;\n if (!isString(name))\n throw new Error('State must have a valid name');\n if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name))\n throw new Error(\"State '\" + name + \"' is already defined\");\n queue.push(state);\n this.flush();\n return state;\n };\n StateQueueManager.prototype.flush = function () {\n var _this = this;\n var _a = this, queue = _a.queue, states = _a.states, builder = _a.builder;\n var registered = [], // states that got registered\n orphans = [], // states that don't yet have a parent registered\n previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered\n var getState = function (name) {\n return _this.states.hasOwnProperty(name) && _this.states[name];\n };\n while (queue.length > 0) {\n var state = queue.shift();\n var name_1 = state.name;\n var result = builder.build(state);\n var orphanIdx = orphans.indexOf(state);\n if (result) {\n var existingState = getState(name_1);\n if (existingState && existingState.name === name_1) {\n throw new Error(\"State '\" + name_1 + \"' is already defined\");\n }\n var existingFutureState = getState(name_1 + '.**');\n if (existingFutureState) {\n // Remove future state of the same name\n this.$registry.deregister(existingFutureState);\n }\n states[name_1] = state;\n this.attachRoute(state);\n if (orphanIdx >= 0)\n orphans.splice(orphanIdx, 1);\n registered.push(state);\n continue;\n }\n var prev = previousQueueLength[name_1];\n previousQueueLength[name_1] = queue.length;\n if (orphanIdx >= 0 && prev === queue.length) {\n // Wait until two consecutive iterations where no additional states were dequeued successfully.\n // throw new Error(`Cannot register orphaned state '${name}'`);\n queue.push(state);\n return states;\n }\n else if (orphanIdx < 0) {\n orphans.push(state);\n }\n queue.push(state);\n }\n if (registered.length) {\n this.listeners.forEach(function (listener) { return listener('registered', registered.map(function (s) { return s.self; })); });\n }\n return states;\n };\n StateQueueManager.prototype.attachRoute = function (state) {\n if (state.abstract || !state.url)\n return;\n this.$urlRouter.rule(this.$urlRouter.urlRuleFactory.create(state));\n };\n return StateQueueManager;\n}());\n\n/**\n * @coreapi\n * @module state\n */ /** for typedoc */\nvar StateRegistry = /** @class */ (function () {\n /** @internalapi */\n function StateRegistry(_router) {\n this._router = _router;\n this.states = {};\n this.listeners = [];\n this.matcher = new StateMatcher(this.states);\n this.builder = new StateBuilder(this.matcher, _router.urlMatcherFactory);\n this.stateQueue = new StateQueueManager(this, _router.urlRouter, this.states, this.builder, this.listeners);\n this._registerRoot();\n }\n /** @internalapi */\n StateRegistry.prototype._registerRoot = function () {\n var rootStateDef = {\n name: '',\n url: '^',\n views: null,\n params: {\n '#': { value: null, type: 'hash', dynamic: true },\n },\n abstract: true,\n };\n var _root = this._root = this.stateQueue.register(rootStateDef);\n _root.navigable = null;\n };\n /** @internalapi */\n StateRegistry.prototype.dispose = function () {\n var _this = this;\n this.stateQueue.dispose();\n this.listeners = [];\n this.get().forEach(function (state) { return _this.get(state) && _this.deregister(state); });\n };\n /**\n * Listen for a State Registry events\n *\n * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.\n *\n * #### Example:\n * ```js\n * let allStates = registry.get();\n *\n * // Later, invoke deregisterFn() to remove the listener\n * let deregisterFn = registry.onStatesChanged((event, states) => {\n * switch(event) {\n * case: 'registered':\n * states.forEach(state => allStates.push(state));\n * break;\n * case: 'deregistered':\n * states.forEach(state => {\n * let idx = allStates.indexOf(state);\n * if (idx !== -1) allStates.splice(idx, 1);\n * });\n * break;\n * }\n * });\n * ```\n *\n * @param listener a callback function invoked when the registered states changes.\n * The function receives two parameters, `event` and `state`.\n * See [[StateRegistryListener]]\n * @return a function that deregisters the listener\n */\n StateRegistry.prototype.onStatesChanged = function (listener) {\n this.listeners.push(listener);\n return function deregisterListener() {\n removeFrom(this.listeners)(listener);\n }.bind(this);\n };\n /**\n * Gets the implicit root state\n *\n * Gets the root of the state tree.\n * The root state is implicitly created by UI-Router.\n * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]\n *\n * @return the root [[StateObject]]\n */\n StateRegistry.prototype.root = function () {\n return this._root;\n };\n /**\n * Adds a state to the registry\n *\n * Registers a [[StateDeclaration]] or queues it for registration.\n *\n * Note: a state will be queued if the state's parent isn't yet registered.\n *\n * @param stateDefinition the definition of the state to register.\n * @returns the internal [[StateObject]] object.\n * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).\n * If the state was only queued, then the object is not fully built.\n */\n StateRegistry.prototype.register = function (stateDefinition) {\n return this.stateQueue.register(stateDefinition);\n };\n /** @hidden */\n StateRegistry.prototype._deregisterTree = function (state) {\n var _this = this;\n var all$$1 = this.get().map(function (s) { return s.$$state(); });\n var getChildren = function (states) {\n var _children = all$$1.filter(function (s) { return states.indexOf(s.parent) !== -1; });\n return _children.length === 0 ? _children : _children.concat(getChildren(_children));\n };\n var children = getChildren([state]);\n var deregistered = [state].concat(children).reverse();\n deregistered.forEach(function (_state) {\n var $ur = _this._router.urlRouter;\n // Remove URL rule\n $ur.rules().filter(propEq('state', _state)).forEach($ur.removeRule.bind($ur));\n // Remove state from registry\n delete _this.states[_state.name];\n });\n return deregistered;\n };\n /**\n * Removes a state from the registry\n *\n * This removes a state from the registry.\n * If the state has children, they are are also removed from the registry.\n *\n * @param stateOrName the state's name or object representation\n * @returns {StateObject[]} a list of removed states\n */\n StateRegistry.prototype.deregister = function (stateOrName) {\n var _state = this.get(stateOrName);\n if (!_state)\n throw new Error(\"Can't deregister state; not found: \" + stateOrName);\n var deregisteredStates = this._deregisterTree(_state.$$state());\n this.listeners.forEach(function (listener) { return listener('deregistered', deregisteredStates.map(function (s) { return s.self; })); });\n return deregisteredStates;\n };\n StateRegistry.prototype.get = function (stateOrName, base) {\n var _this = this;\n if (arguments.length === 0)\n return Object.keys(this.states).map(function (name) { return _this.states[name].self; });\n var found = this.matcher.find(stateOrName, base);\n return found && found.self || null;\n };\n StateRegistry.prototype.decorator = function (name, func) {\n return this.builder.builder(name, func);\n };\n return StateRegistry;\n}());\n\n/**\n * @coreapi\n * @module url\n */\n/** for typedoc */\n/** @hidden */\nfunction quoteRegExp(str, param) {\n var surroundPattern = ['', ''], result = str.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, '\\\\$&');\n if (!param)\n return result;\n switch (param.squash) {\n case false:\n surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')];\n break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:\\/(', ')|\\/)?'];\n break;\n default:\n surroundPattern = [\"(\" + param.squash + \"|\", ')?'];\n break;\n }\n return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1];\n}\n/** @hidden */\nvar memoizeTo = function (obj, _prop, fn) {\n return obj[_prop] = obj[_prop] || fn();\n};\n/** @hidden */\nvar splitOnSlash = splitOnDelim('/');\n/**\n * Matches URLs against patterns.\n *\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL.\n *\n * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)\n * 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 [[UrlMatcher.exec]].\n *\n * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`)\n * or colon placeholders (`/somePath/:param`).\n *\n * - *A parameter RegExp* may be defined for a param after a colon\n * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder.\n * The regexp must match for the url to be matched.\n * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]].\n *\n * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters.\n * See [[UrlMatcherFactory.type]] for more information.\n *\n * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`).\n * A catch-all * parameter value will contain the remainder of the URL.\n *\n * ---\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).\n * A path parameter matches any number of characters other than '/'. For catch-all\n * placeholders the path parameter matches 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` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n */\nvar UrlMatcher = /** @class */ (function () {\n /**\n * @param pattern The pattern to compile into a matcher.\n * @param paramTypes The [[ParamTypes]] registry\n * @param config A configuration object\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 function UrlMatcher(pattern$$1, paramTypes, paramFactory, config) {\n var _this = this;\n this.config = config;\n /** @hidden */\n this._cache = { path: [this] };\n /** @hidden */\n this._children = [];\n /** @hidden */\n this._params = [];\n /** @hidden */\n this._segments = [];\n /** @hidden */\n this._compiled = [];\n this.pattern = pattern$$1;\n this.config = defaults(this.config, {\n params: {},\n strict: true,\n caseInsensitive: false,\n paramMap: identity,\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 var searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var patterns = [];\n var last = 0, matchArray;\n var checkParamErrors = function (id) {\n if (!UrlMatcher.nameValidator.test(id))\n throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern$$1 + \"'\");\n if (find(_this._params, propEq('id', id)))\n throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern$$1 + \"'\");\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 var matchDetails = function (m, isSearch) {\n // IE[78] returns '' for unmatched groups instead of null\n var id = m[2] || m[3];\n var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\\\s\\\\S]*' : null);\n var makeRegexpType = function (str) { return inherit(paramTypes.type(isSearch ? 'query' : 'path'), {\n pattern: new RegExp(str, _this.config.caseInsensitive ? 'i' : undefined),\n }); };\n return {\n id: id,\n regexp: regexp,\n cfg: _this.config.params[id],\n segment: pattern$$1.substring(last, m.index),\n type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp),\n };\n };\n var p, segment;\n // tslint:disable-next-line:no-conditional-assignment\n while ((matchArray = placeholder.exec(pattern$$1))) {\n p = matchDetails(matchArray, false);\n if (p.segment.indexOf('?') >= 0)\n break; // we're into the search part\n checkParamErrors(p.id);\n this._params.push(paramFactory.fromPath(p.id, p.type, this.config.paramMap(p.cfg, false)));\n this._segments.push(p.segment);\n patterns.push([p.segment, tail(this._params)]);\n last = placeholder.lastIndex;\n }\n segment = pattern$$1.substring(last);\n // Find any search parameter names and remove them from the last segment\n var i = segment.indexOf('?');\n if (i >= 0) {\n var search = segment.substring(i);\n segment = segment.substring(0, i);\n if (search.length > 0) {\n last = 0;\n // tslint:disable-next-line:no-conditional-assignment\n while ((matchArray = searchPlaceholder.exec(search))) {\n p = matchDetails(matchArray, true);\n checkParamErrors(p.id);\n this._params.push(paramFactory.fromSearch(p.id, p.type, this.config.paramMap(p.cfg, true)));\n last = placeholder.lastIndex;\n // check if ?&\n }\n }\n }\n this._segments.push(segment);\n this._compiled = patterns.map(function (_pattern) { return quoteRegExp.apply(null, _pattern); }).concat(quoteRegExp(segment));\n }\n /** @hidden */\n UrlMatcher.encodeDashes = function (str) {\n return encodeURIComponent(str).replace(/-/g, function (c) { return \"%5C%\" + c.charCodeAt(0).toString(16).toUpperCase(); });\n };\n /** @hidden Given a matcher, return an array with the matcher's path segments and path params, in order */\n UrlMatcher.pathSegmentsAndParams = function (matcher) {\n var staticSegments = matcher._segments;\n var pathParams = matcher._params.filter(function (p) { return p.location === exports.DefType.PATH; });\n return arrayTuples(staticSegments, pathParams.concat(undefined))\n .reduce(unnestR, [])\n .filter(function (x) { return x !== '' && isDefined(x); });\n };\n /** @hidden Given a matcher, return an array with the matcher's query params */\n UrlMatcher.queryParams = function (matcher) {\n return matcher._params.filter(function (p) { return p.location === exports.DefType.SEARCH; });\n };\n /**\n * Compare two UrlMatchers\n *\n * This comparison function converts a UrlMatcher into static and dynamic path segments.\n * Each static path segment is a static string between a path separator (slash character).\n * Each dynamic segment is a path parameter.\n *\n * The comparison function sorts static segments before dynamic ones.\n */\n UrlMatcher.compare = function (a, b) {\n /**\n * Turn a UrlMatcher and all its parent matchers into an array\n * of slash literals '/', string literals, and Param objects\n *\n * This example matcher matches strings like \"/foo/:param/tail\":\n * var matcher = $umf.compile(\"/foo\").append($umf.compile(\"/:param\")).append($umf.compile(\"/\")).append($umf.compile(\"tail\"));\n * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ]\n *\n * Caches the result as `matcher._cache.segments`\n */\n var segments = function (matcher) {\n return matcher._cache.segments = matcher._cache.segments ||\n matcher._cache.path.map(UrlMatcher.pathSegmentsAndParams)\n .reduce(unnestR, [])\n .reduce(joinNeighborsR, [])\n .map(function (x) { return isString(x) ? splitOnSlash(x) : x; })\n .reduce(unnestR, []);\n };\n /**\n * Gets the sort weight for each segment of a UrlMatcher\n *\n * Caches the result as `matcher._cache.weights`\n */\n var weights = function (matcher) {\n return matcher._cache.weights = matcher._cache.weights ||\n segments(matcher).map(function (segment) {\n // Sort slashes first, then static strings, the Params\n if (segment === '/')\n return 1;\n if (isString(segment))\n return 2;\n if (segment instanceof Param)\n return 3;\n });\n };\n /**\n * Pads shorter array in-place (mutates)\n */\n var padArrays = function (l, r, padVal) {\n var len = Math.max(l.length, r.length);\n while (l.length < len)\n l.push(padVal);\n while (r.length < len)\n r.push(padVal);\n };\n var weightsA = weights(a), weightsB = weights(b);\n padArrays(weightsA, weightsB, 0);\n var _pairs = arrayTuples(weightsA, weightsB);\n var cmp, i;\n for (i = 0; i < _pairs.length; i++) {\n cmp = _pairs[i][0] - _pairs[i][1];\n if (cmp !== 0)\n return cmp;\n }\n return 0;\n };\n /**\n * Creates a new concatenated UrlMatcher\n *\n * Builds a new UrlMatcher by appending another UrlMatcher to this one.\n *\n * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.\n */\n UrlMatcher.prototype.append = function (url) {\n this._children.push(url);\n url._cache = {\n path: this._cache.path.concat(url),\n parent: this,\n pattern: null,\n };\n return url;\n };\n /** @hidden */\n UrlMatcher.prototype.isRoot = function () {\n return this._cache.path[0] === this;\n };\n /** Returns the input pattern string */\n UrlMatcher.prototype.toString = function () {\n return this.pattern;\n };\n /**\n * Tests the specified url/path against this matcher.\n *\n * Tests if the given url matches this matcher's pattern, and returns an object containing the captured\n * parameter values. Returns null if the path does not match.\n *\n * 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 `search`. This means that search parameters are always treated\n * as optional.\n *\n * #### Example:\n * ```js\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 * ```\n *\n * @param path The URL path to match, e.g. `$location.path()`.\n * @param search URL search parameters, e.g. `$location.search()`.\n * @param hash URL hash e.g. `$location.hash()`.\n * @param options\n *\n * @returns The captured parameter values.\n */\n UrlMatcher.prototype.exec = function (path, search, hash, options) {\n var _this = this;\n if (search === void 0) { search = {}; }\n if (options === void 0) { options = {}; }\n var match = memoizeTo(this._cache, 'pattern', function () {\n return new RegExp([\n '^',\n unnest(_this._cache.path.map(prop('_compiled'))).join(''),\n _this.config.strict === false ? '\\/?' : '',\n '$',\n ].join(''), _this.config.caseInsensitive ? 'i' : undefined);\n }).exec(path);\n if (!match)\n return null;\n // options = defaults(options, { isolate: false });\n var allParams = this.parameters(), pathParams = allParams.filter(function (param) { return !param.isSearch(); }), searchParams = allParams.filter(function (param) { return param.isSearch(); }), nPathSegments = this._cache.path.map(function (urlm) { return urlm._segments.length - 1; }).reduce(function (a, x) { return a + x; }), values$$1 = {};\n if (nPathSegments !== match.length - 1)\n throw new Error(\"Unbalanced capture group in route '\" + this.pattern + \"'\");\n function decodePathArray(paramVal) {\n var reverseString = function (str) { return str.split('').reverse().join(''); };\n var unquoteDashes = function (str) { return str.replace(/\\\\-/g, '-'); };\n var split = reverseString(paramVal).split(/-(?!\\\\)/);\n var allReversed = map(split, reverseString);\n return map(allReversed, unquoteDashes).reverse();\n }\n for (var i = 0; i < nPathSegments; i++) {\n var param = pathParams[i];\n var value = match[i + 1];\n // if the param value matches a pre-replace pair, replace the value before decoding.\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value)\n value = param.replace[j].to;\n }\n if (value && param.array === true)\n value = decodePathArray(value);\n if (isDefined(value))\n value = param.type.decode(value);\n values$$1[param.id] = param.value(value);\n }\n searchParams.forEach(function (param) {\n var value = search[param.id];\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value)\n value = param.replace[j].to;\n }\n if (isDefined(value))\n value = param.type.decode(value);\n values$$1[param.id] = param.value(value);\n });\n if (hash)\n values$$1['#'] = hash;\n return values$$1;\n };\n /**\n * @hidden\n * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.\n *\n * @returns {Array.} An array of [[Param]] objects. Must be treated as read-only. If the\n * pattern has no parameters, an empty array is returned.\n */\n UrlMatcher.prototype.parameters = function (opts) {\n if (opts === void 0) { opts = {}; }\n if (opts.inherit === false)\n return this._params;\n return unnest(this._cache.path.map(function (matcher) { return matcher._params; }));\n };\n /**\n * @hidden\n * Returns a single parameter from this UrlMatcher by id\n *\n * @param id\n * @param opts\n * @returns {T|Param|any|boolean|UrlMatcher|null}\n */\n UrlMatcher.prototype.parameter = function (id, opts) {\n var _this = this;\n if (opts === void 0) { opts = {}; }\n var findParam = function () {\n for (var _i = 0, _a = _this._params; _i < _a.length; _i++) {\n var param = _a[_i];\n if (param.id === id)\n return param;\n }\n };\n var parent = this._cache.parent;\n return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null;\n };\n /**\n * Validates the input parameter values against this UrlMatcher\n *\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param params The object hash of parameters to validate.\n * @returns Returns `true` if `params` validates, otherwise `false`.\n */\n UrlMatcher.prototype.validates = function (params) {\n var validParamVal = function (param, val$$1) {\n return !param || param.validates(val$$1);\n };\n params = params || {};\n // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher\n var paramSchema = this.parameters().filter(function (paramDef) { return params.hasOwnProperty(paramDef.id); });\n return paramSchema.map(function (paramDef) { return validParamVal(paramDef, params[paramDef.id]); }).reduce(allTrueR, true);\n };\n /**\n * Given a set of parameter values, creates a URL from this UrlMatcher.\n *\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters.\n *\n * #### Example:\n * ```js\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * ```\n *\n * @param values the values to substitute for the parameters in this pattern.\n * @returns the formatted URL (path and optionally search part).\n */\n UrlMatcher.prototype.format = function (values$$1) {\n if (values$$1 === void 0) { values$$1 = {}; }\n // Build the full path of UrlMatchers (including all parent UrlMatchers)\n var urlMatchers = this._cache.path;\n // Extract all the static segments and Params (processed as ParamDetails)\n // into an ordered array\n var pathSegmentsAndParams = urlMatchers.map(UrlMatcher.pathSegmentsAndParams)\n .reduce(unnestR, [])\n .map(function (x) { return isString(x) ? x : getDetails(x); });\n // Extract the query params into a separate array\n var queryParams = urlMatchers.map(UrlMatcher.queryParams)\n .reduce(unnestR, [])\n .map(getDetails);\n var isInvalid = function (param) { return param.isValid === false; };\n if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) {\n return null;\n }\n /**\n * Given a Param, applies the parameter value, then returns detailed information about it\n */\n function getDetails(param) {\n // Normalize to typed value\n var value = param.value(values$$1[param.id]);\n var isValid = param.validates(value);\n var isDefaultValue = param.isDefaultValue(value);\n // Check if we're in squash mode for the parameter\n var squash = isDefaultValue ? param.squash : false;\n // Allow the Parameter's Type to encode the value\n var encoded = param.type.encode(value);\n return { param: param, value: value, isValid: isValid, isDefaultValue: isDefaultValue, squash: squash, encoded: encoded };\n }\n // Build up the path-portion from the list of static segments and parameters\n var pathString = pathSegmentsAndParams.reduce(function (acc, x) {\n // The element is a static segment (a raw string); just append it\n if (isString(x))\n return acc + x;\n // Otherwise, it's a ParamDetails.\n var squash = x.squash, encoded = x.encoded, param = x.param;\n // If squash is === true, try to remove a slash from the path\n if (squash === true)\n return (acc.match(/\\/$/)) ? acc.slice(0, -1) : acc;\n // If squash is a string, use the string for the param value\n if (isString(squash))\n return acc + squash;\n if (squash !== false)\n return acc; // ?\n if (encoded == null)\n return acc;\n // If this parameter value is an array, encode the value using encodeDashes\n if (isArray(encoded))\n return acc + map(encoded, UrlMatcher.encodeDashes).join('-');\n // If the parameter type is \"raw\", then do not encodeURIComponent\n if (param.raw)\n return acc + encoded;\n // Encode the value\n return acc + encodeURIComponent(encoded);\n }, '');\n // Build the query string by applying parameter values (array or regular)\n // then mapping to key=value, then flattening and joining using \"&\"\n var queryString = queryParams.map(function (paramDetails) {\n var param = paramDetails.param, squash = paramDetails.squash, encoded = paramDetails.encoded, isDefaultValue = paramDetails.isDefaultValue;\n if (encoded == null || (isDefaultValue && squash !== false))\n return;\n if (!isArray(encoded))\n encoded = [encoded];\n if (encoded.length === 0)\n return;\n if (!param.raw)\n encoded = map(encoded, encodeURIComponent);\n return encoded.map(function (val$$1) { return param.id + \"=\" + val$$1; });\n }).filter(identity).reduce(unnestR, []).join('&');\n // Concat the pathstring with the queryString (if exists) and the hashString (if exists)\n return pathString + (queryString ? \"?\" + queryString : '') + (values$$1['#'] ? '#' + values$$1['#'] : '');\n };\n /** @hidden */\n UrlMatcher.nameValidator = /^\\w+([-.]+\\w+)*(?:\\[\\])?$/;\n return UrlMatcher;\n}());\n\n/**\n * @internalapi\n * @module url\n */ /** for typedoc */\n/**\n * Factory for [[UrlMatcher]] instances.\n *\n * The factory is available to ng1 services as\n * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.\n */\nvar UrlMatcherFactory = /** @class */ (function () {\n function UrlMatcherFactory() {\n var _this = this;\n /** @hidden */ this.paramTypes = new ParamTypes();\n /** @hidden */ this._isCaseInsensitive = false;\n /** @hidden */ this._isStrictMode = true;\n /** @hidden */ this._defaultSquashPolicy = false;\n /** @internalapi Creates a new [[Param]] for a given location (DefType) */\n this.paramFactory = {\n /** Creates a new [[Param]] from a CONFIG block */\n fromConfig: function (id, type, config) {\n return new Param(id, type, config, exports.DefType.CONFIG, _this);\n },\n /** Creates a new [[Param]] from a url PATH */\n fromPath: function (id, type, config) {\n return new Param(id, type, config, exports.DefType.PATH, _this);\n },\n /** Creates a new [[Param]] from a url SEARCH */\n fromSearch: function (id, type, config) {\n return new Param(id, type, config, exports.DefType.SEARCH, _this);\n },\n };\n /** @hidden */\n this._getConfig = function (config) {\n return extend({ strict: _this._isStrictMode, caseInsensitive: _this._isCaseInsensitive }, config);\n };\n extend(this, { UrlMatcher: UrlMatcher, Param: Param });\n }\n /** @inheritdoc */\n UrlMatcherFactory.prototype.caseInsensitive = function (value) {\n return this._isCaseInsensitive = isDefined(value) ? value : this._isCaseInsensitive;\n };\n /** @inheritdoc */\n UrlMatcherFactory.prototype.strictMode = function (value) {\n return this._isStrictMode = isDefined(value) ? value : this._isStrictMode;\n };\n /** @inheritdoc */\n UrlMatcherFactory.prototype.defaultSquashPolicy = function (value) {\n if (isDefined(value) && value !== true && value !== false && !isString(value))\n throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n return this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy;\n };\n /**\n * Creates a [[UrlMatcher]] for the specified pattern.\n *\n * @param pattern The URL pattern.\n * @param config The config object hash.\n * @returns The UrlMatcher.\n */\n UrlMatcherFactory.prototype.compile = function (pattern, config) {\n return new UrlMatcher(pattern, this.paramTypes, this.paramFactory, this._getConfig(config));\n };\n /**\n * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.\n *\n * @param object The object to perform the type check against.\n * @returns `true` if the object matches the `UrlMatcher` interface, by\n * implementing all the same methods.\n */\n UrlMatcherFactory.prototype.isMatcher = function (object) {\n // TODO: typeof?\n if (!isObject(object))\n return false;\n var result = true;\n forEach(UrlMatcher.prototype, function (val, name) {\n if (isFunction(val))\n result = result && (isDefined(object[name]) && isFunction(object[name]));\n });\n return result;\n };\n /**\n * Creates and registers a custom [[ParamType]] object\n *\n * A [[ParamType]] can be used to generate URLs with typed parameters.\n *\n * @param name The type name.\n * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.\n * @param definitionFn A function that is injected before the app runtime starts.\n * The result of this function should be a [[ParamTypeDefinition]].\n * The result is merged into the existing `definition`.\n * See [[ParamType]] for information on the values accepted.\n *\n * @returns - if a type was registered: the [[UrlMatcherFactory]]\n * - if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined\n *\n * Note: Register custom types *before using them* in a state definition.\n *\n * See [[ParamTypeDefinition]] for examples\n */\n UrlMatcherFactory.prototype.type = function (name, definition, definitionFn) {\n var type = this.paramTypes.type(name, definition, definitionFn);\n return !isDefined(definition) ? type : this;\n };\n /** @hidden */\n UrlMatcherFactory.prototype.$get = function () {\n this.paramTypes.enqueue = false;\n this.paramTypes._flushTypeQueue();\n return this;\n };\n /** @internalapi */\n UrlMatcherFactory.prototype.dispose = function () {\n this.paramTypes.dispose();\n };\n return UrlMatcherFactory;\n}());\n\n/**\n * @coreapi\n * @module url\n */ /** */\n/**\n * Creates a [[UrlRule]]\n *\n * Creates a [[UrlRule]] from a:\n *\n * - `string`\n * - [[UrlMatcher]]\n * - `RegExp`\n * - [[StateObject]]\n * @internalapi\n */\nvar UrlRuleFactory = /** @class */ (function () {\n function UrlRuleFactory(router) {\n this.router = router;\n }\n UrlRuleFactory.prototype.compile = function (str) {\n return this.router.urlMatcherFactory.compile(str);\n };\n UrlRuleFactory.prototype.create = function (what, handler) {\n var _this = this;\n var makeRule = pattern([\n [isString, function (_what) { return makeRule(_this.compile(_what)); }],\n [is(UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }],\n [isState, function (_what) { return _this.fromState(_what, _this.router); }],\n [is(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }],\n [isFunction, function (_what) { return new BaseUrlRule(_what, handler); }],\n ]);\n var rule = makeRule(what);\n if (!rule)\n throw new Error(\"invalid 'what' in when()\");\n return rule;\n };\n /**\n * A UrlRule which matches based on a UrlMatcher\n *\n * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]\n *\n * ## Handler as a function\n *\n * If `handler` is a function, the function is invoked with:\n *\n * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])\n * - url: the current Url ([[UrlParts]])\n * - router: the router object ([[UIRouter]])\n *\n * #### Example:\n * ```js\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\n * var rule = factory.fromUrlMatcher(urlMatcher, match => \"/home/\" + match.fooId + \"/\" + match.barId);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match); // '/home/123/456'\n * ```\n *\n * ## Handler as UrlMatcher\n *\n * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.\n * The `handler` UrlMatcher is formatted using the matched param from the first matcher.\n * The url is replaced with the result.\n *\n * #### Example:\n * ```js\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\n * var handler = $umf.compile(\"/home/:fooId/:barId\");\n * var rule = factory.fromUrlMatcher(urlMatcher, handler);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match); // '/home/123/456'\n * ```\n */\n UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) {\n var _handler = handler;\n if (isString(handler))\n handler = this.router.urlMatcherFactory.compile(handler);\n if (is(UrlMatcher)(handler))\n _handler = function (match) { return handler.format(match); };\n function matchUrlParamters(url) {\n var params = urlMatcher.exec(url.path, url.search, url.hash);\n return urlMatcher.validates(params) && params;\n }\n // Prioritize URLs, lowest to highest:\n // - Some optional URL parameters, but none matched\n // - No optional parameters in URL\n // - Some optional parameters, some matched\n // - Some optional parameters, all matched\n function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }\n var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: 'URLMATCHER' };\n return extend(new BaseUrlRule(matchUrlParamters, _handler), details);\n };\n /**\n * A UrlRule which matches a state by its url\n *\n * #### Example:\n * ```js\n * var rule = factory.fromState($state.get('foo'), router);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match);\n * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }\n * ```\n */\n UrlRuleFactory.prototype.fromState = function (state, router) {\n /**\n * Handles match by transitioning to matched state\n *\n * First checks if the router should start a new transition.\n * A new transition is not required if the current state's URL\n * and the new URL are already identical\n */\n var handler = function (match) {\n var $state = router.stateService;\n var globals = router.globals;\n if ($state.href(state, match) !== $state.href(globals.current, globals.params)) {\n $state.transitionTo(state, match, { inherit: true, source: 'url' });\n }\n };\n var details = { state: state, type: 'STATE' };\n return extend(this.fromUrlMatcher(state.url, handler), details);\n };\n /**\n * A UrlRule which matches based on a regular expression\n *\n * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.\n *\n * ## Handler as a function\n *\n * If `handler` is a function, the function is invoked with:\n *\n * - regexp match array (from `regexp`)\n * - url: the current Url ([[UrlParts]])\n * - router: the router object ([[UIRouter]])\n *\n * #### Example:\n * ```js\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, match => \"/home/\" + match[1])\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\n * var result = rule.handler(match); // '/home/bar'\n * ```\n *\n * ## Handler as string\n *\n * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.\n * The string is first interpolated using `string.replace()` style pattern.\n *\n * #### Example:\n * ```js\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, \"/home/$1\")\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\n * var result = rule.handler(match); // '/home/bar'\n * ```\n */\n UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) {\n if (regexp.global || regexp.sticky)\n throw new Error('Rule RegExp must not be global or sticky');\n /**\n * If handler is a string, the url will be replaced by the string.\n * If the string has any String.replace() style variables in it (like `$2`),\n * they will be replaced by the captures from [[match]]\n */\n var redirectUrlTo = function (match) {\n // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern\n return handler.replace(/\\$(\\$|\\d{1,2})/, function (m, what) {\n return match[what === '$' ? 0 : Number(what)];\n });\n };\n var _handler = isString(handler) ? redirectUrlTo : handler;\n var matchParamsFromRegexp = function (url) {\n return regexp.exec(url.path);\n };\n var details = { regexp: regexp, type: 'REGEXP' };\n return extend(new BaseUrlRule(matchParamsFromRegexp, _handler), details);\n };\n UrlRuleFactory.isUrlRule = function (obj) {\n return obj && ['type', 'match', 'handler'].every(function (key) { return isDefined(obj[key]); });\n };\n return UrlRuleFactory;\n}());\n/**\n * A base rule which calls `match`\n *\n * The value from the `match` function is passed through to the `handler`.\n * @internalapi\n */\nvar BaseUrlRule = /** @class */ (function () {\n function BaseUrlRule(match, handler) {\n var _this = this;\n this.match = match;\n this.type = 'RAW';\n this.matchPriority = function (match) { return 0 - _this.$id; };\n this.handler = handler || identity;\n }\n return BaseUrlRule;\n}());\n\n/**\n * @internalapi\n * @module url\n */\n/** for typedoc */\n/** @hidden */\nfunction appendBasePath(url, isHtml5, absolute, baseHref) {\n if (baseHref === '/')\n return url;\n if (isHtml5)\n return stripLastPathElement(baseHref) + url;\n if (absolute)\n return baseHref.slice(1) + url;\n return url;\n}\n/** @hidden */\nvar prioritySort = function (a, b) {\n return (b.priority || 0) - (a.priority || 0);\n};\n/** @hidden */\nvar typeSort = function (a, b) {\n var weights = { 'STATE': 4, 'URLMATCHER': 4, 'REGEXP': 3, 'RAW': 2, 'OTHER': 1 };\n return (weights[a.type] || 0) - (weights[b.type] || 0);\n};\n/** @hidden */\nvar urlMatcherSort = function (a, b) {\n return !a.urlMatcher || !b.urlMatcher ? 0 : UrlMatcher.compare(a.urlMatcher, b.urlMatcher);\n};\n/** @hidden */\nvar idSort = function (a, b) {\n // Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL\n var useMatchPriority = { STATE: true, URLMATCHER: true };\n var equal = useMatchPriority[a.type] && useMatchPriority[b.type];\n return equal ? 0 : (a.$id || 0) - (b.$id || 0);\n};\n/**\n * Default rule priority sorting function.\n *\n * Sorts rules by:\n *\n * - Explicit priority (set rule priority using [[UrlRulesApi.when]])\n * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)\n * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.\n * - Rule registration order (for rule types other than STATE and URLMATCHER)\n * - Equally sorted State and UrlMatcher rules will each match the URL.\n * Then, the *best* match is chosen based on how many parameter values were matched.\n *\n * @coreapi\n */\nvar defaultRuleSortFn;\ndefaultRuleSortFn = function (a, b) {\n var cmp = prioritySort(a, b);\n if (cmp !== 0)\n return cmp;\n cmp = typeSort(a, b);\n if (cmp !== 0)\n return cmp;\n cmp = urlMatcherSort(a, b);\n if (cmp !== 0)\n return cmp;\n return idSort(a, b);\n};\n/**\n * Updates URL and responds to URL changes\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\n *\n * This class updates the URL when the state changes.\n * It also responds to changes in the URL.\n */\nvar UrlRouter = /** @class */ (function () {\n /** @hidden */\n function UrlRouter(router) {\n /** @hidden */ this._sortFn = defaultRuleSortFn;\n /** @hidden */ this._rules = [];\n /** @hidden */ this.interceptDeferred = false;\n /** @hidden */ this._id = 0;\n /** @hidden */ this._sorted = false;\n this._router = router;\n this.urlRuleFactory = new UrlRuleFactory(router);\n createProxyFunctions(val(UrlRouter.prototype), this, val(this));\n }\n /** @internalapi */\n UrlRouter.prototype.dispose = function () {\n this.listen(false);\n this._rules = [];\n delete this._otherwiseFn;\n };\n /** @inheritdoc */\n UrlRouter.prototype.sort = function (compareFn) {\n this._rules = this.stableSort(this._rules, this._sortFn = compareFn || this._sortFn);\n this._sorted = true;\n };\n UrlRouter.prototype.ensureSorted = function () {\n this._sorted || this.sort();\n };\n UrlRouter.prototype.stableSort = function (arr, compareFn) {\n var arrOfWrapper = arr.map(function (elem, idx) { return ({ elem: elem, idx: idx }); });\n arrOfWrapper.sort(function (wrapperA, wrapperB) {\n var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);\n return cmpDiff === 0\n ? wrapperA.idx - wrapperB.idx\n : cmpDiff;\n });\n return arrOfWrapper.map(function (wrapper) { return wrapper.elem; });\n };\n /**\n * Given a URL, check all rules and return the best [[MatchResult]]\n * @param url\n * @returns {MatchResult}\n */\n UrlRouter.prototype.match = function (url) {\n var _this = this;\n this.ensureSorted();\n url = extend({ path: '', search: {}, hash: '' }, url);\n var rules = this.rules();\n if (this._otherwiseFn)\n rules.push(this._otherwiseFn);\n // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined\n var checkRule = function (rule) {\n var match = rule.match(url, _this._router);\n return match && { match: match, rule: rule, weight: rule.matchPriority(match) };\n };\n // The rules are pre-sorted.\n // - Find the first matching rule.\n // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`.\n // - Choose the rule with the highest match weight.\n var best;\n for (var i = 0; i < rules.length; i++) {\n // Stop when there is a 'best' rule and the next rule sorts differently than it.\n if (best && this._sortFn(rules[i], best.rule) !== 0)\n break;\n var current = checkRule(rules[i]);\n // Pick the best MatchResult\n best = (!best || current && current.weight > best.weight) ? current : best;\n }\n return best;\n };\n /** @inheritdoc */\n UrlRouter.prototype.sync = function (evt) {\n if (evt && evt.defaultPrevented)\n return;\n var router = this._router, $url = router.urlService, $state = router.stateService;\n var url = {\n path: $url.path(), search: $url.search(), hash: $url.hash(),\n };\n var best = this.match(url);\n var applyResult = pattern([\n [isString, function (newurl) { return $url.url(newurl, true); }],\n [TargetState.isDef, function (def) { return $state.go(def.state, def.params, def.options); }],\n [is(TargetState), function (target) { return $state.go(target.state(), target.params(), target.options()); }],\n ]);\n applyResult(best && best.rule.handler(best.match, url, router));\n };\n /** @inheritdoc */\n UrlRouter.prototype.listen = function (enabled) {\n var _this = this;\n if (enabled === false) {\n this._stopFn && this._stopFn();\n delete this._stopFn;\n }\n else {\n return this._stopFn = this._stopFn || this._router.urlService.onChange(function (evt) { return _this.sync(evt); });\n }\n };\n /**\n * Internal API.\n * @internalapi\n */\n UrlRouter.prototype.update = function (read) {\n var $url = this._router.locationService;\n if (read) {\n this.location = $url.url();\n return;\n }\n if ($url.url() === this.location)\n return;\n $url.url(this.location, true);\n };\n /**\n * Internal API.\n *\n * Pushes a new location to the browser history.\n *\n * @internalapi\n * @param urlMatcher\n * @param params\n * @param options\n */\n UrlRouter.prototype.push = function (urlMatcher, params, options) {\n var replace = options && !!options.replace;\n this._router.urlService.url(urlMatcher.format(params || {}), replace);\n };\n /**\n * Builds and returns a URL with interpolated parameters\n *\n * #### Example:\n * ```js\n * matcher = $umf.compile(\"/about/:person\");\n * params = { person: \"bob\" };\n * $bob = $urlRouter.href(matcher, params);\n * // $bob == \"/about/bob\";\n * ```\n *\n * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.\n * @param params An object of parameter values to fill the matcher's required parameters.\n * @param 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 Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n */\n UrlRouter.prototype.href = function (urlMatcher, params, options) {\n var url = urlMatcher.format(params);\n if (url == null)\n return null;\n options = options || { absolute: false };\n var cfg = this._router.urlService.config;\n var isHtml5 = cfg.html5Mode();\n if (!isHtml5 && url !== null) {\n url = '#' + cfg.hashPrefix() + url;\n }\n url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref());\n if (!options.absolute || !url) {\n return url;\n }\n var slash = (!isHtml5 && url ? '/' : '');\n var cfgPort = cfg.port();\n var port = (cfgPort === 80 || cfgPort === 443 ? '' : ':' + cfgPort);\n return [cfg.protocol(), '://', cfg.host(), port, slash, url].join('');\n };\n /**\n * Manually adds a URL Rule.\n *\n * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]].\n * This api can be used directly for more control (to register a [[BaseUrlRule]], for example).\n * Rules can be created using [[UrlRouter.urlRuleFactory]], or create manually as simple objects.\n *\n * A rule should have a `match` function which returns truthy if the rule matched.\n * It should also have a `handler` function which is invoked if the rule is the best match.\n *\n * @return a function that deregisters the rule\n */\n UrlRouter.prototype.rule = function (rule) {\n var _this = this;\n if (!UrlRuleFactory.isUrlRule(rule))\n throw new Error('invalid rule');\n rule.$id = this._id++;\n rule.priority = rule.priority || 0;\n this._rules.push(rule);\n this._sorted = false;\n return function () { return _this.removeRule(rule); };\n };\n /** @inheritdoc */\n UrlRouter.prototype.removeRule = function (rule) {\n removeFrom(this._rules, rule);\n };\n /** @inheritdoc */\n UrlRouter.prototype.rules = function () {\n this.ensureSorted();\n return this._rules.slice();\n };\n /** @inheritdoc */\n UrlRouter.prototype.otherwise = function (handler) {\n var handlerFn = getHandlerFn(handler);\n this._otherwiseFn = this.urlRuleFactory.create(val(true), handlerFn);\n this._sorted = false;\n };\n /** @inheritdoc */\n UrlRouter.prototype.initial = function (handler) {\n var handlerFn = getHandlerFn(handler);\n var matchFn = function (urlParts, router) {\n return router.globals.transitionHistory.size() === 0 && !!/^\\/?$/.exec(urlParts.path);\n };\n this.rule(this.urlRuleFactory.create(matchFn, handlerFn));\n };\n /** @inheritdoc */\n UrlRouter.prototype.when = function (matcher, handler, options) {\n var rule = this.urlRuleFactory.create(matcher, handler);\n if (isDefined(options && options.priority))\n rule.priority = options.priority;\n this.rule(rule);\n return rule;\n };\n /** @inheritdoc */\n UrlRouter.prototype.deferIntercept = function (defer) {\n if (defer === undefined)\n defer = true;\n this.interceptDeferred = defer;\n };\n return UrlRouter;\n}());\nfunction getHandlerFn(handler) {\n if (!isFunction(handler) && !isString(handler) && !is(TargetState)(handler) && !TargetState.isDef(handler)) {\n throw new Error(\"'handler' must be a string, function, TargetState, or have a state: 'newtarget' property\");\n }\n return isFunction(handler) ? handler : val(handler);\n}\n\n/**\n * @coreapi\n * @module view\n */ /** for typedoc */\n/**\n * The View service\n *\n * This service pairs existing `ui-view` components (which live in the DOM)\n * with view configs (from the state declaration objects: [[StateDeclaration.views]]).\n *\n * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]].\n * The views from exited states are deactivated via [[deactivateViewConfig]].\n * (See: the [[registerActivateViews]] Transition Hook)\n *\n * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]].\n *\n * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]])\n * are configured with the matching [[ViewConfig]](s)\n *\n */\nvar ViewService = /** @class */ (function () {\n function ViewService() {\n var _this = this;\n this._uiViews = [];\n this._viewConfigs = [];\n this._viewConfigFactories = {};\n this._listeners = [];\n this._pluginapi = {\n _rootViewContext: this._rootViewContext.bind(this),\n _viewConfigFactory: this._viewConfigFactory.bind(this),\n _registeredUIViews: function () { return _this._uiViews; },\n _activeViewConfigs: function () { return _this._viewConfigs; },\n _onSync: function (listener) {\n _this._listeners.push(listener);\n return function () { return removeFrom(_this._listeners, listener); };\n },\n };\n }\n /**\n * Normalizes a view's name from a state.views configuration block.\n *\n * This should be used by a framework implementation to calculate the values for\n * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]].\n *\n * @param context the context object (state declaration) that the view belongs to\n * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]]\n *\n * @returns the normalized uiViewName and uiViewContextAnchor that the view targets\n */\n ViewService.normalizeUIViewTarget = function (context, rawViewName) {\n if (rawViewName === void 0) { rawViewName = ''; }\n // TODO: Validate incoming view name with a regexp to allow:\n // ex: \"view.name@foo.bar\" , \"^.^.view.name\" , \"view.name@^.^\" , \"\" ,\n // \"@\" , \"$default@^\" , \"!$default.$default\" , \"!foo.bar\"\n var viewAtContext = rawViewName.split('@');\n var uiViewName = viewAtContext[0] || '$default'; // default to unnamed view\n var uiViewContextAnchor = isString(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context\n // Handle relative view-name sugar syntax.\n // Matches rawViewName \"^.^.^.foo.bar\" into array: [\"^.^.^.foo.bar\", \"^.^.^\", \"foo.bar\"],\n var relativeViewNameSugar = /^(\\^(?:\\.\\^)*)\\.(.*$)/.exec(uiViewName);\n if (relativeViewNameSugar) {\n // Clobbers existing contextAnchor (rawViewName validation will fix this)\n uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to \"^.^.^\"\n uiViewName = relativeViewNameSugar[2]; // set view-name to \"foo.bar\"\n }\n if (uiViewName.charAt(0) === '!') {\n uiViewName = uiViewName.substr(1);\n uiViewContextAnchor = ''; // target absolutely from root\n }\n // handle parent relative targeting \"^.^.^\"\n var relativeMatch = /^(\\^(?:\\.\\^)*)$/;\n if (relativeMatch.exec(uiViewContextAnchor)) {\n var anchorState = uiViewContextAnchor.split('.')\n .reduce((function (anchor, x) { return anchor.parent; }), context);\n uiViewContextAnchor = anchorState.name;\n }\n else if (uiViewContextAnchor === '.') {\n uiViewContextAnchor = context.name;\n }\n return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor };\n };\n ViewService.prototype._rootViewContext = function (context) {\n return this._rootContext = context || this._rootContext;\n };\n ViewService.prototype._viewConfigFactory = function (viewType, factory) {\n this._viewConfigFactories[viewType] = factory;\n };\n ViewService.prototype.createViewConfig = function (path, decl) {\n var cfgFactory = this._viewConfigFactories[decl.$type];\n if (!cfgFactory)\n throw new Error('ViewService: No view config factory registered for type ' + decl.$type);\n var cfgs = cfgFactory(path, decl);\n return isArray(cfgs) ? cfgs : [cfgs];\n };\n /**\n * Deactivates a ViewConfig.\n *\n * This function deactivates a `ViewConfig`.\n * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired.\n *\n * @param viewConfig The ViewConfig view to deregister.\n */\n ViewService.prototype.deactivateViewConfig = function (viewConfig) {\n trace.traceViewServiceEvent('<- Removing', viewConfig);\n removeFrom(this._viewConfigs, viewConfig);\n };\n ViewService.prototype.activateViewConfig = function (viewConfig) {\n trace.traceViewServiceEvent('-> Registering', viewConfig);\n this._viewConfigs.push(viewConfig);\n };\n ViewService.prototype.sync = function () {\n var _this = this;\n var uiViewsByFqn = this._uiViews.map(function (uiv) { return [uiv.fqn, uiv]; }).reduce(applyPairs, {});\n // Return a weighted depth value for a uiView.\n // The depth is the nesting depth of ui-views (based on FQN; times 10,000)\n // plus the depth of the state that is populating the uiView\n function uiViewDepth(uiView) {\n var stateDepth = function (context) {\n return context && context.parent ? stateDepth(context.parent) + 1 : 1;\n };\n return (uiView.fqn.split('.').length * 10000) + stateDepth(uiView.creationContext);\n }\n // Return the ViewConfig's context's depth in the context tree.\n function viewConfigDepth(config) {\n var context = config.viewDecl.$context, count = 0;\n while (++count && context.parent)\n context = context.parent;\n return count;\n }\n // Given a depth function, returns a compare function which can return either ascending or descending order\n var depthCompare = curry(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); });\n var matchingConfigPair = function (uiView) {\n var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView));\n if (matchingConfigs.length > 1) {\n // This is OK. Child states can target a ui-view that the parent state also targets (the child wins)\n // Sort by depth and return the match from the deepest child\n // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs);\n matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending\n }\n return { uiView: uiView, viewConfig: matchingConfigs[0] };\n };\n var configureUIView = function (tuple) {\n // If a parent ui-view is reconfigured, it could destroy child ui-views.\n // Before configuring a child ui-view, make sure it's still in the active uiViews array.\n if (_this._uiViews.indexOf(tuple.uiView) !== -1)\n tuple.uiView.configUpdated(tuple.viewConfig);\n };\n // Sort views by FQN and state depth. Process uiviews nearest the root first.\n var uiViewTuples = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);\n var matchedViewConfigs = uiViewTuples.map(function (tuple) { return tuple.viewConfig; });\n var unmatchedConfigTuples = this._viewConfigs\n .filter(function (config) { return !inArray(matchedViewConfigs, config); })\n .map(function (viewConfig) { return ({ uiView: undefined, viewConfig: viewConfig }); });\n uiViewTuples.forEach(configureUIView);\n var allTuples = uiViewTuples.concat(unmatchedConfigTuples);\n this._listeners.forEach(function (cb) { return cb(allTuples); });\n trace.traceViewSync(allTuples);\n };\n /**\n * Registers a `ui-view` component\n *\n * When a `ui-view` component is created, it uses this method to register itself.\n * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]].\n *\n * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,\n * and what the view's state context is.\n *\n * Note: There is no corresponding `deregisterUIView`.\n * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself.\n *\n * @param uiView The metadata for a UIView\n * @return a de-registration function used when the view is destroyed.\n */\n ViewService.prototype.registerUIView = function (uiView) {\n trace.traceViewServiceUIViewEvent('-> Registering', uiView);\n var uiViews = this._uiViews;\n var fqnAndTypeMatches = function (uiv) { return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type; };\n if (uiViews.filter(fqnAndTypeMatches).length)\n trace.traceViewServiceUIViewEvent('!!!! duplicate uiView named:', uiView);\n uiViews.push(uiView);\n this.sync();\n return function () {\n var idx = uiViews.indexOf(uiView);\n if (idx === -1) {\n trace.traceViewServiceUIViewEvent('Tried removing non-registered uiView', uiView);\n return;\n }\n trace.traceViewServiceUIViewEvent('<- Deregistering', uiView);\n removeFrom(uiViews)(uiView);\n };\n };\n /**\n * Returns the list of views currently available on the page, by fully-qualified name.\n *\n * @return {Array} Returns an array of fully-qualified view names.\n */\n ViewService.prototype.available = function () {\n return this._uiViews.map(prop('fqn'));\n };\n /**\n * Returns the list of views on the page containing loaded content.\n *\n * @return {Array} Returns an array of fully-qualified view names.\n */\n ViewService.prototype.active = function () {\n return this._uiViews.filter(prop('$config')).map(prop('name'));\n };\n /**\n * Given a ui-view and a ViewConfig, determines if they \"match\".\n *\n * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in\n * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.\n *\n * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or\n * can be a segmented ui-view path, describing a portion of a ui-view fqn.\n *\n * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type\n *\n * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:\n * - the ui-view's name matches the ViewConfig's target name\n * - the ui-view's context matches the ViewConfig's anchor\n *\n * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:\n * - There exists a parent ui-view where:\n * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name\n * - the parent ui-view's context matches the ViewConfig's anchor\n * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn\n *\n * Example:\n *\n * DOM:\n * \n * \n * \n * \n * \n * \n * \n * \n *\n * uiViews: [\n * { fqn: \"$default\", creationContext: { name: \"\" } },\n * { fqn: \"$default.foo\", creationContext: { name: \"A\" } },\n * { fqn: \"$default.foo.$default\", creationContext: { name: \"A.B\" } }\n * { fqn: \"$default.foo.$default.bar\", creationContext: { name: \"A.B.C\" } }\n * ]\n *\n * These four view configs all match the ui-view with the fqn: \"$default.foo.$default.bar\":\n *\n * - ViewConfig1: { uiViewName: \"bar\", uiViewContextAnchor: \"A.B.C\" }\n * - ViewConfig2: { uiViewName: \"$default.bar\", uiViewContextAnchor: \"A.B\" }\n * - ViewConfig3: { uiViewName: \"foo.$default.bar\", uiViewContextAnchor: \"A\" }\n * - ViewConfig4: { uiViewName: \"$default.foo.$default.bar\", uiViewContextAnchor: \"\" }\n *\n * Using ViewConfig3 as an example, it matches the ui-view with fqn \"$default.foo.$default.bar\" because:\n * - The ViewConfig's segmented target name is: [ \"foo\", \"$default\", \"bar\" ]\n * - There exists a parent ui-view (which has fqn: \"$default.foo\") where:\n * - the parent ui-view's name \"foo\" matches the first segment \"foo\" of the ViewConfig's target name\n * - the parent ui-view's context \"A\" matches the ViewConfig's anchor context \"A\"\n * - And the remaining segments [ \"$default\", \"bar\" ].join(\".\"_ of the ViewConfig's target name match\n * the tail of the ui-view's fqn \"default.bar\"\n *\n * @internalapi\n */\n ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) {\n // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc\n if (uiView.$type !== viewConfig.viewDecl.$type)\n return false;\n // Split names apart from both viewConfig and uiView into segments\n var vc = viewConfig.viewDecl;\n var vcSegments = vc.$uiViewName.split('.');\n var uivSegments = uiView.fqn.split('.');\n // Check if the tails of the segment arrays match. ex, these arrays' tails match:\n // vc: [\"foo\", \"bar\"], uiv fqn: [\"$default\", \"foo\", \"bar\"]\n if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length)))\n return false;\n // Now check if the fqn ending at the first segment of the viewConfig matches the context:\n // [\"$default\", \"foo\"].join(\".\") == \"$default.foo\", does the ui-view $default.foo context match?\n var negOffset = (1 - vcSegments.length) || undefined;\n var fqnToFirstSegment = uivSegments.slice(0, negOffset).join('.');\n var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;\n return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);\n }; };\n return ViewService;\n}());\n\n/**\n * @coreapi\n * @module core\n */ /** */\n/**\n * Global router state\n *\n * This is where we hold the global mutable state such as current state, current\n * params, current transition, etc.\n */\nvar UIRouterGlobals = /** @class */ (function () {\n function UIRouterGlobals() {\n /**\n * Current parameter values\n *\n * The parameter values from the latest successful transition\n */\n this.params = new StateParams();\n /** @internalapi */\n this.lastStartedTransitionId = -1;\n /** @internalapi */\n this.transitionHistory = new Queue([], 1);\n /** @internalapi */\n this.successfulTransitions = new Queue([], 1);\n }\n UIRouterGlobals.prototype.dispose = function () {\n this.transitionHistory.clear();\n this.successfulTransitions.clear();\n this.transition = null;\n };\n return UIRouterGlobals;\n}());\n\n/**\n * @coreapi\n * @module url\n */ /** */\n/** @hidden */\nvar makeStub = function (keys) {\n return keys.reduce(function (acc, key) { return (acc[key] = notImplemented(key), acc); }, { dispose: noop });\n};\n/* tslint:disable:align */\n/** @hidden */ var locationServicesFns = ['url', 'path', 'search', 'hash', 'onChange'];\n/** @hidden */ var locationConfigFns = ['port', 'protocol', 'host', 'baseHref', 'html5Mode', 'hashPrefix'];\n/** @hidden */ var umfFns = ['type', 'caseInsensitive', 'strictMode', 'defaultSquashPolicy'];\n/** @hidden */ var rulesFns = ['sort', 'when', 'initial', 'otherwise', 'rules', 'rule', 'removeRule'];\n/** @hidden */ var syncFns = ['deferIntercept', 'listen', 'sync', 'match'];\n/* tslint:enable:align */\n/**\n * API for URL management\n */\nvar UrlService = /** @class */ (function () {\n /** @hidden */\n function UrlService(router, lateBind) {\n if (lateBind === void 0) { lateBind = true; }\n this.router = router;\n this.rules = {};\n this.config = {};\n // proxy function calls from UrlService to the LocationService/LocationConfig\n var locationServices = function () { return router.locationService; };\n createProxyFunctions(locationServices, this, locationServices, locationServicesFns, lateBind);\n var locationConfig = function () { return router.locationConfig; };\n createProxyFunctions(locationConfig, this.config, locationConfig, locationConfigFns, lateBind);\n var umf = function () { return router.urlMatcherFactory; };\n createProxyFunctions(umf, this.config, umf, umfFns);\n var urlRouter = function () { return router.urlRouter; };\n createProxyFunctions(urlRouter, this.rules, urlRouter, rulesFns);\n createProxyFunctions(urlRouter, this, urlRouter, syncFns);\n }\n UrlService.prototype.url = function (newurl, replace, state) { return; };\n /** @inheritdoc */\n UrlService.prototype.path = function () { return; };\n /** @inheritdoc */\n UrlService.prototype.search = function () { return; };\n /** @inheritdoc */\n UrlService.prototype.hash = function () { return; };\n /** @inheritdoc */\n UrlService.prototype.onChange = function (callback) { return; };\n /**\n * Returns the current URL parts\n *\n * This method returns the current URL components as a [[UrlParts]] object.\n *\n * @returns the current url parts\n */\n UrlService.prototype.parts = function () {\n return { path: this.path(), search: this.search(), hash: this.hash() };\n };\n UrlService.prototype.dispose = function () { };\n /** @inheritdoc */\n UrlService.prototype.sync = function (evt) { return; };\n /** @inheritdoc */\n UrlService.prototype.listen = function (enabled) { return; };\n /** @inheritdoc */\n UrlService.prototype.deferIntercept = function (defer) { return; };\n /** @inheritdoc */\n UrlService.prototype.match = function (urlParts) { return; };\n /** @hidden */\n UrlService.locationServiceStub = makeStub(locationServicesFns);\n /** @hidden */\n UrlService.locationConfigStub = makeStub(locationConfigFns);\n return UrlService;\n}());\n\n/**\n * @coreapi\n * @module core\n */ /** */\n/** @hidden */\nvar _routerInstance = 0;\n/**\n * The master class used to instantiate an instance of UI-Router.\n *\n * UI-Router (for each specific framework) will create an instance of this class during bootstrap.\n * This class instantiates and wires the UI-Router services together.\n *\n * After a new instance of the UIRouter class is created, it should be configured for your app.\n * For instance, app states should be registered with the [[UIRouter.stateRegistry]].\n *\n * ---\n *\n * Normally the framework code will bootstrap UI-Router.\n * If you are bootstrapping UIRouter manually, tell it to monitor the URL by calling\n * [[UrlService.listen]] then [[UrlService.sync]].\n */\nvar UIRouter = /** @class */ (function () {\n /**\n * Creates a new `UIRouter` object\n *\n * @param locationService a [[LocationServices]] implementation\n * @param locationConfig a [[LocationConfig]] implementation\n * @internalapi\n */\n function UIRouter(locationService, locationConfig) {\n if (locationService === void 0) { locationService = UrlService.locationServiceStub; }\n if (locationConfig === void 0) { locationConfig = UrlService.locationConfigStub; }\n this.locationService = locationService;\n this.locationConfig = locationConfig;\n /** @hidden */ this.$id = _routerInstance++;\n /** @hidden */ this._disposed = false;\n /** @hidden */ this._disposables = [];\n /** Provides trace information to the console */\n this.trace = trace;\n /** Provides services related to ui-view synchronization */\n this.viewService = new ViewService();\n /** Global router state */\n this.globals = new UIRouterGlobals();\n /** Provides services related to Transitions */\n this.transitionService = new TransitionService(this);\n /**\n * Deprecated for public use. Use [[urlService]] instead.\n * @deprecated Use [[urlService]] instead\n */\n this.urlMatcherFactory = new UrlMatcherFactory();\n /**\n * Deprecated for public use. Use [[urlService]] instead.\n * @deprecated Use [[urlService]] instead\n */\n this.urlRouter = new UrlRouter(this);\n /** Provides a registry for states, and related registration services */\n this.stateRegistry = new StateRegistry(this);\n /** Provides services related to states */\n this.stateService = new StateService(this);\n /** Provides services related to the URL */\n this.urlService = new UrlService(this);\n /** @hidden plugin instances are registered here */\n this._plugins = {};\n this.viewService._pluginapi._rootViewContext(this.stateRegistry.root());\n this.globals.$current = this.stateRegistry.root();\n this.globals.current = this.globals.$current.self;\n this.disposable(this.globals);\n this.disposable(this.stateService);\n this.disposable(this.stateRegistry);\n this.disposable(this.transitionService);\n this.disposable(this.urlRouter);\n this.disposable(locationService);\n this.disposable(locationConfig);\n }\n /** Registers an object to be notified when the router is disposed */\n UIRouter.prototype.disposable = function (disposable) {\n this._disposables.push(disposable);\n };\n /**\n * Disposes this router instance\n *\n * When called, clears resources retained by the router by calling `dispose(this)` on all\n * registered [[disposable]] objects.\n *\n * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only.\n *\n * @param disposable (optional) the disposable to dispose\n */\n UIRouter.prototype.dispose = function (disposable) {\n var _this = this;\n if (disposable && isFunction(disposable.dispose)) {\n disposable.dispose(this);\n return undefined;\n }\n this._disposed = true;\n this._disposables.slice().forEach(function (d) {\n try {\n typeof d.dispose === 'function' && d.dispose(_this);\n removeFrom(_this._disposables, d);\n }\n catch (ignored) { }\n });\n };\n /**\n * Adds a plugin to UI-Router\n *\n * This method adds a UI-Router Plugin.\n * A plugin can enhance or change UI-Router behavior using any public API.\n *\n * #### Example:\n * ```js\n * import { MyCoolPlugin } from \"ui-router-cool-plugin\";\n *\n * var plugin = router.addPlugin(MyCoolPlugin);\n * ```\n *\n * ### Plugin authoring\n *\n * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object.\n *\n * The plugin can implement its functionality using any of the public APIs of [[UIRouter]].\n * For example, it may configure router options or add a Transition Hook.\n *\n * The plugin can then be published as a separate module.\n *\n * #### Example:\n * ```js\n * export class MyAuthPlugin implements UIRouterPlugin {\n * constructor(router: UIRouter, options: any) {\n * this.name = \"MyAuthPlugin\";\n * let $transitions = router.transitionService;\n * let $state = router.stateService;\n *\n * let authCriteria = {\n * to: (state) => state.data && state.data.requiresAuth\n * };\n *\n * function authHook(transition: Transition) {\n * let authService = transition.injector().get('AuthService');\n * if (!authService.isAuthenticated()) {\n * return $state.target('login');\n * }\n * }\n *\n * $transitions.onStart(authCriteria, authHook);\n * }\n * }\n * ```\n *\n * @param plugin one of:\n * - a plugin class which implements [[UIRouterPlugin]]\n * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance\n * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance\n * @param options options to pass to the plugin class/factory\n * @returns the registered plugin instance\n */\n UIRouter.prototype.plugin = function (plugin, options) {\n if (options === void 0) { options = {}; }\n var pluginInstance = new plugin(this, options);\n if (!pluginInstance.name)\n throw new Error('Required property `name` missing on plugin: ' + pluginInstance);\n this._disposables.push(pluginInstance);\n return this._plugins[pluginInstance.name] = pluginInstance;\n };\n UIRouter.prototype.getPlugin = function (pluginName) {\n return pluginName ? this._plugins[pluginName] : values(this._plugins);\n };\n return UIRouter;\n}());\n\n/** @module hooks */ /** */\nfunction addCoreResolvables(trans) {\n trans.addResolvable(Resolvable.fromData(UIRouter, trans.router), '');\n trans.addResolvable(Resolvable.fromData(Transition, trans), '');\n trans.addResolvable(Resolvable.fromData('$transition$', trans), '');\n trans.addResolvable(Resolvable.fromData('$stateParams', trans.params()), '');\n trans.entering().forEach(function (state) {\n trans.addResolvable(Resolvable.fromData('$state$', state), state);\n });\n}\nvar registerAddCoreResolvables = function (transitionService) {\n return transitionService.onCreate({}, addCoreResolvables);\n};\nvar TRANSITION_TOKENS = ['$transition$', Transition];\nvar isTransition = inArray(TRANSITION_TOKENS);\n// References to Transition in the treeChanges pathnodes makes all\n// previous Transitions reachable in memory, causing a memory leak\n// This function removes resolves for '$transition$' and `Transition` from the treeChanges.\n// Do not use this on current transitions, only on old ones.\nvar treeChangesCleanup = function (trans) {\n // If the resolvable is a Transition, return a new resolvable with null data\n var replaceTransitionWithNull = function (r) {\n return isTransition(r.token) ? Resolvable.fromData(r.token, null) : r;\n };\n var cleanPath = function (path) { return path.map(function (node) {\n var resolvables = node.resolvables.map(replaceTransitionWithNull);\n return extend(node.clone(), { resolvables: resolvables });\n }); };\n var treeChanges = trans.treeChanges();\n mapObj(treeChanges, cleanPath, treeChanges);\n};\n\n/** @module hooks */ /** */\n/**\n * A [[TransitionHookFn]] that redirects to a different state or params\n *\n * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);`\n *\n * See [[StateDeclaration.redirectTo]]\n */\nvar redirectToHook = function (trans) {\n var redirect = trans.to().redirectTo;\n if (!redirect)\n return;\n var $state = trans.router.stateService;\n function handleResult(result) {\n if (!result)\n return;\n if (result instanceof TargetState)\n return result;\n if (isString(result))\n return $state.target(result, trans.params(), trans.options());\n if (result['state'] || result['params'])\n return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options());\n }\n if (isFunction(redirect)) {\n return services.$q.when(redirect(trans)).then(handleResult);\n }\n return handleResult(redirect);\n};\nvar registerRedirectToHook = function (transitionService) {\n return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook);\n};\n\n/**\n * A factory which creates an onEnter, onExit or onRetain transition hook function\n *\n * The returned function invokes the (for instance) state.onEnter hook when the\n * state is being entered.\n *\n * @hidden\n */\nfunction makeEnterExitRetainHook(hookName) {\n return function (transition, state) {\n var _state = state.$$state();\n var hookFn = _state[hookName];\n return hookFn(transition, state);\n };\n}\n/**\n * The [[TransitionStateHookFn]] for onExit\n *\n * When the state is being exited, the state's .onExit function is invoked.\n *\n * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);`\n *\n * See: [[IHookRegistry.onExit]]\n */\nvar onExitHook = makeEnterExitRetainHook('onExit');\nvar registerOnExitHook = function (transitionService) {\n return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook);\n};\n/**\n * The [[TransitionStateHookFn]] for onRetain\n *\n * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked.\n *\n * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);`\n *\n * See: [[IHookRegistry.onRetain]]\n */\nvar onRetainHook = makeEnterExitRetainHook('onRetain');\nvar registerOnRetainHook = function (transitionService) {\n return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook);\n};\n/**\n * The [[TransitionStateHookFn]] for onEnter\n *\n * When the state is being entered, the state's .onEnter function is invoked.\n *\n * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);`\n *\n * See: [[IHookRegistry.onEnter]]\n */\nvar onEnterHook = makeEnterExitRetainHook('onEnter');\nvar registerOnEnterHook = function (transitionService) {\n return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook);\n};\n\n/** @module hooks */\n/** for typedoc */\nvar RESOLVE_HOOK_PRIORITY = 1000;\n/**\n * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path\n *\n * Registered using `transitionService.onStart({}, eagerResolvePath, { priority: 1000 });`\n *\n * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for.\n *\n * See [[StateDeclaration.resolve]]\n */\nvar eagerResolvePath = function (trans) {\n return new ResolveContext(trans.treeChanges().to)\n .resolvePath('EAGER', trans)\n .then(noop);\n};\nvar registerEagerResolvePath = function (transitionService) {\n return transitionService.onStart({}, eagerResolvePath, { priority: RESOLVE_HOOK_PRIORITY });\n};\n/**\n * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path\n *\n * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState, { priority: 1000 });`\n *\n * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for.\n *\n * See [[StateDeclaration.resolve]]\n */\nvar lazyResolveState = function (trans, state) {\n return new ResolveContext(trans.treeChanges().to)\n .subContext(state.$$state())\n .resolvePath('LAZY', trans)\n .then(noop);\n};\nvar registerLazyResolveState = function (transitionService) {\n return transitionService.onEnter({ entering: val(true) }, lazyResolveState, { priority: RESOLVE_HOOK_PRIORITY });\n};\n/**\n * A [[TransitionHookFn]] which resolves any dynamically added (LAZY or EAGER) Resolvables.\n *\n * Registered using `transitionService.onFinish({}, eagerResolvePath, { priority: 1000 });`\n *\n * After all entering states have been entered, this hook resolves any remaining Resolvables.\n * These are typically dynamic resolves which were added by some Transition Hook using [[Transition.addResolvable]].\n *\n * See [[StateDeclaration.resolve]]\n */\nvar resolveRemaining = function (trans) {\n return new ResolveContext(trans.treeChanges().to)\n .resolvePath('LAZY', trans)\n .then(noop);\n};\nvar registerResolveRemaining = function (transitionService) {\n return transitionService.onFinish({}, resolveRemaining, { priority: RESOLVE_HOOK_PRIORITY });\n};\n\n/** @module hooks */ /** for typedoc */\n/**\n * A [[TransitionHookFn]] which waits for the views to load\n *\n * Registered using `transitionService.onStart({}, loadEnteringViews);`\n *\n * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.\n * In angular 1, this includes loading the templates.\n */\nvar loadEnteringViews = function (transition) {\n var $q = services.$q;\n var enteringViews = transition.views('entering');\n if (!enteringViews.length)\n return;\n return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(noop);\n};\nvar registerLoadEnteringViews = function (transitionService) {\n return transitionService.onFinish({}, loadEnteringViews);\n};\n/**\n * A [[TransitionHookFn]] which activates the new views when a transition is successful.\n *\n * Registered using `transitionService.onSuccess({}, activateViews);`\n *\n * After a transition is complete, this hook deactivates the old views from the previous state,\n * and activates the new views from the destination state.\n *\n * See [[ViewService]]\n */\nvar activateViews = function (transition) {\n var enteringViews = transition.views('entering');\n var exitingViews = transition.views('exiting');\n if (!enteringViews.length && !exitingViews.length)\n return;\n var $view = transition.router.viewService;\n exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); });\n enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); });\n $view.sync();\n};\nvar registerActivateViews = function (transitionService) {\n return transitionService.onSuccess({}, activateViews);\n};\n\n/**\n * A [[TransitionHookFn]] which updates global UI-Router state\n *\n * Registered using `transitionService.onBefore({}, updateGlobalState);`\n *\n * Before a [[Transition]] starts, updates the global value of \"the current transition\" ([[Globals.transition]]).\n * After a successful [[Transition]], updates the global values of \"the current state\"\n * ([[Globals.current]] and [[Globals.$current]]) and \"the current param values\" ([[Globals.params]]).\n *\n * See also the deprecated properties:\n * [[StateService.transition]], [[StateService.current]], [[StateService.params]]\n */\nvar updateGlobalState = function (trans) {\n var globals = trans.router.globals;\n var transitionSuccessful = function () {\n globals.successfulTransitions.enqueue(trans);\n globals.$current = trans.$to();\n globals.current = globals.$current.self;\n copy(trans.params(), globals.params);\n };\n var clearCurrentTransition = function () {\n // Do not clear globals.transition if a different transition has started in the meantime\n if (globals.transition === trans)\n globals.transition = null;\n };\n trans.onSuccess({}, transitionSuccessful, { priority: 10000 });\n trans.promise.then(clearCurrentTransition, clearCurrentTransition);\n};\nvar registerUpdateGlobalState = function (transitionService) {\n return transitionService.onCreate({}, updateGlobalState);\n};\n\n/**\n * A [[TransitionHookFn]] which updates the URL after a successful transition\n *\n * Registered using `transitionService.onSuccess({}, updateUrl);`\n */\nvar updateUrl = function (transition) {\n var options = transition.options();\n var $state = transition.router.stateService;\n var $urlRouter = transition.router.urlRouter;\n // Dont update the url in these situations:\n // The transition was triggered by a URL sync (options.source === 'url')\n // The user doesn't want the url to update (options.location === false)\n // The destination state, and all parents have no navigable url\n if (options.source !== 'url' && options.location && $state.$current.navigable) {\n var urlOptions = { replace: options.location === 'replace' };\n $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions);\n }\n $urlRouter.update(true);\n};\nvar registerUpdateUrl = function (transitionService) {\n return transitionService.onSuccess({}, updateUrl, { priority: 9999 });\n};\n\n/**\n * A [[TransitionHookFn]] that performs lazy loading\n *\n * When entering a state \"abc\" which has a `lazyLoad` function defined:\n * - Invoke the `lazyLoad` function (unless it is already in process)\n * - Flag the hook function as \"in process\"\n * - The function should return a promise (that resolves when lazy loading is complete)\n * - Wait for the promise to settle\n * - If the promise resolves to a [[LazyLoadResult]], then register those states\n * - Flag the hook function as \"not in process\"\n * - If the hook was successful\n * - Remove the `lazyLoad` function from the state declaration\n * - If all the hooks were successful\n * - Retry the transition (by returning a TargetState)\n *\n * ```\n * .state('abc', {\n * component: 'fooComponent',\n * lazyLoad: () => System.import('./fooComponent')\n * });\n * ```\n *\n * See [[StateDeclaration.lazyLoad]]\n */\nvar lazyLoadHook = function (transition) {\n var router = transition.router;\n function retryTransition() {\n if (transition.originalTransition().options().source !== 'url') {\n // The original transition was not triggered via url sync\n // The lazy state should be loaded now, so re-try the original transition\n var orig = transition.targetState();\n return router.stateService.target(orig.identifier(), orig.params(), orig.options());\n }\n // The original transition was triggered via url sync\n // Run the URL rules and find the best match\n var $url = router.urlService;\n var result = $url.match($url.parts());\n var rule = result && result.rule;\n // If the best match is a state, redirect the transition (instead\n // of calling sync() which supersedes the current transition)\n if (rule && rule.type === 'STATE') {\n var state = rule.state;\n var params = result.match;\n return router.stateService.target(state, params, transition.options());\n }\n // No matching state found, so let .sync() choose the best non-state match/otherwise\n router.urlService.sync();\n }\n var promises = transition.entering()\n .filter(function (state) { return !!state.$$state().lazyLoad; })\n .map(function (state) { return lazyLoadState(transition, state); });\n return services.$q.all(promises).then(retryTransition);\n};\nvar registerLazyLoadHook = function (transitionService) {\n return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook);\n};\n/**\n * Invokes a state's lazy load function\n *\n * @param transition a Transition context\n * @param state the state to lazy load\n * @returns A promise for the lazy load result\n */\nfunction lazyLoadState(transition, state) {\n var lazyLoadFn = state.$$state().lazyLoad;\n // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked\n var promise = lazyLoadFn['_promise'];\n if (!promise) {\n var success = function (result) {\n delete state.lazyLoad;\n delete state.$$state().lazyLoad;\n delete lazyLoadFn['_promise'];\n return result;\n };\n var error = function (err) {\n delete lazyLoadFn['_promise'];\n return services.$q.reject(err);\n };\n promise = lazyLoadFn['_promise'] =\n services.$q.when(lazyLoadFn(transition, state))\n .then(updateStateRegistry)\n .then(success, error);\n }\n /** Register any lazy loaded state definitions */\n function updateStateRegistry(result) {\n if (result && Array.isArray(result.states)) {\n result.states.forEach(function (_state) { return transition.router.stateRegistry.register(_state); });\n }\n return result;\n }\n return promise;\n}\n\n/**\n * This class defines a type of hook, such as `onBefore` or `onEnter`.\n * Plugins can define custom hook types, such as sticky states does for `onInactive`.\n *\n * @interalapi\n */\nvar TransitionEventType = /** @class */ (function () {\n /* tslint:disable:no-inferrable-types */\n function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) { reverseSort = false; }\n if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; }\n if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; }\n if (synchronous === void 0) { synchronous = false; }\n this.name = name;\n this.hookPhase = hookPhase;\n this.hookOrder = hookOrder;\n this.criteriaMatchPath = criteriaMatchPath;\n this.reverseSort = reverseSort;\n this.getResultHandler = getResultHandler;\n this.getErrorHandler = getErrorHandler;\n this.synchronous = synchronous;\n }\n return TransitionEventType;\n}());\n\n/** @module hooks */ /** */\n/**\n * A [[TransitionHookFn]] that skips a transition if it should be ignored\n *\n * This hook is invoked at the end of the onBefore phase.\n *\n * If the transition should be ignored (because no parameter or states changed)\n * then the transition is ignored and not processed.\n */\nfunction ignoredHook(trans) {\n var ignoredReason = trans._ignoredReason();\n if (!ignoredReason)\n return;\n trace.traceTransitionIgnored(trans);\n var pending = trans.router.globals.transition;\n // The user clicked a link going back to the *current state* ('A')\n // However, there is also a pending transition in flight (to 'B')\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n return Rejection.ignored().toPromise();\n}\nvar registerIgnoredTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, ignoredHook, { priority: -9999 });\n};\n\n/** @module hooks */ /** */\n/**\n * A [[TransitionHookFn]] that rejects the Transition if it is invalid\n *\n * This hook is invoked at the end of the onBefore phase.\n * If the transition is invalid (for example, param values do not validate)\n * then the transition is rejected.\n */\nfunction invalidTransitionHook(trans) {\n if (!trans.valid()) {\n throw new Error(trans.error());\n }\n}\nvar registerInvalidTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 });\n};\n\n/**\n * @coreapi\n * @module transition\n */\n/** for typedoc */\n/**\n * The default [[Transition]] options.\n *\n * Include this object when applying custom defaults:\n * let reloadOpts = { reload: true, notify: true }\n * let options = defaults(theirOpts, customDefaults, defaultOptions);\n */\nvar defaultTransOpts = {\n location: true,\n relative: null,\n inherit: false,\n notify: true,\n reload: false,\n custom: {},\n current: function () { return null; },\n source: 'unknown',\n};\n/**\n * This class provides services related to Transitions.\n *\n * - Most importantly, it allows global Transition Hooks to be registered.\n * - It allows the default transition error handler to be set.\n * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).\n *\n * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.\n */\nvar TransitionService = /** @class */ (function () {\n /** @hidden */\n function TransitionService(_router) {\n /** @hidden */\n this._transitionCount = 0;\n /** @hidden The transition hook types, such as `onEnter`, `onStart`, etc */\n this._eventTypes = [];\n /** @hidden The registered transition hooks */\n this._registeredHooks = {};\n /** @hidden The paths on a criteria object */\n this._criteriaPaths = {};\n this._router = _router;\n this.$view = _router.viewService;\n this._deregisterHookFns = {};\n this._pluginapi = createProxyFunctions(val(this), {}, val(this), [\n '_definePathType',\n '_defineEvent',\n '_getPathTypes',\n '_getEvents',\n 'getHooks',\n ]);\n this._defineCorePaths();\n this._defineCoreEvents();\n this._registerCoreTransitionHooks();\n _router.globals.successfulTransitions.onEvict(treeChangesCleanup);\n }\n /**\n * Registers a [[TransitionHookFn]], called *while a transition is being constructed*.\n *\n * Registers a transition lifecycle hook, which is invoked during transition construction.\n *\n * This low level hook should only be used by plugins.\n * This can be a useful time for plugins to add resolves or mutate the transition as needed.\n * The Sticky States plugin uses this hook to modify the treechanges.\n *\n * ### Lifecycle\n *\n * `onCreate` hooks are invoked *while a transition is being constructed*.\n *\n * ### Return value\n *\n * The hook's return value is ignored\n *\n * @internalapi\n * @param criteria defines which Transitions the Hook should be invoked for.\n * @param callback the hook function which will be invoked.\n * @param options the registration options\n * @returns a function which deregisters the hook.\n */\n TransitionService.prototype.onCreate = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onBefore = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onStart = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onExit = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onRetain = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onEnter = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onFinish = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onSuccess = function (criteria, callback, options) { return; };\n /** @inheritdoc */\n TransitionService.prototype.onError = function (criteria, callback, options) { return; };\n /**\n * dispose\n * @internalapi\n */\n TransitionService.prototype.dispose = function (router) {\n values(this._registeredHooks).forEach(function (hooksArray) { return hooksArray.forEach(function (hook) {\n hook._deregistered = true;\n removeFrom(hooksArray, hook);\n }); });\n };\n /**\n * Creates a new [[Transition]] object\n *\n * This is a factory function for creating new Transition objects.\n * It is used internally by the [[StateService]] and should generally not be called by application code.\n *\n * @param fromPath the path to the current state (the from state)\n * @param targetState the target state (destination)\n * @returns a Transition\n */\n TransitionService.prototype.create = function (fromPath, targetState) {\n return new Transition(fromPath, targetState, this._router);\n };\n /** @hidden */\n TransitionService.prototype._defineCoreEvents = function () {\n var Phase = exports.TransitionHookPhase;\n var TH = TransitionHook;\n var paths = this._criteriaPaths;\n var NORMAL_SORT = false, REVERSE_SORT = true;\n var SYNCHRONOUS = true;\n this._defineEvent('onCreate', Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS);\n this._defineEvent('onBefore', Phase.BEFORE, 0, paths.to);\n this._defineEvent('onStart', Phase.RUN, 0, paths.to);\n this._defineEvent('onExit', Phase.RUN, 100, paths.exiting, REVERSE_SORT);\n this._defineEvent('onRetain', Phase.RUN, 200, paths.retained);\n this._defineEvent('onEnter', Phase.RUN, 300, paths.entering);\n this._defineEvent('onFinish', Phase.RUN, 400, paths.to);\n this._defineEvent('onSuccess', Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n this._defineEvent('onError', Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n };\n /** @hidden */\n TransitionService.prototype._defineCorePaths = function () {\n var STATE = exports.TransitionHookScope.STATE, TRANSITION = exports.TransitionHookScope.TRANSITION;\n this._definePathType('to', TRANSITION);\n this._definePathType('from', TRANSITION);\n this._definePathType('exiting', STATE);\n this._definePathType('retained', STATE);\n this._definePathType('entering', STATE);\n };\n /** @hidden */\n TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) { reverseSort = false; }\n if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; }\n if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; }\n if (synchronous === void 0) { synchronous = false; }\n var eventType = new TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous);\n this._eventTypes.push(eventType);\n makeEvent(this, this, eventType);\n };\n /** @hidden */ // tslint:disable-next-line\n TransitionService.prototype._getEvents = function (phase) {\n var transitionHookTypes = isDefined(phase) ?\n this._eventTypes.filter(function (type) { return type.hookPhase === phase; }) :\n this._eventTypes.slice();\n return transitionHookTypes.sort(function (l, r) {\n var cmpByPhase = l.hookPhase - r.hookPhase;\n return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase;\n });\n };\n /**\n * Adds a Path to be used as a criterion against a TreeChanges path\n *\n * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.\n * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`\n * Each state in the exiting path is checked against the criteria and returned as part of the match.\n *\n * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.\n * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`\n * Only the tail of the `to` path is checked against the criteria and returned as part of the match.\n *\n * @hidden\n */\n TransitionService.prototype._definePathType = function (name, hookScope) {\n this._criteriaPaths[name] = { name: name, scope: hookScope };\n };\n /** * @hidden */ // tslint:disable-next-line\n TransitionService.prototype._getPathTypes = function () {\n return this._criteriaPaths;\n };\n /** @hidden */\n TransitionService.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n /** @hidden */\n TransitionService.prototype._registerCoreTransitionHooks = function () {\n var fns = this._deregisterHookFns;\n fns.addCoreResolves = registerAddCoreResolvables(this);\n fns.ignored = registerIgnoredTransitionHook(this);\n fns.invalid = registerInvalidTransitionHook(this);\n // Wire up redirectTo hook\n fns.redirectTo = registerRedirectToHook(this);\n // Wire up onExit/Retain/Enter state hooks\n fns.onExit = registerOnExitHook(this);\n fns.onRetain = registerOnRetainHook(this);\n fns.onEnter = registerOnEnterHook(this);\n // Wire up Resolve hooks\n fns.eagerResolve = registerEagerResolvePath(this);\n fns.lazyResolve = registerLazyResolveState(this);\n fns.resolveAll = registerResolveRemaining(this);\n // Wire up the View management hooks\n fns.loadViews = registerLoadEnteringViews(this);\n fns.activateViews = registerActivateViews(this);\n // Updates global state after a transition\n fns.updateGlobals = registerUpdateGlobalState(this);\n // After globals.current is updated at priority: 10000\n fns.updateUrl = registerUpdateUrl(this);\n // Lazy load state trees\n fns.lazyLoad = registerLazyLoadHook(this);\n };\n return TransitionService;\n}());\n\n/**\n * @coreapi\n * @module state\n */\n/** */\n/**\n * Provides state related service functions\n *\n * This class provides services related to ui-router states.\n * An instance of this class is located on the global [[UIRouter]] object.\n */\nvar StateService = /** @class */ (function () {\n /** @internalapi */\n function StateService(router) {\n this.router = router;\n /** @internalapi */\n this.invalidCallbacks = [];\n /** @hidden */\n this._defaultErrorHandler = function $defaultErrorHandler($error$) {\n if ($error$ instanceof Error && $error$.stack) {\n console.error($error$);\n console.error($error$.stack);\n }\n else if ($error$ instanceof Rejection) {\n console.error($error$.toString());\n if ($error$.detail && $error$.detail.stack)\n console.error($error$.detail.stack);\n }\n else {\n console.error($error$);\n }\n };\n var getters = ['current', '$current', 'params', 'transition'];\n var boundFns = Object.keys(StateService.prototype).filter(not(inArray(getters)));\n createProxyFunctions(val(StateService.prototype), this, val(this), boundFns);\n }\n Object.defineProperty(StateService.prototype, \"transition\", {\n /**\n * The [[Transition]] currently in progress (or null)\n *\n * This is a passthrough through to [[UIRouterGlobals.transition]]\n */\n get: function () { return this.router.globals.transition; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"params\", {\n /**\n * The latest successful state parameters\n *\n * This is a passthrough through to [[UIRouterGlobals.params]]\n */\n get: function () { return this.router.globals.params; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"current\", {\n /**\n * The current [[StateDeclaration]]\n *\n * This is a passthrough through to [[UIRouterGlobals.current]]\n */\n get: function () { return this.router.globals.current; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"$current\", {\n /**\n * The current [[StateObject]]\n *\n * This is a passthrough through to [[UIRouterGlobals.$current]]\n */\n get: function () { return this.router.globals.$current; },\n enumerable: true,\n configurable: true\n });\n /** @internalapi */\n StateService.prototype.dispose = function () {\n this.defaultErrorHandler(noop);\n this.invalidCallbacks = [];\n };\n /**\n * Handler for when [[transitionTo]] is called with an invalid state.\n *\n * Invokes the [[onInvalid]] callbacks, in natural order.\n * Each callback's return value is checked in sequence until one of them returns an instance of TargetState.\n * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises.\n *\n * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned.\n *\n * @internalapi\n */\n StateService.prototype._handleInvalidTargetState = function (fromPath, toState) {\n var _this = this;\n var fromState = PathUtils.makeTargetState(this.router.stateRegistry, fromPath);\n var globals = this.router.globals;\n var latestThing = function () { return globals.transitionHistory.peekTail(); };\n var latest = latestThing();\n var callbackQueue = new Queue(this.invalidCallbacks.slice());\n var injector = new ResolveContext(fromPath).injector();\n var checkForRedirect = function (result) {\n if (!(result instanceof TargetState)) {\n return;\n }\n var target = result;\n // Recreate the TargetState, in case the state is now defined.\n target = _this.target(target.identifier(), target.params(), target.options());\n if (!target.valid()) {\n return Rejection.invalid(target.error()).toPromise();\n }\n if (latestThing() !== latest) {\n return Rejection.superseded().toPromise();\n }\n return _this.transitionTo(target.identifier(), target.params(), target.options());\n };\n function invokeNextCallback() {\n var nextCallback = callbackQueue.dequeue();\n if (nextCallback === undefined)\n return Rejection.invalid(toState.error()).toPromise();\n var callbackResult = services.$q.when(nextCallback(toState, fromState, injector));\n return callbackResult.then(checkForRedirect).then(function (result) { return result || invokeNextCallback(); });\n }\n return invokeNextCallback();\n };\n /**\n * Registers an Invalid State handler\n *\n * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]]\n * has been called with an invalid state reference parameter\n *\n * Example:\n * ```js\n * stateService.onInvalid(function(to, from, injector) {\n * if (to.name() === 'foo') {\n * let lazyLoader = injector.get('LazyLoadService');\n * return lazyLoader.load('foo')\n * .then(() => stateService.target('foo'));\n * }\n * });\n * ```\n *\n * @param {function} callback invoked when the toState is invalid\n * This function receives the (invalid) toState, the fromState, and an injector.\n * The function may optionally return a [[TargetState]] or a Promise for a TargetState.\n * If one is returned, it is treated as a redirect.\n *\n * @returns a function which deregisters the callback\n */\n StateService.prototype.onInvalid = function (callback) {\n this.invalidCallbacks.push(callback);\n return function deregisterListener() {\n removeFrom(this.invalidCallbacks)(callback);\n }.bind(this);\n };\n /**\n * Reloads the current state\n *\n * A method that force reloads the current state, or a partial state hierarchy.\n * All resolves are re-resolved, and components reinstantiated.\n *\n * #### Example:\n * ```js\n * let app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * $state.reload();\n * }\n * });\n * ```\n *\n * Note: `reload()` is just an alias for:\n *\n * ```js\n * $state.transitionTo($state.current, $state.params, {\n * reload: true, inherit: false\n * });\n * ```\n *\n * @param reloadState A state name or a state object.\n * If present, this state and all its children will be reloaded, but ancestors will not reload.\n *\n * #### Example:\n * ```js\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item'\n * //and current state is 'contacts.detail.item'\n * let app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * //will reload 'contact.detail' and nested 'contact.detail.item' states\n * $state.reload('contact.detail');\n * }\n * });\n * ```\n *\n * @returns A promise representing the state of the new transition. See [[StateService.go]]\n */\n StateService.prototype.reload = function (reloadState) {\n return this.transitionTo(this.current, this.params, {\n reload: isDefined(reloadState) ? reloadState : true,\n inherit: false,\n notify: false,\n });\n };\n /**\n * Transition to a different state and/or parameters\n *\n * Convenience method for transitioning to a new state.\n *\n * `$state.go` calls `$state.transitionTo` internally but automatically sets options to\n * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`.\n * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`).\n * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters\n * inherit from the current parameter values (because of `inherit: true`).\n *\n * #### Example:\n * ```js\n * let 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 * ```\n *\n * @param to Absolute state name, state object, or relative state path (relative to current state).\n *\n * Some examples:\n *\n * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n * - `$state.go('^')` - will go to the parent state\n * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state\n * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state\n *\n * @param params A map of the parameters that will be sent to the state, will populate $stateParams.\n *\n * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`).\n * This allows, for example, going to a sibling state that shares parameters defined by a parent state.\n *\n * @param options Transition options\n *\n * @returns {promise} A promise representing the state of the new transition.\n */\n StateService.prototype.go = function (to, params, options) {\n var defautGoOpts = { relative: this.$current, inherit: true };\n var transOpts = defaults(options, defautGoOpts, defaultTransOpts);\n return this.transitionTo(to, params, transOpts);\n };\n /**\n * Creates a [[TargetState]]\n *\n * This is a factory method for creating a TargetState\n *\n * This may be returned from a Transition Hook to redirect a transition, for example.\n */\n StateService.prototype.target = function (identifier, params, options) {\n if (options === void 0) { options = {}; }\n // If we're reloading, find the state object to reload from\n if (isObject(options.reload) && !options.reload.name)\n throw new Error('Invalid reload state object');\n var reg = this.router.stateRegistry;\n options.reloadState = options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative);\n if (options.reload && !options.reloadState)\n throw new Error(\"No such reload state '\" + (isString(options.reload) ? options.reload : options.reload.name) + \"'\");\n return new TargetState(this.router.stateRegistry, identifier, params, options);\n };\n StateService.prototype.getCurrentPath = function () {\n var _this = this;\n var globals = this.router.globals;\n var latestSuccess = globals.successfulTransitions.peekTail();\n var rootPath = function () { return [new PathNode(_this.router.stateRegistry.root())]; };\n return latestSuccess ? latestSuccess.treeChanges().to : rootPath();\n };\n /**\n * Low-level method for transitioning to a new state.\n *\n * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations.\n *\n * #### Example:\n * ```js\n * let 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 * ```\n *\n * @param to State name or state object.\n * @param toParams A map of the parameters that will be sent to the state,\n * will populate $stateParams.\n * @param options Transition options\n *\n * @returns A promise representing the state of the new transition. See [[go]]\n */\n StateService.prototype.transitionTo = function (to, toParams, options) {\n var _this = this;\n if (toParams === void 0) { toParams = {}; }\n if (options === void 0) { options = {}; }\n var router = this.router;\n var globals = router.globals;\n options = defaults(options, defaultTransOpts);\n var getCurrent = function () {\n return globals.transition;\n };\n options = extend(options, { current: getCurrent });\n var ref = this.target(to, toParams, options);\n var currentPath = this.getCurrentPath();\n if (!ref.exists())\n return this._handleInvalidTargetState(currentPath, ref);\n if (!ref.valid())\n return silentRejection(ref.error());\n /**\n * Special handling for Ignored, Aborted, and Redirected transitions\n *\n * The semantics for the transition.run() promise and the StateService.transitionTo()\n * promise differ. For instance, the run() promise may be rejected because it was\n * IGNORED, but the transitionTo() promise is resolved because from the user perspective\n * no error occurred. Likewise, the transition.run() promise may be rejected because of\n * a Redirect, but the transitionTo() promise is chained to the new Transition's promise.\n */\n var rejectedTransitionHandler = function (trans) { return function (error) {\n if (error instanceof Rejection) {\n var isLatest = router.globals.lastStartedTransitionId === trans.$id;\n if (error.type === exports.RejectType.IGNORED) {\n isLatest && router.urlRouter.update();\n // Consider ignored `Transition.run()` as a successful `transitionTo`\n return services.$q.when(globals.current);\n }\n var detail = error.detail;\n if (error.type === exports.RejectType.SUPERSEDED && error.redirected && detail instanceof TargetState) {\n // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully\n // by returning the promise for the new (redirect) `Transition.run()`.\n var redirect = trans.redirect(detail);\n return redirect.run().catch(rejectedTransitionHandler(redirect));\n }\n if (error.type === exports.RejectType.ABORTED) {\n isLatest && router.urlRouter.update();\n return services.$q.reject(error);\n }\n }\n var errorHandler = _this.defaultErrorHandler();\n errorHandler(error);\n return services.$q.reject(error);\n }; };\n var transition = this.router.transitionService.create(currentPath, ref);\n var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition));\n silenceUncaughtInPromise(transitionToPromise); // issue #2676\n // Return a promise for the transition, which also has the transition object on it.\n return extend(transitionToPromise, { transition: transition });\n };\n /**\n * Checks if the current state *is* the provided state\n *\n * Similar to [[includes]] but only checks for the full state name.\n * If params is supplied then it will be tested for strict equality against the current\n * active params object, so all params must match with none missing and no extras.\n *\n * #### Example:\n * ```js\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 *\n * // relative name (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * ```html\n *
Item
\n * ```\n *\n * @param stateOrName The state name (absolute or relative) or state object you'd like to check.\n * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like\n * to test against the current active state.\n * @param options An options object. The options are:\n * - `relative`: 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 Returns true if it is the state.\n */\n StateService.prototype.is = function (stateOrName, params, options) {\n options = defaults(options, { relative: this.$current });\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!isDefined(state))\n return undefined;\n if (this.$current !== state)\n return false;\n if (!params)\n return true;\n var schema = state.parameters({ inherit: true, matchingKeys: params });\n return Param.equals(schema, Param.values(schema, params), this.params);\n };\n /**\n * Checks if the current state *includes* the provided state\n *\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 when `$state.$current.name === 'contacts.details.item'`\n * ```js\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 *\n * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`:\n * ```js\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 * ```\n *\n * @param stateOrName A partial name, relative name, glob pattern,\n * or state object to be searched for within the current state name.\n * @param params A param object, e.g. `{sectionId: section.id}`,\n * that you'd like to test against the current active state.\n * @param options An options object. The options are:\n * - `relative`: 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 does include the state\n */\n StateService.prototype.includes = function (stateOrName, params, options) {\n options = defaults(options, { relative: this.$current });\n var glob = isString(stateOrName) && Glob.fromString(stateOrName);\n if (glob) {\n if (!glob.matches(this.$current.name))\n return false;\n stateOrName = this.$current.name;\n }\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes;\n if (!isDefined(state))\n return undefined;\n if (!isDefined(include[state.name]))\n return false;\n if (!params)\n return true;\n var schema = state.parameters({ inherit: true, matchingKeys: params });\n return Param.equals(schema, Param.values(schema, params), this.params);\n };\n /**\n * Generates a URL for a state and parameters\n *\n * Returns the url for the given state populated with the given params.\n *\n * #### Example:\n * ```js\n * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n * ```\n *\n * @param stateOrName The state name or state object you'd like to generate a url from.\n * @param params An object of parameter values to fill the state's required parameters.\n * @param options Options object. The options are:\n *\n * @returns {string} compiled state url\n */\n StateService.prototype.href = function (stateOrName, params, options) {\n var defaultHrefOpts = {\n lossy: true,\n inherit: true,\n absolute: false,\n relative: this.$current,\n };\n options = defaults(options, defaultHrefOpts);\n params = params || {};\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!isDefined(state))\n return null;\n if (options.inherit)\n params = this.params.$inherit(params, this.$current, state);\n var nav = (state && options.lossy) ? state.navigable : state;\n if (!nav || nav.url === undefined || nav.url === null) {\n return null;\n }\n return this.router.urlRouter.href(nav.url, params, {\n absolute: options.absolute,\n });\n };\n /**\n * Sets or gets the default [[transitionTo]] error handler.\n *\n * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition.\n * This includes errors caused by resolves and transition hooks.\n *\n * Note:\n * This handler does not receive certain Transition rejections.\n * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]].\n *\n * The built-in default error handler logs the error to the console.\n *\n * You can provide your own custom handler.\n *\n * #### Example:\n * ```js\n * stateService.defaultErrorHandler(function() {\n * // Do not log transitionTo errors\n * });\n * ```\n *\n * @param handler a global error handler function\n * @returns the current global error handler\n */\n StateService.prototype.defaultErrorHandler = function (handler) {\n return this._defaultErrorHandler = handler || this._defaultErrorHandler;\n };\n StateService.prototype.get = function (stateOrName, base) {\n var reg = this.router.stateRegistry;\n if (arguments.length === 0)\n return reg.get();\n return reg.get(stateOrName, base || this.$current);\n };\n /**\n * Lazy loads a state\n *\n * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function.\n *\n * @param stateOrName the state that should be lazy loaded\n * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc)\n * Note: If no transition is provided, a noop transition is created using the from the current state to the current state.\n * This noop transition is not actually run.\n *\n * @returns a promise to lazy load\n */\n StateService.prototype.lazyLoad = function (stateOrName, transition) {\n var state = this.get(stateOrName);\n if (!state || !state.lazyLoad)\n throw new Error('Can not lazy load ' + stateOrName);\n var currentPath = this.getCurrentPath();\n var target = PathUtils.makeTargetState(this.router.stateRegistry, currentPath);\n transition = transition || this.router.transitionService.create(currentPath, target);\n return lazyLoadState(transition, state);\n };\n return StateService;\n}());\n\n/**\n * # Transition subsystem\n *\n * This module contains APIs related to a Transition.\n *\n * See:\n * - [[TransitionService]]\n * - [[Transition]]\n * - [[HookFn]], [[TransitionHookFn]], [[TransitionStateHookFn]], [[HookMatchCriteria]], [[HookResult]]\n *\n * @coreapi\n * @preferred\n * @module transition\n */ /** for typedoc */\n\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\n/**\n * An angular1-like promise api\n *\n * This object implements four methods similar to the\n * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q)\n *\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\n *\n * This API provides native ES6 promise support wrapped as a $q-like API.\n * Internally, UI-Router uses this $q object to perform promise operations.\n * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular.\n *\n * $q-like promise api\n */\nvar $q = {\n /** Normalizes a value as a promise */\n when: function (val) { return new Promise(function (resolve, reject) { return resolve(val); }); },\n /** Normalizes a value as a promise rejection */\n reject: function (val) { return new Promise(function (resolve, reject) { reject(val); }); },\n /** @returns a deferred object, which has `resolve` and `reject` functions */\n defer: function () {\n var deferred = {};\n deferred.promise = new Promise(function (resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n return deferred;\n },\n /** Like Promise.all(), but also supports object key/promise notation like $q */\n all: function (promises) {\n if (isArray(promises)) {\n return Promise.all(promises);\n }\n if (isObject(promises)) {\n // Convert promises map to promises array.\n // When each promise resolves, map it to a tuple { key: key, val: val }\n var chain = Object.keys(promises)\n .map(function (key) { return promises[key].then(function (val) { return ({ key: key, val: val }); }); });\n // Then wait for all promises to resolve, and convert them back to an object\n return $q.all(chain).then(function (values) {\n return values.reduce(function (acc, tuple) { acc[tuple.key] = tuple.val; return acc; }, {});\n });\n }\n },\n};\n\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\n// globally available injectables\nvar globals = {};\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar ARGUMENT_NAMES = /([^\\s,]+)/g;\n/**\n * A basic angular1-like injector api\n *\n * This object implements four methods similar to the\n * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector)\n *\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\n *\n * This object provides a naive implementation of a globally scoped dependency injection system.\n * It supports the following DI approaches:\n *\n * ### Function parameter names\n *\n * A function's `.toString()` is called, and the parameter names are parsed.\n * This only works when the parameter names aren't \"mangled\" by a minifier such as UglifyJS.\n *\n * ```js\n * function injectedFunction(FooService, BarService) {\n * // FooService and BarService are injected\n * }\n * ```\n *\n * ### Function annotation\n *\n * A function may be annotated with an array of dependency names as the `$inject` property.\n *\n * ```js\n * injectedFunction.$inject = [ 'FooService', 'BarService' ];\n * function injectedFunction(fs, bs) {\n * // FooService and BarService are injected as fs and bs parameters\n * }\n * ```\n *\n * ### Array notation\n *\n * An array provides the names of the dependencies to inject (as strings).\n * The function is the last element of the array.\n *\n * ```js\n * [ 'FooService', 'BarService', function (fs, bs) {\n * // FooService and BarService are injected as fs and bs parameters\n * }]\n * ```\n *\n * @type {$InjectorLike}\n */\nvar $injector = {\n /** Gets an object from DI based on a string token */\n get: function (name) { return globals[name]; },\n /** Returns true if an object named `name` exists in global DI */\n has: function (name) { return $injector.get(name) != null; },\n /**\n * Injects a function\n *\n * @param fn the function to inject\n * @param context the function's `this` binding\n * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }`\n */\n invoke: function (fn, context, locals) {\n var all = extend({}, globals, locals || {});\n var params = $injector.annotate(fn);\n var ensureExist = assertPredicate(function (key) { return all.hasOwnProperty(key); }, function (key) { return \"DI can't find injectable: '\" + key + \"'\"; });\n var args = params.filter(ensureExist).map(function (x) { return all[x]; });\n if (isFunction(fn))\n return fn.apply(context, args);\n else\n return fn.slice(-1)[0].apply(context, args);\n },\n /**\n * Returns a function's dependencies\n *\n * Analyzes a function (or array) and returns an array of DI tokens that the function requires.\n * @return an array of `string`s\n */\n annotate: function (fn) {\n if (!isInjectable(fn))\n throw new Error(\"Not an injectable function: \" + fn);\n if (fn && fn.$inject)\n return fn.$inject;\n if (isArray(fn))\n return fn.slice(0, -1);\n var fnStr = fn.toString().replace(STRIP_COMMENTS, '');\n var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES);\n return result || [];\n },\n};\n\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\nvar keyValsToObjectR = function (accum, _a) {\n var key = _a[0], val = _a[1];\n if (!accum.hasOwnProperty(key)) {\n accum[key] = val;\n }\n else if (isArray(accum[key])) {\n accum[key].push(val);\n }\n else {\n accum[key] = [accum[key], val];\n }\n return accum;\n};\nvar getParams = function (queryString) {\n return queryString.split('&').filter(identity).map(splitEqual).reduce(keyValsToObjectR, {});\n};\nfunction parseUrl$1(url) {\n var orEmptyString = function (x) { return x || ''; };\n var _a = splitHash(url).map(orEmptyString), beforehash = _a[0], hash = _a[1];\n var _b = splitQuery(beforehash).map(orEmptyString), path = _b[0], search = _b[1];\n return { path: path, search: search, hash: hash, url: url };\n}\nvar buildUrl = function (loc) {\n var path = loc.path();\n var searchObject = loc.search();\n var hash = loc.hash();\n var search = Object.keys(searchObject).map(function (key) {\n var param = searchObject[key];\n var vals = isArray(param) ? param : [param];\n return vals.map(function (val) { return key + '=' + val; });\n }).reduce(unnestR, []).join('&');\n return path + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n};\nfunction locationPluginFactory(name, isHtml5, serviceClass, configurationClass) {\n return function (uiRouter) {\n var service = uiRouter.locationService = new serviceClass(uiRouter);\n var configuration = uiRouter.locationConfig = new configurationClass(uiRouter, isHtml5);\n function dispose(router) {\n router.dispose(service);\n router.dispose(configuration);\n }\n return { name: name, service: service, configuration: configuration, dispose: dispose };\n };\n}\n\n/**\n * @internalapi\n * @module vanilla\n */ /** */\n/** A base `LocationServices` */\nvar BaseLocationServices = /** @class */ (function () {\n function BaseLocationServices(router, fireAfterUpdate) {\n var _this = this;\n this.fireAfterUpdate = fireAfterUpdate;\n this._listeners = [];\n this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); };\n this.hash = function () { return parseUrl$1(_this._get()).hash; };\n this.path = function () { return parseUrl$1(_this._get()).path; };\n this.search = function () { return getParams(parseUrl$1(_this._get()).search); };\n this._location = root.location;\n this._history = root.history;\n }\n BaseLocationServices.prototype.url = function (url, replace) {\n if (replace === void 0) { replace = true; }\n if (isDefined(url) && url !== this._get()) {\n this._set(null, null, url, replace);\n if (this.fireAfterUpdate) {\n this._listeners.forEach(function (cb) { return cb({ url: url }); });\n }\n }\n return buildUrl(this);\n };\n BaseLocationServices.prototype.onChange = function (cb) {\n var _this = this;\n this._listeners.push(cb);\n return function () { return removeFrom(_this._listeners, cb); };\n };\n BaseLocationServices.prototype.dispose = function (router) {\n deregAll(this._listeners);\n };\n return BaseLocationServices;\n}());\n\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\n/** A `LocationServices` that uses the browser hash \"#\" to get/set the current location */\nvar HashLocationService = /** @class */ (function (_super) {\n __extends(HashLocationService, _super);\n function HashLocationService(router) {\n var _this = _super.call(this, router, false) || this;\n root.addEventListener('hashchange', _this._listener, false);\n return _this;\n }\n HashLocationService.prototype._get = function () {\n return trimHashVal(this._location.hash);\n };\n HashLocationService.prototype._set = function (state, title, url, replace) {\n this._location.hash = url;\n };\n HashLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n root.removeEventListener('hashchange', this._listener);\n };\n return HashLocationService;\n}(BaseLocationServices));\n\nvar __extends$1 = (undefined && undefined.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\n/** A `LocationServices` that gets/sets the current location from an in-memory object */\nvar MemoryLocationService = /** @class */ (function (_super) {\n __extends$1(MemoryLocationService, _super);\n function MemoryLocationService(router) {\n return _super.call(this, router, true) || this;\n }\n MemoryLocationService.prototype._get = function () {\n return this._url;\n };\n MemoryLocationService.prototype._set = function (state, title, url, replace) {\n this._url = url;\n };\n return MemoryLocationService;\n}(BaseLocationServices));\n\nvar __extends$2 = (undefined && undefined.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis\n *\n * Uses `history.pushState` and `history.replaceState`\n */\nvar PushStateLocationService = /** @class */ (function (_super) {\n __extends$2(PushStateLocationService, _super);\n function PushStateLocationService(router) {\n var _this = _super.call(this, router, true) || this;\n _this._config = router.urlService.config;\n root.addEventListener('popstate', _this._listener, false);\n return _this;\n }\n /**\n * Gets the base prefix without:\n * - trailing slash\n * - trailing filename\n * - protocol and hostname\n *\n * If , this returns '/base'.\n * If , this returns '/foo/base'.\n * If , this returns '/base'.\n * If , this returns '/base'.\n * If , this returns ''.\n * If , this returns ''.\n * If , this returns ''.\n *\n * See: https://html.spec.whatwg.org/dev/semantics.html#the-base-element\n */\n PushStateLocationService.prototype._getBasePrefix = function () {\n return stripLastPathElement(this._config.baseHref());\n };\n PushStateLocationService.prototype._get = function () {\n var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search;\n search = splitQuery(search)[1]; // strip ? if found\n hash = splitHash(hash)[1]; // strip # if found\n var basePrefix = this._getBasePrefix();\n var exactBaseHrefMatch = pathname === this._config.baseHref();\n var startsWithBase = pathname.substr(0, basePrefix.length) === basePrefix;\n pathname = exactBaseHrefMatch ? '/' : startsWithBase ? pathname.substring(basePrefix.length) : pathname;\n return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n };\n PushStateLocationService.prototype._set = function (state, title, url, replace) {\n var basePrefix = this._getBasePrefix();\n var slash = url && url[0] !== '/' ? '/' : '';\n var fullUrl = (url === '' || url === '/') ? this._config.baseHref() : basePrefix + slash + url;\n if (replace) {\n this._history.replaceState(state, title, fullUrl);\n }\n else {\n this._history.pushState(state, title, fullUrl);\n }\n };\n PushStateLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n root.removeEventListener('popstate', this._listener);\n };\n return PushStateLocationService;\n}(BaseLocationServices));\n\n/** A `LocationConfig` mock that gets/sets all config from an in-memory object */\nvar MemoryLocationConfig = /** @class */ (function () {\n function MemoryLocationConfig() {\n var _this = this;\n this.dispose = noop;\n this._baseHref = '';\n this._port = 80;\n this._protocol = 'http';\n this._host = 'localhost';\n this._hashPrefix = '';\n this.port = function () { return _this._port; };\n this.protocol = function () { return _this._protocol; };\n this.host = function () { return _this._host; };\n this.baseHref = function () { return _this._baseHref; };\n this.html5Mode = function () { return false; };\n this.hashPrefix = function (newval) { return isDefined(newval) ? _this._hashPrefix = newval : _this._hashPrefix; };\n }\n return MemoryLocationConfig;\n}());\n\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\n/** A `LocationConfig` that delegates to the browser's `location` object */\nvar BrowserLocationConfig = /** @class */ (function () {\n function BrowserLocationConfig(router, _isHtml5) {\n if (_isHtml5 === void 0) { _isHtml5 = false; }\n this._isHtml5 = _isHtml5;\n this._baseHref = undefined;\n this._hashPrefix = '';\n }\n BrowserLocationConfig.prototype.port = function () {\n if (location.port) {\n return Number(location.port);\n }\n return this.protocol() === 'https' ? 443 : 80;\n };\n BrowserLocationConfig.prototype.protocol = function () {\n return location.protocol.replace(/:/g, '');\n };\n BrowserLocationConfig.prototype.host = function () {\n return location.hostname;\n };\n BrowserLocationConfig.prototype.html5Mode = function () {\n return this._isHtml5;\n };\n BrowserLocationConfig.prototype.hashPrefix = function (newprefix) {\n return isDefined(newprefix) ? this._hashPrefix = newprefix : this._hashPrefix;\n };\n BrowserLocationConfig.prototype.baseHref = function (href) {\n return isDefined(href) ? this._baseHref = href :\n isDefined(this._baseHref) ? this._baseHref : this.applyDocumentBaseHref();\n };\n BrowserLocationConfig.prototype.applyDocumentBaseHref = function () {\n var baseTag = document.getElementsByTagName('base')[0];\n return this._baseHref = baseTag ? baseTag.href.substr(location.origin.length) : location.pathname || '/';\n };\n BrowserLocationConfig.prototype.dispose = function () { };\n return BrowserLocationConfig;\n}());\n\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\nfunction servicesPlugin(router) {\n services.$injector = $injector;\n services.$q = $q;\n return { name: 'vanilla.services', $q: $q, $injector: $injector, dispose: function () { return null; } };\n}\n/** A `UIRouterPlugin` uses the browser hash to get/set the current location */\nvar hashLocationPlugin = locationPluginFactory('vanilla.hashBangLocation', false, HashLocationService, BrowserLocationConfig);\n/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */\nvar pushStateLocationPlugin = locationPluginFactory('vanilla.pushStateLocation', true, PushStateLocationService, BrowserLocationConfig);\n/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */\nvar memoryLocationPlugin = locationPluginFactory('vanilla.memoryLocation', false, MemoryLocationService, MemoryLocationConfig);\n\n/**\n * @internalapi\n * @module vanilla\n */\n/** */\n\n/**\n * # Core classes and interfaces\n *\n * The classes and interfaces that are core to ui-router and do not belong\n * to a more specific subsystem (such as resolve).\n *\n * @coreapi\n * @preferred\n * @module core\n */ /** for typedoc */\n/** @internalapi */\nvar UIRouterPluginBase = /** @class */ (function () {\n function UIRouterPluginBase() {\n }\n UIRouterPluginBase.prototype.dispose = function (router) { };\n return UIRouterPluginBase;\n}());\n\n/**\n * @coreapi\n * @module common\n */ /** */\n\n\n\nvar index = Object.freeze({\n\troot: root,\n\tfromJson: fromJson,\n\ttoJson: toJson,\n\tforEach: forEach,\n\textend: extend,\n\tequals: equals,\n\tidentity: identity,\n\tnoop: noop,\n\tcreateProxyFunctions: createProxyFunctions,\n\tinherit: inherit,\n\tinArray: inArray,\n\t_inArray: _inArray,\n\tremoveFrom: removeFrom,\n\t_removeFrom: _removeFrom,\n\tpushTo: pushTo,\n\t_pushTo: _pushTo,\n\tderegAll: deregAll,\n\tdefaults: defaults,\n\tmergeR: mergeR,\n\tancestors: ancestors,\n\tpick: pick,\n\tomit: omit,\n\tpluck: pluck,\n\tfilter: filter,\n\tfind: find,\n\tmapObj: mapObj,\n\tmap: map,\n\tvalues: values,\n\tallTrueR: allTrueR,\n\tanyTrueR: anyTrueR,\n\tunnestR: unnestR,\n\tflattenR: flattenR,\n\tpushR: pushR,\n\tuniqR: uniqR,\n\tunnest: unnest,\n\tflatten: flatten,\n\tassertPredicate: assertPredicate,\n\tassertMap: assertMap,\n\tassertFn: assertFn,\n\tpairs: pairs,\n\tarrayTuples: arrayTuples,\n\tapplyPairs: applyPairs,\n\ttail: tail,\n\tcopy: copy,\n\t_extend: _extend,\n\tsilenceUncaughtInPromise: silenceUncaughtInPromise,\n\tsilentRejection: silentRejection,\n\tnotImplemented: notImplemented,\n\tservices: services,\n\tGlob: Glob,\n\tcurry: curry,\n\tcompose: compose,\n\tpipe: pipe,\n\tprop: prop,\n\tpropEq: propEq,\n\tparse: parse,\n\tnot: not,\n\tand: and,\n\tor: or,\n\tall: all,\n\tany: any,\n\tis: is,\n\teq: eq,\n\tval: val,\n\tinvoke: invoke,\n\tpattern: pattern,\n\tisUndefined: isUndefined,\n\tisDefined: isDefined,\n\tisNull: isNull,\n\tisNullOrUndefined: isNullOrUndefined,\n\tisFunction: isFunction,\n\tisNumber: isNumber,\n\tisString: isString,\n\tisObject: isObject,\n\tisArray: isArray,\n\tisDate: isDate,\n\tisRegExp: isRegExp,\n\tisState: isState,\n\tisInjectable: isInjectable,\n\tisPromise: isPromise,\n\tQueue: Queue,\n\tmaxLength: maxLength,\n\tpadString: padString,\n\tkebobString: kebobString,\n\tfunctionToString: functionToString,\n\tfnToString: fnToString,\n\tstringify: stringify,\n\tbeforeAfterSubstr: beforeAfterSubstr,\n\thostRegex: hostRegex,\n\tstripLastPathElement: stripLastPathElement,\n\tsplitHash: splitHash,\n\tsplitQuery: splitQuery,\n\tsplitEqual: splitEqual,\n\ttrimHashVal: trimHashVal,\n\tsplitOnDelim: splitOnDelim,\n\tjoinNeighborsR: joinNeighborsR,\n\tget Category () { return exports.Category; },\n\tTrace: Trace,\n\ttrace: trace,\n\tget DefType () { return exports.DefType; },\n\tParam: Param,\n\tParamTypes: ParamTypes,\n\tStateParams: StateParams,\n\tParamType: ParamType,\n\tPathNode: PathNode,\n\tPathUtils: PathUtils,\n\tresolvePolicies: resolvePolicies,\n\tdefaultResolvePolicy: defaultResolvePolicy,\n\tResolvable: Resolvable,\n\tNATIVE_INJECTOR_TOKEN: NATIVE_INJECTOR_TOKEN,\n\tResolveContext: ResolveContext,\n\tresolvablesBuilder: resolvablesBuilder,\n\tStateBuilder: StateBuilder,\n\tStateObject: StateObject,\n\tStateMatcher: StateMatcher,\n\tStateQueueManager: StateQueueManager,\n\tStateRegistry: StateRegistry,\n\tStateService: StateService,\n\tTargetState: TargetState,\n\tget TransitionHookPhase () { return exports.TransitionHookPhase; },\n\tget TransitionHookScope () { return exports.TransitionHookScope; },\n\tHookBuilder: HookBuilder,\n\tmatchState: matchState,\n\tRegisteredHook: RegisteredHook,\n\tmakeEvent: makeEvent,\n\tget RejectType () { return exports.RejectType; },\n\tRejection: Rejection,\n\tTransition: Transition,\n\tTransitionHook: TransitionHook,\n\tTransitionEventType: TransitionEventType,\n\tdefaultTransOpts: defaultTransOpts,\n\tTransitionService: TransitionService,\n\tUrlMatcher: UrlMatcher,\n\tUrlMatcherFactory: UrlMatcherFactory,\n\tUrlRouter: UrlRouter,\n\tUrlRuleFactory: UrlRuleFactory,\n\tBaseUrlRule: BaseUrlRule,\n\tUrlService: UrlService,\n\tViewService: ViewService,\n\tUIRouterGlobals: UIRouterGlobals,\n\tUIRouter: UIRouter,\n\t$q: $q,\n\t$injector: $injector,\n\tBaseLocationServices: BaseLocationServices,\n\tHashLocationService: HashLocationService,\n\tMemoryLocationService: MemoryLocationService,\n\tPushStateLocationService: PushStateLocationService,\n\tMemoryLocationConfig: MemoryLocationConfig,\n\tBrowserLocationConfig: BrowserLocationConfig,\n\tkeyValsToObjectR: keyValsToObjectR,\n\tgetParams: getParams,\n\tparseUrl: parseUrl$1,\n\tbuildUrl: buildUrl,\n\tlocationPluginFactory: locationPluginFactory,\n\tservicesPlugin: servicesPlugin,\n\thashLocationPlugin: hashLocationPlugin,\n\tpushStateLocationPlugin: pushStateLocationPlugin,\n\tmemoryLocationPlugin: memoryLocationPlugin,\n\tUIRouterPluginBase: UIRouterPluginBase\n});\n\nfunction getNg1ViewConfigFactory() {\n var templateFactory = null;\n return function (path, view) {\n templateFactory = templateFactory || services.$injector.get('$templateFactory');\n return [new Ng1ViewConfig(path, view, templateFactory)];\n };\n}\nvar hasAnyKey = function (keys, obj) {\n return keys.reduce(function (acc, key) { return acc || isDefined(obj[key]); }, false);\n};\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `views`.\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * handles the `views` property with logic specific to @uirouter/angularjs (ng1).\n *\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object\n * and applies the state-level configuration to a view named `$default`.\n */\nfunction ng1ViewsBuilder(state) {\n // Do not process root state\n if (!state.parent)\n return {};\n var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);\n // Do not allow a state to have both state-level props and also a `views: {}` property.\n // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.\n // However, the `$default` approach should not be mixed with a separate `views: ` block.\n if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {\n throw new Error(\"State '\" + state.name + \"' has a 'views' object. \" +\n \"It cannot also have \\\"view properties\\\" at the state level. \" +\n \"Move the following properties into a view (in the 'views' object): \" +\n (\" \" + allViewKeys.filter(function (key) { return isDefined(state[key]); }).join(', ')));\n }\n var views = {}, viewsObject = state.views || { '$default': pick(state, allViewKeys) };\n forEach(viewsObject, function (config, name) {\n // Account for views: { \"\": { template... } }\n name = name || '$default';\n // Account for views: { header: \"headerComponent\" }\n if (isString(config))\n config = { component: config };\n // Make a shallow copy of the config object\n config = extend({}, config);\n // Do not allow a view to mix props for component-style view with props for template/controller-style view\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\n throw new Error(\"Cannot combine: \" + compKeys.join('|') + \" with: \" + nonCompKeys.join('|') + \" in stateview: '\" + name + \"@\" + state.name + \"'\");\n }\n config.resolveAs = config.resolveAs || '$resolve';\n config.$type = 'ng1';\n config.$context = state;\n config.$name = name;\n var normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\n config.$uiViewName = normalized.uiViewName;\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\n views[name] = config;\n });\n return views;\n}\nvar id$1 = 0;\nvar Ng1ViewConfig = /** @class */ (function () {\n function Ng1ViewConfig(path, viewDecl, factory) {\n var _this = this;\n this.path = path;\n this.viewDecl = viewDecl;\n this.factory = factory;\n this.$id = id$1++;\n this.loaded = false;\n this.getTemplate = function (uiView, context) {\n return _this.component ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) : _this.template;\n };\n }\n Ng1ViewConfig.prototype.load = function () {\n var _this = this;\n var $q = services.$q;\n var context = new ResolveContext(this.path);\n var params = this.path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});\n var promises = {\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\n controller: $q.when(this.getController(context)),\n };\n return $q.all(promises).then(function (results) {\n trace.traceViewServiceEvent('Loaded', _this);\n _this.controller = results.controller;\n extend(_this, results.template); // Either { template: \"tpl\" } or { component: \"cmpName\" }\n return _this;\n });\n };\n /**\n * Gets the controller for a view configuration.\n *\n * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.\n */\n Ng1ViewConfig.prototype.getController = function (context) {\n var provider = this.viewDecl.controllerProvider;\n if (!isInjectable(provider))\n return this.viewDecl.controller;\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n return Ng1ViewConfig;\n}());\n\n/** @module view */\n/** for typedoc */\n/**\n * Service which manages loading of templates from a ViewConfig.\n */\nvar TemplateFactory = /** @class */ (function () {\n function TemplateFactory() {\n var _this = this;\n /** @hidden */ this._useHttp = ng.version.minor < 3;\n /** @hidden */ this.$get = ['$http', '$templateCache', '$injector', function ($http, $templateCache, $injector) {\n _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');\n _this.$http = $http;\n _this.$templateCache = $templateCache;\n return _this;\n }];\n }\n /** @hidden */\n TemplateFactory.prototype.useHttpService = function (value) {\n this._useHttp = value;\n };\n /**\n * Creates a template from a configuration object.\n *\n * @param 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 params Parameters to pass to the template function.\n * @param context The resolve context associated with the template's view\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 TemplateFactory.prototype.fromConfig = function (config, params, context) {\n var defaultTemplate = '';\n var asTemplate = function (result) { return services.$q.when(result).then(function (str) { return ({ template: str }); }); };\n var asComponent = function (result) { return services.$q.when(result).then(function (str) { return ({ component: str }); }); };\n return (isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) :\n isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) :\n isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) :\n isDefined(config.component) ? asComponent(config.component) :\n isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) :\n asTemplate(defaultTemplate));\n };\n /**\n * Creates a template from a string or a function returning a string.\n *\n * @param template html template as a string or function that returns an html template as a string.\n * @param 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 TemplateFactory.prototype.fromString = function (template, params) {\n return isFunction(template) ? template(params) : template;\n };\n /**\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.} The template html as a string, or a promise\n * for that string.\n */\n TemplateFactory.prototype.fromUrl = function (url, params) {\n if (isFunction(url))\n url = url(params);\n if (url == null)\n return null;\n if (this._useHttp) {\n return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })\n .then(function (response) {\n return response.data;\n });\n }\n return this.$templateRequest(url);\n };\n /**\n * Creates a template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n TemplateFactory.prototype.fromProvider = function (provider, params, context) {\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n /**\n * Creates a component's template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string} The template html as a string: \"\".\n */\n TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {\n var deps = services.$injector.annotate(provider);\n var providerFn = isArray(provider) ? tail(provider) : provider;\n var resolvable = new Resolvable('', providerFn, deps);\n return resolvable.get(context);\n };\n /**\n * Creates a template from a component's name\n *\n * This implements route-to-component.\n * It works by retrieving the component (directive) metadata from the injector.\n * It analyses the component's bindings, then constructs a template that instantiates the component.\n * The template wires input and output bindings to resolves or from the parent component.\n *\n * @param uiView {object} The parent ui-view (for binding outputs to callbacks)\n * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)\n * @param component {string} Component's name in camel case.\n * @param bindings An object defining the component's bindings: {foo: '<'}\n * @return {string} The template as a string: \"\".\n */\n TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {\n bindings = bindings || {};\n // Bind once prefix\n var prefix = ng.version.minor >= 3 ? '::' : '';\n // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`\n var kebob = function (camelCase) {\n var kebobed = kebobString(camelCase);\n return /^(x|data)-/.exec(kebobed) ? \"x-\" + kebobed : kebobed;\n };\n var attributeTpl = function (input) {\n var name = input.name, type = input.type;\n var attrName = kebob(name);\n // If the ui-view has an attribute which matches a binding on the routed component\n // then pass that attribute through to the routed component template.\n // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`\n if (uiView.attr(attrName) && !bindings[name])\n return attrName + \"='\" + uiView.attr(attrName) + \"'\";\n var resolveName = bindings[name] || name;\n // Pre-evaluate the expression for \"@\" bindings by enclosing in {{ }}\n // some-attr=\"{{ ::$resolve.someResolveName }}\"\n if (type === '@')\n return attrName + \"='{{\" + prefix + \"$resolve.\" + resolveName + \"}}'\";\n // Wire \"&\" callbacks to resolves that return a callback function\n // Get the result of the resolve (should be a function) and annotate it to get its arguments.\n // some-attr=\"$resolve.someResolveResultName(foo, bar)\"\n if (type === '&') {\n var res = context.getResolvable(resolveName);\n var fn = res && res.data;\n var args = fn && services.$injector.annotate(fn) || [];\n // account for array style injection, i.e., ['foo', function(foo) {}]\n var arrayIdxStr = isArray(fn) ? \"[\" + (fn.length - 1) + \"]\" : '';\n return attrName + \"='$resolve.\" + resolveName + arrayIdxStr + \"(\" + args.join(',') + \")'\";\n }\n // some-attr=\"::$resolve.someResolveName\"\n return attrName + \"='\" + prefix + \"$resolve.\" + resolveName + \"'\";\n };\n var attrs = getComponentBindings(component).map(attributeTpl).join(' ');\n var kebobName = kebob(component);\n return \"<\" + kebobName + \" \" + attrs + \">\";\n };\n return TemplateFactory;\n}());\n// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')\nfunction getComponentBindings(name) {\n var cmpDefs = services.$injector.get(name + 'Directive'); // could be multiple\n if (!cmpDefs || !cmpDefs.length)\n throw new Error(\"Unable to find component named '\" + name + \"'\");\n return cmpDefs.map(getBindings).reduce(unnestR, []);\n}\n// Given a directive definition, find its object input attributes\n// Use different properties, depending on the type of directive (component, bindToController, normal)\nvar getBindings = function (def) {\n if (isObject(def.bindToController))\n return scopeBindings(def.bindToController);\n return scopeBindings(def.scope);\n};\n// for ng 1.2 style, process the scope: { input: \"=foo\" }\n// for ng 1.3 through ng 1.5, process the component's bindToController: { input: \"=foo\" } object\nvar scopeBindings = function (bindingsObj) { return Object.keys(bindingsObj || {})\n .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; })\n .filter(function (tuple) { return isDefined(tuple) && isArray(tuple[1]); })\n .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); }); };\n\n/** @module ng1 */ /** for typedoc */\n/**\n * The Angular 1 `StateProvider`\n *\n * The `$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 */\nvar StateProvider = /** @class */ (function () {\n function StateProvider(stateRegistry, stateService) {\n this.stateRegistry = stateRegistry;\n this.stateService = stateService;\n createProxyFunctions(val(StateProvider.prototype), this, val(this));\n }\n /**\n * Decorates states when they are registered\n *\n * Allows you to extend (carefully) or override (at your own peril) the\n * `stateBuilder` object used internally by [[StateRegistry]].\n * This can be used to add custom functionality to ui-router,\n * for example inferring templateUrl 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 * Override the internal 'views' builder with a function that takes the state\n * definition, and a reference to the internal function being overridden:\n * ```js\n * $stateProvider.decorator('views', function (state, parent) {\n * let result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * let 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 * ```js\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * $state.go('home');\n * ```\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 StateProvider.prototype.decorator = function (name, func) {\n return this.stateRegistry.decorator(name, func) || this;\n };\n StateProvider.prototype.state = function (name, definition) {\n if (isObject(name)) {\n definition = name;\n }\n else {\n definition.name = name;\n }\n this.stateRegistry.register(definition);\n return this;\n };\n /**\n * Registers an invalid state handler\n *\n * This is a passthrough to [[StateService.onInvalid]] for ng1.\n */\n StateProvider.prototype.onInvalid = function (callback) {\n return this.stateService.onInvalid(callback);\n };\n return StateProvider;\n}());\n\n/** @module ng1 */ /** */\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,\n * `onRetain` callback hooks on a [[Ng1StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * ensures that those hooks are injectable for @uirouter/angularjs (ng1).\n */\nvar getStateHookBuilder = function (hookName) {\n return function stateHookBuilder(stateObject, parentFn) {\n var hook = stateObject[hookName];\n var pathname = hookName === 'onExit' ? 'from' : 'to';\n function decoratedNg1Hook(trans, state) {\n var resolveContext = new ResolveContext(trans.treeChanges(pathname));\n var subContext = resolveContext.subContext(state.$$state());\n var locals = extend(getLocals(subContext), { $state$: state, $transition$: trans });\n return services.$injector.invoke(hook, this, locals);\n }\n return hook ? decoratedNg1Hook : undefined;\n };\n};\n\n/**\n * @internalapi\n * @module ng1\n */ /** */\n/**\n * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service\n */\nvar Ng1LocationServices = /** @class */ (function () {\n function Ng1LocationServices($locationProvider) {\n // .onChange() registry\n this._urlListeners = [];\n this.$locationProvider = $locationProvider;\n var _lp = val($locationProvider);\n createProxyFunctions(_lp, this, _lp, ['hashPrefix']);\n }\n /**\n * Applys ng1-specific path parameter encoding\n *\n * The Angular 1 `$location` service is a bit weird.\n * It doesn't allow slashes to be encoded/decoded bi-directionally.\n *\n * See the writeup at https://github.com/angular-ui/ui-router/issues/2598\n *\n * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F\n *\n * @param router\n */\n Ng1LocationServices.monkeyPatchPathParameterType = function (router) {\n var pathType = router.urlMatcherFactory.type('path');\n pathType.encode = function (x) {\n return x != null ? x.toString().replace(/(~|\\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : x;\n };\n pathType.decode = function (x) {\n return x != null ? x.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : x;\n };\n };\n Ng1LocationServices.prototype.dispose = function () { };\n Ng1LocationServices.prototype.onChange = function (callback) {\n var _this = this;\n this._urlListeners.push(callback);\n return function () { return removeFrom(_this._urlListeners)(callback); };\n };\n Ng1LocationServices.prototype.html5Mode = function () {\n var html5Mode = this.$locationProvider.html5Mode();\n html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;\n return html5Mode && this.$sniffer.history;\n };\n Ng1LocationServices.prototype.url = function (newUrl, replace, state) {\n if (replace === void 0) { replace = false; }\n if (isDefined(newUrl))\n this.$location.url(newUrl);\n if (replace)\n this.$location.replace();\n if (state)\n this.$location.state(state);\n return this.$location.url();\n };\n Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser) {\n var _this = this;\n this.$location = $location;\n this.$sniffer = $sniffer;\n // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange\n $rootScope.$on('$locationChangeSuccess', function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); });\n var _loc = val($location);\n var _browser = val($browser);\n // Bind these LocationService functions to $location\n createProxyFunctions(_loc, this, _loc, ['replace', 'path', 'search', 'hash']);\n // Bind these LocationConfig functions to $location\n createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);\n // Bind these LocationConfig functions to $browser\n createProxyFunctions(_browser, this, _browser, ['baseHref']);\n };\n return Ng1LocationServices;\n}());\n\n/** @module url */ /** */\n/**\n * Manages rules for client-side URL\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\n *\n * This class manages the router rules for what to do when the URL changes.\n *\n * This provider remains for backwards compatibility.\n *\n * @deprecated\n */\nvar UrlRouterProvider = /** @class */ (function () {\n /** @hidden */\n function UrlRouterProvider(router) {\n this._router = router;\n this._urlRouter = router.urlRouter;\n }\n UrlRouterProvider.injectableHandler = function (router, handler) {\n return function (match) {\n return services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });\n };\n };\n /** @hidden */\n UrlRouterProvider.prototype.$get = function () {\n var urlRouter = this._urlRouter;\n urlRouter.update(true);\n if (!urlRouter.interceptDeferred)\n urlRouter.listen();\n return urlRouter;\n };\n /**\n * Registers a url handler function.\n *\n * Registers a low level url handler (a `rule`).\n * A rule detects specific URL patterns and returns a redirect, or performs some action.\n *\n * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.\n *\n * #### Example:\n * ```js\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 * ```\n *\n * @param ruleFn\n * Handler function that takes `$injector` and `$location` services as arguments.\n * You can use them to detect a url and return a different url as a string.\n *\n * @return [[UrlRouterProvider]] (`this`)\n */\n UrlRouterProvider.prototype.rule = function (ruleFn) {\n var _this = this;\n if (!isFunction(ruleFn))\n throw new Error(\"'rule' must be a function\");\n var match = function () {\n return ruleFn(services.$injector, _this._router.locationService);\n };\n var rule = new BaseUrlRule(match, identity);\n this._urlRouter.rule(rule);\n return this;\n };\n /**\n * Defines the path or behavior to use when no url can be matched.\n *\n * #### Example:\n * ```js\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 * ```\n *\n * @param rule\n * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.\n * The function version is passed two params: `$injector` and `$location` services, and should return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n UrlRouterProvider.prototype.otherwise = function (rule) {\n var _this = this;\n var urlRouter = this._urlRouter;\n if (isString(rule)) {\n urlRouter.otherwise(rule);\n }\n else if (isFunction(rule)) {\n urlRouter.otherwise(function () { return rule(services.$injector, _this._router.locationService); });\n }\n else {\n throw new Error(\"'rule' must be a string or function\");\n }\n return this;\n };\n /**\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.\n * It gets invoked if `$location` matches.\n * 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 * ```js\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 * ```\n *\n * @param what A pattern string to match, compiled as a [[UrlMatcher]].\n * @param handler The path (or function that returns a path) that you want to redirect your user to.\n * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]\n *\n * Note: the handler may also invoke arbitrary code, such as `$state.go()`\n */\n UrlRouterProvider.prototype.when = function (what, handler) {\n if (isArray(handler) || isFunction(handler)) {\n handler = UrlRouterProvider.injectableHandler(this._router, handler);\n }\n this._urlRouter.when(what, handler);\n return this;\n };\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * $urlRouterProvider.deferIntercept();\n * })\n *\n * app.run(function (MyService, $urlRouter, $http) {\n * $http.get(\"/stuff\").then(function(resp) {\n * MyService.doStuff(resp.data);\n * $urlRouter.listen();\n * $urlRouter.sync();\n * });\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n UrlRouterProvider.prototype.deferIntercept = function (defer) {\n this._urlRouter.deferIntercept(defer);\n };\n return UrlRouterProvider;\n}());\n\n/**\n * # Angular 1 types\n *\n * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.\n * The customizations to the core types for Angular UI-Router are documented here.\n *\n * The optional [[$resolve]] service is also documented here.\n *\n * @module ng1\n * @preferred\n */\n/** for typedoc */\nng.module('ui.router.angular1', []);\nvar mod_init = ng.module('ui.router.init', []);\nvar mod_util = ng.module('ui.router.util', ['ng', 'ui.router.init']);\nvar mod_rtr = ng.module('ui.router.router', ['ui.router.util']);\nvar mod_state = ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\nvar mod_main = ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\nvar mod_cmpt = ng.module('ui.router.compat', ['ui.router']); // tslint:disable-line\nvar router = null;\n$uiRouterProvider.$inject = ['$locationProvider'];\n/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */\nfunction $uiRouterProvider($locationProvider) {\n // Create a new instance of the Router when the $uiRouterProvider is initialized\n router = this.router = new UIRouter();\n router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);\n // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties\n router.stateRegistry.decorator('views', ng1ViewsBuilder);\n router.stateRegistry.decorator('onExit', getStateHookBuilder('onExit'));\n router.stateRegistry.decorator('onRetain', getStateHookBuilder('onRetain'));\n router.stateRegistry.decorator('onEnter', getStateHookBuilder('onEnter'));\n router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());\n var ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider);\n Ng1LocationServices.monkeyPatchPathParameterType(router);\n // backwards compat: also expose router instance as $uiRouterProvider.router\n router['router'] = router;\n router['$get'] = $get;\n $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache'];\n function $get($location, $browser, $sniffer, $rootScope, $http, $templateCache) {\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser);\n delete router['router'];\n delete router['$get'];\n return router;\n }\n return router;\n}\nvar getProviderFor = function (serviceName) { return ['$uiRouterProvider', function ($urp) {\n var service = $urp.router[serviceName];\n service['$get'] = function () { return service; };\n return service;\n }]; };\n// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\nfunction runBlock($injector, $q, $uiRouter) {\n services.$injector = $injector;\n services.$q = $q;\n // The $injector is now available.\n // Find any resolvables that had dependency annotation deferred\n $uiRouter.stateRegistry.get()\n .map(function (x) { return x.$$state().resolvables; })\n .reduce(unnestR, [])\n .filter(function (x) { return x.deps === 'deferred'; })\n .forEach(function (resolvable) { return resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi); });\n}\n// $urlRouter service and $urlRouterProvider\nvar getUrlRouterProvider = function (uiRouter) {\n return uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter);\n};\n// $state service and $stateProvider\n// $urlRouter service and $urlRouterProvider\nvar getStateProvider = function () {\n return extend(router.stateProvider, { $get: function () { return router.stateService; } });\n};\nwatchDigests.$inject = ['$rootScope'];\nfunction watchDigests($rootScope) {\n $rootScope.$watch(function () { trace.approximateDigests++; });\n}\nmod_init.provider('$uiRouter', $uiRouterProvider);\nmod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\nmod_util.provider('$urlService', getProviderFor('urlService'));\nmod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]);\nmod_util.provider('$templateFactory', function () { return new TemplateFactory(); });\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\nmod_state.provider('$transitions', getProviderFor('transitionService'));\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\nmod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]);\nmod_main.factory('$view', function () { return router.viewService; });\nmod_main.service('$trace', function () { return trace; });\nmod_main.run(watchDigests);\nmod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]);\nmod_state.run(['$state', function ($state) { }]);\nmod_rtr.run(['$urlRouter', function ($urlRouter) { }]);\nmod_init.run(runBlock);\n/** @hidden TODO: find a place to move this */\nvar getLocals = function (ctx) {\n var tokens = ctx.getTokens().filter(isString);\n var tuples = tokens.map(function (key) {\n var resolvable = ctx.getResolvable(key);\n var waitPolicy = ctx.getPolicy(resolvable).async;\n return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];\n });\n return tuples.reduce(applyPairs, {});\n};\n\n/**\n * The current (or pending) State Parameters\n *\n * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition.\n *\n * The values are not updated until *after* a `Transition` successfully completes.\n *\n * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running.\n *\n * ### Deprecation warning:\n *\n * The value injected for `$stateParams` is different depending on where it is injected.\n *\n * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`.\n * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`.\n *\n * Because of these confusing details, this service is deprecated.\n *\n * ### Instead of using the global `$stateParams` service object,\n * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]]\n *\n * ```js\n * MyService.$inject = ['$uiRouterGlobals'];\n * function MyService($uiRouterGlobals) {\n * return {\n * paramValues: function () {\n * return $uiRouterGlobals.params;\n * }\n * }\n * }\n * ```\n *\n * ### Instead of using the per-transition `$stateParams` object,\n * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]]\n *\n * ```js\n * MyController.$inject = ['$transition$'];\n * function MyController($transition$) {\n * var username = $transition$.params().username;\n * // .. do something with username\n * }\n * ```\n *\n * ---\n *\n * This object can be injected into other services.\n *\n * #### Deprecated Example:\n * ```js\n * SomeService.$inject = ['$http', '$stateParams'];\n * function SomeService($http, $stateParams) {\n * return {\n * getUser: function() {\n * return $http.get('/api/users/' + $stateParams.username);\n * }\n * }\n * };\n * angular.service('SomeService', SomeService);\n * ```\n * @deprecated\n */\n\n/**\n * # Angular 1 Directives\n *\n * These are the directives included in UI-Router for Angular 1.\n * These directives are used in templates to create viewports and link/navigate to states.\n *\n * @ng1api\n * @preferred\n * @module directives\n */ /** for typedoc */\n/** @hidden */\nfunction parseStateRef(ref) {\n var parsed;\n var paramsOnly = ref.match(/^\\s*({[^}]*})\\s*$/);\n if (paramsOnly)\n ref = '(' + paramsOnly[1] + ')';\n parsed = ref.replace(/\\n/g, ' ').match(/^\\s*([^(]*?)\\s*(\\((.*)\\))?\\s*$/);\n if (!parsed || parsed.length !== 4)\n throw new Error(\"Invalid state ref '\" + ref + \"'\");\n return { state: parsed[1] || null, paramExpr: parsed[3] || null };\n}\n/** @hidden */\nfunction stateContext(el) {\n var $uiView = el.parent().inheritedData('$uiView');\n var path = parse('$cfg.path')($uiView);\n return path ? tail(path).state.name : undefined;\n}\n/** @hidden */\nfunction processedDef($state, $element, def) {\n var uiState = def.uiState || $state.current.name;\n var uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {});\n var href = $state.href(uiState, def.uiStateParams, uiStateOpts);\n return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href };\n}\n/** @hidden */\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 return {\n attr: isForm ? 'action' : (isSvg ? 'xlink:href' : 'href'),\n isAnchor: el.prop('tagName').toUpperCase() === 'A',\n clickable: !isForm,\n };\n}\n/** @hidden */\nfunction clickHook(el, $state, $timeout, type, getDef) {\n return function (e) {\n var button = e.which || e.button, target = getDef();\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_1 = $timeout(function () {\n $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);\n });\n e.preventDefault();\n // if the state has no URL, ignore one preventDefault from the directive.\n var ignorePreventDefaultCount_1 = type.isAnchor && !target.href ? 1 : 0;\n e.preventDefault = function () {\n if (ignorePreventDefaultCount_1-- <= 0)\n $timeout.cancel(transition_1);\n };\n }\n };\n}\n/** @hidden */\nfunction defaultOpts(el, $state) {\n return {\n relative: stateContext(el) || $state.$current,\n inherit: true,\n source: 'sref',\n };\n}\n/** @hidden */\nfunction bindEvents(element, scope, hookFn, uiStateOpts) {\n var events;\n if (uiStateOpts) {\n events = uiStateOpts.events;\n }\n if (!isArray(events)) {\n events = ['click'];\n }\n var on = element.on ? 'on' : 'bind';\n for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {\n var event_1 = events_1[_i];\n element[on](event_1, hookFn);\n }\n scope.$on('$destroy', function () {\n var off = element.off ? 'off' : 'unbind';\n for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {\n var event_2 = events_2[_i];\n element[off](event_2, hookFn);\n }\n });\n}\n/**\n * `ui-sref`: A directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of the `ui-sref` is the name of the state to link to.\n *\n * #### Example:\n * This will activate the `home` state when the link is clicked.\n * ```html\n * Home\n * ```\n *\n * ### Relative Links\n * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create a relative `ui-sref` which always targets the same destination.\n *\n * #### Example:\n * Both these links are relative to the parent state, even when a child state is currently active.\n * ```html\n * child 1 state\n * child 2 state\n * ```\n *\n * This link activates the parent state.\n * ```html\n * Return\n * ```\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * #### Example:\n * Assuming the `users` state has a url of `/users/`\n * ```html\n * Users\n * ```\n *\n * ### Parameter Values\n * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.\n * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.\n * The content inside the parentheses is an expression, evaluated to the parameter values.\n *\n * #### Example:\n * This example renders a list of links to users.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n *
  • \n * {{ user.displayName }}\n *
  • \n * ```\n *\n * Note:\n * The parameter values expression is `$watch`ed for updates.\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-sref-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Examples\n * If you have the following template:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n * \n * ```\n *\n * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n *
      \n *
    • \n * Joe\n *
    • \n *
    • \n * Alice\n *
    • \n *
    • \n * Bob\n *
    • \n *
    \n *\n * Home\n * ```\n *\n * ### Notes\n *\n * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n *\n * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).\n * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.\n */\nvar uiSrefDirective;\nuiSrefDirective = ['$uiRouter', '$timeout',\n function $StateRefDirective($uiRouter, $timeout) {\n var $state = $uiRouter.stateService;\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 unlinkInfoFn = null;\n var hookFn;\n var rawDef = {};\n var getDef = function () { return processedDef($state, element, rawDef); };\n var ref = parseStateRef(attrs.uiSref);\n rawDef.uiState = ref.state;\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\n function update() {\n var def = getDef();\n if (unlinkInfoFn)\n unlinkInfoFn();\n if (active)\n unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null)\n attrs.$set(type.attr, def.href);\n }\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function (val) {\n rawDef.uiStateParams = extend({}, val);\n update();\n }, true);\n rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));\n }\n update();\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n if (!type.clickable)\n return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n },\n };\n }];\n/**\n * `ui-state`: A fully dynamic directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.\n * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**\n *\n * #### Example:\n * Create a list of links.\n * ```html\n *
  • \n * {{ link.displayName }}\n *
  • \n * ```\n *\n * ### Relative Links\n * If the expression evaluates to a relative path, it is processed like [[uiSref]].\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create relative `ui-state` which always targets the same destination.\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * ### Parameter Values\n * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.\n * Param values should be provided using the `ui-state-params` attribute.\n * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * This example renders a list of links with param values.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n *
  • \n * {{ link.displayName }}\n *
  • \n * ```\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-state-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Notes\n *\n * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.\n * However, it might be simpler to use [[uiSref]] parameter-only links.\n *\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n * ```\n */\nvar uiStateDirective;\nuiStateDirective = ['$uiRouter', '$timeout',\n function $StateRefDynamicDirective($uiRouter, $timeout) {\n var $state = $uiRouter.stateService;\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 unlinkInfoFn = null;\n var hookFn;\n var rawDef = {};\n var getDef = function () { return processedDef($state, element, rawDef); };\n var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\n var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return (acc[attr] = noop, acc); }, {});\n function update() {\n var def = getDef();\n if (unlinkInfoFn)\n unlinkInfoFn();\n if (active)\n unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null)\n attrs.$set(type.attr, def.href);\n }\n inputAttrs.forEach(function (field) {\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\n attrs.$observe(field, function (expr) {\n watchDeregFns[field]();\n watchDeregFns[field] = scope.$watch(expr, function (newval) {\n rawDef[field] = newval;\n update();\n }, true);\n });\n });\n update();\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n if (!type.clickable)\n return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n },\n };\n }];\n/**\n * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active\n *\n * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the\n * related directive's state is active (and remove them when it is inactive).\n *\n * The primary use-case is to highlight the active link in navigation menus,\n * distinguishing it from the inactive menu items.\n *\n * ### Linking to a `ui-sref` or `ui-state`\n * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.\n * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.\n *\n * ### Matching\n *\n * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.\n * This is a \"fuzzy match\" which uses [[StateService.includes]].\n *\n * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).\n * This is an \"exact match\" which uses [[StateService.is]].\n *\n * ### Parameter values\n * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.\n * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.\n *\n * #### Example:\n * ```html\n *
  • \n * {{ user.lastName }}\n *
  • \n * ```\n *\n * ### Examples\n *\n * Given the following template:\n * #### Example:\n * ```html\n * \n * ```\n *\n * When the app state is `app.user` (or any child state),\n * and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n *\n * ```html\n * \n * ```\n *\n * ### Glob mode\n *\n * It is possible to pass `ui-sref-active` an expression that evaluates to an object.\n * The objects keys represent active class names and 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 * ```html\n *
    \n * Roles\n *
    \n * ```\n *\n * Arrays are also supported as values in the `ngClass`-like interface.\n * This allows multiple states to add `active` class.\n *\n * #### Example:\n * Given the following template, with \"admin.roles\" being the current state, the class will be added too:\n * ```html\n *
    \n * Roles\n *
    \n * ```\n *\n * When the current state is \"admin.roles\" the \"active\" class will be applied to both the `
    ` and `` elements.\n * It is important to note that the state names/globs passed to `ui-sref-active` override any state provided by a linked `ui-sref`.\n *\n * ### Notes:\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: `ui-sref-active='class1 class2 class3'`\n */\nvar uiSrefActiveDirective;\nuiSrefActiveDirective = ['$state', '$stateParams', '$interpolate', '$uiRouter',\n function $StateRefActiveDirective($state, $stateParams, $interpolate, $uiRouter) {\n return {\n restrict: 'A',\n controller: ['$scope', '$element', '$attrs',\n function ($scope, $element, $attrs) {\n var states = [];\n var activeEqClass;\n var uiSrefActive;\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 try {\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\n }\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 setStatesFromDefinitionObject(uiSrefActive);\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 function updateAfterTransition(trans) {\n trans.promise.then(update, noop);\n }\n $scope.$on('$destroy', setupEventListeners());\n if ($uiRouter.globals.transition) {\n updateAfterTransition($uiRouter.globals.transition);\n }\n function setupEventListeners() {\n var deregisterStatesChangedListener = $uiRouter.stateRegistry.onStatesChanged(handleStatesChanged);\n var deregisterOnStartListener = $uiRouter.transitionService.onStart({}, updateAfterTransition);\n var deregisterStateChangeSuccessListener = $scope.$on('$stateChangeSuccess', update);\n return function cleanUp() {\n deregisterStatesChangedListener();\n deregisterOnStartListener();\n deregisterStateChangeSuccessListener();\n };\n }\n function handleStatesChanged() {\n setStatesFromDefinitionObject(uiSrefActive);\n }\n function setStatesFromDefinitionObject(statesDefinition) {\n if (isObject(statesDefinition)) {\n states = [];\n forEach(statesDefinition, function (stateOrName, activeClass) {\n // Helper function to abstract adding state.\n var addStateForClass = function (stateOrName, activeClass) {\n var ref = parseStateRef(stateOrName);\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\n };\n if (isString(stateOrName)) {\n // If state is string, just add it.\n addStateForClass(stateOrName, activeClass);\n }\n else if (isArray(stateOrName)) {\n // If state is an array, iterate over it and add each array item individually.\n forEach(stateOrName, function (stateOrName) {\n addStateForClass(stateOrName, activeClass);\n });\n }\n });\n }\n }\n function addState(stateName, stateParams, activeClass) {\n var state = $state.get(stateName, stateContext($element));\n var stateInfo = {\n state: state || { name: stateName },\n params: stateParams,\n activeClass: activeClass,\n };\n states.push(stateInfo);\n return function removeState() {\n removeFrom(states)(stateInfo);\n };\n }\n // Update route state\n function update() {\n var splitClasses = function (str) {\n return str.split(/\\s/).filter(identity);\n };\n var getClasses = function (stateList) {\n return stateList.map(function (x) { return x.activeClass; }).map(splitClasses).reduce(unnestR, []);\n };\n var allClasses = getClasses(states).concat(splitClasses(activeEqClass)).reduce(uniqR, []);\n var fuzzyClasses = getClasses(states.filter(function (x) { return $state.includes(x.state.name, x.params); }));\n var exactlyMatchesAny = !!states.filter(function (x) { return $state.is(x.state.name, x.params); }).length;\n var exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : [];\n var addClasses = fuzzyClasses.concat(exactClasses).reduce(uniqR, []);\n var removeClasses = allClasses.filter(function (cls) { return !inArray(addClasses, cls); });\n $scope.$evalAsync(function () {\n addClasses.forEach(function (className) { return $element.addClass(className); });\n removeClasses.forEach(function (className) { return $element.removeClass(className); });\n });\n }\n update();\n }],\n };\n }];\nng.module('ui.router.state')\n .directive('uiSref', uiSrefDirective)\n .directive('uiSrefActive', uiSrefActiveDirective)\n .directive('uiSrefActiveEq', uiSrefActiveDirective)\n .directive('uiState', uiStateDirective);\n\n/** @module ng1 */ /** for typedoc */\n/**\n * `isState` Filter: truthy if the current state is the parameter\n *\n * Translates to [[StateService.is]] `$state.is(\"stateName\")`.\n *\n * #### Example:\n * ```html\n *
    show if state is 'stateName'
    \n * ```\n */\n$IsStateFilter.$inject = ['$state'];\nfunction $IsStateFilter($state) {\n var isFilter = function (state, params, options) {\n return $state.is(state, params, options);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n/**\n * `includedByState` Filter: truthy if the current state includes the parameter\n *\n * Translates to [[StateService.includes]]` $state.is(\"fullOrPartialStateName\")`.\n *\n * #### Example:\n * ```html\n *
    show if state includes 'fullOrPartialStateName'
    \n * ```\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}\nng.module('ui.router.state')\n .filter('isState', $IsStateFilter)\n .filter('includedByState', $IncludedByStateFilter);\n\n/**\n * @ng1api\n * @module directives\n */ /** for typedoc */\n/**\n * `ui-view`: A viewport directive which is filled in by a view from the active state.\n *\n * ### Attributes\n *\n * - `name`: (Optional) A view name.\n * The name should be unique amongst the other views in the same state.\n * You can have views of the same name that live in different states.\n * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]).\n *\n * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated.\n * Uses [[$uiViewScroll]] to do the scrolling.\n *\n * - `onload`: Expression to evaluate whenever the view updates.\n *\n * #### Example:\n * A view can be unnamed or named.\n * ```html\n * \n *
    \n *\n * \n *
    \n *\n * \n * \n * ```\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 *\n * ```html\n *
    \n * $stateProvider.state(\"home\", {\n * template: \"

    HELLO!

    \"\n * })\n * ```\n *\n * The above is a convenient shortcut equivalent to specifying your view explicitly with the\n * [[Ng1StateDeclaration.views]] config property, by name, in this case an empty name:\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"

    HELLO!

    \"\n * }\n * }\n * })\n * ```\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 *\n * ```html\n *
    \n * ```\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"main\": {\n * template: \"

    HELLO!

    \"\n * }\n * }\n * })\n * ```\n *\n * Really though, you'll use views to set up multiple views:\n *\n * ```html\n *
    \n *
    \n *
    \n * ```\n *\n * ```js\n * $stateProvider.state(\"home\", {\n * views: {\n * \"\": {\n * template: \"

    HELLO!

    \"\n * },\n * \"chart\": {\n * template: \"\"\n * },\n * \"data\": {\n * template: \"\"\n * }\n * }\n * })\n * ```\n *\n * #### Examples for `autoscroll`:\n * ```html\n * \n * \n *\n * \n * \n * \n * \n * ```\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 [[Ng1ViewDeclaration.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:\n * ```js\n * $stateProvider.state('home', {\n * template: '',\n * resolve: {\n * user: function(UserService) { return UserService.fetchUser(); }\n * }\n * });\n * ```\n */\nvar uiView;\nuiView = ['$view', '$animate', '$uiViewScroll', '$interpolate', '$q',\n function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q) {\n function getRenderer(attrs, scope) {\n return {\n enter: function (element, target, cb) {\n if (ng.version.minor > 2) {\n $animate.enter(element, null, target).then(cb);\n }\n else {\n $animate.enter(element, null, target, cb);\n }\n },\n leave: function (element, cb) {\n if (ng.version.minor > 2) {\n $animate.leave(element).then(cb);\n }\n else {\n $animate.leave(element, cb);\n }\n },\n };\n }\n function configsEqual(config1, config2) {\n return config1 === config2;\n }\n var rootData = {\n $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } },\n $uiView: {},\n };\n var directive = {\n count: 0,\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 onloadExp = attrs['onload'] || '', autoScrollExp = attrs['autoscroll'], renderer = getRenderer(attrs, scope), inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default';\n var previousEl, currentEl, currentScope, viewConfig, unregister;\n var activeUIView = {\n $type: 'ng1',\n id: directive.count++,\n name: name,\n fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name,\n config: null,\n configUpdated: configUpdatedCallback,\n get creationContext() {\n var fromParentTagConfig = parse('$cfg.viewDecl.$context')(inherited);\n // Allow \n // See https://github.com/angular-ui/ui-router/issues/3355\n var fromParentTag = parse('$uiView.creationContext')(inherited);\n return fromParentTagConfig || fromParentTag;\n },\n };\n trace.traceUIViewEvent('Linking', activeUIView);\n function configUpdatedCallback(config) {\n if (config && !(config instanceof Ng1ViewConfig))\n return;\n if (configsEqual(viewConfig, config))\n return;\n trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context);\n viewConfig = config;\n updateView(config);\n }\n $element.data('$uiView', { $uiView: activeUIView });\n updateView();\n unregister = $view.registerUIView(activeUIView);\n scope.$on('$destroy', function () {\n trace.traceUIViewEvent('Destroying/Unregistering', activeUIView);\n unregister();\n });\n function cleanupLastView() {\n if (previousEl) {\n trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView'));\n previousEl.remove();\n previousEl = null;\n }\n if (currentScope) {\n trace.traceUIViewEvent('Destroying scope', activeUIView);\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentEl) {\n var _viewData_1 = currentEl.data('$uiViewAnim');\n trace.traceUIViewEvent('Animate out', _viewData_1);\n renderer.leave(currentEl, function () {\n _viewData_1.$$animLeave.resolve();\n previousEl = null;\n });\n previousEl = currentEl;\n currentEl = null;\n }\n }\n function updateView(config) {\n var newScope = scope.$new();\n var animEnter = $q.defer(), animLeave = $q.defer();\n var $uiViewData = {\n $cfg: config,\n $uiView: activeUIView,\n };\n var $uiViewAnim = {\n $animEnter: animEnter.promise,\n $animLeave: animLeave.promise,\n $$animLeave: animLeave,\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 var cloned = $transclude(newScope, function (clone) {\n clone.data('$uiViewAnim', $uiViewAnim);\n clone.data('$uiView', $uiViewData);\n renderer.enter(clone, $element, function onUIViewEnter() {\n animEnter.resolve();\n if (currentScope)\n currentScope.$emit('$viewContentAnimationEnded');\n if (isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) {\n $uiViewScroll(clone);\n }\n });\n cleanupLastView();\n });\n currentEl = cloned;\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 */\n currentScope.$emit('$viewContentLoaded', config || viewConfig);\n currentScope.$eval(onloadExp);\n }\n };\n },\n };\n return directive;\n }];\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q', '$timeout'];\n/** @hidden */\nfunction $ViewDirectiveFill($compile, $controller, $transitions, $view, $q, $timeout) {\n var getControllerAs = parse('viewDecl.controllerAs');\n var getResolveAs = parse('viewDecl.resolveAs');\n return {\n restrict: 'ECA',\n priority: -400,\n compile: function (tElement) {\n var initial = tElement.html();\n tElement.empty();\n return function (scope, $element) {\n var data = $element.data('$uiView');\n if (!data) {\n $element.html(initial);\n $compile($element.contents())(scope);\n return;\n }\n var cfg = data.$cfg || { viewDecl: {}, getTemplate: noop };\n var resolveCtx = cfg.path && new ResolveContext(cfg.path);\n $element.html(cfg.getTemplate($element, resolveCtx) || initial);\n trace.traceUIViewFill(data.$uiView, $element.html());\n var link = $compile($element.contents());\n var controller = cfg.controller;\n var controllerAs = getControllerAs(cfg);\n var resolveAs = getResolveAs(cfg);\n var locals = resolveCtx && getLocals(resolveCtx);\n scope[resolveAs] = locals;\n if (controller) {\n var controllerInstance = $controller(controller, extend({}, locals, { $scope: scope, $element: $element }));\n if (controllerAs) {\n scope[controllerAs] = controllerInstance;\n scope[controllerAs][resolveAs] = locals;\n }\n // TODO: Use $view service as a central point for registering component-level hooks\n // Then, when a component is created, tell the $view service, so it can invoke hooks\n // $view.componentLoaded(controllerInstance, { $scope: scope, $element: $element });\n // scope.$on('$destroy', () => $view.componentUnloaded(controllerInstance, { $scope: scope, $element: $element }));\n $element.data('$ngControllerController', controllerInstance);\n $element.children().data('$ngControllerController', controllerInstance);\n registerControllerCallbacks($q, $transitions, controllerInstance, scope, cfg);\n }\n // Wait for the component to appear in the DOM\n if (isString(cfg.viewDecl.component)) {\n var cmp_1 = cfg.viewDecl.component;\n var kebobName = kebobString(cmp_1);\n var tagRegexp_1 = new RegExp(\"^(x-|data-)?\" + kebobName + \"$\", 'i');\n var getComponentController = function () {\n var directiveEl = [].slice.call($element[0].children)\n .filter(function (el) { return el && el.tagName && tagRegexp_1.exec(el.tagName); });\n return directiveEl && ng.element(directiveEl).data(\"$\" + cmp_1 + \"Controller\");\n };\n var deregisterWatch_1 = scope.$watch(getComponentController, function (ctrlInstance) {\n if (!ctrlInstance)\n return;\n registerControllerCallbacks($q, $transitions, ctrlInstance, scope, cfg);\n deregisterWatch_1();\n });\n }\n link(scope);\n };\n },\n };\n}\n/** @hidden */\nvar hasComponentImpl = typeof ng.module('ui.router')['component'] === 'function';\n/** @hidden incrementing id */\nvar _uiCanExitId = 0;\n/** @hidden TODO: move these callbacks to $view and/or `/hooks/components.ts` or something */\nfunction registerControllerCallbacks($q, $transitions, controllerInstance, $scope, cfg) {\n // Call $onInit() ASAP\n if (isFunction(controllerInstance.$onInit) && !(cfg.viewDecl.component && hasComponentImpl)) {\n controllerInstance.$onInit();\n }\n var viewState = tail(cfg.path).state.self;\n var hookOptions = { bind: controllerInstance };\n // Add component-level hook for onParamsChange\n if (isFunction(controllerInstance.uiOnParamsChanged)) {\n var resolveContext = new ResolveContext(cfg.path);\n var viewCreationTrans_1 = resolveContext.getResolvable('$transition$').data;\n // Fire callback on any successful transition\n var paramsUpdated = function ($transition$) {\n // Exit early if the $transition$ is the same as the view was created within.\n // Exit early if the $transition$ will exit the state the view is for.\n if ($transition$ === viewCreationTrans_1 || $transition$.exiting().indexOf(viewState) !== -1)\n return;\n var toParams = $transition$.params('to');\n var fromParams = $transition$.params('from');\n var toSchema = $transition$.treeChanges().to.map(function (node) { return node.paramSchema; }).reduce(unnestR, []);\n var fromSchema = $transition$.treeChanges().from.map(function (node) { return node.paramSchema; }).reduce(unnestR, []);\n // Find the to params that have different values than the from params\n var changedToParams = toSchema.filter(function (param) {\n var idx = fromSchema.indexOf(param);\n return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]);\n });\n // Only trigger callback if a to param has changed or is new\n if (changedToParams.length) {\n var changedKeys_1 = changedToParams.map(function (x) { return x.id; });\n // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params.\n var newValues = filter(toParams, function (val, key) { return changedKeys_1.indexOf(key) !== -1; });\n controllerInstance.uiOnParamsChanged(newValues, $transition$);\n }\n };\n $scope.$on('$destroy', $transitions.onSuccess({}, paramsUpdated, hookOptions));\n }\n // Add component-level hook for uiCanExit\n if (isFunction(controllerInstance.uiCanExit)) {\n var id_1 = _uiCanExitId++;\n var cacheProp_1 = '_uiCanExitIds';\n // Returns true if a redirect transition already answered truthy\n var prevTruthyAnswer_1 = function (trans) {\n return !!trans && (trans[cacheProp_1] && trans[cacheProp_1][id_1] === true || prevTruthyAnswer_1(trans.redirectedFrom()));\n };\n // If a user answered yes, but the transition was later redirected, don't also ask for the new redirect transition\n var wrappedHook = function (trans) {\n var promise;\n var ids = trans[cacheProp_1] = trans[cacheProp_1] || {};\n if (!prevTruthyAnswer_1(trans)) {\n promise = $q.when(controllerInstance.uiCanExit(trans));\n promise.then(function (val) { return ids[id_1] = (val !== false); });\n }\n return promise;\n };\n var criteria = { exiting: viewState.name };\n $scope.$on('$destroy', $transitions.onBefore(criteria, wrappedHook, hookOptions));\n }\n}\nng.module('ui.router.state').directive('uiView', uiView);\nng.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\n\n/** @module ng1 */ /** */\n/** @hidden */\nfunction $ViewScrollProvider() {\n var useAnchorScroll = false;\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n return function ($element) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\nng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n\n/**\n * Main entry point for angular 1.x build\n * @module ng1\n */ /** */\nvar index$1 = 'ui.router';\n\nexports.default = index$1;\nexports.core = index;\nexports.watchDigests = watchDigests;\nexports.getLocals = getLocals;\nexports.getNg1ViewConfigFactory = getNg1ViewConfigFactory;\nexports.ng1ViewsBuilder = ng1ViewsBuilder;\nexports.Ng1ViewConfig = Ng1ViewConfig;\nexports.StateProvider = StateProvider;\nexports.UrlRouterProvider = UrlRouterProvider;\nexports.root = root;\nexports.fromJson = fromJson;\nexports.toJson = toJson;\nexports.forEach = forEach;\nexports.extend = extend;\nexports.equals = equals;\nexports.identity = identity;\nexports.noop = noop;\nexports.createProxyFunctions = createProxyFunctions;\nexports.inherit = inherit;\nexports.inArray = inArray;\nexports._inArray = _inArray;\nexports.removeFrom = removeFrom;\nexports._removeFrom = _removeFrom;\nexports.pushTo = pushTo;\nexports._pushTo = _pushTo;\nexports.deregAll = deregAll;\nexports.defaults = defaults;\nexports.mergeR = mergeR;\nexports.ancestors = ancestors;\nexports.pick = pick;\nexports.omit = omit;\nexports.pluck = pluck;\nexports.filter = filter;\nexports.find = find;\nexports.mapObj = mapObj;\nexports.map = map;\nexports.values = values;\nexports.allTrueR = allTrueR;\nexports.anyTrueR = anyTrueR;\nexports.unnestR = unnestR;\nexports.flattenR = flattenR;\nexports.pushR = pushR;\nexports.uniqR = uniqR;\nexports.unnest = unnest;\nexports.flatten = flatten;\nexports.assertPredicate = assertPredicate;\nexports.assertMap = assertMap;\nexports.assertFn = assertFn;\nexports.pairs = pairs;\nexports.arrayTuples = arrayTuples;\nexports.applyPairs = applyPairs;\nexports.tail = tail;\nexports.copy = copy;\nexports._extend = _extend;\nexports.silenceUncaughtInPromise = silenceUncaughtInPromise;\nexports.silentRejection = silentRejection;\nexports.notImplemented = notImplemented;\nexports.services = services;\nexports.Glob = Glob;\nexports.curry = curry;\nexports.compose = compose;\nexports.pipe = pipe;\nexports.prop = prop;\nexports.propEq = propEq;\nexports.parse = parse;\nexports.not = not;\nexports.and = and;\nexports.or = or;\nexports.all = all;\nexports.any = any;\nexports.is = is;\nexports.eq = eq;\nexports.val = val;\nexports.invoke = invoke;\nexports.pattern = pattern;\nexports.isUndefined = isUndefined;\nexports.isDefined = isDefined;\nexports.isNull = isNull;\nexports.isNullOrUndefined = isNullOrUndefined;\nexports.isFunction = isFunction;\nexports.isNumber = isNumber;\nexports.isString = isString;\nexports.isObject = isObject;\nexports.isArray = isArray;\nexports.isDate = isDate;\nexports.isRegExp = isRegExp;\nexports.isState = isState;\nexports.isInjectable = isInjectable;\nexports.isPromise = isPromise;\nexports.Queue = Queue;\nexports.maxLength = maxLength;\nexports.padString = padString;\nexports.kebobString = kebobString;\nexports.functionToString = functionToString;\nexports.fnToString = fnToString;\nexports.stringify = stringify;\nexports.beforeAfterSubstr = beforeAfterSubstr;\nexports.hostRegex = hostRegex;\nexports.stripLastPathElement = stripLastPathElement;\nexports.splitHash = splitHash;\nexports.splitQuery = splitQuery;\nexports.splitEqual = splitEqual;\nexports.trimHashVal = trimHashVal;\nexports.splitOnDelim = splitOnDelim;\nexports.joinNeighborsR = joinNeighborsR;\nexports.Trace = Trace;\nexports.trace = trace;\nexports.Param = Param;\nexports.ParamTypes = ParamTypes;\nexports.StateParams = StateParams;\nexports.ParamType = ParamType;\nexports.PathNode = PathNode;\nexports.PathUtils = PathUtils;\nexports.resolvePolicies = resolvePolicies;\nexports.defaultResolvePolicy = defaultResolvePolicy;\nexports.Resolvable = Resolvable;\nexports.NATIVE_INJECTOR_TOKEN = NATIVE_INJECTOR_TOKEN;\nexports.ResolveContext = ResolveContext;\nexports.resolvablesBuilder = resolvablesBuilder;\nexports.StateBuilder = StateBuilder;\nexports.StateObject = StateObject;\nexports.StateMatcher = StateMatcher;\nexports.StateQueueManager = StateQueueManager;\nexports.StateRegistry = StateRegistry;\nexports.StateService = StateService;\nexports.TargetState = TargetState;\nexports.HookBuilder = HookBuilder;\nexports.matchState = matchState;\nexports.RegisteredHook = RegisteredHook;\nexports.makeEvent = makeEvent;\nexports.Rejection = Rejection;\nexports.Transition = Transition;\nexports.TransitionHook = TransitionHook;\nexports.TransitionEventType = TransitionEventType;\nexports.defaultTransOpts = defaultTransOpts;\nexports.TransitionService = TransitionService;\nexports.UrlMatcher = UrlMatcher;\nexports.UrlMatcherFactory = UrlMatcherFactory;\nexports.UrlRouter = UrlRouter;\nexports.UrlRuleFactory = UrlRuleFactory;\nexports.BaseUrlRule = BaseUrlRule;\nexports.UrlService = UrlService;\nexports.ViewService = ViewService;\nexports.UIRouterGlobals = UIRouterGlobals;\nexports.UIRouter = UIRouter;\nexports.$q = $q;\nexports.$injector = $injector;\nexports.BaseLocationServices = BaseLocationServices;\nexports.HashLocationService = HashLocationService;\nexports.MemoryLocationService = MemoryLocationService;\nexports.PushStateLocationService = PushStateLocationService;\nexports.MemoryLocationConfig = MemoryLocationConfig;\nexports.BrowserLocationConfig = BrowserLocationConfig;\nexports.keyValsToObjectR = keyValsToObjectR;\nexports.getParams = getParams;\nexports.parseUrl = parseUrl$1;\nexports.buildUrl = buildUrl;\nexports.locationPluginFactory = locationPluginFactory;\nexports.servicesPlugin = servicesPlugin;\nexports.hashLocationPlugin = hashLocationPlugin;\nexports.pushStateLocationPlugin = pushStateLocationPlugin;\nexports.memoryLocationPlugin = memoryLocationPlugin;\nexports.UIRouterPluginBase = UIRouterPluginBase;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=angular-ui-router.js.map\n\n/**\n * angular-ui-sortable - This directive allows you to jQueryUI Sortable.\n * @version v0.17.2 - 2017-11-25\n * @link http://angular-ui.github.com\n * @license MIT\n */\n\n(function(window, angular, undefined) {\n'use strict';\n/*\n jQuery UI Sortable plugin wrapper\n\n @param [ui-sortable] {object} Options to pass to $.fn.sortable() merged onto ui.config\n */\nangular.module('ui.sortable', [])\n .value('uiSortableConfig',{\n // the default for jquery-ui sortable is \"> *\", we need to restrict this to\n // ng-repeat items\n // if the user uses\n items: '> [ng-repeat],> [data-ng-repeat],> [x-ng-repeat]'\n })\n .directive('uiSortable', [\n 'uiSortableConfig', '$timeout', '$log',\n function(uiSortableConfig, $timeout, $log) {\n return {\n require:'?ngModel',\n scope: {\n ngModel:'=',\n uiSortable:'=',\n ////Expression bindings from html.\n create:'&uiSortableCreate',\n // helper:'&uiSortableHelper',\n start:'&uiSortableStart',\n activate:'&uiSortableActivate',\n // sort:'&uiSortableSort',\n // change:'&uiSortableChange',\n // over:'&uiSortableOver',\n // out:'&uiSortableOut',\n beforeStop:'&uiSortableBeforeStop',\n update:'&uiSortableUpdate',\n remove:'&uiSortableRemove',\n receive:'&uiSortableReceive',\n deactivate:'&uiSortableDeactivate',\n stop:'&uiSortableStop'\n },\n link: function(scope, element, attrs, ngModel) {\n var savedNodes;\n var helper;\n\n function combineCallbacks(first, second){\n var firstIsFunc = typeof first === 'function';\n var secondIsFunc = typeof second === 'function';\n if(firstIsFunc && secondIsFunc) {\n return function() {\n first.apply(this, arguments);\n second.apply(this, arguments);\n };\n } else if (secondIsFunc) {\n return second;\n }\n return first;\n }\n\n function getSortableWidgetInstance(element) {\n // this is a fix to support jquery-ui prior to v1.11.x\n // otherwise we should be using `element.sortable('instance')`\n var data = element.data('ui-sortable');\n if (data && typeof data === 'object' && data.widgetFullName === 'ui-sortable') {\n return data;\n }\n return null;\n }\n\n function patchSortableOption(key, value) {\n if (callbacks[key]) {\n if( key === 'stop' ){\n // call apply after stop\n value = combineCallbacks(\n value, function() { scope.$apply(); });\n\n value = combineCallbacks(value, afterStop);\n }\n // wrap the callback\n value = combineCallbacks(callbacks[key], value);\n } else if (wrappers[key]) {\n value = wrappers[key](value);\n }\n\n // patch the options that need to have values set\n if (!value && (key === 'items' || key === 'ui-model-items')) {\n value = uiSortableConfig.items;\n }\n\n return value;\n }\n\n function patchUISortableOptions(newOpts, oldOpts, sortableWidgetInstance) {\n\n function addDummyOptionKey(value, key) {\n if (!(key in opts)) {\n // add the key in the opts object so that\n // the patch function detects and handles it\n opts[key] = null;\n }\n }\n // for this directive to work we have to attach some callbacks\n angular.forEach(callbacks, addDummyOptionKey);\n\n // only initialize it in case we have to\n // update some options of the sortable\n var optsDiff = null;\n\n if (oldOpts) {\n // reset deleted options to default\n var defaultOptions;\n angular.forEach(oldOpts, function(oldValue, key) {\n if (!newOpts || !(key in newOpts)) {\n if (key in directiveOpts) {\n if (key === 'ui-floating') {\n opts[key] = 'auto';\n } else {\n opts[key] = patchSortableOption(key, undefined);\n }\n return;\n }\n\n if (!defaultOptions) {\n defaultOptions = angular.element.ui.sortable().options;\n }\n var defaultValue = defaultOptions[key];\n defaultValue = patchSortableOption(key, defaultValue);\n\n if (!optsDiff) {\n optsDiff = {};\n }\n optsDiff[key] = defaultValue;\n opts[key] = defaultValue;\n }\n });\n }\n\n newOpts = angular.extend({}, newOpts);\n // update changed options\n // handle the custom option of the directive first\n angular.forEach(newOpts, function(value, key) {\n if (key in directiveOpts) {\n if (key === 'ui-floating' && (value === false || value === true) && sortableWidgetInstance) {\n sortableWidgetInstance.floating = value;\n }\n\n if (key === 'ui-preserve-size' && (value === false || value === true)) {\n var userProvidedHelper = opts.helper;\n newOpts.helper = function(e, item) {\n if (opts['ui-preserve-size'] === true) {\n item.children().each(function () {\n var $el = angular.element(this);\n\n // Preserve the with of the element\n $el.width($el.width());\n });\n }\n return (userProvidedHelper || function(e, item) {\n return item;\n }).apply(this, arguments);\n };\n }\n\n opts[key] = patchSortableOption(key, value);\n }\n });\n\n // handle the normal option of the directive\n angular.forEach(newOpts, function(value, key) {\n if (key in directiveOpts) {\n // the custom option of the directive are already handled\n return;\n }\n\n value = patchSortableOption(key, value);\n\n if (!optsDiff) {\n optsDiff = {};\n }\n optsDiff[key] = value;\n opts[key] = value;\n });\n\n return optsDiff;\n }\n\n function getPlaceholderElement (element) {\n var placeholder = element.sortable('option','placeholder');\n\n // placeholder.element will be a function if the placeholder, has\n // been created (placeholder will be an object). If it hasn't\n // been created, either placeholder will be false if no\n // placeholder class was given or placeholder.element will be\n // undefined if a class was given (placeholder will be a string)\n if (placeholder && placeholder.element && typeof placeholder.element === 'function') {\n var result = placeholder.element();\n // workaround for jquery ui 1.9.x,\n // not returning jquery collection\n result = angular.element(result);\n return result;\n }\n return null;\n }\n\n function getPlaceholderExcludesludes (element, placeholder) {\n // exact match with the placeholder's class attribute to handle\n // the case that multiple connected sortables exist and\n // the placeholder option equals the class of sortable items\n var notCssSelector = opts['ui-model-items'].replace(/[^,]*>/g, '');\n var excludes = element.find('[class=\"' + placeholder.attr('class') + '\"]:not(' + notCssSelector + ')');\n return excludes;\n }\n\n function hasSortingHelper (element, ui) {\n var helperOption = element.sortable('option','helper');\n return helperOption === 'clone' || (typeof helperOption === 'function' && ui.item.sortable.isCustomHelperUsed());\n }\n\n function getSortingHelper (element, ui/*, savedNodes*/) {\n var result = null;\n if (hasSortingHelper(element, ui) &&\n element.sortable( 'option', 'appendTo' ) === 'parent') {\n // The .ui-sortable-helper element (that's the default class name)\n result = helper;\n }\n return result;\n }\n\n // thanks jquery-ui\n function isFloating (item) {\n return (/left|right/).test(item.css('float')) || (/inline|table-cell/).test(item.css('display'));\n }\n\n function getElementContext(elementScopes, element) {\n for (var i = 0; i < elementScopes.length; i++) {\n var c = elementScopes[i];\n if (c.element[0] === element[0]) {\n return c;\n }\n }\n }\n\n function afterStop(e, ui) {\n ui.item.sortable._destroy();\n }\n\n // return the index of ui.item among the items\n // we can't just do ui.item.index() because there it might have siblings\n // which are not items\n function getItemIndex(item) {\n return item.parent()\n .find(opts['ui-model-items'])\n .index(item);\n }\n\n var opts = {};\n\n // directive specific options\n var directiveOpts = {\n 'ui-floating': undefined,\n 'ui-model-items': uiSortableConfig.items,\n 'ui-preserve-size': undefined\n };\n\n var callbacks = {\n create: null,\n start: null,\n activate: null,\n // sort: null,\n // change: null,\n // over: null,\n // out: null,\n beforeStop: null,\n update: null,\n remove: null,\n receive: null,\n deactivate: null,\n stop: null\n };\n\n var wrappers = {\n helper: null\n };\n\n angular.extend(opts, directiveOpts, uiSortableConfig, scope.uiSortable);\n\n if (!angular.element.fn || !angular.element.fn.jquery) {\n $log.error('ui.sortable: jQuery should be included before AngularJS!');\n return;\n }\n\n function wireUp () {\n // When we add or remove elements, we need the sortable to 'refresh'\n // so it can find the new/removed elements.\n scope.$watchCollection('ngModel', function() {\n // Timeout to let ng-repeat modify the DOM\n $timeout(function() {\n // ensure that the jquery-ui-sortable widget instance\n // is still bound to the directive's element\n if (!!getSortableWidgetInstance(element)) {\n element.sortable('refresh');\n }\n }, 0, false);\n });\n\n callbacks.start = function(e, ui) {\n if (opts['ui-floating'] === 'auto') {\n // since the drag has started, the element will be\n // absolutely positioned, so we check its siblings\n var siblings = ui.item.siblings();\n var sortableWidgetInstance = getSortableWidgetInstance(angular.element(e.target));\n sortableWidgetInstance.floating = isFloating(siblings);\n }\n\n // Save the starting position of dragged item\n var index = getItemIndex(ui.item);\n ui.item.sortable = {\n model: ngModel.$modelValue[index],\n index: index,\n source: element,\n sourceList: ui.item.parent(),\n sourceModel: ngModel.$modelValue,\n cancel: function () {\n ui.item.sortable._isCanceled = true;\n },\n isCanceled: function () {\n return ui.item.sortable._isCanceled;\n },\n isCustomHelperUsed: function () {\n return !!ui.item.sortable._isCustomHelperUsed;\n },\n _isCanceled: false,\n _isCustomHelperUsed: ui.item.sortable._isCustomHelperUsed,\n _destroy: function () {\n angular.forEach(ui.item.sortable, function(value, key) {\n ui.item.sortable[key] = undefined;\n });\n },\n _connectedSortables: [],\n _getElementContext: function (element) {\n return getElementContext(this._connectedSortables, element);\n }\n };\n };\n\n callbacks.activate = function(e, ui) {\n var isSourceContext = ui.item.sortable.source === element;\n var savedNodesOrigin = isSourceContext ?\n ui.item.sortable.sourceList :\n element;\n var elementContext = {\n element: element,\n scope: scope,\n isSourceContext: isSourceContext,\n savedNodesOrigin: savedNodesOrigin\n };\n // save the directive's scope so that it is accessible from ui.item.sortable\n ui.item.sortable._connectedSortables.push(elementContext);\n\n // We need to make a copy of the current element's contents so\n // we can restore it after sortable has messed it up.\n // This is inside activate (instead of start) in order to save\n // both lists when dragging between connected lists.\n savedNodes = savedNodesOrigin.contents();\n helper = ui.helper;\n\n // If this list has a placeholder (the connected lists won't),\n // don't inlcude it in saved nodes.\n var placeholder = getPlaceholderElement(element);\n if (placeholder && placeholder.length) {\n var excludes = getPlaceholderExcludesludes(element, placeholder);\n savedNodes = savedNodes.not(excludes);\n }\n };\n\n callbacks.update = function(e, ui) {\n // Save current drop position but only if this is not a second\n // update that happens when moving between lists because then\n // the value will be overwritten with the old value\n if (!ui.item.sortable.received) {\n ui.item.sortable.dropindex = getItemIndex(ui.item);\n var droptarget = ui.item.parent().closest('[ui-sortable], [data-ui-sortable], [x-ui-sortable]');\n ui.item.sortable.droptarget = droptarget;\n ui.item.sortable.droptargetList = ui.item.parent();\n\n var droptargetContext = ui.item.sortable._getElementContext(droptarget);\n ui.item.sortable.droptargetModel = droptargetContext.scope.ngModel;\n\n // Cancel the sort (let ng-repeat do the sort for us)\n // Don't cancel if this is the received list because it has\n // already been canceled in the other list, and trying to cancel\n // here will mess up the DOM.\n element.sortable('cancel');\n }\n\n // Put the nodes back exactly the way they started (this is very\n // important because ng-repeat uses comment elements to delineate\n // the start and stop of repeat sections and sortable doesn't\n // respect their order (even if we cancel, the order of the\n // comments are still messed up).\n var sortingHelper = !ui.item.sortable.received && getSortingHelper(element, ui, savedNodes);\n if (sortingHelper && sortingHelper.length) {\n // Restore all the savedNodes except from the sorting helper element.\n // That way it will be garbage collected.\n savedNodes = savedNodes.not(sortingHelper);\n }\n var elementContext = ui.item.sortable._getElementContext(element);\n savedNodes.appendTo(elementContext.savedNodesOrigin);\n\n // If this is the target connected list then\n // it's safe to clear the restored nodes since:\n // update is currently running and\n // stop is not called for the target list.\n if (ui.item.sortable.received) {\n savedNodes = null;\n }\n\n // If received is true (an item was dropped in from another list)\n // then we add the new item to this list otherwise wait until the\n // stop event where we will know if it was a sort or item was\n // moved here from another list\n if (ui.item.sortable.received && !ui.item.sortable.isCanceled()) {\n scope.$apply(function () {\n ngModel.$modelValue.splice(ui.item.sortable.dropindex, 0,\n ui.item.sortable.moved);\n });\n scope.$emit('ui-sortable:moved', ui);\n }\n };\n\n callbacks.stop = function(e, ui) {\n // If the received flag hasn't be set on the item, this is a\n // normal sort, if dropindex is set, the item was moved, so move\n // the items in the list.\n var wasMoved = ('dropindex' in ui.item.sortable) &&\n !ui.item.sortable.isCanceled();\n\n if (wasMoved && !ui.item.sortable.received) {\n\n scope.$apply(function () {\n ngModel.$modelValue.splice(\n ui.item.sortable.dropindex, 0,\n ngModel.$modelValue.splice(ui.item.sortable.index, 1)[0]);\n });\n scope.$emit('ui-sortable:moved', ui);\n } else if (!wasMoved &&\n !angular.equals(element.contents().toArray(), savedNodes.toArray())) {\n // if the item was not moved\n // and the DOM element order has changed,\n // then restore the elements\n // so that the ngRepeat's comment are correct.\n\n var sortingHelper = getSortingHelper(element, ui, savedNodes);\n if (sortingHelper && sortingHelper.length) {\n // Restore all the savedNodes except from the sorting helper element.\n // That way it will be garbage collected.\n savedNodes = savedNodes.not(sortingHelper);\n }\n var elementContext = ui.item.sortable._getElementContext(element);\n savedNodes.appendTo(elementContext.savedNodesOrigin);\n }\n\n // It's now safe to clear the savedNodes and helper\n // since stop is the last callback.\n savedNodes = null;\n helper = null;\n };\n\n callbacks.receive = function(e, ui) {\n // An item was dropped here from another list, set a flag on the\n // item.\n ui.item.sortable.received = true;\n };\n\n callbacks.remove = function(e, ui) {\n // Workaround for a problem observed in nested connected lists.\n // There should be an 'update' event before 'remove' when moving\n // elements. If the event did not fire, cancel sorting.\n if (!('dropindex' in ui.item.sortable)) {\n element.sortable('cancel');\n ui.item.sortable.cancel();\n }\n\n // Remove the item from this list's model and copy data into item,\n // so the next list can retrive it\n if (!ui.item.sortable.isCanceled()) {\n scope.$apply(function () {\n ui.item.sortable.moved = ngModel.$modelValue.splice(\n ui.item.sortable.index, 1)[0];\n });\n }\n };\n\n // setup attribute handlers\n angular.forEach(callbacks, function(value, key) {\n callbacks[key] = combineCallbacks(callbacks[key],\n function () {\n var attrHandler = scope[key];\n var attrHandlerFn;\n if (typeof attrHandler === 'function' &&\n ('uiSortable' + key.substring(0,1).toUpperCase() + key.substring(1)).length &&\n typeof (attrHandlerFn = attrHandler()) === 'function') {\n attrHandlerFn.apply(this, arguments);\n }\n });\n });\n\n\n wrappers.helper = function (inner) {\n if (inner && typeof inner === 'function') {\n return function (e, item) {\n var oldItemSortable = item.sortable;\n var index = getItemIndex(item);\n item.sortable = {\n model: ngModel.$modelValue[index],\n index: index,\n source: element,\n sourceList: item.parent(),\n sourceModel: ngModel.$modelValue,\n _restore: function () {\n angular.forEach(item.sortable, function(value, key) {\n item.sortable[key] = undefined;\n });\n\n item.sortable = oldItemSortable;\n }\n };\n\n var innerResult = inner.apply(this, arguments);\n item.sortable._restore();\n item.sortable._isCustomHelperUsed = item !== innerResult;\n return innerResult;\n };\n }\n return inner;\n };\n\n scope.$watchCollection('uiSortable', function(newOpts, oldOpts) {\n // ensure that the jquery-ui-sortable widget instance\n // is still bound to the directive's element\n var sortableWidgetInstance = getSortableWidgetInstance(element);\n if (!!sortableWidgetInstance) {\n var optsDiff = patchUISortableOptions(newOpts, oldOpts, sortableWidgetInstance);\n\n if (optsDiff) {\n element.sortable('option', optsDiff);\n }\n }\n }, true);\n\n patchUISortableOptions(opts);\n }\n\n function init () {\n if (ngModel) {\n wireUp();\n } else {\n $log.info('ui.sortable: ngModel not provided!', element);\n }\n\n // Create sortable\n element.sortable(opts);\n }\n\n function initIfEnabled () {\n if (scope.uiSortable && scope.uiSortable.disabled) {\n return false;\n }\n\n init();\n\n // Stop Watcher\n initIfEnabled.cancelWatcher();\n initIfEnabled.cancelWatcher = angular.noop;\n\n return true;\n }\n\n initIfEnabled.cancelWatcher = angular.noop;\n\n if (!initIfEnabled()) {\n initIfEnabled.cancelWatcher = scope.$watch('uiSortable.disabled', initIfEnabled);\n }\n }\n };\n }\n ]);\n\n})(window, window.angular);\n\nangular.module('ajoslin.promise-tracker', [])\n\n.provider('promiseTracker', function() {\n var trackers = {};\n\n this.$get = ['$q', '$timeout', function($q, $timeout) {\n function cancelTimeout(promise) {\n if (promise) {\n $timeout.cancel(promise);\n }\n }\n\n return function PromiseTracker(options) {\n options = options || {};\n\n //Array of promises being tracked\n var tracked = [];\n var self = {};\n\n //Allow an optional \"minimum duration\" that the tracker has to stay active for.\n var minDuration = options.minDuration;\n //Allow a delay that will stop the tracker from activating until that time is reached\n var activationDelay = options.activationDelay;\n\n var minDurationPromise;\n var activationDelayPromise;\n\n self.active = function() {\n //Even if we have a promise in our tracker, we aren't active until delay is elapsed\n if (activationDelayPromise) {\n return false;\n }\n return tracked.length > 0;\n };\n\n self.tracking = function() {\n //Even if we aren't active, we could still have a promise in our tracker\n return tracked.length > 0;\n };\n\n self.trackingCount = function() {\n return tracked.length;\n };\n\n self.destroy = self.cancel = function() {\n minDurationPromise = cancelTimeout(minDurationPromise);\n activationDelayPromise = cancelTimeout(activationDelayPromise);\n for (var i=tracked.length-1; i>=0; i--) {\n tracked[i].resolve();\n }\n tracked.length = 0;\n };\n\n //Create a promise that will make our tracker active until it is resolved.\n // @return deferred - our deferred object that is being tracked\n self.createPromise = function() {\n var deferred = $q.defer();\n tracked.push(deferred);\n\n //If the tracker was just inactive and this the first in the list of\n //promises, we reset our delay and minDuration\n //again.\n if (tracked.length === 1) {\n if (activationDelay) {\n activationDelayPromise = $timeout(function() {\n activationDelayPromise = cancelTimeout(activationDelayPromise);\n startMinDuration();\n }, activationDelay);\n } else {\n startMinDuration();\n }\n }\n\n deferred.promise.then(onDone(false), onDone(true));\n\n return deferred;\n\n function startMinDuration() {\n if (minDuration) {\n minDurationPromise = $timeout(angular.noop, minDuration);\n }\n }\n\n //Create a callback for when this promise is done. It will remove our\n //tracked promise from the array if once minDuration is complete\n function onDone(isError) {\n return function(value) {\n (minDurationPromise || $q.when()).then(function() {\n var index = tracked.indexOf(deferred);\n tracked.splice(index, 1);\n\n //If this is the last promise, cleanup the timeouts\n //for activationDelay\n if (tracked.length === 0) {\n activationDelayPromise = cancelTimeout(activationDelayPromise);\n }\n });\n };\n }\n };\n\n self.addPromise = function(promise) {\n if (Array.isArray(promise)) {\n return $q.all(promise.map(self.addPromise));\n }\n\n promise = promise && (promise.$promise || promise) || {};\n if (!promise.then) {\n throw new Error(\"promiseTracker#addPromise expects a promise object!\");\n }\n\n var deferred = self.createPromise();\n\n //When given promise is done, resolve our created promise\n //Allow $then for angular-resource objects\n promise.then(function success(value) {\n deferred.resolve(value);\n return value;\n }, function error(value) {\n deferred.reject(value);\n return $q.reject(value);\n });\n\n return deferred;\n };\n\n return self;\n };\n }];\n});\n\n/*\n * promise-tracker - v2.1.0 - 2014-11-15\n * http://github.com/ajoslin/angular-promise-tracker\n * Created by Andy Joslin; Licensed under Public Domain\n */\n\n(function() {\n\nangular.module('ajoslin.promise-tracker')\n.config(['$httpProvider', function($httpProvider) {\n $httpProvider.interceptors.push(['$q', 'promiseTracker', function($q, promiseTracker) {\n return {\n request: function(config) {\n if (config.tracker) {\n if (!angular.isArray(config.tracker)) {\n config.tracker = [config.tracker];\n }\n config.$promiseTrackerDeferred = config.$promiseTrackerDeferred || [];\n\n angular.forEach(config.tracker, function(tracker) {\n var deferred = tracker.createPromise();\n config.$promiseTrackerDeferred.push(deferred);\n });\n }\n return $q.when(config);\n },\n response: function(response) {\n if (response.config && response.config.$promiseTrackerDeferred) {\n angular.forEach(response.config.$promiseTrackerDeferred, function(deferred) {\n deferred.resolve(response);\n });\n }\n return $q.when(response);\n },\n responseError: function(response) {\n if (response.config && response.config.$promiseTrackerDeferred) {\n angular.forEach(response.config.$promiseTrackerDeferred, function(deferred) {\n deferred.reject(response);\n });\n }\n return $q.reject(response);\n }\n };\n }]);\n}]);\n\n}());\n/**\r\n * oclazyload - Load modules on demand (lazy load) with angularJS\r\n * @version v1.0.1\r\n * @link https://github.com/ocombe/ocLazyLoad\r\n * @license MIT\r\n * @author Olivier Combe \r\n */\r\n(function (angular, window) {\r\n 'use strict';\r\n\r\n var regModules = ['ng', 'oc.lazyLoad'],\r\n regInvokes = {},\r\n regConfigs = [],\r\n modulesToLoad = [],\r\n recordDeclarations = [],\r\n broadcast = angular.noop,\r\n runBlocks = {},\r\n justLoaded = [];\r\n\r\n var ocLazyLoad = angular.module('oc.lazyLoad', ['ng']);\r\n\r\n ocLazyLoad.provider('$ocLazyLoad', [\"$controllerProvider\", \"$provide\", \"$compileProvider\", \"$filterProvider\", \"$injector\", \"$animateProvider\", function ($controllerProvider, $provide, $compileProvider, $filterProvider, $injector, $animateProvider) {\r\n var modules = {},\r\n providers = {\r\n $controllerProvider: $controllerProvider,\r\n $compileProvider: $compileProvider,\r\n $filterProvider: $filterProvider,\r\n $provide: $provide, // other things (constant, decorator, provider, factory, service)\r\n $injector: $injector,\r\n $animateProvider: $animateProvider\r\n },\r\n debug = false,\r\n events = false,\r\n moduleCache = [];\r\n\r\n moduleCache.push = function (value) {\r\n if (this.indexOf(value) === -1) {\r\n Array.prototype.push.apply(this, arguments);\r\n }\r\n };\r\n\r\n this.config = function (config) {\r\n // If we want to define modules configs\r\n if (angular.isDefined(config.modules)) {\r\n if (angular.isArray(config.modules)) {\r\n angular.forEach(config.modules, function (moduleConfig) {\r\n modules[moduleConfig.name] = moduleConfig;\r\n });\r\n } else {\r\n modules[config.modules.name] = config.modules;\r\n }\r\n }\r\n\r\n if (angular.isDefined(config.debug)) {\r\n debug = config.debug;\r\n }\r\n\r\n if (angular.isDefined(config.events)) {\r\n events = config.events;\r\n }\r\n };\r\n\r\n /**\r\n * Get the list of existing registered modules\r\n * @param element\r\n */\r\n this._init = function _init(element) {\r\n // this is probably useless now because we override angular.bootstrap\r\n if (modulesToLoad.length === 0) {\r\n var elements = [element],\r\n names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],\r\n NG_APP_CLASS_REGEXP = /\\sng[:\\-]app(:\\s*([\\w\\d_]+);?)?\\s/,\r\n append = function append(elm) {\r\n return elm && elements.push(elm);\r\n };\r\n\r\n angular.forEach(names, function (name) {\r\n names[name] = true;\r\n append(document.getElementById(name));\r\n name = name.replace(':', '\\\\:');\r\n if (element[0].querySelectorAll) {\r\n angular.forEach(element[0].querySelectorAll('.' + name), append);\r\n angular.forEach(element[0].querySelectorAll('.' + name + '\\\\:'), append);\r\n angular.forEach(element[0].querySelectorAll('[' + name + ']'), append);\r\n }\r\n });\r\n\r\n angular.forEach(elements, function (elm) {\r\n if (modulesToLoad.length === 0) {\r\n var className = ' ' + element.className + ' ';\r\n var match = NG_APP_CLASS_REGEXP.exec(className);\r\n if (match) {\r\n modulesToLoad.push((match[2] || '').replace(/\\s+/g, ','));\r\n } else {\r\n angular.forEach(elm.attributes, function (attr) {\r\n if (modulesToLoad.length === 0 && names[attr.name]) {\r\n modulesToLoad.push(attr.value);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n if (modulesToLoad.length === 0 && !((window.jasmine || window.mocha) && angular.isDefined(angular.mock))) {\r\n console.error('No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.');\r\n }\r\n\r\n var addReg = function addReg(moduleName) {\r\n if (regModules.indexOf(moduleName) === -1) {\r\n // register existing modules\r\n regModules.push(moduleName);\r\n var mainModule = angular.module(moduleName);\r\n\r\n // register existing components (directives, services, ...)\r\n _invokeQueue(null, mainModule._invokeQueue, moduleName);\r\n _invokeQueue(null, mainModule._configBlocks, moduleName); // angular 1.3+\r\n\r\n angular.forEach(mainModule.requires, addReg);\r\n }\r\n };\r\n\r\n angular.forEach(modulesToLoad, function (moduleName) {\r\n addReg(moduleName);\r\n });\r\n\r\n modulesToLoad = []; // reset for next bootstrap\r\n recordDeclarations.pop(); // wait for the next lazy load\r\n };\r\n\r\n /**\r\n * Like JSON.stringify but that doesn't throw on circular references\r\n * @param obj\r\n */\r\n var stringify = function stringify(obj) {\r\n var cache = [];\r\n return JSON.stringify(obj, function (key, value) {\r\n if (angular.isObject(value) && value !== null) {\r\n if (cache.indexOf(value) !== -1) {\r\n // Circular reference found, discard key\r\n return;\r\n }\r\n // Store value in our collection\r\n cache.push(value);\r\n }\r\n return value;\r\n });\r\n };\r\n\r\n var hashCode = function hashCode(str) {\r\n var hash = 0,\r\n i,\r\n chr,\r\n len;\r\n if (str.length == 0) {\r\n return hash;\r\n }\r\n for (i = 0, len = str.length; i < len; i++) {\r\n chr = str.charCodeAt(i);\r\n hash = (hash << 5) - hash + chr;\r\n hash |= 0; // Convert to 32bit integer\r\n }\r\n return hash;\r\n };\r\n\r\n function _register(providers, registerModules, params) {\r\n if (registerModules) {\r\n var k,\r\n moduleName,\r\n moduleFn,\r\n tempRunBlocks = [];\r\n for (k = registerModules.length - 1; k >= 0; k--) {\r\n moduleName = registerModules[k];\r\n if (!angular.isString(moduleName)) {\r\n moduleName = getModuleName(moduleName);\r\n }\r\n if (!moduleName || justLoaded.indexOf(moduleName) !== -1) {\r\n continue;\r\n }\r\n var newModule = regModules.indexOf(moduleName) === -1;\r\n moduleFn = ngModuleFct(moduleName);\r\n if (newModule) {\r\n // new module\r\n regModules.push(moduleName);\r\n _register(providers, moduleFn.requires, params);\r\n }\r\n if (moduleFn._runBlocks.length > 0) {\r\n // new run blocks detected! Replace the old ones (if existing)\r\n runBlocks[moduleName] = [];\r\n while (moduleFn._runBlocks.length > 0) {\r\n runBlocks[moduleName].push(moduleFn._runBlocks.shift());\r\n }\r\n }\r\n if (angular.isDefined(runBlocks[moduleName]) && (newModule || params.rerun)) {\r\n tempRunBlocks = tempRunBlocks.concat(runBlocks[moduleName]);\r\n }\r\n _invokeQueue(providers, moduleFn._invokeQueue, moduleName, params.reconfig);\r\n _invokeQueue(providers, moduleFn._configBlocks, moduleName, params.reconfig); // angular 1.3+\r\n broadcast(newModule ? 'ocLazyLoad.moduleLoaded' : 'ocLazyLoad.moduleReloaded', moduleName);\r\n registerModules.pop();\r\n justLoaded.push(moduleName);\r\n }\r\n // execute the run blocks at the end\r\n var instanceInjector = providers.getInstanceInjector();\r\n angular.forEach(tempRunBlocks, function (fn) {\r\n instanceInjector.invoke(fn);\r\n });\r\n }\r\n }\r\n\r\n function _registerInvokeList(args, moduleName) {\r\n var invokeList = args[2][0],\r\n type = args[1],\r\n newInvoke = false;\r\n if (angular.isUndefined(regInvokes[moduleName])) {\r\n regInvokes[moduleName] = {};\r\n }\r\n if (angular.isUndefined(regInvokes[moduleName][type])) {\r\n regInvokes[moduleName][type] = {};\r\n }\r\n var onInvoke = function onInvoke(invokeName, signature) {\r\n if (!regInvokes[moduleName][type].hasOwnProperty(invokeName)) {\r\n regInvokes[moduleName][type][invokeName] = [];\r\n }\r\n if (regInvokes[moduleName][type][invokeName].indexOf(signature) === -1) {\r\n newInvoke = true;\r\n regInvokes[moduleName][type][invokeName].push(signature);\r\n broadcast('ocLazyLoad.componentLoaded', [moduleName, type, invokeName]);\r\n }\r\n };\r\n\r\n function signature(data) {\r\n if (angular.isArray(data)) {\r\n // arrays are objects, we need to test for it first\r\n return hashCode(data.toString());\r\n } else if (angular.isObject(data)) {\r\n // constants & values for example\r\n return hashCode(stringify(data));\r\n } else {\r\n if (angular.isDefined(data) && data !== null) {\r\n return hashCode(data.toString());\r\n } else {\r\n // null & undefined constants\r\n return data;\r\n }\r\n }\r\n }\r\n\r\n if (angular.isString(invokeList)) {\r\n onInvoke(invokeList, signature(args[2][1]));\r\n } else if (angular.isObject(invokeList)) {\r\n angular.forEach(invokeList, function (invoke, key) {\r\n if (angular.isString(invoke)) {\r\n // decorators for example\r\n onInvoke(invoke, signature(invokeList[1]));\r\n } else {\r\n // components registered as object lists {\"componentName\": function() {}}\r\n onInvoke(key, signature(invoke));\r\n }\r\n });\r\n } else {\r\n return false;\r\n }\r\n return newInvoke;\r\n }\r\n\r\n function _invokeQueue(providers, queue, moduleName, reconfig) {\r\n if (!queue) {\r\n return;\r\n }\r\n\r\n var i, len, args, provider;\r\n for (i = 0, len = queue.length; i < len; i++) {\r\n args = queue[i];\r\n if (angular.isArray(args)) {\r\n if (providers !== null) {\r\n if (providers.hasOwnProperty(args[0])) {\r\n provider = providers[args[0]];\r\n } else {\r\n throw new Error('unsupported provider ' + args[0]);\r\n }\r\n }\r\n var isNew = _registerInvokeList(args, moduleName);\r\n if (args[1] !== 'invoke') {\r\n if (isNew && angular.isDefined(provider)) {\r\n provider[args[1]].apply(provider, args[2]);\r\n }\r\n } else {\r\n // config block\r\n var callInvoke = function callInvoke(fct) {\r\n var invoked = regConfigs.indexOf('' + moduleName + '-' + fct);\r\n if (invoked === -1 || reconfig) {\r\n if (invoked === -1) {\r\n regConfigs.push('' + moduleName + '-' + fct);\r\n }\r\n if (angular.isDefined(provider)) {\r\n provider[args[1]].apply(provider, args[2]);\r\n }\r\n }\r\n };\r\n if (angular.isFunction(args[2][0])) {\r\n callInvoke(args[2][0]);\r\n } else if (angular.isArray(args[2][0])) {\r\n for (var j = 0, jlen = args[2][0].length; j < jlen; j++) {\r\n if (angular.isFunction(args[2][0][j])) {\r\n callInvoke(args[2][0][j]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n function getModuleName(module) {\r\n var moduleName = null;\r\n if (angular.isString(module)) {\r\n moduleName = module;\r\n } else if (angular.isObject(module) && module.hasOwnProperty('name') && angular.isString(module.name)) {\r\n moduleName = module.name;\r\n }\r\n return moduleName;\r\n }\r\n\r\n function moduleExists(moduleName) {\r\n if (!angular.isString(moduleName)) {\r\n return false;\r\n }\r\n try {\r\n return ngModuleFct(moduleName);\r\n } catch (e) {\r\n if (/No module/.test(e) || e.message.indexOf('$injector:nomod') > -1) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n this.$get = [\"$log\", \"$rootElement\", \"$rootScope\", \"$cacheFactory\", \"$q\", function ($log, $rootElement, $rootScope, $cacheFactory, $q) {\r\n var instanceInjector,\r\n filesCache = $cacheFactory('ocLazyLoad');\r\n\r\n if (!debug) {\r\n $log = {};\r\n $log['error'] = angular.noop;\r\n $log['warn'] = angular.noop;\r\n $log['info'] = angular.noop;\r\n }\r\n\r\n // Make this lazy because when $get() is called the instance injector hasn't been assigned to the rootElement yet\r\n providers.getInstanceInjector = function () {\r\n return instanceInjector ? instanceInjector : instanceInjector = $rootElement.data('$injector') || angular.injector();\r\n };\r\n\r\n broadcast = function broadcast(eventName, params) {\r\n if (events) {\r\n $rootScope.$broadcast(eventName, params);\r\n }\r\n if (debug) {\r\n $log.info(eventName, params);\r\n }\r\n };\r\n\r\n function reject(e) {\r\n var deferred = $q.defer();\r\n $log.error(e.message);\r\n deferred.reject(e);\r\n return deferred.promise;\r\n }\r\n\r\n return {\r\n _broadcast: broadcast,\r\n\r\n _$log: $log,\r\n\r\n /**\r\n * Returns the files cache used by the loaders to store the files currently loading\r\n * @returns {*}\r\n */\r\n _getFilesCache: function getFilesCache() {\r\n return filesCache;\r\n },\r\n\r\n /**\r\n * Let the service know that it should monitor angular.module because files are loading\r\n * @param watch boolean\r\n */\r\n toggleWatch: function toggleWatch(watch) {\r\n if (watch) {\r\n recordDeclarations.push(true);\r\n } else {\r\n recordDeclarations.pop();\r\n }\r\n },\r\n\r\n /**\r\n * Let you get a module config object\r\n * @param moduleName String the name of the module\r\n * @returns {*}\r\n */\r\n getModuleConfig: function getModuleConfig(moduleName) {\r\n if (!angular.isString(moduleName)) {\r\n throw new Error('You need to give the name of the module to get');\r\n }\r\n if (!modules[moduleName]) {\r\n return null;\r\n }\r\n return angular.copy(modules[moduleName]);\r\n },\r\n\r\n /**\r\n * Let you define a module config object\r\n * @param moduleConfig Object the module config object\r\n * @returns {*}\r\n */\r\n setModuleConfig: function setModuleConfig(moduleConfig) {\r\n if (!angular.isObject(moduleConfig)) {\r\n throw new Error('You need to give the module config object to set');\r\n }\r\n modules[moduleConfig.name] = moduleConfig;\r\n return moduleConfig;\r\n },\r\n\r\n /**\r\n * Returns the list of loaded modules\r\n * @returns {string[]}\r\n */\r\n getModules: function getModules() {\r\n return regModules;\r\n },\r\n\r\n /**\r\n * Let you check if a module has been loaded into Angular or not\r\n * @param modulesNames String/Object a module name, or a list of module names\r\n * @returns {boolean}\r\n */\r\n isLoaded: function isLoaded(modulesNames) {\r\n var moduleLoaded = function moduleLoaded(module) {\r\n var isLoaded = regModules.indexOf(module) > -1;\r\n if (!isLoaded) {\r\n isLoaded = !!moduleExists(module);\r\n }\r\n return isLoaded;\r\n };\r\n if (angular.isString(modulesNames)) {\r\n modulesNames = [modulesNames];\r\n }\r\n if (angular.isArray(modulesNames)) {\r\n var i, len;\r\n for (i = 0, len = modulesNames.length; i < len; i++) {\r\n if (!moduleLoaded(modulesNames[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n } else {\r\n throw new Error('You need to define the module(s) name(s)');\r\n }\r\n },\r\n\r\n /**\r\n * Given a module, return its name\r\n * @param module\r\n * @returns {String}\r\n */\r\n _getModuleName: getModuleName,\r\n\r\n /**\r\n * Returns a module if it exists\r\n * @param moduleName\r\n * @returns {module}\r\n */\r\n _getModule: function getModule(moduleName) {\r\n try {\r\n return ngModuleFct(moduleName);\r\n } catch (e) {\r\n // this error message really suxx\r\n if (/No module/.test(e) || e.message.indexOf('$injector:nomod') > -1) {\r\n e.message = 'The module \"' + stringify(moduleName) + '\" that you are trying to load does not exist. ' + e.message;\r\n }\r\n throw e;\r\n }\r\n },\r\n\r\n /**\r\n * Check if a module exists and returns it if it does\r\n * @param moduleName\r\n * @returns {boolean}\r\n */\r\n moduleExists: moduleExists,\r\n\r\n /**\r\n * Load the dependencies, and might try to load new files depending on the config\r\n * @param moduleName (String or Array of Strings)\r\n * @param localParams\r\n * @returns {*}\r\n * @private\r\n */\r\n _loadDependencies: function _loadDependencies(moduleName, localParams) {\r\n var loadedModule,\r\n requires,\r\n diff,\r\n promisesList = [],\r\n self = this;\r\n\r\n moduleName = self._getModuleName(moduleName);\r\n\r\n if (moduleName === null) {\r\n return $q.when();\r\n } else {\r\n try {\r\n loadedModule = self._getModule(moduleName);\r\n } catch (e) {\r\n return reject(e);\r\n }\r\n // get unloaded requires\r\n requires = self.getRequires(loadedModule);\r\n }\r\n\r\n angular.forEach(requires, function (requireEntry) {\r\n // If no configuration is provided, try and find one from a previous load.\r\n // If there isn't one, bail and let the normal flow run\r\n if (angular.isString(requireEntry)) {\r\n var config = self.getModuleConfig(requireEntry);\r\n if (config === null) {\r\n moduleCache.push(requireEntry); // We don't know about this module, but something else might, so push it anyway.\r\n return;\r\n }\r\n requireEntry = config;\r\n }\r\n\r\n // Check if this dependency has been loaded previously\r\n if (self.moduleExists(requireEntry.name)) {\r\n // compare against the already loaded module to see if the new definition adds any new files\r\n diff = requireEntry.files.filter(function (n) {\r\n return self.getModuleConfig(requireEntry.name).files.indexOf(n) < 0;\r\n });\r\n\r\n // If the module was redefined, advise via the console\r\n if (diff.length !== 0) {\r\n self._$log.warn('Module \"', moduleName, '\" attempted to redefine configuration for dependency. \"', requireEntry.name, '\"\\n Additional Files Loaded:', diff);\r\n }\r\n\r\n // Push everything to the file loader, it will weed out the duplicates.\r\n if (angular.isDefined(self.filesLoader)) {\r\n // if a files loader is defined\r\n promisesList.push(self.filesLoader(requireEntry, localParams).then(function () {\r\n return self._loadDependencies(requireEntry);\r\n }));\r\n } else {\r\n return reject(new Error('Error: New dependencies need to be loaded from external files (' + requireEntry.files + '), but no loader has been defined.'));\r\n }\r\n return;\r\n } else if (angular.isArray(requireEntry)) {\r\n requireEntry = {\r\n files: requireEntry\r\n };\r\n } else if (angular.isObject(requireEntry)) {\r\n if (requireEntry.hasOwnProperty('name') && requireEntry['name']) {\r\n // The dependency doesn't exist in the module cache and is a new configuration, so store and push it.\r\n self.setModuleConfig(requireEntry);\r\n moduleCache.push(requireEntry['name']);\r\n }\r\n }\r\n\r\n // Check if the dependency has any files that need to be loaded. If there are, push a new promise to the promise list.\r\n if (angular.isDefined(requireEntry.files) && requireEntry.files.length !== 0) {\r\n if (angular.isDefined(self.filesLoader)) {\r\n // if a files loader is defined\r\n promisesList.push(self.filesLoader(requireEntry, localParams).then(function () {\r\n return self._loadDependencies(requireEntry);\r\n }));\r\n } else {\r\n return reject(new Error('Error: the module \"' + requireEntry.name + '\" is defined in external files (' + requireEntry.files + '), but no loader has been defined.'));\r\n }\r\n }\r\n });\r\n\r\n // Create a wrapper promise to watch the promise list and resolve it once everything is done.\r\n return $q.all(promisesList);\r\n },\r\n\r\n /**\r\n * Inject new modules into Angular\r\n * @param moduleName\r\n * @param localParams\r\n */\r\n inject: function inject(moduleName) {\r\n var localParams = arguments[1] === undefined ? {} : arguments[1];\r\n\r\n var self = this,\r\n deferred = $q.defer();\r\n if (angular.isDefined(moduleName) && moduleName !== null) {\r\n if (angular.isArray(moduleName)) {\r\n var promisesList = [];\r\n angular.forEach(moduleName, function (module) {\r\n promisesList.push(self.inject(module));\r\n });\r\n return $q.all(promisesList);\r\n } else {\r\n self._addToLoadList(self._getModuleName(moduleName), true);\r\n }\r\n }\r\n if (modulesToLoad.length > 0) {\r\n var res = modulesToLoad.slice(); // clean copy\r\n var loadNext = function loadNext(moduleName) {\r\n moduleCache.push(moduleName);\r\n self._loadDependencies(moduleName, localParams).then(function success() {\r\n try {\r\n justLoaded = [];\r\n _register(providers, moduleCache, localParams);\r\n } catch (e) {\r\n self._$log.error(e.message);\r\n deferred.reject(e);\r\n return;\r\n }\r\n\r\n if (modulesToLoad.length > 0) {\r\n loadNext(modulesToLoad.shift()); // load the next in list\r\n } else {\r\n deferred.resolve(res); // everything has been loaded, resolve\r\n }\r\n }, function error(err) {\r\n deferred.reject(err);\r\n });\r\n };\r\n\r\n // load the first in list\r\n loadNext(modulesToLoad.shift());\r\n } else {\r\n deferred.resolve();\r\n }\r\n return deferred.promise;\r\n },\r\n\r\n /**\r\n * Get the list of required modules/services/... for this module\r\n * @param module\r\n * @returns {Array}\r\n */\r\n getRequires: function getRequires(module) {\r\n var requires = [];\r\n angular.forEach(module.requires, function (requireModule) {\r\n if (regModules.indexOf(requireModule) === -1) {\r\n requires.push(requireModule);\r\n }\r\n });\r\n return requires;\r\n },\r\n\r\n /**\r\n * Invoke the new modules & component by their providers\r\n * @param providers\r\n * @param queue\r\n * @param moduleName\r\n * @param reconfig\r\n * @private\r\n */\r\n _invokeQueue: _invokeQueue,\r\n\r\n /**\r\n * Check if a module has been invoked and registers it if not\r\n * @param args\r\n * @param moduleName\r\n * @returns {boolean} is new\r\n */\r\n _registerInvokeList: _registerInvokeList,\r\n\r\n /**\r\n * Register a new module and loads it, executing the run/config blocks if needed\r\n * @param providers\r\n * @param registerModules\r\n * @param params\r\n * @private\r\n */\r\n _register: _register,\r\n\r\n /**\r\n * Add a module name to the list of modules that will be loaded in the next inject\r\n * @param name\r\n * @param force\r\n * @private\r\n */\r\n _addToLoadList: _addToLoadList\r\n };\r\n }];\r\n\r\n // Let's get the list of loaded modules & components\r\n this._init(angular.element(window.document));\r\n }]);\r\n\r\n var bootstrapFct = angular.bootstrap;\r\n angular.bootstrap = function (element, modules, config) {\r\n // we use slice to make a clean copy\r\n angular.forEach(modules.slice(), function (module) {\r\n _addToLoadList(module, true);\r\n });\r\n return bootstrapFct(element, modules, config);\r\n };\r\n\r\n var _addToLoadList = function _addToLoadList(name, force) {\r\n if ((recordDeclarations.length > 0 || force) && angular.isString(name) && modulesToLoad.indexOf(name) === -1) {\r\n modulesToLoad.push(name);\r\n }\r\n };\r\n\r\n var ngModuleFct = angular.module;\r\n angular.module = function (name, requires, configFn) {\r\n _addToLoadList(name);\r\n return ngModuleFct(name, requires, configFn);\r\n };\r\n\r\n // CommonJS package manager support:\r\n if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.exports === exports) {\r\n module.exports = 'oc.lazyLoad';\r\n }\r\n})(angular, window);\r\n(function (angular) {\r\n 'use strict';\r\n\r\n angular.module('oc.lazyLoad').directive('ocLazyLoad', [\"$ocLazyLoad\", \"$compile\", \"$animate\", \"$parse\", function ($ocLazyLoad, $compile, $animate, $parse) {\r\n return {\r\n restrict: 'A',\r\n terminal: true,\r\n priority: 1000,\r\n compile: function compile(element, attrs) {\r\n // we store the content and remove it before compilation\r\n var content = element[0].innerHTML;\r\n element.html('');\r\n\r\n return function ($scope, $element, $attr) {\r\n var model = $parse($attr.ocLazyLoad);\r\n $scope.$watch(function () {\r\n return model($scope) || $attr.ocLazyLoad; // it can be a module name (string), an object, an array, or a scope reference to any of this\r\n }, function (moduleName) {\r\n if (angular.isDefined(moduleName)) {\r\n $ocLazyLoad.load(moduleName).then(function () {\r\n $animate.enter(content, $element);\r\n var contents = element.contents();\r\n angular.forEach(contents, function (content) {\r\n if (content.nodeType !== 3) {\r\n // 3 is a text node\r\n $compile(content)($scope);\r\n }\r\n });\r\n });\r\n }\r\n }, true);\r\n };\r\n }\r\n };\r\n }]);\r\n})(angular);\r\n(function (angular) {\r\n 'use strict';\r\n\r\n angular.module('oc.lazyLoad').config([\"$provide\", function ($provide) {\r\n $provide.decorator('$ocLazyLoad', [\"$delegate\", \"$q\", \"$window\", \"$interval\", function ($delegate, $q, $window, $interval) {\r\n var uaCssChecked = false,\r\n useCssLoadPatch = false,\r\n anchor = $window.document.getElementsByTagName('head')[0] || $window.document.getElementsByTagName('body')[0];\r\n\r\n /**\r\n * Load a js/css file\r\n * @param type\r\n * @param path\r\n * @param params\r\n * @returns promise\r\n */\r\n $delegate.buildElement = function buildElement(type, path, params) {\r\n var deferred = $q.defer(),\r\n el,\r\n loaded,\r\n filesCache = $delegate._getFilesCache(),\r\n cacheBuster = function cacheBuster(url) {\r\n var dc = new Date().getTime();\r\n if (url.indexOf('?') >= 0) {\r\n if (url.substring(0, url.length - 1) === '&') {\r\n return '' + url + '_dc=' + dc;\r\n }\r\n return '' + url + '&_dc=' + dc;\r\n } else {\r\n return '' + url + '?_dc=' + dc;\r\n }\r\n };\r\n\r\n // Store the promise early so the file load can be detected by other parallel lazy loads\r\n // (ie: multiple routes on one page) a 'true' value isn't sufficient\r\n // as it causes false positive load results.\r\n if (angular.isUndefined(filesCache.get(path))) {\r\n filesCache.put(path, deferred.promise);\r\n }\r\n\r\n // Switch in case more content types are added later\r\n switch (type) {\r\n case 'css':\r\n el = $window.document.createElement('link');\r\n el.type = 'text/css';\r\n el.rel = 'stylesheet';\r\n el.href = params.cache === false ? cacheBuster(path) : path;\r\n break;\r\n case 'js':\r\n el = $window.document.createElement('script');\r\n el.src = params.cache === false ? cacheBuster(path) : path;\r\n break;\r\n default:\r\n filesCache.remove(path);\r\n deferred.reject(new Error('Requested type \"' + type + '\" is not known. Could not inject \"' + path + '\"'));\r\n break;\r\n }\r\n el.onload = el['onreadystatechange'] = function (e) {\r\n if (el['readyState'] && !/^c|loade/.test(el['readyState']) || loaded) return;\r\n el.onload = el['onreadystatechange'] = null;\r\n loaded = 1;\r\n $delegate._broadcast('ocLazyLoad.fileLoaded', path);\r\n deferred.resolve();\r\n };\r\n el.onerror = function () {\r\n filesCache.remove(path);\r\n deferred.reject(new Error('Unable to load ' + path));\r\n };\r\n el.async = params.serie ? 0 : 1;\r\n\r\n var insertBeforeElem = anchor.lastChild;\r\n if (params.insertBefore) {\r\n var element = angular.element(angular.isDefined(window.jQuery) ? params.insertBefore : document.querySelector(params.insertBefore));\r\n if (element && element.length > 0) {\r\n insertBeforeElem = element[0];\r\n }\r\n }\r\n insertBeforeElem.parentNode.insertBefore(el, insertBeforeElem);\r\n\r\n /*\r\n The event load or readystatechange doesn't fire in:\r\n - iOS < 6 (default mobile browser)\r\n - Android < 4.4 (default mobile browser)\r\n - Safari < 6 (desktop browser)\r\n */\r\n if (type == 'css') {\r\n if (!uaCssChecked) {\r\n var ua = $window.navigator.userAgent.toLowerCase();\r\n\r\n // iOS < 6\r\n if (/iP(hone|od|ad)/.test($window.navigator.platform)) {\r\n var v = $window.navigator.appVersion.match(/OS (\\d+)_(\\d+)_?(\\d+)?/);\r\n var iOSVersion = parseFloat([parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)].join('.'));\r\n useCssLoadPatch = iOSVersion < 6;\r\n } else if (ua.indexOf('android') > -1) {\r\n // Android < 4.4\r\n var androidVersion = parseFloat(ua.slice(ua.indexOf('android') + 8));\r\n useCssLoadPatch = androidVersion < 4.4;\r\n } else if (ua.indexOf('safari') > -1) {\r\n var versionMatch = ua.match(/version\\/([\\.\\d]+)/i);\r\n useCssLoadPatch = versionMatch && versionMatch[1] && parseFloat(versionMatch[1]) < 6;\r\n }\r\n }\r\n\r\n if (useCssLoadPatch) {\r\n var tries = 1000; // * 20 = 20000 miliseconds\r\n var interval = $interval(function () {\r\n try {\r\n el.sheet.cssRules;\r\n $interval.cancel(interval);\r\n el.onload();\r\n } catch (e) {\r\n if (--tries <= 0) {\r\n el.onerror();\r\n }\r\n }\r\n }, 20);\r\n }\r\n }\r\n\r\n return deferred.promise;\r\n };\r\n\r\n return $delegate;\r\n }]);\r\n }]);\r\n})(angular);\r\n(function (angular) {\r\n 'use strict';\r\n\r\n angular.module('oc.lazyLoad').config([\"$provide\", function ($provide) {\r\n $provide.decorator('$ocLazyLoad', [\"$delegate\", \"$q\", function ($delegate, $q) {\r\n /**\r\n * The function that loads new files\r\n * @param config\r\n * @param params\r\n * @returns {*}\r\n */\r\n $delegate.filesLoader = function filesLoader(config) {\r\n var params = arguments[1] === undefined ? {} : arguments[1];\r\n\r\n var cssFiles = [],\r\n templatesFiles = [],\r\n jsFiles = [],\r\n promises = [],\r\n cachePromise = null,\r\n filesCache = $delegate._getFilesCache();\r\n\r\n $delegate.toggleWatch(true); // start watching angular.module calls\r\n\r\n angular.extend(params, config);\r\n\r\n var pushFile = function pushFile(path) {\r\n var file_type = null,\r\n m;\r\n if (angular.isObject(path)) {\r\n file_type = path.type;\r\n path = path.path;\r\n }\r\n cachePromise = filesCache.get(path);\r\n if (angular.isUndefined(cachePromise) || params.cache === false) {\r\n\r\n // always check for requirejs syntax just in case\r\n if ((m = /^(css|less|html|htm|js)?(?=!)/.exec(path)) !== null) {\r\n // Detect file type using preceding type declaration (ala requireJS)\r\n file_type = m[1];\r\n path = path.substr(m[1].length + 1, path.length); // Strip the type from the path\r\n }\r\n\r\n if (!file_type) {\r\n if ((m = /[.](css|less|html|htm|js)?((\\?|#).*)?$/.exec(path)) !== null) {\r\n // Detect file type via file extension\r\n file_type = m[1];\r\n } else if (!$delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader') && $delegate.jsLoader.hasOwnProperty('load')) {\r\n // requirejs\r\n file_type = 'js';\r\n } else {\r\n $delegate._$log.error('File type could not be determined. ' + path);\r\n return;\r\n }\r\n }\r\n\r\n if ((file_type === 'css' || file_type === 'less') && cssFiles.indexOf(path) === -1) {\r\n cssFiles.push(path);\r\n } else if ((file_type === 'html' || file_type === 'htm') && templatesFiles.indexOf(path) === -1) {\r\n templatesFiles.push(path);\r\n } else if (file_type === 'js' || jsFiles.indexOf(path) === -1) {\r\n jsFiles.push(path);\r\n } else {\r\n $delegate._$log.error('File type is not valid. ' + path);\r\n }\r\n } else if (cachePromise) {\r\n promises.push(cachePromise);\r\n }\r\n };\r\n\r\n if (params.serie) {\r\n pushFile(params.files.shift());\r\n } else {\r\n angular.forEach(params.files, function (path) {\r\n pushFile(path);\r\n });\r\n }\r\n\r\n if (cssFiles.length > 0) {\r\n var cssDeferred = $q.defer();\r\n $delegate.cssLoader(cssFiles, function (err) {\r\n if (angular.isDefined(err) && $delegate.cssLoader.hasOwnProperty('ocLazyLoadLoader')) {\r\n $delegate._$log.error(err);\r\n cssDeferred.reject(err);\r\n } else {\r\n cssDeferred.resolve();\r\n }\r\n }, params);\r\n promises.push(cssDeferred.promise);\r\n }\r\n\r\n if (templatesFiles.length > 0) {\r\n var templatesDeferred = $q.defer();\r\n $delegate.templatesLoader(templatesFiles, function (err) {\r\n if (angular.isDefined(err) && $delegate.templatesLoader.hasOwnProperty('ocLazyLoadLoader')) {\r\n $delegate._$log.error(err);\r\n templatesDeferred.reject(err);\r\n } else {\r\n templatesDeferred.resolve();\r\n }\r\n }, params);\r\n promises.push(templatesDeferred.promise);\r\n }\r\n\r\n if (jsFiles.length > 0) {\r\n var jsDeferred = $q.defer();\r\n $delegate.jsLoader(jsFiles, function (err) {\r\n if (angular.isDefined(err) && $delegate.jsLoader.hasOwnProperty('ocLazyLoadLoader')) {\r\n $delegate._$log.error(err);\r\n jsDeferred.reject(err);\r\n } else {\r\n jsDeferred.resolve();\r\n }\r\n }, params);\r\n promises.push(jsDeferred.promise);\r\n }\r\n\r\n if (promises.length === 0) {\r\n var deferred = $q.defer(),\r\n err = 'Error: no file to load has been found, if you\\'re trying to load an existing module you should use the \\'inject\\' method instead of \\'load\\'.';\r\n $delegate._$log.error(err);\r\n deferred.reject(err);\r\n return deferred.promise;\r\n } else if (params.serie && params.files.length > 0) {\r\n return $q.all(promises).then(function () {\r\n return $delegate.filesLoader(config, params);\r\n });\r\n } else {\r\n return $q.all(promises)['finally'](function (res) {\r\n $delegate.toggleWatch(false); // stop watching angular.module calls\r\n return res;\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Load a module or a list of modules into Angular\r\n * @param module Mixed the name of a predefined module config object, or a module config object, or an array of either\r\n * @param params Object optional parameters\r\n * @returns promise\r\n */\r\n $delegate.load = function (originalModule) {\r\n var originalParams = arguments[1] === undefined ? {} : arguments[1];\r\n\r\n var self = this,\r\n config = null,\r\n deferredList = [],\r\n deferred = $q.defer(),\r\n errText;\r\n\r\n // clean copy\r\n var module = angular.copy(originalModule);\r\n var params = angular.copy(originalParams);\r\n\r\n // If module is an array, break it down\r\n if (angular.isArray(module)) {\r\n // Resubmit each entry as a single module\r\n angular.forEach(module, function (m) {\r\n deferredList.push(self.load(m, params));\r\n });\r\n\r\n // Resolve the promise once everything has loaded\r\n $q.all(deferredList).then(function (res) {\r\n deferred.resolve(res);\r\n }, function (err) {\r\n deferred.reject(err);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n // Get or Set a configuration depending on what was passed in\r\n if (angular.isString(module)) {\r\n config = self.getModuleConfig(module);\r\n if (!config) {\r\n config = {\r\n files: [module]\r\n };\r\n }\r\n } else if (angular.isObject(module)) {\r\n // case {type: 'js', path: lazyLoadUrl + 'testModule.fakejs'}\r\n if (angular.isDefined(module.path) && angular.isDefined(module.type)) {\r\n config = {\r\n files: [module]\r\n };\r\n } else {\r\n config = self.setModuleConfig(module);\r\n }\r\n }\r\n\r\n if (config === null) {\r\n var moduleName = self._getModuleName(module);\r\n errText = 'Module \"' + (moduleName || 'unknown') + '\" is not configured, cannot load.';\r\n $delegate._$log.error(errText);\r\n deferred.reject(new Error(errText));\r\n return deferred.promise;\r\n } else {\r\n // deprecated\r\n if (angular.isDefined(config.template)) {\r\n if (angular.isUndefined(config.files)) {\r\n config.files = [];\r\n }\r\n if (angular.isString(config.template)) {\r\n config.files.push(config.template);\r\n } else if (angular.isArray(config.template)) {\r\n config.files.concat(config.template);\r\n }\r\n }\r\n }\r\n\r\n var localParams = angular.extend({}, params, config);\r\n\r\n // if someone used an external loader and called the load function with just the module name\r\n if (angular.isUndefined(config.files) && angular.isDefined(config.name) && $delegate.moduleExists(config.name)) {\r\n return $delegate.inject(config.name, localParams);\r\n }\r\n\r\n $delegate.filesLoader(config, localParams).then(function () {\r\n $delegate.inject(null, localParams).then(function (res) {\r\n deferred.resolve(res);\r\n }, function (err) {\r\n deferred.reject(err);\r\n });\r\n }, function (err) {\r\n deferred.reject(err);\r\n });\r\n\r\n return deferred.promise;\r\n };\r\n\r\n // return the patched service\r\n return $delegate;\r\n }]);\r\n }]);\r\n})(angular);\r\n(function (angular) {\r\n 'use strict';\r\n\r\n angular.module('oc.lazyLoad').config([\"$provide\", function ($provide) {\r\n $provide.decorator('$ocLazyLoad', [\"$delegate\", \"$q\", function ($delegate, $q) {\r\n /**\r\n * cssLoader function\r\n * @type Function\r\n * @param paths array list of css files to load\r\n * @param callback to call when everything is loaded. We use a callback and not a promise\r\n * @param params object config parameters\r\n * because the user can overwrite cssLoader and it will probably not use promises :(\r\n */\r\n $delegate.cssLoader = function (paths, callback, params) {\r\n var promises = [];\r\n angular.forEach(paths, function (path) {\r\n promises.push($delegate.buildElement('css', path, params));\r\n });\r\n $q.all(promises).then(function () {\r\n callback();\r\n }, function (err) {\r\n callback(err);\r\n });\r\n };\r\n $delegate.cssLoader.ocLazyLoadLoader = true;\r\n\r\n return $delegate;\r\n }]);\r\n }]);\r\n})(angular);\r\n(function (angular) {\r\n 'use strict';\r\n\r\n angular.module('oc.lazyLoad').config([\"$provide\", function ($provide) {\r\n $provide.decorator('$ocLazyLoad', [\"$delegate\", \"$q\", function ($delegate, $q) {\r\n /**\r\n * jsLoader function\r\n * @type Function\r\n * @param paths array list of js files to load\r\n * @param callback to call when everything is loaded. We use a callback and not a promise\r\n * @param params object config parameters\r\n * because the user can overwrite jsLoader and it will probably not use promises :(\r\n */\r\n $delegate.jsLoader = function (paths, callback, params) {\r\n var promises = [];\r\n angular.forEach(paths, function (path) {\r\n promises.push($delegate.buildElement('js', path, params));\r\n });\r\n $q.all(promises).then(function () {\r\n callback();\r\n }, function (err) {\r\n callback(err);\r\n });\r\n };\r\n $delegate.jsLoader.ocLazyLoadLoader = true;\r\n\r\n return $delegate;\r\n }]);\r\n }]);\r\n})(angular);\r\n(function (angular) {\r\n 'use strict';\r\n\r\n angular.module('oc.lazyLoad').config([\"$provide\", function ($provide) {\r\n $provide.decorator('$ocLazyLoad', [\"$delegate\", \"$templateCache\", \"$q\", \"$http\", function ($delegate, $templateCache, $q, $http) {\r\n /**\r\n * templatesLoader function\r\n * @type Function\r\n * @param paths array list of css files to load\r\n * @param callback to call when everything is loaded. We use a callback and not a promise\r\n * @param params object config parameters for $http\r\n * because the user can overwrite templatesLoader and it will probably not use promises :(\r\n */\r\n $delegate.templatesLoader = function (paths, callback, params) {\r\n var promises = [],\r\n filesCache = $delegate._getFilesCache();\r\n\r\n angular.forEach(paths, function (url) {\r\n var deferred = $q.defer();\r\n promises.push(deferred.promise);\r\n $http.get(url, params).success(function (data) {\r\n if (angular.isString(data) && data.length > 0) {\r\n angular.forEach(angular.element(data), function (node) {\r\n if (node.nodeName === 'SCRIPT' && node.type === 'text/ng-template') {\r\n $templateCache.put(node.id, node.innerHTML);\r\n }\r\n });\r\n }\r\n if (angular.isUndefined(filesCache.get(url))) {\r\n filesCache.put(url, true);\r\n }\r\n deferred.resolve();\r\n }).error(function (err) {\r\n deferred.reject(new Error('Unable to load template file \"' + url + '\": ' + err));\r\n });\r\n });\r\n return $q.all(promises).then(function () {\r\n callback();\r\n }, function (err) {\r\n callback(err);\r\n });\r\n };\r\n $delegate.templatesLoader.ocLazyLoadLoader = true;\r\n\r\n return $delegate;\r\n }]);\r\n }]);\r\n})(angular);\r\n// Array.indexOf polyfill for IE8\r\nif (!Array.prototype.indexOf) {\r\n Array.prototype.indexOf = function (searchElement, fromIndex) {\r\n var k;\r\n\r\n // 1. Let O be the result of calling ToObject passing\r\n // the this value as the argument.\r\n if (this == null) {\r\n throw new TypeError('\"this\" is null or not defined');\r\n }\r\n\r\n var O = Object(this);\r\n\r\n // 2. Let lenValue be the result of calling the Get\r\n // internal method of O with the argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n var len = O.length >>> 0;\r\n\r\n // 4. If len is 0, return -1.\r\n if (len === 0) {\r\n return -1;\r\n }\r\n\r\n // 5. If argument fromIndex was passed let n be\r\n // ToInteger(fromIndex); else let n be 0.\r\n var n = +fromIndex || 0;\r\n\r\n if (Math.abs(n) === Infinity) {\r\n n = 0;\r\n }\r\n\r\n // 6. If n >= len, return -1.\r\n if (n >= len) {\r\n return -1;\r\n }\r\n\r\n // 7. If n >= 0, then Let k be n.\r\n // 8. Else, n<0, Let k be len - abs(n).\r\n // If k is less than 0, then let k be 0.\r\n k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\r\n\r\n // 9. Repeat, while k < len\r\n while (k < len) {\r\n // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the\r\n // HasProperty internal method of O with argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n // i. Let elementK be the result of calling the Get\r\n // internal method of O with the argument ToString(k).\r\n // ii. Let same be the result of applying the\r\n // Strict Equality Comparison Algorithm to\r\n // searchElement and elementK.\r\n // iii. If same is true, return k.\r\n if (k in O && O[k] === searchElement) {\r\n return k;\r\n }\r\n k++;\r\n }\r\n return -1;\r\n };\r\n}\r\n//# sourceMappingURL=ocLazyLoad.js.map"]}