-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathguacamole.min.js.mic-fix-v1.1
1 lines (1 loc) · 344 KB
/
guacamole.min.js.mic-fix-v1.1
1
var Guacamole=Guacamole||{};Guacamole.ArrayBufferReader=function(e){var n=this;e.onblob=function(e){for(var t=window.atob(e),a=new ArrayBuffer(t.length),r=new Uint8Array(a),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);n.ondata&&n.ondata(a)},e.onend=function(){n.onend&&n.onend()},this.ondata=null,this.onend=null},(Guacamole=Guacamole||{}).ArrayBufferWriter=function(e){function n(n){for(var t="",a=0;a<n.byteLength;a++)t+=String.fromCharCode(n[a]);e.sendBlob(window.btoa(t))}var t=this;e.onack=function(e){t.onack&&t.onack(e)},this.blobLength=Guacamole.ArrayBufferWriter.DEFAULT_BLOB_LENGTH,this.sendData=function(e){var a=new Uint8Array(e);if(a.length<=t.blobLength)n(a);else for(var r=0;r<a.length;r+=t.blobLength)n(a.subarray(r,r+t.blobLength))},this.sendEnd=function(){e.sendEnd()},this.onack=null},Guacamole.ArrayBufferWriter.DEFAULT_BLOB_LENGTH=6048,(Guacamole=Guacamole||{}).AudioContextFactory={singleton:null,getAudioContext:function(){var e=window.AudioContext||window.webkitAudioContext;if(e)try{return Guacamole.AudioContextFactory.singleton||(Guacamole.AudioContextFactory.singleton=new e),Guacamole.AudioContextFactory.singleton}catch(e){}return null}},(Guacamole=Guacamole||{}).AudioPlayer=function(){this.sync=function(){}},Guacamole.AudioPlayer.isSupportedType=function(e){return Guacamole.RawAudioPlayer.isSupportedType(e)},Guacamole.AudioPlayer.getSupportedTypes=function(){return Guacamole.RawAudioPlayer.getSupportedTypes()},Guacamole.AudioPlayer.getInstance=function(e,n){return Guacamole.RawAudioPlayer.isSupportedType(n)?new Guacamole.RawAudioPlayer(e,n):null},Guacamole.RawAudioPlayer=function(e,n){var t=Guacamole.RawAudioFormat.parse(n),a=Guacamole.AudioContextFactory.getAudioContext(),r=a.currentTime,o=new Guacamole.ArrayBufferReader(e),i=1===t.bytesPerSample?window.Int8Array:window.Int16Array,s=1===t.bytesPerSample?128:32768,c=[],l=function(e){if(e.length<=1)return e[0];var n=0;e.forEach(function(e){n+=e.length});var t=0,a=new i(n);return e.forEach(function(e){a.set(e,t),t+=e.length}),a},u=function(e){for(var n=Number.MAX_VALUE,a=e.length,r=Math.floor(e.length/t.channels),o=Math.floor(.02*t.rate),s=Math.max(t.channels*o,t.channels*(r-o));s<e.length;s+=t.channels){for(var c=0,l=0;l<t.channels;l++)c+=Math.abs(e[s+l]);c<=n&&(a=s+t.channels,n=c)}return a===e.length?[e]:[new i(e.buffer.slice(0,a*t.bytesPerSample)),new i(e.buffer.slice(a*t.bytesPerSample))]},m=function(e){c.push(new i(e))},p=function(){var e=l(c);return e?(c=u(e),e=c.shift()):null},d=function(e){var n=e.length/t.channels,o=a.currentTime;r<o&&(r=o);for(var i=a.createBuffer(t.channels,n,t.rate),c=0;c<t.channels;c++)for(var l=i.getChannelData(c),u=c,m=0;m<n;m++)l[m]=e[u]/s,u+=t.channels;return i};o.ondata=function(e){m(new i(e));var n=p();if(n){var o=a.currentTime;r<o&&(r=o);var s=a.createBufferSource();s.connect(a.destination),s.start||(s.start=s.noteOn),s.buffer=d(n),s.start(r),r+=n.length/t.channels/t.rate}},this.sync=function(){var e=a.currentTime;r=Math.min(r,e+.3)}},Guacamole.RawAudioPlayer.prototype=new Guacamole.AudioPlayer,Guacamole.RawAudioPlayer.isSupportedType=function(e){return!!Guacamole.AudioContextFactory.getAudioContext()&&null!==Guacamole.RawAudioFormat.parse(e)},Guacamole.RawAudioPlayer.getSupportedTypes=function(){return Guacamole.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]},(Guacamole=Guacamole||{}).AudioRecorder=function(){this.onclose=null,this.onerror=null},Guacamole.AudioRecorder.isSupportedType=function(e){return Guacamole.RawAudioRecorder.isSupportedType(e)},Guacamole.AudioRecorder.getSupportedTypes=function(){return Guacamole.RawAudioRecorder.getSupportedTypes()},Guacamole.AudioRecorder.getInstance=function(e,n){return Guacamole.RawAudioRecorder.isSupportedType(n)?new Guacamole.RawAudioRecorder(e,n):null},Guacamole.RawAudioRecorder=function(e,n){var t=this,a=Guacamole.RawAudioFormat.parse(n),r=Guacamole.AudioContextFactory.getAudioContext();navigator.mediaDevices||(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia&&""!=navigator.mediaDevices.getUserMedia.name||(navigator.mediaDevices.getUserMedia=(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia).bind(navigator));var o=new Guacamole.ArrayBufferWriter(e),i=1===a.bytesPerSample?window.Int8Array:window.Int16Array,s=1===a.bytesPerSample?128:32768,c=0,l=0,u=null,m=null,p=null,d=function(e){if(0===e)return 1;var n=Math.PI*e;return Math.sin(n)/n},g=function(e,n){return-n<e&&e<n?d(e)*d(e/n):0},f=function(e,n){for(var t=(e.length-1)*n,a=Math.floor(t)-3+1,r=Math.floor(t)+3,o=0,i=a;i<=r;i++)o+=(e[i]||0)*g(t-i,3);return o},h=function(e){var n=e.length;c+=n;var t=Math.round(c*a.rate/e.sampleRate)-l;l+=t;for(var r=new i(t*a.channels),o=0;o<a.channels;o++)for(var u=e.getChannelData(o),m=o,p=0;p<t;p++)r[m]=f(u,p/(t-1))*s,m+=a.channels;return r},E=function(){navigator.mediaDevices.getUserMedia({audio:!0},function(e){(p=r.createScriptProcessor(2048,a.channels,a.channels)).connect(r.destination),p.onaudioprocess=function(e){o.sendData(h(e.inputBuffer).buffer)},(m=r.createMediaStreamSource(e)).connect(p),u=e},function(){o.sendEnd(),t.onerror&&t.onerror()})},v=function(){if(m&&m.disconnect(),p&&p.disconnect(),u)for(var e=u.getTracks(),n=0;n<e.length;n++)e[n].stop();p=null,m=null,u=null,o.sendEnd()};o.onack=function(e){e.code!==Guacamole.Status.Code.SUCCESS||u?(v(),o.onack=null,e.code===Guacamole.Status.Code.RESOURCE_CLOSED?t.onclose&&t.onclose():t.onerror&&t.onerror()):E()}},Guacamole.RawAudioRecorder.prototype=new Guacamole.AudioRecorder,Guacamole.RawAudioRecorder.isSupportedType=function(e){return!!Guacamole.AudioContextFactory.getAudioContext()&&null!==Guacamole.RawAudioFormat.parse(e)},Guacamole.RawAudioRecorder.getSupportedTypes=function(){return Guacamole.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]},(Guacamole=Guacamole||{}).BlobReader=function(e,n){var t,a=this,r=0;t=window.BlobBuilder?new BlobBuilder:window.WebKitBlobBuilder?new WebKitBlobBuilder:window.MozBlobBuilder?new MozBlobBuilder:new function(){var e=[];this.append=function(t){e.push(new Blob([t],{type:n}))},this.getBlob=function(){return new Blob(e,{type:n})}},e.onblob=function(n){for(var o=window.atob(n),i=new ArrayBuffer(o.length),s=new Uint8Array(i),c=0;c<o.length;c++)s[c]=o.charCodeAt(c);t.append(i),r+=i.byteLength,a.onprogress&&a.onprogress(i.byteLength),e.sendAck("OK",0)},e.onend=function(){a.onend&&a.onend()},this.getLength=function(){return r},this.getBlob=function(){return t.getBlob()},this.onprogress=null,this.onend=null},(Guacamole=Guacamole||{}).BlobWriter=function(e){var n=this,t=new Guacamole.ArrayBufferWriter(e);t.onack=function(e){n.onack&&n.onack(e)};var a=function(e,n,t){var a=(e.slice||e.webkitSlice||e.mozSlice).bind(e),r=t-n;if(r!==t){var o=a(n,r);if(o.size===r)return o}return a(n,t)};this.sendBlob=function(e){var r=0,o=new FileReader,i=function(){if(r>=e.size)n.oncomplete&&n.oncomplete(e);else{var i=a(e,r,r+t.blobLength);r+=t.blobLength,o.readAsArrayBuffer(i)}};o.onload=function(){t.sendData(o.result),t.onack=function(a){n.onack&&n.onack(a),a.isError()||(n.onprogress&&n.onprogress(e,r-t.blobLength),i())}},o.onerror=function(){n.onerror&&n.onerror(e,r,o.error)},i()},this.sendEnd=function(){t.sendEnd()},this.onack=null,this.onerror=null,this.onprogress=null,this.oncomplete=null},(Guacamole=Guacamole||{}).Client=function(e){function n(e){e!=s&&(s=e,r.onstatechange&&r.onstatechange(s))}function t(){return s==i||s==o}function a(n){var t=h[n];return null==t&&((t=h[n]=new Guacamole.Parser).oninstruction=e.oninstruction),t}var r=this,o=2,i=3,s=0,c=0,l=null,u={0:"butt",1:"round",2:"square"},m={0:"bevel",1:"miter",2:"round"},p=new Guacamole.Display,d={},g={},f={},h=[],E=[],v=[],C=new Guacamole.IntegerPool,S=[];this.exportState=function(e){var n={currentState:s,currentTimestamp:c,layers:{}},t={};for(var a in d)t[a]=d[a];p.flush(function(){for(var a in t){var r=parseInt(a),o=t[a],i=o.toCanvas(),s={width:o.width,height:o.height};o.width&&o.height&&(s.url=i.toDataURL("image/png")),r>0&&(s.x=o.x,s.y=o.y,s.z=o.z,s.alpha=o.alpha,s.matrix=o.matrix,s.parent=y(o.parent)),n.layers[a]=s}e(n)})},this.importState=function(e,n){var t,a;s=e.currentState,c=e.currentTimestamp;for(t in d)(a=parseInt(t))>0&&p.dispose(d[t]);d={};for(t in e.layers){a=parseInt(t);var r=e.layers[t],o=A(a);if(p.resize(o,r.width,r.height),r.url&&(p.setChannelMask(o,Guacamole.Layer.SRC),p.draw(o,0,0,r.url)),a>0&&r.parent>=0){var i=A(r.parent);p.move(o,i,r.x,r.y,r.z),p.shade(o,r.alpha);var l=r.matrix;p.distort(o,l[0],l[1],l[2],l[3],l[4],l[5])}}p.flush(n)},this.getDisplay=function(){return p},this.sendSize=function(n,a){t()&&e.sendMessage("size",n,a)},this.sendKeyEvent=function(n,a){t()&&e.sendMessage("key",a,n)},this.sendMouseState=function(n){if(t()){p.moveCursor(Math.floor(n.x),Math.floor(n.y));var a=0;n.left&&(a|=1),n.middle&&(a|=2),n.right&&(a|=4),n.up&&(a|=8),n.down&&(a|=16),e.sendMessage("mouse",Math.floor(n.x),Math.floor(n.y),a)}},this.createOutputStream=function(){var e=C.next();return S[e]=new Guacamole.OutputStream(r,e)},this.createAudioStream=function(n){var t=r.createOutputStream();return e.sendMessage("audio",t.index,n),t},this.createFileStream=function(n,t){var a=r.createOutputStream();return e.sendMessage("file",a.index,n,t),a},this.createPipeStream=function(n,t){var a=r.createOutputStream();return e.sendMessage("pipe",a.index,n,t),a},this.createClipboardStream=function(n){var t=r.createOutputStream();return e.sendMessage("clipboard",t.index,n),t},this.createArgumentValueStream=function(n,t){var a=r.createOutputStream();return e.sendMessage("argv",a.index,n,t),a},this.createObjectOutputStream=function(n,t,a){var o=r.createOutputStream();return e.sendMessage("put",n,o.index,t,a),o},this.requestObjectInputStream=function(n,a){t()&&e.sendMessage("get",n,a)},this.sendAck=function(n,a,r){t()&&e.sendMessage("ack",n,a,r)},this.sendBlob=function(n,a){t()&&e.sendMessage("blob",n,a)},this.endStream=function(n){t()&&(e.sendMessage("end",n),S[n]&&(C.free(n),delete S[n]))},this.onstatechange=null,this.onname=null,this.onerror=null,this.onaudio=null,this.onvideo=null,this.onargv=null,this.onclipboard=null,this.onfile=null,this.onfilesystem=null,this.onpipe=null,this.onsync=null;var A=function(e){var n=d[e];return n||(n=0===e?p.getDefaultLayer():e>0?p.createLayer():p.createBuffer(),d[e]=n),n},y=function(e){if(!e)return null;for(var n in d)if(e===d[n])return parseInt(n);return null},T={"miter-limit":function(e,n){p.setMiterLimit(e,parseFloat(n))}},I={ack:function(e){var n=parseInt(e[0]),t=e[1],a=parseInt(e[2]),r=S[n];r&&(r.onack&&r.onack(new Guacamole.Status(a,t)),a>=256&&S[n]===r&&(C.free(n),delete S[n]))},arc:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]),r=parseInt(e[3]),o=parseFloat(e[4]),i=parseFloat(e[5]),s=parseInt(e[6]);p.arc(n,t,a,r,o,i,0!=s)},argv:function(e){var n=parseInt(e[0]),t=e[1],a=e[2];if(r.onargv){var o=E[n]=new Guacamole.InputStream(r,n);r.onargv(o,t,a)}else r.sendAck(n,"Receiving argument values unsupported",256)},audio:function(e){var n=parseInt(e[0]),t=e[1],a=E[n]=new Guacamole.InputStream(r,n),o=null;r.onaudio&&(o=r.onaudio(a,t)),o||(o=Guacamole.AudioPlayer.getInstance(a,t)),o?(g[n]=o,r.sendAck(n,"OK",0)):r.sendAck(n,"BAD TYPE",783)},blob:function(e){var n=parseInt(e[0]),t=e[1],a=E[n];a&&a.onblob&&a.onblob(t)},body:function(e){var n=parseInt(e[0]),t=v[n],a=parseInt(e[1]),o=e[2],i=e[3];if(t&&t.onbody){var s=E[a]=new Guacamole.InputStream(r,a);t.onbody(s,o,i)}else r.sendAck(a,"Receipt of body unsupported",256)},cfill:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=parseInt(e[2]),r=parseInt(e[3]),o=parseInt(e[4]),i=parseInt(e[5]);p.setChannelMask(t,n),p.fillColor(t,a,r,o,i)},clip:function(e){var n=A(parseInt(e[0]));p.clip(n)},clipboard:function(e){var n=parseInt(e[0]),t=e[1];if(r.onclipboard){var a=E[n]=new Guacamole.InputStream(r,n);r.onclipboard(a,t)}else r.sendAck(n,"Clipboard unsupported",256)},close:function(e){var n=A(parseInt(e[0]));p.close(n)},copy:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]),r=parseInt(e[3]),o=parseInt(e[4]),i=parseInt(e[5]),s=A(parseInt(e[6])),c=parseInt(e[7]),l=parseInt(e[8]);p.setChannelMask(s,i),p.copy(n,t,a,r,o,s,c,l)},cstroke:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=u[parseInt(e[2])],r=m[parseInt(e[3])],o=parseInt(e[4]),i=parseInt(e[5]),s=parseInt(e[6]),c=parseInt(e[7]),l=parseInt(e[8]);p.setChannelMask(t,n),p.strokeColor(t,a,r,o,i,s,c,l)},cursor:function(e){var n=parseInt(e[0]),t=parseInt(e[1]),a=A(parseInt(e[2])),r=parseInt(e[3]),o=parseInt(e[4]),i=parseInt(e[5]),s=parseInt(e[6]);p.setCursor(n,t,a,r,o,i,s)},curve:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]),r=parseInt(e[3]),o=parseInt(e[4]),i=parseInt(e[5]),s=parseInt(e[6]);p.curveTo(n,t,a,r,o,i,s)},disconnect:function(e){r.disconnect()},dispose:function(e){var n=parseInt(e[0]);if(n>0){var t=A(n);p.dispose(t),delete d[n]}else n<0&&delete d[n]},distort:function(e){var n=parseInt(e[0]),t=parseFloat(e[1]),a=parseFloat(e[2]),r=parseFloat(e[3]),o=parseFloat(e[4]),i=parseFloat(e[5]),s=parseFloat(e[6]);if(n>=0){var c=A(n);p.distort(c,t,a,r,o,i,s)}},error:function(e){var n=e[0],t=parseInt(e[1]);r.onerror&&r.onerror(new Guacamole.Status(t,n)),r.disconnect()},end:function(e){var n=parseInt(e[0]),t=E[n];t&&(t.onend&&t.onend(),delete E[n])},file:function(e){var n=parseInt(e[0]),t=e[1],a=e[2];if(r.onfile){var o=E[n]=new Guacamole.InputStream(r,n);r.onfile(o,t,a)}else r.sendAck(n,"File transfer unsupported",256)},filesystem:function(e){var n=parseInt(e[0]),t=e[1];if(r.onfilesystem){var a=v[n]=new Guacamole.Object(r,n);r.onfilesystem(a,t)}},identity:function(e){var n=A(parseInt(e[0]));p.setTransform(n,1,0,0,1,0,0)},img:function(e){var n=parseInt(e[0]),t=parseInt(e[1]),a=A(parseInt(e[2])),o=e[3],i=parseInt(e[4]),s=parseInt(e[5]),c=E[n]=new Guacamole.InputStream(r,n),l=new Guacamole.DataURIReader(c,o);l.onend=function(){p.setChannelMask(a,t),p.draw(a,i,s,l.getURI())}},jpeg:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=parseInt(e[2]),r=parseInt(e[3]),o=e[4];p.setChannelMask(t,n),p.draw(t,a,r,"data:image/jpeg;base64,"+o)},lfill:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=A(parseInt(e[2]));p.setChannelMask(t,n),p.fillLayer(t,a)},line:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]);p.lineTo(n,t,a)},lstroke:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=A(parseInt(e[2]));p.setChannelMask(t,n),p.strokeLayer(t,a)},mouse:function(e){var n=parseInt(e[0]),t=parseInt(e[1]);p.showCursor(!0),p.moveCursor(n,t)},move:function(e){var n=parseInt(e[0]),t=parseInt(e[1]),a=parseInt(e[2]),r=parseInt(e[3]),o=parseInt(e[4]);if(n>0&&t>=0){var i=A(n),s=A(t);p.move(i,s,a,r,o)}},name:function(e){r.onname&&r.onname(e[0])},nest:function(e){a(parseInt(e[0])).receive(e[1])},pipe:function(e){var n=parseInt(e[0]),t=e[1],a=e[2];if(r.onpipe){var o=E[n]=new Guacamole.InputStream(r,n);r.onpipe(o,t,a)}else r.sendAck(n,"Named pipes unsupported",256)},png:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=parseInt(e[2]),r=parseInt(e[3]),o=e[4];p.setChannelMask(t,n),p.draw(t,a,r,"data:image/png;base64,"+o)},pop:function(e){var n=A(parseInt(e[0]));p.pop(n)},push:function(e){var n=A(parseInt(e[0]));p.push(n)},rect:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]),r=parseInt(e[3]),o=parseInt(e[4]);p.rect(n,t,a,r,o)},reset:function(e){var n=A(parseInt(e[0]));p.reset(n)},set:function(e){var n=A(parseInt(e[0])),t=e[1],a=e[2],r=T[t];r&&r(n,a)},shade:function(e){var n=parseInt(e[0]),t=parseInt(e[1]);if(n>=0){var a=A(n);p.shade(a,t)}},size:function(e){var n=parseInt(e[0]),t=A(n),a=parseInt(e[1]),r=parseInt(e[2]);p.resize(t,a,r)},start:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]);p.moveTo(n,t,a)},sync:function(t){var a=parseInt(t[0]);p.flush(function(){for(var n in g){var t=g[n];t&&t.sync()}a!==c&&(e.sendMessage("sync",a),c=a)}),s===o&&n(i),r.onsync&&r.onsync(a)},transfer:function(e){var n=A(parseInt(e[0])),t=parseInt(e[1]),a=parseInt(e[2]),r=parseInt(e[3]),o=parseInt(e[4]),i=parseInt(e[5]),s=A(parseInt(e[6])),c=parseInt(e[7]),l=parseInt(e[8]);3===i?p.put(n,t,a,r,o,s,c,l):5!==i&&p.transfer(n,t,a,r,o,s,c,l,Guacamole.Client.DefaultTransferFunction[i])},transform:function(e){var n=A(parseInt(e[0])),t=parseFloat(e[1]),a=parseFloat(e[2]),r=parseFloat(e[3]),o=parseFloat(e[4]),i=parseFloat(e[5]),s=parseFloat(e[6]);p.transform(n,t,a,r,o,i,s)},undefine:function(e){var n=parseInt(e[0]),t=v[n];t&&t.onundefine&&t.onundefine()},video:function(e){var n=parseInt(e[0]),t=A(parseInt(e[1])),a=e[2],o=E[n]=new Guacamole.InputStream(r,n),i=null;r.onvideo&&(i=r.onvideo(o,t,a)),i||(i=Guacamole.VideoPlayer.getInstance(o,t,a)),i?(f[n]=i,r.sendAck(n,"OK",0)):r.sendAck(n,"BAD TYPE",783)}};e.oninstruction=function(e,n){var t=I[e];t&&t(n)},this.disconnect=function(){5!=s&&4!=s&&(n(4),l&&window.clearInterval(l),e.sendMessage("disconnect"),e.disconnect(),n(5))},this.connect=function(t){n(1);try{e.connect(t)}catch(e){throw n(0),e}l=window.setInterval(function(){e.sendMessage("nop")},5e3),n(o)}},Guacamole.Client.DefaultTransferFunction={0:function(e,n){n.red=n.green=n.blue=0},15:function(e,n){n.red=n.green=n.blue=255},3:function(e,n){n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=e.alpha},5:function(e,n){},12:function(e,n){n.red=255&~e.red,n.green=255&~e.green,n.blue=255&~e.blue,n.alpha=e.alpha},10:function(e,n){n.red=255&~n.red,n.green=255&~n.green,n.blue=255&~n.blue},1:function(e,n){n.red=e.red&n.red,n.green=e.green&n.green,n.blue=e.blue&n.blue},14:function(e,n){n.red=255&~(e.red&n.red),n.green=255&~(e.green&n.green),n.blue=255&~(e.blue&n.blue)},7:function(e,n){n.red=e.red|n.red,n.green=e.green|n.green,n.blue=e.blue|n.blue},8:function(e,n){n.red=255&~(e.red|n.red),n.green=255&~(e.green|n.green),n.blue=255&~(e.blue|n.blue)},6:function(e,n){n.red=e.red^n.red,n.green=e.green^n.green,n.blue=e.blue^n.blue},9:function(e,n){n.red=255&~(e.red^n.red),n.green=255&~(e.green^n.green),n.blue=255&~(e.blue^n.blue)},4:function(e,n){n.red=~e.red&n.red&255,n.green=~e.green&n.green&255,n.blue=~e.blue&n.blue&255},13:function(e,n){n.red=255&(~e.red|n.red),n.green=255&(~e.green|n.green),n.blue=255&(~e.blue|n.blue)},2:function(e,n){n.red=e.red&~n.red&255,n.green=e.green&~n.green&255,n.blue=e.blue&~n.blue&255},11:function(e,n){n.red=255&(e.red|~n.red),n.green=255&(e.green|~n.green),n.blue=255&(e.blue|~n.blue)}},(Guacamole=Guacamole||{}).DataURIReader=function(e,n){var t=this,a="data:"+n+";base64,";e.onblob=function(e){a+=e},e.onend=function(){t.onend&&t.onend()},this.getURI=function(){return a},this.onend=null},(Guacamole=Guacamole||{}).Display=function(){function e(){for(var e=0;e<d.length;){var n=d[e];if(!n.isReady())break;n.flush(),e++}d.splice(0,e)}function n(e,n){this.isReady=function(){for(var e=0;e<n.length;e++)if(n[e].blocked)return!1;return!0},this.flush=function(){for(var t=0;t<n.length;t++)n[t].execute();e&&e()}}function t(n,t){var a=this;this.blocked=t,this.unblock=function(){a.blocked&&(a.blocked=!1,e())},this.execute=function(){n&&n()}}function a(e,n){var a=new t(e,n);return p.push(a),a}var r=this,o=0,i=0,s=1,c=document.createElement("div");c.style.position="relative",c.style.width=o+"px",c.style.height=i+"px",c.style.transformOrigin=c.style.webkitTransformOrigin=c.style.MozTransformOrigin=c.style.OTransformOrigin=c.style.msTransformOrigin="0 0";var l=new Guacamole.Display.VisibleLayer(o,i),u=new Guacamole.Display.VisibleLayer(0,0);u.setChannelMask(Guacamole.Layer.SRC),c.appendChild(l.getElement()),c.appendChild(u.getElement());var m=document.createElement("div");m.style.position="relative",m.style.width=o*s+"px",m.style.height=i*s+"px",m.appendChild(c),this.cursorHotspotX=0,this.cursorHotspotY=0,this.cursorX=0,this.cursorY=0,this.onresize=null,this.oncursor=null;var p=[],d=[];this.getElement=function(){return m},this.getWidth=function(){return o},this.getHeight=function(){return i},this.getDefaultLayer=function(){return l},this.getCursorLayer=function(){return u},this.createLayer=function(){var e=new Guacamole.Display.VisibleLayer(o,i);return e.move(l,0,0,0),e},this.createBuffer=function(){var e=new Guacamole.Layer(0,0);return e.autosize=1,e},this.flush=function(t){d.push(new n(t,p)),p=[],e()},this.setCursor=function(e,n,t,o,i,s,c){a(function(){r.cursorHotspotX=e,r.cursorHotspotY=n,u.resize(s,c),u.copy(t,o,i,s,c,0,0),r.moveCursor(r.cursorX,r.cursorY),r.oncursor&&r.oncursor(u.toCanvas(),e,n)})},this.showCursor=function(e){var n=u.getElement(),t=n.parentNode;!1===e?t&&t.removeChild(n):t!==c&&c.appendChild(n)},this.moveCursor=function(e,n){u.translate(e-r.cursorHotspotX,n-r.cursorHotspotY),r.cursorX=e,r.cursorY=n},this.resize=function(e,n,t){a(function(){e.resize(n,t),e===l&&(o=n,i=t,c.style.width=o+"px",c.style.height=i+"px",m.style.width=o*s+"px",m.style.height=i*s+"px",r.onresize&&r.onresize(n,t))})},this.drawImage=function(e,n,t,r){a(function(){e.drawImage(n,t,r)})},this.drawBlob=function(e,n,t,r){var o=URL.createObjectURL(r),i=a(function(){s.width&&s.height&&e.drawImage(n,t,s),URL.revokeObjectURL(o)},!0),s=new Image;s.onload=i.unblock,s.onerror=i.unblock,s.src=o},this.draw=function(e,n,t,r){var o=a(function(){i.width&&i.height&&e.drawImage(n,t,i)},!0),i=new Image;i.onload=o.unblock,i.onerror=o.unblock,i.src=r},this.play=function(e,n,t,r){var o=document.createElement("video");o.type=n,o.src=r,o.addEventListener("play",function(){function n(){e.drawImage(0,0,o),o.ended||window.setTimeout(n,20)}n()},!1),a(o.play)},this.transfer=function(e,n,t,r,o,i,s,c,l){a(function(){i.transfer(e,n,t,r,o,s,c,l)})},this.put=function(e,n,t,r,o,i,s,c){a(function(){i.put(e,n,t,r,o,s,c)})},this.copy=function(e,n,t,r,o,i,s,c){a(function(){i.copy(e,n,t,r,o,s,c)})},this.moveTo=function(e,n,t){a(function(){e.moveTo(n,t)})},this.lineTo=function(e,n,t){a(function(){e.lineTo(n,t)})},this.arc=function(e,n,t,r,o,i,s){a(function(){e.arc(n,t,r,o,i,s)})},this.curveTo=function(e,n,t,r,o,i,s){a(function(){e.curveTo(n,t,r,o,i,s)})},this.close=function(e){a(function(){e.close()})},this.rect=function(e,n,t,r,o){a(function(){e.rect(n,t,r,o)})},this.clip=function(e){a(function(){e.clip()})},this.strokeColor=function(e,n,t,r,o,i,s,c){a(function(){e.strokeColor(n,t,r,o,i,s,c)})},this.fillColor=function(e,n,t,r,o){a(function(){e.fillColor(n,t,r,o)})},this.strokeLayer=function(e,n,t,r,o){a(function(){e.strokeLayer(n,t,r,o)})},this.fillLayer=function(e,n){a(function(){e.fillLayer(n)})},this.push=function(e){a(function(){e.push()})},this.pop=function(e){a(function(){e.pop()})},this.reset=function(e){a(function(){e.reset()})},this.setTransform=function(e,n,t,r,o,i,s){a(function(){e.setTransform(n,t,r,o,i,s)})},this.transform=function(e,n,t,r,o,i,s){a(function(){e.transform(n,t,r,o,i,s)})},this.setChannelMask=function(e,n){a(function(){e.setChannelMask(n)})},this.setMiterLimit=function(e,n){a(function(){e.setMiterLimit(n)})},this.dispose=function(e){a(function(){e.dispose()})},this.distort=function(e,n,t,r,o,i,s){a(function(){e.distort(n,t,r,o,i,s)})},this.move=function(e,n,t,r,o){a(function(){e.move(n,t,r,o)})},this.shade=function(e,n){a(function(){e.shade(n)})},this.scale=function(e){c.style.transform=c.style.WebkitTransform=c.style.MozTransform=c.style.OTransform=c.style.msTransform="scale("+e+","+e+")",s=e,m.style.width=o*s+"px",m.style.height=i*s+"px"},this.getScale=function(){return s},this.flatten=function(){function e(e){var n=[];for(var t in e.children)n.push(e.children[t]);return n.sort(function(e,n){var t=e.z-n.z;if(0!==t)return t;var a=e.getElement(),r=n.getElement().compareDocumentPosition(a);return r&Node.DOCUMENT_POSITION_PRECEDING?-1:r&Node.DOCUMENT_POSITION_FOLLOWING?1:0}),n}function n(t,r,o){if(t.width>0&&t.height>0){var i=a.globalAlpha;a.globalAlpha*=t.alpha/255,a.drawImage(t.getCanvas(),r,o);for(var s=e(t),c=0;c<s.length;c++){var l=s[c];n(l,r+l.x,o+l.y)}a.globalAlpha=i}}var t=document.createElement("canvas");t.width=l.width,t.height=l.height;var a=t.getContext("2d");return n(l,0,0),t}},Guacamole.Display.VisibleLayer=function(e,n){Guacamole.Layer.apply(this,[e,n]);var t=this;this.__unique_id=Guacamole.Display.VisibleLayer.__next_id++,this.alpha=255,this.x=0,this.y=0,this.z=0,this.matrix=[1,0,0,1,0,0],this.parent=null,this.children={};var a=t.getCanvas();a.style.position="absolute",a.style.left="0px",a.style.top="0px";var r=document.createElement("div");r.appendChild(a),r.style.width=e+"px",r.style.height=n+"px",r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style.overflow="hidden";var o=this.resize;this.resize=function(e,n){r.style.width=e+"px",r.style.height=n+"px",o(e,n)},this.getElement=function(){return r};var i="translate(0px, 0px)",s="matrix(1, 0, 0, 1, 0, 0)";this.translate=function(e,n){t.x=e,t.y=n,i="translate("+e+"px,"+n+"px)",r.style.transform=r.style.WebkitTransform=r.style.MozTransform=r.style.OTransform=r.style.msTransform=i+" "+s},this.move=function(e,n,a,o){t.parent!==e&&(t.parent&&delete t.parent.children[t.__unique_id],t.parent=e,e.children[t.__unique_id]=t,e.getElement().appendChild(r)),t.translate(n,a),t.z=o,r.style.zIndex=o},this.shade=function(e){t.alpha=e,r.style.opacity=e/255},this.dispose=function(){t.parent&&(delete t.parent.children[t.__unique_id],t.parent=null),r.parentNode&&r.parentNode.removeChild(r)},this.distort=function(e,n,a,o,c,l){t.matrix=[e,n,a,o,c,l],s="matrix("+e+","+n+","+a+","+o+","+c+","+l+")",r.style.transform=r.style.WebkitTransform=r.style.MozTransform=r.style.OTransform=r.style.msTransform=i+" "+s}},Guacamole.Display.VisibleLayer.__next_id=0,(Guacamole=Guacamole||{}).InputSink=function(){var e=this,n=document.createElement("textarea");n.style.position="fixed",n.style.outline="none",n.style.border="none",n.style.margin="0",n.style.padding="0",n.style.height="0",n.style.width="0",n.style.left="0",n.style.bottom="0",n.style.resize="none",n.style.background="transparent",n.style.color="transparent",n.addEventListener("keypress",function(e){n.value=""},!1),n.addEventListener("compositionend",function(e){e.data&&(n.value="")},!1),n.addEventListener("input",function(e){e.data&&!e.isComposing&&(n.value="")},!1),n.addEventListener("focus",function(){window.setTimeout(function(){n.click(),n.select()},0)},!0),this.focus=function(){window.setTimeout(function(){n.focus()},0)},this.getElement=function(){return n},document.addEventListener("keydown",function(n){var t=document.activeElement;if(t&&t!==document.body){var a=t.getBoundingClientRect();if(a.left+a.width>0&&a.top+a.height>0)return}e.focus()},!0)},(Guacamole=Guacamole||{}).InputStream=function(e,n){var t=this;this.index=n,this.onblob=null,this.onend=null,this.sendAck=function(n,a){e.sendAck(t.index,n,a)}},(Guacamole=Guacamole||{}).IntegerPool=function(){var e=this,n=[];this.next_int=0,this.next=function(){return n.length>0?n.shift():e.next_int++},this.free=function(e){n.push(e)}},(Guacamole=Guacamole||{}).JSONReader=function(e){var n=this,t=new Guacamole.StringReader(e),a="";this.getLength=function(){return a.length},this.getJSON=function(){return JSON.parse(a)},t.ontext=function(e){a+=e,n.onprogress&&n.onprogress(e.length)},t.onend=function(){n.onend&&n.onend()},this.onprogress=null,this.onend=null},(Guacamole=Guacamole||{}).Keyboard=function(e){function n(e,n,t){if(!e)return null;var r,o=e.indexOf("U+");if(o>=0){var i=e.substring(o+2);r=String.fromCharCode(parseInt(i,16))}else{if(1!==e.length||3===n)return y(f[e],n);r=e}return!0===t?r=r.toUpperCase():!1===t&&(r=r.toLowerCase()),a(r.charCodeAt(0))}function t(e){return e<=31||e>=127&&e<=159}function a(e){return t(e)?65280|e:e>=0&&e<=255?e:e>=256&&e<=1114111?16777216|e:null}function r(e,n){return y(g[e],n)}function o(){var e=O();if(!e)return!1;var n;do{n=e,e=O()}while(null!==e);return P()&&i.reset(),n.defaultPrevented}var i=this,s="_GUAC_KEYBOARD_HANDLED_BY_"+Guacamole.Keyboard._nextID++;this.onkeydown=null,this.onkeyup=null;var c={keyupUnreliable:!1,altIsTypableOnly:!1,capsLockKeyupUnreliable:!1};navigator&&navigator.platform&&(navigator.platform.match(/ipad|iphone|ipod/i)?c.keyupUnreliable=!0:navigator.platform.match(/^mac/i)&&(c.altIsTypableOnly=!0,c.capsLockKeyupUnreliable=!0));var l=function(){var e=this;this.timestamp=(new Date).getTime(),this.defaultPrevented=!1,this.keysym=null,this.reliable=!1,this.getAge=function(){return(new Date).getTime()-e.timestamp}},u=function(e,t,a,o){l.apply(this),this.keyCode=e,this.keyIdentifier=t,this.key=a,this.location=o,this.keysym=n(a,o)||r(e,o),this.keyupReliable=!c.keyupUnreliable,this.keysym&&!T(this.keysym)&&(this.reliable=!0),!this.keysym&&I(e,t)&&(this.keysym=n(t,o,i.modifiers.shift)),i.modifiers.meta&&65511!==this.keysym&&65512!==this.keysym?this.keyupReliable=!1:65509===this.keysym&&c.capsLockKeyupUnreliable&&(this.keyupReliable=!1);var s=!i.modifiers.ctrl&&!c.altIsTypableOnly;(!i.modifiers.alt&&i.modifiers.ctrl||s&&i.modifiers.alt||i.modifiers.meta||i.modifiers.hyper)&&(this.reliable=!0),C[e]=this.keysym};u.prototype=new l;var m=function(e){l.apply(this),this.charCode=e,this.keysym=a(e),this.reliable=!0};m.prototype=new l;var p=function(e,t,a,o){l.apply(this),this.keyCode=e,this.keyIdentifier=t,this.key=a,this.location=o,this.keysym=r(e,o)||n(a,o),i.pressed[this.keysym]||(this.keysym=C[e]||this.keysym),this.reliable=!0};p.prototype=new l;var d=[],g={8:[65288],9:[65289],12:[65291,65291,65291,65461],13:[65293],16:[65505,65505,65506],17:[65507,65507,65508],18:[65513,65513,65027],19:[65299],20:[65509],27:[65307],32:[32],33:[65365,65365,65365,65465],34:[65366,65366,65366,65459],35:[65367,65367,65367,65457],36:[65360,65360,65360,65463],37:[65361,65361,65361,65460],38:[65362,65362,65362,65464],39:[65363,65363,65363,65462],40:[65364,65364,65364,65458],45:[65379,65379,65379,65456],46:[65535,65535,65535,65454],91:[65515],92:[65383],93:null,96:[65456],97:[65457],98:[65458],99:[65459],100:[65460],101:[65461],102:[65462],103:[65463],104:[65464],105:[65465],106:[65450],107:[65451],109:[65453],110:[65454],111:[65455],112:[65470],113:[65471],114:[65472],115:[65473],116:[65474],117:[65475],118:[65476],119:[65477],120:[65478],121:[65479],122:[65480],123:[65481],144:[65407],145:[65300],225:[65027]},f={Again:[65382],AllCandidates:[65341],Alphanumeric:[65328],Alt:[65513,65513,65027],Attn:[64782],AltGraph:[65027],ArrowDown:[65364],ArrowLeft:[65361],ArrowRight:[65363],ArrowUp:[65362],Backspace:[65288],CapsLock:[65509],Cancel:[65385],Clear:[65291],Convert:[65313],Copy:[64789],Crsel:[64796],CrSel:[64796],CodeInput:[65335],Compose:[65312],Control:[65507,65507,65508],ContextMenu:[65383],Delete:[65535],Down:[65364],End:[65367],Enter:[65293],EraseEof:[64774],Escape:[65307],Execute:[65378],Exsel:[64797],ExSel:[64797],F1:[65470],F2:[65471],F3:[65472],F4:[65473],F5:[65474],F6:[65475],F7:[65476],F8:[65477],F9:[65478],F10:[65479],F11:[65480],F12:[65481],F13:[65482],F14:[65483],F15:[65484],F16:[65485],F17:[65486],F18:[65487],F19:[65488],F20:[65489],F21:[65490],F22:[65491],F23:[65492],F24:[65493],Find:[65384],GroupFirst:[65036],GroupLast:[65038],GroupNext:[65032],GroupPrevious:[65034],FullWidth:null,HalfWidth:null,HangulMode:[65329],Hankaku:[65321],HanjaMode:[65332],Help:[65386],Hiragana:[65317],HiraganaKatakana:[65319],Home:[65360],Hyper:[65517,65517,65518],Insert:[65379],JapaneseHiragana:[65317],JapaneseKatakana:[65318],JapaneseRomaji:[65316],JunjaMode:[65336],KanaMode:[65325],KanjiMode:[65313],Katakana:[65318],Left:[65361],Meta:[65511,65511,65512],ModeChange:[65406],NumLock:[65407],PageDown:[65366],PageUp:[65365],Pause:[65299],Play:[64790],PreviousCandidate:[65342],PrintScreen:[65377],Redo:[65382],Right:[65363],RomanCharacters:null,Scroll:[65300],Select:[65376],Separator:[65452],Shift:[65505,65505,65506],SingleCandidate:[65340],Super:[65515,65515,65516],Tab:[65289],UIKeyInputDownArrow:[65364],UIKeyInputEscape:[65307],UIKeyInputLeftArrow:[65361],UIKeyInputRightArrow:[65363],UIKeyInputUpArrow:[65362],Up:[65362],Undo:[65381],Win:[65515],Zenkaku:[65320],ZenkakuHankaku:[65322]},h={65027:!0,65505:!0,65506:!0,65507:!0,65508:!0,65509:!0,65511:!0,65512:!0,65513:!0,65514:!0,65515:!0,65516:!0};this.modifiers=new Guacamole.Keyboard.ModifierState,this.pressed={};var E={},v={},C={},S=null,A=null,y=function(e,n){return e?e[n]||e[0]:null},T=function(e){return e>=0&&e<=255||16777216==(4294901760&e)},I=function(e,n){if(!n)return!1;var t=n.indexOf("U+");return-1===t||(e!==parseInt(n.substring(t+2),16)||(e>=65&&e<=90||e>=48&&e<=57))};this.press=function(e){if(null!==e){if(!i.pressed[e]&&(i.pressed[e]=!0,i.onkeydown)){var n=i.onkeydown(e);return v[e]=n,window.clearTimeout(S),window.clearInterval(A),h[e]||(S=window.setTimeout(function(){A=window.setInterval(function(){i.onkeyup(e),i.onkeydown(e)},50)},500)),n}return v[e]||!1}},this.release=function(e){i.pressed[e]&&(delete i.pressed[e],delete E[e],window.clearTimeout(S),window.clearInterval(A),null!==e&&i.onkeyup&&i.onkeyup(e))},this.type=function(e){for(var n=0;n<e.length;n++){var t=a(e.codePointAt?e.codePointAt(n):e.charCodeAt(n));i.press(t),i.release(t)}},this.reset=function(){for(var e in i.pressed)i.release(parseInt(e));d=[]};var b=function(e,n,t,a){var r;if(-1===t.indexOf(a.keysym))if(e&&!1===n)for(r=0;r<t.length;r++)i.release(t[r]);else if(!e&&n){for(r=0;r<t.length;r++)if(i.pressed[t[r]])return;var o=t[0];a.keysym&&(E[o]=!0),i.press(o)}},N=function(e,n){var t=Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e);b(i.modifiers.alt,t.alt,[65513,65514,65027],n),b(i.modifiers.shift,t.shift,[65505,65506],n),b(i.modifiers.ctrl,t.ctrl,[65507,65508],n),b(i.modifiers.meta,t.meta,[65511,65512],n),b(i.modifiers.hyper,t.hyper,[65515,65516],n),i.modifiers=t},P=function(){for(var e in i.pressed)if(!E[e])return!1;return!0},R=function(e){i.modifiers.ctrl&&i.modifiers.alt&&(e>=65&&e<=90||e>=97&&e<=122||(e<=255||16777216==(4278190080&e))&&(i.release(65507),i.release(65508),i.release(65513),i.release(65514)))},O=function(){var e=d[0];if(!e)return null;if(!(e instanceof u))return e instanceof p&&!c.keyupUnreliable?(n=e.keysym)?(i.release(n),delete C[e.keyCode],e.defaultPrevented=!0,d.shift()):(i.reset(),e):d.shift();var n=null,t=[];if(e.reliable?(n=e.keysym,t=d.splice(0,1)):d[1]instanceof m?(n=d[1].keysym,t=d.splice(0,2)):d[1]&&(n=e.keysym,t=d.splice(0,1)),t.length>0){if(n){R(n);var a=!i.press(n);C[e.keyCode]=n,e.keyupReliable||i.release(n);for(var r=0;r<t.length;r++)t[r].defaultPrevented=a}return e}return null},G=function(e){return"location"in e?e.location:"keyLocation"in e?e.keyLocation:0},w=function(e){return!e[s]&&(e[s]=!0,!0)};this.listenTo=function(e){e.addEventListener("keydown",function(e){if(i.onkeydown&&w(e)){var n;window.event?n=window.event.keyCode:e.which&&(n=e.which);var t=new u(n,e.keyIdentifier,e.key,G(e));N(e,t),229!==n&&(d.push(t),o()&&e.preventDefault())}},!0),e.addEventListener("keypress",function(e){if((i.onkeydown||i.onkeyup)&&w(e)){var n;window.event?n=window.event.keyCode:e.which&&(n=e.which);var t=new m(n);N(e,t),d.push(t),o()&&e.preventDefault()}},!0),e.addEventListener("keyup",function(e){if(i.onkeyup&&w(e)){e.preventDefault();var n;window.event?n=window.event.keyCode:e.which&&(n=e.which);var t=new p(n,e.keyIdentifier,e.key,G(e));N(e,t),d.push(t),o()}},!0);var n=function(n){(i.onkeydown||i.onkeyup)&&w(n)&&n.data&&!n.isComposing&&(e.removeEventListener("compositionend",t,!1),i.type(n.data))},t=function(t){(i.onkeydown||i.onkeyup)&&w(t)&&t.data&&(e.removeEventListener("input",n,!1),i.type(t.data))};e.addEventListener("input",n,!1),e.addEventListener("compositionend",t,!1)},e&&i.listenTo(e)},Guacamole.Keyboard._nextID=0,Guacamole.Keyboard.ModifierState=function(){this.shift=!1,this.ctrl=!1,this.alt=!1,this.meta=!1,this.hyper=!1},Guacamole.Keyboard.ModifierState.fromKeyboardEvent=function(e){var n=new Guacamole.Keyboard.ModifierState;return n.shift=e.shiftKey,n.ctrl=e.ctrlKey,n.alt=e.altKey,n.meta=e.metaKey,e.getModifierState&&(n.hyper=e.getModifierState("OS")||e.getModifierState("Super")||e.getModifierState("Hyper")||e.getModifierState("Win")),n},(Guacamole=Guacamole||{}).Layer=function(e,n){function t(e,n,t,r){var o,i=t+e,s=r+n;o=i>a.width?i:a.width;var c;c=s>a.height?s:a.height,a.resize(o,c)}var a=this,r=document.createElement("canvas"),o=r.getContext("2d");o.save();var i=!0,s=!0,c=0,l={1:"destination-in",2:"destination-out",4:"source-in",6:"source-atop",8:"source-out",9:"destination-atop",10:"xor",11:"destination-over",12:"copy",14:"source-over",15:"lighter"},u=function(e,n){e=e||0,n=n||0;var t=64*Math.ceil(e/64),s=64*Math.ceil(n/64);if(r.width!==t||r.height!==s){var l=null;i||0===r.width||0===r.height||((l=document.createElement("canvas")).width=Math.min(a.width,e),l.height=Math.min(a.height,n),l.getContext("2d").drawImage(r,0,0,l.width,l.height,0,0,l.width,l.height));var u=o.globalCompositeOperation;r.width=t,r.height=s,l&&o.drawImage(l,0,0,l.width,l.height,0,0,l.width,l.height),o.globalCompositeOperation=u,c=0,o.save()}else a.reset();a.width=e,a.height=n};this.autosize=!1,this.width=e,this.height=n,this.getCanvas=function(){return r},this.toCanvas=function(){var e=document.createElement("canvas");return e.width=a.width,e.height=a.height,e.getContext("2d").drawImage(a.getCanvas(),0,0),e},this.resize=function(e,n){e===a.width&&n===a.height||u(e,n)},this.drawImage=function(e,n,r){a.autosize&&t(e,n,r.width,r.height),o.drawImage(r,e,n),i=!1},this.transfer=function(e,n,r,s,c,l,u,m){var p=e.getCanvas();if(!(n>=p.width||r>=p.height)&&(n+s>p.width&&(s=p.width-n),r+c>p.height&&(c=p.height-r),0!==s&&0!==c)){a.autosize&&t(l,u,s,c);for(var d=e.getCanvas().getContext("2d").getImageData(n,r,s,c),g=o.getImageData(l,u,s,c),f=0;f<s*c*4;f+=4){var h=new Guacamole.Layer.Pixel(d.data[f],d.data[f+1],d.data[f+2],d.data[f+3]),E=new Guacamole.Layer.Pixel(g.data[f],g.data[f+1],g.data[f+2],g.data[f+3]);m(h,E),g.data[f]=E.red,g.data[f+1]=E.green,g.data[f+2]=E.blue,g.data[f+3]=E.alpha}o.putImageData(g,l,u),i=!1}},this.put=function(e,n,r,s,c,l,u){var m=e.getCanvas();if(!(n>=m.width||r>=m.height)&&(n+s>m.width&&(s=m.width-n),r+c>m.height&&(c=m.height-r),0!==s&&0!==c)){a.autosize&&t(l,u,s,c);var p=e.getCanvas().getContext("2d").getImageData(n,r,s,c);o.putImageData(p,l,u),i=!1}},this.copy=function(e,n,r,s,c,l,u){var m=e.getCanvas();n>=m.width||r>=m.height||(n+s>m.width&&(s=m.width-n),r+c>m.height&&(c=m.height-r),0!==s&&0!==c&&(a.autosize&&t(l,u,s,c),o.drawImage(m,n,r,s,c,l,u,s,c),i=!1))},this.moveTo=function(e,n){s&&(o.beginPath(),s=!1),a.autosize&&t(e,n,0,0),o.moveTo(e,n)},this.lineTo=function(e,n){s&&(o.beginPath(),s=!1),a.autosize&&t(e,n,0,0),o.lineTo(e,n)},this.arc=function(e,n,r,i,c,l){s&&(o.beginPath(),s=!1),a.autosize&&t(e,n,0,0),o.arc(e,n,r,i,c,l)},this.curveTo=function(e,n,r,i,c,l){s&&(o.beginPath(),s=!1),a.autosize&&t(c,l,0,0),o.bezierCurveTo(e,n,r,i,c,l)},this.close=function(){o.closePath(),s=!0},this.rect=function(e,n,r,i){s&&(o.beginPath(),s=!1),a.autosize&&t(e,n,r,i),o.rect(e,n,r,i)},this.clip=function(){o.clip(),s=!0},this.strokeColor=function(e,n,t,a,r,c,l){o.lineCap=e,o.lineJoin=n,o.lineWidth=t,o.strokeStyle="rgba("+a+","+r+","+c+","+l/255+")",o.stroke(),i=!1,s=!0},this.fillColor=function(e,n,t,a){o.fillStyle="rgba("+e+","+n+","+t+","+a/255+")",o.fill(),i=!1,s=!0},this.strokeLayer=function(e,n,t,a){o.lineCap=e,o.lineJoin=n,o.lineWidth=t,o.strokeStyle=o.createPattern(a.getCanvas(),"repeat"),o.stroke(),i=!1,s=!0},this.fillLayer=function(e){o.fillStyle=o.createPattern(e.getCanvas(),"repeat"),o.fill(),i=!1,s=!0},this.push=function(){o.save(),c++},this.pop=function(){c>0&&(o.restore(),c--)},this.reset=function(){for(;c>0;)o.restore(),c--;o.restore(),o.save(),o.beginPath(),s=!1},this.setTransform=function(e,n,t,a,r,i){o.setTransform(e,n,t,a,r,i)},this.transform=function(e,n,t,a,r,i){o.transform(e,n,t,a,r,i)},this.setChannelMask=function(e){o.globalCompositeOperation=l[e]},this.setMiterLimit=function(e){o.miterLimit=e},u(e,n),r.style.zIndex=-1},Guacamole.Layer.ROUT=2,Guacamole.Layer.ATOP=6,Guacamole.Layer.XOR=10,Guacamole.Layer.ROVER=11,Guacamole.Layer.OVER=14,Guacamole.Layer.PLUS=15,Guacamole.Layer.RIN=1,Guacamole.Layer.IN=4,Guacamole.Layer.OUT=8,Guacamole.Layer.RATOP=9,Guacamole.Layer.SRC=12,Guacamole.Layer.Pixel=function(e,n,t,a){this.red=e,this.green=n,this.blue=t,this.alpha=a},(Guacamole=Guacamole||{}).Mouse=function(e){function n(e){e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function t(){o=r.touchMouseThreshold}function a(e){var t=e.deltaY||-e.wheelDeltaY||-e.wheelDelta;if(t?1===e.deltaMode?t=e.deltaY*r.PIXELS_PER_LINE:2===e.deltaMode&&(t=e.deltaY*r.PIXELS_PER_PAGE):t=e.detail*r.PIXELS_PER_LINE,(i+=t)<=-r.scrollThreshold){do{r.onmousedown&&(r.currentState.up=!0,r.onmousedown(r.currentState)),r.onmouseup&&(r.currentState.up=!1,r.onmouseup(r.currentState)),i+=r.scrollThreshold}while(i<=-r.scrollThreshold);i=0}if(i>=r.scrollThreshold){do{r.onmousedown&&(r.currentState.down=!0,r.onmousedown(r.currentState)),r.onmouseup&&(r.currentState.down=!1,r.onmouseup(r.currentState)),i-=r.scrollThreshold}while(i>=r.scrollThreshold);i=0}n(e)}var r=this;this.touchMouseThreshold=3,this.scrollThreshold=53,this.PIXELS_PER_LINE=18,this.PIXELS_PER_PAGE=16*this.PIXELS_PER_LINE,this.currentState=new Guacamole.Mouse.State(0,0,!1,!1,!1,!1,!1),this.onmousedown=null,this.onmouseup=null,this.onmousemove=null,this.onmouseout=null;var o=0,i=0;e.addEventListener("contextmenu",function(e){n(e)},!1),e.addEventListener("mousemove",function(t){n(t),o?o--:(r.currentState.fromClientPosition(e,t.clientX,t.clientY),r.onmousemove&&r.onmousemove(r.currentState))},!1),e.addEventListener("mousedown",function(e){if(n(e),!o){switch(e.button){case 0:r.currentState.left=!0;break;case 1:r.currentState.middle=!0;break;case 2:r.currentState.right=!0}r.onmousedown&&r.onmousedown(r.currentState)}},!1),e.addEventListener("mouseup",function(e){if(n(e),!o){switch(e.button){case 0:r.currentState.left=!1;break;case 1:r.currentState.middle=!1;break;case 2:r.currentState.right=!1}r.onmouseup&&r.onmouseup(r.currentState)}},!1),e.addEventListener("mouseout",function(t){t||(t=window.event);for(var a=t.relatedTarget||t.toElement;a;){if(a===e)return;a=a.parentNode}n(t),(r.currentState.left||r.currentState.middle||r.currentState.right)&&(r.currentState.left=!1,r.currentState.middle=!1,r.currentState.right=!1,r.onmouseup&&r.onmouseup(r.currentState)),r.onmouseout&&r.onmouseout()},!1),e.addEventListener("selectstart",function(e){n(e)},!1),e.addEventListener("touchmove",t,!1),e.addEventListener("touchstart",t,!1),e.addEventListener("touchend",t,!1),e.addEventListener("DOMMouseScroll",a,!1),e.addEventListener("mousewheel",a,!1),e.addEventListener("wheel",a,!1);var s=function(){var e=document.createElement("div");if(!("cursor"in e.style))return!1;try{e.style.cursor="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX///+nxBvIAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==) 0 0, auto"}catch(e){return!1}return/\burl\([^()]*\)\s+0\s+0\b/.test(e.style.cursor||"")}();this.setCursor=function(n,t,a){if(s){var r=n.toDataURL("image/png");return e.style.cursor="url("+r+") "+t+" "+a+", auto",!0}return!1}},Guacamole.Mouse.State=function(e,n,t,a,r,o,i){var s=this;this.x=e,this.y=n,this.left=t,this.middle=a,this.right=r,this.up=o,this.down=i,this.fromClientPosition=function(e,n,t){s.x=n-e.offsetLeft,s.y=t-e.offsetTop;for(var a=e.offsetParent;a&&a!==document.body;)s.x-=a.offsetLeft-a.scrollLeft,s.y-=a.offsetTop-a.scrollTop,a=a.offsetParent;if(a){var r=document.body.scrollLeft||document.documentElement.scrollLeft,o=document.body.scrollTop||document.documentElement.scrollTop;s.x-=a.offsetLeft-r,s.y-=a.offsetTop-o}}},Guacamole.Mouse.Touchpad=function(e){var n=this;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=10*(window.devicePixelRatio||1),this.currentState=new Guacamole.Mouse.State(0,0,!1,!1,!1,!1,!1),this.onmousedown=null,this.onmouseup=null,this.onmousemove=null;var t=0,a=0,r=0,o=0,i=0,s={1:"left",2:"right",3:"middle"},c=!1,l=null;e.addEventListener("touchend",function(e){if(e.preventDefault(),c&&0===e.touches.length){var a=(new Date).getTime(),r=s[t];n.currentState[r]&&(n.currentState[r]=!1,n.onmouseup&&n.onmouseup(n.currentState),l&&(window.clearTimeout(l),l=null)),a-o<=n.clickTimingThreshold&&i<n.clickMoveThreshold&&(n.currentState[r]=!0,n.onmousedown&&n.onmousedown(n.currentState),l=window.setTimeout(function(){n.currentState[r]=!1,n.onmouseup&&n.onmouseup(n.currentState),c=!1},n.clickTimingThreshold)),l||(c=!1)}},!1),e.addEventListener("touchstart",function(e){if(e.preventDefault(),t=Math.min(e.touches.length,3),l&&(window.clearTimeout(l),l=null),!c){c=!0;var n=e.touches[0];a=n.clientX,r=n.clientY,o=(new Date).getTime(),i=0}},!1),e.addEventListener("touchmove",function(s){s.preventDefault();var c=s.touches[0],l=c.clientX-a,u=c.clientY-r;if(i+=Math.abs(l)+Math.abs(u),1===t){var m=1+i/((new Date).getTime()-o);n.currentState.x+=l*m,n.currentState.y+=u*m,n.currentState.x<0?n.currentState.x=0:n.currentState.x>=e.offsetWidth&&(n.currentState.x=e.offsetWidth-1),n.currentState.y<0?n.currentState.y=0:n.currentState.y>=e.offsetHeight&&(n.currentState.y=e.offsetHeight-1),n.onmousemove&&n.onmousemove(n.currentState),a=c.clientX,r=c.clientY}else if(2===t&&Math.abs(u)>=n.scrollThreshold){var p;p=u>0?"down":"up",n.currentState[p]=!0,n.onmousedown&&n.onmousedown(n.currentState),n.currentState[p]=!1,n.onmouseup&&n.onmouseup(n.currentState),a=c.clientX,r=c.clientY}},!1)},Guacamole.Mouse.Touchscreen=function(e){function n(e){c.currentState[e]||(c.currentState[e]=!0,c.onmousedown&&c.onmousedown(c.currentState))}function t(e){c.currentState[e]&&(c.currentState[e]=!1,c.onmouseup&&c.onmouseup(c.currentState))}function a(e){n(e),t(e)}function r(n,t){c.currentState.fromClientPosition(e,n,t),c.onmousemove&&c.onmousemove(c.currentState)}function o(e){var n=e.touches[0]||e.changedTouches[0],t=n.clientX-u,a=n.clientY-m;return Math.sqrt(t*t+a*a)>=c.clickMoveThreshold}function i(e){var n=e.touches[0];l=!0,u=n.clientX,m=n.clientY}function s(){window.clearTimeout(p),window.clearTimeout(d),l=!1}var c=this,l=!1,u=null,m=null,p=null,d=null;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=16*(window.devicePixelRatio||1),this.longPressThreshold=500,this.currentState=new Guacamole.Mouse.State(0,0,!1,!1,!1,!1,!1),this.onmousedown=null,this.onmouseup=null,this.onmousemove=null,e.addEventListener("touchend",function(e){if(l)if(0===e.touches.length&&1===e.changedTouches.length){if(window.clearTimeout(d),t("left"),!o(e)&&(e.preventDefault(),!c.currentState.left)){var a=e.changedTouches[0];r(a.clientX,a.clientY),n("left"),p=window.setTimeout(function(){t("left"),s()},c.clickTimingThreshold)}}else s()},!1),e.addEventListener("touchstart",function(e){1===e.touches.length?(e.preventDefault(),i(e),window.clearTimeout(p),d=window.setTimeout(function(){var n=e.touches[0];r(n.clientX,n.clientY),a("right"),s()},c.longPressThreshold)):s()},!1),e.addEventListener("touchmove",function(e){if(l)if(o(e)&&window.clearTimeout(d),1===e.touches.length){if(c.currentState.left){e.preventDefault();var n=e.touches[0];r(n.clientX,n.clientY)}}else s()},!1)},(Guacamole=(Guacamole=Guacamole||{})||{}).Object=function(e,n){var t=this,a={},r=function(e){var n=a[e];if(!n)return null;var t=n.shift();return 0===n.length&&delete a[e],t},o=function(e,n){var t=a[e];t||(t=[],a[e]=t),t.push(n)};this.index=n,this.onbody=function(e,n,t){var a=r(t);a&&a(e,n)},this.onundefine=null,this.requestInputStream=function(n,a){a&&o(n,a),e.requestObjectInputStream(t.index,n)},this.createOutputStream=function(n,a){return e.createObjectOutputStream(t.index,n,a)}},Guacamole.Object.ROOT_STREAM="/",Guacamole.Object.STREAM_INDEX_MIMETYPE="application/vnd.glyptodon.guacamole.stream-index+json",(Guacamole=Guacamole||{}).OnScreenKeyboard=function(e){var n=this,t={},a={},r=[],o=function(e,n){e.classList?e.classList.add(n):e.className+=" "+n},i=function(e,n){e.classList?e.classList.remove(n):e.className=e.className.replace(/([^ ]+)[ ]*/g,function(e,t){return t===n?"":e})},s=0,c=function(e,n,t,a){this.width=n,this.height=t,this.scale=function(r){e.style.width=n*r+"px",e.style.height=t*r+"px",a&&(e.style.lineHeight=t*r+"px",e.style.fontSize=r+"px")}},l=function(e){for(var n=0;n<e.length;n++)if(!(e[n]in t))return!1;return!0},u=function(e){var t=n.keys[e];if(!t)return null;for(var a=t.length-1;a>=0;a--){var r=t[a];if(l(r.requires))return r}return null},m=function(e,r){if(!a[e]){o(r,"guac-keyboard-pressed");var s=u(e);if(s.modifier){var c="guac-keyboard-modifier-"+f(s.modifier),l=t[s.modifier];l?(i(d,c),delete t[s.modifier],n.onkeyup&&n.onkeyup(l)):(o(d,c),t[s.modifier]=s.keysym,n.onkeydown&&n.onkeydown(s.keysym))}else n.onkeydown&&n.onkeydown(s.keysym);a[e]=!0}},p=function(e,t){if(a[e]){i(t,"guac-keyboard-pressed");var r=u(e);!r.modifier&&n.onkeyup&&n.onkeyup(r.keysym),a[e]=!1}},d=document.createElement("div");d.className="guac-keyboard",d.onselectstart=d.onmousemove=d.onmouseup=d.onmousedown=function(e){return s&&s--,e.stopPropagation(),!1},this.touchMouseThreshold=3,this.onkeydown=null,this.onkeyup=null,this.layout=new Guacamole.OnScreenKeyboard.Layout(e),this.getElement=function(){return d},this.resize=function(e){for(var t=Math.floor(10*e/n.layout.width)/10,a=0;a<r.length;a++)r[a].scale(t)};var g=function(e,n){if(n instanceof Array){for(var t=[],a=0;a<n.length;a++)t.push(new Guacamole.OnScreenKeyboard.Key(n[a],e));return t}return"number"==typeof n?[new Guacamole.OnScreenKeyboard.Key({name:e,keysym:n})]:"string"==typeof n?[new Guacamole.OnScreenKeyboard.Key({name:e,title:n})]:[new Guacamole.OnScreenKeyboard.Key(n,e)]};this.keys=function(n){var t={};for(var a in e.keys)t[a]=g(a,n[a]);return t}(e.keys);var f=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^A-Za-z0-9]+/g,"-").toLowerCase()};!function e(t,a,i){var l,u=document.createElement("div");if(i&&o(u,"guac-keyboard-"+f(i)),a instanceof Array)for(o(u,"guac-keyboard-group"),l=0;l<a.length;l++)e(u,a[l]);else if(a instanceof Object){o(u,"guac-keyboard-group");var d=Object.keys(a).sort();for(l=0;l<d.length;l++){var i=d[l];e(u,a[i],i)}}else if("number"==typeof a)o(u,"guac-keyboard-gap"),r.push(new c(u,a,a));else if("string"==typeof a){var g=a;1===g.length&&(g="0x"+g.charCodeAt(0).toString(16)),o(u,"guac-keyboard-key-container");var h=document.createElement("div");h.className="guac-keyboard-key guac-keyboard-key-"+f(g);var E=n.keys[a];if(E)for(l=0;l<E.length;l++){var v=E[l],C=document.createElement("div");C.className="guac-keyboard-cap",C.textContent=v.title;for(var S=0;S<v.requires.length;S++){var A=v.requires[S];o(C,"guac-keyboard-requires-"+f(A)),o(h,"guac-keyboard-uses-"+f(A))}h.appendChild(C)}u.appendChild(h),r.push(new c(u,n.layout.keyWidths[a]||1,1,!0));var y=function(e){e.preventDefault(),s=n.touchMouseThreshold,m(a,h)},T=function(e){e.preventDefault(),s=n.touchMouseThreshold,p(a,h)},I=function(e){e.preventDefault(),0===s&&m(a,h)},b=function(e){e.preventDefault(),0===s&&p(a,h)};h.addEventListener("touchstart",y,!0),h.addEventListener("touchend",T,!0),h.addEventListener("mousedown",I,!0),h.addEventListener("mouseup",b,!0),h.addEventListener("mouseout",b,!0)}t.appendChild(u)}(d,e.layout)},Guacamole.OnScreenKeyboard.Layout=function(e){this.language=e.language,this.type=e.type,this.keys=e.keys,this.layout=e.layout,this.width=e.width,this.keyWidths=e.keyWidths||{}},Guacamole.OnScreenKeyboard.Key=function(e,n){this.name=n||e.name,this.title=e.title||this.name,this.keysym=e.keysym||function(e){if(!e||1!==e.length)return null;var n=e.charCodeAt(0);return n>=0&&n<=255?n:n>=256&&n<=1114111?16777216|n:null}(this.title),this.modifier=e.modifier,this.requires=e.requires||[]},(Guacamole=Guacamole||{}).OutputStream=function(e,n){var t=this;this.index=n,this.onack=null,this.sendBlob=function(n){e.sendBlob(t.index,n)},this.sendEnd=function(){e.endStream(t.index)}},(Guacamole=Guacamole||{}).Parser=function(){var e=this,n="",t=[],a=-1,r=0;this.receive=function(o){for(r>4096&&a>=r&&(n=n.substring(r),a-=r,r=0),n+=o;a<n.length;){if(a>=r){var i=n.substring(r,a),s=n.substring(a,a+1);if(t.push(i),";"==s){var c=t.shift();null!=e.oninstruction&&e.oninstruction(c,t),t.length=0}else if(","!=s)throw new Error("Illegal terminator.");r=a+1}var l=n.indexOf(".",r);if(-1==l){r=n.length;break}var u=parseInt(n.substring(a+1,l));if(isNaN(u))throw new Error("Non-numeric character in element length.");a=(r=l+1)+u}},this.oninstruction=null},(Guacamole=Guacamole||{}).RawAudioFormat=function(e){this.bytesPerSample=e.bytesPerSample,this.channels=e.channels,this.rate=e.rate},Guacamole.RawAudioFormat.parse=function(e){var n,t=null,a=1;if("audio/L8;"===e.substring(0,9))e=e.substring(9),n=1;else{if("audio/L16;"!==e.substring(0,10))return null;e=e.substring(10),n=2}for(var r=e.split(","),o=0;o<r.length;o++){var i=r[o],s=i.indexOf("=");if(-1===s)return null;var c=i.substring(0,s),l=i.substring(s+1);switch(c){case"channels":a=parseInt(l);break;case"rate":t=parseInt(l);break;default:return null}}return null===t?null:new Guacamole.RawAudioFormat({bytesPerSample:n,channels:a,rate:t})},(Guacamole=Guacamole||{}).SessionRecording=function(e){var n=this,t=[],a=[],r=0,o=0,i=new Guacamole.SessionRecording._PlaybackTunnel,s=new Guacamole.Client(i),c=-1,l=null,u=null,m=null;s.connect(),s.getDisplay().showCursor(!1),e.oninstruction=function(e,i){var s=new Guacamole.SessionRecording._Frame.Instruction(e,i.slice());if(a.push(s),r+=s.getSize(),"sync"===e){var c=parseInt(i[0]),l=new Guacamole.SessionRecording._Frame(c,a);t.push(l),(1===t.length||r>=16384&&c-o>=5e3)&&(l.keyframe=!0,o=c,r=0),a=[],n.onprogress&&n.onprogress(n.getDuration())}};var p=function(e){return 0===t.length?0:e-t[0].timestamp},d=function e(n,a,r){if(n===a)return n;var o=Math.floor((n+a)/2),i=p(t[o].timestamp);return r<i&&o>n?e(n,o-1,r):r>i&&o<a?e(o+1,a,r):o},g=function(e){for(var n=t[e],a=0;a<n.instructions.length;a++){var r=n.instructions[a];i.receiveInstruction(r.opcode,r.args)}n.keyframe&&!n.clientState&&s.exportState(function(e){n.clientState=e})},f=function e(a,r,o){h(),m=window.setTimeout(function(){var i;for(i=a;i>=0;i--){var l=t[i];if(i===c)break;if(l.clientState){s.importState(l.clientState);break}}i++;for(var u=(new Date).getTime();i<=a&&!((new Date).getTime()-u>=5);i++)g(i);c=i-1,n.onseek&&n.onseek(n.getPosition()),c!==a?e(a,r,Math.max(o-((new Date).getTime()-u),0)):r()},o||0)},h=function(){window.clearTimeout(m)},E=function e(){if(c+1<t.length){var a=t[c+1].timestamp-l+u,r=Math.max(a-(new Date).getTime(),0);f(c+1,function(){e()},r)}else n.pause()};this.onprogress=null,this.onplay=null,this.onpause=null,this.onseek=null,this.connect=function(n){e.connect(n)},this.disconnect=function(){e.disconnect()},this.getDisplay=function(){return s.getDisplay()},this.isPlaying=function(){return!!l},this.getPosition=function(){return-1===c?0:p(t[c].timestamp)},this.getDuration=function(){return 0===t.length?0:p(t[t.length-1].timestamp)},this.play=function(){if(!n.isPlaying()&&c+1<t.length){n.onplay&&n.onplay();var e=t[c+1];l=e.timestamp,u=(new Date).getTime(),E()}},this.seek=function(e,a){if(0!==t.length){var r=n.isPlaying();n.pause(),f(d(0,t.length-1,e),function(){r&&n.play(),a&&a()})}},this.pause=function(){h(),n.isPlaying()&&(n.onpause&&n.onpause(),l=null,u=null)}},Guacamole.SessionRecording._Frame=function(e,n){this.keyframe=!1,this.timestamp=e,this.instructions=n,this.clientState=null},Guacamole.SessionRecording._Frame.Instruction=function(e,n){var t=this;this.opcode=e,this.args=n,this.getSize=function(){for(var e=t.opcode.length,n=0;n<t.args.length;n++)e+=t.args[n].length;return e}},Guacamole.SessionRecording._PlaybackTunnel=function(){var e=this;this.connect=function(e){},this.sendMessage=function(e){},this.disconnect=function(){},this.receiveInstruction=function(n,t){e.oninstruction&&e.oninstruction(n,t)}},(Guacamole=Guacamole||{}).Status=function(e,n){var t=this;this.code=e,this.message=n,this.isError=function(){return t.code<0||t.code>255}},Guacamole.Status.Code={SUCCESS:0,UNSUPPORTED:256,SERVER_ERROR:512,SERVER_BUSY:513,UPSTREAM_TIMEOUT:514,UPSTREAM_ERROR:515,RESOURCE_NOT_FOUND:516,RESOURCE_CONFLICT:517,RESOURCE_CLOSED:518,UPSTREAM_NOT_FOUND:519,UPSTREAM_UNAVAILABLE:520,SESSION_CONFLICT:521,SESSION_TIMEOUT:522,SESSION_CLOSED:523,CLIENT_BAD_REQUEST:768,CLIENT_UNAUTHORIZED:769,CLIENT_FORBIDDEN:771,CLIENT_TIMEOUT:776,CLIENT_OVERRUN:781,CLIENT_BAD_TYPE:783,CLIENT_TOO_MANY:797},Guacamole.Status.Code.fromHTTPCode=function(e){switch(e){case 400:return Guacamole.Status.Code.CLIENT_BAD_REQUEST;case 403:return Guacamole.Status.Code.CLIENT_FORBIDDEN;case 404:return Guacamole.Status.Code.RESOURCE_NOT_FOUND;case 429:return Guacamole.Status.Code.CLIENT_TOO_MANY;case 503:return Guacamole.Status.Code.SERVER_BUSY}return Guacamole.Status.Code.SERVER_ERROR},Guacamole.Status.Code.fromWebSocketCode=function(e){switch(e){case 1e3:return Guacamole.Status.Code.SUCCESS;case 1006:case 1015:return Guacamole.Status.Code.UPSTREAM_NOT_FOUND;case 1001:case 1012:case 1013:case 1014:return Guacamole.Status.Code.UPSTREAM_UNAVAILABLE}return Guacamole.Status.Code.SERVER_ERROR},(Guacamole=Guacamole||{}).StringReader=function(e){function n(e){for(var n="",t=new Uint8Array(e),a=0;a<t.length;a++){var i=t[a];0===r?127==(127|i)?n+=String.fromCharCode(i):223==(31|i)?(o=31&i,r=1):239==(15|i)?(o=15&i,r=2):247==(7|i)?(o=7&i,r=3):n+="�":191==(63|i)?(o=o<<6|63&i,0===--r&&(n+=String.fromCharCode(o))):(r=0,n+="�")}return n}var t=this,a=new Guacamole.ArrayBufferReader(e),r=0,o=0;a.ondata=function(e){var a=n(e);t.ontext&&t.ontext(a)},a.onend=function(){t.onend&&t.onend()},this.ontext=null,this.onend=null},(Guacamole=Guacamole||{}).StringWriter=function(e){function n(e){if(s+e>=i.length){var n=new Uint8Array(2*(s+e));n.set(i),i=n}s+=e}function t(e){var a,r;if(e<=127)a=0,r=1;else if(e<=2047)a=192,r=2;else if(e<=65535)a=224,r=3;else{if(!(e<=2097151))return void t(65533);a=240,r=4}n(r);for(var o=s-1,c=1;c<r;c++)i[o--]=128|63&e,e>>=6;i[o]=a|e}function a(e){for(var n=0;n<e.length;n++)t(e.charCodeAt(n));if(s>0){var a=i.subarray(0,s);return s=0,a}}var r=this,o=new Guacamole.ArrayBufferWriter(e),i=new Uint8Array(8192),s=0;o.onack=function(e){r.onack&&r.onack(e)},this.sendText=function(e){e.length&&o.sendData(a(e))},this.sendEnd=function(){o.sendEnd()},this.onack=null},(Guacamole=Guacamole||{}).Tunnel=function(){this.connect=function(e){},this.disconnect=function(){},this.sendMessage=function(e){},this.setState=function(e){e!==this.state&&(this.state=e,this.onstatechange&&this.onstatechange(e))},this.isConnected=function(){return this.state===Guacamole.Tunnel.State.OPEN||this.state===Guacamole.Tunnel.State.UNSTABLE},this.state=Guacamole.Tunnel.State.CONNECTING,this.receiveTimeout=15e3,this.unstableThreshold=1500,this.uuid=null,this.onerror=null,this.onstatechange=null,this.oninstruction=null},Guacamole.Tunnel.INTERNAL_DATA_OPCODE="",Guacamole.Tunnel.State={CONNECTING:0,OPEN:1,CLOSED:2,UNSTABLE:3},Guacamole.HTTPTunnel=function(e,n,t){function a(e,n){for(var t in n)e.setRequestHeader(t,n[t])}function r(){window.clearTimeout(S),window.clearTimeout(A),u.state===Guacamole.Tunnel.State.UNSTABLE&&u.setState(Guacamole.Tunnel.State.OPEN),S=window.setTimeout(function(){o(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},u.receiveTimeout),A=window.setTimeout(function(){u.setState(Guacamole.Tunnel.State.UNSTABLE)},u.unstableThreshold)}function o(e){window.clearTimeout(S),window.clearTimeout(A),window.clearInterval(y),u.state!==Guacamole.Tunnel.State.CLOSED&&(e.code!==Guacamole.Status.Code.SUCCESS&&u.onerror&&(u.state!==Guacamole.Tunnel.State.CONNECTING&&e.code===Guacamole.Status.Code.RESOURCE_NOT_FOUND||u.onerror(e)),E=!1,u.setState(Guacamole.Tunnel.State.CLOSED))}function i(){if(u.isConnected())if(v.length>0){E=!0;var e=new XMLHttpRequest;e.open("POST",d+u.uuid),e.withCredentials=C,a(e,T),e.setRequestHeader("Content-type","application/octet-stream"),e.onreadystatechange=function(){4===e.readyState&&(r(),200!==e.status?s(e):i())},e.send(v),v=""}else E=!1}function s(e){var n=parseInt(e.getResponseHeader("Guacamole-Status-Code"));if(n){var t=e.getResponseHeader("Guacamole-Error-Message");o(new Guacamole.Status(n,t))}else o(e.status?new Guacamole.Status(Guacamole.Status.Code.fromHTTPCode(e.status),e.statusText):new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_NOT_FOUND))}function c(e){function n(){if(u.isConnected()){if(!(e.readyState<2)){var o;try{o=e.status}catch(e){o=200}if(a||200!==o||(a=l()),3===e.readyState||4===e.readyState){if(r(),h===g&&(3!==e.readyState||t?4===e.readyState&&t&&clearInterval(t):t=setInterval(n,30)),0===e.status)return void u.disconnect();if(200!==e.status)return void s(e);var d;try{d=e.responseText}catch(e){return}for(;i<d.length;){if(i>=m){var f=d.substring(m,i),E=d.substring(i,i+1);if(p.push(f),";"===E){var v=p.shift();u.oninstruction&&u.oninstruction(v,p),p.length=0}m=i+1}var C=d.indexOf(".",m);if(-1===C){m=d.length;break}var S=parseInt(d.substring(i+1,C));if(0===S){t&&clearInterval(t),e.onreadystatechange=null,e.abort(),a&&c(a);break}i=(m=C+1)+S}}}}else null!==t&&clearInterval(t)}var t=null,a=null,o=0,i=-1,m=0,p=new Array;e.onreadystatechange=h===g?function(){3===e.readyState&&++o>=2&&(h=f,e.onreadystatechange=n),n()}:n,n()}function l(){var e=new XMLHttpRequest;return e.open("GET",p+u.uuid+":"+I++),e.withCredentials=C,a(e,T),e.send(null),e}var u=this,m=e+"?connect",p=e+"?read:",d=e+"?write:",g=1,f=0,h=g,E=!1,v="",C=!!n,S=null,A=null,y=null,T=t||{};this.sendMessage=function(){function e(e){var n=new String(e);return n.length+"."+n}if(u.isConnected()&&0!==arguments.length){for(var n=e(arguments[0]),t=1;t<arguments.length;t++)n+=","+e(arguments[t]);v+=n+=";",E||i()}};var I=0;this.connect=function(e){r(),u.setState(Guacamole.Tunnel.State.CONNECTING);var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&(200===n.status?(r(),u.uuid=n.responseText,u.setState(Guacamole.Tunnel.State.OPEN),y=setInterval(function(){u.sendMessage("nop")},500),c(l())):s(n))},n.open("POST",m,!0),n.withCredentials=C,a(n,T),n.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(e)},this.disconnect=function(){o(new Guacamole.Status(Guacamole.Status.Code.SUCCESS,"Manually closed."))}},Guacamole.HTTPTunnel.prototype=new Guacamole.Tunnel,Guacamole.WebSocketTunnel=function(e){function n(){window.clearTimeout(o),window.clearTimeout(i),a.state===Guacamole.Tunnel.State.UNSTABLE&&a.setState(Guacamole.Tunnel.State.OPEN),o=window.setTimeout(function(){t(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},a.receiveTimeout),i=window.setTimeout(function(){a.setState(Guacamole.Tunnel.State.UNSTABLE)},a.unstableThreshold)}function t(e){window.clearTimeout(o),window.clearTimeout(i),window.clearInterval(s),a.state!==Guacamole.Tunnel.State.CLOSED&&(e.code!==Guacamole.Status.Code.SUCCESS&&a.onerror&&a.onerror(e),a.setState(Guacamole.Tunnel.State.CLOSED),r.close())}var a=this,r=null,o=null,i=null,s=null,c={"http:":"ws:","https:":"wss:"};if("ws:"!==e.substring(0,3)&&"wss:"!==e.substring(0,4)){var l=c[window.location.protocol];if("/"===e.substring(0,1))e=l+"//"+window.location.host+e;else{var u=window.location.pathname.lastIndexOf("/"),m=window.location.pathname.substring(0,u+1);e=l+"//"+window.location.host+m+e}}this.sendMessage=function(e){function n(e){var n=new String(e);return n.length+"."+n}if(a.isConnected()&&0!==arguments.length){for(var t=n(arguments[0]),o=1;o<arguments.length;o++)t+=","+n(arguments[o]);t+=";",r.send(t)}},this.connect=function(o){n(),a.setState(Guacamole.Tunnel.State.CONNECTING),(r=new WebSocket(e+"?"+o,"guacamole")).onopen=function(e){n(),s=setInterval(function(){a.sendMessage(Guacamole.Tunnel.INTERNAL_DATA_OPCODE,"ping",(new Date).getTime())},500)},r.onclose=function(e){t(e.reason?new Guacamole.Status(parseInt(e.reason),e.reason):e.code?new Guacamole.Status(Guacamole.Status.Code.fromWebSocketCode(e.code)):new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_NOT_FOUND))},r.onmessage=function(e){n();var r,o=e.data,i=0,s=[];do{var c=o.indexOf(".",i);-1!==c?r=(i=c+1)+parseInt(o.substring(r+1,c)):t(new Guacamole.Status(Guacamole.Status.Code.SERVER_ERROR,"Incomplete instruction."));var l=o.substring(i,r),u=o.substring(r,r+1);if(s.push(l),";"===u){var m=s.shift();a.state===Guacamole.Tunnel.State.CONNECTING&&(m===Guacamole.Tunnel.INTERNAL_DATA_OPCODE&&(a.uuid=s[0]),a.setState(Guacamole.Tunnel.State.OPEN)),m!==Guacamole.Tunnel.INTERNAL_DATA_OPCODE&&a.oninstruction&&a.oninstruction(m,s),s.length=0}i=r+1}while(i<o.length)}},this.disconnect=function(){t(new Guacamole.Status(Guacamole.Status.Code.SUCCESS,"Manually closed."))}},Guacamole.WebSocketTunnel.prototype=new Guacamole.Tunnel,Guacamole.ChainedTunnel=function(e){function n(e){function i(){e.onstatechange=a.onstatechange,e.oninstruction=a.oninstruction,e.onerror=a.onerror,a.uuid=e.uuid,o=e}a.disconnect=e.disconnect,a.sendMessage=e.sendMessage;var s=function(t){if(t&&t.code===Guacamole.Status.Code.UPSTREAM_TIMEOUT)return r=[],null;var a=r.shift();return a&&(e.onerror=null,e.oninstruction=null,e.onstatechange=null,n(a)),a};e.onstatechange=function(e){switch(e){case Guacamole.Tunnel.State.OPEN:i(),a.onstatechange&&a.onstatechange(e);break;case Guacamole.Tunnel.State.CLOSED:!s()&&a.onstatechange&&a.onstatechange(e)}},e.oninstruction=function(e,n){i(),a.oninstruction&&a.oninstruction(e,n)},e.onerror=function(e){!s(e)&&a.onerror&&a.onerror(e)},e.connect(t)}for(var t,a=this,r=[],o=null,i=0;i<arguments.length;i++)r.push(arguments[i]);this.connect=function(e){t=e;var i=o||r.shift();i?n(i):a.onerror&&a.onerror(Guacamole.Status.Code.SERVER_ERROR,"No tunnels to try.")}},Guacamole.ChainedTunnel.prototype=new Guacamole.Tunnel,Guacamole.StaticHTTPTunnel=function(e,n,t){function a(e,n){for(var t in n)e.setRequestHeader(t,n[t])}var r=this,o=null,i=t||{};this.sendMessage=function(e){},this.connect=function(t){r.disconnect(),r.setState(Guacamole.Tunnel.State.CONNECTING),(o=new XMLHttpRequest).open("GET",e),o.withCredentials=!!n,a(o,i),o.responseType="text",o.send(null);var s=0,c=new Guacamole.Parser;c.oninstruction=function(e,n){r.oninstruction&&r.oninstruction(e,n)},o.onreadystatechange=function(){if(3===o.readyState||4===o.readyState){r.setState(Guacamole.Tunnel.State.OPEN);var e=o.responseText,n=e.length;s<n&&(c.receive(e.substring(s)),s=n)}4===o.readyState&&r.disconnect()},o.onerror=function(){r.onerror&&r.onerror(new Guacamole.Status(Guacamole.Status.Code.fromHTTPCode(o.status),o.statusText)),r.disconnect()}},this.disconnect=function(){o&&(o.abort(),o=null),r.setState(Guacamole.Tunnel.State.CLOSED)}},Guacamole.StaticHTTPTunnel.prototype=new Guacamole.Tunnel,(Guacamole=Guacamole||{}).API_VERSION="1.1.0",(Guacamole=Guacamole||{}).VideoPlayer=function(){this.sync=function(){}},Guacamole.VideoPlayer.isSupportedType=function(e){return!1},Guacamole.VideoPlayer.getSupportedTypes=function(){return[]},Guacamole.VideoPlayer.getInstance=function(e,n,t){return null},angular.module("home").factory("ActiveConnection",[function(){return function(e,n){this.name=e,this.client=n}}]),angular.module("rest").factory("ActiveConnection",[function(){return function(e){e=e||{},this.identifier=e.identifier,this.connectionIdentifier=e.connectionIdentifier,this.startDate=e.startDate,this.remoteHost=e.remoteHost,this.username=e.username,this.connectable=e.connectable}}]),angular.module("rest").factory("activeConnectionService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a={};return a.getActiveConnection=function(e,a){var r={token:t.getCurrentToken()};return n({method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/activeConnections/"+encodeURIComponent(a),params:r})},a.getActiveConnections=function(e,a){var r={token:t.getCurrentToken()};return a&&(r.permission=a),n({method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/activeConnections",params:r})},a.deleteActiveConnections=function(e,a){var r={token:t.getCurrentToken()},o=[];return a.forEach(function(e){o.push({op:"remove",path:"/"+e})}),n({method:"PATCH",url:"api/session/data/"+encodeURIComponent(e)+"/activeConnections",params:r,data:o})},a.getSharingCredentials=function(e,a,r){var o={token:t.getCurrentToken()};return n({method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/activeConnections/"+encodeURIComponent(a)+"/sharingCredentials/"+encodeURIComponent(r),params:o})},a}]),angular.module("settings").factory("ActiveConnectionWrapper",[function(){return function(e){this.dataSource=e.dataSource,this.name=e.name,this.startDate=e.startDate,this.activeConnection=e.activeConnection,this.checked=e.checked||!1}}]),angular.module("index").filter("toArray",[function(){var e="_guac_toArray";return function(n){if(!n)return[];var t=[];return angular.forEach(n,function(e,n){t.push({key:n,value:e})}),t.sort(function(e,n){return e.key<n.key?-1:e.key>n.key?1:0}),n[e]||Object.defineProperty(n,e,{value:[],enumerable:!1,configurable:!0,writable:!0}),angular.equals(n[e],t)||(n[e]=t),n[e]}}]),angular.module("auth").factory("AuthenticationResult",[function(){var e=function(e){e=e||{},this.authToken=e.authToken,this.username=e.username,this.dataSource=e.dataSource,this.availableDataSources=e.availableDataSources};return e.ANONYMOUS_USERNAME="",e}]),angular.module("auth").factory("authenticationService",["$injector",function(e){var n=e.get("AuthenticationResult"),t=e.get("Error"),a=e.get("$rootScope"),r=e.get("localStorageService"),o=e.get("requestService"),i={},s=null,c=function(){if(s)return s;var e=r.getItem("GUAC_AUTH");return e?s=new n(e):null},l=function(e){e?(s=e,e.username!==n.ANONYMOUS_USERNAME&&r.setItem("GUAC_AUTH",e)):(s=null,r.removeItem("GUAC_AUTH"))},u=function(){l(null)};return i.authenticate=function(e){return o({method:"POST",url:"api/tokens",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:$.param(e)}).then(function(e){var t=i.getCurrentToken();return e.authToken!==t?(t&&i.logout().catch(angular.noop),l(new n(e)),a.$broadcast("guacLogin",e.authToken)):l(new n(e)),e}).catch(o.createErrorCallback(function(n){throw n.type===t.Type.INVALID_CREDENTIALS?a.$broadcast("guacInvalidCredentials",e,n):n.type===t.Type.INSUFFICIENT_CREDENTIALS?a.$broadcast("guacInsufficientCredentials",e,n):n.type===t.Type.INTERNAL_ERROR&&a.$broadcast("guacFatalPageError",n),n}))},i.updateCurrentToken=function(e){var n={};return i.getCurrentToken()&&(n.token=i.getCurrentToken()),e&&angular.extend(n,e),i.authenticate(n)},i.login=function(e,n){return i.authenticate({username:e,password:n})},i.logout=function(){var e=i.getCurrentToken();return u(),a.$broadcast("guacLogout",e),o({method:"DELETE",url:"api/tokens/"+e})},i.isAnonymous=function(){return""===i.getCurrentUsername()},i.getCurrentUsername=function(){var e=c();return e?e.username:null},i.getCurrentToken=function(){var e=c();return e?e.authToken:null},i.getDataSource=function(){var e=c();return e?e.dataSource:null},i.getAvailableDataSources=function(){var e=c();return e?e.availableDataSources:[]},i}]),angular.module("auth",["rest","storage"]),angular.module("rest").factory("cacheService",["$injector",function(e){var n=e.get("$cacheFactory"),t=e.get("$rootScope"),a={};return a.connections=n("API-CONNECTIONS"),a.languages=n("API-LANGUAGES"),a.patches=n("API-PATCHES"),a.schema=n("API-SCHEMA"),a.users=n("API-USERS"),a.clearCaches=function(){a.connections.removeAll(),a.languages.removeAll(),a.schema.removeAll(),a.users.removeAll()},t.$on("guacLogout",function(){a.clearCaches()}),a}]),angular.module("form").controller("checkboxFieldController",["$scope",function(e){e.$watch("model",function(n){e.typedValue=n===e.field.options[0]}),e.$watch("typedValue",function(n){e.model=n?e.field.options[0]:""})}]),angular.module("client").controller("clientController",["$scope","$routeParams","$injector",function(e,n,t){function a(){for(var e in D)if(!y[e])return!1;return!0}var r=t.get("ManagedClient"),o=t.get("ManagedClientState"),i=t.get("ManagedFilesystem"),s=t.get("Protocol"),c=t.get("ScrollState"),l=t.get("$location"),u=t.get("authenticationService"),m=t.get("clipboardService"),p=t.get("guacClientManager"),d=t.get("guacNotification"),g=t.get("iconService"),f=t.get("preferenceService"),h=t.get("requestService"),E=t.get("tunnelService"),v=t.get("userPageService"),C={65505:!0,65506:!0},S={65513:!0,65514:!0,65027:!0,65511:!0,65512:!0},A={65507:!0,65508:!0},y=angular.extend({},C,S,A),T={65367:!0,65457:!0},I={513:!0,514:!0,515:!0,519:!0,520:!0,521:!0,522:!0,523:!0,769:!0,771:!0,776:!0,797:!0},b={512:!0,514:!0,515:!0,519:!0,520:!0,769:!0,776:!0},N={513:!0,514:!0,515:!0,516:!0,517:!0,519:!0,520:!0,769:!0,771:!0,776:!0,797:!0},P={512:!0,514:!0,515:!0,519:!0,520:!0,776:!0},R={name:"CLIENT.ACTION_LOGOUT",className:"logout button",callback:function(){u.logout().catch(h.IGNORE).finally(function(){l.url("/")})}},O=null;v.getHomePage().then(function(e){l.path()!==e.url&&(O={name:"CLIENT.ACTION_NAVIGATE_HOME",className:"home button",callback:function(){l.url(e.url)}})},h.WARN);var G={name:"CLIENT.ACTION_RECONNECT",className:"reconnect button",callback:function(){e.client=p.replaceManagedClient(n.id,n.params),d.showStatus(!1)}},w={text:"CLIENT.TEXT_RECONNECT_COUNTDOWN",callback:G.callback,remaining:15};e.menu={shown:!1,autoFit:!0,inputMethod:f.preferences.inputMethod,scrollState:new c,connectionParameters:{}},e.closeMenu=function(){e.menu.shown=!1},e.applyParameterChanges=function(){angular.forEach(e.menu.connectionParameters,function(n,t){r.setArgument(e.client,t,n)})},e.client=p.getManagedClient(n.id,n.params),e.sharingProfiles={};var D={},F={},U={};e.menuDrag=function(n,t,a,r,o,i,s){return Math.abs(o-a)<10&&t-r>=64?e.menu.shown=!1:(e.menu.scrollState.left-=i,e.menu.scrollState.top-=s),!1},e.clientDrag=function(n,t,a,r,o,i,s){return t<=64?Math.abs(o-a)<10&&r-t>=64&&(e.menu.shown=!0):e.client.clientProperties.emulateAbsoluteMouse&&(e.client.clientProperties.scrollLeft-=i,e.client.clientProperties.scrollTop-=s),!1};var k=null,M=0,x=0;e.clientPinch=function(n,t,a,r,o){if(!e.client.clientProperties.emulateAbsoluteMouse)return!1;if(!n)return k=null,!1;k||(k=e.client.clientProperties.scale,M=(r+e.client.clientProperties.scrollLeft)/k,x=(o+e.client.clientProperties.scrollTop)/k);var i=k*a/t;return i=Math.max(i,e.client.clientProperties.minScale),i=Math.min(i,e.client.clientProperties.maxScale),e.menu.autoFit=!1,e.client.clientProperties.autoFit=!1,e.client.clientProperties.scale=i,e.client.clientProperties.scrollLeft=M*i-r,e.client.clientProperties.scrollTop=x*i-o,!1},e.$watch("menu.inputMethod",function(n){e.showOSK="osk"===n,e.showTextInput="text"===n}),e.$watch("menu.shown",function(n,t){!n&&t?(e.$broadcast("guacClipboard",e.client.clipboardData),e.applyParameterChanges()):n&&(e.menu.connectionParameters=r.getArgumentModel(e.client)),e.client.clientProperties.keyboardEnabled=!n}),e.$watch("client.thumbnail.canvas",function(e){g.setIcons(e)}),e.$watch("client.clipboardData",function(n){e.menu.shown||m.setLocalClipboard(n).catch(angular.noop);for(var t in D)U[t]=n}),e.$watch("client.tunnel.uuid",function(n){n&&E.getSharingProfiles(n).then(function(n){e.sharingProfiles=n},h.WARN)}),e.share=function(n){r.createShareLink(e.client,n)},e.isShared=function(){return r.isShared(e.client)},e.getShareLinkCount=function(){var n=0;for(var t in e.client.shareLinks)n++;return n},e.$on("guacKeydown",function(n,t,r){D[t]=!0;var o=Object.keys(D);a()&&(_.isEmpty(_.pick(C,o))||_.isEmpty(_.pick(S,o))||_.isEmpty(_.pick(A,o))||(n.preventDefault(),D={},r.reset(),e.$apply(function(){e.menu.shown=!e.menu.shown}))),!T[t]||_.isEmpty(_.pick(S,o))||_.isEmpty(_.pick(A,o))||(n.preventDefault(),delete D[t],F[t]=65535,e.$broadcast("guacSyntheticKeydown",65535))}),e.$on("guacKeyup",function(n,t,a){var r=U[t];r&&!e.menu.shown&&m.setLocalClipboard(r).catch(angular.noop),F[t]?(n.preventDefault(),delete F[t],e.$broadcast("guacSyntheticKeyup",F[t])):(delete U[t],delete D[t])}),e.$watch("client.title",function(n){e.page.title=n});var L=function(e){u.updateCurrentToken(l.search()).catch(h.IGNORE).finally(function(){d.showStatus(e)})};e.isConnectionUnstable=function(){return e.client&&e.client.clientState.tunnelUnstable},e.$watch("client.clientState.connectionState",function(n){if(d.showStatus(!1),n){var t;t=O?[O,G,R]:[G,R];var a=e.client.clientState.statusCode;if(n===o.ConnectionState.CONNECTING||n===o.ConnectionState.WAITING)d.showStatus({title:"CLIENT.DIALOG_HEADER_CONNECTING",text:{key:"CLIENT.TEXT_CLIENT_STATUS_"+n.toUpperCase()}});else if(n===o.ConnectionState.CLIENT_ERROR){r=a in I?a.toString(16).toUpperCase():"DEFAULT";L({className:"error",title:"CLIENT.DIALOG_HEADER_CONNECTION_ERROR",text:{key:"CLIENT.ERROR_CLIENT_"+r},countdown:i=a in b?w:null,actions:t})}else if(n===o.ConnectionState.TUNNEL_ERROR){var r=a in N?a.toString(16).toUpperCase():"DEFAULT",i=a in P?w:null;L({className:"error",title:"CLIENT.DIALOG_HEADER_CONNECTION_ERROR",text:{key:"CLIENT.ERROR_TUNNEL_"+r},countdown:i,actions:t})}else n===o.ConnectionState.DISCONNECTED?L({title:"CLIENT.DIALOG_HEADER_DISCONNECTED",text:{key:"CLIENT.TEXT_CLIENT_STATUS_"+n.toUpperCase()},actions:t}):n===o.ConnectionState.CONNECTED?(m.getLocalClipboard().then(function(n){e.$broadcast("guacClipboard",n)},angular.noop),d.showStatus(!1)):d.showStatus(!1)}}),e.zoomIn=function(){e.menu.autoFit=!1,e.client.clientProperties.autoFit=!1,e.client.clientProperties.scale+=.1},e.zoomOut=function(){e.client.clientProperties.autoFit=!1,e.client.clientProperties.scale-=.1},e.zoomSet=function(){e.menu.autoFit=!1,e.client.clientProperties.autoFit=!1},e.changeAutoFit=function(){e.menu.autoFit&&e.client.clientProperties.minScale?e.client.clientProperties.autoFit=!0:(e.client.clientProperties.autoFit=!1,e.client.clientProperties.scale=1)},e.autoFitDisabled=function(){return e.client.clientProperties.minZoom>=1},e.disconnect=function(){e.client&&e.client.client.disconnect(),e.menu.shown=!1};var B={name:"CLIENT.ACTION_DISCONNECT",className:"danger disconnect",callback:e.disconnect};e.clientMenuActions=[B],e.getProtocolNamespace=s.getNamespace,e.filesystemMenuContents=null,e.hideFilesystemMenu=function(){e.filesystemMenuContents=null},e.showFilesystemMenu=function(n){e.filesystemMenuContents=n},e.isFilesystemMenuShown=function(){return!!e.filesystemMenuContents&&e.menu.shown},e.$watch("isFilesystemMenuShown()",function(){var n=e.filesystemMenuContents;n&&i.refresh(n,n.currentDirectory)}),e.getPath=function(e){for(var n=[];e&&e.parent;)n.unshift(e),e=e.parent;return n},e.changeDirectory=function(e,n){i.changeDirectory(e,n)},e.uploadFiles=function(n){if(e.client)for(var t=0;t<n.length;t++)r.uploadFile(e.client,n[t],e.filesystemMenuContents)},e.hasTransfers=function(){return!!e.client&&!!e.client.uploads.length},e.canShareConnection=function(){for(var n in e.sharingProfiles)return!0;return!1},e.$on("$destroy",function(){var n=e.client;if(n){var t=n.clientState.connectionState;t!==o.ConnectionState.DISCONNECTED&&t!==o.ConnectionState.TUNNEL_ERROR&&t!==o.ConnectionState.CLIENT_ERROR||p.removeManagedClient(n.id)}})}]),angular.module("client").factory("ClientIdentifier",["$injector",function(e){var n=e.get("authenticationService"),t=e.get("$window"),a=function(e){e=e||{},this.dataSource=e.dataSource,this.type=e.type,this.id=e.id};return a.Types={CONNECTION:"c",CONNECTION_GROUP:"g",ACTIVE_CONNECTION:"a"},a.toString=function(e){return t.btoa([e.id,e.type,e.dataSource].join("\0"))},a.fromString=function(e){try{var r=t.atob(e).split("\0");return new a({id:r[0],type:r[1],dataSource:r[2]})}catch(t){return new a({id:e,type:a.Types.CONNECTION,dataSource:n.getDataSource()||"default"})}},a}]),angular.module("client",["auth","clipboard","element","history","navigation","notification","osk","rest","textInput","touch"]),angular.module("client").factory("ClientProperties",["$injector",function(e){var n=e.get("preferenceService");return function(e){e=e||{},this.autoFit=e.autoFit||!0,this.scale=e.scale||1,this.minScale=e.minScale||1,this.maxScale=e.maxScale||3,this.keyboardEnabled=e.keyboardEnabled||!0,this.emulateAbsoluteMouse=e.emulateAbsoluteMouse||n.preferences.emulateAbsoluteMouse,this.scrollTop=e.scrollTop||0,this.scrollLeft=e.scrollLeft||0}}]),angular.module("clipboard").factory("ClipboardData",[function(){return function(e){e=e||{},this.type=e.type||"text/plain",this.data=e.data||""}}]),angular.module("clipboard",[]),angular.module("clipboard").factory("clipboardService",["$injector",function(e){var n=e.get("$q"),t=e.get("$window"),a=e.get("ClipboardData"),r={},o=null,i=t.document,s=i.createElement("textarea");s.className="clipboard-service-target",i.body.appendChild(s);var c=function(e){e.stopPropagation()};s.addEventListener("cut",c),s.addEventListener("copy",c),s.addEventListener("paste",c),s.addEventListener("input",c);var l=[],u=function(){var e=t.getSelection();e.getRangeAt&&e.rangeCount&&l.push(e.getRangeAt(0))},m=function(){var e=l.pop();if(e){var n=t.getSelection();n.removeAllRanges(),n.addRange(e)}},p=function(e){if(e.select)e.select();else{var n=i.createRange();n.selectNodeContents(e);var a=t.getSelection();a.removeAllRanges(),a.addRange(n)}};return r.setLocalClipboard=function(e){var t=n.defer();try{if(navigator.clipboard&&navigator.clipboard.writeText&&"text/plain"===e.type)return navigator.clipboard.writeText(e.data).then(t.resolve,t.reject),t.promise}catch(e){}var a=i.activeElement;if(u(),"string"==typeof e.data)s.value=e.data;else{s.innerHTML="";var r=i.createElement("img");r.src=URL.createObjectURL(e.data),s.appendChild(r)}return s.focus(),p(s),i.execCommand("copy")?t.resolve():t.reject(),s.blur(),a.focus(),m(),t.promise},r.parseDataURL=function(e){var n=/^data:([^;]*);base64,([a-zA-Z0-9+/]*[=]*)$/.exec(e);if(!n)return null;for(var a=n[1],r=t.atob(n[2]),o=new Uint8Array(r.length),i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return new Blob([o],{type:a})},r.getTextContent=function(e){for(var n=[],a="",o=e.firstChild;o;)o.nodeType===Node.TEXT_NODE?a+=o.nodeValue:"BR"===o.nodeName?a+="\n":"IMG"===o.nodeName?a+=o.getAttribute("alt")||"":(a.length&&"block"===t.getComputedStyle(o).display&&("\n"===a.substring(a.length-1)&&(a=a.substring(0,a.length-1)),n.push(a),a=""),a+=r.getTextContent(o)),o=o.nextSibling;return a.length&&n.push(a),n.join("\n")},r.setTextContent=function(e,n){$(e).find("img").remove(),r.getTextContent(e)!==n&&(e.textContent=n)},r.getImageContent=function(e){var n=e.firstChild;return n&&"IMG"===n.nodeName&&!n.nextSibling?n.getAttribute("src"):null},r.setImageContent=function(e,n){if(r.getImageContent(e)!==n){e.innerHTML="";var t=i.createElement("img");t.src=n,e.appendChild(t)}},r.getLocalClipboard=function(){if(o)return o;var e=n.defer();try{if(navigator.clipboard&&navigator.clipboard.readText)return navigator.clipboard.readText().then(function(n){e.resolve(new a({type:"text/plain",data:n}))},e.reject),e.promise}catch(e){}var c=i.activeElement,l=function(){if(i.execCommand("paste")){var n=r.getImageContent(s);if(n){var t=r.parseDataURL(n);t?e.resolve(new a({type:t.type,data:t})):e.reject()}else e.resolve(new a({type:"text/plain",data:s.value}))}else e.reject()};return o=e.promise.finally(function(){s.removeEventListener("focus",l),s.blur(),c.focus(),m(),o=null}),t.setTimeout(function(){u(),s.blur(),s.addEventListener("focus",l),s.value="",s.focus(),p(s),i.activeElement!==s&&e.reject()},100),o},r}]),angular.module("form").provider("colorPickerService",function(){var e=null,n=!1,t=document.createElement("div");t.className="shared-color-picker";var a=null,r=function(n){a&&(e.hide(),n?a.resolve(n):a.reject(),a=null)};try{(e=Pickr.create({el:t,appClass:"guac-input-color-picker",default:"#000000",defaultRepresentation:"HEX",theme:"monolith",useAsButton:!0,appendToBody:!0,lockOpacity:!0,swatches:[],components:{preview:!0,hue:!0,interaction:{input:!0,save:!0,cancel:!0}}})).on("cancel",function(){r()}),e.on("save",function(e){r(e.toHEXA().toString()),a=null}),e.on("init",function(){n=!0})}catch(e){}this.$get=["$injector",function(o){var i=o.get("$q"),s=o.get("$translate"),c={},l=function(){var t=i.defer();return n?t.resolve():e?e.on("init",t.resolve):t.reject(),t.promise}();return c.isAvailable=function(){return!!e},c.selectColor=function(n,o,c){return i.all({saveString:s("APP.ACTION_SAVE"),cancelString:s("APP.ACTION_CANCEL"),pickr:l}).then(function(s){r(),e.setColor(o),n.appendChild(t);var l=e.getRoot();for(l.interaction.save.value=s.saveString,l.interaction.cancel.value=s.cancelString;e.removeSwatch(0););return angular.forEach(c,e.addSwatch.bind(e)),a=i.defer(),e.show(),a.promise})},c}]}),angular.module("form").factory("ColorScheme",[function(){var e=function(e){e=e||{},this.background=e.background||"#000000",this.foreground=e.foreground||"#999999",this.colors=e.colors||["#000000","#993E3E","#3E993E","#99993E","#3E3E99","#993E99","#3E9999","#999999","#3E3E3E","#FF6767","#67FF67","#FFFF67","#6767FF","#FF67FF","#67FFFF","#FFFFFF"],this._originalString=e._originalString},n=function(e){var n=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e);return n?"rgb:"+n[1]+"/"+n[2]+"/"+n[3]:null},t=function(n){var t=function(e){return(e+"0").substring(0,2).toUpperCase()},a=/^rgb:([0-9A-Fa-f]{1,4})\/([0-9A-Fa-f]{1,4})\/([0-9A-Fa-f]{1,4})$/.exec(n);return a?"#"+t(a[1])+t(a[2])+t(a[3]):e.NAMED_COLORS[n.toLowerCase()]||null};return e.fromString=function(n){for(var a=new e({_originalString:n}),r=n.split(/;/),o=0;o<r.length;o++){var i=r[o],s=/^\s*(background|foreground|color([0-9]+))\s*:\s*(\S*)\s*$/.exec(i);if(s){var c=t(s[3]);c&&("background"===s[1]?a.background=c:"foreground"===s[1]?a.foreground=c:a.colors[parseInt(s[2])]=c)}}return a},e.equals=function(e,n){return e.foreground===n.foreground&&e.background===n.background&&_.isEqual(e.colors,n.colors)},e.toString=function(t){if(!_.isUndefined(t._originalString)&&e.equals(t,e.fromString(t._originalString)))return t._originalString;var a="background: "+n(t.background)+";\nforeground: "+n(t.foreground)+";";for(var r in t.colors)a+="\ncolor"+r+": "+n(t.colors[r])+";";return a},e.NAMED_COLORS={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",antiquewhite1:"#FFEFDB",antiquewhite2:"#EEDFCC",antiquewhite3:"#CDC0B0",antiquewhite4:"#8B8378",aqua:"#00FFFF",aquamarine:"#7FFFD4",aquamarine1:"#7FFFD4",aquamarine2:"#76EEC6",aquamarine3:"#66CDAA",aquamarine4:"#458B74",azure:"#F0FFFF",azure1:"#F0FFFF",azure2:"#E0EEEE",azure3:"#C1CDCD",azure4:"#838B8B",beige:"#F5F5DC",bisque:"#FFE4C4",bisque1:"#FFE4C4",bisque2:"#EED5B7",bisque3:"#CDB79E",bisque4:"#8B7D6B",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blue1:"#0000FF",blue2:"#0000EE",blue3:"#0000CD",blue4:"#00008B",blueviolet:"#8A2BE2",brown:"#A52A2A",brown1:"#FF4040",brown2:"#EE3B3B",brown3:"#CD3333",brown4:"#8B2323",burlywood:"#DEB887",burlywood1:"#FFD39B",burlywood2:"#EEC591",burlywood3:"#CDAA7D",burlywood4:"#8B7355",cadetblue:"#5F9EA0",cadetblue1:"#98F5FF",cadetblue2:"#8EE5EE",cadetblue3:"#7AC5CD",cadetblue4:"#53868B",chartreuse:"#7FFF00",chartreuse1:"#7FFF00",chartreuse2:"#76EE00",chartreuse3:"#66CD00",chartreuse4:"#458B00",chocolate:"#D2691E",chocolate1:"#FF7F24",chocolate2:"#EE7621",chocolate3:"#CD661D",chocolate4:"#8B4513",coral:"#FF7F50",coral1:"#FF7256",coral2:"#EE6A50",coral3:"#CD5B45",coral4:"#8B3E2F",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",cornsilk1:"#FFF8DC",cornsilk2:"#EEE8CD",cornsilk3:"#CDC8B1",cornsilk4:"#8B8878",crimson:"#DC143C",cyan:"#00FFFF",cyan1:"#00FFFF",cyan2:"#00EEEE",cyan3:"#00CDCD",cyan4:"#008B8B",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgoldenrod1:"#FFB90F",darkgoldenrod2:"#EEAD0E",darkgoldenrod3:"#CD950C",darkgoldenrod4:"#8B6508",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkolivegreen1:"#CAFF70",darkolivegreen2:"#BCEE68",darkolivegreen3:"#A2CD5A",darkolivegreen4:"#6E8B3D",darkorange:"#FF8C00",darkorange1:"#FF7F00",darkorange2:"#EE7600",darkorange3:"#CD6600",darkorange4:"#8B4500",darkorchid:"#9932CC",darkorchid1:"#BF3EFF",darkorchid2:"#B23AEE",darkorchid3:"#9A32CD",darkorchid4:"#68228B",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkseagreen1:"#C1FFC1",darkseagreen2:"#B4EEB4",darkseagreen3:"#9BCD9B",darkseagreen4:"#698B69",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategray1:"#97FFFF",darkslategray2:"#8DEEEE",darkslategray3:"#79CDCD",darkslategray4:"#528B8B",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deeppink1:"#FF1493",deeppink2:"#EE1289",deeppink3:"#CD1076",deeppink4:"#8B0A50",deepskyblue:"#00BFFF",deepskyblue1:"#00BFFF",deepskyblue2:"#00B2EE",deepskyblue3:"#009ACD",deepskyblue4:"#00688B",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",dodgerblue1:"#1E90FF",dodgerblue2:"#1C86EE",dodgerblue3:"#1874CD",dodgerblue4:"#104E8B",firebrick:"#B22222",firebrick1:"#FF3030",firebrick2:"#EE2C2C",firebrick3:"#CD2626",firebrick4:"#8B1A1A",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",gold1:"#FFD700",gold2:"#EEC900",gold3:"#CDAD00",gold4:"#8B7500",goldenrod:"#DAA520",goldenrod1:"#FFC125",goldenrod2:"#EEB422",goldenrod3:"#CD9B1D",goldenrod4:"#8B6914",gray:"#BEBEBE",gray0:"#000000",gray1:"#030303",gray10:"#1A1A1A",gray100:"#FFFFFF",gray11:"#1C1C1C",gray12:"#1F1F1F",gray13:"#212121",gray14:"#242424",gray15:"#262626",gray16:"#292929",gray17:"#2B2B2B",gray18:"#2E2E2E",gray19:"#303030",gray2:"#050505",gray20:"#333333",gray21:"#363636",gray22:"#383838",gray23:"#3B3B3B",gray24:"#3D3D3D",gray25:"#404040",gray26:"#424242",gray27:"#454545",gray28:"#474747",gray29:"#4A4A4A",gray3:"#080808",gray30:"#4D4D4D",gray31:"#4F4F4F",gray32:"#525252",gray33:"#545454",gray34:"#575757",gray35:"#595959",gray36:"#5C5C5C",gray37:"#5E5E5E",gray38:"#616161",gray39:"#636363",gray4:"#0A0A0A",gray40:"#666666",gray41:"#696969",gray42:"#6B6B6B",gray43:"#6E6E6E",gray44:"#707070",gray45:"#737373",gray46:"#757575",gray47:"#787878",gray48:"#7A7A7A",gray49:"#7D7D7D",gray5:"#0D0D0D",gray50:"#7F7F7F",gray51:"#828282",gray52:"#858585",gray53:"#878787",gray54:"#8A8A8A",gray55:"#8C8C8C",gray56:"#8F8F8F",gray57:"#919191",gray58:"#949494",gray59:"#969696",gray6:"#0F0F0F",gray60:"#999999",gray61:"#9C9C9C",gray62:"#9E9E9E",gray63:"#A1A1A1",gray64:"#A3A3A3",gray65:"#A6A6A6",gray66:"#A8A8A8",gray67:"#ABABAB",gray68:"#ADADAD",gray69:"#B0B0B0",gray7:"#121212",gray70:"#B3B3B3",gray71:"#B5B5B5",gray72:"#B8B8B8",gray73:"#BABABA",gray74:"#BDBDBD",gray75:"#BFBFBF",gray76:"#C2C2C2",gray77:"#C4C4C4",gray78:"#C7C7C7",gray79:"#C9C9C9",gray8:"#141414",gray80:"#CCCCCC",gray81:"#CFCFCF",gray82:"#D1D1D1",gray83:"#D4D4D4",gray84:"#D6D6D6",gray85:"#D9D9D9",gray86:"#DBDBDB",gray87:"#DEDEDE",gray88:"#E0E0E0",gray89:"#E3E3E3",gray9:"#171717",gray90:"#E5E5E5",gray91:"#E8E8E8",gray92:"#EBEBEB",gray93:"#EDEDED",gray94:"#F0F0F0",gray95:"#F2F2F2",gray96:"#F5F5F5",gray97:"#F7F7F7",gray98:"#FAFAFA",gray99:"#FCFCFC",green:"#00FF00",green1:"#00FF00",green2:"#00EE00",green3:"#00CD00",green4:"#008B00",greenyellow:"#ADFF2F",grey:"#BEBEBE",grey0:"#000000",grey1:"#030303",grey10:"#1A1A1A",grey100:"#FFFFFF",grey11:"#1C1C1C",grey12:"#1F1F1F",grey13:"#212121",grey14:"#242424",grey15:"#262626",grey16:"#292929",grey17:"#2B2B2B",grey18:"#2E2E2E",grey19:"#303030",grey2:"#050505",grey20:"#333333",grey21:"#363636",grey22:"#383838",grey23:"#3B3B3B",grey24:"#3D3D3D",grey25:"#404040",grey26:"#424242",grey27:"#454545",grey28:"#474747",grey29:"#4A4A4A",grey3:"#080808",grey30:"#4D4D4D",grey31:"#4F4F4F",grey32:"#525252",grey33:"#545454",grey34:"#575757",grey35:"#595959",grey36:"#5C5C5C",grey37:"#5E5E5E",grey38:"#616161",grey39:"#636363",grey4:"#0A0A0A",grey40:"#666666",grey41:"#696969",grey42:"#6B6B6B",grey43:"#6E6E6E",grey44:"#707070",grey45:"#737373",grey46:"#757575",grey47:"#787878",grey48:"#7A7A7A",grey49:"#7D7D7D",grey5:"#0D0D0D",grey50:"#7F7F7F",grey51:"#828282",grey52:"#858585",grey53:"#878787",grey54:"#8A8A8A",grey55:"#8C8C8C",grey56:"#8F8F8F",grey57:"#919191",grey58:"#949494",grey59:"#969696",grey6:"#0F0F0F",grey60:"#999999",grey61:"#9C9C9C",grey62:"#9E9E9E",grey63:"#A1A1A1",grey64:"#A3A3A3",grey65:"#A6A6A6",grey66:"#A8A8A8",grey67:"#ABABAB",grey68:"#ADADAD",grey69:"#B0B0B0",grey7:"#121212",grey70:"#B3B3B3",grey71:"#B5B5B5",grey72:"#B8B8B8",grey73:"#BABABA",grey74:"#BDBDBD",grey75:"#BFBFBF",grey76:"#C2C2C2",grey77:"#C4C4C4",grey78:"#C7C7C7",grey79:"#C9C9C9",grey8:"#141414",grey80:"#CCCCCC",grey81:"#CFCFCF",grey82:"#D1D1D1",grey83:"#D4D4D4",grey84:"#D6D6D6",grey85:"#D9D9D9",grey86:"#DBDBDB",grey87:"#DEDEDE",grey88:"#E0E0E0",grey89:"#E3E3E3",grey9:"#171717",grey90:"#E5E5E5",grey91:"#E8E8E8",grey92:"#EBEBEB",grey93:"#EDEDED",grey94:"#F0F0F0",grey95:"#F2F2F2",grey96:"#F5F5F5",grey97:"#F7F7F7",grey98:"#FAFAFA",grey99:"#FCFCFC",honeydew:"#F0FFF0",honeydew1:"#F0FFF0",honeydew2:"#E0EEE0",honeydew3:"#C1CDC1",honeydew4:"#838B83",hotpink:"#FF69B4",hotpink1:"#FF6EB4",hotpink2:"#EE6AA7",hotpink3:"#CD6090",hotpink4:"#8B3A62",indianred:"#CD5C5C",indianred1:"#FF6A6A",indianred2:"#EE6363",indianred3:"#CD5555",indianred4:"#8B3A3A",indigo:"#4B0082",ivory:"#FFFFF0",ivory1:"#FFFFF0",ivory2:"#EEEEE0",ivory3:"#CDCDC1",ivory4:"#8B8B83",khaki:"#F0E68C",khaki1:"#FFF68F",khaki2:"#EEE685",khaki3:"#CDC673",khaki4:"#8B864E",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lavenderblush1:"#FFF0F5",lavenderblush2:"#EEE0E5",lavenderblush3:"#CDC1C5",lavenderblush4:"#8B8386",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lemonchiffon1:"#FFFACD",lemonchiffon2:"#EEE9BF",lemonchiffon3:"#CDC9A5",lemonchiffon4:"#8B8970",lightblue:"#ADD8E6",lightblue1:"#BFEFFF",lightblue2:"#B2DFEE",lightblue3:"#9AC0CD",lightblue4:"#68838B",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightcyan1:"#E0FFFF",lightcyan2:"#D1EEEE",lightcyan3:"#B4CDCD",lightcyan4:"#7A8B8B",lightgoldenrod:"#EEDD82",lightgoldenrod1:"#FFEC8B",lightgoldenrod2:"#EEDC82",lightgoldenrod3:"#CDBE70",lightgoldenrod4:"#8B814C",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightpink1:"#FFAEB9",lightpink2:"#EEA2AD",lightpink3:"#CD8C95",lightpink4:"#8B5F65",lightsalmon:"#FFA07A",lightsalmon1:"#FFA07A",lightsalmon2:"#EE9572",lightsalmon3:"#CD8162",lightsalmon4:"#8B5742",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightskyblue1:"#B0E2FF",lightskyblue2:"#A4D3EE",lightskyblue3:"#8DB6CD",lightskyblue4:"#607B8B",lightslateblue:"#8470FF",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightsteelblue1:"#CAE1FF",lightsteelblue2:"#BCD2EE",lightsteelblue3:"#A2B5CD",lightsteelblue4:"#6E7B8B",lightyellow:"#FFFFE0",lightyellow1:"#FFFFE0",lightyellow2:"#EEEED1",lightyellow3:"#CDCDB4",lightyellow4:"#8B8B7A",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",magenta1:"#FF00FF",magenta2:"#EE00EE",magenta3:"#CD00CD",magenta4:"#8B008B",maroon:"#B03060",maroon1:"#FF34B3",maroon2:"#EE30A7",maroon3:"#CD2990",maroon4:"#8B1C62",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumorchid1:"#E066FF",mediumorchid2:"#D15FEE",mediumorchid3:"#B452CD",mediumorchid4:"#7A378B",mediumpurple:"#9370DB",mediumpurple1:"#AB82FF",mediumpurple2:"#9F79EE",mediumpurple3:"#8968CD",mediumpurple4:"#5D478B",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",mistyrose1:"#FFE4E1",mistyrose2:"#EED5D2",mistyrose3:"#CDB7B5",mistyrose4:"#8B7D7B",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navajowhite1:"#FFDEAD",navajowhite2:"#EECFA1",navajowhite3:"#CDB38B",navajowhite4:"#8B795E",navy:"#000080",navyblue:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",olivedrab1:"#C0FF3E",olivedrab2:"#B3EE3A",olivedrab3:"#9ACD32",olivedrab4:"#698B22",orange:"#FFA500",orange1:"#FFA500",orange2:"#EE9A00",orange3:"#CD8500",orange4:"#8B5A00",orangered:"#FF4500",orangered1:"#FF4500",orangered2:"#EE4000",orangered3:"#CD3700",orangered4:"#8B2500",orchid:"#DA70D6",orchid1:"#FF83FA",orchid2:"#EE7AE9",orchid3:"#CD69C9",orchid4:"#8B4789",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",palegreen1:"#9AFF9A",palegreen2:"#90EE90",palegreen3:"#7CCD7C",palegreen4:"#548B54",paleturquoise:"#AFEEEE",paleturquoise1:"#BBFFFF",paleturquoise2:"#AEEEEE",paleturquoise3:"#96CDCD",paleturquoise4:"#668B8B",palevioletred:"#DB7093",palevioletred1:"#FF82AB",palevioletred2:"#EE799F",palevioletred3:"#CD6889",palevioletred4:"#8B475D",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peachpuff1:"#FFDAB9",peachpuff2:"#EECBAD",peachpuff3:"#CDAF95",peachpuff4:"#8B7765",peru:"#CD853F",pink:"#FFC0CB",pink1:"#FFB5C5",pink2:"#EEA9B8",pink3:"#CD919E",pink4:"#8B636C",plum:"#DDA0DD",plum1:"#FFBBFF",plum2:"#EEAEEE",plum3:"#CD96CD",plum4:"#8B668B",powderblue:"#B0E0E6",purple:"#A020F0",purple1:"#9B30FF",purple2:"#912CEE",purple3:"#7D26CD",purple4:"#551A8B",rebeccapurple:"#663399",red:"#FF0000",red1:"#FF0000",red2:"#EE0000",red3:"#CD0000",red4:"#8B0000",rosybrown:"#BC8F8F",rosybrown1:"#FFC1C1",rosybrown2:"#EEB4B4",rosybrown3:"#CD9B9B",rosybrown4:"#8B6969",royalblue:"#4169E1",royalblue1:"#4876FF",royalblue2:"#436EEE",royalblue3:"#3A5FCD",royalblue4:"#27408B",saddlebrown:"#8B4513",salmon:"#FA8072",salmon1:"#FF8C69",salmon2:"#EE8262",salmon3:"#CD7054",salmon4:"#8B4C39",sandybrown:"#F4A460",seagreen:"#2E8B57",seagreen1:"#54FF9F",seagreen2:"#4EEE94",seagreen3:"#43CD80",seagreen4:"#2E8B57",seashell:"#FFF5EE",seashell1:"#FFF5EE",seashell2:"#EEE5DE",seashell3:"#CDC5BF",seashell4:"#8B8682",sienna:"#A0522D",sienna1:"#FF8247",sienna2:"#EE7942",sienna3:"#CD6839",sienna4:"#8B4726",silver:"#C0C0C0",skyblue:"#87CEEB",skyblue1:"#87CEFF",skyblue2:"#7EC0EE",skyblue3:"#6CA6CD",skyblue4:"#4A708B",slateblue:"#6A5ACD",slateblue1:"#836FFF",slateblue2:"#7A67EE",slateblue3:"#6959CD",slateblue4:"#473C8B",slategray:"#708090",slategray1:"#C6E2FF",slategray2:"#B9D3EE",slategray3:"#9FB6CD",slategray4:"#6C7B8B",slategrey:"#708090",snow:"#FFFAFA",snow1:"#FFFAFA",snow2:"#EEE9E9",snow3:"#CDC9C9",snow4:"#8B8989",springgreen:"#00FF7F",springgreen1:"#00FF7F",springgreen2:"#00EE76",springgreen3:"#00CD66",springgreen4:"#008B45",steelblue:"#4682B4",steelblue1:"#63B8FF",steelblue2:"#5CACEE",steelblue3:"#4F94CD",steelblue4:"#36648B",tan:"#D2B48C",tan1:"#FFA54F",tan2:"#EE9A49",tan3:"#CD853F",tan4:"#8B5A2B",teal:"#008080",thistle:"#D8BFD8",thistle1:"#FFE1FF",thistle2:"#EED2EE",thistle3:"#CDB5CD",thistle4:"#8B7B8B",tomato:"#FF6347",tomato1:"#FF6347",tomato2:"#EE5C42",tomato3:"#CD4F39",tomato4:"#8B3626",turquoise:"#40E0D0",turquoise1:"#00F5FF",turquoise2:"#00E5EE",turquoise3:"#00C5CD",turquoise4:"#00868B",violet:"#EE82EE",violetred:"#D02090",violetred1:"#FF3E96",violetred2:"#EE3A8C",violetred3:"#CD3278",violetred4:"#8B2252",webgray:"#808080",webgreen:"#008000",webgrey:"#808080",webmaroon:"#800000",webpurple:"#800080",wheat:"#F5DEB3",wheat1:"#FFE7BA",wheat2:"#EED8AE",wheat3:"#CDBA96",wheat4:"#8B7E66",white:"#FFFFFF",whitesmoke:"#F5F5F5",x11gray:"#BEBEBE",x11green:"#00FF00",x11grey:"#BEBEBE",x11maroon:"#B03060",x11purple:"#A020F0",yellow:"#FFFF00",yellow1:"#FFFF00",yellow2:"#EEEE00",yellow3:"#CDCD00",yellow4:"#8B8B00",yellowgreen:"#9ACD32"},e}]),angular.module("rest").factory("Connection",[function(){return function(e){e=e||{},this.identifier=e.identifier,this.parentIdentifier=e.parentIdentifier,this.name=e.name,this.protocol=e.protocol,this.parameters=e.parameters,this.attributes=e.attributes||{},this.activeConnections=e.activeConnections,this.sharingProfiles=e.sharingProfiles,this.lastActive=e.lastActive}}]),angular.module("rest").factory("ConnectionGroup",[function(){var e=function e(n){n=n||{},this.identifier=n.identifier,this.parentIdentifier=n.parentIdentifier||e.ROOT_IDENTIFIER,this.name=n.name,this.type=n.type||e.Type.ORGANIZATIONAL,this.childConnections=n.childConnections,this.childConnectionGroups=n.childConnectionGroups,this.attributes=n.attributes||{},this.activeConnections=n.activeConnections};return e.ROOT_IDENTIFIER="ROOT",e.Type={BALANCING:"BALANCING",ORGANIZATIONAL:"ORGANIZATIONAL"},e}]),angular.module("rest").factory("connectionGroupService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r=e.get("ConnectionGroup"),o={};return o.getConnectionGroupTree=function(e,o,i){o=o||r.ROOT_IDENTIFIER;var s={token:t.getCurrentToken()};return i&&(s.permission=i),n({cache:a.connections,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/connectionGroups/"+encodeURIComponent(o)+"/tree",params:s})},o.getConnectionGroup=function(e,o){o=o||r.ROOT_IDENTIFIER;var i={token:t.getCurrentToken()};return n({cache:a.connections,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/connectionGroups/"+encodeURIComponent(o),params:i})},o.saveConnectionGroup=function(e,r){var o={token:t.getCurrentToken()};return r.identifier?n({method:"PUT",url:"api/session/data/"+encodeURIComponent(e)+"/connectionGroups/"+encodeURIComponent(r.identifier),params:o,data:r}).then(function(){a.connections.removeAll(),a.users.removeAll()}):n({method:"POST",url:"api/session/data/"+encodeURIComponent(e)+"/connectionGroups",params:o,data:r}).then(function(e){r.identifier=e.identifier,a.connections.removeAll(),a.users.removeAll()})},o.deleteConnectionGroup=function(e,r){var o={token:t.getCurrentToken()};return n({method:"DELETE",url:"api/session/data/"+encodeURIComponent(e)+"/connectionGroups/"+encodeURIComponent(r.identifier),params:o}).then(function(){a.connections.removeAll()})},o}]),angular.module("rest").factory("ConnectionHistoryEntry",[function(){var e=function(e){e=e||{},this.connectionIdentifier=e.connectionIdentifier,this.connectionName=e.connectionName,this.remoteHost=e.remoteHost,this.startDate=e.startDate,this.endDate=e.endDate,this.remoteHost=e.remoteHost,this.username=e.username,this.active=e.active};return e.SortPredicate={START_DATE:"startDate"},e.Duration=function(e){var n=e/1e3,t=function(e){return Math.round(10*e)/10};n>=86400?(this.value=t(n/86400),this.unit="day"):n>=3600?(this.value=t(n/3600),this.unit="hour"):n>=60?(this.value=t(n/60),this.unit="minute"):(this.value=t(n),this.unit="second")},e}]),angular.module("settings").factory("ConnectionHistoryEntryWrapper",["$injector",function(e){var n=e.get("ConnectionHistoryEntry");return function(e){this.connectionIdentifier=e.connectionIdentifier,this.connectionName=e.connectionName,this.remoteHost=e.remoteHost,this.username=e.username,this.startDate=e.startDate,this.endDate=e.endDate,this.duration=this.endDate-this.startDate,this.readableDuration=null,this.endDate&&this.startDate&&(this.readableDuration=new n.Duration(this.duration)),this.readableDurationText="SETTINGS_CONNECTION_HISTORY.TEXT_HISTORY_DURATION",this.endDate||(this.readableDurationText="SETTINGS_CONNECTION_HISTORY.INFO_CONNECTION_DURATION_UNKNOWN")}}]),angular.module("manage").directive("connectionPermissionEditor",["$injector",function(e){var n=e.get("ConnectionGroup"),t=e.get("GroupListItem"),a=e.get("PermissionSet"),r=e.get("connectionGroupService"),o=e.get("dataSourceService"),i=e.get("requestService"),s={restrict:"E",replace:!0,scope:{dataSource:"=",permissionFlags:"=",permissionsAdded:"=",permissionsRemoved:"="},templateUrl:"app/manage/templates/connectionPermissionEditor.html"};return s.controller=["$scope",function(e){var s=null,c=null;e.tabs=["CURRENT_CONNECTIONS","ALL_CONNECTIONS"],e.currentTab="ALL_CONNECTIONS",e.filteredConnectionProperties=["name","protocol"],e.filteredConnectionGroupProperties=["name"],e.getRootGroups=function(){return"CURRENT_CONNECTIONS"===e.currentTab?c:s};var l=function(e,n){switch(e.type){case t.Type.CONNECTION:return n.connectionPermissions.READ[e.identifier];case t.Type.CONNECTION_GROUP:return n.connectionGroupPermissions.READ[e.identifier];case t.Type.SHARING_PROFILE:return n.sharingProfilePermissions.READ[e.identifier]}return!1},u=function e(n,t){return n.expandable&&n.children&&angular.forEach(n.children,function(a){n.expanded|=e(a,t)||l(a,t)}),n.expanded},m=function e(n,a){if((n=new t(n)).children){var r=[];angular.forEach(n.children,function(t){((t=e(t,a)).children&&t.children.length||l(n,a)||l(t,a))&&r.push(t)}),n.children=r}return n};o.apply(r.getConnectionGroupTree,[e.dataSource],n.ROOT_IDENTIFIER,[a.ObjectPermissionType.ADMINISTER]).then(function(n){e.$watchGroup(["permissionFlags"],function(){e.permissionFlags&&(s={},c={},angular.forEach(n,function(n,a){var r=t.fromConnectionGroup(a,n);s[a]=r,u(r,e.permissionFlags),c[a]=m(r,e.permissionFlags)}),e.currentTab=c[e.dataSource].children.length?"CURRENT_CONNECTIONS":"ALL_CONNECTIONS")})},i.DIE);var p=function(n){a.hasConnectionPermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n)?a.removeConnectionPermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n):a.addConnectionPermission(e.permissionsAdded,a.ObjectPermissionType.READ,n)},d=function(n){a.hasConnectionPermission(e.permissionsAdded,a.ObjectPermissionType.READ,n)?a.removeConnectionPermission(e.permissionsAdded,a.ObjectPermissionType.READ,n):a.addConnectionPermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n)},g=function(n){a.hasConnectionGroupPermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n)?a.removeConnectionGroupPermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n):a.addConnectionGroupPermission(e.permissionsAdded,a.ObjectPermissionType.READ,n)},f=function(n){a.hasConnectionGroupPermission(e.permissionsAdded,a.ObjectPermissionType.READ,n)?a.removeConnectionGroupPermission(e.permissionsAdded,a.ObjectPermissionType.READ,n):a.addConnectionGroupPermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n)},h=function(n){a.hasSharingProfilePermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n)?a.removeSharingProfilePermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n):a.addSharingProfilePermission(e.permissionsAdded,a.ObjectPermissionType.READ,n)},E=function(n){a.hasSharingProfilePermission(e.permissionsAdded,a.ObjectPermissionType.READ,n)?a.removeSharingProfilePermission(e.permissionsAdded,a.ObjectPermissionType.READ,n):a.addSharingProfilePermission(e.permissionsRemoved,a.ObjectPermissionType.READ,n)};e.groupListContext={getPermissionFlags:function(){return e.permissionFlags},connectionPermissionChanged:function(n){e.permissionFlags.connectionPermissions.READ[n]?p(n):d(n)},connectionGroupPermissionChanged:function(n){e.permissionFlags.connectionGroupPermissions.READ[n]?g(n):f(n)},sharingProfilePermissionChanged:function(n){e.permissionFlags.sharingProfilePermissions.READ[n]?h(n):E(n)}}}],s}]),angular.module("rest").factory("connectionService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r={};return r.getConnection=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.connections,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/connections/"+encodeURIComponent(r),params:o})},r.getConnectionHistory=function(e,a){var r={token:t.getCurrentToken()};return n({method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/connections/"+encodeURIComponent(a)+"/history",params:r})},r.getConnectionParameters=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.connections,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/connections/"+encodeURIComponent(r)+"/parameters",params:o})},r.saveConnection=function(e,r){var o={token:t.getCurrentToken()};return r.identifier?n({method:"PUT",url:"api/session/data/"+encodeURIComponent(e)+"/connections/"+encodeURIComponent(r.identifier),params:o,data:r}).then(function(){a.connections.removeAll(),a.users.removeAll()}):n({method:"POST",url:"api/session/data/"+encodeURIComponent(e)+"/connections",params:o,data:r}).then(function(e){r.identifier=e.identifier,a.connections.removeAll(),a.users.removeAll()})},r.deleteConnection=function(e,r){var o={token:t.getCurrentToken()};return n({method:"DELETE",url:"api/session/data/"+encodeURIComponent(e)+"/connections/"+encodeURIComponent(r.identifier),params:o}).then(function(){a.connections.removeAll()})},r}]),angular.module("settings").factory("csvService",[function(){var e={},n=function(e){return e=null===e||void 0===e?"":""+e,/^[0-9.]*$/.test(e)?e:'"'+e.replace(/"/g,'""')+'"'},t=function(e){return e.map(n).join(",")},a=function(e){return e.map(t).join("\r\n")};return e.toBlob=function(e){return new Blob([a(e)],{type:"text/csv"})},e}]),angular.module("rest").factory("dataSourceService",["$injector",function(e){var n=e.get("Error"),t=e.get("$q"),a=e.get("requestService"),r={};return r.apply=function(e,r){for(var o=t.defer(),i=[],s={},c=[],l=2;l<arguments.length;l++)c.push(arguments[l]);return angular.forEach(r,function(r){var o=t.defer();i.push(o.promise),e.apply(this,[r].concat(c)).then(function(e){s[r]=e,o.resolve()},a.createErrorCallback(function(e){e.type===n.Type.NOT_FOUND?o.resolve():o.reject(e)}))}),t.all(i).then(function(){o.resolve(s)},a.createErrorCallback(function(e){o.reject(e)})),o.promise},r}]),angular.module("manage").directive("dataSourceTabs",["$injector",function(e){var n=e.get("PageDefinition"),t=e.get("translationStringService"),a={restrict:"E",replace:!0,templateUrl:"app/manage/templates/dataSourceTabs.html",scope:{permissions:"=",url:"&"}};return a.controller=["$scope",function(e){e.pages=null,e.$watch("permissions",function(a){e.pages=[];var r=_.keys(e.permissions).sort();angular.forEach(r,function(r){var o=a[r],i=!!o.identifier,s=!o.canSaveObject;if(i||!s){var c;c=s?"read-only":i?"linked":"unlinked",e.pages.push(new n({name:t.canonicalize("DATA_SOURCE_"+r)+".NAME",url:e.url({dataSource:r}),className:c}))}})})}],a}]),angular.module("form").controller("dateFieldController",["$scope","$injector",function(e,n){var t=n.get("$filter");e.modelOptions={updateOn:"blur",timezone:"UTC"};var a=function(e){var n=new Date(e+"T00:00Z");return isNaN(n.getTime())?null:n};e.$watch("model",function(n){e.typedValue=n?a(n):null}),e.$watch("typedValue",function(n){e.model=n?t("date")(n,"yyyy-MM-dd","UTC"):""})}]),angular.module("element",[]),angular.module("rest").factory("Error",[function(){var e=function e(n){n=n||{},this.message=n.message,this.translatableMessage=n.translatableMessage,this.statusCode=n.statusCode,this.type=n.type||e.Type.INTERNAL_ERROR,this.expected=n.expected};return e.Type={BAD_REQUEST:"BAD_REQUEST",INVALID_CREDENTIALS:"INVALID_CREDENTIALS",INSUFFICIENT_CREDENTIALS:"INSUFFICIENT_CREDENTIALS",INTERNAL_ERROR:"INTERNAL_ERROR",NOT_FOUND:"NOT_FOUND",PERMISSION_DENIED:"PERMISSION_DENIED",STREAM_ERROR:"STREAM_ERROR"},e}]),angular.module("rest").factory("Field",[function(){var e=function e(n){n=n||{},this.name=n.name,this.type=n.type||e.Type.TEXT,this.options=n.options};return e.Type={TEXT:"TEXT",EMAIL:"EMAIL",USERNAME:"USERNAME",PASSWORD:"PASSWORD",NUMERIC:"NUMERIC",BOOLEAN:"BOOLEAN",ENUM:"ENUM",MULTILINE:"MULTILINE",TIMEZONE:"TIMEZONE",DATE:"DATE",TIME:"TIME",QUERY_PARAMETER:"QUERY_PARAMETER",TERMINAL_COLOR_SCHEME:"TERMINAL_COLOR_SCHEME"},e}]),angular.module("form").factory("FieldType",[function(){return function(e){e=e||{},this.template=e.template,this.templateUrl=e.templateUrl,this.module=e.module,this.controller=e.controller}}]),angular.module("list").factory("FilterPattern",["$injector",function(e){var n=e.get("FilterToken"),t=e.get("IPv4Network"),a=e.get("IPv6Network"),r=e.get("$parse");return function(e){var o=this,i=function(){return!0},s=[];angular.forEach(e,function(e){s.push(r(e))});var c=function(e,n){for(var t=0;t<s.length;t++){var a=s[t](e);if(-1!==String(a).toLowerCase().indexOf(n))return!0}return!1},l=function(e,n){for(var a=0;a<s.length;a++){var r=t.parse(String(s[a](e)));if(r&&n.contains(r))return!0}return!1},u=function(e,n){for(var t=0;t<s.length;t++){var r=a.parse(String(s[t](e)));if(r&&n.contains(r))return!0}return!1},m=function(e,n){switch(n.type){case"LITERAL":return c(e,n.value);case"IPV4_NETWORK":return l(e,n.value);case"IPV6_NETWORK":return u(e,n.value);default:return!1}};this.predicate=i,this.compile=function(e){if(e){var t=n.tokenize(e.toLowerCase());o.predicate=function(e){for(var n=0;n<t.length;n++)if(!m(e,t[n]))return!1;return!0}}else o.predicate=i}}}]),angular.module("list").factory("FilterToken",["$injector",function(e){var n=e.get("IPv4Network"),t=e.get("IPv6Network"),a=function(e,n,t){this.consumed=e,this.type=n,this.value=t};return a.Types={IPV4_NETWORK:function(e){var t=/^\S+/.exec(e);if(!t)return null;var r=n.parse(t[0]);return r?new a(t[0],"IPV4_NETWORK",r):null},IPV6_NETWORK:function(e){var n=/^\S+/.exec(e);if(!n)return null;var r=t.parse(n[0]);return r?new a(n[0],"IPV6_NETWORK",r):null},LITERAL:function(e){var n=/^"([^"]*)"|^\S+/.exec(e);return n?n[1]?new a(n[0],"LITERAL",n[1]):new a(n[0],"LITERAL",n[0]):null},WHITESPACE:function(e){var n=/^\s+/.exec(e);return n?new a(n[0],"WHITESPACE",n[0]):null}},a.tokenize=function(e){for(var n=[];e;){var t=function(){for(var n in a.Types){var t=(0,a.Types[n])(e);if(t)return e=e.substring(t.consumed.length),t}return null}();if(!t)break;"WHITESPACE"!==t.type&&n.push(t)}return n},a}]),angular.module("form").directive("guacForm",[function(){return{restrict:"E",replace:!0,scope:{namespace:"=",content:"=",model:"=",modelOnly:"="},templateUrl:"app/form/templates/form.html",controller:["$scope","$injector",function(e,n){var t=n.get("translationStringService");e.forms=[],e.values={},e.getSectionHeader=function(n){return n&&n.name?t.canonicalize(e.namespace||"MISSING_NAMESPACE")+".SECTION_HEADER_"+t.canonicalize(n.name):""};var a=function(e){return!!("name"in e&&"fields"in e)};e.$watch("content",function(n){n?(angular.isArray(n)||(n=[n]),n.length&&!a(n[0])&&(n=[{fields:n}]),e.forms=n):e.forms=[]}),e.$watch("model",function(n){e.values=n||{}}),e.isVisible=function(n){return!e.modelOnly||n&&n.name in e.values},e.containsVisible=function(n){if(n)for(var t=0;t<n.length;t++)if(e.isVisible(n[t]))return!0;return!1}}]}}]),angular.module("rest").factory("Form",[function(){return function(e){e=e||{},this.name=e.name,this.fields=e.fields||[]}}]),angular.module("form").directive("guacFormField",[function(){return{restrict:"E",replace:!0,scope:{namespace:"=",field:"=",model:"="},templateUrl:"app/form/templates/formField.html",controller:["$scope","$injector","$element",function(e,n,t){var a=n.get("$log"),r=n.get("formService"),o=n.get("translationStringService"),i=t.find(".form-field");e.fieldId="guac-field-XXXXXXXXXXXXXXXX".replace(/X/g,function(){return Math.floor(36*Math.random()).toString(36)})+"-"+(new Date).getTime().toString(36),e.getFieldHeader=function(){return e.field&&e.field.name?o.canonicalize(e.namespace||"MISSING_NAMESPACE")+".FIELD_HEADER_"+o.canonicalize(e.field.name):""},e.getFieldOption=function(n){return e.field&&e.field.name?o.canonicalize(e.namespace||"MISSING_NAMESPACE")+".FIELD_OPTION_"+o.canonicalize(e.field.name)+"_"+o.canonicalize(n||"EMPTY"):""},e.isFieldVisible=function(){return i[0].hasChildNodes()},e.$watch("field",function(n){i.innerHTML="",n&&r.insertFieldElement(i[0],n.type,e).catch(function(){a.warn('Failed to retrieve field with type "'+n.type+'"')})})}]}}]),angular.module("form",["locale","rest"]),angular.module("form").provider("formService",function(){var e=this;this.fieldTypes={TEXT:{module:"form",controller:"textFieldController",templateUrl:"app/form/templates/textField.html"},EMAIL:{templateUrl:"app/form/templates/emailField.html"},NUMERIC:{module:"form",controller:"numberFieldController",templateUrl:"app/form/templates/numberField.html"},BOOLEAN:{module:"form",controller:"checkboxFieldController",templateUrl:"app/form/templates/checkboxField.html"},USERNAME:{templateUrl:"app/form/templates/textField.html"},PASSWORD:{module:"form",controller:"passwordFieldController",templateUrl:"app/form/templates/passwordField.html"},ENUM:{module:"form",controller:"selectFieldController",templateUrl:"app/form/templates/selectField.html"},MULTILINE:{templateUrl:"app/form/templates/textAreaField.html"},LANGUAGE:{module:"form",controller:"languageFieldController",templateUrl:"app/form/templates/languageField.html"},TIMEZONE:{module:"form",controller:"timeZoneFieldController",templateUrl:"app/form/templates/timeZoneField.html"},DATE:{module:"form",controller:"dateFieldController",templateUrl:"app/form/templates/dateField.html"},TIME:{module:"form",controller:"timeFieldController",templateUrl:"app/form/templates/timeField.html"},TERMINAL_COLOR_SCHEME:{module:"form",controller:"terminalColorSchemeFieldController",templateUrl:"app/form/templates/terminalColorSchemeField.html"}},this.registerFieldType=function(n,t){e.fieldTypes[n]=t},this.$get=["$injector",function(n){var t=n.get("$compile"),a=n.get("$q"),r=n.get("$templateRequest"),o={},i={};i.fieldTypes=e.fieldTypes;var s=function(e){return n.modules[e]?n:(o[e]=o[e]||angular.injector(["ng",e]),o[e])};return i.insertFieldElement=function(n,o,i){var c=e.fieldTypes[o];if(!c)return a.reject();var l;if(c.template){var u=a.defer();u.resolve(c.template),l=u.promise}else if(c.templateUrl)l=r(c.templateUrl);else{var m=a.defer();m.resolve(""),l=m.promise}var p=a.defer();return l.then(function(e){n.innerHTML=e,c.module&&c.controller&&s(c.module).get("$controller")(c.controller,{$scope:i,$element:angular.element(n.childNodes)}),p.resolve(t(n.childNodes)(i))}).catch(function(){p.reject()}),p.promise},i}]}),angular.module("groupList").factory("GroupListItem",["ConnectionGroup",function(e){var n=function(e){e=e||{},this.dataSource=e.dataSource,this.identifier=e.identifier,this.name=e.name,this.protocol=e.protocol,this.children=e.children||[],this.type=e.type,this.expandable=e.expandable,this.balancing=e.balancing,this.expanded=e.expanded,this.getActiveConnections=e.getActiveConnections||function(){return null},this.wrappedItem=e.wrappedItem,this.weight=e.weight||0};return n.fromConnection=function(e,t,a,r){var o=[];return t.sharingProfiles&&!1!==a&&t.sharingProfiles.forEach(function(t){o.push(n.fromSharingProfile(e,t,r))}),new n({name:t.name,identifier:t.identifier,protocol:t.protocol,dataSource:e,expandable:!1!==a,type:n.Type.CONNECTION,children:o,getActiveConnections:function(){return r?r(e,t):t.activeConnections},wrappedItem:t})},n.fromConnectionGroup=function(t,a,r,o,i,s){var c=[];return a.childConnections&&!1!==r&&a.childConnections.forEach(function(e){c.push(n.fromConnection(t,e,o,i))}),a.childConnectionGroups&&a.childConnectionGroups.forEach(function(e){c.push(n.fromConnectionGroup(t,e,r,o,i,s))}),new n({name:a.name,identifier:a.identifier,dataSource:t,type:n.Type.CONNECTION_GROUP,balancing:a.type===e.Type.BALANCING,expandable:!0,children:c,getActiveConnections:function(){return s?s(t,a):a.activeConnections},wrappedItem:a})},n.fromSharingProfile=function(e,t){return new n({name:t.name,identifier:t.identifier,dataSource:e,type:n.Type.SHARING_PROFILE,wrappedItem:t})},n.Type={CONNECTION:"connection",CONNECTION_GROUP:"connection-group",SHARING_PROFILE:"sharing-profile"},n}]),angular.module("groupList",["list","rest"]),angular.module("client").factory("guacAudio",[function(){return new function(){this.supported=Guacamole.AudioPlayer.getSupportedTypes()}}]),angular.module("client").directive("guacClient",[function(){return{restrict:"E",replace:!0,scope:{client:"="},templateUrl:"app/client/templates/guacClient.html",controller:["$scope","$injector","$element",function(e,n,t){function a(e){e.preventDefault(),e.stopPropagation()}var r=n.get("ManagedClient"),o=n.get("$window"),i=!1,s=null,c=null,l=null,u=t.find(".display")[0],m=t[0],p=(t.find(".resize-sensor")[0],new Guacamole.Mouse(u)),d=new Guacamole.Mouse.Touchscreen(u),g=new Guacamole.Mouse.Touchpad(u),f=function(){c&&(e.client.clientProperties.minScale=Math.min(m.offsetWidth/Math.max(c.getWidth(),1),m.offsetHeight/Math.max(c.getHeight(),1)),e.client.clientProperties.maxScale=Math.max(e.client.clientProperties.minScale,3),c.getScale()<e.client.clientProperties.minScale||e.client.clientProperties.autoFit?e.client.clientProperties.scale=e.client.clientProperties.minScale:c.getScale()>e.client.clientProperties.maxScale&&(e.client.clientProperties.scale=e.client.clientProperties.maxScale))},h=function(e){var n,t=e.x+u.offsetLeft-m.scrollLeft,a=e.y+u.offsetTop-m.scrollTop,r=m.offsetWidth,o=m.offsetHeight;n=t>r?t-r:t<0?t:0;var i;i=a>o?a-o:a<0?a:0,m.scrollLeft+=n,m.scrollTop+=i},E=function(e){var n=new Guacamole.Mouse.State(e.x/c.getScale(),e.y/c.getScale(),e.left,e.middle,e.right,e.up,e.down);s.sendMouseState(n)},v=function(e){s&&c&&(c.showCursor(!i),E(e))},C=function(e){s&&c&&(c.showCursor(!0),h(e),E(e))};e.$watch("client",function(n){u.innerHTML="",n&&(s=n.client,(c=s.getDisplay()).scale(e.client.clientProperties.scale),l=c.getElement(),u.appendChild(l),c.getElement().onclick=function(e){return e.preventDefault(),!1})}),e.$watch("client.clientProperties.scrollLeft",function(n){m.scrollLeft=n,e.client.clientProperties.scrollLeft=m.scrollLeft}),e.$watch("client.clientProperties.scrollTop",function(n){m.scrollTop=n,e.client.clientProperties.scrollTop=m.scrollTop}),e.$watch("client.managedDisplay.size",function(){e.$evalAsync(f)}),e.$watch("client.managedDisplay.cursor",function(e){e&&(i=p.setCursor(e.canvas,e.x,e.y))}),e.$watch("client.clientProperties.emulateAbsoluteMouse",function(e){var n,t;e?(n=d,t=g):(n=g,t=d),n&&(t&&(t.onmousedown=t.onmouseup=t.onmousemove=null,n.currentState.x=t.currentState.x,n.currentState.y=t.currentState.y),n.onmousedown=n.onmouseup=n.onmousemove=C)}),e.$watch("client.clientProperties.scale",function(n){n=Math.max(n,e.client.clientProperties.minScale),(n=Math.min(n,e.client.clientProperties.maxScale))===e.client.clientProperties.minScale?m.style.overflow="hidden":m.style.overflow="auto",c&&c.scale(n),n!==e.client.clientProperties.scale&&(e.client.clientProperties.scale=n)}),e.$watch("client.clientProperties.autoFit",function(n){n&&(e.client.clientProperties.scale=e.client.clientProperties.minScale)}),e.mainElementResized=function(){if(s&&c){var n=o.devicePixelRatio||1,t=m.offsetWidth*n,a=m.offsetHeight*n;c.getWidth()===t&&c.getHeight()===a||s.sendSize(t,a)}e.$evalAsync(f)},p.onmousedown=function(e){document.body.focus(),v(e)},p.onmouseup=p.onmousemove=v,p.onmouseout=function(){c&&c.showCursor(!1)},e.$on("guacClipboard",function(n,t){s&&(r.setClipboard(e.client,t),e.client.clipboardData=t)}),e.$on("guacKeydown",function(n,t,a){e.client.clientProperties.keyboardEnabled&&!n.defaultPrevented&&(s.sendKeyEvent(1,t),n.preventDefault())}),e.$on("guacKeyup",function(n,t,a){e.client.clientProperties.keyboardEnabled&&!n.defaultPrevented&&(s.sendKeyEvent(0,t),n.preventDefault())}),e.$on("guacSyntheticKeydown",function(e,n){s.sendKeyEvent(1,n)}),e.$on("guacSyntheticKeyup",function(e,n){s.sendKeyEvent(0,n)}),u.addEventListener("dragenter",a,!1),u.addEventListener("dragover",a,!1),u.addEventListener("drop",function(n){if(n.preventDefault(),n.stopPropagation(),e.client)for(var t=n.dataTransfer.files,a=0;a<t.length;a++)r.uploadFile(e.client,t[a])},!1)}]}}]),angular.module("client").factory("guacClientManager",["$injector",function(e){var n=e.get("ManagedClient"),t=e.get("$window"),a={},r=e.get("sessionStorageFactory").create({},function(){a.clear()});return a.getManagedClients=function(){return r()},a.removeManagedClient=function(e){var n=r();return e in n&&(n[e].client.disconnect(),delete n[e],!0)},a.replaceManagedClient=function(e,t){return a.removeManagedClient(e),r()[e]=n.getInstance(e,t)},a.getManagedClient=function(e,t){var a=r();return e in a||(a[e]=n.getInstance(e,t)),a[e]},a.clear=function(){var e=r();for(var n in e)e[n].client.disconnect();r({})},t.addEventListener("unload",a.clear),a}]),angular.module("clipboard").directive("guacClipboard",["$injector",function(e){var n=e.get("ClipboardData"),t={restrict:"E",replace:!0,templateUrl:"app/clipboard/templates/guacClipboard.html"};return t.scope={data:"="},t.controller=["$scope","$injector","$element",function(e,t,a){var r=a[0],o=function(){e.$evalAsync(function(){e.data=new n({type:"text/plain",data:r.value})})};r.addEventListener("input",o),r.addEventListener("change",o),e.$watch("data",function(e){"string"==typeof e.data&&(r.value=e.data)})}],t}]),angular.module("client").directive("guacFileBrowser",[function(){return{restrict:"E",replace:!0,scope:{client:"=",filesystem:"="},templateUrl:"app/client/templates/guacFileBrowser.html",controller:["$scope","$element","$injector",function(e,n,t){var a=t.get("ManagedFilesystem"),r=t.get("$interpolate"),o=t.get("$templateRequest"),i=n.find(".current-directory-contents"),s=null;e.isNormalFile=function(e){return e.type===a.File.Type.NORMAL},e.isDirectory=function(e){return e.type===a.File.Type.DIRECTORY},e.changeDirectory=function(n){a.changeDirectory(e.filesystem,n)},e.downloadFile=function(n){a.downloadFile(e.client,e.filesystem,n.streamName)};var c=function e(n,t){if(n.nodeType===Node.TEXT_NODE&&(n.nodeValue=r(n.nodeValue)(t)),n.hasChildNodes())for(var a=n.childNodes,o=0;o<a.length;o++)e(a[o],t)},l=function(n){var t=angular.element(s);c(t[0],n);var a=function(){};return e.isDirectory(n)?(t.addClass("directory"),a=function(){e.changeDirectory(n)}):e.isNormalFile(n)&&(t.addClass("normal-file"),a=function(){e.downloadFile(n)}),t.on("click",function(){t.hasClass("focused")?(a(),t.removeClass("focused")):(t.parent().children().removeClass("focused"),t.addClass("focused"))}),t.on("selectstart",function(e){e.preventDefault(),e.stopPropagation()}),t},u=function(n){var t=[];for(var a in n)t.push(n[a]);return t.sort(function(n,t){return e.isDirectory(n)&&!e.isDirectory(t)?-1:!e.isDirectory(n)&&e.isDirectory(t)?1:n.name.localeCompare(t.name)})};o("app/client/templates/file.html").then(function(n){s=n,e.$watch("filesystem.currentDirectory.files",function(e){i.html(""),angular.forEach(u(e),function(e){i.append(l(e))})})},angular.noop),e.$on("guacUploadComplete",function(n,t){e.filesystem&&a.refresh(e.filesystem,e.filesystem.currentDirectory)})}]}}]),angular.module("client").directive("guacFileTransfer",[function(){return{restrict:"E",replace:!0,scope:{transfer:"="},templateUrl:"app/client/templates/guacFileTransfer.html",controller:["$scope","$injector",function(e,n){var t=n.get("ManagedFileTransferState"),a={256:!0,513:!0,514:!0,515:!0,516:!0,517:!0,769:!0,771:!0,776:!0,797:!0};e.getProgressUnit=function(){var n=e.transfer.progress;return n>1e9?"gb":n>1e6?"mb":n>1e3?"kb":"b"},e.getProgressValue=function(){var n=e.transfer.progress;if(!n)return n;switch(e.getProgressUnit()){case"gb":return(n/1e9).toFixed(1);case"mb":return(n/1e6).toFixed(1);case"kb":return(n/1e3).toFixed(1);case"b":default:return n}},e.getPercentDone=function(){return e.transfer.progress/e.transfer.length*100},e.isInProgress=function(){if(!e.transfer)return!1;switch(e.transfer.transferState.streamState){case t.StreamState.IDLE:case t.StreamState.OPEN:return!0;default:return!1}},e.isSavable=function(){return!!e.transfer.blob},e.save=function(){e.transfer.blob&&saveAs(e.transfer.blob,e.transfer.filename)},e.hasError=function(){return e.transfer.transferState.streamState===t.StreamState.ERROR},e.getErrorText=function(){var n=e.transfer.transferState.statusCode;return"CLIENT.ERROR_UPLOAD_"+(n in a?n.toString(16).toUpperCase():"DEFAULT")}}]}}]),angular.module("client").directive("guacFileTransferManager",[function(){return{restrict:"E",replace:!0,scope:{client:"="},templateUrl:"app/client/templates/guacFileTransferManager.html",controller:["$scope","$injector",function(e,n){var t=n.get("ManagedFileTransferState"),a=function(e){switch(e.streamState){case t.StreamState.IDLE:case t.StreamState.OPEN:return!0;default:return!1}};e.clearCompletedTransfers=function(){e.client&&(e.client.uploads=e.client.uploads.filter(function(e){return a(e.transferState)}))}}]}}]),angular.module("list").directive("guacFilter",[function(){return{restrict:"E",replace:!0,scope:{filteredItems:"=",placeholder:"&",items:"&",properties:"&"},templateUrl:"app/list/templates/guacFilter.html",controller:["$scope","$injector",function(e,n){var t=new(n.get("FilterPattern"))(e.properties());e.searchString=null;var a=function(){var n=e.items();e.filteredItems=n?n.filter(t.predicate):[]};e.$watch("searchString",function(e){t.compile(e),a()}),e.$watchCollection(e.items,function(){a()})}]}}]),angular.module("element").directive("guacFocus",["$parse",function(e){return{restrict:"A",link:function(n,t,a){var r=e(a.guacFocus),o=t[0];n.$watch(r,function(e){n.$evalAsync(function(){e?o.focus():o.blur()})}),o.addEventListener("focus",function(){n.$evalAsync(function(){r.assign(n,!0)})}),o.addEventListener("blur",function(){n.$evalAsync(function(){r.assign(n,!1)})})}}}]),angular.module("groupList").directive("guacGroupList",[function(){return{restrict:"E",replace:!0,scope:{connectionGroups:"=",context:"=",templates:"=",showRootGroup:"=",pageSize:"=",decorator:"="},templateUrl:"app/groupList/templates/guacGroupList.html",controller:["$scope","$injector",function(e,n){var t=n.get("activeConnectionService"),a=n.get("dataSourceService"),r=n.get("requestService"),o=n.get("GroupListItem"),i={};e.rootItems=[];var s=function(e,n){return i[e][n.identifier]};e.isVisible=function(n){return!!e.templates[n]},e.$watch("connectionGroups",function(n){var c=[];e.rootItems=[],i={},n&&(angular.forEach(n,function(n,t){var a;c.push(t),i[t]={},a=n instanceof o?n:o.fromConnectionGroup(t,n,e.isVisible(o.Type.CONNECTION),e.isVisible(o.Type.SHARING_PROFILE),s),e.showRootGroup?e.rootItems.push(a):angular.forEach(a.children,function(n){e.rootItems.push(n)})}),a.apply(t.getActiveConnections,c).then(function(e){angular.forEach(e,function(e,n){angular.forEach(e,function(e){var t=e.connectionIdentifier;i[n][t]?i[n][t]++:i[n][t]=1})})},r.DIE)),e.decorator&&e.decorator(e.rootItems)}),e.toggleExpanded=function(e){e.expanded=!e.expanded}}]}}]),angular.module("groupList").directive("guacGroupListFilter",[function(){return{restrict:"E",replace:!0,scope:{filteredConnectionGroups:"=",placeholder:"&",connectionGroups:"&",connectionProperties:"&",connectionGroupProperties:"&"},templateUrl:"app/groupList/templates/guacGroupListFilter.html",controller:["$scope","$injector",function(e,n){var t=n.get("ConnectionGroup"),a=n.get("FilterPattern"),r=n.get("GroupListItem"),o=new a(e.connectionProperties()),i=new a(e.connectionGroupProperties());e.searchString=null;var s=function e(n){return n=new t(n),n.childConnections=angular.copy(n.childConnections)||[],n.childConnectionGroups=angular.copy(n.childConnectionGroups)||[],angular.forEach(n.childConnectionGroups,function(t){var a=e(t);Array.prototype.push.apply(n.childConnections,a.childConnections),Array.prototype.push.apply(n.childConnectionGroups,a.childConnectionGroups)}),n},c=function(e){return e=new r(e),e.children=angular.copy(e.children)||[],angular.forEach(e.children,function(n){if(n.type===r.Type.CONNECTION_GROUP){var t=s(n);Array.prototype.push.apply(e.children,t.children)}}),e},l=function(e){e.children=e.children.filter(function(e){switch(e.type){case r.Type.CONNECTION:return o.predicate(e.wrappedItem);case r.Type.CONNECTION_GROUP:return i.predicate(e.wrappedItem)}return!0})},u=function(e){e.childConnections=e.childConnections.filter(o.predicate),e.childConnectionGroups=e.childConnectionGroups.filter(i.predicate)},m=function(){if(e.searchString){e.filteredConnectionGroups={};var n=e.connectionGroups();n&&angular.forEach(n,function(n,t){var a;n instanceof r?(a=c(n),l(a)):(a=s(n),u(a)),e.filteredConnectionGroups[t]=a})}else e.filteredConnectionGroups=e.connectionGroups()||{}};e.$watch("searchString",function(e){o.compile(e),i.compile(e),m()}),e.$watchCollection(e.connectionGroups,function(){m()})}]}}]),angular.module("history").factory("guacHistory",["$injector",function(e){var n=e.get("HistoryEntry"),t=e.get("localStorageService"),a={};a.recentConnections=[],a.updateThumbnail=function(e,r){var o;for(o=0;o<a.recentConnections.length;o++)if(a.recentConnections[o].id===e){a.recentConnections.splice(o,1);break}a.recentConnections.unshift(new n(e,r,(new Date).getTime())),a.recentConnections.length>6&&(a.recentConnections.length=6),t.setItem("GUAC_HISTORY",a.recentConnections)};var r=t.getItem("GUAC_HISTORY")||[];return r instanceof Array&&(a.recentConnections=r),a}]),angular.module("client").factory("guacImage",["$injector",function(e){var n=e.get("$q"),t={},a={"image/jpeg":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCAABAAEDAREAAhEBAxEB/8QAFAABAAAAAAAAAAAAAAAAAAAACf/EABQQAQAAAAAAAAAAAAAAAAAAAAD/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AVMH/2Q==","image/png":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX///+nxBvIAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==","image/webp":"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA=="},r=n.defer(),o=[],i=[];return t.getSupportedMimetypes=function(){return r.promise},angular.forEach(a,function(e,t){var a=n.defer();o.push(a.promise);var r=new Image;r.src="data:"+t+";base64,"+e,r.onload=r.onerror=function(){1===r.width&&1===r.height&&i.push(t),a.resolve()}}),n.all(o).then(function(){r.resolve(i)}),t}]),angular.module("form").directive("guacInputColor",[function(){var e={restrict:"E",replace:!0,templateUrl:"app/form/templates/guacInputColor.html",transclude:!0};return e.scope={model:"=",palette:"="},e.controller=["$scope","$element","$injector",function(e,n,t){var a=t.get("colorPickerService");e.isColorPickerAvailable=a.isAvailable,e.isDark=function(){var n=e.model&&/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(e.model);return!!n&&.2126*parseInt(n[1],16)+.7152*parseInt(n[2],16)+.0722*parseInt(n[3],16)<=153},e.selectColor=function(){a.selectColor(n[0],e.model,e.palette).then(function(n){e.model=n},angular.noop)}}],e}]),angular.module("textInput").directive("guacKey",[function(){return{restrict:"E",replace:!0,scope:{text:"=",keysym:"=",sticky:"=?",pressed:"=?"},templateUrl:"app/textInput/templates/guacKey.html",controller:["$scope","$rootScope",function(e,n){e.sticky=e.sticky||!1,e.pressed=e.pressed||!1,e.updateKey=function(){e.sticky?e.pressed=!e.pressed:(n.$broadcast("guacSyntheticKeydown",e.keysym),n.$broadcast("guacSyntheticKeyup",e.keysym))},e.$watch("pressed",function(t,a){t?n.$broadcast("guacSyntheticKeydown",e.keysym):a&&n.$broadcast("guacSyntheticKeyup",e.keysym)})}]}}]),angular.module("form").directive("guacLenientDate",["$injector",function(e){var n=e.get("$filter"),t={restrict:"A",require:"ngModel"};return t.link=function(e,t,a,r){r.$parsers=[function(e){if(!e)return null;var n=/([0-9]*)(?:-([0-9]*)(?:-([0-9]*))?)?/.exec(e);if(!n)return null;var t=parseInt(n[1]||"0")||(new Date).getFullYear(),a=parseInt(n[2]||"0")||1,r=parseInt(n[3]||"0")||1,o=new Date(Date.UTC(t,a-1,r));return isNaN(o.getTime())?null:o}],r.$formatters=[function(e){return e?n("date")(e,"yyyy-MM-dd","UTC"):""}]},t}]),angular.module("form").directive("guacLenientTime",["$injector",function(e){var n=e.get("$filter"),t={restrict:"A",require:"ngModel"};return t.link=function(e,t,a,r){r.$parsers=[function(e){if(!e)return null;var n=/([0-9]*)(?::([0-9]*)(?::([0-9]*))?)?(?:\s*(a|p))?/.exec(e.toLowerCase());if(!n)return null;var t=parseInt(n[1]||"0"),a=parseInt(n[2]||"0"),r=parseInt(n[3]||"0");n[4]&&(12===t&&(t=0),"p"===n[4]&&(t+=12)),a+=r/60,r%=60,t+=a/60,a%=60,t%=24;var o=new Date(Date.UTC(1970,0,1,t,a,r));return isNaN(o.getTime())?null:o}],r.$formatters=[function(e){return e?n("date")(e,"HH:mm:ss","UTC"):""}]},t}]),angular.module("element").directive("guacMarker",["$injector",function(e){var n=e.get("Marker"),t=e.get("$parse");return{restrict:"A",link:function(e,a,r){var o=t(r.guacMarker),i=a[0];o.assign(e,new n(i))}}}]),angular.module("navigation").directive("guacMenu",[function(){return{restrict:"E",transclude:!0,replace:!0,scope:{menuTitle:"="},templateUrl:"app/navigation/templates/guacMenu.html",controller:["$scope","$injector","$element",function(e,n,t){var a=n.get("$document"),r=t[0],o=a[0];e.menuShown=!1,e.toggleMenu=function(){e.menuShown=!e.menuShown},o.body.addEventListener("click",function(){e.$apply(function(){e.menuShown=!1})},!1),r.addEventListener("click",function(e){e.stopPropagation()},!1)}]}}]),angular.module("notification").factory("guacNotification",["$injector",function(e){var n=e.get("$rootScope"),t=e.get("requestService"),a={},r=e.get("sessionStorageFactory").create(!1);return a.ACKNOWLEDGE_ACTION={name:"APP.ACTION_ACKNOWLEDGE",callback:function(){a.showStatus(!1)}},a.getStatus=function(){return r()},a.showStatus=function(e){r()&&e||r(e)},a.SHOW_REQUEST_ERROR=t.createErrorCallback(function(e){a.showStatus({className:"error",title:"APP.DIALOG_HEADER_ERROR",text:e.translatableMessage,actions:[a.ACKNOWLEDGE_ACTION]})}),n.$on("$routeChangeSuccess",function(){a.showStatus(!1)}),a}]),angular.module("notification").directive("guacNotification",[function(){return{restrict:"E",replace:!0,scope:{notification:"="},templateUrl:"app/notification/templates/guacNotification.html",controller:["$scope","$interval",function(e,n){e.$watch("notification.progress.ratio",function(n){e.progressPercent=100*n}),e.$watch("notification",function(t){var a=t.countdown;e.interval&&n.cancel(e.interval),a&&(e.timeRemaining=a.remaining,e.interval=n(function(){0===--e.timeRemaining&&a.callback&&a.callback()},1e3,e.timeRemaining))}),e.$on("$destroy",function(){e.interval&&n.cancel(e.interval)})}]}}]),angular.module("osk").directive("guacOsk",[function(){return{restrict:"E",replace:!0,scope:{layout:"="},templateUrl:"app/osk/templates/guacOsk.html",controller:["$scope","$injector","$element",function(e,n,t){var a=n.get("$http"),r=n.get("$rootScope"),o=n.get("cacheService"),i=null,s=t[0];e.keyboardResized=function(){i&&i.resize(s.offsetWidth)},e.$watch("layout",function(n){i&&(s.removeChild(i.getElement()),i=null),n&&a({cache:o.languages,method:"GET",url:n}).then(function(t){var a=t.data;e.layout===n&&(i=new Guacamole.OnScreenKeyboard(a),s.appendChild(i.getElement()),i.resize(s.offsetWidth),i.onkeydown=function(e){r.$broadcast("guacSyntheticKeydown",e)},i.onkeyup=function(e){r.$broadcast("guacSyntheticKeyup",e)})},angular.noop)})}]}}]),angular.module("navigation").directive("guacPageList",[function(){return{restrict:"E",replace:!0,scope:{pages:"="},templateUrl:"app/navigation/templates/guacPageList.html",controller:["$scope","$injector",function(e,n){var t=n.get("PageDefinition"),a=n.get("$location"),r=a.url(),o=[];e.levels=[];var i=function(e){return angular.isArray(e.name)?e.name:[e.name]},s=function(n,a){for(var s=i(n),c=0;c<s.length;c++){var l=e.levels[c];l||(l=e.levels[c]={});var u=s[c],m=o[c]===u;if(l[u]||(l[u]=new t({name:u,url:m?r:n.url,className:n.className,weight:n.weight||a+c})),o[c]!==u)break}};e.navigateToPage=function(e){a.path(e.url)},e.isCurrentPage=function(e){return r===e.url},e.getPages=function(e){var n=[];return angular.forEach(e,function(e){n.push(e)}),n.sort(function(e,n){return e.weight-n.weight}),n},e.$watch("pages",function(n){o=[],angular.forEach(n,function(n){e.isCurrentPage(n)&&(o=i(n))}),e.levels=[],angular.forEach(n,s),e.levels=e.levels.filter(function(e){var n=0;for(var t in e)if(2==++n)return!0;return!1})})}]}}]),angular.module("list").directive("guacPager",[function(){return{restrict:"E",replace:!0,scope:{page:"=",pageSize:"&",pageCount:"&",items:"&"},templateUrl:"app/list/templates/guacPager.html",controller:["$scope",function(e){var n=[];e.firstPage=1,e.previousPage=1,e.currentPage=1,e.nextPage=1,e.lastPage=1,e.pageNumbers=[];var t=function(){var n=e.pageCount()||11,t=e.currentPage-(n-1)/2,a=t+n-1;t<e.firstPage?(a=Math.min(e.lastPage,a-t+e.firstPage),t=e.firstPage):a>e.lastPage&&(t=Math.max(1,t-a+e.lastPage),a=e.lastPage),e.pageNumbers=[];for(var r=t;r<=a;r++)e.pageNumbers.push(r)},a=function(){var t=e.items(),a=e.pageSize()||10;if(n=[],t)for(var r=0;r<t.length;r+=a)n.push(t.slice(r,r+a));e.firstPage=1,e.lastPage=n.length;var o=Math.min(e.lastPage,Math.max(e.firstPage,e.currentPage));e.selectPage(o)};e.selectPage=function(a){e.currentPage=a,e.page=n[a-1],e.nextPage=Math.min(e.lastPage,e.currentPage+1),e.previousPage=Math.max(e.firstPage,e.currentPage-1),t()},e.canSelectPage=function(n){return n!==e.currentPage&&n>=e.firstPage&&n<=e.lastPage},e.isSelected=function(n){return n===e.currentPage},e.hasMorePagesBefore=function(){return e.pageNumbers[0]!==e.firstPage},e.hasMorePagesAfter=function(){return e.pageNumbers[e.pageNumbers.length-1]!==e.lastPage},e.$watchCollection(e.items,function(){a()}),e.$watch(e.pageSize,function(){a()}),e.$watch(e.pageCount,function(){t()})}]}}]),angular.module("home").directive("guacRecentConnections",[function(){return{restrict:"E",replace:!0,scope:{rootGroups:"="},templateUrl:"app/home/templates/guacRecentConnections.html",controller:["$scope","$injector",function(e,n){var t=n.get("ActiveConnection"),a=n.get("ClientIdentifier"),r=n.get("RecentConnection"),o=n.get("guacClientManager"),i=n.get("guacHistory");e.activeConnections=[],e.recentConnections=[],e.hasRecentConnections=function(){return!(!e.activeConnections.length&&!e.recentConnections.length)};var s={},c=function(e,n){s[a.toString({dataSource:e,type:a.Types.CONNECTION,id:n.identifier})]=n},l=function e(n,t){s[a.toString({dataSource:n,type:a.Types.CONNECTION_GROUP,id:t.identifier})]=t,t.childConnections&&t.childConnections.forEach(function(e){c(n,e)}),t.childConnectionGroups&&t.childConnectionGroups.forEach(function(t){e(n,t)})};e.$watch("rootGroups",function(n){e.activeConnections=[],e.recentConnections=[],s={},n&&angular.forEach(n,function(e,n){l(n,e)});var a=o.getManagedClients();for(var c in a){var u=a[c];if(c in s){var m=s[c];e.activeConnections.push(new t(m.name,u))}}i.recentConnections.forEach(function(n){if(n.id in s&&!(n.id in a)){var t=s[n.id];e.recentConnections.push(new r(t.name,n))}})})}]}}]),angular.module("element").directive("guacResize",["$document",function(e){return{restrict:"A",link:function(n,t,a){var r=n.$eval(a.guacResize),o=t[0],i=e[0].createElement("object"),s=o.offsetWidth,c=o.offsetHeight,l=function(){o.offsetWidth===s&&o.offsetHeight===c||(r&&n.$evalAsync(function(){r(o.offsetWidth,o.offsetHeight)}),s=o.offsetWidth,c=o.offsetHeight)};i.onload=function(){i.contentDocument.defaultView.addEventListener("resize",l),l()},i.className="resize-sensor",i.type="text/html",i.data="app/element/templates/blank.html",o.insertBefore(i,o.firstChild)}}}]),angular.module("element").directive("guacScroll",[function(){return{restrict:"A",link:function(e,n,t){var a=e.$eval(t.guacScroll),r=n[0],o=function(){return a.left},i=function(){return a.top};e.$watch(o,function(e){r.scrollLeft=e,a.left=r.scrollLeft}),e.$watch(i,function(e){r.scrollTop=e,a.top=r.scrollTop})}}}]),angular.module("navigation").directive("guacSectionTabs",["$injector",function(e){var n=e.get("translationStringService"),t={restrict:"E",replace:!0,templateUrl:"app/navigation/templates/guacSectionTabs.html",scope:{namespace:"@",current:"=",tabs:"="}};return t.controller=["$scope",function(e){e.getSectionHeader=function(t){return t?n.canonicalize(e.namespace||"MISSING_NAMESPACE")+".SECTION_HEADER_"+n.canonicalize(t):""},e.selectTab=function(n){e.current=n},e.isSelected=function(n){return e.current===n}}],t}]),angular.module("settings").directive("guacSettingsConnectionHistory",[function(){return{restrict:"E",replace:!0,scope:{},templateUrl:"app/settings/templates/settingsConnectionHistory.html",controller:["$scope","$injector",function(e,n){var t=n.get("ConnectionHistoryEntryWrapper"),a=n.get("FilterToken"),r=n.get("SortOrder"),o=n.get("$filter"),i=n.get("$routeParams"),s=n.get("$translate"),c=n.get("csvService"),l=n.get("historyService"),u=n.get("requestService");e.dataSource=i.dataSource,e.historyEntryWrappers=null,e.searchString="",e.dateFormat=null,e.order=new r(["-startDate","-duration","username","connectionName","remoteHost"]),s("SETTINGS_CONNECTION_HISTORY.FORMAT_DATE").then(function(n){e.dateFormat=n},angular.noop),e.isLoaded=function(){return null!==e.historyEntryWrappers&&null!==e.dateFormat},e.isHistoryEmpty=function(){return e.isLoaded()&&0===e.historyEntryWrappers.length},e.search=function(){e.historyEntryWrappers=null;var n=a.tokenize(e.searchString),r=[];angular.forEach(n,function(e){switch(e.type){case"LITERAL":r.push(e.value);case"WHITESPACE":break;default:r.push(e.consumed)}}),l.getConnectionHistory(e.dataSource,r,e.order.predicate.filter(function(e){return"startDate"===e||"-startDate"===e})).then(function(n){e.historyEntryWrappers=[],angular.forEach(n,function(n){e.historyEntryWrappers.push(new t(n))})},u.DIE)},e.downloadCSV=function(){s(["SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_USERNAME","SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_STARTDATE","SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_DURATION","SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_CONNECTION_NAME","SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_REMOTEHOST","SETTINGS_CONNECTION_HISTORY.FILENAME_HISTORY_CSV"]).then(function(n){var t=[[n["SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_USERNAME"],n["SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_STARTDATE"],n["SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_DURATION"],n["SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_CONNECTION_NAME"],n["SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_REMOTEHOST"]]];angular.forEach(o("orderBy")(e.historyEntryWrappers,e.order.predicate),function(n){t.push([n.username,o("date")(n.startDate,e.dateFormat),n.duration/1e3,n.connectionName,n.remoteHost])}),saveAs(c.toBlob(t),n["SETTINGS_CONNECTION_HISTORY.FILENAME_HISTORY_CSV"])},angular.noop)},e.search()}]}}]),angular.module("settings").directive("guacSettingsConnections",[function(){return{restrict:"E",replace:!0,scope:{},templateUrl:"app/settings/templates/settingsConnections.html",controller:["$scope","$injector",function(e,n){var t=n.get("ConnectionGroup"),a=n.get("GroupListItem"),r=n.get("PermissionSet"),o=n.get("$location"),i=n.get("$routeParams"),s=n.get("authenticationService"),c=n.get("connectionGroupService"),l=n.get("dataSourceService"),u=(n.get("guacNotification"),n.get("permissionService")),m=n.get("requestService"),p=s.getCurrentUsername();e.dataSource=i.dataSource,e.rootGroups=null,e.permissions=null,e.filteredConnectionProperties=["name","protocol"],e.filteredConnectionGroupProperties=["name"],e.isLoaded=function(){return null!==e.rootGroup&&null!==e.permissions},e.canCreateConnections=function(){return!!e.permissions&&!(!r.hasSystemPermission(e.permissions,r.SystemPermissionType.ADMINISTER)&&!r.hasSystemPermission(e.permissions,r.SystemPermissionType.CREATE_CONNECTION))},e.canCreateConnectionGroups=function(){return!!e.permissions&&!(!r.hasSystemPermission(e.permissions,r.SystemPermissionType.ADMINISTER)&&!r.hasSystemPermission(e.permissions,r.SystemPermissionType.CREATE_CONNECTION_GROUP))},e.canCreateSharingProfiles=function(){return!!e.permissions&&!(!r.hasSystemPermission(e.permissions,r.SystemPermissionType.ADMINISTER)&&!r.hasSystemPermission(e.permissions,r.SystemPermissionType.CREATE_SHARING_PROFILE))},e.canManageConnections=function(){return!!e.permissions&&(!!(e.canCreateConnections()||e.canCreateConnectionGroups()||e.canCreateSharingProfiles())||(!(!r.hasConnectionPermission(e.permissions,r.ObjectPermissionType.UPDATE)&&!r.hasConnectionPermission(e.permissions,r.ObjectPermissionType.DELETE))||!(!r.hasConnectionGroupPermission(e.permissions,r.ObjectPermissionType.UPDATE)&&!r.hasConnectionGroupPermission(e.permissions,r.ObjectPermissionType.DELETE))))},e.canUpdateConnection=function(n){return!!e.permissions&&!(!r.hasSystemPermission(e.permissions,r.SystemPermissionType.ADMINISTER)&&!r.hasConnectionPermission(e.permissions,r.ObjectPermissionType.UPDATE,n))},e.canUpdateConnectionGroup=function(n){return!!e.permissions&&!(!r.hasSystemPermission(e.permissions,r.SystemPermissionType.ADMINISTER)&&!r.hasConnectionGroupPermission(e.permissions,r.ObjectPermissionType.UPDATE,n))};var d=function(n,t){t&&!e.canUpdateConnectionGroup(t.identifier)||(e.canCreateConnections()&&n.push(new a({type:"new-connection",dataSource:e.dataSource,weight:1,wrappedItem:t})),e.canCreateConnectionGroups()&&n.push(new a({type:"new-connection-group",dataSource:e.dataSource,weight:1,wrappedItem:t})))},g=function(n,t){t&&!e.canUpdateConnection(t.identifier)||e.canCreateSharingProfiles()&&n.push(new a({type:"new-sharing-profile",dataSource:e.dataSource,weight:1,wrappedItem:t}))},f=function e(n){n.type===a.Type.CONNECTION_GROUP?d(n.children,n):n.type===a.Type.CONNECTION&&g(n.children,n),angular.forEach(n.children,e)};e.rootItemDecorator=function(e){angular.forEach(e,f)},u.getEffectivePermissions(e.dataSource,p).then(function(n){e.permissions=n,r.removeConnectionGroupPermission(e.permissions,r.ObjectPermissionType.UPDATE,t.ROOT_IDENTIFIER),e.canManageConnections()||o.path("/"),l.apply(c.getConnectionGroupTree,[e.dataSource],t.ROOT_IDENTIFIER,[r.ObjectPermissionType.UPDATE,r.ObjectPermissionType.DELETE]).then(function(n){e.rootGroups=n},m.DIE)},m.DIE)}]}}]),angular.module("settings").directive("guacSettingsPreferences",[function(){return{restrict:"E",replace:!0,scope:{},templateUrl:"app/settings/templates/settingsPreferences.html",controller:["$scope","$injector",function(e,n){var t=n.get("PermissionSet"),a=n.get("$translate"),r=n.get("authenticationService"),o=n.get("guacNotification"),i=n.get("permissionService"),s=n.get("preferenceService"),c=n.get("requestService"),l=n.get("userService"),u={name:"SETTINGS_PREFERENCES.ACTION_ACKNOWLEDGE",callback:function(){o.showStatus(!1)}},m=r.getCurrentUsername(),p=r.getDataSource();e.preferences=s.preferences,e.localeFields=[{type:"LANGUAGE",name:"language"},{type:"TIMEZONE",name:"timezone"}],e.$watch("preferences.language",function(e){a.use(e)}),e.newPassword=null,e.newPasswordMatch=null,e.canChangePassword=null,e.updatePassword=function(){e.newPasswordMatch===e.newPassword?e.newPassword?l.updateUserPassword(p,m,e.oldPassword,e.newPassword).then(function(){e.oldPassword=null,e.newPassword=null,e.newPasswordMatch=null,o.showStatus({text:{key:"SETTINGS_PREFERENCES.INFO_PASSWORD_CHANGED"},actions:[u]})},o.SHOW_REQUEST_ERROR):o.showStatus({className:"error",title:"SETTINGS_PREFERENCES.DIALOG_HEADER_ERROR",text:{key:"SETTINGS_PREFERENCES.ERROR_PASSWORD_BLANK"},actions:[u]}):o.showStatus({className:"error",title:"SETTINGS_PREFERENCES.DIALOG_HEADER_ERROR",text:{key:"SETTINGS_PREFERENCES.ERROR_PASSWORD_MISMATCH"},actions:[u]})},i.getEffectivePermissions(p,m).then(function(n){e.canChangePassword=t.hasUserPermission(n,t.ObjectPermissionType.UPDATE,m)}).catch(c.createErrorCallback(function(n){e.canChangePassword=!1})),e.isLoaded=function(){return null!==e.canChangePassword&&null!==e.languages}}]}}]),angular.module("settings").directive("guacSettingsSessions",[function(){return{restrict:"E",replace:!0,scope:{},templateUrl:"app/settings/templates/settingsSessions.html",controller:["$scope","$injector",function(e,n){var t=n.get("ActiveConnectionWrapper"),a=n.get("ClientIdentifier"),r=n.get("ConnectionGroup"),o=n.get("SortOrder"),i=n.get("$filter"),s=n.get("$translate"),c=n.get("$q"),l=n.get("activeConnectionService"),u=n.get("authenticationService"),m=n.get("connectionGroupService"),p=n.get("dataSourceService"),d=n.get("guacNotification"),g=n.get("requestService"),f=u.getAvailableDataSources();e.wrappers=null,e.wrapperOrder=new o(["activeConnection.username","startDate","activeConnection.remoteHost","name"]),e.filteredWrapperProperties=["activeConnection.username","startDate","activeConnection.remoteHost","name"];var h=null,E=null,v=null,C={},S=function(e,n){E[e][n.identifier]=n},A=function e(n,t){angular.forEach(t.childConnections,function(e){S(n,e)}),angular.forEach(t.childConnectionGroups,function(t){e(n,t)})},y=function(){h&&E&&v&&(e.wrappers=[],angular.forEach(h,function(n,a){angular.forEach(n,function(n,r){var o=E[a][n.connectionIdentifier];null!==n.username&&e.wrappers.push(new t({dataSource:a,name:o.name,startDate:i("date")(n.startDate,v),activeConnection:n}))})}))};p.apply(m.getConnectionGroupTree,f,r.ROOT_IDENTIFIER).then(function(e){E={},angular.forEach(e,function(e,n){E[n]={},A(n,e)}),y()},g.DIE),p.apply(l.getActiveConnections,f).then(function(e){h=e,y()},g.DIE),s("SETTINGS_SESSIONS.FORMAT_STARTDATE").then(function(e){v=e,y()},angular.noop),e.isLoaded=function(){return null!==e.wrappers};var T={name:"SETTINGS_SESSIONS.ACTION_CANCEL",callback:function(){d.showStatus(!1)}},I={name:"SETTINGS_SESSIONS.ACTION_DELETE",className:"danger",callback:function(){b(),d.showStatus(!1)}},b=function(){var n=[];angular.forEach(C,function(e,t){var a=Object.keys(e);a.length&&n.push(l.deleteActiveConnections(t,a))}),c.all(n).then(function(){e.wrappers=e.wrappers.filter(function(e){return!(e.activeConnection.identifier in(C[e.dataSource]||{}))}),C={}},d.SHOW_REQUEST_ERROR)};e.deleteSessions=function(){d.showStatus({title:"SETTINGS_SESSIONS.DIALOG_HEADER_CONFIRM_DELETE",text:{key:"SETTINGS_SESSIONS.TEXT_CONFIRM_DELETE"},actions:[I,T]})},e.getClientURL=function(e,n){return n.connectable?"#/client/"+encodeURIComponent(a.toString({dataSource:e,type:a.Types.ACTIVE_CONNECTION,id:n.identifier})):null},e.canDeleteSessions=function(){for(var e in C)for(var n in C[e])return!0;return!1},e.wrapperSelectionChange=function(e){var n=C[e.dataSource];n||(n=C[e.dataSource]={}),e.checked?n[e.activeConnection.identifier]=e:delete n[e.activeConnection.identifier]}}]}}]),angular.module("settings").directive("guacSettingsUserGroups",["$injector",function(e){var n=e.get("ManageableUserGroup"),t=e.get("PermissionSet"),a=e.get("SortOrder"),r=e.get("$location"),o=e.get("authenticationService"),i=e.get("dataSourceService"),s=e.get("permissionService"),c=e.get("requestService"),l=e.get("userGroupService"),u={restrict:"E",replace:!0,templateUrl:"app/settings/templates/settingsUserGroups.html",scope:{}};return u.controller=["$scope",function(e){var u=o.getCurrentUsername(),m=o.getAvailableDataSources(),p=null;e.manageableUserGroups=null,e.filteredUserGroupProperties=["userGroup.identifier"],e.order=new a(["userGroup.identifier"]),e.isLoaded=function(){return null!==e.manageableUserGroups},e.getDefaultDataSource=function(){if(!p)return null;for(var e=_.keys(p).sort(),n=0;n<e.length;n++){var a=e[n],r=p[a];if(t.hasSystemPermission(r,t.SystemPermissionType.ADMINISTER)||t.hasSystemPermission(r,t.SystemPermissionType.CREATE_USER_GROUP))return a}return null},e.canCreateUserGroups=function(){return null!==e.getDefaultDataSource()};var d=function(){if(!p)return!1;if(e.canCreateUserGroups())return!0;for(var n in p){var a=p[n];if(t.hasUserGroupPermission(a,t.ObjectPermissionType.UPDATE)||t.hasUserGroupPermission(a,t.ObjectPermissionType.DELETE))return!0}return!1},g=function(a,r){var o={};e.manageableUserGroups=[],angular.forEach(m,function(i){angular.forEach(r[i],function(r){o[r.identifier]||(t.hasSystemPermission(a[i],t.ObjectPermissionType.ADMINISTER)||t.hasUserGroupPermission(a[i],t.ObjectPermissionType.UPDATE,r.identifier)||t.hasUserGroupPermission(a[i],t.ObjectPermissionType.DELETE,r.identifier)||(i=e.getDefaultDataSource()),o[r.identifier]=r,e.manageableUserGroups.push(new n({dataSource:i,userGroup:r})))})})};i.apply(s.getEffectivePermissions,m,u).then(function(n){return p=n,d()||r.path("/"),e.canCreateUserGroups()?i.apply(l.getUserGroups,m):i.apply(l.getUserGroups,m,[t.ObjectPermissionType.UPDATE,t.ObjectPermissionType.DELETE])}).then(function(e){g(p,e)},c.WARN)}],u}]),angular.module("settings").directive("guacSettingsUsers",[function(){return{restrict:"E",replace:!0,scope:{},templateUrl:"app/settings/templates/settingsUsers.html",controller:["$scope","$injector",function(e,n){var t=n.get("ManageableUser"),a=n.get("PermissionSet"),r=n.get("SortOrder"),o=n.get("$location"),i=n.get("$translate"),s=n.get("authenticationService"),c=n.get("dataSourceService"),l=n.get("permissionService"),u=n.get("requestService"),m=n.get("userService"),p=s.getCurrentUsername(),d=s.getAvailableDataSources();e.manageableUsers=null,e.newUsername="",e.permissions=null,e.filteredUserProperties=['user.attributes["guac-full-name"]','user.attributes["guac-organization"]',"user.lastActive","user.username"],e.dateFormat=null,e.order=new r(["user.username","-user.lastActive",'user.attributes["guac-organization"]','user.attributes["guac-full-name"]']),i("SETTINGS_USERS.FORMAT_DATE").then(function(n){e.dateFormat=n},angular.noop),e.isLoaded=function(){return null!==e.dateFormat&&null!==e.manageableUsers&&null!==e.permissions},e.getDefaultDataSource=function(){if(!e.permissions)return null;for(var n=_.keys(e.permissions).sort(),t=0;t<n.length;t++){var r=n[t],o=e.permissions[r];if(a.hasSystemPermission(o,a.SystemPermissionType.ADMINISTER)||a.hasSystemPermission(o,a.SystemPermissionType.CREATE_USER))return r}return null},e.canCreateUsers=function(){return null!==e.getDefaultDataSource()};var g=function(){if(!e.permissions)return!1;if(e.canCreateUsers())return!0;for(var n in e.permissions){var t=e.permissions[n];if(a.hasUserPermission(t,a.ObjectPermissionType.UPDATE)||a.hasUserPermission(t,a.ObjectPermissionType.DELETE))return!0}return!1};c.apply(l.getEffectivePermissions,d,p).then(function(n){e.permissions=n,g()||o.path("/");(e.canCreateUsers()?c.apply(m.getUsers,d):c.apply(m.getUsers,d,[a.ObjectPermissionType.UPDATE,a.ObjectPermissionType.DELETE])).then(function(r){var o={};e.manageableUsers=[],angular.forEach(d,function(i){angular.forEach(r[i],function(r){o[r.username]||(a.hasSystemPermission(n[i],a.ObjectPermissionType.ADMINISTER)||a.hasUserPermission(n[i],a.ObjectPermissionType.UPDATE,r.username)||a.hasUserPermission(n[i],a.ObjectPermissionType.DELETE,r.username)||(i=e.getDefaultDataSource()),o[r.username]=r,e.manageableUsers.push(new t({dataSource:i,user:r})))})})},u.DIE)},u.DIE)}]}}]),angular.module("list").directive("guacSortOrder",[function(){return{restrict:"A",link:function(e,n,t){var a=e.$eval(t.guacSortOrder),r=e.$eval(t.guacSortProperty),o=function(){return a.primary===r},i=function(){return a.descending};n.addClass("sortable"),e.$watch(o,function(e){n.toggleClass("sort-primary",e)}),e.$watch(i,function(e){n.toggleClass("sort-descending",e)}),n[0].addEventListener("click",function(){e.$evalAsync(function(){a.togglePrimary(r)})})}}}]),angular.module("textInput").directive("guacTextInput",[function(){return{restrict:"E",replace:!0,scope:{needsFocus:"=?"},templateUrl:"app/textInput/templates/guacTextInput.html",controller:["$scope","$rootScope","$element","$timeout",function(e,n,t,a){var r={65027:!0,65288:!0,65289:!0,65293:!0,65307:!0,65360:!0,65361:!0,65362:!0,65363:!0,65364:!0,65367:!0,65380:!0,65470:!0,65471:!0,65472:!0,65473:!0,65474:!0,65475:!0,65476:!0,65477:!0,65478:!0,65479:!0,65480:!0,65481:!0,65505:!0,65506:!0,65507:!0,65508:!0,65513:!0,65514:!0,65535:!0};e.sentText=[],e.altPressed=!1,e.ctrlPressed=!1;var o=t.find(".target")[0],i=!1;o.onfocus=function(){i=!0,d(4)},o.onblur=function(){i=!1,o.focus()};var s=!1;o.addEventListener("compositionstart",function(e){s=!0},!1),o.addEventListener("compositionend",function(e){s=!1},!1);var c=function(e){return e<=31||e>=127&&e<=159?65280|e:e>=0&&e<=255?e:e>=256&&e<=1114111?16777216|e:null},l=function(e){n.$broadcast("guacSyntheticKeydown",e),n.$broadcast("guacSyntheticKeyup",e)},u=function(e){if(10===e)return l(65293),void p();var n=c(e);n&&(l(n),p())},m=function(n){for(var t="",r=0;r<n.length;r++){var o=n.charCodeAt(r);8203!==o&&(t+=String.fromCharCode(o),u(o))}e.$apply(function(){e.sentText.push(t)}),a(function(){e.sentText.shift()},1e3)},p=function(){e.$apply(function(){e.altPressed=!1,e.ctrlPressed=!1})},d=function(e){var n=String.fromCharCode(8203);o.value=new Array(2*e+1).join(n),o.setSelectionRange(e,e)};o.addEventListener("input",function(e){if(!s){var n,t=o.value;if(t.length<8){var a=4-o.selectionStart;for(n=0;n<a;n++)l(65288);var r=8-t.length-a;for(n=0;n<r;n++)l(65535)}else m(t);d(4),e.preventDefault()}},!1),o.addEventListener("selectstart",function(e){e.preventDefault()},!1),e.$watch("needsFocus",function(e){e?o.focus():o.blur()}),e.$on("guacBeforeKeydown",function(e,n){i&&!r[n]&&e.preventDefault()}),e.$on("guacBeforeKeyup",function(e,n){i&&!r[n]&&e.preventDefault()})}]}}]),angular.module("client").directive("guacThumbnail",[function(){return{restrict:"E",replace:!0,scope:{client:"="},templateUrl:"app/client/templates/guacThumbnail.html",controller:["$scope","$injector","$element",function(e,n,t){n.get("$window");var a=null,r=null,o=t.find(".display")[0],i=t[0];e.updateDisplayScale=function(){a&&a.scale(Math.min(i.offsetWidth/Math.max(a.getWidth(),1),i.offsetHeight/Math.max(a.getHeight(),1)))},e.$watch("client",function(e){if(o.innerHTML="",e){var n=e.client;a=n.getDisplay(),r=a.getElement(),o.appendChild(r)}}),e.$watch("client.managedDisplay.size",function(n){var t,a;if(n&&0!==n.width&&0!==n.height){var r=Math.min(320/n.width,240/n.height,1);t=n.width*r,a=n.height*r}else t=320,a=240;var o=document.createElement("canvas");o.width=t,o.height=a,e.thumbnail=o.toDataURL("image/png"),e.$evalAsync(e.updateDisplayScale)})}]}}]),angular.module("touch").directive("guacTouchDrag",[function(){return{restrict:"A",link:function(e,n,t){var a=e.$eval(t.guacTouchDrag),r=n[0],o=!1,i=null,s=null,c=null,l=null,u=0,m=0;r.addEventListener("touchmove",function(n){if(1===n.touches.length){n.stopPropagation();var t=n.touches[0].clientX,r=n.touches[0].clientY;i&&s?o&&(u=t-c,m=r-l,c=t,l=r):(i=c=t,s=l=r,u=0,m=0,o=!0),o&&a&&e.$apply(function(){!1===a(!0,i,s,c,l,u,m)&&n.preventDefault()})}},!1),r.addEventListener("touchend",function(n){i&&s&&0===n.touches.length&&(n.stopPropagation(),o&&a&&e.$apply(function(){!1===a(!0,i,s,c,l,u,m)&&n.preventDefault()}),i=c=null,s=l=null,u=0,m=0,o=!1)},!1)}}}]),angular.module("touch").directive("guacTouchPinch",[function(){return{restrict:"A",link:function(e,n,t){var a=e.$eval(t.guacTouchPinch),r=n[0],o=null,i=null,s=0,c=0,l=function(e){var n=e.touches[0],t=e.touches[1],a=n.clientX-t.clientX,r=n.clientY-t.clientY;return Math.sqrt(a*a+r*r)},u=function(e){var n=e.touches[0],t=e.touches[1];return(n.clientX+t.clientX)/2},m=function(e){var n=e.touches[0],t=e.touches[1];return(n.clientY+t.clientY)/2};r.addEventListener("touchmove",function(n){2===n.touches.length&&(n.stopPropagation(),i=l(n),s=u(n),c=m(n),o||(o=i),a&&e.$apply(function(){!1===a(!0,o,i,s,c)&&n.preventDefault()}))},!1),r.addEventListener("touchend",function(n){o&&n.touches.length<2&&(n.stopPropagation(),a&&e.$apply(function(){!1===a(!1,o,i,s,c)&&n.preventDefault()}),o=null)},!1)}}}]),angular.module("element").directive("guacUpload",["$document",function(e){return{restrict:"A",link:function(n,t,a){var r=n.$eval(a.guacUpload),o=t[0],i=e[0].createElement("form"),s=e[0].createElement("input");s.type="file",s.multiple=!0,i.appendChild(s),s.addEventListener("change",function(){n.$apply(function(){r&&s.files.length>0&&r(s.files),i.reset()})}),o.addEventListener("click",function(){s.click()})}}}]),angular.module("list").directive("guacUserItem",[function(){return{restrict:"E",replace:!0,scope:{username:"="},templateUrl:"app/list/templates/guacUserItem.html",controller:["$scope","$injector",function(e,n){var t=n.get("AuthenticationResult"),a=n.get("$translate");e.displayName=null,e.isAnonymous=function(){return e.username===t.ANONYMOUS_USERNAME},e.$watch("username",function(n){e.isAnonymous()?a("LIST.TEXT_ANONYMOUS_USER").then(function(n){e.displayName=n},angular.noop):e.displayName=n})}]}}]),angular.module("navigation").directive("guacUserMenu",[function(){return{restrict:"E",replace:!0,scope:{localActions:"="},templateUrl:"app/navigation/templates/guacUserMenu.html",controller:["$scope","$injector",function(e,n){var t=n.get("User"),a=n.get("$location"),r=n.get("$route"),o=n.get("authenticationService"),i=n.get("requestService"),s=n.get("userService"),c=n.get("userPageService");e.username=o.getCurrentUsername(),e.fullName=null,e.userURL=null,e.organization=null,e.role=null,s.getUser(o.getDataSource(),e.username).then(function(n){e.fullName=n.attributes[t.Attributes.FULL_NAME],e.organization=n.attributes[t.Attributes.ORGANIZATION],e.role=n.attributes[t.Attributes.ORGANIZATIONAL_ROLE];var a=n.attributes[t.Attributes.EMAIL_ADDRESS];e.userURL=a?"mailto:"+a:null},i.IGNORE),e.pages=null,c.getMainPages().then(function(n){e.pages=n}),e.isAnonymous=function(){return o.isAnonymous()},e.logout=function(){o.logout().catch(i.IGNORE).finally(function(){"/"!==a.path()?a.url("/"):r.reload()})};var l={name:"USER_MENU.ACTION_LOGOUT",className:"logout",callback:e.logout};e.actions=[l]}]}}]),angular.module("client").factory("guacVideo",[function(){return new function(){this.supported=Guacamole.VideoPlayer.getSupportedTypes()}}]),angular.module("client").directive("guacViewport",[function(){return{restrict:"E",scope:{},transclude:!0,templateUrl:"app/client/templates/guacViewport.html",controller:["$scope","$injector","$element",function(e,n,t){var a=n.get("$window"),r=n.get("$document"),o=t.find(".viewport")[0],i=r[0],s=null,c=function(){var e=i.body.scrollLeft,n=i.body.scrollTop,t=i.body.scrollWidth,r=i.body.scrollHeight,c=r-n;e!==t&&n!==r&&s!==c?(o.style.height=c+"px",s=c,a.scrollTo(t,r)):0===c&&a.scrollTo(t,r)};a.addEventListener("scroll",c);var l=a.setInterval(c,10);e.$on("$destroy",function(){a.removeEventListener("scroll",c),a.clearInterval(l)})}]}}]),angular.module("client").directive("guacZoomCtrl",function(){return{restrict:"A",require:"ngModel",priority:101,link:function(e,n,t,a){a.$viewChangeListeners.push(function(){e.$eval(t.ngChange)}),a.$formatters.push(function(e){return Math.round(100*e)}),a.$parsers.push(function(e){return Math.round(e)/100})}}}),angular.module("history").factory("HistoryEntry",[function(){return function(e,n){this.id=e,this.thumbnail=n}}]),angular.module("manage").factory("HistoryEntryWrapper",["$injector",function(e){var n=e.get("ConnectionHistoryEntry");return function(e){this.entry=e,this.duration=null,this.durationText="MANAGE_CONNECTION.TEXT_HISTORY_DURATION",e.active?this.durationText="MANAGE_CONNECTION.INFO_CONNECTION_ACTIVE_NOW":e.endDate||(this.durationText="MANAGE_CONNECTION.INFO_CONNECTION_DURATION_UNKNOWN"),e.endDate&&e.startDate&&(this.duration=new n.Duration(e.endDate-e.startDate))}}]),angular.module("history",["storage"]),angular.module("rest").factory("historyService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a={};return a.getConnectionHistory=function(e,a,r){var o={token:t.getCurrentToken()};return a&&(o.contains=a),r&&(o.order=r),n({method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/history/connections",params:o})},a}]),angular.module("home").controller("homeController",["$scope","$injector",function(e,n){var t=n.get("ConnectionGroup"),a=n.get("ClientIdentifier"),r=n.get("GroupListItem"),o=n.get("authenticationService"),i=n.get("connectionGroupService"),s=n.get("dataSourceService"),c=n.get("requestService");e.rootConnectionGroups=null,e.filteredConnectionProperties=["name"],e.filteredConnectionGroupProperties=["name"],e.isLoaded=function(){return null!==e.rootConnectionGroups},e.context={getClientIdentifier:function(e){return e.type===r.Type.CONNECTION?a.toString({dataSource:e.dataSource,type:a.Types.CONNECTION,id:e.identifier}):e.type===r.Type.CONNECTION_GROUP?a.toString({dataSource:e.dataSource,type:a.Types.CONNECTION_GROUP,id:e.identifier}):null}},s.apply(i.getConnectionGroupTree,o.getAvailableDataSources(),t.ROOT_IDENTIFIER).then(function(n){e.rootConnectionGroups=n},c.DIE)}]),angular.module("home",["client","groupList","history","navigation","rest"]),angular.module("index").factory("iconService",["$rootScope",function(e){var n={},t=$('link[rel=icon][href="images/logo-64.png"]'),a=$('link[rel=icon][href="images/logo-144.png"]'),r=function(e,n,t){var a=document.createElement("canvas");a.width=n,a.height=t;var r=Math.min(n/e.width,t/e.height),o=e.width*r,i=e.height*r,s=(n-o)/2,c=(t-i)/2;return a.getContext("2d").drawImage(e,s,c,o,i),a};return n.setIcons=function(e){if(e){var n=r(e,64,64);t.attr("href",n.toDataURL("image/png"));var o=r(e,144,144);a.attr("href",o.toDataURL("image/png"))}},n.setDefaultIcons=function(){t.attr("href","images/logo-64.png"),a.attr("href","images/logo-144.png")},e.$on("$routeChangeSuccess",function(){n.setDefaultIcons()}),n}]),angular.module("manage").directive("identifierSetEditor",["$injector",function(e){var n={restrict:"E",replace:!0,scope:{header:"@",emptyPlaceholder:"@",unavailablePlaceholder:"@",identifiersAvailable:"=",identifiers:"=",identifiersAdded:"=",identifiersRemoved:"="},templateUrl:"app/manage/templates/identifierSetEditor.html"};return n.controller=["$scope",function(e){e.expanded=!1,e.identifierFlags={},e.isEditable={};var n=function(e,n){var t=_.sortedIndex(e,n);e[t]!==n&&e.splice(t,0,n)},t=function(e,n){var t=_.sortedIndexOf(e,n);return-1!==t&&(e.splice(t,1),!0)};e.$watch("identifiers",function(n){n&&n.sort(),e.identifierFlags={},angular.forEach(n,function(n){e.identifierFlags[n]=!0})}),e.$watch("identifiersAvailable",function(n){e.isEditable={},angular.forEach(n,function(n){e.isEditable[n]=!0})}),e.identifierChanged=function(a){!!e.identifierFlags[a]?(n(e.identifiers,a),t(e.identifiersRemoved,a)||n(e.identifiersAdded,a)):(t(e.identifiers,a),t(e.identifiersAdded,a)||n(e.identifiersRemoved,a))},e.removeIdentifier=function(n){e.identifierFlags[n]=!1,e.identifierChanged(n)},e.expand=function(){e.expanded=!0},e.collapse=function(){e.expanded=!1},e.isEmpty=function(){return _.isEmpty(e.identifiers)&&_.isEmpty(e.identifiersAvailable)}}],n}]),angular.module("index").controller("indexController",["$scope","$injector",function(e,n){var t=n.get("$document"),a=n.get("$window"),r=n.get("clipboardService"),o=n.get("guacNotification");e.fatalError=null,e.guacNotification=o,e.loginHelpText=null,e.acceptedCredentials=null,e.expectedCredentials=null,e.page={title:"",bodyClassName:""};var i=new Guacamole.InputSink;t[0].body.appendChild(i.getElement());var s=new Guacamole.Keyboard(t[0]);s.listenTo(i.getElement()),s.onkeydown=function(n){return!!e.expectedCredentials||(!!e.$broadcast("guacBeforeKeydown",n,s).defaultPrevented||!e.$broadcast("guacKeydown",n,s).defaultPrevented)},s.onkeyup=function(n){e.expectedCredentials||e.$broadcast("guacBeforeKeyup",n,s).defaultPrevented||e.$broadcast("guacKeyup",n,s)},a.onblur=function(){s.reset()};var c=function(){r.getLocalClipboard().then(function(n){e.$broadcast("guacClipboard",n)},angular.noop)};a.addEventListener("load",c,!0),a.addEventListener("copy",c),a.addEventListener("cut",c),a.addEventListener("focus",function(e){e.target===a&&c()},!0),e.$on("guacInvalidCredentials",function(n,t,a){e.page.title="APP.NAME",e.page.bodyClassName="",e.loginHelpText=null,e.acceptedCredentials={},e.expectedCredentials=a.expected,e.fatalError=null}),e.$on("guacInsufficientCredentials",function(n,t,a){e.page.title="APP.NAME",e.page.bodyClassName="",e.loginHelpText=a.translatableMessage,e.acceptedCredentials=t,e.expectedCredentials=a.expected,e.fatalError=null}),e.$on("guacFatalPageError",function(n){e.page.title="APP.NAME",e.page.bodyClassName="",e.fatalError=n}),e.$on("$routeChangeSuccess",function(n,t,a){if(t.$$route){e.loginHelpText=null,e.acceptedCredentials=null,e.expectedCredentials=null,e.fatalError=null;var r=t.$$route.title;r&&(e.page.title=r),e.page.bodyClassName=t.$$route.bodyClassName||""}})}]),angular.module("index").config(["$httpProvider",function(e){e.defaults.headers.patch={"Content-Type":"application/json"}}]),angular.module("index",["auth","client","clipboard","home","login","manage","navigation","ngRoute","ngTouch","notification","pascalprecht.translate","rest","settings","templates-main"]),angular.module("index").config(["$routeProvider","$locationProvider",function(e,n){n.html5Mode(!1),n.hashPrefix("");var t=["$injector",function(e){var n=e.get("$location");return e.get("authenticationService").updateCurrentToken(n.search())}],a=["$injector",function(e){var n=e.get("$location"),a=e.get("$q"),r=e.get("userPageService"),o=a.defer();return e.invoke(t).then(function(){r.getHomePage().then(function(e){n.path()===e.url?o.resolve():(n.path(e.url),o.reject())}).catch(function(){o.resolve()})}).catch(function(){o.reject()}),o.promise}];e.when("/",{title:"APP.NAME",bodyClassName:"home",templateUrl:"app/home/templates/home.html",controller:"homeController",resolve:{routeToUserHomePage:a}}).when("/settings/:dataSource?/:tab",{title:"APP.NAME",bodyClassName:"settings",templateUrl:"app/settings/templates/settings.html",controller:"settingsController",resolve:{updateCurrentToken:t}}).when("/manage/:dataSource/connections/:id?",{title:"APP.NAME",bodyClassName:"manage",templateUrl:"app/manage/templates/manageConnection.html",controller:"manageConnectionController",resolve:{updateCurrentToken:t}}).when("/manage/:dataSource/sharingProfiles/:id?",{title:"APP.NAME",bodyClassName:"manage",templateUrl:"app/manage/templates/manageSharingProfile.html",controller:"manageSharingProfileController",resolve:{updateCurrentToken:t}}).when("/manage/:dataSource/connectionGroups/:id?",{title:"APP.NAME",bodyClassName:"manage",templateUrl:"app/manage/templates/manageConnectionGroup.html",controller:"manageConnectionGroupController",resolve:{updateCurrentToken:t}}).when("/manage/:dataSource/users/:id?",{title:"APP.NAME",bodyClassName:"manage",templateUrl:"app/manage/templates/manageUser.html",controller:"manageUserController",resolve:{updateCurrentToken:t}}).when("/manage/:dataSource/userGroups/:id?",{title:"APP.NAME",bodyClassName:"manage",templateUrl:"app/manage/templates/manageUserGroup.html",controller:"manageUserGroupController",resolve:{updateCurrentToken:t}}).when("/client/:id/:params?",{bodyClassName:"client",templateUrl:"app/client/templates/client.html",controller:"clientController",resolve:{updateCurrentToken:t}}).otherwise({resolve:{routeToUserHomePage:a}})}]),angular.module("index").config(["$injector",function(e){var n=e.get("$translateProvider"),t=e.get("preferenceServiceProvider");n.fallbackLanguage("en"),n.preferredLanguage(t.preferences.language),n.useSanitizeValueStrategy("escape"),n.useLoader("translationLoader"),n.useMessageFormatInterpolation()}]),angular.module("list").factory("IPv4Network",[function(){var e=function(e,n){var t=this;this.address=e,this.netmask=n,this.contains=function(e){return t.address===(e.address&e.netmask&t.netmask)}};return e.parse=function(n){var t=/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})(?:\/([0-9]{1,2}))?$/.exec(n);if(!t)return null;var a=4294967295;if(t[5]){var r=parseInt(t[5]);r>0&&r<=32&&(a=4294967295<<32-r)}for(var o=0,i=1;i<=4;i++){var s=parseInt(t[i]);if(s>255)return null;o=o<<8|s}return new e(o,a)},e}]),angular.module("list").factory("IPv6Network",[function(){var e=function(e,n){var t=this;this.addressGroups=e,this.netmaskGroups=n,this.contains=function(e){for(var n=0;n<8;n++)if(t.addressGroups[n]!==(e.addressGroups[n]&e.netmaskGroups[n]&t.netmaskGroups[n]))return!1;return!0}},n=function(e){var n=[];for(e=Math.min(128,e);e>=16;)n.push(65535),e-=16;for(e>0&&e<=16&&n.push(65535&65535<<16-e);n.length<8;)n.push(0);return n},t=function(e){var n=[],t=e.split(":");return angular.forEach(t,function(e){var t=parseInt(e||"0",16);n.push(t)}),n};return e.parse=function(a){var r=/^([0-9a-f]{0,4}(?::[0-9a-f]{0,4}){0,7})(?:\/([0-9]{1,3}))?$/.exec(a);if(!r)return null;var o,i=r[1],s=r[2];o=n(s?parseInt(s):128);var c,l=i.indexOf("::");if(-1===l)c=t(i);else{for(var u=t(i.substring(0,l)),m=t(i.substring(l+2)),p=8-u.length-m.length;p>0;)u.push(0),p--;c=u.concat(m)}return 8!==c.length?null:new e(c,o)},e}]),angular.module("form").controller("languageFieldController",["$scope","$injector",function(e,n){var t=n.get("languageService"),a=n.get("requestService");e.languages=null,t.getLanguages().then(function(n){e.languages=n},a.DIE),e.$watch("model",function(n){n||""===n||(e.model="")})}]),angular.module("rest").factory("languageService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r={};return r.getLanguages=function(){var e={token:t.getCurrentToken()};return n({cache:a.languages,method:"GET",url:"api/languages",params:e})},r}]),angular.module("list",["auth"]),angular.module("locale",[]),angular.module("storage").provider("localStorageService",[function(){var e=this,n={};e.setItem=function(e,t){var a=JSON.stringify(t);n[e]=a;try{window.localStorage&&localStorage.setItem(e,a)}catch(e){}},e.removeItem=function(e){delete n[e];try{window.localStorage&&localStorage.removeItem(e)}catch(e){}},e.getItem=function(e){try{window.localStorage&&(n[e]=localStorage.getItem(e))}catch(e){}var t=n[e];return t?JSON.parse(t):null},this.$get=["$injector",function(n){return{setItem:e.setItem,removeItem:e.removeItem,getItem:e.getItem}}]}]),angular.module("manage").directive("locationChooser",[function(){return{restrict:"E",replace:!0,scope:{dataSource:"=",rootGroup:"=",value:"="},templateUrl:"app/manage/templates/locationChooser.html",controller:["$scope",function(e){var n={},t=function e(t){n[t.identifier]=t,t.childConnectionGroups&&t.childConnectionGroups.forEach(e)};e.menuOpen=!1,e.chosenConnectionGroupName=null,e.toggleMenu=function(){e.menuOpen=!e.menuOpen},e.$watchGroup(["dataSource","rootGroup"],function(){if(!e.dataSource||!e.rootGroup)return null;e.rootGroups={},e.rootGroups[e.dataSource]=e.rootGroup}),e.groupListContext={chooseGroup:function(n){e.value=n.identifier,e.chosenConnectionGroupName=n.name,e.menuOpen=!1}},e.$watch("rootGroup",function(a){n={},a&&(t(a),e.value&&e.value in n||(e.value=a.identifier),e.chosenConnectionGroupName=n[e.value].name)})}]}}]),angular.module("login").directive("guacLogin",[function(){var e={restrict:"E",replace:!0,templateUrl:"app/login/templates/login.html"};return e.scope={helpText:"=",form:"=",values:"="},e.controller=["$scope","$injector",function(e,n){var t=n.get("Error"),a=n.get("Field"),r=n.get("$route"),o=n.get("authenticationService"),i=n.get("requestService");e.loginError=null,e.enteredValues={},e.remainingFields=[],e.isContinuation=function(){for(var n in e.values)return!0;return!1},e.$watch("values",function(n){angular.extend(e.enteredValues,n||{})}),e.$watch("form",function(n){n?(e.remainingFields=n.filter(function(n){return!(n.name in e.values)}),angular.forEach(e.remainingFields,function(n){e.enteredValues[n.name]||(e.enteredValues[n.name]="")})):e.remainingFields=[]}),e.login=function(){e.loginError=null,o.authenticate(e.enteredValues).then(function(){e.enteredValues={},r.reload()}).catch(i.createErrorCallback(function(n){n.type!==t.Type.INSUFFICIENT_CREDENTIALS&&(n.type===t.Type.INVALID_CREDENTIALS?e.loginError={key:"LOGIN.ERROR_INVALID_LOGIN"}:e.loginError=n.translatableMessage,angular.forEach(e.remainingFields,function(n){n.type!==a.Type.USERNAME&&n.name in e.enteredValues&&delete e.enteredValues[n.name]}))}))}}],e}]),angular.module("login",["element","form","navigation"]),angular.module("manage").factory("ManageableUser",[function(){return function(e){this.dataSource=e.dataSource,this.user=e.user}}]),angular.module("manage").factory("ManageableUserGroup",[function(){return function(e){this.dataSource=e.dataSource,this.userGroup=e.userGroup}}]),angular.module("manage").controller("manageConnectionController",["$scope","$injector",function(e,n){var t=n.get("Connection"),a=n.get("ConnectionGroup"),r=n.get("HistoryEntryWrapper"),o=n.get("ManagementPermissions"),i=n.get("PermissionSet"),s=n.get("Protocol"),c=n.get("$location"),l=n.get("$q"),u=n.get("$routeParams"),m=n.get("$translate"),p=n.get("authenticationService"),d=n.get("connectionService"),g=n.get("connectionGroupService"),f=n.get("permissionService"),h=n.get("requestService"),E=n.get("schemaService");e.selectedDataSource=u.dataSource;var v=c.search().clone,C=u.id;e.protocols=null,e.rootGroup=null,e.connection=null,e.parameters=null,e.historyDateFormat=null,e.historyEntryWrappers=null,e.managementPermissions=null,e.attributes=null,e.isLoaded=function(){return null!==e.protocols&&null!==e.rootGroup&&null!==e.connection&&null!==e.parameters&&null!==e.historyDateFormat&&null!==e.historyEntryWrappers&&null!==e.managementPermissions&&null!==e.attributes};var S=function(n,t){return l.all({connection:d.getConnection(n,t),historyEntries:d.getConnectionHistory(n,t),parameters:d.getConnectionParameters(n,t)}).then(function(n){e.connection=n.connection,e.parameters=n.parameters,e.historyEntryWrappers=[],angular.forEach(n.historyEntries,function(n){e.historyEntryWrappers.push(new r(n))})})},A=function(n,t){return l.all({connection:d.getConnection(n,t),parameters:d.getConnectionParameters(n,t)}).then(function(n){e.connection=n.connection,e.parameters=n.parameters,delete e.connection.identifier,e.historyEntryWrappers=[]})},y=function(){return e.connection=new t({protocol:"vnc",parentIdentifier:c.search().parent}),e.historyEntryWrappers=[],e.parameters={},l.resolve()};l.all({connectionData:function(){return C?S(e.selectedDataSource,C):v?A(e.selectedDataSource,v):y()}(),attributes:E.getConnectionAttributes(e.selectedDataSource),permissions:f.getEffectivePermissions(e.selectedDataSource,p.getCurrentUsername()),protocols:E.getProtocols(e.selectedDataSource),rootGroup:g.getConnectionGroupTree(e.selectedDataSource,a.ROOT_IDENTIFIER,[i.ObjectPermissionType.ADMINISTER])}).then(function(n){e.attributes=n.attributes,e.protocols=n.protocols,e.rootGroup=n.rootGroup,e.managementPermissions=o.fromPermissionSet(n.permissions,i.SystemPermissionType.CREATE_CONNECTION,i.hasConnectionPermission,C)},h.DIE),m("MANAGE_CONNECTION.FORMAT_HISTORY_START").then(function(n){e.historyDateFormat=n},angular.noop),e.getNamespace=s.getNamespace,e.getProtocolName=s.getName,e.returnToConnectionList=function(){c.url("/settings/"+encodeURIComponent(e.selectedDataSource)+"/connections")},e.cloneConnection=function(){c.path("/manage/"+encodeURIComponent(e.selectedDataSource)+"/connections").search("clone",C)},e.saveConnection=function(){return e.connection.parameters=e.parameters,d.saveConnection(e.selectedDataSource,e.connection)},e.deleteConnection=function(){return d.deleteConnection(e.selectedDataSource,e.connection)}}]),angular.module("manage").controller("manageConnectionGroupController",["$scope","$injector",function(e,n){var t=n.get("ConnectionGroup"),a=n.get("ManagementPermissions"),r=n.get("PermissionSet"),o=n.get("$location"),i=n.get("$q"),s=n.get("$routeParams"),c=n.get("authenticationService"),l=n.get("connectionGroupService"),u=n.get("permissionService"),m=n.get("requestService"),p=n.get("schemaService");e.selectedDataSource=s.dataSource;var d=o.search().clone,g=s.id;e.types=[{label:"MANAGE_CONNECTION_GROUP.NAME_TYPE_ORGANIZATIONAL",value:t.Type.ORGANIZATIONAL},{label:"MANAGE_CONNECTION_GROUP.NAME_TYPE_BALANCING",value:t.Type.BALANCING}],e.rootGroup=null,e.connectionGroup=null,e.managementPermissions=null,e.attributes=null,e.isLoaded=function(){return null!==e.rootGroup&&null!==e.connectionGroup&&null!==e.managementPermissions&&null!==e.attributes};var f=function(n,t){return l.getConnectionGroup(n,t).then(function(n){e.connectionGroup=n})},h=function(n,t){return l.getConnectionGroup(n,t).then(function(n){e.connectionGroup=n,delete e.connectionGroup.identifier})},E=function(){return e.connectionGroup=new t({parentIdentifier:o.search().parent}),i.resolve()};i.all({connectionGroupData:function(){return g?f(e.selectedDataSource,g):d?h(e.selectedDataSource,d):E()}(),attributes:p.getConnectionGroupAttributes(e.selectedDataSource),permissions:u.getEffectivePermissions(e.selectedDataSource,c.getCurrentUsername()),rootGroup:l.getConnectionGroupTree(e.selectedDataSource,t.ROOT_IDENTIFIER,[r.ObjectPermissionType.ADMINISTER])}).then(function(n){e.attributes=n.attributes,e.rootGroup=n.rootGroup,e.managementPermissions=a.fromPermissionSet(n.permissions,r.SystemPermissionType.CREATE_CONNECTION,r.hasConnectionPermission,g)},m.DIE),e.returnToConnectionList=function(){o.path("/settings/"+encodeURIComponent(e.selectedDataSource)+"/connections")},e.cloneConnectionGroup=function(){o.path("/manage/"+encodeURIComponent(e.selectedDataSource)+"/connectionGroups").search("clone",g)},e.saveConnectionGroup=function(){return l.saveConnectionGroup(e.selectedDataSource,e.connectionGroup)},e.deleteConnectionGroup=function(){return l.deleteConnectionGroup(e.selectedDataSource,e.connectionGroup)}}]),angular.module("client").factory("ManagedArgument",["$q",function(e){var n=function(e){e=e||{},this.name=e.name,this.value=e.value,this.stream=e.stream};return n.getInstance=function(t,a,r){var o=e.defer(),i=new n({name:a,value:r,stream:t.client.createArgumentValueStream("text/plain",a)});return i.stream.onack=function(e){e.isError()?o.reject(e):o.resolve(i)},o.promise},n.setValue=function(e,n){if(n!==e.value){var t=new Guacamole.StringWriter(e.stream);return t.sendText(n),t.sendEnd(),!0}return!1},n}]),angular.module("client").factory("ManagedClient",["$rootScope","$injector",function(e,n){var t=n.get("ClientProperties"),a=n.get("ClientIdentifier"),r=n.get("ClipboardData"),o=n.get("ManagedArgument"),i=n.get("ManagedClientState"),s=n.get("ManagedClientThumbnail"),c=n.get("ManagedDisplay"),l=n.get("ManagedFilesystem"),u=n.get("ManagedFileUpload"),m=n.get("ManagedShareLink"),p=n.get("$document"),d=n.get("$q"),e=n.get("$rootScope"),g=n.get("$window"),f=n.get("activeConnectionService"),h=n.get("authenticationService"),E=n.get("connectionGroupService"),v=n.get("connectionService"),C=n.get("preferenceService"),S=n.get("requestService"),A=n.get("schemaService"),y=n.get("tunnelService"),T=n.get("guacAudio"),I=n.get("guacHistory"),b=n.get("guacImage"),N=n.get("guacVideo"),P=function(e){e=e||{},this.id=e.id,this.client=e.client,this.tunnel=e.tunnel,this.managedDisplay=e.managedDisplay,this.name=e.name,this.title=e.title,this.protocol=e.protocol||null,this.forms=e.forms||[],this.thumbnail=e.thumbnail,this.clipboardData=e.clipboardData||new r({type:"text/plain",data:""}),this.uploads=e.uploads||[],this.filesystems=e.filesystems||[],this.shareLinks=e.shareLinks||{},this.clientState=e.clientState||new i,this.clientProperties=e.clientProperties||new t,this.arguments=e.arguments||{}};P.AUDIO_INPUT_MIMETYPE="audio/L16;rate=44100,channels=2";var R=function(e,n){var t=d.defer(),a=g.devicePixelRatio||1,r=96*a,o=g.innerWidth*a,i=g.innerHeight*a,s="token="+encodeURIComponent(h.getCurrentToken())+"&GUAC_DATA_SOURCE="+encodeURIComponent(e.dataSource)+"&GUAC_ID="+encodeURIComponent(e.id)+"&GUAC_TYPE="+encodeURIComponent(e.type)+"&GUAC_WIDTH="+Math.floor(o)+"&GUAC_HEIGHT="+Math.floor(i)+"&GUAC_DPI="+Math.floor(r)+"&GUAC_TIMEZONE="+encodeURIComponent(C.preferences.timezone)+(n?"&"+n:"");return T.supported.forEach(function(e){s+="&GUAC_AUDIO="+encodeURIComponent(e)}),N.supported.forEach(function(e){s+="&GUAC_VIDEO="+encodeURIComponent(e)}),b.getSupportedMimetypes().then(function(e){angular.forEach(e,function(e){s+="&GUAC_IMAGE="+encodeURIComponent(e)}),t.resolve(s)}),t.promise},O=function e(n){var t=n.createAudioStream(P.AUDIO_INPUT_MIMETYPE),a=Guacamole.AudioRecorder.getInstance(t,P.AUDIO_INPUT_MIMETYPE);a?a.onclose=e.bind(this,n):t.sendEnd()};return P.getInstance=function(n,t){var s;s=g.WebSocket?new Guacamole.ChainedTunnel(new Guacamole.WebSocketTunnel("websocket-tunnel"),new Guacamole.HTTPTunnel("tunnel")):new Guacamole.HTTPTunnel("tunnel");var u=new Guacamole.Client(s),m=new P({id:n,client:u,tunnel:s});s.onerror=function(n){e.$apply(function(){i.setConnectionState(m.clientState,i.ConnectionState.TUNNEL_ERROR,n.code)})},s.onstatechange=function(n){e.$evalAsync(function(){switch(n){case Guacamole.Tunnel.State.CONNECTING:i.setConnectionState(m.clientState,i.ConnectionState.CONNECTING);break;case Guacamole.Tunnel.State.OPEN:i.setTunnelUnstable(m.clientState,!1);break;case Guacamole.Tunnel.State.UNSTABLE:i.setTunnelUnstable(m.clientState,!0);break;case Guacamole.Tunnel.State.CLOSED:i.setConnectionState(m.clientState,i.ConnectionState.DISCONNECTED)}})},u.onstatechange=function(n){e.$evalAsync(function(){switch(n){case 0:i.setConnectionState(m.clientState,i.ConnectionState.IDLE);break;case 1:break;case 2:i.setConnectionState(m.clientState,i.ConnectionState.WAITING);break;case 3:i.setConnectionState(m.clientState,i.ConnectionState.CONNECTED),m.clipboardData&&P.setClipboard(m,m.clipboardData),O(u),P.updateThumbnail(m);break;case 4:case 5:P.updateThumbnail(m)}})},u.onerror=function(n){e.$apply(function(){u.disconnect(),i.setConnectionState(m.clientState,i.ConnectionState.CLIENT_ERROR,n.code)})},u.onsync=function(){var n=m.thumbnail,t=(new Date).getTime();(!n||t-n.timestamp>=5e3)&&e.$apply(function(){P.updateThumbnail(m)})},u.onargv=function(e,n,t){if("text/plain"===n){var a=new Guacamole.StringReader(e),r="";a.ontext=function(e){r+=e},a.onend=function(){o.getInstance(m,t,r).then(function(e){m.arguments[t]=e},function(){})}}},u.onclipboard=function(n,t){var a;if(/^text\//.exec(t)){var o="";(a=new Guacamole.StringReader(n)).ontext=function(e){o+=e},a.onend=function(){e.$apply(function(){m.clipboardData=new r({type:t,data:o})})}}else(a=new Guacamole.BlobReader(n,t)).onend=function(){e.$apply(function(){m.clipboardData=new r({type:t,data:a.getBlob()})})}},u.onname=function(n){e.$apply(function(){m.title=n})},u.onfile=function(e,n,t){y.downloadStream(s.uuid,e,n,t)},u.onfilesystem=function(n,t){e.$apply(function(){m.filesystems.push(l.getInstance(n,t))})},m.managedDisplay=c.getInstance(u.getDisplay());var p=a.fromString(n);return R(p,t).then(function(e){u.connect(e)}),p.type===a.Types.CONNECTION?d.all({connection:v.getConnection(p.dataSource,p.id),protocols:A.getProtocols(p.dataSource)}).then(function(e){m.name=m.title=e.connection.name,m.protocol=e.connection.protocol,m.forms=e.protocols[e.connection.protocol].connectionForms},S.WARN):p.type===a.Types.CONNECTION_GROUP?E.getConnectionGroup(p.dataSource,p.id).then(function(e){m.name=m.title=e.name},S.WARN):p.type===a.Types.ACTIVE_CONNECTION&&f.getActiveConnection(p.dataSource,p.id).then(function(e){e.connectionIdentifier&&d.all({connection:v.getConnection(p.dataSource,e.connectionIdentifier),protocols:A.getProtocols(p.dataSource)}).then(function(e){m.name=m.title=e.connection.name,m.protocol=e.connection.protocol,m.forms=e.protocols[e.connection.protocol].connectionForms},S.WARN)},S.WARN),m},P.uploadFile=function(e,n,t,a){var r=null,o=null;t&&(r=t.object,o=(a||t.currentDirectory).streamName+"/"+n.name),e.uploads.push(u.getInstance(e,n,r,o))},P.setClipboard=function(e,n){var t,a=e.client.createClipboardStream(n.type);"string"==typeof n.data?((t=new Guacamole.StringWriter(a)).sendText(n.data),t.sendEnd()):((t=new Guacamole.BlobWriter(a)).oncomplete=function(){t.sendEnd()},t.sendBlob(n.data))},P.setArgument=function(e,n,t){var a=e.arguments[n];a&&o.setValue(a,t)&&delete e.arguments[n]},P.getArgumentModel=function(e){var n={};return angular.forEach(e.arguments,function(e){n[e.name]=e.value}),n},P.createShareLink=function(e,n){var t=y.getSharingCredentials(e.tunnel.uuid,n.identifier);return t.then(function(t){e.shareLinks[n.identifier]=m.getInstance(n,t)},S.WARN),t},P.isShared=function(e){for(var n in e.shareLinks)return!0;return!1},P.updateThumbnail=function(e){var n=e.client.getDisplay();if(n&&n.getWidth()>0&&n.getHeight()>0){var t=n.flatten(),a=Math.min(320/t.width,240/t.height,1),r=p[0].createElement("canvas");r.width=t.width*a,r.height=t.height*a,r.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),e.thumbnail=new s({timestamp:(new Date).getTime(),canvas:r}),I.updateThumbnail(e.id,r.toDataURL("image/png"))}},P}]),angular.module("client").factory("ManagedClientState",[function(){var e=function e(n){n=n||{},this.connectionState=n.connectionState||e.ConnectionState.IDLE,this.tunnelUnstable=n.tunnelUnstable||!1,this.statusCode=n.statusCode||Guacamole.Status.Code.SUCCESS};return e.ConnectionState={IDLE:"IDLE",CONNECTING:"CONNECTING",WAITING:"WAITING",CONNECTED:"CONNECTED",DISCONNECTED:"DISCONNECTED",CLIENT_ERROR:"CLIENT_ERROR",TUNNEL_ERROR:"TUNNEL_ERROR"},e.setConnectionState=function(n,t,a){n.connectionState!==e.ConnectionState.TUNNEL_ERROR&&n.connectionState!==e.ConnectionState.CLIENT_ERROR&&(n.connectionState=t,n.tunnelUnstable=!1,a&&(n.statusCode=a))},e.setTunnelUnstable=function(e,n){e.tunnelUnstable=n},e}]),angular.module("client").factory("ManagedClientThumbnail",[function(){return function(e){e=e||{},this.timestamp=e.timestamp,this.canvas=e.canvas}}]),angular.module("client").factory("ManagedDisplay",["$rootScope",function(e){var n=function e(n){n=n||{},this.display=n.display,this.size=new e.Dimensions(n.size),this.cursor=n.cursor};return n.Dimensions=function(e){e=e||{},this.width=e.width||0,this.height=e.height||0},n.Cursor=function(e){e=e||{},this.canvas=e.canvas,this.x=e.x,this.y=e.y},n.getInstance=function(t){var a=new n({display:t});return t.onresize=function(){e.$apply(function(){a.size=new n.Dimensions({width:t.getWidth(),height:t.getHeight()})})},t.oncursor=function(t,r,o){e.$apply(function(){a.cursor=new n.Cursor({canvas:t,x:r,y:o})})},a},n}]),angular.module("client").factory("ManagedFilesystem",["$rootScope","$injector",function(e,n){var t=n.get("tunnelService"),a=function(e){e=e||{},this.object=e.object,this.name=e.name,this.root=e.root,this.currentDirectory=e.currentDirectory||e.root};return a.refresh=function(n,t){t.mimetype===Guacamole.Object.STREAM_INDEX_MIMETYPE&&n.object.requestInputStream(t.streamName,function(n,r){if(r===Guacamole.Object.STREAM_INDEX_MIMETYPE){n.sendAck("Ready",Guacamole.Status.Code.SUCCESS);var o=new Guacamole.JSONReader(n);o.onprogress=function(){n.sendAck("Received",Guacamole.Status.Code.SUCCESS)},o.onend=function(){e.$evalAsync(function(){t.files={};var e=t.streamName;"/"!==e.charAt(e.length-1)&&(e+="/");var n=o.getJSON();for(var r in n)if(r.substring(0,e.length)===e){var i=r.substring(e.length),s=a.File.Type.NORMAL;n[r]===Guacamole.Object.STREAM_INDEX_MIMETYPE&&(s=a.File.Type.DIRECTORY),t.files[i]=new a.File({mimetype:n[r],streamName:r,type:s,parent:t,name:i})}})}}else n.sendAck("Unexpected mimetype",Guacamole.Status.Code.UNSUPPORTED)})},a.getInstance=function(e,n){var t=new a({object:e,name:n,root:new a.File({mimetype:Guacamole.Object.STREAM_INDEX_MIMETYPE,streamName:Guacamole.Object.ROOT_STREAM,type:a.File.Type.DIRECTORY})});return a.refresh(t,t.root),t},a.downloadFile=function(e,n,a){n.object.requestInputStream(a,function(n,r){var o=a.match(/(.*[\\/])?(.*)/)[2];t.downloadStream(e.tunnel.uuid,n,r,o)})},a.changeDirectory=function(e,n){a.refresh(e,n),e.currentDirectory=n},a.File=function(e){this.mimetype=e.mimetype,this.streamName=e.streamName,this.type=e.type,this.name=e.name,this.parent=e.parent,this.files=e.files||{}},a.File.Type={NORMAL:"NORMAL",DIRECTORY:"DIRECTORY"},a}]),angular.module("client").factory("ManagedFileTransferState",[function(){var e=function e(n){n=n||{},this.streamState=n.streamState||e.StreamState.IDLE,this.statusCode=n.statusCode||Guacamole.Status.Code.SUCCESS};return e.StreamState={IDLE:"IDLE",OPEN:"OPEN",CLOSED:"CLOSED",ERROR:"ERROR"},e.setStreamState=function(n,t,a){n.streamState!==e.StreamState.ERROR&&(n.streamState=t,a&&(n.statusCode=a))},e}]),angular.module("client").factory("ManagedFileUpload",["$rootScope","$injector",function(e,n){var t=n.get("Error"),a=n.get("ManagedFileTransferState"),r=n.get("requestService"),o=n.get("tunnelService"),i=function(e){e=e||{},this.transferState=e.transferState||new a,this.mimetype=e.mimetype,this.filename=e.filename,this.progress=e.progress,this.length=e.length};return i.getInstance=function(n,s,c,l){var u,m=new i,p=n.client,d=n.tunnel;return u=c?c.createOutputStream(s.type,l):p.createFileStream(s.type,s.name),e.$evalAsync(function(){m.filename=s.name,m.mimetype=s.type,m.progress=0,m.length=s.size,a.setStreamState(m.transferState,a.StreamState.OPEN)}),u.onack=function(n){n.isError()?e.$apply(function(){a.setStreamState(m.transferState,a.StreamState.ERROR,n.code)}):(o.uploadToStream(d.uuid,u,s,function(n){e.$apply(function(){m.progress=n})}).then(function(){m.progress=s.size,a.setStreamState(m.transferState,a.StreamState.CLOSED),e.$broadcast("guacUploadComplete",s.name)},r.createErrorCallback(function(e){e.type===t.Type.STREAM_ERROR?a.setStreamState(m.transferState,a.StreamState.ERROR,e.statusCode):a.setStreamState(m.transferState,a.StreamState.ERROR,Guacamole.Status.Code.INTERNAL_ERROR)})),u.onack=null)},m},i}]),angular.module("client").factory("ManagedShareLink",["$injector",function(e){var n=e.get("UserCredentials"),t=function(e){e=e||{},this.name=e.name,this.href=e.href,this.sharingProfile=e.sharingProfile,this.sharingCredentials=e.sharingCredentials};return t.getInstance=function(e,a){return new t({name:e.name,href:n.getLink(a),sharingProfile:e,sharingCredentials:a})},t}]),angular.module("manage").directive("managementButtons",["$injector",function(e){var n=e.get("guacNotification"),t={restrict:"E",replace:!0,templateUrl:"app/manage/templates/managementButtons.html",scope:{namespace:"@",permissions:"=",save:"&",clone:"&",delete:"&",return:"&"}};return t.controller=["$scope",function(e){var t={name:e.namespace+".ACTION_DELETE",className:"danger",callback:function(){o(),n.showStatus(!1)}},a={name:e.namespace+".ACTION_CANCEL",callback:function(){n.showStatus(!1)}},r=function(){e.return(e.$parent)},o=function(){e.delete(e.$parent).then(r,n.SHOW_REQUEST_ERROR)};e.cancel=r,e.cloneObject=function(){e.clone(e.$parent)},e.saveObject=function(){e.save(e.$parent).then(r,n.SHOW_REQUEST_ERROR)},e.deleteObject=function(){n.showStatus({title:e.namespace+".DIALOG_HEADER_CONFIRM_DELETE",text:{key:e.namespace+".TEXT_CONFIRM_DELETE"},actions:[t,a]})}}],t}]),angular.module("manage").factory("ManagementPermissions",["$injector",function(e){var n=e.get("PermissionSet"),t=function(e){this.identifier=e.identifier||null,this.canSaveObject=e.canSaveObject,this.canCloneObject=e.canCloneObject,this.canDeleteObject=e.canDeleteObject,this.canChangeAttributes=e.canChangeAttributes,this.canChangeAllAttributes=e.canChangeAllAttributes,this.canChangePermissions=e.canChangePermissions};return t.fromPermissionSet=function(e,a,r,o){var i=n.hasSystemPermission(e,n.SystemPermissionType.ADMINISTER),s=n.hasSystemPermission(e,a),c=r(e,n.ObjectPermissionType.ADMINISTER,o),l=r(e,n.ObjectPermissionType.UPDATE,o),u=r(e,n.ObjectPermissionType.DELETE,o),m=!!o;return new t({identifier:o,canSaveObject:i||!m&&s||l,canCloneObject:m&&(i||s),canDeleteObject:m&&(i||u),canChangeAttributes:!m||i||l,canChangeAllAttributes:!m,canChangePermissions:i||!m||c})},t}]),angular.module("manage",["form","groupList","list","locale","navigation","notification","rest"]),angular.module("manage").controller("manageSharingProfileController",["$scope","$injector",function(e,n){var t=n.get("ManagementPermissions"),a=n.get("SharingProfile"),r=n.get("PermissionSet"),o=n.get("Protocol"),i=n.get("$location"),s=n.get("$q"),c=n.get("$routeParams"),l=n.get("authenticationService"),u=n.get("connectionService"),m=n.get("permissionService"),p=n.get("requestService"),d=n.get("schemaService"),g=n.get("sharingProfileService");e.selectedDataSource=c.dataSource;var f=i.search().clone,h=c.id;e.protocols=null,e.sharingProfile=null,e.parameters=null,e.managementPermissions=null,e.attributes=null,e.isLoaded=function(){return null!==e.protocols&&null!==e.sharingProfile&&null!==e.primaryConnection&&null!==e.parameters&&null!==e.managementPermissions&&null!==e.attributes};var E=function(n,t){return s.all({sharingProfile:g.getSharingProfile(n,t),parameters:g.getSharingProfileParameters(n,t)}).then(function(t){return e.sharingProfile=t.sharingProfile,e.parameters=t.parameters,u.getConnection(n,t.sharingProfile.primaryConnectionIdentifier).then(function(n){e.primaryConnection=n})})},v=function(n,t){return s.all({sharingProfile:g.getSharingProfile(n,t),parameters:g.getSharingProfileParameters(n,t)}).then(function(t){return e.sharingProfile=t.sharingProfile,e.parameters=t.parameters,delete e.sharingProfile.identifier,u.getConnection(n,t.sharingProfile.primaryConnectionIdentifier).then(function(n){e.primaryConnection=n})})},C=function(n){return e.sharingProfile=new a({primaryConnectionIdentifier:i.search().parent}),e.parameters={},u.getConnection(n,e.sharingProfile.primaryConnectionIdentifier).then(function(n){e.primaryConnection=n})};s.all({sharingProfileData:function(){return h?E(e.selectedDataSource,h):f?v(e.selectedDataSource,f):C(e.selectedDataSource)}(),attributes:d.getSharingProfileAttributes(e.selectedDataSource),protocols:d.getProtocols(e.selectedDataSource),permissions:m.getEffectivePermissions(e.selectedDataSource,l.getCurrentUsername())}).then(function(n){e.attributes=n.attributes,e.protocols=n.protocols,e.managementPermissions=t.fromPermissionSet(n.permissions,r.SystemPermissionType.CREATE_CONNECTION,r.hasConnectionPermission,h)},p.DIE),e.getNamespace=o.getNamespace,e.returnToConnectionList=function(){i.url("/settings/"+encodeURIComponent(e.selectedDataSource)+"/connections")},e.cloneSharingProfile=function(){i.path("/manage/"+encodeURIComponent(e.selectedDataSource)+"/sharingProfiles").search("clone",h)},e.saveSharingProfile=function(){return e.sharingProfile.parameters=e.parameters,g.saveSharingProfile(e.selectedDataSource,e.sharingProfile)},e.deleteSharingProfile=function(){return g.deleteSharingProfile(e.selectedDataSource,e.sharingProfile)}}]),angular.module("manage").controller("manageUserController",["$scope","$injector",function(e,n){var t=n.get("Error"),a=n.get("ManagementPermissions"),r=n.get("PermissionFlagSet"),o=n.get("PermissionSet"),i=n.get("User"),s=n.get("$location"),c=n.get("$routeParams"),l=n.get("$q"),u=n.get("authenticationService"),m=n.get("dataSourceService"),p=n.get("membershipService"),d=n.get("permissionService"),g=n.get("requestService"),f=n.get("schemaService"),h=n.get("userGroupService"),E=n.get("userService"),v=u.getAvailableDataSources(),C=u.getCurrentUsername(),S=s.search().clone,A=c.id;e.dataSource=c.dataSource,e.selfUsername="",e.users=null,e.user=null,e.permissionFlags=null,e.permissionsAdded=new o,e.permissionsRemoved=new o,e.availableGroups=null,e.parentGroups=null,e.parentGroupsAdded=[],e.parentGroupsRemoved=[],e.managementPermissions=null,e.attributes=null,e.isLoaded=function(){return null!==e.users&&null!==e.permissionFlags&&null!==e.managementPermissions&&null!==e.availableGroups&&null!==e.parentGroups&&null!==e.attributes},e.canEditUsername=function(e){return!A};var y=function(n,t){return l.all({users:m.apply(E.getUser,v,t),permissions:d.getPermissions(n,t).catch(g.defaultValue(new o)),parentGroups:p.getUserGroups(n,t).catch(g.defaultValue([]))}).then(function(a){e.users=a.users,e.parentGroups=a.parentGroups,e.user=a.users[n]||new i({username:t}),e.selfUsername=t,e.permissionFlags=r.fromPermissionSet(a.permissions)})},T=function(n,t){return l.all({users:m.apply(E.getUser,[n],t),permissions:d.getPermissions(n,t),parentGroups:p.getUserGroups(n,t)}).then(function(a){e.users={},e.user=a.users[n],e.parentGroups=a.parentGroups,e.parentGroupsAdded=a.parentGroups,e.selfUsername=t,e.permissionFlags=r.fromPermissionSet(a.permissions),e.permissionsAdded=a.permissions})},I=function(){return e.users={},e.user=new i,e.parentGroups=[],e.permissionFlags=new r,e.selfUsername="SELF",l.resolve()};l.all({userData:function(){return A?y(e.dataSource,A):S?T(e.dataSource,S):I()}(),permissions:m.apply(d.getEffectivePermissions,v,C),userGroups:h.getUserGroups(e.dataSource,[o.ObjectPermissionType.UPDATE]),attributes:f.getUserAttributes(e.dataSource)}).then(function(n){e.attributes=n.attributes,e.managementPermissions={},angular.forEach(v,function(t){var r=t in e.users;e.availableGroups=[],angular.forEach(n.userGroups,function(n){e.availableGroups.push(n.identifier)}),e.managementPermissions[t]=a.fromPermissionSet(n.permissions[t],o.SystemPermissionType.CREATE_USER,o.hasUserPermission,r?A:null)})},g.DIE),e.getUserURL=function(e){return"/manage/"+encodeURIComponent(e)+"/users/"+encodeURIComponent(A||"")},e.returnToUserList=function(){s.url("/settings/users")},e.cloneUser=function(){s.path("/manage/"+encodeURIComponent(e.dataSource)+"/users").search("clone",A)},e.saveUser=function(){if(e.passwordMatch!==e.user.password)return l.reject(new t({translatableMessage:{key:"MANAGE_USER.ERROR_PASSWORD_MISMATCH"}}));return(e.dataSource in e.users?E.saveUser(e.dataSource,e.user):E.createUser(e.dataSource,e.user)).then(function(){return e.selfUsername!==e.user.username&&(e.permissionsAdded.userPermissions[e.selfUsername]&&(e.permissionsAdded.userPermissions[e.user.username]=e.permissionsAdded.userPermissions[e.selfUsername],delete e.permissionsAdded.userPermissions[e.selfUsername]),e.permissionsRemoved.userPermissions[e.selfUsername]&&(e.permissionsRemoved.userPermissions[e.user.username]=e.permissionsRemoved.userPermissions[e.selfUsername],delete e.permissionsRemoved.userPermissions[e.selfUsername])),l.all([d.patchPermissions(e.dataSource,e.user.username,e.permissionsAdded,e.permissionsRemoved),p.patchUserGroups(e.dataSource,e.user.username,e.parentGroupsAdded,e.parentGroupsRemoved)])})},e.deleteUser=function(){return E.deleteUser(e.dataSource,e.user)}}]),angular.module("manage").controller("manageUserGroupController",["$scope","$injector",function(e,n){var t=n.get("ManagementPermissions"),a=n.get("PermissionFlagSet"),r=n.get("PermissionSet"),o=n.get("UserGroup"),i=n.get("$location"),s=n.get("$routeParams"),c=n.get("$q"),l=n.get("authenticationService"),u=n.get("dataSourceService"),m=n.get("membershipService"),p=n.get("permissionService"),d=n.get("requestService"),g=n.get("schemaService"),f=n.get("userGroupService"),h=n.get("userService"),E=l.getAvailableDataSources(),v=l.getCurrentUsername(),C=i.search().clone,S=s.id;e.dataSource=s.dataSource,e.userGroups=null,e.userGroup=null,e.permissionFlags=null,e.permissionsAdded=new r,e.permissionsRemoved=new r,e.availableGroups=null,e.availableUsers=null,e.parentGroups=null,e.parentGroupsAdded=[],e.parentGroupsRemoved=[],e.memberGroups=null,e.memberGroupsAdded=[],e.memberGroupsRemoved=[],e.memberUsers=null,e.memberUsersAdded=[],e.memberUsersRemoved=[],e.managementPermissions=null,e.attributes=null,e.isLoaded=function(){return null!==e.userGroups&&null!==e.permissionFlags&&null!==e.managementPermissions&&null!==e.availableGroups&&null!==e.availableUsers&&null!==e.parentGroups&&null!==e.memberGroups&&null!==e.memberUsers&&null!==e.attributes},e.canEditIdentifier=function(){return!S};var A=function(n,t){return c.all({userGroups:u.apply(f.getUserGroup,E,t),permissions:p.getPermissions(n,t,!0).catch(d.defaultValue(new r)),parentGroups:m.getUserGroups(n,t,!0).catch(d.defaultValue([])),memberGroups:m.getMemberUserGroups(n,t).catch(d.defaultValue([])),memberUsers:m.getMemberUsers(n,t).catch(d.defaultValue([]))}).then(function(r){e.userGroups=r.userGroups,e.parentGroups=r.parentGroups,e.memberGroups=r.memberGroups,e.memberUsers=r.memberUsers,e.userGroup=r.userGroups[n]||new o({identifier:t}),e.permissionFlags=a.fromPermissionSet(r.permissions)})},y=function(n,t){return c.all({userGroups:u.apply(f.getUserGroup,[n],t),permissions:p.getPermissions(n,t,!0),parentGroups:m.getUserGroups(n,t,!0),memberGroups:m.getMemberUserGroups(n,t),memberUsers:m.getMemberUsers(n,t)}).then(function(t){e.userGroups={},e.userGroup=t.userGroups[n],e.parentGroups=t.parentGroups,e.parentGroupsAdded=t.parentGroups,e.memberGroups=t.memberGroups,e.memberGroupsAdded=t.memberGroups,e.memberUsers=t.memberUsers,e.memberUsersAdded=t.memberUsers,e.permissionFlags=a.fromPermissionSet(t.permissions),e.permissionsAdded=t.permissions})},T=function(){return e.userGroups={},e.userGroup=new o,e.parentGroups=[],e.memberGroups=[],e.memberUsers=[],e.permissionFlags=new a,c.resolve()};c.all({userGroupData:function(){return S?A(e.dataSource,S):C?y(e.dataSource,C):T()}(),permissions:u.apply(p.getEffectivePermissions,E,v),userGroups:f.getUserGroups(e.dataSource,[r.ObjectPermissionType.UPDATE]),users:h.getUsers(e.dataSource,[r.ObjectPermissionType.UPDATE]),attributes:g.getUserGroupAttributes(e.dataSource)}).then(function(n){e.attributes=n.attributes,e.managementPermissions={},angular.forEach(E,function(a){var o=a in e.userGroups;e.availableGroups=[],angular.forEach(n.userGroups,function(n){e.availableGroups.push(n.identifier)}),e.availableUsers=[],angular.forEach(n.users,function(n){e.availableUsers.push(n.username)}),e.managementPermissions[a]=t.fromPermissionSet(n.permissions[a],r.SystemPermissionType.CREATE_USER_GROUP,r.hasUserGroupPermission,o?S:null)})},d.WARN),e.getUserGroupURL=function(e){return"/manage/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(S||"")},e.returnToUserGroupList=function(){i.url("/settings/userGroups")},e.cloneUserGroup=function(){i.path("/manage/"+encodeURIComponent(e.dataSource)+"/userGroups").search("clone",S)},e.saveUserGroup=function(){return(e.dataSource in e.userGroups?f.saveUserGroup(e.dataSource,e.userGroup):f.createUserGroup(e.dataSource,e.userGroup)).then(function(){return c.all([p.patchPermissions(e.dataSource,e.userGroup.identifier,e.permissionsAdded,e.permissionsRemoved,!0),m.patchUserGroups(e.dataSource,e.userGroup.identifier,e.parentGroupsAdded,e.parentGroupsRemoved,!0),m.patchMemberUserGroups(e.dataSource,e.userGroup.identifier,e.memberGroupsAdded,e.memberGroupsRemoved),m.patchMemberUsers(e.dataSource,e.userGroup.identifier,e.memberUsersAdded,e.memberUsersRemoved)])})},e.deleteUserGroup=function(){return f.deleteUserGroup(e.dataSource,e.userGroup)}}]),angular.module("element").factory("Marker",[function(){return function(e){this.scrollIntoView=function(){e.scrollIntoView()}}}]),angular.module("rest").factory("membershipService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r=e.get("RelatedObjectPatch"),o={},i=function(e,n){var t=[];return angular.forEach(e,function(e){t.push(new r({op:r.Operation.ADD,value:e}))}),angular.forEach(n,function(e){t.push(new r({op:r.Operation.REMOVE,value:e}))}),t},s=function(e,n,a){var r="api/session/data/"+encodeURIComponent(e);return a?r+"/userGroups/"+encodeURIComponent(n)+"/userGroups":n===t.getCurrentUsername()?r+"/self/userGroups":r+"/users/"+encodeURIComponent(n)+"/userGroups"};return o.getUserGroups=function(e,r,o){var i={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:s(e,r,o),params:i})},o.patchUserGroups=function(e,r,o,c,l){var u={token:t.getCurrentToken()};return n({method:"PATCH",url:s(e,r,l),params:u,data:i(o,c)}).then(function(){a.users.removeAll()})},o.getMemberUsers=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r)+"/memberUsers",params:o})},o.patchMemberUsers=function(e,r,o,s){var c={token:t.getCurrentToken()};return n({method:"PATCH",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r)+"/memberUsers",params:c,data:i(o,s)}).then(function(){a.users.removeAll()})},o.getMemberUserGroups=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r)+"/memberUserGroups",params:o})},o.patchMemberUserGroups=function(e,r,o,s){var c={token:t.getCurrentToken()};return n({method:"PATCH",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r)+"/memberUserGroups",params:c,data:i(o,s)}).then(function(){a.users.removeAll()})},o}]),angular.module("navigation").factory("MenuAction",[function(){return function(e,n,t){this.className=t,this.name=e,this.callback=n}}]),angular.module("navigation",["auth","form","notification","rest"]),angular.module("notification").factory("Notification",[function(){return function(e){e=e||{},this.className=e.className,this.title=e.title,this.text=e.text,this.actions=e.actions||[],this.progress=e.progress,this.countdown=e.countdown}}]),angular.module("notification").factory("NotificationAction",[function(){return function(e,n,t){this.className=t,this.name=e,this.callback=n}}]),angular.module("notification").factory("NotificationCountdown",[function(){return function(e,n,t){this.text=e,this.remaining=n,this.callback=t}}]),angular.module("notification",["rest","storage"]),angular.module("notification").factory("NotificationProgress",[function(){return function(e,n,t,a){this.text=e,this.value=n,this.unit=t,this.ratio=a}}]),angular.module("form").controller("numberFieldController",["$scope",function(e){e.$watch("model",function(n){e.typedValue=n?Number(n):null}),e.$watch("typedValue",function(n){e.model=n||0===n?n.toString():""})}]),angular.module("osk",[]),angular.module("navigation").factory("PageDefinition",[function(){return function(e){this.name=e.name,this.url=e.url,this.className=e.className||"",this.weight=e.weight}}]),angular.module("form").controller("passwordFieldController",["$scope",function(e){e.passwordInputType="password",e.getTogglePasswordHelpText=function(){return"password"===e.passwordInputType?"FORM.HELP_SHOW_PASSWORD":"FORM.HELP_HIDE_PASSWORD"},e.togglePassword=function(){"password"===e.passwordInputType?e.passwordInputType="text":e.passwordInputType="password"}}]),angular.module("rest").factory("patchService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r={};return r.getPatches=function(){var e={token:t.getCurrentToken()};return n({cache:a.patches,method:"GET",url:"api/patches",params:e})},r}]),angular.module("rest").factory("PermissionFlagSet",["PermissionSet",function(e){var n=function(e){e=e||{},this.systemPermissions=e.systemPermissions||{},this.connectionPermissions=e.connectionPermissions||{READ:{},UPDATE:{},DELETE:{},ADMINISTER:{}},this.connectionGroupPermissions=e.connectionGroupPermissions||{READ:{},UPDATE:{},DELETE:{},ADMINISTER:{}},this.sharingProfilePermissions=e.sharingProfilePermissions||{READ:{},UPDATE:{},DELETE:{},ADMINISTER:{}},this.activeConnectionPermissions=e.activeConnectionPermissions||{READ:{},UPDATE:{},DELETE:{},ADMINISTER:{}},this.userPermissions=e.userPermissions||{READ:{},UPDATE:{},DELETE:{},ADMINISTER:{}},this.userGroupPermissions=e.userGroupPermissions||{READ:{},UPDATE:{},DELETE:{},ADMINISTER:{}}},t=function(e,n){for(var t in e)e[t].forEach(function(e){(n[e]=n[e]||{})[t]=!0})};return n.fromPermissionSet=function(e){var a=new n;return e.systemPermissions.forEach(function(e){a.systemPermissions[e]=!0}),t(e.connectionPermissions,a.connectionPermissions),t(e.connectionGroupPermissions,a.connectionGroupPermissions),t(e.sharingProfilePermissions,a.sharingProfilePermissions),t(e.activeConnectionPermissions,a.activeConnectionPermissions),t(e.userPermissions,a.userPermissions),t(e.userGroupPermissions,a.userGroupPermissions),a},n}]),angular.module("rest").factory("PermissionPatch",[function(){var e=function(e){e=e||{},this.op=e.op,this.path=e.path,this.value=e.value};return e.Operation={ADD:"add",REMOVE:"remove"},e}]),angular.module("rest").factory("permissionService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r=e.get("PermissionPatch"),o={},i=function(e,n){var a="api/session/data/"+encodeURIComponent(e);return n===t.getCurrentUsername()?a+"/self/effectivePermissions":a+"/users/"+encodeURIComponent(n)+"/effectivePermissions"};o.getEffectivePermissions=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:i(e,r),params:o})};var s=function(e,n,a){var r="api/session/data/"+encodeURIComponent(e);return a?r+"/userGroups/"+encodeURIComponent(n)+"/permissions":n===t.getCurrentUsername()?r+"/self/permissions":r+"/users/"+encodeURIComponent(n)+"/permissions"};o.getPermissions=function(e,r,o){var i={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:s(e,r,o),params:i})};var c=function(e,n,t,a){for(var r in a)a[r].forEach(function(a){e.push({op:n,path:t+"/"+r,value:a})})},l=function(e,n,t){c(e,n,"/connectionPermissions",t.connectionPermissions),c(e,n,"/connectionGroupPermissions",t.connectionGroupPermissions),c(e,n,"/sharingProfilePermissions",t.sharingProfilePermissions),c(e,n,"/activeConnectionPermissions",t.activeConnectionPermissions),c(e,n,"/userPermissions",t.userPermissions),c(e,n,"/userGroupPermissions",t.userGroupPermissions),t.systemPermissions.forEach(function(t){e.push({op:n,path:"/systemPermissions",value:t})})};return o.patchPermissions=function(e,o,i,c,u){var m=[],p={token:t.getCurrentToken()};return l(m,r.Operation.ADD,i),l(m,r.Operation.REMOVE,c),n({method:"PATCH",url:s(e,o,u),params:p,data:m}).then(function(){a.users.removeAll()})},o}]),angular.module("rest").factory("PermissionSet",[function(){var e=function(e){e=e||{},this.connectionPermissions=e.connectionPermissions||{},this.connectionGroupPermissions=e.connectionGroupPermissions||{},this.sharingProfilePermissions=e.sharingProfilePermissions||{},this.activeConnectionPermissions=e.activeConnectionPermissions||{},this.userPermissions=e.userPermissions||{},this.userGroupPermissions=e.userGroupPermissions||{},this.systemPermissions=e.systemPermissions||[]};e.ObjectPermissionType={READ:"READ",UPDATE:"UPDATE",DELETE:"DELETE",ADMINISTER:"ADMINISTER"},e.SystemPermissionType={ADMINISTER:"ADMINISTER",CREATE_USER:"CREATE_USER",CREATE_USER_GROUP:"CREATE_USER_GROUP",CREATE_CONNECTION:"CREATE_CONNECTION",CREATE_CONNECTION_GROUP:"CREATE_CONNECTION_GROUP",CREATE_SHARING_PROFILE:"CREATE_SHARING_PROFILE"};var n=function(e,n){for(var t in e)if(-1!==e[t].indexOf(n))return!0;return!1},t=function(e,t,a){return!!e&&(a?a in e&&-1!==e[a].indexOf(t):n(e,t))};e.hasConnectionPermission=function(e,n,a){return t(e.connectionPermissions,n,a)},e.hasConnectionGroupPermission=function(e,n,a){return t(e.connectionGroupPermissions,n,a)},e.hasSharingProfilePermission=function(e,n,a){return t(e.sharingProfilePermissions,n,a)},e.hasActiveConnectionPermission=function(e,n,a){return t(e.activeConnectionPermissions,n,a)},e.hasUserPermission=function(e,n,a){return t(e.userPermissions,n,a)},e.hasUserGroupPermission=function(e,n,a){return t(e.userGroupPermissions,n,a)},e.hasSystemPermission=function(e,n){return!!e.systemPermissions&&-1!==e.systemPermissions.indexOf(n)},e.addSystemPermission=function(e,n){return e.systemPermissions=e.systemPermissions||[],-1===e.systemPermissions.indexOf(n)&&(e.systemPermissions.push(n),!0)},e.removeSystemPermission=function(e,n){e.systemPermissions=e.systemPermissions||[];var t=e.systemPermissions.indexOf(n);return-1!==t&&(e.systemPermissions.splice(t,1),!0)};var a=function(e,n,t){var a=e[t]=e[t]||[];return-1===a.indexOf(n)&&(a.push(n),!0)},r=function(e,n,t){var a=e[t];if(!(t in e))return!1;var r=a.indexOf(n);return-1!==r&&(a.splice(r,1),!0)};return e.addConnectionPermission=function(e,n,t){return e.connectionPermissions=e.connectionPermissions||{},a(e.connectionPermissions,n,t)},e.removeConnectionPermission=function(e,n,t){return e.connectionPermissions=e.connectionPermissions||{},r(e.connectionPermissions,n,t)},e.addConnectionGroupPermission=function(e,n,t){return e.connectionGroupPermissions=e.connectionGroupPermissions||{},a(e.connectionGroupPermissions,n,t)},e.removeConnectionGroupPermission=function(e,n,t){return e.connectionGroupPermissions=e.connectionGroupPermissions||{},r(e.connectionGroupPermissions,n,t)},e.addSharingProfilePermission=function(e,n,t){return e.sharingProfilePermissions=e.sharingProfilePermissions||{},a(e.sharingProfilePermissions,n,t)},e.removeSharingProfilePermission=function(e,n,t){return e.sharingProfilePermissions=e.sharingProfilePermissions||{},r(e.sharingProfilePermissions,n,t)},e.addActiveConnectionPermission=function(e,n,t){return e.activeConnectionPermissions=e.activeConnectionPermissions||{},a(e.activeConnectionPermissions,n,t)},e.removeActiveConnectionPermission=function(e,n,t){return e.activeConnectionPermissions=e.activeConnectionPermissions||{},r(e.activeConnectionPermissions,n,t)},e.addUserPermission=function(e,n,t){return e.userPermissions=e.userPermissions||{},a(e.userPermissions,n,t)},e.removeUserPermission=function(e,n,t){return e.userPermissions=e.userPermissions||{},r(e.userPermissions,n,t)},e.addUserGroupPermission=function(e,n,t){return e.userGroupPermissions=e.userGroupPermissions||{},a(e.userGroupPermissions,n,t)},e.removeUserGroupPermission=function(e,n,t){return e.userGroupPermissions=e.userGroupPermissions||{},r(e.userGroupPermissions,n,t)},e}]),angular.module("settings").provider("preferenceService",["$injector",function(e){var n=e.get("localStorageServiceProvider"),t=this,a={NONE:"none",OSK:"osk",TEXT:"text"};this.preferences={emulateAbsoluteMouse:!0,inputMethod:a.NONE,language:function(){return(navigator.languages&&navigator.languages[0]||navigator.language||navigator.browserLanguage||"en").replace(/-/g,"_")}(),timezone:function(){return jstz.determine().name()}()};var r=n.getItem("GUAC_PREFERENCES");r&&angular.extend(t.preferences,r),this.$get=["$injector",function(e){var n=e.get("$rootScope"),r=e.get("$window"),o=e.get("localStorageService"),i={};return i.inputMethods=a,i.preferences=t.preferences,i.save=function(){o.setItem("GUAC_PREFERENCES",i.preferences)},r.addEventListener("unload",i.save),n.$on("$routeChangeSuccess",function(){i.save()}),n.$on("guacLogout",function(){i.save()}),i}]}]),angular.module("rest").factory("Protocol",["$injector",function(e){var n=e.get("translationStringService"),t=function(e){e=e||{},this.name=e.name,this.connectionForms=e.connectionForms||[],this.sharingProfileForms=e.sharingProfileForms||[]};return t.getNamespace=function(e){return e?"PROTOCOL_"+n.canonicalize(e):null},t.getName=function(e){return t.getNamespace(e)+".NAME"},t}]),angular.module("home").factory("RecentConnection",[function(){return function(e,n){this.name=e,this.entry=n}}]),angular.module("rest").factory("RelatedObjectPatch",[function(){var e=function(e){e=e||{},this.op=e.op,this.path=e.path||"/",this.value=e.value};return e.Operation={ADD:"add",REMOVE:"remove"},e}]),angular.module("rest").factory("requestService",["$injector",function(e){var n=e.get("$http"),t=e.get("$log"),a=e.get("$rootScope"),r=e.get("Error"),o=function(e){return n(e).then(function(e){return e.data},function(e){if(e.data)throw new r(e.data);throw e})};return o.createErrorCallback=function(e){return function(n){if(n instanceof r)return e(n);t.error(n)}},o.defaultValue=function(e){return o.createErrorCallback(function(n){if(n.type===r.Type.NOT_FOUND)return e;throw n})},o.IGNORE=o.createErrorCallback(angular.noop),o.WARN=o.createErrorCallback(function(e){t.warn(e.type,e.message||e.translatableMessage)}),o.DIE=o.createErrorCallback(function(e){a.$broadcast("guacFatalPageError",e),t.error(e.type,e.message||e.translatableMessage)}),o}]),angular.module("rest",["auth","locale"]),angular.module("rest").factory("schemaService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r={};return r.getUserAttributes=function(e){var r={token:t.getCurrentToken()};return n({cache:a.schema,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/schema/userAttributes",params:r})},r.getUserGroupAttributes=function(e){var r={token:t.getCurrentToken()};return n({cache:a.schema,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/schema/userGroupAttributes",params:r})},r.getConnectionAttributes=function(e){var r={token:t.getCurrentToken()};return n({cache:a.schema,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/schema/connectionAttributes",params:r})},r.getSharingProfileAttributes=function(e){var r={token:t.getCurrentToken()};return n({cache:a.schema,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/schema/sharingProfileAttributes",params:r})},r.getConnectionGroupAttributes=function(e){var r={token:t.getCurrentToken()};return n({cache:a.schema,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/schema/connectionGroupAttributes",params:r})},r.getProtocols=function(e){var r={token:t.getCurrentToken()};return n({cache:a.schema,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/schema/protocols",params:r})},r}]),angular.module("element").factory("ScrollState",[function(){return function(e){e=e||{},this.left=e.left||0,this.top=e.top||0}}]),angular.module("form").controller("selectFieldController",["$scope","$injector",function(e,n){e.$watch("model",function(n){n||""===n||(e.model="")})}]),angular.module("storage").factory("sessionStorageFactory",["$injector",function(e){var n=e.get("$rootScope"),t=e.get("authenticationService"),a={};return a.create=function(e,a){var r,o=!!t.getCurrentToken();r="function"==typeof e?e:function(){return angular.copy(e)};var i=void 0;return n.$on("guacLogin",function(){o=!0,i=void 0}),n.$on("guacLogout",function(){angular.isDefined(i)&&a&&a(i),o=!1,i=void 0}),function(e){return o?(angular.isDefined(e)&&(i=e),angular.isDefined(i)||(i=r()),i):angular.isDefined(e)?e:r()}},a}]),angular.module("manage").controller("settingsController",["$scope","$injector",function(e,n){var t=n.get("$routeParams"),a=n.get("userPageService");e.settingsPages=null,e.activeTab=t.tab,a.getSettingsPages().then(function(n){e.settingsPages=n})}]),angular.module("settings",["groupList","list","navigation","notification","rest","storage"]),angular.module("rest").factory("SharingProfile",[function(){return function(e){e=e||{},this.identifier=e.identifier,this.primaryConnectionIdentifier=e.primaryConnectionIdentifier,this.name=e.name,this.parameters=e.parameters,this.attributes=e.attributes||{}}}]),angular.module("rest").factory("sharingProfileService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r={};return r.getSharingProfile=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.connections,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/sharingProfiles/"+encodeURIComponent(r),params:o})},r.getSharingProfileParameters=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.connections,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/sharingProfiles/"+encodeURIComponent(r)+"/parameters",params:o})},r.saveSharingProfile=function(e,r){var o={token:t.getCurrentToken()};return r.identifier?n({method:"PUT",url:"api/session/data/"+encodeURIComponent(e)+"/sharingProfiles/"+encodeURIComponent(r.identifier),params:o,data:r}).then(function(){a.connections.removeAll(),a.users.removeAll()}):n({method:"POST",url:"api/session/data/"+encodeURIComponent(e)+"/sharingProfiles",params:o,data:r}).then(function(e){r.identifier=e.identifier,a.connections.removeAll(),a.users.removeAll()})},r.deleteSharingProfile=function(e,r){var o={token:t.getCurrentToken()};return n({method:"DELETE",url:"api/session/data/"+encodeURIComponent(e)+"/sharingProfiles/"+encodeURIComponent(r.identifier),params:o}).then(function(){a.connections.removeAll()})},r}]),angular.module("list").factory("SortOrder",[function(){return function(e){var n=this;this.predicate=e,this.primary=e[0],this.descending=!1,"-"===this.primary.charAt(0)&&(this.primary=this.primary.substring(1),this.descending=!0),this.reorder=function(e,t){var a=e,r="-"+e;n.predicate=n.predicate.filter(function(e){return e!==a&&e!==r}),t?n.predicate.unshift(r):n.predicate.unshift(a),n.primary=e,n.descending=!!t},this.isSortedBy=function(e){return n.primary===e},this.togglePrimary=function(e){n.isSortedBy(e)?n.reorder(e,!n.descending):n.reorder(e,!1)}}}]),angular.module("storage",["auth"]),angular.module("manage").directive("systemPermissionEditor",["$injector",function(e){var n=e.get("authenticationService"),t=e.get("dataSourceService"),a=e.get("permissionService"),r=e.get("requestService"),o=e.get("PermissionSet"),i={restrict:"E",replace:!0,scope:{dataSource:"=",username:"=",permissionFlags:"=",permissionsAdded:"=",permissionsRemoved:"="},templateUrl:"app/manage/templates/systemPermissionEditor.html"};return i.controller=["$scope",function(e){var i=n.getAvailableDataSources(),s=n.getCurrentUsername();e.systemPermissionTypes=[{label:"MANAGE_USER.FIELD_HEADER_ADMINISTER_SYSTEM",value:o.SystemPermissionType.ADMINISTER},{label:"MANAGE_USER.FIELD_HEADER_CREATE_NEW_USERS",value:o.SystemPermissionType.CREATE_USER},{label:"MANAGE_USER.FIELD_HEADER_CREATE_NEW_USER_GROUPS",value:o.SystemPermissionType.CREATE_USER_GROUP},{label:"MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTIONS",value:o.SystemPermissionType.CREATE_CONNECTION},{label:"MANAGE_USER.FIELD_HEADER_CREATE_NEW_CONNECTION_GROUPS",value:o.SystemPermissionType.CREATE_CONNECTION_GROUP},{label:"MANAGE_USER.FIELD_HEADER_CREATE_NEW_SHARING_PROFILES",value:o.SystemPermissionType.CREATE_SHARING_PROFILE}],t.apply(a.getEffectivePermissions,i,s).then(function(n){e.permissions=n},r.DIE),e.canChangeSystemPermissions=function(){return!!e.permissions&&o.hasSystemPermission(e.permissions[e.dataSource],o.SystemPermissionType.ADMINISTER)};var c=function(n){o.hasSystemPermission(e.permissionsRemoved,n)?o.removeSystemPermission(e.permissionsRemoved,n):o.addSystemPermission(e.permissionsAdded,n)},l=function(n){o.hasSystemPermission(e.permissionsAdded,n)?o.removeSystemPermission(e.permissionsAdded,n):o.addSystemPermission(e.permissionsRemoved,n)};e.systemPermissionChanged=function(n){e.permissionFlags.systemPermissions[n]?c(n):l(n)};var u=function(n,t){o.hasUserPermission(e.permissionsRemoved,n,t)?o.removeUserPermission(e.permissionsRemoved,n,t):o.addUserPermission(e.permissionsAdded,n,t)},m=function(n,t){o.hasUserPermission(e.permissionsAdded,n,t)?o.removeUserPermission(e.permissionsAdded,n,t):o.addUserPermission(e.permissionsRemoved,n,t)};e.userPermissionChanged=function(n,t){e.permissionFlags.userPermissions[n][t]?u(n,t):m(n,t)}}],i}]),angular.module("index").config(["$provide",function(e){var n={};e.decorator("$templateCache",["$delegate",function(e){var t=angular.extend({},e);return t.put=function(t){return delete n[t],e.put.apply(this,arguments)},t}]),e.decorator("$templateRequest",["$delegate","$injector",function(e,t){var a=t.get("$q"),r=t.get("patchService"),o=function e(n,t){this.apply=function(a,r){e.Operations[n](a,t,r)}};o.Operations={before:function(e,n,t){e.find(n).before(t)},after:function(e,n,t){e.find(n).after(t)},replace:function(e,n,t){e.find(n).replaceWith(t)},"before-children":function(e,n,t){e.find(n).prepend(t)},"after-children":function(e,n,t){e.find(n).append(t)},"replace-children":function(e,n,t){e.find(n).empty().append(t)}};var i=function(e,n){angular.forEach(n,function(n){var t=$(n),a=[];t=t.filter(function(e,n){if("META"!==n.tagName)return!0;var t=n.getAttribute("name");if(!(t&&t in o.Operations))return!0;var r=n.getAttribute("content");return!r||(a.push(new o(t,r)),!1)}),angular.forEach(a,function(n){n.apply(e,t)})})};return function(t){var o=a.defer(),s=n[t];return s?(s.then(o.resolve,o.reject),o.promise):(e.apply(this,arguments).then(function(e){r.getPatches().then(function(n){var t=$("<div></div>").html(e);i(t,n),o.resolve.call(this,t.html())},o.reject)},o.reject),n[t]=o.promise,o.promise)}}])}]),angular.module("templates-main",["app/client/templates/client.html","app/client/templates/file.html","app/client/templates/guacClient.html","app/client/templates/guacFileBrowser.html","app/client/templates/guacFileTransfer.html","app/client/templates/guacFileTransferManager.html","app/client/templates/guacThumbnail.html","app/client/templates/guacViewport.html","app/clipboard/templates/guacClipboard.html","app/element/templates/blank.html","app/form/templates/checkboxField.html","app/form/templates/dateField.html","app/form/templates/emailField.html","app/form/templates/form.html","app/form/templates/formField.html","app/form/templates/guacInputColor.html","app/form/templates/languageField.html","app/form/templates/numberField.html","app/form/templates/passwordField.html","app/form/templates/selectField.html","app/form/templates/terminalColorSchemeField.html","app/form/templates/textAreaField.html","app/form/templates/textField.html","app/form/templates/timeField.html","app/form/templates/timeZoneField.html","app/groupList/templates/guacGroupList.html","app/groupList/templates/guacGroupListFilter.html","app/home/templates/connection.html","app/home/templates/connectionGroup.html","app/home/templates/guacRecentConnections.html","app/home/templates/home.html","app/list/templates/guacFilter.html","app/list/templates/guacPager.html","app/list/templates/guacUserItem.html","app/login/templates/login.html","app/manage/templates/connectionGroupPermission.html","app/manage/templates/connectionPermission.html","app/manage/templates/connectionPermissionEditor.html","app/manage/templates/dataSourceTabs.html","app/manage/templates/identifierSetEditor.html","app/manage/templates/locationChooser.html","app/manage/templates/locationChooserConnectionGroup.html","app/manage/templates/manageConnection.html","app/manage/templates/manageConnectionGroup.html","app/manage/templates/manageSharingProfile.html","app/manage/templates/manageUser.html","app/manage/templates/manageUserGroup.html","app/manage/templates/managementButtons.html","app/manage/templates/sharingProfilePermission.html","app/manage/templates/systemPermissionEditor.html","app/navigation/templates/guacMenu.html","app/navigation/templates/guacPageList.html","app/navigation/templates/guacSectionTabs.html","app/navigation/templates/guacUserMenu.html","app/notification/templates/guacNotification.html","app/osk/templates/guacOsk.html","app/settings/templates/connection.html","app/settings/templates/connectionGroup.html","app/settings/templates/newConnection.html","app/settings/templates/newConnectionGroup.html","app/settings/templates/newSharingProfile.html","app/settings/templates/settings.html","app/settings/templates/settingsConnectionHistory.html","app/settings/templates/settingsConnections.html","app/settings/templates/settingsPreferences.html","app/settings/templates/settingsSessions.html","app/settings/templates/settingsUserGroups.html","app/settings/templates/settingsUsers.html","app/settings/templates/sharingProfile.html","app/textInput/templates/guacKey.html","app/textInput/templates/guacTextInput.html"]),angular.module("app/client/templates/client.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/client.html",'\n<guac-viewport>\n\n \x3c!-- Client view --\x3e\n <div class="client-view">\n <div class="client-view-content">\n\n \x3c!-- Central portion of view --\x3e\n <div class="client-body" guac-touch-drag="clientDrag" guac-touch-pinch="clientPinch">\n\n \x3c!-- Client --\x3e\n <guac-client client="client"></guac-client>\n\n </div>\n\n \x3c!-- Bottom portion of view --\x3e\n <div class="client-bottom">\n\n \x3c!-- Text input --\x3e\n <div class="text-input-container" ng-show="showTextInput">\n <guac-text-input needs-focus="showTextInput"></guac-text-input>\n </div>\n\n \x3c!-- On-screen keyboard --\x3e\n <div class="keyboard-container" ng-show="showOSK">\n <guac-osk layout="\'CLIENT.URL_OSK_LAYOUT\' | translate"></guac-osk>\n </div>\n\n </div>\n\n </div>\n </div>\n\n \x3c!-- File transfers --\x3e\n <div id="file-transfer-dialog" ng-show="hasTransfers()">\n <guac-file-transfer-manager client="client"></guac-file-transfer-manager>\n </div>\n\n \x3c!-- Connection stability warning --\x3e\n <div id="connection-warning" ng-show="isConnectionUnstable()">\n {{\'CLIENT.TEXT_CLIENT_STATUS_UNSTABLE\' | translate}}\n </div>\n\n \x3c!-- Menu --\x3e\n <div class="menu" ng-class="{open: menu.shown}" id="guac-menu">\n <div class="menu-content" ng-if="menu.shown">\n\n \x3c!-- Stationary header --\x3e\n <div class="header">\n <h2>{{client.name}}</h2>\n <div class="share-menu" ng-show="canShareConnection()">\n <guac-menu menu-title="\'CLIENT.ACTION_SHARE\' | translate">\n <ul ng-repeat="sharingProfile in sharingProfiles">\n <li><a ng-click="share(sharingProfile)">{{sharingProfile.name}}</a></li>\n </ul>\n </guac-menu>\n </div>\n <guac-user-menu local-actions="clientMenuActions"></guac-user-menu>\n </div>\n\n \x3c!-- Scrollable body --\x3e\n <div class="menu-body" guac-touch-drag="menuDrag" guac-scroll="menu.scrollState">\n\n \x3c!-- Connection sharing --\x3e\n <div class="menu-section" id="share-links" ng-show="isShared()">\n <div class="content">\n <h3>{{\'CLIENT.INFO_CONNECTION_SHARED\' | translate}}</h3>\n <p class="description"\n translate="CLIENT.HELP_SHARE_LINK"\n translate-values="{LINKS : getShareLinkCount()}"></p>\n <table>\n <tr ng-repeat="link in client.shareLinks | toArray | orderBy: value.name">\n <th>{{link.value.name}}</th>\n <td><a href="{{link.value.href}}" target="_blank">{{link.value.href}}</a></td>\n </tr>\n </table>\n </div>\n </div>\n\n \x3c!-- Clipboard --\x3e\n <div class="menu-section" id="clipboard-settings">\n <h3>{{\'CLIENT.SECTION_HEADER_CLIPBOARD\' | translate}}</h3>\n <div class="content">\n <p class="description">{{\'CLIENT.HELP_CLIPBOARD\' | translate}}</p>\n <guac-clipboard data="client.clipboardData"></guac-clipboard>\n </div>\n </div>\n\n \x3c!-- Devices --\x3e\n <div class="menu-section" id="devices" ng-show="client.filesystems.length">\n <h3>{{\'CLIENT.SECTION_HEADER_DEVICES\' | translate}}</h3>\n <div class="content">\n <div class="device filesystem" ng-repeat="filesystem in client.filesystems" ng-click="showFilesystemMenu(filesystem)">\n {{filesystem.name}}\n </div>\n </div>\n </div>\n\n \x3c!-- Connection parameters which may be modified while the connection is open --\x3e\n <div class="menu-section connection-parameters" id="connection-settings" ng-show="client.protocol">\n <guac-form namespace="getProtocolNamespace(client.protocol)"\n content="client.forms"\n model="menu.connectionParameters"\n model-only="true"></guac-form>\n </div>\n\n \x3c!-- Input method --\x3e\n <div class="menu-section" id="keyboard-settings">\n <h3>{{\'CLIENT.SECTION_HEADER_INPUT_METHOD\' | translate}}</h3>\n <div class="content">\n\n \x3c!-- No IME --\x3e\n <div class="choice">\n <label><input id="ime-none" name="input-method" ng-change="closeMenu()" ng-model="menu.inputMethod" type="radio" value="none"/> {{\'CLIENT.NAME_INPUT_METHOD_NONE\' | translate}}</label>\n <p class="caption"><label for="ime-none">{{\'CLIENT.HELP_INPUT_METHOD_NONE\' | translate}}</label></p>\n </div>\n\n \x3c!-- Text input --\x3e\n <div class="choice">\n <div class="figure"><label for="ime-text"><img src="images/settings/tablet-keys.png" alt=""/></label></div>\n <label><input id="ime-text" name="input-method" ng-change="closeMenu()" ng-model="menu.inputMethod" type="radio" value="text"/> {{\'CLIENT.NAME_INPUT_METHOD_TEXT\' | translate}}</label>\n <p class="caption"><label for="ime-text">{{\'CLIENT.HELP_INPUT_METHOD_TEXT\' | translate}} </label></p>\n </div>\n\n \x3c!-- Guac OSK --\x3e\n <div class="choice">\n <label><input id="ime-osk" name="input-method" ng-change="closeMenu()" ng-model="menu.inputMethod" type="radio" value="osk"/> {{\'CLIENT.NAME_INPUT_METHOD_OSK\' | translate}}</label>\n <p class="caption"><label for="ime-osk">{{\'CLIENT.HELP_INPUT_METHOD_OSK\' | translate}}</label></p>\n </div>\n\n </div>\n </div>\n\n \x3c!-- Mouse mode --\x3e\n <div class="menu-section" id="mouse-settings">\n <h3>{{\'CLIENT.SECTION_HEADER_MOUSE_MODE\' | translate}}</h3>\n <div class="content">\n <p class="description">{{\'CLIENT.HELP_MOUSE_MODE\' | translate}}</p>\n\n \x3c!-- Touchscreen --\x3e\n <div class="choice">\n <input name="mouse-mode" ng-change="closeMenu()" ng-model="client.clientProperties.emulateAbsoluteMouse" type="radio" ng-value="true" checked="checked" id="absolute"/>\n <div class="figure">\n <label for="absolute"><img src="images/settings/touchscreen.png" alt="{{\'CLIENT.NAME_MOUSE_MODE_ABSOLUTE\' | translate}}"/></label>\n <p class="caption"><label for="absolute">{{\'CLIENT.HELP_MOUSE_MODE_ABSOLUTE\' | translate}}</label></p>\n </div>\n </div>\n\n \x3c!-- Touchpad --\x3e\n <div class="choice">\n <input name="mouse-mode" ng-change="closeMenu()" ng-model="client.clientProperties.emulateAbsoluteMouse" type="radio" ng-value="false" id="relative"/>\n <div class="figure">\n <label for="relative"><img src="images/settings/touchpad.png" alt="{{\'CLIENT.NAME_MOUSE_MODE_RELATIVE\' | translate}}"/></label>\n <p class="caption"><label for="relative">{{\'CLIENT.HELP_MOUSE_MODE_RELATIVE\' | translate}}</label></p>\n </div>\n </div>\n\n </div>\n </div>\n\n \x3c!-- Display options --\x3e\n <div class="menu-section" id="display-settings">\n <h3>{{\'CLIENT.SECTION_HEADER_DISPLAY\' | translate}}</h3>\n <div class="content">\n <div id="zoom-settings">\n <div ng-click="zoomOut()" id="zoom-out"><img src="images/settings/zoom-out.png" alt="-"/></div>\n <div class="zoom-ctrl">\n <input type="number" class="zoom-ctrl" guac-zoom-ctrl\n ng-model="client.clientProperties.scale"\n ng-model-options="{ updateOn: \'blur submit\' }"\n ng-change="zoomSet()" />%\n </div>\n <div ng-click="zoomIn()" id="zoom-in"><img src="images/settings/zoom-in.png" alt="+"/></div>\n </div>\n <div><label><input ng-model="menu.autoFit" ng-change="changeAutoFit()" ng-disabled="autoFitDisabled()" type="checkbox" id="auto-fit"/> {{\'CLIENT.TEXT_ZOOM_AUTO_FIT\' | translate}}</label></div>\n </div>\n </div>\n\n </div>\n\n </div>\n </div>\n\n \x3c!-- Filesystem menu --\x3e\n <div id="filesystem-menu" class="menu" ng-class="{open: isFilesystemMenuShown()}">\n <div class="menu-content">\n\n \x3c!-- Stationary header --\x3e\n <div class="header">\n <h2>{{filesystemMenuContents.name}}</h2>\n <button class="upload button" guac-upload="uploadFiles">{{\'CLIENT.ACTION_UPLOAD_FILES\' | translate}}</button>\n <button class="back" ng-click="hideFilesystemMenu()">{{\'CLIENT.ACTION_NAVIGATE_BACK\' | translate}}</button>\n </div>\n\n \x3c!-- Breadcrumbs --\x3e\n <div class="header breadcrumbs"><div\n class="breadcrumb root"\n ng-click="changeDirectory(filesystemMenuContents, filesystemMenuContents.root)"></div><div\n class="breadcrumb"\n ng-repeat="file in getPath(filesystemMenuContents.currentDirectory)"\n ng-click="changeDirectory(filesystemMenuContents, file)">{{file.name}}</div>\n </div>\n\n \x3c!-- Scrollable body --\x3e\n <div class="menu-body">\n <guac-file-browser client="client" filesystem="filesystemMenuContents"></guac-file-browser>\n </div>\n\n </div>\n </div>\n\n</guac-viewport>')}]),angular.module("app/client/templates/file.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/file.html",'<div class="list-item">\n\n \x3c!-- Filename and icon --\x3e\n <div class="caption">\n <div class="icon"></div>\n {{::name}}\n </div>\n\n</div>')}]),angular.module("app/client/templates/guacClient.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/guacClient.html",'<div class="main" guac-resize="mainElementResized">\n\n \x3c!-- Display --\x3e\n <div class="displayOuter">\n\n <div class="displayMiddle">\n <div class="display software-cursor">\n </div>\n </div>\n\n </div>\n\n</div>')}]),angular.module("app/client/templates/guacFileBrowser.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/guacFileBrowser.html",'<div class="file-browser">\n\n \x3c!-- Current directory contents --\x3e\n <div class="current-directory-contents"></div>\n\n</div>')}]),angular.module("app/client/templates/guacFileTransfer.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/guacFileTransfer.html",'<div class="transfer" ng-class="{\'in-progress\': isInProgress(), \'savable\': isSavable(), \'error\': hasError()}" ng-click="save()">\n\n \x3c!-- Overall status of transfer --\x3e\n <div class="transfer-status">\n\n \x3c!-- Filename and progress bar --\x3e\n <div class="filename">\n <div class="progress"><div ng-style="{\'width\': getPercentDone() + \'%\'}" class="bar"></div></div>\n {{transfer.filename}}\n </div>\n\n \x3c!-- Error text --\x3e\n <p class="error-text">{{getErrorText() | translate}}</p>\n\n </div>\n\n \x3c!-- Progress/status text --\x3e\n <div class="text"\n translate="CLIENT.TEXT_FILE_TRANSFER_PROGRESS"\n translate-values="{PROGRESS: getProgressValue(), UNIT: getProgressUnit()}"></div>\n\n</div>')}]),angular.module("app/client/templates/guacFileTransferManager.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/guacFileTransferManager.html",'<div class="transfer-manager">\n\n \x3c!-- File transfer manager header --\x3e\n <div class="header">\n <h2>{{\'CLIENT.SECTION_HEADER_FILE_TRANSFERS\' | translate}}</h2>\n <button ng-click="clearCompletedTransfers()">{{\'CLIENT.ACTION_CLEAR_COMPLETED_TRANSFERS\' | translate}}</button>\n </div>\n\n \x3c!-- Sent/received files --\x3e\n <div class="transfer-manager-body">\n <div class="transfers">\n <guac-file-transfer\n transfer="upload"\n ng-repeat="upload in client.uploads">\n </guac-file-transfer><guac-file-transfer\n transfer="download"\n ng-repeat="download in client.downloads">\n </guac-file-transfer>\n </div>\n </div>\n\n</div>')}]),angular.module("app/client/templates/guacThumbnail.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/guacThumbnail.html",'<div class="thumbnail-main" guac-resize="updateDisplayScale">\n\n \x3c!-- Display --\x3e\n <div class="display">\n </div>\n\n \x3c!-- Dummy background thumbnail --\x3e\n <img alt="" ng-src="{{thumbnail}}"/>\n\n</div>')}]),angular.module("app/client/templates/guacViewport.html",[]).run(["$templateCache",function(e){e.put("app/client/templates/guacViewport.html",'<div class="viewport" ng-transclude>\n</div>')}]),angular.module("app/clipboard/templates/guacClipboard.html",[]).run(["$templateCache",function(e){e.put("app/clipboard/templates/guacClipboard.html",'<textarea class="clipboard"></textarea>')}]),angular.module("app/element/templates/blank.html",[]).run(["$templateCache",function(e){e.put("app/element/templates/blank.html",'<!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n <title>_</title>\n </head>\n <body></body>\n</html>')}]),angular.module("app/form/templates/checkboxField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/checkboxField.html",'<input type="checkbox"\n ng-attr-id="{{ fieldId }}"\n ng-model="typedValue"\n autocorrect="off"\n autocapitalize="off"/>')}]),angular.module("app/form/templates/dateField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/dateField.html",'<div class="date-field">\n <input type="date"\n ng-attr-id="{{ fieldId }}"\n ng-model="typedValue"\n ng-model-options="modelOptions"\n guac-lenient-date\n placeholder="{{\'FORM.FIELD_PLACEHOLDER_DATE\' | translate}}"\n autocorrect="off"\n autocapitalize="off"/>\n</div>')}]),angular.module("app/form/templates/emailField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/emailField.html",'<div class="email-field">\n <input type="email"\n ng-attr-id="{{ fieldId }}"\n ng-model="model"\n ng-hide="readOnly"\n autocorrect="off"\n autocapitalize="off"/>\n <a href="mailto:{{model}}" ng-show="readOnly">{{model}}</a>\n</div>')}]),angular.module("app/form/templates/form.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/form.html",'<div class="form-group">\n <div ng-repeat="form in forms" class="form"\n ng-show="containsVisible(form.fields)">\n\n \x3c!-- Form name --\x3e\n <h3 ng-show="form.name">{{getSectionHeader(form) | translate}}</h3>\n\n \x3c!-- All fields in form --\x3e\n <div class="fields">\n <guac-form-field ng-repeat="field in form.fields" namespace="namespace"\n ng-if="isVisible(field)"\n field="field" model="values[field.name]"></guac-form-field>\n </div>\n\n </div>\n</div>')}]),angular.module("app/form/templates/formField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/formField.html",'<div class="labeled-field" ng-class="{empty: !model}" ng-show="isFieldVisible()">\n\n \x3c!-- Field header --\x3e\n <div class="field-header">\n <label ng-attr-for="{{ fieldId }}">{{getFieldHeader() | translate}}</label>\n </div>\n\n \x3c!-- Field content --\x3e\n <div class="form-field"></div>\n\n</div>')}]),angular.module("app/form/templates/guacInputColor.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/guacInputColor.html",'<div class="guac-input-color"\n ng-class="{\n \'dark\' : isDark(),\n \'read-only\' : !isColorPickerAvailable()\n }"\n ng-click="selectColor()"\n ng-style="{\n \'background-color\' : model\n }">\n <ng-transclude></ng-transclude>\n</div>')}]),angular.module("app/form/templates/languageField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/languageField.html",'<select ng-attr-id="{{ fieldId }}"\n ng-model="model"\n ng-options="language.key as language.value for language in languages | toArray | orderBy: key"></select>')}]),angular.module("app/form/templates/numberField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/numberField.html",'<input type="number"\n ng-attr-id="{{ fieldId }}"\n ng-model="typedValue"\n autocorrect="off"\n autocapitalize="off"/>')}]),angular.module("app/form/templates/passwordField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/passwordField.html",'<div class="password-field">\n <input type="{{passwordInputType}}"\n ng-attr-id="{{ fieldId }}"\n ng-model="model"\n ng-trim="false"\n autocorrect="off"\n autocapitalize="off"/>\n <div class="icon toggle-password" ng-click="togglePassword()" title="{{getTogglePasswordHelpText() | translate}}"></div>\n</div>')}]),angular.module("app/form/templates/selectField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/selectField.html",'<select ng-attr-id="{{ fieldId }}"\n ng-model="model"\n ng-options="option as getFieldOption(option) | translate for option in field.options | orderBy: value"></select>')}]),angular.module("app/form/templates/terminalColorSchemeField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/terminalColorSchemeField.html",'<div class="terminal-color-scheme-field" ng-class="{\n \'custom-color-scheme-details-visible\' : detailsShown,\n \'custom-color-scheme-details-hidden\' : !detailsShown\n }">\n\n \x3c!-- Pre-defined color scheme options --\x3e\n <select ng-attr-id="{{ fieldId }}" ng-model="selectedColorScheme">\n <option ng-repeat="option in field.options | orderBy: value"\n ng-value="option">{{ getFieldOption(option) | translate }}</option>\n <option value="custom">{{ \'COLOR_SCHEME.FIELD_OPTION_CUSTOM\' | translate }}</option>\n </select>\n\n \x3c!-- Custom color scheme --\x3e\n <div class="custom-color-scheme" ng-show="isCustom()">\n\n \x3c!-- Default foreground color --\x3e\n <div class="custom-color-scheme-section default-color foreground">\n <guac-input-color model="customColorScheme.foreground"\n palette="defaultPalette">\n {{ \'COLOR_SCHEME.FIELD_HEADER_FOREGROUND\' | translate }}\n </guac-input-color>\n </div>\n\n \x3c!-- Default background color --\x3e\n <div class="custom-color-scheme-section default-color background">\n <guac-input-color model="customColorScheme.background"\n palette="defaultPalette">\n {{ \'COLOR_SCHEME.FIELD_HEADER_BACKGROUND\' | translate }}\n </guac-input-color>\n </div>\n\n \x3c!-- Low intensity portion of 16-color palette --\x3e\n <div class="custom-color-scheme-section palette low-intensity">\n <guac-input-color ng-repeat="index in lowIntensity"\n model="customColorScheme.colors[index]"\n palette="defaultPalette">\n {{ index }}\n </guac-input-color>\n </div>\n\n \x3c!-- High intensity portion of 16-color palette --\x3e\n <div class="custom-color-scheme-section palette high-intensity">\n <guac-input-color ng-repeat="index in highIntensity"\n model="customColorScheme.colors[index]"\n palette="defaultPalette">\n {{ index }}\n </guac-input-color>\n </div>\n\n </div>\n\n \x3c!-- Show/hide details --\x3e\n <h4 class="custom-color-scheme-details-header" ng-show="isCustom()">\n {{\'COLOR_SCHEME.SECTION_HEADER_DETAILS\' | translate}}\n <a class="custom-color-scheme-show-details" ng-click="showDetails()">{{\'COLOR_SCHEME.ACTION_SHOW_DETAILS\' | translate}}</a>\n <a class="custom-color-scheme-hide-details" ng-click="hideDetails()">{{\'COLOR_SCHEME.ACTION_HIDE_DETAILS\' | translate}}</a>\n </h4>\n\n \x3c!-- Custom color scheme details (internal representation --\x3e\n <textarea class="custom-color-scheme-details" spellcheck="false"\n ng-model="model" ng-show="isCustom()"></textarea>\n\n</div>')}]),angular.module("app/form/templates/textAreaField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/textAreaField.html",'<textarea ng-attr-id="{{ fieldId }}"\n ng-model="model"\n autocorrect="off"\n autocapitalize="off"></textarea>')}]),angular.module("app/form/templates/textField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/textField.html",'<div class="text-field">\n <input type="text"\n ng-attr-id="{{ fieldId }}"\n ng-attr-list="{{ dataListId }}"\n ng-model="model"\n autocorrect="off"\n autocapitalize="off"/>\n <datalist ng-if="dataListId" ng-attr-id="{{ dataListId }}">\n <option ng-repeat="option in field.options | orderBy: option"\n value="{{ option }}">{{ getFieldOption(option) | translate }}</option>\n </datalist>\n</div>')}]),angular.module("app/form/templates/timeField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/timeField.html",'<div class="time-field">\n <input type="time"\n ng-attr-id="{{ fieldId }}"\n ng-model="typedValue"\n ng-model-options="modelOptions"\n guac-lenient-time\n placeholder="{{\'FORM.FIELD_PLACEHOLDER_TIME\' | translate}}"\n autocorrect="off"\n autocapitalize="off"/>\n</div>')}]),angular.module("app/form/templates/timeZoneField.html",[]).run(["$templateCache",function(e){e.put("app/form/templates/timeZoneField.html",'<div class="time-zone-field">\n\n \x3c!-- Available time zone regions --\x3e\n <select class="time-zone-region"\n ng-attr-id="{{ fieldId }}"\n ng-model="region"\n ng-options="name for name in regions | orderBy: name"></select>\n\n \x3c!-- Time zones within selected region --\x3e\n <select class="time-zone"\n ng-disabled="!region"\n ng-model="model"\n ng-options="timeZone.value as timeZone.key for timeZone in timeZones[region] | toArray | orderBy: key"></select>\n\n</div>')}]),angular.module("app/groupList/templates/guacGroupList.html",[]).run(["$templateCache",function(e){e.put("app/groupList/templates/guacGroupList.html",'<div class="group-list">\n\n <script type="text/ng-template" id="nestedItem.html">\n <div class="{{item.type}}" ng-if="isVisible(item.type)"\n ng-class="{\n expanded : item.expanded,\n expandable : item.expandable,\n empty : !item.children.length\n }">\n\n \x3c!-- Item caption --\x3e\n <div class="caption">\n\n \x3c!-- Expand/collapse icon --\x3e\n <div class="icon expand" ng-click="toggleExpanded(item)"\n ng-if="item.expandable"></div>\n\n <ng-include src="templates[item.type]"/>\n\n </div>\n\n \x3c!-- Children of item (if any) --\x3e\n <div class="children" ng-if="item.expanded">\n <div class="list-item" ng-repeat="item in item.children | orderBy : \'name\'"\n ng-include="\'nestedItem.html\'"></div>\n </div>\n\n </div>\n <\/script>\n\n \x3c!-- Root-level connections / groups --\x3e\n <div class="group-list-page">\n <div class="list-item" ng-repeat="item in childrenPage" ng-include="\'nestedItem.html\'"></div>\n </div>\n\n \x3c!-- Pager for connections / groups --\x3e\n <guac-pager page="childrenPage" items="rootItems | orderBy : [\'weight\', \'name\']"\n page-size="pageSize"></guac-pager>\n\n</div>')}]),angular.module("app/groupList/templates/guacGroupListFilter.html",[]).run(["$templateCache",function(e){e.put("app/groupList/templates/guacGroupListFilter.html",'<div class="group-list-filter filter">\n\n \x3c!-- Filter string --\x3e\n <input class="search-string" placeholder="{{placeholder()}}" type="text" ng-model="searchString"/>\n\n</div>')}]),angular.module("app/home/templates/connection.html",[]).run(["$templateCache",function(e){e.put("app/home/templates/connection.html",'<a class="home-connection"\n ng-href="#/client/{{context.getClientIdentifier(item)}}"\n ng-class="{active: item.getActiveConnections()}">\n\n \x3c!-- Connection icon --\x3e\n <div class="icon type" ng-class="item.protocol"></div>\n\n \x3c!-- Connection name --\x3e\n <span class="name">{{item.name}}</span>\n\n \x3c!-- Active user count --\x3e\n <span class="activeUserCount" ng-show="item.getActiveConnections()"\n translate="HOME.INFO_ACTIVE_USER_COUNT"\n translate-values="{USERS: item.getActiveConnections()}"></span>\n\n</a>')}]),angular.module("app/home/templates/connectionGroup.html",[]).run(["$templateCache",function(e){e.put("app/home/templates/connectionGroup.html",'<span class="home-connection-group name">\n <a ng-show="item.balancing" ng-href="#/client/{{context.getClientIdentifier(item)}}">{{item.name}}</a>\n <span ng-show="!item.balancing">{{item.name}}</span>\n</span>')}]),angular.module("app/home/templates/guacRecentConnections.html",[]).run(["$templateCache",function(e){e.put("app/home/templates/guacRecentConnections.html",'<div>\n\n \x3c!-- Text displayed if no recent connections exist --\x3e\n <p class="placeholder" ng-hide="hasRecentConnections()">{{\'HOME.INFO_NO_RECENT_CONNECTIONS\' | translate}}</p>\n\n \x3c!-- All active connections --\x3e\n <div ng-repeat="activeConnection in activeConnections" class="connection">\n <a href="#/client/{{activeConnection.client.id}}">\n\n \x3c!-- Connection thumbnail --\x3e\n <div class="thumbnail">\n <guac-thumbnail client="activeConnection.client"></guac-thumbnail>\n </div>\n\n \x3c!-- Connection name --\x3e\n <div class="caption">\n <span class="name">{{activeConnection.name}}</span>\n </div>\n\n </a>\n </div>\n \n \x3c!-- All recent connections --\x3e\n <div ng-repeat="recentConnection in recentConnections" class="connection">\n <a href="#/client/{{recentConnection.entry.id}}">\n\n \x3c!-- Connection thumbnail --\x3e\n <div class="thumbnail">\n <img alt="{{recentConnection.name}}" ng-src="{{recentConnection.entry.thumbnail}}"/>\n </div>\n\n \x3c!-- Connection name --\x3e\n <div class="caption">\n <span class="name">{{recentConnection.name}}</span>\n </div>\n\n </a>\n </div>\n\n</div>')}]),angular.module("app/home/templates/home.html",[]).run(["$templateCache",function(e){e.put("app/home/templates/home.html",'\n<div class="view" ng-class="{loading: !isLoaded()}">\n\n <div class="connection-list-ui">\n\n \x3c!-- The recent connections for this user --\x3e\n <div class="header">\n <h2>{{\'HOME.SECTION_HEADER_RECENT_CONNECTIONS\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n <div class="recent-connections">\n <guac-recent-connections root-groups="rootConnectionGroups"></guac-recent-connections>\n </div>\n\n \x3c!-- All connections for this user --\x3e\n <div class="header">\n <h2>{{\'HOME.SECTION_HEADER_ALL_CONNECTIONS\' | translate}}</h2>\n <guac-group-list-filter connection-groups="rootConnectionGroups"\n filtered-connection-groups="filteredRootConnectionGroups"\n placeholder="\'HOME.FIELD_PLACEHOLDER_FILTER\' | translate"\n connection-properties="filteredConnectionProperties"\n connection-group-properties="filteredConnectionGroupProperties"></guac-group-list-filter>\n </div>\n <div class="all-connections">\n <guac-group-list\n context="context"\n connection-groups="filteredRootConnectionGroups"\n templates="{\n'+" 'connection' : 'app/home/templates/connection.html',\n 'connection-group' : 'app/home/templates/connectionGroup.html'\n }\"\n page-size=\"20\"></guac-group-list>\n </div>\n\n </div>\n\n</div>")}]),angular.module("app/list/templates/guacFilter.html",[]).run(["$templateCache",function(e){e.put("app/list/templates/guacFilter.html",'<div class="filter">\n\n \x3c!-- Filter string --\x3e\n <input class="search-string" placeholder="{{placeholder()}}" type="text" ng-model="searchString"/>\n\n</div>')}]),angular.module("app/list/templates/guacPager.html",[]).run(["$templateCache",function(e){e.put("app/list/templates/guacPager.html",'<div class="pager" ng-show="pageNumbers.length > 1">\n\n \x3c!-- First / Previous --\x3e\n <div class="first-page icon" ng-class="{disabled: !canSelectPage(firstPage)}" ng-click="selectPage(firstPage)"/>\n <div class="prev-page icon" ng-class="{disabled: !canSelectPage(previousPage)}" ng-click="selectPage(previousPage)"/>\n\n \x3c!-- Indicator of the existence of pages before the first page number shown --\x3e\n <div class="more-pages" ng-show="hasMorePagesBefore()">...</div>\n \n \x3c!-- Page numbers --\x3e\n <ul class="page-numbers">\n <li class="set-page"\n ng-class="{current: isSelected(pageNumber)}"\n ng-repeat="pageNumber in pageNumbers"\n ng-click="selectPage(pageNumber)">{{pageNumber}}</li>\n </ul>\n\n \x3c!-- Indicator of the existence of pages beyond the last page number shown --\x3e\n <div class="more-pages" ng-show="hasMorePagesAfter()">...</div>\n\n \x3c!-- Next / Last --\x3e\n <div class="next-page icon" ng-class="{disabled: !canSelectPage(nextPage)}" ng-click="selectPage(nextPage)"/>\n <div class="last-page icon" ng-class="{disabled: !canSelectPage(lastPage)}" ng-click="selectPage(lastPage)"/>\n\n</div>')}]),angular.module("app/list/templates/guacUserItem.html",[]).run(["$templateCache",function(e){e.put("app/list/templates/guacUserItem.html",'<div class="user-item" ng-class="{\'anonymous\' : isAnonymous() }">\n <span class="username">{{displayName}}</span>\n</div>')}]),angular.module("app/login/templates/login.html",[]).run(["$templateCache",function(e){e.put("app/login/templates/login.html",'<div class="login-ui" ng-class="{error: loginError, continuation: isContinuation(), initial: !isContinuation()}" >\n\n \x3c!-- Login error message --\x3e\n <p class="login-error" translate="{{loginError.key}}"\n translate-values="{{loginError.variables}}"></p>\n\n <div class="login-dialog-middle">\n\n <div class="login-dialog">\n\n <form class="login-form" ng-submit="login()">\n\n \x3c!-- Guacamole version --\x3e\n <div class="logo"></div>\n <div class="version">\n <div class="app-name">{{\'APP.NAME\' | translate}}</div>\n <div class="version-number">{{\'APP.VERSION\' | translate}}</div>\n </div>\n\n \x3c!-- Login message/instructions --\x3e\n <p ng-show="helpText" translate="{{helpText.key}}"\n translate-values="{{helpText.variables}}"></p>\n\n \x3c!-- Login fields --\x3e\n <div class="login-fields">\n <guac-form namespace="\'LOGIN\'" content="remainingFields" model="enteredValues"></guac-form>\n </div>\n\n \x3c!-- Submit button --\x3e\n <div class="buttons">\n <input type="submit" name="login" class="login" value="{{\'LOGIN.ACTION_LOGIN\' | translate}}"/>\n <input type="submit" name="login" class="continue-login" value="{{\'LOGIN.ACTION_CONTINUE\' | translate}}"/>\n </div>\n\n </form>\n\n </div>\n\n </div>\n\n</div>')}]),angular.module("app/manage/templates/connectionGroupPermission.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/connectionGroupPermission.html",'<div class="choice">\n\n \x3c!-- Connection group icon --\x3e\n <div class="icon type"></div>\n\n \x3c!-- Permission checkbox --\x3e\n <input type="checkbox" ng-model="context.getPermissionFlags().connectionGroupPermissions.READ[item.identifier]"\n ng-change="context.connectionGroupPermissionChanged(item.identifier)"/>\n\n \x3c!-- Connection group name --\x3e\n <span class="name">{{item.name}}</span>\n\n</div>')}]),angular.module("app/manage/templates/connectionPermission.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/connectionPermission.html",'<div class="choice">\n\n \x3c!-- Connection icon --\x3e\n <div class="icon type" ng-class="item.protocol"></div>\n\n \x3c!-- Permission checkbox --\x3e\n <input type="checkbox" ng-model="context.getPermissionFlags().connectionPermissions.READ[item.identifier]"\n ng-change="context.connectionPermissionChanged(item.identifier)"/>\n\n \x3c!-- Connection name --\x3e\n <span class="name">{{item.name}}</span>\n\n</div>')}]),angular.module("app/manage/templates/connectionPermissionEditor.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/connectionPermissionEditor.html",'<div class="connection-permissions">\n <div class="header tabbed">\n <h2>{{\'MANAGE_USER.SECTION_HEADER_CONNECTIONS\' | translate}}</h2>\n <guac-group-list-filter connection-groups="getRootGroups()"\n filtered-connection-groups="filteredRootGroups"\n placeholder="\'MANAGE_USER.FIELD_PLACEHOLDER_FILTER\' | translate"\n connection-properties="filteredConnectionProperties"\n connection-group-properties="filteredConnectionGroupProperties"></guac-group-list-filter>\n </div>\n <guac-section-tabs namespace="MANAGE_USER" current="currentTab" tabs="tabs"></guac-section-tabs>\n <div class="section">\n <guac-group-list\n context="groupListContext"\n connection-groups="filteredRootGroups"\n templates="{\n'+" 'connection' : 'app/manage/templates/connectionPermission.html',\n 'sharing-profile' : 'app/manage/templates/sharingProfilePermission.html',\n 'connection-group' : 'app/manage/templates/connectionGroupPermission.html'\n }\"\n page-size=\"20\"></guac-group-list>\n </div>\n</div>")}]),angular.module("app/manage/templates/dataSourceTabs.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/dataSourceTabs.html",'<div class="page-tabs">\n <guac-page-list pages="pages"></guac-page-list>\n</div>')}]),angular.module("app/manage/templates/identifierSetEditor.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/identifierSetEditor.html",'<div class="related-objects" ng-hide="isEmpty()">\n <div class="header">\n <h2>{{ header | translate }}</h2>\n <div class="filter">\n <input class="search-string" type="text"\n placeholder="{{ \'SETTINGS_USERS.FIELD_PLACEHOLDER_FILTER\' | translate }}"\n ng-model="filterString"/>\n </div>\n </div>\n\n <div class="section">\n\n \x3c!-- Abbreviated list of only the currently selected objects --\x3e\n <div class="abbreviated-related-objects">\n <img src="images/arrows/right.png" alt="Expand" class="expand" ng-hide="expanded" ng-click="expand()"/>\n <img src="images/arrows/down.png" alt="Collapse" class="collapse" ng-show="expanded" ng-click="collapse()"/>\n <p ng-hide="identifiers.length" class="no-related-objects">{{ emptyPlaceholder | translate }}</p>\n <ul>\n <li ng-repeat="identifier in identifiers | filter: filterString">\n <label><img src="images/x-red.png" alt="Remove" class="remove"\n ng-click="removeIdentifier(identifier)"\n ng-show="isEditable[identifier]"/><span class="identifier">{{ identifier }}</span>\n </label>\n </li>\n </ul>\n </div>\n\n \x3c!-- Exhaustive, paginated list of all objects --\x3e\n <div class="all-related-objects" ng-show="expanded">\n <p ng-hide="identifiersAvailablePage.length" class="no-objects-available">{{ unavailablePlaceholder | translate }}</p>\n <ul>\n <li ng-repeat="identifier in identifiersAvailablePage">\n <label><input type="checkbox"\n ng-model="identifierFlags[identifier]"\n ng-change="identifierChanged(identifier)"/>\n <span class="identifier">{{ identifier }}</span>\n </label>\n </li>\n </ul>\n\n \x3c!-- Pager controls for user list --\x3e\n <guac-pager page="identifiersAvailablePage" page-size="25"\n items="identifiersAvailable | orderBy | filter: filterString"></guac-pager>\n </div>\n\n </div>\n</div>')}]),angular.module("app/manage/templates/locationChooser.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/locationChooser.html",'<div class="location-chooser">\n\n \x3c!-- Chosen group name --\x3e\n <div ng-click="toggleMenu()" class="location">{{chosenConnectionGroupName}}</div>\n\n \x3c!-- Dropdown hierarchical menu of groups --\x3e\n <div ng-show="menuOpen" class="dropdown">\n <guac-group-list\n context="groupListContext"\n show-root-group="true"\n connection-groups="rootGroups"\n templates="{\n \'connection-group\' : \'app/manage/templates/locationChooserConnectionGroup.html\'\n }"/>\n </div>\n\n</div>')}]),angular.module("app/manage/templates/locationChooserConnectionGroup.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/locationChooserConnectionGroup.html",'<span class="name" ng-click="context.chooseGroup(item.wrappedItem)">\n\n {{item.name}}\n</span>')}]),angular.module("app/manage/templates/manageConnection.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/manageConnection.html",'\n<div class="view" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- Main property editor --\x3e\n <div class="header">\n <h2>{{\'MANAGE_CONNECTION.SECTION_HEADER_EDIT_CONNECTION\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n <div class="section">\n <table class="properties">\n \n \x3c!-- Edit connection name --\x3e\n <tr>\n <th>{{\'MANAGE_CONNECTION.FIELD_HEADER_NAME\' | translate}}</th>\n \n <td><input type="text" ng-model="connection.name" autocorrect="off" autocapitalize="off"/></td>\n </tr>\n \n \x3c!-- Edit connection location --\x3e\n <tr>\n <th>{{\'MANAGE_CONNECTION.FIELD_HEADER_LOCATION\' | translate}}</th>\n \n <td>\n <location-chooser\n data-data-source="selectedDataSource" root-group="rootGroup"\n value="connection.parentIdentifier"></location-chooser>\n </td>\n </tr>\n \n \n \x3c!-- Edit connection protocol --\x3e\n <tr>\n <th>{{\'MANAGE_CONNECTION.FIELD_HEADER_PROTOCOL\' | translate}}</th>\n <td>\n <select ng-model="connection.protocol" ng-options="protocol.value.name as getProtocolName(protocol.value.name) | translate for protocol in protocols | toArray | orderBy: value.name"></select>\n </td>\n </tr>\n </table>\n </div>\n\n \x3c!-- Connection attributes section --\x3e\n <div class="attributes">\n <guac-form namespace="\'CONNECTION_ATTRIBUTES\'" content="attributes"\n model="connection.attributes" model-only="!managementPermissions.canChangeAllAttributes"></guac-form>\n </div>\n\n \x3c!-- Connection parameters --\x3e\n <h2 class="header">{{\'MANAGE_CONNECTION.SECTION_HEADER_PARAMETERS\' | translate}}</h2>\n <div class="section connection-parameters" ng-class="{loading: !parameters}">\n <guac-form namespace="getNamespace(connection.protocol)"\n content="protocols[connection.protocol].connectionForms"\n model="parameters"></guac-form>\n </div>\n\n \x3c!-- Form action buttons --\x3e\n <management-buttons namespace="MANAGE_CONNECTION"\n permissions="managementPermissions"\n save="saveConnection()"\n delete="deleteConnection()"\n clone="cloneConnection()"\n return="returnToConnectionList()">\n </management-buttons>\n\n \x3c!-- Connection history --\x3e\n <h2 class="header">{{\'MANAGE_CONNECTION.SECTION_HEADER_HISTORY\' | translate}}</h2>\n <div class="history section" ng-class="{loading: !historyEntryWrappers}">\n <p ng-hide="historyEntryWrappers.length">{{\'MANAGE_CONNECTION.INFO_CONNECTION_NOT_USED\' | translate}}</p>\n\n \x3c!-- History list --\x3e\n <table ng-show="historyEntryWrappers.length">\n <thead>\n <tr>\n <th>{{\'MANAGE_CONNECTION.TABLE_HEADER_HISTORY_USERNAME\' | translate}}</th>\n <th>{{\'MANAGE_CONNECTION.TABLE_HEADER_HISTORY_START\' | translate}}</th>\n <th>{{\'MANAGE_CONNECTION.TABLE_HEADER_HISTORY_DURATION\' | translate}}</th>\n <th>{{\'MANAGE_CONNECTION.TABLE_HEADER_HISTORY_REMOTEHOST\' | translate}}</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="wrapper in wrapperPage">\n <td class="username"><guac-user-item username="wrapper.entry.username"></guac-user-item></td>\n <td class="start">{{wrapper.entry.startDate | date:historyDateFormat}}</td>\n <td class="duration"\n translate="{{wrapper.durationText}}"\n translate-values="{VALUE: wrapper.duration.value, UNIT: wrapper.duration.unit}"></td>\n <td class="remoteHost">{{wrapper.entry.remoteHost}}</td>\n </tr>\n </tbody>\n </table>\n\n \x3c!-- Pager controls for history list --\x3e\n <guac-pager page="wrapperPage" items="historyEntryWrappers"></guac-pager>\n\n </div>\n\n</div>')}]),angular.module("app/manage/templates/manageConnectionGroup.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/manageConnectionGroup.html",'\n<div class="view" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- Main property editor --\x3e\n <div class="header">\n <h2>{{\'MANAGE_CONNECTION_GROUP.SECTION_HEADER_EDIT_CONNECTION_GROUP\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n <div class="section">\n <table class="properties">\n \n \x3c!-- Edit connection group name --\x3e\n <tr>\n <th>{{\'MANAGE_CONNECTION_GROUP.FIELD_HEADER_NAME\' | translate}}</th>\n \n <td><input type="text" ng-model="connectionGroup.name" autocorrect="off" autocapitalize="off"/></td>\n </tr>\n \n \x3c!-- Edit connection group location --\x3e\n <tr>\n <th>{{\'MANAGE_CONNECTION_GROUP.FIELD_HEADER_LOCATION\' | translate}}</th>\n \n <td>\n <location-chooser\n data-data-source="selectedDataSource" root-group="rootGroup"\n value="connectionGroup.parentIdentifier"></location-chooser>\n </td>\n </tr>\n \n \n \x3c!-- Edit connection group type --\x3e\n <tr>\n <th>{{\'MANAGE_CONNECTION_GROUP.FIELD_HEADER_TYPE\' | translate}}</th>\n <td>\n <select ng-model="connectionGroup.type" ng-options="type.value as type.label | translate for type in types | orderBy: name"></select>\n </td>\n </tr>\n </table>\n </div>\n\n \x3c!-- Connection group attributes section --\x3e\n <div class="attributes">\n <guac-form namespace="\'CONNECTION_GROUP_ATTRIBUTES\'" content="attributes"\n model="connectionGroup.attributes" model-only="!managementPermissions.canChangeAllAttributes"></guac-form>\n </div>\n\n \x3c!-- Form action buttons --\x3e\n <management-buttons namespace="MANAGE_CONNECTION_GROUP"\n permissions="managementPermissions"\n save="saveConnectionGroup()"\n delete="deleteConnectionGroup()"\n clone="cloneConnectionGroup()"\n return="returnToConnectionList()">\n </management-buttons>\n\n</div>')}]),angular.module("app/manage/templates/manageSharingProfile.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/manageSharingProfile.html",'<div class="view" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- Main property editor --\x3e\n <div class="header">\n <h2>{{\'MANAGE_SHARING_PROFILE.SECTION_HEADER_EDIT_SHARING_PROFILE\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n <div class="section">\n <table class="properties">\n <tr>\n <th>{{\'MANAGE_SHARING_PROFILE.FIELD_HEADER_NAME\' | translate}}</th>\n <td><input type="text" ng-model="sharingProfile.name"\n autocorrect="off" autocapitalize="off"/></td>\n </tr>\n <tr>\n <th>{{\'MANAGE_SHARING_PROFILE.FIELD_HEADER_PRIMARY_CONNECTION\' | translate}}</th>\n <td>{{primaryConnection.name}}</td>\n </tr>\n </table>\n </div>\n\n \x3c!-- Sharing profile attributes section --\x3e\n <div class="attributes">\n <guac-form namespace="\'SHARING_PROFILE_ATTRIBUTES\'" content="attributes"\n model="sharingProfile.attributes" model-only="!managementPermissions.canChangeAllAttributes"></guac-form>\n </div>\n\n \x3c!-- Sharing profile parameters --\x3e\n <h2 class="header">{{\'MANAGE_SHARING_PROFILE.SECTION_HEADER_PARAMETERS\' | translate}}</h2>\n <div class="section connection-parameters" ng-class="{loading: !parameters}">\n <guac-form namespace="getNamespace(primaryConnection.protocol)"\n content="protocols[primaryConnection.protocol].sharingProfileForms"\n model="parameters"></guac-form>\n </div>\n\n \x3c!-- Form action buttons --\x3e\n <management-buttons namespace="MANAGE_SHARING_PROFILE"\n permissions="managementPermissions"\n save="saveSharingProfile()"\n delete="deleteSharingProfile()"\n clone="cloneSharingProfile()"\n return="returnToConnectionList()">\n </management-buttons>\n\n</div>')}]),angular.module("app/manage/templates/manageUser.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/manageUser.html",'\n<div class="manage-user view" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- User header and data source tabs --\x3e\n <div class="header tabbed">\n <h2>{{\'MANAGE_USER.SECTION_HEADER_EDIT_USER\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n <data-data-source-tabs ng-hide="cloneSourceUsername"\n permissions="managementPermissions"\n url="getUserURL(dataSource)">\n </data-data-source-tabs>\n\n \x3c!-- Warn if user is read-only --\x3e\n <div class="section" ng-hide="managementPermissions[dataSource].canSaveObject">\n <p class="notice read-only">{{\'MANAGE_USER.INFO_READ_ONLY\' | translate}}</p>\n </div>\n\n \x3c!-- Sections applicable to non-read-only users --\x3e\n <div ng-show="managementPermissions[dataSource].canSaveObject">\n\n \x3c!-- User password section --\x3e\n <div class="section">\n <table class="properties">\n <tr>\n <th>{{\'MANAGE_USER.FIELD_HEADER_USERNAME\' | translate}}</th>\n <td>\n <input ng-show="canEditUsername()" ng-model="user.username" type="text"/>\n <span ng-hide="canEditUsername()">{{user.username}}</span>\n </td>\n </tr>\n <tr>\n <th>{{\'MANAGE_USER.FIELD_HEADER_PASSWORD\' | translate}}</th>\n <td><input ng-model="user.password" type="password" /></td>\n </tr>\n <tr>\n <th>{{\'MANAGE_USER.FIELD_HEADER_PASSWORD_AGAIN\' | translate}}</th>\n <td><input ng-model="passwordMatch" type="password" /></td>\n </tr>\n </table>\n </div>\n\n \x3c!-- User attributes section --\x3e\n <div class="attributes" ng-show="managementPermissions[dataSource].canChangeAttributes">\n <guac-form namespace="\'USER_ATTRIBUTES\'" content="attributes"\n model="user.attributes"\n model-only="!managementPermissions[dataSource].canChangeAllAttributes"></guac-form>\n </div>\n\n \x3c!-- System permissions section --\x3e\n <system-permission-editor ng-show="managementPermissions[dataSource].canChangePermissions"\n username="selfUsername"\n data-data-source="dataSource"\n permission-flags="permissionFlags"\n permissions-added="permissionsAdded"\n permissions-removed="permissionsRemoved">\n </system-permission-editor>\n\n \x3c!-- Parent group section --\x3e\n <identifier-set-editor\n header="MANAGE_USER.SECTION_HEADER_USER_GROUPS"\n empty-placeholder="MANAGE_USER.HELP_NO_USER_GROUPS"\n unavailable-placeholder="MANAGE_USER.INFO_NO_USER_GROUPS_AVAILABLE"\n identifiers-available="availableGroups"\n identifiers="parentGroups"\n identifiers-added="parentGroupsAdded"\n identifiers-removed="parentGroupsRemoved">\n </identifier-set-editor>\n\n \x3c!-- Connection permissions section --\x3e\n <connection-permission-editor ng-show="managementPermissions[dataSource].canChangePermissions"\n data-data-source="dataSource"\n permission-flags="permissionFlags"\n permissions-added="permissionsAdded"\n permissions-removed="permissionsRemoved">\n </connection-permission-editor>\n\n \x3c!-- Form action buttons --\x3e\n <management-buttons namespace="MANAGE_USER"\n permissions="managementPermissions[dataSource]"\n save="saveUser()"\n delete="deleteUser()"\n clone="cloneUser()"\n return="returnToUserList()">\n </management-buttons>\n\n </div>\n\n</div>')}]),angular.module("app/manage/templates/manageUserGroup.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/manageUserGroup.html",'<div class="manage-user-group view" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- User group header and data source tabs --\x3e\n <div class="header tabbed">\n <h2>{{\'MANAGE_USER_GROUP.SECTION_HEADER_EDIT_USER_GROUP\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n <data-data-source-tabs ng-hide="cloneSourceIdentifier"\n permissions="managementPermissions"\n url="getUserGroupURL(dataSource)">\n </data-data-source-tabs>\n\n \x3c!-- Warn if user group is read-only --\x3e\n <div class="section" ng-hide="managementPermissions[dataSource].canSaveObject">\n <p class="notice read-only">{{\'MANAGE_USER_GROUP.INFO_READ_ONLY\' | translate}}</p>\n </div>\n\n \x3c!-- Sections applicable to non-read-only user groups --\x3e\n <div ng-show="managementPermissions[dataSource].canSaveObject">\n\n \x3c!-- User group name --\x3e\n <div class="section">\n <table class="properties">\n <tr>\n <th>{{\'MANAGE_USER_GROUP.FIELD_HEADER_USER_GROUP_NAME\' | translate}}</th>\n <td>\n <input ng-show="canEditIdentifier()" ng-model="userGroup.identifier" type="text"/>\n <span ng-hide="canEditIdentifier()">{{userGroup.identifier}}</span>\n </td>\n </tr>\n </table>\n </div>\n\n \x3c!-- User group attributes section --\x3e\n <div class="attributes" ng-show="managementPermissions[dataSource].canChangeAttributes">\n <guac-form namespace="\'USER_GROUP_ATTRIBUTES\'" content="attributes"\n model="userGroup.attributes"\n model-only="!managementPermissions[dataSource].canChangeAllAttributes"></guac-form>\n </div>\n\n \x3c!-- System permissions section --\x3e\n <system-permission-editor ng-show="managementPermissions[dataSource].canChangePermissions"\n data-data-source="dataSource"\n permission-flags="permissionFlags"\n permissions-added="permissionsAdded"\n permissions-removed="permissionsRemoved">\n </system-permission-editor>\n\n \x3c!-- Parent group section --\x3e\n <identifier-set-editor\n header="MANAGE_USER_GROUP.SECTION_HEADER_USER_GROUPS"\n empty-placeholder="MANAGE_USER_GROUP.HELP_NO_USER_GROUPS"\n unavailable-placeholder="MANAGE_USER_GROUP.INFO_NO_USER_GROUPS_AVAILABLE"\n identifiers-available="availableGroups"\n identifiers="parentGroups"\n identifiers-added="parentGroupsAdded"\n identifiers-removed="parentGroupsRemoved">\n </identifier-set-editor>\n\n \x3c!-- Member group section --\x3e\n <identifier-set-editor\n header="MANAGE_USER_GROUP.SECTION_HEADER_MEMBER_USER_GROUPS"\n empty-placeholder="MANAGE_USER_GROUP.HELP_NO_MEMBER_USER_GROUPS"\n unavailable-placeholder="MANAGE_USER_GROUP.INFO_NO_USER_GROUPS_AVAILABLE"\n identifiers-available="availableGroups"\n identifiers="memberGroups"\n identifiers-added="memberGroupsAdded"\n identifiers-removed="memberGroupsRemoved">\n </identifier-set-editor>\n\n \x3c!-- Member user section --\x3e\n <identifier-set-editor\n header="MANAGE_USER_GROUP.SECTION_HEADER_MEMBER_USERS"\n empty-placeholder="MANAGE_USER_GROUP.HELP_NO_MEMBER_USERS"\n unavailable-placeholder="MANAGE_USER_GROUP.INFO_NO_USERS_AVAILABLE"\n identifiers-available="availableUsers"\n identifiers="memberUsers"\n identifiers-added="memberUsersAdded"\n identifiers-removed="memberUsersRemoved">\n </identifier-set-editor>\n\n \x3c!-- Connection permissions section --\x3e\n <connection-permission-editor ng-show="managementPermissions[dataSource].canChangePermissions"\n data-data-source="dataSource"\n permission-flags="permissionFlags"\n permissions-added="permissionsAdded"\n permissions-removed="permissionsRemoved">\n </connection-permission-editor>\n\n \x3c!-- Form action buttons --\x3e\n <management-buttons namespace="MANAGE_USER_GROUP"\n permissions="managementPermissions[dataSource]"\n save="saveUserGroup()"\n delete="deleteUserGroup()"\n clone="cloneUserGroup()"\n return="returnToUserGroupList()">\n </management-buttons>\n\n </div>\n\n</div>')}]),angular.module("app/manage/templates/managementButtons.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/managementButtons.html",'<div class="action-buttons">\n <button ng-show="permissions.canSaveObject" ng-click="saveObject()">{{namespace + \'.ACTION_SAVE\' | translate}}</button>\n <button ng-show="permissions.canCloneObject" ng-click="cloneObject()">{{namespace + \'.ACTION_CLONE\' | translate}}</button>\n <button ng-click="cancel()">{{namespace + \'.ACTION_CANCEL\' | translate}}</button>\n <button ng-show="permissions.canDeleteObject" ng-click="deleteObject()" class="danger">{{namespace + \'.ACTION_DELETE\' | translate}}</button>\n</div>')}]),angular.module("app/manage/templates/sharingProfilePermission.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/sharingProfilePermission.html",'<div class="choice">\n\n \x3c!-- Sharing profile icon --\x3e\n <div class="icon type"></div>\n\n \x3c!-- Permission checkbox --\x3e\n <input type="checkbox" ng-model="context.getPermissionFlags().sharingProfilePermissions.READ[item.identifier]"\n ng-change="context.sharingProfilePermissionChanged(item.identifier)"/>\n\n \x3c!-- Sharing profile name --\x3e\n <span class="name">{{item.name}}</span>\n\n</div>')}]),angular.module("app/manage/templates/systemPermissionEditor.html",[]).run(["$templateCache",function(e){e.put("app/manage/templates/systemPermissionEditor.html",'<div class="system-permissions">\n <h2 class="header">{{\'MANAGE_USER.SECTION_HEADER_PERMISSIONS\' | translate}}</h2>\n <div class="section">\n <table class="properties">\n <tr ng-repeat="systemPermissionType in systemPermissionTypes"\n ng-show="canChangeSystemPermissions()">\n <th>{{systemPermissionType.label | translate}}</th>\n <td><input type="checkbox" ng-model="permissionFlags.systemPermissions[systemPermissionType.value]"\n ng-change="systemPermissionChanged(systemPermissionType.value)"/></td>\n </tr>\n <tr ng-show="username">\n <th>{{\'MANAGE_USER.FIELD_HEADER_CHANGE_OWN_PASSWORD\' | translate}}</th>\n <td><input type="checkbox" ng-model="permissionFlags.userPermissions.UPDATE[username]"\n ng-change="userPermissionChanged(\'UPDATE\', username)"/></td>\n </tr>\n </table>\n </div>\n</div>')}]),angular.module("app/navigation/templates/guacMenu.html",[]).run(["$templateCache",function(e){e.put("app/navigation/templates/guacMenu.html",'<div class="menu-dropdown" ng-class="{open: menuShown}" ng-click="toggleMenu()">\n <div class="menu-title">{{menuTitle}}</div>\n <div class="menu-indicator"></div>\n\n \x3c!-- Menu contents --\x3e\n <div class="menu-contents" ng-transclude></div>\n</div>')}]),angular.module("app/navigation/templates/guacPageList.html",[]).run(["$templateCache",function(e){e.put("app/navigation/templates/guacPageList.html",'<div class="page-list" ng-show="levels.length">\n\n \x3c!-- Navigation links --\x3e\n <ul class="page-list-level" ng-repeat="level in levels track by $index">\n <li ng-repeat="page in getPages(level)" class="{{page.className}}">\n <a class="home" ng-click="navigateToPage(page)"\n ng-class="{current: isCurrentPage(page)}" href="#{{page.url}}">\n {{page.name | translate}}\n </a>\n </li>\n </ul>\n\n</div>')}]),angular.module("app/navigation/templates/guacSectionTabs.html",[]).run(["$templateCache",function(e){e.put("app/navigation/templates/guacSectionTabs.html",'<div class="section-tabs" ng-show="tabs.length">\n <ul>\n <li ng-repeat="name in tabs">\n <a ng-click="selectTab(name)"\n ng-class="{ current : isSelected(name) }">\n {{ getSectionHeader(name) | translate }}\n </a>\n </li>\n </ul>\n</div>')}]),angular.module("app/navigation/templates/guacUserMenu.html",[]).run(["$templateCache",function(e){e.put("app/navigation/templates/guacUserMenu.html",'<div class="user-menu" ng-show="!isAnonymous()">\n <guac-menu menu-title="username">\n \n \x3c!-- User profile view --\x3e\n <div class="profile" ng-show="fullName">\n <div class="full-name"><a ng-href="{{userURL}}">{{ fullName }}</a></div>\n <div class="organizational-role" ng-show="role">{{ role }}</div>\n <div class="organization" ng-show="organization">{{ organization }}</div>\n </div>\n\n \x3c!-- Local actions --\x3e\n <ul class="action-list">\n <li ng-repeat="action in localActions">\n <a ng-class="action.className" ng-click="action.callback()">\n {{action.name | translate}}\n </a>\n </li>\n </ul>\n\n \x3c!-- Navigation links --\x3e\n <guac-page-list pages="pages"></guac-page-list>\n\n \x3c!-- Actions --\x3e\n <ul class="action-list">\n <li ng-repeat="action in actions">\n <a ng-class="action.className" ng-click="action.callback()">\n {{action.name | translate}}\n </a>\n </li>\n </ul>\n\n </guac-menu>\n</div>')}]),angular.module("app/notification/templates/guacNotification.html",[]).run(["$templateCache",function(e){e.put("app/notification/templates/guacNotification.html",'<div class="notification" ng-class="notification.className">\n\n \x3c!-- Notification title --\x3e\n <div ng-show="notification.title" class="title-bar">\n <div class="title">{{notification.title | translate}}</div>\n </div>\n\n <div class="body">\n\n \x3c!-- Notification text --\x3e\n <p ng-show="notification.text" class="text"\n translate="{{notification.text.key}}"\n translate-values="{{notification.text.variables}}"></p>\n\n \x3c!-- Current progress --\x3e\n <div class="progress" ng-show="notification.progress"><div class="bar" ng-show="progressPercent" ng-style="{\'width\': progressPercent + \'%\'}"></div><div\n ng-show="notification.progress.text"\n translate="{{notification.progress.text}}"\n translate-values="{PROGRESS: notification.progress.value, UNIT: notification.progress.unit}"></div></div>\n\n \x3c!-- Default action countdown text --\x3e\n <p class="countdown-text"\n ng-show="notification.countdown.text"\n translate="{{notification.countdown.text}}"\n translate-values="{REMAINING: timeRemaining}"></p>\n\n </div>\n\n \x3c!-- Buttons --\x3e\n <div ng-show="notification.actions.length" class="buttons">\n <button ng-repeat="action in notification.actions" ng-click="action.callback()" ng-class="action.className">{{action.name | translate}}</button>\n </div>\n\n</div>')}]),angular.module("app/osk/templates/guacOsk.html",[]).run(["$templateCache",function(e){e.put("app/osk/templates/guacOsk.html",'<div class="osk" guac-resize="keyboardResized">\n</div>')}]),angular.module("app/settings/templates/connection.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/connection.html",'<a ng-href="#/manage/{{item.dataSource}}/connections/{{item.identifier}}"\n ng-class="{active: item.getActiveConnections()}">\n\n \x3c!-- Connection icon --\x3e\n <div class="icon type" ng-class="item.protocol"></div>\n\n \x3c!-- Connection name --\x3e\n <span class="name">{{item.name}}</span>\n\n \x3c!-- Active user count --\x3e\n <span class="activeUserCount" ng-show="item.getActiveConnections()"\n translate="SETTINGS_CONNECTIONS.INFO_ACTIVE_USER_COUNT"\n translate-values="{USERS: item.getActiveConnections()}"></span>\n\n</a>')}]),angular.module("app/settings/templates/connectionGroup.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/connectionGroup.html",'<a ng-href="#/manage/{{item.dataSource}}/connectionGroups/{{item.identifier}}">\n\n \x3c!-- Connection group icon --\x3e\n <div class="icon type"></div>\n\n \x3c!-- Connection group name --\x3e\n <span class="name">{{item.name}}</span>\n\n</a>')}]),angular.module("app/settings/templates/newConnection.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/newConnection.html",'<a ng-href="#/manage/{{item.dataSource}}/connections/?parent={{item.wrappedItem.identifier}}">\n <span class="name">{{\'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION\' | translate}}</span>\n</a>')}]),angular.module("app/settings/templates/newConnectionGroup.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/newConnectionGroup.html",'<a ng-href="#/manage/{{item.dataSource}}/connectionGroups/?parent={{item.wrappedItem.identifier}}">\n <span class="name">{{\'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION_GROUP\' | translate}}</span>\n</a>')}]),angular.module("app/settings/templates/newSharingProfile.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/newSharingProfile.html",'<a ng-href="#/manage/{{item.dataSource}}/sharingProfiles/?parent={{item.wrappedItem.identifier}}">\n <span class="name">{{\'SETTINGS_CONNECTIONS.ACTION_NEW_SHARING_PROFILE\' | translate}}</span>\n</a>')}]),angular.module("app/settings/templates/settings.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settings.html",'\n<div class="view">\n\n <div class="header tabbed">\n <h2>{{\'SETTINGS.SECTION_HEADER_SETTINGS\' | translate}}</h2>\n <guac-user-menu></guac-user-menu>\n </div>\n\n \x3c!-- Available tabs --\x3e\n <div class="page-tabs">\n <guac-page-list pages="settingsPages"></guac-page-list>\n </div>\n\n \x3c!-- Selected tab --\x3e\n <guac-settings-users ng-if="activeTab === \'users\'"></guac-settings-users>\n <guac-settings-user-groups ng-if="activeTab === \'userGroups\'"></guac-settings-user-groups>\n <guac-settings-connections ng-if="activeTab === \'connections\'"></guac-settings-connections>\n <guac-settings-connection-history ng-if="activeTab === \'history\'"></guac-settings-connection-history>\n <guac-settings-sessions ng-if="activeTab === \'sessions\'"></guac-settings-sessions>\n <guac-settings-preferences ng-if="activeTab === \'preferences\'"></guac-settings-preferences>\n\n</div>')}]),angular.module("app/settings/templates/settingsConnectionHistory.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settingsConnectionHistory.html",'<div class="settings section connectionHistory">\n\n \x3c!-- Connection history --\x3e\n <p>{{\'SETTINGS_CONNECTION_HISTORY.HELP_CONNECTION_HISTORY\' | translate}}</p>\n\n \x3c!-- Search controls --\x3e\n <form class="filter" ng-submit="search()">\n <input class="search-string" type="text" placeholder="{{\'SETTINGS_CONNECTION_HISTORY.FIELD_PLACEHOLDER_FILTER\' | translate}}" ng-model="searchString" />\n <input class="search-button" type="submit" value="{{\'SETTINGS_CONNECTION_HISTORY.ACTION_SEARCH\' | translate}}" />\n <button type="button" ng-click="downloadCSV()">{{\'SETTINGS_CONNECTION_HISTORY.ACTION_DOWNLOAD\' | translate}}</button>\n </form>\n\n \x3c!-- Search results --\x3e\n <div class="results">\n\n \x3c!-- List of matching history records --\x3e\n <table class="sorted history-list">\n <thead>\n <tr>\n <th guac-sort-order="order" guac-sort-property="\'username\'">\n {{\'SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_USERNAME\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'startDate\'">\n {{\'SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_STARTDATE\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'duration\'">\n {{\'SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_DURATION\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'connectionName\'">\n {{\'SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_CONNECTION_NAME\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'remoteHost\'">\n {{\'SETTINGS_CONNECTION_HISTORY.TABLE_HEADER_SESSION_REMOTEHOST\' | translate}}\n </th>\n </tr>\n </thead>\n <tbody ng-class="{loading: !isLoaded()}">\n <tr ng-repeat="historyEntryWrapper in historyEntryWrapperPage" class="history">\n <td><guac-user-item username="historyEntryWrapper.username"></guac-user-item></td>\n <td>{{historyEntryWrapper.startDate | date : dateFormat}}</td>\n <td translate="{{historyEntryWrapper.readableDurationText}}"\n translate-values="{VALUE: historyEntryWrapper.readableDuration.value, UNIT: historyEntryWrapper.readableDuration.unit}"></td>\n <td>{{historyEntryWrapper.connectionName}}</td>\n <td>{{historyEntryWrapper.remoteHost}}</td>\n </tr>\n </tbody>\n </table>\n\n \x3c!-- Text displayed if no history exists --\x3e\n <p class="placeholder" ng-show="isHistoryEmpty()">\n {{\'SETTINGS_CONNECTION_HISTORY.INFO_NO_HISTORY\' | translate}}\n </p>\n\n \x3c!-- Pager for history list --\x3e\n <guac-pager page="historyEntryWrapperPage" page-size="25"\n items="historyEntryWrappers | orderBy : order.predicate"></guac-pager>\n </div>\n\n</div>')}]),angular.module("app/settings/templates/settingsConnections.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settingsConnections.html",'<div class="settings section connections" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- Connection management --\x3e\n <p>{{\'SETTINGS_CONNECTIONS.HELP_CONNECTIONS\' | translate}}</p>\n\n \x3c!-- Connection management toolbar --\x3e\n <div class="toolbar">\n\n \x3c!-- Form action buttons --\x3e\n <div class="action-buttons">\n\n <a class="add-connection button"\n ng-show="canCreateConnections()"\n href="#/manage/{{dataSource}}/connections/">{{\'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION\' | translate}}</a>\n\n <a class="add-connection-group button"\n ng-show="canCreateConnectionGroups()"\n href="#/manage/{{dataSource}}/connectionGroups/">{{\'SETTINGS_CONNECTIONS.ACTION_NEW_CONNECTION_GROUP\' | translate}}</a>\n\n </div>\n\n \x3c!-- Connection filter --\x3e\n <guac-group-list-filter connection-groups="rootGroups"\n filtered-connection-groups="filteredRootGroups"\n placeholder="\'SETTINGS_CONNECTIONS.FIELD_PLACEHOLDER_FILTER\' | translate"\n connection-properties="filteredConnectionProperties"\n connection-group-properties="filteredConnectionGroupProperties"></guac-group-list-filter>\n\n </div>\n\n \x3c!-- List of accessible connections and groups --\x3e\n <div class="connection-list">\n <guac-group-list\n page-size="25"\n connection-groups="filteredRootGroups"\n decorator="rootItemDecorator"\n templates="{\n\n'+" 'connection' : 'app/settings/templates/connection.html',\n 'sharing-profile' : 'app/settings/templates/sharingProfile.html',\n 'connection-group' : 'app/settings/templates/connectionGroup.html',\n\n 'new-connection' : 'app/settings/templates/newConnection.html',\n 'new-sharing-profile' : 'app/settings/templates/newSharingProfile.html',\n 'new-connection-group' : 'app/settings/templates/newConnectionGroup.html'\n\n }\"/>\n </div>\n</div>")}]),angular.module("app/settings/templates/settingsPreferences.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settingsPreferences.html",'<div class="preferences" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- Locale settings --\x3e\n <div class="settings section locale">\n <p>{{\'SETTINGS_PREFERENCES.HELP_LOCALE\' | translate}}</p>\n <guac-form content="localeFields" model="preferences" namespace="\'SETTINGS_PREFERENCES\'"></guac-form>\n </div>\n \n \x3c!-- Password update --\x3e\n <h2 class="header" ng-show="canChangePassword">{{\'SETTINGS_PREFERENCES.SECTION_HEADER_UPDATE_PASSWORD\' | translate}}</h2>\n <div class="settings section update-password" ng-show="canChangePassword">\n <p>{{\'SETTINGS_PREFERENCES.HELP_UPDATE_PASSWORD\' | translate}}</p>\n\n \x3c!-- Password editor --\x3e\n <div class="form">\n <table class="fields">\n <tr>\n <th>{{\'SETTINGS_PREFERENCES.FIELD_HEADER_PASSWORD_OLD\' | translate}}</th>\n <td><input ng-model="oldPassword" type="password" /></td>\n </tr>\n <tr>\n <th>{{\'SETTINGS_PREFERENCES.FIELD_HEADER_PASSWORD_NEW\' | translate}}</th>\n <td><input ng-model="newPassword" type="password" /></td>\n </tr>\n <tr>\n <th>{{\'SETTINGS_PREFERENCES.FIELD_HEADER_PASSWORD_NEW_AGAIN\' | translate}}</th>\n <td><input ng-model="newPasswordMatch" type="password" /></td>\n </tr>\n </table>\n </div>\n\n \x3c!-- Form action buttons --\x3e\n <div class="action-buttons">\n <button class="change-password" ng-click="updatePassword()">{{\'SETTINGS_PREFERENCES.ACTION_UPDATE_PASSWORD\' | translate}}</button>\n </div>\n </div>\n\n \x3c!-- Input method --\x3e\n <h2 class="header">{{\'SETTINGS_PREFERENCES.SECTION_HEADER_DEFAULT_INPUT_METHOD\' | translate}}</h2>\n <div class="settings section input-method">\n <p>{{\'SETTINGS_PREFERENCES.HELP_DEFAULT_INPUT_METHOD\' | translate}}</p>\n <div class="choices">\n\n \x3c!-- No IME --\x3e\n <div class="choice">\n <label><input id="ime-none" name="input-method" ng-model="preferences.inputMethod" type="radio" value="none"/> {{\'SETTINGS_PREFERENCES.NAME_INPUT_METHOD_NONE\' | translate}}</label>\n <p class="caption"><label for="ime-none">{{\'SETTINGS_PREFERENCES.HELP_INPUT_METHOD_NONE\' | translate}}</label></p>\n </div>\n\n \x3c!-- Text input --\x3e\n <div class="choice">\n <label><input id="ime-text" name="input-method" ng-model="preferences.inputMethod" type="radio" value="text"/> {{\'SETTINGS_PREFERENCES.NAME_INPUT_METHOD_TEXT\' | translate}}</label>\n <p class="caption"><label for="ime-text">{{\'SETTINGS_PREFERENCES.HELP_INPUT_METHOD_TEXT\' | translate}} </label></p>\n </div>\n\n \x3c!-- Guac OSK --\x3e\n <div class="choice">\n <label><input id="ime-osk" name="input-method" ng-model="preferences.inputMethod" type="radio" value="osk"/> {{\'SETTINGS_PREFERENCES.NAME_INPUT_METHOD_OSK\' | translate}}</label>\n <p class="caption"><label for="ime-osk">{{\'SETTINGS_PREFERENCES.HELP_INPUT_METHOD_OSK\' | translate}}</label></p>\n </div>\n\n </div>\n </div>\n\n \x3c!-- Mouse mode --\x3e\n <h2 class="header">{{\'SETTINGS_PREFERENCES.SECTION_HEADER_DEFAULT_MOUSE_MODE\' | translate}}</h2>\n <div class="settings section mouse-mode">\n <p>{{\'SETTINGS_PREFERENCES.HELP_DEFAULT_MOUSE_MODE\' | translate}}</p>\n <div class="choices">\n\n \x3c!-- Touchscreen --\x3e\n <div class="choice">\n <input name="mouse-mode" ng-model="preferences.emulateAbsoluteMouse" type="radio" ng-value="true" checked="checked" id="absolute"/>\n <div class="figure">\n <label for="absolute"><img src="images/settings/touchscreen.png" alt="{{\'SETTINGS_PREFERENCES.NAME_MOUSE_MODE_ABSOLUTE\' | translate}}"/></label>\n <p class="caption"><label for="absolute">{{\'SETTINGS_PREFERENCES.HELP_MOUSE_MODE_ABSOLUTE\' | translate}}</label></p>\n </div>\n </div>\n\n \x3c!-- Touchpad --\x3e\n <div class="choice">\n <input name="mouse-mode" ng-model="preferences.emulateAbsoluteMouse" type="radio" ng-value="false" id="relative"/>\n <div class="figure">\n <label for="relative"><img src="images/settings/touchpad.png" alt="{{\'SETTINGS_PREFERENCES.NAME_MOUSE_MODE_RELATIVE\' | translate}}"/></label>\n <p class="caption"><label for="relative">{{\'SETTINGS_PREFERENCES.HELP_MOUSE_MODE_RELATIVE\' | translate}}</label></p>\n </div>\n </div>\n\n </div>\n </div>\n\n</div>')}]),angular.module("app/settings/templates/settingsSessions.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settingsSessions.html",'<div class="settings section sessions" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- User Session management --\x3e\n <p>{{\'SETTINGS_SESSIONS.HELP_SESSIONS\' | translate}}</p>\n\n \x3c!-- Form action buttons --\x3e\n <div class="action-buttons">\n <button class="delete-sessions danger" ng-disabled="!canDeleteSessions()" ng-click="deleteSessions()">{{\'SETTINGS_SESSIONS.ACTION_DELETE\' | translate}}</button>\n </div>\n\n \x3c!-- Session filter --\x3e\n <guac-filter filtered-items="filteredWrappers" items="wrappers"\n placeholder="\'SETTINGS_SESSIONS.FIELD_PLACEHOLDER_FILTER\' | translate"\n properties="filteredWrapperProperties"></guac-filter>\n\n \x3c!-- List of current user sessions --\x3e\n <table class="sorted session-list">\n <thead>\n <tr>\n <th class="select-session"></th>\n <th guac-sort-order="wrapperOrder" guac-sort-property="\'activeConnection.username\'">\n {{\'SETTINGS_SESSIONS.TABLE_HEADER_SESSION_USERNAME\' | translate}}\n </th>\n <th guac-sort-order="wrapperOrder" guac-sort-property="\'startDate\'">\n {{\'SETTINGS_SESSIONS.TABLE_HEADER_SESSION_STARTDATE\' | translate}}\n </th>\n <th guac-sort-order="wrapperOrder" guac-sort-property="\'activeConnection.remoteHost\'">\n {{\'SETTINGS_SESSIONS.TABLE_HEADER_SESSION_REMOTEHOST\' | translate}}\n </th>\n <th guac-sort-order="wrapperOrder" guac-sort-property="\'name\'">\n {{\'SETTINGS_SESSIONS.TABLE_HEADER_SESSION_CONNECTION_NAME\' | translate}}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="wrapper in wrapperPage" class="session">\n <td class="select-session">\n <input ng-change="wrapperSelectionChange(wrapper)" type="checkbox" ng-model="wrapper.checked" />\n </td>\n <td><guac-user-item username="wrapper.activeConnection.username"></guac-user-item></td>\n <td>{{wrapper.startDate}}</td>\n <td>{{wrapper.activeConnection.remoteHost}}</td>\n <td><a ng-href="{{\n getClientURL(wrapper.dataSource, wrapper.activeConnection)\n }}">{{wrapper.name}}</a></td>\n </tr>\n </tbody>\n </table>\n\n \x3c!-- Text displayed if no sessions exist --\x3e\n <p class="placeholder" ng-hide="wrapperPage.length">\n {{\'SETTINGS_SESSIONS.INFO_NO_SESSIONS\' | translate}}\n </p>\n\n \x3c!-- Pager for session list --\x3e\n <guac-pager page="wrapperPage" page-size="25"\n items="filteredWrappers | orderBy : wrapperOrder.predicate"></guac-pager>\n</div>')}]),angular.module("app/settings/templates/settingsUserGroups.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settingsUserGroups.html",'<div class="settings section user-groups" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- User group management --\x3e\n <p>{{\'SETTINGS_USER_GROUPS.HELP_USER_GROUPS\' | translate}}</p>\n\n\n \x3c!-- User management toolbar --\x3e\n <div class="toolbar">\n\n \x3c!-- Form action buttons --\x3e\n <div class="action-buttons">\n <a class="add-user-group button" ng-show="canCreateUserGroups()"\n href="#/manage/{{getDefaultDataSource()}}/userGroups/">{{\'SETTINGS_USER_GROUPS.ACTION_NEW_USER_GROUP\' | translate}}</a>\n </div>\n\n \x3c!-- User group filter --\x3e\n <guac-filter filtered-items="filteredManageableUserGroups" items="manageableUserGroups"\n placeholder="\'SETTINGS_USER_GROUPS.FIELD_PLACEHOLDER_FILTER\' | translate"\n properties="filteredUserGroupProperties"></guac-filter>\n\n </div>\n\n \x3c!-- List of user groups this user has access to --\x3e\n <table class="sorted user-group-list">\n <thead>\n <tr>\n <th guac-sort-order="order" guac-sort-property="\'userGroup.identifier\'" class="user-group-name">\n {{\'SETTINGS_USER_GROUPS.TABLE_HEADER_USER_GROUP_NAME\' | translate}}\n </th>\n </tr>\n </thead>\n <tbody ng-class="{loading: !isLoaded()}">\n <tr ng-repeat="manageableUserGroup in manageableUserGroupPage" class="user-group">\n <td class="user-group-name">\n <a ng-href="#/manage/{{manageableUserGroup.dataSource}}/userGroups/{{manageableUserGroup.userGroup.identifier}}">\n <div class="icon user-group"></div>\n <span class="name">{{manageableUserGroup.userGroup.identifier}}</span>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n\n \x3c!-- Pager controls for user group list --\x3e\n <guac-pager page="manageableUserGroupPage" page-size="25"\n items="filteredManageableUserGroups | orderBy : order.predicate"></guac-pager>\n\n</div>')}]),angular.module("app/settings/templates/settingsUsers.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/settingsUsers.html",'<div class="settings section users" ng-class="{loading: !isLoaded()}">\n\n \x3c!-- User management --\x3e\n <p>{{\'SETTINGS_USERS.HELP_USERS\' | translate}}</p>\n\n\n \x3c!-- User management toolbar --\x3e\n <div class="toolbar">\n\n \x3c!-- Form action buttons --\x3e\n <div class="action-buttons">\n <a class="add-user button" ng-show="canCreateUsers()"\n href="#/manage/{{getDefaultDataSource()}}/users/">{{\'SETTINGS_USERS.ACTION_NEW_USER\' | translate}}</a>\n </div>\n\n \x3c!-- User filter --\x3e\n <guac-filter filtered-items="filteredManageableUsers" items="manageableUsers"\n placeholder="\'SETTINGS_USERS.FIELD_PLACEHOLDER_FILTER\' | translate"\n properties="filteredUserProperties"></guac-filter>\n\n </div>\n\n \x3c!-- List of users this user has access to --\x3e\n <table class="sorted user-list">\n <thead>\n <tr>\n <th guac-sort-order="order" guac-sort-property="\'user.username\'" class="username">\n {{\'SETTINGS_USERS.TABLE_HEADER_USERNAME\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'user.attributes[\\\'guac-organization\\\']\'" class="organization">\n {{\'SETTINGS_USERS.TABLE_HEADER_ORGANIZATION\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'user.attributes[\\\'guac-full-name\\\']\'" class="full-name">\n {{\'SETTINGS_USERS.TABLE_HEADER_FULL_NAME\' | translate}}\n </th>\n <th guac-sort-order="order" guac-sort-property="\'user.lastActive\'" class="last-active">\n {{\'SETTINGS_USERS.TABLE_HEADER_LAST_ACTIVE\' | translate}}\n </th>\n </tr>\n </thead>\n <tbody ng-class="{loading: !isLoaded()}">\n <tr ng-repeat="manageableUser in manageableUserPage" class="user">\n <td class="username">\n <a ng-href="#/manage/{{manageableUser.dataSource}}/users/{{manageableUser.user.username}}">\n <div class="icon user"></div>\n <span class="name">{{manageableUser.user.username}}</span>\n </a>\n </td>\n <td class="organization">{{manageableUser.user.attributes[\'guac-organization\']}}</td>\n <td class="full-name">{{manageableUser.user.attributes[\'guac-full-name\']}}</td>\n <td class="last-active">{{manageableUser.user.lastActive | date : dateFormat}}</td>\n </tr>\n </tbody>\n </table>\n\n \x3c!-- Pager controls for user list --\x3e\n <guac-pager page="manageableUserPage" page-size="25"\n items="filteredManageableUsers | orderBy : order.predicate"></guac-pager>\n\n</div>')}]),angular.module("app/settings/templates/sharingProfile.html",[]).run(["$templateCache",function(e){e.put("app/settings/templates/sharingProfile.html",'<a ng-href="#/manage/{{item.dataSource}}/sharingProfiles/{{item.identifier}}">\n\n \x3c!-- Sharing profile icon --\x3e\n <div class="icon type"></div>\n\n \x3c!-- Sharing profile name --\x3e\n <span class="name">{{item.name}}</span>\n\n</a>')}]),angular.module("app/textInput/templates/guacKey.html",[]).run(["$templateCache",function(e){e.put("app/textInput/templates/guacKey.html",'<button class="key" ng-click="updateKey()" ng-class="{pressed: pressed, sticky: sticky}">\n\n {{text | translate}}\n</button>')}]),angular.module("app/textInput/templates/guacTextInput.html",[]).run(["$templateCache",function(e){e.put("app/textInput/templates/guacTextInput.html",'<div class="text-input">\n\n \x3c!-- Text input target --\x3e\n <div class="text-input-field"><div class="sent-history"><div class="sent-text" ng-repeat="text in sentText track by $index">{{text}}</div></div><textarea rows="1" class="target" autocorrect="off" autocapitalize="off"></textarea></div><div class="text-input-buttons"><guac-key keysym="65507" sticky="true" text="\'CLIENT.NAME_KEY_CTRL\'" pressed="ctrlPressed"></guac-key><guac-key keysym="65513" sticky="true" text="\'CLIENT.NAME_KEY_ALT\'" pressed="altPressed"></guac-key><guac-key keysym="65307" text="\'CLIENT.NAME_KEY_ESC\'"></guac-key><guac-key keysym="65289" text="\'CLIENT.NAME_KEY_TAB\'"></guac-key></div>\n\n</div>')}]),angular.module("form").controller("terminalColorSchemeFieldController",["$scope","$injector",function(e,n){var t=n.get("ColorScheme");e.selectedColorScheme="",e.customColorScheme=new t,e.defaultPalette=(new t).colors,e.detailsShown=!1,e.lowIntensity=[0,1,2,3,4,5,6,7],e.highIntensity=[8,9,10,11,12,13,14,15];e.isCustom=function(){return"custom"===e.selectedColorScheme},e.showDetails=function(){e.detailsShown=!0},e.hideDetails=function(){e.detailsShown=!1},e.$watch("model",function(n){"custom"===e.selectedColorScheme||n&&!_.includes(e.field.options,n)?(e.customColorScheme=t.fromString(n),e.selectedColorScheme="custom"):e.selectedColorScheme=n||""}),e.$watch("selectedColorScheme",function(n){e.model=n?"custom"===n?t.toString(e.customColorScheme):n:""}),e.$watch("customColorScheme",function(n){"custom"===e.selectedColorScheme&&(e.model=t.toString(n))},!0)}]),angular.module("form").controller("textFieldController",["$scope","$injector",function(e,n){e.dataListId=null,e.field.options&&e.field.options.length&&(e.dataListId=e.fieldId+"-datalist")}]),angular.module("textInput",[]),angular.module("form").controller("timeFieldController",["$scope","$injector",function(e,n){var t=n.get("$filter");e.modelOptions={updateOn:"blur",timezone:"UTC"};var a=function(e){var n=new Date("1970-01-01T"+e+"Z");return isNaN(n.getTime())?null:n};e.$watch("model",function(n){e.typedValue=n?a(n):null}),e.$watch("typedValue",function(n){e.model=n?t("date")(n,"HH:mm:ss","UTC"):""})}]),angular.module("form").controller("timeZoneFieldController",["$scope","$injector",function(e,n){e.timeZones={Africa:{Abidjan:"Africa/Abidjan",Accra:"Africa/Accra","Addis Ababa":"Africa/Addis_Ababa",Algiers:"Africa/Algiers",Asmara:"Africa/Asmara",Asmera:"Africa/Asmera",Bamako:"Africa/Bamako",Bangui:"Africa/Bangui",Banjul:"Africa/Banjul",Bissau:"Africa/Bissau",Blantyre:"Africa/Blantyre",Brazzaville:"Africa/Brazzaville",Bujumbura:"Africa/Bujumbura",Cairo:"Africa/Cairo",Casablanca:"Africa/Casablanca",Ceuta:"Africa/Ceuta",Conakry:"Africa/Conakry",Dakar:"Africa/Dakar","Dar es Salaam":"Africa/Dar_es_Salaam",Djibouti:"Africa/Djibouti",Douala:"Africa/Douala","El Aaiun":"Africa/El_Aaiun",Freetown:"Africa/Freetown",Gaborone:"Africa/Gaborone",Harare:"Africa/Harare",Johannesburg:"Africa/Johannesburg",Juba:"Africa/Juba",Kampala:"Africa/Kampala",Khartoum:"Africa/Khartoum",Kigali:"Africa/Kigali",Kinshasa:"Africa/Kinshasa",Lagos:"Africa/Lagos",Libreville:"Africa/Libreville",Lome:"Africa/Lome",Luanda:"Africa/Luanda",Lubumbashi:"Africa/Lubumbashi",Lusaka:"Africa/Lusaka",Malabo:"Africa/Malabo",Maputo:"Africa/Maputo",Maseru:"Africa/Maseru",Mbabane:"Africa/Mbabane",Mogadishu:"Africa/Mogadishu",Monrovia:"Africa/Monrovia",Nairobi:"Africa/Nairobi",Ndjamena:"Africa/Ndjamena",Niamey:"Africa/Niamey",Nouakchott:"Africa/Nouakchott",Ouagadougou:"Africa/Ouagadougou","Porto-Novo":"Africa/Porto-Novo","Sao Tome":"Africa/Sao_Tome",Timbuktu:"Africa/Timbuktu",Tripoli:"Africa/Tripoli",Tunis:"Africa/Tunis",Windhoek:"Africa/Windhoek"},America:{Adak:"America/Adak",Anchorage:"America/Anchorage",Anguilla:"America/Anguilla",Antigua:"America/Antigua",Araguaina:"America/Araguaina","Argentina / Buenos Aires":"America/Argentina/Buenos_Aires","Argentina / Catamarca":"America/Argentina/Catamarca","Argentina / Comodoro Rivadavia":"America/Argentina/ComodRivadavia","Argentina / Cordoba":"America/Argentina/Cordoba","Argentina / Jujuy":"America/Argentina/Jujuy","Argentina / La Rioja":"America/Argentina/La_Rioja","Argentina / Mendoza":"America/Argentina/Mendoza","Argentina / Rio Gallegos":"America/Argentina/Rio_Gallegos","Argentina / Salta":"America/Argentina/Salta","Argentina / San Juan":"America/Argentina/San_Juan","Argentina / San Luis":"America/Argentina/San_Luis","Argentina / Tucuman":"America/Argentina/Tucuman","Argentina / Ushuaia":"America/Argentina/Ushuaia",Aruba:"America/Aruba",Asuncion:"America/Asuncion",Atikokan:"America/Atikokan",Atka:"America/Atka",Bahia:"America/Bahia","Bahia Banderas":"America/Bahia_Banderas",Barbados:"America/Barbados",Belem:"America/Belem",Belize:"America/Belize","Blanc-Sablon":"America/Blanc-Sablon","Boa Vista":"America/Boa_Vista",Bogota:"America/Bogota",Boise:"America/Boise","Buenos Aires":"America/Buenos_Aires","Cambridge Bay":"America/Cambridge_Bay","Campo Grande":"America/Campo_Grande",Cancun:"America/Cancun",Caracas:"America/Caracas",Catamarca:"America/Catamarca",Cayenne:"America/Cayenne",Cayman:"America/Cayman",Chicago:"America/Chicago",Chihuahua:"America/Chihuahua","Coral Harbour":"America/Coral_Harbour",Cordoba:"America/Cordoba","Costa Rica":"America/Costa_Rica",Creston:"America/Creston",Cuiaba:"America/Cuiaba",Curacao:"America/Curacao",Danmarkshavn:"America/Danmarkshavn",Dawson:"America/Dawson","Dawson Creek":"America/Dawson_Creek",Denver:"America/Denver",Detroit:"America/Detroit",Dominica:"America/Dominica",Edmonton:"America/Edmonton",Eirunepe:"America/Eirunepe","El Salvador":"America/El_Salvador",Ensenada:"America/Ensenada","Fort Wayne":"America/Fort_Wayne",Fortaleza:"America/Fortaleza","Glace Bay":"America/Glace_Bay",Godthab:"America/Godthab","Goose Bay":"America/Goose_Bay","Grand Turk":"America/Grand_Turk",Grenada:"America/Grenada",Guadeloupe:"America/Guadeloupe",Guatemala:"America/Guatemala",Guayaquil:"America/Guayaquil",Guyana:"America/Guyana",Halifax:"America/Halifax",Havana:"America/Havana",Hermosillo:"America/Hermosillo","Indiana / Indianapolis":"America/Indiana/Indianapolis","Indiana / Knox":"America/Indiana/Knox","Indiana / Marengo":"America/Indiana/Marengo","Indiana / Petersburg":"America/Indiana/Petersburg","Indiana / Tell City":"America/Indiana/Tell_City","Indiana / Vevay":"America/Indiana/Vevay","Indiana / Vincennes":"America/Indiana/Vincennes","Indiana / Winamac":"America/Indiana/Winamac",Indianapolis:"America/Indianapolis",Inuvik:"America/Inuvik",Iqaluit:"America/Iqaluit",Jamaica:"America/Jamaica",Jujuy:"America/Jujuy",Juneau:"America/Juneau","Kentucky / Louisville":"America/Kentucky/Louisville","Kentucky / Monticello":"America/Kentucky/Monticello",Kralendijk:"America/Kralendijk","La Paz":"America/La_Paz",Lima:"America/Lima","Los Angeles":"America/Los_Angeles",Louisville:"America/Louisville","Lower Princes":"America/Lower_Princes",Maceio:"America/Maceio",Managua:"America/Managua",Manaus:"America/Manaus",Marigot:"America/Marigot",Martinique:"America/Martinique",Matamoros:"America/Matamoros",Mazatlan:"America/Mazatlan",Mendoza:"America/Mendoza",Menominee:"America/Menominee",Merida:"America/Merida",Metlakatla:"America/Metlakatla","Mexico City":"America/Mexico_City",Miquelon:"America/Miquelon",Moncton:"America/Moncton",Monterrey:"America/Monterrey",Montevideo:"America/Montevideo",Montreal:"America/Montreal",Montserrat:"America/Montserrat",Nassau:"America/Nassau","New York":"America/New_York",Nipigon:"America/Nipigon",Nome:"America/Nome",Noronha:"America/Noronha","North Dakota / Beulah":"America/North_Dakota/Beulah","North Dakota / Center":"America/North_Dakota/Center","North Dakota / New Salem":"America/North_Dakota/New_Salem",Ojinaga:"America/Ojinaga",Panama:"America/Panama",Pangnirtung:"America/Pangnirtung",Paramaribo:"America/Paramaribo",Phoenix:"America/Phoenix","Port-au-Prince":"America/Port-au-Prince","Port of Spain":"America/Port_of_Spain","Porto Acre":"America/Porto_Acre","Porto Velho":"America/Porto_Velho","Puerto Rico":"America/Puerto_Rico","Rainy River":"America/Rainy_River","Rankin Inlet":"America/Rankin_Inlet",Recife:"America/Recife",Regina:"America/Regina",Resolute:"America/Resolute","Rio Branco":"America/Rio_Branco",Rosario:"America/Rosario","Santa Isabel":"America/Santa_Isabel",Santarem:"America/Santarem",Santiago:"America/Santiago","Santo Domingo":"America/Santo_Domingo","Sao Paulo":"America/Sao_Paulo",Scoresbysund:"America/Scoresbysund",Shiprock:"America/Shiprock",Sitka:"America/Sitka","St. Barthelemy":"America/St_Barthelemy","St. Johns":"America/St_Johns","St. Kitts":"America/St_Kitts","St. Lucia":"America/St_Lucia","St. Thomas":"America/St_Thomas","St. Vincent":"America/St_Vincent","Swift Current":"America/Swift_Current",Tegucigalpa:"America/Tegucigalpa",Thule:"America/Thule","Thunder Bay":"America/Thunder_Bay",Tijuana:"America/Tijuana",Toronto:"America/Toronto",Tortola:"America/Tortola",Vancouver:"America/Vancouver",Virgin:"America/Virgin",Whitehorse:"America/Whitehorse",Winnipeg:"America/Winnipeg",Yakutat:"America/Yakutat",Yellowknife:"America/Yellowknife"},Antarctica:{Casey:"Antarctica/Casey",Davis:"Antarctica/Davis","Dumont d'Urville":"Antarctica/DumontDUrville",Macquarie:"Antarctica/Macquarie",Mawson:"Antarctica/Mawson",McMurdo:"Antarctica/McMurdo",Palmer:"Antarctica/Palmer",Rothera:"Antarctica/Rothera","South Pole":"Antarctica/South_Pole",Syowa:"Antarctica/Syowa",Troll:"Antarctica/Troll",Vostok:"Antarctica/Vostok"},Arctic:{Longyearbyen:"Arctic/Longyearbyen"},Asia:{Aden:"Asia/Aden",Almaty:"Asia/Almaty",Amman:"Asia/Amman",Anadyr:"Asia/Anadyr",Aqtau:"Asia/Aqtau",Aqtobe:"Asia/Aqtobe",Ashgabat:"Asia/Ashgabat",Ashkhabad:"Asia/Ashkhabad",Baghdad:"Asia/Baghdad",Bahrain:"Asia/Bahrain",Baku:"Asia/Baku",Bangkok:"Asia/Bangkok",Beirut:"Asia/Beirut",Bishkek:"Asia/Bishkek",Brunei:"Asia/Brunei",Calcutta:"Asia/Calcutta",Chita:"Asia/Chita",Choibalsan:"Asia/Choibalsan",Chongqing:"Asia/Chongqing",Colombo:"Asia/Colombo",Dacca:"Asia/Dacca",Damascus:"Asia/Damascus",Dhaka:"Asia/Dhaka",Dili:"Asia/Dili",Dubai:"Asia/Dubai",Dushanbe:"Asia/Dushanbe",Gaza:"Asia/Gaza",Harbin:"Asia/Harbin",Hebron:"Asia/Hebron","Ho Chi Minh":"Asia/Ho_Chi_Minh","Hong Kong":"Asia/Hong_Kong",Hovd:"Asia/Hovd",Irkutsk:"Asia/Irkutsk",Istanbul:"Asia/Istanbul",Jakarta:"Asia/Jakarta",Jayapura:"Asia/Jayapura",Jerusalem:"Asia/Jerusalem",Kabul:"Asia/Kabul",Kamchatka:"Asia/Kamchatka",Karachi:"Asia/Karachi",Kashgar:"Asia/Kashgar",Kathmandu:"Asia/Kathmandu",Katmandu:"Asia/Katmandu",Khandyga:"Asia/Khandyga",Kolkata:"Asia/Kolkata",Krasnoyarsk:"Asia/Krasnoyarsk","Kuala Lumpur":"Asia/Kuala_Lumpur",Kuching:"Asia/Kuching",Kuwait:"Asia/Kuwait",Macao:"Asia/Macao",Macau:"Asia/Macau",Magadan:"Asia/Magadan",Makassar:"Asia/Makassar",Manila:"Asia/Manila",Muscat:"Asia/Muscat",Nicosia:"Asia/Nicosia",Novokuznetsk:"Asia/Novokuznetsk",Novosibirsk:"Asia/Novosibirsk",Omsk:"Asia/Omsk",Oral:"Asia/Oral","Phnom Penh":"Asia/Phnom_Penh",Pontianak:"Asia/Pontianak",Pyongyang:"Asia/Pyongyang",Qatar:"Asia/Qatar",Qyzylorda:"Asia/Qyzylorda",Rangoon:"Asia/Rangoon",Riyadh:"Asia/Riyadh",Saigon:"Asia/Saigon",Sakhalin:"Asia/Sakhalin",Samarkand:"Asia/Samarkand",Seoul:"Asia/Seoul",Shanghai:"Asia/Shanghai",Singapore:"Asia/Singapore",Srednekolymsk:"Asia/Srednekolymsk",Taipei:"Asia/Taipei",Tashkent:"Asia/Tashkent",Tbilisi:"Asia/Tbilisi",Tehran:"Asia/Tehran","Tel Aviv":"Asia/Tel_Aviv",Thimbu:"Asia/Thimbu",Thimphu:"Asia/Thimphu",Tokyo:"Asia/Tokyo","Ujung Pandang":"Asia/Ujung_Pandang",Ulaanbaatar:"Asia/Ulaanbaatar","Ulan Bator":"Asia/Ulan_Bator",Urumqi:"Asia/Urumqi","Ust-Nera":"Asia/Ust-Nera",Vientiane:"Asia/Vientiane",Vladivostok:"Asia/Vladivostok",Yakutsk:"Asia/Yakutsk",Yekaterinburg:"Asia/Yekaterinburg",Yerevan:"Asia/Yerevan"},Atlantic:{Azores:"Atlantic/Azores",Bermuda:"Atlantic/Bermuda",Canary:"Atlantic/Canary","Cape Verde":"Atlantic/Cape_Verde",Faeroe:"Atlantic/Faeroe",Faroe:"Atlantic/Faroe","Jan Mayen":"Atlantic/Jan_Mayen",Madeira:"Atlantic/Madeira",Reykjavik:"Atlantic/Reykjavik","South Georgia":"Atlantic/South_Georgia","St. Helena":"Atlantic/St_Helena",Stanley:"Atlantic/Stanley"},Australia:{Adelaide:"Australia/Adelaide",Brisbane:"Australia/Brisbane","Broken Hill":"Australia/Broken_Hill",Canberra:"Australia/Canberra",Currie:"Australia/Currie",Darwin:"Australia/Darwin",Eucla:"Australia/Eucla",Hobart:"Australia/Hobart",Lindeman:"Australia/Lindeman","Lord Howe":"Australia/Lord_Howe",Melbourne:"Australia/Melbourne",North:"Australia/North",Perth:"Australia/Perth",Queensland:"Australia/Queensland",South:"Australia/South",Sydney:"Australia/Sydney",Tasmania:"Australia/Tasmania",Victoria:"Australia/Victoria",West:"Australia/West",Yancowinna:"Australia/Yancowinna"},Brazil:{Acre:"Brazil/Acre","Fernando de Noronha":"Brazil/DeNoronha",East:"Brazil/East",West:"Brazil/West"},Canada:{Atlantic:"Canada/Atlantic",Central:"Canada/Central",Eastern:"Canada/Eastern",Mountain:"Canada/Mountain",Newfoundland:"Canada/Newfoundland",Pacific:"Canada/Pacific",Saskatchewan:"Canada/Saskatchewan",Yukon:"Canada/Yukon"},Chile:{Continental:"Chile/Continental","Easter Island":"Chile/EasterIsland"},Europe:{Amsterdam:"Europe/Amsterdam",Andorra:"Europe/Andorra",Athens:"Europe/Athens",Belfast:"Europe/Belfast",Belgrade:"Europe/Belgrade",Berlin:"Europe/Berlin",Bratislava:"Europe/Bratislava",Brussels:"Europe/Brussels",Bucharest:"Europe/Bucharest",Budapest:"Europe/Budapest",Busingen:"Europe/Busingen",Chisinau:"Europe/Chisinau",Copenhagen:"Europe/Copenhagen",Dublin:"Europe/Dublin",Gibraltar:"Europe/Gibraltar",Guernsey:"Europe/Guernsey",Helsinki:"Europe/Helsinki","Isle of Man":"Europe/Isle_of_Man",Istanbul:"Europe/Istanbul",Jersey:"Europe/Jersey",Kaliningrad:"Europe/Kaliningrad",Kiev:"Europe/Kiev",Lisbon:"Europe/Lisbon",Ljubljana:"Europe/Ljubljana",London:"Europe/London",Luxembourg:"Europe/Luxembourg",Madrid:"Europe/Madrid",Malta:"Europe/Malta",Mariehamn:"Europe/Mariehamn",Minsk:"Europe/Minsk",Monaco:"Europe/Monaco",Moscow:"Europe/Moscow",Nicosia:"Europe/Nicosia",Oslo:"Europe/Oslo",Paris:"Europe/Paris",Podgorica:"Europe/Podgorica",Prague:"Europe/Prague",Riga:"Europe/Riga",Rome:"Europe/Rome",Samara:"Europe/Samara","San Marino":"Europe/San_Marino",Sarajevo:"Europe/Sarajevo",Simferopol:"Europe/Simferopol",Skopje:"Europe/Skopje",Sofia:"Europe/Sofia",Stockholm:"Europe/Stockholm",Tallinn:"Europe/Tallinn",Tirane:"Europe/Tirane",Tiraspol:"Europe/Tiraspol",Uzhgorod:"Europe/Uzhgorod",Vaduz:"Europe/Vaduz",Vatican:"Europe/Vatican",Vienna:"Europe/Vienna",Vilnius:"Europe/Vilnius",Volgograd:"Europe/Volgograd",Warsaw:"Europe/Warsaw",Zagreb:"Europe/Zagreb",Zaporozhye:"Europe/Zaporozhye",Zurich:"Europe/Zurich"},GMT:{"GMT-14":"Etc/GMT-14","GMT-13":"Etc/GMT-13","GMT-12":"Etc/GMT-12","GMT-11":"Etc/GMT-11","GMT-10":"Etc/GMT-10","GMT-9":"Etc/GMT-9","GMT-8":"Etc/GMT-8","GMT-7":"Etc/GMT-7","GMT-6":"Etc/GMT-6","GMT-5":"Etc/GMT-5","GMT-4":"Etc/GMT-4","GMT-3":"Etc/GMT-3","GMT-2":"Etc/GMT-2","GMT-1":"Etc/GMT-1","GMT+0":"Etc/GMT+0","GMT+1":"Etc/GMT+1","GMT+2":"Etc/GMT+2","GMT+3":"Etc/GMT+3","GMT+4":"Etc/GMT+4","GMT+5":"Etc/GMT+5","GMT+6":"Etc/GMT+6","GMT+7":"Etc/GMT+7","GMT+8":"Etc/GMT+8","GMT+9":"Etc/GMT+9","GMT+10":"Etc/GMT+10","GMT+11":"Etc/GMT+11","GMT+12":"Etc/GMT+12"},Indian:{Antananarivo:"Indian/Antananarivo",Chagos:"Indian/Chagos",Christmas:"Indian/Christmas",Cocos:"Indian/Cocos",Comoro:"Indian/Comoro",Kerguelen:"Indian/Kerguelen",Mahe:"Indian/Mahe",Maldives:"Indian/Maldives",Mauritius:"Indian/Mauritius",Mayotte:"Indian/Mayotte",Reunion:"Indian/Reunion"},Mexico:{"Baja Norte":"Mexico/BajaNorte","Baja Sur":"Mexico/BajaSur",General:"Mexico/General"},Pacific:{Apia:"Pacific/Apia",Auckland:"Pacific/Auckland",Bougainville:"Pacific/Bougainville",Chatham:"Pacific/Chatham",Chuuk:"Pacific/Chuuk",Easter:"Pacific/Easter",Efate:"Pacific/Efate",Enderbury:"Pacific/Enderbury",Fakaofo:"Pacific/Fakaofo",Fiji:"Pacific/Fiji",Funafuti:"Pacific/Funafuti",Galapagos:"Pacific/Galapagos",Gambier:"Pacific/Gambier",Guadalcanal:"Pacific/Guadalcanal",Guam:"Pacific/Guam",Honolulu:"Pacific/Honolulu",Johnston:"Pacific/Johnston",Kiritimati:"Pacific/Kiritimati",Kosrae:"Pacific/Kosrae",Kwajalein:"Pacific/Kwajalein",Majuro:"Pacific/Majuro",Marquesas:"Pacific/Marquesas",Midway:"Pacific/Midway",Nauru:"Pacific/Nauru",Niue:"Pacific/Niue",Norfolk:"Pacific/Norfolk",Noumea:"Pacific/Noumea","Pago Pago":"Pacific/Pago_Pago",Palau:"Pacific/Palau",Pitcairn:"Pacific/Pitcairn",Pohnpei:"Pacific/Pohnpei",Ponape:"Pacific/Ponape","Port Moresby":"Pacific/Port_Moresby",Rarotonga:"Pacific/Rarotonga",Saipan:"Pacific/Saipan",Samoa:"Pacific/Samoa",Tahiti:"Pacific/Tahiti",Tarawa:"Pacific/Tarawa",Tongatapu:"Pacific/Tongatapu",Truk:"Pacific/Truk",Wake:"Pacific/Wake",Wallis:"Pacific/Wallis",Yap:"Pacific/Yap"}},e.regions=function(){var n=[""];for(var t in e.timeZones)n.push(t);return n}();var t=function(){var n={};for(var t in e.timeZones){var a=e.timeZones[t];for(var r in a)n[a[r]]=t}return n}(),a=function(){var n={};for(var t in e.timeZones){var a=e.timeZones[t],r=null,o=null;for(var i in a){var s=a[i];(!r||i<r)&&(r=i,o=s)}n[t]=o}return n}();e.region="",e.$watch("model",function(n){e.region=t[n]||"",a[e.region]=n}),e.$watch("region",function(n){e.model=a[n]||null})}]),angular.module("touch",[]),angular.module("rest").factory("TranslatableMessage",[function(){return function(e){e=e||{},this.key=e.key,this.variables=e.variables}}]),angular.module("locale").factory("translationLoader",["$injector",function(e){var n=e.get("$http"),t=e.get("$q"),a=e.get("cacheService"),r=e.get("languageService"),o=function e(t,o,i){var s=i.shift();if(s){var c=function(){e(t,o,i)};r.getLanguages().then(function(e){s in e?n({cache:a.languages,method:"GET",url:"translations/"+encodeURIComponent(s)+".json"}).then(function(e){t.resolve(e.data)},c):c()},c)}else t.resolve("{}")},i=function(e){var n=e.indexOf("_");return-1===n?[e]:[e,e.substr(0,n)]};return function(e){var n=t.defer();return o(n,e.key,i(e.key)),n.promise}}]),angular.module("locale").factory("translationStringService",[function(){var e={};return e.canonicalize=function(e){return e.replace(/[^a-zA-Z0-9]+/g,"_").toUpperCase()},e}]),angular.module("rest").factory("tunnelService",["$injector",function(e){var n=e.get("Error"),t=e.get("$q"),a=e.get("$window"),r=e.get("authenticationService"),o=e.get("requestService"),i={},s=a.document;i.getTunnels=function(){var e={token:r.getCurrentToken()};return o({method:"GET",url:"api/session/tunnels",params:e})},i.getSharingProfiles=function(e){var n={token:r.getCurrentToken()};return o({method:"GET",url:"api/session/tunnels/"+encodeURIComponent(e)+"/activeConnection/connection/sharingProfiles",params:n})},i.getSharingCredentials=function(e,n){var t={token:r.getCurrentToken()};return o({method:"GET",url:"api/session/tunnels/"+encodeURIComponent(e)+"/activeConnection/sharingCredentials/"+encodeURIComponent(n),params:t})};var c=function(e){return e.replace(/[\\\/]+/g,"_")};return i.downloadStream=function(e,n,t,o){if(a.location.origin)i=a.location.origin;else var i=a.location.protocol+"//"+a.location.hostname+(a.location.port?":"+a.location.port:"");var l=i+a.location.pathname+"api/session/tunnels/"+encodeURIComponent(e)+"/streams/"+encodeURIComponent(n.index)+"/"+encodeURIComponent(c(o))+"?token="+encodeURIComponent(r.getCurrentToken()),u=s.createElement("iframe");u.style.position="fixed",u.style.border="none",u.style.width="1px",u.style.height="1px",u.style.left="-1px",u.style.top="-1px",s.body.appendChild(u),u.onload=function(){s.body.removeChild(u)},n.onblob=function(){n.sendAck("OK",Guacamole.Status.Code.SUCCESS)},n.onend=function(){a.setTimeout(function(){u.parentElement&&s.body.removeChild(u)},5e3)},u.src=l},i.uploadToStream=function(e,o,i,s){var l=t.defer();if(a.location.origin)u=a.location.origin;else var u=a.location.protocol+"//"+a.location.hostname+(a.location.port?":"+a.location.port:"");var m=u+a.location.pathname+"api/session/tunnels/"+encodeURIComponent(e)+"/streams/"+encodeURIComponent(o.index)+"/"+encodeURIComponent(c(i.name))+"?token="+encodeURIComponent(r.getCurrentToken()),p=new XMLHttpRequest;return s&&p.upload&&p.upload.addEventListener("progress",function(e){s(e.loaded)}),p.onreadystatechange=function(){4===p.readyState&&(p.status>=200&&p.status<300?l.resolve():"application/json"===p.getResponseHeader("Content-Type")?l.reject(angular.fromJson(p.responseText)):p.status>=400&&p.status<500?l.reject(new n({type:n.Type.STREAM_ERROR,statusCode:Guacamole.Status.Code.CLIENT_FORBIDDEN,message:"HTTP "+p.status})):l.reject(new n({type:n.Type.STREAM_ERROR,statusCode:Guacamole.Status.Code.INTERNAL_ERROR,message:"HTTP "+p.status})))},p.open("POST",m,!0),p.send(i),l.promise},i}]),angular.module("rest").factory("User",[function(){var e=function(e){e=e||{},this.username=e.username,this.password=e.password,this.lastActive=e.lastActive,this.attributes=e.attributes||{}};return e.Attributes={FULL_NAME:"guac-full-name",EMAIL_ADDRESS:"guac-email-address",ORGANIZATION:"guac-organization",ORGANIZATIONAL_ROLE:"guac-organizational-role"},e}]),angular.module("rest").factory("UserCredentials",["$injector",function(e){var n=e.get("$window"),t=e.get("Field"),a=function(e){e=e||{},this.expected=e.expected,this.values=e.values};return a.getQueryParameters=function(e){var n=[];return angular.forEach(e.expected,function(a){if(a.type===t.Type.QUERY_PARAMETER){var r=a.name,o=e.values[r];n.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}}),n.join("&")},a.getLink=function(e){if(n.location.origin)t=n.location.origin;else var t=n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"");var r=t+n.location.pathname+"#/",o=a.getQueryParameters(e);return o&&(r+="?"+o),r},a}]),angular.module("rest").factory("UserGroup",[function(){return function(e){e=e||{},this.identifier=e.identifier,this.attributes=e.attributes||{}}}]),angular.module("rest").factory("userGroupService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r={};return r.getUserGroups=function(e,r){var o={token:t.getCurrentToken()};return r&&(o.permission=r),n({cache:a.users,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups",params:o})},r.getUserGroup=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r),params:o})},r.deleteUserGroup=function(e,r){var o={token:t.getCurrentToken()};return n({method:"DELETE",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r.identifier),params:o}).then(function(){a.users.removeAll()})},r.createUserGroup=function(e,r){var o={token:t.getCurrentToken()};return n({method:"POST",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups",params:o,data:r}).then(function(){a.users.removeAll()})},r.saveUserGroup=function(e,r){var o={token:t.getCurrentToken()};return n({method:"PUT",url:"api/session/data/"+encodeURIComponent(e)+"/userGroups/"+encodeURIComponent(r.identifier),params:o,data:r}).then(function(){a.users.removeAll()})},r}]),angular.module("navigation").factory("userPageService",["$injector",function(e){var n=e.get("ClientIdentifier"),t=e.get("ConnectionGroup"),a=e.get("PageDefinition"),r=e.get("PermissionSet"),o=e.get("$q"),i=e.get("authenticationService"),s=e.get("connectionGroupService"),c=e.get("dataSourceService"),l=e.get("permissionService"),u=e.get("requestService"),m=e.get("translationStringService"),p={},d=new a({name:"USER_MENU.ACTION_NAVIGATE_HOME",url:"/"}),g=function(e,r){var o=null;if(f(r).length>2)return d;for(var i in e){var s=e[i],c=s.childConnections||[],l=s.childConnectionGroups||[],u=c.length+l.length;if(null===o&&1===u){var m=c[0],p=l[0];m&&(o=new a({name:m.name,url:"/client/"+n.toString({dataSource:i,type:n.Types.CONNECTION,id:m.identifier})})),p&&p.type===t.Type.BALANCING&&_.isEmpty(p.childConnections)&&_.isEmpty(p.childConnectionGroups)&&(o=new a({name:p.name,url:"/client/"+n.toString({dataSource:i,type:n.Types.CONNECTION_GROUP,id:p.identifier})}))}else if(u>=1){o=null;break}}return o||d};p.getHomePage=function(){var e=o.defer(),n=c.apply(s.getConnectionGroupTree,i.getAvailableDataSources(),t.ROOT_IDENTIFIER),a=c.apply(l.getPermissions,i.getAvailableDataSources(),i.getCurrentUsername());return o.all({rootGroups:n,permissionsSets:a}).then(function(n){e.resolve(g(n.rootGroups,n.permissionsSets))},u.DIE),e.promise};var f=function(e){var n=[],o=[],s=[],c=[],l=[];return angular.forEach(i.getAvailableDataSources(),function(n){var a=e[n];a&&(a=angular.copy(a),r.removeConnectionGroupPermission(a,r.ObjectPermissionType.UPDATE,t.ROOT_IDENTIFIER),r.removeUserPermission(a,r.ObjectPermissionType.UPDATE,i.getCurrentUsername()),(r.hasSystemPermission(a,r.SystemPermissionType.ADMINISTER)||r.hasSystemPermission(a,r.SystemPermissionType.CREATE_USER)||r.hasUserPermission(a,r.ObjectPermissionType.UPDATE)||r.hasUserPermission(a,r.ObjectPermissionType.DELETE)||r.hasUserPermission(a,r.ObjectPermissionType.ADMINISTER))&&o.push(n),(r.hasSystemPermission(a,r.SystemPermissionType.ADMINISTER)||r.hasSystemPermission(a,r.SystemPermissionType.CREATE_USER_GROUP)||r.hasUserGroupPermission(a,r.ObjectPermissionType.UPDATE)||r.hasUserGroupPermission(a,r.ObjectPermissionType.DELETE)||r.hasUserGroupPermission(a,r.ObjectPermissionType.ADMINISTER))&&s.push(n),(r.hasSystemPermission(a,r.SystemPermissionType.ADMINISTER)||r.hasSystemPermission(a,r.SystemPermissionType.CREATE_CONNECTION)||r.hasSystemPermission(a,r.SystemPermissionType.CREATE_CONNECTION_GROUP)||r.hasConnectionPermission(a,r.ObjectPermissionType.UPDATE)||r.hasConnectionGroupPermission(a,r.ObjectPermissionType.UPDATE)||r.hasConnectionPermission(a,r.ObjectPermissionType.DELETE)||r.hasConnectionGroupPermission(a,r.ObjectPermissionType.DELETE)||r.hasConnectionPermission(a,r.ObjectPermissionType.ADMINISTER)||r.hasConnectionGroupPermission(a,r.ObjectPermissionType.ADMINISTER))&&c.push(n),r.hasSystemPermission(a,r.SystemPermissionType.ADMINISTER)&&l.push(n))}),n.push(new a({name:"USER_MENU.ACTION_MANAGE_SESSIONS",url:"/settings/sessions"})),angular.forEach(l,function(e){n.push(new a({name:["USER_MENU.ACTION_VIEW_HISTORY",m.canonicalize("DATA_SOURCE_"+e)+".NAME"],url:"/settings/"+encodeURIComponent(e)+"/history"}))}),o.length&&n.push(new a({name:"USER_MENU.ACTION_MANAGE_USERS",url:"/settings/users"})),s.length&&n.push(new a({name:"USER_MENU.ACTION_MANAGE_USER_GROUPS",url:"/settings/userGroups"})),angular.forEach(c,function(e){n.push(new a({name:["USER_MENU.ACTION_MANAGE_CONNECTIONS",m.canonicalize("DATA_SOURCE_"+e)+".NAME"],url:"/settings/"+encodeURIComponent(e)+"/connections"}))}),n.push(new a({name:"USER_MENU.ACTION_MANAGE_PREFERENCES",url:"/settings/preferences"})),n};p.getSettingsPages=function(){var e=o.defer();return c.apply(l.getEffectivePermissions,i.getAvailableDataSources(),i.getCurrentUsername()).then(function(n){e.resolve(f(n))},u.DIE),e.promise};var h=function(e,n){var t=[],r=g(e,n),o=f(n);return(r===d||o.length)&&t.push(r),o.length&&t.push(new a({name:"USER_MENU.ACTION_MANAGE_SETTINGS",url:o[0].url})),t};return p.getMainPages=function(){var e=o.defer(),n=null,a=null,r=function(){n&&a&&e.resolve(h(n,a))};return c.apply(s.getConnectionGroupTree,i.getAvailableDataSources(),t.ROOT_IDENTIFIER).then(function(e){n=e,r()},u.DIE),c.apply(l.getEffectivePermissions,i.getAvailableDataSources(),i.getCurrentUsername()).then(function(e){a=e,r()},u.DIE),e.promise},p}]),angular.module("rest").factory("UserPasswordUpdate",[function(){return function(e){e=e||{},this.oldPassword=e.oldPassword,this.newPassword=e.newPassword}}]),angular.module("rest").factory("userService",["$injector",function(e){var n=e.get("requestService"),t=e.get("authenticationService"),a=e.get("cacheService"),r=e.get("UserPasswordUpdate"),o={};return o.getUsers=function(e,r){var o={token:t.getCurrentToken()};return r&&(o.permission=r),n({cache:a.users,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/users",params:o})},o.getUser=function(e,r){var o={token:t.getCurrentToken()};return n({cache:a.users,method:"GET",url:"api/session/data/"+encodeURIComponent(e)+"/users/"+encodeURIComponent(r),params:o})},o.deleteUser=function(e,r){var o={token:t.getCurrentToken()};return n({method:"DELETE",url:"api/session/data/"+encodeURIComponent(e)+"/users/"+encodeURIComponent(r.username),params:o}).then(function(){a.users.removeAll()})},o.createUser=function(e,r){var o={token:t.getCurrentToken()};return n({method:"POST",url:"api/session/data/"+encodeURIComponent(e)+"/users",params:o,data:r}).then(function(){a.users.removeAll()})},o.saveUser=function(e,r){var o={token:t.getCurrentToken()};return n({method:"PUT",url:"api/session/data/"+encodeURIComponent(e)+"/users/"+encodeURIComponent(r.username),params:o,data:r}).then(function(){a.users.removeAll()})},o.updateUserPassword=function(e,o,i,s){var c={token:t.getCurrentToken()};return n({method:"PUT",url:"api/session/data/"+encodeURIComponent(e)+"/users/"+encodeURIComponent(o)+"/password",params:c,data:new r({oldPassword:i,newPassword:s})}).then(function(){a.users.removeAll()})},o}]);