(function(){var t,e,r,n,i,o,s,a;this.taiga=a={},a.emojis=window.emojis,this.taigaContribPlugins=this.taigaContribPlugins||window.taigaContribPlugins||[],a.generateHash=function(t){return null==t&&(t=[]),t=_.map(t,function(t){return JSON.stringify(t)}),hex_sha1(t.join(":"))},a.generateUniqueSessionIdentifier=function(){var t,e;return t=(new Date).getTime(),e=Math.floor(150994944*Math.random()),a.generateHash([t,e])},a.sessionId=a.generateUniqueSessionIdentifier(),t=function(t,e,r,n,i,o,s,c,u){var l,p,h,f,d,g,m,v,y;return u.classNameFilter(/^(?:(?!ng-animate-disabled).)*$/),g=t.when,t.when=function(e,r){return r.resolve||(r.resolve={}),angular.extend(r.resolve,{languageLoad:["$q","$translate",function(t,e){var r;return r=t.defer(),e().then(function(){return r.resolve()}),r.promise}],projectLoaded:["$q","tgProjectService","$route",function(t,e,r){var n,i;return n=t.defer(),e.setSection(null!=(i=r.current.$$route)?i.section:void 0),r.current.params.pslug?e.setProjectBySlug(r.current.params.pslug).then(n.resolve):(e.cleanProject(),n.resolve()),n.promise}]}),g.call(t,e,r)},t.when("/",{templateUrl:"home/home.html",controller:"Home",controllerAs:"vm",loader:!0,title:"HOME.PAGE_TITLE",loader:!0,description:"HOME.PAGE_DESCRIPTION",joyride:"dashboard"}),t.when("/discover",{templateUrl:"discover/discover-home/discover-home.html",controller:"DiscoverHome",controllerAs:"vm",title:"PROJECT.NAVIGATION.DISCOVER",loader:!0}),t.when("/discover/search",{templateUrl:"discover/discover-search/discover-search.html",title:"PROJECT.NAVIGATION.DISCOVER",loader:!0,controller:"DiscoverSearch",controllerAs:"vm",reloadOnSearch:!1}),t.when("/projects/",{templateUrl:"projects/listing/projects-listing.html",access:{requiresLogin:!0},title:"PROJECTS.PAGE_TITLE",description:"PROJECTS.PAGE_DESCRIPTION",loader:!0,controller:"ProjectsListing",controllerAs:"vm"}),t.when("/project/new",{title:"PROJECT.CREATE.TITLE",templateUrl:"projects/create/create-project.html",loader:!0,controller:"CreateProjectCtrl",controllerAs:"vm"}),t.when("/project/new/scrum",{title:"PROJECT.CREATE.TITLE",template:'',loader:!0}),t.when("/project/new/kanban",{title:"PROJECT.CREATE.TITLE",template:'',loader:!0}),t.when("/project/new/duplicate",{title:"PROJECT.CREATE.TITLE",template:"",loader:!0}),t.when("/project/new/import/:platform?",{title:"PROJECT.CREATE.TITLE",template:"",loader:!0}),t.when("/project/:pslug/",{templateUrl:"projects/project/project.html",loader:!0,controller:"Project",controllerAs:"vm",section:"project-timeline"}),t.when("/project/:pslug/t/:ref",{loader:!0,controller:"DetailController",template:""}),t.when("/project/:pslug/search",{templateUrl:"search/search.html",reloadOnSearch:!1,section:"search",loader:!0}),t.when("/project/:pslug/epics",{section:"epics",templateUrl:"epics/dashboard/epics-dashboard.html",loader:!0,controller:"EpicsDashboardCtrl",controllerAs:"vm"}),t.when("/project/:pslug/epic/:epicref",{templateUrl:"epic/epic-detail.html",loader:!0,section:"epics"}),t.when("/project/:pslug/backlog",{templateUrl:"backlog/backlog.html",loader:!0,section:"backlog",joyride:"backlog"}),t.when("/project/:pslug/kanban",{templateUrl:"kanban/kanban.html",loader:!0,section:"kanban",joyride:"kanban"}),t.when("/project/:pslug/taskboard/:sslug",{templateUrl:"taskboard/taskboard.html",loader:!0,section:"backlog"}),t.when("/project/:pslug/us/:usref",{templateUrl:"us/us-detail.html",loader:!0,section:"backlog-kanban"}),t.when("/project/:pslug/task/:taskref",{templateUrl:"task/task-detail.html",loader:!0,section:"backlog-kanban"}),t.when("/project/:pslug/wiki",{redirectTo:function(t){return"/project/"+t.pslug+"/wiki/home"}}),t.when("/project/:pslug/wiki-list",{templateUrl:"wiki/wiki-list.html",loader:!0,section:"wiki"}),t.when("/project/:pslug/wiki/:slug",{templateUrl:"wiki/wiki.html",loader:!0,section:"wiki"}),t.when("/project/:pslug/team",{templateUrl:"team/team.html",loader:!0,section:"team"}),t.when("/project/:pslug/issues",{templateUrl:"issue/issues.html",loader:!0,section:"issues"}),t.when("/project/:pslug/issue/:issueref",{templateUrl:"issue/issues-detail.html",loader:!0,section:"issues"}),t.when("/project/:pslug/admin/project-profile/details",{templateUrl:"admin/admin-project-profile.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/default-values",{templateUrl:"admin/admin-project-default-values.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/modules",{templateUrl:"admin/admin-project-modules.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/export",{templateUrl:"admin/admin-project-export.html",section:"admin"}),t.when("/project/:pslug/admin/project-profile/reports",{templateUrl:"admin/admin-project-reports.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/status",{templateUrl:"admin/admin-project-values-status.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/points",{templateUrl:"admin/admin-project-values-points.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/priorities",{templateUrl:"admin/admin-project-values-priorities.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/severities",{templateUrl:"admin/admin-project-values-severities.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/types",{templateUrl:"admin/admin-project-values-types.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/custom-fields",{templateUrl:"admin/admin-project-values-custom-fields.html",section:"admin"}),t.when("/project/:pslug/admin/project-values/tags",{templateUrl:"admin/admin-project-values-tags.html",section:"admin"}),t.when("/project/:pslug/admin/memberships",{templateUrl:"admin/admin-memberships.html",section:"admin"}),t.when("/project/:pslug/admin/roles",{templateUrl:"admin/admin-roles.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/webhooks",{templateUrl:"admin/admin-third-parties-webhooks.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/github",{templateUrl:"admin/admin-third-parties-github.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/gitlab",{templateUrl:"admin/admin-third-parties-gitlab.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/bitbucket",{templateUrl:"admin/admin-third-parties-bitbucket.html",section:"admin"}),t.when("/project/:pslug/admin/third-parties/gogs",{templateUrl:"admin/admin-third-parties-gogs.html",section:"admin"}),t.when("/project/:pslug/admin/contrib/:plugin",{templateUrl:"contrib/main.html"}),t.when("/project/:pslug/transfer/:token",{templateUrl:"projects/transfer/transfer-page.html",loader:!0,controller:"Project",controllerAs:"vm"}),t.when("/user-settings/user-profile",{templateUrl:"user/user-profile.html"}),t.when("/user-settings/user-change-password",{templateUrl:"user/user-change-password.html"}),t.when("/user-settings/mail-notifications",{templateUrl:"user/mail-notifications.html"}),t.when("/user-settings/live-notifications",{templateUrl:"user/live-notifications.html"}),t.when("/change-email/:email_token",{templateUrl:"user/change-email.html"}),t.when("/cancel-account/:cancel_token",{templateUrl:"user/cancel-account.html"}),t.when("/user-settings/contrib/:plugin",{templateUrl:"contrib/user-settings.html"}),t.when("/profile",{templateUrl:"profile/profile.html",loader:!0,access:{requiresLogin:!0},controller:"Profile",controllerAs:"vm"}),t.when("/profile/:slug",{templateUrl:"profile/profile.html",loader:!0,controller:"Profile",controllerAs:"vm"}),t.when("/login",{templateUrl:"auth/login.html",title:"LOGIN.PAGE_TITLE",description:"LOGIN.PAGE_DESCRIPTION",disableHeader:!0,controller:"LoginPage"}),t.when("/register",{templateUrl:"auth/register.html",title:"REGISTER.PAGE_TITLE",description:"REGISTER.PAGE_DESCRIPTION",disableHeader:!0}),t.when("/forgot-password",{templateUrl:"auth/forgot-password.html",title:"FORGOT_PASSWORD.PAGE_TITLE",description:"FORGOT_PASSWORD.PAGE_DESCRIPTION",disableHeader:!0}),t.when("/change-password/:token",{templateUrl:"auth/change-password-from-recovery.html",title:"CHANGE_PASSWORD.PAGE_TITLE",description:"CHANGE_PASSWORD.PAGE_TITLE",disableHeader:!0}),t.when("/invitation/:token",{templateUrl:"auth/invitation.html",title:"INVITATION.PAGE_TITLE",description:"INVITATION.PAGE_DESCRIPTION",disableHeader:!0}),t.when("/external-apps",{templateUrl:"external-apps/external-app.html",title:"EXTERNAL_APP.PAGE_TITLE",description:"EXTERNAL_APP.PAGE_DESCRIPTION",controller:"ExternalApp",controllerAs:"vm",disableHeader:!0,mobileViewport:!0}),t.when("/blocked-project/:pslug/",{templateUrl:"projects/project/blocked-project.html",loader:!0}),t.when("/error",{templateUrl:"error/error.html"}),t.when("/not-found",{templateUrl:"error/not-found.html"}),t.when("/permission-denied",{templateUrl:"error/permission-denied.html"}),t.otherwise({templateUrl:"error/not-found.html"}),e.html5Mode({enabled:!0,requireBase:!1}),f={"Content-Type":"application/json","Accept-Language":window.taigaConfig.defaultLanguage||"en","X-Session-Id":a.sessionId},r.defaults.headers["delete"]=f,r.defaults.headers.patch=f,r.defaults.headers.post=f,r.defaults.headers.put=f,r.defaults.headers.get={"X-Session-Id":a.sessionId},r.useApplyAsync(!0),i.setSessionId(a.sessionId),l=function(t,e,r,n,i){var o;return o=function(o){var s,a;return 0===o.status||o.status===-1&&!o.config.cancelable?(n.closeAll(),i.error()):401===o.status&&e.url().indexOf("/login")===-1&&(s=e.url(),a=e.search(),a.force_next?e.url(r.resolve("login")).search("force_next",a.force_next):e.url(r.resolve("login")).search({unauthorized:!0,next:s})),t.reject(o)},{responseError:o}},n.factory("authHttpIntercept",["$q","$location","$tgNavUrls","lightboxService","tgErrorHandlingService",l]),r.interceptors.push("authHttpIntercept"),d=function(t,e){return{request:function(t){return e.logRequest(),t},requestError:function(r){return e.logResponse(),t.reject(r)},responseError:function(r){return e.logResponse(),t.reject(r)},response:function(t){return e.logResponse(),t}}},n.factory("loaderIntercept",["$q","tgLoader",d]),r.interceptors.push("loaderIntercept"),y=function(t){var e;return e=function(e){var r;return 400===e.status&&e.data.version&&(r=angular.element("body").injector(),r.invoke(["$tgConfirm","$translate",function(t){return function(t,e){var r;return r=e.instant("ERROR.VERSION_ERROR"),t.notify("error",r,null,1e4)}}(this)])),t.reject(e)},{responseError:e}},n.factory("versionCheckHttpIntercept",["$q",y]),r.interceptors.push("versionCheckHttpIntercept"),p=function(t,e){var r,n,i;return r=function(){return e.block()},i=function(t){return t.data.blocked_code&&r(),t},n=function(e){return 451===e.status&&r(),t.reject(e)},{response:i,responseError:n}},n.factory("blockingIntercept",["$q","tgErrorHandlingService",p]),r.interceptors.push("blockingIntercept"),o.debugInfoEnabled(window.taigaConfig.debugInfo||!1),localStorage.userInfo&&(v=JSON.parse(localStorage.userInfo)),m=(null!=v?v.lang:void 0)||window.taigaConfig.defaultLanguage||"en",c.addPart("taiga"),s.useLoader("$translatePartialLoader",{urlTemplate:"/"+window._version+"/locales/{part}/locale-{lang}.json"}).useSanitizeValueStrategy("escapeParameters").addInterpolation("$translateMessageFormatInterpolation").preferredLanguage(m),s.fallbackLanguage(m),h=window.getDecorators(),_.each(h,function(t){return n.decorator(t.provider,t.decorator)})},e=function(t,e){var r;return moment.locale(t),"en"!==t&&ljs.load("/"+window._version+"/locales/moment-locales/"+t+".js"),r={defaultMessage:e.instant("COMMON.FORM_ERRORS.DEFAULT_MESSAGE"),type:{email:e.instant("COMMON.FORM_ERRORS.TYPE_EMAIL"),url:e.instant("COMMON.FORM_ERRORS.TYPE_URL"),urlstrict:e.instant("COMMON.FORM_ERRORS.TYPE_URLSTRICT"),number:e.instant("COMMON.FORM_ERRORS.TYPE_NUMBER"),digits:e.instant("COMMON.FORM_ERRORS.TYPE_DIGITS"),dateIso:e.instant("COMMON.FORM_ERRORS.TYPE_DATEISO"),alphanum:e.instant("COMMON.FORM_ERRORS.TYPE_ALPHANUM"),phone:e.instant("COMMON.FORM_ERRORS.TYPE_PHONE")},notnull:e.instant("COMMON.FORM_ERRORS.NOTNULL"),notblank:e.instant("COMMON.FORM_ERRORS.NOT_BLANK"),required:e.instant("COMMON.FORM_ERRORS.REQUIRED"),regexp:e.instant("COMMON.FORM_ERRORS.REGEXP"),min:e.instant("COMMON.FORM_ERRORS.MIN"),max:e.instant("COMMON.FORM_ERRORS.MAX"),range:e.instant("COMMON.FORM_ERRORS.RANGE"),minlength:e.instant("COMMON.FORM_ERRORS.MIN_LENGTH"),maxlength:e.instant("COMMON.FORM_ERRORS.MAX_LENGTH"),rangelength:e.instant("COMMON.FORM_ERRORS.RANGE_LENGTH"),mincheck:e.instant("COMMON.FORM_ERRORS.MIN_CHECK"),maxcheck:e.instant("COMMON.FORM_ERRORS.MAX_CHECK"),rangecheck:e.instant("COMMON.FORM_ERRORS.RANGE_CHECK"),equalto:e.instant("COMMON.FORM_ERRORS.EQUAL_TO"),linewidth:e.instant("COMMON.FORM_ERRORS.LINEWIDTH"),pikaday:e.instant("COMMON.FORM_ERRORS.PIKADAY")},checksley.updateMessages("default",r)},r=function(t,r,n,i,o,s,c,u,l,p,h,f,d,g){var m,v,y;return t.debug("Initialize application"),r.$on("$translatePartialLoaderStructureChanged",function(){return s.refresh()}),y={linewidth:function(t,e){var r,n;return r=a.nl2br(t).split("
"),n=_.every(r,function(t){return t.length-1}),Promise.setScheduler(function(t){return r.$evalAsync(t)}),i.setupConnection(),n.isAuthenticated()&&(v=n.getUser(),n.showTerms()),o.initialize(),r.$on("$locationChangeStart",function(t){if(f.init(),d.getLightboxOpen().length)return t.preventDefault(),d.closeAll()}),m=r.$on("$routeChangeStart",function(t,e){return e.loader&&p.start(!0),m()}),r.$on("$routeChangeSuccess",function(t,e){var r,i;return e.loader&&p.start(!0),e.access&&e.access.requiresLogin&&(n.isAuthenticated()||c.path(u.resolve("login"))),(e.title||e.description)&&(i=s.instant(e.title||""),r=s.instant(e.description||""),l.setAll(i,r)),e.mobileViewport?l.addMobileViewport():l.removeMobileViewport(),e.disableHeader?h.disableHeader():h.enableHeader()})},angular.module("infinite-scroll").value("THROTTLE_MILLISECONDS",500),s=_.filter(this.taigaContribPlugins,function(t){return t.module}),o=_.map(s,function(t){return t.module}),i=["taigaBase","taigaCommon","taigaResources","taigaResources2","taigaAuth","taigaEvents","taigaHome","taigaNavigationBar","taigaProjects","taigaRelatedTasks","taigaBacklog","taigaTaskboard","taigaKanban","taigaIssues","taigaUserStories","taigaTasks","taigaTeam","taigaWiki","taigaSearch","taigaAdmin","taigaProject","taigaUserSettings","taigaFeedback","taigaPlugins","taigaIntegrations","taigaComponents","taigaProfile","taigaHome","taigaUserTimeline","taigaExternalApps","taigaDiscover","taigaHistory","taigaWikiHistory","taigaEpics","taigaUtils","templates","ngSanitize","ngRoute","ngAnimate","ngAria","pascalprecht.translate","infinite-scroll","tgRepeat"].concat(o),n=angular.module("taiga",i),n.config(["$routeProvider","$locationProvider","$httpProvider","$provide","$tgEventsProvider","$compileProvider","$translateProvider","$translatePartialLoaderProvider","$animateProvider",t]),n.run(["$log","$rootScope","$tgAuth","$tgEvents","$tgAnalytics","$translate","$tgLocation","$tgNavUrls","tgAppMetaService","tgLoader","tgNavigationBarService","tgErrorHandlingService","lightboxService","$tgConfig",r])}).call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty,o=function(t,e){return function(){return t.apply(e,arguments)}};t=function(){function t(){}return t}(),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return n(e,t),e}(t),e=function(t){function e(){return this.onInitialDataError=o(this.onInitialDataError,this),e.__super__.constructor.apply(this,arguments)}return n(e,t),e.prototype.onInitialDataError=function(t){return t&&(404===t.status?this.errorHandlingService.notfound():403===t.status&&this.errorHandlingService.permissionDenied()),this.q.reject(t)},e}(t),this.taiga.Base=t,this.taiga.Service=r,this.taiga.Controller=e}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v,y,b,S,j,k,$,I,E,T,C,P,w,A,O,R=[].indexOf||function(t){for(var e=0,r=this.length;e\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+e+"$2")}}(this),r=function(t){return function(t){var e,r;return e=_.keys(t),r=[],_.forIn(t,function(t,n){if(R.call(e,n)<0&&_.isFunction(t))return r.push(n)}),_.bindAll(t,r)}}(this),n=function(t){return function(t,e,r){var n,i;return i=t.$eval(e),void 0!==i?r(i):(n=null,n=t.$watch(e,function(t){if(void 0!==t)return r(t),n?n():void 0}))}}(this),m=function(){var t,e,r,n,i,o,s,a;for(e=arguments[0],o=2<=arguments.length?M.call(arguments,1):[],t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return U(e,t),e}(e),r=o.length-1;r>=0;r+=-1){i=o[r],a=i.prototype;for(s in a)n=a[s],t.prototype[s]=n}return t},w=function(t,e){return _.trim(t,e)},k=function(t){return t.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-")},O=function(t){return t?_.capitalize(t.replace(/-/g," ")):t},P=function(t,e){var r,n;return r=t.data("nextTextPosition"),(null==r||r>=e.length)&&(r=0),n=e[r],t.data("nextTextPosition",r+1),t.text(n)},p=function(t,e){var r,n,i,o;for(o={},r=0,i=t.length;re&&(n=n.substring(0,e+1),n=n.substring(0,Math.min(n.length,n.lastIndexOf(" "))),n+=r),n):t},j=function(t,e){var r,n,i;return null==e&&(e=1),isNaN(parseFloat(t))||!isFinite(t)?"-":0===t?"0 bytes":(i=["bytes","KB","MB","GB","TB","PB"],r=Math.floor(Math.log(t)/Math.log(1024)),r>5&&(r=5),n=(t/Math.pow(1024,r)).toFixed(e),n+" "+i[r])},I=function(t,e){var r;return e?(r=new RegExp("<(?!"+e+"s*/?)[^>]+>","gi"),String(t).replace(r,"")):String(t).replace(/<\/?[^>]+>/g,"")},b=function(t,e,r){var n;return n=new RegExp("<("+e+")>","gi"),t=t.replace(n,"<"+r+">"),n=new RegExp("","gi"),t=t.replace(n,"")},a=function(t){return function(t,e,r){return Object.defineProperty(t,e,{get:function(){var t;if(!_.isFunction(r))throw"defineImmutableProperty third param must be a function";if(t=r(),t&&_.isObject(t)&&void 0===t.size)throw"defineImmutableProperty must return immutable data";return t}})}}(this),_.mixin({removeKeys:function(t,e){return _.chain([e]).flatten().reduce(function(t,e){return delete t[e],t},t).value()},cartesianProduct:function(){return _.reduceRight(arguments,function(t,e){return _.flatten(_.map(t,function(t){return _.map(e,function(e){return[e].concat(t)})}),!0)},[[]])}}),f=function(t){return null!==t.match(/\.(jpe?g|png|gif|gifv|webm|svg|psd)/i)},h=function(t){return null!=t&&null!==t.match(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)},d=function(t){return null!==t.match(/\.(pdf)/i)},y=function(t,e){var r;return r={},e.forEach(function(e,n){if(e!==t.get(n))return e.toJS?r[n]=e.toJS():r[n]=e}),r},t=["#fce94f","#edd400","#c4a000","#8ae234","#73d216","#4e9a06","#d3d7cf","#fcaf3e","#f57900","#ce5c00","#729fcf","#3465a4","#204a87","#888a85","#ad7fa8","#75507b","#5c3566","#ef2929","#cc0000","#a40000","#222222"],l=function(){return _.sample(t)},c=function(){return _.clone(t)},u=function(t,e,r){var n,i;for(r||(r=1),i=[],n=null;n=e.exec(t);)r===-1?i.push(n):i.push(n[r]);return i},E=this.taiga,E.addClass=e,E.nl2br=v,E.bindMethods=r,E.bindOnce=n,E.mixOf=m,E.trim=w,E.slugify=k,E.unslugify=O,E.toggleText=P,E.groupBy=p,E.timeout=T,E.cancelTimeout=i,E.scopeDefer=S,E.toString=C,E.joinStr=g,E.truncate=A,E.debounce=o,E.debounceLeading=s,E.startswith=$,E.sizeFormat=j,E.stripTags=I,E.replaceTags=b,E.defineImmutableProperty=a,E.isImage=f,E.isEmail=h,E.isPdf=d,E.patch=y,E.getRandomDefaultColor=l,E.getDefaulColorList=c,E.getMatches=u}.call(this),function(){var t,e,r,n,i,o,s,a;o=this.taiga,n=this.taiga.groupBy,i=this.taiga.joinStr,a=this.taiga.trim,s=this.taiga.toString,e=function(){function t(){}return t.prototype.fillUsersAndRoles=function(t,e){var r,i;return r=_.filter(t,function(t){return function(t){return t.is_active}}(this)),this.scope.activeUsers=_.sortBy(r,"full_name_display"),this.scope.activeUsersById=n(this.scope.activeUsers,function(t){return t.id}),this.scope.users=_.sortBy(t,"full_name_display"),this.scope.usersById=n(this.scope.users,function(t){return t.id}),this.scope.roles=_.sortBy(e,"order"),i=_(this.scope.project.members).map("role").uniq().value(),this.scope.computableRoles=_(e).filter("computable").filter(function(t){return _.includes(i,t.id)}).value()},t.prototype.loadUsersAndRoles=function(){var t;return t=this.q.all([this.rs.projects.usersList(this.scope.projectId),this.rs.projects.rolesList(this.scope.projectId)]),t.then(function(t){return function(e){var r,n;return n=e[0],r=e[1],t.fillUsersAndRoles(n,r),e}}(this))},t}(),o.PageMixin=e,t=function(){function t(){}return t.prototype.selectFilter=function(t,e,r){var n,s,c;if(null==r&&(r=!1),c=this.location.search(),void 0!==c[t]&&"page"!==t&&(n=_.map(o.toString(c[t]).split(","),function(t){return a(t)}),n.push(o.toString(e)),n=_.compact(n),e=i(",",_.uniq(n))),!this.location.isInCurrentRouteParams(t,e))return s=r?this.location:this.location.noreload(this.scope),s.search(t,e)},t.prototype.replaceFilter=function(t,e,r){var n;if(null==r&&(r=!1),!this.location.isInCurrentRouteParams(t,e))return n=r?this.location:this.location.noreload(this.scope),n.search(t,e)},t.prototype.replaceAllFilters=function(t,e){var r;return null==e&&(e=!1),r=e?this.location:this.location.noreload(this.scope),r.search(t)},t.prototype.unselectFilter=function(t,e,r){var n,s,c,u;if(null==r&&(r=!1),c=this.location.search(),void 0!==c[t])return void 0!==e&&null!==e||delete c[t],u=_.map(o.toString(c[t]).split(","),function(t){return a(t)}),s=_.reject(u,function(t){return t===o.toString(e)}),s=_.compact(s),e=_.isEmpty(s)?null:i(",",_.uniq(s)),n=r?this.location:this.location.noreload(this.scope),n.search(t,e)},t.prototype.applyStoredFilters=function(t,e){var r;return!(!_.isEmpty(this.location.search())||(r=this.getFilters(t,e),!Object.keys(r).length))&&(this.location.search(r),this.location.replace(),!0)},t.prototype.storeFilters=function(t,e,r){var n,i;return i=t+":"+r,n=o.generateHash([t,i]),this.storage.set(n,e)},t.prototype.getFilters=function(t,e){var r,n;return n=t+":"+e,r=o.generateHash([t,n]),this.storage.get(r)||{}},t.prototype.formatSelectedFilters=function(t,e,r){var n,i,o,s,a;return s=r.split(","),o=_.filter(e,function(t){return s.indexOf(_.toString(t.id))!==-1}),i=_.filter(s,function(t){return!_.find(o,function(e){return _.toString(e.id)===t})}),n=_.map(i,function(e){return{id:e,key:t+":"+e,dataType:t,name:e}}),a=_.map(o,function(e){return{id:e.id,key:t+":"+e.id,dataType:t,name:e.name,color:e.color}}),n.concat(a)},t}(),o.FiltersMixin=t,r=function(){function t(){}return t.prototype.changeQ=function(t){return this.replaceFilter("q",t),this.filtersReloadContent(),this.generateFilters()},t.prototype.removeFilter=function(t){return this.unselectFilter(t.dataType,t.id),this.filtersReloadContent(),this.generateFilters()},t.prototype.addFilter=function(t){return this.selectFilter(t.category.dataType,t.filter.id),this.filtersReloadContent(),this.generateFilters()},t.prototype.selectCustomFilter=function(t){return this.replaceAllFilters(t.filter),this.filtersReloadContent(),this.generateFilters()},t.prototype.saveCustomFilter=function(t){var e,r;return e={},r=this.location.search(),e.tags=r.tags,e.status=r.status,e.assigned_to=r.assigned_to,e.owner=r.owner,e.epic=r.epic,e.role=r.role,this.filterRemoteStorageService.getFilters(this.scope.projectId,this.storeCustomFiltersName).then(function(r){return function(n){return n[t]=e,r.filterRemoteStorageService.storeFilters(r.scope.projectId,n,r.storeCustomFiltersName).then(r.generateFilters)}}(this))},t.prototype.removeCustomFilter=function(t){return this.filterRemoteStorageService.getFilters(this.scope.projectId,this.storeCustomFiltersName).then(function(e){return function(r){return delete r[t.id],e.filterRemoteStorageService.storeFilters(e.scope.projectId,r,e.storeCustomFiltersName).then(e.generateFilters),e.generateFilters()}}(this))},t.prototype.isFilterDataTypeSelected=function(t){var e,r,n,i;for(i=this.selectedFilters,r=0,n=i.length;r0}),n=_.map(o.assigned_to,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.full_name||"Unassigned",t}),c=_.map(o.roles,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.name||"Unassigned",t}),a=_.map(o.owners,function(t){return t.id=t.id.toString(),t.name=t.full_name,t}),s=_.map(o.epics,function(t){return t.id?(t.id=t.id.toString(),t.name="#"+t.ref+" "+t.subject):(t.id="null",t.name="Not in an epic"),t}),t.selectedFilters=[],e.status&&(u=t.formatSelectedFilters("status",l,e.status),t.selectedFilters=t.selectedFilters.concat(u)),e.tags&&(u=t.formatSelectedFilters("tags",p,e.tags),t.selectedFilters=t.selectedFilters.concat(u)),e.assigned_to&&(u=t.formatSelectedFilters("assigned_to",n,e.assigned_to),t.selectedFilters=t.selectedFilters.concat(u)),e.owner&&(u=t.formatSelectedFilters("owner",a,e.owner),t.selectedFilters=t.selectedFilters.concat(u)),e.epic&&(u=t.formatSelectedFilters("epic",s,e.epic),t.selectedFilters=t.selectedFilters.concat(u)),e.role&&(u=t.formatSelectedFilters("role",c,e.role),t.selectedFilters=t.selectedFilters.concat(u)),t.filterQ=e.q,t.filters=[{title:t.translate.instant("COMMON.FILTERS.CATEGORIES.STATUS"),dataType:"status",content:l},{title:t.translate.instant("COMMON.FILTERS.CATEGORIES.TAGS"),dataType:"tags",content:p,hideEmpty:!0,totalTaggedElements:h.length},{title:t.translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"),dataType:"assigned_to",content:n},{title:t.translate.instant("COMMON.FILTERS.CATEGORIES.ROLE"),dataType:"role",content:c},{title:t.translate.instant("COMMON.FILTERS.CATEGORIES.CREATED_BY"),dataType:"owner",content:a},{title:t.translate.instant("COMMON.FILTERS.CATEGORIES.EPIC"),dataType:"epic",content:s}],t.customFilters=[],_.forOwn(i,function(e,r){return t.customFilters.push({id:r,name:r,filter:e})})}}(this))},t}(),o.UsFiltersMixin=r}.call(this),function(){var t;t=angular.module("taigaAdmin",[])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f=function(t,e){function r(){this.constructor=t}for(var n in e)d.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},d={}.hasOwnProperty;h=this.taiga,l=this.taiga.debounce,p=angular.module("taigaAuth",["taigaResources"]),a=function(){function t(t,e,r,n,i){var o;t.isAuthenticated()&&(n.force_login||(o=r.resolve("home"),n.next&&(o=decodeURIComponent(n.next),e.search("next",null)),n.unauthorized?(i.clear(),i.removeToken()):e.url(o)))}return t.$inject=["tgCurrentUserService","$location","$tgNavUrls","$routeParams","$tgAuth"],t}(),p.controller("LoginPage",a),t=function(t){function e(t,r,n,i,o,s,a,c,u,l,p,h){var f;this.rootscope=t,this.storage=r,this.model=n,this.rs=i,this.http=o,this.urls=s,this.config=a,this.translate=c,this.currentUserService=u,this.themeService=l,this.analytics=p,this.termsAnnouncementService=h,e.__super__.constructor.call(this),f=this.getUser(),this._currentTheme=this._getUserTheme(),this.setUserdata(f)}return f(e,t),e.$inject=["$rootScope","$tgStorage","$tgModel","$tgResources","$tgHttp","$tgUrls","$tgConfig","$translate","tgCurrentUserService","tgThemeService","$tgAnalytics","tgTermsAnnouncementService"],e.prototype.setUserdata=function(t){return t?(this.userData=Immutable.fromJS(t.getAttrs()),this.currentUserService.setUser(this.userData)):this.userData=null,this.analytics.setUserId()},e.prototype._getUserTheme=function(){var t;return(null!=(t=this.rootscope.user)?t.theme:void 0)||this.config.get("defaultTheme")||"taiga"},e.prototype._setTheme=function(){var t;if(t=this._getUserTheme(),this._currentTheme!==t)return this._currentTheme=t,this.themeService.use(this._currentTheme)},e.prototype._setLocales=function(){var t,e;return t=(null!=(e=this.rootscope.user)?e.lang:void 0)||this.config.get("defaultLanguage")||"en",this.translate.preferredLanguage(t),this.translate.use(t)},e.prototype.getUser=function(){var t,e;return this.rootscope.user?this.rootscope.user:(e=this.storage.get("userInfo"))?(t=this.model.make_model("users",e),this.rootscope.user=t,this._setLocales(),this._setTheme(),t):(this._setTheme(),null)},e.prototype.setUser=function(t){return this.rootscope.auth=t,this.storage.set("userInfo",t.getAttrs()),this.rootscope.user=t,this.setUserdata(t),this._setLocales(),this._setTheme()},e.prototype.clear=function(){return this.rootscope.auth=null,this.rootscope.user=null,this.storage.remove("userInfo")},e.prototype.setToken=function(t){return this.storage.set("token",t)},e.prototype.getToken=function(){return this.storage.get("token")},e.prototype.removeToken=function(){return this.storage.remove("token")},e.prototype.isAuthenticated=function(){return null!==this.getUser()},e.prototype.refresh=function(){var t;return t=this.urls.resolve("user-me"),this.http.get(t).then(function(t){return function(e,r){var n;return n=e.data,n.token=t.getUser().auth_token,n=t.model.make_model("users",n),t.setUser(n),t.rootscope.$broadcast("auth:refresh",n),n}}(this))},e.prototype.login=function(t,e){var r;return r=this.urls.resolve("auth"),t=_.clone(t,!1),t.type=e?e:"normal",this.removeToken(),this.http.post(r,t).then(function(t){return function(e,r){var n;return n=t.model.make_model("users",e.data),t.setToken(n.auth_token),t.setUser(n),t.rootscope.$broadcast("auth:login",n),n}}(this))},e.prototype.logout=function(){return this.removeToken(),this.clear(),this.currentUserService.removeUser(),this._setTheme(),this._setLocales(),this.rootscope.$broadcast("auth:logout"),this.analytics.setUserId(); },e.prototype.register=function(t,e,r){var n;return n=this.urls.resolve("auth-register"),t=_.clone(t,!1),t.type=e?e:"public","private"===e&&(t.existing=!!r&&r),this.removeToken(),this.http.post(n,t).then(function(t){return function(e){var r;return r=t.model.make_model("users",e.data),t.setToken(r.auth_token),t.setUser(r),t.rootscope.$broadcast("auth:register",r),r}}(this))},e.prototype.getInvitation=function(t){return this.rs.invitations.get(t)},e.prototype.acceptInvitiationWithNewUser=function(t){return this.register(t,"private",!1)},e.prototype.forgotPassword=function(t){var e;return e=this.urls.resolve("users-password-recovery"),t=_.clone(t,!1),this.removeToken(),this.http.post(e,t)},e.prototype.changePasswordFromRecovery=function(t){var e;return e=this.urls.resolve("users-change-password-from-recovery"),t=_.clone(t,!1),this.removeToken(),this.http.post(e,t)},e.prototype.changeEmail=function(t){var e;return e=this.urls.resolve("users-change-email"),t=_.clone(t,!1),this.http.post(e,t)},e.prototype.cancelAccount=function(t){var e;return e=this.urls.resolve("users-cancel-account"),t=_.clone(t,!1),this.http.post(e,t)},e.prototype.exportProfile=function(){var t;return t=this.urls.resolve("users-export"),this.http.post(t)},e.prototype.showTerms=function(t){var e;if(e=this.getUser(),e&&!e.read_new_terms)return this.termsAnnouncementService.show()},e}(h.Service),p.service("$tgAuth",t),c=function(t,e,r,n){var i,o;return i=n.get("auth/login-text.html",!0),o=function(){var n,o,s;return(o=t.get("publicRegisterEnabled"))?(s=e.resolve("register"),r.force_next&&(n=encodeURIComponent(r.force_next),s+="?next="+n),i({url:s})):""},{restrict:"AE",scope:{},template:o}},p.directive("tgPublicRegisterMessage",["$tgConfig","$tgNavUrls","$routeParams","$tgTemplate",c]),s=function(t,e,r,n,i,o,s,a,c,u){var p;return p=function(p,h,f){var d,g,m,v;return d=new checksley.Form(h.find("form.login-form")),i.next&&i.next!==o.resolve("login")?p.nextUrl=decodeURIComponent(i.next):p.nextUrl=o.resolve("home"),i.force_next&&(p.nextUrl=decodeURIComponent(i.force_next)),m=function(e){return s.setupConnection(),u.trackEvent("auth","login","user login",1),t.showTerms(),0===p.nextUrl.indexOf("http")?c.location.href=p.nextUrl:r.url(p.nextUrl)},g=function(t){return e.notify("light-error",a.instant("LOGIN_FORM.ERROR_AUTH_INCORRECT"))},p.onKeyUp=function(t){var e,r;if(e=angular.element(t.currentTarget),r=e.val(),p.iscapsLockActivated=!1,r!==r.toLowerCase())return p.iscapsLockActivated=!0},v=l(2e3,function(e){return function(e){var r,i,o;if(e.preventDefault(),d.validate())return r={username:h.find("form.login-form input[name=username]").val(),password:h.find("form.login-form input[name=password]").val()},i=n.get("loginFormType","normal"),o=t.login(r,i),o.then(m,g)}}(this)),h.on("submit","form",v),window.prerenderReady=!0,p.$on("$destroy",function(){return h.off()})},{link:p}},p.directive("tgLogin",["$tgAuth","$tgConfirm","$tgLocation","$tgConfig","$routeParams","$tgNavUrls","$tgEvents","$translate","$window","$tgAnalytics",s]),u=function(t,e,r,n,i,o,s,a,c){var u;return u=function(u,p,h){var f,d,g,m;return i.get("publicRegisterEnabled")||(r.path(n.resolve("not-found")),r.replace()),u.data={},f=p.find("form").checksley({onlyOneErrorElement:!0}),o.next&&o.next!==n.resolve("login")?u.nextUrl=decodeURIComponent(o.next):u.nextUrl=n.resolve("home"),g=function(t){return s.trackEvent("auth","register","user registration",1),0===u.nextUrl.indexOf("http")?c.location.href=u.nextUrl:r.url(u.nextUrl)},d=function(t){var r;return t.data._error_message&&(r=a.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),e.notify("light-error",r)),f.setErrors(t.data)},m=l(2e3,function(e){return function(e){var r;if(e.preventDefault(),f.validate())return r=t.register(u.data),r.then(g,d)}}(this)),p.on("submit","form",m),u.$on("$destroy",function(){return p.off()}),window.prerenderReady=!0},{link:u}},p.directive("tgRegister",["$tgAuth","$tgConfirm","$tgLocation","$tgNavUrls","$tgConfig","$routeParams","$tgAnalytics","$translate","$window",u]),i=function(t,e,r,n,i){var o;return o=function(o,s,a){var c,u,p,h;return o.data={},c=s.find("form").checksley(),p=function(t){var o,s;return r.path(n.resolve("login")),s=i.instant("FORGOT_PASSWORD_FORM.SUCCESS_TITLE"),o=i.instant("FORGOT_PASSWORD_FORM.SUCCESS_TEXT"),e.success(s,o)},u=function(t){var r;return r=i.instant("FORGOT_PASSWORD_FORM.ERROR"),e.notify("light-error",r)},h=l(2e3,function(e){return function(e){var r;if(e.preventDefault(),c.validate())return r=t.forgotPassword(o.data),r.then(p,u)}}(this)),s.on("submit","form",h),o.$on("$destroy",function(){return s.off()}),window.prerenderReady=!0},{link:o}},p.directive("tgForgotPassword",["$tgAuth","$tgConfirm","$tgLocation","$tgNavUrls","$translate",i]),n=function(t,e,r,n,i,o){var s;return s=function(s,a,c){var u,p,h,f,d;return s.data={},null!=n.token?(s.tokenInParams=!0,s.data.token=n.token):(r.path(i.resolve("login")),d=o.instant("CHANGE_PASSWORD_RECOVERY_FORM.ERROR"),e.notify("light-error",d)),u=a.find("form").checksley(),h=function(t){return r.path(i.resolve("login")),d=o.instant("CHANGE_PASSWORD_RECOVERY_FORM.SUCCESS"),e.success(d)},p=function(t){return d=o.instant("CHANGE_PASSWORD_RECOVERY_FORM.ERROR"),e.notify("light-error",d)},f=l(2e3,function(e){return function(e){var r;if(e.preventDefault(),u.validate())return r=t.changePasswordFromRecovery(s.data),r.then(h,p)}}(this)),a.on("submit","form",f),s.$on("$destroy",function(){return a.off()})},{link:s}},p.directive("tgChangePasswordFromRecovery",["$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls","$translate",n]),o=function(t,e,r,n,i,o,s,a,c){var u;return u=function(u,p,h){var f,d,g,m,v,y,b,S,j,k;return k=i.token,y=t.getInvitation(k),y.then(function(t){return u.invitation=t,u.publicRegisterEnabled=c.get("publicRegisterEnabled")}),y.then(null,function(t){var n;return r.path(o.resolve("login")),n=a.instant("INVITATION_LOGIN_FORM.NOT_FOUND"),e.notify("light-error",n)}),u.dataLogin={token:k},f=p.find("form.login-form").checksley({onlyOneErrorElement:!0}),m=function(t){var n;return s.trackEvent("auth","invitationAccept","invitation accept with existing user",1),r.path(o.resolve("project",{project:u.invitation.project_slug})),n=a.instant("INVITATION_LOGIN_FORM.SUCCESS",{project_name:u.invitation.project_name}),e.notify("success",n)},d=function(t){return e.notify("light-error",t.data._error_message)},S=l(2e3,function(e){return function(e){var r,i;if(e.preventDefault(),f.validate())return i=n.get("loginFormType","normal"),r=u.dataLogin,y=t.login({username:r.username,password:r.password,invitation_token:r.token},i),y.then(m,d)}}(this)),p.on("submit","form.login-form",S),p.on("click",".button-login",S),u.dataRegister={token:k},b=p.find("form.register-form").checksley({onlyOneErrorElement:!0}),v=function(t){return s.trackEvent("auth","invitationAccept","invitation accept with new user",1),r.path(o.resolve("project",{project:u.invitation.project_slug})),e.notify("success","You've successfully joined this project","Welcome to "+_.escape(u.invitation.project_name))},g=function(t){var r;return t.data._error_message&&(r=a.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),e.notify("light-error",r)),b.setErrors(t.data)},j=l(2e3,function(e){return function(e){if(e.preventDefault(),b.validate())return y=t.acceptInvitiationWithNewUser(u.dataRegister),y.then(v,g)}}(this)),p.on("submit","form.register-form",j),p.on("click",".button-register",j),u.$on("$destroy",function(){return p.off()})},{link:u}},p.directive("tgInvitation",["$tgAuth","$tgConfirm","$tgLocation","$tgConfig","$routeParams","$tgNavUrls","$tgAnalytics","$translate","$tgConfig",o]),r=function(t,e,r,n,i,o,s,a){var c;return c=function(e,c,u){var l,p,h,f;return e.data={},e.data.email_token=o.email_token,l=c.find("form").checksley(),h=function(e){var o;return r.isAuthenticated()?t.queryOne("users",r.getUser().id).then(function(t){return function(t){return r.setUser(t),i.path(s.resolve("home")),i.replace()}}(this)):(i.path(s.resolve("login")),i.replace()),o=a.instant("CHANGE_EMAIL_FORM.SUCCESS"),n.success(o)},p=function(t){var e;return e=a.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),n.notify("light-error",e)},f=function(){var t;if(l.validate())return t=r.changeEmail(e.data),t.then(h,p)},c.on("submit",function(t){return t.preventDefault(),f()}),c.on("click","a.button-change-email",function(t){return t.preventDefault(),f()}),e.$on("$destroy",function(){return c.off()})},{link:c}},p.directive("tgChangeEmail",["$tgRepo","$tgModel","$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls","$translate",r]),e=function(t,e,r,n,i,o,s){var a;return a=function(t,e,a){var c,u,p,h;return t.data={},t.data.cancel_token=o.cancel_token,c=e.find("form").checksley(),p=function(t){var e;return r.logout(),i.path(s.resolve("home")),e=$translate.instant("CANCEL_ACCOUNT.SUCCESS"),n.success(e)},u=function(t){var e;return e=$translate.instant("COMMON.GENERIC_ERROR",{error:t.data._error_message}),n.notify("error",e)},h=l(2e3,function(e){return function(e){var n;if(e.preventDefault(),c.validate())return n=r.cancelAccount(t.data),n.then(p,u)}}(this)),e.on("submit","form",h),t.$on("$destroy",function(){return e.off()})},{link:a}},p.directive("tgCancelAccount",["$tgRepo","$tgModel","$tgAuth","$tgConfirm","$tgLocation","$routeParams","$tgNavUrls",e])}.call(this),function(){var t;t=angular.module("taigaBacklog",[])}.call(this),function(){var t,e,r,n,i,o,s;o=this.taiga,r=this.taiga.groupBy,e=this.taiga.bindOnce,i=angular.module("taigaBase",[]),t=function(t,e){var r;return r=function(r,n,i){return e.onresize=function(){return t.$broadcast("resize")}},{link:r}},i.directive("tgMain",["$rootScope","$window",t]),s={home:"/",projects:"/projects",error:"/error","not-found":"/not-found","permission-denied":"/permission-denied",discover:"/discover","discover-search":"/discover/search",login:"/login","forgot-password":"/forgot-password","change-password":"/change-password/:token","change-email":"/change-email/:token","cancel-account":"/cancel-account/:token",register:"/register",invitation:"/invitation/:token","create-project":"/project/new","create-project-scrum":"/project/new/scrum","create-project-kanban":"/project/new/kanban","create-project-duplicate":"/project/new/duplicate","create-project-import":"/project/new/import","create-project-import-platform":"/project/new/import/:platform",profile:"/profile","user-profile":"/profile/:username","blocked-project":"/blocked-project/:project",project:"/project/:project","project-detail-ref":"/project/:project/t/:ref","project-backlog":"/project/:project/backlog","project-taskboard":"/project/:project/taskboard/:sprint","project-kanban":"/project/:project/kanban","project-issues":"/project/:project/issues","project-epics":"/project/:project/epics","project-search":"/project/:project/search","project-epics-detail":"/project/:project/epic/:ref","project-userstories-detail":"/project/:project/us/:ref","project-tasks-detail":"/project/:project/task/:ref","project-issues-detail":"/project/:project/issue/:ref","project-wiki":"/project/:project/wiki","project-wiki-list":"/project/:project/wiki-list","project-wiki-page":"/project/:project/wiki/:slug","project-team":"/project/:project/team","project-admin-home":"/project/:project/admin/project-profile/details","project-admin-project-profile-details":"/project/:project/admin/project-profile/details","project-admin-project-profile-default-values":"/project/:project/admin/project-profile/default-values","project-admin-project-profile-modules":"/project/:project/admin/project-profile/modules","project-admin-project-profile-export":"/project/:project/admin/project-profile/export","project-admin-project-profile-reports":"/project/:project/admin/project-profile/reports","project-admin-project-values-status":"/project/:project/admin/project-values/status","project-admin-project-values-points":"/project/:project/admin/project-values/points","project-admin-project-values-priorities":"/project/:project/admin/project-values/priorities","project-admin-project-values-severities":"/project/:project/admin/project-values/severities","project-admin-project-values-types":"/project/:project/admin/project-values/types","project-admin-project-values-custom-fields":"/project/:project/admin/project-values/custom-fields","project-admin-project-values-tags":"/project/:project/admin/project-values/tags","project-admin-memberships":"/project/:project/admin/memberships","project-admin-roles":"/project/:project/admin/roles","project-admin-third-parties-webhooks":"/project/:project/admin/third-parties/webhooks","project-admin-third-parties-github":"/project/:project/admin/third-parties/github","project-admin-third-parties-gitlab":"/project/:project/admin/third-parties/gitlab","project-admin-third-parties-bitbucket":"/project/:project/admin/third-parties/bitbucket","project-admin-third-parties-gogs":"/project/:project/admin/third-parties/gogs","project-admin-contrib":"/project/:project/admin/contrib/:plugin","user-settings-user-profile":"/user-settings/user-profile","user-settings-user-change-password":"/user-settings/user-change-password","user-settings-user-avatar":"/user-settings/user-avatar","user-settings-mail-notifications":"/user-settings/mail-notifications","user-settings-live-notifications":"/user-settings/live-notifications","user-settings-contrib":"/user-settings/contrib/:plugin"},n=function(t,e){return t.debug("Initialize navigation urls"),e.update(s)},i.run(["$log","$tgNavUrls",n])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v=[].slice,y=function(t,e){function r(){this.constructor=t}for(var n in e)b.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},b={}.hasOwnProperty;m=this.taiga,g=angular.module("taigaCommon",[]),s=function(t,e,r){return{get:function(){var n,i,o,s;return s=r.getUser(),i=s.lang||t.preferredLanguage(),o=e.get("rtlLanguages",[]),n=o.indexOf(i)>-1,{i18n:{previousMonth:t.instant("COMMON.PICKERDATE.PREV_MONTH"),nextMonth:t.instant("COMMON.PICKERDATE.NEXT_MONTH"),months:[t.instant("COMMON.PICKERDATE.MONTHS.JAN"),t.instant("COMMON.PICKERDATE.MONTHS.FEB"),t.instant("COMMON.PICKERDATE.MONTHS.MAR"),t.instant("COMMON.PICKERDATE.MONTHS.APR"),t.instant("COMMON.PICKERDATE.MONTHS.MAY"),t.instant("COMMON.PICKERDATE.MONTHS.JUN"),t.instant("COMMON.PICKERDATE.MONTHS.JUL"),t.instant("COMMON.PICKERDATE.MONTHS.AUG"),t.instant("COMMON.PICKERDATE.MONTHS.SEP"),t.instant("COMMON.PICKERDATE.MONTHS.OCT"),t.instant("COMMON.PICKERDATE.MONTHS.NOV"),t.instant("COMMON.PICKERDATE.MONTHS.DEC")],weekdays:[t.instant("COMMON.PICKERDATE.WEEK_DAYS.SUN"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.MON"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.TUE"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.WED"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.THU"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.FRI"),t.instant("COMMON.PICKERDATE.WEEK_DAYS.SAT")],weekdaysShort:[t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SUN"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.MON"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.TUE"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.WED"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.THU"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.FRI"),t.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SAT")]},isRTL:n,firstDay:parseInt(t.instant("COMMON.PICKERDATE.FIRST_DAY_OF_WEEK"),10),format:t.instant("COMMON.PICKERDATE.FORMAT")}}}},g.factory("tgDatePickerConfigService",["$translate","$tgConfig","$tgAuth",s]),p=function(t,e){var r;return r=function(){return t.getSelection?t.getSelection().toString():e.selection?e.selection.createRange().text:""},{get:r}},g.factory("$selectedText",["$window","$document",p]),n=function(t){var e,r;return r=function(t,e,r){if(e&&r&&e.get("my_permissions").indexOf(r)>-1)return t.removeClass("hidden")},e=function(e,n,i){var o,s,a;return n.addClass("hidden"),o=i.tgCheckPermission,a=e.$watch(function(){return t.project},function(){if(t.project)return r(n,t.project,o),a()}),s=i.$observe("tgCheckPermission",function(e){if(e)return r(n,t.project,e),s()}),e.$on("$destroy",function(){return n.off()})},{link:e}},n.$inject=["tgProjectService"],g.directive("tgCheckPermission",n),i=function(){var t,e;return e="tgClassPermission",t=function(t,r,n){var i,o,s;return i=function(t,e,n){var i;return i="!"===n[0],i&&(n=n.slice(1)),i&&t.my_permissions.indexOf(n)===-1?r.addClass(e):i||t.my_permissions.indexOf(n)===-1?r.removeClass(e):r.addClass(e)},o=function(r){var o,a,c,u;if(r){s(),a=t.$eval(n[e]),u=[];for(o in a)c=a[o],u.push(i(r,o,c));return u}},s=t.$watch("project",o)},{link:t}},g.directive("tgClassPermission",i),t=function(){var t,e,r,n;return e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,r=function(t){return function(t){var i;if(i=n.shift(),i(),n.length)return e(r)}}(this),n=[],t=function(){var t,i,o,s;for(s=[],i=0,o=arguments.length;i-1?t.resolve("project-backlog",r):e.is_kanban_activated&&e.my_permissions.indexOf("view_us")>-1?t.resolve("project-kanban",r):e.is_wiki_activated&&e.my_permissions.indexOf("view_wiki_pages")>-1?t.resolve("project-wiki",r):e.is_issues_activated&&e.my_permissions.indexOf("view_issues")>-1?t.resolve("project-issues",r):t.resolve("project",r)},{get:e}},g.factory("$projectUrl",["$tgNavUrls",c]),u=function(t){var e,r,n;return e=t.defer(),e.resolve(),r=e.promise,n={bindAdd:function(t){return function(e){return function(){var n;return n=1<=arguments.length?v.call(arguments,0):[],r=r.then(function(){return e.apply(t,n)})}}}(this),add:function(t){return function(t){return r=r?r.then(t):t(),n}}(this)}},g.factory("$tgQqueue",["$q",u]),l=function(t){function e(t,e,r,n){this.qqueue=t,this.repo=e,this.q=r,this.model=n}return y(e,t),e.$inject=["$tgQqueue","$tgRepo","$q","$tgModel"],e.prototype.setObject=function(t,e){this.scope=t,this.prop=e},e.prototype.clone=function(){var t,e;return t=_.cloneDeep(this.scope[this.prop]._attrs),e=this.model.make_model(this.scope[this.prop]._name,t)},e.prototype.getObj=function(){return this.scope[this.prop]},e.prototype.save=function(t){var e;return e=this.q.defer(),this.qqueue.add(function(r){return function(){var n,i,o,s,a;return s=r.getObj(),i=s.comment,s.comment="",n=r.clone(),o=_.omit(s._modifiedAttrs,["version"]),n=_.assign(n,o),t(n),i.length&&(n.comment=i),a=function(){return r.scope[r.prop]=n,e.resolve.apply(null,arguments)},r.repo.save(n).then(a,e.reject)}}(this)),e.promise},e}(m.Service),g.service("$tgQueueModelTransformation",l),f=function(t){return{get:function(e){return function(e,r){var n;return null==r&&(r=!1),n=t.get(e),r&&(n=_.template(n)),n}}(this)}},g.factory("$tgTemplate",["$templateCache",f]),r=function(){var t;return t="",{template:t}},g.directive("tgCapslock",[r]),a=function(){var t,e;return e='\n \n',t=function(t,e,r){},{scope:{onClose:"&"},link:t,template:e}},g.directive("tgLightboxClose",[a]),h=function(){var t;return t='\n \n {{svgTitle}}\n {{svgTitleTranslate | translate: svgTitleTranslateValues}}\n \n',{scope:{svgIcon:"@",svgTitle:"@",svgTitleTranslate:"@",svgTitleTranslateValues:"="},template:t}},g.directive("tgSvg",[h]),e=function(t,e,r){return{restrict:"A",link:function(r,n,i){var o;return i.ngShow?(o=e(i.ngShow),r.$watch(o,function(e){if(e===!0)return t(function(){return n[0].focus()})})):t(function(){return n[0].focus()})}}},g.directive("tgAutofocus",["$timeout","$parse","animationFrame",e]),g.directive("tgPreloadImage",function(){var t,e,r;return e="loading...",r="
\n \n
",t=function(t,e){var r;return r=new Image,r.onload=e,r.src=t,r},{template:r,transclude:!0,replace:!0,link:function(r,n,i){var o,s,a;return o=n.find("img:last"),a=null,s=function(){if(n.find(".loading-spinner").remove(),o.show(),a)return clearTimeout(a),a=null},i.$observe("preloadSrc",function(r){return a&&clearTimeout(a),n.find(".loading-spinner").remove(),a=setTimeout(function(){return n.prepend(e)},200),o.hide(),t(r,s)})}}}),o=function(){var t;return t=function(t,e,r){return e.on("click",function(t){if(t.ctrlKey||t.metaKey)return t.preventDefault()})},{link:t}},g.directive("tgCtrlClickDisable",o)}.call(this),function(){var t,e,r,n,i,o,s,a,c;a=this.taiga,o=this.taiga.mixOf,c=this.taiga.toString,i=this.taiga.joinStr,n=this.taiga.groupBy,r=this.taiga.bindOnce,e=this.taiga.bindMethods,s=angular.module("taigaCommon"),t=function(){function t(t,e,r,n,i){this.params=t,this.repo=e,this.projectService=r,this.navurls=n,this.location=i,this.repo.resolve({pslug:this.params.pslug,ref:this.params.ref}).then(function(t){return function(e){var r;return e.issue?r=t.navurls.resolve("project-issues-detail",{project:t.projectService.project.get("slug"),ref:t.params.ref}):e.task?r=t.navurls.resolve("project-tasks-detail",{project:t.projectService.project.get("slug"),ref:t.params.ref}):e.us?r=t.navurls.resolve("project-userstories-detail",{project:t.projectService.project.get("slug"),ref:t.params.ref}):e.epic?r=t.navurls.resolve("project-epics-detail",{project:t.projectService.project.get("slug"),ref:t.params.ref}):e.wikipage&&(r=t.navurls.resolve("project-wiki-page",{project:t.projectService.project.get("slug"),slug:t.params.ref})),t.location.path(r)}}(this))}return t.$inject=["$routeParams","$tgRepo","tgProjectService","$tgNavUrls","$location"],t}(),s.controller("DetailController",t)}.call(this),function(){var t;t=angular.module("taigaEpics",[])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}};o=this.taiga,i=this.taiga.startswith,r=this.taiga.bindMethods,n=angular.module("taigaEvents",[]),e=function(){function t(t,e,n,i,o,a){this.win=t,this.log=e,this.config=n,this.auth=i,this.liveAnnouncementService=o,this.rootScope=a,this.processMessage=s(this.processMessage,this),r(this)}return t.prototype.initialize=function(t){if(this.sessionId=t,this.subscriptions={},this.connected=!1,this.error=!1,this.pendingMessages=[],this.missedHeartbeats=0,this.heartbeatInterval=null,void 0===this.win.WebSocket)return this.log.info("WebSockets not supported on your browser")},t.prototype.setupConnection=function(){var t,e,r,n;if(this.stopExistingConnection(),n=this.config.get("eventsUrl"))return i(n,"ws:")||i(n,"wss:")||(t=this.win.location,r="https:"===t.protocol?"wss:":"ws:",e=_.trimStart(n,"/"),n=r+"//"+t.host+"/"+e),this.error=!1,this.ws=new this.win.WebSocket(n),this.ws.addEventListener("open",this.onOpen),this.ws.addEventListener("message",this.onMessage),this.ws.addEventListener("error",this.onError),this.ws.addEventListener("close",this.onClose)},t.prototype.stopExistingConnection=function(){if(void 0!==this.ws)return this.ws.removeEventListener("open",this.onOpen),this.ws.removeEventListener("close",this.onClose),this.ws.removeEventListener("error",this.onError),this.ws.removeEventListener("message",this.onMessage),this.stopHeartBeatMessages(),this.ws.close(),delete this.ws},t.prototype.notifications=function(){return this.subscribe(null,"notifications",function(t){return function(e){return t.liveAnnouncementService.show(e.title,e.desc),t.rootScope.$digest()}}(this))},t.prototype.liveNotifications=function(){var t,e;if(null!=this.auth.userData)return e=this.auth.userData.get("id"),t=function(t){return function(){return t.subscribe(null,"live_notifications."+e,function(t){var e;if(e=new Notification(t.title,{icon:"/"+window._version+"/images/favicon.png",body:t.body,tag:t.id}),e.onshow=function(){if(t.timeout&&t.timeout>0)return setTimeout(function(){return e.close()},t.timeout)},t.url)return e.onclick=function(){return window.open(t.url)}})}}(this),Notification?"granted"===Notification.permission?t():"denied"!==Notification.permission?Notification.requestPermission(function(e){return function(e){if("granted"===e)return t()}}(this)):void 0:console.log("This browser does not support desktop notification")},t.prototype.startHeartBeatMessages=function(){var t,e,r;if(!this.heartbeatInterval)return e=this.config.get("eventsMaxMissedHeartbeats",5),t=this.config.get("eventsHeartbeatIntervalTime",6e4),r=this.config.get("eventsReconnectTryInterval",1e4),this.missedHeartbeats=0,this.heartbeatInterval=setInterval(function(t){return function(){var r;try{if(t.missedHeartbeats>=e)throw new Error("Too many missed heartbeats PINGs.");return t.missedHeartbeats++,t.sendMessage({cmd:"ping"}),t.log.debug("HeartBeat send PING")}catch(n){return r=n,t.log.error("HeartBeat error: "+r.message),t.setupConnection()}}}(this),t),this.log.debug("HeartBeat enabled")},t.prototype.stopHeartBeatMessages=function(){if(this.heartbeatInterval)return clearInterval(this.heartbeatInterval),this.heartbeatInterval=null,this.log.debug("HeartBeat disabled")},t.prototype.processHeartBeatPongMessage=function(t){return this.missedHeartbeats=0,this.log.debug("HeartBeat recived PONG")},t.prototype.serialize=function(t){return _.isObject(t)?JSON.stringify(t):t},t.prototype.sendMessage=function(t){var e,r,n,i,o;if(this.pendingMessages.push(t),this.connected){for(n=_.map(this.pendingMessages,this.serialize),this.pendingMessages=[],o=[],e=0,r=n.length;e\n
<%- name %>
'),i=function(i,c,u){var l,p,h,f,d;return d=function(t){var e,o,a;return o={name:r.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED")},a=i.usersById[t.assigned_to],e=n.getAvatar(a),o.imgurl=e.url,o.bg=e.bg,a&&(o.name=a.full_name_display),c.find(".avatar").html(s(o)),c.find(".task-assignedto").attr("title",o.name)},l=c.controller(),f=i.$eval(u.tgRelatedTaskAssignedToInlineEdition),h=i.$eval(u.notAutoSave),p=!h,i.$watch(u.tgRelatedTaskAssignedToInlineEdition,function(){return f=i.$eval(u.tgRelatedTaskAssignedToInlineEdition),d(f)}),d(f),c.on("click",".task-assignedto",function(t){return e.$broadcast("assigned-to:add",f)}),a.bindOnce(i,"project",function(t){if(t.my_permissions.indexOf("modify_task")===-1)return c.unbind("click"),c.find("a").addClass("not-clickable")}),i.$on("assigned-to:added",o(2e3,function(e){return function(e,r,n){if(n.id===f.id)return n.assigned_to=r,p&&t.save(n).then(function(){return i.$emit("related-tasks:assigned-to-changed")}),d(n)}}(this))),i.$on("$destroy",function(){return c.off()})},{link:i}},s.directive("tgRelatedTaskAssignedToInlineEdition",["$tgRepo","$rootScope","$translate","tgAvatarService",t])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=this.taiga,t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e}(i.Service),o={auth:"/auth","auth-register":"/auth/register",invitations:"/invitations",users:"/users",by_username:"/users/by_username","users-password-recovery":"/users/password_recovery","users-change-password-from-recovery":"/users/change_password_from_recovery","users-change-password":"/users/change_password","users-change-email":"/users/change_email","users-cancel-account":"/users/cancel","users-export":"/users/export","user-stats":"/users/%s/stats","user-liked":"/users/%s/liked","user-voted":"/users/%s/voted","user-watched":"/users/%s/watched","user-contacts":"/users/%s/contacts","user-me":"/users/me",permissions:"/permissions","notify-policies":"/notify-policies","user-storage":"/user-storage",memberships:"/memberships","bulk-create-memberships":"/memberships/bulk_create",roles:"/roles",permissions:"/permissions",resolver:"/resolver",projects:"/projects","project-templates":"/project-templates","project-modules":"/projects/%s/modules","bulk-update-projects-order":"/projects/bulk_update_order","project-like":"/projects/%s/like","project-unlike":"/projects/%s/unlike","project-watch":"/projects/%s/watch","project-unwatch":"/projects/%s/unwatch","project-contact":"contact","project-transfer-validate-token":"/projects/%s/transfer_validate_token","project-transfer-accept":"/projects/%s/transfer_accept","project-transfer-reject":"/projects/%s/transfer_reject","project-transfer-request":"/projects/%s/transfer_request","project-transfer-start":"/projects/%s/transfer_start","epic-statuses":"/epic-statuses","userstory-statuses":"/userstory-statuses",points:"/points","task-statuses":"/task-statuses","issue-statuses":"/issue-statuses","issue-types":"/issue-types",priorities:"/priorities",severities:"/severities",milestones:"/milestones",epics:"/epics","epic-upvote":"/epics/%s/upvote","epic-downvote":"/epics/%s/downvote","epic-watch":"/epics/%s/watch","epic-unwatch":"/epics/%s/unwatch","epic-related-userstories":"/epics/%s/related_userstories","epic-related-userstories-bulk-create":"/epics/%s/related_userstories/bulk_create",userstories:"/userstories","bulk-create-us":"/userstories/bulk_create","bulk-update-us-backlog-order":"/userstories/bulk_update_backlog_order","bulk-update-us-milestone":"/userstories/bulk_update_milestone","bulk-update-us-miles-order":"/userstories/bulk_update_sprint_order","bulk-update-us-kanban-order":"/userstories/bulk_update_kanban_order","bulk-update-us-milestone":"/userstories/bulk_update_milestone","userstories-filters":"/userstories/filters_data","userstory-upvote":"/userstories/%s/upvote","userstory-downvote":"/userstories/%s/downvote","userstory-watch":"/userstories/%s/watch","userstory-unwatch":"/userstories/%s/unwatch",tasks:"/tasks","bulk-create-tasks":"/tasks/bulk_create","bulk-update-task-taskboard-order":"/tasks/bulk_update_taskboard_order","task-upvote":"/tasks/%s/upvote","task-downvote":"/tasks/%s/downvote","task-watch":"/tasks/%s/watch","task-unwatch":"/tasks/%s/unwatch","task-filters":"/tasks/filters_data",issues:"/issues","bulk-create-issues":"/issues/bulk_create","issues-filters":"/issues/filters_data","issue-upvote":"/issues/%s/upvote","issue-downvote":"/issues/%s/downvote","issue-watch":"/issues/%s/watch","issue-unwatch":"/issues/%s/unwatch",wiki:"/wiki","wiki-restore":"/wiki/%s/restore","wiki-links":"/wiki-links","history/epic":"/history/epic","history/us":"/history/userstory","history/issue":"/history/issue","history/task":"/history/task","history/wiki":"/history/wiki/%s","attachments/epic":"/epics/attachments","attachments/us":"/userstories/attachments","attachments/issue":"/issues/attachments","attachments/task":"/tasks/attachments","attachments/wiki_page":"/wiki/attachments","custom-attributes/epic":"/epic-custom-attributes","custom-attributes/userstory":"/userstory-custom-attributes","custom-attributes/task":"/task-custom-attributes","custom-attributes/issue":"/issue-custom-attributes","custom-attributes-values/epic":"/epics/custom-attributes-values","custom-attributes-values/userstory":"/userstories/custom-attributes-values","custom-attributes-values/task":"/tasks/custom-attributes-values","custom-attributes-values/issue":"/issues/custom-attributes-values",webhooks:"/webhooks","webhooks-test":"/webhooks/%s/test",webhooklogs:"/webhooklogs","webhooklogs-resend":"/webhooklogs/%s/resend","epics-csv":"/epics/csv?uuid=%s","userstories-csv":"/userstories/csv?uuid=%s","tasks-csv":"/tasks/csv?uuid=%s","issues-csv":"/issues/csv?uuid=%s","timeline-profile":"/timeline/profile","timeline-user":"/timeline/user","timeline-project":"/timeline/project",search:"/search",exporter:"/exporter",importer:"/importer/load_dump",feedback:"/feedback",locales:"/locales",applications:"/applications","application-tokens":"/application-tokens","stats-discover":"/stats/discover","importers-trello-auth-url":"/importers/trello/auth_url","importers-trello-authorize":"/importers/trello/authorize","importers-trello-list-projects":"/importers/trello/list_projects","importers-trello-list-users":"/importers/trello/list_users","importers-trello-import-project":"/importers/trello/import_project","importers-jira-auth-url":"/importers/jira/auth_url","importers-jira-authorize":"/importers/jira/authorize","importers-jira-list-projects":"/importers/jira/list_projects","importers-jira-list-users":"/importers/jira/list_users","importers-jira-import-project":"/importers/jira/import_project","importers-github-auth-url":"/importers/github/auth_url","importers-github-authorize":"/importers/github/authorize","importers-github-list-projects":"/importers/github/list_projects","importers-github-list-users":"/importers/github/list_users","importers-github-import-project":"/importers/github/import_project","importers-asana-auth-url":"/importers/asana/auth_url","importers-asana-authorize":"/importers/asana/authorize","importers-asana-list-projects":"/importers/asana/list_projects","importers-asana-list-users":"/importers/asana/list_users","importers-asana-import-project":"/importers/asana/import_project"},r=function(t,e){return t.debug("Initialize api urls"),e.update(o)},e=function(t,e){var r,n,i,o,s;for(t.debug("Initialize resources"),o=_.toArray(arguments).slice(2),s=[],r=0,n=o.length;rn){n=a.length,s.name=i,s.value=a;break}return 0===n?s:s},d=function(t){var e,r,n;r=[];for(e in t)n=t[e],m.find("li."+e).show(),r.push(m.find("li."+e+" .num").html(n.length));return r},f=function(t){return m.find("a.active").removeClass("active"),m.find("li."+t.name+" a").addClass("active"),u=!1,c=t.name},v={epics:r.get("search-epics"),issues:r.get("search-issues"),tasks:r.get("search-tasks"),userstories:r.get("search-userstories"),wikipages:r.get("search-wikipages")},g=function(r){var i,o,s,a,c;return o=n.find(".search-result-table").children(),s=o.scope(),s&&(s.$destroy(),o.remove()),a=t.$new(),a[r.name]=r.value,c=angular.element.parseHTML(l(v[r.name])),i=e(c)(a),n.find(".search-result-table").html(i)},t.$watch("searchResults",function(t){var e;if(h=t)return e=p(t),d(t),g(e),f(e)}),t.$watch("searchTerm",function(t){return void 0!==t&&i.search("text",t),o.trackPage(i.url(),"Search")}),n.on("click",".search-filter li > a",function(e){var r,n,i,o;return e.preventDefault(),o=angular.element(e.currentTarget),i=o.parent().data("name"),n=h?h[i]:[],r={name:i,value:n},t.$apply(function(){return g(r),f(r)})})},s=function(t,e,r){var i,o;return i=e.controller(),a(t,e,r,i),o=n.text,t.$watch("projectId",function(e){if(null!=e)return t.searchTerm=o})},{link:s}},c.directive("tgSearch",["$log","$compile","$templateCache","$routeParams","$tgLocation","$tgAnalytics",r])}.call(this),function(){var t;t=angular.module("taigaTaskboard",[])}.call(this),function(){var t;t=angular.module("taigaTasks",[])}.call(this),function(){var t;t=angular.module("taigaTeam",[])}.call(this),function(){var t;t=angular.module("taigaUserSettings",[])}.call(this),function(){var t;t=angular.module("taigaUserStories",[])}.call(this),function(){var t;t=angular.module("taigaWiki",[])}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=this.taiga,e=angular.module("taigaCommon"),t=function(t){function e(t,e,r,n,i,o){var s;this.rootscope=t,this.log=e,this.config=r,this.win=n,this.doc=i,this.location=o,this.initialized=!1,s=this.config.get("analytics",{}),this.accountId=s.accountId,this.pageEvent=s.pageEvent||"$routeChangeSuccess",this.trackRoutes=s.trackRoutes||!0,this.ignoreFirstPageLoad=s.ignoreFirstPageLoad||!1}return n(e,t),e.$inject=["$rootScope","$log","$tgConfig","$window","$document","$location"],e.prototype.initialize=function(){return this.accountId?(this.injectAnalytics(),this.win.ga("create",this.accountId,"auto"),this.win.ga("require","ec"),this.win.ga("require","displayfeatures"),this.trackRoutes&&!this.ignoreFirstPageLoad&&this.win.ga("send","pageview",this.getUrl()),this.trackRoutes&&this.rootscope.$on(this.pageEvent,function(t){return function(){return t.trackPage(t.getUrl(),"Taiga")}}(this)),this.initialized=!0,this.setUserId()):void this.log.debug("Analytics: no acount id provided. Disabling.")},e.prototype.setUserId=function(){var t,e;if(this.initialized&&this.win.ga)return this.win.ga("set","userId",null!=(t=this.rootscope)&&null!=(e=t.user)?e.uuid:void 0)},e.prototype.getUrl=function(){return this.location.path()},e.prototype.injectAnalytics=function(){var t;return(t=function(t,e,r,n,i,o,s){t.GoogleAnalyticsObject=i,t[i]=t[i]||function(){(t[i].q=t[i].q||[]).push(arguments)},t[i].l=1*new Date,o=e.createElement(r),s=e.getElementsByTagName(r)[0],o.async=1,o.src=n,s.parentNode.insertBefore(o,s)})(window,document,"script","//www.google-analytics.com/analytics.js","ga")},e.prototype.trackPage=function(t,e){if(this.initialized&&this.win.ga)return e=e||this.doc[0].title,this.win.ga("send","pageview",{page:t,title:e})},e.prototype.trackEvent=function(t,e,r,n){if(this.initialized&&this.win.ga)return this.win.ga("send","event",t,e,r,n)},e.prototype.ecViewPlan=function(t){if(this.initialized&&this.win.ga)return this.win.ga("ec:addProduct",{id:t.plan_id,name:t.name,category:"plans",quantity:1,position:1}),this.win.ga("ec:setAction","detail"),this.trackEvent("ecommerce","view-product-detail",t.name,t.plan_id)},e.prototype.ecClickPlan=function(t){if(this.initialized&&this.win.ga)return this.win.ga("ec:addProduct",{id:t.plan_id,name:t.name,category:"plans",quantity:1,position:1}),this.win.ga("ec:setAction","click"),this.trackEvent("ecommerce","click-product",t.name,t.plan_id)},e.prototype.ecListPlans=function(t,e){var r,n,i,o,s;if(o=t[0],this.initialized&&this.win.ga){for(s=1,r=0,n=o.length;r0},g=function(i,o){var s;return s=n.save(function(t){return t.assigned_users=i,t.assigned_to||(t.assigned_to=o),t}),s.then(function(){var e;return i=_.map(i,function(t){return r.usersById[t]}),d(i),e=t.$broadcast("object:updated")}),s.then(null,function(){return e.notify("error")})},f=function(){var e;return e=_.clone(c.$modelValue,!1),t.$broadcast("assigned-user:add",e)},u=function(){var t,e;if(h())return e=a.getUser().get("id"),t=_.clone(c.$modelValue.assigned_users,!1),t.push(e),t=_.uniq(t),g(t,e)},l=function(i){var o;return o=n.save(function(t){var e;return t.assigned_users=i,e=t.assigned_to,$.call(i,e)<0&&i.length>0&&(t.assigned_to=i[0]),0===i.length&&(t.assigned_to=null),t}),o.then(function(){var e,i;return i=n.getObj(),e=_.map(i.assignedUsers,function(t){return r.usersById[t]}),d(e),t.$broadcast("object:updated")}),o.then(null,function(){return item.revert(),e.notify("error")})},d=function(t){return r.assignedUsers=t,r.isEditable=h(),r.isAssigned=p(),r.openAssignedUsers=f,r.assignToMe=u},i.on("click",".remove-user",function(t){var n,i,o,a;if(t.preventDefault(),h())return o=angular.element(t.currentTarget),n=o.data("assigned-user-id"),a=s.instant("COMMON.ASSIGNED_USERS.TITLE_LIGHTBOX_DELETE_ASSIGNED"),i=r.usersById[n].full_name_display,e.askOnDelete(a,i).then(function(t){return function(t){var e;return t.finish(),e=_.clone(c.$modelValue.assigned_users,!1),e=_.pull(e,n),l(e)}}(this))}),r.$on("assigned-user:deleted",function(t,e){var r;return r=_.clone(c.$modelValue.assigned_users,!1),r=_.pull(r,e),r=_.uniq(r),l(r)}),r.$on("assigned-user:added",function(t,e){var r;return r=_.clone(c.$modelValue.assigned_users,!1),r.push(e),r=_.uniq(r),g(r,e)}),r.$watch(o.ngModel,function(t){var e;if(null!=t)return e=_.map(t.assigned_users,function(t){return r.usersById[t]}),e=_.filter(e,function(t){return!!t}),d(e)}),r.$on("$destroy",function(){return i.off()})},{scope:!0,templateUrl:"common/components/assigned-users.html",link:c,require:"ngModel"}},j.directive("tgAssignedUsers",["$rootScope","$tgConfirm","$tgRepo","$tgQueueModelTransformation","$tgTemplate","$compile","$translate","tgCurrentUserService",e]),t=function(t,e,r,n,i,o,s,a,c,u){var l,p;return p=o.get("common/components/assigned-to.html",!0),l=function(r,o,l,h){var f,d,g;return f=function(){var t,e;return(null!=(t=r.project)&&null!=(e=t.my_permissions)?e.indexOf(l.requiredPerm):void 0)!==-1},g=function(r){var s,a,c;return a=h.$modelValue.clone(),a.assigned_to=r,s=n().target(o).start(),c=i.save(function(t){return t.assigned_to=r,t}),c.then(function(){return s.finish(),d(i.getObj()),t.$broadcast("object:updated")}),c.then(null,function(){return e.notify("error"),s.finish()}),c},d=function(t){var e,n,i,l,h,d,g;return e=u.getAvatar(null!=t?t.assigned_to_extra_info:void 0),n=null,null!=(null!=t?t.assigned_to:void 0)?(l=t.assigned_to_extra_info.full_name_display,g=!1,n=e.bg):(l=s.instant("COMMON.ASSIGNED_TO.ASSIGN"),g=!0),d=null!=t?t.is_iocaine:void 0,i={fullName:l,avatar:e.url,bg:n,isUnassigned:g,isEditable:f(),isIocaine:d,fullNameVisible:!(g&&!c.isAuthenticated())},h=a(p(i))(r),o.html(h)},o.on("click",".user-assigned",function(e){if(e.preventDefault(),f())return r.$apply(function(){return t.$broadcast("assigned-to:add",h.$modelValue)})}),o.on("click",".assign-to-me",function(t){if(t.preventDefault(),f())return h.$modelValue.assigned_to=c.getUser().get("id"),g(c.getUser().get("id"))}),o.on("click",".remove-user",function(t){var r;if(t.preventDefault(),f())return r=s.instant("COMMON.ASSIGNED_TO.CONFIRM_UNASSIGNED"),e.ask(r).then(function(t){return function(t){return t.finish(),h.$modelValue.assigned_to=null,g(null)}}(this))}),r.$on("assigned-to:added",function(t,e,r){if(r.id===h.$modelValue.id)return g(e)}),r.$watch(l.ngModel,function(t){return d(t)}),r.$on("$destroy",function(){return o.off()})},{link:l,require:"ngModel"}},j.directive("tgAssignedTo",["$rootScope","$tgConfirm","$tgRepo","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$translate","$compile","tgCurrentUserService","tgAvatarService",t]),r=function(t,e,r){var n,i;return i=r.get("common/components/block-button.html"),n=function(r,n,i,o){var s;return s=function(){return r.project.my_permissions.indexOf("modify_us")!==-1},r.$watch(i.ngModel,function(t){if(t)return s()&&n.find(".item-block").addClass("editable"),t.is_blocked?(n.find(".item-block").removeClass("is-active"),n.find(".item-unblock").addClass("is-active")):(n.find(".item-block").addClass("is-active"),n.find(".item-unblock").removeClass("is-active"))}),n.on("click",".item-block",function(e){return e.preventDefault(),t.$broadcast("block",o.$modelValue)}),n.on("click",".item-unblock",function(r){var i,s;return r.preventDefault(),i=e().target(n.find(".item-unblock")).start(),s=function(){return i.finish()},t.$broadcast("unblock",o.$modelValue,s)}),r.$on("$destroy",function(){return n.off()})},{link:n,restrict:"EA",require:"ngModel",template:i}},j.directive("tgBlockButton",["$rootScope","$tgLoading","$tgTemplate",r]),s=function(t,e,r,n,i){var o,s;return s=i.get("common/components/delete-button.html"),o=function(i,o,s,a){return s.onDeleteGoToUrl?s.onDeleteTitle?(o.on("click",".button-delete",function(t){var o,c;return c=s.onDeleteTitle,o=a.$modelValue.subject,r.askOnDelete(c,o).then(function(t){return function(t){var o;return o=e.remove(a.$modelValue),o.then(function(){var e;return t.finish(),e=i.$eval(s.onDeleteGoToUrl),n.path(e)}),o.then(null,function(){return t.finish(!1),r.notify("error")})}}(this))}),i.$on("$destroy",function(){return o.off()})):t.error("DeleteButtonDirective requires on-delete-title set in scope."):t.error("DeleteButtonDirective requires on-delete-go-to-url set in scope.")},{link:o,restrict:"EA",require:"ngModel",template:s}},j.directive("tgDeleteButton",["$log","$tgRepo","$tgConfirm","$tgLocation","$tgTemplate",s]),c=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemEpicStatus),S(t,"epicStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemEpicStatus",c), d=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemUsStatus),S(t,"usStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemUsStatus",d),h=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemTaskStatus),S(t,"taskStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemTaskStatus",h),a=function(t,e,r){var n,i;return i=t.get("common/components/list-item-assigned-to-avatar.html",!0),n=function(t,n,o){return S(t,"usersById",function(s){var a,c,u,l;return u=t.$eval(o.tgListitemAssignedto),c={name:e.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED")},l=s[u.assigned_to],a=r.getAvatar(l),c.imgurl=a.url,c.bg=a.bg,l&&(c.name=l.full_name_display),n.html(i(c))})},{link:n}},j.directive("tgListitemAssignedto",["$tgTemplate","$translate","tgAvatarService",a]),u=function(){var t;return t=function(t,e,r){var n;return n=t.$eval(r.tgListitemIssueStatus),S(t,"issueStatusById",function(t){return e.html(t[n.status].name)})},{link:t}},j.directive("tgListitemIssueStatus",u),f=function(){var t;return t=function(t,e,r){var n;return n=function(t,r){var n,i;return i=t[r.type],n=e.find(".level"),n.css("background-color",i.color),n.attr("title",i.name)},S(t,"issueTypeById",function(e){var i;return i=t.$eval(r.tgListitemType),n(e,i)}),t.$watch(r.tgListitemType,function(e){return n(t.issueTypeById,e)})},{link:t,templateUrl:"common/components/level.html"}},j.directive("tgListitemType",f),l=function(){var t;return t=function(t,e,r){var n;return n=function(t,r){var n,i;return i=t[r.priority],n=e.find(".level"),n.css("background-color",i.color),n.attr("title",i.name)},S(t,"priorityById",function(e){var i;return i=t.$eval(r.tgListitemPriority),n(e,i)}),t.$watch(r.tgListitemPriority,function(e){return n(t.priorityById,e)})},{link:t,templateUrl:"common/components/level.html"}},j.directive("tgListitemPriority",l),p=function(){var t;return t=function(t,e,r){var n;return n=function(t,r){var n,i;return i=t[r.severity],n=e.find(".level"),n.css("background-color",i.color),n.attr("title",i.name)},S(t,"severityById",function(e){var i;return i=t.$eval(r.tgListitemSeverity),n(e,i)}),t.$watch(r.tgListitemSeverity,function(e){return n(t.severityById,e)})},{link:t,templateUrl:"common/components/level.html"}},j.directive("tgListitemSeverity",p),v=function(t){var e,r,n;return n=t.get("common/components/progress-bar.html",!0),r=function(t,e){return t.html(n({percentage:e}))},e=function(t,e,n){var i;return i=angular.element(e),t.$watch(n.tgProgressBar,function(t){return t=_.max([0,t]),t=_.min([100,t]),r(e,t)}),t.$on("$destroy",function(){return e.off()})},{link:e}},j.directive("tgProgressBar",["$tgTemplate",v]),m=function(t){var e;return e=function(t,e,r){return r.$observe("i18nSectionName",function(e){return t.sectionName=e}),t.$on("$destroy",function(){return e.off()})},{link:e,templateUrl:"common/components/main-title.html",scope:{projectName:"=projectName"}}},j.directive("tgMainTitle",["$translate",m])}.call(this),function(){var t,e,r,n,i,o,s,a,c=function(t,e){function r(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=this.taiga,a=this.taiga.timeout,n=this.taiga.cancelTimeout,i=this.taiga.debounce,r=this.taiga.bindMethods,e={success:{title:"NOTIFICATION.OK",message:"NOTIFICATION.SAVED"},error:{title:"NOTIFICATION.WARNING",message:"NOTIFICATION.WARNING_TEXT"},"light-error":{title:"NOTIFICATION.WARNING",message:"NOTIFICATION.WARNING_TEXT"}},t=function(t){function o(t,e,n,i){this.q=t,this.lightboxService=e,this.loading=n,this.translate=i,r(this)}return c(o,t),o.$inject=["$q","lightboxService","$tgLoading","$translate"],o.prototype.hide=function(t){if(t)return this.lightboxService.close(t),t.off(".confirm-dialog")},o.prototype.ask=function(t,e,r,n){var o,s;return null==n&&(n=".lightbox-generic-ask"),o=this.q.defer(),s=angular.element(n),t&&s.find(".title").text(t),e&&s.find(".subtitle").text(e),r&&s.find(".message").text(r),s.on("click.confirm-dialog",".button-green",i(2e3,function(t){return function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=t.loading().target(n).start(),o.resolve({finish:function(e){if(null==e&&(e=!0),r.finish(),e)return t.hide(s)}})}}(this))),s.on("click.confirm-dialog",".button-red",function(t){return function(e){return e.preventDefault(),o.reject(),t.hide(s)}}(this)),this.lightboxService.open(s),o.promise},o.prototype.askOnDelete=function(t,e,r){return null==r&&(r=this.translate.instant("NOTIFICATION.ASK_DELETE")),this.ask(t,r,e)},o.prototype.askChoice=function(t,e,r,n,o,s){var a,c,u;return null==s&&(s=".lightbox-ask-choice"),c=this.q.defer(),u=angular.element(s),u.find(".title").text(t),u.find(".subtitle").text(e),n?u.find(".replacement").text(n):u.find(".replacement").remove(),o?u.find(".warning").text(o):u.find(".warning").remove(),a=u.find(".choices"),a.html(""),_.each(r,function(t,e){return t=_.escape(t),a.append(angular.element(""))}),u.on("click.confirm-dialog","a.button-green",i(2e3,function(t){return function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=t.loading().target(n).start(),c.resolve({selected:a.val(),finish:function(e){if(null==e&&(e=!0),r.finish(),e)return t.hide(u)}})}}(this))),u.on("click.confirm-dialog",".button-red",function(t){return function(e){return e.preventDefault(),c.reject(),t.hide(u)}}(this)),this.lightboxService.open(u),c.promise},o.prototype.error=function(t){var e,r;return e=this.q.defer(),r=angular.element(".lightbox-generic-error"),r.find(".title").html(t),r.on("click.confirm-dialog",".button-green",function(t){return function(n){return n.preventDefault(),e.resolve(),t.hide(r)}}(this)),r.on("click.confirm-dialog",".close",function(t){return function(n){return n.preventDefault(),e.resolve(),t.hide(r)}}(this)),this.lightboxService.open(r),e.promise},o.prototype.success=function(t,e,r){var n,i,o,a,c;return n=this.q.defer(),o=angular.element(".lightbox-generic-success"),o.find("img").remove(),o.find("svg").remove(),r&&("img"===r.type?i=$("").addClass("lb-icon").attr("src",r.name):"svg"===r.type&&(i=document.createElement("div"),s.addClass(i,"icon"),s.addClass(i,r.name),s.addClass(i,"lb-icon"),a=document.createElementNS("http://www.w3.org/2000/svg","svg"),c=document.createElementNS("http://www.w3.org/2000/svg","use"),c.setAttributeNS("http://www.w3.org/1999/xlink","href","#"+r.name),i.appendChild(a).appendChild(c)),i&&o.find("section").prepend(i)),t&&o.find(".title").html(t),e&&o.find(".message").html(e),o.on("click.confirm-dialog",".button-green",function(t){return function(e){return e.preventDefault(),n.resolve(),t.hide(o)}}(this)),o.on("click.confirm-dialog",".close",function(t){return function(e){return e.preventDefault(),n.resolve(),t.hide(o)}}(this)),this.lightboxService.open(o),n.promise},o.prototype.loader=function(t,e,r){var n;return null==r&&(r=!1),n=angular.element(".lightbox-generic-loading"),t&&n.find(".title").html(t),e&&n.find(".message").html(e),r&&n.find(".spin").removeClass("hidden"),{start:function(t){return function(){return t.lightboxService.open(n)}}(this),stop:function(t){return function(){return t.lightboxService.close(n)}}(this),update:function(t){return function(t,e,r,i){return e&&n.find(".title").html(e),r&&n.find(".message").html(r),i?(n.find(".spin").addClass("hidden"),n.find(".progress-bar-wrapper").removeClass("hidden"),n.find(".progress-bar-wrapper > .bar").width(i+"%"),n.find(".progress-bar-wrapper > span").html(i+"%").css("left",i-9+"%")):(n.find(".spin").removeClass("hidden"),n.find(".progress-bar-wrapper").addClass("hidden"))}}(this)}},o.prototype.notify=function(t,r,i,o){var s,c,u;if(u=".notification-message-"+t,c=angular.element(u),!c.hasClass("active"))return i?c.find("h4").html(i):c.find("h4").html(this.translate.instant(e[t].title)),r?c.find("p").html(r):c.find("p").html(this.translate.instant(e[t].message)),s=angular.element("body"),s.find(".notification-message .notification-light").removeClass("active").addClass("inactive"),s.find(u).removeClass("inactive").addClass("active"),this.tsem&&n(this.tsem),o||(o="error"===t||"light-error"===t?3500:1500),this.tsem=a(o,function(t){return function(){return s.find(u).removeClass("active").addClass("inactive").one("animationend",function(){return $(this).removeClass("inactive")}),delete t.tsem}}(this)),c.on("click",".icon-close, .close",function(t){return function(t){return s.find(u).removeClass("active").addClass("inactive")}}(this))},o}(s.Service),o=angular.module("taigaCommon"),o.service("$tgConfirm",t)}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g=function(t,e){function r(){this.constructor=t}for(var n in e)m.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},m={}.hasOwnProperty;d=this.taiga,u=this.taiga.bindMethods,l=this.taiga.bindOnce,p=this.taiga.debounce,h=d.generateHash,f=angular.module("taigaCommon"),s="text",o="url",i="multiline",n="date",c="url",a=[{key:s,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_TEXT"},{key:i,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_MULTI"},{key:n,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_DATE"},{key:c,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_URL"},{key:o,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_RICHTEXT"}],e=function(t){function e(t,e,r,n,i,o){this.scope=t,this.rootscope=e,this.repo=r,this.rs=n,this.confirm=i,this.q=o,u(this),this.type=null,this.objectId=null,this.projectId=null,this.customAttributes=[],this.customAttributesValues=null}return g(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgResources","$tgConfirm","$q"],e.prototype.initialize=function(t,e){return this.project=this.scope.project,this.type=t,this.objectId=e,this.projectId=this.scope.projectId},e.prototype.loadCustomAttributesValues=function(){return this.objectId?this.rs.customAttributesValues[this.type].get(this.objectId).then(function(t){return function(e){return t.customAttributes=t.project[t.type+"_custom_attributes"],t.customAttributesValues=e,e}}(this)):this.customAttributesValues},e.prototype.getAttributeValue=function(t){var e;return e=_.clone(t,!1),e.value=this.customAttributesValues.attributes_values[t.id],e},e.prototype.updateAttributeValue=function(t){var e,r,n;return n=function(t){return function(){return t.rootscope.$broadcast("custom-attributes-values:edit")}}(this),r=function(t){return function(e){return t.confirm.notify("error"),t.q.reject()}}(this),e=_.clone(this.customAttributesValues.attributes_values,!0),e[t.id]=t.value,this.customAttributesValues.attributes_values=e,this.customAttributesValues.id=this.objectId,this.repo.save(this.customAttributesValues).then(n,r)},e}(d.Controller),r=function(t,r){var n,i,o,s;return o=t.get("custom-attributes/custom-attributes-values.html",!0),n=function(t){return h(["custom-attributes-collapsed",t])},i=function(t,e,i,o){var s,a,c;return s=o[0],a=o[1],c=n(i.type),t.collapsed=r.get(c)||!1,l(t,i.ngModel,function(t){return s.initialize(i.type,t.id),s.loadCustomAttributesValues()}),t.toggleCollapse=function(){return t.collapsed=!t.collapsed,r.set(c,t.collapsed)},t.$on("$destroy",function(){return e.off()})},s=function(t,e){return o({requiredEditionPerm:e.requiredEditionPerm})},{require:["tgCustomAttributesValues","ngModel"],controller:e,controllerAs:"ctrl",restrict:"AE",scope:!0,link:i,template:s}},f.directive("tgCustomAttributesValues",["$tgTemplate","$tgStorage","$translate",r]),t=function(t,e,r,i,o,s){var a,c,u;return c=t.get("custom-attributes/custom-attribute-value.html",!0),u=t.get("custom-attributes/custom-attribute-value-edit.html",!0),a=function(t,a,l,h){var f,d,g,m,v,y;return g=i.instant("COMMON.PICKERDATE.FORMAT"),m=function(e,i){var l,p,h,f,m,v;return null==i&&(i=!1),v=e.type===n&&e.value?moment(e.value,"YYYY-MM-DD").format(g):e.value,h=d(),l={id:e.id,name:e.name,description:e.description,value:v,isEditable:h,type:e.type},m=t.$new(),m.attributeHtml=s.getHTML(v),!h||!i&&v?(f=c(l),f=r(f)(m),a.html(f)):(f=u(l),f=r(f)(m),a.html(f),e.type===n?(p=o.get(),_.merge(p,{field:a.find("input[name=value]")[0],onSelect:function(t){return function(t){var e;return e=t}}(this),onOpen:function(t){return function(){if("undefined"!=typeof selectedDate&&null!==selectedDate)return a.picker.setDate(selectedDate)}}(this)}),a.picker=new Pikaday(p)):void 0)},d=function(){var e,r;return e=t.project.my_permissions,r=l.requiredEditionPerm,e.indexOf(r)>-1},t.saveCustomRichText=function(t){return function(t,e){return f.value=t,h.updateAttributeValue(f).then(function(){return e(),m(f,!1)})}}(this),t.cancelCustomRichText=function(t){return function(){return m(f,!1),null}}(this),y=p(2e3,function(e){return function(e){var r,i;if(e.preventDefault(),r=a.find("form").checksley(),r.validate())return i=a.find("input[name=value], textarea[name='value']"),f.value=i.val(),f.type===n&&moment(f.value,g).isValid()&&(f.value=moment(f.value,g).format("YYYY-MM-DD")),t.$apply(function(){return h.updateAttributeValue(f).then(function(){return m(f,!1)})})}}(this)),v=function(){return a.find("input[name='value'], textarea[name='value']").focus().select()},f=t.$eval(l.tgCustomAttributeValue),null!==f.value&&void 0!==f.value||(f.value=""),t.customAttributeValue=f,m(f),a.on("click",".js-value-view-mode span a",function(t){return t.stopPropagation()}),a.on("click",".js-value-view-mode",function(){if(d()&&!e.get().length)return m(f,!0),v()}),a.on("click",".js-edit-description",function(t){return t.preventDefault(),m(f,!0),v()}),a.on("keyup","input[name=value], textarea[name='value']",function(t){return 13===t.keyCode&&"textarea"!==t.currentTarget.type?y(t):27===t.keyCode?m(f,!1):void 0}),a.on("submit","form",y),a.on("click",".js-save-description",y),t.$on("$destroy",function(){return a.off()})},{link:a,require:"^tgCustomAttributesValues",restrict:"AE"}},f.directive("tgCustomAttributeValue",["$tgTemplate","$selectedText","$compile","$translate","tgDatePickerConfigService","tgWysiwygService",t])}.call(this),function(){var t,e,r,n=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;r=this.taiga,e=angular.module("taigaCommon"),t=function(t){function e(){this.replaceEmojiNameByHtmlImgs=n(this.replaceEmojiNameByHtmlImgs,this),this.replaceEmojiNameByImgs=n(this.replaceEmojiNameByImgs,this),this.replaceImgsByEmojiName=n(this.replaceImgsByEmojiName,this),this.getEmojiByName=n(this.getEmojiByName,this),this.getEmojiById=n(this.getEmojiById,this),this.searchByName=n(this.searchByName,this),this.emojis=_.map(r.emojis,function(t){return t.image="/"+window._version+"/emojis/"+t.image,t}),this.emojisById=_.keyBy(this.emojis,"id"),this.emojisByName=_.keyBy(this.emojis,"name")}return i(e,t),e.$inject=[],e.prototype.searchByName=function(t){return _.filter(this.emojis,function(e){return e.name.indexOf(t)!==-1})},e.prototype.getEmojiById=function(t){return this.emojisById[t]},e.prototype.getEmojiByName=function(t){return this.emojisByName[t]},e.prototype.replaceImgsByEmojiName=function(t){var e,n,i,o,s,a;for(i=r.getMatches(t,/emojis\/([^"]+).png"/gi),o=0,s=i.length;o]+>","g"),e=this.getEmojiById(n),t=t.replace(a,":"+e.name+":");return t},e.prototype.replaceEmojiNameByImgs=function(t){var e,n,i,o,s,a;for(i=r.getMatches(t,/:([\w +-]*):/g),o=0,s=i.length;o'));return t},e}(r.Service),e.service("$tgEmojis",t)}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){return function(){return t.apply(e,arguments)}};o=this.taiga,n=this.taiga.groupBy,i=angular.module("taigaCommon"),e=function(t,e,r,n,i){var o;return o=function(e,r,o,s){return e.$watch(o.ngModel,function(o){var a;if(o)return a=t.create(r,o,e.project),a.onSelectedPointForRole=function(t,r,n){return o.points=n,a.render(),e.$apply(function(){return s.$setViewValue(o)})},a.render=function(){var t,r,o,s;return t={totalPoints:this.calculateTotalPoints(),roles:this.calculateRoles(),editable:this.isEditable,loading:!1},o="common/estimation/us-estimation-points-per-role.html",s=n.get(o,!0),r=s(t),r=i(r)(e),this.$el.html(r)},a.render()}),e.$on("$destroy",function(){return r.off()})},{link:o,restrict:"EA",require:"ngModel"}},i.directive("tgLbUsEstimation",["$tgEstimationsService","$rootScope","$tgRepo","$tgTemplate","$compile",e]),r=function(t,e,r,n,i,o,s){var a;return a=function(r,a,c,u){var l;return l=function(t){var e,r;return r=o.save(function(e){return function(e){return e.points=t,e}}(this)),e=function(t){return function(){return s.notify("error")}}(this),r.then(null,e)},r.$watchCollection(function(){return u.$modelValue&&u.$modelValue.points},function(){var o,s;if(s=u.$modelValue)return o=t.create(a,s,r.project),o.onSelectedPointForRole=function(t,r,n){return o.loading=t,o.render(),l(n).then(function(){return o.loading=!1,e.$broadcast("object:updated"),o.render()})},o.render=function(){var t,e,s,a;return t={totalPoints:this.calculateTotalPoints(),roles:this.calculateRoles(),editable:this.isEditable,loading:o.loading},s="common/estimation/us-estimation-points-per-role.html",a=n.get(s,!0),e=a(t),e=i(e)(r),this.$el.html(e)},o.render()}),r.$on("$destroy",function(){return a.off()})},{link:a,restrict:"EA",require:"ngModel"}},i.directive("tgUsEstimation",["$tgEstimationsService","$rootScope","$tgRepo","$tgTemplate","$compile","$tgQueueModelTransformation","$tgConfirm",r]),t=function(t,e,r,i,o){var a,c,u;return u=t.get("common/estimation/us-estimation-points.html",!0),a=function(){function t(t,e,r){this.$el=t,this.us=e,this.project=r,this.bindClickEvents=s(this.bindClickEvents,this),this.isEditable=this.project.my_permissions.indexOf("modify_us")!==-1,this.roles=this.project.roles,this.points=this.project.points,this.loading=!1,this.pointsById=n(this.points,function(t){return t.id}),this.onSelectedPointForRole=function(t,e){},this.render=function(){}}return t.prototype.save=function(t,n){var s;return s=i.defer(),o.add(function(t){return function(){var n,i;return i=function(){return s.resolve(),t.render()},n=function(){return r.notify("error"),t.us.revert(),t.render(),s.reject()},e.save(t.us).then(i,n)}}(this)),s.promise},t.prototype.calculateTotalPoints=function(){var t,e;return e=_.map(this.us.points,function(t){return function(e,r){var n;return null!=(n=t.pointsById[e])?n.value:void 0}}(this)),0===e.length?"?":(t=_.filter(e,function(t){return null!=t}),0===t.length?"?":_.reduce(t,function(t,e){return t+e}))},t.prototype.calculateRoles=function(){var t,e;return t=_.filter(this.project.roles,"computable"),e=_.map(t,function(t){return function(e){var r,n;return r=t.us.points[e.id],n=t.pointsById[r],e=_.clone(e,!0),e.points=null!=n&&null!=n.name?n.name:"?",e}}(this))},t.prototype.bindClickEvents=function(){return this.$el.on("click",".total.clickable",function(t){return function(e){var r,n;return e.preventDefault(),e.stopPropagation(),n=angular.element(e.currentTarget),r=n.data("role-id"),t.renderPointsSelector(r,n),n.siblings().removeClass("active"),n.addClass("active")}}(this)),this.$el.on("click",".point",function(t){return function(e){var r,n,i,o;return e.preventDefault(),e.stopPropagation(),o=angular.element(e.currentTarget),i=o.data("role-id"),r=o.data("point-id"),t.$el.find(".popover").popover().close(),n=_.clone(t.us.points,!0),n[i]=r,t.onSelectedPointForRole(i,r,n)}}(this))},t.prototype.renderPointsSelector=function(t,e){var r,n,i,o,s;if(o=_.map(this.points,function(e){return function(r){return r=_.clone(r,!0),r.selected=e.us.points[t]!==r.id,r}}(this)),i=5,r=_.some(o,function(t){return function(t){return t.name.length>i}}(this)),n=u({points:o,roleId:t,horizontal:r}),this.$el.find(".popover").popover().close(),this.$el.find(".pop-points-open").remove(),null!=e?this.$el.find(e).append(n):this.$el.append(n),this.$el.find(".pop-points-open").popover().open(function(){return $(this).removeClass("active").closest("li").removeClass("active")}),this.$el.find(".pop-points-open").show(),s=this.$el.find(".pop-points-open"),s.offset().top+s.height()>document.body.clientHeight)return s.addClass("pop-bottom")},t}(),c=function(t,e,r){var n;return t.unbind("click"),n=new a(t,e,r),n.isEditable&&n.bindClickEvents(),n},{create:c}},i.factory("$tgEstimationsService",["$tgTemplate","$tgRepo","$tgConfirm","$q","$tgQqueue",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f;l=this.taiga,s=angular.module("taigaCommon"),r=function(){return function(t,e){return t===[null,void 0]?e:t}},s.filter("default",r),f=function(t){return function(e){return e?t.instant("COMMON.YES"):t.instant("COMMON.NO")}},s.filter("yesNo",["$translate",f]),h=function(){return l.unslugify},s.filter("unslugify",h),a=function(){return function(t,e){return t?moment(t).format(e):""}},s.filter("momentFormat",a),c=function(){return function(t,e){return t?moment(t).fromNow(e||!1):""}},s.filter("momentFromNow",c),u=function(t){return function(){return t.taiga.sizeFormat}}(this),s.filter("sizeFormat",u),p=function(){var t,e;return e=function(t){return t.toJS()},t=_.memoize(e),function(e){return e instanceof Immutable.List?t(e):e}},s.filter("toMutable",p),t=function(t){return function(e,r){var n;return(null!=r?r.startsWith("#"):void 0)?(n=r.substr(1),_.filter(e,function(t){return function(t){return String(t.ref).startsWith(n)}}(this))):t(e,r)}},s.filter("byRef",["filterFilter",t]),e=function(){return function(t,e){var r,n,i,o,s,a,c,u;for(t=new String(t).replace(/[^0-9a-f]/gi,""),t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0,a="#",n=0,i=0,r=0,u=255,c=[0,1,2],o=0,s=c.length;o5},a=d(r),a=n(a)(o),s.find(".assigned-to-list").html(a)},c=function(){return e.stop(),t.close(s)},o.$on("assigned-to:add",function(r,n){var i;return h=n,i=n.assigned_to,f=o.usersById[i],p(f),t.open(s).then(function(){return s.find("input").focus(),e.init(s)})}),o.$watch("usersSearch",function(t){if(null!=t)return p(f,t),s.find("input").focus()}),s.on("click",".user-list-single",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),c(),o.$apply(function(){return o.$broadcast("assigned-to:added",e.data("user-id"),h),o.usersSearch=null})}),s.on("click",".remove-assigned-to",function(t){return t.preventDefault(),t.stopPropagation(),c(),o.$apply(function(){return o.usersSearch=null,o.$broadcast("assigned-to:added",null,h)})}),s.on("click",".close",function(t){return t.preventDefault(),c(),o.$apply(function(){return o.usersSearch=null})}),o.$on("$destroy",function(){return s.off()})},{templateUrl:"common/lightbox/lightbox-assigned-to.html",link:o}},d.directive("tgLbAssignedto",["lightboxService","lightboxKeyboardNavigationService","$tgTemplate","$compile","tgAvatarService",t]),e=function(t,e,r,n,i,o){var s;return s=function(t,s,a){var c,u,l,p,h,d,g;return d=[],h=null,g=n.get("common/lightbox/lightbox-assigned-users-users.html",!0),l=function(t){var e;return e=t,e=e.replace("Á","A").replace("Ä","A").replace("À","A"),e=e.replace("É","E").replace("Ë","E").replace("È","E"),e=e.replace("Í","I").replace("Ï","I").replace("Ì","I"),e=e.replace("Ó","O").replace("Ö","O").replace("Ò","O"),e=e.replace("Ú","U").replace("Ü","U").replace("Ù","U")},u=function(t,e){var r;return r=e.full_name_display.toUpperCase(),r=l(r),t=t.toUpperCase(),t=l(t),_.includes(r,t)},p=function(e,r){var n,a,c,l,p;return l=_.clone(t.activeUsers,!0),l=_.sortBy(l,function(e){return e.id===t.user.id?0:e.id}),null!=r&&(l=_.filter(l,_.partial(u,r))),c=[],_.map(l,function(t){var r;if(r=t.id,S.call(e,r)>=0)return t.avatar=o.getAvatar(t),c.push(t)}),p=[],_.map(l,function(t){var r;if(r=t.id,S.call(e,r)<0)return t.avatar=o.getAvatar(t),p.push(t)}),n={selected:c,users:_.slice(p,0,5),showMore:l.length>5},a=g(n),a=i(a)(t),s.find(".assigned-to-list").html(a)},c=function(){return r.stop(),e.close(s)},t.$on("assigned-user:add",function(t,n){return h=n,d=n.assigned_users,p(d),e.open(s).then(function(){return s.find("input").focus(),r.init(s)})}),t.$watch("usersSearch",function(t){if(null!=t)return p(d,t),s.find("input").focus()}),s.on("click",".user-list-single",f(200,function(e){var r;return c(),e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return t.usersSearch=null,t.$broadcast("assigned-user:added",r.data("user-id"),h)})})),s.on("click",".remove-assigned-to",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),e.stopPropagation(),t.$apply(function(){return t.usersSearch=null,t.$broadcast("assigned-user:deleted",r.data("user-id"),h)}),c()}),s.on("click",".close",function(t){return t.preventDefault(),c()}),t.$on("$destroy",function(){return s.off()})},{templateUrl:"common/lightbox/lightbox-assigned-users.html",link:s}},d.directive("tgLbAssignedUsers",["$tgRepo","lightboxService","lightboxKeyboardNavigationService","$tgTemplate","$compile","tgAvatarService",e]),p=function(t,e,r,n,i,o){var s;return s=function(t,s,a){var c,u,l,p,h;return p=null,h=n.get("common/lightbox/lightbox-assigned-to-users.html",!0),u=function(e){var r,n;return null==e&&(e=""),r=function(t,e){var r;return(!p||!_.find(p.watchers,function(t){return t===e.id}))&&(r=e.full_name_display.toUpperCase(),t=t.toUpperCase(),_.includes(r,t))},n=_.clone(t.activeUsers,!0),n=_.filter(n,_.partial(r,e))},l=function(e){var r,n,a;return a=_.slice(e,0,5),a=_.map(a,function(t){return t.avatar=o.getAvatar(t),t}),r={selected:!1,users:a,showMore:e.length>5},n=h(r),n=i(n)(t),s.find(".ticket-watchers").html(n)},c=function(){return r.stop(),e.close(s)},t.$on("watcher:add",function(t,n){var i;return p=n,i=u(),l(i),e.open(s).then(function(){return s.find("input").focus(),r.init(s)})}),t.$watch("usersSearch",function(t){var e;if(null!=t)return e=u(t),l(e),s.find("input").focus()}),s.on("click",".user-list-single",f(200,function(e){var r;return c(),e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return t.usersSearch=null,t.$broadcast("watcher:added",r.data("user-id"))})})),s.on("click",".close",function(e){return e.preventDefault(),c(),t.$apply(function(){return t.usersSearch=null})}),t.$on("$destroy",function(){return s.off()})},{templateUrl:"common/lightbox/lightbox-users.html",link:s}},d.directive("tgLbWatchers",["$tgRepo","lightboxService","lightboxKeyboardNavigationService","$tgTemplate","$compile","tgAvatarService",p]),c=function(t,e,r){var n;return n=function(e,r,n){return t.open(r)},{templateUrl:"common/lightbox/lightbox-leave-project-warning.html",link:n,scope:!0}},d.directive("tgLightboxLeaveProjectWarning",["lightboxService",c]),l=function(t,e,r,n,i){var o;return o=function(o,s,a){var c,u,l;return c=r.instant("COMMON.PICKERDATE.FORMAT"),t.open(s),o.object.due_date&&(o.new_due_date=moment(o.object.due_date).format(c)),s.on("click",".suggestion",function(t){var e,r,n,i;return r=angular.element(t.currentTarget),e=r.data("quantity"),n=r.data("unit"),i=moment().add(e,n).format(c),s.find(".due-date").val(i)}),l=function(){var r,o;return r=e().target(s.find(".submit-button")).start(),o=i.save(function(t){var e;return e=$(".due-date").val(),t.due_date=e?moment(e,c).format("YYYY-MM-DD"):null,t}),o.then(function(){return n.notify("success")}),o.then(null,function(){return n.notify("error")}),o["finally"](function(){return r.finish(),t.close(s)})},s.on("click",".submit-button",function(t){return t.preventDefault(),l()}),u=function(){var t,e,i;return i=r.instant("LIGHTBOX.DELETE_DUE_DATE.TITLE"),e=r.instant("LIGHTBOX.DELETE_DUE_DATE.SUBTITLE"),t=moment(o.object.due_date).format(c),n.askOnDelete(i,t,e).then(function(t){return t.finish(),$(".due-date").val(null),o.object.due_date_reason=null,l()})},s.on("click",".delete-due-date",function(t){return t.preventDefault(),u()})},{templateUrl:"common/lightbox/lightbox-due-date.html",link:o,scope:!0}},d.directive("tgLbSetDueDate",["lightboxService","$tgLoading","$translate","$tgConfirm","$tgQueueModelTransformation",l])}.call(this),function(){var t,e,r,n,i,o;i=this.taiga,n=this.taiga.sizeFormat,o=this.taiga.timeout,r=angular.module("taigaCommon"),e=function(t,e){var r;return r=function(e,r,n){return t.onStart(function(){return $(document.body).addClass("loader-active"),r.addClass("active")}),t.onEnd(function(){return $(document.body).removeClass("loader-active"),r.removeClass("active")})},{link:r}},r.directive("tgLoader",["tgLoader","$rootScope",e]),t=function(t){var e,r,n,i,s,a,c,u;return r={minTime:300},i=!1,u=0,a=0,n=0,s=function(e){var s,c,l;return null==e&&(e=!1),u&&(l=0,e||(c=(new Date).getTime(),s=c-u,s",function(){var r;return r={settings:{target:null,scope:null,classes:[],timeout:0,template:null},target:function(t){return r.settings.target=t,r},scope:function(t){return r.settings.scope=t,r},template:function(t){return r.settings.template=t,r},removeClasses:function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],r.settings.classes=t,r},timeout:function(t){return r.settings.timeout=t,r},start:function(){var t,n;return t=r.settings.target,r.settings.classes.map(function(e){return t.removeClass(e)}),t.hasClass("loading")||r.settings.template||(r.settings.template=t.html()),n=setTimeout(function(){if(!t.hasClass("loading"))return t.addClass("loading"),t.html(e)},r.settings.timeout),r.settings.timeoutId=n,r},finish:function(){var e,n,i;return n=r.settings.target,i=r.settings.timeoutId,i&&(clearTimeout(i),e=r.settings.classes,e.map(function(t){return r.settings.target.addClass(t)}),n.html(r.settings.template),n.removeClass("loading"),r.settings.scope&&t(n.contents())(r.settings.scope)),r}}}},e.$inject=["$compile"],r.factory("$tgLoading",e),t=function(t){var e;return e=function(e,r,n){var i,o;return i=null,o=r.html(),e.$watch(n.tgLoading,function(n){return function(n){return n?i=t().target(r).timeout(100).template(o).scope(e).start():i?i.finish():void 0}}(this))},{priority:99999,link:e}},r.directive("tgLoading",["$tgLoading",t])}.call(this),function(){var t,e,r,n,i,o;o=this.taiga,r=this.taiga.bindOnce,n=this.taiga.debounce,i=angular.module("taigaCommon"),e=function(t,e){var i,o;return o=e.get("common/popover/popover-us-status.html",!0),i=function(e,i,s){var a,c,u;return a=i.controller(),c=function(t){var r,n,o;if(o=i.find(".us-status"),n=i.find(".us-status .us-status-bind"),r=e.usStatusById,r[t.status])return n.text(r[t.status].name),o.css("color",r[t.status].color)},i.on("click",".us-status",function(t){return t.preventDefault(),t.stopPropagation(),i.find(".pop-status").popover().open()}),i.on("click",".status",n(2e3,function(r){var n,o;return r.preventDefault(),r.stopPropagation(),n=angular.element(r.currentTarget),o=e.$eval(s.tgUsStatus),o.status=n.data("status-id"),c(o),i.find(".pop-status").popover().close(),e.$apply(function(){return t.save(o).then(function(){return e.$eval(s.onUpdate)})})})),e.$on("userstories:loaded",function(){return c(e.$eval(s.tgUsStatus))}),e.$on("$destroy",function(){return i.off()}),u=e.$eval(s.tgUsStatus),c(u),r(e,"project",function(t){var r;if(r=o({statuses:t.us_statuses}),i.append(r),e.project.my_permissions.indexOf("modify_us")===-1)return i.unbind("click"),i.find("a").addClass("not-clickable")})},{link:i}},i.directive("tgUsStatus",["$tgRepo","$tgTemplate",e]),t=function(t,e){var r,i,s;return i=e.get("common/popover/popover-related-task-status.html",!0),s=function(t,e,r){var n,i;if(i=t.find(".us-status"),n=t.find(".task-status .task-status-bind"),r[e.status])return n.text(r[e.status].name),i.css("color",r[e.status].color)},r=function(e,r,a){var c,u,l,p;return c=r.controller(),p=e.$eval(a.tgRelatedTaskStatus),l=e.$eval(a.notAutoSave),u=!l,r.on("click",".task-status",function(t){return t.preventDefault(),t.stopPropagation(),r.find(".pop-status").popover().open()}),r.on("click",".status",n(2e3,function(n){var i;if(n.preventDefault(),n.stopPropagation(),i=angular.element(n.currentTarget),p.status=i.data("status-id"),r.find(".pop-status").popover().close(),s(r,p,e.taskStatusById),u)return e.$apply(function(){return t.save(p).then(function(){return e.$eval(a.onUpdate),e.$emit("related-tasks:status-changed")})})})),e.$watch(a.tgRelatedTaskStatus,function(){return p=e.$eval(a.tgRelatedTaskStatus),s(r,p,e.taskStatusById)}),o.bindOnce(e,"project",function(t){if(r.append(i({statuses:t.task_statuses})),s(r,p,e.taskStatusById),t.my_permissions.indexOf("modify_task")===-1)return r.unbind("click"),r.find("a").addClass("not-clickable")}),e.$on("$destroy",function(){return r.off()})},{link:r}},i.directive("tgRelatedTaskStatus",["$tgRepo","$tgTemplate",t]),$.fn.popover=function(){var t,e,r,n,i,o;return t=this,i=function(e){return function(){var e,r,n,i,o,s,a,c,u,l;return t.css({display:"block",visibility:"hidden"}),i=$(window).scrollTop(),e=i+$(window).height(),o=$(window).width(),n=o,r=0,u=t.offset().top,s=u+t.height(),l=t.width(),a=t.offset().left,c=t.offset().left+l,t.css({display:"none",visibility:"visible"}),s<=e&&u>=i&&a>=r&&c<=n}}(this),n=function(e){return function(e){return e&&e.call(t),t.fadeOut(function(){return t.removeClass("active").removeClass("fix")}),t.off("popup:close")}}(this),r=function(t){return function(){return $(".popover.active").each(function(){return $(this).trigger("popup:close")})}}(this),o=function(o){return function(o){return t.hasClass("active")?e():(r(),i()||t.addClass("fix"),t.fadeIn(function(){return t.addClass("active"),$(document.body).off("popover"),$(document.body).one("click.popover",function(){return r()})}),t.on("popup:close",function(t){return n(o)}))}}(this),e=function(e){return function(){return t.trigger("popup:close")}}(this),{open:o,close:e,closeAll:r}}}.call(this),function(){var t,e,r;r=this.taiga,e=angular.module("taigaCommon"),t=function(t,e){var r;return this.config=e,r=this.config.get("ravenConfig",null),r?(t.debug("Using the RavenJS exception handler."),Raven.config(r).install(),function(e,r){return t.error.apply(t,arguments),Raven.captureException(e)}):(t.debug("Using the default logging exception handler."),function(e,r){return t.error.apply(t,arguments)})},e.factory("$exceptionHandler",["$log","$tgConfig",t])}.call(this),function(){var e,r,n,i,o,s,a,c=[].indexOf||function(t){for(var e=0,r=this.length;e\n <% if (tag[1] !== null) { %>\n \n <%= emojify(tag[0]) %>\n \n <% } %>\n<% }) %>\n<% _.each(tags, function(tag) { %>\n <% if (tag[1] === null) { %>\n \n <%= emojify(tag[0]) %>\n \n <% } %>\n<% }) %>'),e=function(e,n,i,o){var s;return s=function(e){var i;return i=r({tags:e,emojify:function(e){return t.replaceEmojiNameByHtmlImgs(_.escape(e))}}),n.html(i)},e.$watch(i.tgColorizeBacklogTags,function(t){if(null!=t)return s(t)}),e.$on("$destroy",function(){return n.off()})},{link:e}},o.directive("tgColorizeBacklogTags",["$tgEmojis",e]),r=function(e,r,n){var o,s,u,l,p;return s=13,o=188,p=r.get("common/tag/lb-tag-line-tags.html",!0),u=null,l=function(e,r,o,l){var h,f,d,g,m,v,y,b;return b=_.has(o,"withoutColors"),g=function(i,o){var s,a,c;return null==o&&(o=[]),s=b?null:o[t],a={tags:_.map(i,function(t){return{name:t,style:s?"border-left: 5px solid "+s:""}})},c=n(p(a))(e),r.find(".tags-container").html(c)},y=function(){return r.find(".save").removeClass("hidden")},d=function(){return r.find(".save").addClass("hidden")},m=function(){return r.find("input").val(""),u.close()},h=function(t){var r;if(t=a(t.toLowerCase()),0!==t.length)return r=_.clone(l.$modelValue,!1),null==r&&(r=[]),c.call(r,t)<0&&r.push(t),e.$apply(function(){return l.$setViewValue(r)}),d()},f=function(t){var r;if(t=a(t.toLowerCase()),0!==t.length)return r=_.clone(l.$modelValue,!1),r=_.pull(r,t),e.$apply(function(){return l.$setViewValue(r)})},v=function(){var t;return t=r.find("input").val(),h(t),m()},r.on("keypress","input",function(t){var e;return e=angular.element(t.currentTarget),t.keyCode===s?(t.preventDefault(),v()):","===String.fromCharCode(t.keyCode)?(t.preventDefault(),v()):e.val().length?y():d()}),r.on("click",".save",function(t){return t.preventDefault(),v()}),r.on("click",".remove-tag",function(t){var e,r;return t.preventDefault(),e=angular.element(t.currentTarget),r=e.siblings(".tag-name").text(),f(r)}),i(e,"project",function(t){var e;return e=r.find("input"),u=new Awesomplete(e[0],{list:_.keys(t.tags_colors)}),e.on("awesomplete-selectcomplete",function(){return h(e.val()),e.val("")})}),e.$watch(o.ngModel,function(t){var r,n;return n=(null!=(r=e.project)?r.tags_colors:void 0)||[],g(t,n)}),e.$on("$destroy",function(){return r.off()})},{link:l,require:"ngModel",templateUrl:"common/tag/lb-tag-line.html"}},o.directive("tgLbTagLine",["$tgResources","$tgTemplate","$compile",r])}.call(this),function(){var t,e,r,n,i;i=this.taiga,e=this.taiga.bindOnce,r=this.taiga.debounce,n=angular.module("taigaBacklog"),t=function(t,e,n,i,o,s,a){var c;return c=function(n,c,u){var l,p,h,f,d,g,m,v;return f=!1,l=!0,p=null,n.newSprint={},v=null,g=function(){return p&&p.reset(),n.newSprint={project:null,name:null,estimated_start:null,estimated_finish:null}},m=r(2e3,function(r){return function(r){var u,h,d,g,m,y,b,S,j;return r.preventDefault(),j=angular.element(r.currentTarget),y=a.instant("COMMON.PICKERDATE.FORMAT"),S=c.find(".submit-button"),p=c.find("form").checksley(),p.validate()?(f=!1,u=null,g=$(".date-start").val(),d=$(".date-end").val(),l?(m=angular.copy(n.newSprint),m.estimated_start=moment(g,y).format("YYYY-MM-DD"),m.estimated_finish=moment(d,y).format("YYYY-MM-DD"),b=t.create("milestones",m),u="sprintform:create:success"):(m=n.newSprint.realClone(),m.estimated_start=moment(g,y).format("YYYY-MM-DD"),m.estimated_finish=moment(d,y).format("YYYY-MM-DD"),b=t.save(m),u="sprintform:edit:success"),h=s().target(S).start(),b.then(function(t){return h.finish(),l&&(n.sprintsCounter+=1),n.sprints=_.map(n.sprints,function(e){return e.id===t.id?t:e}),"sprintform:create:success"===u&&v?i.$broadcast(u,t,v):i.$broadcast(u,t),o.close(c)}),b.then(null,function(t){return h.finish(),p.setErrors(t),t._error_message?e.notify("light-error",t._error_message):t.__all__?e.notify("light-error",t.__all__[0]):void 0})):(f=!0,void c.find(".last-sprint-name").addClass("disappear"))}}(this)),d=function(){var r,s;return s=a.instant("LIGHTBOX.DELETE_SPRINT.TITLE"),r=n.newSprint.name,e.askOnDelete(s,r).then(function(r){return function(r){var s,a;return a=function(){return r.finish(),n.milestonesCounter-=1,o.close(c),i.$broadcast("sprintform:remove:success",n.newSprint)},s=function(){return r.finish(!1),e.notify("error")},t.remove(n.newSprint).then(a,s)}}(this))},h=function(){var t,e;return t=_.filter(n.sprints,function(t){return!t.closed}),e=_.sortBy(t,function(t){return moment(t.estimated_finish,"YYYY-MM-DD").format("X")}),e[e.length-1]},n.$on("sprintform:create",function(t,e,r){var i,s,u,f,d,m;return v=r,g(),p=c.find("form").checksley(),p.reset(),l=!0,d=a.instant("COMMON.PICKERDATE.FORMAT"),n.newSprint.project=e,n.newSprint.name=null,n.newSprint.slug=null,u=h(),s=moment(),u?s=moment(u.estimated_finish):n.newSprint.estimated_start&&(s=moment(n.newSprint.estimated_start)),n.newSprint.estimated_start=s.format(d),i=moment().add(2,"weeks"),u?i=moment(u.estimated_finish).add(2,"weeks"):n.newSprint.estimated_finish&&(i=moment(n.newSprint.estimated_finish)),n.newSprint.estimated_finish=i.format(d),f=c.find(".last-sprint-name"),null!=(null!=u?u.name:void 0)&&(m=a.instant("LIGHTBOX.ADD_EDIT_SPRINT.LAST_SPRINT_NAME",{lastSprint:u.name}),f.html(m)),c.find(".delete-sprint").addClass("hidden"),m=a.instant("LIGHTBOX.ADD_EDIT_SPRINT.TITLE"),c.find(".title").text(m),m=a.instant("COMMON.CREATE"),c.find(".button-green").text(m),o.open(c),c.find(".sprint-name").focus(),c.find(".last-sprint-name").removeClass("disappear")}),n.$on("sprintform:edit",function(t,e){var r,i,s;return g(),l=!1,i=a.instant("COMMON.PICKERDATE.FORMAT"),n.$apply(function(){return n.newSprint=e.realClone(),n.newSprint.estimated_start=moment(n.newSprint.estimated_start).format(i),n.newSprint.estimated_finish=moment(n.newSprint.estimated_finish).format(i)}),c.find(".delete-sprint").removeClass("hidden"),r=a.instant("BACKLOG.EDIT_SPRINT"),c.find(".title").text(r),s=a.instant("COMMON.SAVE"),c.find(".button-green").text(s),o.open(c),c.find(".sprint-name").focus().select(),c.find(".last-sprint-name").addClass("disappear")}),c.on("keyup",".sprint-name",function(t){return c.find(".sprint-name").val().length>0||f?c.find(".last-sprint-name").addClass("disappear"):c.find(".last-sprint-name").removeClass("disappear")}),c.on("submit","form",m),c.on("click",".delete-sprint",function(t){return t.preventDefault(),d()}),n.$on("$destroy",function(){return c.off()}),g()},{link:c}},n.directive("tgLbCreateEditSprint",["$tgRepo","$tgConfirm","$tgResources","$rootScope","lightboxService","$tgLoading","$translate",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v=function(t,e){function r(){this.constructor=t}for(var n in e)y.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},y={}.hasOwnProperty;d=this.taiga,p=this.taiga.mixOf,m=this.taiga.toggleText,f=this.taiga.scopeDefer,c=this.taiga.bindOnce,l=this.taiga.groupBy,g=this.taiga.timeout,a=this.taiga.bindMethods,u=this.taiga.generateHash,h=angular.module("taigaBacklog"),t=function(t){function e(t,e,r,n,i,o,s,c,u,l,p,h,f,d,g,m,v,y,_,b){var S;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=c,this.appMetaService=u,this.navUrls=l,this.events=p,this.analytics=h,this.translate=f,this.loading=d,this.rs2=g,this.modelTransform=m,this.errorHandlingService=v,this.storage=y,this.filterRemoteStorageService=_,this.projectService=b,a(this),this.backlogOrder={},this.milestonesOrder={},this.page=1,this.disablePagination=!1,this.firstLoadComplete=!1,this.scope.userstories=[],this.applyStoredFilters(this.params.pslug,"backlog-filters")||(this.scope.sectionName=this.translate.instant("BACKLOG.SECTION_NAME"),this.showTags=!1,this.activeFilters=!1,this.scope.showGraphPlaceholder=null,this.displayVelocity=!1,this.initializeEventHandlers(),S=this.loadInitialData(),S.then(function(t){return function(){var e,r;if(t.firstLoadComplete=!0,r=t.translate.instant("BACKLOG.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.translate.instant("BACKLOG.PAGE_DESCRIPTION",{projectName:t.scope.project.name,projectDescription:t.scope.project.description}),t.appMetaService.setAll(r,e),t.rs.userstories.getShowTags(t.scope.projectId))return t.showTags=!0,t.scope.$broadcast("showTags",t.showTags)}}(this)),S.then(null,this.onInitialDataError.bind(this)))}return v(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","tgAppMetaService","$tgNavUrls","$tgEvents","$tgAnalytics","$translate","$tgLoading","tgResources","$tgQueueModelTransformation","tgErrorHandlingService","$tgStorage","tgFilterRemoteStorageService","tgProjectService"],e.prototype.storeCustomFiltersName="backlog-custom-filters",e.prototype.storeFiltersName="backlog-filters",e.prototype.backlogOrder={},e.prototype.milestonesOrder={},e.prototype.filtersReloadContent=function(){return this.loadUserstories(!0)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("usform:bulk:success",function(t){return function(){return t.loadUserstories(!0),t.loadProjectStats(),t.confirm.notify("success"),t.analytics.trackEvent("userstory","create","bulk create userstory on backlog",1)}}(this)),this.scope.$on("sprintform:create:success",function(t){return function(e,r,n){return t.loadSprints().then(function(){return t.scope.$broadcast("sprintform:create:success:callback",n)}),t.loadProjectStats(),t.confirm.notify("success"),t.analytics.trackEvent("sprint","create","create sprint on backlog",1)}}(this)),this.scope.$on("usform:new:success",function(t){return function(){return t.loadUserstories(!0),t.loadProjectStats(),t.rootscope.$broadcast("filters:update"),t.confirm.notify("success"),t.analytics.trackEvent("userstory","create","create userstory on backlog",1)}}(this)),this.scope.$on("sprintform:edit:success",function(t){return function(){return t.loadProjectStats()}}(this)),this.scope.$on("sprintform:remove:success",function(t){return function(e,r){return t.loadSprints(),t.loadProjectStats(),t.loadUserstories(!0),r.closed&&t.loadClosedSprints(),t.rootscope.$broadcast("filters:update")}}(this)),this.scope.$on("usform:edit:success",function(t){return function(e,r){var n;return n=_.findIndex(t.scope.userstories,function(t){return t.id===r.id}),t.scope.userstories[n]=r,t.rootscope.$broadcast("filters:update")}}(this)),this.scope.$on("sprint:us:move",this.moveUs),this.scope.$on("sprint:us:moved",function(t){return function(){return t.loadSprints(),t.loadProjectStats()}}(this)),this.scope.$on("backlog:load-closed-sprints",this.loadClosedSprints),this.scope.$on("backlog:unload-closed-sprints",this.unloadClosedSprints)},e.prototype.initializeSubscription=function(){var t,e;return t="changes.project."+this.scope.projectId+".userstories",this.events.subscribe(this.scope,t,function(t){return function(e){return t.loadAllPaginatedUserstories(),t.loadSprints()}}(this)),e="changes.project."+this.scope.projectId+".milestones",this.events.subscribe(this.scope,e,function(t){return function(e){return t.loadSprints()}}(this))},e.prototype.toggleShowTags=function(){return this.scope.$apply(function(t){return function(){return t.showTags=!t.showTags,t.rs.userstories.storeShowTags(t.scope.projectId,t.showTags)}}(this))},e.prototype.toggleActiveFilters=function(){return this.activeFilters=!this.activeFilters},e.prototype.toggleVelocityForecasting=function(){return this.displayVelocity=!this.displayVelocity,this.displayVelocity?this.scope.visibleUserStories=_.map(this.forecastedStories,function(t){return t.ref}):this.scope.visibleUserStories=_.map(this.scope.userstories,function(t){return t.ref}),f(this.scope,function(t){return function(){return t.scope.$broadcast("userstories:loaded")}}(this))},e.prototype.loadProjectStats=function(){return this.rs.projects.stats(this.scope.projectId).then(function(t){return function(e){var r;return t.scope.stats=e,r=e.total_points?e.total_points:e.defined_points,r?t.scope.stats.completedPercentage=Math.round(100*e.closed_points/r):t.scope.stats.completedPercentage=0,t.scope.showGraphPlaceholder=!(null!=e.total_points&&null!=e.total_milestones),t.calculateForecasting(),e}}(this))},e.prototype.setMilestonesOrder=function(t){var e,r,n,i,o;for(i=[],r=0,n=t.length;r0&&t>s.speed));r++)o.push(void 0);return o},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.is_backlog_activated||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.closedMilestones=!!t.total_closed_milestones,this.scope.$emit("project:loaded",t),this.scope.points=_.sortBy(t.points,"order"),this.scope.pointsById=l(t.points,function(t){return t.id}),this.scope.usStatusById=l(t.us_statuses,function(t){return t.id}),this.scope.usStatusList=_.sortBy(t.us_statuses,"id"),t},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles), this.initializeSubscription(),this.loadBacklog().then(function(t){return function(){var e;return t.generateFilters(e="null")}}(this)).then(function(t){return function(){return t.scope.$emit("backlog:loaded")}}(this))},e.prototype.prepareBulkUpdateData=function(t,e){return null==e&&(e="backlog_order"),_.map(t,function(t){return{us_id:t.id,order:t[e]}})},e.prototype.moveUs=function(t,e,r,n){var i,o,s,a,c,u,l,p,h,f,d,g,m,v,y,b,S,j,k,$,I,E,T,C,P,w,A,O,R,M,U,N,D,L,x,F,B,H;if(E=e[0].milestone,R=e[0].project,E&&(F=this.scope.sprintsById[E]||this.scope.closedSprintsById[E]),n&&($=this.scope.sprintsById[n]||this.scope.closedSprintsById[n]),s=n!==E?n:E,P=null,C="",n!==E)if(null===n){for(l=u=0,h=e.length;u1&&(x=_.map(O,function(t){return{us_id:t.id,order:P[t.id]}}))):B=0,j=[],l=S=0,d=e.length;S1&&n!==E)a=j.concat(x),M=this.rs.userstories.bulkUpdateMilestone(R,n,a);else if(e.length>1)a=j.concat(x),M=this.rs.userstories.bulkUpdateBacklogOrder(R,a);else{for(L={},U=0,y=x.length;U=n&&t<=r})},e}(p(d.Controller,d.PageMixin,d.FiltersMixin,d.UsFiltersMixin)),h.controller("BacklogController",t),e=function(t,e,r,n){var i,o,s,a,c,u,l,p;return i=_.template('
<%- text %>
'),s=function(t,e,n,o){var s,a,c,u;return c=function(){var r,n,i,o,a,c,l,p,h,f;if(t.displayVelocity&&u(),null!=t.stats&&null!=t.stats.total_points&&0!==t.stats.total_points&&null==t.displayVelocity){if(u(),p=t.stats,h=p.total_points,r=p.assigned_points,!t.userstories)return;for(c=t.userstories,l=[],i=o=0,a=c.length;oh){n=e.find(".backlog-table-body .us-item-row")[i],s(n);break}l.push(void 0)}return l}},u=function(){return e.find(".doom-line").remove()},s=function(t){var e;return e=r.instant("BACKLOG.DOOMLINE"),$(t).before(i({text:e}))},a=function(){var t;return t=e.find(".backlog-table-body .us-item-row"),_.map(t,function(t){return angular.element(t)})},t.$on("userstories:loaded",c),t.$on("userstories:forecast",u),t.$watch("stats",c)},c=function(t,r,i,o){var s,a,c,u,l,h,f;return a=function(){var e;return e=r.find(".backlog-table-body input:checkbox:checked"),_.map(e,function(e){var r;return e=$(e).closest(".tg-scope"),r=e.scope(),r.us.milestone=t.sprints[0].id,r.us})},h=function(e,i){var s,a,c,u;return u=_(t.userstories),t.userstories=u.without.apply(u,e).value(),a=_.map(e,function(t,e){return t.total_points}),c=_.reduce(a,function(t,e){return t+e}),i.user_stories=_.union(i.user_stories,e),i.total_points+=c,s=_.map(e,function(t){return{us_id:t.id,order:t.sprint_order}}),n.userstories.bulkUpdateMilestone(t.project.id,t.sprints[0].id,s).then(function(t){return function(){return o.loadSprints(),o.loadProjectStats(),o.toggleVelocityForecasting(),o.calculateForecasting()}}(this)),r.find(".move-to-sprint").hide()},u=function(e){return h(e,t.currentSprint)},l=function(e){return h(e,t.sprints[0])},t.$on("sprintform:create:success:callback",function(t,e){return _.partial(u,e)()}),f=!1,c=null,s=function(e){var n,i;return c=e.closest(".us-item-row"),e.closest(".us-item-row").toggleClass("ui-multisortable-multiple"),n=r.find(".move-to-sprint"),i=r.find(".backlog-table-body input:checkbox:checked"),i.length>0&&t.sprints.length>0?n.show():n.hide()},$(window).on("keydown.shift-pressed keyup.shift-pressed",function(t){return f=!!t.shiftKey,!0}),r.on("change",".backlog-table-body input:checkbox",function(t){var e,r,n,i,o;return c&&f&&(r=[],e=$(t.currentTarget).closest(".us-item-row"),n=c.nextAll(),i=c.prevAll(),_.some(n,function(t){return t===e[0]})?r=c.nextUntil(e):_.some(i,function(t){return t===e[0]})&&(r=c.prevUntil(e)),_.map(r,function(t){var e;return e=$(t).find("input:checkbox"),e.prop("checked",!0),s(e)})),o=angular.element(t.currentTarget),o.closest(".us-item-row").toggleClass("is-checked"),s(o)}),r.on("click","#move-to-latest-sprint",function(e){return function(e){var r;return r=a(),t.$apply(_.partial(l,r))}}(this)),r.on("click","#move-to-current-sprint",function(e){return function(e){var r;return r=a(),t.$apply(_.partial(u,r))}}(this)),r.on("click","#show-tags",function(t){return t.preventDefault(),o.toggleShowTags(),p(o)}),r.on("click",".forecasting-add-sprint",function(r){var n,i;return i=o.forecastedStories,t.currentSprint?(n=_.map(i,function(e,r){return e.milestone=t.currentSprint.id,e.order=r,e}),t.$apply(_.partial(u,n))):(n=_.map(i,function(t,e){return t.order=e,t}),e.$broadcast("sprintform:create",t.projectId,n))})},p=function(t){var e,n;return e=angular.element("#show-tags"),t.showTags?(e.addClass("active"),n=r.instant("BACKLOG.TAGS.HIDE"),e.text(n)):(e.removeClass("active"),n=r.instant("BACKLOG.TAGS.SHOW"),e.text(n))},u=function(t,e,r){var n;return n=e.find("sidebar.backlog-filter"),n.addClass("active"),r.activeFilters=!0},l=function(t,n,i){var o,s,a,c;return a=n.find("sidebar.backlog-filter"),a.one("transitionend",function(){return g(150,function(){return e.$broadcast("resize"),$(".burndown").css("visibility","visible")})}),c=angular.element("#show-filters-button"),$(".burndown").css("visibility","hidden"),a.toggleClass("active"),c.toggleClass("active"),o=r.instant("BACKLOG.FILTERS.HIDE"),s=r.instant("BACKLOG.FILTERS.SHOW"),m(c,[o,s]),i.toggleActiveFilters()},a=function(t,e,r,n){return t.filtersSearch={},e.on("click","#show-filters-button",function(r){return r.preventDefault(),t.$apply(function(){return l(t,e,n)})})},o=function(t,e,r,n){var i,o;return i=e.controller(),c(t,e,r,i),a(t,e,r,i),s(t,e,r,i),o=i.location.search(),(o.status||o.tags||o.q||o.assigned_to||o.owner)&&u(t,e,i),t.$on("showTags",function(){return p(i)}),t.$on("$destroy",function(){return e.off(),$(window).off(".shift-pressed")})},{link:o}},h.directive("tgBacklog",["$tgRepo","$rootScope","$translate","$tgResources",e]),s=function(t,e,r,n){var i,o;return o=e.get("backlog/us-role-points-popover.html",!0),i=function(e,i,s){return c(e,"project",function(t){var n,s;return s=_.filter(t.roles,"computable"),n=_.size(s),n>1?i.append(r(o({roles:s}))(e)):(i.find(".icon-arrow-down").remove(),i.find(".header-points").addClass("not-clickable"))}),e.$on("uspoints:select",function(t,e,r){return i.find(".popover").popover().close(),i.find(".header-points").html(r+"/Total")}),e.$on("uspoints:clear-selection",function(t,e){var r;return i.find(".popover").popover().close(),r=n.instant("COMMON.FIELDS.POINTS"),i.find(".header-points").text(r)}),i.on("click",function(t){var e;return e=angular.element(t.target),(e.is("span")||e.is("div"))&&t.stopPropagation(),i.find(".popover").popover().open()}),i.on("click",".clear-selection",function(e){return e.preventDefault(),e.stopPropagation(),t.$broadcast("uspoints:clear-selection")}),i.on("click",".role",function(e){var r,n;return e.preventDefault(),e.stopPropagation(),n=angular.element(e.currentTarget),r=n.scope(),t.$broadcast("uspoints:select",n.data("role-id"),n.text())}),e.$on("$destroy",function(){return i.off()})},{link:i}},h.directive("tgUsRolePointsSelector",["$rootScope","$tgTemplate","$compile","$translate",s]),o=function(t,e,r){var n,i;return i=r.get("common/estimation/us-points-roles-popover.html",!0),n=function(e,n,o){var s,a,c,u,l,p,h;return s=n.controller(),h=null,p=null,u=null,c=null,e.$on("uspoints:select",function(t,r,n){var i;return i=e.$eval(o.tgBacklogUsPoints),p=r,c.render()}),e.$on("uspoints:clear-selection",function(t){var r;return r=e.$eval(o.tgBacklogUsPoints),p=null,c.render()}),e.$watch(o.tgBacklogUsPoints,function(i){var o;if(i)return c=t.create(n,i,e.project),o=c.calculateRoles(),0===o.length?(n.find(".icon-arrow-bottom").remove(),n.find("a.us-points").addClass("not-clickable")):1===o.length&&(p=_.keys(i.points)[0]),c.isEditable&&a(),c.onSelectedPointForRole=function(t,e,r){return i.points=r,c.render(),this.save(t,e).then(function(){return s.loadProjectStats()})},c.render=function(){var t,e,n,i,s,a,c,u,l;return l=this.calculateTotalPoints(),null==p||1===o.length?(c=l,u=l):(i=this.us.points[p],s=this.pointsById[i],c=s.name+" / "+l+"",u=s.name+" / "+l),t={totalPoints:l,roles:this.calculateRoles(),editable:this.isEditable,text:c,title:u},n="common/estimation/us-estimation-total.html",a=r.get(n,!0),e=a(t),this.$el.html(e)},c.render()}),l=function(){var t,e;return e=c.calculateRoles(),t=i({roles:e}),n.append(t),n.find(".pop-role").popover().open(function(){return $(this).remove()})},a=function(){return n.on("click","a.us-points",function(t){var r;return t.preventDefault(),t.stopPropagation(),r=e.$eval(o.tgBacklogUsPoints),h=p,null!=p?c.renderPointsSelector(p):l()}),n.on("click",".role",function(t){var r,i,s;return t.preventDefault(),t.stopPropagation(),i=angular.element(t.currentTarget),s=e.$eval(o.tgBacklogUsPoints),h=i.data("role-id"),r=n.find(".pop-role"),r.find("a").removeClass("active"),r.find("a[data-role-id='"+h+"']").addClass("active"),c.renderPointsSelector(h)})},e.$on("$destroy",function(){return n.off()})},{link:n}},h.directive("tgBacklogUsPoints",["$tgEstimationsService","$tgRepo","$tgTemplate",o]),i=function(t){var e,r,n;return e=function(){return $(".js-burndown-graph").removeClass("shown"),$(".js-toggle-burndown-visibility-button").removeClass("active"),$(".js-burndown-graph").removeClass("open")},n=function(t){return $(".js-toggle-burndown-visibility-button").addClass("active"),t?$(".js-burndown-graph").addClass("shown"):$(".js-burndown-graph").addClass("open")},r=function(r,i,o){var s,a,c;return s=!0,a=u(["is-burndown-grpahs-collapsed"]),r.isBurndownGraphCollapsed=t.get(a)||!1,c=function(){return r.isBurndownGraphCollapsed?e(s):n(s),s=!1},r.$watch("showGraphPlaceholder",function(){if(null!=r.showGraphPlaceholder)return r.isBurndownGraphCollapsed=r.isBurndownGraphCollapsed||r.showGraphPlaceholder,c()}),i.on("click",".js-toggle-burndown-visibility-button",function(){return r.isBurndownGraphCollapsed=!r.isBurndownGraphCollapsed,t.set(a,r.isBurndownGraphCollapsed),c()}),r.$on("$destroy",function(){return i.off()})},{link:r}},h.directive("tgToggleBurndownVisibility",["$tgStorage",i]),r=function(t){var e,r;return r=function(e,r){var n,i,o,s,a,c,u,l,p,h,f;return h=e.width(),e.height(h/6),a=function(){l=[];for(var t=0,e=r.milestones.length-1;0<=e?t<=e:t>=e;0<=e?t++:t--)l.push(t);return l}.apply(this),o=[],f=_.map(r.milestones,function(t){return 0}),o.push({data:_.zip(a,f),lines:{fillColor:"rgba(0,0,0,0)"},points:{show:!1}}),c=_.map(r.milestones,function(t){return t.optimal}),o.push({data:_.zip(a,c),lines:{fillColor:"rgba(120,120,120,0.2)"}}),s=_.filter(_.map(r.milestones,function(t){return t.evolution}),function(t){return null!=t}),o.push({data:_.zip(a,s),lines:{fillColor:"rgba(102,153,51,0.3)"}}),n=_.map(r.milestones,function(t){return-t["team-increment"]-t["client-increment"]}),o.push({data:_.zip(a,n),lines:{fillColor:"rgba(255,51,51,0.3)"}}),p=_.map(r.milestones,function(t){return-t["team-increment"]}),o.push({data:_.zip(a,p),lines:{fillColor:"rgba(153,51,51,0.3)"}}),i=["rgba(0,0,0,1)","rgba(120,120,120,0.2)","rgba(102,153,51,1)","rgba(153,51,51,1)","rgba(255,51,51,1)"],u={grid:{borderWidth:{top:0,right:1,left:0,bottom:0},borderColor:"#ccc",hoverable:!0},xaxis:{ticks:r.milestones.length,axisLabel:t.instant("BACKLOG.CHART.XAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5,tickFormatter:function(t,e){return""}},yaxis:{axisLabel:t.instant("BACKLOG.CHART.YAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5},series:{shadowSize:0,lines:{show:!0,fill:!0},points:{show:!0,fill:!0,radius:4,lineWidth:2}},colors:i,tooltip:!0,tooltipOpts:{content:function(e,n,i,o){var s;return 1===o.seriesIndex?(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.OPTIMAL",s)):2===o.seriesIndex?(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.REAL",s)):3===o.seriesIndex?(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.INCREMENT_CLIENT",s)):(s={sprintName:r.milestones[n].name,value:Math.abs(i)},t.instant("BACKLOG.CHART.INCREMENT_TEAM",s))}}},e.empty(),e.plot(o,u).data("plot")},e=function(t,e,n){var i;return i=angular.element(e),t.$watch("stats",function(e){if(null!=t.stats)return r(i,t.stats),t.$on("resize",function(){return r(i,t.stats)})}),t.$on("$destroy",function(){return e.off()})},{link:e}},h.directive("tgBurndownBacklogGraph",["$translate",r]),n=function(t,e){var r,n,i,o;return o=t.get("backlog/progress-bar.html",!0),i=function(t,r,n,i){var s;return s=o({projectPointsPercentaje:n,closedPointsPercentaje:i}),s=e(s)(t),r.html(s)},r=function(t){var e;return e=_.max([0,t]),e=_.min([100,e]),Math.round(e)},n=function(t,e,n){var o;return o=angular.element(e),t.$watch(n.tgBacklogProgressBar,function(n){var o,s,a,c,u;if(null!=n)return u=n.total_points?n.total_points:n.defined_points,a=n.defined_points,o=n.closed_points,a>u?(c=100*u/a,s=100*o/a):(c=100,s=100*o/u),c=r(c-3),s=r(s-3),i(t,e,c,s)}),t.$on("$destroy",function(){return e.off()})},{link:n}},h.directive("tgBacklogProgressBar",["$tgTemplate","$compile",n])}.call(this),function(){var t,e,r,n,i;i=this.taiga,e=this.taiga.bindOnce,n=angular.module("taigaBacklog"),r=function(t){return $(t).scope().$destroy(),$(t).off(),$(t).remove()},t=function(){var t;return t=function(t,n,i){return e(t,"project",function(e){var i,o,s;if(e.my_permissions.indexOf("modify_us")>-1)return o=!1,i=dragula([n[0],$(".js-empty-backlog")[0]],{copySortSource:!1,copy:!1,isContainer:function(t){return t.classList.contains("sprint-table")},moves:function(t){return!!$(t).hasClass("row")}}),i.on("drag",function(t,e){var r,n;return n=$(t).parent(),o=n.hasClass("backlog-table-body"),$(document.body).addClass("drag-active"),r=$(t).find("input[type='checkbox']").is(":checked"),window.dragMultiple.start(t,e)}),i.on("cloned",function(t){return $(t).addClass("multiple-drag-mirror")}),i.on("dragend",function(e){var n,i,s,a,c,u,l,p;return c=$(e).parent(),$(".doom-line").remove(),c=$(e).parent(),a=c.hasClass("backlog-table-body")||c.hasClass("js-empty-backlog"),u=o||a?o===a:$(e).scope().sprint.id===c.scope().sprint.id,n=window.dragMultiple.stop(),$(document.body).removeClass("drag-active"),l=null,i=n.length?n[0]:e,a?s=$(i).index(".backlog-table-body .row"):(s=$(i).index(),l=c.scope().sprint.id),u?p=n.length?_.map(n,function(t){return t=$(t).scope().us}):[$(e).scope().us]:(p=n.length?_.map(n,function(t){return t=$(t).scope().us}):[$(e).scope().us],n.length?_.each(n,function(t){return r(t)}):r(e)),t.$emit("sprint:us:move",p,s,l)}),s=autoScroll([window],{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&i.dragging}}),t.$on("$destroy",function(){return n.off(),i.destroy()})})},{link:t}},n.directive("tgBacklogSortable",t)}.call(this),function(){var t,e,r,n,i;i=this.taiga,n=angular.module("taigaBacklog"),t=function(t,e){var r,n,i,o;return i=50,n={duration:500,easing:"linear"},o=function(t){return function(t){var e,r;return r=t.find(".sprint-table"),e=t.find(".compact-sprint"),e.toggleClass("active"),r.toggleClass("open")}}(this),r=function(t,r,i){return t.$watch(i.tgBacklogSprint,function(e){return e=t.$eval(i.tgBacklogSprint),e.closed?r.addClass("sprint-closed"):o(r)}),r.on("click",".sprint-name > .compact-sprint",function(t){return t.preventDefault(),o(r),r.find(".sprint-table").slideToggle(n)}),r.on("click",".edit-sprint",function(r){var n;return r.preventDefault(),n=t.$eval(i.tgBacklogSprint),e.$broadcast("sprintform:edit",n)}),t.$on("$destroy",function(){return r.off()})},{link:r}},n.directive("tgBacklogSprint",["$tgRepo","$rootScope",t]),e=function(t,e,r,n){var i,o;return o=e.get("backlog/sprint-header.html"),i=function(e,i,s,a){var c,u,l,p;return l=n.instant("BACKLOG.SPRINTS.DATE"),c=function(){return e.project.my_permissions.indexOf("modify_milestone")!==-1},u=function(){return e.project.my_permissions.indexOf("view_milestones")!==-1},p=function(n){var s,a,p,h,f,d,g;return d=t.resolve("project-taskboard",{project:e.project.slug,sprint:n.slug}),f=moment(n.estimated_start).format(l),h=moment(n.estimated_finish).format(l),p=f+"-"+h,a={name:n.name,taskboardUrl:d,estimatedDateRange:p,closedPoints:n.closed_points||0,totalPoints:n.total_points||0,isVisible:u(),isEditable:c()},g=e.$new(),_.assign(g,a),s=r(o)(g),i.html(s)},e.$watch("sprint",function(t){return p(t)}),e.$on("$destroy",function(){return i.off()})},{link:i,restrict:"EA"}},n.directive("tgBacklogSprintHeader",["$tgNavUrls","$tgTemplate","$compile","$translate",e]),r=function(t,e,r){var n,i;return n=!0,i=function(i,o,s){var a,c;return c=$("
"),o.after(c),a=null,o.on("click",function(r){return r.preventDefault(),n=!n,a=e().target(c).start(),n?t.$broadcast("backlog:unload-closed-sprints"):t.$broadcast("backlog:load-closed-sprints")}),i.$on("$destroy",function(){return o.off()}),i.$on("closed-sprints:reloaded",function(t){return function(t,e){var n,i;return a.finish(),n=e.length>0?"BACKLOG.SPRINTS.ACTION_HIDE_CLOSED_SPRINTS":"BACKLOG.SPRINTS.ACTION_SHOW_CLOSED_SPRINTS",i=r.instant(n),o.find(".text").text(i)}}(this))},{link:i}},n.directive("tgBacklogToggleClosedSprintsVisualization",["$rootScope","$tgLoading","$translate",r])}.call(this),function(){var t,e,r,n,i,o,s,a,c;s=this.taiga,n=this.taiga.mixOf,c=this.taiga.toggleText,o=this.taiga.scopeDefer,e=this.taiga.bindOnce,r=this.taiga.groupBy,a=this.taiga.timeout,i=angular.module("taigaTaskboard"),t=function(t){var e,r;return r=function(e,r){var n,i,o,s;return s=e.width(),e.height(240),i=_.map(r,function(t){return moment(new Date(t.day).getTime())}),n=[],n.unshift({data:_.zip(i,_.map(r,function(t){return t.optimal_points})),lines:{fillColor:"rgba(120,120,120,0.2)"}}),n.unshift({data:_.zip(i,_.map(r,function(t){return t.open_points})),lines:{fillColor:"rgba(102,153,51,0.3)"}}),o={grid:{borderWidth:{top:0,right:1,left:0,bottom:0},borderColor:"#ccc",hoverable:!0},xaxis:{tickSize:[1,"day"],min:i[0],max:_.last(i),mode:"time",daysNames:i,axisLabel:t.instant("TASKBOARD.CHARTS.XAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5},yaxis:{min:0,axisLabel:t.instant("TASKBOARD.CHARTS.YAXIS_LABEL"),axisLabelUseCanvas:!0,axisLabelFontSizePixels:12,axisLabelFontFamily:"Verdana, Arial, Helvetica, Tahoma, sans-serif",axisLabelPadding:5},series:{shadowSize:0,lines:{show:!0,fill:!0},points:{show:!0,fill:!0,radius:4,lineWidth:2}},colors:["rgba(102,153,51,1)","rgba(120,120,120,0.2)"],tooltip:!0,tooltipOpts:{content:function(e,r,n,i){var o,s;return o=moment(r).format(t.instant("TASKBOARD.CHARTS.DATE")),s=Math.round(n),1===i.seriesIndex?t.instant("TASKBOARD.CHARTS.OPTIMAL",{formattedDate:o,roundedValue:s}):t.instant("TASKBOARD.CHARTS.REAL",{formattedDate:o,roundedValue:s})}}},e.empty(),e.plot(n,o).data("plot")},e=function(t,e,n){var i;return i=angular.element(e),t.$on("resize",function(){if(t.stats)return r(i,t.stats.days)}),t.$on("taskboard:graph:toggle-visibility",function(){return e.parent().toggleClass("open"),a(100,function(){if(t.stats)return r(i,t.stats.days)})}),t.$watch("stats",function(e){if(null!=t.stats)return r(i,t.stats.days)}),t.$on("$destroy",function(){return e.off()})},{link:e}},i.directive("tgSprintGraph",["$translate",t])}.call(this),function(){var t,e,r,n,i,o,s,a=[].indexOf||function(t){for(var e=0,r=this.length;e1&&r<=1&&(this.zoomLoading=!0,this.loadTasks().then(function(t){return function(){return t.zoomLoading=!1,t.taskboardTasksService.resetFolds()}}(this))),"0"===this.zoomLevel?this.rootscope.$broadcast("sprint:zoom0"):void 0)},e.prototype.changeQ=function(t){return this.replaceFilter("q",t),this.loadTasks(),this.generateFilters()},e.prototype.removeFilter=function(t){return this.unselectFilter(t.dataType,t.id),this.loadTasks(),this.generateFilters()},e.prototype.addFilter=function(t){return this.selectFilter(t.category.dataType,t.filter.id),this.loadTasks(),this.generateFilters()},e.prototype.selectCustomFilter=function(t){return this.replaceAllFilters(t.filter),this.loadTasks(),this.generateFilters()},e.prototype.removeCustomFilter=function(t){return this.filterRemoteStorageService.getFilters(this.scope.projectId,"tasks-custom-filters").then(function(e){return function(r){return delete r[t.id],e.filterRemoteStorageService.storeFilters(e.scope.projectId,r,"tasks-custom-filters").then(e.generateFilters)}}(this))},e.prototype.isFilterDataTypeSelected=function(t){var e,r,n,i;for(i=this.selectedFilters,r=0,n=i.length;r0}),n=_.map(o.assigned_to,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.full_name||"Unassigned",t}),a=_.map(o.roles,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.name||"Unassigned",t}),s=_.map(o.owners,function(t){return t.id=t.id.toString(),t.name=t.full_name,t}),e.selectedFilters=[], t.status&&(c=e.formatSelectedFilters("status",u,t.status),e.selectedFilters=e.selectedFilters.concat(c)),t.tags&&(c=e.formatSelectedFilters("tags",l,t.tags),e.selectedFilters=e.selectedFilters.concat(c)),t.assigned_to&&(c=e.formatSelectedFilters("assigned_to",n,t.assigned_to),e.selectedFilters=e.selectedFilters.concat(c)),t.owner&&(c=e.formatSelectedFilters("owner",s,t.owner),e.selectedFilters=e.selectedFilters.concat(c)),t.role&&(c=e.formatSelectedFilters("role",a,t.role),e.selectedFilters=e.selectedFilters.concat(c)),e.filterQ=t.q,e.filters=[{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.STATUS"),dataType:"status",content:u},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TAGS"),dataType:"tags",content:l,hideEmpty:!0,totalTaggedElements:p.length},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"),dataType:"assigned_to",content:n},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ROLE"),dataType:"role",content:a},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.CREATED_BY"),dataType:"owner",content:s}],e.customFilters=[],_.forOwn(i,function(t,r){return e.customFilters.push({id:r,name:r,filter:t})})}}(this))},e.prototype._setMeta=function(){var t,e,r;return e=this.translate.instant("BACKLOG.SPRINTS.DATE"),r=this.translate.instant("TASKBOARD.PAGE_TITLE",{projectName:this.scope.project.name,sprintName:this.scope.sprint.name}),t=this.translate.instant("TASKBOARD.PAGE_DESCRIPTION",{projectName:this.scope.project.name,sprintName:this.scope.sprint.name,startDate:moment(this.scope.sprint.estimated_start).format(e),endDate:moment(this.scope.sprint.estimated_finish).format(e),completedPercentage:this.scope.stats.completedPercentage||"0",completedPoints:this.scope.stats.completedPointsSum||"--",totalPoints:this.scope.stats.totalPointsSum||"--",openTasks:this.scope.stats.openTasks||"--",totalTasks:this.scope.stats.total_tasks||"--"}),this.appMetaService.setAll(r,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("taskform:bulk:success",function(t){return function(e,r){return t.refreshTagsColors().then(function(){return t.taskboardTasksService.add(r)}),t.analytics.trackEvent("task","create","bulk create task on taskboard",1)}}(this)),this.scope.$on("taskform:new:success",function(t){return function(e,r){return t.refreshTagsColors().then(function(){return t.taskboardTasksService.add(r)}),t.analytics.trackEvent("task","create","create task on taskboard",1)}}(this)),this.scope.$on("taskform:edit:success",function(t){return function(e,r){return t.refreshTagsColors().then(function(){return t.taskboardTasksService.replaceModel(r)})}}(this)),this.scope.$on("taskboard:task:deleted",function(t){return function(e,r){return t.loadTasks()}}(this)),this.scope.$on("taskboard:task:move",this.taskMove),this.scope.$on("assigned-to:added",this.onAssignedToChanged)},e.prototype.onAssignedToChanged=function(t,e,r){return r.assigned_to=e,this.taskboardTasksService.replaceModel(r),this.repo.save(r).then(function(t){return function(){if(t.generateFilters(),t.isFilterDataTypeSelected("assigned_to")||t.isFilterDataTypeSelected("role"))return t.loadTasks()}}(this))},e.prototype.initializeSubscription=function(){var t,e;return t="changes.project."+this.scope.projectId+".tasks",this.events.subscribe(this.scope,t,o(500,function(t){return function(e){return t.loadTaskboard()}}(this))),e="changes.project."+this.scope.projectId+".userstories",this.events.subscribe(this.scope,e,function(t){return function(e){return t.refreshTagsColors(),t.loadSprintStats(),t.loadSprint()}}(this))},e.prototype.loadProject=function(){return this.rs.projects.get(this.scope.projectId).then(function(t){return function(e){return e.is_backlog_activated||t.errorHandlingService.permissionDenied(),t.scope.project=e,t.scope.pointsList=_.sortBy(e.points,"order"),t.scope.pointsById=s(e.points,function(t){return t.id}),t.scope.roleById=s(e.roles,function(t){return t.id}),t.scope.taskStatusList=_.sortBy(e.task_statuses,"order"),t.scope.usStatusList=_.sortBy(e.us_statuses,"order"),t.scope.usStatusById=s(e.us_statuses,function(t){return t.id}),t.scope.$emit("project:loaded",e),t.fillUsersAndRoles(e.members,e.roles),e}}(this))},e.prototype.loadSprintStats=function(){return this.rs.sprints.stats(this.scope.projectId,this.scope.sprintId).then(function(t){return function(e){var r,n,i,o;return o=_.reduce(_.values(e.total_points),function(t,e){return t+e},0),r=_.reduce(_.values(e.completed_points),function(t,e){return t+e},0),n=o-r,i=e.total_tasks-e.completed_tasks,t.scope.stats=e,t.scope.stats.totalPointsSum=o,t.scope.stats.completedPointsSum=r,t.scope.stats.remainingPointsSum=n,t.scope.stats.remainingTasks=i,e.totalPointsSum?t.scope.stats.completedPercentage=Math.round(100*e.completedPointsSum/e.totalPointsSum):t.scope.stats.completedPercentage=0,t.scope.stats.openTasks=e.total_tasks-e.completed_tasks,e}}(this))},e.prototype.refreshTagsColors=function(){return this.rs.projects.tagsColors(this.scope.projectId).then(function(t){return function(e){return t.scope.project.tags_colors=e._attrs}}(this))},e.prototype.loadSprint=function(){return this.rs.sprints.get(this.scope.projectId,this.scope.sprintId).then(function(t){return function(e){return t.scope.sprint=e,t.scope.userstories=_.sortBy(e.user_stories,"sprint_order"),t.taskboardTasksService.setUserstories(t.scope.userstories),e}}(this))},e.prototype.loadTasks=function(){var t;return t={},this.zoomLevel>1&&(t.include_attachments=1),t=_.merge(t,this.location.search()),this.rs.tasks.list(this.scope.projectId,this.scope.sprintId,null,t).then(function(t){return function(e){return t.taskboardTasksService.init(t.scope.project,t.scope.usersById),t.taskboardTasksService.set(e)}}(this))},e.prototype.loadTaskboard=function(){return this.q.all([this.refreshTagsColors(),this.loadSprintStats(),this.loadSprint().then(function(t){return function(){return t.loadTasks()}}(this))])},e.prototype.loadInitialData=function(){var t,e;return t={pslug:this.params.pslug,sslug:this.params.sslug},e=this.repo.resolve(t).then(function(t){return function(e){return t.scope.projectId=e.project,t.scope.sprintId=e.milestone,t.initializeSubscription(),e}}(this)),e.then(function(t){return function(){return t.loadProject()}}(this)).then(function(t){return function(){return t.generateFilters(),t.loadTaskboard().then(function(){return t.setRolePoints()})}}(this))},e.prototype.showPlaceHolder=function(t,e){return!(this.taskboardTasksService.tasksRaw.length||this.scope.taskStatusList[0].id!==t||this.scope.userstories.length&&this.scope.userstories[0].id!==e)},e.prototype.editTask=function(t){var e;return e=this.taskboardTasksService.getTask(t),e=e.set("loading-edit",!0),this.taskboardTasksService.replace(e),this.rs.tasks.getByRef(e.getIn(["model","project"]),e.getIn(["model","ref"])).then(function(t){return function(r){return t.rs2.attachments.list("task",e.get("id"),e.getIn(["model","project"])).then(function(n){return t.rootscope.$broadcast("taskform:edit",r,n.toJS()),e=e.set("loading",!1),t.taskboardTasksService.replace(e)})}}(this))},e.prototype.deleteTask=function(t){var e;return e=this.taskboardTasksService.getTask(t),e=e.set("loading-delete",!0),this.rs.tasks.getByRef(e.getIn(["model","project"]),e.getIn(["model","ref"])).then(function(t){return function(r){var n,i;return e=e.set("loading-delete",!1),i=t.translate.instant("TASK.TITLE_DELETE_ACTION"),n=r.subject,t.confirm.askOnDelete(i,n).then(function(e){var n;return n=t.repo.remove(r),n.then(function(){return t.scope.$broadcast("taskboard:task:deleted"),e.finish()}),n.then(null,function(){return e.finish(!1),this.confirm.notify("error")})})}}(this))},e.prototype.taskMove=function(t,e,r,n,i,o){var s,a,c,u;return e=this.taskboardTasksService.getTaskModel(e.get("id")),s=this.taskboardTasksService.move(e.id,n,i,o),c={status__is_archived:!1,include_attachments:!0},a={headers:{"set-orders":JSON.stringify(s.set_orders)}},u=this.repo.save(e,!0,c,a,!0).then(function(t){return function(e){var r;if(r=e[1],r&&r["taiga-info-order-updated"]&&(o=JSON.parse(r["taiga-info-order-updated"]),t.taskboardTasksService.assignOrders(o)),t.loadSprintStats(),t.generateFilters(),t.isFilterDataTypeSelected("status"))return t.loadTasks()}}(this))},e.prototype.addNewTask=function(t,e){switch(t){case"standard":return this.rootscope.$broadcast("taskform:new",this.scope.sprintId,null!=e?e.id:void 0);case"bulk":return this.rootscope.$broadcast("taskform:bulk",this.scope.sprintId,null!=e?e.id:void 0)}},e.prototype.toggleFold=function(t){return this.taskboardTasksService.toggleFold(t)},e.prototype.changeTaskAssignedTo=function(t){var e;return e=this.taskboardTasksService.getTaskModel(t),this.rootscope.$broadcast("assigned-to:add",e)},e.prototype.setRolePoints=function(){var t,e,r,n;return t=_.filter(this.scope.project.roles,"computable"),r=function(e){return function(e){return e=parseInt(e,10),_.find(t,function(t){return t.id===e})}}(this),e=function(t){return function(e){var r;return r=parseInt(e,10),_.find(t.scope.project.points,function(t){return t.id===e})}}(this),n=_.reduce(this.scope.userstories,function(t){return function(t,n,i){return _.forOwn(n.points,function(n,i){var o,s;return s=r(i),o=e(n),t[s.id]||(t[s.id]=s,t[s.id].points=0),t[s.id].points+=o.value}),t}}(this),{}),this.scope.pointsByRole=Object.keys(n).map(function(t){return n[t]})},e}(a(l.Controller,l.PageMixin,l.FiltersMixin)),c.controller("TaskboardController",t),e=function(t){var e;return e=function(e,r,n){var i,o;return i=r.controller(),r.on("click",".toggle-analytics-visibility",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),r.toggleClass("active"),t.$broadcast("taskboard:graph:toggle-visibility")}),o=r.find(".taskboard-table-body"),o.on("scroll",function(t){var e,n;return n=angular.element(t.currentTarget),e=r.find(".taskboard-table-header .taskboard-table-inner"),e.css("left",-1*n.scrollLeft())}),e.$on("$destroy",function(){return r.off()})},{link:e}},c.directive("tgTaskboard",["$rootScope",e]),r=function(t){var e,r,n;return e=40,n=300,r=function(r,i,o){var s,a,c,u,l;return r.$on("sprint:zoom0",function(t){return function(){return c()}}(this)),r.$on("sprint:task:moved",function(t){return function(){return c()}}(this)),r.$watch("usTasks",function(){if(r.project)return r.statusesFolded=t.tasks.getStatusColumnModes(r.project.id),r.usFolded=t.tasks.getUsRowModes(r.project.id,r.sprintId),c()}),r.foldStatus=function(e){return r.statusesFolded[e.id]=!r.statusesFolded[e.id],t.tasks.storeStatusColumnModes(r.projectId,r.statusesFolded),c()},r.foldUs=function(e){return e?r.usFolded[e.id]=!r.usFolded[e.id]:r.usFolded[null]=!r.usFolded[null],t.tasks.storeUsRowModes(r.projectId,r.sprintId,r.usFolded),c()},s=function(t){return function(t,n){var i,o,s;return i=t?r.usTasks.getIn([t.toString(),n.toString()]).size:r.usTasks.getIn(["null",n.toString()]).size,r.statusesFolded[n]?(i&&r.usFolded[t]?(o=Math.round(Math.sqrt(i)),s=e*o):s=e,s):0}}(this),l=function(t){return function(t,e){var o;return o=i.find(".squish-status-"+t),e?o.css("max-width",e):"0"===r.ctrl.zoomLevel?o.css("max-width",148):o.css("max-width",n)}}(this),u=function(t){return function(){var t,e,r;return t=[],e=i.find(".task-colum-name"),t=_.map(e,function(t){return $(t).outerWidth(!0)}),r=_.reduce(t,function(t,e){return t+e}),i.find(".taskboard-table-inner").css("width",r)}}(this),a=function(t){return function(t){var e;return e=s(null,t),_.forEach(r.userstories,function(r){var n;if(n=s(r.id,t),n>e)return e=n}),l(t,e)}}(this),c=function(t){return function(){_.forEach(r.taskStatusList,function(t){return a(t.id)}),u()}}(this)},{link:r}},c.directive("tgTaskboardSquishColumn",["$tgResources",r])}.call(this),function(){var t,e,r,n,i,o,s,a;s=this.taiga,n=this.taiga.mixOf,a=this.taiga.toggleText,o=this.taiga.scopeDefer,e=this.taiga.bindOnce,r=this.taiga.groupBy,i=angular.module("taigaBacklog"),t=function(t,e,r,n){var i;return i=function(t,e,i){var o;return o=t.$watch("usTasks",function(i){var s,a,c,u,l,p,h,f,d;if(i&&i.size&&(o(),t.project.my_permissions.indexOf("modify_task")>-1))return h=null,p=null,l=null,d=e,u=function(){var t;return t=n.instant("BACKLOG.SORTABLE_FILTER_ERROR"),$tgConfirm.notify("error",t)},a=function(t){return t.scope().$destroy(),t.off(),t.remove()},s=_.map(e.find(".task-column"),function(t){return t}),c=dragula(s,{copySortSource:!1,copy:!1,accepts:function(t,e){return!$(e).hasClass("taskboard-userstory-box")},moves:function(t){return $(t).is("tg-card")}}),c.on("drag",function(t){if(h=$(t).parent().scope(),e.hasClass("active-filters"))return u(),setTimeout(function(){return c.cancel(!0)},0),!1}),c.on("dragend",function(e){var n,i,o,s,c,u,f;return f=$(e).parent(),l=$(e),i=l.scope().task,n=l.index(),p=f.scope(),u=h.us?h.us.id:null,c=h.st.id,s=p.us?p.us.id:null,o=p.st.id,o===c&&s===u||a(l),t.$apply(function(){return r.$broadcast("taskboard:task:move",i,i.getIn(["model","status"]),s,o,n)})}),f=autoScroll([$(".taskboard-table-body")[0]],{margin:100,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&c.dragging}}),t.$on("$destroy",function(){return e.off(),c.destroy()})})},{link:i}},i.directive("tgTaskboardSortable",["$tgRepo","$tgResources","$rootScope","$translate",t])}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga.groupBy,t=function(t){function e(){this.reset()}return r(e,t),e.$inject=[],e.prototype.reset=function(){return this.tasksRaw=[],this.foldStatusChanged={},this.usTasks=Immutable.Map()},e.prototype.init=function(t,e){return this.project=t,this.usersById=e},e.prototype.resetFolds=function(){return this.foldStatusChanged={},this.refresh()},e.prototype.toggleFold=function(t){return this.foldStatusChanged[t]=!this.foldStatusChanged[t],this.refresh()},e.prototype.add=function(t){return this.tasksRaw=this.tasksRaw.concat(t),this.refresh()},e.prototype.set=function(t){return this.tasksRaw=t,this.refreshRawOrder(),this.refresh()},e.prototype.setUserstories=function(t){return this.userstories=t},e.prototype.refreshRawOrder=function(){var t,e,r,n,i;for(this.order={},r=this.tasksRaw,n=[],t=0,e=r.length;t1)for(s=0,l=f.length;s1)for(o=0,p=m.length;o1&&(b=_.map(m,function(t){return function(e){return{us_id:e.id,order:t.order[e.id]}}}(this)))}}else S=0;for(l=u=0,f=t.length;u1&&r<=1?(this.zoomLoading=!0,this.loadUserstories().then(function(t){return function(){return t.zoomLoading=!1,t.kanbanUserstoriesService.resetFolds()}}(this))):void 0)},e.prototype.filtersReloadContent=function(){return this.loadUserstories().then(function(t){return function(){var e,r,n,i,o;if(n=_.difference(t.kanbanUserstoriesService.archivedStatus,t.kanbanUserstoriesService.statusHide),n.length){for(i=[],e=0,r=n.length;e0&&(r.assigned_to=n[0]),0===n.length&&(r.assigned_to=null),this.kanbanUserstoriesService.replaceModel(r),i=this.repo.save(r),i.then(null,function(){return console.log("FAIL")})},e.prototype.refreshTagsColors=function(){return this.rs.projects.tagsColors(this.scope.projectId).then(function(t){return function(e){return t.scope.project.tags_colors=e._attrs}}(this))},e.prototype.loadUserstories=function(){var t,e;return t={status__is_archived:!1},this.zoomLevel>1&&(t.include_attachments=1,t.include_tasks=1),t=_.merge(t,this.location.search()),e=this.rs.userstories.listAll(this.scope.projectId,t).then(function(t){return function(e){return t.kanbanUserstoriesService.init(t.scope.project,t.scope.usersById),t.kanbanUserstoriesService.set(e),h(t.scope,function(){return t.scope.$broadcast("userstories:loaded",e)}),e}}(this)),e.then(function(t){return function(){return t.scope.$broadcast("redraw:wip")}}(this)),e},e.prototype.loadUserStoriesForStatus=function(t,e){var r,n;if(r=this.location.search().status,!r||(r=r.split(",").map(function(t){return parseInt(t,10)}),r.indexOf(e)!==-1))return n={status:e,include_attachments:!0,include_tasks:!0},n=_.merge(n,this.location.search()),this.rs.userstories.listAll(this.scope.projectId,n).then(function(t){return function(r){return t.scope.$broadcast("kanban:shown-userstories-for-status",e,r),r}}(this))},e.prototype.hideUserStoriesForStatus=function(t,e){return this.scope.$broadcast("kanban:hidden-userstories-for-status",e)},e.prototype.loadKanban=function(){return this.q.all([this.refreshTagsColors(),this.loadUserstories()])},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.is_kanban_activated||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.projectId=t.id,this.scope.points=_.sortBy(t.points,"order"),this.scope.pointsById=u(t.points,function(t){return t.id}),this.scope.usStatusById=u(t.us_statuses,function(t){return t.id}),this.scope.usStatusList=_.sortBy(t.us_statuses,"order"),this.scope.$emit("project:loaded",t),t},e.prototype.initializeSubscription=function(){var t;return t="changes.project."+this.scope.projectId+".userstories",this.events.subscribe(this.scope,t,c(500,function(t){return function(e){return t.loadUserstories()}}(this)))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles),this.initializeSubscription(),this.loadKanban(),this.generateFilters()},e.prototype.prepareBulkUpdateData=function(t,e){return null==e&&(e="kanban_order"),_.map(t,function(t){return{us_id:t.id,order:t[e]}})},e.prototype.moveUs=function(t,e,r,n){var i,o;return this.cleanSelectedUss(),e=_.map(e,function(t){return function(e){return t.kanbanUserstoriesService.getUsModel(e.id)}}(this)),i=this.kanbanUserstoriesService.move(e,r,n),o=this.rs.userstories.bulkUpdateKanbanOrder(this.scope.projectId,r,i.bulkOrders),o.then(function(t){return function(){var r,n,s;return r={headers:{"set-orders":JSON.stringify(i.setOrders)}},n={include_attachments:!0,include_tasks:!0},s=_.map(e,function(e){return t.repo.save(e,!0,n,r,!0)}),o=t.q.all(s),o.then(function(e){var r,n; return r=e[1],r&&r["taiga-info-order-updated"]&&(n=JSON.parse(r["taiga-info-order-updated"]),t.kanbanUserstoriesService.assignOrders(n)),t.scope.$broadcast("redraw:wip"),t.generateFilters(),t.isFilterDataTypeSelected("status")&&t.filtersReloadContent(),o})}}(this))},e}(l(f.Controller,f.PageMixin,f.FiltersMixin,f.UsFiltersMixin)),p.controller("KanbanController",r),n=function(t,e){var r;return r=function(t,e,r){var n;return n=e.find(".kanban-table-body"),n.on("scroll",function(t){var r,n;return n=angular.element(t.currentTarget),r=e.find(".kanban-table-header .kanban-table-inner"),r.css("left",-1*n.scrollLeft())}),t.$on("$destroy",function(){return e.off()})},{link:r}},p.directive("tgKanban",["$tgRepo","$rootScope",n]),t=function(t,e,r){var n,i,o;return o=e.instant("KANBAN.ACTION_SHOW_ARCHIVED"),n=e.instant("KANBAN.ACTION_HIDE_ARCHIVED"),i=function(e,i,s){var a,c;return c=e.$eval(s.tgKanbanArchivedStatusHeader),a=!0,r.addArchivedStatus(c.id),r.hideStatus(c.id),e["class"]="icon-watch",e.title=o,i.on("click",function(i){return a=!a,e.$apply(function(){return a?(e["class"]="icon-watch",e.title=o,t.$broadcast("kanban:hide-userstories-for-status",c.id),r.hideStatus(c.id)):(e["class"]="icon-unwatch",e.title=n,t.$broadcast("kanban:show-userstories-for-status",c.id),r.showStatus(c.id))})}),e.$on("$destroy",function(){return i.off()})},{link:i}},p.directive("tgKanbanArchivedStatusHeader",["$rootScope","$translate","tgKanbanUserstories",t]),e=function(t,e){var r,n;return n=[],r=function(r,n,i){var o,s,a;return o=t.instant("KANBAN.HIDDEN_USER_STORIES"),s=r.$eval(i.tgKanbanArchivedStatusIntro),n.text(o),a=function(t){return t?n.text(""):n.text(o)},r.$on("kanban:us:move",function(t,r,n,i,o){var s;return s=!!e.getStatus(i).length,a(s)}),r.$on("kanban:shown-userstories-for-status",function(t,r,n){var i;if(r===s.id)return e.deleteStatus(r),e.add(n),i=!!e.getStatus(r).length,a(i)}),r.$on("kanban:hidden-userstories-for-status",function(t,e){if(e===s.id)return a(!1)}),r.$on("$destroy",function(){return n.off()})},{link:r}},p.directive("tgKanbanArchivedStatusIntro",["$translate","tgKanbanUserstories",e]),i=function(t,e){var r;return r=function(r,n,i){var o,s;return r.foldStatus=function(e){r.folds[e.id]=!r.folds[e.id],t.kanban.storeStatusColumnModes(r.projectId,r.folds),s()},s=function(){var t,e;return t=_.map(r.usStatusList,function(t){return r.folds[t.id]?40:310}),e=_.reduce(t,function(t,e){return t+e}),n.find(".kanban-table-inner").css("width",e)},o=r.$watch("usByStatus",function(n){if(n.size)return r.folds=t.kanban.getStatusColumnModes(e.project.get("id")),s(),o()})},{link:r}},p.directive("tgKanbanSquishColumn",["$tgResources","tgProjectService",i]),o=function(t){var e;return e=function(e,r,n){var i,o;return o=e.$eval(n.tgKanbanWipLimit),i=function(e){return function(){return r.find(".kanban-wip-limit").remove(),t(function(){var t;if(t=r.find("tg-card")[o.wip_limit])return angular.element(t).before("
")})}}(this),o&&!o.is_archived&&(e.$on("redraw:wip",i),e.$on("kanban:us:move",i),e.$on("usform:new:success",i),e.$on("usform:bulk:success",i)),e.$on("$destroy",function(){return r.off()})},{link:e}},p.directive("tgKanbanWipLimit",["$timeout",o])}.call(this),function(){var t,e,r,n,i,o,s,a,c;s=this.taiga,n=this.taiga.mixOf,c=this.taiga.toggleText,o=this.taiga.scopeDefer,e=this.taiga.bindOnce,r=this.taiga.groupBy,a=this.taiga.timeout,i=angular.module("taigaKanban"),t=function(t,e,r){var n;return n=function(t,e,n){var i;return i=t.$watch("usByStatus",function(n){var o,s,a,c,u,l,p;if(n&&n.size&&(i(),t.project.my_permissions.indexOf("modify_us")>-1))return u=null,c=null,p=e,s=function(t){return t.scope().$destroy(),t.off(),t.remove()},o=_.map(e.find(".task-column"),function(t){return t}),a=dragula(o,{copySortSource:!1,copy:!1,moves:function(t){return $(t).is("tg-card")}}),a.on("drag",function(t){return window.dragMultiple.start(t,o)}),a.on("cloned",function(t,e){return $(t).addClass("multiple-drag-mirror")}),a.on("dragend",function(e){var n,i,o,a,l,p,h,f;return h=$(e).parent(),u=h.scope(),p=u.s.id,n=window.dragMultiple.stop(),n.length||(n=[e]),o=n[0],a=$(o).index(),l=u.s.id,f=_.map(n,function(t){return $(t).scope().us}),i=_.map(f,function(t){return{id:t.get("id"),oldStatusId:t.getIn(["model","status"])}}),t.$apply(function(){return _.each(f,function(t){return function(t,e){var r,i;if(r=t.getIn(["model","status"]),i=l===r,!i)return c=$(n[e]),s(c)}}(this)),r.$broadcast("kanban:us:move",i,l,a)})}),l=autoScroll(o,{margin:100,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&a.dragging}}),t.$on("$destroy",function(){return e.off(),a.destroy()})})},{link:n}},i.directive("tgKanbanSortable",["$tgRepo","$tgResources","$rootScope",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;u=this.taiga,a=this.taiga.mixOf,l=this.taiga.toString,s=this.taiga.joinStr,o=this.taiga.groupBy,i=this.taiga.bindOnce,n=this.taiga.bindMethods,c=angular.module("taigaEpics"),t=function(t){function e(t,e,r,i,o,s,a,c,u,l,p,h,f,d,g,m,v){var y;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=i,this.rs=o,this.rs2=s,this.params=a,this.q=c,this.location=u,this.log=l,this.appMetaService=p,this.analytics=h,this.navUrls=f,this.translate=d,this.modelTransform=g,this.errorHandlingService=m,this.projectService=v,n(this),this.scope.epicRef=this.params.epicref,this.scope.sectionName=this.translate.instant("EPIC.SECTION_NAME"),this.initializeEventHandlers(),y=this.loadInitialData(),y.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),y.then(null,this.onInitialDataError.bind(this))}return p(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgAnalytics","$tgNavUrls","$translate","$tgQueueModelTransformation","tgErrorHandlingService","tgProjectService"],e.prototype._setMeta=function(){var t,e,r;return r=this.translate.instant("EPIC.PAGE_TITLE",{epicRef:"#"+this.scope.epic.ref,epicSubject:this.scope.epic.subject,projectName:this.scope.project.name}),t=this.translate.instant("EPIC.PAGE_DESCRIPTION",{epicStatus:(null!=(e=this.scope.statusById[this.scope.epic.status])?e.name:void 0)||"--",epicDescription:angular.element(this.scope.epic.description_html||"").text()}),this.appMetaService.setAll(r,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on epic",1)}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadEpic()}}(this)),this.scope.$on("custom-attributes-values:edit",function(t){return function(){return t.rootscope.$broadcast("object:updated")}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;return t={project:this.scope.project.slug},this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-epics",t)},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.immutableProject=this.projectService.project,this.scope.$emit("project:loaded",t),this.scope.statusList=t.epic_statuses,this.scope.statusById=o(t.epic_statuses,function(t){return t.id}),t},e.prototype.loadEpic=function(){return this.rs.epics.getByRef(this.scope.projectId,this.params.epicref).then(function(t){return function(e){var r,n,i;if(t.scope.epic=e,t.scope.immutableEpic=Immutable.fromJS(e._attrs),t.scope.epicId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"epic"),null!=(null!=(n=t.scope.epic.neighbors.previous)?n.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.epic.neighbors.previous.ref},t.scope.previousUrl=t.navUrls.resolve("project-epics-detail",r)),null!=(null!=(i=t.scope.epic.neighbors.next)?i.ref:void 0))return r={project:t.scope.project.slug,ref:t.scope.epic.neighbors.next.ref},t.scope.nextUrl=t.navUrls.resolve("project-epics-detail",r)}}(this))},e.prototype.loadUserstories=function(){return this.rs2.userstories.listInEpic(this.scope.epicId).then(function(t){return function(e){return t.scope.userstories=e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles),this.loadEpic().then(function(t){return function(){return t.loadUserstories()}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.upvote(this.scope.epicId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.downvote(this.scope.epicId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.watch(this.scope.epicId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadEpic(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.epics.unwatch(this.scope.epicId).then(e,t)},e.prototype.onSelectColor=function(t){var e,r,n;return r=function(t){return function(){return t.rootscope.$broadcast("object:updated"),t.confirm.notify("success")}}(this),e=function(t){return function(){return t.confirm.notify("error")}}(this),n=this.modelTransform.save(function(e){return e.color=t,e}),n.then(r,e)},e}(a(u.Controller,u.PageMixin)),c.controller("EpicDetailController",t),r=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:s.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},c.directive("tgEpicStatusDisplay",["$tgTemplate","$compile",r]),e=function(t,e,r,n,i,o,s,a){var c,u;return u=a.get("common/components/status-button.html",!0),c=function(e,s,a,c){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_epic")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=o(u({status:n,statuses:e.statusList,editable:l()}))(e),s.html(r)}}(this),h=function(e){var o,a,c,u;return o=n().target(s).start(),u=i.save(function(t){return t.status=e,t}),c=function(){return t.$broadcast("object:updated"),o.finish()},a=function(){return r.notify("error"),o.finish()},u.then(c,a)},s.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return s.find(".pop-status").popover().open()}),s.on("click",".status",function(t){var e;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),$.fn.popover().closeAll(),h(e.data("status-id"))}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.status:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return s.off()})},{link:c,restrict:"EA",require:"ngModel"}},c.directive("tgEpicStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$compile","$translate","$tgTemplate",e])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g=function(t,e){function r(){this.constructor=t}for(var n in e)m.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},m={}.hasOwnProperty;f=this.taiga,p=this.taiga.mixOf,d=this.taiga.toString,l=this.taiga.joinStr,u=this.taiga.groupBy,c=this.taiga.bindOnce,a=this.taiga.bindMethods,h=angular.module("taigaIssues"),t=function(t){function e(t,e,r,n,i,o,s,c,u,l,p,h,f,d,g,m){var v;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=c,this.log=u,this.appMetaService=l,this.analytics=p,this.navUrls=h,this.translate=f,this.modelTransform=d,this.errorHandlingService=g,this.projectService=m,a(this),this.scope.issueRef=this.params.issueref,this.scope.sectionName=this.translate.instant("ISSUES.SECTION_NAME"),this.initializeEventHandlers(),v=this.loadInitialData(),v.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),v.then(null,this.onInitialDataError.bind(this))}return g(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgAnalytics","$tgNavUrls","$translate","$tgQueueModelTransformation","tgErrorHandlingService","tgProjectService"],e.prototype._setMeta=function(){var t,e,r,n,i,o;return o=this.translate.instant("ISSUE.PAGE_TITLE",{issueRef:"#"+this.scope.issue.ref,issueSubject:this.scope.issue.subject,projectName:this.scope.project.name}),t=this.translate.instant("ISSUE.PAGE_DESCRIPTION",{issueStatus:(null!=(e=this.scope.statusById[this.scope.issue.status])?e.name:void 0)||"--",issueType:(null!=(r=this.scope.typeById[this.scope.issue.type])?r.name:void 0)||"--",issueSeverity:(null!=(n=this.scope.severityById[this.scope.issue.severity])?n.name:void 0)||"--",issuePriority:(null!=(i=this.scope.priorityById[this.scope.issue.priority])?i.name:void 0)||"--",issueDescription:angular.element(this.scope.issue.description_html||"").text()}),this.appMetaService.setAll(o,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on issue",1)}}(this)),this.scope.$on("promote-issue-to-us:success",function(t){return function(){return t.analytics.trackEvent("issue","promoteToUserstory","promote issue to userstory",1),t.rootscope.$broadcast("object:updated"),t.loadIssue()}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadIssue()}}(this)),this.scope.$on("custom-attributes-values:edit",function(t){return function(){return t.rootscope.$broadcast("object:updated")}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;return t={project:this.scope.project.slug},this.scope.project.is_issues_activated?this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-issues",t):this.scope.onDeleteGoToUrl=this.navUrls.resolve("project",t)},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),this.scope.statusList=t.issue_statuses,this.scope.statusById=u(t.issue_statuses,function(t){return t.id}),this.scope.typeById=u(t.issue_types,function(t){return t.id}),this.scope.typeList=_.sortBy(t.issue_types,"order"),this.scope.severityList=t.severities,this.scope.severityById=u(t.severities,function(t){return t.id}),this.scope.priorityList=t.priorities,this.scope.priorityById=u(t.priorities,function(t){return t.id}),t},e.prototype.loadIssue=function(){return this.rs.issues.getByRef(this.scope.projectId,this.params.issueref).then(function(t){return function(e){var r,n,i;if(t.scope.issue=e,t.scope.issueId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"issue"),null!=(null!=(n=t.scope.issue.neighbors.previous)?n.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.issue.neighbors.previous.ref},t.scope.previousUrl=t.navUrls.resolve("project-issues-detail",r)),null!=(null!=(i=t.scope.issue.neighbors.next)?i.ref:void 0))return r={project:t.scope.project.slug,ref:t.scope.issue.neighbors.next.ref},t.scope.nextUrl=t.navUrls.resolve("project-issues-detail",r)}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles),this.loadIssue()},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.upvote(this.scope.issueId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.downvote(this.scope.issueId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.watch(this.scope.issueId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadIssue(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.issues.unwatch(this.scope.issueId).then(e,t)},e}(p(f.Controller,f.PageMixin)),h.controller("IssueDetailController",t),i=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:s.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},h.directive("tgIssueStatusDisplay",["$tgTemplate","$compile",i]),n=function(t,e,r,n,i,o,s){var a,c;return c=o.get("common/components/status-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=c({status:n,statuses:e.statusList,editable:l()}),r=s(r)(e),o.html(r)}}(this),h=function(e){var s,a,c,u;return $.fn.popover().closeAll(),s=n().target(o).start(),u=i.save(function(t){return t.status=e,t}),c=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},u.then(c,a)},o.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-status").popover().open()}),o.on("click",".status",function(t){var e;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),h(e.data("status-id"))}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.status:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},h.directive("tgIssueStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",n]),o=function(t,e,r,n,i,o,s){var a,c;return c=o.get("issue/issue-type-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.typeById[t.type],r=c({type:n,typees:e.typeList,editable:l()}),r=s(r)(e),o.html(r)}}(this),h=function(e){var s,a,c,u;return $.fn.popover().closeAll(),s=n().target(o.find(".level-name")).start(),u=i.save(function(t){return t.type=e,t}),c=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},u.then(c,a)},o.on("click",".type-data",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-type").popover().open()}),o.on("click",".type",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),r=e.data("type-id"),h(r)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.type:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},h.directive("tgIssueTypeButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",o]),r=function(t,e,r,n,i,o,s){var a,c;return c=o.get("issue/issue-severity-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.severityById[t.severity],r=c({severity:n,severityes:e.severityList,editable:l()}),r=s(r)(e),o.html(r)}}(this),h=function(e){var s,a,c,u;return $.fn.popover().closeAll(),s=n().target(o.find(".level-name")).start(),u=i.save(function(t){return t.severity=e,t}),c=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},u.then(c,a)},o.on("click",".severity-data",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-severity").popover().open()}),o.on("click",".severity",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return r=angular.element(t.currentTarget),e=r.data("severity-id"),h(e)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.severity:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},h.directive("tgIssueSeverityButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",r]),e=function(t,e,r,n,i,o,s){var a,c;return c=o.get("issue/issue-priority-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_issue")!==-1},p=function(t){return function(t){var r,n;return n=e.priorityById[t.priority],r=c({priority:n,priorityes:e.priorityList,editable:l()}),r=s(r)(e),o.html(r)}}(this),h=function(e){var s,a,c,u;return $.fn.popover().closeAll(),s=n().target(o.find(".level-name")).start(),u=i.save(function(t){return t.priority=e,t}),c=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},u.then(c,a)},o.on("click",".priority-data",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-priority").popover().open()}),o.on("click",".priority",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return r=angular.element(t.currentTarget),e=r.data("priority-id"),h(e)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.priority:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},h.directive("tgIssuePriorityButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",e]),s=function(t,e,r,n){var i;return i=function(i,o,s,a){var c;return c=function(n){return function(n,i){var o,s,a;return o={generated_from_issue:n.id,project:n.project,subject:n.subject,description:n.description,tags:n.tags,is_blocked:n.is_blocked,blocked_note:n.blocked_note,due_date:n.due_date},a=function(){return i.finish(),r.notify("success"),t.$broadcast("promote-issue-to-us:success")},s=function(){return i.finish(),r.notify("error")},e.create("userstories",o).then(a,s)}}(this),o.on("click","a",function(t){var e,i,o,s;return t.preventDefault(),e=a.$modelValue,s=n.instant("ISSUES.CONFIRM_PROMOTE.TITLE"),i=n.instant("ISSUES.CONFIRM_PROMOTE.MESSAGE"),o=e.subject,r.ask(s,o,i).then(function(t){return function(t){return c(e,t)}}(this))}),i.$on("$destroy",function(){return o.off()})},{restrict:"AE",require:"ngModel",templateUrl:"issue/promote-issue-to-us-button.html",link:i}},h.directive("tgPromoteIssueToUsButton",["$rootScope","$tgRepo","$tgConfirm","$translate",s])}.call(this),function(){var t,e,r,n,i,o,s,a=[].indexOf||function(t){for(var e=0,r=this.length;e0}),n=_.map(o.assigned_to,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.full_name||"Unassigned",t}),s=_.map(o.owners,function(t){return t.id=t.id.toString(),t.name=t.full_name,t}),c=_.map(o.roles,function(t){return t.id?t.id=t.id.toString():t.id="null",t.name=t.name||"Unassigned",t}),e.selectedFilters=[],t.status&&(u=e.formatSelectedFilters("status",p,t.status),e.selectedFilters=e.selectedFilters.concat(u)),t.tags&&(u=e.formatSelectedFilters("tags",h,t.tags),e.selectedFilters=e.selectedFilters.concat(u)),t.assigned_to&&(u=e.formatSelectedFilters("assigned_to",n,t.assigned_to), e.selectedFilters=e.selectedFilters.concat(u)),t.owner&&(u=e.formatSelectedFilters("owner",s,t.owner),e.selectedFilters=e.selectedFilters.concat(u)),t.type&&(u=e.formatSelectedFilters("type",d,t.type),e.selectedFilters=e.selectedFilters.concat(u)),t.severity&&(u=e.formatSelectedFilters("severity",l,t.severity),e.selectedFilters=e.selectedFilters.concat(u)),t.priority&&(u=e.formatSelectedFilters("priority",a,t.priority),e.selectedFilters=e.selectedFilters.concat(u)),t.role&&(u=e.formatSelectedFilters("role",c,t.role),e.selectedFilters=e.selectedFilters.concat(u)),e.filterQ=t.q,e.filters=[{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TYPE"),dataType:"type",content:d},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.SEVERITY"),dataType:"severity",content:l},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.PRIORITIES"),dataType:"priority",content:a},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.STATUS"),dataType:"status",content:p},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.TAGS"),dataType:"tags",content:h,hideEmpty:!0,totalTaggedElements:f.length},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ASSIGNED_TO"),dataType:"assigned_to",content:n},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.ROLE"),dataType:"role",content:c},{title:e.translate.instant("COMMON.FILTERS.CATEGORIES.CREATED_BY"),dataType:"owner",content:s}],e.customFilters=[],_.forOwn(i,function(t,r){return e.customFilters.push({id:r,name:r,filter:t})})}}(this))},e.prototype.initializeSubscription=function(){var t;return t="changes.project."+this.scope.projectId+".issues",this.events.subscribe(this.scope,t,s(500,function(t){return function(e){return t.loadIssues()}}(this)))},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.is_issues_activated||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),this.scope.issueStatusById=a(t.issue_statuses,function(t){return t.id}),this.scope.issueStatusList=_.sortBy(t.issue_statuses,"order"),this.scope.severityById=a(t.severities,function(t){return t.id}),this.scope.severityList=_.sortBy(t.severities,"order"),this.scope.priorityById=a(t.priorities,function(t){return t.id}),this.scope.priorityList=_.sortBy(t.priorities,"order"),this.scope.issueTypes=_.sortBy(t.issue_types,"order"),this.scope.issueTypeById=a(t.issue_types,function(t){return t.id}),t},e.prototype.loadIssuesRequests=0,e.prototype.loadIssues=function(){var t,e;return t=this.location.search(),e=this.rs.issues.list(this.scope.projectId,t),this.loadIssuesRequests+=1,e.index=this.loadIssuesRequests,e.then(function(t){return function(r){return e.index===t.loadIssuesRequests&&(t.scope.issues=r.models,t.scope.page=r.current,t.scope.count=r.count,t.scope.paginatedBy=r.paginatedBy),r}}(this)),e},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles),this.initializeSubscription(),this.generateFilters(),this.loadIssues()},e.prototype.addNewIssue=function(){return this.rootscope.$broadcast("issueform:new",this.scope.project)},e.prototype.addIssuesInBulk=function(){return this.rootscope.$broadcast("issueform:bulk",this.scope.projectId)},e.prototype.upVoteIssue=function(t){var e,r;return this.voting=t,r=function(t){return function(){return t.loadIssues(),t.voting=null}}(this),e=function(t){return function(){return t.confirm.notify("error"),t.voting=null}}(this),this.rs.issues.upvote(t).then(r,e)},e.prototype.downVoteIssue=function(t){var e,r;return this.voting=t,r=function(t){return function(){return t.loadIssues(),t.voting=null}}(this),e=function(t){return function(){return t.confirm.notify("error"),t.voting=null}}(this),this.rs.issues.downvote(t).then(r,e)},e.prototype.getOrderBy=function(){return _.isString(this.location.search().order_by)?this.location.search().order_by:"created_date"},e}(u(h.Controller,h.PageMixin,h.FiltersMixin)),l.controller("IssuesController",r),n=function(t,e,r,n){var i,o,s,a;return a=r.get("issue/issue-paginator.html",!0),s=function(t,e,r,i){var o,s,c,u,l,p,h;return s=2,l=4,c=2,u=2,o=e.find(".issues-paginator"),p=function(){var e;return e=t.count/t.paginatedBy,e=parseInt(e,10)1,d.showNext=!(t.page===f),e=t.page,i=h=1,m=f;1<=m?h<=m:h>=m;i=1<=m?++h:--h)i===e+s&&f>e+s+u?g.push({classes:"dots",type:"dots"}):i===e-l&&e>c+l?g.push({classes:"dots",type:"dots"}):i>e+s&&i<=f-u||ic||(i===e?g.push({classes:"active",num:i,type:"page-active"}):g.push({classes:"page",num:i,type:"page"}));return r=a(d),r=n(r)(t),o.html(r)},t.$watch("issues",function(t){if(t)return h()}),e.on("click",".issues-paginator a.next",function(e){return e.preventDefault(),t.$apply(function(){return i.selectFilter("page",t.page+1),i.loadIssues()})}),e.on("click",".issues-paginator a.previous",function(e){return e.preventDefault(),t.$apply(function(){return i.selectFilter("page",t.page-1),i.loadIssues()})}),e.on("click",".issues-paginator li.page > a",function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=n.data("pagenum"),t.$apply(function(){return i.selectFilter("page",r),i.loadIssues()})})},o=function(t,r,i,o){var s,a,c,u;return a=o.getOrderBy(),a&&(c=p(a,"-")?"icon-arrow-up":"icon-arrow-down",s=r.find(".row.title > div[data-fieldname='"+d(a,"-")+"']"),u=$("").attr("svg-icon",c),s.append(u),n(s.contents())(t)),r.on("click",".row.title > div",function(i){var s,l,h;return h=angular.element(i.currentTarget),a=o.getOrderBy(),l=h.data("fieldname"),"total_voters"===l&&"-total_voters"!==a&&(a="total_voters"),s=a===l?"-"+l:l,t.$apply(function(){return o.replaceFilter("order_by",s),o.storeFilters(o.params.pslug,e.search(),o.filtersHashSuffix),o.loadIssues().then(function(){return r.find(".row.title > div > tg-svg").remove(),c=p(s,"-")?"icon-arrow-up":"icon-arrow-down",u=$("").attr("svg-icon",c),h.append(u),n(h.contents())(t)})})})},i=function(t,e,r){var n;return n=e.controller(),o(t,e,r,n),s(t,e,r,n),t.$on("$destroy",function(){return e.off()})},{link:i}},l.directive("tgIssues",["$log","$tgLocation","$tgTemplate","$compile",n]),e=function(t,e,r){var n,i,o;return i=e.get("issue/issue-status-inline-edition-selection.html",!0),o=function(t,e,r){var n,i,o;if(i=t.find(".issue-status"),n=t.find(".issue-status .issue-status-bind"),o=r[e.status])return n.text(o.name),n.prop("title",o.name),i.css("color",o.color)},n=function(e,r,n){var s,a;return s=r.controller(),a=e.$eval(n.tgIssueStatusInlineEdition),r.on("click",".issue-status",function(t){return t.preventDefault(),t.stopPropagation(),r.find(".pop-status").popover().open()}),r.on("click",".status",function(n){var i;return n.preventDefault(),n.stopPropagation(),i=angular.element(n.currentTarget),a.status=i.data("status-id"),r.find(".pop-status").popover().close(),o(r,a,e.issueStatusById),e.$apply(function(){return t.save(a).then(function(){if(s.generateFilters(),s.isFilterDataTypeSelected("status"))return s.loadIssues()})})}),h.bindOnce(e,"project",function(t){if(r.append(i({statuses:t.issue_statuses})),o(r,a,e.issueStatusById),t.my_permissions.indexOf("modify_issue")===-1)return r.unbind("click"),r.find("a").addClass("not-clickable")}),e.$watch(n.tgIssueStatusInlineEdition,function(t){return function(t){return o(r,t,e.issueStatusById)}}(this)),e.$on("$destroy",function(){return r.off()})},{link:n}},l.directive("tgIssueStatusInlineEdition",["$tgRepo","$tgTemplate","$rootScope",e]),t=function(t,e,r,n){var i,o;return o=_.template('<%- name %>\n
<%- name %>
'),i=function(i,s,a){var c,u,l;return l=function(t){var e,a,c;return a={name:r.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED"),imgurl:"/"+window._version+"/images/unnamed.png"},c=i.usersById[t.assigned_to],e=n.getAvatar(c),a.imgurl=e.url,a.bg=null,c&&(a.name=c.full_name_display,a.bg=e.bg),s.find(".avatar").html(o(a)),s.find(".issue-assignedto").attr("title",a.name)},c=s.controller(),u=i.$eval(a.tgIssueAssignedToInlineEdition),l(u),s.on("click",".issue-assignedto",function(t){return e.$broadcast("assigned-to:add",u)}),h.bindOnce(i,"project",function(t){if(t.my_permissions.indexOf("modify_issue")===-1)return s.unbind("click"),s.find("a").addClass("not-clickable")}),i.$on("assigned-to:added",function(e,r,n){if(n.id===u.id)return n.assigned_to=r,t.save(u).then(function(){if(l(n),c.generateFilters(),c.isFilterDataTypeSelected("assigned_to")||c.isFilterDataTypeSelected("role"))return c.loadIssues()})}),i.$watch(a.tgIssueAssignedToInlineEdition,function(t){return l(t)}),i.$on("$destroy",function(){return s.off()})},{link:i}},l.directive("tgIssueAssignedToInlineEdition",["$tgRepo","$rootScope","$translate","tgAvatarService",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;l=this.taiga,c=this.taiga.mixOf,a=this.taiga.groupBy,s=this.taiga.bindOnce,o=this.taiga.bindMethods,u=angular.module("taigaUserStories"),i=function(t){function e(t,e,r,n,i,s,a,c,u,l,p,h,f,d,g,m,v,y){var _;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=s,this.q=a,this.location=c,this.log=u,this.appMetaService=l,this.navUrls=p,this.analytics=h,this.translate=f,this.modelTransform=d,this.errorHandlingService=g,this.configService=m,this.projectService=v,this.wysiwigService=y,o(this),this.scope.usRef=this.params.usref,this.scope.sectionName=this.translate.instant("US.SECTION_NAME"),this.scope.tribeEnabled=this.configService.config.tribeHost,this.initializeEventHandlers(),_=this.loadInitialData(),_.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),_.then(null,this.onInitialDataError.bind(this))}return p(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgNavUrls","$tgAnalytics","$translate","$tgQueueModelTransformation","tgErrorHandlingService","$tgConfig","tgProjectService","tgWysiwygService"],e.prototype._setMeta=function(){var t,e,r,n,i,o;return o=this.scope.tasks.length,t=_.filter(this.scope.tasks,function(t){return function(e){return t.scope.taskStatusById[e.status].is_closed}}(this)).length,r=o>0?Math.round(100*t/o):0,i=this.translate.instant("US.PAGE_TITLE",{userStoryRef:"#"+this.scope.us.ref,userStorySubject:this.scope.us.subject,projectName:this.scope.project.name}),e=this.translate.instant("US.PAGE_DESCRIPTION",{userStoryStatus:(null!=(n=this.scope.statusById[this.scope.us.status])?n.name:void 0)||"--",userStoryPoints:this.scope.us.total_points,userStoryDescription:angular.element(this.wysiwigService.getHTML(this.scope.us.description)||"").text(),userStoryClosedTasks:t,userStoryTotalTasks:o,userStoryProgressPercentage:r}),this.appMetaService.setAll(i,e)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("related-tasks:update",function(t){return function(){var e;if(t.scope.tasks=_.clone(t.scope.tasks,!1),e=_.every(t.scope.tasks,function(t){return t.is_closed}),t.scope.us.is_closed!==e)return t.loadUs()}}(this)),this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on userstory",1)}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadUs()}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;return t={project:this.scope.project.slug},this.scope.onDeleteGoToUrl=this.navUrls.resolve("project",t),this.scope.project.is_backlog_activated?this.scope.us.milestone?(t.sprint=this.scope.sprint.slug,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-taskboard",t)):this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-backlog",t):this.scope.project.is_kanban_activated?this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-kanban",t):void 0},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),this.scope.statusList=t.us_statuses,this.scope.statusById=a(t.us_statuses,function(t){return t.id}),this.scope.taskStatusById=a(t.task_statuses,function(t){return t.id}),this.scope.pointsList=_.sortBy(t.points,"order"),this.scope.pointsById=a(this.scope.pointsList,function(t){return t.id}),t},e.prototype.loadUs=function(){var t,e,r,n;return t=_.pick(this.location.search(),"milestone","no-milestone","kanban-status"),r=t.milestone,r&&this.rs.userstories.storeQueryParams(this.scope.projectId,{milestone:r,order_by:"sprint_order"}),n=t["no-milestone"],n&&this.rs.userstories.storeQueryParams(this.scope.projectId,{milestone:"null",order_by:"backlog_order"}),e=t["kanban-status"],e&&this.rs.userstories.storeQueryParams(this.scope.projectId,{status:e,order_by:"kanban_order"}),this.rs.userstories.getByRef(this.scope.projectId,this.params.usref).then(function(t){return function(e){return t.scope.us=e,t.scope.usId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"us"),e}}(this))},e.prototype.loadSprint=function(){if(this.scope.us.milestone)return this.rs.sprints.get(this.scope.us.project,this.scope.us.milestone).then(function(t){return function(e){return t.scope.sprint=e,e}}(this))},e.prototype.loadTasks=function(){return this.rs.tasks.list(this.scope.projectId,null,this.scope.usId).then(function(t){return function(e){return t.scope.tasks=e,e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles),this.loadUs().then(function(t){return function(){return t.q.all([t.loadSprint(),t.loadTasks()])}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.upvote(this.scope.usId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.downvote(this.scope.usId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.watch(this.scope.usId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadUs(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.userstories.unwatch(this.scope.usId).then(e,t)},e.prototype.onTribeInfo=function(){var t,e,r,n;return r=this.translate.instant("US.TRIBE.PUBLISH_MORE_INFO_TITLE"),t=$("").attr({src:"/"+window._version+"/images/monster-fight.png",alt:this.translate.instant("US.TRIBE.PUBLISH_MORE_INFO_TITLE")}),n=this.translate.instant("US.TRIBE.PUBLISH_MORE_INFO_TEXT"),e=$("
").append(t).append(n),this.confirm.success(r,e)},e}(c(l.Controller,l.PageMixin)),u.controller("UserStoryDetailController",i),r=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:i.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},u.directive("tgUsStatusDisplay",["$tgTemplate","$compile",r]),e=function(t,e,r,n,i,o,s){var a,c;return c=o.get("common/components/status-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_us")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=c({status:n,statuses:e.statusList,editable:l()}),o.html(r),s(o.contents())(e)}}(this),h=function(e){return function(e){var s,a,c,u;return o.find(".pop-status").popover().close(),s=n().target(o.find(".js-edit-status")).start(),u=i.save(function(t){return t.status=e,t}),c=function(){return t.$broadcast("object:updated"),s.finish()},a=function(){return r.notify("error"),s.finish()},u.then(c,a)}}(this),o.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return o.find(".pop-status").popover().open()}),o.on("click",".status",function(t){var e,r;if(t.preventDefault(),t.stopPropagation(),l())return r=angular.element(t.currentTarget),e=r.data("status-id"),h(e)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.status:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},u.directive("tgUsStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",e]),n=function(t,e,r,n,i,o,s){var a,c;return c=o.get("us/us-team-requirement-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_us")!==-1},p=function(t){var r,n;return r={canEdit:l(),isRequired:t.team_requirement},n=c(r),n=s(n)(e),o.html(n)},h=function(e){var s,a;return s=n().target(o.find("label")).start(),a=i.save(function(t){return t.team_requirement=e,t}),a.then(function(e){return function(){return s.finish(),t.$broadcast("object:updated")}}(this)),a.then(null,function(){return s.finish(),r.notify("error")})},o.on("click",".team-requirement",function(t){var e;if(l())return e=!u.$modelValue.team_requirement,h(e)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.team_requirement:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},u.directive("tgUsTeamRequirementButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",n]),t=function(t,e,r,n,i,o,s){var a,c;return c=o.get("us/us-client-requirement-button.html",!0),a=function(e,o,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_us")!==-1},p=function(t){var r,n;return r={canEdit:l(),isRequired:t.client_requirement},n=s(c(r))(e),o.html(n)},h=function(e){var s,a;return s=n().target(o.find("label")).start(),a=i.save(function(t){return t.client_requirement=e,t}),a.then(function(e){return function(){return s.finish(),t.$broadcast("object:updated")}}(this)),a.then(null,function(){return r.notify("error")})},o.on("click",".client-requirement",function(t){var e;if(l())return e=!u.$modelValue.client_requirement,h(e)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.client_requirement:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return o.off()})},{link:a,restrict:"EA",require:"ngModel"}},u.directive("tgUsClientRequirementButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$tgTemplate","$compile",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;c=this.taiga,s=this.taiga.mixOf,o=this.taiga.groupBy,i=this.taiga.bindMethods,a=angular.module("taigaTasks"),t=function(t){function e(t,e,r,n,o,s,a,c,u,l,p,h,f,d,g,m){var v;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=o,this.params=s,this.q=a,this.location=c,this.log=u,this.appMetaService=l,this.navUrls=p,this.analytics=h,this.translate=f,this.modelTransform=d,this.errorHandlingService=g,this.projectService=m,i(this),this.scope.taskRef=this.params.taskref,this.scope.sectionName=this.translate.instant("TASK.SECTION_NAME"),this.initializeEventHandlers(),v=this.loadInitialData(),v.then(function(t){return function(){return t._setMeta(),t.initializeOnDeleteGoToUrl()}}(this)),v.then(null,this.onInitialDataError.bind(this))}return u(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$log","tgAppMetaService","$tgNavUrls","$tgAnalytics","$translate","$tgQueueModelTransformation","tgErrorHandlingService","tgProjectService"],e.prototype._setMeta=function(){var t,e,r;return r=this.translate.instant("TASK.PAGE_TITLE",{taskRef:"#"+this.scope.task.ref,taskSubject:this.scope.task.subject,projectName:this.scope.project.name}),t=this.translate.instant("TASK.PAGE_DESCRIPTION",{taskStatus:(null!=(e=this.scope.statusById[this.scope.task.status])?e.name:void 0)||"--",taskDescription:angular.element(this.scope.task.description_html||"").text()}),this.appMetaService.setAll(r,t)},e.prototype.initializeEventHandlers=function(){return this.scope.$on("attachment:create",function(t){return function(){return t.analytics.trackEvent("attachment","create","create attachment on task",1)}}(this)),this.scope.$on("custom-attributes-values:edit",function(t){return function(){return t.rootscope.$broadcast("object:updated")}}(this)),this.scope.$on("comment:new",function(t){return function(){return t.loadTask()}}(this))},e.prototype.initializeOnDeleteGoToUrl=function(){var t;if(t={project:this.scope.project.slug},this.scope.onDeleteGoToUrl=this.navUrls.resolve("project",t),this.scope.project.is_backlog_activated){if(this.scope.task.milestone)return t.sprint=this.scope.sprint.slug,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-taskboard",t);if(this.scope.task.us)return t.ref=this.scope.us.ref,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-userstories-detail",t)}else if(this.scope.project.is_kanban_activated&&this.scope.us)return t.ref=this.scope.us.ref,this.scope.onDeleteGoToUrl=this.navUrls.resolve("project-userstories-detail",t)},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),this.scope.statusList=t.task_statuses,this.scope.statusById=o(t.task_statuses,function(t){return t.id}),t},e.prototype.loadTask=function(){return this.rs.tasks.getByRef(this.scope.projectId,this.params.taskref).then(function(t){return function(e){var r,n,i;return t.scope.task=e,t.scope.taskId=e.id,t.scope.commentModel=e,t.modelTransform.setObject(t.scope,"task"),null!=(null!=(n=t.scope.task.neighbors.previous)?n.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.task.neighbors.previous.ref},t.scope.previousUrl=t.navUrls.resolve("project-tasks-detail",r)),null!=(null!=(i=t.scope.task.neighbors.next)?i.ref:void 0)&&(r={project:t.scope.project.slug,ref:t.scope.task.neighbors.next.ref},t.scope.nextUrl=t.navUrls.resolve("project-tasks-detail",r)),e}}(this))},e.prototype.loadSprint=function(){if(this.scope.task.milestone)return this.rs.sprints.get(this.scope.task.project,this.scope.task.milestone).then(function(t){return function(e){return t.scope.sprint=e,e}}(this))},e.prototype.loadUserStory=function(){if(this.scope.task.user_story)return this.rs.userstories.get(this.scope.task.project,this.scope.task.user_story).then(function(t){return function(e){return t.scope.us=e,e}}(this))},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.fillUsersAndRoles(t.members,t.roles),this.loadTask().then(function(t){return function(){return t.q.all([t.loadSprint(),t.loadUserStory()])}}(this))},e.prototype.onUpvote=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.upvote(this.scope.taskId).then(e,t)},e.prototype.onDownvote=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.downvote(this.scope.taskId).then(e,t)},e.prototype.onWatch=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.watch(this.scope.taskId).then(e,t)},e.prototype.onUnwatch=function(){var t,e;return e=function(t){return function(){return t.loadTask(),t.rootscope.$broadcast("object:updated")}}(this),t=function(t){return function(){return t.confirm.notify("error")}}(this),this.rs.tasks.unwatch(this.scope.taskId).then(e,t)},e}(s(c.Controller,c.PageMixin)),a.controller("TaskDetailController",t),n=function(t,e){var r,n;return n=t.get("common/components/status-display.html",!0),r=function(t,r,i){var o;return o=function(i){var o,s;return s=t.statusById[i.status],o=n({is_closed:s.is_closed,status:s}),o=e(o)(t),r.html(o)},t.$watch(i.ngModel,function(t){if(null!=t)return o(t)}),t.$on("$destroy",function(){return r.off()})},{link:r,restrict:"EA",require:"ngModel"}},a.directive("tgTaskStatusDisplay",["$tgTemplate","$compile",n]),r=function(t,e,r,n,i,o,s,a){var c,u;return u=a.get("common/components/status-button.html",!0),c=function(e,s,a,c){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_task")!==-1},p=function(t){return function(t){var r,n;return n=e.statusById[t.status],r=o(u({status:n,statuses:e.statusList,editable:l()}))(e),s.html(r)}}(this),h=function(e){var o,a,c,u;return o=n().target(s).start(),u=i.save(function(t){return t.status=e,t}),c=function(){return t.$broadcast("object:updated"),o.finish()},a=function(){return r.notify("error"),o.finish()},u.then(c,a)},s.on("click",".js-edit-status",function(t){if(t.preventDefault(),t.stopPropagation(),l())return s.find(".pop-status").popover().open()}),s.on("click",".status",function(t){var e;if(t.preventDefault(),t.stopPropagation(),l())return e=angular.element(t.currentTarget),$.fn.popover().closeAll(),h(e.data("status-id"))}),e.$watch(function(){var t;return null!=(t=c.$modelValue)?t.status:void 0},function(){var t;if(t=c.$modelValue)return p(t)}),e.$on("$destroy",function(){return s.off()})},{link:c,restrict:"EA",require:"ngModel"}},a.directive("tgTaskStatusButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$compile","$translate","$tgTemplate",r]),e=function(t,e,r,n,i,o,s){var a,c;return c=s.get("issue/iocaine-button.html",!0),a=function(e,s,a,u){var l,p,h;return l=function(){return e.project.my_permissions.indexOf("modify_task")!==-1},p=function(t){var r,n;return l()||t.is_iocaine?(r={isIocaine:t.is_iocaine,isEditable:l()},n=o(c(r))(e),s.html(n)):void s.html("")},h=function(e){var o,a;return o=n().target(s.find("label")).start(),a=i.save(function(t){return t.is_iocaine=e,t}),a.then(function(){return t.$broadcast("object:updated")}),a.then(null,function(){return r.notify("error")}),a["finally"](function(){return o.finish()})},s.on("click",".is-iocaine",function(t){var e;if(l())return e=!u.$modelValue.is_iocaine,h(e)}),e.$watch(function(){var t;return null!=(t=u.$modelValue)?t.is_iocaine:void 0},function(){var t;if(t=u.$modelValue)return p(t)}),e.$on("$destroy",function(){return s.off()})},{link:a,restrict:"EA",require:"ngModel"}},a.directive("tgTaskIsIocaineButton",["$rootScope","$tgRepo","$tgConfirm","$tgLoading","$tgQueueModelTransformation","$compile","$tgTemplate",e])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;u=this.taiga,a=this.taiga.mixOf,c=angular.module("taigaTeam"),e=function(t){function e(t,e,r,n,i,o,s,a,c,u,l,p,h){var f;this.scope=t,this.rootscope=e,this.repo=r,this.rs=n,this.params=i,this.q=o,this.location=s,this.navUrls=a,this.appMetaService=c,this.auth=u,this.translate=l,this.projectService=p,this.errorHandlingService=h,this.scope.sectionName="TEAM.SECTION_NAME",f=this.loadInitialData(),f.then(function(t){return function(){var e,r;return r=t.translate.instant("TEAM.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.translate.instant("TEAM.PAGE_DESCRIPTION",{projectName:t.scope.project.name,projectDescription:t.scope.project.description}),t.appMetaService.setAll(r,e)}}(this)),f.then(null,this.onInitialDataError.bind(this))}return l(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgResources","$routeParams","$q","$location","$tgNavUrls","tgAppMetaService","$tgAuth","$translate","tgProjectService","tgErrorHandlingService"],e.prototype.setRole=function(t){return t?this.scope.filtersRole=t:this.scope.filtersRole=null},e.prototype.loadMembers=function(){var t,e,r,n,i;for(i=this.auth.getUser(),this.scope.totals={},n=this.scope.activeUsers,t=0,e=n.length;t=0)})}},c.filter("membersFilter",s)}.call(this),function(){var t,e,r,n,i,o,s,a,c,u=function(t,e){return function(){return t.apply(e,arguments)}},l=function(t,e){function r(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},p={}.hasOwnProperty;c=this.taiga,s=this.taiga.mixOf,o=this.taiga.groupBy,n=this.taiga.bindOnce,i=this.taiga.debounce,a=angular.module("taigaWiki"),t=function(t){function e(t,e,r,n,i,o,s,a,c,l,p,h,f,d,g,m,v){var y;this.scope=t,this.rootscope=e,this.repo=r,this.model=n,this.confirm=i,this.rs=o,this.params=s,this.q=a,this.location=c,this.filter=l,this.log=p,this.appMetaService=h,this.navUrls=f,this.analytics=d,this.translate=g,this.errorHandlingService=m,this.projectService=v,this.moveLink=u(this.moveLink,this),this.loadWiki=u(this.loadWiki,this),this.scope.$on("wiki:links:move",this.moveLink),this.scope.$on("wikipage:add",this.loadWiki),this.scope.projectSlug=this.params.pslug,this.scope.wikiSlug=this.params.slug,this.scope.sectionName="Wiki",this.scope.linksVisible=!1,y=this.loadInitialData(),y.then(function(t){return function(){return t._setMeta()}}(this)),y.then(null,this.onInitialDataError.bind(this))}return l(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgModel","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$filter","$log","tgAppMetaService","$tgNavUrls","$tgAnalytics","$translate","tgErrorHandlingService","tgProjectService"],e.prototype._setMeta=function(){var t,e,r,n,i;return i=this.translate.instant("WIKI.PAGE_TITLE",{wikiPageName:this.scope.wikiSlug,projectName:this.scope.project.name}),t=this.translate.instant("WIKI.PAGE_DESCRIPTION",{wikiPageContent:angular.element((null!=(e=this.scope.wiki)?e.html:void 0)||"").text(),totalEditions:(null!=(r=this.scope.wiki)?r.editions:void 0)||0,lastModifiedDate:moment(null!=(n=this.scope.wiki)?n.modified_date:void 0).format(this.translate.instant("WIKI.DATETIME"))}),this.appMetaService.setAll(i,t)},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.is_wiki_activated||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadWiki=function(){var t;return t=this.rs.wiki.getBySlug(this.scope.projectId,this.params.slug),t.then(function(t){return function(e){return t.scope.wiki=e,t.scope.wikiId=e.id,t.scope.wiki}}(this)),t.then(null,function(t){return function(e){var r;return t.scope.wikiId=null,t.scope.project.my_permissions.indexOf("add_wiki_page")===-1?null:(r={project:t.scope.projectId,slug:t.scope.wikiSlug,content:""},t.scope.wiki=t.model.make_model("wiki",r),t.scope.wiki)}}(this))},e.prototype.loadWikiLinks=function(){return this.rs.wiki.listLinks(this.scope.projectId).then(function(t){return function(e){var r,n,i,o,s;for(t.scope.wikiLinks=e,o=t.scope.wikiLinks,r=0,n=o.length;r\n \n \n\n
\n\n \n {{'COMMON.DESCRIPTION.NO_DESCRIPTION' | translate}}\n \n"}},a.directive("tgWikiWysiwyg",["$tgQueueModelTransformation","$rootScope","$tgConfirm","tgAttachmentsFullService","$tgQqueue","$tgRepo","$tgAnalytics","tgWikiHistoryService",r])}.call(this),function(){var t,e,r,n,i,o;o=this.taiga,n=this.taiga.mixOf,r=this.taiga.groupBy,e=this.taiga.bindOnce,i=angular.module("taigaWiki"),t=function(t,r,n,i,o,s,a,c,u){var l,p,h;return h=a.get("wiki/wiki-nav.html",!0),p=function(n,a,l){var p,f,d,g;return p=a.controller(),null==l.ngModel?r.error("WikiNavDirective: no ng-model attr is defined"):(f=n.project.my_permissions.indexOf("add_wiki_link")>-1,d=null,g=function(e){var r,l,m,v,y;return f=n.project.my_permissions.indexOf("add_wiki_link")>-1,r=n.project.my_permissions.indexOf("delete_wiki_link")>-1,l=h({wikiLinks:e,projectSlug:n.projectSlug,addWikiLinkPermission:f,deleteWikiLinkPermission:r}),l=c(l)(n),a.off(),f&&d&&d.destroy(),a.html(l),f&&(m=null,y=a.find(".sortable"),d=dragula([y[0]],{direction:"vertical",copySortSource:!1,copy:!1,mirrorContainer:y[0],moves:function(t){return $(t).is("li")}}),d.on("dragend",function(t){var e;return m=$(t),t=m.scope().link,e=m.index(),n.$emit("wiki:links:move",t,e)}),v=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&d.dragging}})),a.on("click",".add-button",function(t){return t.preventDefault(),a.find(".new").removeClass("hidden"),a.find(".new input").focus(),a.find(".add-button").hide()}),a.on("click",".js-delete-link",function(e){var r,o,s,a;return e.preventDefault(),e.stopPropagation(),s=angular.element(e.currentTarget),r=s.parents(".wiki-link").data("id"),a=u.instant("WIKI.DELETE_LINK_TITLE"),o=n.wikiLinks[r].title,i.askOnDelete(a,o).then(function(e){return function(e){var o;return o=t.remove(n.wikiLinks[r]),o.then(function(){return o=p.loadWikiLinks(),o.then(function(){return e.finish(),g(n.wikiLinks)}),o.then(null,function(){return e.finish()})}),o.then(null,function(){return e.finish(!1),i.notify("error")})}}(this))}),a.on("keyup",".new input",function(e){var r,c,u,l;return e.preventDefault(),13===e.keyCode?(l=angular.element(e.currentTarget),c=l.val(),r=s().target(a.find(".new")).start(),u=t.create("wiki-links",{project:n.projectId,title:c}),u.then(function(){var t;return o.trackEvent("wikilink","create","create wiki link",1),t=p.loadWikiLinks(),t.then(function(){return r.finish(),a.find(".new").addClass("hidden"),a.find(".new input").val(""),a.find(".add-button").show(),g(n.wikiLinks)}),t.then(null,function(){return r.finish(),a.find(".new").addClass("hidden"),a.find(".new input").val(""),a.find(".add-button").show(),i.notify("error","Error loading wiki links")})}),u.then(null,function(t){var e;return r.finish(),a.find(".new input").val(c),a.find(".new input").focus().select(),null!=(null!=t&&null!=(e=t.__all__)?e[0]:void 0)?i.notify("error","The link already exists"):i.notify("error")})):27===e.keyCode?(l=angular.element(e.currentTarget),a.find(".new").addClass("hidden"),a.find(".new input").val(""),a.find(".add-button").show()):void 0})},e(n,l.ngModel,g))},l=function(t,e,r){return p(t,e,r),t.$on("$destroy",function(){return e.off()})},{link:l}},i.directive("tgWikiNav",["$tgRepo","$log","$tgLocation","$tgConfirm","$tgAnalytics","$tgLoading","$tgTemplate","$compile","$translate",t])}.call(this),function(){var t,e,r,n,i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;n=this.taiga,e=this.taiga.mixOf,r=angular.module("taigaWiki"),t=function(t){function e(t,e,r,n,i,o,s,a,c,u,l){var p;this.scope=t,this.rootscope=e,this.repo=r,this.model=n,this.confirm=i,this.rs=o,this.params=s,this.q=a,this.navUrls=c,this.errorHandlingService=u,this.projectService=l,this.scope.projectSlug=this.params.pslug,this.scope.wikiSlug=this.params.slug,this.scope.sectionName="Wiki",this.scope.linksVisible=!1,p=this.loadInitialData(),p.then(null,this.onInitialDataError.bind(this))}return i(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgModel","$tgConfirm","$tgResources","$routeParams","$q","$tgNavUrls","tgErrorHandlingService","tgProjectService"],e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.is_wiki_activated||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadWikiPages=function(){var t;return t=this.rs.wiki.list(this.scope.projectId).then(function(t){return function(e){return t.scope.wikipages=e}}(this))},e.prototype.loadWikiLinks=function(){return this.rs.wiki.listLinks(this.scope.projectId).then(function(t){return function(e){var r,n,i,o,s;for(t.scope.wikiLinks=e,o=t.scope.wikiLinks,r=0,n=o.length;rt.total_memberships,this.scope.$emit("project:loaded",t),t},e.prototype.loadMembers=function(){var t;return t=this.getUrlFilters(),this.rs.memberships.list(this.scope.projectId,t).then(function(t){return function(e){return t.scope.memberships=_.filter(e.models,function(t){return null===t.user||t.is_user_active}),t.scope.page=e.current,t.scope.count=e.count,t.scope.paginatedBy=e.paginatedBy,e}}(this))},e.prototype.loadInitialData=function(){return this.loadProject(),this.q.all([this.loadMembers(),this.auth.refresh()])},e.prototype.getUrlFilters=function(){var t;return t=_.pick(this.location.search(),"page"),t.page||(t.page=1),t},e.prototype.addNewMembers=function(){return this.lightboxFactory.create("tg-lb-add-members",{"class":"lightbox lightbox-add-member",project:"project"},{project:this.scope.project})},e.prototype.showLimitUsersWarningMessage=function(){var t,e,r;return r=this.translate.instant("ADMIN.MEMBERSHIPS.LIMIT_USERS_WARNING"),e=this.translate.instant("ADMIN.MEMBERSHIPS.LIMIT_USERS_WARNING_MESSAGE",{members:this.scope.project.max_memberships}),t="/"+window._version+"/svg/icons/team-question.svg",this.confirm.success(r,e,{name:t,type:"img"})},e}(c(l.Controller,l.PageMixin,l.FiltersMixin)),u.controller("MembershipsController",t),e=function(t,e){var r,n,i;return i=t.get("admin/admin-membership-paginator.html",!0),n=function(t,r,n,o){var s,a,c,u,l,p,h;return a=2,l=4,c=2,u=2,s=r.find(".memberships-paginator"),p=function(){var e;return e=t.count/t.paginatedBy,e=parseInt(e,10)1,d.showNext=!(t.page===f),r=t.page,o=h=1,m=f;1<=m?h<=m:h>=m;o=1<=m?++h:--h)o===r+a&&f>r+a+u?g.push({classes:"dots",type:"dots"}):o===r-l&&r>c+l?g.push({classes:"dots",type:"dots"}):o>r+a&&o<=f-u||oc||(o===r?g.push({classes:"active",num:o,type:"page-active"}):g.push({classes:"page",num:o,type:"page"}));return n=i(d),n=e(n)(t),s.html(n),s.show()},t.$watch("memberships",function(t){if(t)return h()}),r.on("click",".memberships-paginator a.next",function(e){return e.preventDefault(),t.$apply(function(){return o.selectFilter("page",t.page+1),o.loadMembers()})}),r.on("click",".memberships-paginator a.previous",function(e){return e.preventDefault(),t.$apply(function(){return o.selectFilter("page",t.page-1),o.loadMembers()})}),r.on("click",".memberships-paginator li.page > a",function(e){var r,n;return e.preventDefault(),n=angular.element(e.currentTarget),r=n.data("pagenum"),t.$apply(function(){return o.selectFilter("page",r),o.loadMembers()})})},r=function(t,e,r){var i;return i=e.controller(),n(t,e,r,i),t.$on("$destroy",function(){return e.off()})},{link:r}},u.directive("tgMemberships",["$tgTemplate","$compile",e]),i=function(t,e,r,n,i){var o,s;return s=e.get("admin/memberships-row-avatar.html",!0),o=function(e,o,a){var c,u,l;return u=r.instant("ADMIN.MEMBERSHIP.STATUS_PENDING"),l=function(t){var r,a,c;return r=i.getAvatar(t),a={full_name:t.full_name?t.full_name:"",email:t.user_email?t.user_email:t.email,imgurl:r.url,bg:r.bg,pending:t.is_user_active?"":u,isOwner:t.is_owner},c=s(a),c=n(c)(e),o.html(c)},null==a.tgMembershipsRowAvatar?t.error("MembershipsRowAvatarDirective: the directive need a member"):(c=e.$eval(a.tgMembershipsRowAvatar),l(c),e.$on("$destroy",function(){return o.off()}))},{link:o}},u.directive("tgMembershipsRowAvatar",["$log","$tgTemplate","$translate","$compile","tgAvatarService",i]),n=function(t,e,r,n,i){var o,s;return s=n.get("admin/admin-memberships-row-checkbox.html",!0),o=function(n,o,a){var c,u,l;return n.$on("$destroy",function(){return o.off()}),null==a.tgMembershipsRowAdminCheckbox?t.error("MembershipsRowAdminCheckboxDirective: the directive need a member"):(u=n.$eval(a.tgMembershipsRowAdminCheckbox),u.is_owner?void o.find(".js-check").remove():(l=function(t){var e,r;return e={inputId:"is-admin-"+t.id},r=s(e),r=i(r)(n),o.html(r)},o.on("click",":checkbox",function(t){return function(t){var n,i,s;return i=function(){return r.notify("success")},n=function(t){return u.revert(),o.find(":checkbox").prop("checked",u.is_admin),r.notify("error",t.is_admin[0])},s=angular.element(t.currentTarget),u.is_admin=s.prop("checked"),e.save(u).then(i,n)}}(this)),c=l(u),u.is_admin?o.find(":checkbox").prop("checked",!0):void 0))},{link:o}},u.directive("tgMembershipsRowAdminCheckbox",["$log","$tgRepo","$tgConfirm","$tgTemplate","$compile",n]),o=function(t,e,r){var n,i;return i=_.template(''),n=function(n,o,s){var a,c,u,l;return l=function(t){var e,r;return e={roleList:n.project.roles,selectedRole:t.role},r=i(e),o.html(r)},null==s.tgMembershipsRowRoleSelector?t.error("MembershipsRowRoleSelectorDirective: the directive need a member"):(a=o.controller(),u=n.$eval(s.tgMembershipsRowRoleSelector),c=l(u),o.on("change","select",function(t){return function(t){var n,i,o,s;if(o=function(){return r.notify("success")},i=function(){return r.notify("error")},s=angular.element(t.currentTarget),n=parseInt(s.val(),10),u.role!==n)return u.role=n,e.save(u).then(o,i)}}(this)),n.$on("$destroy",function(){return o.off()}))},{link:n}},u.directive("tgMembershipsRowRoleSelector",["$log","$tgRepo","$tgConfirm",o]),r=function(t,e,r,n,i,o,s,a,c,u){var l,p,h;return l='
\n
\n\n \n',h='\n\n\n \n',p=function(p,f,d){var g,m,v,y;return y=function(t){var e;return e=t.user?i(l)(p):i(h)(p),f.html(e)},null==d.tgMembershipsRowActions?t.error("MembershipsRowActionsDirective: the directive need a member"):(g=f.controller(),v=p.$eval(d.tgMembershipsRowActions),y(v),f.on("click",".js-resend",function(t){var e,i;return t.preventDefault(),i=function(){var t;return t=o.instant("ADMIN.MEMBERSHIP.SUCCESS_SEND_INVITATION",{email:p.member.email}),n.notify("success",t)},e=function(){var t;return t=o.instant("ADMIM.MEMBERSHIP.ERROR_SEND_INVITATION"),n.notify("error",t)},r.memberships.resendInvitation(p.member.id).then(i,e)}),m=function(){var t,r,i;return i=o.instant("ADMIN.MEMBERSHIP.DELETE_MEMBER"),t=o.instant("ADMIN.MEMBERSHIP.DEFAULT_DELETE_MESSAGE",{email:v.email}),r=v.user?v.full_name:t,n.askOnDelete(i,r).then(function(t){var i,c;return c=function(e){return function(){var e;return t.finish(),v.user!==p.user.id?(p.page>1&&p.count-1<=p.paginatedBy&&g.selectFilter("page",p.page-1),u.fetchProject().then(function(){return g.loadInitialData()})):s.path(a.resolve("home")),e=o.instant("ADMIN.MEMBERSHIP.SUCCESS_DELETE",{message:r}),n.notify("success",e,null,5e3)}}(this),i=function(e){return function(){var e;return t.finish(!1),e=o.instant("ADMIN.MEMBERSHIP.ERROR_DELETE",{message:r}),n.notify("error",e)}}(this),e.remove(v).then(c,i)})},f.on("click",".delete",function(t){var e;return t.preventDefault(),p.project.owner.id===v.user?(e=p.user.id===v.user,c.create("tg-lightbox-leave-project-warning",{"class":"lightbox lightbox-leave-project-warning"},{isCurrentUser:e,project:p.project})):m()}),p.$on("$destroy",function(){return f.off()}))},{link:p}},u.directive("tgMembershipsRowActions",["$log","$tgRepo","$tgResources","$tgConfirm","$compile","$translate","$tgLocation","$tgNavUrls","tgLightboxFactory","tgProjectService",r]),s=function(){return{templateUrl:"admin/no-more-memberships-explanation.html",scope:{project:"="}}},u.directive("tgNoMoreMembershipsExplanation",[s])}.call(this),function(){var t,e;t=function(){var t;return t=function(t,e,r){var n;return n=r.tgAdminNavigation,e.find(".active").removeClass("active"),e.find("#adminmenu-"+n+" a").addClass("active"),t.$on("$destroy",function(){return e.off()})},{link:t}},e=angular.module("taigaAdmin"),e.directive("tgAdminNavigation",t)}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v,y,b,S,j,k,$,I,E,T,C,P,w=function(t,e){function r(){this.constructor=t}for(var n in e)A.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},A={}.hasOwnProperty,O=function(t,e){return function(){return t.apply(e,arguments)}};T=this.taiga,$=this.taiga.mixOf,E=this.taiga.scopeDefer,P=this.taiga.trim,C=this.taiga.toString,k=this.taiga.joinStr,j=this.taiga.groupBy,b=this.taiga.bindOnce,S=this.taiga.debounce,I=angular.module("taigaAdmin"),v=function(t){function e(t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g){var m;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=c,this.appMetaService=u,this.translate=l,this.tgAuth=p,this.currentUserService=h,this.errorHandlingService=f,this.projectService=d,this.model=g,this.scope.project={},this.scope.projectTags=[],m=this.loadInitialData(),m.then(function(t){return function(){var e,r,n;return r=t.translate.instant(t.scope.sectionName),n=t.translate.instant("ADMIN.PROJECT_PROFILE.PAGE_TITLE",{sectionName:r,projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(n,e),t.fillUsersAndRoles(t.scope.project.members,t.scope.project.roles)}}(this)),m.then(null,this.onInitialDataError.bind(this)),this.scope.$on("project:loaded",function(t){return function(){var e,r,n;return r=t.translate.instant(t.scope.sectionName),n=t.translate.instant("ADMIN.PROJECT_PROFILE.PAGE_TITLE",{sectionName:r,projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(n,e)}}(this))}return w(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","$tgAuth","tgCurrentUserService","tgErrorHandlingService","tgProjectService","$tgModel"],e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t=this.model.make_model("projects",t),t.i_am_admin||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.epicStatusList=_.sortBy(t.epic_statuses,"order"),this.scope.usStatusList=_.sortBy(t.us_statuses,"order"),this.scope.pointsList=_.sortBy(t.points,"order"),this.scope.taskStatusList=_.sortBy(t.task_statuses,"order"),this.scope.issueTypesList=_.sortBy(t.issue_types,"order"),this.scope.issueStatusList=_.sortBy(t.issue_statuses,"order"),this.scope.prioritiesList=_.sortBy(t.priorities,"order"),this.scope.severitiesList=_.sortBy(t.severities,"order"),E(this.scope,function(e){return function(){return e.scope.$emit("project:loaded",t)}}(this)),this.scope.projectTags=_.map(this.scope.project.tags,function(t){return function(e){return[e,t.scope.project.tags_colors[e]]}}(this)),t},e.prototype.loadInitialData=function(){return this.loadProject(),this.tgAuth.refresh()},e.prototype.openDeleteLightbox=function(){return this.rootscope.$broadcast("deletelightbox:new",this.scope.project)},e.prototype.addTag=function(t,e){var r;return r=_.clone(this.scope.project.tags),r.push(t),this.scope.projectTags.push([t,null]),this.scope.project.tags=r},e.prototype.deleteTag=function(t){var e;return e=_.clone(this.scope.project.tags),_.pull(e,t[0]),_.remove(this.scope.projectTags,function(e){return function(e){return e[0]===t[0]}}(this)),this.scope.project.tags=e},e}($(T.Controller,T.PageMixin)),I.controller("ProjectProfileController",v),y=function(t,e,r,n,i,o,s,a){var c;return c=function(c,u,l){var p,h,f,d;return p=u.controller(),h=u.find("form").checksley({onlyOneErrorElement:!0}),f=S(2e3,function(u){return function(u){var l,f,g;if(u.preventDefault(),h.validate())return l=r().target(d).start(),f=c.project.isAttributeModified("is_private"),g=t.save(c.project),g.then(function(){var t;return l.finish(),f&&c.project.is_private?a.trackEvent("project-privacy-changed","from-public-to-private","Change project privacy from public to private",1):f&&!c.project.is_private&&a.trackEvent("project-privacy-changed","from-private-to-public","Change project privacy from private to public",1),e.notify("success"),t=n.resolve("project-admin-project-profile-details",{project:c.project.slug}),i.path(t),o.fetchProject().then(function(t){return function(){return p.loadInitialData()}}(this)),s.loadProjects()}),g.then(null,function(t){if(l.finish(),h.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),d=u.find(".submit-button"),u.on("submit","form",f)},{link:c}},I.directive("tgProjectProfile",["$tgRepo","$tgConfirm","$tgLoading","$tgNavUrls","$tgLocation","tgProjectService","tgCurrentUserService","$tgAnalytics",y]),h=function(t,e,r){var n;return n=function(n,i,o){var s,a,c;return s=i.find("form").checksley({onlyOneErrorElement:!0}),a=S(2e3,function(i){return function(i){var o,a;if(i.preventDefault(),s.validate())return o=r().target(c).start(),a=t.save(n.project),a.then(function(){return o.finish(),e.notify("success")}),a.then(null,function(t){if(o.finish(),s.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),c=i.find(".submit-button"),i.on("submit","form",a),n.$on("$destroy",function(){return i.off()})},{link:n}},I.directive("tgProjectDefaultValues",["$tgRepo","$tgConfirm","$tgLoading",h]),m=function(t,e,r,n){var i;return i=function(r,i,o){var s;return s=function(o){return function(){var o,s;if(o=i.find("form").checksley(),o.initializeFields(),o.reset(),o.validate())return s=t.save(r.project),s.then(function(){return r.$emit("project:loaded",r.project),e.notify("success"),n.fetchProject()}),s.then(null,function(t){if(o.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this),i.on("change",".module-activation.module-direct-active input",function(t){return t.preventDefault(),r.$applyAsync(s)}),i.on("submit","form",function(t){return t.preventDefault(),s()}),i.on("click",".save",function(t){return t.preventDefault(),s()}),i.on("keydown",".videoconference-attributes input",function(t){return 32!==t.which}),r.$watch("project.videoconferences",function(t,e){if(null!=t&&null!=e&&t!==e)return r.project.videoconferences_extra_data=""}),r.$watch("isVideoconferenceActivated",function(t,e){if(t===!1&&(r.project.videoconferences=null,r.project.videoconferences_extra_data="",e===!0))return s()}),r.$watch("project",function(t){return null!=t.videoconferences?r.isVideoconferenceActivated=!0:r.isVideoconferenceActivated=!1})},{link:i}},I.directive("tgProjectModules",["$tgRepo","$tgConfirm","$tgLoading","tgProjectService",m]), f=function(t,e,r,n,i){var o;return o=function(o,s,a){var c,u,l,p,h,f,d,g,m,v,y,_,b,j,k,$,I,E,T,C,P,w,A,O,R,M;return u=s.find(".admin-project-export-buttons"),E=function(){return u.removeClass("hidden")},p=function(){return u.addClass("hidden")},m=s.find(".admin-project-export-result"),A=function(){return m.removeClass("hidden")},h=function(){return m.addClass("hidden")},R=s.find(".spin"),O=function(){return R.removeClass("hidden")},f=function(){return R.addClass("hidden")},y=s.find(".result-title"),g=n.instant("ADMIN.PROJECT_EXPORT.LOADING_TITLE"),d=n.instant("ADMIN.PROJECT_EXPORT.LOADING_MESSAGE"),l=function(){return y.html(n.instant("ADMIN.PROJECT_EXPORT.DUMP_READY"))},c=function(){return y.html(n.instant("ADMIN.PROJECT_EXPORT.ASYNC_MESSAGE"))},M=function(t){return y.html(n.instant("ADMIN.PROJECT_EXPORT.SYNC_MESSAGE",{url:t}))},k=function(){return y.html(g)},b=function(){return y.html(d)},I=function(){return y.html(l)},v=s.find(".result-message "),j=function(){return v.html(d)},_=function(){return v.html(c)},$=function(t){return v.html(M(t))},w=function(){return O(),k(),j(),p(),A()},C=function(){return f(),b(),_()},P=function(t){return f(),I(),$(t)},T=function(){return f(),h(),E()},s.on("click","a.button-export",S(2e3,function(s){return function(s){var a,c;return s.preventDefault(),c=function(e){var r;return i.trackEvent("exporter","export-project","Exported project",1),202===e.status?C():(r=e.data.url,P(r),t.open(r,"_blank"))},a=function(t){var e,i;return T(),e=n.instant("ADMIN.PROJECT_EXPORT.ERROR"),429===t.status?e=n.instant("ADMIN.PROJECT_EXPORT.ERROR_BUSY"):(null!=(i=t.data)?i._error_message:void 0)&&(e=n.instant("ADMIN.PROJECT_EXPORT.ERROR_BUSY",{message:t.data._error_message})),r.notify("error",e)},w(),e.projects["export"](o.projectId).then(c,a)}}(this)))},{link:o}},I.directive("tgProjectExport",["$window","$tgResources","$tgConfirm","$translate","$tgAnalytics",f]),i=function(t){function e(t,e,r,n,i,o){this.scope=t,this.rootscope=e,this.urls=r,this.confirm=n,this.rs=i,this.translate=o,this._generateUuid=O(this._generateUuid,this),this.setCsvUuid=O(this.setCsvUuid,this),this.rootscope.$on("project:loaded",this.setCsvUuid),this.scope.$watch("csvUuid",function(t){return function(e){return e?t.scope.csvUrl=t.urls.resolveAbsolute(t.type+"-csv",e):t.scope.csvUrl=""}}(this))}return w(e,t),e.$inject=["$scope","$rootScope","$tgUrls","$tgConfirm","$tgResources","$translate"],e.prototype.setCsvUuid=function(){return this.scope.csvUuid=this.scope.project[this.type+"_csv_uuid"]},e.prototype._generateUuid=function(t){var e;return null==t&&(t=null),e=this.rs.projects["regenerate_"+this.type+"_csv_uuid"](this.scope.projectId),e.then(function(t){return function(e){var r;return t.scope.csvUuid=null!=(r=e.data)?r.uuid:void 0}}(this)),e.then(null,function(t){return function(){return t.confirm.notify("error")}}(this)),e["finally"](function(){if(t)return t.finish()}),e},e.prototype.regenerateUuid=function(){var t,e;return this.scope.csvUuid?(e=this.translate.instant("ADMIN.REPORTS.REGENERATE_TITLE"),t=this.translate.instant("ADMIN.REPORTS.REGENERATE_SUBTITLE"),this.confirm.ask(e,t).then(this._generateUuid)):this._generateUuid()},e}(T.Controller),o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="epics",e}(i),c=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="userstories",e}(i),a=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="tasks",e}(i),s=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return w(e,t),e.prototype.type="issues",e}(i),I.controller("CsvExporterEpicsController",o),I.controller("CsvExporterUserstoriesController",c),I.controller("CsvExporterTasksController",a),I.controller("CsvExporterIssuesController",s),n=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_EPIC"},{controller:"CsvExporterEpicsController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvEpic",["$translate",n]),p=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_US"},{controller:"CsvExporterUserstoriesController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvUs",["$translate",p]),l=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_TASK"},{controller:"CsvExporterTasksController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvTask",["$translate",l]),u=function(t){var e;return e=function(t){return t.sectionTitle="ADMIN.CSV.SECTION_TITLE_ISSUE"},{controller:"CsvExporterIssuesController",controllerAs:"ctrl",templateUrl:"admin/project-csv.html",link:e,scope:!0}},I.directive("tgCsvIssue",["$translate",u]),d=function(t,e,r,n){var i;return i=function(t,i,o){var s,a,c;return c=function(){return i.find(".size-info").addClass("active")},a=function(r){var o;return o=e.make_model("projects",r.data),t.project=o,i.find(".loading-overlay").removeClass("active"),n.notify("success")},s=function(t){return 413===t.status&&c(),i.find(".loading-overlay").removeClass("active"),n.notify("error",t.data._error_message)},i.on("click",".js-change-logo",function(){return i.find("#logo-field").click()}),i.on("change","#logo-field",function(e){if(t.logoAttachment)return i.find(".loading-overlay").addClass("active"),r.projects.changeLogo(t.project.id,t.logoAttachment).then(a,s)}),i.on("click","a.js-use-default-logo",function(e){return i.find(".loading-overlay").addClass("active"),r.projects.removeLogo(t.project.id).then(a,s)}),t.$on("$destroy",function(){return i.off()})},{link:i}},I.directive("tgProjectLogo",["$tgAuth","$tgModel","$tgResources","$tgConfirm",d]),g=function(t){var e;return e=function(e,r,n){var i,o;return i=t(n.tgProjectLogoModel),o=i.assign,r.bind("change",function(){return e.$apply(function(){return o(e,r[0].files[0])})})},{link:e}},I.directive("tgProjectLogoModel",["$parse",g]),r=function(){return{scope:{project:"="},templateUrl:"admin/admin-project-restrictions.html"}},I.directive("tgAdminProjectRestrictions",[r]),e=function(t){return{link:function(e){return e.requestOwnership=function(){return t.create("tg-lb-request-ownership",{"class":"lightbox lightbox-request-ownership"},{projectId:e.projectId})}},scope:{projectId:"=",owner:"="},templateUrl:"admin/admin-project-request-ownership.html"}},I.directive("tgAdminProjectRequestOwnership",["tgLightboxFactory",e]),t=function(t){return{link:function(e){return e.changeOwner=function(){return t.create("tg-lb-change-owner",{"class":"lightbox lightbox-select-user","project-id":"projectId","active-users":"activeUsers","current-owner-id":"currentOwnerId"},{projectId:e.projectId,activeUsers:e.activeUsers,currentOwnerId:e.owner.id,members:e.members})}},scope:{activeUsers:"=",projectId:"=",owner:"=",members:"="},templateUrl:"admin/admin-project-change-owner.html"}},I.directive("tgAdminProjectChangeOwner",["tgLightboxFactory",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v,y,b,S,j,k,I,E=function(t,e){function r(){this.constructor=t}for(var n in e)T.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},T={}.hasOwnProperty,C=function(t,e){return function(){return t.apply(e,arguments)}};j=this.taiga,b=this.taiga.mixOf,I=this.taiga.trim,k=this.taiga.toString,y=this.taiga.joinStr,v=this.taiga.groupBy,d=this.taiga.bindOnce,g=this.taiga.debounce,m=this.taiga.getDefaulColorList,S=angular.module("taigaAdmin"),u=function(t){function e(t,e,r,n,i,o,s,a,c,u,l,p,h){var f,d,g;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=c,this.appMetaService=u,this.translate=l,this.errorHandlingService=p,this.projectService=h,this.scope.project={},this.loadInitialData(),d=this.translate.instant(this.scope.sectionName),g=this.translate.instant("ADMIN.PROJECT_VALUES.PAGE_TITLE",{sectionName:d,projectName:this.scope.project.name}),f=this.scope.project.description,this.appMetaService.setAll(g,f)}return E(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","tgErrorHandlingService","tgProjectService"],e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.i_am_admin||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadInitialData=function(){var t;return t=this.loadProject()},e}(b(j.Controller,j.PageMixin)),S.controller("ProjectValuesSectionController",u),a=function(t){function e(t,e,r,n,i){var o;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.moveValue=C(this.moveValue,this),this.loadValues=C(this.loadValues,this),this.scope.$on("admin:project-values:move",this.moveValue),o=this.scope.$watch("resource",function(t){return function(e){if(e)return t.loadValues(),o()}}(this))}return E(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources"],e.prototype.loadValues=function(){return this.rs[this.scope.resource].listValues(this.scope.projectId,this.scope.type).then(function(t){return function(e){return t.scope.values=e,t.scope.maxValueOrder=_.maxBy(e,"order").order,e}}(this))},e.prototype.moveValue=function(t,e,r){var n,i;return i=this.scope.values,n=i.indexOf(e),i.splice(n,1),i.splice(r,0,e),_.each(i,function(t,e){return t.order=e}),this.repo.saveAll(i)},e}(j.Controller),S.controller("ProjectValuesController",a),c=function(t,e,r,n,i,o,s,a){var c,u,l;return u=function(t,e,r){var n,i,o,s,a,c;return s=null,o=null,i=null,c=e.find(".sortable"),n=dragula([c[0]],{direction:"vertical",copySortSource:!1,copy:!1,mirrorContainer:c[0],moves:function(t){return $(t).is("div[tg-bind-scope]")}}),n.on("dragend",function(e){var r,n;return i=$(e),n=i.scope().value,r=i.index(),t.$broadcast("admin:project-values:move",n,r)}),a=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&n.dragging}}),t.$on("$destroy",function(){return e.off(),n.destroy()})},l=function(t,n,i){var c,u,l,p,h,f,d,m,v;return c=n.controller(),v=i.type,f=i.objname,p=function(){return t.newValue={name:"",is_closed:!1,is_archived:!1}},h=function(){return t.addNewElementText=o.instant("ADMIN.PROJECT_VALUES_"+f.toUpperCase()+".ACTION_ADD")},p(),h(),s.$on("$translateChangeEnd",function(){return t.$evalAsync(h)}),l=function(t){return function(t){var e;if(null==t&&(t=!1),e=n.find(".table-main"),$(document.body).scrollTop(e.offset().top+e.height()),t)return n.find(".new-value input:visible").first().focus()}}(this),m=function(t){var r,n,i,o;if(n=t.parents("form"),r=n.checksley(),r.validate())return o=n.scope().value,i=e.save(o),i.then(function(e){return function(){var e;return e=t.parents(".row.table-main"),e.addClass("hidden"),e.siblings(".visualization").removeClass("hidden"),a.fetchProject()}}(this)),i.then(null,function(t){return r.setErrors(t)})},d=function(r){var n,i,o;if(i=r.parents("form"),n=i.checksley(),n.validate())return t.newValue.project=t.project.id,t.newValue.order=t.maxValueOrder?t.maxValueOrder+1:1,o=e.create(v,t.newValue),o.then(function(e){return function(e){return r.addClass("hidden"),t.values.push(e),t.maxValueOrder=e.order,p()}}(this)),o.then(null,function(t){return n.setErrors(t)})},u=function(e){var r,n,i;return n=e.parents(".row.table-main"),r=e.parents("form"),i=r.scope().value,t.$apply(function(){return n.addClass("hidden"),i.revert(),n.siblings(".visualization").removeClass("hidden")})},n.on("click",".show-add-new",function(t){return t.preventDefault(),n.find(".new-value").removeClass("hidden"),l(!0)}),n.on("click",".add-new",g(2e3,function(t){var e;return t.preventDefault(),e=n.find(".new-value"),d(e)})),n.on("click",".delete-new",function(t){return t.preventDefault(),n.find(".new-value").addClass("hidden"),p()}),n.on("click",".edit-value",function(t){var e,r,n;return t.preventDefault(),n=angular.element(t.currentTarget),r=n.parents(".row.table-main"),r.addClass("hidden"),e=r.siblings(".edition"),e.removeClass("hidden"),e.find("input:visible").first().focus().select()}),n.on("keyup",".new-value input",function(t){var e;return 13===t.keyCode?(e=n.find(".new-value"),d(e)):27===t.keyCode?(n.find(".new-value").addClass("hidden"),p()):void 0}),n.on("click",".save",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),m(e)}),n.on("click",".cancel",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),u(e)}),n.on("click",".delete-value",function(n){var i,s,a,u,l,p,h;return n.preventDefault(),u=angular.element(n.currentTarget),s=u.parents("form"),h=s.scope().value,i={},_.each(t.values,function(t){if(h.id!==t.id)return i[t.id]=t.name}),a=h.name,0===_.keys(i).length?r.error(o.instant("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL")):(p=o.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_VALUE"),l=o.instant("ADMIN.PROJECT_VALUES.REPLACEMENT"),r.askChoice(p,a,i,l).then(function(t){var n,i;return i=function(){return c.loadValues()["finally"](function(){return t.finish()})},n=function(){return r.notify("error")},e.remove(h,{moveTo:t.selected}).then(i,n)}))})},c=function(t,e,r){return u(t,e,r),l(t,e,r),t.$on("$destroy",function(){return e.off()})},{link:c}},S.directive("tgProjectValues",["$log","$tgRepo","$tgConfirm","$tgLocation","animationFrame","$translate","$rootScope","tgProjectService",c]),t=function(){var t;return t=function(t,e,r,n){var i;return t.colorList=m(),t.allowEmpty=!1,r.tgAllowEmpty&&(t.allowEmpty=!0),i=e.controller(),t.$watch(r.ngModel,function(e){return t.color=e.color}),e.on("click",".current-color",function(t){var r,n;return t.preventDefault(),t.stopPropagation(),n=angular.element(t.currentTarget),$(".select-color").hide(),n.siblings(".select-color").show(),r=angular.element("body"),r.on("click",function(t){return function(t){if(0===angular.element(t.target).parent(".select-color").length)return e.find(".select-color").hide(),r.unbind("click")}}(this))}),e.on("click",".select-color .color",function(r){var i;return r.preventDefault(),i=angular.element(r.currentTarget),t.$apply(function(){return n.$modelValue.color=i.data("color")}),e.find(".select-color").hide()}),e.on("click",".select-color .selected-color",function(r){return r.preventDefault(),t.$apply(function(){return n.$modelValue.color=t.color}),e.find(".select-color").hide()}),e.on("keyup","input",function(r){return r.stopPropagation(),13===r.keyCode?(t.$apply(function(){return n.$modelValue.color=t.color}),e.find(".select-color").hide()):27===r.keyCode?e.find(".select-color").hide():void 0}),t.$on("$destroy",function(){return e.off()})},{link:t,require:"ngModel"}},S.directive("tgColorSelection",t),p="text",r="multiline",l="richtext",e="date",f="url",h=[{key:p,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_TEXT"},{key:r,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_MULTI"},{key:l,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_RICHTEXT"},{key:e,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_DATE"},{key:f,name:"ADMIN.CUSTOM_FIELDS.FIELD_TYPE_URL"}],n=function(t){function e(t,e,r,n,i,o,s,a,c,u,l){var p,f,d;this.scope=t,this.rootscope=e,this.repo=r,this.rs=n,this.params=i,this.q=o,this.location=s,this.navUrls=a,this.appMetaService=c,this.translate=u,this.projectService=l,this.moveCustomAttributes=C(this.moveCustomAttributes,this),this.deleteCustomAttribute=C(this.deleteCustomAttribute,this),this.saveCustomAttribute=C(this.saveCustomAttribute,this),this.createCustomAttribute=C(this.createCustomAttribute,this),this.loadCustomAttributes=C(this.loadCustomAttributes,this),this.scope.TYPE_CHOICES=h,this.scope.project=this.projectService.project.toJS(),this.scope.projectId=this.scope.project.id,f=this.translate.instant(this.scope.sectionName),d=this.translate.instant("ADMIN.CUSTOM_ATTRIBUTES.PAGE_TITLE",{sectionName:f,projectName:this.scope.project.name}),p=this.scope.project.description,this.appMetaService.setAll(d,p),this.scope.init=function(t){return function(e){return t.scope.type=e,t.loadCustomAttributes()}}(this)}return E(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","tgProjectService"],e.prototype.loadCustomAttributes=function(){return this.rs.customAttributes[this.scope.type].list(this.scope.projectId).then(function(t){return function(e){var r;return t.scope.customAttributes=e,t.scope.maxOrder=null!=(r=_.maxBy(e,"order"))?r.order:void 0,e}}(this))},e.prototype.createCustomAttribute=function(t){return this.repo.create("custom-attributes/"+this.scope.type,t)},e.prototype.saveCustomAttribute=function(t){return this.repo.save(t)},e.prototype.deleteCustomAttribute=function(t){return this.repo.remove(t)},e.prototype.moveCustomAttributes=function(t,e){var r,n;return r=this.scope.customAttributes,n=r.indexOf(t),r.splice(n,1),r.splice(e,0,t),_.each(r,function(t,e){return t.order=e}),this.repo.saveAll(r)},e}(b(j.Controller,j.PageMixin)),S.controller("ProjectCustomAttributesController",n),i=function(t,e,r,n){var i;return i=function(t,r,i){var o,s,a,c,u,l,p,h,f,d,m,v,y,_,b,S,j,k;return o=r.controller(),t.$on("$destroy",function(){return r.off()}),j=r.find(".js-sortable"),l=dragula([j[0]],{direction:"vertical",copySortSource:!1,copy:!1,mirrorContainer:j[0],moves:function(t){return $(t).is("div[tg-bind-scope]")}}),l.on("dragend",function(t){var e,r,n;return r=$(t),e=r.scope().attr,n=r.index(),o.moveCustomAttributes(e,n)}),b=function(){return r.find(".js-new-custom-field").removeClass("hidden"),r.find(".js-new-custom-field input:visible").first().focus()},f=function(){return r.find(".js-new-custom-field").addClass("hidden")},y=function(){return r.find(".js-add-custom-field-button").removeClass("hidden")},p=function(){return r.find(".js-add-custom-field-button").addClass("hidden")},_=function(){return r.find(".js-cancel-new-custom-field-button").removeClass("hidden")},h=function(){return r.find(".js-cancel-new-custom-field-button").addClass("hidden")},m=function(){return t.newAttr={}},c=function(r){var n,i,s,a;if(i=r.checksley(),i.validate())return a=function(t){return function(){return o.loadCustomAttributes(),f(),m(),e.notify("success")}}(this),s=function(t){return function(t){return i.setErrors(t)}}(this),n=t.newAttr,n.project=t.projectId,n.order=t.maxOrder?t.maxOrder+1:1,o.createCustomAttribute(n).then(a,s)},s=function(){return f(),m()},t.$watch("customAttributes",function(t){if(t)return 0===t.length?(h(),p(),b()):(f(),y(),_())}),r.on("click",".js-add-custom-field-button",function(t){return t.preventDefault(),b()}),r.on("click",".js-create-custom-field-button",g(2e3,function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),c(e)})),r.on("click",".js-cancel-new-custom-field-button",function(t){return t.preventDefault(),s()}),r.on("keyup",".js-new-custom-field input",function(t){var e,r;return 13===t.keyCode?(r=angular.element(t.currentTarget),e=r.closest("form"),c(e)):27===t.keyCode?s():void 0}),S=function(t){return t.find(".js-view-custom-field").addClass("hidden"),t.find(".js-edit-custom-field").removeClass("hidden"),t.find(".js-edit-custom-field input:visible").first().focus().select()},d=function(t){return t.find(".js-edit-custom-field").addClass("hidden"),t.find(".js-view-custom-field").removeClass("hidden")},v=function(e){return t.$apply(function(){return e.scope().attr.revert()})},k=function(t){var r,n,i,s;if(n=t.checksley(),n.validate())return s=function(r){return function(){return o.loadCustomAttributes(),d(t),e.notify("success")}}(this),i=function(t){return function(t){return n.setErrors(t)}}(this),r=t.scope().attr,o.saveCustomAttribute(r).then(s,i)},a=function(t){return d(t),v(t)},r.on("click",".js-edit-custom-field-button",function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),S(e)}),r.on("click",".js-update-custom-field-button",g(2e3,function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),k(e)})),r.on("click",".js-cancel-edit-custom-field-button",function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),a(e)}),r.on("keyup",".js-edit-custom-field input",function(t){var e,r;return 13===t.keyCode?(r=angular.element(t.currentTarget),e=r.closest("form"),k(e)):27===t.keyCode?(r=angular.element(t.currentTarget),e=r.closest("form"),a(e)):void 0}),u=function(t){var r,i,s,a;return r=t.scope().attr,i=r.name,a=n.instant("COMMON.CUSTOM_ATTRIBUTES.DELETE"),s=n.instant("COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE"),e.ask(a,s,i).then(function(t){var n,s;return s=function(){return o.loadCustomAttributes()["finally"](function(){return t.finish()})},n=function(){return e.notify("error",null,"We have not been able to delete '"+i+"'.")},o.deleteCustomAttribute(r).then(s,n)})},r.on("click",".js-delete-custom-field-button",g(2e3,function(t){var e,r;return t.preventDefault(),r=angular.element(t.currentTarget),e=r.closest("form"),u(e)}))},{link:i}},S.directive("tgProjectCustomAttributes",["$log","$tgConfirm","animationFrame","$translate",i]),o=function(t){function e(t,e,r,n,i,o,s){this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.model=o,this.projectService=s,this.mixingClass=C(this.mixingClass,this),this.cancelMixingTags=C(this.cancelMixingTags,this),this.confirmMixingTags=C(this.confirmMixingTags,this),this.toggleMixingFromTags=C(this.toggleMixingFromTags,this),this.startMixingTags=C(this.startMixingTags,this),this.deleteTag=C(this.deleteTag,this),this.editTag=C(this.editTag,this),this.createTag=C(this.createTag,this),this.filterAndSortTags=C(this.filterAndSortTags,this),this.loadTags=C(this.loadTags,this),this.loading=!0,this.loadTags()}return E(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$tgModel","tgProjectService"],e.prototype.loadTags=function(){var t;return t=this.projectService.project.toJS(),this.rs.projects.tagsColors(t.id).then(function(t){return function(e){return t.scope.projectTagsAll=_.map(e.getAttrs(),function(e,r){return t.model.make_model("tag",{name:r,color:e})}),t.filterAndSortTags(),t.loading=!1}}(this))},e.prototype.filterAndSortTags=function(){return this.scope.projectTags=_.sortBy(this.scope.projectTagsAll,function(t){return t.name.toLowerCase()}),this.scope.projectTags=_.filter(this.scope.projectTags,function(t){return function(e){return e.name.indexOf(t.scope.tagsFilter.name)!==-1}}(this))},e.prototype.createTag=function(t,e){return this.rs.projects.createTag(this.scope.projectId,t,e)},e.prototype.editTag=function(t,e,r){return t===e&&(e=null),this.rs.projects.editTag(this.scope.projectId,t,e,r)},e.prototype.deleteTag=function(t){return this.scope.loadingDelete=!0,this.rs.projects.deleteTag(this.scope.projectId,t)["finally"](function(t){return function(){return t.scope.loadingDelete=!1}}(this))},e.prototype.startMixingTags=function(t){return this.scope.mixingTags.toTag=t.name},e.prototype.toggleMixingFromTags=function(t){var e;if(t.name!==this.scope.mixingTags.toTag)return e=this.scope.mixingTags.fromTags.indexOf(t.name),e===-1?this.scope.mixingTags.fromTags.push(t.name):this.scope.mixingTags.fromTags.splice(e,1)},e.prototype.confirmMixingTags=function(){var t,e;return e=this.scope.mixingTags.toTag,t=this.scope.mixingTags.fromTags,this.scope.loadingMixing=!0,this.rs.projects.mixTags(this.scope.projectId,e,t).then(function(t){return function(){return t.cancelMixingTags(),t.loadTags()}}(this))["finally"](function(t){return function(){return t.scope.loadingMixing=!1}}(this))},e.prototype.cancelMixingTags=function(){return this.scope.mixingTags.toTag=null,this.scope.mixingTags.fromTags=[]},e.prototype.mixingClass=function(t){if(null!==this.scope.mixingTags.toTag){if(t.name===this.scope.mixingTags.toTag)return"mixing-tags-to";if(this.scope.mixingTags.fromTags.indexOf(t.name)!==-1)return"mixing-tags-from"}},e}(j.Controller),S.controller("ProjectTagsController",o),s=function(t,e,r,n,i,o,s){var a;return a=function(t,e,n){var i,a,c,u,l,p,h,f,d,m,v,y;return a=$(window),i=e.controller(),y=n.type,d=n.objname,p=function(){return t.newValue={tag:"",color:""}},h=function(){return t.tagsFilter={name:""}},l=function(){return t.mixingTags={toTag:null,fromTags:[]}},f=function(){return t.addNewElementText=o.instant("ADMIN.PROJECT_VALUES_TAGS.ACTION_ADD")},p(),h(),l(),f(),s.$on("$translateChangeEnd",function(){return t.$evalAsync(f)}),u=function(t){return function(t){var r;if(null==t&&(t=!1),r=e.find(".table-main"),$(document.body).scrollTop(r.offset().top+r.height()),t)return e.find(".new-value input:visible").first().focus()}}(this),v=function(e){return function(e){var r,n,o,s,a;if(n=e.parents("form"),r=n.checksley(),r.validate())return a=n.scope().tag,o=a.clone(),o.revert(),t.loadingEdit=!0,s=i.editTag(o.name,a.name,a.color),s.then(function(){return i.loadTags().then(function(){var r;return r=e.parents(".row.table-main"),r.addClass("hidden"),t.loadingEdit=!1,r.siblings(".visualization").removeClass("hidden")})}),s.then(null,function(e){return t.loadingEdit=!1,r.setErrors(e.data)})}}(this),m=function(e){return function(e){var r,n,o;if(n=e.parents("form"),n=e,r=n.checksley(),r.validate())return t.loadingCreate=!0,o=i.createTag(t.newValue.tag,t.newValue.color),o.then(function(r){return i.loadTags().then(function(){return t.loadingCreate=!1,e.addClass("hidden"),p()})}),o.then(null,function(e){return t.loadingCreate=!1,r.setErrors(e.data)})}}(this),c=function(e){var r,n,i;return n=e.parents(".row.table-main"),r=e.parents("form"),i=r.scope().tag,t.$apply(function(){return n.addClass("hidden"),i.revert(),n.siblings(".visualization").removeClass("hidden")})},t.$watch("tagsFilter.name",function(t){return i.filterAndSortTags()}),a.on("keyup",function(e){if(27===e.keyCode)return t.$apply(function(){return l()})}),e.on("click",".show-add-new",function(t){return t.preventDefault(),e.find(".new-value").removeClass("hidden")}),e.on("click",".add-new",g(2e3,function(t){var r;return t.preventDefault(),r=e.find(".new-value"),m(r)})),e.on("click",".delete-new",function(t){return t.preventDefault(),e.find(".new-value").addClass("hidden"),p()}),e.on("click",".mix-tags",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return i.startMixingTags(r.parents("form").scope().tag)})}),e.on("click",".mixing-row",function(e){var r;return e.preventDefault(),r=angular.element(e.currentTarget),t.$apply(function(){return i.toggleMixingFromTags(r.parents("form").scope().tag)})}),e.on("click",".mixing-confirm",function(e){return e.preventDefault(),e.stopPropagation(),t.$apply(function(){return i.confirmMixingTags()})}),e.on("click",".mixing-cancel",function(e){return e.preventDefault(),e.stopPropagation(),t.$apply(function(){return i.cancelMixingTags()})}),e.on("click",".edit-value",function(t){var e,r,n;return t.preventDefault(),n=angular.element(t.currentTarget),r=n.parents(".row.table-main"),r.addClass("hidden"),e=r.siblings(".edition"),e.removeClass("hidden"),e.find("input:visible").first().focus().select()}),e.on("keyup",".new-value input",function(t){var r;return 13===t.keyCode?(r=e.find(".new-value"),m(r)):27===t.keyCode?(e.find(".new-value").addClass("hidden"),p()):void 0}),e.on("keyup",".status-name input",function(t){var e;return e=angular.element(t.currentTarget),13===t.keyCode?v(e):27===t.keyCode?c(e):void 0}),e.on("click",".save",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),v(e)}),e.on("click",".cancel",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),c(e)}),e.on("click",".delete-tag",function(t){var e,n,s,a;return t.preventDefault(),s=angular.element(t.currentTarget),e=s.parents("form"),n=e.scope().tag,a=o.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_TAG"),r.askOnDelete(a,n.name).then(function(t){var e,o;return o=function(){return i.loadTags()["finally"](function(){return t.finish()})},e=function(){return r.notify("error")},i.deleteTag(n.name).then(o,e)})}),t.$on("$destroy",function(){return e.off(),a.off()})},{link:a}},S.directive("tgProjectTags",["$log","$tgRepo","$tgConfirm","$tgLocation","animationFrame","$translate","$rootScope",s])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p=function(t,e){return function(){return t.apply(e,arguments)}},h=function(t,e){function r(){this.constructor=t}for(var n in e)f.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},f={}.hasOwnProperty,d=[].indexOf||function(t){for(var e=0,r=this.length;e\n
\n
<%- category.activePermissions %>/<%- category.permissions.length %>
\n <% _.each(category.permissions, function(permission) { %>\n
\n <% }) %>\n
\n'),o=_.template('
\n
\n
\n
\n
\n <% _.each(category.permissions, function(permission) { %>\n
\n \n
\n disabled="disabled" <% } %>\n <% if(permission.active) { %> checked="checked" <% } %>/>\n
\n \n \n
\n
\n <% }) %>\n
\n
\n
'),i=_.template('
'),a=function(a,u,l){var p,h,f,g,m;return p=u.controller(),h=function(t){var e,r,n,i,o,s,c,u,l,p;return s=function(e){return _.map(e,function(e){var r;return _.extend({},e,{active:(r=e.key,d.call(t.permissions,r)>=0)})})},n=function(t,e,r){return!(e.external_user&&!r.is_private&&0===t.key.indexOf("view_"))},c=function(e){return _.map(e,function(e){return e.permissions=e.permissions.map(function(e){return e.editable=n(e,t,a.project),e}),_.extend({},e,{activePermissions:_.filter(e.permissions,"active").length})})},e=[],r=[{key:"view_epics",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.VIEW_EPICS"},{key:"add_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.ADD_EPICS"},{key:"modify_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.MODIFY_EPICS"},{key:"comment_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.COMMENT_EPICS"},{key:"delete_epic",name:"COMMON.PERMISIONS_CATEGORIES.EPICS.DELETE_EPICS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.EPICS.NAME",permissions:s(r)}),o=[{key:"view_milestones",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.VIEW_SPRINTS"},{key:"add_milestone",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.ADD_SPRINTS"},{key:"modify_milestone",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.MODIFY_SPRINTS"},{key:"delete_milestone",name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.DELETE_SPRINTS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.SPRINTS.NAME",permissions:s(o)}),l=[{key:"view_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.VIEW_USER_STORIES"},{key:"add_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.ADD_USER_STORIES"},{key:"modify_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.MODIFY_USER_STORIES"},{key:"comment_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.COMMENT_USER_STORIES"},{key:"delete_us",name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.DELETE_USER_STORIES"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.USER_STORIES.NAME",permissions:s(l)}),u=[{key:"view_tasks",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.VIEW_TASKS"},{key:"add_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.ADD_TASKS"},{key:"modify_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.MODIFY_TASKS"},{key:"comment_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.COMMENT_TASKS"},{key:"delete_task",name:"COMMON.PERMISIONS_CATEGORIES.TASKS.DELETE_TASKS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.TASKS.NAME",permissions:s(u)}),i=[{key:"view_issues",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.VIEW_ISSUES"},{key:"add_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.ADD_ISSUES"},{key:"modify_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.MODIFY_ISSUES"},{key:"comment_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.COMMENT_ISSUES"},{key:"delete_issue",name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.DELETE_ISSUES"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.ISSUES.NAME",permissions:s(i)}),p=[{key:"view_wiki_pages",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.VIEW_WIKI_PAGES"},{key:"add_wiki_page",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.ADD_WIKI_PAGES"},{key:"modify_wiki_page",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.MODIFY_WIKI_PAGES"},{key:"delete_wiki_page",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.DELETE_WIKI_PAGES"},{key:"view_wiki_links",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.VIEW_WIKI_LINKS"},{key:"add_wiki_link",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.ADD_WIKI_LINKS"},{key:"delete_wiki_link",name:"COMMON.PERMISIONS_CATEGORIES.WIKI.DELETE_WIKI_LINKS"}],e.push({name:"COMMON.PERMISIONS_CATEGORIES.WIKI.NAME",permissions:s(p)}),c(e)},m=function(t,e){return t.find(".resume").html(n(c({category:e}))(a))},f=function(t,e){var r;return r=o({category:t,index:e}),r=angular.element(r),m(r,t),n(r)(a)},g=function(){var n;return u.off(),n=i(),_.each(h(a.role),function(t,e){return n=angular.element(n).append(f(t,e))}),u.html(n),u.on("click",".resume",function(t){var e;return t.preventDefault(),e=angular.element(t.currentTarget),e.toggleClass("open-drawer"),e.next().toggleClass("open")}),u.on("change",".category-item input",function(n){var i,o,s,c;return i=function(){var t;return t=_.filter(u.find(".category-item input"),function(t){return angular.element(t).is(":checked")}),t=_.sortBy(_.map(t,function(t){var e;return e=angular.element(t).parents(".category-item").data("id")})),t.length&&t.push("view_project"),t},c=angular.element(n.currentTarget),a.role.permissions=i(),s=function(){var e,n;return e=h(a.role),n=c.parents(".category-config").data("id"),m(c.parents(".category-config"),e[n]),t.$broadcast("projects:reload"),r.notify("success"),p.forceLoadProject()},o=function(){return r.notify("error"),c.prop("checked",!c.prop("checked")),a.role.permissions=i()},a.role.external_user?(a.project.public_permissions=a.role.permissions,a.project.anon_permissions=a.role.permissions.filter(function(t){return 0===t.indexOf("view_")}),e.save(a.project).then(s,o)):e.save(a.role).then(s,o)})},a.$on("$destroy",function(){return u.off()}),a.$on("role:changed",function(){return g()}),s(a,l.ngModel,g)},{link:a}},u.directive("tgRolePermissions",["$rootScope","$tgRepo","$tgConfirm","$compile",r])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v,y,b=function(t,e){function r(){this.constructor=t}for(var n in e)S.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},S={}.hasOwnProperty;v=this.taiga,g=this.taiga.mixOf,f=this.taiga.bindMethods,d=this.taiga.debounce,y=this.taiga.timeout,m=angular.module("taigaAdmin"),h=function(t){function e(t,e,r,n,i,o,s,a,c,u){var l;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.location=i,this.navUrls=o,this.appMetaService=s,this.translate=a,this.errorHandlingService=c,this.projectService=u,f(this),this.scope.sectionName="ADMIN.WEBHOOKS.SECTION_NAME",this.scope.project={},l=this.loadInitialData(),l.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.WEBHOOKS.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),l.then(null,this.onInitialDataError.bind(this)),this.scope.$on("webhooks:reload",this.loadWebhooks)}return b(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","$tgLocation","$tgNavUrls","tgAppMetaService","$translate","tgErrorHandlingService","tgProjectService"],e.prototype.loadWebhooks=function(){return this.rs.webhooks.list(this.scope.projectId).then(function(t){return function(e){return t.scope.webhooks=e}}(this))},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),t.i_am_admin||this.errorHandlingService.permissionDenied(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadInitialData=function(){return this.loadProject(),this.loadWebhooks()},e}(g(v.Controller,v.PageMixin,v.FiltersMixin)),m.controller("WebhooksController",h),p=function(t,e,r,n,i){var o;return o=function(n,o,s){var a,c,u,l,p,h,f,g;return g=n.$eval(s.tgWebhook),h=function(){var e;return e=i.instant("ADMIN.WEBHOOKS.DATE"),t.webhooklogs.list(g.id).then(function(t){return function(t){var r,n,i,o;for(r=0,n=t.length;r=1)return a.addClass("hidden")})}),s.on("click",function(t){return a.removeClass("hidden"),a.find("input")[0].focus()})},{link:o}},m.directive("tgNewWebhook",["$tgResources","$tgRepo","$tgConfirm","$tgLoading","$tgAnalytics",c]),r=function(t){function e(t,e,r,n,i,o,s){var a;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,this.projectService=s,f(this),this.scope.sectionName=this.translate.instant("ADMIN.GITHUB.SECTION_NAME"),this.scope.project={},a=this.loadInitialData(),a.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.GITHUB.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),a.then(null,this.onInitialDataError.bind(this))}return b(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate","tgProjectService"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"github").then(function(t){return function(e){return t.scope.github=e}}(this))},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadInitialData=function(){var t;return t=this.loadProject(),this.loadModules()},e}(g(v.Controller,v.PageMixin,v.FiltersMixin)),m.controller("GithubController",r),i=function(t){function e(t,e,r,n,i,o,s){var a;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,this.projectService=s,f(this),this.scope.sectionName=this.translate.instant("ADMIN.GITLAB.SECTION_NAME"),this.scope.project={},a=this.loadInitialData(),a.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.GITLAB.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),a.then(null,this.onInitialDataError.bind(this)),this.scope.$on("project:modules:reload",function(t){return function(){return t.loadModules()}}(this))}return b(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate","tgProjectService"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"gitlab").then(function(t){return function(e){return t.scope.gitlab=e}}(this))},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadInitialData=function(){return this.loadProject(),this.loadModules()},e}(g(v.Controller,v.PageMixin,v.FiltersMixin)),m.controller("GitlabController",i),t=function(t){function e(t,e,r,n,i,o,s){var a;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,this.projectService=s,f(this),this.scope.sectionName=this.translate.instant("ADMIN.BITBUCKET.SECTION_NAME"),this.scope.project={},a=this.loadInitialData(),a.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.BITBUCKET.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),a.then(null,this.onInitialDataError.bind(this)),this.scope.$on("project:modules:reload",function(t){return function(){return t.loadModules()}}(this))}return b(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate","tgProjectService"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"bitbucket").then(function(t){return function(e){return t.scope.bitbucket=e}}(this))},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadInitialData=function(){return this.loadProject(),this.loadModules()},e}(g(v.Controller,v.PageMixin,v.FiltersMixin)),m.controller("BitbucketController",t),u=function(){var t;return t=function(t,e,r){return e.on("click",".select-input-content",function(){return e.find("input").select(),e.find(".help-copy").addClass("visible")})},{link:t}},m.directive("tgSelectInputText",u),n=function(t,e,r,n){var i;return i=function(i,o,s){var a,c,u;return a=o.find("form").checksley({onlyOneErrorElement:!0}),c=d(2e3,function(o){return function(o){var s,c;if(o.preventDefault(),a.validate())return s=r().target(u).start(),c=t.saveAttribute(i.github,"github"),c.then(function(){return n.trackEvent("github-webhook","created-or-changed","Create or changed github webhook",1),s.finish(),e.notify("success")}),c.then(null,function(t){if(s.finish(),a.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=o.find(".submit-button"),o.on("submit","form",c)},{link:i}},m.directive("tgGithubWebhooks",["$tgRepo","$tgConfirm","$tgLoading","$tgAnalytics",n]),o=function(t,e,r,n){var i;return i=function(i,o,s){var a,c,u;return a=o.find("form").checksley({onlyOneErrorElement:!0}),c=d(2e3,function(o){return function(o){var s,c;if(o.preventDefault(),a.validate())return s=r().target(u).start(),c=t.saveAttribute(i.gitlab,"gitlab"),c.then(function(){return n.trackEvent("gitlab-webhook","created-or-changed","Create or changed gitlab webhook",1),s.finish(),e.notify("success"),i.$emit("project:modules:reload")}),c.then(null,function(t){if(s.finish(),a.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=o.find(".submit-button"),o.on("submit","form",c)},{link:i}},m.directive("tgGitlabWebhooks",["$tgRepo","$tgConfirm","$tgLoading","$tgAnalytics",o]),e=function(t,e,r,n){var i;return i=function(i,o,s){var a,c,u;return a=o.find("form").checksley({onlyOneErrorElement:!0}),c=d(2e3,function(o){return function(o){var s,c;if(o.preventDefault(),a.validate())return s=r().target(u).start(),c=t.saveAttribute(i.bitbucket,"bitbucket"),c.then(function(){return n.trackEvent("bitbucket-webhook","created-or-changed","Create or changed bitbucket webhook",1),s.finish(),e.notify("success"),i.$emit("project:modules:reload")}),c.then(null,function(t){if(s.finish(),a.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=o.find(".submit-button"),o.on("submit","form",c)},{link:i}},m.directive("tgBitbucketWebhooks",["$tgRepo","$tgConfirm","$tgLoading","$tgAnalytics",e]),l=function(){var t;return t=function(t,e,r,n){return n.$parsers.push(function(t){return t=$.trim(t),""===t?[]:t.split(",")})},{link:t,restrict:"EA",require:"ngModel"}},m.directive("tgValidOriginIps",l),s=function(t){function e(t,e,r,n,i,o,s){var a;this.scope=t,this.repo=e,this.rs=r,this.params=n,this.appMetaService=i,this.translate=o,this.projectService=s,f(this),this.scope.sectionName=this.translate.instant("ADMIN.GOGS.SECTION_NAME"),this.scope.project={},a=this.loadInitialData(),a.then(function(t){return function(){var e,r;return r=t.translate.instant("ADMIN.GOGS.PAGE_TITLE",{projectName:t.scope.project.name}),e=t.scope.project.description,t.appMetaService.setAll(r,e)}}(this)),a.then(null,this.onInitialDataError.bind(this))}return b(e,t),e.$inject=["$scope","$tgRepo","$tgResources","$routeParams","tgAppMetaService","$translate","tgProjectService"],e.prototype.loadModules=function(){return this.rs.modules.list(this.scope.projectId,"gogs").then(function(t){return function(e){return t.scope.gogs=e}}(this))},e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),t},e.prototype.loadInitialData=function(){return this.loadProject(),this.loadModules()},e}(g(v.Controller,v.PageMixin,v.FiltersMixin)),a=function(t,e,r,n){var i;return i=function(i,o,s){var a,c,u;return a=o.find("form").checksley({onlyOneErrorElement:!0}),c=d(2e3,function(o){return function(o){var s,c;if(o.preventDefault(),a.validate())return s=r().target(u).start(),c=t.saveAttribute(i.gogs,"gogs"),c.then(function(){return n.trackEvent("gogs-webhook","create-or-change","Create or change gogs webhook",1),s.finish(),e.notify("success"),i.$emit("project:modules:reload")}),c.then(null,function(t){if(s.finish(),a.setErrors(t),t._error_message)return e.notify("error",t._error_message)})}}(this)),u=o.find(".submit-button"),o.on("submit","form",c),o.on("click",".submit-button",c)},{link:i}},m.controller("GogsController",s),m.directive("tgGogsWebhooks",["$tgRepo","$tgConfirm","$tgLoading","$tgAnalytics",a])}.call(this),function(){var t,e,r,n,i,o;i=this.taiga,e=this.taiga.bindOnce,o=this.taiga.timeout,r=this.taiga.debounce,n=angular.module("taigaProject"),t=function(t,e,r,n,i,o,s,a,c,u){var l;return l=function(r,l,p){var h,f;return h=null,r.$on("deletelightbox:new",function(t,e){return s.open(l),h=e}),r.$on("$destroy",function(){return l.off()}),f=function(){var r;return a.start(),s.close(l),r=t.remove(h),r.then(function(t){return u.trackEvent("projects","delete","Delete project",1),a.pageLoaded(),e.$broadcast("projects:reload"),n.path(i.resolve("home")),o.notify("success"),c.loadProjects()}),r.then(null,function(){return o.notify("error"),s.close(l)})},l.on("click",".button-red",function(t){return t.preventDefault(),s.close(l)}),l.on("click",".button-green",function(t){return t.preventDefault(),f()})},{link:l}},n.directive("tgLbDeleteProject",["$tgRepo","$rootScope","$tgAuth","$tgLocation","$tgNavUrls","$tgConfirm","lightboxService","tgLoader","tgCurrentUserService","$tgAnalytics",t])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u,l;u=this.taiga.bindOnce,r=function(){var t;return t=function(t,e,r){return u(t,r.tgBoBind,function(t){return e.text(t)})},{link:t}},i=function(){var t;return t=function(t,e,r){return u(t,r.tgBoHtml,function(t){return e.html(t)})},{link:t}},o=function(){var t;return t=function(t,e,r){return u(t,r.tgBoRef,function(t){return e.html("#"+t+" ")})},{link:t}},s=function(){var t;return t=function(t,e,r){return u(t,r.tgBoSrc,function(t){return e.attr("src",t)})},{link:t}},n=function(){var t;return t=function(t,e,r){return u(t,r.tgBoHref,function(t){return e.attr("href",t)})},{link:t}},e=function(){var t;return t=function(t,e,r){return u(t,r.tgBoAlt,function(t){return e.attr("alt",t)})},{link:t}},a=function(){var t;return t=function(t,e,r){return u(t,r.tgBoTitle,function(t){return e.attr("title",t)})},{link:t}},c=function(){var t;return t=function(t,e,r){return t.$watch(r.tgTitleHtml,function(t){if(null!=t)return e.attr("title",t)})},{link:t}},t=function(){var t;return t=function(t,e,r){return t.$watch(r.tgBindHtml,function(t){if(null!=t)return e.html(t)})},{link:t}},l=angular.module("taigaBase"),l.directive("tgBoBind",r),l.directive("tgBoHtml",i),l.directive("tgBoRef",o),l.directive("tgBoSrc",s),l.directive("tgBoHref",n),l.directive("tgBoAlt",e),l.directive("tgBoTitle",a),l.directive("tgBindTitle",c),l.directive("tgBindHtml",t)}.call(this),function(){var t,e;t=function(){function t(){this.config=window.taigaConfig}return t.prototype.get=function(t,e){return null==e&&(e=null),_.has(this.config,t)?this.config[t]:e},t}(),e=angular.module("taigaBase"),e.service("$tgConfig",t)}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=angular.module("taigaBase"),t=function(t){function e(t,e,r,n,i,o,s){this.rootScope=t,this.scope=e,this.params=r,this.repo=n,this.rs=i,this.confirm=o,this.projectService=s,this.scope.currentPlugin=_.head(_.filter(this.rootScope.adminPlugins,{slug:this.params.plugin})),this.scope.projectSlug=this.params.pslug,this.loadInitialData()}return n(e,t),e.$inject=["$rootScope","$scope","$routeParams","$tgRepo","$tgResources","$tgConfirm","tgProjectService"],e.prototype.loadProject=function(){var t;return t=this.projectService.project.toJS(),this.scope.projectId=t.id,this.scope.project=t,this.scope.$emit("project:loaded",t),this.scope.$broadcast("project:loaded",t),t},e.prototype.loadInitialData=function(){return this.loadProject()},e}(taiga.Controller),r.controller("ContribController",t),e=function(t){function e(t,e,r){this.rootScope=t,this.scope=e,this.params=r,this.scope.currentPlugin=_.head(_.filter(this.rootScope.userSettingsPlugins,{slug:this.params.plugin}))}return n(e,t),e.$inject=["$rootScope","$scope","$routeParams"],e}(taiga.Controller),r.controller("ContribUserSettingsController",e)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga,t=function(t){function e(t,e){this.storage=t,this.params=e}return r(e,t),e.$inject=["$tgStorage","$routeParams"],e.prototype.generateHash=function(t){return null==t&&(t=[]),t=_.map(t,function(t){return JSON.stringify(t)}),hex_sha1(t.join(":"))},e}(e.Service)}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=this.taiga,t=function(t){function e(t,r,n,i,o,s){this.http=t,this.q=r,this.storage=n,this.rootScope=i,this.cacheFactory=o,this.translate=s,e.__super__.constructor.call(this),this.cache=this.cacheFactory("httpget")}return n(e,t),e.$inject=["$http","$q","$tgStorage","$rootScope","$cacheFactory","$translate"],e.prototype.headers=function(){var t,e,r;return t={},r=this.storage.get("token"),r&&(t.Authorization="Bearer "+r),e=this.translate.preferredLanguage(),e&&(t["Accept-Language"]=e),t},e.prototype.request=function(t){return t.headers=_.assign({},t.headers||{},this.headers()),this.http(t)},e.prototype.get=function(t,e,r){return r=_.assign({method:"GET",url:t},r),e&&(r.params=e),r.cache=this.cache,this.request(r)["finally"](function(t){return function(e){return t.cache.removeAll()}}(this))},e.prototype.post=function(t,e,r,n){return n=_.assign({method:"POST",url:t},n),e&&(n.data=e),r&&(n.params=r),this.request(n)},e.prototype.put=function(t,e,r,n){return n=_.assign({method:"PUT",url:t},n),e&&(n.data=e),r&&(n.params=r),this.request(n)},e.prototype.patch=function(t,e,r,n){return n=_.assign({method:"PATCH",url:t},n),e&&(n.data=e),r&&(n.params=r),this.request(n)},e.prototype["delete"]=function(t,e,r,n){return n=_.assign({method:"DELETE",url:t},n),e&&(n.data=e),r&&(n.params=r),this.request(n)},e}(r.Service),e=angular.module("taigaBase"),e.service("$tgHttp",t)}.call(this),function(){var t,e;t=function(t,e,r){return t.noreload=function(r){var n,i;return n=e.current,i=r.$on("$locationChangeSuccess",function(){return e.current=n,i()}),t},t.isInCurrentRouteParams=function(e,r){var n;return n=t.search()||{},n[e]===r},t},e=angular.module("taigaBase"),e.factory("$tgLocation",["$location","$route","$rootScope",t])}.call(this),function(){var t,e,r,n,i,o=[].indexOf||function(t){for(var e=0,r=this.length;ef?(p=a.instant("PROJECT.IMPORT.ERROR_MAX_SIZE_EXCEEDED",{fileName:e.name,fileSize:r(e.size),maxFileSize:r(f)}),d={status:413,data:{_error_message:p}},l.reject(d),l.promise):(v=function(t){return function(t){var e,i;return i=Math.round(t.loaded/t.total*100),e=a.instant("PROJECT.IMPORT.UPLOAD_IN_PROGRESS_MESSAGE",{uploadedSize:r(t.loaded),totalSize:r(t.total)}),n("in-progress",null,e,i)}}(this),g=function(t){return function(t){return n("done",a.instant("PROJECT.IMPORT.TITLE"),a.instant("PROJECT.IMPORT.DESCRIPTION"))}}(this),m=function(t){return function(t){return n("error")}}(this),c=function(t){return function(t){var e;d={};try{d.data=JSON.parse(t.target.responseText)}catch(r){d.data={}}return d.status=t.target.status,t.target.getResponseHeader("Taiga-Info-Project-Is-Private")&&(d.headers={isPrivate:"True"===t.target.getResponseHeader("Taiga-Info-Project-Is-Private"),memberships:parseInt(t.target.getResponseHeader("Taiga-Info-Project-Memberships"))}),201!==(e=d.status)&&202!==e||l.resolve(d),l.reject(d)}}(this),h=function(t){return function(t){return l.reject("fail")}}(this),u=new FormData,u.append("dump",e),y=new XMLHttpRequest,y.upload.addEventListener("progress",v,!1),y.upload.addEventListener("load",g,!1),y.upload.addEventListener("error",m,!1),y.upload.addEventListener("abort",m,!1),y.addEventListener("load",c,!1),y.addEventListener("error",h,!1),y.open("POST",i.resolve("importer")),y.setRequestHeader("Authorization","Bearer "+o.getToken()),y.setRequestHeader("Accept","application/json"),y.send(u),l.promise)},c.changeLogo=function(e,o){var a,c,u,l,p,h;return u=t.get("maxUploadFileSize",null),u&&o.size>u?(p={status:413,data:{_error_message:"'"+o.name+"' ("+r(o.size)+") is too heavy for our oompa loompas, try it with a smaller than ("+r(u)+")"}},c=s.defer(),c.reject(p),c.promise):(a=new FormData,a.append("logo",o),l={transformRequest:angular.identity,headers:{"Content-Type":void 0}},h=i.resolve("projects")+"/"+e+"/change_logo",n.post(h,a,{},l))},c.removeLogo=function(t){var e;return e=i.resolve("projects")+"/"+t+"/remove_logo",n.post(e)},function(t){return t.projects=c}},t=angular.module("taigaResources"),t.factory("$tgProjectsResourcesProvider",["$tgConfig","$tgRepo","$tgHttp","$tgUrls","$tgAuth","$q","$translate",e])}.call(this),function(){var t,e,r;r=this.taiga,e=function(t,e,r){var n;return n={},n.get=function(e){return t.queryOne("roles",e)},n.list=function(e){return t.queryMany("roles",{project:e})},function(t){return t.roles=n}},t=angular.module("taigaResources"),t.factory("$tgRolesResourcesProvider",["$tgRepo","$tgHttp","$tgUrls",e])}.call(this),function(){var t,e,r;r=this.taiga,e=function(t,e,r,n){var i;return i={},i["do"]=function(t,i){var o,s,a,c;return o=n.defer(),c=e.resolve("search"),s={url:c,method:"GET",timeout:o.promise,cancelable:!0,params:{project:t,text:i,get_all:!1}},a=r.request(s).then(function(t){return t.data}),a.abort=function(){return o.resolve()},a["finally"]=function(){return a.abort=angular.noop,o=a=null},a},function(t){return t.search=i}},t=angular.module("taigaResources"),t.factory("$tgSearchResourcesProvider",["$tgRepo","$tgUrls","$tgHttp","$q",e])}.call(this),function(){var t,e,r,n;n=this.taiga,t=n.generateHash,r=function(t,e,r){var n;return n={},n.get=function(r,n){return t.queryOne("milestones",n).then(function(t){var r;return r=t.user_stories,r=_.map(r,function(t){return e.make_model("userstories",t)}),t._attrs.user_stories=r,t})},n.stats=function(e,r){return t.queryOneRaw("milestones",r+"/stats")},n.list=function(r,n){var i;return i={project:r},i=_.extend({},i,n||{}),t.queryMany("milestones",i,{},!0).then(function(t){return function(t){var r,n,i,o,s,a;for(s=t[0],r=t[1],n=0,i=s.length;nc?(l={status:413,data:{_error_message:"'"+e.name+"' ("+r(e.size)+") is too heavy for our oompa loompas, try it with a smaller than ("+r(c)+")"}},a=o.defer(),a.reject(l),a.promise):(s=new FormData,s.append("avatar",e),u={transformRequest:angular.identity,headers:{"Content-Type":void 0}},p=i.resolve("users")+"/change_avatar",n.post(p,s,{},u))},s.removeAvatar=function(){var t;return t=i.resolve("users")+"/remove_avatar",n.post(t)},s.changePassword=function(t,e){var r,o;return o=i.resolve("users")+"/change_password",r={current_password:t,password:e},n.post(o,r)},function(t){return t.userSettings=s}},t=angular.module("taigaResources"),t.factory("$tgUserSettingsResourcesProvider",["$tgConfig","$tgRepo","$tgHttp","$tgUrls","$q",e])}.call(this),function(){var t,e,r,n;n=this.taiga,r=this.taiga.sizeFormat,e=function(t,e){var r;return r={},r.contacts=function(r,n){var i,o;return null==n&&(n={}),o=e.resolve("user-contacts",r),i={headers:{}},n.enablePagination||(i.headers["x-disable-pagination"]="1"),t.get(o,{},i).then(function(t){return t.data})},function(t){return t.users=r}},t=angular.module("taigaResources"),t.factory("$tgUsersResourcesProvider",["$tgHttp","$tgUrls","$q",e])}.call(this),function(){var t,e,r,n;n=this.taiga,t=n.generateHash,r=function(e,r,n,i,o){var s,a;return a={},s="userstories-queryparams",a.get=function(t,r,n){var i;return i=a.getQueryParams(t),i.project=t,i=_.extend({},i,n),e.queryOne("userstories",r,i)},a.getByRef=function(t,r,n){var i;return null==n&&(n={}),i=a.getQueryParams(t),i.project=t,i.ref=r,i=_.extend({},i,n),e.queryOne("userstories","by_ref",i)},a.listInAllProjects=function(t){return e.queryMany("userstories",t)},a.filtersData=function(t){return e.queryOneRaw("userstories-filters",null,t)},a.listUnassigned=function(t,r,n){var i;return i={project:t,milestone:"null"},i=_.extend({},i,r||{}),a.storeQueryParams(t,i),e.queryMany("userstories",_.extend(i,{page_size:n}),{enablePagination:!0},!0)},a.listAll=function(t,r){var n;return n={project:t},n=_.extend({},n,r||{}),a.storeQueryParams(t,n),e.queryMany("userstories",n)},a.bulkCreate=function(t,e,i){var o,s;return o={project_id:t,status_id:e,bulk_stories:i},s=n.resolve("bulk-create-us"),r.post(s,o)},a.upvote=function(t){var e;return e=n.resolve("userstory-upvote",t),r.post(e)},a.downvote=function(t){var e;return e=n.resolve("userstory-downvote",t),r.post(e)},a.watch=function(t){var e;return e=n.resolve("userstory-watch",t),r.post(e)},a.unwatch=function(t){var e;return e=n.resolve("userstory-unwatch",t),r.post(e)},a.bulkUpdateBacklogOrder=function(t,e){var i,o;return o=n.resolve("bulk-update-us-backlog-order"),i={project_id:t,bulk_stories:e},r.post(o,i)},a.bulkUpdateMilestone=function(t,e,i){var o,s;return s=n.resolve("bulk-update-us-milestone"),o={project_id:t,milestone_id:e,bulk_stories:i},r.post(s,o)},a.bulkUpdateKanbanOrder=function(t,e,i){var o,s;return s=n.resolve("bulk-update-us-kanban-order"),o={project_id:t,status_id:e,bulk_stories:i},r.post(s,o)},a.listValues=function(t,r){var n;return n={project:t},a.storeQueryParams(t,n),e.queryMany(r,n)},a.storeQueryParams=function(e,r){var n,o;return o=e+":"+s,n=t([e,o]),i.set(n,r)},a.getQueryParams=function(e){var r,n;return n=e+":"+s,r=t([e,n]),i.get(r)||{}},a.storeShowTags=function(e,r){var n;return n=t([e,"showTags"]),i.set(n,r)},a.getShowTags=function(e){var r;return r=t([e,"showTags"]),i.get(r)||null},function(t){return t.userstories=a}},e=angular.module("taigaResources"),e.factory("$tgUserstoriesResourcesProvider",["$tgRepo","$tgHttp","$tgUrls","$tgStorage","$q",r])}.call(this),function(){var t,e;e=function(t,e,r){var n;return n={},n.list=function(e){var r;return r={webhook:e},t.queryMany("webhooklogs",r)},n.resend=function(t){var n;return n=e.resolve("webhooklogs-resend",t),r.post(n)},function(t){return t.webhooklogs=n}},t=angular.module("taigaResources"),t.factory("$tgWebhookLogsResourcesProvider",["$tgRepo","$tgUrls","$tgHttp",e])}.call(this),function(){var t,e;e=function(t,e,r){var n;return n={},n.list=function(e){var r;return r={project:e},t.queryMany("webhooks",r)},n.test=function(t){var n;return n=e.resolve("webhooks-test",t),r.post(n)},function(t){return t.webhooks=n}},t=angular.module("taigaResources"),t.factory("$tgWebhooksResourcesProvider",["$tgRepo","$tgUrls","$tgHttp",e])}.call(this),function(){var t,e,r;r=this.taiga,e=function(t,e,r){var n;return n={},n.get=function(e){return t.queryOne("wiki",e)},n.getBySlug=function(e,r){return t.queryOne("wiki","by_slug?project="+e+"&slug="+r)},n.list=function(e){return t.queryMany("wiki",{project:e})},n.listLinks=function(e){return t.queryMany("wiki-links",{project:e})},function(t){return t.wiki=n}},t=angular.module("taigaResources"),t.factory("$tgWikiResourcesProvider",["$tgRepo","$tgHttp","$tgUrls",e])}.call(this),function(){var t,e,r,n,i,o,s=function(t,e){function r(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=this.taiga,n=this.taiga.mixOf,r=this.taiga.debounce,i=angular.module("taigaUserSettings"),t=function(t){function e(t,e,r,n,i,o,s,a,c,u,l){this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=c,this.auth=u,this.translate=l,this.scope.sectionName=this.translate.instant("CHANGE_PASSWORD.SECTION_NAME"),this.scope.user=this.auth.getUser()}return s(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","$translate"], e}(n(o.Controller,o.PageMixin)),i.controller("UserChangePasswordController",t),e=function(t,e,n,i){var o;return o=function(o,s,a,c){var u,l,p;return u=new checksley.Form(s.find("form")),l=r(2e3,function(r){return function(r){var s,a;if(r.preventDefault(),u.validate())return o.newPassword1!==o.newPassword2?void e.notify("error",i.instant("CHANGE_PASSWORD.ERROR_PASSWORD_MATCH")):(s=n().target(p).start(),a=t.userSettings.changePassword(o.currentPassword,o.newPassword1),a.then(function(){return s.finish(),e.notify("success")}),a.then(null,function(t){return s.finish(),e.notify("error",t.data._error_message)}))}}(this)),p=s.find(".submit-button"),s.on("submit","form",l),o.$on("$destroy",function(){return s.off()})},{link:o}},i.directive("tgUserChangePassword",["$tgResources","$tgConfirm","$tgLoading","$translate",e])}.call(this),function(){var t,e,r,n,i;i=this.taiga,e=this.taiga.bindOnce,r=this.taiga.debounce,n=angular.module("taigaUserSettings"),t=function(t,e,n,i,o,s,a){var c;return c=function(e,c,u){var l,p;return e.$on("deletelightbox:new",function(t,e){return s.open(c)}),e.$on("$destroy",function(){return c.off()}),l=function(){var r,u;return r=a().target(p).start(),u=t.remove(e.user),u.then(function(t){return r.finish(),s.close(c),n.logout(),i.path(o.resolve("login"))}),u.then(null,function(){return r.finish(),console.log("FAIL")})},c.on("click",".button-green",function(t){return t.preventDefault(),s.close(c)}),c.on("click",".button-red",r(2e3,function(t){return t.preventDefault(),l()})),p=c.find(".button-red")},{link:c,templateUrl:"user/lightbox/lightbox-delete-account.html"}},n.directive("tgLbDeleteUser",["$tgRepo","$rootScope","$tgAuth","$tgLocation","$tgNavUrls","lightboxService","$tgLoading",t])}.call(this),function(){var t,e,r,n,i,o,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;s=this.taiga,i=this.taiga.mixOf,n=this.taiga.bindOnce,o=angular.module("taigaUserSettings"),t=function(t){function e(t,e,r,n,i,o,s,a,c,u,l){var p;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=c,this.auth=u,this.errorHandlingService=l,this.scope.sectionName="USER_SETTINGS.NOTIFICATIONS.LIVE_SECTION_NAME",this.scope.user=this.auth.getUser(),p=this.loadInitialData(),p.then(null,this.onInitialDataError.bind(this))}return a(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","tgErrorHandlingService"],e.prototype.loadInitialData=function(){return this.rs.notifyPolicies.list().then(function(t){return function(e){return t.scope.notifyPolicies=e,e}}(this))},e}(i(s.Controller,s.PageMixin)),o.controller("UserLiveNotificationsController",t),e=function(){var t;return t=function(t,e,r){return t.$on("$destroy",function(){return e.off()})},{link:t}},o.directive("tgUserLiveNotifications",e),r=function(t,e,r){var i,o;return o=_.template('<% _.each(notifyPolicies, function (notifyPolicy, index) { %>\n
\n
<%- notifyPolicy.project_name %>
\n
\n
\n checked="checked"<% } %>/>\n \n
\n
\n
\n
\n checked="checked"<% } %> />\n \n
\n
\n
\n
\n checked="checked"<% } %> />\n \n
\n
\n
\n<% }) %>'),i=function(i,s,a){var c;return c=function(){var n,a;return s.off(),n={notifyPolicies:i.notifyPolicies},a=o(n),s.html(r(a)(i)),s.on("change","input[type=radio]",function(r){var n,o,s,a,c,u;return u=angular.element(r.currentTarget),a=u.parents(".policy-table-row").data("index"),s=i.notifyPolicies[a],c=s.live_notify_level,s.live_notify_level=parseInt(u.val(),10),o=function(){return e.notify("success")},n=function(){return e.notify("error"),u.parents(".policy-table-row").find("input[value="+c+"]").prop("checked",!0)},t.save(s).then(o,n)})},i.$on("$destroy",function(){return s.off()}),n(i,a.ngModel,c)},{link:i}},o.directive("tgUserLiveNotificationsList",["$tgRepo","$tgConfirm","$compile",r])}.call(this),function(){var t,e,r,n,i,o,s,a,c,u=function(t,e){function r(){this.constructor=t}for(var n in e)l.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},l={}.hasOwnProperty;c=this.taiga,o=this.taiga.mixOf,a=this.taiga.sizeFormat,s=angular.module("taigaUserSettings"),i=this.taiga.debounce,n=function(t){function e(t,e,r,n,i,o,s,c,u,l,p,h,f,d){var g,m,v;this.scope=t,this.rootscope=e,this.config=r,this.repo=n,this.confirm=i,this.rs=o,this.params=s,this.q=c,this.location=u,this.navUrls=l,this.auth=p,this.translate=h,this.errorHandlingService=f,this.window=d,this.scope.sectionName="USER_SETTINGS.MENU.SECTION_TITLE",this.scope.project={},this.scope.user=this.auth.getUser(),this.scope.user||this.errorHandlingService.permissionDenied(),this.scope.lang=this.getLan(),this.scope.theme=this.getTheme(),g=this.config.get("maxUploadFileSize",null),g&&(v=this.translate.instant("USER_SETTINGS.AVATAR_MAX_SIZE",{maxFileSize:a(g)}),this.scope.maxFileSizeMsg=v),m=this.loadInitialData(),m.then(null,this.onInitialDataError.bind(this))}return u(e,t),e.$inject=["$scope","$rootScope","$tgConfig","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","$translate","tgErrorHandlingService","$window"],e.prototype.loadInitialData=function(){return this.scope.availableThemes=this.config.get("themes",[]),this.rs.locales.list().then(function(t){return function(e){return t.scope.locales=e,e}}(this))},e.prototype.openDeleteLightbox=function(){return this.rootscope.$broadcast("deletelightbox:new",this.scope.user)},e.prototype.getLan=function(){return this.scope.user.lang||this.translate.preferredLanguage()},e.prototype.getTheme=function(){return this.scope.user.theme||this.config.get("defaultTheme")||"taiga"},e.prototype.exportProfile=function(){var t,e;return e=function(t){var e;return e=t.data.url,this.window.open(e,"_blank")},t=function(t){return function(e){var r;if(null!=(r=e.data)?r._error_message:void 0)return t.confirm.notify("error",e.data._error_message)}}(this),this.auth.exportProfile().then(e,t)},e}(o(c.Controller,c.PageMixin)),s.controller("UserSettingsController",n),r=function(t,e,r,n){var o;return o=function(o,s,a){var c;return c=i(2e3,function(i){return function(i){var a,c,u,l;if(i.preventDefault(),c=s.find("form").checksley(),c.validate())return a=o.user.isAttributeModified("email"),o.user.lang=o.lang,o.user.theme=o.theme,l=function(r){var i;return e.setUser(r),a?(i=n.instant("USER_PROFILE.CHANGE_EMAIL_SUCCESS"),t.success(i)):t.notify("success")},u=function(e){return c.setErrors(e),t.notify("error",e._error_message)},r.save(o.user).then(l,u)}}(this)),s.on("submit","form",c),o.$on("$destroy",function(){return s.off()})},{link:o}},s.directive("tgUserProfile",["$tgConfirm","$tgAuth","$tgRepo","$translate",r]),e=function(t,e,r,n){var i;return i=function(i,o,s){var a,c,u;return u=function(){return o.find(".size-info").removeClass("hidden")},c=function(r){var s;return s=e.make_model("users",r.data),t.setUser(s),i.user=s,o.find(".loading-overlay").removeClass("active"),n.notify("success")},a=function(t){return 413===t.status&&u(),o.find(".loading-overlay").removeClass("active"),n.notify("error",t.data._error_message)},o.on("click",".js-change-avatar",function(){return o.find("#avatar-field").click()}),o.on("change","#avatar-field",function(t){if(i.avatarAttachment)return o.find(".loading-overlay").addClass("active"),r.userSettings.changeAvatar(i.avatarAttachment).then(c,a)}),o.on("click","a.js-use-gravatar",function(t){return o.find(".loading-overlay").addClass("active"),r.userSettings.removeAvatar().then(c,a)}),i.$on("$destroy",function(){return o.off()})},{link:i}},s.directive("tgUserAvatar",["$tgAuth","$tgModel","$tgResources","$tgConfirm",e]),t=function(t){var e;return e=function(e,r,n){var i,o;return i=t(n.tgAvatarModel),o=i.assign,r.bind("change",function(){return e.$apply(function(){return o(e,r[0].files[0])})})},{link:e}},s.directive("tgAvatarModel",["$parse",t])}.call(this),function(){var t,e;t=function(){var t;return t=function(t,e,r){var n;return n=r.tgUserSettingsNavigation,e.find(".active").removeClass("active"),e.find("#usersettingsmenu-"+n+" a").addClass("active"),t.$on("$destroy",function(){return e.off()})},{link:t}},e=angular.module("taigaUserSettings"),e.directive("tgUserSettingsNavigation",t)}.call(this),function(){var t,e,r,n,i,o,s,a=function(t,e){function r(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},c={}.hasOwnProperty;s=this.taiga,i=this.taiga.mixOf,n=this.taiga.bindOnce,o=angular.module("taigaUserSettings"),t=function(t){function e(t,e,r,n,i,o,s,a,c,u,l){var p;this.scope=t,this.rootscope=e,this.repo=r,this.confirm=n,this.rs=i,this.params=o,this.q=s,this.location=a,this.navUrls=c,this.auth=u,this.errorHandlingService=l,this.scope.sectionName="USER_SETTINGS.NOTIFICATIONS.SECTION_NAME",this.scope.user=this.auth.getUser(),p=this.loadInitialData(),p.then(null,this.onInitialDataError.bind(this))}return a(e,t),e.$inject=["$scope","$rootScope","$tgRepo","$tgConfirm","$tgResources","$routeParams","$q","$tgLocation","$tgNavUrls","$tgAuth","tgErrorHandlingService"],e.prototype.loadInitialData=function(){return this.rs.notifyPolicies.list().then(function(t){return function(e){return t.scope.notifyPolicies=e,e}}(this))},e}(i(s.Controller,s.PageMixin)),o.controller("UserNotificationsController",t),e=function(){var t;return t=function(t,e,r){return t.$on("$destroy",function(){return e.off()})},{link:t}},o.directive("tgUserNotifications",e),r=function(t,e,r){var i,o;return o=_.template('<% _.each(notifyPolicies, function (notifyPolicy, index) { %>\n
\n
<%- notifyPolicy.project_name %>
\n
\n
\n checked="checked"<% } %>/>\n \n
\n
\n
\n
\n checked="checked"<% } %> />\n \n
\n
\n
\n
\n checked="checked"<% } %> />\n \n
\n
\n
\n<% }) %>'),i=function(i,s,a){var c;return c=function(){var n,a;return s.off(),n={notifyPolicies:i.notifyPolicies},a=o(n),s.html(r(a)(i)),s.on("change","input[type=radio]",function(r){var n,o,s,a,c,u;return u=angular.element(r.currentTarget),a=u.parents(".policy-table-row").data("index"),s=i.notifyPolicies[a],c=s.notify_level,s.notify_level=parseInt(u.val(),10),o=function(){return e.notify("success")},n=function(){return e.notify("error"),u.parents(".policy-table-row").find("input[value="+c+"]").prop("checked",!0)},t.save(s).then(o,n)})},i.$on("$destroy",function(){return s.off()}),n(i,a.ngModel,c)},{link:i}},o.directive("tgUserNotificationsList",["$tgRepo","$tgConfirm","$compile",r])}.call(this),function(){angular.module("taigaComponents",[])}.call(this),function(){var t;t=angular.module("taigaDiscover",[])}.call(this),function(){var t;t=angular.module("taigaExternalApps",[])}.call(this),function(){angular.module("taigaHistory",[])}.call(this),function(){var t;t=angular.module("taigaHome",[])}.call(this),function(){angular.module("taigaNavigationBar",[])}.call(this),function(){var t;t=angular.module("taigaProfile",[])}.call(this),function(){angular.module("taigaProjects",[])}.call(this),function(){angular.module("taigaResources2",[])}.call(this),function(){angular.module("taigaUserTimeline",[])}.call(this),function(){var t;t=angular.module("taigaUtils",[])}.call(this),function(){angular.module("taigaWikiHistory",[])}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{templateUrl:"components/assigned-to/assigned-item/assigned-item.html",scope:{member:"="},link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAssignedItem",t)}.call(this),function(){var t;t=function(){function t(){this.assigned&&this._getAssignedMember(),this._filterAssignedMember()}return t.$inject=[],t.prototype._getAssignedMember=function(){return this.assignedMember=_.filter(this.project.members,function(t){return function(e){return e.id===t.assigned.get("id")}}(this))},t.prototype._filterAssignedMember=function(){return this.assigned?this.nonAssignedMembers=_.filter(this.project.members,function(t){return function(e){return e.id!==t.assigned.get("id")}}(this)):this.nonAssignedMembers=this.project.members},t}(),angular.module("taigaComponents").controller("AssignedToSelectorCtrl",t)}.call(this),function(){var t;t=function(){return{controller:"AssignedToSelectorCtrl",controllerAs:"vm",bindToController:!0,templateUrl:"components/assigned-to/assigned-to-selector/assigned-to-selector.html",scope:{assigned:"=",project:"=",onRemoveAssigned:"&",onAssignTo:"&"}}},t.$inject=[],angular.module("taigaComponents").directive("tgAssignedToSelector",t)}.call(this),function(){var t;t=function(){function t(t,e){this.lightboxFactory=t,this.lightboxService=e,this.has_permissions=_.includes(this.project.my_permissions,"modify_epic")}return t.$inject=["tgLightboxFactory","lightboxService"],t.prototype._closeAndRemoveAssigned=function(){return this.lightboxService.closeAll(),this.onRemoveAssigned()},t.prototype._closeAndAssign=function(t){return this.lightboxService.closeAll(),this.onAssignTo({member:t})},t.prototype.onSelectAssignedTo=function(t,e){return this.lightboxFactory.create("tg-assigned-to-selector",{"class":"lightbox lightbox-assigned-to-selector open",assigned:"assigned",project:"project","on-remove-assigned":"onRemoveAssigned()","on-assign-to":"assignTo(member)"},{assigned:this.assignedTo,project:this.project,onRemoveAssigned:this._closeAndRemoveAssigned.bind(this),assignTo:this._closeAndAssign.bind(this)})},t}(),angular.module("taigaComponents").controller("AssignedToCtrl",t)}.call(this),function(){var t;t=function(){return{controller:"AssignedToCtrl",controllerAs:"vm",bindToController:!0,templateUrl:"components/assigned-to/assigned-to.html",scope:{assignedTo:"=",project:"=",onRemoveAssigned:"&",onAssignTo:"&"}}},t.$inject=[],angular.module("taigaComponents").directive("tgAssignedToComponent",t)}.call(this),function(){var t;t=function(t,e,r){var n;return n=function(n,i,o){var s;return s=t(o.tgAttachmentLink)(n),i.on("click",function(t){return taiga.isImage(s.getIn(["file","name"]))?(t.preventDefault(),n.$apply(function(){return r.open($("tg-attachments-preview")),e.fileId=s.getIn(["file","id"])})):taiga.isPdf(s.getIn(["file","name"]))?(t.preventDefault(),window.open(s.getIn(["file","url"]))):void 0}),n.$on("$destroy",function(){return i.off()})},{link:n}},t.$inject=["$parse","tgAttachmentsPreviewService","lightboxService"],angular.module("taigaComponents").directive("tgAttachmentLink",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{},bindToController:{attachment:"=",onDelete:"&",onUpdate:"&",type:"="},controller:"Attachment",controllerAs:"vm",templateUrl:"components/attachment/attachment-gallery.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachmentGallery",t)}.call(this),function(){var t;t=function(){function t(t,e){this.attachmentsService=t,this.translate=e,this.form={},this.form.description=this.attachment.getIn(["file","description"]),this.form.is_deprecated=this.attachment.get(["file","is_deprecated"]),this.title=this.translate.instant("ATTACHMENT.TITLE",{fileName:this.attachment.get("name"),date:moment(this.attachment.get("created_date")).format(this.translate.instant("ATTACHMENT.DATE"))})}return t.$inject=["tgAttachmentsService","$translate"],t.prototype.editMode=function(t){var e;return e=this.attachment.set("editable",t),this.onUpdate({attachment:e})},t.prototype["delete"]=function(){return this.onDelete({attachment:this.attachment})},t.prototype.save=function(){var t;return t=this.attachment.set("loading",!0),this.onUpdate({attachment:t}),t=this.attachment.merge({editable:!1,loading:!1}),t=t.mergeIn(["file"],{description:this.form.description,is_deprecated:!!this.form.is_deprecated}),this.onUpdate({attachment:t})},t}(),angular.module("taigaComponents").controller("Attachment",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{},bindToController:{attachment:"=",onDelete:"&",onUpdate:"&",type:"="},controller:"Attachment",controllerAs:"vm",templateUrl:"components/attachment/attachment.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachment",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i;return i=t(n.tgAttachmentsDrop),r.on("dragover",function(t){return t.preventDefault(),!1}),r.on("drop",function(t){var r;return t.stopPropagation(),t.preventDefault(),r=t.dataTransfer||t.originalEvent&&t.originalEvent.dataTransfer,e.$apply(function(){return i(e,{files:r.files})})}),e.$on("$destroy",function(){return r.off()})},{link:e}},t.$inject=["$parse"],angular.module("taigaComponents").directive("tgAttachmentsDrop",t)}.call(this),function(){var t,e;e=this.taiga.sizeFormat,t=function(){function t(t,r,n,i,o,s,a){this.translate=t,this.confirm=r,this.config=n,this.storage=i,this.attachmentsFullService=o,this.projectService=s,this.attachmentsPreviewService=a,this.mode=this.storage.get("attachment-mode","list"),this.maxFileSize=this.config.get("maxUploadFileSize",null),this.maxFileSize&&(this.maxFileSize=e(this.maxFileSize)),this.maxFileSizeMsg=this.maxFileSize?this.translate.instant("ATTACHMENT.MAX_UPLOAD_SIZE",{maxFileSize:this.maxFileSize}):"",taiga.defineImmutableProperty(this,"attachments",function(t){return function(){return t.attachmentsFullService.attachments}}(this)),taiga.defineImmutableProperty(this,"deprecatedsCount",function(t){return function(){return t.attachmentsFullService.deprecatedsCount}}(this)),taiga.defineImmutableProperty(this,"attachmentsVisible",function(t){return function(){return t.attachmentsFullService.attachmentsVisible}}(this)),taiga.defineImmutableProperty(this,"deprecatedsVisible",function(t){return function(){return t.attachmentsFullService.deprecatedsVisible}}(this))}return t.$inject=["$translate","$tgConfirm","$tgConfig","$tgStorage","tgAttachmentsFullService","tgProjectService","tgAttachmentsPreviewService"],t.prototype.uploadingAttachments=function(){return this.attachmentsFullService.uploadingAttachments},t.prototype.addAttachment=function(t){var e;return e="list"===this.mode,this.attachmentsFullService.addAttachment(this.projectId,this.objId,this.type,t,e)},t.prototype.setMode=function(t){return this.mode=t,this.storage.set("attachment-mode",t)},t.prototype.toggleDeprecatedsVisible=function(){return this.attachmentsFullService.toggleDeprecatedsVisible()},t.prototype.addAttachments=function(t){return _.forEach(t,function(t){return function(e){return t.addAttachment(e)}}(this))},t.prototype.loadAttachments=function(){return this.attachmentsFullService.loadAttachments(this.type,this.objId,this.projectId)},t.prototype.deleteAttachment=function(t){var e,r;return this.attachmentsPreviewService.fileId=null,r=this.translate.instant("ATTACHMENT.TITLE_LIGHTBOX_DELETE_ATTACHMENT"),e=this.translate.instant("ATTACHMENT.MSG_LIGHTBOX_DELETE_ATTACHMENT",{fileName:t.getIn(["file","name"])}),this.confirm.askOnDelete(r,e).then(function(r){return function(n){var i,o;return i=function(){return e=r.translate.instant("ATTACHMENT.ERROR_DELETE_ATTACHMENT",{errorMessage:e}),r.confirm.notify("error",null,e),n.finish(!1)},o=function(){return n.finish()},r.attachmentsFullService.deleteAttachment(t,r.type).then(o,i)}}(this))},t.prototype.reorderAttachment=function(t,e){return this.attachmentsFullService.reorderAttachment(this.type,t,e)},t.prototype.updateAttachment=function(t){return this.attachmentsFullService.updateAttachment(t,this.type)},t.prototype._isEditable=function(){return!!this.projectService.project&&this.projectService.hasPermission(this.editPermission)},t.prototype.showAttachments=function(){return this._isEditable()||this.attachmentsFullService.attachments.size},t}(),angular.module("taigaComponents").controller("AttachmentsFull",t)}.call(this),function(){var t,e;e=this.taiga.bindOnce,t=function(){var t;return t=function(t,r,n,i){return e(t,"vm.objId",function(t){return i.loadAttachments()})},{scope:{},bindToController:{type:"@",objId:"=",projectId:"=",editPermission:"@"},controller:"AttachmentsFull",controllerAs:"vm",templateUrl:"components/attachments-full/attachments-full.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachmentsFull",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.attachmentsService=t,this.rootScope=e,this._attachments=Immutable.List(),this._deprecatedsCount=0,this._attachmentsVisible=Immutable.List(),this._deprecatedsVisible=!1,this.uploadingAttachments=[],taiga.defineImmutableProperty(this,"attachments",function(t){return function(){return t._attachments}}(this)),taiga.defineImmutableProperty(this,"deprecatedsCount",function(t){return function(){return t._deprecatedsCount}}(this)),taiga.defineImmutableProperty(this,"attachmentsVisible",function(t){return function(){return t._attachmentsVisible}}(this)),taiga.defineImmutableProperty(this,"deprecatedsVisible",function(t){return function(){return t._deprecatedsVisible}}(this))}return e(r,t),r.$inject=["tgAttachmentsService","$rootScope"],r.prototype.toggleDeprecatedsVisible=function(){return this._deprecatedsVisible=!this._deprecatedsVisible,this.regenerate()},r.prototype.regenerate=function(){return this._deprecatedsCount=this._attachments.count(function(t){return t.getIn(["file","is_deprecated"])}),this._deprecatedsVisible?this._attachmentsVisible=this._attachments:this._attachmentsVisible=this._attachments.filter(function(t){return!t.getIn(["file","is_deprecated"])})},r.prototype.addAttachment=function(t,e,r,n,i,o){return null==i&&(i=!0),null==o&&(o=!1),new Promise(function(s){return function(a,c){var u;return s.attachmentsService.validate(n)?(s.uploadingAttachments.push(n),u=s.attachmentsService.upload(n,e,t,r,o),u.then(function(t){var e;return s.uploadingAttachments=s.uploadingAttachments.filter(function(e){return e.name!==t.get("name")}),e=Immutable.Map(),e=e.merge({file:t,editable:i,loading:!1,from_comment:o}),s._attachments=s._attachments.push(e),s.regenerate(),s.rootScope.$broadcast("attachment:create"),a(e)})):c(new Error(n))}}(this))},r.prototype.loadAttachments=function(t,e,r){return this.attachmentsService.list(t,e,r).then(function(t){return function(e){return t._attachments=e.map(function(t){var e;return e=Immutable.Map(),e.merge({loading:!1,editable:!1,file:t})}),t.regenerate()}}(this))},r.prototype.deleteAttachment=function(t,e){var r;return r=function(e){return function(){return e._attachments=e._attachments.filter(function(e){return e!==t}),e.regenerate()}}(this),this.attachmentsService["delete"](e,t.getIn(["file","id"])).then(r)},r.prototype.reorderAttachment=function(t,e,r){var n,i,o;if(i=this.attachments.findIndex(function(t){return t===e}),i!==r)return n=this.attachments.remove(i),n=n.splice(r,0,e),n=n.map(function(t,e){return t.setIn(["file","order"],e+1)}),o=[],n.forEach(function(e){return function(r){var n;return n={order:r.getIn(["file","order"])},o.push(e.attachmentsService.patch(r.getIn(["file","id"]),t,n))}}(this)),Promise.all(o).then(function(t){return function(){return t._attachments=n,t.regenerate()}}(this))},r.prototype.updateAttachment=function(t,e){var r,n,i;return r=this._attachments.findIndex(function(e){return e.getIn(["file","id"])===t.getIn(["file","id"])}),n=this._attachments.get(r),i=taiga.patch(n.get("file"),t.get("file")),t.get("loading")?(this._attachments=this._attachments.set(r,t),this.regenerate()):this.attachmentsService.patch(t.getIn(["file","id"]),e,i).then(function(e){return function(){return e._attachments=e._attachments.set(r,t),e.regenerate()}}(this))},r}(taiga.Service),angular.module("taigaComponents").service("tgAttachmentsFullService",t)}.call(this),function(){var t;t=function(){function t(t){this.attachmentsPreviewService=t,taiga.defineImmutableProperty(this,"current",function(t){return function(){return t.attachmentsPreviewService.fileId?t.getCurrent():null}}(this))}return t.$inject=["tgAttachmentsPreviewService"],t.prototype.hasPagination=function(){var t;return t=this.attachments.filter(function(t){return function(t){return taiga.isImage(t.getIn(["file","name"]))}}(this)),t.size>1},t.prototype.getCurrent=function(){var t,e;return t=this.attachments.find(function(t){return function(e){return t.attachmentsPreviewService.fileId===e.getIn(["file","id"])}}(this)),e=t.get("file")},t.prototype.getIndex=function(){return this.attachments.findIndex(function(t){return function(e){return t.attachmentsPreviewService.fileId===e.getIn(["file","id"])}}(this))},t.prototype.next=function(){var t,e;return t=this.getIndex(),e=this.attachments.slice(t+1).find(function(t){return taiga.isImage(t.getIn(["file","name"]))}),e||(e=this.attachments.find(function(t){return taiga.isImage(t.getIn(["file","name"]))})),this.attachmentsPreviewService.fileId=e.getIn(["file","id"])},t.prototype.previous=function(){var t,e;return t=this.getIndex(),e=this.attachments.slice(0,t).findLast(function(t){return taiga.isImage(t.getIn(["file","name"]))}),e||(e=this.attachments.findLast(function(t){return taiga.isImage(t.getIn(["file","name"]))})),this.attachmentsPreviewService.fileId=e.getIn(["file","id"])},t}(),angular.module("taigaComponents").controller("AttachmentsPreview",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(t,r,n,i){return $(document.body).on("keydown.image-preview",function(r){return e.fileId&&(39===r.keyCode?i.next():37===r.keyCode&&i.previous()),t.$digest()}),t.$on("$destroy",function(){return $(document.body).off(".image-preview")})},{scope:{},controller:"AttachmentsPreview",templateUrl:"components/attachments-preview/attachments-preview.html",link:r,controllerAs:"vm",bindToController:{attachments:"="}}},angular.module("taigaComponents").directive("tgAttachmentsPreview",["lightboxService","tgAttachmentsPreviewService",t])}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){}return e(r,t),r.$inject=[],r}(taiga.Service),angular.module("taigaComponents").service("tgAttachmentsPreviewService",t)}.call(this),function(){var t;t=function(){function t(t){this.attachmentsService=t}return t.$inject=["tgAttachmentsService"],t.prototype.addAttachment=function(t){var e;if(e=Immutable.fromJS({file:t,name:t.name,size:t.size}),this.attachmentsService.validate(t)&&(this.attachments=this.attachments.push(e),this.onAdd))return this.onAdd({attachment:e})},t.prototype.addAttachments=function(t){return _.forEach(t,this.addAttachment.bind(this))},t.prototype.deleteAttachment=function(t){if(this.attachments=this.attachments.filter(function(e){return e!==t}),this.onDelete)return this.onDelete({attachment:t})},t}(),angular.module("taigaComponents").controller("AttachmentsSimple",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{scope:{},bindToController:{attachments:"=",onAdd:"&",onDelete:"&"},controller:"AttachmentsSimple",controllerAs:"vm",templateUrl:"components/attachments-simple/attachments-simple.html",link:t}},t.$inject=[],angular.module("taigaComponents").directive("tgAttachmentsSimple",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i,o,s;return i=t(n.tgAttachmentsSortable),o=dragula([r[0]],{copySortSource:!1,copy:!1,mirrorContainer:r[0],moves:function(t){return $(t).is("div[tg-bind-scope]")}}),o.on("dragend",function(t){var r,n;return t=$(t),r=t.scope().attachment,n=t.index(),e.$apply(function(){return i(e,{attachment:r,index:n})})}),s=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&o.dragging}}),e.$on("$destroy",function(){return r.off(),o.destroy()})},{link:e}},t.$inject=["$parse"],angular.module("taigaComponents").directive("tgAttachmentsSortable",t)}.call(this),function(){var t;t=function(t){return{link:function(e,r){return t(function(){return r[0].select()})}}},t.$inject=["$timeout"],angular.module("taigaComponents").directive("tgAutoSelect",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i;return i=n.tgAvatarBig?"avatarBig":"avatar",e.$watch(i,function(e){var n;return n=t.getAvatar(e,i),r.attr("src",n.url),r.css("background",n.bg||"")})},{link:e,scope:{avatar:"=tgAvatar",avatarBig:"=tgAvatarBig"}}},t.$inject=["tgAvatarService"],angular.module("taigaComponents").directive("tgAvatar",t),angular.module("taigaComponents").directive("tgAvatarBig",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){var t,e;return t=function(t,e,r){return t.$watch("epics",function(e){if(e&&!e.isIterable)return t.immutable_epics=Immutable.fromJS(e)})},e=function(t,e){return e.format?"components/belong-to-epics/belong-to-epics-"+e.format+".html":"components/belong-to-epics/belong-to-epics-pill.html"},{link:t,scope:{epics:"="},templateUrl:e}},e.directive("tgBelongToEpics",t)}.call(this),function(){var t;t=function(t,e,r,n,i){return{restrict:"A",compile:function(o,s){var a,c;return a=e(s.tgBindCode),c=e(s.tgBindCode,function(t){return(t||"").toString()}),r.$$addBindingClass(o),function(e,o,s){return r.$$addBindingInfo(o,s.tgBindCode),e.$watch(c,function(){var r;return r=n.getHTML(a(e)),o.html(t.getTrustedHtml(r)||""),i.addHightlighter(o)})}}}},angular.module("taigaComponents").directive("tgBindCode",["$sce","$parse","$compile","tgWysiwygService","tgWysiwygCodeHightlighterService",t]); }.call(this),function(){var t;t=function(){return{scope:{levels:"=",value:"="},templateUrl:"components/board-zoom/board-zoom.html"}},angular.module("taigaComponents").directive("tgBoardZoom",[t])}.call(this),function(){var t;t=function(){function t(){this.index=0}return t.$inject=[],t.prototype.next=function(){if(this.index++,this.index>=this.images.size)return this.index=0},t.prototype.previous=function(){if(this.index--,this.index<0)return this.index=this.images.size-1},t}(),angular.module("taigaComponents").controller("CardSlideshow",t)}.call(this),function(){var t,e;e=angular.module("taigaComponents"),t=function(){return{controller:"CardSlideshow",templateUrl:"components/card-slideshow/card-slideshow.html",bindToController:!0,controllerAs:"vm",scope:{images:"="}}},e.directive("tgCardSlideshow",t)}.call(this),function(){var t;t=function(){function t(){}return t.$inject=[],t.prototype.visible=function(t){return this.zoom.indexOf(t)!==-1},t.prototype.hasTasks=function(){var t;return t=this.item.getIn(["model","tasks"]),t&&t.size>0},t.prototype.hasMultipleAssignedUsers=function(){var t;return t=this.item.getIn(["model","assigned_users"]),t&&t.size>1},t.prototype.hasVisibleAttachments=function(){return this.item.get("images").size>0},t.prototype.toggleFold=function(){return this.onToggleFold({id:this.item.get("id")})},t.prototype.getClosedTasks=function(){return this.item.getIn(["model","tasks"]).filter(function(t){return t.get("is_closed")})},t.prototype.closedTasksPercent=function(){return 100*this.getClosedTasks().size/this.item.getIn(["model","tasks"]).size},t.prototype.getModifyPermisionKey=function(){return"task"===this.type?"modify_task":"modify_us"},t.prototype.getDeletePermisionKey=function(){return"task"===this.type?"delete_task":"delete_us"},t.prototype._setVisibility=function(){var t;return t={related:this.visible("related_tasks"),slides:this.visible("attachments")},_.isUndefined(this.item.get("foldStatusChanged"))||(this.visible("related_tasks")&&this.visible("attachments")?(t.related=!this.item.get("foldStatusChanged"),t.slides=!this.item.get("foldStatusChanged")):this.visible("attachments")?(t.related=this.item.get("foldStatusChanged"),t.slides=this.item.get("foldStatusChanged")):this.visible("related_tasks")||this.visible("attachments")||(t.related=this.item.get("foldStatusChanged"),t.slides=this.item.get("foldStatusChanged"))),this.item.getIn(["model","tasks"])&&this.item.getIn(["model","tasks"]).size||(t.related=!1),this.item.get("images")&&this.item.get("images").size||(t.slides=!1),t},t.prototype.isRelatedTasksVisible=function(){var t;return t=this._setVisibility(),t.related},t.prototype.isSlideshowVisible=function(){var t;return t=this._setVisibility(),t.slides},t.prototype.getNavKey=function(){return"task"===this.type?"project-tasks-detail":"project-userstories-detail"},t}(),angular.module("taigaComponents").controller("Card",t)}.call(this),function(){var t,e;e=angular.module("taigaComponents"),t=function(){return{link:function(t){},controller:"Card",controllerAs:"vm",bindToController:!0,templateUrl:"components/card/card.html",scope:{onToggleFold:"&",onClickAssignedTo:"&",onClickEdit:"&",onClickDelete:"&",project:"=",item:"=",zoom:"=",zoomLevel:"=",archived:"=",type:"@"}}},e.directive("tgCard",t)}.call(this),function(){var t;t=function(){return{link:function(t,e){return e.on("click",function(t){var r;if(!$(t.target).is("input"))return t.preventDefault(),r=e.find('input[type="file"]'),r.val(""),r.trigger("click")}),t.$on("$destroy",function(){return e.off()})}}},angular.module("taigaComponents").directive("tgClickInputFile",[t])}.call(this),function(){var t,e,r;r=this.taiga,e=r.getDefaulColorList,t=function(){function t(t){this.projectService=t,this.colorList=e(),this.checkIsColorRequired(),this.displayColorList=!1}return t.$inject=["tgProjectService"],t.prototype.userCanChangeColor=function(){return!this.requiredPerm||this.projectService.hasPermission(this.requiredPerm)},t.prototype.checkIsColorRequired=function(){if(!this.isColorRequired)return this.colorList=_.dropRight(this.colorList)},t.prototype.setColor=function(t){return this.color=t,this.customColor=t},t.prototype.resetColor=function(){if(this.isColorRequired&&!this.color)return this.color=this.initColor},t.prototype.toggleColorList=function(){return this.displayColorList=!this.displayColorList,this.customColor=this.color,this.resetColor()},t.prototype.onSelectDropdownColor=function(t){return this.color=t,this.onSelectColor({color:t}),this.toggleColorList()},t.prototype.onKeyDown=function(t){if(13===t.which)return!this.customColor&&this.isColorRequired||this.onSelectDropdownColor(this.customColor),t.preventDefault()},t}(),angular.module("taigaComponents").controller("ColorSelectorCtrl",t)}.call(this),function(){var t,e;e=this.taiga.bindOnce,t=function(t){var e;return e=function(e,r,n,i){var o,s,a;return o=null,s=function(){return t.cancel(o),o=null},a=function(){if(!o)return o=t(function(){return i.displayColorList=!1,i.resetColor()},400)},r.find(".color-selector").mouseenter(s).mouseleave(a),r.find(".color-selector-dropdown").mouseenter(s).mouseleave(a),e.$watch("vm.initColor",function(t){return i.setColor(t)})},{link:e,templateUrl:"components/color-selector/color-selector.html",controller:"ColorSelectorCtrl",controllerAs:"vm",bindToController:{isColorRequired:"=",onSelectColor:"&",initColor:"=",requiredPerm:"@"},scope:{}}},t.$inject=["$timeout"],angular.module("taigaComponents").directive("tgColorSelector",t)}.call(this),function(){var t,e;e=angular.module("taigaUserStories"),t=function(){function t(t,e,r,n,i){this.rootScope=t,this.confirm=e,this.modelTransform=r,this.navUrls=n,this.window=i,this.editMode=!1,this.loadingSubject=!1,this.originalSubject=this.item.subject}return t.$inject=["$rootScope","$tgConfirm","$tgQueueModelTransformation","$tgNavUrls","$window"],t.prototype._checkNav=function(){var t,e,r;if(null!=(null!=(e=this.item.neighbors.previous)?e.ref:void 0)&&(t={project:this.project.slug,ref:this.item.neighbors.previous.ref},this.previousUrl=this.navUrls.resolve("project-"+this.item._name+"-detail",t)),null!=(null!=(r=this.item.neighbors.next)?r.ref:void 0))return t={project:this.project.slug,ref:this.item.neighbors.next.ref},this.nextUrl=this.navUrls.resolve("project-"+this.item._name+"-detail",t)},t.prototype._checkPermissions=function(){return this.permissions={canEdit:_.includes(this.project.my_permissions,this.requiredPerm)}},t.prototype.editSubject=function(t){var e;if(e=this.window.getSelection(),"Range"!==e.type&&(t&&(this.editMode=!0),!t))return this.editMode=!1},t.prototype.onKeyDown=function(t){if(13===t.which&&this.saveSubject(),27===t.which)return this.item.subject=this.originalSubject,this.editSubject(!1)},t.prototype.saveSubject=function(){var t,e,r,n;return r=function(t){return function(){return t.loadingSubject=!1,t.rootScope.$broadcast("object:updated"),t.confirm.notify("success"),t.originalSubject=t.item.subject}}(this),e=function(t){return function(){return t.loadingSubject=!1,t.confirm.notify("error")}}(this),this.editMode=!1,this.loadingSubject=!0,t=this.item,n=this.modelTransform.save(function(t){return t}),n.then(r,e)},t}(),e.controller("StoryHeaderCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaUserStories"),t=function(){var t;return this.$inject=[],t=function(t,e,r,n){return n._checkPermissions(),n._checkNav()},{link:t,controller:"StoryHeaderCtrl",bindToController:!0,scope:{item:"=",project:"=",requiredPerm:"@"},controllerAs:"vm",templateUrl:"components/detail/header/detail-header.html"}},e.directive("tgDetailHeader",t)}.call(this),function(){var t;t=function(){function t(t,e){this.translate=t,this.tgLightboxFactory=e}return t.$inject=["$translate","tgLightboxFactory"],t.prototype.visible=function(){return"button"===this.format||null!=this.dueDate},t.prototype.disabled=function(){return this.isClosed},t.prototype.color=function(){var t;return t={no_longer_applicable:"closed",due_soon:"due-soon",past_due:"past-due",set:"due-set"},t[this.dueDateStatus]||""},t.prototype.title=function(){return"button"===this.format?this.dueDate?this._formatTitle():"Edit due date":this._formatTitle()},t.prototype._formatTitle=function(){var t,e,r,n;return t="closed",n={no_longer_applicable:"COMMON.DUE_DATE.NO_LONGER_APPLICABLE",due_soon:"COMMON.DUE_DATE.DUE_SOON",past_due:"COMMON.DUE_DATE.PAST_DUE"},r=this.translate.instant("COMMON.PICKERDATE.FORMAT"),e=moment(this.dueDate).format(r),n[this.dueDateStatus]?e+" ("+this.translate.instant(n[this.dueDateStatus])+")":e},t.prototype.setDueDate=function(){if(!this.disabled())return this.tgLightboxFactory.create("tg-lb-set-due-date",{"class":"lightbox lightbox-set-due-date"},{object:this.item})},t}(),angular.module("taigaComponents").controller("DueDate",t)}.call(this),function(){var t,e;e=angular.module("taigaComponents"),t=function(){var t;return t=function(t,e){return e.format?"components/due-date/due-date-"+e.format+".html":"components/due-date/due-date-icon.html"},{link:function(t){},controller:"DueDate",controllerAs:"vm",bindToController:!0,templateUrl:t,scope:{dueDate:"=",dueDateStatus:"=",isClosed:"=",item:"=",format:"@"}}},e.directive("tgDueDate",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n,i){var o;return o=t(n.tgFileChange),r.on("change",function(t){return e.$apply(function(){return o(e,{files:t.currentTarget.files})})}),e.$on("$destroy",function(){return r.off()})},{restrict:"A",link:e}},t.$inject=["$parse"],angular.module("taigaComponents").directive("tgFileChange",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=taiga.generateHash,t=function(t){function n(t,e,r){this.q=t,this.urls=e,this.http=r}return r(n,t),n.$inject=["$q","$tgUrls","$tgHttp"],n.prototype.storeFilters=function(t,r,n){var i,o,s,a,c;return i=this.q.defer(),c=this.urls.resolve("user-storage"),s=t+":"+n,o=e([t,s]),_.isEmpty(r)?(a=this.http["delete"](c+"/"+o,{key:o,value:r}),a.then(function(){return i.resolve()}),a.then(null,function(){return i.reject()})):(a=this.http.put(c+"/"+o,{key:o,value:r}),a.then(function(t){return i.resolve()}),a.then(null,function(t){return function(e){var n;return n=t.http.post(""+c,{key:o,value:r}),n.then(function(){return i.resolve()}),n.then(null,function(){return i.reject()})}}(this))),i.promise},n.prototype.getFilters=function(t,r){var n,i,o,s,a;return n=this.q.defer(),a=this.urls.resolve("user-storage"),o=t+":"+r,i=e([t,o]),s=this.http.get(a+"/"+i),s.then(function(t){return n.resolve(t.data.value)}),s.then(null,function(t){return n.resolve({})}),n.promise},n}(taiga.Service),angular.module("taigaComponents").service("tgFilterRemoteStorageService",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){var i;return i=$("tg-filter"),t.$watch(r.ngIf,function(t){var r,n;if(t)return i.find(".filter-list").hide(),n=i.height(),r=0,i.children().each(function(){return r+=$(this).outerHeight(!0)}),$(e.context.nextSibling).css({"max-height":n-r,display:"block"})})},{priority:900,link:t}},angular.module("taigaComponents").directive("tgFilterSlideDown",[t])}.call(this),function(){var t;t=function(){function t(){this.opened=null,this.customFilterForm=!1,this.customFilterName=""}return t.$inject=[],t.prototype.toggleFilterCategory=function(t){return this.opened===t?this.opened=null:this.opened=t},t.prototype.isOpen=function(t){return this.opened===t},t.prototype.saveCustomFilter=function(){return this.onSaveCustomFilter({name:this.customFilterName}),this.customFilterForm=!1,this.opened="custom-filter",this.customFilterName=""},t.prototype.changeQ=function(){return this.onChangeQ({q:this.q})},t.prototype.unselectFilter=function(t){return this.onRemoveFilter({filter:t})},t.prototype.unselectFilter=function(t){return this.onRemoveFilter({filter:t})},t.prototype.selectFilter=function(t,e){return e={category:t,filter:e},this.onAddFilter({filter:e})},t.prototype.removeCustomFilter=function(t){return this.onRemoveCustomFilter({filter:t})},t.prototype.selectCustomFilter=function(t){return this.onSelectCustomFilter({filter:t})},t.prototype.isFilterSelected=function(t,e){return!!_.find(this.selectedFilters,function(r){return e.id===r.id&&t.dataType===r.dataType})},t}(),angular.module("taigaComponents").controller("Filter",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){var i;return i=t.$watch("vm.defaultQ",function(e){return e&&!t.vm.filtersForm.$dirty?(t.vm.q=e,i()):t.vm.filtersForm.$dirty?i():void 0}),r.$observe("open",function(r){return r=t.$eval(r),r?e.addClass("open"):e.removeClass("open")})},{scope:{onChangeQ:"&",onAddFilter:"&",onSelectCustomFilter:"&",onRemoveFilter:"&",onRemoveCustomFilter:"&",onSaveCustomFilter:"&",customFilters:"<",defaultQ:"=q",filters:"<",customFilters:"<",selectedFilters:"<"},bindToController:!0,controller:"Filter",controllerAs:"vm",templateUrl:"components/filter/filter.html",link:t}},angular.module("taigaComponents").directive("tgFilter",[t])}.call(this),function(){var t,e;e=this.taiga,t=function(t,e,r,n,i){var o;return o=function(n,o,s,a){var c,u,l;return l=null,u=introJs(),u.oncomplete(function(){return $("html,body").scrollTop(0)}),u.onexit(function(){return e.disableJoyRide()}),c=function(t,e){if(e[t.joyride])return u.setOptions({exitOnEsc:!1,exitOnOverlayClick:!1,showStepNumbers:!1,nextLabel:i.instant("JOYRIDE.NAV.NEXT")+" →",prevLabel:"← "+i.instant("JOYRIDE.NAV.BACK"),skipLabel:i.instant("JOYRIDE.NAV.SKIP"),doneLabel:i.instant("JOYRIDE.NAV.DONE"),disableInteraction:!0}),u.setOption("steps",r.get(t.joyride)),u.start()},t.$on("$routeChangeSuccess",function(r,n){return n.joyride&&e.isAuthenticated()?(u.oncomplete(function(){return e.disableJoyRide(n.joyride)}),n.loader?l=t.$on("loader:end",function(){return e.loadJoyRideConfig().then(function(t){return c(n,t)}),l()}):e.loadJoyRideConfig().then(function(t){return c(n,t)})):(u.exit(),void(l&&l()))})},{scope:{},link:o}},t.$inject=["$rootScope","tgCurrentUserService","tgJoyRideService","$location","$translate"],angular.module("taigaComponents").directive("tgJoyRide",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.translate=t,this.checkPermissionsService=e}return e(r,t),r.$inject=["$translate","tgCheckPermissionsService"],r.prototype.getConfig=function(){return{dashboard:function(t){return function(){var e;return e=[{element:".project-list > section:not(.ng-hide)",position:"left",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP1.TITLE"),text:t.translate.instant("JOYRIDE.DASHBOARD.STEP1.TEXT")}},{element:".working-on-container",position:"right",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP2.TITLE"),text:t.translate.instant("JOYRIDE.DASHBOARD.STEP2.TEXT")}},{element:".watching-container",position:"right",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP3.TITLE"),text:[t.translate.instant("JOYRIDE.DASHBOARD.STEP3.TEXT1"),t.translate.instant("JOYRIDE.DASHBOARD.STEP3.TEXT2")]}}],$(".project-list .create-project-button").is(":hidden")||e.push({element:".project-list .create-project-button",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.DASHBOARD.STEP4.TITLE"),text:[t.translate.instant("JOYRIDE.DASHBOARD.STEP4.TEXT1"),t.translate.instant("JOYRIDE.DASHBOARD.STEP4.TEXT2")]}}),e}}(this),backlog:function(t){return function(){var e;return e=[{element:".summary",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP1.TITLE"),text:[t.translate.instant("JOYRIDE.BACKLOG.STEP1.TEXT1"),t.translate.instant("JOYRIDE.BACKLOG.STEP1.TEXT2")]}},{element:".backlog-table-empty",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP2.TITLE"),text:t.translate.instant("JOYRIDE.BACKLOG.STEP2.TEXT")}},{element:".sprints",position:"left",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP3.TITLE"),text:t.translate.instant("JOYRIDE.BACKLOG.STEP3.TEXT")}}],t.checkPermissionsService.check("add_us")&&e.push({element:".new-us",position:"rigth",joyride:{title:t.translate.instant("JOYRIDE.BACKLOG.STEP4.TITLE"),text:t.translate.instant("JOYRIDE.BACKLOG.STEP4.TEXT")}}),e}}(this),kanban:function(t){return function(){var e;return e=[{element:".kanban-table-inner",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.KANBAN.STEP1.TITLE"),text:t.translate.instant("JOYRIDE.KANBAN.STEP1.TEXT")}},{element:".card-placeholder",position:"right",joyride:{title:t.translate.instant("JOYRIDE.KANBAN.STEP2.TITLE"),text:t.translate.instant("JOYRIDE.KANBAN.STEP2.TEXT")}}],t.checkPermissionsService.check("add_us")&&e.push({element:".add-action",position:"bottom",joyride:{title:t.translate.instant("JOYRIDE.KANBAN.STEP3.TITLE"),text:[t.translate.instant("JOYRIDE.KANBAN.STEP3.TEXT1"),t.translate.instant("JOYRIDE.KANBAN.STEP3.TEXT2")]}}),e}}(this)}},r.prototype.get=function(t){var e,r;return r=this.getConfig(),e=r[t].call(this),_.map(e,function(t){var e;return e="",t.joyride.title&&(e+="

"+t.joyride.title+"

"),_.isArray(t.joyride.text)?_.forEach(t.joyride.text,function(t){return e+="

"+t+"

"}):e+="

"+t.joyride.text+"

",t.intro=e,t})},r}(taiga.Service),angular.module("taigaComponents").service("tgJoyRideService",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i,o){var s,a,c;return r.zoomIndex=t.get("kanban_zoom")||2,r.levels=5,c=[["ref"],["subject"],["owner","tags","extra_info","unfold"],["attachments"],["related_tasks","empty_extra_info"]],s=function(e){return null==e&&(e=0),t.get("kanban_zoom")!==e&&t.set("kanban_zoom",e),_.reduce(c,function(t,r,n){return n<=e&&(t=t.concat(r)),t})},r.$watch("zoomIndex",function(t){var e;return e=s(t),r.onZoomChange({zoomLevel:t,zoom:e})}),a=r.$watch(function(){return e.project},function(t){if(t)return t.get("my_permissions").indexOf("view_tasks")===-1&&(r.levels=4),a()})},{scope:{onZoomChange:"&"},template:'',link:r}},angular.module("taigaComponents").directive("tgKanbanBoardZoom",["$tgStorage","tgProjectService",t])}.call(this),function(){var t;t=function(t){var e;return e=function(t,e,r){},{restrict:"AE",scope:{},controllerAs:"vm",controller:function(){return this.close=function(){return t.open=!1},Object.defineProperties(this,{open:{get:function(){return t.open}},title:{get:function(){return t.title}},desc:{get:function(){return t.desc}}})},link:e,templateUrl:"components/live-announcement/live-announcement.html"}},t.$inject=["tgLiveAnnouncementService"],angular.module("taigaComponents").directive("tgLiveAnnouncement",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){this.open=!1,this.title="",this.desc=""}return e(r,t),r.prototype.show=function(t,e){return this.open=!0,this.title=t,this.desc=e},r}(taiga.Service),angular.module("taigaComponents").service("tgLiveAnnouncementService",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.$watch("project",function(e){var n,i;if(e=Immutable.fromJS(e))return i=e.get("logo_big_url"),i?(r.attr("src",i),r.css("background","")):(n=t.getDefaultProjectLogo(e.get("slug"),e.get("id")),r.attr("src",n.src),r.css("background",n.color))})},{link:e,scope:{project:"=tgProjectLogoBigSrc"}}},t.$inject=["tgProjectLogoService"],angular.module("taigaComponents").directive("tgProjectLogoBigSrc",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.$watch("project",function(e){var n,i;if(e=Immutable.fromJS(e))return i=e.get("logo_small_url"),i?(r.attr("src",i),r.css("background","")):(n=t.getDefaultProjectLogo(e.get("slug"),e.get("id")),r.attr("src",n.src),r.css("background",n.color))})},{link:e,scope:{project:"=tgProjectLogoSmallSrc"}}},t.$inject=["tgProjectLogoService"],angular.module("taigaComponents").directive("tgProjectLogoSmallSrc",t)}.call(this),function(){var t;t=function(){function t(t,e){this.projectService=t,this.lightboxFactory=e,this.project=null,this.menu=Immutable.Map()}return t.$inject=["tgProjectService","tgLightboxFactory"],t.prototype.show=function(){return this.project=this.projectService.project,this.active=this._getActiveSection(),this._setVideoConference(),this._setMenuPermissions()},t.prototype.hide=function(){return this.project=null,this.menu={}},t.prototype.search=function(){return this.lightboxFactory.create("tg-search-box",{"class":"lightbox lightbox-search"})},t.prototype._setVideoConference=function(){var t;if(t=this._videoConferenceUrl())return this.project=this.project.set("videoconferenceUrl",t)},t.prototype._setMenuPermissions=function(){if(this.menu=Immutable.Map({epics:!1,backlog:!1,kanban:!1,issues:!1,wiki:!1}),this.project.get("is_epics_activated")&&this.project.get("my_permissions").indexOf("view_epics")!==-1&&(this.menu=this.menu.set("epics",!0)),this.project.get("is_backlog_activated")&&this.project.get("my_permissions").indexOf("view_us")!==-1&&(this.menu=this.menu.set("backlog",!0)),this.project.get("is_kanban_activated")&&this.project.get("my_permissions").indexOf("view_us")!==-1&&(this.menu=this.menu.set("kanban",!0)),this.project.get("is_issues_activated")&&this.project.get("my_permissions").indexOf("view_issues")!==-1&&(this.menu=this.menu.set("issues",!0)),this.project.get("is_wiki_activated")&&this.project.get("my_permissions").indexOf("view_wiki_pages")!==-1)return this.menu=this.menu.set("wiki",!0)},t.prototype._getActiveSection=function(){var t,e,r,n,i;return n=this.projectService.section,i=this.projectService.sectionsBreadcrumb,t=i.lastIndexOf("backlog"),e=i.lastIndexOf("kanban"),t===-1&&e===-1||(r=e===-1||t>e?"backlog":"kanban"),"backlog-kanban"===n&&("backlog"===r||"kanban"===r?n=r:this.project.get("is_backlog_activated")&&!this.project.get("is_kanban_activated")?n="backlog":!this.project.get("is_backlog_activated")&&this.project.get("is_kanban_activated")&&(n="kanban")),n},t.prototype._videoConferenceUrl=function(){var t,e;if("appear-in"===this.project.get("videoconferences"))t="https://appear.in/";else if("talky"===this.project.get("videoconferences"))t="https://talky.io/";else{if("jitsi"!==this.project.get("videoconferences"))return"custom"===this.project.get("videoconferences")?this.project.get("videoconferences_extra_data"):"";t="https://meet.jit.si/"}return e=this.project.get("videoconferences_extra_data")?this.project.get("slug")+"-"+taiga.slugify(this.project.get("videoconferences_extra_data")):this.project.get("slug"),"jitsi"===this.project.get("videoconferences")&&(e=e.replace(/-/g,"")),t+e},t}(),angular.module("taigaComponents").controller("ProjectMenu",t)}.call(this),function(){var t,e;e=this.taiga,t=function(t,e){var r;return r=function(e,r,n,i){var o;return o=function(){return t.project?i.show():i.hide()},e.$watch(function(){return t.project},o),e.vm.fixed=!1,$(window).on("scroll",function(){var t;return t=$(window).scrollTop(),t>100&&e.vm.fixed===!1?(e.vm.fixed=!0,e.$digest()):t<100&&e.vm.fixed===!0?(e.vm.fixed=!1,e.$digest()):void 0})},{scope:{},controller:"ProjectMenu",controllerAs:"vm",templateUrl:"components/project-menu/project-menu.html",link:r}},t.$inject=["tgProjectService","tgLightboxFactory"],angular.module("taigaComponents").directive("tgProjectMenu",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){var t,e,r,n;return r=function(t){var e,r,n;return t.addClass("selected"),n=t.position().top+t.outerHeight(),e=t.parent().outerHeight(),n>e?(r=n-e,t.parent().scrollTop(t.parent().scrollTop()+r)):t.position().top<0?t.parent().scrollTop(t.parent().scrollTop()+t.position().top):void 0},t=function(t,e,n){var i,o,s;if(i=t.find(".selected"),40===e){if(!i.length)return r(t.find("li:first"));if(o=i.next("li"),o.length)return i.removeClass("selected"),r(o)}else if(38===e){if(!i.length)return r(t.find("li:last"));if(s=i.prev("li"),s.length)return i.removeClass("selected"),r(s)}},n=function(){return $(document).off(".tags-keyboard-navigation")},e=function(e,r){return n(),$(r).parent().on("keydown.tags-keyboard-navigation",function(n){return function(n){var i;if(i=n.keyCode?n.keyCode:n.which,40===i||38===i)return n.preventDefault(),t(r,i,e)}}(this)),e.$on("$destroy",n)},{link:e,templateUrl:"components/tags/tag-dropdown/tag-dropdown.html",scope:{onSelectTag:"&",colorArray:"=",tag:"="}}},e.directive("tgTagsDropdown",t)}.call(this),function(){var t,e,r;r=this.taiga.trim,e=angular.module("taigaCommon"),t=function(){function t(t){this.tagLineService=t,this.disableColorSelection=!1,this.newTag={name:"",color:null},this.colorArray=[],this.addTag=!1}return t.$inject=["tgTagLineService"],t.prototype.checkPermissions=function(){return this.tagLineService.checkPermissions(this.project.my_permissions,this.permissions)},t.prototype._createColorsArray=function(t){return this.colorArray=this.tagLineService.createColorsArray(t)},t.prototype.displayTagInput=function(){return this.addTag=!0},t.prototype.addNewTag=function(t,e){if(this.newTag.name="",this.newTag.color=null,t.length)return this.disableColorSelection?t.length?this.onAddTag({name:t,color:e}):void 0:(this.project.tags_colors[t]&&(e=this.project.tags_colors[t]),this.onAddTag({name:t,color:e}))},t.prototype.selectColor=function(t){return this.newTag.color=t},t}(),e.controller("TagLineCommonCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){var t;return t=function(t,e,r,n){var i;return _.isUndefined(r.disableColorSelection)||(n.disableColorSelection=!0),i=t.$watch("vm.project",function(t){if(t&&Object.keys(t).length)return i(),n.disableColorSelection?void 0:n.colorArray=n._createColorsArray(n.project.tags_colors)}),e.on("keydown",".tag-input",function(r){var i;return 27===r.keyCode?(n.addTag=!1,n.newTag.name="",n.newTag.color="",r.stopPropagation()):13===r.keyCode&&(r.preventDefault(),e.find(".tags-dropdown .selected").length?(i=$(".tags-dropdown .selected .tags-dropdown-name").text(),n.addNewTag(i,null)):n.addNewTag(n.newTag.name,n.newTag.color)),t.$apply()})},{link:t,scope:{permissions:"@",loadingAddTag:"=",loadingRemoveTag:"=",tags:"=",project:"=",onAddTag:"&",onDeleteTag:"&"},templateUrl:"components/tags/tag-line-common/tag-line-common.html",controller:"TagLineCommonCtrl",controllerAs:"vm",bindToController:!0}},e.directive("tgTagLineCommon",t)}.call(this),function(){var t,e,r;r=this.taiga.trim,e=angular.module("taigaCommon"),t=function(){function t(t,e,r){this.rootScope=t,this.confirm=e,this.modelTransform=r,this.loadingAddTag=!1}return t.$inject=["$rootScope","$tgConfirm","$tgQueueModelTransformation"],t.prototype.onDeleteTag=function(t){var e,n,i,o;return this.loadingRemoveTag=t[0],n=function(t){return function(e){return t.rootScope.$broadcast("object:updated"),t.loadingRemoveTag=!1,e}}(this),e=function(t){return function(){return t.confirm.notify("error"),t.loadingRemoveTag=!1}}(this),i=r(t[0].toLowerCase()),o=this.modelTransform.save(function(t){var e;return e=_.clone(t.tags),_.remove(e,function(t){return t[0]===i}),t.tags=e,t}),o.then(n,e)},t.prototype.onAddTag=function(t,e){var n,i,o;return this.loadingAddTag=!0,i=function(t){return function(e){return t.rootScope.$broadcast("object:updated"),t.addTag=!1,t.loadingAddTag=!1,e}}(this),n=function(t){return function(){return t.loadingAddTag=!1,t.confirm.notify("error")}}(this),o=this.modelTransform.save(function(n){return function(n){var i,o;return o=r(t.toLowerCase()),i=_.clone(n.tags),i.push([t,e]),n.tags=i,n}}(this)),o.then(i,n)},t}(),e.controller("TagLineCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){return{scope:{item:"=",permissions:"@",project:"="},templateUrl:"components/tags/tag-line-detail/tag-line-detail.html",controller:"TagLineCtrl",controllerAs:"vm",bindToController:!0}},e.directive("tgTagLine",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=angular.module("taigaCommon"),t=function(t){function e(){}return r(e,t),e.$inject=[],e.prototype.checkPermissions=function(t,e){return _.includes(t,e)},e.prototype.createColorsArray=function(t){return _.map(t,function(t,e){return[e,t]})},e}(taiga.Service),e.service("tgTagLineService",t)}.call(this),function(){var t,e;e=angular.module("taigaCommon"),t=function(){return{templateUrl:"components/tags/tag/tag.html",scope:{tag:"<",loadingRemoveTag:"<",onDeleteTag:"&",hasPermissions:"@"}}},e.directive("tgTag",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n,i){var o,s;return e.zoomIndex=t.get("taskboard_zoom")||2,e.levels=4,s=[["ref"],["subject"],["owner","tags","extra_info","unfold"],["attachments","empty_extra_info"],["related_tasks"]],o=function(e){return null==e&&(e=0),t.get("taskboard_zoom")!==e&&t.set("taskboard_zoom",e),_.reduce(s,function(t,r,n){return n<=e&&(t=t.concat(r)),t})},e.$watch("zoomIndex",function(t){var r;return r=o(t),e.onZoomChange({zoomLevel:t,zoom:r})})},{scope:{onZoomChange:"&"},template:'',link:e}},angular.module("taigaComponents").directive("tgTaskboardZoom",["$tgStorage",t])}.call(this),function(){var t;t=function(t,e,r,n,i){var o;return o=function(t,e,r){return t.privacyPolicyUrl=n.get("privacyPolicyUrl"),t.termsOfServiceUrl=n.get("termsOfServiceUrl"),t.GDPRUrl=n.get("GDPRUrl")},{restrict:"AE",scope:{},controllerAs:"vm",controller:function(){return this.close=function(){var n,o,s;return t.open=!1,o=r.getUser(),void 0===o.read_new_terms&&(s=o.getAttrs(),s.read_new_terms=!1,o=i.make_model("users",s)),o.read_new_terms=!0,n=function(t){return r.setUser(t)},e.save(o).then(n)},Object.defineProperties(this,{open:{get:function(){return t.open}}})},link:o,templateUrl:"components/terms-announcement/terms-announcement.html"}},t.$inject=["tgTermsAnnouncementService","$tgRepo","$tgAuth","$tgConfig","$tgModel"],angular.module("taigaComponents").directive("tgTermsAnnouncement",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(){this.open=!1}return e(r,t),r.prototype.show=function(){return this.open=!0},r}(taiga.Service),angular.module("taigaComponents").service("tgTermsAnnouncementService",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){return e.privacyPolicyUrl=t.get("privacyPolicyUrl"),e.termsOfServiceUrl=t.get("termsOfServiceUrl"),e.target=!1,e.privacyPolicyUrl&&e.termsOfServiceUrl||(e.target=!0),r.on("change","input[name='accepted_terms']",function(t){var r;return r=angular.element(t.currentTarget),e.target=r.is(":checked"),e.$apply()})},{restrict:"AE",link:e,scope:{target:"="},templateUrl:"components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.html"}},angular.module("taigaComponents").directive("tgTermsOfServiceAndPrivacyPolicyNotice",["$tgConfig",t])}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i){return r.vm={},r.vm.tribeHost=t.config.tribeHost,r.vm.url=e.protocol()+"://"+e.host(),"http"===e.protocol()&&80!==e.port()?r.vm.url=r.vm.url+":"+e.port():"https"===e.protocol()&&443!==e.port()?r.vm.url=r.vm.url+":"+e.port():void 0},{scope:{usId:"=",projectSlug:"="},controllerAs:"vm",templateUrl:"components/tribe-button/tribe-button.html",link:r}},t.$inject=["$tgConfig","$tgLocation"],angular.module("taigaComponents").directive("tgTribeButton",t); }.call(this),function(){var t;t=function(t){var e,r;return r=function(e,r,n){return e.vm={},e.vm.tribeHost=t.config.tribeHost,e.vm.show=function(){return e.vm.open=!0},e.vm.hide=function(t){return e.vm.open=!1}},e={templateUrl:"components/tribe-button/tribe-linked.html",scope:{gigTitle:"=",gigId:"="},link:r}},t.$inject=["$tgConfig"],angular.module("taigaComponents").directive("tgTribeLinked",t)}.call(this),function(){var t;t=function(){function t(t){this.currentUserService=t,this.user=this.currentUserService.getUser(),this.isMouseOver=!1,this.loading=!1}return t.$inject=["tgCurrentUserService"],t.prototype.showTextWhenMouseIsOver=function(){return this.isMouseOver=!0},t.prototype.showTextWhenMouseIsLeave=function(){return this.isMouseOver=!1},t.prototype.toggleVote=function(){var t;return this.loading=!0,t=this.item.is_voter?this._downvote():this._upvote(),t["finally"](function(t){return function(){return t.loading=!1}}(this)),t},t.prototype._upvote=function(){return this.onUpvote().then(function(t){return function(){return t.showTextWhenMouseIsLeave()}}(this))},t.prototype._downvote=function(){return this.onDownvote()},t}(),angular.module("taigaComponents").controller("VoteButton",t)}.call(this),function(){var t;t=function(){return{scope:{},controller:"VoteButton",bindToController:{item:"=",onUpvote:"=",onDownvote:"="},controllerAs:"vm",templateUrl:"components/vote-button/vote-button.html"}},angular.module("taigaComponents").directive("tgVoteButton",t)}.call(this),function(){var t;t=function(){function t(t,e){this.currentUserService=t,this.rootScope=e,this.user=this.currentUserService.getUser(),this.isMouseOver=!1,this.loading=!1}return t.$inject=["tgCurrentUserService","$rootScope"],t.prototype.showTextWhenMouseIsOver=function(){return this.isMouseOver=!0},t.prototype.showTextWhenMouseIsLeave=function(){return this.isMouseOver=!1},t.prototype.openWatchers=function(){return this.rootScope.$broadcast("watcher:add",this.item)},t.prototype.getPerms=function(){var t,e;return this.item?(t=this.item._name,e={userstories:"modify_us",issues:"modify_issue",tasks:"modify_task",epics:"modify_epic"},e[t]):""},t.prototype.toggleWatch=function(){var t;return this.loading=!0,t=this.item.is_watcher?this._unwatch():this._watch(),t["finally"](function(t){return function(){return t.loading=!1}}(this)),t},t.prototype._watch=function(){return this.onWatch().then(function(t){return function(){return t.showTextWhenMouseIsLeave()}}(this))},t.prototype._unwatch=function(){return this.onUnwatch()},t}(),angular.module("taigaComponents").controller("WatchButton",t)}.call(this),function(){var t;t=function(){return{scope:{},controller:"WatchButton",bindToController:{item:"=",onWatch:"=",onUnwatch:"="},controllerAs:"vm",templateUrl:function(t,e){return"components/watch-button/watch-button-"+e.environment+".html"}}},angular.module("taigaComponents").directive("tgWatchButton",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i,o;return i={epics:"epic",userstories:"us",issues:"issue",tasks:"task"},o=function(r,n){return t.addAttachment(e.vm.projectId,e.vm.comment.comment.id,i[e.vm.comment.comment._name],r,!0,!0).then(function(t){return n(t.getIn(["file","name"]),t.getIn(["file","url"]))})},e.uploadFiles=function(t,e){var r,n,i,s;for(s=[],n=0,i=t.length;n\n \n \n"}},angular.module("taigaComponents").directive("tgCommentEditWysiwyg",["tgAttachmentsFullService",t])}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i,o;return e.editableDescription=!1,e.saveComment=function(t,r){return e.content="",e.vm.type.comment=t,e.vm.onAddComment({callback:r})},i={epics:"epic",userstories:"us",issues:"issue",tasks:"task"},o=function(r,n){return t.addAttachment(e.vm.projectId,e.vm.type.id,i[e.vm.type._name],r,!0,!0).then(function(t){return n(t.getIn(["file","name"]),t.getIn(["file","url"]))})},e.onChange=function(t){return e.vm.type.comment=t},e.uploadFiles=function(t,e){var r,n,i,s;for(s=[],n=0,i=t.length;n\n \n \n"}},angular.module("taigaComponents").directive("tgCommentWysiwyg",["tgAttachmentsFullService",t])}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n){var i,o;return i={userstories:"us",issues:"issue",tasks:"task"},o=function(r,n){return t.addAttachment(e.vm.projectId,e.vm.comment.comment.id,i[e.vm.comment.comment._name],r).then(function(t){return n(t.getIn(["file","name"]),t.getIn(["file","url"]))})},e.uploadFiles=function(t,e){var r,n,i,s;for(s=[],n=0,i=t.length;n\n \n \n"}},angular.module("taigaComponents").directive("tgCustomFieldEditWysiwyg",["tgAttachmentsFullService",t])}.call(this),function(){var t;t=function(t,e,r,n,i){var o;return o=function(i,o,s){var a;return i.editableDescription=!1,i.saveDescription=function(n,i){var o;return o=t.save(function(t){return t.description=n,t}),o.then(function(){return r.notify("success"),e.$broadcast("object:updated")}),o.then(null,function(){return r.notify("error")}),o["finally"](i)},a=function(t,e){return n.addAttachment(i.project.id,i.item.id,s.type,t).then(function(t){return e(t.getIn(["file","name"]),t.getIn(["file","url"]))})},i.uploadFiles=function(t,e){var r,n,i,o;for(o=[],n=0,i=t.length;n\n \n \n\n \n\n \n {{'COMMON.DESCRIPTION.NO_DESCRIPTION' | translate}}\n \n"}},angular.module("taigaComponents").directive("tgItemWysiwyg",["$tgQueueModelTransformation","$rootScope","$tgConfirm","tgAttachmentsFullService","$translate",t])}.call(this),function(){var t;t=function(){function t(){Prism.plugins.customClass.prefix("prism-"),Prism.plugins.customClass.map({})}return t.prototype.getLanguages=function(){return new Promise(function(t){return function(e,r){return t.languages?e(t.languages):t.loadPromise?t.loadPromise.then(function(){return e(t.languages)}):t.loadPromise=$.getJSON("/"+window._version+"/prism/prism-languages.json").then(function(r){return t.loadPromise=null,t.languages=_.map(r,function(t){return t.url="/"+window._version+"/prism/"+t.file,t}),e(t.languages)})}}(this))},t.prototype.getLanguageInClassList=function(t){var e;return e=_.find(this.languages,function(e){return!!_.find(t,function(t){return"language-"+e.name===t})}),e?e.name:null},t.prototype.loadLanguage=function(t){return new Promise(function(e){return Prism.languages[t]?e():ljs.load("/"+window._version+"/prism/prism-"+t+".min.js",e)})},t.prototype.replaceCodeBrToNl=function(t){return $(t).find("br").replaceWith("\n")},t.prototype.hightlightCode=function(t){var e;if(this.replaceCodeBrToNl(t),e=this.getLanguageInClassList(t.classList))return this.loadLanguage(e).then(function(){return Prism.highlightElement(t)})},t.prototype.addHightlighter=function(t){var e;return e=$(t).find("code"),e.each(function(t){return function(e,r){return t.hightlightCode(r)}}(this))},t}(),angular.module("taigaComponents").service("tgWysiwygCodeHightlighterService",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n,i){return e.$watch("visible",function(n){return n&&!r.hasClass("open")?(e.open=!0,t.open(r,null,e.onClose),e.$applyAsync(function(){var t;if(t=r[0].querySelector("textarea"))return t.select()})):!n&&r.hasClass("open")?(e.open=!1,t.close(r)):void 0})},{scope:{languages:"<",codeLanguage:"<",code:"<",visible:"<",onClose:"&",onSave:"&"},link:e,templateUrl:"components/wysiwyg/wysiwyg-code-lightbox/wysiwyg-code-lightbox.html"}},angular.module("taigaComponents").directive("tgWysiwygCodeLightbox",["lightboxService",t])}.call(this),function(){var t;t=function(){function t(t,e,r,n){this.projectService=t,this.wysiwygService=e,this.navurls=r,this.rs=n,this.cancelablePromise=null}return t.$inject=["tgProjectService","tgWysiwygService","$tgNavUrls","$tgResources"],t.prototype.searchEmoji=function(t,e){var r;return r=this.wysiwygService.searchEmojiByName(t),r=r.slice(0,10),e(r)},t.prototype.searchUser=function(t,e){var r,n;return r=["username","full_name","full_name_display"],n=this.projectService.project.toJS().members.filter(function(e){return function(e){var n,i,o;for(n=0,i=r.length;n=0)return!0;if(e[o].indexOf(t)>=0)return!0}return!1}}(this)),n=n.slice(0,10).map(function(t){return function(e){return e.url=t.navurls.resolve("user-profile",{project:t.projectService.project.get("slug"),username:e.username}),e}}(this)),e(n)},t.prototype.searchItem=function(t){return new Promise(function(e){return function(r,n){var i,o,s,a;return t=taiga.slugify(t),s=["issues","tasks","userstories"],a={issues:"project-issues-detail",tasks:"project-tasks-detail",userstories:"project-userstories-detail"},o=["ref","subject"],i=function(e){var r,n,i;for(r=0,n=o.length;r=0)return!0;return!1},e.cancelablePromise&&e.cancelablePromise.abort(),e.cancelablePromise=e.rs.search["do"](e.projectService.project.get("id"),t),e.cancelablePromise.then(function(t){var n,o,c,u,l;if(t.count<1||t.count===t.wikipages.length)return r([]);for(u=[],n=0,c=s.length;n0&&(o=t[l].filter(i),o=o.map(function(t){return t.url=e.navurls.resolve(a[l],{project:e.projectService.project.get("slug"),ref:t.ref}),t}),u=u.concat(o));return u=_.sortBy(u,["ref"]),r(u.slice(0,10))})}}(this))},t.prototype.search=function(t){return new Promise(function(e){return function(r){return"#".indexOf(t[0])!==-1?e.searchItem(t.replace("#","")).then(r):"@".indexOf(t[0])!==-1?e.searchUser(t.replace("@",""),r):":".indexOf(t[0])!==-1?e.searchEmoji(t.replace(":",""),r):void 0}}(this))},t}(),angular.module("taigaComponents").service("tgWysiwygMentionService",t)}.call(this),function(){var t,e,r;r=this.taiga,e=this.taiga.bindOnce,t=function(t,e,n,i,o,s,a,c,u,l){var p,h,f,d,g,m,v,y,b,S,j,k;return k=function(){if(window.getSelection){if(window.getSelection().empty)return window.getSelection().empty()}else{if(window.getSelection().removeAllRanges)return window.getSelection().removeAllRanges();if(document.selection)return document.selection.empty()}},m=function(t){return $(t.endContainer).parentsUntil(".editor","code")},v=function(t){return!!m(t).length},j=function(t,e){var r,n,i;return r=$(t).is("code")?t:$(t).closest("code")[0],i=r.parentNode,n=document.createElement("p"),n.innerText=r.innerText,i.parentNode.replaceChild(n,i),e.checkContentChanged(e.elements[0])},d=function(t,e){var r,n,i,o;return i=document.createElement("pre"),r=document.createElement("code"),t.startContainer.parentNode.nextSibling||$("
").insertAfter(t.startContainer.parentNode),o=t.endContainer.parentNode.nextSibling,n=t.extractContents(),r.appendChild(n),i.appendChild(r),o.parentNode.insertBefore(i,o),S(e),e.checkContentChanged(e.elements[0])},S=function(e){var r,n,i,o,s,a,c,u,l,p;if(e){for(l=e.elements[0].children,r=0,i=l.length;rRTL",this.button.title="RTL",this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},handleClick:function(t){var e;return e=MediumEditor.selection.getSelectionRange(document),"right"===e.commonAncestorContainer.parentNode.style.textAlign?document.execCommand("justifyLeft",!1):document.execCommand("justifyRight",!1)}}),g=function(t){return'\n \n'},h=MediumEditor.extensions.button.extend({name:"code",init:function(){var t;return t=_.find(this.base.options.toolbar.buttons,function(t){return"code"===t.name}),this.button=this.document.createElement("button"),this.button.classList.add("medium-editor-action"),this.button.innerHTML=t.contentDefault||"Code",this.button.title="Code",this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},tagNames:["code"],handleClick:function(t){var e,r;if(e=MediumEditor.selection.getSelectionRange(self.document),v(e,this.base)?j(e.endContainer,this.base):(d(e,this.base),k()),r=this.base.getExtensionByName("toolbar"))return r.hideToolbar()}}),f=MediumEditor.extensions.paste.extend({doPaste:function(t,e,r){var n;return n=MediumEditor.util.htmlEntities(e),MediumEditor.util.insertHTMLCommand(this.document,n)}}),b=MediumEditor.util.isBlockContainer,MediumEditor.util.isBlockContainer=function(t){var e;return t?(e=t.tagName?t.tagName:t.parentNode.tagName,"code"===e.toLowerCase()||b(t)):b(t)},y=function(o,d,m){var v,y,b,k,I,E,T,C,P,w,A,O,R,M,U,N,D,L,x,F,B,H,q;return M=null,C=d.find(".medium"),T=d.find(".markdown"),k=null,A=!!m.$attr.editonly,U=!!m.$attr.notPersist,o.required=!!m.$attr.required,o.editMode=A||!1,o.mode=n.get("editor-mode","html"),o.markdown="",o.codeEditorVisible=!1,o.codeLans=[],a.getLanguages().then(function(t){return o.codeLans=t}),L=function(t){return o.editMode=t},x=function(t){var e;if(e=i.getHTML(t),C.html(e),a.addHightlighter(M.elements[0]),o.editMode)return S(M)},o.saveSnippet=function(t,e){var r;return o.codeEditorVisible=!1,k.innerText=e,r=k.parentNode,"remove-formating"===t?(k.className="",r.className="",j(k,M)):_.trim(e).length?(t?(k.className="language-"+t,r.className="language-"+t):(k.className="",r.className=""),a.hightlightCode(k),M.checkContentChanged(M.elements[0])):(k.parentNode.parentNode.removeChild(k.parentNode),M.checkContentChanged(M.elements[0])),F(),null},o.setMode=function(t){return n.set("editor-mode",t),"markdown"===t?H():x(o.markdown),o.mode=t,M.trigger("editableBlur",{},C[0])},o.save=function(t){t&&t.preventDefault(),"html"===o.mode&&H(),x(o.markdown),o.required&&!o.markdown.length||(o.saving=!0,o.outdated=!1,o.onSave({text:o.markdown,cb:D}))},o.cancel=function(t){t&&t.preventDefault(),A||L(!1),U?b():"html"===o.mode&&x(o.content||null),o.markdown=o.content,E(),M.trigger("blur",{},C[0]),o.outdated=!1,S(M),o.onCancel()},b=function(){return o.markdown="",C.html("")},D=function(){return o.saving=!1,A||L(!1),U&&b(),E(),M.trigger("blur",{},C[0]),u.trackEvent("develop","save wysiwyg",o.mode,1)},q=function(t,e){return r.isImage(t)?M.pasteHTML("
"):(t=$("
").text(t).html(),M.pasteHTML(""+t+"
"))},O=function(){var t;return t=n.get(o.storageKey),!(!t||!t.version||t.version===o.version)},w=function(){var t;return t=n.get(o.storageKey),!!t},P=function(){var t;return t=n.get(o.storageKey),t?t.text:o.content},E=function(){return n.remove(o.storageKey)},v=function(){var r,n;return o.content===o.markdown?(o.cancel(),document.activeElement.blur(),document.body.click(),null):(n=t.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE_TITLE"),r=t.instant("COMMON.CONFIRM_CLOSE_EDIT_MODE_MESSAGE"),e.ask(n,null,r).then(function(t){return o.cancel(),t.finish()}))},N=function(){var t;return t=$("
").html(C.html()),t.find("code br").replaceWith("\n"),t.html()},H=function(){var t;return t=N(),o.markdown=i.getMarkdown(t)},R=function(t){var e;if(o.storageKey)return e={},e.version=o.version||0,e.text=t,n.set(o.storageKey,e)},y=function(){return"html"===o.mode&&H(),R(o.markdown),o.onChange({markdown:o.markdown})},F=_.throttle(y,200),I=function(t,e){var r;return null==e&&(e=!1),t.length&&(r=i.getHTML(t),C.html(r)),M=new MediumEditor(C[0],{imageDragging:!1,placeholder:{text:o.placeholder},toolbar:{buttons:[{name:"bold",contentDefault:g("editor-bold")},{name:"italic",contentDefault:g("editor-italic")},{name:"strikethrough",contentDefault:g("editor-cross-out")},{name:"anchor",contentDefault:g("editor-link")},{name:"image",contentDefault:g("editor-image")},{name:"orderedlist",contentDefault:g("editor-list-n")},{name:"unorderedlist",contentDefault:g("editor-list-o")},{name:"h1",contentDefault:g("editor-h1")},{name:"h2",contentDefault:g("editor-h2")},{name:"h3",contentDefault:g("editor-h3")},{name:"quote",contentDefault:g("editor-quote")},{name:"removeFormat",contentDefault:g("editor-no-format")},{name:"rtl",contentDefault:g("editor-rtl")},{name:"code",contentDefault:g("editor-code")}]},extensions:{paste:new f,code:new h,autolist:new AutoList,alignright:new p,mediumMention:new MentionExtension({getItems:function(t,e){return c.search(t).then(e)}})}}),o.changeMarkdown=F,M.subscribe("editableInput",function(t){return o.$applyAsync(F)}),M.subscribe("editableClick",function(t){var e;if(e=new RegExp("^(?:[a-z]+:)?//","i"),t.target.href)return e.test(t.target.getAttribute("href"))||"_blank"===t.target.getAttribute("target")?(t.stopPropagation(),window.open(t.target.href)):l.url(t.target.href)}),M.subscribe("editableDrop",function(t){return o.onUploadFile({files:t.dataTransfer.files,cb:q})}),M.subscribe("editableKeydown",function(t){var e,r;return e=t.keyCode?t.keyCode:t.which,r=$(".medium-mention"),40!==e&&38!==e||!r.length?o.editMode&&27===e?(t.stopPropagation(),o.$applyAsync(v)):27===e?C.blur():void 0:(t.stopPropagation(),void t.preventDefault())}),L(e),o.$applyAsync(function(){return a.addHightlighter(M.elements[0]),S(M)})},$(C[0]).on("mousedown",function(t){return t.target.href?(t.preventDefault(),t.stopPropagation()):o.$applyAsync(function(){if(!o.editMode)return L(!0),S(M)})}),$(C[0]).on("dblclick","pre",function(t){return o.$applyAsync(function(){return o.codeEditorVisible=!0,k=t.currentTarget.querySelector("code"),o.currentCodeLanguage=a.getLanguageInClassList(k.classList),o.code=k.innerText})}),B=o.$watch("content",function(t){var e;if(!_.isUndefined(t)){if(o.outdated=O(),!M&&w()&&L(!0),(o.markdown.length||t.length)&&o.markdown===t)return;return t=P(),o.markdown=t,M&&M.destroy(),s.open()?e=s.onEnd(function(){return I(t,o.editMode),e()}):I(t,o.editMode),B()}}),o.$on("$destroy",function(){if(M)return C.length&&$(C[0]).off(),M.destroy()})},{templateUrl:"common/components/wysiwyg-toolbar.html",scope:{placeholder:"@",version:"<",storageKey:"<",content:"<",onCancel:"&",onSave:"&",onUploadFile:"&",onChange:"&"},link:y}},angular.module("taigaComponents").directive("tgWysiwyg",["$translate","$tgConfirm","$tgStorage","tgWysiwygService","animationFrame","tgLoader","tgWysiwygCodeHightlighterService","tgWysiwygMentionService","$tgAnalytics","$location",t])}.call(this),function(){var t;t=function(){function t(t,e,r,n){this.wysiwygCodeHightlighterService=t,this.projectService=e,this.navurls=r,this.emojis=n}return t.$inject=["tgWysiwygCodeHightlighterService","tgProjectService","$tgNavUrls","$tgEmojis"],t.prototype.searchEmojiByName=function(t){return this.emojis.searchByName(t)},t.prototype.pipeLinks=function(t){return t.replace(/\[\[(.*?)\]\]/g,function(t,e,r,n){var i,o,s;return o=e.split("|"),i=o[0],s=o[1]||o[0],"["+s+"]("+i+")"})},t.prototype.replaceUrls=function(t){var e,r,n,i,o;for(e=document.createElement("html"),e.innerHTML=t,o=e.querySelectorAll("a"),r=0,n=o.length;r(.*?)
<\/li>/g,"
  • $1
  • ")},t.prototype.getMarkdown=function(t){var e,r,n;return e={filter:["html","body","span","div"],replacement:function(t){return t}},r={filter:function(t){return function(t){return"PRE"===t.nodeName&&t.firstChild&&"CODE"===t.firstChild.nodeName}}(this),replacement:function(t){return function(e,r){var n;return n=t.wysiwygCodeHightlighterService.getLanguageInClassList(r.firstChild.classList),n||(n=""),"\n\n```"+n+"\n"+_.trim(r.firstChild.textContent)+"\n```\n\n"}}(this)},t=t.replace(/ (<\/.*>)/g,"$1"),t=this.emojis.replaceImgsByEmojiName(t),t=this.replaceUrls(t),t=this.removeTrailingListBr(t),n=toMarkdown(t,{gfm:!0,converters:[e,r]})},t.prototype.parseMentionMatches=function(t){var e,r,n,i,o,s,a;for(s="twitter",a=this.tagBuilder,r=[],o=/@[^\s]{1,50}[^.\s]/g,e=o.exec(t);null!==e;)n=e.index,i=t.charAt(n-1),e.index===o.lastIndex&&o.lastIndex++,e.forEach(function(t,e){return r.push(new Autolinker.match.Mention({tagBuilder:a,matchedText:t,offset:n,serviceName:s,mention:t.slice(1)}))}),e=o.exec(t);return r},t.prototype.autoLinkHTML=function(t){var e,r;return r=String(Autolinker.matcher.Mention.prototype.matcherRegexes.twitter),r.indexOf(".")===-1&&(r="@[^s]{1,50}[^.s]"),e=new Autolinker({mention:"twitter",hashtag:"twitter",replaceFn:function(t){return function(e){var r,n;return"mention"===e.getType()?(r=t.navurls.resolve("user-profile",{project:t.projectService.project.get("slug"),username:e.getMention()}),'@'+e.getMention()+""):"hashtag"===e.getType()?(n=t.navurls.resolve("project-detail-ref",{project:t.projectService.project.get("slug"),ref:e.getHashtag()}),'#'+e.getHashtag()+""):void 0}}(this)}),Autolinker.matcher.Mention.prototype.parseMatches=this.parseMentionMatches.bind(e),e.link(t)},t.prototype.getHTML=function(t){var e,r,n;return t&&t.length?(r={breaks:!0},t=this.emojis.replaceEmojiNameByImgs(t),t=this.pipeLinks(t),e=window.markdownit({breaks:!0}),e.use(window.markdownitLazyHeaders),n=e.render(t),n=this.searchWikiLinks(n),n=this.autoLinkHTML(n)):""},t}(),angular.module("taigaComponents").service("tgWysiwygService",t)}.call(this),function(){var t;t=function(){function t(t){this.translate=t,this.is_open=!1,this.texts={week:this.translate.instant("DISCOVER.FILTERS.WEEK"),month:this.translate.instant("DISCOVER.FILTERS.MONTH"),year:this.translate.instant("DISCOVER.FILTERS.YEAR"),all:this.translate.instant("DISCOVER.FILTERS.ALL_TIME")}}return t.$inject=["$translate"],t.prototype.currentText=function(){return this.texts[this.currentOrderBy]},t.prototype.open=function(){return this.is_open=!0},t.prototype.close=function(){return this.is_open=!1},t.prototype.orderBy=function(t){return this.currentOrderBy=t,this.is_open=!1,this.onChange({orderBy:this.currentOrderBy})},t}(),angular.module("taigaDiscover").controller("DiscoverHomeOrderBy",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{controller:"DiscoverHomeOrderBy",controllerAs:"vm",bindToController:!0,templateUrl:"discover/components/discover-home-order-by/discover-home-order-by.html",scope:{currentOrderBy:"=orderBy",onChange:"&"},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverHomeOrderBy",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"projects",function(t){return function(){return t.discoverProjectsService.projectsCount}}(this)),this.discoverProjectsService.fetchStats()}return t.$inject=["tgDiscoverProjectsService"],t.prototype.selectFilter=function(t){return this.onChange({filter:t,q:this.q})},t.prototype.submitFilter=function(){return this.onChange({filter:this.filter,q:this.q})},t}(),angular.module("taigaDiscover").controller("DiscoverSearchBar",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){},{controller:"DiscoverSearchBar",controllerAs:"vm",templateUrl:"discover/components/discover-search-bar/discover-search-bar.html",bindToController:!0,scope:{q:"=",filter:"=",onChange:"&"},compile:function(t,e){if(!e.q)return e.q=""},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverSearchBar",t)}.call(this),function(){var t;t=function(){function t(){this.like_is_open=0===this.orderBy.indexOf("-total_fans"),this.activity_is_open=0===this.orderBy.indexOf("-total_activity")}return t.$inject=[],t.prototype.openLike=function(){return this.like_is_open=!0,this.activity_is_open=!1,this.setOrderBy("-total_fans_last_week")},t.prototype.openActivity=function(){return this.activity_is_open=!0,this.like_is_open=!1,this.setOrderBy("-total_activity_last_week")},t.prototype.setOrderBy=function(t){return null==t&&(t=""),t||(this.like_is_open=!1,this.activity_is_open=!1),this.onChange({orderBy:t})},t}(),angular.module("taigaDiscover").controller("DiscoverSearchListHeader",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{controller:"DiscoverSearchListHeader",controllerAs:"vm",bindToController:!0,templateUrl:"discover/components/discover-search-list-header/discover-search-list-header.html",scope:{onChange:"&",orderBy:"="},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverSearchListHeader",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"featured",function(t){return function(){return t.discoverProjectsService.featured}}(this)),this.discoverProjectsService.fetchFeatured()}return t.$inject=["tgDiscoverProjectsService"],t}(),angular.module("taigaDiscover").controller("FeaturedProjects",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r){},{controller:"FeaturedProjects",controllerAs:"vm",templateUrl:"discover/components/featured-projects/featured-projects.html",scope:{},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgFeaturedProjects",t)}.call(this),function(){var t;t=function(){return{templateUrl:"discover/components/highlighted/highlighted.html",scope:{loading:"=",highlighted:"=",orderBy:"="}}},t.$inject=[],angular.module("taigaDiscover").directive("tgHighlighted",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"highlighted",function(t){return function(){return t.discoverProjectsService.mostActive}}(this)),this.currentOrderBy="week",this.order_by=this.getOrderBy()}return t.$inject=["tgDiscoverProjectsService"],t.prototype.fetch=function(){return this.loading=!0,this.order_by=this.getOrderBy(),this.discoverProjectsService.fetchMostActive({order_by:this.order_by}).then(function(t){return function(){return t.loading=!1}}(this))},t.prototype.orderBy=function(t){return this.currentOrderBy=t,this.fetch()},t.prototype.getOrderBy=function(t){return"all"===this.currentOrderBy?"-total_activity":"-total_activity_last_"+this.currentOrderBy},t}(),angular.module("taigaDiscover").controller("MostActive",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.fetch()},{controller:"MostActive",controllerAs:"vm",templateUrl:"discover/components/most-active/most-active.html",scope:{},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgMostActive",t)}.call(this),function(){var t;t=function(){function t(t){this.discoverProjectsService=t,taiga.defineImmutableProperty(this,"highlighted",function(t){return function(){return t.discoverProjectsService.mostLiked}}(this)),this.currentOrderBy="week",this.order_by=this.getOrderBy()}return t.$inject=["tgDiscoverProjectsService"],t.prototype.fetch=function(){return this.loading=!0,this.order_by=this.getOrderBy(),this.discoverProjectsService.fetchMostLiked({order_by:this.order_by}).then(function(t){return function(){return t.loading=!1}}(this))},t.prototype.orderBy=function(t){return this.currentOrderBy=t,this.fetch()},t.prototype.getOrderBy=function(){return"all"===this.currentOrderBy?"-total_fans":"-total_fans_last_"+this.currentOrderBy},t}(),angular.module("taigaDiscover").controller("MostLiked",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.fetch()},{controller:"MostLiked",controllerAs:"vm",templateUrl:"discover/components/most-liked/most-liked.html",scope:{},link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgMostLiked",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n){var i,o;this.location=t,this.navUrls=e,this.appMetaService=r,this.translate=n,o=this.translate.instant("DISCOVER.PAGE_TITLE"),i=this.translate.instant("DISCOVER.PAGE_DESCRIPTION"),this.appMetaService.setAll(o,i)}return t.$inject=["$tgLocation","$tgNavUrls","tgAppMetaService","$translate"],t.prototype.onSubmit=function(t){var e;return e=this.navUrls.resolve("discover-search"),this.location.search("text",t).path(e)},t}(),angular.module("taigaDiscover").controller("DiscoverHome",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n,i,o,s){var a,c;this.routeParams=t,this.discoverProjectsService=e,this.route=r,this.location=n,this.analytics=i,this.appMetaService=o,this.translate=s,this.page=1,taiga.defineImmutableProperty(this,"searchResult",function(t){return function(){return t.discoverProjectsService.searchResult}}(this)),taiga.defineImmutableProperty(this,"nextSearchPage",function(t){return function(){return t.discoverProjectsService.nextSearchPage}}(this)),this.q=this.routeParams.text,this.filter=this.routeParams.filter||"all",this.orderBy=this.routeParams.order_by||"",this.loadingGlobal=!1,this.loadingList=!1,this.loadingPagination=!1,c=this.translate.instant("DISCOVER.SEARCH.PAGE_TITLE"), a=this.translate.instant("DISCOVER.SEARCH.PAGE_DESCRIPTION"),this.appMetaService.setAll(c,a),this.analytics.trackPage(this.location.url(),"Discover Search")}return t.$inject=["$routeParams","tgDiscoverProjectsService","$route","$tgLocation","$tgAnalytics","tgAppMetaService","$translate"],t.prototype.fetch=function(){return this.page=1,this.discoverProjectsService.resetSearchList(),this.search()},t.prototype.fetchByGlobalSearch=function(){if(!this.loadingGlobal)return this.loadingGlobal=!0,this.fetch().then(function(t){return function(){return t.loadingGlobal=!1}}(this))},t.prototype.fetchByOrderBy=function(){if(!this.loadingList)return this.loadingList=!0,this.fetch().then(function(t){return function(){return t.loadingList=!1}}(this))},t.prototype.showMore=function(){if(!this.loadingPagination)return this.loadingPagination=!0,this.page++,this.search().then(function(t){return function(){return t.loadingPagination=!1}}(this))},t.prototype.search=function(){var t,e;return t=this.getFilter(),e={page:this.page,q:this.q,order_by:this.orderBy},_.assign(e,t),this.discoverProjectsService.fetchSearch(e)},t.prototype.getFilter=function(){return"people"===this.filter?{is_looking_for_people:!0}:"scrum"===this.filter?{is_backlog_activated:!0}:"kanban"===this.filter?{is_kanban_activated:!0}:{}},t.prototype.onChangeFilter=function(t,e){return this.filter=t,this.q=e,this.route.updateParams({filter:this.filter,text:this.q}),this.analytics.trackPage(this.location.url(),"Discover Search"),this.fetchByGlobalSearch()},t.prototype.onChangeOrder=function(t){return this.orderBy=t,this.route.updateParams({order_by:t}),this.analytics.trackPage(this.location.url(),"Discover Search"),this.fetchByOrderBy()},t}(),angular.module("taigaDiscover").controller("DiscoverSearch",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){return n.fetch()},{controller:"DiscoverSearch",controllerAs:"vm",link:t}},t.$inject=[],angular.module("taigaDiscover").directive("tgDiscoverSearch",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga,t=function(t){function n(t,r){this.rs=t,this.projectsService=r,this._mostLiked=Immutable.List(),this._mostActive=Immutable.List(),this._featured=Immutable.List(),this._searchResult=Immutable.List(),this._projectsCount=0,this.decorate=this.projectsService._decorate.bind(this.projectsService),e.defineImmutableProperty(this,"mostLiked",function(t){return function(){return t._mostLiked}}(this)),e.defineImmutableProperty(this,"mostActive",function(t){return function(){return t._mostActive}}(this)),e.defineImmutableProperty(this,"featured",function(t){return function(){return t._featured}}(this)),e.defineImmutableProperty(this,"searchResult",function(t){return function(){return t._searchResult}}(this)),e.defineImmutableProperty(this,"nextSearchPage",function(t){return function(){return t._nextSearchPage}}(this)),e.defineImmutableProperty(this,"projectsCount",function(t){return function(){return t._projectsCount}}(this))}var i;return r(n,t),n.$inject=["tgResources","tgProjectsService"],i={discover_mode:!0},n.prototype.fetchMostLiked=function(t){var e;return e=_.extend({},i,t),this.rs.projects.getProjects(e,!1).then(function(t){return function(e){var r,n;return r=e.data.slice(0,5),n=Immutable.fromJS(r),n=n.map(t.decorate),t._mostLiked=n}}(this))},n.prototype.fetchMostActive=function(t){var e;return e=_.extend({},i,t),this.rs.projects.getProjects(e,!1).then(function(t){return function(e){var r,n;return r=e.data.slice(0,5),n=Immutable.fromJS(r),n=n.map(t.decorate),t._mostActive=n}}(this))},n.prototype.fetchFeatured=function(){var t;return t=_.extend({},i),t.is_featured=!0,this.rs.projects.getProjects(t,!1).then(function(t){return function(e){var r,n;return r=e.data.slice(0,4),n=Immutable.fromJS(r),n=n.map(t.decorate),t._featured=n}}(this))},n.prototype.resetSearchList=function(){return this._searchResult=Immutable.List()},n.prototype.fetchStats=function(){return this.rs.stats.discover().then(function(t){return function(e){return t._projectsCount=e.getIn(["projects","total"])}}(this))},n.prototype.fetchSearch=function(t){var e;return e=_.extend({},i,t),this.rs.projects.getProjects(e).then(function(t){return function(e){var r;return t._nextSearchPage=!!e.headers("X-Pagination-Next"),r=Immutable.fromJS(e.data),r=r.map(t.decorate),t._searchResult=t._searchResult.concat(r)}}(this))},n}(e.Service),angular.module("taigaDiscover").service("tgDiscoverProjectsService",t)}.call(this),function(){var t,e,r,n;r=this.taiga,n=r.trim,e=r.getRandomDefaultColor,t=function(){function t(t,r,n,i){this.confirm=t,this.projectService=r,this.epicsService=n,this.analytics=i,this.project=this.projectService.project.toJS(),this.newEpic={color:e(),status:this.project.default_epic_status,tags:[]},this.attachments=Immutable.List(),this.loading=!1}return t.$inject=["$tgConfirm","tgProjectService","tgEpicsService","$tgAnalytics"],t.prototype.createEpic=function(){if(this.validateForm())return this.loading=!0,this.epicsService.createEpic(this.newEpic,this.attachments).then(function(t){return function(e){return t.analytics.trackEvent("epic","create","create epic",1),t.onCreateEpic(),t.loading=!1}}(this))["catch"](function(t){return function(e){if(t.loading=!1,t.setFormErrors(e.data),e.data._error_message)return t.confirm.notify("error",e.data._error_message)}}(this))},t.prototype.selectColor=function(t){return this.newEpic.color=t},t.prototype.addTag=function(t,e){if(t=n(t.toLowerCase()),!_.find(this.newEpic.tags,function(e){return e[0]===t}))return this.newEpic.tags.push([t,e])},t.prototype.deleteTag=function(t){return _.remove(this.newEpic.tags,function(e){return e[0]===t[0]})},t.prototype.addAttachment=function(t){return this.attachments.push(t)},t}(),angular.module("taigaEpics").controller("CreateEpicCtrl",t)}.call(this),function(){var t;t=function(){var t;return t=function(t,e,r,n){var i;return i=e.find("form").checksley(),n.validateForm=function(t){return function(){return i.validate()}}(this),n.setFormErrors=function(t){return function(t){return i.setErrors(t)}}(this)},{link:t,templateUrl:"epics/create-epic/create-epic.html",controller:"CreateEpicCtrl",controllerAs:"vm",bindToController:{onCreateEpic:"&"},scope:{}}},angular.module("taigaEpics").directive("tgCreateEpic",t)}.call(this),function(){var t;t=function(){function t(t,e,r){this.confirm=t,this.projectService=e,this.epicsService=r,this.displayUserStories=!1,this.displayAssignedTo=!1,this.displayStatusList=!1,this.loadingStatus=!1,this.project=this.projectService.project.toJS(),this._calculateProgressBar()}return t.$inject=["$tgConfirm","tgProjectService","tgEpicsService"],t.prototype._calculateProgressBar=function(){var t,e;return this.epic.getIn(["status_extra_info","is_closed"])===!0?this.percentage="100%":(t=this.epic.getIn(["user_stories_counts","progress"]),e=this.epic.getIn(["user_stories_counts","total"]),0===e?this.percentage="0%":this.percentage=100*t/e+"%")},t.prototype.canEditEpics=function(){return this.projectService.hasPermission("modify_epic")},t.prototype.toggleUserStoryList=function(){return this.displayUserStories?this.displayUserStories=!1:this.epicsService.listRelatedUserStories(this.epic).then(function(t){return function(e){return t.epicStories=e,t.displayUserStories=!0}}(this))["catch"](function(t){return function(){return t.confirm.notify("error")}}(this))},t.prototype.updateStatus=function(t){return this.displayStatusList=!1,this.loadingStatus=!0,this.epicsService.updateEpicStatus(this.epic,t)["catch"](function(t){return function(){return t.confirm.notify("error")}}(this))["finally"](function(t){return function(){return t.loadingStatus=!1}}(this))},t.prototype.updateAssignedTo=function(t){return this.assignLoader=!0,this.epicsService.updateEpicAssignedTo(this.epic,(null!=t?t.id:void 0)||null)["catch"](function(t){return function(){return t.confirm.notify("error")}}(this)).then(function(t){return function(){return t.assignLoader=!1}}(this))},t}(),angular.module("taigaEpics").controller("EpicRowCtrl",t)}.call(this),function(){var t;t=function(){return{templateUrl:"epics/dashboard/epic-row/epic-row.html",controller:"EpicRowCtrl",controllerAs:"vm",bindToController:!0,scope:{epic:"=",column:"="}}},angular.module("taigaEpics").directive("tgEpicRow",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r,n,i,o,s,a,c,u){this.params=t,this.errorHandlingService=r,this.lightboxFactory=n,this.lightboxService=i,this.confirm=o,this.projectService=s,this.epicsService=a,this.appMetaService=c,this.translate=u,this.sectionName="EPICS.SECTION_NAME",e.defineImmutableProperty(this,"project",function(t){return function(){return t.projectService.project}}(this)),e.defineImmutableProperty(this,"epics",function(t){return function(){return t.epicsService.epics}}(this)),this.appMetaService.setfn(this._setMeta.bind(this))}return t.$inject=["$routeParams","tgErrorHandlingService","tgLightboxFactory","lightboxService","$tgConfirm","tgProjectService","tgEpicsService","tgAppMetaService","$translate"],t.prototype._setMeta=function(){var t;return this.project?(t={projectName:this.project.get("name"),projectDescription:this.project.get("description")},{title:this.translate.instant("EPICS.PAGE_TITLE",t),description:this.translate.instant("EPICS.PAGE_DESCRIPTION",t)}):null},t.prototype.loadInitialData=function(){return this.epicsService.clear(),this.projectService.setProjectBySlug(this.params.pslug).then(function(t){return function(){return t.projectService.isEpicsDashboardEnabled()?t.projectService.hasPermission("view_epics")?t.epicsService.fetchEpics():t.errorHandlingService.permissionDenied():t.errorHandlingService.notFound()}}(this))},t.prototype.canCreateEpics=function(){return this.projectService.hasPermission("add_epic")},t.prototype.onCreateEpic=function(){var t;return t=function(t){return function(){t.lightboxService.closeAll(),t.confirm.notify("success")}}(this),this.lightboxFactory.create("tg-create-epic",{"class":"lightbox lightbox-create-epic open","on-create-epic":"onCreateEpic()"},{onCreateEpic:t.bind(this)})},t}(),angular.module("taigaEpics").controller("EpicsDashboardCtrl",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i){var o,s,a;if(e.hasPermission("modify_epic"))return o=t(i.tgEpicsSortable),s=dragula([n[0]],{copySortSource:!1,copy:!1,mirrorContainer:n[0],moves:function(t){return $(t).is("div.epics-table-body-row")}}),s.on("dragend",function(t){var e,n,i;return n=$(t),e=n.scope().epic,i=n.index(),r.$apply(function(){return o(r,{epic:e,newIndex:i})})}),a=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&s.dragging}}),r.$on("$destroy",function(){return n.off(),s.destroy()})},{link:r}},t.$inject=["$parse","tgProjectService"],angular.module("taigaComponents").directive("tgEpicsSortable",t)}.call(this),function(){var t,e,r;r=this.taiga,e=this.taiga.generateHash,t=function(){function t(t,n,i,o,s){this.confirm=t,this.epicsService=n,this.timeout=i,this.storage=o,this.projectService=s,this.hash=e([this.projectService.project.get("id"),"epics"]),this.displayOptions=!1,this.displayVotes=!0,this.column=this.storage.get(this.hash,{votes:!0,name:!0,project:!0,sprint:!0,assigned:!0,status:!0,progress:!0}),r.defineImmutableProperty(this,"epics",function(t){return function(){return t.epicsService.epics}}(this)),r.defineImmutableProperty(this,"disabledEpicsPagination",function(t){return function(){return t.epicsService._disablePagination}}(this)),r.defineImmutableProperty(this,"loadingEpics",function(t){return function(){return t.epicsService._loadingEpics}}(this))}return t.$inject=["$tgConfirm","tgEpicsService","$timeout","$tgStorage","tgProjectService"],t.prototype.toggleEpicTableOptions=function(){return this.displayOptions=!this.displayOptions},t.prototype.reorderEpic=function(t,e){return t.get("epics_order")===e?null:this.epicsService.reorderEpic(t,e).then(null,function(t){return function(){return t.confirm.notify("error")}}(this))},t.prototype.nextPage=function(){return this.epicsService.nextPage()},t.prototype.hoverEpicTableOption=function(){if(this.timer)return this.timeout.cancel(this.timer)},t.prototype.hideEpicTableOption=function(){return this.timer=this.timeout(function(t){return function(){return t.displayOptions=!1}}(this),400)},t.prototype.updateViewOptions=function(){return this.storage.set(this.hash,this.column)},t}(),angular.module("taigaEpics").controller("EpicsTableCtrl",t)}.call(this),function(){var t;t=function(){return{templateUrl:"epics/dashboard/epics-table/epics-table.html",controller:"EpicsTableCtrl",controllerAs:"vm",scope:{}}},angular.module("taigaEpics").directive("tgEpicsTable",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(){this._calculateProgressBar()}return t.$inject=[],t.prototype._calculateProgressBar=function(){var t,e;return this.story.get("is_closed")===!0?this.percentage="100%":(t=this.story.get("tasks").size,e=this.story.get("tasks").filter(function(t){return t.get("is_closed")}).size,0===t?this.percentage="0%":this.percentage=100*e/t+"%")},t}(),e.controller("StoryRowCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){return{templateUrl:"epics/dashboard/story-row/story-row.html",controller:"StoryRowCtrl",controllerAs:"vm",bindToController:!0,scope:{story:"=",column:"="}}},e.directive("tgStoryRow",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r,n,i){this.projectService=t,this.attachmentsService=r,this.resources=n,this.xhrError=i,this.clear(),e.defineImmutableProperty(this,"epics",function(t){return function(){return t._epics}}(this))}return t.$inject=["tgProjectService","tgAttachmentsService","tgResources","tgXhrErrorService"],t.prototype.clear=function(){return this._loadingEpics=!1,this._disablePagination=!1,this._page=1,this._epics=Immutable.List()},t.prototype.fetchEpics=function(t){return null==t&&(t=!1),this._loadingEpics=!0,this._disablePagination=!0,this.resources.epics.list(this.projectService.project.get("id"),this._page).then(function(e){return function(r){return t?(e.clear(),e._epics=r.list):e._epics=e._epics.concat(r.list),e._loadingEpics=!1,e._disablePagination=!r.headers("x-pagination-next")}}(this))["catch"](function(t){return function(e){return t.xhrError.response(e)}}(this))},t.prototype.nextPage=function(){return this._page++,this.fetchEpics()},t.prototype.listRelatedUserStories=function(t){return this.resources.userstories.listInEpic(t.get("id"))},t.prototype.createEpic=function(t,e){return t.project=this.projectService.project.get("id"),this.resources.epics.post(t).then(function(t){return function(r){var n;return n=_.map(e.toJS(),function(e){return t.attachmentsService.upload(e.file,r.get("id"),r.get("project"),"epic")}),Promise.all(n).then(t.fetchEpics.bind(t,!0))}}(this))},t.prototype.reorderEpic=function(t,e){var r,n,i,o,s,a,c,u,l;return s={},this._epics.forEach(function(t){return s[t.get("id")]=t.get("epics_order")}),l=this.epics.filter(function(e){return function(e){return e.get("id")!==t.get("id")}}(this)),n=l.slice(0,e),r=l.slice(e),a=n.last(),o=a?a.get("epics_order")+1:0,s[t.get("id")]=o,c=n.filter(function(t){return function(t){return t.get("epics_order")===a.get("epics_order")}}(this)),u=_.fromPairs(c.map(function(t){return function(t){return[t.get("id"),t.get("epics_order")]}}(this)).toJS()),r.forEach(function(t){return s[t.get("id")]=t.get("epics_order")+1}),this._epics=this._epics.map(function(t){return t.set("epics_order",s[t.get("id")])}),this._epics=this._epics.sortBy(function(t){return t.get("epics_order")}),i={epics_order:o,version:t.get("version")},this.resources.epics.reorder(t.get("id"),i,u).then(function(t){return function(e){return t._epics=t._epics.map(function(t){return t.get("id")===e.get("id")?e:t})}}(this))},t.prototype.reorderRelatedUserstory=function(t,e,r,n){var i,o,s,a,c,u,l,p,h;return h=e.filter(function(t){return function(t){return t.get("id")!==r.get("id")}}(this)),i=h.slice(0,n),c=i.last(),a=c?c.get("epic_order")+1:0,u=i.filter(function(t){return function(t){return t.get("epic_order")===c.get("epic_order")}}(this)),l=_.fromPairs(u.map(function(t){return function(t){return[t.get("id"),t.get("epic_order")]}}(this)).toJS()),o={order:a},s=t.get("id"),p=r.get("id"),this.resources.epics.reorderRelatedUserstory(s,p,o,l).then(function(e){return function(){return e.listRelatedUserStories(t)}}(this))},t.prototype.replaceEpic=function(t){return this._epics=this._epics.map(function(e){return e.get("id")===t.get("id")?t:e})},t.prototype.updateEpicStatus=function(t,e){var r;return r={status:e,version:t.get("version")},this.resources.epics.patch(t.get("id"),r).then(this.replaceEpic.bind(this))},t.prototype.updateEpicAssignedTo=function(t,e){var r;return r={assigned_to:e,version:t.get("version")},this.resources.epics.patch(t.get("id"),r).then(this.replaceEpic.bind(this))},t}(),angular.module("taigaEpics").service("tgEpicsService",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(t,e){this.projectService=t,this.epicsService=e,this.sectionName="Epics",this.showCreateRelatedUserstoriesLightbox=!1}return t.$inject=["tgProjectService","tgEpicsService"],t.prototype.showRelatedUserStoriesSection=function(){var t;return this.projectService.hasPermission("view_epics")||(null!=(t=this.userstories)?t.length:void 0)>0},t.prototype.userCanSort=function(){return this.projectService.hasPermission("modify_epic")},t.prototype.loadRelatedUserstories=function(){return this.epicsService.listRelatedUserStories(this.epic).then(function(t){return function(e){return t.userstories=e}}(this))},t.prototype.reorderRelatedUserstory=function(t,e){return this.epicsService.reorderRelatedUserstory(this.epic,this.userstories,t,e).then(function(t){return function(e){return t.userstories=e}}(this))},t}(),e.controller("RelatedUserStoriesCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(t,e,r,n){this.currentUserService=t,this.rs=e,this.confirm=r,this.analytics=n,this.projects=null,this.projectUserstories=Immutable.List(),this.loading=!1}return t.$inject=["tgCurrentUserService","tgResources","$tgConfirm","$tgAnalytics"],t.prototype.loadProjects=function(){if(null===this.projects)return this.projects=this.currentUserService.projects.get("all")},t.prototype.filterUss=function(t,e){var r;return r=this.rs.userstories.listInAllProjects({project:t,q:e},!0).then(function(t){return function(e){var r,n;return r=t.epicUserstories.map(function(t){return t.get("id")}),n=e.filter(function(t){return r.indexOf(t.get("id"))===-1}),t.projectUserstories=n}}(this))},t.prototype.saveRelatedUserStory=function(t,e){var r,n,i;if(this.validateExistingUserstoryForm())return this.loading=!0,n=function(t){return function(e){return t.loading=!1,t.confirm.notify("error"),t.setExistingUserstoryFormErrors(e)}}(this),i=function(t){return function(){return t.analytics.trackEvent("epic related user story","create","create related user story on epic",1),t.loading=!1,e&&e(),t.loadRelatedUserstories()}}(this),r=this.epic.get("id"),this.rs.epics.addRelatedUserstory(r,t).then(i,n)},t.prototype.bulkCreateRelatedUserStories=function(t,e,r){var n,i,o;if(this.validateNewUserstoryForm())return this.loading=!0,i=function(t){return function(e){return t.loading=!1,t.confirm.notify("error"),t.setNewUserstoryFormErrors(e)}}(this),o=function(t){return function(){return t.analytics.trackEvent("epic related user story","create","create related user story on epic",1),t.loading=!1,r&&r(),t.loadRelatedUserstories()}}(this),n=this.epic.get("id"),this.rs.epics.bulkCreateRelatedUserStories(n,t,e).then(o,i)},t}(),e.controller("RelatedUserstoriesCreateCtrl",t)}.call(this),function(){var t,e,r;r=angular.module("taigaEpics"),e=this.taiga.debounceLeading,t=function(t){var r;return this.lightboxService=t,r=function(t,r,n,i){var o,s;return s=r.find(".new-user-story-form").checksley(),o=r.find(".existing-user-story-form").checksley(),i.validateNewUserstoryForm=function(t){return function(){return s.validate()}}(this),i.setNewUserstoryFormErrors=function(t){return function(t){return s.setErrors(t)}}(this),i.validateExistingUserstoryForm=function(t){return function(){return o.validate()}}(this),i.setExistingUserstoryFormErrors=function(t){return function(t){return o.setErrors(t)}}(this),t.showLightbox=function(e){return i.loadProjects(),t.selectProject(e).then(function(t){return function(){return lightboxService.open(r.find(".lightbox-create-related-user-stories"))}}(this))},t.closeLightbox=function(){return t.selectedUserstory=null,t.searchUserstory="",t.relatedUserstoriesText="",lightboxService.close(r.find(".lightbox-create-related-user-stories"))},t.$watch("vm.project",function(e){if(null!=e)return t.selectedProject=e.get("id")}),t.selectProject=function(e){return t.selectedUserstory=null,t.searchUserstory="",i.filterUss(e,t.searchUserstory)},t.onUpdateSearchUserstory=e(300,function(){return t.selectedUserstory=null,i.filterUss(t.selectedProject,t.searchUserstory)})},{link:r,templateUrl:"epics/related-userstories/related-userstories-create/related-userstories-create.html",controller:"RelatedUserstoriesCreateCtrl",controllerAs:"vm",bindToController:!0,scope:{showCreateRelatedUserstoriesLightbox:"=",project:"=",epic:"=",epicUserstories:"=",loadRelatedUserstories:"&"}}},t.$inject=["lightboxService"],r.directive("tgRelatedUserstoriesCreate",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(t,e){var r;return r=function(r,n,i){var o,s,a;if(e.hasPermission("modify_epic"))return o=t(i.tgRelatedUserstoriesSortable),s=dragula([n[0]],{copySortSource:!1,copy:!1,mirrorContainer:n[0],moves:function(t){return $(t).is("tg-related-userstory-row")}}),s.on("dragend",function(t){var e,n,i;return e=$(t),i=e.scope().us,n=e.index(),r.$apply(function(){return o(r,{us:i,newIndex:n})})}),a=autoScroll(window,{margin:20,pixels:30,scrollWhenOutside:!0,autoScroll:function(){return this.down&&s.dragging}}),r.$on("$destroy",function(){return n.off(),s.destroy()})},{link:r}},t.$inject=["$parse","tgProjectService"],e.directive("tgRelatedUserstoriesSortable",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){return{templateUrl:"epics/related-userstories/related-userstories.html",controller:"RelatedUserStoriesCtrl",controllerAs:"vm",bindToController:!0,scope:{userstories:"=",project:"=",epic:"="}}},t.$inject=[],e.directive("tgRelatedUserstories",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){function t(t,e,r,n){this.avatarService=t,this.translate=e,this.confirm=r,this.rs=n}return t.$inject=["tgAvatarService","$translate","$tgConfirm","tgResources"],t.prototype.setAvatarData=function(){var t;return t=this.userstory.get("assigned_to_extra_info"),this.avatar=this.avatarService.getAvatar(t)},t.prototype.getAssignedToFullNameDisplay=function(){return this.userstory.get("assigned_to")?this.userstory.getIn(["assigned_to_extra_info","full_name_display"]):this.translate.instant("COMMON.ASSIGNED_TO.NOT_ASSIGNED")},t.prototype.onDeleteRelatedUserstory=function(){var t,e;return e=this.translate.instant("EPIC.TITLE_LIGHTBOX_UNLINK_RELATED_USERSTORY"),t=this.translate.instant("EPIC.MSG_LIGHTBOX_UNLINK_RELATED_USERSTORY",{subject:this.userstory.get("subject")}),this.confirm.askOnDelete(e,t).then(function(e){return function(r){var n,i,o,s;return i=function(){return t=e.translate.instant("EPIC.ERROR_UNLINK_RELATED_USERSTORY",{errorMessage:t}),e.confirm.notify("error",null,t),r.finish(!1)},o=function(){return e.loadRelatedUserstories(),r.finish()},n=e.epic.get("id"),s=e.userstory.get("id"),e.rs.epics.deleteRelatedUserstory(n,s).then(o,i)}}(this))},t}(),e.controller("RelatedUserstoryRowCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaEpics"),t=function(){var t;return t=function(t,e,r,n){return n.setAvatarData()},{link:t,templateUrl:"epics/related-userstories/related-userstory-row/related-userstory-row.html",controller:"RelatedUserstoryRowCtrl",controllerAs:"vm",bindToController:!0,scope:{userstory:"=",epic:"=",project:"=",loadRelatedUserstories:"&"}}},t.$inject=[],e.directive("tgRelatedUserstoryRow",t)}.call(this),function(){var t,e,r=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;e=this.taiga,t=function(t){function i(t,n,i,o,s,a,c,u){var l,p;this.routeParams=t,this.externalAppsService=n,this.window=i,this.currentUserService=o,this.location=s,this.navUrls=a,this.xhrError=c,this.loader=u,this.createApplicationToken=r(this.createApplicationToken,this),this._getApplicationToken=r(this._getApplicationToken,this),this._redirect=r(this._redirect,this),this.loader.start(!1),this._applicationId=this.routeParams.application,this._state=this.routeParams.state,this._getApplicationToken(),this._user=this.currentUserService.getUser(),this._application=null,p=encodeURIComponent(this.location.url()),l=this.navUrls.resolve("login"),this.loginWithAnotherUserUrl=l+"?next="+p,e.defineImmutableProperty(this,"user",function(t){return function(){return t._user}}(this)),e.defineImmutableProperty(this,"application",function(t){return function(){return t._application}}(this))}return n(i,t),i.$inject=["$routeParams","tgExternalAppsService","$window","tgCurrentUserService","$location","$tgNavUrls","tgXhrErrorService","tgLoader"],i.prototype._redirect=function(t){var e;return e=t.get("next_url"),this.window.open(e,"_self")},i.prototype._getApplicationToken=function(){return this.externalAppsService.getApplicationToken(this._applicationId,this._state).then(function(t){return function(e){return t._application=e.get("application"),e.get("auth_code")?t._redirect(e):t.loader.pageLoaded()}}(this))["catch"](function(t){return function(e){return t.loader.pageLoaded(),t.xhrError.response(e)}}(this))},i.prototype.cancel=function(){return this.window.history.back()},i.prototype.createApplicationToken=function(){return this.externalAppsService.authorizeApplicationToken(this._applicationId,this._state).then(function(t){return function(e){return t._redirect(e)}}(this))["catch"](function(t){return function(e){return t.xhrError.response(e)}}(this))},i}(e.Controller),angular.module("taigaExternalApps").controller("ExternalApp",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.rs=t}return e(r,t),r.$inject=["tgResources"],r.prototype.getApplicationToken=function(t,e){return this.rs.externalapps.getApplicationToken(t,e)},r.prototype.authorizeApplicationToken=function(t,e){return this.rs.externalapps.authorizeApplicationToken(t,e)},r}(taiga.Service),angular.module("taigaExternalApps").service("tgExternalAppsService",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.lightboxFactory=t}return e(r,t),r.$inject=["tgLightboxFactory"],r.prototype.sendFeedback=function(){return this.lightboxFactory.create("tg-lb-feedback",{"class":"lightbox lightbox-feedback lightbox-generic-form"})},r}(taiga.Service),angular.module("taigaFeedback").service("tgFeedbackService",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(t,e,r){this.currentUserService=t,this.permissionService=e,this.lightboxFactory=r,this.hiddenDeletedComment=!0}return t.$inject=["tgCurrentUserService","tgCheckPermissionsService","tgLightboxFactory"],t.prototype.showDeletedComment=function(){return this.hiddenDeletedComment=!1},t.prototype.hideDeletedComment=function(){return this.hiddenDeletedComment=!0},t.prototype.checkCancelComment=function(t){if(27===t.keyCode)return this.onEditMode({commentId:this.comment.id})},t.prototype.canEditDeleteComment=function(){if(this.currentUserService.getUser())return this.user=this.currentUserService.getUser(),this.user.get("id")===this.comment.user.pk||this.permissionService.check("modify_project")},t.prototype.saveComment=function(t,e){return this.onEditComment({commentId:this.comment.id,commentData:t,callback:e})},t.prototype.displayCommentHistory=function(){return this.lightboxFactory.create("tg-lb-display-historic",{"class":"lightbox lightbox-display-historic",comment:"comment",name:"name",object:"object"},{comment:this.comment,name:this.name,object:this.object})},t}(),e.controller("CommentCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){return{scope:{name:"@",object:"@",comment:"<",type:"<",loading:"<",editing:"<",deleting:"<",objectId:"<",editMode:"<",onEditMode:"&",onDeleteComment:"&",onRestoreDeletedComment:"&",onEditComment:"&"},templateUrl:"history/comments/comment.html",bindToController:!0,controller:"CommentCtrl",controllerAs:"vm"}},e.directive("tgComment",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(){}return t.$inject=[],t.prototype.initializePermissions=function(){return this.canAddCommentPermission="comment_"+this.name},t}(),e.controller("CommentsCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r,n){return n.initializePermissions()},{scope:{type:"<",name:"@",object:"@",comments:"<",onEditMode:"&",onDeleteComment:"&",onRestoreDeletedComment:"&",onAddComment:"&",onEditComment:"&",editMode:"<",loading:"<",deleting:"<",editing:"<",projectId:"="},templateUrl:"history/comments/comments.html",bindToController:!0,controller:"CommentsCtrl",controllerAs:"vm",link:t}},e.directive("tgComments",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(t){this.rs=t}return t.$inject=["$tgResources"],t.prototype._loadHistoric=function(){var t,e,r;return r=this.name,e=this.object,t=this.comment.id,this.rs.history.getCommentHistory(r,e,t).then(function(t){return function(e){return t.commentHistoryEntries=e}}(this))},t}(),e.controller("LightboxDisplayHistoricCtrl",t)}.call(this),function(){var t;t=function(t){var e;return e=function(e,r,n,i){return i._loadHistoric(),t.open(r)},{scope:{},bindToController:{name:"=",object:"=",comment:"="},templateUrl:"history/history-lightbox/comment-history-lightbox.html",controller:"LightboxDisplayHistoricCtrl",controllerAs:"vm",link:e}},t.$inject=["lightboxService"],angular.module("taigaHistory").directive("tgLbDisplayHistoric",t)}.call(this),function(){var t;t=function(){return{scope:{entry:"<"},templateUrl:"history/history-lightbox/history-entry.html"}},angular.module("taigaHistory").directive("tgHistoryEntry",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){return{templateUrl:"history/history-tabs/history-tabs.html",scope:{showCommentTab:"&",showActivityTab:"&",onActiveComments:"&",onActiveActivities:"&",onOrderComments:"&",activeTab:"<",commentsNum:"<",activitiesNum:"<",onReverse:"<"}}},e.directive("tgHistoryTabs",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(t,e,r,n){this.rs=t,this.repo=e,this.storage=r,this.projectService=n,this.editing=null,this.deleting=null,this.editMode={},this.viewComments=!0,this.reverse=this.storage.get("orderComments"),this._loadHistory()}return t.$inject=["$tgResources","$tgRepo","$tgStorage","tgProjectService"],t.prototype._loadHistory=function(){return this.rs.history.get(this.name,this.id).then(function(t){return function(e){return t._getComments(e),t._getActivities(e)}}(this))},t.prototype._getComments=function(t){ return this.comments=_.filter(t,function(t){return""!==t.comment}),this.reverse&&this.comments-_.reverse(this.comments),this.commentsNum=this.comments.length},t.prototype._getActivities=function(t){return this.activities=_.filter(t,function(t){return Object.keys(t.values_diff).length>0}),this.activitiesNum=this.activities.length},t.prototype.showHistorySection=function(){return this.showCommentTab()||this.showActivityTab()},t.prototype.showCommentTab=function(){return this.commentsNum>0||this.projectService.hasPermission("comment_"+this.name)},t.prototype.showActivityTab=function(){return this.activitiesNum>0},t.prototype.toggleEditMode=function(t){return this.editMode[t]=!this.editMode[t]},t.prototype.onActiveHistoryTab=function(t){return this.viewComments=t},t.prototype.deleteComment=function(t){var e,r,n;return n=this.name,r=this.id,e=t,this.deleting=t,this.rs.history.deleteComment(n,r,e).then(function(t){return function(){return t._loadHistory(),t.deleting=null}}(this))},t.prototype.editComment=function(t,e){var r,n,i;return i=this.name,n=this.id,r=t,this.editing=t,this.rs.history.editComment(i,n,r,e).then(function(e){return function(){return e._loadHistory(),e.toggleEditMode(t),e.editing=null}}(this))},t.prototype.restoreDeletedComment=function(t){var e,r,n;return n=this.name,r=this.id,e=t,this.editing=t,this.rs.history.undeleteComment(n,r,e).then(function(t){return function(){return t._loadHistory(),t.editing=null}}(this))},t.prototype.addComment=function(t){return this.repo.save(this.type).then(function(e){return function(){return e._loadHistory(),t()}}(this))},t.prototype.onOrderComments=function(){return this.reverse=!this.reverse,this.storage.set("orderComments",this.reverse),this._loadHistory()},t}(),e.controller("HistorySection",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r,n){return t.$on("object:updated",function(){return n._loadHistory(t.type,t.id)})},{link:t,templateUrl:"history/history.html",controller:"HistorySection",controllerAs:"vm",bindToController:!0,scope:{type:"=",name:"@",id:"=",projectId:"="}}},t.$inject=[],e.directive("tgHistorySection",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){function t(){}return t.$inject=[],t.prototype.diffTags=function(){if("tags"===this.type)return this.diffRemoveTags=_.difference(this.diff[0],this.diff[1]).toString(),this.diffAddTags=_.difference(this.diff[1],this.diff[0]).toString()},t}(),e.controller("ActivitiesDiffCtrl",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r,n){return n.diffTags()},{scope:{type:"<",diff:"<"},templateUrl:"history/history/history-diff.html",controller:"ActivitiesDiffCtrl",controllerAs:"vm",bindToController:!0,link:t}},e.directive("tgHistoryDiff",t)}.call(this),function(){var t,e;e=angular.module("taigaHistory"),t=function(){var t;return t=function(t,e,r){},{scope:{activities:"<"},templateUrl:"history/history/history.html",link:t}},e.directive("tgHistory",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(t,r,n,i){return t.vm={},t.vm.duty=t.duty,t.vm.type=t.type,t.vm.getDutyType=function(){if(t.vm.duty){if("epics"===t.vm.duty.get("_name"))return e.instant("COMMON.EPIC");if("userstories"===t.vm.duty.get("_name"))return e.instant("COMMON.USER_STORY");if("tasks"===t.vm.duty.get("_name"))return e.instant("COMMON.TASK");if("issues"===t.vm.duty.get("_name"))return e.instant("COMMON.ISSUE")}}},{templateUrl:"home/duties/duty.html",scope:{duty:"=tgDuty",type:"@"},link:r}},t.$inject=["$tgNavUrls","$translate"],angular.module("taigaHome").directive("tgDuty",t)}.call(this),function(){var t;t=function(){function t(t,e,r){this.currentUserService=t,this.location=e,this.navUrls=r,this.currentUserService.getUser()||this.location.path(this.navUrls.resolve("discover"))}return t.$inject=["tgCurrentUserService","$location","$tgNavUrls"],t}(),angular.module("taigaHome").controller("Home",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga.groupBy,t=function(t){function n(t,e,r){this.navurls=t,this.rs=e,this.projectsService=r}return r(n,t),n.$inject=["$tgNavUrls","tgResources","tgProjectsService"],n.prototype._attachProjectInfoToWorkInProgress=function(t,e){var r,n,i,o,s;return r=function(t){return function(r,n){var i,o,s;return o=e.get(String(r.get("project"))),i={project:o.get("slug"),ref:r.get("ref")},s=t.navurls.resolve("project-"+n+"-detail",i),r=r.set("url",s),r=r.set("project",o),r=r.set("_name",n)}}(this),i=function(t,n){return t=t.filter(function(t){return e.get(String(t.get("project")))}),t=t.map(function(t){return r(t,n)})},o=t.get("assignedTo"),o.get("epics")&&(n=i(o.get("epics"),"epics"),o=o.set("epics",n)),o.get("userStories")&&(n=i(o.get("userStories"),"userstories"),o=o.set("userStories",n)),o.get("tasks")&&(n=i(o.get("tasks"),"tasks"),o=o.set("tasks",n)),o.get("issues")&&(n=i(o.get("issues"),"issues"),o=o.set("issues",n)),s=t.get("watching"),s.get("epics")&&(n=i(s.get("epics"),"epics"),s=s.set("epics",n)),s.get("userStories")&&(n=i(s.get("userStories"),"userstories"),s=s.set("userStories",n)),s.get("tasks")&&(n=i(s.get("tasks"),"tasks"),s=s.set("tasks",n)),s.get("issues")&&(n=i(s.get("issues"),"issues"),s=s.set("issues",n)),t=t.set("assignedTo",o),t=t.set("watching",s)},n.prototype.getWorkInProgress=function(t){var r,n,i,o,s,a,c,u,l,p,h,f,d,g,m,v,y;return p=Immutable.Map(),h=this.projectsService.getProjectsByUserId(t).then(function(t){return p=Immutable.fromJS(e(t.toJS(),function(t){return t.id}))}),o=Immutable.Map(),a={status__is_closed:!1,assigned_to:t},l={is_closed:!1,assigned_users:t},u={status__is_closed:!1,assigned_to:t},c={status__is_closed:!1,assigned_to:t},r=this.rs.epics.listInAllProjects(a).then(function(t){return o=o.set("epics",t)}),s=this.rs.userstories.listInAllProjects(l).then(function(t){return o=o.set("userStories",t)}),i=this.rs.tasks.listInAllProjects(u).then(function(t){return o=o.set("tasks",t)}),n=this.rs.issues.listInAllProjects(c).then(function(t){return o=o.set("issues",t)}),a={status__is_closed:!1,watchers:t},l={is_closed:!1,watchers:t},u={status__is_closed:!1,watchers:t},c={status__is_closed:!1,watchers:t},f=Immutable.Map(),d=this.rs.epics.listInAllProjects(a).then(function(t){return f=f.set("epics",t)}),v=this.rs.userstories.listInAllProjects(l).then(function(t){return f=f.set("userStories",t)}),m=this.rs.tasks.listInAllProjects(u).then(function(t){return f=f.set("tasks",t)}),g=this.rs.issues.listInAllProjects(c).then(function(t){return f=f.set("issues",t)}),y=Immutable.Map(),Promise.all([h,r,d,s,v,i,m,n,g]).then(function(t){return function(){return y=y.set("assignedTo",o),y=y.set("watching",f),y=t._attachProjectInfoToWorkInProgress(y,p)}}(this))},n}(taiga.Service),angular.module("taigaHome").service("tgHomeService",t)}.call(this),function(){var t;t=function(t){var e,r;return r=function(e,r,n,i){return e.vm={},taiga.defineImmutableProperty(e.vm,"projects",function(){return t.projects.get("recents")})},e={templateUrl:"home/projects/home-project-list.html",scope:{},link:r}},t.$inject=["tgCurrentUserService"],angular.module("taigaHome").directive("tgHomeProjectList",t)}.call(this),function(){var t;t=function(){function t(t){this.homeService=t,this.assignedTo=Immutable.Map(),this.watching=Immutable.Map()}return t.$inject=["tgHomeService"],t.prototype._setAssignedTo=function(t){var e,r,n,i;if(e=t.get("assignedTo").get("epics"),i=t.get("assignedTo").get("userStories"),n=t.get("assignedTo").get("tasks"),r=t.get("assignedTo").get("issues"),this.assignedTo=i.concat(n).concat(r).concat(e),this.assignedTo.size>0)return this.assignedTo=this.assignedTo.sortBy(function(t){return t.get("modified_date")}).reverse()},t.prototype._setWatching=function(t){var e,r,n,i;if(e=t.get("watching").get("epics"),i=t.get("watching").get("userStories"),n=t.get("watching").get("tasks"),r=t.get("watching").get("issues"),this.watching=i.concat(n).concat(r).concat(e),this.watching.size>0)return this.watching=this.watching.sortBy(function(t){return t.get("modified_date")}).reverse()},t.prototype.getWorkInProgress=function(t){return this.homeService.getWorkInProgress(t).then(function(t){return function(e){return t._setAssignedTo(e),t._setWatching(e)}}(this))},t}(),angular.module("taigaHome").controller("WorkingOn",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(t,r,n,i){var o,s;if(o=e.getUser())return s=o.get("id"),i.getWorkInProgress(s)},{controller:"WorkingOn",controllerAs:"vm",templateUrl:"home/working-on/working-on.html",scope:{},link:r}},t.$inject=["tgHomeService","tgCurrentUserService"],angular.module("taigaHome").directive("tgWorkingOn",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,e,r,n,i){this.projectService=t,this.rs=e,this.lightboxService=r,this.confirm=n,this.rootScope=i,this.project=this.projectService.project,this.roles=this.projectService.project.get("roles"),this.rolesValues={},this.loading=!1,this.defaultMaxInvites=4}return t.$inject=["tgProjectService","$tgResources","lightboxService","$tgConfirm","$rootScope"],t.prototype._areRolesValidated=function(){return Object.defineProperty(this,"areRolesValidated",{get:function(t){return function(){var e;return e=_.filter(Object.values(t.rolesValues),function(t){return t}),e.length===t.contactsToInvite.size+t.emailsToInvite.size}}(this)})},t.prototype._checkLimitMemberships=function(){var t;return null===this.project.get("max_memberships")?this.membersLimit=this.defaultMaxInvites:(t=Math.max(this.project.get("max_memberships")-this.project.get("total_memberships"),0),this.membersLimit=Math.min(t,this.defaultMaxInvites)),this.showWarningMessage=this.membersLimit=s.get("max_memberships_private_projects"),i&&n?(e="private-space-members",r=s.get("max_memberships_private_projects")):i?e="private-space":n&&(e="private-members",r=s.get("max_memberships_private_projects"))):(o=!this.currentUserService.canCreatePublicProjects().valid,n=null!==s.get("max_memberships_public_projects")&&t.headers.memberships>=s.get("max_memberships_public_projects"),o&&n?(e="public-space-members",r=s.get("max_memberships_public_projects")):o?e="public-space":n&&(e="public-members",r=s.get("max_memberships_public_projects"))),!!e&&{key:e,values:{max_memberships:r,members:t.headers.memberships}})},r}(taiga.Service),angular.module("taigaProjects").service("tgImportProjectService",t)}.call(this),function(){var t;t=function(){function t(){}return t.$inject=[],t.prototype.isDisabled=function(t){return this.invitedMembers.indexOf(t)===-1},t}(),angular.module("taigaProjects").controller("InviteMembersCtrl",t)}.call(this),function(){var t;t=function(){ var t;return t=function(t,e,r,n){},{link:t,templateUrl:"projects/create/invite-members/invite-members.html",controller:"InviteMembersCtrl",controllerAs:"vm",bindToController:!0,scope:{invitedMembers:"<",members:"<",onToggleInvitedMember:"&"}}},t.$inject=[],angular.module("taigaProjects").directive("tgInviteMembers",t)}.call(this),function(){var t;t=function(){return{templateUrl:"projects/create/invite-members/single-member/single-member.html",scope:{disabled:"<",avatar:"="}}},t.$inject=[],angular.module("taigaProjects").directive("tgSingleMember",t)}.call(this),function(){var t;t=function(){function t(t){this.currentUserService=t,this.canCreatePublicProjects=this.currentUserService.canCreatePublicProjects(),this.canCreatePrivateProjects=this.currentUserService.canCreatePrivateProjects(),this.projectForm=this.project.toJS(),this.projectForm.is_private=!1,this.projectForm.keepExternalReference=!1,"agile"===this.projectForm.importer_type?this.projectForm.project_type=null:this.projectForm.project_type="scrum",this.projectForm.create_subissues=!0,!this.canCreatePublicProjects.valid&&this.canCreatePrivateProjects.valid&&(this.projectForm.is_private=!0)}return t.$inject=["tgCurrentUserService"],t.prototype.checkUsersLimit=function(){return this.limitMembersPrivateProject=this.currentUserService.canAddMembersPrivateProject(this.members.size),this.limitMembersPublicProject=this.currentUserService.canAddMembersPublicProject(this.members.size)},t.prototype.saveForm=function(){return this.onSaveProjectDetails({project:Immutable.fromJS(this.projectForm)})},t.prototype.canCreateProject=function(){return this.projectForm.is_private?this.canCreatePrivateProjects.valid:this.canCreatePublicProjects.valid},t.prototype.isDisabled=function(){return!this.canCreateProject()},t}(),angular.module("taigaProjects").controller("JiraImportProjectFormCtrl",t)}.call(this),function(){var t;t=function(){return{link:function(t,e,r,n){return t.$watch("vm.members",n.checkUsersLimit.bind(n))},templateUrl:"projects/create/jira-import/jira-import-project-form/jira-import-project-form.html",controller:"JiraImportProjectFormCtrl",controllerAs:"vm",bindToController:!0,scope:{members:"<",project:"<",onSaveProjectDetails:"&",onCancelForm:"&",fetchingUsers:"<"}}},t.$inject=[],angular.module("taigaProjects").directive("tgJiraImportProjectForm",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n){this.jiraImportService=t,this.confirm=e,this.translate=r,this.importProjectService=n,this.step="autorization-jira",this.project=null,taiga.defineImmutableProperty(this,"projects",function(t){return function(){return t.jiraImportService.projects}}(this)),taiga.defineImmutableProperty(this,"members",function(t){return function(){return t.jiraImportService.projectUsers}}(this))}return t.$inject=["tgJiraImportService","$tgConfirm","$translate","tgImportProjectService"],t.prototype.startProjectSelector=function(){return this.step="project-select-jira",this.jiraImportService.fetchProjects()},t.prototype.onSelectProject=function(t){return this.step="project-form-jira",this.project=t,this.fetchingUsers=!0,this.jiraImportService.fetchUsers(this.project.get("id")).then(function(t){return function(){return t.fetchingUsers=!1}}(this))},t.prototype.onSaveProjectDetails=function(t){return this.project=t,this.step="project-members-jira"},t.prototype.onCancelMemberSelection=function(){return this.step="project-form-jira"},t.prototype.startImport=function(t){var e,r,n;return e=this.confirm.loader(this.translate.instant("PROJECT.IMPORT.IN_PROGRESS.TITLE"),this.translate.instant("PROJECT.IMPORT.IN_PROGRESS.DESCRIPTION"),!0),e.start(),r=this.project.get("project_type"),"issues"===r&&this.project.get("create_subissues")&&(r="issues-with-subissues"),n=this.jiraImportService.importProject(this.project.get("name"),this.project.get("description"),this.project.get("id"),t,this.project.get("keepExternalReference"),this.project.get("is_private"),r,this.project.get("importer_type")),this.importProjectService.importPromise(n).then(function(t){return function(){return e.stop()}}(this))},t.prototype.submitUserSelection=function(t){return this.startImport(t),null},t}(),angular.module("taigaProjects").controller("JiraImportCtrl",t)}.call(this),function(){var t;t=function(){return{link:function(t,e,r,n){return n.startProjectSelector()},templateUrl:"projects/create/jira-import/jira-import.html",controller:"JiraImportCtrl",controllerAs:"vm",bindToController:!0,scope:{onCancel:"&"}}},t.$inject=[],angular.module("taigaProjects").directive("tgJiraImport",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.resources=t,this.location=e,this.projects=Immutable.List(),this.projectUsers=Immutable.List()}return e(r,t),r.$inject=["tgResources","$location"],r.prototype.setToken=function(t,e){return this.token=t,this.url=e},r.prototype.fetchProjects=function(){return this.resources.jiraImporter.listProjects(this.url,this.token).then(function(t){return function(e){return t.projects=e}}(this))},r.prototype.fetchUsers=function(t){return this.resources.jiraImporter.listUsers(this.url,this.token,t).then(function(t){return function(e){return t.projectUsers=e}}(this))},r.prototype.importProject=function(t,e,r,n,i,o,s,a){return this.resources.jiraImporter.importProject(this.url,this.token,t,e,r,n,i,o,s,a)},r.prototype.getAuthUrl=function(t){return new Promise(function(e){return function(r,n){return e.resources.jiraImporter.getAuthUrl(t).then(function(t){return e.authUrl=t.data.url,r(e.authUrl)},function(t){return n(t.data._error_message)})}}(this))},r.prototype.authorize=function(t){return new Promise(function(e){return function(r,n){return e.resources.jiraImporter.authorize(t).then(function(t){return e.token=t.data.token,e.url=t.data.url,r(t.data)},function(t){return n(new Error(t.status))})}}(this))},r}(taiga.Service),angular.module("taigaProjects").service("tgJiraImportService",t)}.call(this),function(){var t;t=function(){function t(){}return t.$inject=[],t.prototype.start=function(){return this.mode="search",this.invalid=!1},t.prototype.assignUser=function(){return this.onSelectUser({user:this.user,taigaUser:this.userEmail})},t.prototype.selectUser=function(t){return this.onSelectUser({user:this.user,taigaUser:Immutable.fromJS(t)})},t}(),angular.module("taigaProjects").controller("SelectImportUserLightboxCtrl",t)}.call(this),function(){var t;t=function(t,e){var r;return r=function(r,n,i,o){return r.$watch("vm.visible",function(i){return i&&!n.hasClass("open")?(o.start(),t.open(n,null,r.vm.onClose).then(function(){return n.find("input").focus(),e.init(n)})):!i&&n.hasClass("open")?t.close(n).then(function(){return o.userEmail="",o.usersSearch=""}):void 0})},{controller:"SelectImportUserLightboxCtrl",controllerAs:"vm",bindToController:!0,scope:{user:"<",visible:"<",onClose:"&",onSelectUser:"&",selectableUsers:"<",isPrivate:"<",limitMembersPrivateProject:"<",limitMembersPublicProject:"<",displayEmailSelector:"<"},templateUrl:"projects/create/select-import-user-lightbox/select-import-user-lightbox.html",link:r}},t.$inject=["lightboxService","lightboxKeyboardNavigationService"],angular.module("taigaProjects").directive("tgSelectImportUserLightbox",t)}.call(this),function(){var t;t=function(){function t(t){this.currentUserService=t,this.canCreatePublicProjects=this.currentUserService.canCreatePublicProjects(),this.canCreatePrivateProjects=this.currentUserService.canCreatePrivateProjects(),this.projectForm=this.project.toJS(),this.platformName="Trello",this.projectForm.is_private=!1,this.projectForm.keepExternalReference=!1,!this.canCreatePublicProjects.valid&&this.canCreatePrivateProjects.valid&&(this.projectForm.is_private=!0)}return t.$inject=["tgCurrentUserService"],t.prototype.checkUsersLimit=function(){return this.limitMembersPrivateProject=this.currentUserService.canAddMembersPrivateProject(this.members.size),this.limitMembersPublicProject=this.currentUserService.canAddMembersPublicProject(this.members.size)},t.prototype.saveForm=function(){return this.onSaveProjectDetails({project:Immutable.fromJS(this.projectForm)})},t.prototype.canCreateProject=function(){return this.projectForm.is_private?this.canCreatePrivateProjects.valid:this.canCreatePublicProjects.valid},t.prototype.isDisabled=function(){return!this.canCreateProject()},t}(),angular.module("taigaProjects").controller("TrelloImportProjectFormCtrl",t)}.call(this),function(){var t;t=function(){return{link:function(t,e,r,n){return t.$watch("vm.members",n.checkUsersLimit.bind(n))},templateUrl:"projects/create/trello-import/trello-import-project-form/trello-import-project-form.html",controller:"TrelloImportProjectFormCtrl",controllerAs:"vm",bindToController:!0,scope:{members:"<",project:"<",onSaveProjectDetails:"&",onCancelForm:"&",fetchingUsers:"<"}}},t.$inject=[],angular.module("taigaProjects").directive("tgTrelloImportProjectForm",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n){this.trelloImportService=t,this.confirm=e,this.translate=r,this.importProjectService=n,this.project=null,taiga.defineImmutableProperty(this,"projects",function(t){return function(){return t.trelloImportService.projects}}(this)),taiga.defineImmutableProperty(this,"members",function(t){return function(){return t.trelloImportService.projectUsers}}(this))}return t.$inject=["tgTrelloImportService","$tgConfirm","$translate","tgImportProjectService"],t.prototype.startProjectSelector=function(){return this.trelloImportService.fetchProjects().then(function(t){return function(){return t.step="project-select-trello"}}(this))},t.prototype.onSelectProject=function(t){return this.step="project-form-trello",this.project=t,this.fetchingUsers=!0,this.trelloImportService.fetchUsers(this.project.get("id")).then(function(t){return function(){return t.fetchingUsers=!1}}(this))},t.prototype.onSaveProjectDetails=function(t){return this.project=t,this.step="project-members-trello"},t.prototype.onCancelMemberSelection=function(){return this.step="project-form-trello"},t.prototype.startImport=function(t){var e,r;return e=this.confirm.loader(this.translate.instant("PROJECT.IMPORT.IN_PROGRESS.TITLE"),this.translate.instant("PROJECT.IMPORT.IN_PROGRESS.DESCRIPTION"),!0),e.start(),r=this.trelloImportService.importProject(this.project.get("name"),this.project.get("description"),this.project.get("id"),t,this.project.get("keepExternalReference"),this.project.get("is_private")),this.importProjectService.importPromise(r).then(function(t){return function(){return e.stop()}}(this))},t.prototype.submitUserSelection=function(t){return this.startImport(t),null},t}(),angular.module("taigaProjects").controller("TrelloImportCtrl",t)}.call(this),function(){var t;t=function(){return{link:function(t,e,r,n){return n.startProjectSelector()},templateUrl:"projects/create/trello-import/trello-import.html",controller:"TrelloImportCtrl",controllerAs:"vm",bindToController:!0,scope:{onCancel:"&"}}},t.$inject=[],angular.module("taigaProjects").directive("tgTrelloImport",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t){this.resources=t,this.projects=Immutable.List(),this.projectUsers=Immutable.List(),this.token=null}return e(r,t),r.$inject=["tgResources"],r.prototype.setToken=function(t){return this.token=t},r.prototype.fetchProjects=function(){return this.resources.trelloImporter.listProjects(this.token).then(function(t){return function(e){return t.projects=e}}(this))},r.prototype.fetchUsers=function(t){return this.resources.trelloImporter.listUsers(this.token,t).then(function(t){return function(e){return t.projectUsers=e}}(this))},r.prototype.importProject=function(t,e,r,n,i,o){return this.resources.trelloImporter.importProject(this.token,t,e,r,n,i,o)},r.prototype.getAuthUrl=function(){return new Promise(function(t){return function(e){return t.resources.trelloImporter.getAuthUrl().then(function(r){return t.authUrl=r.data.url,e(t.authUrl)})}}(this))},r.prototype.authorize=function(t){return new Promise(function(e){return function(r,n){return e.resources.trelloImporter.authorize(t).then(function(t){return e.token=t.data.token,r(e.token)},function(t){return n(new Error(t.status))})}}(this))},r}(taiga.Service),angular.module("taigaProjects").service("tgTrelloImportService",t)}.call(this),function(){var t;t=function(t,e){return{link:function(r,n,i){return r.$watch("visible",function(i){return i&&!n.hasClass("open")?t.open(n,r.onClose).then(function(){return n.find("input").focus(),e.init(n)}):!i&&n.hasClass("open")?t.close(n):void 0})},templateUrl:"projects/create/warning-user-import-lightbox/warning-user-import-lightbox.html",scope:{visible:"<",onClose:"&",onConfirm:"&"}}},t.$inject=["lightboxService","lightboxKeyboardNavigationService"],angular.module("taigaProjects").directive("tgWarningUserImportLightbox",t)}.call(this),function(){var t;t=function(){function t(t){this.currentUserService=t,taiga.defineImmutableProperty(this,"projects",function(t){return function(){return t.currentUserService.projects.get("all")}}(this))}return t.$inject=["tgCurrentUserService"],t}(),angular.module("taigaProjects").controller("ProjectsListing",t)}.call(this),function(){var t;t=function(){function t(t,e,r,n,i){this.routeParams=t,this.appMetaService=e,this.auth=r,this.translate=n,this.projectService=i,this.user=this.auth.userData,taiga.defineImmutableProperty(this,"project",function(t){return function(){return t.projectService.project}}(this)),taiga.defineImmutableProperty(this,"members",function(t){return function(){return t.projectService.activeMembers}}(this)),this.appMetaService.setfn(this._setMeta.bind(this))}return t.$inject=["$routeParams","tgAppMetaService","$tgAuth","$translate","tgProjectService"],t.prototype._setMeta=function(){var t;return this.project?(t={projectName:this.project.get("name")},{title:this.translate.instant("PROJECT.PAGE_TITLE",t),description:this.project.get("description")}):null},t}(),angular.module("taigaProjects").controller("Project",t)}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=this.taiga,e=this.taiga.groupBy,t=function(t){function e(t,e){this.rs=t,this.projectUrl=e}return n(e,t),e.$inject=["tgResources","$projectUrl"],e.prototype.create=function(t){return this.rs.projects.create(t)},e.prototype.duplicate=function(t,e){return this.rs.projects.duplicate(t,e)},e.prototype.getProjectBySlug=function(t){return this.rs.projects.getProjectBySlug(t).then(function(t){return function(e){return t._decorate(e)}}(this))},e.prototype.getProjectStats=function(t){return this.rs.projects.getProjectStats(t)},e.prototype.getProjectsByUserId=function(t,e){return this.rs.projects.getProjectsByUserId(t,e).then(function(t){return function(e){return e.map(t._decorate.bind(t))}}(this))},e.prototype._decorate=function(t){var e;return e=this.projectUrl.get(t.toJS()),t=t.set("url",e)},e.prototype.bulkUpdateProjectsOrder=function(t){return this.rs.projects.bulkUpdateOrder(t)},e.prototype.transferValidateToken=function(t,e){return this.rs.projects.transferValidateToken(t,e)},e.prototype.transferAccept=function(t,e,r){return this.rs.projects.transferAccept(t,e,r)},e.prototype.transferReject=function(t,e,r){return this.rs.projects.transferReject(t,e,r)},e}(r.Service),angular.module("taigaProjects").service("tgProjectsService",t)}.call(this),function(){var t;t=function(){return{templateUrl:"projects/transfer/cant-own-project-explanation.html"}},angular.module("taigaProjects").directive("tgCantOwnProjectExplanation",t)}.call(this),function(){var t,e;e=angular.module("taigaProjects"),t=function(){function t(t,e,r,n,i,o,s,a,c){this.routeParams=t,this.projectService=e,this.location=r,this.authService=n,this.currentUserService=i,this.navUrls=o,this.translate=s,this.confirmService=a,this.errorHandlingService=c}return t.$inject=["$routeParams","tgProjectsService","$location","$tgAuth","tgCurrentUserService","$tgNavUrls","$translate","$tgConfirm","tgErrorHandlingService"],t.prototype.initialize=function(){return this.projectId=this.project.get("id"),this.token=this.routeParams.token,this.showAddComment=!1,this._refreshUserData()},t.prototype._validateToken=function(){return this.projectService.transferValidateToken(this.projectId,this.token).then(null,function(t){return function(e,r){return t.errorHandlingService.notfound()}}(this))},t.prototype._refreshUserData=function(){return this.authService.refresh().then(function(t){return function(){return t._validateToken(),t._setProjectData(),t._checkOwnerData()}}(this))},t.prototype._setProjectData=function(){return this.canBeOwnedByUser=this.currentUserService.canOwnProject(this.project)},t.prototype._checkOwnerData=function(){var t,e;return t=this.currentUserService.getUser(),this.project.get("is_private")?(this.ownerMessage="ADMIN.PROJECT_TRANSFER.OWNER_MESSAGE.PRIVATE",this.maxProjects=t.get("max_private_projects"),null===this.maxProjects&&(this.maxProjects=this.translate.instant("ADMIN.PROJECT_TRANSFER.UNLIMITED_PROJECTS")),this.currentProjects=t.get("total_private_projects"),e=t.get("max_memberships_private_projects")):(this.ownerMessage="ADMIN.PROJECT_TRANSFER.OWNER_MESSAGE.PUBLIC",this.maxProjects=t.get("max_public_projects"),null===this.maxProjects&&(this.maxProjects=this.translate.instant("ADMIN.PROJECT_TRANSFER.UNLIMITED_PROJECTS")),this.currentProjects=t.get("total_public_projects"),e=t.get("max_memberships_public_projects")),this.validNumberOfMemberships=null===e||this.project.get("total_memberships")<=e},t.prototype.transferAccept=function(t,e){return this.loadingAccept=!0,this.projectService.transferAccept(this.project.get("id"),t,e).then(function(t){return function(){var e;e=t.navUrls.resolve("project-admin-project-profile-details",{project:t.project.get("slug")}),t.loadingAccept=!1,t.location.path(e),t.confirmService.notify("success",t.translate.instant("ADMIN.PROJECT_TRANSFER.ACCEPTED_PROJECT_OWNERNSHIP"),"",5e3)}}(this))},t.prototype.transferReject=function(t,e){return this.loadingReject=!0,this.projectService.transferReject(this.project.get("id"),t,e).then(function(t){return function(){var e;e=t.navUrls.resolve("home",{project:t.project.get("slug")}),t.loadingReject=!1,t.location.path(e),t.confirmService.notify("success",t.translate.instant("ADMIN.PROJECT_TRANSFER.REJECTED_PROJECT_OWNERNSHIP"),"",5e3)}}(this))},t.prototype.addComment=function(){return this.showAddComment=!0},t.prototype.hideComment=function(){return this.showAddComment=!1,this.reason=""},t}(),e.controller("TransferProjectController",t)}.call(this),function(){var t,e;e=angular.module("taigaProjects"),t=function(){var t;return t=function(t,e,r,n){return n.initialize()},{link:t,scope:{},bindToController:{project:"="},templateUrl:"projects/transfer/transfer-project.html",controller:"TransferProjectController",controllerAs:"vm"}},e.directive("tgTransferProject",t)}.call(this),function(){var t,e,r,n;n=this.taiga,r=this.taiga.sizeFormat,t=function(t,e,n,i,o,s){var a;return a={},a.list=function(r,n,i){var o,s,a,c;return c="attachments/"+r,s={object_id:n,project:i},o={headers:{"x-disable-pagination":"1"}},a=t.resolve(c),e.get(a,s,o).then(function(t){return Immutable.fromJS(t.data)})},a["delete"]=function(r,n){var i,o;return o="attachments/"+r,i=t.resolve(o)+("/"+n),e["delete"](i)},a.patch=function(r,n,i){var o,s;return s="attachments/"+r,o=t.resolve(s)+("/"+n),e.patch(o,i)},a.create=function(e,a,c,u,l){var p,h,f,d,g,m,v,y,_,b,S;return b="attachments/"+e,_=t.resolve(b),h=o.defer(),void 0===u?(h.reject(null),h.promise):(f=n.get("maxUploadFileSize",null),f&&u.size>f?(d={status:413,data:{_error_message:"'"+u.name+"' ("+r(u.size)+") is too heavy for our oompa loompas, try it with a smaller than ("+r(f)+")"}},h.reject(d),h.promise):(y=function(t){return function(t){return i.$apply(function(){return u.status="in-progress",u.size=r(t.total),u.progressMessage="upload "+r(t.loaded)+" of "+r(t.total),u.progressPercent=Math.round(t.loaded/t.total*100)+"%"})}}(this),m=function(t){return function(t){return i.$apply(function(){var e,r,n;u.status="done",n=t.target.status;try{e=JSON.parse(t.target.responseText)}catch(i){e={}}return n>=200&&n<400?(e=Immutable.fromJS(e),h.resolve(e)):(d={status:n,data:{_error_message:null!=(r=p.attached_file)?r[0]:void 0}},h.reject(d))})}}(this),v=function(t){return function(t){return i.$apply(function(){return u.status="error",h.reject("fail")})}}(this),p=new FormData,p.append("project",a),p.append("object_id",c),p.append("attached_file",u),p.append("from_comment",l),S=new XMLHttpRequest,S.upload.addEventListener("progress",y,!1),S.addEventListener("load",m,!1),S.addEventListener("error",v,!1),g=s.get("token"),S.open("POST",_),S.setRequestHeader("Authorization","Bearer "+g),S.setRequestHeader("Accept","application/json"),S.send(p),h.promise))},function(){return{attachments:a}}},t.$inject=["$tgUrls","$tgHttp","$tgConfig","$rootScope","$q","$tgStorage"],e=angular.module("taigaResources2"),e.factory("tgAttachmentsResource",t)}.call(this),function(){var t,e;t=function(t,e){var r;return r={},r.listInAllProjects=function(r){var n,i;return i=t.resolve("epics"),n={headers:{"x-disable-pagination":"1"}},e.get(i,r,n).then(function(t){return Immutable.fromJS(t.data)})},r.list=function(r,n){var i,o;return null==n&&(n=0),o=t.resolve("epics"),i={project:r,page:n},e.get(o,i).then(function(t){return{list:Immutable.fromJS(t.data),headers:t.headers}})},r.patch=function(r,n){var i;return i=t.resolve("epics")+("/"+r),e.patch(i,n).then(function(t){return Immutable.fromJS(t.data)})},r.post=function(r){var n;return n=t.resolve("epics"),e.post(n,r).then(function(t){return Immutable.fromJS(t.data)})},r.reorder=function(r,n,i){var o,s;return s=t.resolve("epics")+("/"+r),o={headers:{"set-orders":JSON.stringify(i)}},e.patch(s,n,null,o).then(function(t){return Immutable.fromJS(t.data)})},r.addRelatedUserstory=function(r,n){var i,o;return o=t.resolve("epic-related-userstories",r),i={user_story:n,epic:r},e.post(o,i)},r.reorderRelatedUserstory=function(r,n,i,o){var s,a;return a=t.resolve("epic-related-userstories",r)+("/"+n),s={headers:{"set-orders":JSON.stringify(o)}},e.patch(a,i,null,s)},r.bulkCreateRelatedUserStories=function(r,n,i){var o,s;return s=t.resolve("epic-related-userstories-bulk-create",r),o={bulk_userstories:i,project_id:n},e.post(s,o)},r.deleteRelatedUserstory=function(r,n){var i;return i=t.resolve("epic-related-userstories",r)+("/"+n),e["delete"](i)},function(){return{epics:r}}},t.$inject=["$tgUrls","$tgHttp"],e=angular.module("taigaResources2"),e.factory("tgEpicsResource",t)}.call(this),function(){var t,e;t=function(t,e){var r;return r={},r.getApplicationToken=function(r,n){var i;return i=t.resolve("applications"),i=i+"/"+r+"/token?state="+n,e.get(i).then(function(t){return Immutable.fromJS(t.data)})},r.authorizeApplicationToken=function(r,n){var i,o;return o=t.resolve("application-tokens"),o+="/authorize",i={state:n,application:r},e.post(o,i).then(function(t){return Immutable.fromJS(t.data)})},function(){return{externalapps:r}}},t.$inject=["$tgUrls","$tgHttp"],e=angular.module("taigaResources2"),e.factory("tgExternalAppsResource",t)}.call(this),function(){var t,e,r,n,i,o;o=this.taiga,n=function(t,e){var r;return r={},r.getAuthUrl=function(r){return r=t.resolve("importers-trello-auth-url"),e.get(r)},r.authorize=function(r){var n;return n=t.resolve("importers-trello-authorize"),e.post(n,{code:r})},r.listProjects=function(r){var n;return n=t.resolve("importers-trello-list-projects"),e.post(n,{token:r}).then(function(t){return Immutable.fromJS(t.data)})},r.listUsers=function(r,n){var i;return i=t.resolve("importers-trello-list-users"),e.post(i,{token:r,project:n}).then(function(t){return Immutable.fromJS(t.data)})},r.importProject=function(r,n,i,o,s,a,c){var u,l;return l=t.resolve("importers-trello-import-project"),u={token:r,name:n,description:i,project:o,users_bindings:s.toJS(),keep_external_reference:a,is_private:c,template:"kanban"},e.post(l,u)},function(){return{trelloImporter:r}}},n.$inject=["$tgUrls","$tgHttp"],r=function(t,e){var r;return r={},r.getAuthUrl=function(r){var n;return n=t.resolve("importers-jira-auth-url")+"?url="+r,e.get(n)},r.authorize=function(r){var n;return n=t.resolve("importers-jira-authorize"),e.post(n,{oauth_verifier:r})},r.listProjects=function(r,n){var i;return i=t.resolve("importers-jira-list-projects"),e.post(i,{url:r,token:n}).then(function(t){return Immutable.fromJS(t.data)})},r.listUsers=function(r,n,i){var o;return o=t.resolve("importers-jira-list-users"),e.post(o,{url:r,token:n,project:i}).then(function(t){return Immutable.fromJS(t.data)})},r.importProject=function(r,n,i,o,s,a,c,u,l,p){var h,f,d;return d=t.resolve("importers-jira-import-project"),f="kanban","kanban"!==l&&(f="scrum"),h={url:r,token:n,name:i,description:o,project:s,users_bindings:a.toJS(),keep_external_reference:c,is_private:u,project_type:l,importer_type:p,template:f},e.post(d,h)},function(){return{jiraImporter:r}}},r.$inject=["$tgUrls","$tgHttp"],e=function(t,e){var r;return r={},r.getAuthUrl=function(r){var n;return n=t.resolve("importers-github-auth-url")+"?uri="+r,e.get(n)},r.authorize=function(r){var n;return n=t.resolve("importers-github-authorize"),e.post(n,{code:r})},r.listProjects=function(r){var n;return n=t.resolve("importers-github-list-projects"),e.post(n,{token:r}).then(function(t){return Immutable.fromJS(t.data)})},r.listUsers=function(r,n){var i;return i=t.resolve("importers-github-list-users"),e.post(i,{token:r,project:n}).then(function(t){return Immutable.fromJS(t.data)})},r.importProject=function(r,n,i,o,s,a,c,u){var l,p;return p=t.resolve("importers-github-import-project"),l={token:r,name:n,description:i,project:o,users_bindings:s.toJS(),keep_external_reference:a,is_private:c,template:u},e.post(p,l)},function(){return{githubImporter:r}}},e.$inject=["$tgUrls","$tgHttp"],t=function(t,e){var r;return r={},r.getAuthUrl=function(){var r;return r=t.resolve("importers-asana-auth-url"),e.get(r)},r.authorize=function(r){var n;return n=t.resolve("importers-asana-authorize"),e.post(n,{code:r})},r.listProjects=function(r){var n;return n=t.resolve("importers-asana-list-projects"),e.post(n,{token:r}).then(function(t){return Immutable.fromJS(t.data)})},r.listUsers=function(r,n){var i;return i=t.resolve("importers-asana-list-users"),e.post(i,{token:r,project:n}).then(function(t){return Immutable.fromJS(t.data)})},r.importProject=function(r,n,i,o,s,a,c,u){var l,p;return p=t.resolve("importers-asana-import-project"),l={token:r,name:n,description:i,project:o,users_bindings:s.toJS(),keep_external_reference:a,is_private:c,template:u},e.post(p,l)},function(){return{asanaImporter:r}}},t.$inject=["$tgUrls","$tgHttp"],i=angular.module("taigaResources2"),i.factory("tgTrelloImportResource",n),i.factory("tgJiraImportResource",r),i.factory("tgGithubImportResource",e),i.factory("tgAsanaImportResource",t)}.call(this),function(){var t,e;t=function(t,e){var r;return r={},r.listInAllProjects=function(r){var n,i;return i=t.resolve("issues"),n={headers:{"x-disable-pagination":"1"}},e.get(i,r,n).then(function(t){return Immutable.fromJS(t.data)})},function(){return{issues:r}}},t.$inject=["$tgUrls","$tgHttp"],e=angular.module("taigaResources2"),e.factory("tgIssuesResource",t)}.call(this),function(){var t,e,r;r=function(){},t=function(t,e,r){var n;return n={},n.create=function(r){var n;return n=t.resolve("projects"),e.post(n,JSON.stringify(r)).then(function(t){return function(t){return Immutable.fromJS(t.data)}}(this))},n.duplicate=function(r,n){var i,o,s;return s=t.resolve("projects"),s=s+"/"+r+"/duplicate",i=n.users.map(function(t){return function(t){return{id:t}}}(this)),o={name:n.name,description:n.description,is_private:n.is_private,users:i},e.post(s,o)},n.getProjects=function(r,n){var i,o;return null==r&&(r={}),null==n&&(n=!0),o=t.resolve("projects"),i={},n||(i={headers:{"x-lazy-pagination":!0}}),e.get(o,r,i)},n.getProjectBySlug=function(r){var n;return n=t.resolve("projects"),n=n+"/by_slug?slug="+r,e.get(n).then(function(t){return Immutable.fromJS(t.data)})},n.getProjectsByUserId=function(r,n){var i,o,s;return null==n&&(n=!1),s=t.resolve("projects"),i={},n||(i.headers={"x-disable-pagination":"1"}),o={member:r,order_by:"user_order"},e.get(s,o,i).then(function(t){return Immutable.fromJS(t.data)})},n.getProjectStats=function(r){var n;return n=t.resolve("projects"),n=n+"/"+r,e.get(n).then(function(t){return Immutable.fromJS(t.data)})},n.bulkUpdateOrder=function(r){var n;return n=t.resolve("bulk-update-projects-order"),e.post(n,r)},n.getTimeline=function(n,i){var o,s;return o={page:i,only_relevant:!0},s=t.resolve("timeline-project"),s=s+"/"+n,e.get(s,o,{headers:{"x-lazy-pagination":!0}}).then(function(t){return t=Immutable.fromJS(t),r(t)})},n.likeProject=function(r){var n;return n=t.resolve("project-like",r),e.post(n)},n.unlikeProject=function(r){var n;return n=t.resolve("project-unlike",r),e.post(n)},n.watchProject=function(r,n){var i,o;return i={notify_level:n,live_notify_level:n},o=t.resolve("project-watch",r),e.post(o,i)},n.unwatchProject=function(r){var n;return n=t.resolve("project-unwatch",r),e.post(n)},n.contactProject=function(r,n){var i,o;return i={project:r,comment:n},o=t.resolve("project-contact"),e.post(o,i)},n.transferValidateToken=function(r,n){var i,o;return i={token:n},o=t.resolve("project-transfer-validate-token",r),e.post(o,i)},n.transferAccept=function(r,n,i){var o,s;return o={token:n,reason:i},s=t.resolve("project-transfer-accept",r),e.post(s,o)},n.transferReject=function(r,n,i){var o,s;return o={token:n,reason:i},s=t.resolve("project-transfer-reject",r),e.post(s,o)},n.transferRequest=function(r){var n;return n=t.resolve("project-transfer-request",r),e.post(n)},n.transferStart=function(r,n,i){var o,s;return o={user:n,reason:i},s=t.resolve("project-transfer-start",r),e.post(s,o)},function(){return{projects:n}}},t.$inject=["$tgUrls","$tgHttp","tgPaginateResponseService"],e=angular.module("taigaResources2"),e.factory("tgProjectsResources",t)}.call(this),function(){var t,e;e=["tgProjectsResources","tgUserResources","tgUsersResources","tgUserstoriesResource","tgTasksResource","tgIssuesResource","tgExternalAppsResource","tgAttachmentsResource","tgStatsResource","tgWikiHistory","tgEpicsResource","tgTrelloImportResource","tgJiraImportResource","tgGithubImportResource","tgAsanaImportResource"],t=function(t){var r,n,i,o,s,a,c,u,l;for(r=0,i=e.length;r"),$("head").append(r)),r.text(e||"")):0===t.indexOf("og:")?(r=$("head meta[property='"+t+"']"),0===r.length&&(r=$(""),$("head").append(r)),r.attr("content",e||"")):(r=$("head meta[name='"+t+"']"),0===r.length&&(r=$(""),$("head").append(r)),r.attr("content",e||""))},t.prototype.setTitle=function(t){return this._set("title",t)},t.prototype.setDescription=function(t){return this._set("description",r(t,250))},t.prototype.setTwitterMetas=function(t,e){return this._set("twitter:card","summary"),this._set("twitter:site","@taigaio"),this._set("twitter:title",t),this._set("twitter:description",r(e,300)),this._set("twitter:image",window.location.origin+"/"+window._version+"/images/logo-color.png")},t.prototype.setOpenGraphMetas=function(t,e){return this._set("og:type","object"),this._set("og:site_name","Taiga - Love your projects"),this._set("og:title",t),this._set("og:description",r(e,300)),this._set("og:image",window.location.origin+"/"+window._version+"/images/logo-color.png"),this._set("og:url",window.location.href)},t.prototype.setAll=function(t,e){return this.setTitle(t),this.setDescription(e),this.setTwitterMetas(t,e),this.setOpenGraphMetas(t,e)},t.prototype.addMobileViewport=function(){return $("head").append('')},t.prototype.removeMobileViewport=function(){return $('head meta[name="viewport"]').remove()},t.prototype.setfn=function(t){return this.listener&&this._listener(),this._listener=this.rootScope.$watchCollection(t,function(t){return function(e){if(e)return t.setAll(e.title,e.description),t._listener()}}(this))},t}(),angular.module("taigaCommon").service("tgAppMetaService",t)}.call(this),function(){var t,e;e=this.taiga.sizeFormat,t=function(){function t(t,r,n,i){this.confirm=t,this.config=r,this.translate=n,this.rs=i,this.maxFileSize=this.getMaxFileSize(),this.maxFileSize&&(this.maxFileSizeFormated=e(this.maxFileSize))}return t.$inject=["$tgConfirm","$tgConfig","$translate","tgResources"],t.prototype.sizeError=function(t){var r;return r=this.translate.instant("ATTACHMENT.ERROR_MAX_SIZE_EXCEEDED",{fileName:t.name,fileSize:e(t.size),maxFileSize:this.maxFileSizeFormated}),this.confirm.notify("error",r)},t.prototype.validate=function(t){return!(this.maxFileSize&&t.size>this.maxFileSize)||(this.sizeError(t),!1)},t.prototype.getMaxFileSize=function(){return this.config.get("maxUploadFileSize",null)},t.prototype.list=function(t,e,r){return this.rs.attachments.list(t,e,r).then(function(t){return function(t){return t.sortBy(function(t){return t.get("order")})}}(this))},t.prototype["delete"]=function(t,e){return this.rs.attachments["delete"](t,e)},t.prototype.saveError=function(t,e){var r;return r="",t&&(r=this.translate.instant("ATTACHMENT.ERROR_UPLOAD_ATTACHMENT",{fileName:t.name,errorMessage:e.data._error_message})),this.confirm.notify("error",r)},t.prototype.upload=function(t,e,r,n,i){var o;return null==i&&(i=!1),o=this.rs.attachments.create(n,r,e,t,i),o.then(null,this.saveError.bind(this,t)),o},t.prototype.patch=function(t,e,r){var n;return n=this.rs.attachments.patch(e,t,r),n.then(null,this.saveError.bind(this,null)),n},t}(),angular.module("taigaCommon").service("tgAttachmentsService",t)}.call(this),function(){var t,e=function(t,e){return(+t%(e=+e)+e)%e};t=function(){function t(t){var e,r;this.config=t,r=["/"+window._version+"/images/user-avatars/user-avatar-01.png","/"+window._version+"/images/user-avatars/user-avatar-02.png","/"+window._version+"/images/user-avatars/user-avatar-03.png","/"+window._version+"/images/user-avatars/user-avatar-04.png","/"+window._version+"/images/user-avatars/user-avatar-05.png"],e=["rgba( 178, 176, 204, 1 )","rgba( 183, 203, 131, 1 )","rgba( 210, 198, 139, 1 )","rgba( 214, 161, 212, 1 )","rgba( 247, 154, 154, 1 )"],this.logos=_.cartesianProduct(r,e)}return t.prototype.getDefault=function(t){var r,n;return r=e(murmurhash3_32_gc(t,42),this.logos.length),n=this.logos[r],{src:n[0],color:n[1]}},t.prototype.getUnnamed=function(){return{url:"/"+window._version+"/images/unnamed.png"}},t.prototype.getAvatar=function(t,e){var r,n,i,o,s,a;return t?(r="photo","avatarBig"===e&&(r="big_photo"),s=null,t instanceof Immutable.Map?(n=t.get("gravatar_id"),s=t.get(r)):(n=t.gravatar_id,s=t[r]),n?s?{url:s}:location.host.indexOf("localhost")===-1&&this.config.get("gravatar",!0)?(a=location.protocol+"//"+location.host,i=this.getDefault(n),o=encodeURIComponent(a+i.src),{url:"https://www.gravatar.com/avatar/"+n+"?s=200&d="+o,bg:i.color}):(a=location.protocol+"//"+location.host,i=this.getDefault(n),{url:a+i.src,bg:i.color}):this.getUnnamed()):this.getUnnamed()},t}(),angular.module("taigaCommon").service("tgAvatarService",["$tgConfig",t])}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t){this.projectService=t}return t.$inject=["tgProjectService"],t.prototype.check=function(t){return!!this.projectService.project&&this.projectService.project.get("my_permissions").indexOf(t)!==-1},t}(),angular.module("taigaCommon").service("tgCheckPermissionsService",t)}.call(this),function(){var t,e,r;r=this.taiga,e=this.taiga.groupBy,t=function(){function t(t,e,n){this.projectsService=t,this.storageService=e,this.rs=n,this._user=null,this._projects=Immutable.Map(),this._projectsById=Immutable.Map(),this._joyride=null,r.defineImmutableProperty(this,"projects",function(t){return function(){return t._projects}}(this)),r.defineImmutableProperty(this,"projectsById",function(t){return function(){return t._projectsById}}(this))}return t.$inject=["tgProjectsService","$tgStorage","tgResources"],t.prototype.isAuthenticated=function(){return null!==this.getUser()},t.prototype.getUser=function(){var t;return this._user||(t=this.storageService.get("userInfo"),t&&(t=Immutable.fromJS(t),this.setUser(t))),this._user},t.prototype.removeUser=function(){return this._user=null,this._projects=Immutable.Map(),this._projectsById=Immutable.Map(),this._joyride=null},t.prototype.setUser=function(t){return this._user=t,this._loadUserInfo()},t.prototype.bulkUpdateProjectsOrder=function(t){return this.projectsService.bulkUpdateProjectsOrder(t).then(function(t){return function(){return t.loadProjects()}}(this))},t.prototype.loadProjects=function(){return this.projectsService.getProjectsByUserId(this._user.get("id")).then(function(t){return function(e){return t.setProjects(e)}}(this))},t.prototype.disableJoyRide=function(t){if(this.isAuthenticated())return t?this._joyride[t]=!1:this._joyride={backlog:!1,kanban:!1,dashboard:!1},this.rs.user.setUserStorage("joyride",this._joyride)},t.prototype.loadJoyRideConfig=function(){return new Promise(function(t){return function(e){return null!==t._joyride?void e(t._joyride):t.rs.user.getUserStorage("joyride").then(function(r){return t._joyride=r,e(t._joyride)})["catch"](function(){return t._joyride={backlog:!0,kanban:!0,dashboard:!0},t.rs.user.createUserStorage("joyride",t._joyride),e(t._joyride)})}}(this))},t.prototype._loadUserInfo=function(){return Promise.all([this.loadProjects()])},t.prototype.setProjects=function(t){return this._projects=this._projects.set("all",t),this._projects=this._projects.set("recents",t.slice(0,10)),this._projectsById=Immutable.fromJS(e(t.toJS(),function(t){return t.id})),this.projects},t.prototype.canCreatePrivateProjects=function(){var t;return t=this.getUser(),null!==t.get("max_private_projects")&&t.get("total_private_projects")>=t.get("max_private_projects")?{valid:!1,reason:"max_private_projects",type:"private_project",current:t.get("total_private_projects"),max:t.get("max_private_projects")}:{valid:!0}},t.prototype.canCreatePublicProjects=function(){var t;return t=this.getUser(),null!==t.get("max_public_projects")&&t.get("total_public_projects")>=t.get("max_public_projects")?{valid:!1,reason:"max_public_projects",type:"public_project",current:t.get("total_public_projects"),max:t.get("max_public_projects")}:{valid:!0}},t.prototype.canAddMembersPublicProject=function(t){var e;return e=this.getUser(),null!==e.get("max_memberships_public_projects")&&t>e.get("max_memberships_public_projects")?{valid:!1,reason:"max_members_public_projects",type:"public_project",current:t,max:e.get("max_memberships_public_projects")}:{valid:!0}},t.prototype.canAddMembersPrivateProject=function(t){var e;return e=this.getUser(),null!==e.get("max_memberships_private_projects")&&t>e.get("max_memberships_private_projects")?{valid:!1,reason:"max_members_private_projects",type:"private_project",current:t,max:e.get("max_memberships_private_projects")}:{valid:!0}},t.prototype.canOwnProject=function(t){var e,r,n;if(n=this.getUser(),t.get("is_private")){if(r=this.canCreatePrivateProjects(),!r.valid)return r;if(e=this.canAddMembersPrivateProject(t.get("total_memberships")),!e.valid)return e}else{if(r=this.canCreatePublicProjects(),!r.valid)return r;if(e=this.canAddMembersPublicProject(t.get("total_memberships")),!e.valid)return e}return{valid:!0}},t}(),angular.module("taigaCommon").service("tgCurrentUserService",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t){this.rootScope=t}return t.$inject=["$rootScope"],t.prototype.init=function(){return this.rootScope.errorHandling={}},t.prototype.notfound=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.notfound=!0},t.prototype.error=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.error=!0},t.prototype.permissionDenied=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.permissionDenied=!0},t.prototype.block=function(){return this.rootScope.errorHandling.showingError=!0,this.rootScope.errorHandling.blocked=!0},t}(),angular.module("taigaCommon").service("tgErrorHandlingService",t)}.call(this),function(){var t;t=function(){function t(t,e){this.rootScope=t,this.compile=e}return t.$inject=["$rootScope","$compile"],t.prototype.create=function(t,e,r){var n,i,o;o=this.rootScope.$new(),o=_.merge(o,r),n=$("
    ").attr(t,!0).attr("tg-bind-scope",!0),e&&n.attr(e),n.addClass("remove-on-close"),i=this.compile(n)(o),$(document.body).append(i)},t}(),angular.module("taigaCommon").service("tgLightboxFactory",t)}.call(this),function(){var t;t=function(){return function(t){var e;return e=Immutable.Map({data:t.get("data"),next:!!t.get("headers")("x-pagination-next"),prev:!!t.get("headers")("x-pagination-prev"),current:t.get("headers")("x-pagination-current"),count:t.get("headers")("x-pagination-count")})}},angular.module("taigaCommon").factory("tgPaginateResponseService",t)}.call(this),function(){var t,e=function(t,e){return(+t%(e=+e)+e)%e};t=function(){function t(){var t,e;e=["/"+window._version+"/images/project-logos/project-logo-01.png","/"+window._version+"/images/project-logos/project-logo-02.png","/"+window._version+"/images/project-logos/project-logo-03.png","/"+window._version+"/images/project-logos/project-logo-04.png","/"+window._version+"/images/project-logos/project-logo-05.png"],t=["rgba( 153, 214, 220, 1 )","rgba( 213, 156, 156, 1 )","rgba( 214, 161, 212, 1 )","rgba( 164, 162, 219, 1 )","rgba( 152, 224, 168, 1 )"],this.logos=_.cartesianProduct(e,t)}return t.prototype.getDefaultProjectLogo=function(t,r){var n,i,o;return i=t+"-"+r,n=e(murmurhash3_32_gc(i,42),this.logos.length),o=this.logos[n],{src:o[0],color:o[1]}},t}(),angular.module("taigaCommon").service("tgProjectLogoService",t)}.call(this),function(){var t,e;e=this.taiga,t=function(){function t(t,r,n,i){this.projectsService=t,this.xhrError=r,this.userActivityService=n,this.interval=i,this._project=null,this._section=null,this._sectionsBreadcrumb=Immutable.List(),this._activeMembers=Immutable.List(),e.defineImmutableProperty(this,"project",function(t){return function(){return t._project}}(this)),e.defineImmutableProperty(this,"section",function(t){return function(){return t._section}}(this)),e.defineImmutableProperty(this,"sectionsBreadcrumb",function(t){return function(){return t._sectionsBreadcrumb}}(this)),e.defineImmutableProperty(this,"activeMembers",function(t){return function(){return t._activeMembers}}(this)),window.localStorage.e2e||this.autoRefresh()}return t.$inject=["tgProjectsService","tgXhrErrorService","tgUserActivityService","$interval"],t.prototype.cleanProject=function(){return this._project=null,this._activeMembers=Immutable.List(),this._section=null,this._sectionsBreadcrumb=Immutable.List()},t.prototype.autoRefresh=function(){var t;return t=this.interval(function(t){return function(){return t.fetchProject()}}(this),6e5),this.userActivityService.onInactive(function(e){return function(){return e.interval.cancel(t)}}(this)),this.userActivityService.onActive(function(t){return function(){return t.fetchProject(),t.autoRefresh()}}(this))},t.prototype.setSection=function(t){return this._section=t,t?this._sectionsBreadcrumb=this._sectionsBreadcrumb.push(this._section):this._sectionsBreadcrumb=Immutable.List()},t.prototype.setProject=function(t){return this._project=t,this._activeMembers=this._project.get("members").filter(function(t){return t.get("is_active")})},t.prototype.setProjectBySlug=function(t){return new Promise(function(e){return function(r,n){return e.project&&e.project.get("slug")===t?r():e.projectsService.getProjectBySlug(t).then(function(t){return e.setProject(t),r()})["catch"](function(t){return e.xhrError.response(t)})}}(this))},t.prototype.fetchProject=function(){var t;if(this.project)return t=this.project.get("slug"),this.projectsService.getProjectBySlug(t).then(function(t){return function(e){return t.setProject(e)}}(this))},t.prototype.hasPermission=function(t){return this._project.get("my_permissions").indexOf(t)!==-1},t.prototype.isEpicsDashboardEnabled=function(){return this._project.get("is_epics_activated")},t}(),angular.module("taigaCommon").service("tgProjectService",t)}.call(this),function(){var t,e,r=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;e=this.taiga,t=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return r(e,t),e}(e.Service=function(){return{use:function(t){var e;return e=$("link[rel='stylesheet']:first"),0===e.length&&(e=$(""),$("head").append(e)),e.attr("href","/"+window._version+"/styles/theme-"+t+".css")}}}),angular.module("taigaCommon").service("tgThemeService",t)}.call(this),function(){var t,e,r;r=this.taiga,e=this.taiga.groupBy,t=function(){function t(t){return this.timeout=t,window.localStorage.e2e?null:(window.addEventListener("mousemove",this.resetTimer.bind(this),!1),window.addEventListener("mousedown",this.resetTimer.bind(this),!1),window.addEventListener("keypress",this.resetTimer.bind(this),!1),window.addEventListener("mousewheel",this.resetTimer.bind(this),!1),window.addEventListener("touchmove",this.resetTimer.bind(this),!1),this.subscriptionsActive=[],this.subscriptionsInactive=[],this.isActive=!0,void this.startTimer())}return t.$inject=["$timeout"],t.prototype.idleTimeout=3e5,t.prototype.startTimer=function(){return this.timerId=this.timeout(this._fireInactive.bind(this),this.idleTimeout)},t.prototype.resetTimer=function(){return this.isActive||this._fireActive(),this.timeout.cancel(this.timerId),this.startTimer(),this.isActive=!0},t.prototype.onActive=function(t){return this.subscriptionsActive.push(t),this._unSubscriptionsActive.bind(this,t)},t.prototype.onInactive=function(t){return this.subscriptionsInactive.push(t),this._unSubscriptionsInactive.bind(this,t)},t.prototype._fireActive=function(){return this.subscriptionsActive.forEach(function(t){return t()})},t.prototype._fireInactive=function(){return this.isActive=!1,this.subscriptionsInactive.forEach(function(t){return t()})},t.prototype._unSubscriptionsActive=function(t){return this.subscriptionsActive=this.subscriptionsActive.filter(function(e){return e!==t})},t.prototype._unSubscriptionsInactive=function(t){return this.subscriptionsInactive=this.subscriptionsInactive.filter(function(e){return e!==t})},t}(),angular.module("taigaCommon").service("tgUserActivityService",t)}.call(this),function(){var t,e,r,n=function(t,e){function r(){this.constructor=t}for(var n in e)i.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},i={}.hasOwnProperty;r=this.taiga,e=r.bindMethods,t=function(t){function r(t){this.rs=t,e(this)}return n(r,t),r.$inject=["tgResources"],r.prototype.getUserByUserName=function(t){return this.rs.users.getUserByUsername(t)},r.prototype.getContacts=function(t,e){return this.rs.users.getContacts(t,e)},r.prototype.getLiked=function(t,e,r,n){return this.rs.users.getLiked(t,e,r,n)},r.prototype.getVoted=function(t,e,r,n){return this.rs.users.getVoted(t,e,r,n)},r.prototype.getWatched=function(t,e,r,n){return this.rs.users.getWatched(t,e,r,n)},r.prototype.getStats=function(t){return this.rs.users.getStats(t)},r.prototype.attachUserContactsToProjects=function(t,e){return this.getContacts(t).then(function(t){return e=e.map(function(e){var r;return r=t.filter(function(t){var r;return r=t.get("id"),e.get("members").indexOf(r)!==-1}),e=e.set("contacts",r)})})},r}(r.Service),angular.module("taigaCommon").service("tgUserService",t)}.call(this),function(){var t,e=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=function(t){function r(t,e){this.q=t,this.errorHandlingService=e}return e(r,t),r.$inject=["$q","tgErrorHandlingService"],r.prototype.notFound=function(){return this.errorHandlingService.notfound()},r.prototype.permissionDenied=function(){return this.errorHandlingService.permissionDenied()},r.prototype.response=function(t){return t&&(404===t.status?this.notFound():403===t.status&&this.permissionDenied()),this.q.reject(t)},r}(taiga.Service),angular.module("taigaCommon").service("tgXhrErrorService",t)}.call(this),function(){var t;t=function(t,e){var r,n,i;return i=[".jpg",".jpeg",".bmp",".gif",".png"],r=function(t){return t=t.toLowerCase(),_.some(i,function(e){return t.indexOf(e,t-e.length)!==-1})},n=function(n,i){var o,s;return o=r(n.attachment.get("url")),s=o?t.get("user-timeline/user-timeline-attachment/user-timeline-attachment-image.html"):t.get("user-timeline/user-timeline-attachment/user-timeline-attachment.html"),i.html(s),e(i.contents())(n),i.find("img").error(function(){return this.remove()})},{link:n,scope:{attachment:"=tgUserTimelineAttachment"}}},t.$inject=["$tgTemplate","$compile"],angular.module("taigaUserTimeline").directive("tgUserTimelineAttachment",t)}.call(this),function(){var t,e;e=this.taiga.unslugify,t=function(){function t(t,e){this.translate=t,this.sce=e}return t.$inject=["$translate","$sce"],t.prototype._fieldTranslationKey={status:"COMMON.FIELDS.STATUS",subject:"COMMON.FIELDS.SUBJECT",description_diff:"COMMON.FIELDS.DESCRIPTION",points:"COMMON.FIELDS.POINTS",assigned_to:"COMMON.FIELDS.ASSIGNED_TO",assigned_users:"COMMON.FIELDS.ASSIGNED_USERS",severity:"ISSUES.FIELDS.SEVERITY",priority:"ISSUES.FIELDS.PRIORITY",type:"ISSUES.FIELDS.TYPE",is_iocaine:"TASK.FIELDS.IS_IOCAINE",is_blocked:"COMMON.FIELDS.IS_BLOCKED",color:"COMMON.FIELDS.COLOR",due_date:"COMMON.FIELDS.DUE_DATE",due_date_reason:"COMMON.FIELDS.DUE_DATE_REASON"},t.prototype._params={username:function(t,e){var r,n,i;return i=t.getIn(["data","user"]),i.get("is_profile_visible")?(r=this.translate.instant("COMMON.SEE_USER_PROFILE",{username:i.get("username")}),n="user-profile:username=timeline.getIn(['data', 'user', 'username'])",this._getLink(n,i.get("name"),r)):this._getUsernameSpan(i.get("name"))},field_name:function(t,e){var r;return r=t.getIn(["data","value_diff","key"]),this.translate.instant(this._fieldTranslationKey[r])},project_name:function(t,e){var r;return r="project:project=timeline.getIn(['data', 'project', 'slug'])",this._getLink(r,t.getIn(["data","project","name"]))},new_value:function(t,e){var r,n,i;return _.isArray(t.getIn(["data","value_diff","value"]).toJS())?(i=t.getIn(["data","value_diff","value"]).get(1),null===i&&"assigned_to"===t.getIn(["data","value_diff","key"])&&(i=this.translate.instant("ACTIVITY.VALUES.UNASSIGNED")),null===i&&"assigned_users"===t.getIn(["data","value_diff","key"])?i=this.translate.instant("ACTIVITY.VALUES.UNASSIGNED"):"due_date"===t.getIn(["data","value_diff","key"])&&(i?(n=this.translate.instant("COMMON.PICKERDATE.FORMAT"),i=moment(i,"YYYY-MM-DD").format(n)):i=this.translate.instant("ACTIVITY.VALUES.NOT_SET")),r=i):r=t.getIn(["data","value_diff","value"]).first().get(1),_.escape(r)},sprint_name:function(t,e){var r;return r="project-taskboard:project=timeline.getIn(['data', 'project', 'slug']),sprint=timeline.getIn(['data', 'milestone', 'slug'])",this._getLink(r,t.getIn(["data","milestone","name"]))},us_name:function(t,e){var r,n,i,o;return n=this._getTimelineObj(t,e).get("userstory"),r={obj:"parent_userstory"},o=this._getDetailObjUrl(r),i="#"+n.get("ref")+" "+n.get("subject"),this._getLink(o,i)},related_us_name:function(t,e){var r,n,i;return r=t.getIn(["data","userstory"]),i="project-userstories-detail:project=timeline.getIn(['data', 'userstory', 'project', 'slug']),ref=timeline.getIn(['data', 'userstory', 'ref'])",n="#"+r.get("ref")+" "+r.get("subject"),this._getLink(i,n)},epic_name:function(t,e){var r,n,i;return r=t.getIn(["data","epic"]),i="project-epics-detail:project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['data', 'epic', 'ref'])",n="#"+r.get("ref")+" "+r.get("subject"),this._getLink(i,n)},obj_name:function(t,r){var n,i,o;return n=this._getTimelineObj(t,r),o=this._getDetailObjUrl(r),i="wikipage"===r.obj?e(n.get("slug")):"milestone"===r.obj?n.get("name"):"#"+n.get("ref")+" "+n.get("subject"),this._getLink(o,i)},role_name:function(t,e){return _.escape(t.getIn(["data","value_diff","value"]).keySeq().first())}},t.prototype._translateTitleParams=function(t,e,r){return this._params[t].call(this,e,r)},t.prototype._getTimelineObj=function(t,e){return t.getIn(["data",e.obj])},t.prototype._getDetailObjUrl=function(t){var e;return e={issue:["project-issues-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"],wikipage:["project-wiki-page",":project=timeline.getIn(['data', 'project', 'slug']),slug=timeline.getIn(['obj', 'slug'])"],task:["project-tasks-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"],userstory:["project-userstories-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"],parent_userstory:["project-userstories-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'userstory', 'ref'])"],milestone:["project-taskboard",":project=timeline.getIn(['data', 'project', 'slug']),sprint=timeline.getIn(['obj', 'slug'])"],epic:["project-epics-detail",":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"]},e[t.obj][0]+e[t.obj][1]},t.prototype._getLink=function(t,e,r){var n;return r=r||e,n=$("").attr("ng-non-bindable",!0).text(e),$("").attr("tg-nav",t).attr("title",r).append(n).prop("outerHTML")},t.prototype._getUsernameSpan=function(t){var e;return e=e||t,$("").addClass("username").text(t).prop("outerHTML")},t.prototype._getParams=function(t,e,r){var n;return n={},r.translate_params.forEach(function(r){return function(i){return n[i]=r._translateTitleParams(i,t,e)}}(this)),n},t.prototype.getTitle=function(t,e,r){var n,i,o;return n=this._getParams(t,e,r),i={},Object.keys(n).forEach(function(t){return i[t]="{{"+t+"}}"}),o=this.translate.instant(r.key,i),Object.keys(n).forEach(function(t){var e;return e="{{"+t+"}}",o=o.replace(new RegExp(e,"g"),n[t])}),o},t}(),angular.module("taigaUserTimeline").service("tgUserTimelineItemTitle",t)}.call(this),function(){var t,e;e=function(t,e){var r;return r=[{check:function(t,e){return"membership"===e.obj},key:"TIMELINE.NEW_MEMBER",translate_params:["project_name"],member:function(t){return Immutable.Map({user:t.getIn(["data","user"]),role:t.getIn(["data","role"])})}},{check:function(t,e){return"project"===e.obj&&"create"===e.type},key:"TIMELINE.NEW_PROJECT",translate_params:["username","project_name"],description:function(t){return t.getIn(["data","project","description"])}},{check:function(t,e){return"change"===e.type&&t.hasIn(["data","value_diff"])&&"attachments"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.UPLOAD_ATTACHMENT",translate_params:["username","obj_name"]},{check:function(t,e){return"userstory"===e.obj&&"create"===e.type},key:"TIMELINE.US_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"issue"===e.obj&&"create"===e.type},key:"TIMELINE.ISSUE_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"wikipage"===e.obj&&"create"===e.type},key:"TIMELINE.WIKI_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"task"===e.obj&&"create"===e.type&&!t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"task"===e.obj&&"create"===e.type&&t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_CREATED_WITH_US",translate_params:["username","project_name","obj_name","us_name"]},{check:function(t,e){return"milestone"===e.obj&&"create"===e.type},key:"TIMELINE.MILESTONE_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"epic"===e.obj&&"create"===e.type},key:"TIMELINE.EPIC_CREATED",translate_params:["username","project_name","obj_name"]},{check:function(t,e){return"relateduserstory"===e.obj&&"create"===e.type},key:"TIMELINE.EPIC_RELATED_USERSTORY_CREATED",translate_params:["username","project_name","related_us_name","epic_name"]},{check:function(t,e){return t.getIn(["data","comment"])&&"userstory"===e.obj},key:"TIMELINE.NEW_COMMENT_US",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.getIn(["data","comment"])&&"issue"===e.obj},key:"TIMELINE.NEW_COMMENT_ISSUE",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.getIn(["data","comment"])&&"task"===e.obj},key:"TIMELINE.NEW_COMMENT_TASK",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.getIn(["data","comment"])&&"epic"===e.obj},key:"TIMELINE.NEW_COMMENT_EPIC",translate_params:["username","obj_name"],description:function(t){var e;return e=t.getIn(["data","comment_html"]),$($.parseHTML(e)).text()}},{check:function(t,e){return t.hasIn(["data","value_diff"])&&"moveInBacklog"===t.getIn(["data","value_diff","key"])&&t.hasIn(["data","value_diff","value","backlog_order"])&&"change"===e.type},key:"TIMELINE.US_MOVED",translate_params:["username","obj_name"]},{check:function(t,e){return!(!t.hasIn(["data","value_diff"])||"moveInBacklog"!==t.getIn(["data","value_diff","key"])||"change"!==e.type||"userstory"!==e.obj)&&null===t.getIn(["data","value_diff","value","milestone"]).get(1)},key:"TIMELINE.US_REMOVED_FROM_MILESTONE",translate_params:["username","obj_name"]},{check:function(t,e){return t.hasIn(["data","value_diff"])&&"moveInBacklog"===t.getIn(["data","value_diff","key"])&&"change"===e.type&&"userstory"===e.obj},key:"TIMELINE.US_ADDED_MILESTONE",translate_params:["username","obj_name","sprint_name"]},{check:function(t,e){return!(!t.hasIn(["data","value_diff"])||"blocked"!==t.getIn(["data","value_diff","key"])||"change"!==e.type)&&t.getIn(["data","value_diff","value","is_blocked"]).get(1)===!0},key:"TIMELINE.BLOCKED",translate_params:["username","obj_name"],description:function(t){var e;return!!t.hasIn(["data","value_diff","value","blocked_note_html"])&&(e=t.getIn(["data","value_diff","value","blocked_note_html"]).get(1),$($.parseHTML(e)).text())}},{check:function(t,e){return!(!t.hasIn(["data","value_diff"])||"blocked"!==t.getIn(["data","value_diff","key"])||"change"!==e.type)&&t.getIn(["data","value_diff","value","is_blocked"]).get(1)===!1; },key:"TIMELINE.UNBLOCKED",translate_params:["username","obj_name"]},{check:function(t,e){return"milestone"===e.obj&&"change"===e.type},key:"TIMELINE.MILESTONE_UPDATED",translate_params:["username","obj_name"]},{check:function(t,e){return"wikipage"===e.obj&&"change"===e.type},key:"TIMELINE.WIKI_UPDATED",translate_params:["username","obj_name"]},{check:function(t,e){return"userstory"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"points"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.US_UPDATED_POINTS",translate_params:["username","field_name","obj_name","new_value","role_name"]},{check:function(t,e){return"userstory"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.US_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"userstory"===e.obj&&"change"===e.type},key:"TIMELINE.US_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"issue"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.ISSUE_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"issue"===e.obj&&"change"===e.type},key:"TIMELINE.ISSUE_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&!t.getIn(["data","task","userstory"])&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.TASK_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&t.getIn(["data","task","userstory"])&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.TASK_UPDATED_WITH_US",translate_params:["username","field_name","obj_name","us_name"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&!t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"task"===e.obj&&"change"===e.type&&t.getIn(["data","task","userstory"])},key:"TIMELINE.TASK_UPDATED_WITH_US_NEW_VALUE",translate_params:["username","field_name","obj_name","us_name","new_value"]},{check:function(t,e){return"epic"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"description_diff"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.EPIC_UPDATED",translate_params:["username","field_name","obj_name"]},{check:function(t,e){return"epic"===e.obj&&"change"===e.type&&t.hasIn(["data","value_diff"])&&"color"===t.getIn(["data","value_diff","key"])},key:"TIMELINE.EPIC_UPDATED_WITH_NEW_COLOR",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"epic"===e.obj&&"change"===e.type},key:"TIMELINE.EPIC_UPDATED_WITH_NEW_VALUE",translate_params:["username","field_name","obj_name","new_value"]},{check:function(t,e){return"user"===e.obj&&"create"===e.type},key:"TIMELINE.NEW_USER",translate_params:["username"]}],_.find(r,function(r){return r.check(t,e)})},t=function(){function t(){}return t.prototype.getType=function(t,r){return e(t,r)},t}(),angular.module("taigaUserTimeline").service("tgUserTimelineItemType",t)}.call(this),function(){var t;t=function(){return{templateUrl:"user-timeline/user-timeline-item/user-timeline-item.html",scope:{timeline:"=tgUserTimelineItem"}}},angular.module("taigaUserTimeline").directive("tgUserTimelineItem",t)}.call(this),function(){var t;t=function(){var t;return t={},t.generate=function(t){var e,r,n,i;return i=1,r=Immutable.List(),t.minItems=t.minItems||20,n=function(){return r=Immutable.List(),e()},e=function(){return t.fetch(i).then(function(n){var o;return i++,o=n.get("data"),t.filter&&(o=t.filter(o)),t.map&&(o=o.map(t.map)),r=r.concat(o),r.size