diff --git a/public/js/8.js b/public/js/8.js index 9c1f89f6c..68ce94b48 100644 --- a/public/js/8.js +++ b/public/js/8.js @@ -7,4 +7,4 @@ * @copyright The Financial Times Limited [All Rights Reserved] * @license MIT License (see LICENSE.txt) */function FastClick(a,b){"use strict";function c(a,b){return function(){return a.apply(b,arguments)}}var d;if(b=b||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=b.touchBoundary||10,this.layer=a,this.tapDelay=b.tapDelay||200,!FastClick.notNeeded(a)){for(var e=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],f=this,g=0,h=e.length;h>g;g++)f[e[g]]=c(f[e[g]],f);deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;"click"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),"function"==typeof a.onclick&&(d=a.onclick,a.addEventListener("click",function(a){d(a)},!1),a.onclick=null)}}var deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),deviceIsIOS4=deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),deviceIsIOSWithBadTarget=deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),deviceIsBlackBerry10=navigator.userAgent.indexOf("BB10")>0;FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(a.className)},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!deviceIsAndroid;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.sendClick=function(a,b){"use strict";var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],(c=document.createEvent("MouseEvents")).initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},FastClick.prototype.determineEventType=function(a){"use strict";return deviceIsAndroid&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(a){"use strict";var b;deviceIsIOS&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},FastClick.prototype.updateScrollParent=function(a){"use strict";var b,c;if(!(b=a.fastClickScrollParent)||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(a){"use strict";return a.nodeType===Node.TEXT_NODE?a.parentNode:a},FastClick.prototype.onTouchStart=function(a){"use strict";var b,c,d;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],deviceIsIOS){if((d=window.getSelection()).rangeCount&&!d.isCollapsed)return!0;if(!deviceIsIOS4){if(c.identifier&&c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTimec||Math.abs(b.pageY-this.touchStartY)>c},FastClick.prototype.onTouchMove=function(a){"use strict";return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0)},FastClick.prototype.findControl=function(a){"use strict";return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d,e,f,g=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime100||deviceIsIOS&&window.top!==window&&"input"===d?(this.targetElement=null,!1):(this.focus(g),this.sendClick(g,a),deviceIsIOS&&"select"===d||(this.targetElement=null,a.preventDefault()),!1);return!(!deviceIsIOS||deviceIsIOS4||(e=g.fastClickScrollParent,!e||e.fastClickLastScrollTop===e.scrollTop))||(this.needsClick(g)||(a.preventDefault(),this.sendClick(g,a)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(a){"use strict";return!this.targetElement||(!!a.forwardedTouchEvent||(!(a.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick))||(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1)))},FastClick.prototype.onClick=function(a){"use strict";var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail||((b=this.onMouse(a))||(this.targetElement=null),b)},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(a){"use strict";var b,c,d;if(void 0===window.ontouchstart)return!0;if(c=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!deviceIsAndroid)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(c>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(deviceIsBlackBerry10&&((d=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/))[1]>=10&&d[2]>=3&&(b=document.querySelector("meta[name=viewport]")))){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===a.style.msTouchAction},FastClick.attach=function(a,b){"use strict";return new FastClick(a,b)},void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){"use strict";return FastClick}.call(exports,__webpack_require__,exports,module))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},45:function(module,exports,__webpack_require__){(function(jQuery){/*! http://mths.be/placeholder v2.0.8 by @mathias */ -!function(a,b,c){function e(a,b){var d=this,e=c(d);if(d.value==e.attr("placeholder")&&e.hasClass("placeholder"))if(e.data("placeholder-password")){if(e=e.hide().next().show().attr("id",e.removeAttr("id").data("placeholder-id")),!0===a)return e[0].value=b;e.focus()}else d.value="",e.removeClass("placeholder"),d==g()&&d.select()}function f(){var a,b=this,f=c(b),g=this.id;if(""==b.value){if("password"==b.type){if(!f.data("placeholder-textinput")){try{a=f.clone().attr({type:"text"})}catch(h){a=c("").attr(c.extend(function(a){var b={},d=/^jQuery\d+$/;return c.each(a.attributes,function(a,c){c.specified&&!d.test(c.name)&&(b[c.name]=c.value)}),b}(this),{type:"text"}))}a.removeAttr("name").data({"placeholder-password":f,"placeholder-id":g}).bind("focus.placeholder",e),f.data({"placeholder-textinput":a,"placeholder-id":g}).before(a)}f=f.removeAttr("id").hide().prev().attr("id",g).show()}f.addClass("placeholder"),f[0].value=f.attr("placeholder")}else f.removeClass("placeholder")}function g(){try{return b.activeElement}catch(a){}}var h,i,j="[object OperaMini]"==Object.prototype.toString.call(a.operamini),k="placeholder"in b.createElement("input")&&!j,l="placeholder"in b.createElement("textarea")&&!j,m=c.fn,n=c.valHooks,o=c.propHooks;k&&l?(i=m.placeholder=function(){return this}).input=i.textarea=!0:((i=m.placeholder=function(){return this.filter((k?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":e,"blur.placeholder":f}).data("placeholder-enabled",!0).trigger("blur.placeholder"),this}).input=k,i.textarea=l,h={get:function(a){var b=c(a),d=b.data("placeholder-password");return d?d[0].value:b.data("placeholder-enabled")&&b.hasClass("placeholder")?"":a.value},set:function(a,b){var d=c(a),h=d.data("placeholder-password");return h?h[0].value=b:d.data("placeholder-enabled")?(""==b?(a.value=b,a!=g()&&f.call(a)):d.hasClass("placeholder")&&e.call(a,!0,b)||(a.value=b),d):a.value=b}},k||(n.input=h,o.value=h),l||(n.textarea=h,o.value=h),c(function(){c(b).delegate("form","submit.placeholder",function(){var a=c(".placeholder",this).each(e);setTimeout(function(){a.each(f)},10)})}),c(a).bind("beforeunload.placeholder",function(){c(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery)}).call(this,__webpack_require__(0))},450:function(module,exports){},46:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;/*! pace 0.5.3 */(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W=[].slice,X={}.hasOwnProperty,Y=function(a,b){function c(){this.constructor=a}for(var d in b)X.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},Z=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(t={catchupTime:500,initialRate:.03,minTime:500,ghostTime:500,maxProgressPerFrame:10,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},B=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?a:+new Date},D=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,s=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==D&&(D=function(a){return setTimeout(a,50)},s=function(a){return clearTimeout(a)}),F=function(a){var b,c;return b=B(),(c=function(){var d;return(d=B()-b)>=33?(b=B(),a(d,function(){return D(c)})):setTimeout(c,33-d)})()},E=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?W.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},u=function(){var a,b,c,d,e,f,g;for(b=arguments[0],f=0,g=(d=2<=arguments.length?W.call(arguments,1):[]).length;g>f;f++)if(c=d[f])for(a in c)X.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?u(b[a],e):b[a]=e);return b},p=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},w=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];cP;P++)!0===C[J=T[P]]&&(C[J]=t[J]);i=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return Y(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(!(a=document.querySelector(C.target)))throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='
\n
\n
\n
',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return(a=this.getElement()).className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b;return null!=document.querySelector(C.target)&&((a=this.getElement()).children[0].style.width=this.progress+"%",(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",(0|this.progress)+"%"),this.progress>=100?b="99":(b=this.progress<10?"0":"",b+=0|this.progress),a.children[0].setAttribute("data-progress",""+b)),this.lastRenderedProgress=this.progress)},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(g=[],d=0,e=(f=this.bindings[a]).length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),O=window.XMLHttpRequest,N=window.XDomainRequest,M=window.WebSocket,v=function(a,b){var d,e,f;for(d in f=[],b.prototype)try{e=b.prototype[d],f.push(null==a[d]&&"function"!=typeof e?a[d]=e:void 0)}catch(g){g}return f},z=[],Pace.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?W.call(arguments,1):[],z.unshift("ignore"),c=b.apply(null,a),z.shift(),c},Pace.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?W.call(arguments,1):[],z.unshift("track"),c=b.apply(null,a),z.shift(),c},I=function(a){var b;if(null==a&&(a="GET"),"track"===z[0])return"force";if(!z.length&&C.ajax){if("socket"===a&&C.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),Z.call(C.ajax.trackMethods,b)>=0)return!0}return!1},j=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return I(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new O(b),a(c),c},v(window.XMLHttpRequest,O),null!=N&&(window.XDomainRequest=function(){var b;return b=new N,a(b),b},v(window.XDomainRequest,N)),null!=M&&C.ajax.trackWebSockets&&(window.WebSocket=function(a,b){var d;return d=null!=b?new M(a,b):new M(a),I("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d},v(window.WebSocket,M))}return Y(b,h),b}(),Q=null,H=function(a){var b,c,d,e;for(c=0,d=(e=C.ajax.ignoreURLs).length;d>c;c++)if("string"==typeof(b=e[c])){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},(x=function(){return null==Q&&(Q=new j),Q})().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,H(g)?void 0:Pace.running||!1===C.restartOnRequestAfter&&"force"!==I(f)?void 0:(d=arguments,"boolean"==typeof(c=C.restartOnRequestAfter||0)&&(c=0),setTimeout(function(){var c,g,h,i,j;if("socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(Pace.restart(),j=[],c=0,g=(i=Pace.sources).length;g>c;c++){if((J=i[c])instanceof a){J.watch.apply(J,d);break}j.push(void 0)}return j}},c))}),a=function(){function a(){var a=this;this.elements=[],x().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,H(e)?void 0:(c="socket"===d?new m(b):new n(b),this.elements.push(c))},a}(),n=function(){return function(a){var b,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2}),d=0,e=(g=["load","abort","timeout","error"]).length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100});else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}}(),m=function(){return function(a){var b,c,d,e,f=this;for(this.progress=0,c=0,d=(e=["error","open"]).length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100})}}(),d=function(){return function(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),c=0,d=(f=a.selectors).length;d>c;c++)b=f[c],this.elements.push(new e(b))}}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},C.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){return function(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=B(),b=setInterval(function(){var g;return g=B()-c-50,c=B(),e.push(g),e.length>C.eventLag.sampleCount&&e.shift(),a=p(e),++d>=C.eventLag.minSamples&&a=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/C.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,C.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+C.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),K=null,G=null,q=null,L=null,o=null,r=null,Pace.running=!1,y=function(){return C.restartOnPushState?Pace.restart():void 0},null!=window.history.pushState&&(S=window.history.pushState,window.history.pushState=function(){return y(),S.apply(window.history,arguments)}),null!=window.history.replaceState&&(V=window.history.replaceState,window.history.replaceState=function(){return y(),V.apply(window.history,arguments)}),k={ajax:a,elements:d,document:c,eventLag:f},(A=function(){var a,c,d,e,f,g,h,i;for(Pace.sources=K=[],c=0,e=(g=["ajax","elements","document","eventLag"]).length;e>c;c++)!1!==C[a=g[c]]&&K.push(new k[a](C[a]));for(d=0,f=(i=null!=(h=C.extraSources)?h:[]).length;f>d;d++)J=i[d],K.push(new J(C));return Pace.bar=q=new b,G=[],L=new l})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,q.destroy(),r=!0,null!=o&&("function"==typeof s&&s(o),o=null),A()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){var a;return Pace.running=!0,q.render(),a=B(),r=!1,o=F(function(b,c){var d,e,f,g,h,i,j,m,n,o,p,s,t,u,v;for(100-q.progress,e=o=0,f=!0,i=p=0,t=K.length;t>p;i=++p)for(J=K[i],n=null!=G[i]?G[i]:G[i]=[],j=s=0,u=(h=null!=(v=J.elements)?v:[J]).length;u>s;j=++s)g=h[j],f&=(m=null!=n[j]?n[j]:n[j]=new l(g)).done,m.done||(e++,o+=m.tick(b));return d=o/e,q.update(L.tick(b,d)),q.done()||f||r?(q.update(100),Pace.trigger("done"),setTimeout(function(){return q.finish(),Pace.running=!1,Pace.trigger("hide")},Math.max(C.ghostTime,Math.max(C.minTime-(B()-a),0)))):c()})},Pace.start=function(a){u(C,a),Pace.running=!0;try{q.render()}catch(b){i=b}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return Pace}.call(exports,__webpack_require__,exports,module))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}).call(this)},47:function(module,exports,__webpack_require__){(function(jQuery){var $;($=jQuery).idleTimer=function(firstParam,elem){var opts;"object"==typeof firstParam?(opts=firstParam,firstParam=null):"number"==typeof firstParam&&(opts={timeout:firstParam},firstParam=null),elem=elem||document,opts=$.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},opts);var jqElem=$(elem),obj=jqElem.data("idleTimerObj")||{},toggleIdleState=function(e){var obj=$.data(elem,"idleTimerObj")||{};obj.idle=!obj.idle,obj.olddate=+new Date;var event=$.Event((obj.idle?"idle":"active")+".idleTimer");$(elem).trigger(event,[elem,$.extend({},obj),e])},handleEvent=function(e){var obj=$.data(elem,"idleTimerObj")||{};if(("storage"!==e.type||e.originalEvent.key===obj.timerSyncId)&&null==obj.remaining){if("mousemove"===e.type){if(e.pageX===obj.pageX&&e.pageY===obj.pageY)return;if(void 0===e.pageX&&void 0===e.pageY)return;if(+new Date-obj.olddate<200)return}clearTimeout(obj.tId),obj.idle&&toggleIdleState(e),obj.lastActive=+new Date,obj.pageX=e.pageX,obj.pageY=e.pageY,"storage"!==e.type&&obj.timerSyncId&&"undefined"!=typeof localStorage&&localStorage.setItem(obj.timerSyncId,obj.lastActive),obj.tId=setTimeout(toggleIdleState,obj.timeout)}},reset=function(){var obj=$.data(elem,"idleTimerObj")||{};obj.idle=obj.idleBackup,obj.olddate=+new Date,obj.lastActive=obj.olddate,obj.remaining=null,clearTimeout(obj.tId),obj.idle||(obj.tId=setTimeout(toggleIdleState,obj.timeout))};if(null===firstParam&&void 0!==obj.idle)return reset(),jqElem;if(null===firstParam);else{if(null!==firstParam&&void 0===obj.idle)return!1;if("destroy"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};clearTimeout(obj.tId),jqElem.removeData("idleTimerObj"),jqElem.off("._idleTimer")}(),jqElem;if("pause"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};null==obj.remaining&&(obj.remaining=obj.timeout-(+new Date-obj.olddate),clearTimeout(obj.tId))}(),jqElem;if("resume"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};null!=obj.remaining&&(obj.idle||(obj.tId=setTimeout(toggleIdleState,obj.remaining)),obj.remaining=null)}(),jqElem;if("reset"===firstParam)return reset(),jqElem;if("getRemainingTime"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};if(obj.idle)return 0;if(null!=obj.remaining)return obj.remaining;var remaining=obj.timeout-(+new Date-obj.lastActive);return remaining<0&&(remaining=0),remaining}();if("getElapsedTime"===firstParam)return+new Date-obj.olddate;if("getLastActiveTime"===firstParam)return obj.lastActive;if("isIdle"===firstParam)return obj.idle}return jqElem.on($.trim((opts.events+" ").split(" ").join("._idleTimer ")),function(e){handleEvent(e)}),opts.timerSyncId&&$(window).bind("storage",handleEvent),(obj=$.extend({},{olddate:+new Date,lastActive:+new Date,idle:opts.idle,idleBackup:opts.idle,timeout:opts.timeout,remaining:null,timerSyncId:opts.timerSyncId,tId:null,pageX:null,pageY:null})).idle||(obj.tId=setTimeout(toggleIdleState,obj.timeout)),$.data(elem,"idleTimerObj",obj),jqElem},$.fn.idleTimer=function(firstParam){return this[0]?$.idleTimer(firstParam,this[0]):this}}).call(this,__webpack_require__(0))},48:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var react=__webpack_require__(50),react_default=__webpack_require__.n(react),react_dom=__webpack_require__(73),react_dom_default=__webpack_require__.n(react_dom),redux=__webpack_require__(105),es=__webpack_require__(52),redux_saga_es=__webpack_require__(524),redux_saga_thunk=__webpack_require__(252),handleActions=__webpack_require__(525),immutable_es=__webpack_require__(67),lib=__webpack_require__(330);const PENDING="PENDING",ERROR="ERROR",SUCCESS="SUCCESS",SHOW_MODAL=Object(lib.defineAction)("SHOW_MODAL"),HIDE_MODAL=Object(lib.defineAction)("HIDE_MODAL"),CLEAR_MODAL=Object(lib.defineAction)("CLEAR_MODAL"),SHOW_NOTICE=Object(lib.defineAction)("SHOW_NOTICE",[SUCCESS]),CLEAR_NOTICE=Object(lib.defineAction)("CLEAR_NOTICE"),SET_SESSION_USER=Object(lib.defineAction)("SET_SESSION_USER"),FETCH_ROLES=Object(lib.defineAction)("FETCH_ROLES",[SUCCESS,ERROR]),UPDATE_ROLE_ORDER=Object(lib.defineAction)("UPDATE_ROLE_ORDER",[SUCCESS,ERROR]),NAV_CHANGE=Object(lib.defineAction)("NAV_CHANGE"),FETCH_TICKETS=Object(lib.defineAction)("FETCH_TICKETS",[SUCCESS,PENDING,ERROR]),CREATE_TICKET=Object(lib.defineAction)("CREATE_TICKET",[PENDING,SUCCESS,ERROR]),DELETE_TICKET=Object(lib.defineAction)("DELETE_TICKET",[SUCCESS,PENDING,ERROR]),UNLOAD_TICKETS=Object(lib.defineAction)("UNLOAD_TICKETS",[SUCCESS]),TICKET_UPDATED=Object(lib.defineAction)("TICKET_UPDATED",[SUCCESS]),TICKET_EVENT=Object(lib.defineAction)("TICKET_EVENT",[SUCCESS]),CREATE_TICKET_TYPE=Object(lib.defineAction)("CREATE_TICKET_TYPE",[SUCCESS,ERROR]),RENAME_TICKET_TYPE=Object(lib.defineAction)("RENAME_TICKET_TYPE",[SUCCESS,ERROR]),DELETE_TICKET_TYPE=Object(lib.defineAction)("DELETE_TICKET_TYPE",[SUCCESS,ERROR]),CREATE_PRIORITY=Object(lib.defineAction)("CREATE_PRIORITY",[SUCCESS,ERROR]),UPDATE_PRIORITY=Object(lib.defineAction)("UPDATE_PRIORITY",[SUCCESS,ERROR]),DELETE_PRIORITY=Object(lib.defineAction)("DELETE_PRIORITY",[SUCCESS,ERROR]),GET_TAGS_WITH_PAGE=Object(lib.defineAction)("GET_TAGS_WITH_PAGE",[SUCCESS,ERROR]),TAGS_UPDATE_CURRENT_PAGE=Object(lib.defineAction)("TAGS_UPDATE_CURRENT_PAGE",[SUCCESS,ERROR]),CREATE_TAG=Object(lib.defineAction)("CREATE_TAG",[SUCCESS,ERROR]),FETCH_ACCOUNTS=Object(lib.defineAction)("FETCH_ACCOUNTS",[PENDING,SUCCESS,ERROR]),CREATE_ACCOUNT=Object(lib.defineAction)("CREATE_ACCOUNT",[PENDING,SUCCESS,ERROR]),SAVE_EDIT_ACCOUNT=Object(lib.defineAction)("SAVE_EDIT_ACCOUNT",[PENDING,SUCCESS,ERROR]),DELETE_ACCOUNT=Object(lib.defineAction)("DELETE_ACCOUNT",[PENDING,SUCCESS,ERROR]),ENABLE_ACCOUNT=Object(lib.defineAction)("ENABLE_ACCOUNT",[SUCCESS,ERROR]),UNLOAD_ACCOUNTS=Object(lib.defineAction)("UNLOAD_ACCOUNTS",[SUCCESS]),FETCH_GROUPS=Object(lib.defineAction)("FETCH_GROUPS",[PENDING,SUCCESS,ERROR]),CREATE_GROUP=Object(lib.defineAction)("CREATE_GROUP",[SUCCESS,PENDING,ERROR]),UPDATE_GROUP=Object(lib.defineAction)("UPDATE_GROUP",[SUCCESS,PENDING,ERROR]),DELETE_GROUP=Object(lib.defineAction)("DELETE_GROUP",[SUCCESS,PENDING,ERROR]),UNLOAD_GROUPS=Object(lib.defineAction)("UNLOAD_GROUPS",[SUCCESS]),FETCH_TEAMS=Object(lib.defineAction)("FETCH_TEAMS",[PENDING,SUCCESS,ERROR]),CREATE_TEAM=Object(lib.defineAction)("CREATE_TEAM",[PENDING,SUCCESS,ERROR]),SAVE_EDIT_TEAM=Object(lib.defineAction)("SAVE_EDIT_TEAM",[PENDING,SUCCESS,ERROR]),DELETE_TEAM=Object(lib.defineAction)("DELETE_TEAM",[PENDING,SUCCESS,ERROR]),UNLOAD_TEAMS=Object(lib.defineAction)("UNLOAD_TEAMS",[SUCCESS]),FETCH_DEPARTMENTS=Object(lib.defineAction)("FETCH_DEPARTMENTS",[PENDING,SUCCESS,ERROR]),CREATE_DEPARTMENT=Object(lib.defineAction)("CREATE_DEPARTMENT",[PENDING,SUCCESS,ERROR]),UPDATE_DEPARTMENT=Object(lib.defineAction)("UPDATE_DEPARTMENT",[SUCCESS,PENDING,ERROR]),DELETE_DEPARTMENT=Object(lib.defineAction)("DELETE_DEPARTMENT",[SUCCESS,PENDING,ERROR]),UNLOAD_DEPARTMENTS=Object(lib.defineAction)("UNLOAD_DEPARTMENTS",[SUCCESS]),FETCH_SEARCH_RESULTS=Object(lib.defineAction)("FETCH_SEARCH_RESULTS",[SUCCESS,PENDING,ERROR]),UNLOAD_SEARCH_RESULTS=Object(lib.defineAction)("UNLOAD_SEARCH_RESULTS",[SUCCESS]),FETCH_SETTINGS=Object(lib.defineAction)("FETCH_SETTINGS",[SUCCESS,ERROR]),UPDATE_SETTING=Object(lib.defineAction)("UPDATE_SETTING",[SUCCESS,ERROR]),UPDATE_MULTIPLE_SETTINGS=Object(lib.defineAction)("UPDATE_MULTIPLE_SETTINGS",[SUCCESS,ERROR]),UPDATE_COLORSCHEME=Object(lib.defineAction)("UPDATE_COLORSCHEME",[SUCCESS,ERROR]),FETCH_MONGODB_TOOLS=Object(lib.defineAction)("FETCH_MONGODB_TOOLS",[SUCCESS,ERROR]),FETCH_BACKUPS=Object(lib.defineAction)("FETCH_BACKUPS",[SUCCESS,ERROR]),BACKUP_NOW=Object(lib.defineAction)("BACKUP_NOW",[PENDING,SUCCESS,ERROR]),FETCH_DELETED_TICKETS=Object(lib.defineAction)("FETCH_DELETED_TICKETS",[PENDING,SUCCESS,ERROR]),RESTORE_DELETED_TICKET=Object(lib.defineAction)("RESTORE_DELETED_TICKET",[SUCCESS,ERROR]),CHANGE_DELETED_TICKETS_PAGE=Object(lib.defineAction)("CHANGE_DELETED_TICKETS_PAGE"),UPDATE_PERMISSIONS=Object(lib.defineAction)("UPDATE_PERMISSIONS",[PENDING,SUCCESS,ERROR]),CREATE_ROLE=Object(lib.defineAction)("CREATE_ROLE",[SUCCESS,ERROR]),DELETE_ROLE=Object(lib.defineAction)("DELETE_ROLE",[SUCCESS,ERROR]),initialState={sessionUser:null,roles:Object(immutable_es.a)([]),roleOrder:Object(immutable_es.b)({}),notice:null};var reducers_shared=Object(handleActions.a)({[SET_SESSION_USER]:(state,action)=>({...state,sessionUser:action.payload.sessionUser}),[SHOW_NOTICE]:(state,action)=>({...state,notice:Object(immutable_es.c)(action.payload)}),[CLEAR_NOTICE]:state=>({...state,notice:null}),[FETCH_ROLES.SUCCESS]:(state,action)=>({...state,roles:Object(immutable_es.c)(action.response.roles),roleOrder:Object(immutable_es.c)(action.response.roleOrder)}),[UPDATE_ROLE_ORDER.SUCCESS]:(state,action)=>({...state,roleOrder:Object(immutable_es.c)(action.response.roleOrder)})},initialState);const common_initialState={};var common=function(state=common_initialState,action){return action.type,state},uikit_combined_min=__webpack_require__(5),uikit_combined_min_default=__webpack_require__.n(uikit_combined_min);const modalReducer_initialState={modalType:null,modalProps:{}};var modalReducer=Object(handleActions.a)({[SHOW_MODAL]:(state,action)=>({modalType:action.payload.modalType,modalProps:action.payload.modalProps}),[HIDE_MODAL]:(state,action)=>{const modal=document.getElementById("uk-modal");if(modal){const modalTag=modal.getAttribute("data-modal-tag");modalTag===action.payload?uikit_combined_min_default.a.modal(modal).hide():modalTag||uikit_combined_min_default.a.modal(modal).hide()}return state},[CLEAR_MODAL]:()=>({...modalReducer_initialState})},modalReducer_initialState);var reducers_sidebarReducer=Object(handleActions.a)({[NAV_CHANGE]:(state,action)=>({activeItem:action.payload.activeItem,activeSubItem:action.payload.activeSubItem,plugins:null})},{activeItem:"",activeSubItem:"",plugins:null}),lodash=__webpack_require__(14),helpers=__webpack_require__(9),helpers_default=__webpack_require__.n(helpers);const settings_initialState={loaded:!1,settings:Object(immutable_es.b)({}),hasMongoDBTools:!1,backingup:!1,backups:Object(immutable_es.a)([]),deletedTicketsCount:0,allDeletedTickets:Object(immutable_es.a)([]),deletedTickets:Object(immutable_es.a)([])};var reducers_settings=Object(handleActions.a)({[FETCH_SETTINGS.SUCCESS]:(state,action)=>({...state,settings:Object(immutable_es.c)(action.response.settings.data),loaded:!0}),[UPDATE_SETTING.SUCCESS]:(state,action)=>{const updatedSetting=Object(lodash.find)(action.response.updatedSettings,{name:action.payload.name});return{...state,loaded:state.loaded,settings:state.settings.setIn(["settings",action.payload.stateName],updatedSetting)}},[UPDATE_SETTING.ERROR]:(state,action)=>(helpers_default.a.UI.showSnackbar("Error: "+action.error,!0),{...state,loaded:state.loaded,settings:state.settings}),[UPDATE_MULTIPLE_SETTINGS.SUCCESS]:state=>({...state,loaded:state.loaded,settings:state.settings}),[FETCH_MONGODB_TOOLS.SUCCESS]:(state,action)=>({...state,hasMongoDBTools:action.response.success}),[FETCH_BACKUPS.SUCCESS]:(state,action)=>({...state,backups:Object(immutable_es.c)(action.response.files)}),[BACKUP_NOW.PENDING]:state=>({...state,backingup:!0}),[BACKUP_NOW.SUCCESS]:state=>({...state,backingup:!1}),[BACKUP_NOW.ERROR]:state=>({...state,backingup:!1}),[FETCH_DELETED_TICKETS.SUCCESS]:(state,action)=>({...state,deletedTicketsCount:action.response.deletedTickets.length,allDeletedTickets:Object(immutable_es.c)(action.response.deletedTickets),deletedTickets:Object(immutable_es.c)(action.response.deletedTickets.slice(0,15))}),[RESTORE_DELETED_TICKET.SUCCESS]:(state,action)=>{const deletedIdx=state.deletedTickets.findIndex(i=>i.get("_id")===action.payload._id),allDeletedIdx=state.allDeletedTickets.findIndex(i=>i.get("_id")===action.payload._id);return{...state,allDeletedTickets:state.allDeletedTickets.splice(allDeletedIdx,1),deletedTickets:state.deletedTickets.splice(deletedIdx,1)}},[CHANGE_DELETED_TICKETS_PAGE]:(state,action)=>{const pageIndex=action.payload.pageIndex;return{...state,deletedTickets:state.allDeletedTickets.slice(15*pageIndex,15*(pageIndex+1))}}},settings_initialState),isUndefined=__webpack_require__(332),isUndefined_default=__webpack_require__.n(isUndefined);const ticketsReducer_initialState={tickets:Object(immutable_es.a)([]),totalCount:"",viewType:"active",loading:!1,nextPage:1,prevPage:0};var ticketsReducer=Object(handleActions.a)({[FETCH_TICKETS.PENDING]:(state,action)=>({...state,viewType:action.payload.type,loading:!0}),[FETCH_TICKETS.SUCCESS]:(state,action)=>({...state,tickets:Object(immutable_es.c)(action.response.tickets||[]),prevPage:Object(immutable_es.c)(action.response.prevPage),nextPage:Object(immutable_es.c)(action.response.nextPage),totalCount:action.response.totalCount?Object(immutable_es.c)(action.response.totalCount.toString()):action.response.tickets.length.toString(),loading:!1}),[FETCH_TICKETS.ERROR]:(state,action)=>({...state,loading:!1}),[CREATE_TICKET.SUCCESS]:(state,action)=>({...state}),[DELETE_TICKET.SUCCESS]:(state,action)=>{const idx=state.tickets.findIndex(ticket=>ticket.get("_id")===action.payload.id);return{...state,tickets:state.tickets.delete(idx)}},[TICKET_EVENT.SUCCESS]:(state,action)=>{switch(action.payload.type){case"created":{const ticket=action.payload.data;return{...state,tickets:state.tickets.insert(0,Object(immutable_es.c)(ticket))}}case"deleted":{const id=action.payload.data,idx=state.tickets.findIndex(ticket=>ticket.get("_id")===id);return{...state,tickets:state.tickets.delete(idx)}}default:return{...state}}},[TICKET_UPDATED.SUCCESS]:(state,action)=>{const ticket=action.payload.ticket,userGroupIds=action.sessionUser.groups,idx=state.tickets.findIndex(t=>t.get("_id")===ticket._id),inView=function(view,status,assignee,userId,userGroupIds,groupId){let hasView=!1,hasGroup=!1;switch(view){case"filter":hasView=!0;break;case"all":hasView=-1!==[0,1,2,3].indexOf(status);break;case"active":hasView=-1!==[0,1,2].indexOf(status);break;case"assigned":hasView=assignee===userId;break;case"unassigned":hasView=isUndefined_default()(assignee);break;case"new":hasView=0===status;break;case"open":hasView=1===status;break;case"pending":hasView=2===status;break;case"closed":hasView=3===status;break;default:hasView=!1}return(hasGroup=!isUndefined_default()(userGroupIds)&&!isUndefined_default()(groupId)&&-1!==userGroupIds.indexOf(groupId))&&hasView}(state.viewType,ticket.status,ticket.assignee?ticket.assignee._id:void 0,action.sessionUser._id,userGroupIds,ticket.group._id);if(!inView&&-1!==idx)return{...state,tickets:state.tickets.delete(idx)};if(!inView)return{...state};if(-1===idx){const withTicket=state.tickets.push(Object(immutable_es.c)(ticket));return{...state,tickets:withTicket.sortBy(t=>-t.get("uid"))}}return{...state,tickets:state.tickets.set(idx,Object(immutable_es.c)(ticket))}},[UNLOAD_TICKETS.SUCCESS]:state=>({...state,tickets:state.tickets.clear(),loading:!1})},ticketsReducer_initialState);const tagsReducer_initialState={loading:!0,totalCount:0,tags:Object(immutable_es.a)([]),currentPage:0};var reducers_tagsReducer=Object(handleActions.a)({[GET_TAGS_WITH_PAGE.SUCCESS]:(state,action)=>({...state,loading:!1,totalCount:action.response.count,tags:Object(immutable_es.c)(action.response.tags)}),[GET_TAGS_WITH_PAGE.ERROR]:(state,action)=>({...state,loading:!1}),[TAGS_UPDATE_CURRENT_PAGE]:(state,action)=>({...state,currentPage:action.payload.currentPage})},tagsReducer_initialState);const accountsReducer_initialState={accounts:Object(immutable_es.a)([]),type:"customers",loading:!1};var accountsReducer=Object(handleActions.a)({[FETCH_ACCOUNTS.PENDING]:state=>({...state,loading:!0}),[FETCH_ACCOUNTS.SUCCESS]:(state,action)=>{let arr=state.accounts.toArray();return action.payload.response.accounts.map(i=>{arr.push(i)}),{...state,accounts:Object(immutable_es.c)(arr),type:action.payload.payload&&action.payload.payload.type?action.payload.payload.type:"customers",loading:!1}},[CREATE_ACCOUNT.SUCCESS]:(state,action)=>{const resAccount=action.response.account;if(!resAccount.role.isAgent&&!resAccount.role.isAdmin&&"customers"!==state.type)return{...state};if(resAccount.role.isAgent||resAccount.role.isAdmin&&"customers"===state.type)return{...state};if(resAccount.role.isAdmin&&!resAccount.role.isAgent&&"agents"===state.type)return{...state};if(resAccount.role.isAgent&&!resAccount.role.isAdmin&&"admins"===state.type)return{...state};const insertedAccount=state.accounts.push(Object(immutable_es.c)(resAccount));return{...state,accounts:insertedAccount.sortBy(account=>account.get("fullname"))}},[SAVE_EDIT_ACCOUNT.SUCCESS]:(state,action)=>{const resUser=action.response.user,accountIndex=state.accounts.findIndex(u=>u.get("_id")===resUser._id),customer=!resUser.role.isAdmin&&!resUser.role.isAgent;let accounts=null;return"agents"!==state.type&&"admins"!==state.type||customer?("agents"!==state.type&&"admins"!==state.type||!customer)&&("customers"!==state.type||customer)?"customers"===state.type&&customer&&(accounts=state.accounts.set(accountIndex,Object(immutable_es.c)(resUser))):accounts=state.accounts.remove(accountIndex):accounts=state.accounts.set(accountIndex,Object(immutable_es.c)(resUser)),{...state,accounts}},[DELETE_ACCOUNT.PENDING]:(state,action)=>{const accountIndex=state.accounts.findIndex(u=>u.get("username")===action.payload.username);return{...state,accounts:state.accounts.setIn([accountIndex,"loading"],!0)}},[DELETE_ACCOUNT.SUCCESS]:(state,action)=>{const isDisabled=action.response.disabled,accountIndex=state.accounts.findIndex(u=>u.get("username")===action.payload.username);let withDisabled;return withDisabled=(withDisabled=state.accounts.setIn([accountIndex,"deleted"],isDisabled)).setIn([accountIndex,"loading"],!1),isDisabled||(withDisabled=state.accounts.delete(accountIndex)),{...state,accounts:withDisabled}},[ENABLE_ACCOUNT.SUCCESS]:(state,action)=>{const accountIndex=state.accounts.findIndex(u=>u.get("username")===action.payload.username);return{...state,accounts:state.accounts.setIn([accountIndex,"deleted"],!1)}},[UNLOAD_ACCOUNTS.SUCCESS]:state=>({...state,accounts:state.accounts.clear()})},accountsReducer_initialState);const groupsReducer_initialState={groups:Object(immutable_es.a)([])};var groupsReducer=Object(handleActions.a)({[FETCH_GROUPS.SUCCESS]:(state,action)=>{return{...state,groups:Object(immutable_es.c)(action.response.groups).sortBy(group=>group.get("name"))}},[CREATE_GROUP.SUCCESS]:(state,action)=>{const resGroup=action.response.group,withInsertedGroup=state.groups.push(Object(immutable_es.c)(resGroup));return{...state,groups:withInsertedGroup.sortBy(team=>team.get("name"))}},[UPDATE_GROUP.SUCCESS]:(state,action)=>{const resGroup=action.response.group,groupIndex=state.groups.findIndex(g=>g.get("_id")===resGroup._id);return{...state,groups:state.groups.set(groupIndex,Object(immutable_es.c)(resGroup))}},[DELETE_GROUP.SUCCESS]:(state,action)=>{const idx=state.groups.findIndex(g=>g.get("_id")===action.payload._id);return{...state,groups:state.groups.delete(idx)}},[UNLOAD_GROUPS.SUCCESS]:state=>({...state,groups:state.groups.clear()})},groupsReducer_initialState);const teamsReducer_initialState={teams:Object(immutable_es.a)([])};var teamsReducer=Object(handleActions.a)({[FETCH_TEAMS.SUCCESS]:(state,action)=>({...state,teams:Object(immutable_es.c)(action.payload.response.teams)}),[CREATE_TEAM.SUCCESS]:(state,action)=>{const resTeam=action.response.team,withInsertedTeam=state.teams.push(Object(immutable_es.c)(resTeam));return{...state,teams:withInsertedTeam.sortBy(team=>team.get("name"))}},[SAVE_EDIT_TEAM.SUCCESS]:(state,action)=>{const resTeam=action.response.team,teamIndex=state.teams.findIndex(t=>t.get("_id")===resTeam._id);return{...state,teams:state.teams.set(teamIndex,Object(immutable_es.c)(resTeam))}},[DELETE_TEAM.SUCCESS]:(state,action)=>{const idx=state.teams.findIndex(t=>t.get("_id")===action.payload._id);return{...state,teams:state.teams.delete(idx)}},[UNLOAD_TEAMS.SUCCESS]:state=>({...state,teams:state.teams.clear()})},teamsReducer_initialState);const departmentsReducer_initialState={departments:Object(immutable_es.a)([])};var departmentsReducer=Object(handleActions.a)({[FETCH_DEPARTMENTS.SUCCESS]:(state,action)=>{return{...state,departments:Object(immutable_es.c)(action.response.departments).sortBy(d=>d.get("normalized"))}},[CREATE_DEPARTMENT.SUCCESS]:(state,action)=>{const department=Object(immutable_es.c)(action.response.department),withDepartment=state.departments.push(department);return{...state,departments:withDepartment.sortBy(department=>department.get("normalized"))}},[UPDATE_DEPARTMENT.SUCCESS]:(state,action)=>{const department=action.response.department,idx=state.departments.findIndex(d=>d.get("_id")===department._id);return{...state,departments:state.departments.set(idx,Object(immutable_es.c)(department))}},[DELETE_DEPARTMENT.SUCCESS]:(state,action)=>{const idx=state.departments.findIndex(d=>d.get("_id")===action.payload._id);return{...state,departments:state.departments.delete(idx)}},[UNLOAD_DEPARTMENTS.SUCCESS]:state=>({...state,departments:state.departments.clear()})},departmentsReducer_initialState);const searchReducer_initialState={loading:!1,results:Object(immutable_es.a)([]),error:null};var reducers_searchReducer=Object(handleActions.a)({[FETCH_SEARCH_RESULTS.PENDING]:state=>({...state,loading:!0}),[FETCH_SEARCH_RESULTS.SUCCESS]:(state,action)=>({...state,loading:!1,results:Object(immutable_es.c)(action.response.hits.hits)}),[FETCH_SEARCH_RESULTS.ERROR]:(state,action)=>({...state,loading:!1,error:action.error.response.data}),[UNLOAD_SEARCH_RESULTS.SUCCESS]:state=>({...state,loading:!1,results:state.results.clear()})},searchReducer_initialState);var reducers=Object(redux.c)({shared:reducers_shared,common,searchState:reducers_searchReducer,modal:modalReducer,sidebar:reducers_sidebarReducer,ticketsState:ticketsReducer,accountsState:accountsReducer,groupsState:groupsReducer,teamsState:teamsReducer,departmentsState:departmentsReducer,settings:reducers_settings,tagsSettings:reducers_tagsReducer}),effects=__webpack_require__(62),axios=__webpack_require__(59),axios_default=__webpack_require__.n(axios);axios_default.a.defaults.headers.post["Content-Type"]="application/json";let api={tickets:{}};api.tickets.getWithPage=(payload=>{const limit=payload.limit?payload.limit:50,page=payload.page?payload.page:0,type=payload.type?payload.type:"all",filter=payload.filter?encodeURIComponent(JSON.stringify(payload.filter,null,2)):void 0,fullFilter=filter?`&filter=${filter}`:void 0;return axios_default.a.get(`/api/v2/tickets?type=${type}&page=${page}&limit=${limit}${fullFilter}`).then(res=>res.data)}),api.tickets.search=(payload=>axios_default.a.get(`/api/v1/tickets/search/?search=${payload.searchString}&limit=100`).then(res=>res.data)),api.tickets.create=(payload=>axios_default.a.post("/api/v1/tickets/create",payload).then(res=>res.data)),api.tickets.delete=(({id})=>axios_default.a.delete(`/api/v1/tickets/${id}`).then(res=>res.data)),api.tickets.renameTicketType=((id,name)=>axios_default.a.put("/api/v1/tickets/types/"+id,{name}).then(res=>res.data)),api.tickets.createTicketType=(({name})=>axios_default.a.post("/api/v1/tickets/types/create",{name}).then(res=>res.data)),api.tickets.addPriorityToType=(({typeId,priority})=>axios_default.a.post(`/api/v1/tickets/type/${typeId}/addpriority`,{priority}).then(res=>res.data)),api.tickets.removePriorityFromType=(({typeId,priority})=>axios_default.a.post(`/api/v1/tickets/type/${typeId}/removepriority`,{priority}).then(res=>res.data)),api.tickets.deleteTicketType=(({id,newTypeId})=>axios_default.a.delete(`/api/v1/tickets/types/${id}`,{data:{newTypeId}}).then(res=>res.data)),api.tickets.createPriority=(({name,overdueIn,htmlColor})=>axios_default.a.post("/api/v1/tickets/priority/create",{name,overdueIn,htmlColor}).then(res=>res.data)),api.tickets.updatePriority=(({id,name,overdueIn,htmlColor})=>axios_default.a.put(`/api/v1/tickets/priority/${id}`,{name,overdueIn,htmlColor}).then(res=>res.data)),api.tickets.deletePriority=(({id,newPriority})=>axios_default.a.post(`/api/v1/tickets/priority/${id}/delete`,{newPriority}).then(res=>res.data)),api.tickets.getTagsWithPage=(({limit,page})=>(limit=limit||10,page=page||0,axios_default.a.get(`/api/v1/tags/limit?limit=${limit}&page=${page}`).then(res=>res.data))),api.tickets.createTag=(({name})=>axios_default.a.post("/api/v1/tags/create",{tag:name}).then(res=>res.data)),api.accounts={},api.accounts.create=(payload=>axios_default.a.post("/api/v2/accounts",payload).then(res=>res.data)),api.accounts.getWithPage=(payload=>{const limit=payload&&payload.limit?payload.limit:25,page=payload&&payload.page?payload.page:0,type=payload&&payload.type?payload.type:"all";let search=payload&&payload.search?payload.search:"";search&&(search=`&search=${search}`);const showDeleted=!(!payload||!payload.showDeleted)&&payload.showDeleted;return axios_default.a.get(`/api/v2/accounts?type=${type}&limit=${limit}&page=${page}${search}&showDeleted=${showDeleted}`).then(res=>res.data)}),api.accounts.updateUser=(payload=>axios_default.a.put(`/api/v2/accounts/${payload.username}`,payload).then(res=>res.data)),api.accounts.deleteAccount=(({username})=>axios_default.a.delete(`/api/v1/users/${username}`).then(res=>res.data)),api.accounts.enableAccount=(({username})=>axios_default.a.get(`/api/v1/users/${username}/enable`).then(res=>res.data)),api.groups={},api.groups.create=(payload=>axios_default.a.post("/api/v2/groups",payload).then(res=>res.data)),api.groups.get=(payload=>{const limit=payload&&payload.limit?payload.limit:1e3,page=payload&&payload.page?payload.page:0,type=payload&&payload.type?`&type=${payload.type}`:"";return axios_default.a.get(`/api/v2/groups?limit=${limit}&page=${page}${type}`).then(res=>res.data)}),api.groups.update=(payload=>axios_default.a.put(`/api/v2/groups/${payload._id}`,payload).then(res=>res.data)),api.groups.delete=(({_id})=>axios_default.a.delete(`/api/v2/groups/${_id}`).then(res=>res.data)),api.teams={},api.teams.getWithPage=(payload=>{const limit=payload&&payload.limit?payload.limit:100,page=payload&&payload.page?payload.page:0;return axios_default.a.get(`/api/v2/teams?limit=${limit}&page=${page}`).then(res=>res.data)}),api.teams.create=(payload=>axios_default.a.post("/api/v2/teams",payload).then(res=>res.data)),api.teams.updateTeam=(payload=>axios_default.a.put(`/api/v2/teams/${payload._id}`,payload).then(res=>res.data)),api.teams.deleteTeam=(({_id})=>axios_default.a.delete(`/api/v2/teams/${_id}`).then(res=>res.data)),api.departments={},api.departments.get=(()=>axios_default.a.get("/api/v2/departments").then(res=>res.data)),api.departments.create=(payload=>axios_default.a.post("/api/v2/departments",payload).then(res=>res.data)),api.departments.update=(payload=>axios_default.a.put(`/api/v2/departments/${payload._id}`,payload).then(res=>res.data)),api.departments.delete=(({_id})=>axios_default.a.delete(`/api/v2/departments/${_id}`).then(res=>res.data)),api.search={},api.search.search=(({limit,term})=>{const l=limit||25;return axios_default.a.get(`/api/v2/es/search?limit=${l}&q=${term}`).then(res=>res.data)}),api.settings={},api.settings.update=(settings=>axios_default.a.put("/api/v1/settings",settings).then(res=>res.data)),api.settings.hasMongoDBTools=(()=>axios_default.a.get("/api/v1/backup/hastools").then(res=>res.data)),api.settings.fetchBackups=(()=>axios_default.a.get("/api/v1/backups").then(res=>res.data)),api.settings.backupNow=(()=>axios_default.a.post("/api/v1/backup").then(res=>res.data)),api.settings.getBackups=(()=>axios_default.a.get("/api/v1/backups").then(res=>res.data)),api.settings.fetchDeletedTickets=(()=>axios_default.a.get("/api/v1/tickets/deleted").then(res=>res.data)),api.settings.restoreDeletedTicket=(({_id})=>axios_default.a.post("/api/v1/tickets/deleted/restore",{_id}).then(res=>res.data)),api.settings.updateRoleOrder=(({roleOrder})=>axios_default.a.put("/api/v1/settings/updateroleorder",{roleOrder}).then(res=>res.data)),api.settings.updatePermissions=(payload=>axios_default.a.put(`/api/v1/roles/${payload._id}`,payload).then(res=>res.data)),api.settings.createRole=(({name})=>axios_default.a.post("/api/v1/roles",{name}).then(res=>res.data)),api.settings.deleteRole=(({_id,newRoleId})=>axios_default.a.delete(`/api/v1/roles/${_id}`,{data:{newRoleId}}).then(res=>res.data)),api.common={},api.common.fetchRoles=(()=>axios_default.a.get("/api/v1/roles").then(res=>res.data));var client_api=api,browser=__webpack_require__(351),browser_default=__webpack_require__.n(browser);const BASE="trudesk",COLOURS={debug:"blue",info:"green",warn:"pink",error:"red"};var logger=new class{generateMessage(level,message,source){const namespace=`${BASE}:${level}`,createDebug=browser_default()(namespace);createDebug.color=COLOURS[level],source?createDebug(source,message):createDebug(message)}debug(message,source){return this.generateMessage("debug",message,source)}info(message,source){return this.generateMessage("info",message,source)}warn(message,source){return this.generateMessage("warn",message,source)}error(message,source){return this.generateMessage("error",message,source)}};function*fetchRoles({payload}){try{const response=yield Object(effects.b)(client_api.common.fetchRoles,payload);yield Object(effects.c)({type:FETCH_ROLES.SUCCESS,response})}catch(error){const errorText=error.response.data.error;logger.error(errorText,error.response),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_ROLES.ERROR,error})}}function*watcher(){yield Object(effects.f)(FETCH_ROLES.ACTION,fetchRoles)}function fetchSettings(){return axios_default.a.get("/api/v1/settings").then(res=>res.data).catch(error=>{throw error.response})}function*fetchFlow({payload}){try{const response=yield Object(effects.b)(fetchSettings,payload);yield Object(effects.c)({type:FETCH_SETTINGS.SUCCESS,response})}catch(error){yield Object(effects.c)({type:FETCH_SETTINGS.ERROR,error})}}function*updateSetting({payload,meta}){try{const response=yield Object(effects.b)(client_api.settings.update,[payload]);payload.noSnackbar||helpers_default.a.UI.showSnackbar("Setting Saved Successfully",!1),yield Object(effects.c)({type:UPDATE_SETTING.SUCCESS,response,payload,meta})}catch(error){yield Object(effects.c)({type:UPDATE_SETTING.ERROR,error,meta})}}function*updateMultipleSettings({payload}){try{const response=yield Object(effects.b)(client_api.settings.update,payload);yield Object(effects.c)({type:UPDATE_MULTIPLE_SETTINGS.SUCCESS,response}),helpers_default.a.UI.showSnackbar("Setting saved successfully.",!1),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){helpers_default.a.UI.showSnackbar(error,!0),yield Object(effects.c)({type:UPDATE_MULTIPLE_SETTINGS.ERROR,error})}}function*updateColorScheme({payload}){try{const response=yield Object(effects.b)(client_api.settings.update,payload);yield Object(effects.c)({type:UPDATE_COLORSCHEME.SUCCESS,response}),helpers_default.a.UI.showSnackbar("Setting saved successfully. Reloading...",!1),setTimeout(function(){window.location.reload()},1e3)}catch(error){helpers_default.a.UI.showSnackbar(error,!0),yield Object(effects.c)({type:UPDATE_MULTIPLE_SETTINGS.ERROR,error})}}function*checkMongoDBTools({payload}){try{const response=yield Object(effects.b)(client_api.settings.hasMongoDBTools,payload);yield Object(effects.c)({type:FETCH_MONGODB_TOOLS.SUCCESS,response})}catch(error){yield Object(effects.c)({type:FETCH_MONGODB_TOOLS.ERROR,error})}}function*fetchBackups(){try{const response=yield Object(effects.b)(client_api.settings.fetchBackups);yield Object(effects.c)({type:FETCH_BACKUPS.SUCCESS,response})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_BACKUPS.ERROR,error})}}function*backupNow(){try{yield Object(effects.c)({type:BACKUP_NOW.PENDING});const response=yield Object(effects.b)(client_api.settings.backupNow);yield Object(effects.c)({type:BACKUP_NOW.SUCCESS,response}),yield Object(effects.c)({type:FETCH_BACKUPS.ACTION}),helpers_default.a.UI.showSnackbar("Backup completed successfully")}catch(error){if(!error.response)return logger.error(error);const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:BACKUP_NOW.ERROR,error})}}function*fetchDeletedTickets(){try{yield Object(effects.c)({type:FETCH_DELETED_TICKETS.PENDING});const response=yield Object(effects.b)(client_api.settings.fetchDeletedTickets);yield Object(effects.c)({type:FETCH_DELETED_TICKETS.SUCCESS,response})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_DELETED_TICKETS.ERROR,error})}}function*restoreDeletedTicket({payload}){try{const response=yield Object(effects.b)(client_api.settings.restoreDeletedTicket,payload);yield Object(effects.c)({type:RESTORE_DELETED_TICKET.SUCCESS,response,payload}),helpers_default.a.UI.showSnackbar("Ticket Restored")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:RESTORE_DELETED_TICKET.ERROR,error})}}function*updateRoleOrder({payload}){try{const response=yield Object(effects.b)(client_api.settings.updateRoleOrder,payload);yield Object(effects.c)({type:UPDATE_ROLE_ORDER.SUCCESS,response})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_ROLE_ORDER.ERROR,error})}}function*updatePermissions({payload}){try{yield Object(effects.c)({type:UPDATE_PERMISSIONS.PENDING});const response=yield Object(effects.b)(client_api.settings.updatePermissions,payload);yield Object(effects.c)({type:UPDATE_PERMISSIONS.SUCCESS,response}),helpers_default.a.UI.showSnackbar("Updated Role. Flushing Permissions...")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_PERMISSIONS.ERROR,error})}}function*createRole({payload}){try{const response=yield Object(effects.b)(client_api.settings.createRole,payload);yield Object(effects.c)({type:CREATE_ROLE.SUCCESS,response}),yield Object(effects.c)({type:FETCH_ROLES.ACTION}),yield Object(effects.c)({type:HIDE_MODAL})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_ROLE.ERROR,error})}}function*deleteRole({payload}){try{const response=yield Object(effects.b)(client_api.settings.deleteRole,payload);yield Object(effects.c)({type:DELETE_ROLE.SUCCESS,response}),yield Object(effects.c)({type:FETCH_ROLES.ACTION}),yield Object(effects.c)({type:HIDE_MODAL}),helpers_default.a.UI.showSnackbar("Role successfully deleted")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_ROLE.ERROR,error})}}function*settingsWatcher(){yield Object(effects.f)(FETCH_SETTINGS.ACTION,fetchFlow),yield Object(effects.f)(UPDATE_SETTING.ACTION,updateSetting),yield Object(effects.f)(UPDATE_MULTIPLE_SETTINGS.ACTION,updateMultipleSettings),yield Object(effects.f)(UPDATE_COLORSCHEME.ACTION,updateColorScheme),yield Object(effects.f)(FETCH_MONGODB_TOOLS.ACTION,checkMongoDBTools),yield Object(effects.f)(FETCH_BACKUPS.ACTION,fetchBackups),yield Object(effects.f)(BACKUP_NOW.ACTION,backupNow),yield Object(effects.f)(FETCH_DELETED_TICKETS.ACTION,fetchDeletedTickets),yield Object(effects.f)(RESTORE_DELETED_TICKET.ACTION,restoreDeletedTicket),yield Object(effects.f)(UPDATE_ROLE_ORDER.ACTION,updateRoleOrder),yield Object(effects.f)(UPDATE_PERMISSIONS.ACTION,updatePermissions),yield Object(effects.f)(CREATE_ROLE.ACTION,createRole),yield Object(effects.f)(DELETE_ROLE.ACTION,deleteRole)}const getSessionUser=state=>state.shared.sessionUser;function*fetchTickets({payload}){yield Object(effects.c)({type:FETCH_TICKETS.PENDING,payload});try{let response=null;response="search"===payload.type?yield Object(effects.b)(client_api.tickets.search,payload):yield Object(effects.b)(client_api.tickets.getWithPage,payload),yield Object(effects.c)({type:FETCH_TICKETS.SUCCESS,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_TICKETS.ERROR,error}),logger.error(errorText,error)}}function*createTicket({payload}){try{const response=yield Object(effects.b)(client_api.tickets.create,payload),sessionUser=yield Object(effects.d)(getSessionUser);yield Object(effects.c)({type:CREATE_TICKET.SUCCESS,response,sessionUser}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:CREATE_TICKET.ERROR,error})}}function*deleteTicket({payload}){try{const response=yield Object(effects.b)(client_api.tickets.delete,payload);yield Object(effects.c)({type:DELETE_TICKET.SUCCESS,payload,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_TICKET.ERROR,error}),logger.error(errorText,error)}}function*unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_TICKETS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*ticketUpdated({payload}){try{const sessionUser=yield Object(effects.d)(getSessionUser);yield Object(effects.c)({type:TICKET_UPDATED.SUCCESS,payload,sessionUser})}catch(error){logger.error(error)}}function*ticketEvent({payload}){try{const sessionUser=yield Object(effects.d)(getSessionUser);yield Object(effects.c)({type:TICKET_EVENT.SUCCESS,payload,sessionUser})}catch(error){logger.error(error)}}function*createTicketType({payload}){try{const response=yield Object(effects.b)(client_api.tickets.createTicketType,payload);yield Object(effects.c)({type:CREATE_TICKET_TYPE.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:CREATE_TICKET_TYPE.ERROR,error})}}function*deleteTicketType({payload}){try{const response=yield Object(effects.b)(client_api.tickets.deleteTicketType,payload);yield Object(effects.c)({type:DELETE_TICKET_TYPE.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:DELETE_TICKET_TYPE.ERROR,error})}}function*getTagsWithPage({payload}){try{const response=yield Object(effects.b)(client_api.tickets.getTagsWithPage,payload);yield Object(effects.c)({type:GET_TAGS_WITH_PAGE.SUCCESS,response})}catch(error){if(!error.response)return logger.error(error);const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:GET_TAGS_WITH_PAGE.ERROR,error})}}function*createPriority({payload}){try{const response=yield Object(effects.b)(client_api.tickets.createPriority,payload);yield Object(effects.c)({type:CREATE_PRIORITY.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:CREATE_PRIORITY.ERROR,error})}}function*updatePriority({payload}){try{const response=yield Object(effects.b)(client_api.tickets.updatePriority,payload);yield Object(effects.c)({type:UPDATE_PRIORITY.SUCCESS,response}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_PRIORITY.ERROR,error})}}function*deletePriority({payload}){try{const response=yield Object(effects.b)(client_api.tickets.deletePriority,payload);yield Object(effects.c)({type:DELETE_PRIORITY.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:DELETE_PRIORITY.ERROR,error})}}function*createTag({payload}){try{const response=yield Object(effects.b)(client_api.tickets.createTag,{name:payload.name});yield Object(effects.c)({type:CREATE_TAG.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),Object(lodash.isUndefined)(payload.currentPage)||(yield Object(effects.c)({type:GET_TAGS_WITH_PAGE.ACTION,payload:{limit:16,page:payload.currentPage}})),helpers_default.a.UI.showSnackbar(`Tag ${payload.name} successfully created`)}catch(error){if(!error.response)return logger.error(error);const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_TAG.ERROR,error})}}function*tickets_watcher(){yield Object(effects.f)(FETCH_TICKETS.ACTION,fetchTickets),yield Object(effects.f)(CREATE_TICKET.ACTION,createTicket),yield Object(effects.e)(DELETE_TICKET.ACTION,deleteTicket),yield Object(effects.f)(UNLOAD_TICKETS.ACTION,unloadThunk),yield Object(effects.e)(TICKET_UPDATED.ACTION,ticketUpdated),yield Object(effects.e)(TICKET_EVENT.ACTION,ticketEvent),yield Object(effects.f)(CREATE_TICKET_TYPE.ACTION,createTicketType),yield Object(effects.f)(DELETE_TICKET_TYPE.ACTION,deleteTicketType),yield Object(effects.f)(CREATE_PRIORITY.ACTION,createPriority),yield Object(effects.f)(UPDATE_PRIORITY.ACTION,updatePriority),yield Object(effects.f)(DELETE_PRIORITY.ACTION,deletePriority),yield Object(effects.f)(GET_TAGS_WITH_PAGE.ACTION,getTagsWithPage),yield Object(effects.f)(CREATE_TAG.ACTION,createTag)}function*fetchAccounts({payload,meta}){yield Object(effects.c)({type:FETCH_ACCOUNTS.PENDING});try{const response=yield Object(effects.b)(client_api.accounts.getWithPage,payload);yield Object(effects.c)({type:FETCH_ACCOUNTS.SUCCESS,payload:{response,payload},meta})}catch(error){let errorText="";error.response&&(errorText=error.response.data.error),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:FETCH_ACCOUNTS.ERROR,error})}}function*createAccount({payload}){try{const response=yield Object(effects.b)(client_api.accounts.create,payload);yield Object(effects.c)({type:CREATE_ACCOUNT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),helpers_default.a.UI.showSnackbar("Account created successfully")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:CREATE_ACCOUNT.ERROR,error})}}function*saveEditAccount({payload}){try{const response=yield Object(effects.b)(client_api.accounts.updateUser,payload);yield Object(effects.c)({type:SAVE_EDIT_ACCOUNT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),helpers_default.a.UI.showSnackbar("Account updated successfully")}catch(error){let errorText="";error.response&&(errorText=error.response.data.error),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:SAVE_EDIT_ACCOUNT.ERROR,error})}}function*deleteAccount({payload}){try{yield Object(effects.c)({type:DELETE_ACCOUNT.PENDING,payload});const response=yield Object(effects.b)(client_api.accounts.deleteAccount,payload);yield Object(effects.c)({type:DELETE_ACCOUNT.SUCCESS,response,payload}),response.disabled?helpers_default.a.UI.showSnackbar("Account is linked to existing tickets. Account Disabled"):helpers_default.a.UI.showSnackbar("Account deleted successfully")}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:DELETE_ACCOUNT.ERROR,error})}}function*enableAccount({payload}){try{const response=yield Object(effects.b)(client_api.accounts.enableAccount,payload);yield Object(effects.c)({type:ENABLE_ACCOUNT.SUCCESS,response,payload}),helpers_default.a.UI.showSnackbar("Account has been enabled")}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:ENABLE_ACCOUNT.ERROR,error})}}function*accounts_unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_ACCOUNTS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*accounts_watcher(){yield Object(effects.f)(CREATE_ACCOUNT.ACTION,createAccount),yield Object(effects.f)(FETCH_ACCOUNTS.ACTION,fetchAccounts),yield Object(effects.f)(SAVE_EDIT_ACCOUNT.ACTION,saveEditAccount),yield Object(effects.e)(DELETE_ACCOUNT.ACTION,deleteAccount),yield Object(effects.e)(ENABLE_ACCOUNT.ACTION,enableAccount),yield Object(effects.f)(UNLOAD_ACCOUNTS.ACTION,accounts_unloadThunk)}function*fetchGroups({payload}){try{const response=yield Object(effects.b)(client_api.groups.get,payload);yield Object(effects.c)({type:FETCH_GROUPS.SUCCESS,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_GROUPS.ERROR,error}),logger.error(errorText,error)}}function*createGroup({payload}){try{const response=yield Object(effects.b)(client_api.groups.create,payload);yield Object(effects.c)({type:CREATE_GROUP.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_GROUP.ERROR,error}),logger.error(errorText,error)}}function*updateGroup({payload}){try{const response=yield Object(effects.b)(client_api.groups.update,payload);yield Object(effects.c)({type:UPDATE_GROUP.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_GROUP.ERROR,error}),logger.error(errorText,error)}}function*deleteGroup({payload,meta}){try{const response=yield Object(effects.b)(client_api.groups.delete,payload);yield Object(effects.c)({type:DELETE_GROUP.SUCCESS,payload,response,meta}),helpers_default.a.UI.showSnackbar("Successfully delete group")}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_GROUP.ERROR,error}),logger.error(errorText,error)}}function*groups_unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_GROUPS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*groups_watcher(){yield Object(effects.f)(FETCH_GROUPS.ACTION,fetchGroups),yield Object(effects.f)(CREATE_GROUP.ACTION,createGroup),yield Object(effects.f)(UPDATE_GROUP.ACTION,updateGroup),yield Object(effects.f)(DELETE_GROUP.ACTION,deleteGroup),yield Object(effects.f)(UNLOAD_GROUPS.ACTION,groups_unloadThunk)}function*fetchTeams({payload,meta}){try{const response=yield Object(effects.b)(client_api.teams.getWithPage,payload);yield Object(effects.c)({type:FETCH_TEAMS.SUCCESS,payload:{response,payload},meta})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error),yield Object(effects.c)({type:FETCH_TEAMS.ERROR,error})}}function*createTeam({payload}){try{const response=yield Object(effects.b)(client_api.teams.create,payload);yield Object(effects.c)({type:CREATE_TEAM.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_TEAM.ERROR,error})}}function*updateTeam({payload}){try{const response=yield Object(effects.b)(client_api.teams.updateTeam,payload);yield Object(effects.c)({type:SAVE_EDIT_TEAM.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:SAVE_EDIT_TEAM.ERROR,error})}}function*deleteTeam({payload}){try{const response=yield Object(effects.b)(client_api.teams.deleteTeam,payload);yield Object(effects.c)({type:DELETE_TEAM.SUCCESS,payload,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error),yield Object(effects.c)({type:DELETE_TEAM.ERROR,error})}}function*teams_unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_TEAMS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*teams_watcher(){yield Object(effects.f)(FETCH_TEAMS.ACTION,fetchTeams),yield Object(effects.f)(CREATE_TEAM.ACTION,createTeam),yield Object(effects.f)(SAVE_EDIT_TEAM.ACTION,updateTeam),yield Object(effects.f)(DELETE_TEAM.ACTION,deleteTeam),yield Object(effects.f)(UNLOAD_TEAMS.ACTION,teams_unloadThunk)}function*fetchDepartments({payload}){try{const response=yield Object(effects.b)(client_api.departments.get,payload);yield Object(effects.c)({type:FETCH_DEPARTMENTS.SUCCESS,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error),yield Object(effects.c)({type:FETCH_DEPARTMENTS.ERROR,error})}}function*createDepartment({payload}){try{const response=yield Object(effects.b)(client_api.departments.create,payload);yield Object(effects.c)({type:CREATE_DEPARTMENT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_DEPARTMENT.ERROR,error}),logger.error(errorText,error)}}function*updateDepartment({payload}){try{const response=yield Object(effects.b)(client_api.departments.update,payload);yield Object(effects.c)({type:UPDATE_DEPARTMENT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_DEPARTMENT.ERROR,error}),logger.error(errorText,error)}}function*deleteDepartment({payload}){try{const response=yield Object(effects.b)(client_api.departments.delete,payload);yield Object(effects.c)({type:DELETE_DEPARTMENT.SUCCESS,payload,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_DEPARTMENT.ERROR,error}),logger.error(errorText,error)}}function*unloadDepartments({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_DEPARTMENTS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*departments_watcher(){yield Object(effects.f)(FETCH_DEPARTMENTS.ACTION,fetchDepartments),yield Object(effects.f)(CREATE_DEPARTMENT.ACTION,createDepartment),yield Object(effects.f)(UPDATE_DEPARTMENT.ACTION,updateDepartment),yield Object(effects.f)(DELETE_DEPARTMENT.ACTION,deleteDepartment),yield Object(effects.f)(UNLOAD_DEPARTMENTS.ACTION,unloadDepartments)}function*fetchSearchResults({payload,meta}){yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.PENDING}),payload.term||(yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.ERROR,error:{message:"Invalid search Term"}}));try{const response=yield Object(effects.b)(client_api.search.search,payload);yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.SUCCESS,response,meta})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.ERROR,error}),logger.error(errorText,error)}}function*unloadSearchResults({payload,meta}){yield Object(effects.c)({type:UNLOAD_SEARCH_RESULTS.SUCCESS,payload,meta})}function*search_watcher(){yield Object(effects.f)(FETCH_SEARCH_RESULTS.ACTION,fetchSearchResults),yield Object(effects.f)(UNLOAD_SEARCH_RESULTS.ACTION,unloadSearchResults)}var prop_types=__webpack_require__(51),prop_types_default=__webpack_require__.n(prop_types),index_module=__webpack_require__(55),mobx_module=__webpack_require__(53),clsx_m=__webpack_require__(78),createAction=__webpack_require__(526);const showModal=Object(createAction.a)(SHOW_MODAL.ACTION,(modalType,modalProps)=>({modalType,modalProps})),hideModal=Object(createAction.a)(HIDE_MODAL.ACTION),clearModal=Object(createAction.a)(CLEAR_MODAL.ACTION),common_showNotice=Object(createAction.a)(SHOW_NOTICE.ACTION),clearNotice=Object(createAction.a)(CLEAR_NOTICE.ACTION),common_fetchRoles=Object(createAction.a)(FETCH_ROLES.ACTION),common_updateRoleOrder=Object(createAction.a)(UPDATE_ROLE_ORDER.ACTION);function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _defineProperties(target,props){for(var i=0;i'),li=null;if(isArray_default()(this.props.children))for(var i=0;i"):(this.props.children[i].props.hasSeperator&&ul.append("
"),li=jquery_default()('
  • '+this.props.children[i].props.text+"
  • "),ul.append(li)));else{if("NavSeperator"===this.props.children.type.name)return;li=jquery_default()('
  • '+this.props.children.props.text+"
  • "),ul.append(li)}$sideBarToRight.append(ul),helpers_default.a.UI.setupSidebarTether(),jquery_default()("body").ajaxify()}}},{key:"render",value:function(){return react_default.a.createElement("ul",{id:"side-nav-accordion-"+this.props.id,className:"side-nav-sub side-nav-accordion"+(!0===this.props.subMenuOpen?" subMenuOpen":"")},this.props.children)}}])&&Submenu_defineProperties(Constructor.prototype,protoProps),staticProps&&Submenu_defineProperties(Constructor,staticProps),Submenu}();Submenu_Submenu.propTypes={id:prop_types_default.a.string.isRequired,subMenuOpen:prop_types_default.a.bool,children:prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.node),prop_types_default.a.node]).isRequired};var Nav_Submenu=Submenu_Submenu;function SubmenuItem_typeof(obj){return(SubmenuItem_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function SubmenuItem_defineProperties(target,props){for(var i=0;i({activeItem:values.activeItem,activeSubItem:values.activeSubItem,sessionUser:values.sessionUser}));function Sidebar_typeof(obj){return(Sidebar_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Sidebar_defineProperties(target,props){for(var i=0;i0,subMenuTarget:"plugins",active:"plugins"===activeItem},plugins&&plugins.length>0&&react_default.a.createElement(Nav_Submenu,{id:"plugins",subMenuOpen:"plugins"===activeItem},plugins.map(function(item){if(-1!==item.permissions.split(" ").indexOf(sessionUser.role))return react_default.a.createElement(Nav_SubmenuItem,{key:item.name,text:item.menu.main.name,icon:item.menu.main.icon,href:item.menu.main.link,active:activeSubItem===item.name})})))}},{key:"render",value:function(){var _this$props=this.props,activeItem=_this$props.activeItem,activeSubItem=_this$props.activeSubItem,sessionUser=_this$props.sessionUser;return react_default.a.createElement("ul",{className:"side-nav"},sessionUser&&helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement(SidebarItem,{text:"Dashboard",icon:"dashboard",href:"/dashboard",class:"navHome",active:"dashboard"===activeItem}),sessionUser&&helpers_default.a.canUser("tickets:view")&&react_default.a.createElement(SidebarItem,{text:"Tickets",icon:"assignment",href:"/tickets",class:"navTickets no-ajaxy",hasSubmenu:!0,subMenuTarget:"tickets",active:"tickets"===activeItem},react_default.a.createElement(Nav_Submenu,{id:"tickets"},react_default.a.createElement(Nav_SubmenuItem,{text:"Active",icon:"timer",href:"/tickets/active",active:"tickets-active"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Assigned",icon:"assignment_ind",href:"/tickets/assigned",active:"tickets-assigned"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Unassigned",icon:"person_add_disabled",href:"/tickets/unassigned",active:"tickets-unassigned"===activeSubItem}),react_default.a.createElement(Nav_NavSeperator,null),react_default.a.createElement(Nav_SubmenuItem,{text:"New",icon:"",href:"/tickets/new",active:"tickets-new"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Pending",icon:"",href:"/tickets/pending",active:"tickets-pending"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Open",icon:"",href:"/tickets/open",active:"tickets-open"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Closed",icon:"",href:"/tickets/closed",active:"tickets-closed"===activeSubItem}))),react_default.a.createElement(SidebarItem,{text:"Messages",icon:"chat",href:"/messages",class:"navMessages",active:"messages"===activeItem}),sessionUser&&helpers_default.a.canUser("accounts:view")&&react_default.a.createElement(SidebarItem,{text:"Accounts",icon:"",href:"/accounts",class:"navAccounts",active:"accounts"===activeItem,subMenuTarget:"accounts",hasSubmenu:sessionUser&&helpers_default.a.canUser("agent:*",!0)},sessionUser&&helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement(Nav_Submenu,{id:"accounts"},react_default.a.createElement(Nav_SubmenuItem,{href:"/accounts/customers",text:"Customers",icon:"account_box",active:"accounts-customers"===activeSubItem}),sessionUser&&helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement(Nav_SubmenuItem,{href:"/accounts/agents",text:"Agents",icon:"account_circle",active:"accounts-agents"===activeSubItem}),sessionUser&&helpers_default.a.canUser("admin:*")&&react_default.a.createElement(Nav_SubmenuItem,{href:"/accounts/admins",text:"Admins",icon:"how_to_reg",active:"accounts-admins"===activeSubItem}))),sessionUser&&helpers_default.a.canUser("groups:view")&&react_default.a.createElement(SidebarItem,{text:"Customer Groups",icon:"supervisor_account",href:"/groups",class:"navGroups",active:"groups"===activeItem}),sessionUser&&helpers_default.a.canUser("teams:view")&&react_default.a.createElement(SidebarItem,{text:"Teams",icon:"wc",href:"/teams",class:"navTeams",active:"teams"===activeItem}),sessionUser&&helpers_default.a.canUser("departments:view")&&react_default.a.createElement(SidebarItem,{text:"Departments",icon:"domain",href:"/departments",class:"navTeams",active:"departments"===activeItem}),sessionUser&&helpers_default.a.canUser("reports:view")&&react_default.a.createElement(SidebarItem,{text:"Reports",icon:"assessment",href:"/reports/generate",class:"navReports no-ajaxy",hasSubmenu:!0,subMenuTarget:"reports",active:"reports"===activeItem},react_default.a.createElement(Nav_Submenu,{id:"reports"},react_default.a.createElement(Nav_SubmenuItem,{text:"Generate",icon:"timeline",href:"/reports/generate",active:"reports-generate"===activeSubItem}),react_default.a.createElement(Nav_NavSeperator,null),react_default.a.createElement(Nav_SubmenuItem,{text:"Group Breakdown",icon:"supervisor_account",href:"/reports/breakdown/group",active:"reports-breakdown-group"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"User Breakdown",icon:"perm_identity",href:"/reports/breakdown/user",active:"reports-breakdown-user"===activeSubItem}))),sessionUser&&helpers_default.a.canUser("notices:view")&&react_default.a.createElement(SidebarItem,{text:"Notices",icon:"warning",href:"/notices",class:"navNotices",active:"notices"===activeItem}),sessionUser&&helpers_default.a.canUser("settings:edit")&&react_default.a.createElement(SidebarItem,{text:"Settings",icon:"settings",href:"/settings/general",class:"navSettings no-ajaxy",hasSubmenu:!0,subMenuTarget:"settings",active:"settings"===activeItem},react_default.a.createElement(Nav_Submenu,{id:"settings"},react_default.a.createElement(Nav_SubmenuItem,{text:"General",icon:"tune",href:"/settings",active:"settings-general"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Appearance",icon:"style",href:"/settings/appearance",active:"settings-appearance"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Tickets",icon:"assignment",href:"/settings/tickets",active:"settings-tickets"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Permissions",icon:"security",href:"/settings/permissions",active:"settings-permissions"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Mailer",icon:"email",href:"/settings/mailer",active:"settings-mailer"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{href:"/settings/elasticsearch",text:"Elasticsearch",icon:"search",active:"settings-elasticsearch"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Push Service",icon:"mobile_friendly",href:"/settings/tps",active:"settings-tps"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Backup/Restore",icon:"archive",href:"/settings/backup",active:"settings-backup"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Legal",icon:"gavel",href:"/settings/legal",active:"settings-legal"===activeSubItem}),sessionUser&&helpers_default.a.canUser("settings:logs")&&react_default.a.createElement(Nav_SubmenuItem,{text:"Logs",icon:"remove_from_queue",href:"/settings/logs",hasSeperator:!0,active:"settings-logs"===activeSubItem}))),react_default.a.createElement(Nav_NavSeperator,null),react_default.a.createElement(SidebarItem,{href:"/about",icon:"help",text:"About",active:"about"===activeItem}),react_default.a.createElement(SidebarItem,{href:"https://www.trudesk.io",icon:"cloud",text:"Cloud",target:"_blank"}))}}])&&Sidebar_defineProperties(Constructor.prototype,protoProps),staticProps&&Sidebar_defineProperties(Constructor,staticProps),Sidebar}();Sidebar_Sidebar.propTypes={updateNavChange:prop_types_default.a.func.isRequired,activeItem:prop_types_default.a.string.isRequired,activeSubItem:prop_types_default.a.string.isRequired,sessionUser:prop_types_default.a.object,plugins:prop_types_default.a.array};var Nav_Sidebar=Object(es.b)(function(state){return{activeItem:state.sidebar.activeItem,activeSubItem:state.sidebar.activeSubItem,sessionUser:state.shared.sessionUser}},{updateNavChange})(Sidebar_Sidebar);function Button_typeof(obj){return(Button_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Button_defineProperties(target,props){for(var i=0;ipayload,()=>({thunk:!0})),tickets_ticketEvent=Object(createAction.a)(TICKET_EVENT.ACTION),tickets_createTicketType=Object(createAction.a)(CREATE_TICKET_TYPE.ACTION,input=>({name:input.name})),tickets_deleteTicketType=(Object(createAction.a)(RENAME_TICKET_TYPE.ACTION,input=>({name:input.name})),Object(createAction.a)(DELETE_TICKET_TYPE.ACTION,(id,newTypeId)=>({id,newTypeId}))),tickets_createPriority=Object(createAction.a)(CREATE_PRIORITY.ACTION,({name,overdueIn,htmlColor})=>({name,overdueIn,htmlColor})),tickets_updatePriority=Object(createAction.a)(UPDATE_PRIORITY.ACTION,({id,name,overdueIn,htmlColor})=>({id,name,overdueIn,htmlColor})),tickets_deletePriority=Object(createAction.a)(DELETE_PRIORITY.ACTION,({id,newPriority})=>({id,newPriority})),tickets_getTagsWithPage=Object(createAction.a)(GET_TAGS_WITH_PAGE.ACTION,({limit,page})=>({limit,page})),tagsUpdateCurrentPage=Object(createAction.a)(TAGS_UPDATE_CURRENT_PAGE.ACTION,currentPage=>({currentPage})),tickets_createTag=Object(createAction.a)(CREATE_TAG.ACTION,({name,currentPage})=>({name,currentPage}));function CreateTicketTypeModal_typeof(obj){return(CreateTicketTypeModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateTicketTypeModal_extends(){return(CreateTicketTypeModal_extends=Object.assign||function(target){for(var i=1;ipayload,()=>({thunk:!0})),groups_createGroup=Object(createAction.a)(CREATE_GROUP.ACTION),groups_updateGroup=Object(createAction.a)(UPDATE_GROUP.ACTION),groups_deleteGroup=Object(createAction.a)(DELETE_GROUP.ACTION,payload=>payload,()=>({thunk:!0})),unloadGroups=Object(createAction.a)(UNLOAD_GROUPS.ACTION,payload=>payload,()=>({thunk:!0})),accounts_fetchAccounts=Object(createAction.a)(FETCH_ACCOUNTS.ACTION,payload=>payload,()=>({thunk:!0})),accounts_createAccount=Object(createAction.a)(CREATE_ACCOUNT.ACTION),accounts_saveEditAccount=Object(createAction.a)(SAVE_EDIT_ACCOUNT.ACTION),accounts_deleteAccount=Object(createAction.a)(DELETE_ACCOUNT.ACTION),accounts_enableAccount=Object(createAction.a)(ENABLE_ACCOUNT.ACTION),unloadAccounts=Object(createAction.a)(UNLOAD_ACCOUNTS.ACTION,payload=>payload,()=>({thunk:!0}));function FilterTicketsModal_typeof(obj){return(FilterTicketsModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function FilterTicketsModal_defineProperties(target,props){for(var i=0;i({name:input.name,value:input.value,stateName:input.stateName,noSnackbar:!!input.noSnackbar&&input.noSnackbar}),()=>({thunk:!0})),settings_updateMultipleSettings=Object(createAction.a)(UPDATE_MULTIPLE_SETTINGS.ACTION),settings_updateColorScheme=Object(createAction.a)(UPDATE_COLORSCHEME.ACTION),fetchMongoDBTools=Object(createAction.a)(FETCH_MONGODB_TOOLS.ACTION),settings_fetchBackups=Object(createAction.a)(FETCH_BACKUPS.ACTION),settings_backupNow=Object(createAction.a)(BACKUP_NOW.ACTION),settings_fetchDeletedTickets=Object(createAction.a)(FETCH_DELETED_TICKETS.ACTION),settings_restoreDeletedTicket=Object(createAction.a)(RESTORE_DELETED_TICKET.ACTION),changeDeletedTicketsPage=Object(createAction.a)(CHANGE_DELETED_TICKETS_PAGE.ACTION,pageIndex=>({pageIndex})),settings_createRole=Object(createAction.a)(CREATE_ROLE.ACTION),settings_updatePermissions=Object(createAction.a)(UPDATE_PERMISSIONS.ACTION),settings_deleteRole=Object(createAction.a)(DELETE_ROLE.ACTION);function AddPriorityToTypeModal_typeof(obj){return(AddPriorityToTypeModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function AddPriorityToTypeModal_defineProperties(target,props){for(var i=0;i0&&velocity_min_default()($check,{opacity:1},{delay:360,duration:200,begin:function(){$check.show()}}),_this.props.fetchSettings()}).catch(function(error){var errorText=error.response.data.error;logger.error(errorText,error.response),helpers_default.a.UI.showSnackbar("Error: ".concat(errorText),!0)})}},{key:"render",value:function(){var _this2=this,type=this.props.type;return react_default.a.createElement(Modals_BaseModal,null,react_default.a.createElement("form",{className:"uk-form-stacked"},react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("h2",null,"Add Priorities"),react_default.a.createElement("span",null,"Please select the priorities you wish to add to type: ",type.get("name"))),react_default.a.createElement("div",{className:"priority-loop zone"},this.getPriorities().map(function(priority){return some_default()(type.get("priorities").toJS(),priority.toObject())?react_default.a.createElement("div",{key:priority.get("_id"),className:"z-box uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h5",{style:{color:priority.get("htmlColor"),fontWeight:"bold"}},priority.get("name")),react_default.a.createElement("p",{className:"uk-text-muted"},"SLA Overdue: ",react_default.a.createElement("strong",null,priority.get("durationFormatted")))),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("i",{className:"material-icons uk-text-success mt-10 mr-15",style:{fontSize:"28px"}},"check"))):react_default.a.createElement("div",{key:priority.get("_id"),className:"z-box uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h5",{style:{color:priority.get("htmlColor"),fontWeight:"bold"}},priority.get("name")),react_default.a.createElement("p",{className:"uk-text-muted"},"SLA Overdue: ",react_default.a.createElement("strong",null,priority.get("durationFormatted")))),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("a",{type:"button",className:"uk-button uk-button-success mt-10 mr-10 no-ajaxy",onClick:function(e){return _this2.onAddClick(e,type,priority)}},"Add"),react_default.a.createElement("i",{className:"material-icons uk-text-success mt-10 mr-15",style:{display:"none",opacity:0,fontSize:"28px"}},"check")))})),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{type:"button",flat:!0,waves:!0,text:"Close",extraClass:"uk-modal-close"}))))}}])&&AddPriorityToTypeModal_defineProperties(Constructor.prototype,protoProps),staticProps&&AddPriorityToTypeModal_defineProperties(Constructor,staticProps),AddPriorityToTypeModal}();AddPriorityToTypeModal_AddPriorityToTypeModal.propTypes={settings:prop_types_default.a.object.isRequired,type:prop_types_default.a.object.isRequired,fetchSettings:prop_types_default.a.func.isRequired};var Modals_AddPriorityToTypeModal=Object(es.b)(function(state){return{settings:state.settings.settings}},{fetchSettings:settings_fetchSettings})(AddPriorityToTypeModal_AddPriorityToTypeModal);function ColorSelector_typeof(obj){return(ColorSelector_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function ColorSelector_defineProperties(target,props){for(var i=0;i=128?"#444":"#f7f8fa"}}],(protoProps=[{key:"componentDidMount",value:function(){helpers_default.a.UI.inputs(),this.setState({selectedColor:this.props.defaultColor},this.updateColorButton)}},{key:"componentDidUpdate",value:function(prevProps){this.props.defaultColor!==prevProps.defaultColor&&this.setState({selectedColor:this.props.defaultColor},this.updateColorButton)}},{key:"generateRandomColor",value:function(event){var _this2=this;if(event.preventDefault(),jquery_default()(event.target).length>0){var color=ColorSelector.getRandomColor();this.props.onChange&&(event.target.value=color,this.props.onChange(event)),this.setState({selectedColor:color},function(){_this2.updateColorButton()})}}},{key:"updateColorButton",value:function(){var fgColor=ColorSelector.getContrast(this.state.selectedColor.substring(1));jquery_default()(this.colorButton).css({background:this.state.selectedColor,color:fgColor})}},{key:"onInputValueChange",value:function(e){var val=e.target.value;this.props.onChange&&this.props.onChange(e),this.setState({selectedColor:val},this.updateColorButton)}},{key:"revertColor",value:function(){this.setState({selectedColor:this.props.defaultColor},this.updateColorButton)}},{key:"render",value:function(){var _this3=this;return react_default.a.createElement("div",{className:this.props.parentClass},react_default.a.createElement("div",{className:"uk-float-left uk-width-1-4"},react_default.a.createElement("button",{ref:function(colorButton){_this3.colorButton=colorButton},className:"uk-button uk-button-small uk-color-button mr-5 mt-10",style:{float:"right"},onClick:function(e){_this3.generateRandomColor(e)}},react_default.a.createElement("i",{className:"material-icons"},"refresh"))),react_default.a.createElement("div",{className:"md-input-wrapper uk-float-left md-input-filled",style:{width:this.props.hideRevert?"70%":"50%"}},react_default.a.createElement("label",null,"Color"),this.props.validationEnabled&&react_default.a.createElement("input",{name:this.props.inputName?this.props.inputName:"",type:"text",className:"md-input",value:this.state.selectedColor,onChange:function(e){_this3.onInputValueChange(e)},"data-validation":"custom","data-validation-regexp":"^\\#([0-9a-fA-F]){3,6}$","data-validation-error-msg":"Invalid HEX Color"}),!this.props.validationEnabled&&react_default.a.createElement("input",{name:this.props.inputName?this.props.inputName:"",type:"text",className:"md-input",value:this.state.selectedColor,onChange:function(e){_this3.onInputValueChange(e)}}),react_default.a.createElement("div",{className:"md-input-bar"})),!this.props.hideRevert&&react_default.a.createElement("button",{className:"md-btn md-btn-small md-btn-flat mt-10 uk-float-right uk-width-1-4",onClick:function(){_this3.revertColor()}},"Revert"))}}])&&ColorSelector_defineProperties(Constructor.prototype,protoProps),staticProps&&ColorSelector_defineProperties(Constructor,staticProps),ColorSelector}();ColorSelector_ColorSelector.propTypes={inputName:prop_types_default.a.string,defaultColor:prop_types_default.a.string.isRequired,hideRevert:prop_types_default.a.bool,parentClass:prop_types_default.a.string,onChange:prop_types_default.a.func,validationEnabled:prop_types_default.a.bool},ColorSelector_ColorSelector.defaultProps={defaultColor:"#878982",hideRevert:!1,validationEnabled:!1};var CreatePriorityModal_class,CreatePriorityModal_class2,CreatePriorityModal_descriptor,CreatePriorityModal_descriptor2,CreatePriorityModal_descriptor3,components_ColorSelector=ColorSelector_ColorSelector;function CreatePriorityModal_typeof(obj){return(CreatePriorityModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreatePriorityModal_extends(){return(CreatePriorityModal_extends=Object.assign||function(target){for(var i=1;i0&&jquery_default()(this.select).val(this.props.currentTags),jquery_default()(this.select).trigger("chosen:updated")}},{key:"onSubmit",value:function(e){var _this=this;e.preventDefault();var selectedTags=jquery_default()(e.target.tags).val();selectedTags||(selectedTags=[]),axios_default.a.put("/api/v1/tickets/".concat(this.props.ticketId),{tags:selectedTags}).then(function(){socket_default.a.ui.refreshTicketTags(_this.props.ticketId),_this.closeButton.click()}).catch(function(error){logger.error(error),helpers_default.a.UI.showSnackbar(error,!0)})}},{key:"render",value:function(){var _this2=this,mappedTags=this.props.tagsSettings.tags&&this.props.tagsSettings.tags.map(function(tag){return{text:tag.get("name"),value:tag.get("_id")}}).toArray();return react_default.a.createElement(Modals_BaseModal,{options:{bgclose:!1}},react_default.a.createElement("div",{className:"uk-clearfix"},react_default.a.createElement("h5",{style:{fontWeight:300}},"Add Tags"),react_default.a.createElement("div",null,react_default.a.createElement("form",{className:"nomargin",onSubmit:function(e){return _this2.onSubmit(e)}},react_default.a.createElement("div",{className:"search-container"},react_default.a.createElement("select",{name:"tags",id:"tags",className:"chosen-select",multiple:!0,"data-placeholder":" ","data-noresults":"No Tags Found for ",ref:function(r){return _this2.select=r}},mappedTags.map(function(tag){return react_default.a.createElement("option",{key:tag.value,value:tag.value},tag.text)})),react_default.a.createElement("button",{type:"button",style:{borderRadius:0}},react_default.a.createElement("i",{className:"material-icons",style:{marginRight:0}},"add"))),react_default.a.createElement("div",{className:"left",style:{marginTop:15}},react_default.a.createElement(components_Button,{type:"button",text:"Clear",small:!0,flat:!0,style:"danger"})),react_default.a.createElement("div",{className:"right",style:{marginTop:15}},react_default.a.createElement(components_Button,{type:"button",text:"Cancel",style:"secondary",small:!0,flat:!0,waves:!0,extraClass:"uk-modal-close",ref:function(r){return _this2.closeButton=r}}),react_default.a.createElement(components_Button,{type:"submit",text:"Save Tags",style:"success",small:!0,waves:!0}))))))}}])&&AddTagsModal_defineProperties(Constructor.prototype,protoProps),staticProps&&AddTagsModal_defineProperties(Constructor,staticProps),AddTagsModal}();AddTagsModal_AddTagsModal.propTypes={ticketId:prop_types_default.a.string.isRequired,currentTags:prop_types_default.a.array,tagsSettings:prop_types_default.a.object.isRequired,getTagsWithPage:prop_types_default.a.func.isRequired};var Modals_AddTagsModal=Object(es.b)(function(state){return{tagsSettings:state.tagsSettings}},{getTagsWithPage:tickets_getTagsWithPage})(AddTagsModal_AddTagsModal);function Grid_typeof(obj){return(Grid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Grid_defineProperties(target,props){for(var i=0;i");attachFileDiv.addClass("attachFileDesc").html("

    Attach images by dragging & dropping or pasting from clipboard.

    "),$el.siblings(".CodeMirror").addClass("hasFileDesc"),$el.siblings(".editor-statusbar").addClass("hasFileDesc").prepend(attachFileDiv)}},{key:"getMdeToolbarItems",value:function(){return[{name:"bold",action:easymde_min_default.a.toggleBold,className:"material-icons mi-bold no-ajaxy",title:"Bold"},{name:"italic",action:easymde_min_default.a.toggleItalic,className:"material-icons mi-italic no-ajaxy",title:"Italic"},{name:"Title",action:easymde_min_default.a.toggleHeadingSmaller,className:"material-icons mi-title no-ajaxy",title:"Title"},"|",{name:"Code",action:easymde_min_default.a.toggleCodeBlock,className:"material-icons mi-code no-ajaxy",title:"Code"},{name:"Quote",action:easymde_min_default.a.toggleBlockquote,className:"material-icons mi-quote no-ajaxy",title:"Quote"},{name:"Generic List",action:easymde_min_default.a.toggleUnorderedList,className:"material-icons mi-list no-ajaxy",title:"Generic List"},{name:"Numbered List",action:easymde_min_default.a.toggleOrderedList,className:"material-icons mi-numlist no-ajaxy",title:"Numbered List"},"|",{name:"Create Link",action:easymde_min_default.a.drawLink,className:"material-icons mi-link no-ajaxy",title:"Create Link"},"|",{name:"Toggle Preview",action:easymde_min_default.a.togglePreview,className:"material-icons mi-preview no-disable no-mobile no-ajaxy",title:"Toggle Preview"}]}}],(protoProps=[{key:"componentDidMount",value:function(){var _this2=this;if(this.easymde=new easymde_min_default.a({element:this.element,forceSync:!0,minHeight:this.props.height,toolbar:EasyMDE.getMdeToolbarItems(),autoDownloadFontAwesome:!1,status:!1,spellChecker:!1}),this.easymde.codemirror.on("change",function(){_this2.onTextareaChanged(_this2.easymde.value())}),this.easymde&&this.props.allowImageUpload){if(!this.props.inlineImageUploadUrl)return logger.error("Invalid inlineImageUploadUrl Prop.");var $el=jquery_default()(this.element);$el.hasClass("hasInlineUpload")||($el.addClass("hasInlineUpload"),window.inlineAttachment.editors.codemirror4.attach(this.easymde.codemirror,{onFileUploadResponse:function(xhr){var result=JSON.parse(xhr.responseText),filename=result[this.settings.jsonFieldName];if(result&&filename){var newValue;newValue="function"==typeof this.settings.urlText?this.settings.urlText.call(this,filename,result):this.settings.urlText.replace(this.filenameTag,filename);var text=this.editor.getValue().replace(this.lastValue,newValue);this.editor.setValue(text),this.settings.onFileUploaded.call(this,filename)}return!1},onFileUploadError:function(xhr){var result=xhr.responseText,text=this.editor.getValue()+" "+result;this.editor.setValue(text)},extraHeaders:this.props.inlineImageUploadHeaders,errorText:"Error uploading file: ",uploadUrl:this.props.inlineImageUploadUrl,jsonFieldName:"filename",urlText:"![Image]({filename})"}),EasyMDE.attachFileDesc(this.element))}}},{key:"componentDidUpdate",value:function(){this.easymde&&this.easymde.value()!==this.state.value&&this.easymde.value(this.state.value)}},{key:"componentWillUnmount",value:function(){this.easymde&&(this.easymde.codemirror.off("change"),this.easymde=null)}},{key:"onTextareaChanged",value:function(value){this.setState({value}),this.props.onChange&&this.props.onChange(value)}},{key:"getEditorText",value:function(){return this.state.value}},{key:"setEditorText",value:function(value){this.setState({value:tomarkdown_default()(value)})}},{key:"render",value:function(){var _this3=this;return setTimeout(function(){_this3.easymde.codemirror.refresh()},250),react_default.a.createElement(react.Fragment,null,react_default.a.createElement("textarea",{ref:function(i){return _this3.element=i},value:this.state.value,onChange:function(e){return _this3.onTextareaChanged(e)}}),this.props.showStatusBar&&react_default.a.createElement("div",{className:"editor-statusbar uk-float-left uk-width-1-1"}))}}])&&EasyMDE_defineProperties(Constructor.prototype,protoProps),staticProps&&EasyMDE_defineProperties(Constructor,staticProps),EasyMDE}();EasyMDE_EasyMDE.propTypes={height:prop_types_default.a.string,value:prop_types_default.a.string,onChange:prop_types_default.a.func,defaultValue:prop_types_default.a.string,allowImageUpload:prop_types_default.a.bool,inlineImageUploadUrl:prop_types_default.a.string,inlineImageUploadHeaders:prop_types_default.a.object,showStatusBar:prop_types_default.a.bool.isRequired},EasyMDE_EasyMDE.defaultProps={height:"150px",allowImageUpload:!1,showStatusBar:!0};var CreateTicketModal_class,CreateTicketModal_class2,CreateTicketModal_descriptor,CreateTicketModal_descriptor2,CreateTicketModal_descriptor3,_descriptor4,components_EasyMDE=EasyMDE_EasyMDE;function CreateTicketModal_typeof(obj){return(CreateTicketModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateTicketModal_extends(){return(CreateTicketModal_extends=Object.assign||function(target){for(var i=1;iPlease enter a valid issue. Issue must contain at least '.concat(minIssueLength," characters"));($mdeError=$issueTextbox.siblings(".editor-statusbar").find(".mde-error")).length<1&&$issueTextbox.siblings(".editor-statusbar").prepend(mdeError)}else{if($errorBorderWrap.css("border","none"),($mdeError=$issueTextbox.parent().find(".mde-error")).length>0&&$mdeError.remove(),!$form.isValid(null,null,!1))return!0;allowAgentUserTickets&&(data.owner=this.ownerSelect.value),data.subject=e.target.subject.value,data.group=this.groupSelect.value,data.type=this.typeSelect.value,data.tags=this.tagSelect.value,data.priority=this.selectedPriority,data.issue=this.issueMde.easymde.value(),data.socketid=socket_default.a.ui.socket.io.engine.id,this.props.createTicket(data)}}}},{key:"onGroupSelectChange",value:function(e){}},{key:"render",value:function(){var _this4=this,_this$props=this.props,shared=_this$props.shared,viewdata=_this$props.viewdata,allowAgentUserTickets=viewdata.ticketSettings.allowAgentUserTickets&&(shared.sessionUser.role.isAdmin||shared.sessionUser.role.isAgent),mappedAccounts=this.props.accounts.map(function(a){return{text:a.get("fullname"),value:a.get("_id")}}).toArray(),mappedGroups=this.props.groups.map(function(grp){return{text:grp.get("name"),value:grp.get("_id")}}).toArray(),mappedTicketTypes=this.props.viewdata.ticketTypes.map(function(type){return{text:type.name,value:type._id}}),mappedTicketTags=this.props.viewdata.ticketTags.map(function(tag){return{text:tag.name,value:tag._id}});return react_default.a.createElement(Modals_BaseModal,CreateTicketModal_extends({},this.props,{options:{bgclose:!1}}),react_default.a.createElement("form",{className:"uk-form-stacked",onSubmit:function(e){return _this4.onFormSubmit(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Subject"),react_default.a.createElement("input",{type:"text",name:"subject",className:"md-input","data-validation":"length","data-validation-length":"min".concat(viewdata.ticketSettings.minSubject),"data-validation-error-msg":"Please enter a valid Subject. Subject must contain at least ".concat(viewdata.ticketSettings.minSubject," characters.")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement(components_Grid,null,allowAgentUserTickets&&react_default.a.createElement(Grid_GridItem,{width:"1-3"},react_default.a.createElement("label",{className:"uk-form-label"},"Owner"),react_default.a.createElement(components_SingleSelect,{showTextbox:!0,items:mappedAccounts,defaultValue:[this.props.viewdata.loggedInAccount._id],width:"100%",ref:function(i){return _this4.ownerSelect=i}})),react_default.a.createElement(Grid_GridItem,{width:allowAgentUserTickets?"2-3":"1-1"},react_default.a.createElement("label",{className:"uk-form-label"},"Group"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,items:mappedGroups,defaultValue:Object(lodash.head)(mappedGroups)?Object(lodash.head)(mappedGroups).value:"",onSelectChange:function(e){return _this4.onGroupSelectChange(e)},width:"100%",ref:function(i){return _this4.groupSelect=i}})))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement(components_Grid,null,react_default.a.createElement(Grid_GridItem,{width:"1-3"},react_default.a.createElement("label",{className:"uk-form-label"},"Type"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,items:mappedTicketTypes,width:"100%",defaultValue:this.props.viewdata.defaultTicketType._id,onSelectChange:function(e){_this4.onTicketTypeSelectChange(e)},ref:function(i){return _this4.typeSelect=i}})),react_default.a.createElement(Grid_GridItem,{width:"2-3"},react_default.a.createElement("label",{className:"uk-form-label"},"Tags"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,items:mappedTicketTags,width:"100%",multiple:!0,ref:function(i){return _this4.tagSelect=i}})))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Priority"),react_default.a.createElement("div",{ref:function(i){return _this4.priorityLoader=i},style:{height:"32px",width:"32px",position:"relative"},className:"hide"},react_default.a.createElement(components_SpinLoader,{style:{background:"transparent"},spinnerStyle:{width:"24px",height:"24px"},active:!0})),react_default.a.createElement("div",{ref:function(i){return _this4.priorityWrapper=i},className:"uk-clearfix"},this.priorities.map(function(priority){return react_default.a.createElement("div",{key:priority._id,className:"uk-float-left"},react_default.a.createElement("span",{className:"icheck-inline"},react_default.a.createElement("input",{id:"p___"+priority._id,name:"priority",type:"radio",className:"with-gap",value:priority._id,onChange:function(e){_this4.onPriorityRadioChange(e)},checked:_this4.selectedPriority===priority._id,"data-md-icheck":!0}),react_default.a.createElement("label",{htmlFor:"p___"+priority._id,className:"mb-10 inline-label"},react_default.a.createElement("span",{className:"uk-badge",style:{backgroundColor:priority.htmlColor}},priority.name))))}))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("span",null,"Description"),react_default.a.createElement("div",{className:"error-border-wrap uk-clearfix"},react_default.a.createElement(components_EasyMDE,{ref:function(i){return _this4.issueMde=i},onChange:function(val){return _this4.issueText=val},allowImageUpload:!0,inlineImageUploadUrl:"/tickets/uploadmdeimage",inlineImageUploadHeaders:{ticketid:"uploads"}})),react_default.a.createElement("span",{style:{marginTop:"6px",display:"inline-block",fontSize:"11px"},className:"uk-text-muted"},"Please try to be as specific as possible. Please include any details you think may be relevant, such as","troubleshooting steps you've taken.")),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{text:"Cancel",flat:!0,waves:!0,extraClass:"uk-modal-close"}),react_default.a.createElement(components_Button,{text:"Create",style:"primary",flat:!0,type:"submit"}))))}}])&&CreateTicketModal_defineProperties(Constructor.prototype,protoProps),staticProps&&CreateTicketModal_defineProperties(Constructor,staticProps),CreateTicketModal}()).prototype,"priorities",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),CreateTicketModal_descriptor2=CreateTicketModal_applyDecoratedDescriptor(CreateTicketModal_class2.prototype,"allAccounts",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.props.accounts||[]}}),CreateTicketModal_descriptor3=CreateTicketModal_applyDecoratedDescriptor(CreateTicketModal_class2.prototype,"groupAccounts",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),_descriptor4=CreateTicketModal_applyDecoratedDescriptor(CreateTicketModal_class2.prototype,"selectedPriority",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateTicketModal_class=CreateTicketModal_class2))||CreateTicketModal_class;CreateTicketModal_CreateTicketModal.propTypes={shared:prop_types_default.a.object.isRequired,viewdata:prop_types_default.a.object.isRequired,accounts:prop_types_default.a.object.isRequired,groups:prop_types_default.a.object.isRequired,createTicket:prop_types_default.a.func.isRequired,fetchGroups:prop_types_default.a.func.isRequired,fetchAccounts:prop_types_default.a.func.isRequired};var CreateRoleModal_class,CreateRoleModal_class2,CreateRoleModal_descriptor,Modals_CreateTicketModal=Object(es.b)(function(state){return{shared:state.shared,viewdata:state.common,groups:state.groupsState.groups,accounts:state.accountsState.accounts}},{createTicket:tickets_createTicket,fetchGroups:groups_fetchGroups,fetchAccounts:accounts_fetchAccounts})(CreateTicketModal_CreateTicketModal);function CreateRoleModal_typeof(obj){return(CreateRoleModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateRoleModal_defineProperties(target,props){for(var i=0;ipayload,()=>({thunk:!0})),teams_createTeam=Object(createAction.a)(CREATE_TEAM.ACTION),saveEditTeam=Object(createAction.a)(SAVE_EDIT_TEAM.ACTION),teams_deleteTeam=Object(createAction.a)(DELETE_TEAM.ACTION),unloadTeams=Object(createAction.a)(UNLOAD_TEAMS.ACTION,payload=>payload,()=>({thunk:!0}));function MultiSelect_typeof(obj){return(MultiSelect_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function MultiSelect_defineProperties(target,props){for(var i=0;i").concat(i.text,""))}),$select.attr("disabled",!1),$select.multiSelect("refresh"),this.props.initialSelected&&($select.multiSelect("select",this.props.initialSelected),$select.multiSelect("refresh"))),$select.attr("disabled",this.props.disabled),$select.multiSelect("refresh")}},{key:"getSelected",value:function(){var $select=jquery_default()(this.select);return $select?$select.val():[]}},{key:"selectAll",value:function(){var $select=jquery_default()(this.select);$select&&this.props.items&&this.props.items.length>0&&($select.multiSelect("select_all"),$select.multiSelect("refresh"))}},{key:"deselectAll",value:function(){var $select=jquery_default()(this.select);$select&&this.props.items&&this.props.items.length>0&&($select.multiSelect("deselect_all"),$select.multiSelect("refresh"))}},{key:"render",value:function(){var _this=this,_this$props=this.props,id=_this$props.id,items=_this$props.items;return react_default.a.createElement("select",{id,multiple:"multiple",className:"multiselect",ref:function(r){return _this.select=r}},items&&items.map(function(item,i){return react_default.a.createElement("option",{key:i,value:item.value},item.text)}))}}])&&MultiSelect_defineProperties(Constructor.prototype,protoProps),staticProps&&MultiSelect_defineProperties(Constructor,staticProps),MultiSelect}();MultiSelect_MultiSelect.propTypes={id:prop_types_default.a.string,items:prop_types_default.a.array.isRequired,initialSelected:prop_types_default.a.array,onChange:prop_types_default.a.func.isRequired,disabled:prop_types_default.a.bool};var CreateAccountModal_class,CreateAccountModal_class2,CreateAccountModal_descriptor,CreateAccountModal_descriptor2,CreateAccountModal_descriptor3,CreateAccountModal_descriptor4,_descriptor5,_descriptor6,_descriptor7,components_MultiSelect=MultiSelect_MultiSelect;function CreateAccountModal_typeof(obj){return(CreateAccountModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateAccountModal_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function CreateAccountModal_defineProperties(target,props){for(var i=0;i1?this.password:void 0,passwordConfirm:this.passwordConfirm.length>1?this.passwordConfirm:void 0};this.props.createAccount(payload)}}},{key:"render",value:function(){var _this3=this,roles=this.props.roles.map(function(role){return{text:role.get("name"),value:role.get("_id")}}).toArray(),groups=this.props.groups.map(function(group){return{text:group.get("name"),value:group.get("_id")}}).toArray(),teams=this.props.teams.map(function(team){return{text:team.get("name"),value:team.get("_id")}}).toArray();return react_default.a.createElement(Modals_BaseModal,{parentExtraClass:"pt-0",extraClass:"p-0 pb-25"},react_default.a.createElement("div",{className:"user-heading",style:{minHeight:"130px",background:"#1976d2",padding:"24px"}},react_default.a.createElement("div",{className:"uk-width-1-1"},react_default.a.createElement("div",{style:{width:"82px",height:"82px",float:"left",marginRight:"24px",position:"relative"}},react_default.a.createElement("div",{className:"mediumProfilePic",style:{position:"relative"}},react_default.a.createElement("img",{src:"/uploads/users/defaultProfile.jpg",alt:"Profile Picture"}))),react_default.a.createElement("div",{className:"user-heading-content"},react_default.a.createElement("h2",null,react_default.a.createElement("span",{className:"uk-text-truncate"},"Create Account"),react_default.a.createElement("span",{className:"sub-heading"},"Please provide account details below"))))),react_default.a.createElement("div",{style:{margin:"24px 24px 0 24px"}},react_default.a.createElement("form",{className:"uk-form-stacked",onSubmit:function(e){return _this3.onFormSubmit(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Username"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.username,onChange:function(e){return _this3.onInputChanged(e,"username")},"data-validation":"length","data-validation-length":"min4","data-validation-error-msg":"Username must contain at least 4 characters."})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Name"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.fullname,onChange:function(e){return _this3.onInputChanged(e,"fullname")},"data-validation":"length","data-validation-length":"min2","data-validation-error-msg":"Name must contain at least 2 characters."})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Title"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.title,onChange:function(e){return _this3.onInputChanged(e,"title")}}))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Password"),react_default.a.createElement("input",{type:"password",className:"md-input",name:"password_confirmation",value:this.password,onChange:function(e){return _this3.onInputChanged(e,"password")},"data-validation":"length","data-validation-length":"min6","data-validation-error-msg":"Password must contain at least 6 characters."})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Confirm Password"),react_default.a.createElement("input",{type:"password",className:"md-input",name:"password",value:this.passwordConfirm,onChange:function(e){return _this3.onInputChanged(e,"passwordConfirm")},"data-validation":"confirmation","data-validation-error-msg":"Password does not match"}))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Email"),react_default.a.createElement("input",{type:"email",className:"md-input",value:this.email,onChange:function(e){return _this3.onInputChanged(e,"email")},"data-validation":"email"})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Role"),react_default.a.createElement(components_SingleSelect,{items:roles,width:"100",showTextbox:!1,onSelectChange:function(e){return _this3.onRoleSelectChange(e)}}),react_default.a.createElement("span",{className:"hide help-block",style:{display:"inline-block",marginTop:"10px",fontWeight:"bold",color:"#d85030"},ref:function(r){return _this3.roleSelectErrorMessage=r}},"Please select a role for this user")),!this.isAgentRole&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Groups"),react_default.a.createElement(components_MultiSelect,{items:groups,onChange:function(e){return _this3.onGroupSelectChange(e)},ref:function(r){return _this3.groupSelect=r}}),react_default.a.createElement("span",{className:"hide help-block",style:{display:"inline-block",marginTop:"3px",fontWeight:"bold",color:"#d85030"},ref:function(r){return _this3.groupSelectErrorMessage=r}},"Please select a group for this user."))),this.isAgentRole&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Teams"),react_default.a.createElement(components_MultiSelect,{items:teams,onChange:function(){},ref:function(r){return _this3.teamSelect=r}}))),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{text:"Close",flat:!0,waves:!0,extraClass:"uk-modal-close"}),react_default.a.createElement(components_Button,{text:"Create Account",flat:!0,waves:!0,style:"success",type:"submit"})))))}}])&&CreateAccountModal_defineProperties(Constructor.prototype,protoProps),staticProps&&CreateAccountModal_defineProperties(Constructor,staticProps),CreateAccountModal}()).prototype,"username",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateAccountModal_descriptor2=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"password",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateAccountModal_descriptor3=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"passwordConfirm",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateAccountModal_descriptor4=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"fullname",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_descriptor5=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"email",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_descriptor6=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"title",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_descriptor7=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"isAgentRole",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),CreateAccountModal_class=CreateAccountModal_class2))||CreateAccountModal_class;CreateAccountModal_CreateAccountModal.propTypes={common:prop_types_default.a.object.isRequired,groups:prop_types_default.a.object.isRequired,teams:prop_types_default.a.object.isRequired,roles:prop_types_default.a.object.isRequired,createAccount:prop_types_default.a.func.isRequired,fetchGroups:prop_types_default.a.func.isRequired,unloadGroups:prop_types_default.a.func.isRequired,fetchTeams:prop_types_default.a.func.isRequired,unloadTeams:prop_types_default.a.func.isRequired,fetchRoles:prop_types_default.a.func.isRequired};var Modals_CreateAccountModal=Object(es.b)(function(state){return{roles:state.shared.roles,common:state.common,groups:state.groupsState.groups,teams:state.teamsState.teams}},{createAccount:accounts_createAccount,fetchGroups:groups_fetchGroups,unloadGroups,fetchTeams:teams_fetchTeams,unloadTeams,fetchRoles:common_fetchRoles})(CreateAccountModal_CreateAccountModal);const departments_fetchDepartments=Object(createAction.a)(FETCH_DEPARTMENTS.ACTION,payload=>payload,()=>({thunk:!0})),departments_createDepartment=Object(createAction.a)(CREATE_DEPARTMENT.ACTION),departments_updateDepartment=Object(createAction.a)(UPDATE_DEPARTMENT.ACTION),departments_deleteDepartment=Object(createAction.a)(DELETE_DEPARTMENT.ACTION),departments_unloadDepartments=Object(createAction.a)(UNLOAD_DEPARTMENTS.ACTION,payload=>payload,()=>({thunk:!0}));var EditAccountModal_class,EditAccountModal_class2,EditAccountModal_descriptor,EditAccountModal_descriptor2,EditAccountModal_descriptor3,EditAccountModal_descriptor4,EditAccountModal_descriptor5,EditAccountModal_descriptor6;function EditAccountModal_typeof(obj){return(EditAccountModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function EditAccountModal_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function EditAccountModal_defineProperties(target,props){for(var i=0;i1?this.password:void 0,passwordConfirm:this.confirmPassword.length>1?this.confirmPassword:void 0};this.props.saveEditAccount(data)}}},{key:"render",value:function(){var departments,groups,teams,_this3=this,_this$props=this.props,user=_this$props.user,edit=_this$props.edit,customer=!this.isAgentRole,profilePicture=user.image||"defaultProfile.jpg",roles=helpers_default.a.getRolesByHierarchy().map(function(role){return{text:role.name,value:role._id}});return teams=this.props.teams?this.props.teams.map(function(team){return{text:team.get("name"),value:team.get("_id")}}).toArray():[],departments=this.props.departments?this.props.departments.map(function(department){return{text:department.get("name"),value:department.get("_id")}}).toArray():[],groups=this.props.groups?this.props.groups.map(function(group){return{text:group.get("name"),value:group.get("_id")}}).toArray():[],user.teams||(user.teams=[]),user.departments||(user.departments=[]),user.groups||(user.groups=[]),react_default.a.createElement(Modals_BaseModal,{parentExtraClass:"pt-0",extraClass:"p-0 pb-25"},react_default.a.createElement("div",{className:"user-heading",style:{minHeight:"130px",background:"#1976d2",padding:"24px"}},react_default.a.createElement("div",{className:"uk-width-1-1"},react_default.a.createElement("div",{style:{width:"82px",height:"82px",float:"left",marginRight:"24px",position:"relative"}},edit&&react_default.a.createElement("form",{className:"form nomargin",encType:"multipart/form-data"},react_default.a.createElement("div",{className:"mediumProfilePic",style:{position:"relative"}},react_default.a.createElement("input",{name:"_id",type:"hidden",value:user._id,readOnly:!0}),react_default.a.createElement("input",{name:"username",type:"hidden",value:user.username,readOnly:!0}),react_default.a.createElement("input",{type:"file",style:{display:"none"},ref:function(r){return _this3.uploadImageInput=r},onChange:function(e){return _this3.onImageUploadChanged(e)}}),react_default.a.createElement("img",{src:"/uploads/users/".concat(profilePicture),alt:"Profile Picture",ref:function(r){return _this3.uploadProfileImage=r}})),react_default.a.createElement("div",{className:"profile-picture-controls"},react_default.a.createElement("span",{className:"btn-file",onClick:function(e){return _this3.onFileBtnClick(e)}},react_default.a.createElement("i",{className:"material-icons"},"file_upload")))),!edit&&react_default.a.createElement("div",{className:"mediumProfilePic",style:{position:"relative"}},react_default.a.createElement("img",{src:"/uploads/users/".concat(profilePicture),alt:"Profile Picture",ref:function(r){return _this3.uploadProfileImage=r}}))),react_default.a.createElement("div",{className:"user-heading-content"},react_default.a.createElement("h2",null,react_default.a.createElement("span",{className:"uk-text-truncate"},user.username),react_default.a.createElement("span",{className:"sub-heading"},user.title))))),react_default.a.createElement("div",{style:{margin:"24px 24px 0 24px"}},react_default.a.createElement("form",{className:"uk-form-stacked",onSubmit:function(e){return _this3.onSubmitSaveAccount(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Name"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.name,onChange:function(e){return _this3.onInputChanged(e,"name")},disabled:!edit})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Title"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.title,onChange:function(e){return _this3.onInputChanged(e,"title")},disabled:!edit}))),edit&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Password"),react_default.a.createElement("input",{type:"password",className:"md-input",value:this.password,onChange:function(e){return _this3.onInputChanged(e,"password")}})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Confirm Password"),react_default.a.createElement("input",{type:"password",className:"md-input",value:this.confirmPassword,onChange:function(e){return _this3.onInputChanged(e,"confirmPassword")}})))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Email"),react_default.a.createElement("input",{type:"email",className:"md-input",value:this.email,onChange:function(e){return _this3.onInputChanged(e,"email")},disabled:!edit})),edit&&react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Role"),react_default.a.createElement(components_SingleSelect,{items:roles,width:"100",showTextbox:!1,defaultValue:user.role._id,onSelectChange:function(e){return _this3.onRoleSelectChange(e)},disabled:!edit})),this.props.groups&&customer&&react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Groups"),react_default.a.createElement(components_MultiSelect,{items:groups,initialSelected:user.groups.map(function(i){return i._id}),onChange:function(){},ref:function(r){return _this3.groupSelect=r},disabled:!edit})),!customer&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Teams"),react_default.a.createElement(components_MultiSelect,{items:teams,initialSelected:user.teams.map(function(i){return i._id}),onChange:function(){},ref:function(r){return _this3.teamsSelect=r},disabled:!edit})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Departments"),react_default.a.createElement(components_MultiSelect,{items:departments,initialSelected:user.departments.map(function(i){return i._id}),onChange:function(){},disabled:!0}))),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{text:"Close",flat:!0,waves:!0,extraClass:"uk-modal-close"}),react_default.a.createElement(components_Button,{text:"Save Account",flat:!0,waves:!0,style:"primary",type:"submit",disabled:!edit})))))}}])&&EditAccountModal_defineProperties(Constructor.prototype,protoProps),staticProps&&EditAccountModal_defineProperties(Constructor,staticProps),EditAccountModal}()).prototype,"name",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor2=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"title",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor3=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"password",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor4=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"confirmPassword",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor5=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"email",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor6=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"isAgentRole",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),EditAccountModal_class=EditAccountModal_class2))||EditAccountModal_class;EditAccountModal_EditAccountModal.propTypes={edit:prop_types_default.a.bool.isRequired,user:prop_types_default.a.object.isRequired,groups:prop_types_default.a.object.isRequired,teams:prop_types_default.a.object.isRequired,departments:prop_types_default.a.object.isRequired,saveEditAccount:prop_types_default.a.func.isRequired,fetchGroups:prop_types_default.a.func.isRequired,unloadGroups:prop_types_default.a.func.isRequired,fetchTeams:prop_types_default.a.func.isRequired,unloadTeams:prop_types_default.a.func.isRequired,fetchDepartments:prop_types_default.a.func.isRequired,unloadDepartments:prop_types_default.a.func.isRequired,fetchRoles:prop_types_default.a.func.isRequired,roles:prop_types_default.a.object.isRequired},EditAccountModal_EditAccountModal.defaultProps={edit:!1};var CreateGroupModal_class,CreateGroupModal_class2,CreateGroupModal_descriptor,Modals_EditAccountModal=Object(es.b)(function(state){return{groups:state.groupsState.groups,teams:state.teamsState.teams,departments:state.departmentsState.departments,roles:state.shared.roles}},{saveEditAccount:accounts_saveEditAccount,fetchGroups:groups_fetchGroups,unloadGroups,fetchTeams:teams_fetchTeams,unloadTeams,fetchDepartments:departments_fetchDepartments,unloadDepartments:departments_unloadDepartments,fetchRoles:common_fetchRoles})(EditAccountModal_EditAccountModal);function CreateGroupModal_typeof(obj){return(CreateGroupModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateGroupModal_defineProperties(target,props){for(var i=0;ipayload,()=>({thunk:!0})),search_unloadSearchResults=Object(createAction.a)(UNLOAD_SEARCH_RESULTS.ACTION,payload=>payload,()=>({thunk:!0}));function PageTitle_typeof(obj){return(PageTitle_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function PageTitle_defineProperties(target,props){for(var i=0;i0)return!1;SearchResults.toggleAnimation(!0,!1)}},{key:"toggleAnimation",value:function(forceState,state){for(var animateItems=jquery_default()(".search-results-container"),docElemStyle=document.documentElement.style,transitionProp=angular.isString(docElemStyle.transition)?"transition":"WebkitTransition",i=0;i3?(components_SearchResults.toggleAnimation(!0,!0),this.props.fetchSearchResults({term:this.searchTerm})):components_SearchResults.toggleAnimation(!0,!1)}},{key:"_onSearchFocus",value:function(e){this.searchTerm.length>3&&components_SearchResults.toggleAnimation(!0,!0)}},{key:"onSearchKeypress",value:function(e){this.searchTerm.length>3&&this.props.fetchSearchResults({term:this.searchTerm})}},{key:"_selectAll",value:function(){var _this4=this;this.selectedTickets=[],this.ticketsTable.querySelectorAll('td > input[type="checkbox"]').forEach(function(item){_this4.selectedTickets.push(item.dataset.ticket),item.checked=!0}),this.selectedTickets=Object(lodash.uniq)(this.selectedTickets)}},{key:"_clearChecked",value:function(){this.selectedTickets=[],this.ticketsTable.querySelectorAll('td > input[type="checkbox"]').forEach(function(item){item.checked=!1}),this.selectAllCheckbox.checked=!1}},{key:"onSelectAll",value:function(e){e.target.checked?this._selectAll():this._clearChecked()}},{key:"render",value:function(){for(var _this5=this,loadingItems=[],i=0;i<51;i++){for(var cells=[],k=0;k<10;k++)cells.push(react_default.a.createElement(Table_TableCell,{key:k,className:"vam"},react_default.a.createElement("div",{className:"loadingTextAnimation"})));loadingItems.push(react_default.a.createElement(Table_TableRow,{key:Math.random()},cells))}var selectAllCheckbox=react_default.a.createElement("div",{style:{marginLeft:17}},react_default.a.createElement("input",{type:"checkbox",id:"select_all",style:{display:"none"},className:"svgcheckinput",onChange:function(e){return _this5.onSelectAll(e)},ref:function(r){return _this5.selectAllCheckbox=r}}),react_default.a.createElement("label",{htmlFor:"select_all",className:"svgcheck"},react_default.a.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 18 18"},react_default.a.createElement("path",{d:"M1,9 L1,3.5 C1,2 2,1 3.5,1 L14.5,1 C16,1 17,2 17,3.5 L17,14.5 C17,16 16,17 14.5,17 L3.5,17 C2,17 1,16 1,14.5 L1,9 Z"}),react_default.a.createElement("polyline",{points:"1 9 7 14 15 4"}))));return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Tickets",shadow:!1,rightComponent:react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(components_TitlePagination,{limit:50,total:this.props.totalCount,type:this.props.view,prevEnabled:this.props.prevEnabled,nextEnabled:this.props.nextEnabled,currentPage:this.props.page,prevPage:this.props.prevPage,nextPage:this.props.nextPage,filter:this.props.filter}),react_default.a.createElement(components_PageTitleButton,{fontAwesomeIcon:"fa-refresh",onButtonClick:function(e){e.preventDefault(),_this5.props.unloadTickets().then(_this5.props.fetchTickets({type:_this5.props.view,page:_this5.props.page}))}}),react_default.a.createElement(components_PageTitleButton,{fontAwesomeIcon:"fa-filter",onButtonClick:function(e){e.preventDefault(),_this5.props.showModal("FILTER_TICKET")}}),react_default.a.createElement(Dropdown_DropdownTrigger,{pos:"bottom-right",offset:5,extraClass:"uk-float-left"},react_default.a.createElement(components_PageTitleButton,{fontAwesomeIcon:"fa-tasks"}),react_default.a.createElement(components_Dropdown,{small:!0,width:120},react_default.a.createElement(Dropdown_DropdownItem,{text:"Create",onClick:function(){return _this5.props.showModal("CREATE_TICKET")}}),react_default.a.createElement(DropdownSeperator,null),react_default.a.createElement(Dropdown_DropdownItem,{text:"Set Open",onClick:function(){return _this5.onSetStatus(1)}}),react_default.a.createElement(Dropdown_DropdownItem,{text:"Set Pending",onClick:function(){return _this5.onSetStatus(2)}}),react_default.a.createElement(Dropdown_DropdownItem,{text:"Set Closed",onClick:function(){return _this5.onSetStatus(3)}}),helpers_default.a.canUser("tickets:delete",!0)&&react_default.a.createElement(DropdownSeperator,null),helpers_default.a.canUser("tickets:delete",!0)&&react_default.a.createElement(Dropdown_DropdownItem,{text:"Delete",extraClass:"text-danger",onClick:function(){return _this5.onDeleteClicked()}}))),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("div",{id:"ticket-search-box",className:"search-box uk-float-left nb",style:{marginTop:8,paddingLeft:0}},react_default.a.createElement("input",{type:"text",id:"tickets_Search",placeholder:"Search",className:"ticket-top-search",value:this.searchTerm,onChange:function(e){return _this5.onSearchTermChanged(e)},onFocus:function(e){return _this5._onSearchFocus(e)}})))),react_default.a.createElement(components_SearchResults,{target:"#ticket-search-box",ref:function(r){return _this5.searchContainer=r}}))}),react_default.a.createElement(components_PageContent,{padding:0,paddingBottom:0,extraClass:"uk-position-relative"},react_default.a.createElement(components_Table,{tableRef:function(ref){return _this5.ticketsTable=ref},style:{margin:0},extraClass:"pDataTable",stickyHeader:!0,striped:!0,headers:[react_default.a.createElement(Table_TableHeader,{key:0,width:45,height:50,component:selectAllCheckbox}),react_default.a.createElement(Table_TableHeader,{key:1,width:60,text:"Status"}),react_default.a.createElement(Table_TableHeader,{key:2,width:65,text:"#"}),react_default.a.createElement(Table_TableHeader,{key:3,width:"23%",text:"Subject"}),react_default.a.createElement(Table_TableHeader,{key:4,width:110,text:"Created"}),react_default.a.createElement(Table_TableHeader,{key:5,width:125,text:"Requester"}),react_default.a.createElement(Table_TableHeader,{key:6,width:175,text:"Customer"}),react_default.a.createElement(Table_TableHeader,{key:7,text:"Assignee"}),react_default.a.createElement(Table_TableHeader,{key:8,width:110,text:"Due Date"}),react_default.a.createElement(Table_TableHeader,{key:9,text:"Updated"})]},!this.props.loading&&this.props.tickets.size<1&&react_default.a.createElement(Table_TableRow,{clickable:!1},react_default.a.createElement(Table_TableCell,{colSpan:10},react_default.a.createElement("h5",{style:{margin:10}},"No Tickets Found"))),this.props.loading&&loadingItems,!this.props.loading&&this.props.tickets.map(function(ticket){var a,status=function(){switch(ticket.get("status")){case 0:return"new";case 1:return"open";case 2:return"pending";case 3:return"closed"}},updated=ticket.get("updated")?helpers_default.a.formatDate(ticket.get("updated"),helpers_default.a.getShortDateFormat())+", "+helpers_default.a.formatDate(ticket.get("updated"),helpers_default.a.getTimeFormat()):"--",dueDate=ticket.get("dueDate")?helpers_default.a.formatDate(ticket.get("dueDate"),helpers_default.a.getShortDateFormat()):"--";return react_default.a.createElement(Table_TableRow,{key:ticket.get("_id"),className:"ticket-".concat(status()," ").concat(function(){if(!_this5.props.common.showOverdue||-1!==[2,3].indexOf(ticket.get("status")))return!1;var overdueIn=ticket.getIn(["priority","overdueIn"]),now=moment_timezone_default()(),updated=ticket.get("updated"),timeout=(updated=updated?moment_timezone_default()(updated):moment_timezone_default()(ticket.get("date"))).clone().add(overdueIn,"m");return now.isAfter(timeout)}()?"overdue":""),clickable:!0,onClick:function(e){if(e.target.closest("td").getElementsByTagName("input").length>0)return!1;History.pushState(null,"Ticket-".concat(ticket.get("uid")),"/tickets/".concat(ticket.get("uid")))}},react_default.a.createElement(Table_TableCell,{className:"ticket-priority nbb vam",style:{borderColor:ticket.getIn(["priority","htmlColor"]),padding:"18px 15px"}},react_default.a.createElement("input",{type:"checkbox",id:"c_".concat(ticket.get("_id")),"data-ticket":ticket.get("_id"),style:{display:"none"},onChange:function(e){return _this5.onTicketCheckChanged(e,ticket.get("_id"))},className:"svgcheckinput"}),react_default.a.createElement("label",{htmlFor:"c_".concat(ticket.get("_id")),className:"svgcheck"},react_default.a.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 18 18"},react_default.a.createElement("path",{d:"M1,9 L1,3.5 C1,2 2,1 3.5,1 L14.5,1 C16,1 17,2 17,3.5 L17,14.5 C17,16 16,17 14.5,17 L3.5,17 C2,17 1,16 1,14.5 L1,9 Z"}),react_default.a.createElement("polyline",{points:"1 9 7 14 15 4"})))),react_default.a.createElement(Table_TableCell,{className:"ticket-status ticket-".concat(status()," vam nbb uk-text-center")},react_default.a.createElement("span",{className:"uk-display-inline-block"},status()[0].toUpperCase())),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.get("uid")),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.get("subject")),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},helpers_default.a.formatDate(ticket.get("date"),helpers_default.a.getShortDateFormat())),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.getIn(["owner","fullname"])),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.getIn(["group","name"])),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},(a=ticket.get("assignee"))?a.get("fullname"):"--"),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},dueDate),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},updated))}))))}}])&&TicketsContainer_defineProperties(Constructor.prototype,protoProps),staticProps&&TicketsContainer_defineProperties(Constructor,staticProps),TicketsContainer}()).prototype,"searchTerm",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),TicketsContainer_class=TicketsContainer_class2))||TicketsContainer_class;TicketsContainer_TicketsContainer.propTypes={view:prop_types_default.a.string.isRequired,page:prop_types_default.a.string.isRequired,prevPage:prop_types_default.a.number.isRequired,nextPage:prop_types_default.a.number.isRequired,prevEnabled:prop_types_default.a.bool.isRequired,nextEnabled:prop_types_default.a.bool.isRequired,tickets:prop_types_default.a.object.isRequired,totalCount:prop_types_default.a.string.isRequired,loading:prop_types_default.a.bool.isRequired,fetchTickets:prop_types_default.a.func.isRequired,deleteTicket:prop_types_default.a.func.isRequired,ticketEvent:prop_types_default.a.func.isRequired,unloadTickets:prop_types_default.a.func.isRequired,ticketUpdated:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired,fetchSearchResults:prop_types_default.a.func.isRequired,common:prop_types_default.a.object.isRequired,filter:prop_types_default.a.object.isRequired},TicketsContainer_TicketsContainer.defaultProps={view:"active",page:0,prevEnabled:!0,nextEnabled:!0};var AssigneeDropdownPartial_class,AssigneeDropdownPartial_class2,AssigneeDropdownPartial_descriptor,Tickets_TicketsContainer=Object(es.b)(function(state){return{tickets:state.ticketsState.tickets,totalCount:state.ticketsState.totalCount,prevPage:state.ticketsState.prevPage,nextPage:state.ticketsState.nextPage,loading:state.ticketsState.loading,common:state.common}},{fetchTickets:tickets_fetchTickets,deleteTicket:tickets_deleteTicket,ticketEvent:tickets_ticketEvent,unloadTickets,ticketUpdated:tickets_ticketUpdated,fetchSearchResults:search_fetchSearchResults,showModal})(TicketsContainer_TicketsContainer),sortBy=__webpack_require__(425),sortBy_default=__webpack_require__.n(sortBy),union=__webpack_require__(430),union_default=__webpack_require__.n(union);function AssigneeDropdownPartial_typeof(obj){return(AssigneeDropdownPartial_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function AssigneeDropdownPartial_defineProperties(target,props){for(var i=0;i"),react_default.a.createElement("br",null),react_default.a.createElement("time",{dateTime:dateFormatted,title:dateFormatted,"data-uk-tooltip":"{delay: 200}"},helpers_default.a.calendarDate(comment.date)),react_default.a.createElement("br",null),isNote&&react_default.a.createElement("span",{className:"uk-badge uk-badge-small nomargin-left-right text-white"},"NOTE"),react_default.a.createElement("div",{className:"comment-body",style:{marginTop:10},ref:function(r){return _this.body=r}},isNote&&react_default.a.createElement(react.Fragment,null,react_html_parser_lib_default()(comment.note)),!isNote&&react_default.a.createElement(react.Fragment,null,react_html_parser_lib_default()(comment.comment)))),3!==this.props.ticketStatus&&react_default.a.createElement("div",{className:"comment-actions"},helpers_default.a.hasPermOverRole(comment.owner.role,null,"comments:delete",!0)&&react_default.a.createElement("div",{className:"remove-comment",onClick:onRemoveClick},react_default.a.createElement("i",{className:"material-icons"},"")),helpers_default.a.hasPermOverRole(comment.owner.role,null,"comments:update",!0)&&react_default.a.createElement("div",{className:"edit-comment",onClick:onEditClick},react_default.a.createElement("i",{className:"material-icons"},""))))}}])&&CommentNotePartial_defineProperties(Constructor.prototype,protoProps),staticProps&&CommentNotePartial_defineProperties(Constructor,staticProps),CommentNotePartial}();CommentNotePartial_CommentNotePartial.propTypes={ticketStatus:prop_types_default.a.number.isRequired,ticketSubject:prop_types_default.a.string.isRequired,comment:prop_types_default.a.object.isRequired,dateFormat:prop_types_default.a.string.isRequired,isNote:prop_types_default.a.bool.isRequired,onEditClick:prop_types_default.a.func.isRequired,onRemoveClick:prop_types_default.a.func.isRequired},CommentNotePartial_CommentNotePartial.defaultProps={isNote:!1};var Tickets_CommentNotePartial=CommentNotePartial_CommentNotePartial;function DatePicker_typeof(obj){return(DatePicker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function DatePicker_defineProperties(target,props){for(var i=0;i"),react_default.a.createElement("br",null),react_default.a.createElement("time",{dateTime:helpers_default.a.formatDate(this.props.date,"YYYY-MM-DD HH:mm")},helpers_default.a.formatDate(this.props.date,this.props.dateFormat)),react_default.a.createElement("br",null),react_default.a.createElement("ul",{className:"attachments"},this.attachments&&this.attachments.map(function(attachment){return react_default.a.createElement("li",{key:attachment._id},react_default.a.createElement("a",{href:attachment.path,className:"no-ajaxy",rel:"noopener noreferrer",target:"_blank"},attachment.name),3!==_this4.status&&react_default.a.createElement("a",{role:"button",className:"remove-attachment",onClick:function(e){return _this4.removeAttachment(e,attachment._id)}},react_default.a.createElement("i",{className:"fa fa-remove"})))})),react_default.a.createElement("div",{className:"issue-body",ref:function(r){return _this4.issueBody=r}},react_html_parser_lib_default()(this.issue))),3!==this.status&&helpers_default.a.hasPermOverRole(this.props.owner.role,null,"tickets:update",!0)&&react_default.a.createElement(react.Fragment,null,react_default.a.createElement("div",{className:"edit-issue",onClick:function(){_this4.props.editorWindow&&_this4.props.editorWindow.openEditorWindow({subject:_this4.subject,text:_this4.issue,onPrimaryClick:function(data){socket_default.a.ui.setTicketIssue(_this4.ticketId,data.text,data.subjectText)}})}},react_default.a.createElement("i",{className:"material-icons"},"")),react_default.a.createElement("form",{className:"form nomargin",encType:"multipart/form-data"},react_default.a.createElement("div",{className:"add-attachment",onClick:function(e){return _this4.attachmentInput.click()}},react_default.a.createElement("i",{className:"material-icons"},"")),react_default.a.createElement("input",{ref:function(r){return _this4.attachmentInput=r},className:"hide",type:"file",onChange:function(e){return _this4.onAttachmentInputChange(e)}}))))}}])&&IssuePartial_defineProperties(Constructor.prototype,protoProps),staticProps&&IssuePartial_defineProperties(Constructor,staticProps),IssuePartial}()).prototype,"ticketId",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IssuePartial_descriptor2=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"status",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),IssuePartial_descriptor3=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"owner",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),IssuePartial_descriptor4=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"subject",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IssuePartial_descriptor5=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"issue",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IssuePartial_descriptor6=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"attachments",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),IssuePartial_class=IssuePartial_class2))||IssuePartial_class;IssuePartial_IssuePartial.propTypes={ticketId:prop_types_default.a.string.isRequired,status:prop_types_default.a.number.isRequired,owner:prop_types_default.a.object.isRequired,subject:prop_types_default.a.string.isRequired,issue:prop_types_default.a.string.isRequired,date:prop_types_default.a.string.isRequired,dateFormat:prop_types_default.a.string.isRequired,attachments:prop_types_default.a.array,editorWindow:prop_types_default.a.object};var OffCanvasEditor_class,OffCanvasEditor_class2,OffCanvasEditor_descriptor,OffCanvasEditor_descriptor2,OffCanvasEditor_descriptor3,OffCanvasEditor_descriptor4,Tickets_IssuePartial=IssuePartial_IssuePartial;__webpack_require__(26);function OffCanvasEditor_typeof(obj){return(OffCanvasEditor_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function OffCanvasEditor_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function OffCanvasEditor_defineProperties(target,props){for(var i=0;i .tru-tab-selector"))}},{key:"render",value:function(){var _this=this,_this$props=this.props,children=_this$props.children,showTrack=_this$props.showTrack;return react_default.a.createElement("div",{className:"tru-tab-selectors",style:this.props.style,ref:function(r){return _this.selectors=r}},children,react_default.a.createElement("span",{className:"tru-tab-highlighter"}),showTrack&&react_default.a.createElement("span",{className:"tru-tab-hr tru-tab-hr-lighten"}))}}])&&TruTabSelectors_defineProperties(Constructor.prototype,protoProps),staticProps&&TruTabSelectors_defineProperties(Constructor,staticProps),TruTabSelectors}();TruTabSelectors_TruTabSelectors.propTypes={showTrack:prop_types_default.a.bool,style:prop_types_default.a.object},TruTabSelectors_TruTabSelectors.defaultProps={showTrack:!0};var TruTabs_TruTabSelectors=TruTabSelectors_TruTabSelectors;function TruTabWrapper_typeof(obj){return(TruTabWrapper_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function TruTabWrapper_defineProperties(target,props){for(var i=0;i
    Please select a new priority",function(){},{cancelButtonClass:"uk-hidden"})),socket_default.a.ui.setTicketType(_this4.ticket._id,e.target.value)}},mappedTypes&&mappedTypes.map(function(type){return react_default.a.createElement("option",{key:type.value,value:type.value},type.text)})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},this.ticket.type.name))),react_default.a.createElement("div",{className:"uk-width-1-2 uk-float-left nopadding"},react_default.a.createElement("div",{className:"marginleft5"},react_default.a.createElement("span",null,"Priority"),hasTicketUpdate&&react_default.a.createElement("select",{name:"tPriority",id:"tPriority",value:this.ticket.priority._id,onChange:function(e){return socket_default.a.ui.setTicketPriority(_this4.ticket._id,e.target.value)}},this.ticket.type&&this.ticket.type.priorities&&this.ticket.type.priorities.map(function(priority){return react_default.a.createElement("option",{key:priority._id,value:priority._id},priority.name)})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},this.ticket.priority.name))),react_default.a.createElement("div",{className:"uk-width-1-1 nopadding uk-clearfix"},react_default.a.createElement("span",null,"Group"),hasTicketUpdate&&react_default.a.createElement("select",{value:this.ticket.group._id,onChange:function(e){socket_default.a.ui.setTicketGroup(_this4.ticket._id,e.target.value)}},mappedGroups&&mappedGroups.map(function(group){return react_default.a.createElement("option",{key:group.value,value:group.value},group.text)})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},this.ticket.group.name)),react_default.a.createElement("div",{className:"uk-width-1-1 p-0"},react_default.a.createElement("span",null,"Due Date")," ",hasTicketUpdate&&react_default.a.createElement("span",null,"- "),hasTicketUpdate&&react_default.a.createElement("div",{className:"uk-display-inline"},react_default.a.createElement("a",{role:"button",onClick:function(e){e.preventDefault(),socket_default.a.ui.setTicketDueDate(_this4.ticket._id,void 0)}},"Clear"),react_default.a.createElement(components_DatePicker,{format:helpers_default.a.getShortDateFormat(),value:this.ticket.dueDate,onChange:function(e){var dueDate=moment_default()(e.target.value,helpers_default.a.getShortDateFormat()).utc().toISOString();socket_default.a.ui.setTicketDueDate(_this4.ticket._id,dueDate)}})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},helpers_default.a.formatDate(this.ticket.dueDate,this.props.common.shortDateFormat))),react_default.a.createElement("div",{className:"uk-width-1-1 nopadding"},react_default.a.createElement("span",null,"Tags",hasTicketUpdate&&react_default.a.createElement(react.Fragment,null,react_default.a.createElement("span",null," - "),react_default.a.createElement("div",{id:"editTags",className:"uk-display-inline"},react_default.a.createElement("a",{role:"button",style:{fontSize:11},className:"no-ajaxy",onClick:function(){_this4.props.showModal("ADD_TAGS_MODAL",{ticketId:_this4.ticket._id,currentTags:_this4.ticket.tags.map(function(tag){return tag._id})})}},"Edit Tags")))),react_default.a.createElement("div",{className:"tag-list uk-clearfix"},this.ticket.tags&&this.ticket.tags.map(function(tag){return react_default.a.createElement("div",{key:tag._id,className:"item"},tag.name)}))))),helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement("div",{className:"uk-width-1-1 padding-left-right-15"},react_default.a.createElement("div",{className:"tru-card ticket-details pr-0 pb-0",style:{height:250}},"Ticket History",react_default.a.createElement("hr",{style:{padding:0,margin:0}}),react_default.a.createElement("div",{className:"history-items scrollable",style:{paddingTop:12}},this.ticket.history&&this.ticket.history.map(function(item){return react_default.a.createElement("div",{key:item._id,className:"history-item"},react_default.a.createElement("time",{dateTime:helpers_default.a.formatDate(item.date,_this4.props.common.longDateFormat)}),react_default.a.createElement("em",null,"Action by: ",react_default.a.createElement("span",null,item.owner.fullname)),react_default.a.createElement("p",null,item.description))}))))))),react_default.a.createElement("div",{className:"page-message nopadding",style:{marginLeft:360}},react_default.a.createElement("div",{className:"page-title-right noshadow"},react_default.a.createElement("div",{className:"page-top-comments uk-float-right"},react_default.a.createElement("a",{role:"button",className:"btn no-ajaxy",onClick:function(e){e.preventDefault(),helpers_default.a.scrollToBottom(".page-content-right",!0)}},"Add Comment")),react_default.a.createElement("div",{className:"onoffswitch subscribeSwitch uk-float-right",style:{marginRight:10,position:"relative",top:18}},react_default.a.createElement("input",{id:"subscribeSwitch",type:"checkbox",name:"subscribeSwitch",className:"onoffswitch-checkbox",checked:this.isSubscribed,onChange:function(e){return _this4.onSubscriberChanged(e)}}),react_default.a.createElement("label",{className:"onoffswitch-label",htmlFor:"subscribeSwitch"},react_default.a.createElement("span",{className:"onoffswitch-inner subscribeSwitch-inner"}),react_default.a.createElement("span",{className:"onoffswitch-switch subscribeSwitch-switch"}))),react_default.a.createElement("div",{className:"pagination uk-float-right",style:{marginRight:5}},react_default.a.createElement("ul",{className:"button-group"},react_default.a.createElement("li",{className:"pagination"},react_default.a.createElement("a",{href:"/tickets/print/".concat(this.ticket.uid),className:"btn no-ajaxy",style:{borderRadius:3,marginRight:5},rel:"noopener noreferrer",target:"_blank"},react_default.a.createElement("i",{className:"material-icons"},"")))))),react_default.a.createElement("div",{className:"page-content-right full-height scrollable"},react_default.a.createElement("div",{className:"comments-wrapper"},react_default.a.createElement(Tickets_IssuePartial,{ticketId:this.ticket._id,status:this.ticket.status,owner:this.ticket.owner,subject:this.ticket.subject,issue:this.ticket.issue,date:this.ticket.date,dateFormat:"".concat(this.props.common.longDateFormat,", ").concat(this.props.common.timeFormat),attachments:this.ticket.attachments,editorWindow:this.editorWindow}),this.hasCommentsOrNotes&&react_default.a.createElement(TruTabs_TruTabWrapper,null,react_default.a.createElement(TruTabs_TruTabSelectors,{style:{marginLeft:110}},react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:0,label:"All",active:!0,showBadge:!0,badgeText:this.commentsAndNotes.length}),react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:1,label:"Comments",showBadge:!0,badgeText:this.ticket?this.ticket.comments&&this.ticket.comments.length:0}),helpers_default.a.canUser("tickets:notes",!0)&&react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:2,label:"Notes",showBadge:!0,badgeText:this.ticket?this.ticket.notes&&this.ticket.notes.length:0})),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:0,active:!0},react_default.a.createElement("div",{className:"all-comments"},this.commentsAndNotes.map(function(item){return react_default.a.createElement(Tickets_CommentNotePartial,{key:item._id,ticketStatus:_this4.ticket.status,ticketSubject:_this4.ticket.subject,comment:item,isNote:item.isNote,dateFormat:"".concat(_this4.props.common.longDateFormat,", ").concat(_this4.props.common.timeFormat),onEditClick:function(){_this4.editorWindow.openEditorWindow({showSubject:!1,text:item.isNote?item.note:item.comment,onPrimaryClick:function(data){item.isNote?socket_default.a.ui.setNoteText(_this4.ticket._id,item._id,data.text):socket_default.a.ui.setCommentText(_this4.ticket._id,item._id,data.text)}})},onRemoveClick:function(){item.isNote?socket_default.a.ui.removeNote(_this4.ticket._id,item._id):socket_default.a.ui.removeComment(_this4.ticket._id,item._id)}})}))),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:1},react_default.a.createElement("div",{className:"comments"},this.ticket&&this.ticket.comments.map(function(comment){return react_default.a.createElement(Tickets_CommentNotePartial,{key:comment._id,ticketStatus:_this4.ticket.status,ticketSubject:_this4.ticket.subject,comment,dateFormat:"".concat(_this4.props.common.longDateFormat,", ").concat(_this4.props.common.timeFormat),onEditClick:function(){_this4.editorWindow.openEditorWindow({showSubject:!1,text:comment.comment,onPrimaryClick:function(data){socket_default.a.ui.setCommentText(_this4.ticket._id,comment._id,data.text)}})},onRemoveClick:function(){socket_default.a.ui.removeComment(_this4.ticket._id,comment._id)}})}))),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:2},react_default.a.createElement("div",{className:"notes"},this.ticket&&this.ticket.notes.map(function(note){return react_default.a.createElement(Tickets_CommentNotePartial,{key:note._id,ticketStatus:_this4.ticket.status,ticketSubject:_this4.ticket.subject,comment:note,isNote:!0,dateFormat:"".concat(_this4.props.common.longDateFormat,", ").concat(_this4.props.common.timeFormat),onEditClick:function(){_this4.editorWindow.openEditorWindow({showSubject:!1,text:note.note,onPrimaryClick:function(data){socket_default.a.ui.setNoteText(_this4.ticket._id,note._id,data.text)}})},onRemoveClick:function(){socket_default.a.ui.removeNote(_this4.ticket._id,note._id)}})})))),3!==this.ticket.status&&(helpers_default.a.canUser("comments:create",!0)||helpers_default.a.canUser("tickets:notes",!0))&&react_default.a.createElement("div",{className:"uk-width-1-1 ticket-reply uk-clearfix"},react_default.a.createElement(components_Avatar_Avatar,{image:this.props.shared.sessionUser.image,showOnlineBubble:!1}),react_default.a.createElement(TruTabs_TruTabWrapper,{style:{paddingLeft:85}},react_default.a.createElement(TruTabs_TruTabSelectors,{showTrack:!1},helpers_default.a.canUser("comments:create",!0)&&react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:0,label:"Comment",active:!0}),helpers_default.a.canUser("tickets:notes",!0)&&react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:1,label:"Internal Note",active:!helpers_default.a.canUser("comments:create",!0)})),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:0,style:{paddingTop:0},active:helpers_default.a.canUser("comments:create",!0)},react_default.a.createElement("form",{onSubmit:function(e){return _this4.onCommentNoteSubmit(e,"comment")}},react_default.a.createElement(components_EasyMDE,{allowImageUpload:!0,inlineImageUploadUrl:"/tickets/uploadmdeimage",inlineImageUploadHeaders:{ticketid:this.ticket._id},ref:function(r){return _this4.commentMDE=r}}),react_default.a.createElement("div",{className:"uk-width-1-1 uk-clearfix",style:{marginTop:50}},react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("button",{type:"submit",className:"uk-button uk-button-accent",style:{padding:"10px 15px"}},"Post Comment"))))),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:1,style:{paddingTop:0},active:!helpers_default.a.canUser("comments:create")&&helpers_default.a.canUser("tickets:notes",!0)},react_default.a.createElement("form",{onSubmit:function(e){return _this4.onCommentNoteSubmit(e,"note")}},react_default.a.createElement(components_EasyMDE,{allowImageUpload:!0,inlineImageUploadUrl:"/tickets/uploadmdeimage",inlineImageUploadHeaders:{ticketid:this.ticket._id},ref:function(r){return _this4.noteMDE=r}}),react_default.a.createElement("div",{className:"uk-width-1-1 uk-clearfix",style:{marginTop:50}},react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("button",{type:"submit",className:"uk-button uk-button-accent",style:{padding:"10px 15px"}},"Save Note"))))))))))),react_default.a.createElement(components_OffCanvasEditor,{primaryLabel:"Save Edit",ref:function(r){return _this4.editorWindow=r}})))}},{key:"notesTagged",get:function(){return this.ticket.notes.forEach(function(i){return i.isNote=!0}),this.ticket.notes}},{key:"commentsAndNotes",get:function(){if(!this.ticket)return[];if(!helpers_default.a.canUser("tickets:notes",!0))return sortBy_default()(this.ticket.comments,"date");var commentsAndNotes=union_default()(this.ticket.comments,this.notesTagged);return commentsAndNotes=sortBy_default()(commentsAndNotes,"date")}},{key:"hasCommentsOrNotes",get:function(){return!!this.ticket&&(this.ticket.comments.length>0||this.ticket.notes.length>0)}}])&&SingleTicketContainer_defineProperties(Constructor.prototype,protoProps),staticProps&&SingleTicketContainer_defineProperties(Constructor,staticProps),SingleTicketContainer}()).prototype,"ticket",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),SingleTicketContainer_descriptor2=SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"isSubscribed",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"notesTagged",[mobx_module.d],Object.getOwnPropertyDescriptor(SingleTicketContainer_class2.prototype,"notesTagged"),SingleTicketContainer_class2.prototype),SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"commentsAndNotes",[mobx_module.d],Object.getOwnPropertyDescriptor(SingleTicketContainer_class2.prototype,"commentsAndNotes"),SingleTicketContainer_class2.prototype),SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"hasCommentsOrNotes",[mobx_module.d],Object.getOwnPropertyDescriptor(SingleTicketContainer_class2.prototype,"hasCommentsOrNotes"),SingleTicketContainer_class2.prototype),SingleTicketContainer_class=SingleTicketContainer_class2))||SingleTicketContainer_class;SingleTicketContainer_SingleTicketContainer.propTypes={ticketId:prop_types_default.a.string.isRequired,ticketUid:prop_types_default.a.string.isRequired,shared:prop_types_default.a.object.isRequired,common:prop_types_default.a.object.isRequired,groupsState:prop_types_default.a.object.isRequired,fetchGroups:prop_types_default.a.func.isRequired,unloadGroups:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Tickets_SingleTicketContainer=Object(es.b)(function(state){return{common:state.common,shared:state.shared,groupsState:state.groupsState}},{fetchGroups:groups_fetchGroups,unloadGroups,showModal})(SingleTicketContainer_SingleTicketContainer);function Menu_typeof(obj){return(Menu_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Menu_defineProperties(target,props){for(var i=0;i0&&this.setState({activeChild:this.props.menuItems[0].key})}},{key:"switchChild",value:function(key){this.setState({activeChild:key})}},{key:"render",value:function(){var _this2=this,_this$props=this.props,title=_this$props.title,subtitle=_this$props.subtitle,rightComponent=_this$props.rightComponent,menuItems=_this$props.menuItems,tooltip=_this$props.tooltip;return react_default.a.createElement("div",{className:"setting-item-wrap uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"panel trupanel nopadding no-hover-shadow uk-overflow-hidden",style:{minHeight:"60px",height:"auto"}},react_default.a.createElement("div",{className:"left"},react_default.a.createElement("h6",{style:{padding:"0 0 0 15px",margin:"15px 0 0 0",fontSize:"16px",lineHeight:"14px"}},title,tooltip&&react_default.a.createElement("i",{className:"material-icons",style:{color:"#888",fontSize:"16px",cursor:"pointer",lineHeight:"3px",marginLeft:"4px"},"data-uk-tooltip":"{cls:'long-text'}",title:tooltip},"error")),react_default.a.createElement("h5",{style:{padding:"0 0 10px 15px",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},subtitle)),react_default.a.createElement("div",{className:"right"},react_default.a.createElement("div",{style:{margin:"12px 10px 0 0"}},rightComponent)),react_default.a.createElement("hr",{className:"nomargin-top clear"}),react_default.a.createElement("div",{className:"panel-body2"},react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"split-panel-categories uk-width-1-4 uk-width-large-1-5 scrollable br",style:{minHeight:"300px",overflow:"hidden auto"}},react_default.a.createElement(Settings_Menu,{hideBorders:!0,draggable:this.props.menuDraggable,onMenuDrag:this.props.menuOnDrag},menuItems.map(function(item){return react_default.a.createElement(Settings_MenuItem,{active:_this2.state.activeChild===item.key,key:item.key,dragKey:item.key,title:item.title,onClick:function(){_this2.switchChild(item.key)},draggable:_this2.props.menuDraggable})}))),react_default.a.createElement("div",{className:"uk-width-3-4 uk-width-large-4-5"+(this.props.scrollable?" scrollable":""),style:{padding:"20px 15px 15px 15px",maxHeight:this.props.maxHeight||"auto"}},menuItems.map(function(menuItem){return react_default.a.createElement(body,{active:_this2.state.activeChild===menuItem.key,key:menuItem.key,component:menuItem.bodyComponent})})))),this.props.footer&&react_default.a.createElement("div",{className:"panel-footer"},this.props.footer)))}}])&&SplitSettingsPanel_defineProperties(Constructor.prototype,protoProps),staticProps&&SplitSettingsPanel_defineProperties(Constructor,staticProps),SplitSettingsPanel}();SplitSettingsPanel_SplitSettingsPanel.propTypes={title:prop_types_default.a.string.isRequired,subtitle:prop_types_default.a.oneOfType([prop_types_default.a.string,prop_types_default.a.element]),tooltip:prop_types_default.a.string,rightComponent:prop_types_default.a.element,scrollable:prop_types_default.a.bool,maxHeight:prop_types_default.a.string,footer:prop_types_default.a.element,menuItems:prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.object),prop_types_default.a.object]).isRequired,menuDraggable:prop_types_default.a.bool,menuOnDrag:prop_types_default.a.func};var Settings_SplitSettingsPanel=SplitSettingsPanel_SplitSettingsPanel;function permSwitchPartial_typeof(obj){return(permSwitchPartial_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function permSwitchPartial_defineProperties(target,props){for(var i=0;i0&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"panel-body2 bg-warn",style:{padding:"0 10px"}},react_default.a.createElement("div",{className:"uk-clearfix"},react_default.a.createElement("div",{className:"left"},react_default.a.createElement("h6",{className:"text-dark",style:{padding:"0 0 0 15px",margin:"20px 0",fontSize:"18px",lineHeight:"14px"}},"Special Permissions")))),this.roleSpecials.map(function(perm){return react_default.a.createElement(permSwitchPartial,{key:"".concat(perm.title,"_").concat(perm.perm),title:perm.title,checked:_this2.hasSpecial(perm.perm),onChange:function(e){return _this2.onSpecialChanged(e,perm.perm)},disabled:_this2.all})}))))}}])&&permissionGroupPartial_defineProperties(Constructor.prototype,protoProps),staticProps&&permissionGroupPartial_defineProperties(Constructor,staticProps),PermissionGroupPartial}()).prototype,"all",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor2=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"create",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor3=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"view",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor4=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"update",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor5=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"delete",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor6=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"special",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),permissionGroupPartial_descriptor7=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"roleSpecials",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_class=permissionGroupPartial_class2))||permissionGroupPartial_class;permissionGroupPartial_PermissionGroupPartial.propTypes={title:prop_types_default.a.string.isRequired,subtitle:prop_types_default.a.string,roleSpecials:prop_types_default.a.array,role:prop_types_default.a.object.isRequired,grants:prop_types_default.a.object.isRequired};var permissionBody_class,permissionBody_class2,permissionBody_descriptor,permissionBody_descriptor2,permissionBody_descriptor3,permissionBody_descriptor4,permissionBody_descriptor5,permissionBody_descriptor6,permissionBody_descriptor7,_descriptor8,_descriptor9,_descriptor10,_descriptor11,permissionGroupPartial=permissionGroupPartial_PermissionGroupPartial;function permissionBody_typeof(obj){return(permissionBody_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function permissionBody_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function permissionBody_defineProperties(target,props){for(var i=0;i Editing a priority will update all types linked."},"help")),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(components_Button,{text:"Add",style:"success",flat:!0,waves:!0,onClick:function(e){return _this4.onAddPriorityClick(e,type)}})),react_default.a.createElement("hr",{style:{margin:"5px 0 25px 0"}}),react_default.a.createElement("div",{className:"priority-loop zone"},type.get("priorities").map(function(item){return react_default.a.createElement("div",{key:item.get("_id"),ref:function(i){return _this4.prioritiesRef[item.get("_id")]=i},className:"z-box uk-clearfix"},react_default.a.createElement("div",{className:"view-priority uk-clearfix"},react_default.a.createElement(Settings_SettingSubItem,{title:item.get("name"),titleCss:{color:item.get("htmlColor")},subtitle:react_default.a.createElement("div",null,"SLA Overdue: ",react_default.a.createElement("strong",null,item.get("durationFormatted"))),component:react_default.a.createElement(components_ButtonGroup,{classNames:"uk-float-right"},react_default.a.createElement(components_Button,{text:"Edit",small:!0,onClick:function(e){return _this4.toggleEditPriority(e,item.get("_id"))}}),react_default.a.createElement(components_Button,{text:"Remove",small:!0,style:"danger",onClick:function(e){return _this4.onRemoveTicketTypePriorityClicked(e,item.get("_id"))}}))})),react_default.a.createElement(editPriorityPartial,{priority:item}))}))),react_default.a.createElement("div",{className:"uk-margin-large-top"},react_default.a.createElement("h2",{className:"text-light"},"Danger Zone"),react_default.a.createElement("div",{className:"danger-zone"},react_default.a.createElement("div",{className:"dz-box uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h5",null,"Delete this type"),react_default.a.createElement("p",null,"Once you delete a ticket type, there is no going back. Please be certain.")),react_default.a.createElement("div",{className:"uk-float-right",style:{paddingTop:"10px"}},react_default.a.createElement(components_Button,{text:"Delete",small:!0,style:"danger",onClick:function(e){return _this4.showDeleteTicketTypeModal(e,type)}}))))))}}])&&ticketTypeBody_defineProperties(Constructor.prototype,protoProps),staticProps&&ticketTypeBody_defineProperties(Constructor,staticProps),TicketTypeBody}();ticketTypeBody_TicketTypeBody.propTypes={type:prop_types_default.a.object.isRequired,updatePriority:prop_types_default.a.func.isRequired,fetchSettings:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var ticketTypeBody=Object(es.b)(null,{updatePriority:tickets_updatePriority,fetchSettings:settings_fetchSettings,showModal})(ticketTypeBody_TicketTypeBody);function Tickets_typeof(obj){return(Tickets_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Tickets_defineProperties(target,props){for(var i=0;ithis.tagsPagination.pages-1&&this.tagsPagination.selectPage(this.tagsPagination.pages-1))}},{key:"getSetting",value:function(name){return this.props.settings.getIn(["settings",name,"value"])?this.props.settings.getIn(["settings",name,"value"]):""}},{key:"getTicketTypes",value:function(){return this.props.settings&&this.props.settings.get("ticketTypes")?this.props.settings.get("ticketTypes").toArray():[]}},{key:"getPriorities",value:function(){return this.props.settings&&this.props.settings.get("priorities")?this.props.settings.get("priorities").toArray():[]}},{key:"getTicketTags",value:function(e,page){e&&e.preventDefault(),this.props.tagsUpdateCurrentPage(page),this.props.getTagsWithPage({limit:16,page})}},{key:"onDefaultTicketTypeChange",value:function(e){this.props.updateSetting({name:"ticket:type:default",value:e.target.value,stateName:"defaultTicketType"})}},{key:"onAllowPublicTicketsChange",value:function(e){this.props.updateSetting({name:"allowPublicTickets:enable",value:e.target.checked,stateName:"allowPublicTickets",noSnackbar:!0})}},{key:"onAllowAgentUserTicketsChange",value:function(e){this.props.updateSetting({name:"allowAgentUserTickets:enable",value:e.target.checked,stateName:"allowAgentUserTickets",noSnackbar:!0})}},{key:"onShowOverdueChange",value:function(e){this.props.updateSetting({name:"showOverdueTickets:enable",value:e.target.checked,stateName:"showOverdueTickets",noSnackbar:!0})}},{key:"showModal",value:function(e,modal,props){e.preventDefault(),this.props.showModal(modal,props)}},{key:"onRemovePriorityClicked",value:function(e,priority){e.preventDefault(),this.props.showModal("DELETE_PRIORITY",{priority})}},{key:"onSubmitUpdateTag",value:function(e,tagId){var _this2=this;e.preventDefault(),e.persist();var name=e.target.name.value;if(name.length<2)return helpers_default.a.UI.showSnackbar("Invalid Tag Name",!0);axios_default.a.put("/api/v1/tags/".concat(tagId),{name}).then(function(res){TicketsSettings.toggleEditTag(e),helpers_default.a.UI.showSnackbar("Tag: ".concat(res.data.tag.name," updated successfully")),_this2.getTicketTags(null,_this2.tagsPagination.currentPage)}).catch(function(err){if(!err.response)return logger.error(err);var errorText=err.response.data.error;logger.error(errorText,err.response),helpers_default.a.UI.showSnackbar("Error: ".concat(errorText),!0)})}},{key:"onRemoveTagClicked",value:function(e,tag){var _this3=this;uikit_combined_min_default.a.modal.confirm("Really delete tag ".concat(tag.get(),'
    \n This will remove the tag from all associated tickets.'),function(){axios_default.a.delete("/api/v1/tags/".concat(tag.get("_id"))).then(function(res){res.data.success&&(helpers_default.a.UI.showSnackbar("Successfully removed tag: ".concat(tag.get("name"))),_this3.getTicketTags(null,_this3.tagsPagination.currentPage))}).catch(function(error){var errorText=error.response.data.error;helpers_default.a.UI.showSnackbar("Error: ".concat(errorText),!0),logger.error(errorText,error.response)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this4=this,_this$props=this.props,active=_this$props.active,viewdata=_this$props.viewdata,mappedTypes=this.getTicketTypes().map(function(type){return{text:type.get("name"),value:type.get("_id")}});return react_default.a.createElement("div",{className:active?"active":"hide"},react_default.a.createElement(Settings_SettingItem,{title:"Default Ticket Type",subtitle:"Default ticket type for newly created tickets.",component:react_default.a.createElement(components_SingleSelect,{items:mappedTypes,defaultValue:this.getSetting("defaultTicketType"),onSelectChange:function(e){_this4.onDefaultTicketTypeChange(e)},width:"50%",showTextbox:!1})}),react_default.a.createElement(Settings_SettingItem,{title:"Allow Public Tickets",subtitle:react_default.a.createElement("div",null,"Allow the creation of tickets by users that are unregistered. (",react_default.a.createElement("a",{href:viewdata.hosturl+"/newissue"},viewdata.hosturl+"/newissue"),")"),component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"allowPublicTickets",label:"Enable",checked:this.getSetting("allowPublicTickets"),onChange:function(e){_this4.onAllowPublicTicketsChange(e)}})}),react_default.a.createElement(Settings_SettingItem,{title:"Allow Agents to Submit Tickets on Behalf of User",subtitle:react_default.a.createElement("div",null,"Allow the creation of tickets by agents on behalf of users."),tooltip:"Setting takes affect after refresh.",component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"allowAgentUserTickets",label:"Enable",checked:this.getSetting("allowAgentUserTickets"),onChange:function(e){_this4.onAllowAgentUserTicketsChange(e)}})}),react_default.a.createElement(Settings_SettingItem,{title:"Show Overdue Tickets",subtitle:"Enable/Disable flashing of tickets based on SLA time of type priority.",tooltip:"If disabled, priority SLA times will not mark tickets overdue.",component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"showOverdueTickets",label:"Enable",checked:this.getSetting("showOverdueTickets"),onChange:function(e){_this4.onShowOverdueChange(e)}})}),react_default.a.createElement(Settings_SettingItem,{title:"Minimum Subject Length",subtitle:"Minimum character limit for ticket subject",component:react_default.a.createElement(Settings_NumberWithSave,{stateName:"minSubjectLength",settingName:"ticket:minlength:subject",value:this.getSetting("minSubjectLength"),width:"40%"})}),react_default.a.createElement(Settings_SettingItem,{title:"Minimum Issue Length",subtitle:"Minimum character limit for ticket issue",component:react_default.a.createElement(Settings_NumberWithSave,{stateName:"minIssueLength",settingName:"ticket:minlength:issue",value:this.getSetting("minIssueLength"),width:"40%"})}),react_default.a.createElement(Settings_SplitSettingsPanel,{title:"Ticket Types",subtitle:"Create/Modify Ticket Types",rightComponent:react_default.a.createElement(components_Button,{text:"Create",style:"success",flat:!0,extraClass:"md-btn-wave",onClick:function(e){_this4.showModal(e,"CREATE_TICKET_TYPE")}}),menuItems:this.getTicketTypes().map(function(type){return{key:type.get("_id"),title:type.get("name"),bodyComponent:react_default.a.createElement(ticketTypeBody,{type})}})}),react_default.a.createElement(Settings_SettingItem,{title:"Ticket Priorities",subtitle:"Ticket priorities set the level of SLAs for each ticket.",component:react_default.a.createElement(components_Button,{text:"Create",style:"success",flat:!0,waves:!0,extraClass:"mt-10 right",onClick:function(e){return _this4.showModal(e,"CREATE_PRIORITY")}})},react_default.a.createElement(zone,null,this.getPriorities().map(function(p){var disableRemove=!!p.get("default")&&p.get("default");return react_default.a.createElement(components_ZoneBox,{key:p.get("_id"),extraClass:"priority-wrapper"},react_default.a.createElement(Settings_SettingSubItem,{parentClass:"view-priority",title:p.get("name"),titleCss:{color:p.get("htmlColor")},subtitle:react_default.a.createElement("div",null,"SLA Overdue: ",react_default.a.createElement("strong",null,p.get("durationFormatted"))),component:react_default.a.createElement(components_ButtonGroup,{classNames:"uk-float-right"},react_default.a.createElement(components_Button,{text:"Edit",small:!0,onClick:function(e){return TicketsSettings.toggleEditPriority(e)}}),react_default.a.createElement(components_Button,{text:"Remove",small:!0,style:"danger",disabled:disableRemove,onClick:function(e){return _this4.onRemovePriorityClicked(e,p)}}))}),react_default.a.createElement(editPriorityPartial,{priority:p}))}))),react_default.a.createElement(Settings_SettingItem,{title:"Ticket Tags",subtitle:"Create/Modify Ticket Tags",component:react_default.a.createElement(components_Button,{text:"Create",style:"success",flat:!0,waves:!0,extraClass:"mt-10 right",onClick:function(e){return _this4.showModal(e,"CREATE_TAG",{page:"settings",currentPage:_this4.props.tagsSettings.currentPage})}}),footer:react_default.a.createElement("ul",{id:"tagPagination",className:"uk-pagination"})},react_default.a.createElement(components_Grid,{extraClass:"uk-margin-medium-bottom"},this.props.tagsSettings.tags.size<1&&react_default.a.createElement("div",{style:{width:"100%",padding:"55px",textAlign:"center"}},react_default.a.createElement("h3",{style:{fontSize:"24px",fontWeight:"300"}},"No Tags Found")),react_default.a.createElement(components_SpinLoader,{active:this.props.tagsSettings.loading,extraClass:"panel-bg"}),react_default.a.createElement(Grid_GridItem,{width:"1-1"},react_default.a.createElement(components_Grid,{extraClass:"zone ml-0"},this.props.tagsSettings.tags.map(function(i){return react_default.a.createElement(Grid_GridItem,{width:"1-2",key:i.get("_id"),extraClass:"tag-wrapper br bb"},react_default.a.createElement(components_Grid,{extraClass:"view-tag"},react_default.a.createElement(Grid_GridItem,{width:"1-1"},react_default.a.createElement(components_ZoneBox,null,react_default.a.createElement(components_Grid,null,react_default.a.createElement(Grid_GridItem,{width:"1-2"},react_default.a.createElement("h5",{style:{fontSize:"16px",lineHeight:"31px",margin:0,padding:0,fontWeight:300}},i.get("name"))),react_default.a.createElement(Grid_GridItem,{width:"1-2",extraClass:"uk-text-right"},react_default.a.createElement(components_ButtonGroup,{classNames:"mt-5"},react_default.a.createElement(components_Button,{text:"edit",flat:!0,waves:!0,small:!0,onClick:function(e){return TicketsSettings.toggleEditTag(e)}}),react_default.a.createElement(components_Button,{text:"remove",flat:!0,waves:!0,style:"danger",small:!0,onClick:function(e){return _this4.onRemoveTagClicked(e,i)}}))))))),react_default.a.createElement(components_Grid,{extraClass:"edit-tag z-box uk-clearfix nbt hide",style:{paddingTop:"5px"}},react_default.a.createElement(Grid_GridItem,{width:"1-1"},react_default.a.createElement("form",{onSubmit:function(e){return _this4.onSubmitUpdateTag(e,i.get("_id"))}},react_default.a.createElement(components_Grid,null,react_default.a.createElement(Grid_GridItem,{width:"2-3"},react_default.a.createElement("input",{type:"text",className:"md-input",name:"name",defaultValue:i.get("name")})),react_default.a.createElement(Grid_GridItem,{width:"1-3",style:{paddingTop:"10px"}},react_default.a.createElement(components_ButtonGroup,{classNames:"uk-float-right uk-text-right"},react_default.a.createElement(components_Button,{text:"cancel",flat:!0,waves:!0,small:!0,onClick:function(e){return TicketsSettings.toggleEditTag(e)}}),react_default.a.createElement(components_Button,{type:"submit",text:"save",flat:!0,waves:!0,small:!0,style:"success"}))))))))}))))))}}])&&Tickets_defineProperties(Constructor.prototype,protoProps),staticProps&&Tickets_defineProperties(Constructor,staticProps),TicketsSettings}();Tickets_TicketsSettings.propTypes={active:prop_types_default.a.bool.isRequired,viewdata:prop_types_default.a.object.isRequired,settings:prop_types_default.a.object.isRequired,tagsSettings:prop_types_default.a.object.isRequired,updateSetting:prop_types_default.a.func.isRequired,getTagsWithPage:prop_types_default.a.func.isRequired,tagsUpdateCurrentPage:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Tickets=Object(es.b)(function(state){return{viewdata:state.common,settings:state.settings.settings,tagsSettings:state.tagsSettings}},{updateSetting:settings_updateSetting,getTagsWithPage:tickets_getTagsWithPage,tagsUpdateCurrentPage,showModal})(Tickets_TicketsSettings);function mailer_typeof(obj){return(mailer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function mailer_defineProperties(target,props){for(var i=0;i
    Would you like to restart the server now?",function(){axios_default.a.get("/api/v1/admin/restart").catch(function(error){helpers_default.a.hideLoader(),logger.error(error.response),logger.error("Unable to restart server. Server must run under PM2 and Account must have admin rights."),helpers_default.a.UI.showSnackbar("Unable to restart server. Are you an Administrator?",!0)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-primary"})})}},{key:"onInputValueChanged",value:function(e,stateName){this.setState(mailerCheck_defineProperty({},stateName,e.target.value))}},{key:"onPollingChanged",value:function(e){this.setState({mailerCheckPolling:e.target.value})}},{key:"onCheckboxChanged",value:function(e,stateName){this.setState(mailerCheck_defineProperty({},stateName,e.target.checked))}},{key:"onTicketTypeSelectChanged",value:function(e){this.setState({mailerCheckTicketType:e.target.value,typePriorities:Mailer_MailerCheck.getTypePriorities(this.props.settings.get("ticketTypes"),e.target.value)})}},{key:"onSingleSelectChanged",value:function(e,stateName){this.setState(mailerCheck_defineProperty({},stateName,e.target.value))}},{key:"render",value:function(){var _this2=this,mappedTicketTypes=this.getTicketTypes().map(function(type){return{text:type.get("name"),value:type.get("_id")}});return react_default.a.createElement(Settings_SettingItem,{title:"Mailer Check",subtitle:react_default.a.createElement("div",null,"Poll an IMAP mailbox for messages to convert to tickets - ",react_default.a.createElement("i",null,"Settings are applied after server restart")),component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"mailerCheckEnabled",label:"Enabled",checked:this.getSetting("mailerCheckEnabled"),onChange:function(e){return _this2.onEnableMailerCheckChanged(e)}})},react_default.a.createElement("div",null,react_default.a.createElement("form",{onSubmit:function(e){return _this2.onFormSubmit(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Mail Server"),react_default.a.createElement("input",{type:"text",className:"md-input md-input-width-medium",name:"mailerCheckHost",value:this.state.mailerCheckHost,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckHost")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Port"),react_default.a.createElement("input",{type:"text",className:"md-input md-input-width-medium",name:"mailerCheckPort",value:this.state.mailerCheckPort,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckPort")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Username"),react_default.a.createElement("input",{type:"text",className:"md-input md-input-width-medium",name:"mailerCheckUsername",value:this.state.mailerCheckUsername,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckUsername")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Password"),react_default.a.createElement("input",{type:"password",className:"md-input md-input-width-medium",name:"mailerCheckPassword",value:this.state.mailerCheckPassword,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckPassword")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-clearfix uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h6",{style:{padding:0,margin:"5px 0 0 0",fontSize:"16px",lineHeight:"14px"}},"Polling Interval",react_default.a.createElement("i",{className:"material-icons",style:{color:"#888",fontSize:"16px",cursor:"pointer",lineHeight:"20px",marginLeft:"5px"},"data-uk-tooltip":"{cls:'long-text'}",title:"Caution: Polling too often can cause high CPU usage"},"error")),react_default.a.createElement("h5",{style:{padding:"0 0 10px 0",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},"How often to poll the server for new messages (Minutes)")),react_default.a.createElement("div",{className:"uk-float-right",style:{position:"relative"}},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"90px",paddingRight:"10px"}},react_default.a.createElement("input",{type:"number",className:"md-input md-input-width-small",name:"mailerCheckPolling",disabled:!this.getSetting("mailerCheckEnabled"),value:this.state.mailerCheckPolling,onChange:function(e){return _this2.onPollingChanged(e)}}))),react_default.a.createElement("hr",{style:{float:"left",marginTop:"10px"}})),react_default.a.createElement("div",{className:"uk-clearfix uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h6",{style:{padding:0,margin:"5px 0 0 0",fontSize:"16px",lineHeight:"14px"}},"Create Account"),react_default.a.createElement("h5",{style:{padding:"0 0 10px 0",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},"Create a user account if account does not exist.")),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(Settings_EnableSwitch,{label:"Enable",stateName:"mailerCheckCreateAccount",checked:this.state.mailerCheckCreateAccount,onChange:function(e){return _this2.onCheckboxChanged(e,"mailerCheckCreateAccount")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("hr",{style:{float:"left",marginTop:"10px"}})),react_default.a.createElement("div",{className:"uk-clearfix uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h6",{style:{padding:0,margin:"5px 0 0 0",fontSize:"16px",lineHeight:"14px"}},"Delete Message"),react_default.a.createElement("h5",{style:{padding:"0 0 10px 0",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},"Delete email message from INBOX once processed")),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(Settings_EnableSwitch,{label:"Enable",stateName:"mailerCheckDeleteMessage",checked:this.state.mailerCheckDeleteMessage,onChange:function(e){return _this2.onCheckboxChanged(e,"mailerCheckDeleteMessage")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("hr",{style:{float:"left",marginTop:"10px"}})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("label",null,"Default Ticket Type"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,width:"100%",items:mappedTicketTypes,defaultValue:this.state.mailerCheckTicketType,disabled:!this.getSetting("mailerCheckEnabled"),onSelectChange:function(e){return _this2.onTicketTypeSelectChanged(e)}})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("label",null,"Default Ticket Priority"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,width:"100%",items:this.state.typePriorities,defaultValue:this.state.mailerCheckTicketPriority,disabled:!this.getSetting("mailerCheckEnabled"),onSelectChange:function(e){return _this2.onSingleSelectChanged(e,"mailerCheckTicketPriority")}})),react_default.a.createElement("div",{className:"uk-clearfix"},react_default.a.createElement(components_Button,{text:"Apply",type:"submit",extraClass:"uk-float-right",flat:!0,waves:!0,style:"success",disabled:!this.getSetting("mailerCheckEnabled")})))))}}])&&mailerCheck_defineProperties(Constructor.prototype,protoProps),staticProps&&mailerCheck_defineProperties(Constructor,staticProps),Mailer_MailerCheck}();mailerCheck_Mailer_MailerCheck.propTypes={settings:prop_types_default.a.object.isRequired,updateSetting:prop_types_default.a.func.isRequired,updateMultipleSettings:prop_types_default.a.func.isRequired};var mailerSettingsTemplates_class,mailerSettingsTemplates_class2,mailerSettingsTemplates_descriptor,mailerSettingsTemplates_descriptor2,mailerCheck=Object(es.b)(function(state){return{settings:state.settings.settings}},{updateSetting:settings_updateSetting,updateMultipleSettings:settings_updateMultipleSettings})(mailerCheck_Mailer_MailerCheck);function mailerSettingsTemplates_typeof(obj){return(mailerSettingsTemplates_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function mailerSettingsTemplates_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function mailerSettingsTemplates_defineProperties(target,props){for(var i=0;i0&&(this.deletedTicketsPagination=uikit_combined_min_default.a.pagination($deletedTicketPagination,{items:this.props.settings.deletedTicketsCount,itemsOnPage:15}),$deletedTicketPagination.on("select.uk.pagination",function(e,pageIndex){_this2.props.changeDeletedTicketsPage(pageIndex)}))}prevProps.settings.deletedTicketsCount!==this.props.settings.deletedTicketsCount&&(this.deletedTicketsPagination.pages=Math.ceil(this.props.settings.deletedTicketsCount/15)?Math.ceil(this.props.settings.deletedTicketsCount/15):1,this.deletedTicketsPagination.render(),this.deletedTicketsPagination.currentPage>this.deletedTicketsPagination.pages-1&&this.deletedTicketsPagination.selectPage(this.deletedTicketsPagination.pages-1))}},{key:"componentWillUnmount",value:function(){this.deletedTicketsPagination&&(this.deletedTicketsPagination.element.off("select.uk.pagination"),this.deletedTicketsPagination=null)}},{key:"initBackupUpload",value:function(){var $progressBar=jquery_default()(this.backupUploadProgressbar),$uploadSelect=jquery_default()(this.backupUploadSelect),$uploadButton=jquery_default()(this.backupUploadBtn),bar=$progressBar.find(".uk-progress-bar");if(!($progressBar.length<1||$uploadSelect.length<1||$uploadButton.length<1)){var self=this,settings={action:"/api/v1/backup/upload",allow:"*.zip",type:"json",loadstart:function(){bar.css("width","0%").text("0%"),$progressBar.removeClass("hide"),$uploadButton.addClass("hide")},notallowed:function(){helpers_default.a.UI.showSnackbar("Invalid File Type. Please upload a Zip file.",!0)},error:function(err){logger.error(err),helpers_default.a.UI.showSnackbar("An unknown error occurred. Check Console",!0)},progress:function(percent){percent=Math.ceil(percent),bar.css("width",percent+"%").text(percent+"%")},allcomplete:function(response){logger.debug(response),response.success||helpers_default.a.UI.showSnackbar(response.error,!0),bar.css("width","100%").text("100%"),setTimeout(function(){$progressBar.addClass("hide"),$uploadButton.removeClass("hide"),$uploadSelect.val(null),self.props.fetchBackups(),helpers_default.a.UI.playSound("success")},1500)}};uikit_combined_min_default.a.uploadSelect($uploadSelect,settings)}}},{key:"onBackupNowClicked",value:function(e){e.preventDefault(),this.props.backupNow()}},{key:"oneRestoreClicked",value:function(e,backup){if(backup){var filename=backup.get("filename");uikit_combined_min_default.a.modal.confirm('

    Are you sure?

    \n

    \n This is a permanent action. \n This will earse the database and restore it with the selected backup file: '.concat(filename,'\n

    \n

    \n Any users currently logged in will be presented with a blocking restore page. Preventing any further actions.\n Once complete all users are required to log in again.


    \n

    \n This process may take a while depending on the size of the backup.\n

    '),function(){socket_default.a.ui.emitShowRestoreOverlay(),axios_default.a.post("/api/v1/backup/restore",{file:filename}).then(function(){helpers_default.a.UI.showSnackbar("Restore Complete. Logging all users out..."),setTimeout(function(){socket_default.a.ui.emitRestoreComplete()},2e3)}).catch(function(err){logger.error(err),helpers_default.a.UI.showSnackbar("An error occurred. Check console.",!0)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}}},{key:"onDeleteBackupClicked",value:function(e,backup){var _this3=this;uikit_combined_min_default.a.modal.confirm('

    Are you sure?

    \n

    This action is permanent and will destroy the backup file: \n '.concat(backup.get("filename"),"\n

    "),function(){axios_default.a.delete("/api/v1/backup/".concat(backup.get("filename"))).then(function(res){res.data&&res.data.success?(_this3.props.fetchBackups(),helpers_default.a.UI.showSnackbar("Backup successfully deleted")):helpers_default.a.UI.showSnackbar("Unable to delete backup",!0)}).catch(function(err){logger.error(err),helpers_default.a.UI.showSnackbar("Error: ".concat(err.response.data.error),!0)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"onRestoreTicketClicked",value:function(e,ticket){ticket&&this.props.restoreDeletedTicket({_id:ticket.get("_id")})}},{key:"render",value:function(){var _this4=this,active=this.props.active;return react_default.a.createElement("div",{className:active?"active":"hide"},!this.props.settings.hasMongoDBTools&&react_default.a.createElement(Settings_SettingItem,{title:"MongoDB Tools Not Found",subtitle:"Unable to locate MongoDB tools. Please make sure MongoDB tools are installed."},react_default.a.createElement("div",null,react_default.a.createElement("h4",null,"Installing MongoDB Tools"),react_default.a.createElement("p",{style:{margin:"0 0 5px 0",fontSize:"13px"}},"MongoDB Tools are required to perform backup and restore. See below for instructions on installing MongoDB Tools."),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Ubuntu 16.04")),react_default.a.createElement("pre",{style:{whiteSpace:"pre-line"}},"wget https://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.6/multiverse/binary-amd64/mongodb-org-tools_3.6.9_amd64.deb && \\ dpkg -i mongodb-org-tools_3.6.9_amd64.deb"),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Ubuntu 18.04")),react_default.a.createElement("pre",{style:{whiteSpace:"pre-line"}},"sudo apt install -y mongo-tools"),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Fedora 29")),react_default.a.createElement("pre",null,"dnf install -y mongo-tools"),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Alpine Linux")),react_default.a.createElement("pre",null,"apk add mongodb-tools"))),this.props.settings.hasMongoDBTools&&react_default.a.createElement("div",null,react_default.a.createElement(Settings_SettingItem,{title:"Backup Now",subtitle:"Backup all site data. (Database, Attachments, Assets)",component:react_default.a.createElement("div",{className:"uk-float-right mt-10"},react_default.a.createElement("div",{className:"uk-progress uk-progress-success uk-progress-striped uk-active"+(this.props.settings.backingup?"":" hide "),style:{height:"31px",background:"transparent"}},react_default.a.createElement("div",{className:"uk-progress-bar uk-float-right",style:{width:"115px",fontSize:"11px",textTransform:"uppercase",lineHeight:"31px"}},"Please Wait...")),!this.props.settings.backingup&&react_default.a.createElement(components_Button,{text:"Backup Now",style:"success",small:!0,styleOverride:{width:"115px"},onClick:function(e){return _this4.onBackupNowClicked(e)}}))}),react_default.a.createElement(Settings_SettingItem,{title:"Backups",subtitle:"Currently stored backups",component:react_default.a.createElement("div",{className:"uk-float-right mt-10",style:{width:"85px"}},react_default.a.createElement("div",{className:"uk-progress hide",style:{height:"31px"},ref:function(i){return _this4.backupUploadProgressbar=i}},react_default.a.createElement("div",{className:"uk-progress-bar",style:{width:0,lineHeight:"31px",fontSize:"11px"}},"0%")),react_default.a.createElement("form",{className:"uk-form-stacked"},react_default.a.createElement("button",{className:"md-btn md-btn-small md-btn-primary uk-form-file no-ajaxy",style:{width:"85px"},ref:function(i){return _this4.backupUploadBtn=i}},"Upload",react_default.a.createElement("input",{ref:function(i){return _this4.backupUploadSelect=i},type:"file",name:"backupUploadSelect"}))))},this.props.settings.backups.size<1&&react_default.a.createElement(zone,null,react_default.a.createElement(components_ZoneBox,null,react_default.a.createElement("h2",{className:"uk-text-muted uk-text-center"},"No Backups"))),this.props.settings.backups.size>0&&react_default.a.createElement("table",{className:"uk-table mt-0"},react_default.a.createElement("thead",null,react_default.a.createElement("tr",null,react_default.a.createElement("th",null,"Filename"),react_default.a.createElement("th",null,"Size"),react_default.a.createElement("th",null))),react_default.a.createElement("tbody",null,this.props.settings.backups.map(function(backup){return react_default.a.createElement("tr",{key:backup.get("filename")},react_default.a.createElement("td",{className:"valign-middle",style:{width:"60%",height:"60px"}},backup.get("filename")),react_default.a.createElement("td",{className:"valign-middle"},backup.get("sizeFormat")),react_default.a.createElement("td",{className:"uk-text-right valign-middle"},react_default.a.createElement(components_ButtonGroup,null,react_default.a.createElement("a",{href:"/backups/".concat(backup.get("filename")),className:"md-btn md-btn-small md-btn-wave no-ajaxy",download:backup.get("filename")},"download"),react_default.a.createElement(components_Button,{text:"Restore",small:!0,waves:!0,onClick:function(e){return _this4.oneRestoreClicked(e,backup)}}),react_default.a.createElement(components_Button,{text:"Delete",small:!0,style:"danger",waves:!0,onClick:function(e){return _this4.onDeleteBackupClicked(e,backup)}}))))}))))),react_default.a.createElement(Settings_SettingItem,{title:"Restore Deleted Tickets",subtitle:"Tickets marked as deleted are shown below."},this.props.settings.deletedTickets.size<1&&react_default.a.createElement(zone,null,react_default.a.createElement(components_ZoneBox,null,react_default.a.createElement("h2",{className:"uk-text-muted uk-text-center"},"No Deleted Tickets"))),this.props.settings.deletedTickets.size>0&&react_default.a.createElement("div",null,react_default.a.createElement("table",{className:"uk-table mt-0 mb-5"},react_default.a.createElement("thead",null,react_default.a.createElement("tr",null,react_default.a.createElement("th",null,"UID"),react_default.a.createElement("th",null,"Subject"),react_default.a.createElement("th",null,"Group"),react_default.a.createElement("th",null,"Date"),react_default.a.createElement("th",null))),react_default.a.createElement("tbody",null,this.props.settings.deletedTickets.map(function(ticket){return react_default.a.createElement("tr",{key:ticket.get("_id")},react_default.a.createElement("td",{className:"valign-middle",style:{width:"10%",height:"60px"}},ticket.get("uid")),react_default.a.createElement("td",{className:"valign-middle",style:{width:"30%"}},ticket.get("subject")),react_default.a.createElement("td",{className:"valign-middle",style:{width:"30%"}},ticket.getIn(["group","name"])),react_default.a.createElement("td",{className:"valign-middle",style:{width:"30%"}},ticket.get("date")),react_default.a.createElement("td",{className:"uk-text-right valign-middle"},react_default.a.createElement(components_ButtonGroup,null,react_default.a.createElement(components_Button,{text:"Restore",small:!0,waves:!0,onClick:function(e){return _this4.onRestoreTicketClicked(e,ticket)}}))))}))),react_default.a.createElement("div",{className:"uk-pagination deletedTicketPagination"}))))}}])&&BackupRestore_defineProperties(Constructor.prototype,protoProps),staticProps&&BackupRestore_defineProperties(Constructor,staticProps),BackupRestoreSettingsContainer}();BackupRestore_BackupRestoreSettingsContainer.propTypes={active:prop_types_default.a.bool.isRequired,fetchMongoDBTools:prop_types_default.a.func.isRequired,fetchBackups:prop_types_default.a.func.isRequired,fetchDeletedTickets:prop_types_default.a.func.isRequired,changeDeletedTicketsPage:prop_types_default.a.func.isRequired,backupNow:prop_types_default.a.func.isRequired,restoreDeletedTicket:prop_types_default.a.func.isRequired,settings:prop_types_default.a.object.isRequired};var BackupRestore=Object(es.b)(function(state){return{settings:state.settings}},{fetchBackups:settings_fetchBackups,fetchMongoDBTools,backupNow:settings_backupNow,fetchDeletedTickets:settings_fetchDeletedTickets,restoreDeletedTicket:settings_restoreDeletedTicket,changeDeletedTicketsPage})(BackupRestore_BackupRestoreSettingsContainer);function Legal_typeof(obj){return(Legal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Legal_defineProperties(target,props){for(var i=0;i=25})}},{key:"onSearchKeyUp",value:function(e){var _this3=this,keyCode=e.keyCode||e.which,search=e.target.value;13===keyCode&&(search.length>2?this.props.unloadAccounts().then(function(){_this3.hasMore=!1,_this3.props.fetchAccounts({limit:-1,search}).then(function(_ref2){var response=_ref2.response;_this3.pageStart=-1,_this3.hasMore=response.count>=25})}):0===search.length&&this.props.unloadAccounts().then(function(){_this3.pageStart=-1,_this3.getUsersWithPage(0)}))}},{key:"render",value:function(){var _this4=this,items=this.props.accountsState.accounts&&this.props.accountsState.accounts.map(function(user){var userImage=user.get("image")||"defaultProfile.jpg",actionMenu=[react_default.a.createElement(Dropdown_DropdownItem,{key:0,text:"Edit",onClick:function(e){return _this4.onEditAccountClicked(e,user)}})];user.get("deleted")?actionMenu.push(react_default.a.createElement(Dropdown_DropdownItem,{key:2,text:"Enable",onClick:function(e){return _this4.onEnableAccountClicked(e,user)}})):actionMenu.push(react_default.a.createElement(Dropdown_DropdownItem,{key:1,text:"Delete",extraClass:"uk-text-danger",onClick:function(e){return _this4.onDeleteAccountClicked(e,user)}}));var isAdmin=user.getIn(["role","isAdmin"])||!1,isAgent=user.getIn(["role","isAgent"])||!1,customer=!isAdmin&&!isAgent,isDeleted=user.get("deleted")||!1;return react_default.a.createElement(Grid_GridItem,{key:user.get("_id"),width:"1-5",xLargeWidth:"1-6",extraClass:"mb-25"},react_default.a.createElement(components_TruCard,{loaderActive:user.get("loading"),menu:actionMenu,extraHeadClass:(isAdmin?"tru-card-head-admin":"")+(!isAdmin&&isAgent?"tru-card-head-agent":"")+(isDeleted?" tru-card-head-deleted":""),header:react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"account-image relative uk-display-inline-block"},react_default.a.createElement("img",{src:"/uploads/users/".concat(userImage),alt:"ProfilePic",className:"tru-card-head-avatar"}),react_default.a.createElement("span",{"data-user-status-id":user.get("_id"),className:"user-status-large user-offline uk-border-circle"})),react_default.a.createElement("h3",{className:"tru-card-head-text uk-text-center"},user.get("fullname"),react_default.a.createElement("span",{className:"uk-text-truncate"},user.get("title")))),content:react_default.a.createElement("ul",{className:"tru-list"},react_default.a.createElement("li",null,react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Role"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted"},user.getIn(["role","name"])))),react_default.a.createElement("li",null,react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Email"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted"},react_default.a.createElement("a",{href:"mailto:".concat(user.get("email"))},user.get("email"))))),react_default.a.createElement("li",null,customer&&user.get("groups")&&react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Groups"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted uk-text-truncate"},user.get("groups").map(function(group){return group.get("name")+(user.get("groups").toArray().length>1?", ":"")}))),!customer&&user.get("teams")&&react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Teams"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted uk-text-truncate"},user.get("teams").map(function(team){return team.get("name")+(user.get("teams").toArray().length>1?", ":"")})))),!customer&&user.get("departments")&&react_default.a.createElement("li",null,react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Departments"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted uk-text-truncate"},user.get("departments").map(function(department){return department.get("name")+(user.get("departments").toArray().length>1?", ":"")})))))}))});return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:this.props.title,rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-4 uk-push-3-4 mt-15 pr-20 uk-clearfix"},react_default.a.createElement(components_ButtonGroup,{classNames:"uk-clearfix uk-float-right"},react_default.a.createElement(components_Button,{text:"Create",hasDropdown:!1,flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(){return _this4.props.showModal("CREATE_ACCOUNT")}}),helpers_default.a.canUser("accounts:import",!0)&&react_default.a.createElement(Dropdown_DropdownTrigger,{mode:"click",pos:"bottom-right",offset:5,extraClass:"uk-float-right"},react_default.a.createElement(components_Button,{text:"",hasDropdown:!0,small:!0,waves:!1,styleOverride:{padding:"0 5px 0 0"},extraClass:"pr-5 no-border-radius nbl bg-accent md-color-white hover-accent"}),react_default.a.createElement(components_Dropdown,{small:!0},react_default.a.createElement(Dropdown_DropdownHeader,{text:"Account Actions"}),react_default.a.createElement(Dropdown_DropdownItem,{text:"Import",href:"/accounts/import"}))))))}),react_default.a.createElement(components_PageContent,{id:"accounts-page-content"},react_default.a.createElement(react_infinite_scroller_default.a,{pageStart:this.pageStart,loadMore:this.getUsersWithPage,hasMore:this.hasMore,initialLoad:this.initialLoad,threshold:25,loader:react_default.a.createElement("div",{className:"uk-width-1-1 uk-text-center",key:0},react_default.a.createElement("i",{className:"uk-icon-refresh uk-icon-spin"})),useWindow:!1,getScrollParent:function(){return document.getElementById("accounts-page-content")}},react_default.a.createElement(components_Grid,{gutterSize:"medium"},items))))}}])&&Accounts_defineProperties(Constructor.prototype,protoProps),staticProps&&Accounts_defineProperties(Constructor,staticProps),AccountsContainer}()).prototype,"initialLoad",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Accounts_descriptor2=Accounts_applyDecoratedDescriptor(Accounts_class2.prototype,"hasMore",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Accounts_descriptor3=Accounts_applyDecoratedDescriptor(Accounts_class2.prototype,"pageStart",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),Accounts_class=Accounts_class2))||Accounts_class;Accounts_AccountsContainer.propTypes={title:prop_types_default.a.string.isRequired,view:prop_types_default.a.string.isRequired,fetchAccounts:prop_types_default.a.func.isRequired,deleteAccount:prop_types_default.a.func.isRequired,enableAccount:prop_types_default.a.func.isRequired,unloadAccounts:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired,common:prop_types_default.a.object.isRequired,shared:prop_types_default.a.object.isRequired,accountsState:prop_types_default.a.object.isRequired},Accounts_AccountsContainer.defaultProps={title:"Accounts",view:"customers"};var Accounts=Object(es.b)(function(state){return{shared:state.shared,accountsState:state.accountsState,common:state.common}},{fetchAccounts:accounts_fetchAccounts,deleteAccount:accounts_deleteAccount,enableAccount:accounts_enableAccount,unloadAccounts,showModal})(Accounts_AccountsContainer);function Groups_typeof(obj){return(Groups_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Groups_defineProperties(target,props){for(var i=0;iAre you sure?\n

    \n This is a permanent action. \n

    \n

    \n Agents may lose access to resources once this group is deleted.\n

    \n Groups that are associated with ticket cannot be deleted.\n ',function(){_this.props.deleteGroup({_id})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this2=this,tableItems=this.props.groups.map(function(group){return react_default.a.createElement(Table_TableRow,{key:group.get("_id"),className:"vam nbb"},react_default.a.createElement(Table_TableCell,{style:{fontWeight:500,padding:"18px 15px"}},group.get("name")),react_default.a.createElement(Table_TableCell,{style:{padding:"13px 20px 8px 8px"}},group.get("members")&&group.get("members").size>0&&group.get("members").filter(function(user){return!user.get("deleted")}).map(function(user){var profilePic=user.get("image")||"defaultProfile.jpg";return react_default.a.createElement("div",{key:user.get("_id"),className:"uk-float-left uk-position-relative mb-10","data-uk-tooltip":'{pos: "bottom"}',title:user.get("fullname")},react_default.a.createElement("img",{style:{width:25,height:25,marginRight:5},className:"round",src:"/uploads/users/".concat(profilePic),alt:user.get("fullname")}),react_default.a.createElement("span",{"data-user-status-id":user.get("_id"),className:"user-offline uk-border-circle",style:{width:13,height:13}}))}),!group.get("members")&&react_default.a.createElement("div",null)),react_default.a.createElement(Table_TableCell,{style:{textAlign:"right",paddingRight:15}},react_default.a.createElement(components_ButtonGroup,null,helpers_default.a.canUser("groups:update",!0)&&react_default.a.createElement(components_Button,{text:"Edit",small:!0,waves:!0,onClick:function(){return _this2.onEditGroupClick(group.toJS())}}),helpers_default.a.canUser("groups:delete",!0)&&react_default.a.createElement(components_Button,{text:"Delete",style:"danger",small:!0,waves:!0,onClick:function(){return _this2.onDeleteGroupClick(group.get("_id"))}}))))});return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Customer Groups",rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-1 mt-15 uk-text-right"},react_default.a.createElement(components_Button,{text:"Create",flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(){return _this2.onCreateGroupClick()}})))}),react_default.a.createElement(components_PageContent,{padding:0,paddingBottom:0},react_default.a.createElement(components_Table,{headers:[react_default.a.createElement(Table_TableHeader,{key:0,width:"25%",height:40,text:"Name",padding:"8px 8px 8px 15px"}),react_default.a.createElement(Table_TableHeader,{key:1,width:"50%",text:"Group Members"}),react_default.a.createElement(Table_TableHeader,{key:2,width:130,text:"Group Actions"})]},tableItems)))}}])&&Groups_defineProperties(Constructor.prototype,protoProps),staticProps&&Groups_defineProperties(Constructor,staticProps),GroupsContainer}();Groups_GroupsContainer.propTypes={groups:prop_types_default.a.object.isRequired,fetchGroups:prop_types_default.a.func.isRequired,deleteGroup:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Groups=Object(es.b)(function(state){return{groups:state.groupsState.groups}},{fetchGroups:groups_fetchGroups,deleteGroup:groups_deleteGroup,showModal})(Groups_GroupsContainer);function Teams_typeof(obj){return(Teams_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Teams_defineProperties(target,props){for(var i=0;iAre you sure?\n

    \n This is a permanent action. \n

    \n

    \n Agents may lose access to resources once this team is deleted.\n

    \n ',function(){_this.props.deleteTeam({_id})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this2=this,tableItems=this.props.teamsState.teams.map(function(team){return react_default.a.createElement(Table_TableRow,{key:team.get("_id"),className:"vam nbb"},react_default.a.createElement(Table_TableCell,{style:{fontWeight:500,padding:"18px 15px"}},team.get("name")),react_default.a.createElement(Table_TableCell,{style:{padding:"13px 8px 8px 8px"}},team.get("members")&&team.get("members").size>0&&team.get("members").filter(function(user){return!user.get("deleted")}).map(function(user){var profilePic=user.get("image")||"defaultProfile.jpg";return react_default.a.createElement("div",{key:user.get("_id"),className:"uk-float-left uk-position-relative mb-10","data-uk-tooltip":'{pos: "bottom"}',title:user.get("fullname")},react_default.a.createElement("img",{style:{width:25,height:25,marginRight:5},className:"round",src:"/uploads/users/".concat(profilePic),alt:user.get("fullname")}),react_default.a.createElement("span",{"data-user-status-id":user.get("_id"),className:"user-offline uk-border-circle",style:{width:13,height:13}}))})),react_default.a.createElement(Table_TableCell,{style:{textAlign:"right",paddingRight:15}},react_default.a.createElement(components_ButtonGroup,null,helpers_default.a.canUser("teams:update",!0)&&react_default.a.createElement(components_Button,{text:"Edit",small:!0,waves:!0,onClick:function(){return _this2.onEditTeamClick(team.toJS())}}),helpers_default.a.canUser("teams:delete",!0)&&react_default.a.createElement(components_Button,{text:"Delete",style:"danger",small:!0,waves:!0,onClick:function(){return _this2.onDeleteTeamClick(team.get("_id"))}}))))});return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Teams",shadow:!0,rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-1 mt-15 uk-text-right"},react_default.a.createElement(components_Button,{text:"Create",flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(e){return _this2.onCreateTeamClick(e)}})))}),react_default.a.createElement(components_PageContent,{id:"teams-page-content",padding:0,paddingBottom:0},react_default.a.createElement(components_Table,{headers:[react_default.a.createElement(Table_TableHeader,{key:0,width:"25%",height:40,text:"Name",padding:"8px 8px 8px 15px"}),react_default.a.createElement(Table_TableHeader,{key:1,width:"50%",text:"Team Members"}),react_default.a.createElement(Table_TableHeader,{key:2,width:130,text:"Team Actions"})]},this.props.teamsState.teams.size<1&&react_default.a.createElement(Table_TableRow,null,react_default.a.createElement(Table_TableCell,{colSpan:3},react_default.a.createElement("h5",{style:{paddingLeft:8}},"No Teams"))),tableItems)))}}])&&Teams_defineProperties(Constructor.prototype,protoProps),staticProps&&Teams_defineProperties(Constructor,staticProps),TeamsContainer}();Teams_TeamsContainer.propTypes={teamsState:prop_types_default.a.object.isRequired,fetchTeams:prop_types_default.a.func.isRequired,unloadTeams:prop_types_default.a.func.isRequired,deleteTeam:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Teams=Object(es.b)(function(state){return{teamsState:state.teamsState}},{fetchTeams:teams_fetchTeams,unloadTeams,deleteTeam:teams_deleteTeam,showModal})(Teams_TeamsContainer);function Departments_typeof(obj){return(Departments_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Departments_defineProperties(target,props){for(var i=0;iAre you sure?\n

    \n This is a permanent action. \n

    \n

    \n Agents may lose access to resources once this department is deleted.\n

    \n ',function(){_this.props.deleteDepartment({_id})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this2=this;return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Departments",shadow:!1,rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-1 mt-15 uk-text-right"},react_default.a.createElement(components_Button,{text:"Create",flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(){return _this2.onCreateDepartmentClick()}})))}),react_default.a.createElement(components_PageContent,{padding:0},react_default.a.createElement("table",{className:"uk-table uk-table-striped sticky-header fixed-width"},react_default.a.createElement("thead",null,react_default.a.createElement("tr",null,react_default.a.createElement("th",{style:{width:"35%",verticalAlign:"middle",fontSize:12,textTransform:"uppercase",padding:"8px 8px 8px 27px"}},"Name"),react_default.a.createElement("th",{style:{verticalAlign:"middle",fontSize:12,textTransform:"uppercase"}},"Teams"),react_default.a.createElement("th",{style:{width:"25%",verticalAlign:"middle",fontSize:12,textTransform:"uppercase"}},"Groups"),react_default.a.createElement("th",{style:{width:220,verticalAlign:"middle",fontSize:12,textTransform:"uppercase"}},"Actions"))),react_default.a.createElement("tbody",{className:"scrollable full-height"},this.props.departments&&this.props.departments.map(function(department){var teams=department.get("teams"),groups=department.get("groups");return react_default.a.createElement("tr",{key:department.get("_id")},react_default.a.createElement("td",{style:{verticalAlign:"middle",padding:"8px 8px 8px 26px"}},react_default.a.createElement("div",{style:{fontWeight:"500"}},department.get("name"))),react_default.a.createElement("td",{style:{verticalAlign:"middle"}},teams&&teams.map(function(team){return react_default.a.createElement("div",{key:team.get("_id"),style:{marginBottom:4}},team.get("name"))})),react_default.a.createElement("td",{style:{verticalAlign:"middle"}},!0===department.get("allGroups")&&react_default.a.createElement("div",null,react_default.a.createElement("h6",{className:"text-success",style:{fontWeight:"bold"}},"All Groups")),!0===department.get("publicGroups")&&react_default.a.createElement("div",null,react_default.a.createElement("h6",{className:"text-success",style:{fontWeight:"bold"}},"All Public Groups")),!0!==department.get("allGroups")&&groups&&groups.map(function(group){return react_default.a.createElement("div",{key:group.get("_id"),style:{marginBottom:4}},group.get("name"))})),react_default.a.createElement("td",null,react_default.a.createElement(components_ButtonGroup,null,helpers_default.a.canUser("departments:update",!0)&&react_default.a.createElement(components_Button,{text:"Edit",small:!0,waves:!0,onClick:function(){return _this2.onEditDepartmentClick(department)}}),helpers_default.a.canUser("departments:delete",!0)&&react_default.a.createElement(components_Button,{text:"Delete",style:"danger",small:!0,waves:!0,onClick:function(){return _this2.onDeleteDepartmentClick(department.get("_id"))}}))))})))))}}])&&Departments_defineProperties(Constructor.prototype,protoProps),staticProps&&Departments_defineProperties(Constructor,staticProps),DepartmentsContainer}();Departments_DepartmentsContainer.propTypes={departments:prop_types_default.a.object.isRequired,fetchDepartments:prop_types_default.a.func.isRequired,deleteDepartment:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Departments=Object(es.b)(function(state){return{departments:state.departmentsState.departments}},{fetchDepartments:departments_fetchDepartments,deleteDepartment:departments_deleteDepartment,showModal})(Departments_DepartmentsContainer),renderer=function(store){if(document.getElementById("tickets-container")){var view=document.getElementById("tickets-container").getAttribute("data-view"),page=document.getElementById("tickets-container").getAttribute("data-page"),filter=document.getElementById("tickets-container").getAttribute("data-filter");filter=filter?JSON.parse(filter):{};var TicketsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Tickets_TicketsContainer,{view,page,filter}));react_dom_default.a.render(TicketsContainerWithProvider,document.getElementById("tickets-container"))}if(document.getElementById("single-ticket-container")){var ticketId=document.getElementById("single-ticket-container").getAttribute("data-ticket-id"),ticketUid=document.getElementById("single-ticket-container").getAttribute("data-ticket-uid"),SingleTicketContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Tickets_SingleTicketContainer,{ticketId,ticketUid}));react_dom_default.a.render(SingleTicketContainerWithProvider,document.getElementById("single-ticket-container"))}if(document.getElementById("accounts-container")){var title=document.getElementById("accounts-container").getAttribute("data-title"),_view=document.getElementById("accounts-container").getAttribute("data-view"),AccountsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Accounts,{title,view:_view}));react_dom_default.a.render(AccountsContainerWithProvider,document.getElementById("accounts-container"))}if(document.getElementById("groups-container")){var GroupsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Groups,null));react_dom_default.a.render(GroupsContainerWithProvider,document.getElementById("groups-container"))}if(document.getElementById("teams-container")){var TeamsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Teams,null));react_dom_default.a.render(TeamsContainerWithProvider,document.getElementById("teams-container"))}if(document.getElementById("departments-container")){var _TeamsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Departments,null));react_dom_default.a.render(_TeamsContainerWithProvider,document.getElementById("departments-container"))}if(document.getElementById("settings-container")){var SettingsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Settings_SettingsContainer,null));react_dom_default.a.render(SettingsContainerWithProvider,document.getElementById("settings-container"))}};var sagaMiddleware=Object(redux_saga_es.a)(),composeSetup=redux.d;localStorage.setItem("debug","trudesk:*");var preloadedState={common:window.trudesk.__PRELOADED_STATE__};delete window.trudesk,jquery_default()("script#preloader").remove();var app_store=Object(redux.e)(reducers,preloadedState,composeSetup(Object(redux.a)(redux_saga_thunk.middleware,sagaMiddleware)));window.react.redux={store:app_store},sagaMiddleware.run(function*(){yield Object(effects.a)([watcher(),tickets_watcher(),settingsWatcher(),accounts_watcher(),groups_watcher(),teams_watcher(),departments_watcher(),search_watcher()])});var sidebarWithProvider=react_default.a.createElement(es.a,{store:app_store},react_default.a.createElement(Nav_Sidebar,null));if(react_dom_default.a.render(sidebarWithProvider,document.getElementById("side-nav")),document.getElementById("modal-wrapper")){var RootModal=react_default.a.createElement(es.a,{store:app_store},react_default.a.createElement(Modals,null));react_dom_default.a.render(RootModal,document.getElementById("modal-wrapper"))}if(document.getElementById("topbar")){var TopbarRoot=react_default.a.createElement(es.a,{store:app_store},react_default.a.createElement(Topbar_TopbarContainer,null));react_dom_default.a.render(TopbarRoot,document.getElementById("topbar"))}window.react.renderer=renderer,window.react.dom=react_dom_default.a,renderer(app_store)}}]); \ No newline at end of file +!function(a,b,c){function e(a,b){var d=this,e=c(d);if(d.value==e.attr("placeholder")&&e.hasClass("placeholder"))if(e.data("placeholder-password")){if(e=e.hide().next().show().attr("id",e.removeAttr("id").data("placeholder-id")),!0===a)return e[0].value=b;e.focus()}else d.value="",e.removeClass("placeholder"),d==g()&&d.select()}function f(){var a,b=this,f=c(b),g=this.id;if(""==b.value){if("password"==b.type){if(!f.data("placeholder-textinput")){try{a=f.clone().attr({type:"text"})}catch(h){a=c("").attr(c.extend(function(a){var b={},d=/^jQuery\d+$/;return c.each(a.attributes,function(a,c){c.specified&&!d.test(c.name)&&(b[c.name]=c.value)}),b}(this),{type:"text"}))}a.removeAttr("name").data({"placeholder-password":f,"placeholder-id":g}).bind("focus.placeholder",e),f.data({"placeholder-textinput":a,"placeholder-id":g}).before(a)}f=f.removeAttr("id").hide().prev().attr("id",g).show()}f.addClass("placeholder"),f[0].value=f.attr("placeholder")}else f.removeClass("placeholder")}function g(){try{return b.activeElement}catch(a){}}var h,i,j="[object OperaMini]"==Object.prototype.toString.call(a.operamini),k="placeholder"in b.createElement("input")&&!j,l="placeholder"in b.createElement("textarea")&&!j,m=c.fn,n=c.valHooks,o=c.propHooks;k&&l?(i=m.placeholder=function(){return this}).input=i.textarea=!0:((i=m.placeholder=function(){return this.filter((k?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":e,"blur.placeholder":f}).data("placeholder-enabled",!0).trigger("blur.placeholder"),this}).input=k,i.textarea=l,h={get:function(a){var b=c(a),d=b.data("placeholder-password");return d?d[0].value:b.data("placeholder-enabled")&&b.hasClass("placeholder")?"":a.value},set:function(a,b){var d=c(a),h=d.data("placeholder-password");return h?h[0].value=b:d.data("placeholder-enabled")?(""==b?(a.value=b,a!=g()&&f.call(a)):d.hasClass("placeholder")&&e.call(a,!0,b)||(a.value=b),d):a.value=b}},k||(n.input=h,o.value=h),l||(n.textarea=h,o.value=h),c(function(){c(b).delegate("form","submit.placeholder",function(){var a=c(".placeholder",this).each(e);setTimeout(function(){a.each(f)},10)})}),c(a).bind("beforeunload.placeholder",function(){c(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery)}).call(this,__webpack_require__(0))},450:function(module,exports){},46:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;/*! pace 0.5.3 */(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W=[].slice,X={}.hasOwnProperty,Y=function(a,b){function c(){this.constructor=a}for(var d in b)X.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},Z=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(t={catchupTime:500,initialRate:.03,minTime:500,ghostTime:500,maxProgressPerFrame:10,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},B=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?a:+new Date},D=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,s=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==D&&(D=function(a){return setTimeout(a,50)},s=function(a){return clearTimeout(a)}),F=function(a){var b,c;return b=B(),(c=function(){var d;return(d=B()-b)>=33?(b=B(),a(d,function(){return D(c)})):setTimeout(c,33-d)})()},E=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?W.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},u=function(){var a,b,c,d,e,f,g;for(b=arguments[0],f=0,g=(d=2<=arguments.length?W.call(arguments,1):[]).length;g>f;f++)if(c=d[f])for(a in c)X.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?u(b[a],e):b[a]=e);return b},p=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},w=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];cP;P++)!0===C[J=T[P]]&&(C[J]=t[J]);i=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return Y(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(!(a=document.querySelector(C.target)))throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='
    \n
    \n
    \n
    ',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return(a=this.getElement()).className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b;return null!=document.querySelector(C.target)&&((a=this.getElement()).children[0].style.width=this.progress+"%",(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",(0|this.progress)+"%"),this.progress>=100?b="99":(b=this.progress<10?"0":"",b+=0|this.progress),a.children[0].setAttribute("data-progress",""+b)),this.lastRenderedProgress=this.progress)},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(g=[],d=0,e=(f=this.bindings[a]).length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),O=window.XMLHttpRequest,N=window.XDomainRequest,M=window.WebSocket,v=function(a,b){var d,e,f;for(d in f=[],b.prototype)try{e=b.prototype[d],f.push(null==a[d]&&"function"!=typeof e?a[d]=e:void 0)}catch(g){g}return f},z=[],Pace.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?W.call(arguments,1):[],z.unshift("ignore"),c=b.apply(null,a),z.shift(),c},Pace.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?W.call(arguments,1):[],z.unshift("track"),c=b.apply(null,a),z.shift(),c},I=function(a){var b;if(null==a&&(a="GET"),"track"===z[0])return"force";if(!z.length&&C.ajax){if("socket"===a&&C.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),Z.call(C.ajax.trackMethods,b)>=0)return!0}return!1},j=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return I(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new O(b),a(c),c},v(window.XMLHttpRequest,O),null!=N&&(window.XDomainRequest=function(){var b;return b=new N,a(b),b},v(window.XDomainRequest,N)),null!=M&&C.ajax.trackWebSockets&&(window.WebSocket=function(a,b){var d;return d=null!=b?new M(a,b):new M(a),I("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d},v(window.WebSocket,M))}return Y(b,h),b}(),Q=null,H=function(a){var b,c,d,e;for(c=0,d=(e=C.ajax.ignoreURLs).length;d>c;c++)if("string"==typeof(b=e[c])){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},(x=function(){return null==Q&&(Q=new j),Q})().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,H(g)?void 0:Pace.running||!1===C.restartOnRequestAfter&&"force"!==I(f)?void 0:(d=arguments,"boolean"==typeof(c=C.restartOnRequestAfter||0)&&(c=0),setTimeout(function(){var c,g,h,i,j;if("socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(Pace.restart(),j=[],c=0,g=(i=Pace.sources).length;g>c;c++){if((J=i[c])instanceof a){J.watch.apply(J,d);break}j.push(void 0)}return j}},c))}),a=function(){function a(){var a=this;this.elements=[],x().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,H(e)?void 0:(c="socket"===d?new m(b):new n(b),this.elements.push(c))},a}(),n=function(){return function(a){var b,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2}),d=0,e=(g=["load","abort","timeout","error"]).length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100});else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}}(),m=function(){return function(a){var b,c,d,e,f=this;for(this.progress=0,c=0,d=(e=["error","open"]).length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100})}}(),d=function(){return function(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),c=0,d=(f=a.selectors).length;d>c;c++)b=f[c],this.elements.push(new e(b))}}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},C.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){return function(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=B(),b=setInterval(function(){var g;return g=B()-c-50,c=B(),e.push(g),e.length>C.eventLag.sampleCount&&e.shift(),a=p(e),++d>=C.eventLag.minSamples&&a=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/C.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,C.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+C.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),K=null,G=null,q=null,L=null,o=null,r=null,Pace.running=!1,y=function(){return C.restartOnPushState?Pace.restart():void 0},null!=window.history.pushState&&(S=window.history.pushState,window.history.pushState=function(){return y(),S.apply(window.history,arguments)}),null!=window.history.replaceState&&(V=window.history.replaceState,window.history.replaceState=function(){return y(),V.apply(window.history,arguments)}),k={ajax:a,elements:d,document:c,eventLag:f},(A=function(){var a,c,d,e,f,g,h,i;for(Pace.sources=K=[],c=0,e=(g=["ajax","elements","document","eventLag"]).length;e>c;c++)!1!==C[a=g[c]]&&K.push(new k[a](C[a]));for(d=0,f=(i=null!=(h=C.extraSources)?h:[]).length;f>d;d++)J=i[d],K.push(new J(C));return Pace.bar=q=new b,G=[],L=new l})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,q.destroy(),r=!0,null!=o&&("function"==typeof s&&s(o),o=null),A()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){var a;return Pace.running=!0,q.render(),a=B(),r=!1,o=F(function(b,c){var d,e,f,g,h,i,j,m,n,o,p,s,t,u,v;for(100-q.progress,e=o=0,f=!0,i=p=0,t=K.length;t>p;i=++p)for(J=K[i],n=null!=G[i]?G[i]:G[i]=[],j=s=0,u=(h=null!=(v=J.elements)?v:[J]).length;u>s;j=++s)g=h[j],f&=(m=null!=n[j]?n[j]:n[j]=new l(g)).done,m.done||(e++,o+=m.tick(b));return d=o/e,q.update(L.tick(b,d)),q.done()||f||r?(q.update(100),Pace.trigger("done"),setTimeout(function(){return q.finish(),Pace.running=!1,Pace.trigger("hide")},Math.max(C.ghostTime,Math.max(C.minTime-(B()-a),0)))):c()})},Pace.start=function(a){u(C,a),Pace.running=!0;try{q.render()}catch(b){i=b}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return Pace}.call(exports,__webpack_require__,exports,module))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)}).call(this)},47:function(module,exports,__webpack_require__){(function(jQuery){var $;($=jQuery).idleTimer=function(firstParam,elem){var opts;"object"==typeof firstParam?(opts=firstParam,firstParam=null):"number"==typeof firstParam&&(opts={timeout:firstParam},firstParam=null),elem=elem||document,opts=$.extend({idle:!1,timeout:3e4,events:"mousemove keydown wheel DOMMouseScroll mousewheel mousedown touchstart touchmove MSPointerDown MSPointerMove"},opts);var jqElem=$(elem),obj=jqElem.data("idleTimerObj")||{},toggleIdleState=function(e){var obj=$.data(elem,"idleTimerObj")||{};obj.idle=!obj.idle,obj.olddate=+new Date;var event=$.Event((obj.idle?"idle":"active")+".idleTimer");$(elem).trigger(event,[elem,$.extend({},obj),e])},handleEvent=function(e){var obj=$.data(elem,"idleTimerObj")||{};if(("storage"!==e.type||e.originalEvent.key===obj.timerSyncId)&&null==obj.remaining){if("mousemove"===e.type){if(e.pageX===obj.pageX&&e.pageY===obj.pageY)return;if(void 0===e.pageX&&void 0===e.pageY)return;if(+new Date-obj.olddate<200)return}clearTimeout(obj.tId),obj.idle&&toggleIdleState(e),obj.lastActive=+new Date,obj.pageX=e.pageX,obj.pageY=e.pageY,"storage"!==e.type&&obj.timerSyncId&&"undefined"!=typeof localStorage&&localStorage.setItem(obj.timerSyncId,obj.lastActive),obj.tId=setTimeout(toggleIdleState,obj.timeout)}},reset=function(){var obj=$.data(elem,"idleTimerObj")||{};obj.idle=obj.idleBackup,obj.olddate=+new Date,obj.lastActive=obj.olddate,obj.remaining=null,clearTimeout(obj.tId),obj.idle||(obj.tId=setTimeout(toggleIdleState,obj.timeout))};if(null===firstParam&&void 0!==obj.idle)return reset(),jqElem;if(null===firstParam);else{if(null!==firstParam&&void 0===obj.idle)return!1;if("destroy"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};clearTimeout(obj.tId),jqElem.removeData("idleTimerObj"),jqElem.off("._idleTimer")}(),jqElem;if("pause"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};null==obj.remaining&&(obj.remaining=obj.timeout-(+new Date-obj.olddate),clearTimeout(obj.tId))}(),jqElem;if("resume"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};null!=obj.remaining&&(obj.idle||(obj.tId=setTimeout(toggleIdleState,obj.remaining)),obj.remaining=null)}(),jqElem;if("reset"===firstParam)return reset(),jqElem;if("getRemainingTime"===firstParam)return function(){var obj=$.data(elem,"idleTimerObj")||{};if(obj.idle)return 0;if(null!=obj.remaining)return obj.remaining;var remaining=obj.timeout-(+new Date-obj.lastActive);return remaining<0&&(remaining=0),remaining}();if("getElapsedTime"===firstParam)return+new Date-obj.olddate;if("getLastActiveTime"===firstParam)return obj.lastActive;if("isIdle"===firstParam)return obj.idle}return jqElem.on($.trim((opts.events+" ").split(" ").join("._idleTimer ")),function(e){handleEvent(e)}),opts.timerSyncId&&$(window).bind("storage",handleEvent),(obj=$.extend({},{olddate:+new Date,lastActive:+new Date,idle:opts.idle,idleBackup:opts.idle,timeout:opts.timeout,remaining:null,timerSyncId:opts.timerSyncId,tId:null,pageX:null,pageY:null})).idle||(obj.tId=setTimeout(toggleIdleState,obj.timeout)),$.data(elem,"idleTimerObj",obj),jqElem},$.fn.idleTimer=function(firstParam){return this[0]?$.idleTimer(firstParam,this[0]):this}}).call(this,__webpack_require__(0))},48:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var react=__webpack_require__(50),react_default=__webpack_require__.n(react),react_dom=__webpack_require__(73),react_dom_default=__webpack_require__.n(react_dom),redux=__webpack_require__(105),es=__webpack_require__(52),redux_saga_es=__webpack_require__(524),redux_saga_thunk=__webpack_require__(252),handleActions=__webpack_require__(525),immutable_es=__webpack_require__(67),lib=__webpack_require__(330);const PENDING="PENDING",ERROR="ERROR",SUCCESS="SUCCESS",SHOW_MODAL=Object(lib.defineAction)("SHOW_MODAL"),HIDE_MODAL=Object(lib.defineAction)("HIDE_MODAL"),CLEAR_MODAL=Object(lib.defineAction)("CLEAR_MODAL"),SHOW_NOTICE=Object(lib.defineAction)("SHOW_NOTICE",[SUCCESS]),CLEAR_NOTICE=Object(lib.defineAction)("CLEAR_NOTICE"),SET_SESSION_USER=Object(lib.defineAction)("SET_SESSION_USER"),FETCH_ROLES=Object(lib.defineAction)("FETCH_ROLES",[SUCCESS,ERROR]),UPDATE_ROLE_ORDER=Object(lib.defineAction)("UPDATE_ROLE_ORDER",[SUCCESS,ERROR]),NAV_CHANGE=Object(lib.defineAction)("NAV_CHANGE"),FETCH_TICKETS=Object(lib.defineAction)("FETCH_TICKETS",[SUCCESS,PENDING,ERROR]),CREATE_TICKET=Object(lib.defineAction)("CREATE_TICKET",[PENDING,SUCCESS,ERROR]),DELETE_TICKET=Object(lib.defineAction)("DELETE_TICKET",[SUCCESS,PENDING,ERROR]),UNLOAD_TICKETS=Object(lib.defineAction)("UNLOAD_TICKETS",[SUCCESS]),TICKET_UPDATED=Object(lib.defineAction)("TICKET_UPDATED",[SUCCESS]),TICKET_EVENT=Object(lib.defineAction)("TICKET_EVENT",[SUCCESS]),CREATE_TICKET_TYPE=Object(lib.defineAction)("CREATE_TICKET_TYPE",[SUCCESS,ERROR]),RENAME_TICKET_TYPE=Object(lib.defineAction)("RENAME_TICKET_TYPE",[SUCCESS,ERROR]),DELETE_TICKET_TYPE=Object(lib.defineAction)("DELETE_TICKET_TYPE",[SUCCESS,ERROR]),CREATE_PRIORITY=Object(lib.defineAction)("CREATE_PRIORITY",[SUCCESS,ERROR]),UPDATE_PRIORITY=Object(lib.defineAction)("UPDATE_PRIORITY",[SUCCESS,ERROR]),DELETE_PRIORITY=Object(lib.defineAction)("DELETE_PRIORITY",[SUCCESS,ERROR]),GET_TAGS_WITH_PAGE=Object(lib.defineAction)("GET_TAGS_WITH_PAGE",[SUCCESS,ERROR]),TAGS_UPDATE_CURRENT_PAGE=Object(lib.defineAction)("TAGS_UPDATE_CURRENT_PAGE",[SUCCESS,ERROR]),CREATE_TAG=Object(lib.defineAction)("CREATE_TAG",[SUCCESS,ERROR]),FETCH_ACCOUNTS=Object(lib.defineAction)("FETCH_ACCOUNTS",[PENDING,SUCCESS,ERROR]),FETCH_ACCOUNTS_CREATE_TICKET=Object(lib.defineAction)("FETCH_ACCOUNTS_CREATE_TICKET",[PENDING,SUCCESS,ERROR]),CREATE_ACCOUNT=Object(lib.defineAction)("CREATE_ACCOUNT",[PENDING,SUCCESS,ERROR]),SAVE_EDIT_ACCOUNT=Object(lib.defineAction)("SAVE_EDIT_ACCOUNT",[PENDING,SUCCESS,ERROR]),DELETE_ACCOUNT=Object(lib.defineAction)("DELETE_ACCOUNT",[PENDING,SUCCESS,ERROR]),ENABLE_ACCOUNT=Object(lib.defineAction)("ENABLE_ACCOUNT",[SUCCESS,ERROR]),UNLOAD_ACCOUNTS=Object(lib.defineAction)("UNLOAD_ACCOUNTS",[SUCCESS]),FETCH_GROUPS=Object(lib.defineAction)("FETCH_GROUPS",[PENDING,SUCCESS,ERROR]),CREATE_GROUP=Object(lib.defineAction)("CREATE_GROUP",[SUCCESS,PENDING,ERROR]),UPDATE_GROUP=Object(lib.defineAction)("UPDATE_GROUP",[SUCCESS,PENDING,ERROR]),DELETE_GROUP=Object(lib.defineAction)("DELETE_GROUP",[SUCCESS,PENDING,ERROR]),UNLOAD_GROUPS=Object(lib.defineAction)("UNLOAD_GROUPS",[SUCCESS]),FETCH_TEAMS=Object(lib.defineAction)("FETCH_TEAMS",[PENDING,SUCCESS,ERROR]),CREATE_TEAM=Object(lib.defineAction)("CREATE_TEAM",[PENDING,SUCCESS,ERROR]),SAVE_EDIT_TEAM=Object(lib.defineAction)("SAVE_EDIT_TEAM",[PENDING,SUCCESS,ERROR]),DELETE_TEAM=Object(lib.defineAction)("DELETE_TEAM",[PENDING,SUCCESS,ERROR]),UNLOAD_TEAMS=Object(lib.defineAction)("UNLOAD_TEAMS",[SUCCESS]),FETCH_DEPARTMENTS=Object(lib.defineAction)("FETCH_DEPARTMENTS",[PENDING,SUCCESS,ERROR]),CREATE_DEPARTMENT=Object(lib.defineAction)("CREATE_DEPARTMENT",[PENDING,SUCCESS,ERROR]),UPDATE_DEPARTMENT=Object(lib.defineAction)("UPDATE_DEPARTMENT",[SUCCESS,PENDING,ERROR]),DELETE_DEPARTMENT=Object(lib.defineAction)("DELETE_DEPARTMENT",[SUCCESS,PENDING,ERROR]),UNLOAD_DEPARTMENTS=Object(lib.defineAction)("UNLOAD_DEPARTMENTS",[SUCCESS]),FETCH_SEARCH_RESULTS=Object(lib.defineAction)("FETCH_SEARCH_RESULTS",[SUCCESS,PENDING,ERROR]),UNLOAD_SEARCH_RESULTS=Object(lib.defineAction)("UNLOAD_SEARCH_RESULTS",[SUCCESS]),FETCH_SETTINGS=Object(lib.defineAction)("FETCH_SETTINGS",[SUCCESS,ERROR]),UPDATE_SETTING=Object(lib.defineAction)("UPDATE_SETTING",[SUCCESS,ERROR]),UPDATE_MULTIPLE_SETTINGS=Object(lib.defineAction)("UPDATE_MULTIPLE_SETTINGS",[SUCCESS,ERROR]),UPDATE_COLORSCHEME=Object(lib.defineAction)("UPDATE_COLORSCHEME",[SUCCESS,ERROR]),FETCH_MONGODB_TOOLS=Object(lib.defineAction)("FETCH_MONGODB_TOOLS",[SUCCESS,ERROR]),FETCH_BACKUPS=Object(lib.defineAction)("FETCH_BACKUPS",[SUCCESS,ERROR]),BACKUP_NOW=Object(lib.defineAction)("BACKUP_NOW",[PENDING,SUCCESS,ERROR]),FETCH_DELETED_TICKETS=Object(lib.defineAction)("FETCH_DELETED_TICKETS",[PENDING,SUCCESS,ERROR]),RESTORE_DELETED_TICKET=Object(lib.defineAction)("RESTORE_DELETED_TICKET",[SUCCESS,ERROR]),CHANGE_DELETED_TICKETS_PAGE=Object(lib.defineAction)("CHANGE_DELETED_TICKETS_PAGE"),UPDATE_PERMISSIONS=Object(lib.defineAction)("UPDATE_PERMISSIONS",[PENDING,SUCCESS,ERROR]),CREATE_ROLE=Object(lib.defineAction)("CREATE_ROLE",[SUCCESS,ERROR]),DELETE_ROLE=Object(lib.defineAction)("DELETE_ROLE",[SUCCESS,ERROR]),initialState={sessionUser:null,roles:Object(immutable_es.a)([]),roleOrder:Object(immutable_es.b)({}),notice:null};var reducers_shared=Object(handleActions.a)({[SET_SESSION_USER]:(state,action)=>({...state,sessionUser:action.payload.sessionUser}),[SHOW_NOTICE]:(state,action)=>({...state,notice:Object(immutable_es.c)(action.payload)}),[CLEAR_NOTICE]:state=>({...state,notice:null}),[FETCH_ROLES.SUCCESS]:(state,action)=>({...state,roles:Object(immutable_es.c)(action.response.roles),roleOrder:Object(immutable_es.c)(action.response.roleOrder)}),[UPDATE_ROLE_ORDER.SUCCESS]:(state,action)=>({...state,roleOrder:Object(immutable_es.c)(action.response.roleOrder)})},initialState);const common_initialState={};var common=function(state=common_initialState,action){return action.type,state},uikit_combined_min=__webpack_require__(5),uikit_combined_min_default=__webpack_require__.n(uikit_combined_min);const modalReducer_initialState={modalType:null,modalProps:{}};var modalReducer=Object(handleActions.a)({[SHOW_MODAL]:(state,action)=>({modalType:action.payload.modalType,modalProps:action.payload.modalProps}),[HIDE_MODAL]:(state,action)=>{const modal=document.getElementById("uk-modal");if(modal){const modalTag=modal.getAttribute("data-modal-tag");modalTag===action.payload?uikit_combined_min_default.a.modal(modal).hide():modalTag||uikit_combined_min_default.a.modal(modal).hide()}return state},[CLEAR_MODAL]:()=>({...modalReducer_initialState})},modalReducer_initialState);var reducers_sidebarReducer=Object(handleActions.a)({[NAV_CHANGE]:(state,action)=>({activeItem:action.payload.activeItem,activeSubItem:action.payload.activeSubItem,plugins:null})},{activeItem:"",activeSubItem:"",plugins:null}),lodash=__webpack_require__(14),helpers=__webpack_require__(9),helpers_default=__webpack_require__.n(helpers);const settings_initialState={loaded:!1,settings:Object(immutable_es.b)({}),hasMongoDBTools:!1,backingup:!1,backups:Object(immutable_es.a)([]),deletedTicketsCount:0,allDeletedTickets:Object(immutable_es.a)([]),deletedTickets:Object(immutable_es.a)([])};var reducers_settings=Object(handleActions.a)({[FETCH_SETTINGS.SUCCESS]:(state,action)=>({...state,settings:Object(immutable_es.c)(action.response.settings.data),loaded:!0}),[UPDATE_SETTING.SUCCESS]:(state,action)=>{const updatedSetting=Object(lodash.find)(action.response.updatedSettings,{name:action.payload.name});return{...state,loaded:state.loaded,settings:state.settings.setIn(["settings",action.payload.stateName],updatedSetting)}},[UPDATE_SETTING.ERROR]:(state,action)=>(helpers_default.a.UI.showSnackbar("Error: "+action.error,!0),{...state,loaded:state.loaded,settings:state.settings}),[UPDATE_MULTIPLE_SETTINGS.SUCCESS]:state=>({...state,loaded:state.loaded,settings:state.settings}),[FETCH_MONGODB_TOOLS.SUCCESS]:(state,action)=>({...state,hasMongoDBTools:action.response.success}),[FETCH_BACKUPS.SUCCESS]:(state,action)=>({...state,backups:Object(immutable_es.c)(action.response.files)}),[BACKUP_NOW.PENDING]:state=>({...state,backingup:!0}),[BACKUP_NOW.SUCCESS]:state=>({...state,backingup:!1}),[BACKUP_NOW.ERROR]:state=>({...state,backingup:!1}),[FETCH_DELETED_TICKETS.SUCCESS]:(state,action)=>({...state,deletedTicketsCount:action.response.deletedTickets.length,allDeletedTickets:Object(immutable_es.c)(action.response.deletedTickets),deletedTickets:Object(immutable_es.c)(action.response.deletedTickets.slice(0,15))}),[RESTORE_DELETED_TICKET.SUCCESS]:(state,action)=>{const deletedIdx=state.deletedTickets.findIndex(i=>i.get("_id")===action.payload._id),allDeletedIdx=state.allDeletedTickets.findIndex(i=>i.get("_id")===action.payload._id);return{...state,allDeletedTickets:state.allDeletedTickets.splice(allDeletedIdx,1),deletedTickets:state.deletedTickets.splice(deletedIdx,1)}},[CHANGE_DELETED_TICKETS_PAGE]:(state,action)=>{const pageIndex=action.payload.pageIndex;return{...state,deletedTickets:state.allDeletedTickets.slice(15*pageIndex,15*(pageIndex+1))}}},settings_initialState),isUndefined=__webpack_require__(332),isUndefined_default=__webpack_require__.n(isUndefined);const ticketsReducer_initialState={tickets:Object(immutable_es.a)([]),totalCount:"",viewType:"active",loading:!1,nextPage:1,prevPage:0};var ticketsReducer=Object(handleActions.a)({[FETCH_TICKETS.PENDING]:(state,action)=>({...state,viewType:action.payload.type,loading:!0}),[FETCH_TICKETS.SUCCESS]:(state,action)=>({...state,tickets:Object(immutable_es.c)(action.response.tickets||[]),prevPage:Object(immutable_es.c)(action.response.prevPage),nextPage:Object(immutable_es.c)(action.response.nextPage),totalCount:action.response.totalCount?Object(immutable_es.c)(action.response.totalCount.toString()):action.response.tickets.length.toString(),loading:!1}),[FETCH_TICKETS.ERROR]:(state,action)=>({...state,loading:!1}),[CREATE_TICKET.SUCCESS]:(state,action)=>({...state}),[DELETE_TICKET.SUCCESS]:(state,action)=>{const idx=state.tickets.findIndex(ticket=>ticket.get("_id")===action.payload.id);return{...state,tickets:state.tickets.delete(idx)}},[TICKET_EVENT.SUCCESS]:(state,action)=>{switch(action.payload.type){case"created":{const ticket=action.payload.data;return{...state,tickets:state.tickets.insert(0,Object(immutable_es.c)(ticket))}}case"deleted":{const id=action.payload.data,idx=state.tickets.findIndex(ticket=>ticket.get("_id")===id);return{...state,tickets:state.tickets.delete(idx)}}default:return{...state}}},[TICKET_UPDATED.SUCCESS]:(state,action)=>{const ticket=action.payload.ticket,userGroupIds=action.sessionUser.groups,idx=state.tickets.findIndex(t=>t.get("_id")===ticket._id),inView=function(view,status,assignee,userId,userGroupIds,groupId){let hasView=!1,hasGroup=!1;switch(view){case"filter":hasView=!0;break;case"all":hasView=-1!==[0,1,2,3].indexOf(status);break;case"active":hasView=-1!==[0,1,2].indexOf(status);break;case"assigned":hasView=assignee===userId;break;case"unassigned":hasView=isUndefined_default()(assignee);break;case"new":hasView=0===status;break;case"open":hasView=1===status;break;case"pending":hasView=2===status;break;case"closed":hasView=3===status;break;default:hasView=!1}return(hasGroup=!isUndefined_default()(userGroupIds)&&!isUndefined_default()(groupId)&&-1!==userGroupIds.indexOf(groupId))&&hasView}(state.viewType,ticket.status,ticket.assignee?ticket.assignee._id:void 0,action.sessionUser._id,userGroupIds,ticket.group._id);if(!inView&&-1!==idx)return{...state,tickets:state.tickets.delete(idx)};if(!inView)return{...state};if(-1===idx){const withTicket=state.tickets.push(Object(immutable_es.c)(ticket));return{...state,tickets:withTicket.sortBy(t=>-t.get("uid"))}}return{...state,tickets:state.tickets.set(idx,Object(immutable_es.c)(ticket))}},[UNLOAD_TICKETS.SUCCESS]:state=>({...state,tickets:state.tickets.clear(),loading:!1})},ticketsReducer_initialState);const tagsReducer_initialState={loading:!0,totalCount:0,tags:Object(immutable_es.a)([]),currentPage:0};var reducers_tagsReducer=Object(handleActions.a)({[GET_TAGS_WITH_PAGE.SUCCESS]:(state,action)=>({...state,loading:!1,totalCount:action.response.count,tags:Object(immutable_es.c)(action.response.tags)}),[GET_TAGS_WITH_PAGE.ERROR]:(state,action)=>({...state,loading:!1}),[TAGS_UPDATE_CURRENT_PAGE]:(state,action)=>({...state,currentPage:action.payload.currentPage})},tagsReducer_initialState);const accountsReducer_initialState={accounts:Object(immutable_es.a)([]),type:"customers",loading:!1,accountsCreateTicket:Object(immutable_es.a)([]),createTicketLoading:!1};var accountsReducer=Object(handleActions.a)({[FETCH_ACCOUNTS.PENDING]:state=>({...state,loading:!0}),[FETCH_ACCOUNTS.SUCCESS]:(state,action)=>{let arr=state.accounts.toArray();return action.payload.response.accounts.map(i=>{arr.push(i)}),{...state,accounts:Object(immutable_es.c)(arr),type:action.payload.payload&&action.payload.payload.type?action.payload.payload.type:"customers",loading:!1}},[FETCH_ACCOUNTS_CREATE_TICKET.PENDING]:state=>({...state,createTicketLoading:!0}),[FETCH_ACCOUNTS_CREATE_TICKET.SUCCESS]:(state,action)=>{let arr=state.accountsCreateTicket.toArray();return action.payload.response.accounts.map(i=>{arr.push(i)}),{...state,accountsCreateTicket:Object(immutable_es.c)(arr),createTicketLoading:!1}},[CREATE_ACCOUNT.SUCCESS]:(state,action)=>{const resAccount=action.response.account;if(!resAccount.role.isAgent&&!resAccount.role.isAdmin&&"customers"!==state.type)return{...state};if(resAccount.role.isAgent||resAccount.role.isAdmin&&"customers"===state.type)return{...state};if(resAccount.role.isAdmin&&!resAccount.role.isAgent&&"agents"===state.type)return{...state};if(resAccount.role.isAgent&&!resAccount.role.isAdmin&&"admins"===state.type)return{...state};const insertedAccount=state.accounts.push(Object(immutable_es.c)(resAccount));return{...state,accounts:insertedAccount.sortBy(account=>account.get("fullname"))}},[SAVE_EDIT_ACCOUNT.SUCCESS]:(state,action)=>{const resUser=action.response.user,accountIndex=state.accounts.findIndex(u=>u.get("_id")===resUser._id),customer=!resUser.role.isAdmin&&!resUser.role.isAgent;let accounts=null;return"agents"!==state.type&&"admins"!==state.type||customer?("agents"!==state.type&&"admins"!==state.type||!customer)&&("customers"!==state.type||customer)?"customers"===state.type&&customer&&(accounts=state.accounts.set(accountIndex,Object(immutable_es.c)(resUser))):accounts=state.accounts.remove(accountIndex):accounts=state.accounts.set(accountIndex,Object(immutable_es.c)(resUser)),{...state,accounts}},[DELETE_ACCOUNT.PENDING]:(state,action)=>{const accountIndex=state.accounts.findIndex(u=>u.get("username")===action.payload.username);return{...state,accounts:state.accounts.setIn([accountIndex,"loading"],!0)}},[DELETE_ACCOUNT.SUCCESS]:(state,action)=>{const isDisabled=action.response.disabled,accountIndex=state.accounts.findIndex(u=>u.get("username")===action.payload.username);let withDisabled;return withDisabled=(withDisabled=state.accounts.setIn([accountIndex,"deleted"],isDisabled)).setIn([accountIndex,"loading"],!1),isDisabled||(withDisabled=state.accounts.delete(accountIndex)),{...state,accounts:withDisabled}},[ENABLE_ACCOUNT.SUCCESS]:(state,action)=>{const accountIndex=state.accounts.findIndex(u=>u.get("username")===action.payload.username);return{...state,accounts:state.accounts.setIn([accountIndex,"deleted"],!1)}},[UNLOAD_ACCOUNTS.SUCCESS]:state=>({...state,accounts:state.accounts.clear()})},accountsReducer_initialState);const groupsReducer_initialState={groups:Object(immutable_es.a)([])};var groupsReducer=Object(handleActions.a)({[FETCH_GROUPS.SUCCESS]:(state,action)=>{return{...state,groups:Object(immutable_es.c)(action.response.groups).sortBy(group=>group.get("name"))}},[CREATE_GROUP.SUCCESS]:(state,action)=>{const resGroup=action.response.group,withInsertedGroup=state.groups.push(Object(immutable_es.c)(resGroup));return{...state,groups:withInsertedGroup.sortBy(team=>team.get("name"))}},[UPDATE_GROUP.SUCCESS]:(state,action)=>{const resGroup=action.response.group,groupIndex=state.groups.findIndex(g=>g.get("_id")===resGroup._id);return{...state,groups:state.groups.set(groupIndex,Object(immutable_es.c)(resGroup))}},[DELETE_GROUP.SUCCESS]:(state,action)=>{const idx=state.groups.findIndex(g=>g.get("_id")===action.payload._id);return{...state,groups:state.groups.delete(idx)}},[UNLOAD_GROUPS.SUCCESS]:state=>({...state,groups:state.groups.clear()})},groupsReducer_initialState);const teamsReducer_initialState={teams:Object(immutable_es.a)([])};var teamsReducer=Object(handleActions.a)({[FETCH_TEAMS.SUCCESS]:(state,action)=>({...state,teams:Object(immutable_es.c)(action.payload.response.teams)}),[CREATE_TEAM.SUCCESS]:(state,action)=>{const resTeam=action.response.team,withInsertedTeam=state.teams.push(Object(immutable_es.c)(resTeam));return{...state,teams:withInsertedTeam.sortBy(team=>team.get("name"))}},[SAVE_EDIT_TEAM.SUCCESS]:(state,action)=>{const resTeam=action.response.team,teamIndex=state.teams.findIndex(t=>t.get("_id")===resTeam._id);return{...state,teams:state.teams.set(teamIndex,Object(immutable_es.c)(resTeam))}},[DELETE_TEAM.SUCCESS]:(state,action)=>{const idx=state.teams.findIndex(t=>t.get("_id")===action.payload._id);return{...state,teams:state.teams.delete(idx)}},[UNLOAD_TEAMS.SUCCESS]:state=>({...state,teams:state.teams.clear()})},teamsReducer_initialState);const departmentsReducer_initialState={departments:Object(immutable_es.a)([])};var departmentsReducer=Object(handleActions.a)({[FETCH_DEPARTMENTS.SUCCESS]:(state,action)=>{return{...state,departments:Object(immutable_es.c)(action.response.departments).sortBy(d=>d.get("normalized"))}},[CREATE_DEPARTMENT.SUCCESS]:(state,action)=>{const department=Object(immutable_es.c)(action.response.department),withDepartment=state.departments.push(department);return{...state,departments:withDepartment.sortBy(department=>department.get("normalized"))}},[UPDATE_DEPARTMENT.SUCCESS]:(state,action)=>{const department=action.response.department,idx=state.departments.findIndex(d=>d.get("_id")===department._id);return{...state,departments:state.departments.set(idx,Object(immutable_es.c)(department))}},[DELETE_DEPARTMENT.SUCCESS]:(state,action)=>{const idx=state.departments.findIndex(d=>d.get("_id")===action.payload._id);return{...state,departments:state.departments.delete(idx)}},[UNLOAD_DEPARTMENTS.SUCCESS]:state=>({...state,departments:state.departments.clear()})},departmentsReducer_initialState);const searchReducer_initialState={loading:!1,results:Object(immutable_es.a)([]),error:null};var reducers_searchReducer=Object(handleActions.a)({[FETCH_SEARCH_RESULTS.PENDING]:state=>({...state,loading:!0}),[FETCH_SEARCH_RESULTS.SUCCESS]:(state,action)=>({...state,loading:!1,results:Object(immutable_es.c)(action.response.hits.hits)}),[FETCH_SEARCH_RESULTS.ERROR]:(state,action)=>({...state,loading:!1,error:action.error.response.data}),[UNLOAD_SEARCH_RESULTS.SUCCESS]:state=>({...state,loading:!1,results:state.results.clear()})},searchReducer_initialState);var reducers=Object(redux.c)({shared:reducers_shared,common,searchState:reducers_searchReducer,modal:modalReducer,sidebar:reducers_sidebarReducer,ticketsState:ticketsReducer,accountsState:accountsReducer,groupsState:groupsReducer,teamsState:teamsReducer,departmentsState:departmentsReducer,settings:reducers_settings,tagsSettings:reducers_tagsReducer}),effects=__webpack_require__(62),axios=__webpack_require__(59),axios_default=__webpack_require__.n(axios);axios_default.a.defaults.headers.post["Content-Type"]="application/json";let api={tickets:{}};api.tickets.getWithPage=(payload=>{const limit=payload.limit?payload.limit:50,page=payload.page?payload.page:0,type=payload.type?payload.type:"all",filter=payload.filter?encodeURIComponent(JSON.stringify(payload.filter,null,2)):void 0,fullFilter=filter?`&filter=${filter}`:void 0;return axios_default.a.get(`/api/v2/tickets?type=${type}&page=${page}&limit=${limit}${fullFilter}`).then(res=>res.data)}),api.tickets.search=(payload=>axios_default.a.get(`/api/v1/tickets/search/?search=${payload.searchString}&limit=100`).then(res=>res.data)),api.tickets.create=(payload=>axios_default.a.post("/api/v1/tickets/create",payload).then(res=>res.data)),api.tickets.delete=(({id})=>axios_default.a.delete(`/api/v1/tickets/${id}`).then(res=>res.data)),api.tickets.renameTicketType=((id,name)=>axios_default.a.put("/api/v1/tickets/types/"+id,{name}).then(res=>res.data)),api.tickets.createTicketType=(({name})=>axios_default.a.post("/api/v1/tickets/types/create",{name}).then(res=>res.data)),api.tickets.addPriorityToType=(({typeId,priority})=>axios_default.a.post(`/api/v1/tickets/type/${typeId}/addpriority`,{priority}).then(res=>res.data)),api.tickets.removePriorityFromType=(({typeId,priority})=>axios_default.a.post(`/api/v1/tickets/type/${typeId}/removepriority`,{priority}).then(res=>res.data)),api.tickets.deleteTicketType=(({id,newTypeId})=>axios_default.a.delete(`/api/v1/tickets/types/${id}`,{data:{newTypeId}}).then(res=>res.data)),api.tickets.createPriority=(({name,overdueIn,htmlColor})=>axios_default.a.post("/api/v1/tickets/priority/create",{name,overdueIn,htmlColor}).then(res=>res.data)),api.tickets.updatePriority=(({id,name,overdueIn,htmlColor})=>axios_default.a.put(`/api/v1/tickets/priority/${id}`,{name,overdueIn,htmlColor}).then(res=>res.data)),api.tickets.deletePriority=(({id,newPriority})=>axios_default.a.post(`/api/v1/tickets/priority/${id}/delete`,{newPriority}).then(res=>res.data)),api.tickets.getTagsWithPage=(({limit,page})=>(limit=limit||10,page=page||0,axios_default.a.get(`/api/v1/tags/limit?limit=${limit}&page=${page}`).then(res=>res.data))),api.tickets.createTag=(({name})=>axios_default.a.post("/api/v1/tags/create",{tag:name}).then(res=>res.data)),api.accounts={},api.accounts.create=(payload=>axios_default.a.post("/api/v2/accounts",payload).then(res=>res.data)),api.accounts.getWithPage=(payload=>{const limit=payload&&payload.limit?payload.limit:25,page=payload&&payload.page?payload.page:0,type=payload&&payload.type?payload.type:"all";let search=payload&&payload.search?payload.search:"";search&&(search=`&search=${search}`);const showDeleted=!(!payload||!payload.showDeleted)&&payload.showDeleted;return axios_default.a.get(`/api/v2/accounts?type=${type}&limit=${limit}&page=${page}${search}&showDeleted=${showDeleted}`).then(res=>res.data)}),api.accounts.updateUser=(payload=>axios_default.a.put(`/api/v2/accounts/${payload.username}`,payload).then(res=>res.data)),api.accounts.deleteAccount=(({username})=>axios_default.a.delete(`/api/v1/users/${username}`).then(res=>res.data)),api.accounts.enableAccount=(({username})=>axios_default.a.get(`/api/v1/users/${username}/enable`).then(res=>res.data)),api.groups={},api.groups.create=(payload=>axios_default.a.post("/api/v2/groups",payload).then(res=>res.data)),api.groups.get=(payload=>{const limit=payload&&payload.limit?payload.limit:1e3,page=payload&&payload.page?payload.page:0,type=payload&&payload.type?`&type=${payload.type}`:"";return axios_default.a.get(`/api/v2/groups?limit=${limit}&page=${page}${type}`).then(res=>res.data)}),api.groups.update=(payload=>axios_default.a.put(`/api/v2/groups/${payload._id}`,payload).then(res=>res.data)),api.groups.delete=(({_id})=>axios_default.a.delete(`/api/v2/groups/${_id}`).then(res=>res.data)),api.teams={},api.teams.getWithPage=(payload=>{const limit=payload&&payload.limit?payload.limit:100,page=payload&&payload.page?payload.page:0;return axios_default.a.get(`/api/v2/teams?limit=${limit}&page=${page}`).then(res=>res.data)}),api.teams.create=(payload=>axios_default.a.post("/api/v2/teams",payload).then(res=>res.data)),api.teams.updateTeam=(payload=>axios_default.a.put(`/api/v2/teams/${payload._id}`,payload).then(res=>res.data)),api.teams.deleteTeam=(({_id})=>axios_default.a.delete(`/api/v2/teams/${_id}`).then(res=>res.data)),api.departments={},api.departments.get=(()=>axios_default.a.get("/api/v2/departments").then(res=>res.data)),api.departments.create=(payload=>axios_default.a.post("/api/v2/departments",payload).then(res=>res.data)),api.departments.update=(payload=>axios_default.a.put(`/api/v2/departments/${payload._id}`,payload).then(res=>res.data)),api.departments.delete=(({_id})=>axios_default.a.delete(`/api/v2/departments/${_id}`).then(res=>res.data)),api.search={},api.search.search=(({limit,term})=>{const l=limit||25;return axios_default.a.get(`/api/v2/es/search?limit=${l}&q=${term}`).then(res=>res.data)}),api.settings={},api.settings.update=(settings=>axios_default.a.put("/api/v1/settings",settings).then(res=>res.data)),api.settings.hasMongoDBTools=(()=>axios_default.a.get("/api/v1/backup/hastools").then(res=>res.data)),api.settings.fetchBackups=(()=>axios_default.a.get("/api/v1/backups").then(res=>res.data)),api.settings.backupNow=(()=>axios_default.a.post("/api/v1/backup").then(res=>res.data)),api.settings.getBackups=(()=>axios_default.a.get("/api/v1/backups").then(res=>res.data)),api.settings.fetchDeletedTickets=(()=>axios_default.a.get("/api/v1/tickets/deleted").then(res=>res.data)),api.settings.restoreDeletedTicket=(({_id})=>axios_default.a.post("/api/v1/tickets/deleted/restore",{_id}).then(res=>res.data)),api.settings.updateRoleOrder=(({roleOrder})=>axios_default.a.put("/api/v1/settings/updateroleorder",{roleOrder}).then(res=>res.data)),api.settings.updatePermissions=(payload=>axios_default.a.put(`/api/v1/roles/${payload._id}`,payload).then(res=>res.data)),api.settings.createRole=(({name})=>axios_default.a.post("/api/v1/roles",{name}).then(res=>res.data)),api.settings.deleteRole=(({_id,newRoleId})=>axios_default.a.delete(`/api/v1/roles/${_id}`,{data:{newRoleId}}).then(res=>res.data)),api.common={},api.common.fetchRoles=(()=>axios_default.a.get("/api/v1/roles").then(res=>res.data));var client_api=api,browser=__webpack_require__(351),browser_default=__webpack_require__.n(browser);const BASE="trudesk",COLOURS={debug:"blue",info:"green",warn:"pink",error:"red"};var logger=new class{generateMessage(level,message,source){const namespace=`${BASE}:${level}`,createDebug=browser_default()(namespace);createDebug.color=COLOURS[level],source?createDebug(source,message):createDebug(message)}debug(message,source){return this.generateMessage("debug",message,source)}info(message,source){return this.generateMessage("info",message,source)}warn(message,source){return this.generateMessage("warn",message,source)}error(message,source){return this.generateMessage("error",message,source)}};function*fetchRoles({payload}){try{const response=yield Object(effects.b)(client_api.common.fetchRoles,payload);yield Object(effects.c)({type:FETCH_ROLES.SUCCESS,response})}catch(error){const errorText=error.response.data.error;logger.error(errorText,error.response),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_ROLES.ERROR,error})}}function*watcher(){yield Object(effects.f)(FETCH_ROLES.ACTION,fetchRoles)}function fetchSettings(){return axios_default.a.get("/api/v1/settings").then(res=>res.data).catch(error=>{throw error.response})}function*fetchFlow({payload}){try{const response=yield Object(effects.b)(fetchSettings,payload);yield Object(effects.c)({type:FETCH_SETTINGS.SUCCESS,response})}catch(error){yield Object(effects.c)({type:FETCH_SETTINGS.ERROR,error})}}function*updateSetting({payload,meta}){try{const response=yield Object(effects.b)(client_api.settings.update,[payload]);payload.noSnackbar||helpers_default.a.UI.showSnackbar("Setting Saved Successfully",!1),yield Object(effects.c)({type:UPDATE_SETTING.SUCCESS,response,payload,meta})}catch(error){yield Object(effects.c)({type:UPDATE_SETTING.ERROR,error,meta})}}function*updateMultipleSettings({payload}){try{const response=yield Object(effects.b)(client_api.settings.update,payload);yield Object(effects.c)({type:UPDATE_MULTIPLE_SETTINGS.SUCCESS,response}),helpers_default.a.UI.showSnackbar("Setting saved successfully.",!1),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){helpers_default.a.UI.showSnackbar(error,!0),yield Object(effects.c)({type:UPDATE_MULTIPLE_SETTINGS.ERROR,error})}}function*updateColorScheme({payload}){try{const response=yield Object(effects.b)(client_api.settings.update,payload);yield Object(effects.c)({type:UPDATE_COLORSCHEME.SUCCESS,response}),helpers_default.a.UI.showSnackbar("Setting saved successfully. Reloading...",!1),setTimeout(function(){window.location.reload()},1e3)}catch(error){helpers_default.a.UI.showSnackbar(error,!0),yield Object(effects.c)({type:UPDATE_MULTIPLE_SETTINGS.ERROR,error})}}function*checkMongoDBTools({payload}){try{const response=yield Object(effects.b)(client_api.settings.hasMongoDBTools,payload);yield Object(effects.c)({type:FETCH_MONGODB_TOOLS.SUCCESS,response})}catch(error){yield Object(effects.c)({type:FETCH_MONGODB_TOOLS.ERROR,error})}}function*fetchBackups(){try{const response=yield Object(effects.b)(client_api.settings.fetchBackups);yield Object(effects.c)({type:FETCH_BACKUPS.SUCCESS,response})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_BACKUPS.ERROR,error})}}function*backupNow(){try{yield Object(effects.c)({type:BACKUP_NOW.PENDING});const response=yield Object(effects.b)(client_api.settings.backupNow);yield Object(effects.c)({type:BACKUP_NOW.SUCCESS,response}),yield Object(effects.c)({type:FETCH_BACKUPS.ACTION}),helpers_default.a.UI.showSnackbar("Backup completed successfully")}catch(error){if(!error.response)return logger.error(error);const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:BACKUP_NOW.ERROR,error})}}function*fetchDeletedTickets(){try{yield Object(effects.c)({type:FETCH_DELETED_TICKETS.PENDING});const response=yield Object(effects.b)(client_api.settings.fetchDeletedTickets);yield Object(effects.c)({type:FETCH_DELETED_TICKETS.SUCCESS,response})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_DELETED_TICKETS.ERROR,error})}}function*restoreDeletedTicket({payload}){try{const response=yield Object(effects.b)(client_api.settings.restoreDeletedTicket,payload);yield Object(effects.c)({type:RESTORE_DELETED_TICKET.SUCCESS,response,payload}),helpers_default.a.UI.showSnackbar("Ticket Restored")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:RESTORE_DELETED_TICKET.ERROR,error})}}function*updateRoleOrder({payload}){try{const response=yield Object(effects.b)(client_api.settings.updateRoleOrder,payload);yield Object(effects.c)({type:UPDATE_ROLE_ORDER.SUCCESS,response})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_ROLE_ORDER.ERROR,error})}}function*updatePermissions({payload}){try{yield Object(effects.c)({type:UPDATE_PERMISSIONS.PENDING});const response=yield Object(effects.b)(client_api.settings.updatePermissions,payload);yield Object(effects.c)({type:UPDATE_PERMISSIONS.SUCCESS,response}),helpers_default.a.UI.showSnackbar("Updated Role. Flushing Permissions...")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_PERMISSIONS.ERROR,error})}}function*createRole({payload}){try{const response=yield Object(effects.b)(client_api.settings.createRole,payload);yield Object(effects.c)({type:CREATE_ROLE.SUCCESS,response}),yield Object(effects.c)({type:FETCH_ROLES.ACTION}),yield Object(effects.c)({type:HIDE_MODAL})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_ROLE.ERROR,error})}}function*deleteRole({payload}){try{const response=yield Object(effects.b)(client_api.settings.deleteRole,payload);yield Object(effects.c)({type:DELETE_ROLE.SUCCESS,response}),yield Object(effects.c)({type:FETCH_ROLES.ACTION}),yield Object(effects.c)({type:HIDE_MODAL}),helpers_default.a.UI.showSnackbar("Role successfully deleted")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_ROLE.ERROR,error})}}function*settingsWatcher(){yield Object(effects.f)(FETCH_SETTINGS.ACTION,fetchFlow),yield Object(effects.f)(UPDATE_SETTING.ACTION,updateSetting),yield Object(effects.f)(UPDATE_MULTIPLE_SETTINGS.ACTION,updateMultipleSettings),yield Object(effects.f)(UPDATE_COLORSCHEME.ACTION,updateColorScheme),yield Object(effects.f)(FETCH_MONGODB_TOOLS.ACTION,checkMongoDBTools),yield Object(effects.f)(FETCH_BACKUPS.ACTION,fetchBackups),yield Object(effects.f)(BACKUP_NOW.ACTION,backupNow),yield Object(effects.f)(FETCH_DELETED_TICKETS.ACTION,fetchDeletedTickets),yield Object(effects.f)(RESTORE_DELETED_TICKET.ACTION,restoreDeletedTicket),yield Object(effects.f)(UPDATE_ROLE_ORDER.ACTION,updateRoleOrder),yield Object(effects.f)(UPDATE_PERMISSIONS.ACTION,updatePermissions),yield Object(effects.f)(CREATE_ROLE.ACTION,createRole),yield Object(effects.f)(DELETE_ROLE.ACTION,deleteRole)}const getSessionUser=state=>state.shared.sessionUser;function*fetchTickets({payload}){yield Object(effects.c)({type:FETCH_TICKETS.PENDING,payload});try{let response=null;response="search"===payload.type?yield Object(effects.b)(client_api.tickets.search,payload):yield Object(effects.b)(client_api.tickets.getWithPage,payload),yield Object(effects.c)({type:FETCH_TICKETS.SUCCESS,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_TICKETS.ERROR,error}),logger.error(errorText,error)}}function*createTicket({payload}){try{const response=yield Object(effects.b)(client_api.tickets.create,payload),sessionUser=yield Object(effects.d)(getSessionUser);yield Object(effects.c)({type:CREATE_TICKET.SUCCESS,response,sessionUser}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:CREATE_TICKET.ERROR,error})}}function*deleteTicket({payload}){try{const response=yield Object(effects.b)(client_api.tickets.delete,payload);yield Object(effects.c)({type:DELETE_TICKET.SUCCESS,payload,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_TICKET.ERROR,error}),logger.error(errorText,error)}}function*unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_TICKETS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*ticketUpdated({payload}){try{const sessionUser=yield Object(effects.d)(getSessionUser);yield Object(effects.c)({type:TICKET_UPDATED.SUCCESS,payload,sessionUser})}catch(error){logger.error(error)}}function*ticketEvent({payload}){try{const sessionUser=yield Object(effects.d)(getSessionUser);yield Object(effects.c)({type:TICKET_EVENT.SUCCESS,payload,sessionUser})}catch(error){logger.error(error)}}function*createTicketType({payload}){try{const response=yield Object(effects.b)(client_api.tickets.createTicketType,payload);yield Object(effects.c)({type:CREATE_TICKET_TYPE.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:CREATE_TICKET_TYPE.ERROR,error})}}function*deleteTicketType({payload}){try{const response=yield Object(effects.b)(client_api.tickets.deleteTicketType,payload);yield Object(effects.c)({type:DELETE_TICKET_TYPE.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:DELETE_TICKET_TYPE.ERROR,error})}}function*getTagsWithPage({payload}){try{const response=yield Object(effects.b)(client_api.tickets.getTagsWithPage,payload);yield Object(effects.c)({type:GET_TAGS_WITH_PAGE.SUCCESS,response})}catch(error){if(!error.response)return logger.error(error);const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:GET_TAGS_WITH_PAGE.ERROR,error})}}function*createPriority({payload}){try{const response=yield Object(effects.b)(client_api.tickets.createPriority,payload);yield Object(effects.c)({type:CREATE_PRIORITY.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:CREATE_PRIORITY.ERROR,error})}}function*updatePriority({payload}){try{const response=yield Object(effects.b)(client_api.tickets.updatePriority,payload);yield Object(effects.c)({type:UPDATE_PRIORITY.SUCCESS,response}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_PRIORITY.ERROR,error})}}function*deletePriority({payload}){try{const response=yield Object(effects.b)(client_api.tickets.deletePriority,payload);yield Object(effects.c)({type:DELETE_PRIORITY.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),yield Object(effects.c)({type:FETCH_SETTINGS.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response),yield Object(effects.c)({type:DELETE_PRIORITY.ERROR,error})}}function*createTag({payload}){try{const response=yield Object(effects.b)(client_api.tickets.createTag,{name:payload.name});yield Object(effects.c)({type:CREATE_TAG.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),Object(lodash.isUndefined)(payload.currentPage)||(yield Object(effects.c)({type:GET_TAGS_WITH_PAGE.ACTION,payload:{limit:16,page:payload.currentPage}})),helpers_default.a.UI.showSnackbar(`Tag ${payload.name} successfully created`)}catch(error){if(!error.response)return logger.error(error);const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_TAG.ERROR,error})}}function*tickets_watcher(){yield Object(effects.f)(FETCH_TICKETS.ACTION,fetchTickets),yield Object(effects.f)(CREATE_TICKET.ACTION,createTicket),yield Object(effects.e)(DELETE_TICKET.ACTION,deleteTicket),yield Object(effects.f)(UNLOAD_TICKETS.ACTION,unloadThunk),yield Object(effects.e)(TICKET_UPDATED.ACTION,ticketUpdated),yield Object(effects.e)(TICKET_EVENT.ACTION,ticketEvent),yield Object(effects.f)(CREATE_TICKET_TYPE.ACTION,createTicketType),yield Object(effects.f)(DELETE_TICKET_TYPE.ACTION,deleteTicketType),yield Object(effects.f)(CREATE_PRIORITY.ACTION,createPriority),yield Object(effects.f)(UPDATE_PRIORITY.ACTION,updatePriority),yield Object(effects.f)(DELETE_PRIORITY.ACTION,deletePriority),yield Object(effects.f)(GET_TAGS_WITH_PAGE.ACTION,getTagsWithPage),yield Object(effects.f)(CREATE_TAG.ACTION,createTag)}function*fetchAccounts({payload,meta}){yield Object(effects.c)({type:FETCH_ACCOUNTS.PENDING});try{const response=yield Object(effects.b)(client_api.accounts.getWithPage,payload);yield Object(effects.c)({type:FETCH_ACCOUNTS.SUCCESS,payload:{response,payload},meta})}catch(error){let errorText="";error.response&&(errorText=error.response.data.error),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:FETCH_ACCOUNTS.ERROR,error})}}function*fetchAccountsCreateTicket({payload,meta}){try{const response=yield Object(effects.b)(client_api.accounts.getWithPage,payload);yield Object(effects.c)({type:FETCH_ACCOUNTS_CREATE_TICKET.SUCCESS,payload:{response,payload},meta})}catch(error){const errorText=error.response?error.response.data.error:error;error.response&&401!==error.response.status&&(logger.error(errorText,error),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0)),yield Object(effects.c)({type:FETCH_ACCOUNTS_CREATE_TICKET.ERROR,error})}}function*createAccount({payload}){try{const response=yield Object(effects.b)(client_api.accounts.create,payload);yield Object(effects.c)({type:CREATE_ACCOUNT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),helpers_default.a.UI.showSnackbar("Account created successfully")}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:CREATE_ACCOUNT.ERROR,error})}}function*saveEditAccount({payload}){try{const response=yield Object(effects.b)(client_api.accounts.updateUser,payload);yield Object(effects.c)({type:SAVE_EDIT_ACCOUNT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION}),helpers_default.a.UI.showSnackbar("Account updated successfully")}catch(error){let errorText="";error.response&&(errorText=error.response.data.error),helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:SAVE_EDIT_ACCOUNT.ERROR,error})}}function*deleteAccount({payload}){try{yield Object(effects.c)({type:DELETE_ACCOUNT.PENDING,payload});const response=yield Object(effects.b)(client_api.accounts.deleteAccount,payload);yield Object(effects.c)({type:DELETE_ACCOUNT.SUCCESS,response,payload}),response.disabled?helpers_default.a.UI.showSnackbar("Account is linked to existing tickets. Account Disabled"):helpers_default.a.UI.showSnackbar("Account deleted successfully")}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:DELETE_ACCOUNT.ERROR,error})}}function*enableAccount({payload}){try{const response=yield Object(effects.b)(client_api.accounts.enableAccount,payload);yield Object(effects.c)({type:ENABLE_ACCOUNT.SUCCESS,response,payload}),helpers_default.a.UI.showSnackbar("Account has been enabled")}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error.response||error),yield Object(effects.c)({type:ENABLE_ACCOUNT.ERROR,error})}}function*accounts_unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_ACCOUNTS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*accounts_watcher(){yield Object(effects.f)(CREATE_ACCOUNT.ACTION,createAccount),yield Object(effects.f)(FETCH_ACCOUNTS.ACTION,fetchAccounts),yield Object(effects.f)(FETCH_ACCOUNTS_CREATE_TICKET.ACTION,fetchAccountsCreateTicket),yield Object(effects.f)(SAVE_EDIT_ACCOUNT.ACTION,saveEditAccount),yield Object(effects.e)(DELETE_ACCOUNT.ACTION,deleteAccount),yield Object(effects.e)(ENABLE_ACCOUNT.ACTION,enableAccount),yield Object(effects.f)(UNLOAD_ACCOUNTS.ACTION,accounts_unloadThunk)}function*fetchGroups({payload}){try{const response=yield Object(effects.b)(client_api.groups.get,payload);yield Object(effects.c)({type:FETCH_GROUPS.SUCCESS,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_GROUPS.ERROR,error}),logger.error(errorText,error)}}function*createGroup({payload}){try{const response=yield Object(effects.b)(client_api.groups.create,payload);yield Object(effects.c)({type:CREATE_GROUP.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_GROUP.ERROR,error}),logger.error(errorText,error)}}function*updateGroup({payload}){try{const response=yield Object(effects.b)(client_api.groups.update,payload);yield Object(effects.c)({type:UPDATE_GROUP.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_GROUP.ERROR,error}),logger.error(errorText,error)}}function*deleteGroup({payload,meta}){try{const response=yield Object(effects.b)(client_api.groups.delete,payload);yield Object(effects.c)({type:DELETE_GROUP.SUCCESS,payload,response,meta}),helpers_default.a.UI.showSnackbar("Successfully delete group")}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_GROUP.ERROR,error}),logger.error(errorText,error)}}function*groups_unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_GROUPS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*groups_watcher(){yield Object(effects.f)(FETCH_GROUPS.ACTION,fetchGroups),yield Object(effects.f)(CREATE_GROUP.ACTION,createGroup),yield Object(effects.f)(UPDATE_GROUP.ACTION,updateGroup),yield Object(effects.f)(DELETE_GROUP.ACTION,deleteGroup),yield Object(effects.f)(UNLOAD_GROUPS.ACTION,groups_unloadThunk)}function*fetchTeams({payload,meta}){try{const response=yield Object(effects.b)(client_api.teams.getWithPage,payload);yield Object(effects.c)({type:FETCH_TEAMS.SUCCESS,payload:{response,payload},meta})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error),yield Object(effects.c)({type:FETCH_TEAMS.ERROR,error})}}function*createTeam({payload}){try{const response=yield Object(effects.b)(client_api.teams.create,payload);yield Object(effects.c)({type:CREATE_TEAM.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_TEAM.ERROR,error})}}function*updateTeam({payload}){try{const response=yield Object(effects.b)(client_api.teams.updateTeam,payload);yield Object(effects.c)({type:SAVE_EDIT_TEAM.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL.ACTION})}catch(error){const errorText=error.response.data.error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:SAVE_EDIT_TEAM.ERROR,error})}}function*deleteTeam({payload}){try{const response=yield Object(effects.b)(client_api.teams.deleteTeam,payload);yield Object(effects.c)({type:DELETE_TEAM.SUCCESS,payload,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error),yield Object(effects.c)({type:DELETE_TEAM.ERROR,error})}}function*teams_unloadThunk({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_TEAMS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*teams_watcher(){yield Object(effects.f)(FETCH_TEAMS.ACTION,fetchTeams),yield Object(effects.f)(CREATE_TEAM.ACTION,createTeam),yield Object(effects.f)(SAVE_EDIT_TEAM.ACTION,updateTeam),yield Object(effects.f)(DELETE_TEAM.ACTION,deleteTeam),yield Object(effects.f)(UNLOAD_TEAMS.ACTION,teams_unloadThunk)}function*fetchDepartments({payload}){try{const response=yield Object(effects.b)(client_api.departments.get,payload);yield Object(effects.c)({type:FETCH_DEPARTMENTS.SUCCESS,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),logger.error(errorText,error),yield Object(effects.c)({type:FETCH_DEPARTMENTS.ERROR,error})}}function*createDepartment({payload}){try{const response=yield Object(effects.b)(client_api.departments.create,payload);yield Object(effects.c)({type:CREATE_DEPARTMENT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:CREATE_DEPARTMENT.ERROR,error}),logger.error(errorText,error)}}function*updateDepartment({payload}){try{const response=yield Object(effects.b)(client_api.departments.update,payload);yield Object(effects.c)({type:UPDATE_DEPARTMENT.SUCCESS,response}),yield Object(effects.c)({type:HIDE_MODAL})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:UPDATE_DEPARTMENT.ERROR,error}),logger.error(errorText,error)}}function*deleteDepartment({payload}){try{const response=yield Object(effects.b)(client_api.departments.delete,payload);yield Object(effects.c)({type:DELETE_DEPARTMENT.SUCCESS,payload,response})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:DELETE_DEPARTMENT.ERROR,error}),logger.error(errorText,error)}}function*unloadDepartments({payload,meta}){try{yield Object(effects.c)({type:UNLOAD_DEPARTMENTS.SUCCESS,payload,meta})}catch(error){logger.error(error)}}function*departments_watcher(){yield Object(effects.f)(FETCH_DEPARTMENTS.ACTION,fetchDepartments),yield Object(effects.f)(CREATE_DEPARTMENT.ACTION,createDepartment),yield Object(effects.f)(UPDATE_DEPARTMENT.ACTION,updateDepartment),yield Object(effects.f)(DELETE_DEPARTMENT.ACTION,deleteDepartment),yield Object(effects.f)(UNLOAD_DEPARTMENTS.ACTION,unloadDepartments)}function*fetchSearchResults({payload,meta}){yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.PENDING}),payload.term||(yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.ERROR,error:{message:"Invalid search Term"}}));try{const response=yield Object(effects.b)(client_api.search.search,payload);yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.SUCCESS,response,meta})}catch(error){const errorText=error.response?error.response.data.error:error;helpers_default.a.UI.showSnackbar(`Error: ${errorText}`,!0),yield Object(effects.c)({type:FETCH_SEARCH_RESULTS.ERROR,error}),logger.error(errorText,error)}}function*unloadSearchResults({payload,meta}){yield Object(effects.c)({type:UNLOAD_SEARCH_RESULTS.SUCCESS,payload,meta})}function*search_watcher(){yield Object(effects.f)(FETCH_SEARCH_RESULTS.ACTION,fetchSearchResults),yield Object(effects.f)(UNLOAD_SEARCH_RESULTS.ACTION,unloadSearchResults)}var prop_types=__webpack_require__(51),prop_types_default=__webpack_require__.n(prop_types),index_module=__webpack_require__(55),mobx_module=__webpack_require__(53),clsx_m=__webpack_require__(78),createAction=__webpack_require__(526);const showModal=Object(createAction.a)(SHOW_MODAL.ACTION,(modalType,modalProps)=>({modalType,modalProps})),hideModal=Object(createAction.a)(HIDE_MODAL.ACTION),clearModal=Object(createAction.a)(CLEAR_MODAL.ACTION),common_showNotice=Object(createAction.a)(SHOW_NOTICE.ACTION),clearNotice=Object(createAction.a)(CLEAR_NOTICE.ACTION),common_fetchRoles=Object(createAction.a)(FETCH_ROLES.ACTION),common_updateRoleOrder=Object(createAction.a)(UPDATE_ROLE_ORDER.ACTION);function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _defineProperties(target,props){for(var i=0;i'),li=null;if(isArray_default()(this.props.children))for(var i=0;i"):(this.props.children[i].props.hasSeperator&&ul.append("
    "),li=jquery_default()('
  • '+this.props.children[i].props.text+"
  • "),ul.append(li)));else{if("NavSeperator"===this.props.children.type.name)return;li=jquery_default()('
  • '+this.props.children.props.text+"
  • "),ul.append(li)}$sideBarToRight.append(ul),helpers_default.a.UI.setupSidebarTether(),jquery_default()("body").ajaxify()}}},{key:"render",value:function(){return react_default.a.createElement("ul",{id:"side-nav-accordion-"+this.props.id,className:"side-nav-sub side-nav-accordion"+(!0===this.props.subMenuOpen?" subMenuOpen":"")},this.props.children)}}])&&Submenu_defineProperties(Constructor.prototype,protoProps),staticProps&&Submenu_defineProperties(Constructor,staticProps),Submenu}();Submenu_Submenu.propTypes={id:prop_types_default.a.string.isRequired,subMenuOpen:prop_types_default.a.bool,children:prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.node),prop_types_default.a.node]).isRequired};var Nav_Submenu=Submenu_Submenu;function SubmenuItem_typeof(obj){return(SubmenuItem_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function SubmenuItem_defineProperties(target,props){for(var i=0;i({activeItem:values.activeItem,activeSubItem:values.activeSubItem,sessionUser:values.sessionUser}));function Sidebar_typeof(obj){return(Sidebar_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Sidebar_defineProperties(target,props){for(var i=0;i0,subMenuTarget:"plugins",active:"plugins"===activeItem},plugins&&plugins.length>0&&react_default.a.createElement(Nav_Submenu,{id:"plugins",subMenuOpen:"plugins"===activeItem},plugins.map(function(item){if(-1!==item.permissions.split(" ").indexOf(sessionUser.role))return react_default.a.createElement(Nav_SubmenuItem,{key:item.name,text:item.menu.main.name,icon:item.menu.main.icon,href:item.menu.main.link,active:activeSubItem===item.name})})))}},{key:"render",value:function(){var _this$props=this.props,activeItem=_this$props.activeItem,activeSubItem=_this$props.activeSubItem,sessionUser=_this$props.sessionUser;return react_default.a.createElement("ul",{className:"side-nav"},sessionUser&&helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement(SidebarItem,{text:"Dashboard",icon:"dashboard",href:"/dashboard",class:"navHome",active:"dashboard"===activeItem}),sessionUser&&helpers_default.a.canUser("tickets:view")&&react_default.a.createElement(SidebarItem,{text:"Tickets",icon:"assignment",href:"/tickets",class:"navTickets no-ajaxy",hasSubmenu:!0,subMenuTarget:"tickets",active:"tickets"===activeItem},react_default.a.createElement(Nav_Submenu,{id:"tickets"},react_default.a.createElement(Nav_SubmenuItem,{text:"Active",icon:"timer",href:"/tickets/active",active:"tickets-active"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Assigned",icon:"assignment_ind",href:"/tickets/assigned",active:"tickets-assigned"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Unassigned",icon:"person_add_disabled",href:"/tickets/unassigned",active:"tickets-unassigned"===activeSubItem}),react_default.a.createElement(Nav_NavSeperator,null),react_default.a.createElement(Nav_SubmenuItem,{text:"New",icon:"",href:"/tickets/new",active:"tickets-new"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Pending",icon:"",href:"/tickets/pending",active:"tickets-pending"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Open",icon:"",href:"/tickets/open",active:"tickets-open"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Closed",icon:"",href:"/tickets/closed",active:"tickets-closed"===activeSubItem}))),react_default.a.createElement(SidebarItem,{text:"Messages",icon:"chat",href:"/messages",class:"navMessages",active:"messages"===activeItem}),sessionUser&&helpers_default.a.canUser("accounts:view")&&react_default.a.createElement(SidebarItem,{text:"Accounts",icon:"",href:"/accounts",class:"navAccounts",active:"accounts"===activeItem,subMenuTarget:"accounts",hasSubmenu:sessionUser&&helpers_default.a.canUser("agent:*",!0)},sessionUser&&helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement(Nav_Submenu,{id:"accounts"},react_default.a.createElement(Nav_SubmenuItem,{href:"/accounts/customers",text:"Customers",icon:"account_box",active:"accounts-customers"===activeSubItem}),sessionUser&&helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement(Nav_SubmenuItem,{href:"/accounts/agents",text:"Agents",icon:"account_circle",active:"accounts-agents"===activeSubItem}),sessionUser&&helpers_default.a.canUser("admin:*")&&react_default.a.createElement(Nav_SubmenuItem,{href:"/accounts/admins",text:"Admins",icon:"how_to_reg",active:"accounts-admins"===activeSubItem}))),sessionUser&&helpers_default.a.canUser("groups:view")&&react_default.a.createElement(SidebarItem,{text:"Customer Groups",icon:"supervisor_account",href:"/groups",class:"navGroups",active:"groups"===activeItem}),sessionUser&&helpers_default.a.canUser("teams:view")&&react_default.a.createElement(SidebarItem,{text:"Teams",icon:"wc",href:"/teams",class:"navTeams",active:"teams"===activeItem}),sessionUser&&helpers_default.a.canUser("departments:view")&&react_default.a.createElement(SidebarItem,{text:"Departments",icon:"domain",href:"/departments",class:"navTeams",active:"departments"===activeItem}),sessionUser&&helpers_default.a.canUser("reports:view")&&react_default.a.createElement(SidebarItem,{text:"Reports",icon:"assessment",href:"/reports/generate",class:"navReports no-ajaxy",hasSubmenu:!0,subMenuTarget:"reports",active:"reports"===activeItem},react_default.a.createElement(Nav_Submenu,{id:"reports"},react_default.a.createElement(Nav_SubmenuItem,{text:"Generate",icon:"timeline",href:"/reports/generate",active:"reports-generate"===activeSubItem}),react_default.a.createElement(Nav_NavSeperator,null),react_default.a.createElement(Nav_SubmenuItem,{text:"Group Breakdown",icon:"supervisor_account",href:"/reports/breakdown/group",active:"reports-breakdown-group"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"User Breakdown",icon:"perm_identity",href:"/reports/breakdown/user",active:"reports-breakdown-user"===activeSubItem}))),sessionUser&&helpers_default.a.canUser("notices:view")&&react_default.a.createElement(SidebarItem,{text:"Notices",icon:"warning",href:"/notices",class:"navNotices",active:"notices"===activeItem}),sessionUser&&helpers_default.a.canUser("settings:edit")&&react_default.a.createElement(SidebarItem,{text:"Settings",icon:"settings",href:"/settings/general",class:"navSettings no-ajaxy",hasSubmenu:!0,subMenuTarget:"settings",active:"settings"===activeItem},react_default.a.createElement(Nav_Submenu,{id:"settings"},react_default.a.createElement(Nav_SubmenuItem,{text:"General",icon:"tune",href:"/settings",active:"settings-general"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Appearance",icon:"style",href:"/settings/appearance",active:"settings-appearance"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Tickets",icon:"assignment",href:"/settings/tickets",active:"settings-tickets"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Permissions",icon:"security",href:"/settings/permissions",active:"settings-permissions"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Mailer",icon:"email",href:"/settings/mailer",active:"settings-mailer"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{href:"/settings/elasticsearch",text:"Elasticsearch",icon:"search",active:"settings-elasticsearch"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Push Service",icon:"mobile_friendly",href:"/settings/tps",active:"settings-tps"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Backup/Restore",icon:"archive",href:"/settings/backup",active:"settings-backup"===activeSubItem}),react_default.a.createElement(Nav_SubmenuItem,{text:"Legal",icon:"gavel",href:"/settings/legal",active:"settings-legal"===activeSubItem}),sessionUser&&helpers_default.a.canUser("settings:logs")&&react_default.a.createElement(Nav_SubmenuItem,{text:"Logs",icon:"remove_from_queue",href:"/settings/logs",hasSeperator:!0,active:"settings-logs"===activeSubItem}))),react_default.a.createElement(Nav_NavSeperator,null),react_default.a.createElement(SidebarItem,{href:"/about",icon:"help",text:"About",active:"about"===activeItem}),react_default.a.createElement(SidebarItem,{href:"https://www.trudesk.io",icon:"cloud",text:"Cloud",target:"_blank"}))}}])&&Sidebar_defineProperties(Constructor.prototype,protoProps),staticProps&&Sidebar_defineProperties(Constructor,staticProps),Sidebar}();Sidebar_Sidebar.propTypes={updateNavChange:prop_types_default.a.func.isRequired,activeItem:prop_types_default.a.string.isRequired,activeSubItem:prop_types_default.a.string.isRequired,sessionUser:prop_types_default.a.object,plugins:prop_types_default.a.array};var Nav_Sidebar=Object(es.b)(function(state){return{activeItem:state.sidebar.activeItem,activeSubItem:state.sidebar.activeSubItem,sessionUser:state.shared.sessionUser}},{updateNavChange})(Sidebar_Sidebar);function Button_typeof(obj){return(Button_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Button_defineProperties(target,props){for(var i=0;ipayload,()=>({thunk:!0})),tickets_ticketEvent=Object(createAction.a)(TICKET_EVENT.ACTION),tickets_createTicketType=Object(createAction.a)(CREATE_TICKET_TYPE.ACTION,input=>({name:input.name})),tickets_deleteTicketType=(Object(createAction.a)(RENAME_TICKET_TYPE.ACTION,input=>({name:input.name})),Object(createAction.a)(DELETE_TICKET_TYPE.ACTION,(id,newTypeId)=>({id,newTypeId}))),tickets_createPriority=Object(createAction.a)(CREATE_PRIORITY.ACTION,({name,overdueIn,htmlColor})=>({name,overdueIn,htmlColor})),tickets_updatePriority=Object(createAction.a)(UPDATE_PRIORITY.ACTION,({id,name,overdueIn,htmlColor})=>({id,name,overdueIn,htmlColor})),tickets_deletePriority=Object(createAction.a)(DELETE_PRIORITY.ACTION,({id,newPriority})=>({id,newPriority})),tickets_getTagsWithPage=Object(createAction.a)(GET_TAGS_WITH_PAGE.ACTION,({limit,page})=>({limit,page})),tagsUpdateCurrentPage=Object(createAction.a)(TAGS_UPDATE_CURRENT_PAGE.ACTION,currentPage=>({currentPage})),tickets_createTag=Object(createAction.a)(CREATE_TAG.ACTION,({name,currentPage})=>({name,currentPage}));function CreateTicketTypeModal_typeof(obj){return(CreateTicketTypeModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateTicketTypeModal_extends(){return(CreateTicketTypeModal_extends=Object.assign||function(target){for(var i=1;ipayload,()=>({thunk:!0})),groups_createGroup=Object(createAction.a)(CREATE_GROUP.ACTION),groups_updateGroup=Object(createAction.a)(UPDATE_GROUP.ACTION),groups_deleteGroup=Object(createAction.a)(DELETE_GROUP.ACTION,payload=>payload,()=>({thunk:!0})),unloadGroups=Object(createAction.a)(UNLOAD_GROUPS.ACTION,payload=>payload,()=>({thunk:!0})),accounts_fetchAccounts=Object(createAction.a)(FETCH_ACCOUNTS.ACTION,payload=>payload,()=>({thunk:!0})),accounts_fetchAccountsCreateTicket=Object(createAction.a)(FETCH_ACCOUNTS_CREATE_TICKET.ACTION,payload=>payload,()=>({thunk:!0})),accounts_createAccount=Object(createAction.a)(CREATE_ACCOUNT.ACTION),accounts_saveEditAccount=Object(createAction.a)(SAVE_EDIT_ACCOUNT.ACTION),accounts_deleteAccount=Object(createAction.a)(DELETE_ACCOUNT.ACTION),accounts_enableAccount=Object(createAction.a)(ENABLE_ACCOUNT.ACTION),unloadAccounts=Object(createAction.a)(UNLOAD_ACCOUNTS.ACTION,payload=>payload,()=>({thunk:!0}));function FilterTicketsModal_typeof(obj){return(FilterTicketsModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function FilterTicketsModal_defineProperties(target,props){for(var i=0;i({name:input.name,value:input.value,stateName:input.stateName,noSnackbar:!!input.noSnackbar&&input.noSnackbar}),()=>({thunk:!0})),settings_updateMultipleSettings=Object(createAction.a)(UPDATE_MULTIPLE_SETTINGS.ACTION),settings_updateColorScheme=Object(createAction.a)(UPDATE_COLORSCHEME.ACTION),fetchMongoDBTools=Object(createAction.a)(FETCH_MONGODB_TOOLS.ACTION),settings_fetchBackups=Object(createAction.a)(FETCH_BACKUPS.ACTION),settings_backupNow=Object(createAction.a)(BACKUP_NOW.ACTION),settings_fetchDeletedTickets=Object(createAction.a)(FETCH_DELETED_TICKETS.ACTION),settings_restoreDeletedTicket=Object(createAction.a)(RESTORE_DELETED_TICKET.ACTION),changeDeletedTicketsPage=Object(createAction.a)(CHANGE_DELETED_TICKETS_PAGE.ACTION,pageIndex=>({pageIndex})),settings_createRole=Object(createAction.a)(CREATE_ROLE.ACTION),settings_updatePermissions=Object(createAction.a)(UPDATE_PERMISSIONS.ACTION),settings_deleteRole=Object(createAction.a)(DELETE_ROLE.ACTION);function AddPriorityToTypeModal_typeof(obj){return(AddPriorityToTypeModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function AddPriorityToTypeModal_defineProperties(target,props){for(var i=0;i0&&velocity_min_default()($check,{opacity:1},{delay:360,duration:200,begin:function(){$check.show()}}),_this.props.fetchSettings()}).catch(function(error){var errorText=error.response.data.error;logger.error(errorText,error.response),helpers_default.a.UI.showSnackbar("Error: ".concat(errorText),!0)})}},{key:"render",value:function(){var _this2=this,type=this.props.type;return react_default.a.createElement(Modals_BaseModal,null,react_default.a.createElement("form",{className:"uk-form-stacked"},react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("h2",null,"Add Priorities"),react_default.a.createElement("span",null,"Please select the priorities you wish to add to type: ",type.get("name"))),react_default.a.createElement("div",{className:"priority-loop zone"},this.getPriorities().map(function(priority){return some_default()(type.get("priorities").toJS(),priority.toObject())?react_default.a.createElement("div",{key:priority.get("_id"),className:"z-box uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h5",{style:{color:priority.get("htmlColor"),fontWeight:"bold"}},priority.get("name")),react_default.a.createElement("p",{className:"uk-text-muted"},"SLA Overdue: ",react_default.a.createElement("strong",null,priority.get("durationFormatted")))),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("i",{className:"material-icons uk-text-success mt-10 mr-15",style:{fontSize:"28px"}},"check"))):react_default.a.createElement("div",{key:priority.get("_id"),className:"z-box uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h5",{style:{color:priority.get("htmlColor"),fontWeight:"bold"}},priority.get("name")),react_default.a.createElement("p",{className:"uk-text-muted"},"SLA Overdue: ",react_default.a.createElement("strong",null,priority.get("durationFormatted")))),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("a",{type:"button",className:"uk-button uk-button-success mt-10 mr-10 no-ajaxy",onClick:function(e){return _this2.onAddClick(e,type,priority)}},"Add"),react_default.a.createElement("i",{className:"material-icons uk-text-success mt-10 mr-15",style:{display:"none",opacity:0,fontSize:"28px"}},"check")))})),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{type:"button",flat:!0,waves:!0,text:"Close",extraClass:"uk-modal-close"}))))}}])&&AddPriorityToTypeModal_defineProperties(Constructor.prototype,protoProps),staticProps&&AddPriorityToTypeModal_defineProperties(Constructor,staticProps),AddPriorityToTypeModal}();AddPriorityToTypeModal_AddPriorityToTypeModal.propTypes={settings:prop_types_default.a.object.isRequired,type:prop_types_default.a.object.isRequired,fetchSettings:prop_types_default.a.func.isRequired};var Modals_AddPriorityToTypeModal=Object(es.b)(function(state){return{settings:state.settings.settings}},{fetchSettings:settings_fetchSettings})(AddPriorityToTypeModal_AddPriorityToTypeModal);function ColorSelector_typeof(obj){return(ColorSelector_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function ColorSelector_defineProperties(target,props){for(var i=0;i=128?"#444":"#f7f8fa"}}],(protoProps=[{key:"componentDidMount",value:function(){helpers_default.a.UI.inputs(),this.setState({selectedColor:this.props.defaultColor},this.updateColorButton)}},{key:"componentDidUpdate",value:function(prevProps){this.props.defaultColor!==prevProps.defaultColor&&this.setState({selectedColor:this.props.defaultColor},this.updateColorButton)}},{key:"generateRandomColor",value:function(event){var _this2=this;if(event.preventDefault(),jquery_default()(event.target).length>0){var color=ColorSelector.getRandomColor();this.props.onChange&&(event.target.value=color,this.props.onChange(event)),this.setState({selectedColor:color},function(){_this2.updateColorButton()})}}},{key:"updateColorButton",value:function(){var fgColor=ColorSelector.getContrast(this.state.selectedColor.substring(1));jquery_default()(this.colorButton).css({background:this.state.selectedColor,color:fgColor})}},{key:"onInputValueChange",value:function(e){var val=e.target.value;this.props.onChange&&this.props.onChange(e),this.setState({selectedColor:val},this.updateColorButton)}},{key:"revertColor",value:function(){this.setState({selectedColor:this.props.defaultColor},this.updateColorButton)}},{key:"render",value:function(){var _this3=this;return react_default.a.createElement("div",{className:this.props.parentClass},react_default.a.createElement("div",{className:"uk-float-left uk-width-1-4"},react_default.a.createElement("button",{ref:function(colorButton){_this3.colorButton=colorButton},className:"uk-button uk-button-small uk-color-button mr-5 mt-10",style:{float:"right"},onClick:function(e){_this3.generateRandomColor(e)}},react_default.a.createElement("i",{className:"material-icons"},"refresh"))),react_default.a.createElement("div",{className:"md-input-wrapper uk-float-left md-input-filled",style:{width:this.props.hideRevert?"70%":"50%"}},react_default.a.createElement("label",null,"Color"),this.props.validationEnabled&&react_default.a.createElement("input",{name:this.props.inputName?this.props.inputName:"",type:"text",className:"md-input",value:this.state.selectedColor,onChange:function(e){_this3.onInputValueChange(e)},"data-validation":"custom","data-validation-regexp":"^\\#([0-9a-fA-F]){3,6}$","data-validation-error-msg":"Invalid HEX Color"}),!this.props.validationEnabled&&react_default.a.createElement("input",{name:this.props.inputName?this.props.inputName:"",type:"text",className:"md-input",value:this.state.selectedColor,onChange:function(e){_this3.onInputValueChange(e)}}),react_default.a.createElement("div",{className:"md-input-bar"})),!this.props.hideRevert&&react_default.a.createElement("button",{className:"md-btn md-btn-small md-btn-flat mt-10 uk-float-right uk-width-1-4",onClick:function(){_this3.revertColor()}},"Revert"))}}])&&ColorSelector_defineProperties(Constructor.prototype,protoProps),staticProps&&ColorSelector_defineProperties(Constructor,staticProps),ColorSelector}();ColorSelector_ColorSelector.propTypes={inputName:prop_types_default.a.string,defaultColor:prop_types_default.a.string.isRequired,hideRevert:prop_types_default.a.bool,parentClass:prop_types_default.a.string,onChange:prop_types_default.a.func,validationEnabled:prop_types_default.a.bool},ColorSelector_ColorSelector.defaultProps={defaultColor:"#878982",hideRevert:!1,validationEnabled:!1};var CreatePriorityModal_class,CreatePriorityModal_class2,CreatePriorityModal_descriptor,CreatePriorityModal_descriptor2,CreatePriorityModal_descriptor3,components_ColorSelector=ColorSelector_ColorSelector;function CreatePriorityModal_typeof(obj){return(CreatePriorityModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreatePriorityModal_extends(){return(CreatePriorityModal_extends=Object.assign||function(target){for(var i=1;i0&&jquery_default()(this.select).val(this.props.currentTags),jquery_default()(this.select).trigger("chosen:updated")}},{key:"onSubmit",value:function(e){var _this=this;e.preventDefault();var selectedTags=jquery_default()(e.target.tags).val();selectedTags||(selectedTags=[]),axios_default.a.put("/api/v1/tickets/".concat(this.props.ticketId),{tags:selectedTags}).then(function(){socket_default.a.ui.refreshTicketTags(_this.props.ticketId),_this.closeButton.click()}).catch(function(error){logger.error(error),helpers_default.a.UI.showSnackbar(error,!0)})}},{key:"render",value:function(){var _this2=this,mappedTags=this.props.tagsSettings.tags&&this.props.tagsSettings.tags.map(function(tag){return{text:tag.get("name"),value:tag.get("_id")}}).toArray();return react_default.a.createElement(Modals_BaseModal,{options:{bgclose:!1}},react_default.a.createElement("div",{className:"uk-clearfix"},react_default.a.createElement("h5",{style:{fontWeight:300}},"Add Tags"),react_default.a.createElement("div",null,react_default.a.createElement("form",{className:"nomargin",onSubmit:function(e){return _this2.onSubmit(e)}},react_default.a.createElement("div",{className:"search-container"},react_default.a.createElement("select",{name:"tags",id:"tags",className:"chosen-select",multiple:!0,"data-placeholder":" ","data-noresults":"No Tags Found for ",ref:function(r){return _this2.select=r}},mappedTags.map(function(tag){return react_default.a.createElement("option",{key:tag.value,value:tag.value},tag.text)})),react_default.a.createElement("button",{type:"button",style:{borderRadius:0}},react_default.a.createElement("i",{className:"material-icons",style:{marginRight:0}},"add"))),react_default.a.createElement("div",{className:"left",style:{marginTop:15}},react_default.a.createElement(components_Button,{type:"button",text:"Clear",small:!0,flat:!0,style:"danger"})),react_default.a.createElement("div",{className:"right",style:{marginTop:15}},react_default.a.createElement(components_Button,{type:"button",text:"Cancel",style:"secondary",small:!0,flat:!0,waves:!0,extraClass:"uk-modal-close",ref:function(r){return _this2.closeButton=r}}),react_default.a.createElement(components_Button,{type:"submit",text:"Save Tags",style:"success",small:!0,waves:!0}))))))}}])&&AddTagsModal_defineProperties(Constructor.prototype,protoProps),staticProps&&AddTagsModal_defineProperties(Constructor,staticProps),AddTagsModal}();AddTagsModal_AddTagsModal.propTypes={ticketId:prop_types_default.a.string.isRequired,currentTags:prop_types_default.a.array,tagsSettings:prop_types_default.a.object.isRequired,getTagsWithPage:prop_types_default.a.func.isRequired};var Modals_AddTagsModal=Object(es.b)(function(state){return{tagsSettings:state.tagsSettings}},{getTagsWithPage:tickets_getTagsWithPage})(AddTagsModal_AddTagsModal);function Grid_typeof(obj){return(Grid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Grid_defineProperties(target,props){for(var i=0;i");attachFileDiv.addClass("attachFileDesc").html("

    Attach images by dragging & dropping or pasting from clipboard.

    "),$el.siblings(".CodeMirror").addClass("hasFileDesc"),$el.siblings(".editor-statusbar").addClass("hasFileDesc").prepend(attachFileDiv)}},{key:"getMdeToolbarItems",value:function(){return[{name:"bold",action:easymde_min_default.a.toggleBold,className:"material-icons mi-bold no-ajaxy",title:"Bold"},{name:"italic",action:easymde_min_default.a.toggleItalic,className:"material-icons mi-italic no-ajaxy",title:"Italic"},{name:"Title",action:easymde_min_default.a.toggleHeadingSmaller,className:"material-icons mi-title no-ajaxy",title:"Title"},"|",{name:"Code",action:easymde_min_default.a.toggleCodeBlock,className:"material-icons mi-code no-ajaxy",title:"Code"},{name:"Quote",action:easymde_min_default.a.toggleBlockquote,className:"material-icons mi-quote no-ajaxy",title:"Quote"},{name:"Generic List",action:easymde_min_default.a.toggleUnorderedList,className:"material-icons mi-list no-ajaxy",title:"Generic List"},{name:"Numbered List",action:easymde_min_default.a.toggleOrderedList,className:"material-icons mi-numlist no-ajaxy",title:"Numbered List"},"|",{name:"Create Link",action:easymde_min_default.a.drawLink,className:"material-icons mi-link no-ajaxy",title:"Create Link"},"|",{name:"Toggle Preview",action:easymde_min_default.a.togglePreview,className:"material-icons mi-preview no-disable no-mobile no-ajaxy",title:"Toggle Preview"}]}}],(protoProps=[{key:"componentDidMount",value:function(){var _this2=this;if(this.easymde=new easymde_min_default.a({element:this.element,forceSync:!0,minHeight:this.props.height,toolbar:EasyMDE.getMdeToolbarItems(),autoDownloadFontAwesome:!1,status:!1,spellChecker:!1}),this.easymde.codemirror.on("change",function(){_this2.onTextareaChanged(_this2.easymde.value())}),this.easymde&&this.props.allowImageUpload){if(!this.props.inlineImageUploadUrl)return logger.error("Invalid inlineImageUploadUrl Prop.");var $el=jquery_default()(this.element);$el.hasClass("hasInlineUpload")||($el.addClass("hasInlineUpload"),window.inlineAttachment.editors.codemirror4.attach(this.easymde.codemirror,{onFileUploadResponse:function(xhr){var result=JSON.parse(xhr.responseText),filename=result[this.settings.jsonFieldName];if(result&&filename){var newValue;newValue="function"==typeof this.settings.urlText?this.settings.urlText.call(this,filename,result):this.settings.urlText.replace(this.filenameTag,filename);var text=this.editor.getValue().replace(this.lastValue,newValue);this.editor.setValue(text),this.settings.onFileUploaded.call(this,filename)}return!1},onFileUploadError:function(xhr){var result=xhr.responseText,text=this.editor.getValue()+" "+result;this.editor.setValue(text)},extraHeaders:this.props.inlineImageUploadHeaders,errorText:"Error uploading file: ",uploadUrl:this.props.inlineImageUploadUrl,jsonFieldName:"filename",urlText:"![Image]({filename})"}),EasyMDE.attachFileDesc(this.element))}}},{key:"componentDidUpdate",value:function(){this.easymde&&this.easymde.value()!==this.state.value&&this.easymde.value(this.state.value)}},{key:"componentWillUnmount",value:function(){this.easymde&&(this.easymde.codemirror.off("change"),this.easymde=null)}},{key:"onTextareaChanged",value:function(value){this.setState({value}),this.props.onChange&&this.props.onChange(value)}},{key:"getEditorText",value:function(){return this.state.value}},{key:"setEditorText",value:function(value){this.setState({value:tomarkdown_default()(value)})}},{key:"render",value:function(){var _this3=this;return setTimeout(function(){_this3.easymde.codemirror.refresh()},250),react_default.a.createElement(react.Fragment,null,react_default.a.createElement("textarea",{ref:function(i){return _this3.element=i},value:this.state.value,onChange:function(e){return _this3.onTextareaChanged(e)}}),this.props.showStatusBar&&react_default.a.createElement("div",{className:"editor-statusbar uk-float-left uk-width-1-1"}))}}])&&EasyMDE_defineProperties(Constructor.prototype,protoProps),staticProps&&EasyMDE_defineProperties(Constructor,staticProps),EasyMDE}();EasyMDE_EasyMDE.propTypes={height:prop_types_default.a.string,value:prop_types_default.a.string,onChange:prop_types_default.a.func,defaultValue:prop_types_default.a.string,allowImageUpload:prop_types_default.a.bool,inlineImageUploadUrl:prop_types_default.a.string,inlineImageUploadHeaders:prop_types_default.a.object,showStatusBar:prop_types_default.a.bool.isRequired},EasyMDE_EasyMDE.defaultProps={height:"150px",allowImageUpload:!1,showStatusBar:!0};var CreateTicketModal_class,CreateTicketModal_class2,CreateTicketModal_descriptor,CreateTicketModal_descriptor2,CreateTicketModal_descriptor3,_descriptor4,components_EasyMDE=EasyMDE_EasyMDE;function CreateTicketModal_typeof(obj){return(CreateTicketModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateTicketModal_extends(){return(CreateTicketModal_extends=Object.assign||function(target){for(var i=1;iPlease enter a valid issue. Issue must contain at least '.concat(minIssueLength," characters"));($mdeError=$issueTextbox.siblings(".editor-statusbar").find(".mde-error")).length<1&&$issueTextbox.siblings(".editor-statusbar").prepend(mdeError)}else{if($errorBorderWrap.css("border","none"),($mdeError=$issueTextbox.parent().find(".mde-error")).length>0&&$mdeError.remove(),!$form.isValid(null,null,!1))return!0;allowAgentUserTickets&&(data.owner=this.ownerSelect.value),data.subject=e.target.subject.value,data.group=this.groupSelect.value,data.type=this.typeSelect.value,data.tags=this.tagSelect.value,data.priority=this.selectedPriority,data.issue=this.issueMde.easymde.value(),data.socketid=socket_default.a.ui.socket.io.engine.id,this.props.createTicket(data)}}}},{key:"onGroupSelectChange",value:function(e){}},{key:"render",value:function(){var _this4=this,_this$props=this.props,shared=_this$props.shared,viewdata=_this$props.viewdata,allowAgentUserTickets=viewdata.ticketSettings.allowAgentUserTickets&&(shared.sessionUser.role.isAdmin||shared.sessionUser.role.isAgent),mappedAccounts=this.props.accounts.map(function(a){return{text:a.get("fullname"),value:a.get("_id")}}).toArray(),mappedGroups=this.props.groups.map(function(grp){return{text:grp.get("name"),value:grp.get("_id")}}).toArray(),mappedTicketTypes=this.props.viewdata.ticketTypes.map(function(type){return{text:type.name,value:type._id}}),mappedTicketTags=this.props.viewdata.ticketTags.map(function(tag){return{text:tag.name,value:tag._id}});return react_default.a.createElement(Modals_BaseModal,CreateTicketModal_extends({},this.props,{options:{bgclose:!1}}),react_default.a.createElement("form",{className:"uk-form-stacked",onSubmit:function(e){return _this4.onFormSubmit(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Subject"),react_default.a.createElement("input",{type:"text",name:"subject",className:"md-input","data-validation":"length","data-validation-length":"min".concat(viewdata.ticketSettings.minSubject),"data-validation-error-msg":"Please enter a valid Subject. Subject must contain at least ".concat(viewdata.ticketSettings.minSubject," characters.")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement(components_Grid,null,allowAgentUserTickets&&react_default.a.createElement(Grid_GridItem,{width:"1-3"},react_default.a.createElement("label",{className:"uk-form-label"},"Owner"),react_default.a.createElement(components_SingleSelect,{showTextbox:!0,items:mappedAccounts,defaultValue:[this.props.viewdata.loggedInAccount._id],width:"100%",ref:function(i){return _this4.ownerSelect=i}})),react_default.a.createElement(Grid_GridItem,{width:allowAgentUserTickets?"2-3":"1-1"},react_default.a.createElement("label",{className:"uk-form-label"},"Group"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,items:mappedGroups,defaultValue:Object(lodash.head)(mappedGroups)?Object(lodash.head)(mappedGroups).value:"",onSelectChange:function(e){return _this4.onGroupSelectChange(e)},width:"100%",ref:function(i){return _this4.groupSelect=i}})))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement(components_Grid,null,react_default.a.createElement(Grid_GridItem,{width:"1-3"},react_default.a.createElement("label",{className:"uk-form-label"},"Type"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,items:mappedTicketTypes,width:"100%",defaultValue:this.props.viewdata.defaultTicketType._id,onSelectChange:function(e){_this4.onTicketTypeSelectChange(e)},ref:function(i){return _this4.typeSelect=i}})),react_default.a.createElement(Grid_GridItem,{width:"2-3"},react_default.a.createElement("label",{className:"uk-form-label"},"Tags"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,items:mappedTicketTags,width:"100%",multiple:!0,ref:function(i){return _this4.tagSelect=i}})))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Priority"),react_default.a.createElement("div",{ref:function(i){return _this4.priorityLoader=i},style:{height:"32px",width:"32px",position:"relative"},className:"hide"},react_default.a.createElement(components_SpinLoader,{style:{background:"transparent"},spinnerStyle:{width:"24px",height:"24px"},active:!0})),react_default.a.createElement("div",{ref:function(i){return _this4.priorityWrapper=i},className:"uk-clearfix"},this.priorities.map(function(priority){return react_default.a.createElement("div",{key:priority._id,className:"uk-float-left"},react_default.a.createElement("span",{className:"icheck-inline"},react_default.a.createElement("input",{id:"p___"+priority._id,name:"priority",type:"radio",className:"with-gap",value:priority._id,onChange:function(e){_this4.onPriorityRadioChange(e)},checked:_this4.selectedPriority===priority._id,"data-md-icheck":!0}),react_default.a.createElement("label",{htmlFor:"p___"+priority._id,className:"mb-10 inline-label"},react_default.a.createElement("span",{className:"uk-badge",style:{backgroundColor:priority.htmlColor}},priority.name))))}))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("span",null,"Description"),react_default.a.createElement("div",{className:"error-border-wrap uk-clearfix"},react_default.a.createElement(components_EasyMDE,{ref:function(i){return _this4.issueMde=i},onChange:function(val){return _this4.issueText=val},allowImageUpload:!0,inlineImageUploadUrl:"/tickets/uploadmdeimage",inlineImageUploadHeaders:{ticketid:"uploads"}})),react_default.a.createElement("span",{style:{marginTop:"6px",display:"inline-block",fontSize:"11px"},className:"uk-text-muted"},"Please try to be as specific as possible. Please include any details you think may be relevant, such as","troubleshooting steps you've taken.")),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{text:"Cancel",flat:!0,waves:!0,extraClass:"uk-modal-close"}),react_default.a.createElement(components_Button,{text:"Create",style:"primary",flat:!0,type:"submit"}))))}}])&&CreateTicketModal_defineProperties(Constructor.prototype,protoProps),staticProps&&CreateTicketModal_defineProperties(Constructor,staticProps),CreateTicketModal}()).prototype,"priorities",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),CreateTicketModal_descriptor2=CreateTicketModal_applyDecoratedDescriptor(CreateTicketModal_class2.prototype,"allAccounts",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.props.accounts||[]}}),CreateTicketModal_descriptor3=CreateTicketModal_applyDecoratedDescriptor(CreateTicketModal_class2.prototype,"groupAccounts",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),_descriptor4=CreateTicketModal_applyDecoratedDescriptor(CreateTicketModal_class2.prototype,"selectedPriority",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateTicketModal_class=CreateTicketModal_class2))||CreateTicketModal_class;CreateTicketModal_CreateTicketModal.propTypes={shared:prop_types_default.a.object.isRequired,viewdata:prop_types_default.a.object.isRequired,accounts:prop_types_default.a.object.isRequired,groups:prop_types_default.a.object.isRequired,createTicket:prop_types_default.a.func.isRequired,fetchGroups:prop_types_default.a.func.isRequired,fetchAccountsCreateTicket:prop_types_default.a.func.isRequired};var CreateRoleModal_class,CreateRoleModal_class2,CreateRoleModal_descriptor,Modals_CreateTicketModal=Object(es.b)(function(state){return{shared:state.shared,viewdata:state.common,groups:state.groupsState.groups,accounts:state.accountsState.accountsCreateTicket}},{createTicket:tickets_createTicket,fetchGroups:groups_fetchGroups,fetchAccountsCreateTicket:accounts_fetchAccountsCreateTicket})(CreateTicketModal_CreateTicketModal);function CreateRoleModal_typeof(obj){return(CreateRoleModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateRoleModal_defineProperties(target,props){for(var i=0;ipayload,()=>({thunk:!0})),teams_createTeam=Object(createAction.a)(CREATE_TEAM.ACTION),saveEditTeam=Object(createAction.a)(SAVE_EDIT_TEAM.ACTION),teams_deleteTeam=Object(createAction.a)(DELETE_TEAM.ACTION),unloadTeams=Object(createAction.a)(UNLOAD_TEAMS.ACTION,payload=>payload,()=>({thunk:!0}));function MultiSelect_typeof(obj){return(MultiSelect_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function MultiSelect_defineProperties(target,props){for(var i=0;i").concat(i.text,""))}),$select.attr("disabled",!1),$select.multiSelect("refresh"),this.props.initialSelected&&($select.multiSelect("select",this.props.initialSelected),$select.multiSelect("refresh"))),$select.attr("disabled",this.props.disabled),$select.multiSelect("refresh")}},{key:"getSelected",value:function(){var $select=jquery_default()(this.select);return $select?$select.val():[]}},{key:"selectAll",value:function(){var $select=jquery_default()(this.select);$select&&this.props.items&&this.props.items.length>0&&($select.multiSelect("select_all"),$select.multiSelect("refresh"))}},{key:"deselectAll",value:function(){var $select=jquery_default()(this.select);$select&&this.props.items&&this.props.items.length>0&&($select.multiSelect("deselect_all"),$select.multiSelect("refresh"))}},{key:"render",value:function(){var _this=this,_this$props=this.props,id=_this$props.id,items=_this$props.items;return react_default.a.createElement("select",{id,multiple:"multiple",className:"multiselect",ref:function(r){return _this.select=r}},items&&items.map(function(item,i){return react_default.a.createElement("option",{key:i,value:item.value},item.text)}))}}])&&MultiSelect_defineProperties(Constructor.prototype,protoProps),staticProps&&MultiSelect_defineProperties(Constructor,staticProps),MultiSelect}();MultiSelect_MultiSelect.propTypes={id:prop_types_default.a.string,items:prop_types_default.a.array.isRequired,initialSelected:prop_types_default.a.array,onChange:prop_types_default.a.func.isRequired,disabled:prop_types_default.a.bool};var CreateAccountModal_class,CreateAccountModal_class2,CreateAccountModal_descriptor,CreateAccountModal_descriptor2,CreateAccountModal_descriptor3,CreateAccountModal_descriptor4,_descriptor5,_descriptor6,_descriptor7,components_MultiSelect=MultiSelect_MultiSelect;function CreateAccountModal_typeof(obj){return(CreateAccountModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateAccountModal_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function CreateAccountModal_defineProperties(target,props){for(var i=0;i1?this.password:void 0,passwordConfirm:this.passwordConfirm.length>1?this.passwordConfirm:void 0};this.props.createAccount(payload)}}},{key:"render",value:function(){var _this3=this,roles=this.props.roles.map(function(role){return{text:role.get("name"),value:role.get("_id")}}).toArray(),groups=this.props.groups.map(function(group){return{text:group.get("name"),value:group.get("_id")}}).toArray(),teams=this.props.teams.map(function(team){return{text:team.get("name"),value:team.get("_id")}}).toArray();return react_default.a.createElement(Modals_BaseModal,{parentExtraClass:"pt-0",extraClass:"p-0 pb-25"},react_default.a.createElement("div",{className:"user-heading",style:{minHeight:"130px",background:"#1976d2",padding:"24px"}},react_default.a.createElement("div",{className:"uk-width-1-1"},react_default.a.createElement("div",{style:{width:"82px",height:"82px",float:"left",marginRight:"24px",position:"relative"}},react_default.a.createElement("div",{className:"mediumProfilePic",style:{position:"relative"}},react_default.a.createElement("img",{src:"/uploads/users/defaultProfile.jpg",alt:"Profile Picture"}))),react_default.a.createElement("div",{className:"user-heading-content"},react_default.a.createElement("h2",null,react_default.a.createElement("span",{className:"uk-text-truncate"},"Create Account"),react_default.a.createElement("span",{className:"sub-heading"},"Please provide account details below"))))),react_default.a.createElement("div",{style:{margin:"24px 24px 0 24px"}},react_default.a.createElement("form",{className:"uk-form-stacked",onSubmit:function(e){return _this3.onFormSubmit(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Username"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.username,onChange:function(e){return _this3.onInputChanged(e,"username")},"data-validation":"length","data-validation-length":"min4","data-validation-error-msg":"Username must contain at least 4 characters."})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Name"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.fullname,onChange:function(e){return _this3.onInputChanged(e,"fullname")},"data-validation":"length","data-validation-length":"min2","data-validation-error-msg":"Name must contain at least 2 characters."})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Title"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.title,onChange:function(e){return _this3.onInputChanged(e,"title")}}))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Password"),react_default.a.createElement("input",{type:"password",className:"md-input",name:"password_confirmation",value:this.password,onChange:function(e){return _this3.onInputChanged(e,"password")},"data-validation":"length","data-validation-length":"min6","data-validation-error-msg":"Password must contain at least 6 characters."})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Confirm Password"),react_default.a.createElement("input",{type:"password",className:"md-input",name:"password",value:this.passwordConfirm,onChange:function(e){return _this3.onInputChanged(e,"passwordConfirm")},"data-validation":"confirmation","data-validation-error-msg":"Password does not match"}))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Email"),react_default.a.createElement("input",{type:"email",className:"md-input",value:this.email,onChange:function(e){return _this3.onInputChanged(e,"email")},"data-validation":"email"})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Role"),react_default.a.createElement(components_SingleSelect,{items:roles,width:"100",showTextbox:!1,onSelectChange:function(e){return _this3.onRoleSelectChange(e)}}),react_default.a.createElement("span",{className:"hide help-block",style:{display:"inline-block",marginTop:"10px",fontWeight:"bold",color:"#d85030"},ref:function(r){return _this3.roleSelectErrorMessage=r}},"Please select a role for this user")),!this.isAgentRole&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Groups"),react_default.a.createElement(components_MultiSelect,{items:groups,onChange:function(e){return _this3.onGroupSelectChange(e)},ref:function(r){return _this3.groupSelect=r}}),react_default.a.createElement("span",{className:"hide help-block",style:{display:"inline-block",marginTop:"3px",fontWeight:"bold",color:"#d85030"},ref:function(r){return _this3.groupSelectErrorMessage=r}},"Please select a group for this user."))),this.isAgentRole&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Teams"),react_default.a.createElement(components_MultiSelect,{items:teams,onChange:function(){},ref:function(r){return _this3.teamSelect=r}}))),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{text:"Close",flat:!0,waves:!0,extraClass:"uk-modal-close"}),react_default.a.createElement(components_Button,{text:"Create Account",flat:!0,waves:!0,style:"success",type:"submit"})))))}}])&&CreateAccountModal_defineProperties(Constructor.prototype,protoProps),staticProps&&CreateAccountModal_defineProperties(Constructor,staticProps),CreateAccountModal}()).prototype,"username",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateAccountModal_descriptor2=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"password",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateAccountModal_descriptor3=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"passwordConfirm",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),CreateAccountModal_descriptor4=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"fullname",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_descriptor5=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"email",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_descriptor6=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"title",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),_descriptor7=CreateAccountModal_applyDecoratedDescriptor(CreateAccountModal_class2.prototype,"isAgentRole",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),CreateAccountModal_class=CreateAccountModal_class2))||CreateAccountModal_class;CreateAccountModal_CreateAccountModal.propTypes={common:prop_types_default.a.object.isRequired,groups:prop_types_default.a.object.isRequired,teams:prop_types_default.a.object.isRequired,roles:prop_types_default.a.object.isRequired,createAccount:prop_types_default.a.func.isRequired,fetchGroups:prop_types_default.a.func.isRequired,unloadGroups:prop_types_default.a.func.isRequired,fetchTeams:prop_types_default.a.func.isRequired,unloadTeams:prop_types_default.a.func.isRequired,fetchRoles:prop_types_default.a.func.isRequired};var Modals_CreateAccountModal=Object(es.b)(function(state){return{roles:state.shared.roles,common:state.common,groups:state.groupsState.groups,teams:state.teamsState.teams}},{createAccount:accounts_createAccount,fetchGroups:groups_fetchGroups,unloadGroups,fetchTeams:teams_fetchTeams,unloadTeams,fetchRoles:common_fetchRoles})(CreateAccountModal_CreateAccountModal);const departments_fetchDepartments=Object(createAction.a)(FETCH_DEPARTMENTS.ACTION,payload=>payload,()=>({thunk:!0})),departments_createDepartment=Object(createAction.a)(CREATE_DEPARTMENT.ACTION),departments_updateDepartment=Object(createAction.a)(UPDATE_DEPARTMENT.ACTION),departments_deleteDepartment=Object(createAction.a)(DELETE_DEPARTMENT.ACTION),departments_unloadDepartments=Object(createAction.a)(UNLOAD_DEPARTMENTS.ACTION,payload=>payload,()=>({thunk:!0}));var EditAccountModal_class,EditAccountModal_class2,EditAccountModal_descriptor,EditAccountModal_descriptor2,EditAccountModal_descriptor3,EditAccountModal_descriptor4,EditAccountModal_descriptor5,EditAccountModal_descriptor6;function EditAccountModal_typeof(obj){return(EditAccountModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function EditAccountModal_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function EditAccountModal_defineProperties(target,props){for(var i=0;i1?this.password:void 0,passwordConfirm:this.confirmPassword.length>1?this.confirmPassword:void 0};this.props.saveEditAccount(data)}}},{key:"render",value:function(){var departments,groups,teams,_this3=this,_this$props=this.props,user=_this$props.user,edit=_this$props.edit,customer=!this.isAgentRole,profilePicture=user.image||"defaultProfile.jpg",roles=helpers_default.a.getRolesByHierarchy().map(function(role){return{text:role.name,value:role._id}});return teams=this.props.teams?this.props.teams.map(function(team){return{text:team.get("name"),value:team.get("_id")}}).toArray():[],departments=this.props.departments?this.props.departments.map(function(department){return{text:department.get("name"),value:department.get("_id")}}).toArray():[],groups=this.props.groups?this.props.groups.map(function(group){return{text:group.get("name"),value:group.get("_id")}}).toArray():[],user.teams||(user.teams=[]),user.departments||(user.departments=[]),user.groups||(user.groups=[]),react_default.a.createElement(Modals_BaseModal,{parentExtraClass:"pt-0",extraClass:"p-0 pb-25"},react_default.a.createElement("div",{className:"user-heading",style:{minHeight:"130px",background:"#1976d2",padding:"24px"}},react_default.a.createElement("div",{className:"uk-width-1-1"},react_default.a.createElement("div",{style:{width:"82px",height:"82px",float:"left",marginRight:"24px",position:"relative"}},edit&&react_default.a.createElement("form",{className:"form nomargin",encType:"multipart/form-data"},react_default.a.createElement("div",{className:"mediumProfilePic",style:{position:"relative"}},react_default.a.createElement("input",{name:"_id",type:"hidden",value:user._id,readOnly:!0}),react_default.a.createElement("input",{name:"username",type:"hidden",value:user.username,readOnly:!0}),react_default.a.createElement("input",{type:"file",style:{display:"none"},ref:function(r){return _this3.uploadImageInput=r},onChange:function(e){return _this3.onImageUploadChanged(e)}}),react_default.a.createElement("img",{src:"/uploads/users/".concat(profilePicture),alt:"Profile Picture",ref:function(r){return _this3.uploadProfileImage=r}})),react_default.a.createElement("div",{className:"profile-picture-controls"},react_default.a.createElement("span",{className:"btn-file",onClick:function(e){return _this3.onFileBtnClick(e)}},react_default.a.createElement("i",{className:"material-icons"},"file_upload")))),!edit&&react_default.a.createElement("div",{className:"mediumProfilePic",style:{position:"relative"}},react_default.a.createElement("img",{src:"/uploads/users/".concat(profilePicture),alt:"Profile Picture",ref:function(r){return _this3.uploadProfileImage=r}}))),react_default.a.createElement("div",{className:"user-heading-content"},react_default.a.createElement("h2",null,react_default.a.createElement("span",{className:"uk-text-truncate"},user.username),react_default.a.createElement("span",{className:"sub-heading"},user.title))))),react_default.a.createElement("div",{style:{margin:"24px 24px 0 24px"}},react_default.a.createElement("form",{className:"uk-form-stacked",onSubmit:function(e){return _this3.onSubmitSaveAccount(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Name"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.name,onChange:function(e){return _this3.onInputChanged(e,"name")},disabled:!edit})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Title"),react_default.a.createElement("input",{type:"text",className:"md-input",value:this.title,onChange:function(e){return _this3.onInputChanged(e,"title")},disabled:!edit}))),edit&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"50%",paddingRight:"20px"}},react_default.a.createElement("label",{className:"uk-form-label"},"Password"),react_default.a.createElement("input",{type:"password",className:"md-input",value:this.password,onChange:function(e){return _this3.onInputChanged(e,"password")}})),react_default.a.createElement("div",{className:"uk-float-left uk-width-1-2"},react_default.a.createElement("label",{className:"uk-form-label"},"Confirm Password"),react_default.a.createElement("input",{type:"password",className:"md-input",value:this.confirmPassword,onChange:function(e){return _this3.onInputChanged(e,"confirmPassword")}})))),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Email"),react_default.a.createElement("input",{type:"email",className:"md-input",value:this.email,onChange:function(e){return _this3.onInputChanged(e,"email")},disabled:!edit})),edit&&react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Role"),react_default.a.createElement(components_SingleSelect,{items:roles,width:"100",showTextbox:!1,defaultValue:user.role._id,onSelectChange:function(e){return _this3.onRoleSelectChange(e)},disabled:!edit})),this.props.groups&&customer&&react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Groups"),react_default.a.createElement(components_MultiSelect,{items:groups,initialSelected:user.groups.map(function(i){return i._id}),onChange:function(){},ref:function(r){return _this3.groupSelect=r},disabled:!edit})),!customer&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Teams"),react_default.a.createElement(components_MultiSelect,{items:teams,initialSelected:user.teams.map(function(i){return i._id}),onChange:function(){},ref:function(r){return _this3.teamsSelect=r},disabled:!edit})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",{className:"uk-form-label"},"Departments"),react_default.a.createElement(components_MultiSelect,{items:departments,initialSelected:user.departments.map(function(i){return i._id}),onChange:function(){},disabled:!0}))),react_default.a.createElement("div",{className:"uk-modal-footer uk-text-right"},react_default.a.createElement(components_Button,{text:"Close",flat:!0,waves:!0,extraClass:"uk-modal-close"}),react_default.a.createElement(components_Button,{text:"Save Account",flat:!0,waves:!0,style:"primary",type:"submit",disabled:!edit})))))}}])&&EditAccountModal_defineProperties(Constructor.prototype,protoProps),staticProps&&EditAccountModal_defineProperties(Constructor,staticProps),EditAccountModal}()).prototype,"name",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor2=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"title",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor3=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"password",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor4=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"confirmPassword",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor5=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"email",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),EditAccountModal_descriptor6=EditAccountModal_applyDecoratedDescriptor(EditAccountModal_class2.prototype,"isAgentRole",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),EditAccountModal_class=EditAccountModal_class2))||EditAccountModal_class;EditAccountModal_EditAccountModal.propTypes={edit:prop_types_default.a.bool.isRequired,user:prop_types_default.a.object.isRequired,groups:prop_types_default.a.object.isRequired,teams:prop_types_default.a.object.isRequired,departments:prop_types_default.a.object.isRequired,saveEditAccount:prop_types_default.a.func.isRequired,fetchGroups:prop_types_default.a.func.isRequired,unloadGroups:prop_types_default.a.func.isRequired,fetchTeams:prop_types_default.a.func.isRequired,unloadTeams:prop_types_default.a.func.isRequired,fetchDepartments:prop_types_default.a.func.isRequired,unloadDepartments:prop_types_default.a.func.isRequired,fetchRoles:prop_types_default.a.func.isRequired,roles:prop_types_default.a.object.isRequired},EditAccountModal_EditAccountModal.defaultProps={edit:!1};var CreateGroupModal_class,CreateGroupModal_class2,CreateGroupModal_descriptor,Modals_EditAccountModal=Object(es.b)(function(state){return{groups:state.groupsState.groups,teams:state.teamsState.teams,departments:state.departmentsState.departments,roles:state.shared.roles}},{saveEditAccount:accounts_saveEditAccount,fetchGroups:groups_fetchGroups,unloadGroups,fetchTeams:teams_fetchTeams,unloadTeams,fetchDepartments:departments_fetchDepartments,unloadDepartments:departments_unloadDepartments,fetchRoles:common_fetchRoles})(EditAccountModal_EditAccountModal);function CreateGroupModal_typeof(obj){return(CreateGroupModal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function CreateGroupModal_defineProperties(target,props){for(var i=0;ipayload,()=>({thunk:!0})),search_unloadSearchResults=Object(createAction.a)(UNLOAD_SEARCH_RESULTS.ACTION,payload=>payload,()=>({thunk:!0}));function PageTitle_typeof(obj){return(PageTitle_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function PageTitle_defineProperties(target,props){for(var i=0;i0)return!1;SearchResults.toggleAnimation(!0,!1)}},{key:"toggleAnimation",value:function(forceState,state){for(var animateItems=jquery_default()(".search-results-container"),docElemStyle=document.documentElement.style,transitionProp=angular.isString(docElemStyle.transition)?"transition":"WebkitTransition",i=0;i3?(components_SearchResults.toggleAnimation(!0,!0),this.props.fetchSearchResults({term:this.searchTerm})):components_SearchResults.toggleAnimation(!0,!1)}},{key:"_onSearchFocus",value:function(e){this.searchTerm.length>3&&components_SearchResults.toggleAnimation(!0,!0)}},{key:"onSearchKeypress",value:function(e){this.searchTerm.length>3&&this.props.fetchSearchResults({term:this.searchTerm})}},{key:"_selectAll",value:function(){var _this4=this;this.selectedTickets=[],this.ticketsTable.querySelectorAll('td > input[type="checkbox"]').forEach(function(item){_this4.selectedTickets.push(item.dataset.ticket),item.checked=!0}),this.selectedTickets=Object(lodash.uniq)(this.selectedTickets)}},{key:"_clearChecked",value:function(){this.selectedTickets=[],this.ticketsTable.querySelectorAll('td > input[type="checkbox"]').forEach(function(item){item.checked=!1}),this.selectAllCheckbox.checked=!1}},{key:"onSelectAll",value:function(e){e.target.checked?this._selectAll():this._clearChecked()}},{key:"render",value:function(){for(var _this5=this,loadingItems=[],i=0;i<51;i++){for(var cells=[],k=0;k<10;k++)cells.push(react_default.a.createElement(Table_TableCell,{key:k,className:"vam"},react_default.a.createElement("div",{className:"loadingTextAnimation"})));loadingItems.push(react_default.a.createElement(Table_TableRow,{key:Math.random()},cells))}var selectAllCheckbox=react_default.a.createElement("div",{style:{marginLeft:17}},react_default.a.createElement("input",{type:"checkbox",id:"select_all",style:{display:"none"},className:"svgcheckinput",onChange:function(e){return _this5.onSelectAll(e)},ref:function(r){return _this5.selectAllCheckbox=r}}),react_default.a.createElement("label",{htmlFor:"select_all",className:"svgcheck"},react_default.a.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 18 18"},react_default.a.createElement("path",{d:"M1,9 L1,3.5 C1,2 2,1 3.5,1 L14.5,1 C16,1 17,2 17,3.5 L17,14.5 C17,16 16,17 14.5,17 L3.5,17 C2,17 1,16 1,14.5 L1,9 Z"}),react_default.a.createElement("polyline",{points:"1 9 7 14 15 4"}))));return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Tickets",shadow:!1,rightComponent:react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(components_TitlePagination,{limit:50,total:this.props.totalCount,type:this.props.view,prevEnabled:this.props.prevEnabled,nextEnabled:this.props.nextEnabled,currentPage:this.props.page,prevPage:this.props.prevPage,nextPage:this.props.nextPage,filter:this.props.filter}),react_default.a.createElement(components_PageTitleButton,{fontAwesomeIcon:"fa-refresh",onButtonClick:function(e){e.preventDefault(),_this5.props.unloadTickets().then(_this5.props.fetchTickets({type:_this5.props.view,page:_this5.props.page}))}}),react_default.a.createElement(components_PageTitleButton,{fontAwesomeIcon:"fa-filter",onButtonClick:function(e){e.preventDefault(),_this5.props.showModal("FILTER_TICKET")}}),react_default.a.createElement(Dropdown_DropdownTrigger,{pos:"bottom-right",offset:5,extraClass:"uk-float-left"},react_default.a.createElement(components_PageTitleButton,{fontAwesomeIcon:"fa-tasks"}),react_default.a.createElement(components_Dropdown,{small:!0,width:120},react_default.a.createElement(Dropdown_DropdownItem,{text:"Create",onClick:function(){return _this5.props.showModal("CREATE_TICKET")}}),react_default.a.createElement(DropdownSeperator,null),react_default.a.createElement(Dropdown_DropdownItem,{text:"Set Open",onClick:function(){return _this5.onSetStatus(1)}}),react_default.a.createElement(Dropdown_DropdownItem,{text:"Set Pending",onClick:function(){return _this5.onSetStatus(2)}}),react_default.a.createElement(Dropdown_DropdownItem,{text:"Set Closed",onClick:function(){return _this5.onSetStatus(3)}}),helpers_default.a.canUser("tickets:delete",!0)&&react_default.a.createElement(DropdownSeperator,null),helpers_default.a.canUser("tickets:delete",!0)&&react_default.a.createElement(Dropdown_DropdownItem,{text:"Delete",extraClass:"text-danger",onClick:function(){return _this5.onDeleteClicked()}}))),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("div",{id:"ticket-search-box",className:"search-box uk-float-left nb",style:{marginTop:8,paddingLeft:0}},react_default.a.createElement("input",{type:"text",id:"tickets_Search",placeholder:"Search",className:"ticket-top-search",value:this.searchTerm,onChange:function(e){return _this5.onSearchTermChanged(e)},onFocus:function(e){return _this5._onSearchFocus(e)}})))),react_default.a.createElement(components_SearchResults,{target:"#ticket-search-box",ref:function(r){return _this5.searchContainer=r}}))}),react_default.a.createElement(components_PageContent,{padding:0,paddingBottom:0,extraClass:"uk-position-relative"},react_default.a.createElement(components_Table,{tableRef:function(ref){return _this5.ticketsTable=ref},style:{margin:0},extraClass:"pDataTable",stickyHeader:!0,striped:!0,headers:[react_default.a.createElement(Table_TableHeader,{key:0,width:45,height:50,component:selectAllCheckbox}),react_default.a.createElement(Table_TableHeader,{key:1,width:60,text:"Status"}),react_default.a.createElement(Table_TableHeader,{key:2,width:65,text:"#"}),react_default.a.createElement(Table_TableHeader,{key:3,width:"23%",text:"Subject"}),react_default.a.createElement(Table_TableHeader,{key:4,width:110,text:"Created"}),react_default.a.createElement(Table_TableHeader,{key:5,width:125,text:"Requester"}),react_default.a.createElement(Table_TableHeader,{key:6,width:175,text:"Customer"}),react_default.a.createElement(Table_TableHeader,{key:7,text:"Assignee"}),react_default.a.createElement(Table_TableHeader,{key:8,width:110,text:"Due Date"}),react_default.a.createElement(Table_TableHeader,{key:9,text:"Updated"})]},!this.props.loading&&this.props.tickets.size<1&&react_default.a.createElement(Table_TableRow,{clickable:!1},react_default.a.createElement(Table_TableCell,{colSpan:10},react_default.a.createElement("h5",{style:{margin:10}},"No Tickets Found"))),this.props.loading&&loadingItems,!this.props.loading&&this.props.tickets.map(function(ticket){var a,status=function(){switch(ticket.get("status")){case 0:return"new";case 1:return"open";case 2:return"pending";case 3:return"closed"}},updated=ticket.get("updated")?helpers_default.a.formatDate(ticket.get("updated"),helpers_default.a.getShortDateFormat())+", "+helpers_default.a.formatDate(ticket.get("updated"),helpers_default.a.getTimeFormat()):"--",dueDate=ticket.get("dueDate")?helpers_default.a.formatDate(ticket.get("dueDate"),helpers_default.a.getShortDateFormat()):"--";return react_default.a.createElement(Table_TableRow,{key:ticket.get("_id"),className:"ticket-".concat(status()," ").concat(function(){if(!_this5.props.common.showOverdue||-1!==[2,3].indexOf(ticket.get("status")))return!1;var overdueIn=ticket.getIn(["priority","overdueIn"]),now=moment_timezone_default()(),updated=ticket.get("updated"),timeout=(updated=updated?moment_timezone_default()(updated):moment_timezone_default()(ticket.get("date"))).clone().add(overdueIn,"m");return now.isAfter(timeout)}()?"overdue":""),clickable:!0,onClick:function(e){if(e.target.closest("td").getElementsByTagName("input").length>0)return!1;History.pushState(null,"Ticket-".concat(ticket.get("uid")),"/tickets/".concat(ticket.get("uid")))}},react_default.a.createElement(Table_TableCell,{className:"ticket-priority nbb vam",style:{borderColor:ticket.getIn(["priority","htmlColor"]),padding:"18px 15px"}},react_default.a.createElement("input",{type:"checkbox",id:"c_".concat(ticket.get("_id")),"data-ticket":ticket.get("_id"),style:{display:"none"},onChange:function(e){return _this5.onTicketCheckChanged(e,ticket.get("_id"))},className:"svgcheckinput"}),react_default.a.createElement("label",{htmlFor:"c_".concat(ticket.get("_id")),className:"svgcheck"},react_default.a.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 18 18"},react_default.a.createElement("path",{d:"M1,9 L1,3.5 C1,2 2,1 3.5,1 L14.5,1 C16,1 17,2 17,3.5 L17,14.5 C17,16 16,17 14.5,17 L3.5,17 C2,17 1,16 1,14.5 L1,9 Z"}),react_default.a.createElement("polyline",{points:"1 9 7 14 15 4"})))),react_default.a.createElement(Table_TableCell,{className:"ticket-status ticket-".concat(status()," vam nbb uk-text-center")},react_default.a.createElement("span",{className:"uk-display-inline-block"},status()[0].toUpperCase())),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.get("uid")),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.get("subject")),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},helpers_default.a.formatDate(ticket.get("date"),helpers_default.a.getShortDateFormat())),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.getIn(["owner","fullname"])),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},ticket.getIn(["group","name"])),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},(a=ticket.get("assignee"))?a.get("fullname"):"--"),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},dueDate),react_default.a.createElement(Table_TableCell,{className:"vam nbb"},updated))}))))}}])&&TicketsContainer_defineProperties(Constructor.prototype,protoProps),staticProps&&TicketsContainer_defineProperties(Constructor,staticProps),TicketsContainer}()).prototype,"searchTerm",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),TicketsContainer_class=TicketsContainer_class2))||TicketsContainer_class;TicketsContainer_TicketsContainer.propTypes={view:prop_types_default.a.string.isRequired,page:prop_types_default.a.string.isRequired,prevPage:prop_types_default.a.number.isRequired,nextPage:prop_types_default.a.number.isRequired,prevEnabled:prop_types_default.a.bool.isRequired,nextEnabled:prop_types_default.a.bool.isRequired,tickets:prop_types_default.a.object.isRequired,totalCount:prop_types_default.a.string.isRequired,loading:prop_types_default.a.bool.isRequired,fetchTickets:prop_types_default.a.func.isRequired,deleteTicket:prop_types_default.a.func.isRequired,ticketEvent:prop_types_default.a.func.isRequired,unloadTickets:prop_types_default.a.func.isRequired,ticketUpdated:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired,fetchSearchResults:prop_types_default.a.func.isRequired,common:prop_types_default.a.object.isRequired,filter:prop_types_default.a.object.isRequired},TicketsContainer_TicketsContainer.defaultProps={view:"active",page:0,prevEnabled:!0,nextEnabled:!0};var AssigneeDropdownPartial_class,AssigneeDropdownPartial_class2,AssigneeDropdownPartial_descriptor,Tickets_TicketsContainer=Object(es.b)(function(state){return{tickets:state.ticketsState.tickets,totalCount:state.ticketsState.totalCount,prevPage:state.ticketsState.prevPage,nextPage:state.ticketsState.nextPage,loading:state.ticketsState.loading,common:state.common}},{fetchTickets:tickets_fetchTickets,deleteTicket:tickets_deleteTicket,ticketEvent:tickets_ticketEvent,unloadTickets,ticketUpdated:tickets_ticketUpdated,fetchSearchResults:search_fetchSearchResults,showModal})(TicketsContainer_TicketsContainer),sortBy=__webpack_require__(425),sortBy_default=__webpack_require__.n(sortBy),union=__webpack_require__(430),union_default=__webpack_require__.n(union);function AssigneeDropdownPartial_typeof(obj){return(AssigneeDropdownPartial_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function AssigneeDropdownPartial_defineProperties(target,props){for(var i=0;i"),react_default.a.createElement("br",null),react_default.a.createElement("time",{dateTime:dateFormatted,title:dateFormatted,"data-uk-tooltip":"{delay: 200}"},helpers_default.a.calendarDate(comment.date)),react_default.a.createElement("br",null),isNote&&react_default.a.createElement("span",{className:"uk-badge uk-badge-small nomargin-left-right text-white"},"NOTE"),react_default.a.createElement("div",{className:"comment-body",style:{marginTop:10},ref:function(r){return _this.body=r}},isNote&&react_default.a.createElement(react.Fragment,null,react_html_parser_lib_default()(comment.note)),!isNote&&react_default.a.createElement(react.Fragment,null,react_html_parser_lib_default()(comment.comment)))),3!==this.props.ticketStatus&&react_default.a.createElement("div",{className:"comment-actions"},helpers_default.a.hasPermOverRole(comment.owner.role,null,"comments:delete",!0)&&react_default.a.createElement("div",{className:"remove-comment",onClick:onRemoveClick},react_default.a.createElement("i",{className:"material-icons"},"")),helpers_default.a.hasPermOverRole(comment.owner.role,null,"comments:update",!0)&&react_default.a.createElement("div",{className:"edit-comment",onClick:onEditClick},react_default.a.createElement("i",{className:"material-icons"},""))))}}])&&CommentNotePartial_defineProperties(Constructor.prototype,protoProps),staticProps&&CommentNotePartial_defineProperties(Constructor,staticProps),CommentNotePartial}();CommentNotePartial_CommentNotePartial.propTypes={ticketStatus:prop_types_default.a.number.isRequired,ticketSubject:prop_types_default.a.string.isRequired,comment:prop_types_default.a.object.isRequired,dateFormat:prop_types_default.a.string.isRequired,isNote:prop_types_default.a.bool.isRequired,onEditClick:prop_types_default.a.func.isRequired,onRemoveClick:prop_types_default.a.func.isRequired},CommentNotePartial_CommentNotePartial.defaultProps={isNote:!1};var Tickets_CommentNotePartial=CommentNotePartial_CommentNotePartial;function DatePicker_typeof(obj){return(DatePicker_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function DatePicker_defineProperties(target,props){for(var i=0;i"),react_default.a.createElement("br",null),react_default.a.createElement("time",{dateTime:helpers_default.a.formatDate(this.props.date,"YYYY-MM-DD HH:mm")},helpers_default.a.formatDate(this.props.date,this.props.dateFormat)),react_default.a.createElement("br",null),react_default.a.createElement("ul",{className:"attachments"},this.attachments&&this.attachments.map(function(attachment){return react_default.a.createElement("li",{key:attachment._id},react_default.a.createElement("a",{href:attachment.path,className:"no-ajaxy",rel:"noopener noreferrer",target:"_blank"},attachment.name),3!==_this4.status&&react_default.a.createElement("a",{role:"button",className:"remove-attachment",onClick:function(e){return _this4.removeAttachment(e,attachment._id)}},react_default.a.createElement("i",{className:"fa fa-remove"})))})),react_default.a.createElement("div",{className:"issue-body",ref:function(r){return _this4.issueBody=r}},react_html_parser_lib_default()(this.issue))),3!==this.status&&helpers_default.a.hasPermOverRole(this.props.owner.role,null,"tickets:update",!0)&&react_default.a.createElement(react.Fragment,null,react_default.a.createElement("div",{className:"edit-issue",onClick:function(){_this4.props.editorWindow&&_this4.props.editorWindow.openEditorWindow({subject:_this4.subject,text:_this4.issue,onPrimaryClick:function(data){socket_default.a.ui.setTicketIssue(_this4.ticketId,data.text,data.subjectText)}})}},react_default.a.createElement("i",{className:"material-icons"},"")),react_default.a.createElement("form",{className:"form nomargin",encType:"multipart/form-data"},react_default.a.createElement("div",{className:"add-attachment",onClick:function(e){return _this4.attachmentInput.click()}},react_default.a.createElement("i",{className:"material-icons"},"")),react_default.a.createElement("input",{ref:function(r){return _this4.attachmentInput=r},className:"hide",type:"file",onChange:function(e){return _this4.onAttachmentInputChange(e)}}))))}}])&&IssuePartial_defineProperties(Constructor.prototype,protoProps),staticProps&&IssuePartial_defineProperties(Constructor,staticProps),IssuePartial}()).prototype,"ticketId",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IssuePartial_descriptor2=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"status",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),IssuePartial_descriptor3=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"owner",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),IssuePartial_descriptor4=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"subject",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IssuePartial_descriptor5=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"issue",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),IssuePartial_descriptor6=IssuePartial_applyDecoratedDescriptor(IssuePartial_class2.prototype,"attachments",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),IssuePartial_class=IssuePartial_class2))||IssuePartial_class;IssuePartial_IssuePartial.propTypes={ticketId:prop_types_default.a.string.isRequired,status:prop_types_default.a.number.isRequired,owner:prop_types_default.a.object.isRequired,subject:prop_types_default.a.string.isRequired,issue:prop_types_default.a.string.isRequired,date:prop_types_default.a.string.isRequired,dateFormat:prop_types_default.a.string.isRequired,attachments:prop_types_default.a.array,editorWindow:prop_types_default.a.object};var OffCanvasEditor_class,OffCanvasEditor_class2,OffCanvasEditor_descriptor,OffCanvasEditor_descriptor2,OffCanvasEditor_descriptor3,OffCanvasEditor_descriptor4,Tickets_IssuePartial=IssuePartial_IssuePartial;__webpack_require__(26);function OffCanvasEditor_typeof(obj){return(OffCanvasEditor_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function OffCanvasEditor_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function OffCanvasEditor_defineProperties(target,props){for(var i=0;i .tru-tab-selector"))}},{key:"render",value:function(){var _this=this,_this$props=this.props,children=_this$props.children,showTrack=_this$props.showTrack;return react_default.a.createElement("div",{className:"tru-tab-selectors",style:this.props.style,ref:function(r){return _this.selectors=r}},children,react_default.a.createElement("span",{className:"tru-tab-highlighter"}),showTrack&&react_default.a.createElement("span",{className:"tru-tab-hr tru-tab-hr-lighten"}))}}])&&TruTabSelectors_defineProperties(Constructor.prototype,protoProps),staticProps&&TruTabSelectors_defineProperties(Constructor,staticProps),TruTabSelectors}();TruTabSelectors_TruTabSelectors.propTypes={showTrack:prop_types_default.a.bool,style:prop_types_default.a.object},TruTabSelectors_TruTabSelectors.defaultProps={showTrack:!0};var TruTabs_TruTabSelectors=TruTabSelectors_TruTabSelectors;function TruTabWrapper_typeof(obj){return(TruTabWrapper_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function TruTabWrapper_defineProperties(target,props){for(var i=0;i
    Please select a new priority",function(){},{cancelButtonClass:"uk-hidden"})),socket_default.a.ui.setTicketType(_this4.ticket._id,e.target.value)}},mappedTypes&&mappedTypes.map(function(type){return react_default.a.createElement("option",{key:type.value,value:type.value},type.text)})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},this.ticket.type.name))),react_default.a.createElement("div",{className:"uk-width-1-2 uk-float-left nopadding"},react_default.a.createElement("div",{className:"marginleft5"},react_default.a.createElement("span",null,"Priority"),hasTicketUpdate&&react_default.a.createElement("select",{name:"tPriority",id:"tPriority",value:this.ticket.priority._id,onChange:function(e){return socket_default.a.ui.setTicketPriority(_this4.ticket._id,e.target.value)}},this.ticket.type&&this.ticket.type.priorities&&this.ticket.type.priorities.map(function(priority){return react_default.a.createElement("option",{key:priority._id,value:priority._id},priority.name)})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},this.ticket.priority.name))),react_default.a.createElement("div",{className:"uk-width-1-1 nopadding uk-clearfix"},react_default.a.createElement("span",null,"Group"),hasTicketUpdate&&react_default.a.createElement("select",{value:this.ticket.group._id,onChange:function(e){socket_default.a.ui.setTicketGroup(_this4.ticket._id,e.target.value)}},mappedGroups&&mappedGroups.map(function(group){return react_default.a.createElement("option",{key:group.value,value:group.value},group.text)})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},this.ticket.group.name)),react_default.a.createElement("div",{className:"uk-width-1-1 p-0"},react_default.a.createElement("span",null,"Due Date")," ",hasTicketUpdate&&react_default.a.createElement("span",null,"- "),hasTicketUpdate&&react_default.a.createElement("div",{className:"uk-display-inline"},react_default.a.createElement("a",{role:"button",onClick:function(e){e.preventDefault(),socket_default.a.ui.setTicketDueDate(_this4.ticket._id,void 0)}},"Clear"),react_default.a.createElement(components_DatePicker,{format:helpers_default.a.getShortDateFormat(),value:this.ticket.dueDate,onChange:function(e){var dueDate=moment_default()(e.target.value,helpers_default.a.getShortDateFormat()).utc().toISOString();socket_default.a.ui.setTicketDueDate(_this4.ticket._id,dueDate)}})),!hasTicketUpdate&&react_default.a.createElement("div",{className:"input-box"},helpers_default.a.formatDate(this.ticket.dueDate,this.props.common.shortDateFormat))),react_default.a.createElement("div",{className:"uk-width-1-1 nopadding"},react_default.a.createElement("span",null,"Tags",hasTicketUpdate&&react_default.a.createElement(react.Fragment,null,react_default.a.createElement("span",null," - "),react_default.a.createElement("div",{id:"editTags",className:"uk-display-inline"},react_default.a.createElement("a",{role:"button",style:{fontSize:11},className:"no-ajaxy",onClick:function(){_this4.props.showModal("ADD_TAGS_MODAL",{ticketId:_this4.ticket._id,currentTags:_this4.ticket.tags.map(function(tag){return tag._id})})}},"Edit Tags")))),react_default.a.createElement("div",{className:"tag-list uk-clearfix"},this.ticket.tags&&this.ticket.tags.map(function(tag){return react_default.a.createElement("div",{key:tag._id,className:"item"},tag.name)}))))),helpers_default.a.canUser("agent:*",!0)&&react_default.a.createElement("div",{className:"uk-width-1-1 padding-left-right-15"},react_default.a.createElement("div",{className:"tru-card ticket-details pr-0 pb-0",style:{height:250}},"Ticket History",react_default.a.createElement("hr",{style:{padding:0,margin:0}}),react_default.a.createElement("div",{className:"history-items scrollable",style:{paddingTop:12}},this.ticket.history&&this.ticket.history.map(function(item){return react_default.a.createElement("div",{key:item._id,className:"history-item"},react_default.a.createElement("time",{dateTime:helpers_default.a.formatDate(item.date,_this4.props.common.longDateFormat)}),react_default.a.createElement("em",null,"Action by: ",react_default.a.createElement("span",null,item.owner.fullname)),react_default.a.createElement("p",null,item.description))}))))))),react_default.a.createElement("div",{className:"page-message nopadding",style:{marginLeft:360}},react_default.a.createElement("div",{className:"page-title-right noshadow"},react_default.a.createElement("div",{className:"page-top-comments uk-float-right"},react_default.a.createElement("a",{role:"button",className:"btn no-ajaxy",onClick:function(e){e.preventDefault(),helpers_default.a.scrollToBottom(".page-content-right",!0)}},"Add Comment")),react_default.a.createElement("div",{className:"onoffswitch subscribeSwitch uk-float-right",style:{marginRight:10,position:"relative",top:18}},react_default.a.createElement("input",{id:"subscribeSwitch",type:"checkbox",name:"subscribeSwitch",className:"onoffswitch-checkbox",checked:this.isSubscribed,onChange:function(e){return _this4.onSubscriberChanged(e)}}),react_default.a.createElement("label",{className:"onoffswitch-label",htmlFor:"subscribeSwitch"},react_default.a.createElement("span",{className:"onoffswitch-inner subscribeSwitch-inner"}),react_default.a.createElement("span",{className:"onoffswitch-switch subscribeSwitch-switch"}))),react_default.a.createElement("div",{className:"pagination uk-float-right",style:{marginRight:5}},react_default.a.createElement("ul",{className:"button-group"},react_default.a.createElement("li",{className:"pagination"},react_default.a.createElement("a",{href:"/tickets/print/".concat(this.ticket.uid),className:"btn no-ajaxy",style:{borderRadius:3,marginRight:5},rel:"noopener noreferrer",target:"_blank"},react_default.a.createElement("i",{className:"material-icons"},"")))))),react_default.a.createElement("div",{className:"page-content-right full-height scrollable"},react_default.a.createElement("div",{className:"comments-wrapper"},react_default.a.createElement(Tickets_IssuePartial,{ticketId:this.ticket._id,status:this.ticket.status,owner:this.ticket.owner,subject:this.ticket.subject,issue:this.ticket.issue,date:this.ticket.date,dateFormat:"".concat(this.props.common.longDateFormat,", ").concat(this.props.common.timeFormat),attachments:this.ticket.attachments,editorWindow:this.editorWindow}),this.hasCommentsOrNotes&&react_default.a.createElement(TruTabs_TruTabWrapper,null,react_default.a.createElement(TruTabs_TruTabSelectors,{style:{marginLeft:110}},react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:0,label:"All",active:!0,showBadge:!0,badgeText:this.commentsAndNotes.length}),react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:1,label:"Comments",showBadge:!0,badgeText:this.ticket?this.ticket.comments&&this.ticket.comments.length:0}),helpers_default.a.canUser("tickets:notes",!0)&&react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:2,label:"Notes",showBadge:!0,badgeText:this.ticket?this.ticket.notes&&this.ticket.notes.length:0})),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:0,active:!0},react_default.a.createElement("div",{className:"all-comments"},this.commentsAndNotes.map(function(item){return react_default.a.createElement(Tickets_CommentNotePartial,{key:item._id,ticketStatus:_this4.ticket.status,ticketSubject:_this4.ticket.subject,comment:item,isNote:item.isNote,dateFormat:"".concat(_this4.props.common.longDateFormat,", ").concat(_this4.props.common.timeFormat),onEditClick:function(){_this4.editorWindow.openEditorWindow({showSubject:!1,text:item.isNote?item.note:item.comment,onPrimaryClick:function(data){item.isNote?socket_default.a.ui.setNoteText(_this4.ticket._id,item._id,data.text):socket_default.a.ui.setCommentText(_this4.ticket._id,item._id,data.text)}})},onRemoveClick:function(){item.isNote?socket_default.a.ui.removeNote(_this4.ticket._id,item._id):socket_default.a.ui.removeComment(_this4.ticket._id,item._id)}})}))),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:1},react_default.a.createElement("div",{className:"comments"},this.ticket&&this.ticket.comments.map(function(comment){return react_default.a.createElement(Tickets_CommentNotePartial,{key:comment._id,ticketStatus:_this4.ticket.status,ticketSubject:_this4.ticket.subject,comment,dateFormat:"".concat(_this4.props.common.longDateFormat,", ").concat(_this4.props.common.timeFormat),onEditClick:function(){_this4.editorWindow.openEditorWindow({showSubject:!1,text:comment.comment,onPrimaryClick:function(data){socket_default.a.ui.setCommentText(_this4.ticket._id,comment._id,data.text)}})},onRemoveClick:function(){socket_default.a.ui.removeComment(_this4.ticket._id,comment._id)}})}))),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:2},react_default.a.createElement("div",{className:"notes"},this.ticket&&this.ticket.notes.map(function(note){return react_default.a.createElement(Tickets_CommentNotePartial,{key:note._id,ticketStatus:_this4.ticket.status,ticketSubject:_this4.ticket.subject,comment:note,isNote:!0,dateFormat:"".concat(_this4.props.common.longDateFormat,", ").concat(_this4.props.common.timeFormat),onEditClick:function(){_this4.editorWindow.openEditorWindow({showSubject:!1,text:note.note,onPrimaryClick:function(data){socket_default.a.ui.setNoteText(_this4.ticket._id,note._id,data.text)}})},onRemoveClick:function(){socket_default.a.ui.removeNote(_this4.ticket._id,note._id)}})})))),3!==this.ticket.status&&(helpers_default.a.canUser("comments:create",!0)||helpers_default.a.canUser("tickets:notes",!0))&&react_default.a.createElement("div",{className:"uk-width-1-1 ticket-reply uk-clearfix"},react_default.a.createElement(components_Avatar_Avatar,{image:this.props.shared.sessionUser.image,showOnlineBubble:!1}),react_default.a.createElement(TruTabs_TruTabWrapper,{style:{paddingLeft:85}},react_default.a.createElement(TruTabs_TruTabSelectors,{showTrack:!1},helpers_default.a.canUser("comments:create",!0)&&react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:0,label:"Comment",active:!0}),helpers_default.a.canUser("tickets:notes",!0)&&react_default.a.createElement(TruTabs_TruTabSelector,{selectorId:1,label:"Internal Note",active:!helpers_default.a.canUser("comments:create",!0)})),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:0,style:{paddingTop:0},active:helpers_default.a.canUser("comments:create",!0)},react_default.a.createElement("form",{onSubmit:function(e){return _this4.onCommentNoteSubmit(e,"comment")}},react_default.a.createElement(components_EasyMDE,{allowImageUpload:!0,inlineImageUploadUrl:"/tickets/uploadmdeimage",inlineImageUploadHeaders:{ticketid:this.ticket._id},ref:function(r){return _this4.commentMDE=r}}),react_default.a.createElement("div",{className:"uk-width-1-1 uk-clearfix",style:{marginTop:50}},react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("button",{type:"submit",className:"uk-button uk-button-accent",style:{padding:"10px 15px"}},"Post Comment"))))),react_default.a.createElement(TruTabs_TruTabSection,{sectionId:1,style:{paddingTop:0},active:!helpers_default.a.canUser("comments:create")&&helpers_default.a.canUser("tickets:notes",!0)},react_default.a.createElement("form",{onSubmit:function(e){return _this4.onCommentNoteSubmit(e,"note")}},react_default.a.createElement(components_EasyMDE,{allowImageUpload:!0,inlineImageUploadUrl:"/tickets/uploadmdeimage",inlineImageUploadHeaders:{ticketid:this.ticket._id},ref:function(r){return _this4.noteMDE=r}}),react_default.a.createElement("div",{className:"uk-width-1-1 uk-clearfix",style:{marginTop:50}},react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement("button",{type:"submit",className:"uk-button uk-button-accent",style:{padding:"10px 15px"}},"Save Note"))))))))))),react_default.a.createElement(components_OffCanvasEditor,{primaryLabel:"Save Edit",ref:function(r){return _this4.editorWindow=r}})))}},{key:"notesTagged",get:function(){return this.ticket.notes.forEach(function(i){return i.isNote=!0}),this.ticket.notes}},{key:"commentsAndNotes",get:function(){if(!this.ticket)return[];if(!helpers_default.a.canUser("tickets:notes",!0))return sortBy_default()(this.ticket.comments,"date");var commentsAndNotes=union_default()(this.ticket.comments,this.notesTagged);return commentsAndNotes=sortBy_default()(commentsAndNotes,"date")}},{key:"hasCommentsOrNotes",get:function(){return!!this.ticket&&(this.ticket.comments.length>0||this.ticket.notes.length>0)}}])&&SingleTicketContainer_defineProperties(Constructor.prototype,protoProps),staticProps&&SingleTicketContainer_defineProperties(Constructor,staticProps),SingleTicketContainer}()).prototype,"ticket",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),SingleTicketContainer_descriptor2=SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"isSubscribed",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"notesTagged",[mobx_module.d],Object.getOwnPropertyDescriptor(SingleTicketContainer_class2.prototype,"notesTagged"),SingleTicketContainer_class2.prototype),SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"commentsAndNotes",[mobx_module.d],Object.getOwnPropertyDescriptor(SingleTicketContainer_class2.prototype,"commentsAndNotes"),SingleTicketContainer_class2.prototype),SingleTicketContainer_applyDecoratedDescriptor(SingleTicketContainer_class2.prototype,"hasCommentsOrNotes",[mobx_module.d],Object.getOwnPropertyDescriptor(SingleTicketContainer_class2.prototype,"hasCommentsOrNotes"),SingleTicketContainer_class2.prototype),SingleTicketContainer_class=SingleTicketContainer_class2))||SingleTicketContainer_class;SingleTicketContainer_SingleTicketContainer.propTypes={ticketId:prop_types_default.a.string.isRequired,ticketUid:prop_types_default.a.string.isRequired,shared:prop_types_default.a.object.isRequired,common:prop_types_default.a.object.isRequired,groupsState:prop_types_default.a.object.isRequired,fetchGroups:prop_types_default.a.func.isRequired,unloadGroups:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Tickets_SingleTicketContainer=Object(es.b)(function(state){return{common:state.common,shared:state.shared,groupsState:state.groupsState}},{fetchGroups:groups_fetchGroups,unloadGroups,showModal})(SingleTicketContainer_SingleTicketContainer);function Menu_typeof(obj){return(Menu_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Menu_defineProperties(target,props){for(var i=0;i0&&this.setState({activeChild:this.props.menuItems[0].key})}},{key:"switchChild",value:function(key){this.setState({activeChild:key})}},{key:"render",value:function(){var _this2=this,_this$props=this.props,title=_this$props.title,subtitle=_this$props.subtitle,rightComponent=_this$props.rightComponent,menuItems=_this$props.menuItems,tooltip=_this$props.tooltip;return react_default.a.createElement("div",{className:"setting-item-wrap uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"panel trupanel nopadding no-hover-shadow uk-overflow-hidden",style:{minHeight:"60px",height:"auto"}},react_default.a.createElement("div",{className:"left"},react_default.a.createElement("h6",{style:{padding:"0 0 0 15px",margin:"15px 0 0 0",fontSize:"16px",lineHeight:"14px"}},title,tooltip&&react_default.a.createElement("i",{className:"material-icons",style:{color:"#888",fontSize:"16px",cursor:"pointer",lineHeight:"3px",marginLeft:"4px"},"data-uk-tooltip":"{cls:'long-text'}",title:tooltip},"error")),react_default.a.createElement("h5",{style:{padding:"0 0 10px 15px",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},subtitle)),react_default.a.createElement("div",{className:"right"},react_default.a.createElement("div",{style:{margin:"12px 10px 0 0"}},rightComponent)),react_default.a.createElement("hr",{className:"nomargin-top clear"}),react_default.a.createElement("div",{className:"panel-body2"},react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"split-panel-categories uk-width-1-4 uk-width-large-1-5 scrollable br",style:{minHeight:"300px",overflow:"hidden auto"}},react_default.a.createElement(Settings_Menu,{hideBorders:!0,draggable:this.props.menuDraggable,onMenuDrag:this.props.menuOnDrag},menuItems.map(function(item){return react_default.a.createElement(Settings_MenuItem,{active:_this2.state.activeChild===item.key,key:item.key,dragKey:item.key,title:item.title,onClick:function(){_this2.switchChild(item.key)},draggable:_this2.props.menuDraggable})}))),react_default.a.createElement("div",{className:"uk-width-3-4 uk-width-large-4-5"+(this.props.scrollable?" scrollable":""),style:{padding:"20px 15px 15px 15px",maxHeight:this.props.maxHeight||"auto"}},menuItems.map(function(menuItem){return react_default.a.createElement(body,{active:_this2.state.activeChild===menuItem.key,key:menuItem.key,component:menuItem.bodyComponent})})))),this.props.footer&&react_default.a.createElement("div",{className:"panel-footer"},this.props.footer)))}}])&&SplitSettingsPanel_defineProperties(Constructor.prototype,protoProps),staticProps&&SplitSettingsPanel_defineProperties(Constructor,staticProps),SplitSettingsPanel}();SplitSettingsPanel_SplitSettingsPanel.propTypes={title:prop_types_default.a.string.isRequired,subtitle:prop_types_default.a.oneOfType([prop_types_default.a.string,prop_types_default.a.element]),tooltip:prop_types_default.a.string,rightComponent:prop_types_default.a.element,scrollable:prop_types_default.a.bool,maxHeight:prop_types_default.a.string,footer:prop_types_default.a.element,menuItems:prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.object),prop_types_default.a.object]).isRequired,menuDraggable:prop_types_default.a.bool,menuOnDrag:prop_types_default.a.func};var Settings_SplitSettingsPanel=SplitSettingsPanel_SplitSettingsPanel;function permSwitchPartial_typeof(obj){return(permSwitchPartial_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function permSwitchPartial_defineProperties(target,props){for(var i=0;i0&&react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"panel-body2 bg-warn",style:{padding:"0 10px"}},react_default.a.createElement("div",{className:"uk-clearfix"},react_default.a.createElement("div",{className:"left"},react_default.a.createElement("h6",{className:"text-dark",style:{padding:"0 0 0 15px",margin:"20px 0",fontSize:"18px",lineHeight:"14px"}},"Special Permissions")))),this.roleSpecials.map(function(perm){return react_default.a.createElement(permSwitchPartial,{key:"".concat(perm.title,"_").concat(perm.perm),title:perm.title,checked:_this2.hasSpecial(perm.perm),onChange:function(e){return _this2.onSpecialChanged(e,perm.perm)},disabled:_this2.all})}))))}}])&&permissionGroupPartial_defineProperties(Constructor.prototype,protoProps),staticProps&&permissionGroupPartial_defineProperties(Constructor,staticProps),PermissionGroupPartial}()).prototype,"all",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor2=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"create",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor3=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"view",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor4=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"update",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor5=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"delete",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_descriptor6=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"special",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),permissionGroupPartial_descriptor7=permissionGroupPartial_applyDecoratedDescriptor(permissionGroupPartial_class2.prototype,"roleSpecials",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),permissionGroupPartial_class=permissionGroupPartial_class2))||permissionGroupPartial_class;permissionGroupPartial_PermissionGroupPartial.propTypes={title:prop_types_default.a.string.isRequired,subtitle:prop_types_default.a.string,roleSpecials:prop_types_default.a.array,role:prop_types_default.a.object.isRequired,grants:prop_types_default.a.object.isRequired};var permissionBody_class,permissionBody_class2,permissionBody_descriptor,permissionBody_descriptor2,permissionBody_descriptor3,permissionBody_descriptor4,permissionBody_descriptor5,permissionBody_descriptor6,permissionBody_descriptor7,_descriptor8,_descriptor9,_descriptor10,_descriptor11,permissionGroupPartial=permissionGroupPartial_PermissionGroupPartial;function permissionBody_typeof(obj){return(permissionBody_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function permissionBody_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function permissionBody_defineProperties(target,props){for(var i=0;i Editing a priority will update all types linked."},"help")),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(components_Button,{text:"Add",style:"success",flat:!0,waves:!0,onClick:function(e){return _this4.onAddPriorityClick(e,type)}})),react_default.a.createElement("hr",{style:{margin:"5px 0 25px 0"}}),react_default.a.createElement("div",{className:"priority-loop zone"},type.get("priorities").map(function(item){return react_default.a.createElement("div",{key:item.get("_id"),ref:function(i){return _this4.prioritiesRef[item.get("_id")]=i},className:"z-box uk-clearfix"},react_default.a.createElement("div",{className:"view-priority uk-clearfix"},react_default.a.createElement(Settings_SettingSubItem,{title:item.get("name"),titleCss:{color:item.get("htmlColor")},subtitle:react_default.a.createElement("div",null,"SLA Overdue: ",react_default.a.createElement("strong",null,item.get("durationFormatted"))),component:react_default.a.createElement(components_ButtonGroup,{classNames:"uk-float-right"},react_default.a.createElement(components_Button,{text:"Edit",small:!0,onClick:function(e){return _this4.toggleEditPriority(e,item.get("_id"))}}),react_default.a.createElement(components_Button,{text:"Remove",small:!0,style:"danger",onClick:function(e){return _this4.onRemoveTicketTypePriorityClicked(e,item.get("_id"))}}))})),react_default.a.createElement(editPriorityPartial,{priority:item}))}))),react_default.a.createElement("div",{className:"uk-margin-large-top"},react_default.a.createElement("h2",{className:"text-light"},"Danger Zone"),react_default.a.createElement("div",{className:"danger-zone"},react_default.a.createElement("div",{className:"dz-box uk-clearfix"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h5",null,"Delete this type"),react_default.a.createElement("p",null,"Once you delete a ticket type, there is no going back. Please be certain.")),react_default.a.createElement("div",{className:"uk-float-right",style:{paddingTop:"10px"}},react_default.a.createElement(components_Button,{text:"Delete",small:!0,style:"danger",onClick:function(e){return _this4.showDeleteTicketTypeModal(e,type)}}))))))}}])&&ticketTypeBody_defineProperties(Constructor.prototype,protoProps),staticProps&&ticketTypeBody_defineProperties(Constructor,staticProps),TicketTypeBody}();ticketTypeBody_TicketTypeBody.propTypes={type:prop_types_default.a.object.isRequired,updatePriority:prop_types_default.a.func.isRequired,fetchSettings:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var ticketTypeBody=Object(es.b)(null,{updatePriority:tickets_updatePriority,fetchSettings:settings_fetchSettings,showModal})(ticketTypeBody_TicketTypeBody);function Tickets_typeof(obj){return(Tickets_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Tickets_defineProperties(target,props){for(var i=0;ithis.tagsPagination.pages-1&&this.tagsPagination.selectPage(this.tagsPagination.pages-1))}},{key:"getSetting",value:function(name){return this.props.settings.getIn(["settings",name,"value"])?this.props.settings.getIn(["settings",name,"value"]):""}},{key:"getTicketTypes",value:function(){return this.props.settings&&this.props.settings.get("ticketTypes")?this.props.settings.get("ticketTypes").toArray():[]}},{key:"getPriorities",value:function(){return this.props.settings&&this.props.settings.get("priorities")?this.props.settings.get("priorities").toArray():[]}},{key:"getTicketTags",value:function(e,page){e&&e.preventDefault(),this.props.tagsUpdateCurrentPage(page),this.props.getTagsWithPage({limit:16,page})}},{key:"onDefaultTicketTypeChange",value:function(e){this.props.updateSetting({name:"ticket:type:default",value:e.target.value,stateName:"defaultTicketType"})}},{key:"onAllowPublicTicketsChange",value:function(e){this.props.updateSetting({name:"allowPublicTickets:enable",value:e.target.checked,stateName:"allowPublicTickets",noSnackbar:!0})}},{key:"onAllowAgentUserTicketsChange",value:function(e){this.props.updateSetting({name:"allowAgentUserTickets:enable",value:e.target.checked,stateName:"allowAgentUserTickets",noSnackbar:!0})}},{key:"onShowOverdueChange",value:function(e){this.props.updateSetting({name:"showOverdueTickets:enable",value:e.target.checked,stateName:"showOverdueTickets",noSnackbar:!0})}},{key:"showModal",value:function(e,modal,props){e.preventDefault(),this.props.showModal(modal,props)}},{key:"onRemovePriorityClicked",value:function(e,priority){e.preventDefault(),this.props.showModal("DELETE_PRIORITY",{priority})}},{key:"onSubmitUpdateTag",value:function(e,tagId){var _this2=this;e.preventDefault(),e.persist();var name=e.target.name.value;if(name.length<2)return helpers_default.a.UI.showSnackbar("Invalid Tag Name",!0);axios_default.a.put("/api/v1/tags/".concat(tagId),{name}).then(function(res){TicketsSettings.toggleEditTag(e),helpers_default.a.UI.showSnackbar("Tag: ".concat(res.data.tag.name," updated successfully")),_this2.getTicketTags(null,_this2.tagsPagination.currentPage)}).catch(function(err){if(!err.response)return logger.error(err);var errorText=err.response.data.error;logger.error(errorText,err.response),helpers_default.a.UI.showSnackbar("Error: ".concat(errorText),!0)})}},{key:"onRemoveTagClicked",value:function(e,tag){var _this3=this;uikit_combined_min_default.a.modal.confirm("Really delete tag ".concat(tag.get(),'
    \n This will remove the tag from all associated tickets.'),function(){axios_default.a.delete("/api/v1/tags/".concat(tag.get("_id"))).then(function(res){res.data.success&&(helpers_default.a.UI.showSnackbar("Successfully removed tag: ".concat(tag.get("name"))),_this3.getTicketTags(null,_this3.tagsPagination.currentPage))}).catch(function(error){var errorText=error.response.data.error;helpers_default.a.UI.showSnackbar("Error: ".concat(errorText),!0),logger.error(errorText,error.response)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this4=this,_this$props=this.props,active=_this$props.active,viewdata=_this$props.viewdata,mappedTypes=this.getTicketTypes().map(function(type){return{text:type.get("name"),value:type.get("_id")}});return react_default.a.createElement("div",{className:active?"active":"hide"},react_default.a.createElement(Settings_SettingItem,{title:"Default Ticket Type",subtitle:"Default ticket type for newly created tickets.",component:react_default.a.createElement(components_SingleSelect,{items:mappedTypes,defaultValue:this.getSetting("defaultTicketType"),onSelectChange:function(e){_this4.onDefaultTicketTypeChange(e)},width:"50%",showTextbox:!1})}),react_default.a.createElement(Settings_SettingItem,{title:"Allow Public Tickets",subtitle:react_default.a.createElement("div",null,"Allow the creation of tickets by users that are unregistered. (",react_default.a.createElement("a",{href:viewdata.hosturl+"/newissue"},viewdata.hosturl+"/newissue"),")"),component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"allowPublicTickets",label:"Enable",checked:this.getSetting("allowPublicTickets"),onChange:function(e){_this4.onAllowPublicTicketsChange(e)}})}),react_default.a.createElement(Settings_SettingItem,{title:"Allow Agents to Submit Tickets on Behalf of User",subtitle:react_default.a.createElement("div",null,"Allow the creation of tickets by agents on behalf of users."),tooltip:"Setting takes affect after refresh.",component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"allowAgentUserTickets",label:"Enable",checked:this.getSetting("allowAgentUserTickets"),onChange:function(e){_this4.onAllowAgentUserTicketsChange(e)}})}),react_default.a.createElement(Settings_SettingItem,{title:"Show Overdue Tickets",subtitle:"Enable/Disable flashing of tickets based on SLA time of type priority.",tooltip:"If disabled, priority SLA times will not mark tickets overdue.",component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"showOverdueTickets",label:"Enable",checked:this.getSetting("showOverdueTickets"),onChange:function(e){_this4.onShowOverdueChange(e)}})}),react_default.a.createElement(Settings_SettingItem,{title:"Minimum Subject Length",subtitle:"Minimum character limit for ticket subject",component:react_default.a.createElement(Settings_NumberWithSave,{stateName:"minSubjectLength",settingName:"ticket:minlength:subject",value:this.getSetting("minSubjectLength"),width:"40%"})}),react_default.a.createElement(Settings_SettingItem,{title:"Minimum Issue Length",subtitle:"Minimum character limit for ticket issue",component:react_default.a.createElement(Settings_NumberWithSave,{stateName:"minIssueLength",settingName:"ticket:minlength:issue",value:this.getSetting("minIssueLength"),width:"40%"})}),react_default.a.createElement(Settings_SplitSettingsPanel,{title:"Ticket Types",subtitle:"Create/Modify Ticket Types",rightComponent:react_default.a.createElement(components_Button,{text:"Create",style:"success",flat:!0,extraClass:"md-btn-wave",onClick:function(e){_this4.showModal(e,"CREATE_TICKET_TYPE")}}),menuItems:this.getTicketTypes().map(function(type){return{key:type.get("_id"),title:type.get("name"),bodyComponent:react_default.a.createElement(ticketTypeBody,{type})}})}),react_default.a.createElement(Settings_SettingItem,{title:"Ticket Priorities",subtitle:"Ticket priorities set the level of SLAs for each ticket.",component:react_default.a.createElement(components_Button,{text:"Create",style:"success",flat:!0,waves:!0,extraClass:"mt-10 right",onClick:function(e){return _this4.showModal(e,"CREATE_PRIORITY")}})},react_default.a.createElement(zone,null,this.getPriorities().map(function(p){var disableRemove=!!p.get("default")&&p.get("default");return react_default.a.createElement(components_ZoneBox,{key:p.get("_id"),extraClass:"priority-wrapper"},react_default.a.createElement(Settings_SettingSubItem,{parentClass:"view-priority",title:p.get("name"),titleCss:{color:p.get("htmlColor")},subtitle:react_default.a.createElement("div",null,"SLA Overdue: ",react_default.a.createElement("strong",null,p.get("durationFormatted"))),component:react_default.a.createElement(components_ButtonGroup,{classNames:"uk-float-right"},react_default.a.createElement(components_Button,{text:"Edit",small:!0,onClick:function(e){return TicketsSettings.toggleEditPriority(e)}}),react_default.a.createElement(components_Button,{text:"Remove",small:!0,style:"danger",disabled:disableRemove,onClick:function(e){return _this4.onRemovePriorityClicked(e,p)}}))}),react_default.a.createElement(editPriorityPartial,{priority:p}))}))),react_default.a.createElement(Settings_SettingItem,{title:"Ticket Tags",subtitle:"Create/Modify Ticket Tags",component:react_default.a.createElement(components_Button,{text:"Create",style:"success",flat:!0,waves:!0,extraClass:"mt-10 right",onClick:function(e){return _this4.showModal(e,"CREATE_TAG",{page:"settings",currentPage:_this4.props.tagsSettings.currentPage})}}),footer:react_default.a.createElement("ul",{id:"tagPagination",className:"uk-pagination"})},react_default.a.createElement(components_Grid,{extraClass:"uk-margin-medium-bottom"},this.props.tagsSettings.tags.size<1&&react_default.a.createElement("div",{style:{width:"100%",padding:"55px",textAlign:"center"}},react_default.a.createElement("h3",{style:{fontSize:"24px",fontWeight:"300"}},"No Tags Found")),react_default.a.createElement(components_SpinLoader,{active:this.props.tagsSettings.loading,extraClass:"panel-bg"}),react_default.a.createElement(Grid_GridItem,{width:"1-1"},react_default.a.createElement(components_Grid,{extraClass:"zone ml-0"},this.props.tagsSettings.tags.map(function(i){return react_default.a.createElement(Grid_GridItem,{width:"1-2",key:i.get("_id"),extraClass:"tag-wrapper br bb"},react_default.a.createElement(components_Grid,{extraClass:"view-tag"},react_default.a.createElement(Grid_GridItem,{width:"1-1"},react_default.a.createElement(components_ZoneBox,null,react_default.a.createElement(components_Grid,null,react_default.a.createElement(Grid_GridItem,{width:"1-2"},react_default.a.createElement("h5",{style:{fontSize:"16px",lineHeight:"31px",margin:0,padding:0,fontWeight:300}},i.get("name"))),react_default.a.createElement(Grid_GridItem,{width:"1-2",extraClass:"uk-text-right"},react_default.a.createElement(components_ButtonGroup,{classNames:"mt-5"},react_default.a.createElement(components_Button,{text:"edit",flat:!0,waves:!0,small:!0,onClick:function(e){return TicketsSettings.toggleEditTag(e)}}),react_default.a.createElement(components_Button,{text:"remove",flat:!0,waves:!0,style:"danger",small:!0,onClick:function(e){return _this4.onRemoveTagClicked(e,i)}}))))))),react_default.a.createElement(components_Grid,{extraClass:"edit-tag z-box uk-clearfix nbt hide",style:{paddingTop:"5px"}},react_default.a.createElement(Grid_GridItem,{width:"1-1"},react_default.a.createElement("form",{onSubmit:function(e){return _this4.onSubmitUpdateTag(e,i.get("_id"))}},react_default.a.createElement(components_Grid,null,react_default.a.createElement(Grid_GridItem,{width:"2-3"},react_default.a.createElement("input",{type:"text",className:"md-input",name:"name",defaultValue:i.get("name")})),react_default.a.createElement(Grid_GridItem,{width:"1-3",style:{paddingTop:"10px"}},react_default.a.createElement(components_ButtonGroup,{classNames:"uk-float-right uk-text-right"},react_default.a.createElement(components_Button,{text:"cancel",flat:!0,waves:!0,small:!0,onClick:function(e){return TicketsSettings.toggleEditTag(e)}}),react_default.a.createElement(components_Button,{type:"submit",text:"save",flat:!0,waves:!0,small:!0,style:"success"}))))))))}))))))}}])&&Tickets_defineProperties(Constructor.prototype,protoProps),staticProps&&Tickets_defineProperties(Constructor,staticProps),TicketsSettings}();Tickets_TicketsSettings.propTypes={active:prop_types_default.a.bool.isRequired,viewdata:prop_types_default.a.object.isRequired,settings:prop_types_default.a.object.isRequired,tagsSettings:prop_types_default.a.object.isRequired,updateSetting:prop_types_default.a.func.isRequired,getTagsWithPage:prop_types_default.a.func.isRequired,tagsUpdateCurrentPage:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Tickets=Object(es.b)(function(state){return{viewdata:state.common,settings:state.settings.settings,tagsSettings:state.tagsSettings}},{updateSetting:settings_updateSetting,getTagsWithPage:tickets_getTagsWithPage,tagsUpdateCurrentPage,showModal})(Tickets_TicketsSettings);function mailer_typeof(obj){return(mailer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function mailer_defineProperties(target,props){for(var i=0;i
    Would you like to restart the server now?",function(){axios_default.a.get("/api/v1/admin/restart").catch(function(error){helpers_default.a.hideLoader(),logger.error(error.response),logger.error("Unable to restart server. Server must run under PM2 and Account must have admin rights."),helpers_default.a.UI.showSnackbar("Unable to restart server. Are you an Administrator?",!0)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-primary"})})}},{key:"onInputValueChanged",value:function(e,stateName){this.setState(mailerCheck_defineProperty({},stateName,e.target.value))}},{key:"onPollingChanged",value:function(e){this.setState({mailerCheckPolling:e.target.value})}},{key:"onCheckboxChanged",value:function(e,stateName){this.setState(mailerCheck_defineProperty({},stateName,e.target.checked))}},{key:"onTicketTypeSelectChanged",value:function(e){this.setState({mailerCheckTicketType:e.target.value,typePriorities:Mailer_MailerCheck.getTypePriorities(this.props.settings.get("ticketTypes"),e.target.value)})}},{key:"onSingleSelectChanged",value:function(e,stateName){this.setState(mailerCheck_defineProperty({},stateName,e.target.value))}},{key:"render",value:function(){var _this2=this,mappedTicketTypes=this.getTicketTypes().map(function(type){return{text:type.get("name"),value:type.get("_id")}});return react_default.a.createElement(Settings_SettingItem,{title:"Mailer Check",subtitle:react_default.a.createElement("div",null,"Poll an IMAP mailbox for messages to convert to tickets - ",react_default.a.createElement("i",null,"Settings are applied after server restart")),component:react_default.a.createElement(Settings_EnableSwitch,{stateName:"mailerCheckEnabled",label:"Enabled",checked:this.getSetting("mailerCheckEnabled"),onChange:function(e){return _this2.onEnableMailerCheckChanged(e)}})},react_default.a.createElement("div",null,react_default.a.createElement("form",{onSubmit:function(e){return _this2.onFormSubmit(e)}},react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Mail Server"),react_default.a.createElement("input",{type:"text",className:"md-input md-input-width-medium",name:"mailerCheckHost",value:this.state.mailerCheckHost,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckHost")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Port"),react_default.a.createElement("input",{type:"text",className:"md-input md-input-width-medium",name:"mailerCheckPort",value:this.state.mailerCheckPort,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckPort")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Username"),react_default.a.createElement("input",{type:"text",className:"md-input md-input-width-medium",name:"mailerCheckUsername",value:this.state.mailerCheckUsername,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckUsername")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom"},react_default.a.createElement("label",null,"Password"),react_default.a.createElement("input",{type:"password",className:"md-input md-input-width-medium",name:"mailerCheckPassword",value:this.state.mailerCheckPassword,onChange:function(e){return _this2.onInputValueChanged(e,"mailerCheckPassword")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("div",{className:"uk-clearfix uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h6",{style:{padding:0,margin:"5px 0 0 0",fontSize:"16px",lineHeight:"14px"}},"Polling Interval",react_default.a.createElement("i",{className:"material-icons",style:{color:"#888",fontSize:"16px",cursor:"pointer",lineHeight:"20px",marginLeft:"5px"},"data-uk-tooltip":"{cls:'long-text'}",title:"Caution: Polling too often can cause high CPU usage"},"error")),react_default.a.createElement("h5",{style:{padding:"0 0 10px 0",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},"How often to poll the server for new messages (Minutes)")),react_default.a.createElement("div",{className:"uk-float-right",style:{position:"relative"}},react_default.a.createElement("div",{className:"uk-float-left",style:{width:"90px",paddingRight:"10px"}},react_default.a.createElement("input",{type:"number",className:"md-input md-input-width-small",name:"mailerCheckPolling",disabled:!this.getSetting("mailerCheckEnabled"),value:this.state.mailerCheckPolling,onChange:function(e){return _this2.onPollingChanged(e)}}))),react_default.a.createElement("hr",{style:{float:"left",marginTop:"10px"}})),react_default.a.createElement("div",{className:"uk-clearfix uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h6",{style:{padding:0,margin:"5px 0 0 0",fontSize:"16px",lineHeight:"14px"}},"Create Account"),react_default.a.createElement("h5",{style:{padding:"0 0 10px 0",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},"Create a user account if account does not exist.")),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(Settings_EnableSwitch,{label:"Enable",stateName:"mailerCheckCreateAccount",checked:this.state.mailerCheckCreateAccount,onChange:function(e){return _this2.onCheckboxChanged(e,"mailerCheckCreateAccount")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("hr",{style:{float:"left",marginTop:"10px"}})),react_default.a.createElement("div",{className:"uk-clearfix uk-margin-medium-bottom"},react_default.a.createElement("div",{className:"uk-float-left"},react_default.a.createElement("h6",{style:{padding:0,margin:"5px 0 0 0",fontSize:"16px",lineHeight:"14px"}},"Delete Message"),react_default.a.createElement("h5",{style:{padding:"0 0 10px 0",margin:"2px 0 0 0",fontSize:"12px"},className:"uk-text-muted"},"Delete email message from INBOX once processed")),react_default.a.createElement("div",{className:"uk-float-right"},react_default.a.createElement(Settings_EnableSwitch,{label:"Enable",stateName:"mailerCheckDeleteMessage",checked:this.state.mailerCheckDeleteMessage,onChange:function(e){return _this2.onCheckboxChanged(e,"mailerCheckDeleteMessage")},disabled:!this.getSetting("mailerCheckEnabled")})),react_default.a.createElement("hr",{style:{float:"left",marginTop:"10px"}})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("label",null,"Default Ticket Type"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,width:"100%",items:mappedTicketTypes,defaultValue:this.state.mailerCheckTicketType,disabled:!this.getSetting("mailerCheckEnabled"),onSelectChange:function(e){return _this2.onTicketTypeSelectChanged(e)}})),react_default.a.createElement("div",{className:"uk-margin-medium-bottom uk-clearfix"},react_default.a.createElement("label",null,"Default Ticket Priority"),react_default.a.createElement(components_SingleSelect,{showTextbox:!1,width:"100%",items:this.state.typePriorities,defaultValue:this.state.mailerCheckTicketPriority,disabled:!this.getSetting("mailerCheckEnabled"),onSelectChange:function(e){return _this2.onSingleSelectChanged(e,"mailerCheckTicketPriority")}})),react_default.a.createElement("div",{className:"uk-clearfix"},react_default.a.createElement(components_Button,{text:"Apply",type:"submit",extraClass:"uk-float-right",flat:!0,waves:!0,style:"success",disabled:!this.getSetting("mailerCheckEnabled")})))))}}])&&mailerCheck_defineProperties(Constructor.prototype,protoProps),staticProps&&mailerCheck_defineProperties(Constructor,staticProps),Mailer_MailerCheck}();mailerCheck_Mailer_MailerCheck.propTypes={settings:prop_types_default.a.object.isRequired,updateSetting:prop_types_default.a.func.isRequired,updateMultipleSettings:prop_types_default.a.func.isRequired};var mailerSettingsTemplates_class,mailerSettingsTemplates_class2,mailerSettingsTemplates_descriptor,mailerSettingsTemplates_descriptor2,mailerCheck=Object(es.b)(function(state){return{settings:state.settings.settings}},{updateSetting:settings_updateSetting,updateMultipleSettings:settings_updateMultipleSettings})(mailerCheck_Mailer_MailerCheck);function mailerSettingsTemplates_typeof(obj){return(mailerSettingsTemplates_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function mailerSettingsTemplates_initializerDefineProperty(target,property,descriptor,context){descriptor&&Object.defineProperty(target,property,{enumerable:descriptor.enumerable,configurable:descriptor.configurable,writable:descriptor.writable,value:descriptor.initializer?descriptor.initializer.call(context):void 0})}function mailerSettingsTemplates_defineProperties(target,props){for(var i=0;i0&&(this.deletedTicketsPagination=uikit_combined_min_default.a.pagination($deletedTicketPagination,{items:this.props.settings.deletedTicketsCount,itemsOnPage:15}),$deletedTicketPagination.on("select.uk.pagination",function(e,pageIndex){_this2.props.changeDeletedTicketsPage(pageIndex)}))}prevProps.settings.deletedTicketsCount!==this.props.settings.deletedTicketsCount&&(this.deletedTicketsPagination.pages=Math.ceil(this.props.settings.deletedTicketsCount/15)?Math.ceil(this.props.settings.deletedTicketsCount/15):1,this.deletedTicketsPagination.render(),this.deletedTicketsPagination.currentPage>this.deletedTicketsPagination.pages-1&&this.deletedTicketsPagination.selectPage(this.deletedTicketsPagination.pages-1))}},{key:"componentWillUnmount",value:function(){this.deletedTicketsPagination&&(this.deletedTicketsPagination.element.off("select.uk.pagination"),this.deletedTicketsPagination=null)}},{key:"initBackupUpload",value:function(){var $progressBar=jquery_default()(this.backupUploadProgressbar),$uploadSelect=jquery_default()(this.backupUploadSelect),$uploadButton=jquery_default()(this.backupUploadBtn),bar=$progressBar.find(".uk-progress-bar");if(!($progressBar.length<1||$uploadSelect.length<1||$uploadButton.length<1)){var self=this,settings={action:"/api/v1/backup/upload",allow:"*.zip",type:"json",loadstart:function(){bar.css("width","0%").text("0%"),$progressBar.removeClass("hide"),$uploadButton.addClass("hide")},notallowed:function(){helpers_default.a.UI.showSnackbar("Invalid File Type. Please upload a Zip file.",!0)},error:function(err){logger.error(err),helpers_default.a.UI.showSnackbar("An unknown error occurred. Check Console",!0)},progress:function(percent){percent=Math.ceil(percent),bar.css("width",percent+"%").text(percent+"%")},allcomplete:function(response){logger.debug(response),response.success||helpers_default.a.UI.showSnackbar(response.error,!0),bar.css("width","100%").text("100%"),setTimeout(function(){$progressBar.addClass("hide"),$uploadButton.removeClass("hide"),$uploadSelect.val(null),self.props.fetchBackups(),helpers_default.a.UI.playSound("success")},1500)}};uikit_combined_min_default.a.uploadSelect($uploadSelect,settings)}}},{key:"onBackupNowClicked",value:function(e){e.preventDefault(),this.props.backupNow()}},{key:"oneRestoreClicked",value:function(e,backup){if(backup){var filename=backup.get("filename");uikit_combined_min_default.a.modal.confirm('

    Are you sure?

    \n

    \n This is a permanent action. \n This will earse the database and restore it with the selected backup file: '.concat(filename,'\n

    \n

    \n Any users currently logged in will be presented with a blocking restore page. Preventing any further actions.\n Once complete all users are required to log in again.


    \n

    \n This process may take a while depending on the size of the backup.\n

    '),function(){socket_default.a.ui.emitShowRestoreOverlay(),axios_default.a.post("/api/v1/backup/restore",{file:filename}).then(function(){helpers_default.a.UI.showSnackbar("Restore Complete. Logging all users out..."),setTimeout(function(){socket_default.a.ui.emitRestoreComplete()},2e3)}).catch(function(err){logger.error(err),helpers_default.a.UI.showSnackbar("An error occurred. Check console.",!0)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}}},{key:"onDeleteBackupClicked",value:function(e,backup){var _this3=this;uikit_combined_min_default.a.modal.confirm('

    Are you sure?

    \n

    This action is permanent and will destroy the backup file: \n '.concat(backup.get("filename"),"\n

    "),function(){axios_default.a.delete("/api/v1/backup/".concat(backup.get("filename"))).then(function(res){res.data&&res.data.success?(_this3.props.fetchBackups(),helpers_default.a.UI.showSnackbar("Backup successfully deleted")):helpers_default.a.UI.showSnackbar("Unable to delete backup",!0)}).catch(function(err){logger.error(err),helpers_default.a.UI.showSnackbar("Error: ".concat(err.response.data.error),!0)})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"onRestoreTicketClicked",value:function(e,ticket){ticket&&this.props.restoreDeletedTicket({_id:ticket.get("_id")})}},{key:"render",value:function(){var _this4=this,active=this.props.active;return react_default.a.createElement("div",{className:active?"active":"hide"},!this.props.settings.hasMongoDBTools&&react_default.a.createElement(Settings_SettingItem,{title:"MongoDB Tools Not Found",subtitle:"Unable to locate MongoDB tools. Please make sure MongoDB tools are installed."},react_default.a.createElement("div",null,react_default.a.createElement("h4",null,"Installing MongoDB Tools"),react_default.a.createElement("p",{style:{margin:"0 0 5px 0",fontSize:"13px"}},"MongoDB Tools are required to perform backup and restore. See below for instructions on installing MongoDB Tools."),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Ubuntu 16.04")),react_default.a.createElement("pre",{style:{whiteSpace:"pre-line"}},"wget https://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.6/multiverse/binary-amd64/mongodb-org-tools_3.6.9_amd64.deb && \\ dpkg -i mongodb-org-tools_3.6.9_amd64.deb"),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Ubuntu 18.04")),react_default.a.createElement("pre",{style:{whiteSpace:"pre-line"}},"sudo apt install -y mongo-tools"),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Fedora 29")),react_default.a.createElement("pre",null,"dnf install -y mongo-tools"),react_default.a.createElement("br",null),react_default.a.createElement("h5",null,react_default.a.createElement("strong",null,"Alpine Linux")),react_default.a.createElement("pre",null,"apk add mongodb-tools"))),this.props.settings.hasMongoDBTools&&react_default.a.createElement("div",null,react_default.a.createElement(Settings_SettingItem,{title:"Backup Now",subtitle:"Backup all site data. (Database, Attachments, Assets)",component:react_default.a.createElement("div",{className:"uk-float-right mt-10"},react_default.a.createElement("div",{className:"uk-progress uk-progress-success uk-progress-striped uk-active"+(this.props.settings.backingup?"":" hide "),style:{height:"31px",background:"transparent"}},react_default.a.createElement("div",{className:"uk-progress-bar uk-float-right",style:{width:"115px",fontSize:"11px",textTransform:"uppercase",lineHeight:"31px"}},"Please Wait...")),!this.props.settings.backingup&&react_default.a.createElement(components_Button,{text:"Backup Now",style:"success",small:!0,styleOverride:{width:"115px"},onClick:function(e){return _this4.onBackupNowClicked(e)}}))}),react_default.a.createElement(Settings_SettingItem,{title:"Backups",subtitle:"Currently stored backups",component:react_default.a.createElement("div",{className:"uk-float-right mt-10",style:{width:"85px"}},react_default.a.createElement("div",{className:"uk-progress hide",style:{height:"31px"},ref:function(i){return _this4.backupUploadProgressbar=i}},react_default.a.createElement("div",{className:"uk-progress-bar",style:{width:0,lineHeight:"31px",fontSize:"11px"}},"0%")),react_default.a.createElement("form",{className:"uk-form-stacked"},react_default.a.createElement("button",{className:"md-btn md-btn-small md-btn-primary uk-form-file no-ajaxy",style:{width:"85px"},ref:function(i){return _this4.backupUploadBtn=i}},"Upload",react_default.a.createElement("input",{ref:function(i){return _this4.backupUploadSelect=i},type:"file",name:"backupUploadSelect"}))))},this.props.settings.backups.size<1&&react_default.a.createElement(zone,null,react_default.a.createElement(components_ZoneBox,null,react_default.a.createElement("h2",{className:"uk-text-muted uk-text-center"},"No Backups"))),this.props.settings.backups.size>0&&react_default.a.createElement("table",{className:"uk-table mt-0"},react_default.a.createElement("thead",null,react_default.a.createElement("tr",null,react_default.a.createElement("th",null,"Filename"),react_default.a.createElement("th",null,"Size"),react_default.a.createElement("th",null))),react_default.a.createElement("tbody",null,this.props.settings.backups.map(function(backup){return react_default.a.createElement("tr",{key:backup.get("filename")},react_default.a.createElement("td",{className:"valign-middle",style:{width:"60%",height:"60px"}},backup.get("filename")),react_default.a.createElement("td",{className:"valign-middle"},backup.get("sizeFormat")),react_default.a.createElement("td",{className:"uk-text-right valign-middle"},react_default.a.createElement(components_ButtonGroup,null,react_default.a.createElement("a",{href:"/backups/".concat(backup.get("filename")),className:"md-btn md-btn-small md-btn-wave no-ajaxy",download:backup.get("filename")},"download"),react_default.a.createElement(components_Button,{text:"Restore",small:!0,waves:!0,onClick:function(e){return _this4.oneRestoreClicked(e,backup)}}),react_default.a.createElement(components_Button,{text:"Delete",small:!0,style:"danger",waves:!0,onClick:function(e){return _this4.onDeleteBackupClicked(e,backup)}}))))}))))),react_default.a.createElement(Settings_SettingItem,{title:"Restore Deleted Tickets",subtitle:"Tickets marked as deleted are shown below."},this.props.settings.deletedTickets.size<1&&react_default.a.createElement(zone,null,react_default.a.createElement(components_ZoneBox,null,react_default.a.createElement("h2",{className:"uk-text-muted uk-text-center"},"No Deleted Tickets"))),this.props.settings.deletedTickets.size>0&&react_default.a.createElement("div",null,react_default.a.createElement("table",{className:"uk-table mt-0 mb-5"},react_default.a.createElement("thead",null,react_default.a.createElement("tr",null,react_default.a.createElement("th",null,"UID"),react_default.a.createElement("th",null,"Subject"),react_default.a.createElement("th",null,"Group"),react_default.a.createElement("th",null,"Date"),react_default.a.createElement("th",null))),react_default.a.createElement("tbody",null,this.props.settings.deletedTickets.map(function(ticket){return react_default.a.createElement("tr",{key:ticket.get("_id")},react_default.a.createElement("td",{className:"valign-middle",style:{width:"10%",height:"60px"}},ticket.get("uid")),react_default.a.createElement("td",{className:"valign-middle",style:{width:"30%"}},ticket.get("subject")),react_default.a.createElement("td",{className:"valign-middle",style:{width:"30%"}},ticket.getIn(["group","name"])),react_default.a.createElement("td",{className:"valign-middle",style:{width:"30%"}},ticket.get("date")),react_default.a.createElement("td",{className:"uk-text-right valign-middle"},react_default.a.createElement(components_ButtonGroup,null,react_default.a.createElement(components_Button,{text:"Restore",small:!0,waves:!0,onClick:function(e){return _this4.onRestoreTicketClicked(e,ticket)}}))))}))),react_default.a.createElement("div",{className:"uk-pagination deletedTicketPagination"}))))}}])&&BackupRestore_defineProperties(Constructor.prototype,protoProps),staticProps&&BackupRestore_defineProperties(Constructor,staticProps),BackupRestoreSettingsContainer}();BackupRestore_BackupRestoreSettingsContainer.propTypes={active:prop_types_default.a.bool.isRequired,fetchMongoDBTools:prop_types_default.a.func.isRequired,fetchBackups:prop_types_default.a.func.isRequired,fetchDeletedTickets:prop_types_default.a.func.isRequired,changeDeletedTicketsPage:prop_types_default.a.func.isRequired,backupNow:prop_types_default.a.func.isRequired,restoreDeletedTicket:prop_types_default.a.func.isRequired,settings:prop_types_default.a.object.isRequired};var BackupRestore=Object(es.b)(function(state){return{settings:state.settings}},{fetchBackups:settings_fetchBackups,fetchMongoDBTools,backupNow:settings_backupNow,fetchDeletedTickets:settings_fetchDeletedTickets,restoreDeletedTicket:settings_restoreDeletedTicket,changeDeletedTicketsPage})(BackupRestore_BackupRestoreSettingsContainer);function Legal_typeof(obj){return(Legal_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Legal_defineProperties(target,props){for(var i=0;i=25})}},{key:"onSearchKeyUp",value:function(e){var _this3=this,keyCode=e.keyCode||e.which,search=e.target.value;13===keyCode&&(search.length>2?this.props.unloadAccounts().then(function(){_this3.hasMore=!1,_this3.props.fetchAccounts({limit:-1,search}).then(function(_ref2){var response=_ref2.response;_this3.pageStart=-1,_this3.hasMore=response.count>=25})}):0===search.length&&this.props.unloadAccounts().then(function(){_this3.pageStart=-1,_this3.getUsersWithPage(0)}))}},{key:"render",value:function(){var _this4=this,items=this.props.accountsState.accounts&&this.props.accountsState.accounts.map(function(user){var userImage=user.get("image")||"defaultProfile.jpg",actionMenu=[react_default.a.createElement(Dropdown_DropdownItem,{key:0,text:"Edit",onClick:function(e){return _this4.onEditAccountClicked(e,user)}})];user.get("deleted")?actionMenu.push(react_default.a.createElement(Dropdown_DropdownItem,{key:2,text:"Enable",onClick:function(e){return _this4.onEnableAccountClicked(e,user)}})):actionMenu.push(react_default.a.createElement(Dropdown_DropdownItem,{key:1,text:"Delete",extraClass:"uk-text-danger",onClick:function(e){return _this4.onDeleteAccountClicked(e,user)}}));var isAdmin=user.getIn(["role","isAdmin"])||!1,isAgent=user.getIn(["role","isAgent"])||!1,customer=!isAdmin&&!isAgent,isDeleted=user.get("deleted")||!1;return react_default.a.createElement(Grid_GridItem,{key:user.get("_id"),width:"1-5",xLargeWidth:"1-6",extraClass:"mb-25"},react_default.a.createElement(components_TruCard,{loaderActive:user.get("loading"),menu:actionMenu,extraHeadClass:(isAdmin?"tru-card-head-admin":"")+(!isAdmin&&isAgent?"tru-card-head-agent":"")+(isDeleted?" tru-card-head-deleted":""),header:react_default.a.createElement("div",null,react_default.a.createElement("div",{className:"account-image relative uk-display-inline-block"},react_default.a.createElement("img",{src:"/uploads/users/".concat(userImage),alt:"ProfilePic",className:"tru-card-head-avatar"}),react_default.a.createElement("span",{"data-user-status-id":user.get("_id"),className:"user-status-large user-offline uk-border-circle"})),react_default.a.createElement("h3",{className:"tru-card-head-text uk-text-center"},user.get("fullname"),react_default.a.createElement("span",{className:"uk-text-truncate"},user.get("title")))),content:react_default.a.createElement("ul",{className:"tru-list"},react_default.a.createElement("li",null,react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Role"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted"},user.getIn(["role","name"])))),react_default.a.createElement("li",null,react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Email"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted"},react_default.a.createElement("a",{href:"mailto:".concat(user.get("email"))},user.get("email"))))),react_default.a.createElement("li",null,customer&&user.get("groups")&&react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Groups"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted uk-text-truncate"},user.get("groups").map(function(group){return group.get("name")+(user.get("groups").toArray().length>1?", ":"")}))),!customer&&user.get("teams")&&react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Teams"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted uk-text-truncate"},user.get("teams").map(function(team){return team.get("name")+(user.get("teams").toArray().length>1?", ":"")})))),!customer&&user.get("departments")&&react_default.a.createElement("li",null,react_default.a.createElement("div",{className:"tru-list-content"},react_default.a.createElement("span",{className:"tru-list-heading"},"Departments"),react_default.a.createElement("span",{className:"uk-text-small uk-text-muted uk-text-truncate"},user.get("departments").map(function(department){return department.get("name")+(user.get("departments").toArray().length>1?", ":"")})))))}))});return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:this.props.title,rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-4 uk-push-3-4 mt-15 pr-20 uk-clearfix"},react_default.a.createElement(components_ButtonGroup,{classNames:"uk-clearfix uk-float-right"},react_default.a.createElement(components_Button,{text:"Create",hasDropdown:!1,flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(){return _this4.props.showModal("CREATE_ACCOUNT")}}),helpers_default.a.canUser("accounts:import",!0)&&react_default.a.createElement(Dropdown_DropdownTrigger,{mode:"click",pos:"bottom-right",offset:5,extraClass:"uk-float-right"},react_default.a.createElement(components_Button,{text:"",hasDropdown:!0,small:!0,waves:!1,styleOverride:{padding:"0 5px 0 0"},extraClass:"pr-5 no-border-radius nbl bg-accent md-color-white hover-accent"}),react_default.a.createElement(components_Dropdown,{small:!0},react_default.a.createElement(Dropdown_DropdownHeader,{text:"Account Actions"}),react_default.a.createElement(Dropdown_DropdownItem,{text:"Import",href:"/accounts/import"}))))))}),react_default.a.createElement(components_PageContent,{id:"accounts-page-content"},react_default.a.createElement(react_infinite_scroller_default.a,{pageStart:this.pageStart,loadMore:this.getUsersWithPage,hasMore:this.hasMore,initialLoad:this.initialLoad,threshold:25,loader:react_default.a.createElement("div",{className:"uk-width-1-1 uk-text-center",key:0},react_default.a.createElement("i",{className:"uk-icon-refresh uk-icon-spin"})),useWindow:!1,getScrollParent:function(){return document.getElementById("accounts-page-content")}},react_default.a.createElement(components_Grid,{gutterSize:"medium"},items))))}}])&&Accounts_defineProperties(Constructor.prototype,protoProps),staticProps&&Accounts_defineProperties(Constructor,staticProps),AccountsContainer}()).prototype,"initialLoad",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Accounts_descriptor2=Accounts_applyDecoratedDescriptor(Accounts_class2.prototype,"hasMore",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),Accounts_descriptor3=Accounts_applyDecoratedDescriptor(Accounts_class2.prototype,"pageStart",[mobx_module.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return-1}}),Accounts_class=Accounts_class2))||Accounts_class;Accounts_AccountsContainer.propTypes={title:prop_types_default.a.string.isRequired,view:prop_types_default.a.string.isRequired,fetchAccounts:prop_types_default.a.func.isRequired,deleteAccount:prop_types_default.a.func.isRequired,enableAccount:prop_types_default.a.func.isRequired,unloadAccounts:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired,common:prop_types_default.a.object.isRequired,shared:prop_types_default.a.object.isRequired,accountsState:prop_types_default.a.object.isRequired},Accounts_AccountsContainer.defaultProps={title:"Accounts",view:"customers"};var Accounts=Object(es.b)(function(state){return{shared:state.shared,accountsState:state.accountsState,common:state.common}},{fetchAccounts:accounts_fetchAccounts,deleteAccount:accounts_deleteAccount,enableAccount:accounts_enableAccount,unloadAccounts,showModal})(Accounts_AccountsContainer);function Groups_typeof(obj){return(Groups_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Groups_defineProperties(target,props){for(var i=0;iAre you sure?\n

    \n This is a permanent action. \n

    \n

    \n Agents may lose access to resources once this group is deleted.\n

    \n Groups that are associated with ticket cannot be deleted.\n ',function(){_this.props.deleteGroup({_id})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this2=this,tableItems=this.props.groups.map(function(group){return react_default.a.createElement(Table_TableRow,{key:group.get("_id"),className:"vam nbb"},react_default.a.createElement(Table_TableCell,{style:{fontWeight:500,padding:"18px 15px"}},group.get("name")),react_default.a.createElement(Table_TableCell,{style:{padding:"13px 20px 8px 8px"}},group.get("members")&&group.get("members").size>0&&group.get("members").filter(function(user){return!user.get("deleted")}).map(function(user){var profilePic=user.get("image")||"defaultProfile.jpg";return react_default.a.createElement("div",{key:user.get("_id"),className:"uk-float-left uk-position-relative mb-10","data-uk-tooltip":'{pos: "bottom"}',title:user.get("fullname")},react_default.a.createElement("img",{style:{width:25,height:25,marginRight:5},className:"round",src:"/uploads/users/".concat(profilePic),alt:user.get("fullname")}),react_default.a.createElement("span",{"data-user-status-id":user.get("_id"),className:"user-offline uk-border-circle",style:{width:13,height:13}}))}),!group.get("members")&&react_default.a.createElement("div",null)),react_default.a.createElement(Table_TableCell,{style:{textAlign:"right",paddingRight:15}},react_default.a.createElement(components_ButtonGroup,null,helpers_default.a.canUser("groups:update",!0)&&react_default.a.createElement(components_Button,{text:"Edit",small:!0,waves:!0,onClick:function(){return _this2.onEditGroupClick(group.toJS())}}),helpers_default.a.canUser("groups:delete",!0)&&react_default.a.createElement(components_Button,{text:"Delete",style:"danger",small:!0,waves:!0,onClick:function(){return _this2.onDeleteGroupClick(group.get("_id"))}}))))});return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Customer Groups",rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-1 mt-15 uk-text-right"},react_default.a.createElement(components_Button,{text:"Create",flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(){return _this2.onCreateGroupClick()}})))}),react_default.a.createElement(components_PageContent,{padding:0,paddingBottom:0},react_default.a.createElement(components_Table,{headers:[react_default.a.createElement(Table_TableHeader,{key:0,width:"25%",height:40,text:"Name",padding:"8px 8px 8px 15px"}),react_default.a.createElement(Table_TableHeader,{key:1,width:"50%",text:"Group Members"}),react_default.a.createElement(Table_TableHeader,{key:2,width:130,text:"Group Actions"})]},tableItems)))}}])&&Groups_defineProperties(Constructor.prototype,protoProps),staticProps&&Groups_defineProperties(Constructor,staticProps),GroupsContainer}();Groups_GroupsContainer.propTypes={groups:prop_types_default.a.object.isRequired,fetchGroups:prop_types_default.a.func.isRequired,deleteGroup:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Groups=Object(es.b)(function(state){return{groups:state.groupsState.groups}},{fetchGroups:groups_fetchGroups,deleteGroup:groups_deleteGroup,showModal})(Groups_GroupsContainer);function Teams_typeof(obj){return(Teams_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Teams_defineProperties(target,props){for(var i=0;iAre you sure?\n

    \n This is a permanent action. \n

    \n

    \n Agents may lose access to resources once this team is deleted.\n

    \n ',function(){_this.props.deleteTeam({_id})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this2=this,tableItems=this.props.teamsState.teams.map(function(team){return react_default.a.createElement(Table_TableRow,{key:team.get("_id"),className:"vam nbb"},react_default.a.createElement(Table_TableCell,{style:{fontWeight:500,padding:"18px 15px"}},team.get("name")),react_default.a.createElement(Table_TableCell,{style:{padding:"13px 8px 8px 8px"}},team.get("members")&&team.get("members").size>0&&team.get("members").filter(function(user){return!user.get("deleted")}).map(function(user){var profilePic=user.get("image")||"defaultProfile.jpg";return react_default.a.createElement("div",{key:user.get("_id"),className:"uk-float-left uk-position-relative mb-10","data-uk-tooltip":'{pos: "bottom"}',title:user.get("fullname")},react_default.a.createElement("img",{style:{width:25,height:25,marginRight:5},className:"round",src:"/uploads/users/".concat(profilePic),alt:user.get("fullname")}),react_default.a.createElement("span",{"data-user-status-id":user.get("_id"),className:"user-offline uk-border-circle",style:{width:13,height:13}}))})),react_default.a.createElement(Table_TableCell,{style:{textAlign:"right",paddingRight:15}},react_default.a.createElement(components_ButtonGroup,null,helpers_default.a.canUser("teams:update",!0)&&react_default.a.createElement(components_Button,{text:"Edit",small:!0,waves:!0,onClick:function(){return _this2.onEditTeamClick(team.toJS())}}),helpers_default.a.canUser("teams:delete",!0)&&react_default.a.createElement(components_Button,{text:"Delete",style:"danger",small:!0,waves:!0,onClick:function(){return _this2.onDeleteTeamClick(team.get("_id"))}}))))});return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Teams",shadow:!0,rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-1 mt-15 uk-text-right"},react_default.a.createElement(components_Button,{text:"Create",flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(e){return _this2.onCreateTeamClick(e)}})))}),react_default.a.createElement(components_PageContent,{id:"teams-page-content",padding:0,paddingBottom:0},react_default.a.createElement(components_Table,{headers:[react_default.a.createElement(Table_TableHeader,{key:0,width:"25%",height:40,text:"Name",padding:"8px 8px 8px 15px"}),react_default.a.createElement(Table_TableHeader,{key:1,width:"50%",text:"Team Members"}),react_default.a.createElement(Table_TableHeader,{key:2,width:130,text:"Team Actions"})]},this.props.teamsState.teams.size<1&&react_default.a.createElement(Table_TableRow,null,react_default.a.createElement(Table_TableCell,{colSpan:3},react_default.a.createElement("h5",{style:{paddingLeft:8}},"No Teams"))),tableItems)))}}])&&Teams_defineProperties(Constructor.prototype,protoProps),staticProps&&Teams_defineProperties(Constructor,staticProps),TeamsContainer}();Teams_TeamsContainer.propTypes={teamsState:prop_types_default.a.object.isRequired,fetchTeams:prop_types_default.a.func.isRequired,unloadTeams:prop_types_default.a.func.isRequired,deleteTeam:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Teams=Object(es.b)(function(state){return{teamsState:state.teamsState}},{fetchTeams:teams_fetchTeams,unloadTeams,deleteTeam:teams_deleteTeam,showModal})(Teams_TeamsContainer);function Departments_typeof(obj){return(Departments_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Departments_defineProperties(target,props){for(var i=0;iAre you sure?\n

    \n This is a permanent action. \n

    \n

    \n Agents may lose access to resources once this department is deleted.\n

    \n ',function(){_this.props.deleteDepartment({_id})},{labels:{Ok:"Yes",Cancel:"No"},confirmButtonClass:"md-btn-danger"})}},{key:"render",value:function(){var _this2=this;return react_default.a.createElement("div",null,react_default.a.createElement(components_PageTitle,{title:"Departments",shadow:!1,rightComponent:react_default.a.createElement("div",{className:"uk-grid uk-grid-collapse"},react_default.a.createElement("div",{className:"uk-width-1-1 mt-15 uk-text-right"},react_default.a.createElement(components_Button,{text:"Create",flat:!1,small:!0,waves:!1,extraClass:"hover-accent",onClick:function(){return _this2.onCreateDepartmentClick()}})))}),react_default.a.createElement(components_PageContent,{padding:0},react_default.a.createElement("table",{className:"uk-table uk-table-striped sticky-header fixed-width"},react_default.a.createElement("thead",null,react_default.a.createElement("tr",null,react_default.a.createElement("th",{style:{width:"35%",verticalAlign:"middle",fontSize:12,textTransform:"uppercase",padding:"8px 8px 8px 27px"}},"Name"),react_default.a.createElement("th",{style:{verticalAlign:"middle",fontSize:12,textTransform:"uppercase"}},"Teams"),react_default.a.createElement("th",{style:{width:"25%",verticalAlign:"middle",fontSize:12,textTransform:"uppercase"}},"Groups"),react_default.a.createElement("th",{style:{width:220,verticalAlign:"middle",fontSize:12,textTransform:"uppercase"}},"Actions"))),react_default.a.createElement("tbody",{className:"scrollable full-height"},this.props.departments&&this.props.departments.map(function(department){var teams=department.get("teams"),groups=department.get("groups");return react_default.a.createElement("tr",{key:department.get("_id")},react_default.a.createElement("td",{style:{verticalAlign:"middle",padding:"8px 8px 8px 26px"}},react_default.a.createElement("div",{style:{fontWeight:"500"}},department.get("name"))),react_default.a.createElement("td",{style:{verticalAlign:"middle"}},teams&&teams.map(function(team){return react_default.a.createElement("div",{key:team.get("_id"),style:{marginBottom:4}},team.get("name"))})),react_default.a.createElement("td",{style:{verticalAlign:"middle"}},!0===department.get("allGroups")&&react_default.a.createElement("div",null,react_default.a.createElement("h6",{className:"text-success",style:{fontWeight:"bold"}},"All Groups")),!0===department.get("publicGroups")&&react_default.a.createElement("div",null,react_default.a.createElement("h6",{className:"text-success",style:{fontWeight:"bold"}},"All Public Groups")),!0!==department.get("allGroups")&&groups&&groups.map(function(group){return react_default.a.createElement("div",{key:group.get("_id"),style:{marginBottom:4}},group.get("name"))})),react_default.a.createElement("td",null,react_default.a.createElement(components_ButtonGroup,null,helpers_default.a.canUser("departments:update",!0)&&react_default.a.createElement(components_Button,{text:"Edit",small:!0,waves:!0,onClick:function(){return _this2.onEditDepartmentClick(department)}}),helpers_default.a.canUser("departments:delete",!0)&&react_default.a.createElement(components_Button,{text:"Delete",style:"danger",small:!0,waves:!0,onClick:function(){return _this2.onDeleteDepartmentClick(department.get("_id"))}}))))})))))}}])&&Departments_defineProperties(Constructor.prototype,protoProps),staticProps&&Departments_defineProperties(Constructor,staticProps),DepartmentsContainer}();Departments_DepartmentsContainer.propTypes={departments:prop_types_default.a.object.isRequired,fetchDepartments:prop_types_default.a.func.isRequired,deleteDepartment:prop_types_default.a.func.isRequired,showModal:prop_types_default.a.func.isRequired};var Departments=Object(es.b)(function(state){return{departments:state.departmentsState.departments}},{fetchDepartments:departments_fetchDepartments,deleteDepartment:departments_deleteDepartment,showModal})(Departments_DepartmentsContainer),renderer=function(store){if(document.getElementById("tickets-container")){var view=document.getElementById("tickets-container").getAttribute("data-view"),page=document.getElementById("tickets-container").getAttribute("data-page"),filter=document.getElementById("tickets-container").getAttribute("data-filter");filter=filter?JSON.parse(filter):{};var TicketsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Tickets_TicketsContainer,{view,page,filter}));react_dom_default.a.render(TicketsContainerWithProvider,document.getElementById("tickets-container"))}if(document.getElementById("single-ticket-container")){var ticketId=document.getElementById("single-ticket-container").getAttribute("data-ticket-id"),ticketUid=document.getElementById("single-ticket-container").getAttribute("data-ticket-uid"),SingleTicketContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Tickets_SingleTicketContainer,{ticketId,ticketUid}));react_dom_default.a.render(SingleTicketContainerWithProvider,document.getElementById("single-ticket-container"))}if(document.getElementById("accounts-container")){var title=document.getElementById("accounts-container").getAttribute("data-title"),_view=document.getElementById("accounts-container").getAttribute("data-view"),AccountsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Accounts,{title,view:_view}));react_dom_default.a.render(AccountsContainerWithProvider,document.getElementById("accounts-container"))}if(document.getElementById("groups-container")){var GroupsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Groups,null));react_dom_default.a.render(GroupsContainerWithProvider,document.getElementById("groups-container"))}if(document.getElementById("teams-container")){var TeamsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Teams,null));react_dom_default.a.render(TeamsContainerWithProvider,document.getElementById("teams-container"))}if(document.getElementById("departments-container")){var _TeamsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Departments,null));react_dom_default.a.render(_TeamsContainerWithProvider,document.getElementById("departments-container"))}if(document.getElementById("settings-container")){var SettingsContainerWithProvider=react_default.a.createElement(es.a,{store},react_default.a.createElement(Settings_SettingsContainer,null));react_dom_default.a.render(SettingsContainerWithProvider,document.getElementById("settings-container"))}};var sagaMiddleware=Object(redux_saga_es.a)(),composeSetup=redux.d;localStorage.setItem("debug","trudesk:*");var preloadedState={common:window.trudesk.__PRELOADED_STATE__};delete window.trudesk,jquery_default()("script#preloader").remove();var app_store=Object(redux.e)(reducers,preloadedState,composeSetup(Object(redux.a)(redux_saga_thunk.middleware,sagaMiddleware)));window.react.redux={store:app_store},sagaMiddleware.run(function*(){yield Object(effects.a)([watcher(),tickets_watcher(),settingsWatcher(),accounts_watcher(),groups_watcher(),teams_watcher(),departments_watcher(),search_watcher()])});var sidebarWithProvider=react_default.a.createElement(es.a,{store:app_store},react_default.a.createElement(Nav_Sidebar,null));if(react_dom_default.a.render(sidebarWithProvider,document.getElementById("side-nav")),document.getElementById("modal-wrapper")){var RootModal=react_default.a.createElement(es.a,{store:app_store},react_default.a.createElement(Modals,null));react_dom_default.a.render(RootModal,document.getElementById("modal-wrapper"))}if(document.getElementById("topbar")){var TopbarRoot=react_default.a.createElement(es.a,{store:app_store},react_default.a.createElement(Topbar_TopbarContainer,null));react_dom_default.a.render(TopbarRoot,document.getElementById("topbar"))}window.react.renderer=renderer,window.react.dom=react_dom_default.a,renderer(app_store)}}]); \ No newline at end of file