sogo/UI/WebServerResources/js/vendor/angular-ui-router.min.js

16 lines
108 KiB
JavaScript
Raw Normal View History

/**
2017-05-04 07:17:26 +02:00
* State-based routing for AngularJS 1.x
2017-05-08 07:23:36 +02:00
* NOTICE: This monolithic bundle also bundles the @uirouter/core code.
* This causes it to be incompatible with plugins that depend on @uirouter/core.
* We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead.
* For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles
2017-06-30 07:28:54 +02:00
* @version v1.0.5
2017-05-04 07:17:26 +02:00
* @link https://ui-router.github.io
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
2017-06-30 07:28:54 +02:00
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("angular")):"function"==typeof define&&define.amd?define(["exports","angular"],e):e(t["@uirouter/angularjs"]=t["@uirouter/angularjs"]||{},t.angular)}(this,function(t,e){"use strict";function r(t){function e(r){return r.length>=n?t.apply(null,r):function(){return e(r.concat([].slice.apply(arguments)))}}var r=[].slice.apply(arguments,[1]),n=t.length;return e(r)}function n(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(null,[].slice.call(arguments).reverse())}function o(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(null,r)&&e.apply(null,r)}}function a(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(null,r)||e.apply(null,r)}}function u(t,e){return function(r){return r[t].apply(r,e)}}function s(t){return function(e){for(var r=0;r<t.length;r++)if(t[r][0](e))return t[r][1](e)}}function c(t){if(re(t)&&t.length){var e=t.slice(0,-1),r=t.slice(-1);return!(e.filter(Dt(te)).length||r.filter(Dt(Zt)).length)}return Zt(t)}function f(t){return t}function l(){}function p(t,e,r,n,i){void 0===i&&(i=!1);var o=function(e){return t()[e].bind(r())},a=function(t){return function(){return e[t]=o(t),e[t].apply(null,arguments)}};return n=n||Object.keys(t()),n.reduce(function(t,e){return t[e]=i?a(e):o(e),t},e)}function h(t,e){return-1!==t.indexOf(e)}function d(t,e){var r=t.indexOf(e);return r>=0&&t.splice(r,1),t}function v(t,e){return t.push(e),e}function m(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=e.concat({}).reverse(),i=ve.apply(null,n);return ve({},i,g(t||{},Object.keys(i)))}function y(t,e){var r=[];for(var n in t.path){if(t.path[n]!==e.path[n])break;r.push(t.path[n])}return r}function g(t,e){var r={};for(var n in t)-1!==e.indexOf(n)&&(r[n]=t[n]);return r}function w(t,e){return Object.keys(t).filter(Dt(ge(e))).reduce(function(e,r){return e[r]=t[r],e},{})}function _(t,e){return b(t,At(e))}function $(t,e){var r=re(t),n=r?[]:{},i=r?function(t){return n.push(t)}:function(t,e){return n[e]=t};return de(t,function(t,r){e(t,r)&&i(t,r)}),n}function S(t,e){var r;return de(t,function(t,n){r||e(t,n)&&(r=t)}),r}function b(t,e){var r=re(t)?[]:{};return de(t,function(t,n){return r[n]=e(t,n)}),r}function R(t,e){return t.push(e),t}function E(t,e){return void 0===e&&(e="assert failure"),function(r){var n=t(r);if(!n)throw new Error(Zt(e)?e(r):e);return n}}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return[];var r,n=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991),i=[];for(r=0;r<n;r++)switch(t.length){case 1:i.push([t[0][r]]);break;case 2:i.push([t[0][r],t[1][r]]);break;case 3:i.push([t[0][r],t[1][r],t[2][r]]);break;case 4:i.push([t[0][r],t[1][r],t[2][r],t[3][r]]);break;default:i.push(t.map(function(t){return t[r]}))}return i}function T(t,e){var r,n;if(re(e)&&(r=e[0],n=e[1]),!te(r))throw new Error("invalid parameters to applyPairs");return t[r]=n,t}function P(t){return t.length&&t[t.length-1]||void 0}function k(t,e){return e&&Object.keys(e).forEach(function(t){return delete e[t]}),e||(e={}),ve(e,t)}function O(t,e,r){if(re(t))return t.forEach(e,r);Object.keys(t).forEach(function(r){return e(t[r],r)})}function x(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var n=Object.keys(r),i=0;i<n.length;i++)t[n[i]]=r[n[i]]}return t}function j(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var r=typeof t;if(r!==typeof e||"object"!==r)return!1;var n=[t,e];if(Nt(re)(n))return I(t,e);if(Nt(ne)(n))return t.getTime()===e.getTime();if(Nt(ie)(n))return t.toString()===e.toString();if(Nt(Zt)(n))return!0;if([Zt,re,ne,ie].map(Ft).reduce(function(t,e){return t||!!e(n)},!1))return!1;var i,o={};for(i in t){if(!j(t[i],e[i]))return!1;o[i]=!0}for(i in e)if(!o[i])return!1;return!0}function I(t,e){return t.length=
},o),u=e.criteriaMatchPath.scope===t.TransitionHookScope.STATE?n.state.self:null,s=new Ke(r,u,i,a);return{hook:i,node:n,transitionHook:s}})};return i.map(a).reduce(Te,[]).sort(D(e.reverseSort)).map(function(t){return t.transitionHook})},e.prototype.getMatchingHooks=function(e,r){var n=e.hookPhase===t.TransitionHookPhase.CREATE,i=this.transition.router.transitionService;return(n?[i]:[this.transition,i]).map(function(t){return t.getHooks(e.name)}).filter(je(re,"broken event named: "+e.name)).reduce(Te,[]).filter(function(t){return t.matches(r)})},e}(),Xe=function(){function t(t){this.pattern=/.*/,this.inherit=!0,ve(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{ParamType:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new N(this,t)},t}(),tr=Object.prototype.hasOwnProperty,er=function(t){return 0===["value","type","squash","array","dynamic"].filter(tr.bind(t||{})).length};!function(t){t[t.PATH=0]="PATH",t[t.SEARCH=1]="SEARCH",t[t.CONFIG=2]="CONFIG"}(t.DefType||(t.DefType={}));var rr=function(){function e(e,r,n,i,o){n=F(n),r=U(n,r,i,e,o.paramTypes);var a=function(){var r={array:i===t.DefType.SEARCH&&"auto"},o=e.match(/\[\]$/)?{array:!0}:{};return ve(r,o,n).array}();r=a?r.$asArray(a,i===t.DefType.SEARCH):r;var u=void 0!==n.value||i===t.DefType.SEARCH,s=Qt(n.dynamic)?!!n.dynamic:!!r.dynamic,c=Qt(n.raw)?!!n.raw:!!r.raw,f=L(n,u,o.defaultSquashPolicy()),l=M(n,a,u,f),p=Qt(n.inherit)?!!n.inherit:!!r.inherit;ve(this,{id:e,type:r,location:i,isOptional:u,dynamic:s,raw:c,squash:f,replace:l,inherit:p,array:a,config:n})}return e.prototype.isDefaultValue=function(t){return this.isOptional&&this.type.equals(this.value(),t)},e.prototype.value=function(t){var e=this;return t=function(t){for(var r=0,n=e.replace;r<n.length;r++){var i=n[r];if(i.from===t)return i.to}return t}(t),Jt(t)?function(){if(e._defaultValueCache)return e._defaultValueCache.defaultValue;if(!se.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=se.$injector.invoke(e.config.$$fn);if(null!==t&&void 0!==t&&!e.type.is(t))throw new Error("Default value ("+t+") for parameter '"+e.id+"' is not an instance of ParamType ("+e.type.name+")");return e.config.$$fn.__cacheable&&(e._defaultValueCache={defaultValue:t}),t}():this.type.$normalize(t)},e.prototype.isSearch=function(){return this.location===t.DefType.SEARCH},e.prototype.validates=function(t){if((Jt(t)||null===t)&&this.isOptional)return!0;var e=this.type.$normalize(t);if(!this.type.is(e))return!1;var r=this.type.encode(e);return!(te(r)&&!this.type.pattern.exec(r))},e.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},e.values=function(t,e){void 0===e&&(e={});for(var r={},n=0,i=t;n<i.length;n++){var o=i[n];r[o.id]=o.value(e[o.id])}return r},e.changed=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),t.filter(function(t){return!t.type.equals(e[t.id],r[t.id])})},e.equals=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),0===e.changed(t,r,n).length},e.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(Ee,!0)},e}(),nr=function(){function t(e){if(e instanceof t){var r=e;this.state=r.state,this.paramSchema=r.paramSchema.slice(),this.paramValues=ve({},r.paramValues),this.resolvables=r.resolvables.slice(),this.views=r.views&&r.views.slice()}else{var n=e;this.state=n,this.paramSchema=n.parameters({inherit:!1}),this.paramValues={},this.resolvables=n.resolvables.map(function(t){return t.clone()})}}return t.prototype.applyRawParams=function(t){var e=function(e){return[e.id,e.value(t[e.id])]};retu
caseInsensitive:e._isCaseInsensitive},t)},this.paramFactory={fromConfig:function(r,n,i){return new rr(r,n,i,t.DefType.CONFIG,e)},fromPath:function(r,n,i){return new rr(r,n,i,t.DefType.PATH,e)},fromSearch:function(r,n,i){return new rr(r,n,i,t.DefType.SEARCH,e)}},ve(this,{UrlMatcher:jr,Param:rr})}return e.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=Qt(t)?t:this._isCaseInsensitive},e.prototype.strictMode=function(t){return this._isStrictMode=Qt(t)?t:this._isStrictMode},e.prototype.defaultSquashPolicy=function(t){if(Qt(t)&&!0!==t&&!1!==t&&!te(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=Qt(t)?t:this._defaultSquashPolicy},e.prototype.compile=function(t,e){return new jr(t,this.paramTypes,this.paramFactory,this._getConfig(e))},e.prototype.isMatcher=function(t){if(!ee(t))return!1;var e=!0;return de(jr.prototype,function(r,n){Zt(r)&&(e=e&&Qt(t[n])&&Zt(t[n]))}),e},e.prototype.type=function(t,e,r){var n=this.paramTypes.type(t,e,r);return Qt(e)?this:n},e.prototype.$get=function(){return this.paramTypes.enqueue=!1,this.paramTypes._flushTypeQueue(),this},e.prototype.dispose=function(){this.paramTypes.dispose()},e}(),Vr=function(){function t(t){this.router=t}return t.prototype.compile=function(t){return this.router.urlMatcherFactory.compile(t)},t.prototype.create=function(t,e){var r=this,n=s([[te,function(t){return n(r.compile(t))}],[Ut(jr),function(t){return r.fromUrlMatcher(t,e)}],[oe,function(t){return r.fromState(t,r.router)}],[Ut(RegExp),function(t){return r.fromRegExp(t,e)}],[Zt,function(t){return new Ar(t,e)}]]),i=n(t);if(!i)throw new Error("invalid 'what' in when()");return i},t.prototype.fromUrlMatcher=function(t,e){function r(e){var r=t.exec(e.path,e.search,e.hash);return t.validates(r)&&r}function n(e){var r=t.parameters().filter(function(t){return t.isOptional});return r.length?r.filter(function(t){return e[t.id]}).length/r.length:1e-6}var i=e;te(e)&&(e=this.router.urlMatcherFactory.compile(e)),Ut(jr)(e)&&(i=function(t){return e.format(t)});var o={urlMatcher:t,matchPriority:n,type:"URLMATCHER"};return ve(new Ar(r,i),o)},t.prototype.fromState=function(t,e){var r=function(r){var n=e.stateService,i=e.globals;n.href(t,r)!==n.href(i.current,i.params)&&n.transitionTo(t,r,{inherit:!0,source:"url"})},n={state:t,type:"STATE"};return ve(this.fromUrlMatcher(t.url,r),n)},t.prototype.fromRegExp=function(t,e){if(t.global||t.sticky)throw new Error("Rule RegExp must not be global or sticky");var r=function(t){return e.replace(/\$(\$|\d{1,2})/,function(e,r){return t["$"===r?0:Number(r)]})},n=te(e)?r:e,i=function(e){return t.exec(e.path)},o={regexp:t,type:"REGEXP"};return ve(new Ar(i,n),o)},t.isUrlRule=function(t){return t&&["type","match","handler"].every(function(e){return Qt(t[e])})},t}(),Ar=function(){function t(t,e){var r=this;this.match=t,this.type="RAW",this.matchPriority=function(t){return 0-r.$id},this.handler=e||f}return t}(),Hr=At("urlMatcher");_r=He(Ae(i(At("priority"),function(t){return-t})),Ae(i(At("type"),function(t){return{STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1}[t]})),function(t,e){return Hr(t)&&Hr(e)?jr.compare(Hr(t),Hr(e)):0},Ae(At("$id"),ge(["REGEXP","RAW","OTHER"])));var qr=function(){function t(e){this._sortFn=_r,this._rules=[],this.interceptDeferred=!1,this._id=0,this._sorted=!1,this._router=e,this.urlRuleFactory=new Vr(e),p(Mt(t.prototype),this,Mt(this))}return t.prototype.dispose=function(){this.listen(!1),this._rules=[],delete this._otherwiseFn},t.prototype.sort=function(t){this._rules.sort(this._sortFn=t||this._sortFn),this._sorted=!0},t.prototype.ensureSorted=function(){this._sorted||this.sort()},t.prototype.match=function(t){var e=this;this.ensureSorted(),t=ve({path:"",search:{},hash:""},t);var r=this.rules();this._otherwiseFn&&r.push(this._otherwiseFn);for(var n,i=0;i<r.length&&(!n||0===this._sortFn(r[i],n.rule));i++){var o=function(r){var n=r.match(t,e._router);return n&&{match:n,rule:r,weight:r.matchPriority(n)}}(r[i]);n=!n||o&&o.weight>n.weight?o:n}return n},t.prototype.sync=function(t){if(!t||!
t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;if(!c(e))return this.viewDecl.controller;var r=se.$injector.annotate(e),n=re(e)?P(e):e;return new ar("",n,r).get(t)},t}(),ei=function(){function t(){var t=this;this._useHttp=Vt.version.minor<3,this.$get=["$http","$templateCache","$injector",function(e,r,n){return t.$templateRequest=n.has&&n.has("$templateRequest")&&n.get("$templateRequest"),t.$http=e,t.$templateCache=r,t}]}return t.prototype.useHttpService=function(t){this._useHttp=t},t.prototype.fromConfig=function(t,e,r){var n=function(t){return se.$q.when(t).then(function(t){return{template:t}})},i=function(t){return se.$q.when(t).then(function(t){return{component:t}})};return Qt(t.template)?n(this.fromString(t.template,e)):Qt(t.templateUrl)?n(this.fromUrl(t.templateUrl,e)):Qt(t.templateProvider)?n(this.fromProvider(t.templateProvider,e,r)):Qt(t.component)?i(t.component):Qt(t.componentProvider)?i(this.fromComponentProvider(t.componentProvider,e,r)):n("<ui-view></ui-view>")},t.prototype.fromString=function(t,e){return Zt(t)?t(e):t},t.prototype.fromUrl=function(t,e){return Zt(t)&&(t=t(e)),null==t?null:this._useHttp?this.$http.get(t,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then(function(t){return t.data}):this.$templateRequest(t)},t.prototype.fromProvider=function(t,e,r){var n=se.$injector.annotate(t),i=re(t)?P(t):t;return new ar("",i,n).get(r)},t.prototype.fromComponentProvider=function(t,e,r){var n=se.$injector.annotate(t),i=re(t)?P(t):t;return new ar("",i,n).get(r)},t.prototype.makeComponentTemplate=function(t,e,r,n){n=n||{};var i=Vt.version.minor>=3?"::":"",o=function(t){var e=W(t);return/^(x|data)-/.exec(e)?"x-"+e:e},a=function(r){var a=r.name,u=r.type,s=o(a);if(t.attr(s)&&!n[a])return s+"='"+t.attr(s)+"'";var c=n[a]||a;if("@"===u)return s+"='{{"+i+"$resolve."+c+"}}'";if("&"===u){var f=e.getResolvable(c),l=f&&f.data,p=l&&se.$injector.annotate(l)||[];return s+"='$resolve."+c+(re(l)?"["+(l.length-1)+"]":"")+"("+p.join(",")+")'"}return s+"='"+i+"$resolve."+c+"'"},u=yt(r).map(a).join(" "),s=o(r);return"<"+s+" "+u+"></"+s+">"},t}(),ri=function(t){return ni(ee(t.bindToController)?t.bindToController:t.scope)},ni=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@&])[?]?(.*)/.exec(t[e])]}).filter(function(t){return Qt(t)&&re(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},ii=function(){function t(e,r){this.stateRegistry=e,this.stateService=r,p(Mt(t.prototype),this,Mt(this))}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return ee(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){return this.stateService.onInvalid(t)},t}(),oi=function(t){return function(e,r){function n(t,e){var r=new pr(t.treeChanges(o)),n=ve(gi(r),{$state$:e,$transition$:t});return se.$injector.invoke(i,this,n)}var i=e[t],o="onExit"===t?"from":"to";return i?n:void 0}},ai=function(){function t(t){this._urlListeners=[],this.$locationProvider=t;var e=Mt(t);p(e,this,e,["hashPrefix"])}return t.prototype.dispose=function(){},t.prototype.onChange=function(t){var e=this;return this._urlListeners.push(t),function(){return we(e._urlListeners)(t)}},t.prototype.html5Mode=function(){var t=this.$locationProvider.html5Mode();return(t=ee(t)?t.enabled:t)&&this.$sniffer.history},t.prototype.url=function(t,e,r){return void 0===e&&(e=!1),t&&this.$location.url(t),e&&this.$location.replace(),r&&this.$location.state(r),this.$location.url()},t.prototype._runtimeServices=function(t,e,r,n){var i=this;this.$location=e,this.$sniffer=r,t.$on("$locationChangeSuccess",function(t){return i._urlListeners.forEach(function(e){return e(t)})});var o=Mt(e),a=Mt(n);p(o,this,o,["replace","path","search","hash"]),p(o,this,o,["port","protocol","host"]),p(a,this,a,["baseHref"])},t.monkeyPatchPathParameterType=function(t){var e=t.urlMatcherFactory.type("path");e.encode=function(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t},e.decode=function(t){return null!=t?t
2017-05-04 07:17:26 +02:00
//# sourceMappingURL=angular-ui-router.min.js.map