bedrock-agentcore 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/identity/client.d.ts +1 -1
- package/dist/src/identity/client.d.ts.map +1 -1
- package/dist/src/identity/client.js +6 -2
- package/dist/src/identity/client.js.map +1 -1
- package/dist/src/identity/types.d.ts +10 -2
- package/dist/src/identity/types.d.ts.map +1 -1
- package/dist/src/identity/wrappers.d.ts.map +1 -1
- package/dist/src/identity/wrappers.js +2 -0
- package/dist/src/identity/wrappers.js.map +1 -1
- package/dist/src/runtime/app.d.ts +11 -0
- package/dist/src/runtime/app.d.ts.map +1 -1
- package/dist/src/runtime/app.js +70 -14
- package/dist/src/runtime/app.js.map +1 -1
- package/dist/src/runtime/types.d.ts +2 -2
- package/dist/src/tools/browser/live-view/BrowserLiveView.d.ts.map +1 -1
- package/dist/src/tools/browser/live-view/BrowserLiveView.js +6 -3
- package/dist/src/tools/browser/live-view/BrowserLiveView.js.map +1 -1
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcv-ui/dcv-ui.js +2 -2
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-esm/dcv.js +4 -4
- package/dist/src/tools/browser/live-view/nice-dcv-web-client-sdk/dcvjs-umd/dcv.js +4 -4
- package/package.json +6 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import*as e from"react";import t,{memo as n,useEffect as r,useRef as o,useState as i,useCallback as a,useMemo as s}from"react";import c from"prop-types";import l from"dcv";import{Popover as d,StatusIndicator as u,Button as m,Modal as p,Box as f,SpaceBetween as h,Textarea as g,Grid as b,Link as v,Tabs as y,RadioGroup as w,Alert as E,Select as S,ColumnLayout as x,Toggle as M,ButtonDropdown as k,Header as C,LineChart as O,Pagination as R,BreadcrumbGroup as T,Table as I,Icon as F,Input as D,Container as A,Badge as B,ProgressBar as _,Spinner as N}from"@cloudscape-design/components";import{applyMode as P,Mode as L,applyDensity as $,Density as j}from"@cloudscape-design/global-styles";import{colorChartsPaletteCategorical1 as z,colorChartsPaletteCategorical2 as W,colorChartsPaletteCategorical3 as U,colorBorderDividerDefault as V,colorBackgroundContainerHeader as H,colorBackgroundContainerContent as q,colorTextBodyDefault as G}from"@cloudscape-design/design-tokens";import K from"@babel/runtime/helpers/extends";import Q from"react-dom";var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,X={exports:{}};var ee,te,ne,re=(J||(J=1,te=X.exports,ne=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var n=this.getLevel(),o=0;o<r.length;o++){var i=r[o];this[i]=o<n?e:this.methodFactory(i,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function l(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function d(r,o,i){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||l.apply(this,arguments)}function u(e,n){var a,s,l,u=this,m="loglevel";function p(){var e;if(typeof window!==t&&m){try{e=window.localStorage[m]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(m),o=n.indexOf(r+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o+r.length+1))[1])}catch(e){}return void 0===u.levels[e]&&(e=void 0),e}}function f(e){var t=e;if("string"==typeof t&&void 0!==u.levels[t.toUpperCase()]&&(t=u.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=u.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?m+=":"+e:"symbol"==typeof e&&(m=void 0),u.name=e,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=n||d,u.getLevel=function(){return null!=l?l:null!=s?s:a},u.setLevel=function(e,n){return l=f(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&m){try{return void(window.localStorage[m]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(m)+"="+n+";"}catch(e){}}}(l),c.call(u)},u.setDefaultLevel=function(e){s=f(e),p()||u.setLevel(e,!1)},u.resetLevel=function(){l=null,function(){if(typeof window!==t&&m){try{window.localStorage.removeItem(m)}catch(e){}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(u)},u.enableAll=function(e){u.setLevel(u.levels.TRACE,e)},u.disableAll=function(e){u.setLevel(u.levels.SILENT,e)},u.rebuild=function(){if(i!==u&&(a=f(i.getLevel())),c.call(u),i===u)for(var e in o)o[e].rebuild()},a=f(i?i.getLevel():"WARN");var h=p();null!=h&&(l=f(h)),c.call(u)}(i=new u).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new u(e,i.methodFactory)),t};var m=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=m),i},i.getLoggers=function(){return o},i.default=i,i},(ee=X).exports?ee.exports=ne():te.log=ne()),X.exports),oe=Z(re);const ie=oe.getLogger("DCV-web-sdk-UI");class ae{constructor(e){this.name=e,this.dateObject=new Date}trace(e){const t=this.dateObject;t.setTime(Date.now()),ie.trace(`${t.toISOString()} - [UI][${this.name}] TRACE ${e}`)}debug(e){const t=this.dateObject;t.setTime(Date.now()),ie.debug(`${t.toISOString()} - [UI][${this.name}] DEBUG ${e}`)}info(e){const t=this.dateObject;t.setTime(Date.now()),ie.info(`${t.toISOString()} - [UI][${this.name}] INFO ${e}`)}warn(e){const t=this.dateObject;t.setTime(Date.now()),ie.warn(`${t.toISOString()} - [UI][${this.name}] WARN ${e}`)}error(e){const t=this.dateObject;t.setTime(Date.now()),ie.error(`${t.toISOString()} - [UI][${this.name}] ERROR ${e}`)}}function se(e){return new ae(e)}var ce,le={exports:{}};var de=(ce||(ce=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new o(r,i||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,o,i,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,l,d=this._events[s],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,r),!0;case 4:return d.fn.call(d.context,t,r,o),!0;case 5:return d.fn.call(d.context,t,r,o,i),!0;case 6:return d.fn.call(d.context,t,r,o,i,a),!0}for(l=1,c=new Array(u-1);l<u;l++)c[l-1]=arguments[l];d.fn.apply(d.context,c)}else{var m,p=d.length;for(l=0;l<p;l++)switch(d[l].once&&this.removeListener(e,d[l].fn,void 0,!0),u){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,t);break;case 3:d[l].fn.call(d[l].context,t,r);break;case 4:d[l].fn.call(d[l].context,t,r,o);break;default:if(!c)for(m=1,c=new Array(u-1);m<u;m++)c[m-1]=arguments[m];d[l].fn.apply(d[l].context,c)}}return!0},s.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||r&&s.context!==r||a(this,i);else{for(var c=0,l=[],d=s.length;c<d;c++)(s[c].fn!==t||o&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(le)),le.exports);const ue=new(Z(de)),me={on:(e,t)=>ue.on(e,t),once:(e,t)=>ue.once(e,t),off:(e,t)=>ue.off(e,t),emit:(e,...t)=>ue.emit(e,...t)};function pe(e){return"function"==typeof e}function fe(e){return null==e}function he(e){return!fe(e)&&"object"==typeof e&&!Array.isArray(e)}function ge(e){return e.charAt(0).toUpperCase()+e.slice(1)}function be(e,n,r){return t.createElement("div",{style:{padding:"0 20px"}},e)}function ve(e){return(e||window).document.documentElement.clientHeight}function ye(e){return-1!==["available","attached","streaming"].indexOf(e)}Object.freeze(me);const we={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},Ee={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},Se={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},xe={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},Me={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};class ke{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);t.push(0);const n=t[0],r=t[1];if(10===n)switch(r){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(n){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=ke.getVersionPrecision(e),o=ke.getVersionPrecision(t);let i=Math.max(r,o),a=0;const s=ke.map([e,t],e=>{const t=i-ke.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return ke.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(a=i-Math.min(r,o)),i-=1;i>=a;){if(s[0][i]>s[1][i])return 1;if(s[0][i]===s[1][i]){if(i===a)return 0;i-=1}else if(s[0][i]<s[1][i])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,o;if(Object.assign)return Object.assign(e,...t);for(r=0,o=t.length;r<o;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{n[t]=e[t]})}}return e}static getBrowserAlias(e){return we[e]}static getBrowserTypeByAlias(e){return Ee[e]||""}}const Ce=/version\/(\d+(\.?_?\d+)+)/i,Oe=[{test:[/gptbot/i],describe(e){const t={name:"GPTBot"},n=ke.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe(e){const t={name:"ChatGPT-User"},n=ke.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe(e){const t={name:"OAI-SearchBot"},n=ke.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(e){const t={name:"ClaudeBot"},n=ke.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe(e){const t={name:"Omgilibot"},n=ke.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe(e){const t={name:"Diffbot"},n=ke.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe(e){const t={name:"PerplexityBot"},n=ke.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe(e){const t={name:"Perplexity-User"},n=ke.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe(e){const t={name:"YouBot"},n=ke.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe(e){const t={name:"Meta-WebIndexer"},n=ke.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe(e){const t={name:"Meta-ExternalAds"},n=ke.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe(e){const t={name:"Meta-ExternalAgent"},n=ke.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe(e){const t={name:"Meta-ExternalFetcher"},n=ke.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=ke.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe(e){const t={name:"AmazonBot"},n=ke.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe(e){const t={name:"BingCrawler"},n=ke.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe(e){const t={name:"BaiduSpider"},n=ke.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe(e){const t={name:"DuckDuckBot"},n=ke.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe(e){const t={name:"InternetArchiveCrawler"},n=ke.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({name:"FacebookExternalHit"})},{test:[/yahoo!?[\s/]*slurp/i],describe:()=>({name:"YahooSlurp"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({name:"YandexBot"})},{test:[/pingdom/i],describe:()=>({name:"PingdomBot"})},{test:[/opera/i],describe(e){const t={name:"Opera"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=ke.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe(e){const t={name:"Pale Moon"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=ke.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=ke.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=ke.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=ke.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=ke.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=ke.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=ke.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=ke.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=ke.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=ke.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=ke.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=ke.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=ke.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=ke.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=ke.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=ke.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=ke.getFirstMatch(Ce,e)||ke.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=ke.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=ke.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=ke.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe(e){const t={name:"LibreWolf"},n=ke.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=ke.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=ke.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(e){const t={name:"Sogou Browser"},n=ke.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),r=ke.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),o=ke.getFirstMatch(/se ([\d.]+)x/i,e),i=n||r||o;return i&&(t.version=i),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=ke.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=ke.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=ke.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=ke.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=ke.getFirstMatch(Ce,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:ke.getFirstMatch(t,e),version:ke.getSecondMatch(t,e)}}}];var Re=[{test:[/Roku\/DVP/],describe(e){const t=ke.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:xe.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=ke.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:xe.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=ke.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=ke.getWindowsVersionName(t);return{name:xe.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:xe.iOS},n=ke.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=ke.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=ke.getMacOSVersionName(t),r={name:xe.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=ke.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:xe.iOS,version:t}}},{test:[/OpenHarmony/i],describe(e){const t=ke.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:xe.HarmonyOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=ke.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=ke.getAndroidVersionName(t),r={name:xe.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=ke.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:xe.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=ke.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||ke.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||ke.getFirstMatch(/\bbb(\d+)/i,e);return{name:xe.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=ke.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:xe.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=ke.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:xe.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:xe.Linux})},{test:[/CrOS/],describe:()=>({name:xe.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=ke.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:xe.PlayStation4,version:t}}}],Te=[{test:[/googlebot/i],describe:()=>({type:Se.bot,vendor:"Google"})},{test:[/amazonbot/i],describe:()=>({type:Se.bot,vendor:"Amazon"})},{test:[/gptbot/i],describe:()=>({type:Se.bot,vendor:"OpenAI"})},{test:[/chatgpt-user/i],describe:()=>({type:Se.bot,vendor:"OpenAI"})},{test:[/oai-searchbot/i],describe:()=>({type:Se.bot,vendor:"OpenAI"})},{test:[/baiduspider/i],describe:()=>({type:Se.bot,vendor:"Baidu"})},{test:[/bingbot/i],describe:()=>({type:Se.bot,vendor:"Bing"})},{test:[/duckduckbot/i],describe:()=>({type:Se.bot,vendor:"DuckDuckGo"})},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:()=>({type:Se.bot,vendor:"Anthropic"})},{test:[/omgilibot/i,/webzio-extended/i],describe:()=>({type:Se.bot,vendor:"Webz.io"})},{test:[/diffbot/i],describe:()=>({type:Se.bot,vendor:"Diffbot"})},{test:[/perplexitybot/i],describe:()=>({type:Se.bot,vendor:"Perplexity AI"})},{test:[/perplexity-user/i],describe:()=>({type:Se.bot,vendor:"Perplexity AI"})},{test:[/youbot/i],describe:()=>({type:Se.bot,vendor:"You.com"})},{test:[/ia_archiver/i],describe:()=>({type:Se.bot,vendor:"Internet Archive"})},{test:[/meta-webindexer/i],describe:()=>({type:Se.bot,vendor:"Meta"})},{test:[/meta-externalads/i],describe:()=>({type:Se.bot,vendor:"Meta"})},{test:[/meta-externalagent/i],describe:()=>({type:Se.bot,vendor:"Meta"})},{test:[/meta-externalfetcher/i],describe:()=>({type:Se.bot,vendor:"Meta"})},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:()=>({type:Se.bot,vendor:"Meta"})},{test:[/yahoo/i],describe:()=>({type:Se.bot,vendor:"Yahoo"})},{test:[/yandexbot/i,/yandexmobilebot/i],describe:()=>({type:Se.bot,vendor:"Yandex"})},{test:[/pingdom/i],describe:()=>({type:Se.bot,vendor:"Pingdom"})},{test:[/huawei/i],describe(e){const t=ke.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Se.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Se.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Se.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Se.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Se.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Se.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Se.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=ke.getFirstMatch(/(ipod|iphone)/i,e);return{type:Se.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Se.mobile,vendor:"Nexus"})},{test:[/Nokia/i],describe(e){const t=ke.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:Se.mobile,vendor:"Nokia"};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:()=>({type:Se.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Se.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Se.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Se.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Se.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Se.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Se.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Se.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Se.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Se.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Se.tv})}],Ie=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:Me.Blink};const t=ke.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:Me.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:Me.Trident},n=ke.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:Me.Presto},n=ke.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:Me.Gecko},n=ke.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:Me.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:Me.WebKit},n=ke.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class Fe{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=ke.find(Oe,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=ke.find(Re,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=ke.find(Te,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=ke.find(Ie,e=>{if("function"==typeof e.test)return e.test(this);if(Array.isArray(e.test))return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return ke.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let o=0;if(Object.keys(e).forEach(i=>{const a=e[i];"string"==typeof a?(r[i]=a,o+=1):"object"==typeof a&&(t[i]=a,n+=1)}),n>0){const e=Object.keys(t),n=ke.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=ke.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(o>0){const e=Object.keys(r),t=ke.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const o=ke.getBrowserTypeByAlias(r);return t&&o&&(r=o.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const o=this.getBrowserVersion();if("string"==typeof o)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(ke.compareVersions(o,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
|
|
1
|
+
import*as e from"react";import t,{memo as n,useEffect as r,useRef as o,useState as i,useCallback as a,useMemo as s}from"react";import c from"prop-types";import l from"dcv";import{Popover as u,StatusIndicator as d,Button as m,Modal as p,Box as f,SpaceBetween as h,Textarea as g,Grid as b,Link as v,Tabs as y,RadioGroup as w,Alert as E,Select as S,ColumnLayout as x,Toggle as k,ButtonDropdown as C,Header as O,LineChart as M,Pagination as R,BreadcrumbGroup as T,Table as I,Icon as A,Input as D,Container as F,Badge as B,ProgressBar as N,Spinner as _}from"@cloudscape-design/components";import{applyMode as P,Mode as L,applyDensity as $,Density as j}from"@cloudscape-design/global-styles";import{colorChartsPaletteCategorical1 as W,colorChartsPaletteCategorical2 as z,colorChartsPaletteCategorical3 as U,colorBorderDividerDefault as V,colorBackgroundContainerHeader as H,colorBackgroundContainerContent as q,colorTextBodyDefault as G}from"@cloudscape-design/design-tokens";import K from"@babel/runtime/helpers/extends";import Q from"react-dom";var Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,X={exports:{}};var ee,te,ne,re=(J||(J=1,te=X.exports,ne=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var n=this.getLevel(),o=0;o<r.length;o++){var i=r[o];this[i]=o<n?e:this.methodFactory(i,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function l(e){return function(){typeof console!==t&&(c.call(this),this[e].apply(this,arguments))}}function u(r,o,i){return function(r){return"debug"===r&&(r="log"),typeof console!==t&&("trace"===r&&n?s:void 0!==console[r]?a(console,r):void 0!==console.log?a(console,"log"):e)}(r)||l.apply(this,arguments)}function d(e,n){var a,s,l,d=this,m="loglevel";function p(){var e;if(typeof window!==t&&m){try{e=window.localStorage[m]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(m),o=n.indexOf(r+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o+r.length+1))[1])}catch(e){}return void 0===d.levels[e]&&(e=void 0),e}}function f(e){var t=e;if("string"==typeof t&&void 0!==d.levels[t.toUpperCase()]&&(t=d.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=d.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?m+=":"+e:"symbol"==typeof e&&(m=void 0),d.name=e,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=n||u,d.getLevel=function(){return null!=l?l:null!=s?s:a},d.setLevel=function(e,n){return l=f(e),!1!==n&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t&&m){try{return void(window.localStorage[m]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(m)+"="+n+";"}catch(e){}}}(l),c.call(d)},d.setDefaultLevel=function(e){s=f(e),p()||d.setLevel(e,!1)},d.resetLevel=function(){l=null,function(){if(typeof window!==t&&m){try{window.localStorage.removeItem(m)}catch(e){}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),c.call(d)},d.enableAll=function(e){d.setLevel(d.levels.TRACE,e)},d.disableAll=function(e){d.setLevel(d.levels.SILENT,e)},d.rebuild=function(){if(i!==d&&(a=f(i.getLevel())),c.call(d),i===d)for(var e in o)o[e].rebuild()},a=f(i?i.getLevel():"WARN");var h=p();null!=h&&(l=f(h)),c.call(d)}(i=new d).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new d(e,i.methodFactory)),t};var m=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=m),i},i.getLoggers=function(){return o},i.default=i,i},(ee=X).exports?ee.exports=ne():te.log=ne()),X.exports),oe=Z(re);const ie=oe.getLogger("DCV-web-sdk-UI");class ae{constructor(e){this.name=e,this.dateObject=new Date}trace(e){const t=this.dateObject;t.setTime(Date.now()),ie.trace(`${t.toISOString()} - [UI][${this.name}] TRACE ${e}`)}debug(e){const t=this.dateObject;t.setTime(Date.now()),ie.debug(`${t.toISOString()} - [UI][${this.name}] DEBUG ${e}`)}info(e){const t=this.dateObject;t.setTime(Date.now()),ie.info(`${t.toISOString()} - [UI][${this.name}] INFO ${e}`)}warn(e){const t=this.dateObject;t.setTime(Date.now()),ie.warn(`${t.toISOString()} - [UI][${this.name}] WARN ${e}`)}error(e){const t=this.dateObject;t.setTime(Date.now()),ie.error(`${t.toISOString()} - [UI][${this.name}] ERROR ${e}`)}}function se(e){return new ae(e)}var ce,le,ue={};function de(){if(le)return ce;le=1;var e=function(e){return e&&e.Math==Math&&e};return ce=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof Y&&Y)||function(){return this}()||Function("return this")()}var me,pe,fe,he,ge,be,ve,ye,we={};function Ee(){return pe?me:(pe=1,me=function(e){try{return!!e()}catch(e){return!0}})}function Se(){if(he)return fe;he=1;var e=Ee();return fe=!e(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})}function xe(){if(be)return ge;be=1;var e=Ee();return ge=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function ke(){if(ye)return ve;ye=1;var e=xe(),t=Function.prototype.call;return ve=e?t.bind(t):function(){return t.apply(t,arguments)},ve}var Ce,Oe,Me,Re,Te,Ie,Ae,De,Fe,Be,Ne,_e,Pe,Le,$e,je,We,ze,Ue,Ve,He,qe,Ge,Ke,Qe,Ye,Ze,Je,Xe,et,tt,nt,rt,ot,it,at,st,ct,lt,ut={};function dt(){return Me?Oe:(Me=1,Oe=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function mt(){if(Te)return Re;Te=1;var e=xe(),t=Function.prototype,n=t.bind,r=t.call,o=e&&n.bind(r,r);return Re=e?function(e){return e&&o(e)}:function(e){return e&&function(){return r.apply(e,arguments)}},Re}function pt(){if(Ae)return Ie;Ae=1;var e=mt(),t=e({}.toString),n=e("".slice);return Ie=function(e){return n(t(e),8,-1)}}function ft(){if(Ne)return Be;Ne=1;var e=de().TypeError;return Be=function(t){if(null==t)throw e("Can't call method on "+t);return t}}function ht(){if(Pe)return _e;Pe=1;var e=function(){if(Fe)return De;Fe=1;var e=de(),t=mt(),n=Ee(),r=pt(),o=e.Object,i=t("".split);return De=n(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"==r(e)?i(e,""):o(e)}:o}(),t=ft();return _e=function(n){return e(t(n))}}function gt(){return $e?Le:($e=1,Le=function(e){return"function"==typeof e})}function bt(){if(We)return je;We=1;var e=gt();return je=function(t){return"object"==typeof t?null!==t:e(t)}}function vt(){if(Ue)return ze;Ue=1;var e=de(),t=gt();return ze=function(n,r){return arguments.length<2?(o=e[n],t(o)?o:void 0):e[n]&&e[n][r];var o},ze}function yt(){if(He)return Ve;He=1;var e=mt();return Ve=e({}.isPrototypeOf)}function wt(){if(Qe)return Ke;Qe=1;var e,t,n=de(),r=function(){if(Ge)return qe;Ge=1;var e=vt();return qe=e("navigator","userAgent")||""}(),o=n.process,i=n.Deno,a=o&&o.versions||i&&i.version,s=a&&a.v8;return s&&(t=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),Ke=t}function Et(){if(Ze)return Ye;Ze=1;var e=wt(),t=Ee();return Ye=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function St(){if(Xe)return Je;Xe=1;var e=Et();return Je=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function xt(){if(tt)return et;tt=1;var e=de(),t=vt(),n=gt(),r=yt(),o=St(),i=e.Object;return et=o?function(e){return"symbol"==typeof e}:function(e){var o=t("Symbol");return n(o)&&r(o.prototype,i(e))}}function kt(){if(rt)return nt;rt=1;var e=de().String;return nt=function(t){try{return e(t)}catch(e){return"Object"}}}function Ct(){if(it)return ot;it=1;var e=de(),t=gt(),n=kt(),r=e.TypeError;return ot=function(e){if(t(e))return e;throw r(n(e)+" is not a function")}}function Ot(){if(st)return at;st=1;var e=Ct();return at=function(t,n){var r=t[n];return null==r?void 0:e(r)}}function Mt(){if(lt)return ct;lt=1;var e=de(),t=ke(),n=gt(),r=bt(),o=e.TypeError;return ct=function(e,i){var a,s;if("string"===i&&n(a=e.toString)&&!r(s=t(a,e)))return s;if(n(a=e.valueOf)&&!r(s=t(a,e)))return s;if("string"!==i&&n(a=e.toString)&&!r(s=t(a,e)))return s;throw o("Can't convert object to primitive value")}}var Rt,Tt,It,At,Dt,Ft,Bt,Nt,_t,Pt,Lt,$t,jt,Wt,zt,Ut,Vt,Ht,qt,Gt,Kt,Qt,Yt,Zt,Jt={exports:{}};function Xt(){return Tt?Rt:(Tt=1,Rt=!1)}function en(){if(At)return It;At=1;var e=de(),t=Object.defineProperty;return It=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function tn(){if(Ft)return Dt;Ft=1;var e=de(),t=en(),n="__core-js_shared__",r=e[n]||t(n,{});return Dt=r}function nn(){if(Bt)return Jt.exports;Bt=1;var e=Xt(),t=tn();return(Jt.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.20.3",mode:e?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"}),Jt.exports}function rn(){if(_t)return Nt;_t=1;var e=de(),t=ft(),n=e.Object;return Nt=function(e){return n(t(e))}}function on(){if(Lt)return Pt;Lt=1;var e=mt(),t=rn(),n=e({}.hasOwnProperty);return Pt=Object.hasOwn||function(e,r){return n(t(e),r)}}function an(){if(jt)return $t;jt=1;var e=mt(),t=0,n=Math.random(),r=e(1..toString);return $t=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function sn(){if(zt)return Wt;zt=1;var e=de(),t=nn(),n=on(),r=an(),o=Et(),i=St(),a=t("wks"),s=e.Symbol,c=s&&s.for,l=i?s:s&&s.withoutSetter||r;return Wt=function(e){if(!n(a,e)||!o&&"string"!=typeof a[e]){var t="Symbol."+e;o&&n(s,e)?a[e]=s[e]:a[e]=i&&c?c(t):l(t)}return a[e]}}function cn(){if(Vt)return Ut;Vt=1;var e=de(),t=ke(),n=bt(),r=xt(),o=Ot(),i=Mt(),a=sn(),s=e.TypeError,c=a("toPrimitive");return Ut=function(e,a){if(!n(e)||r(e))return e;var l,u=o(e,c);if(u){if(void 0===a&&(a="default"),l=t(u,e,a),!n(l)||r(l))return l;throw s("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(e,a)}}function ln(){if(qt)return Ht;qt=1;var e=cn(),t=xt();return Ht=function(n){var r=e(n,"string");return t(r)?r:r+""}}function un(){if(Kt)return Gt;Kt=1;var e=de(),t=bt(),n=e.document,r=t(n)&&t(n.createElement);return Gt=function(e){return r?n.createElement(e):{}}}function dn(){if(Yt)return Qt;Yt=1;var e=Se(),t=Ee(),n=un();return Qt=!e&&!t(function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function mn(){if(Zt)return we;Zt=1;var e=Se(),t=ke(),n=function(){if(Ce)return ut;Ce=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return ut.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,ut}(),r=dt(),o=ht(),i=ln(),a=on(),s=dn(),c=Object.getOwnPropertyDescriptor;return we.f=e?c:function(e,l){if(e=o(e),l=i(l),s)try{return c(e,l)}catch(e){}if(a(e,l))return r(!t(n.f,e,l),e[l])},we}var pn,fn,hn,gn,bn,vn,yn,wn={};function En(){if(fn)return pn;fn=1;var e=Se(),t=Ee();return pn=e&&t(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Sn(){if(gn)return hn;gn=1;var e=de(),t=bt(),n=e.String,r=e.TypeError;return hn=function(e){if(t(e))return e;throw r(n(e)+" is not an object")}}function xn(){if(bn)return wn;bn=1;var e=de(),t=Se(),n=dn(),r=En(),o=Sn(),i=ln(),a=e.TypeError,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",d="writable";return wn.f=t?r?function(e,t,n){if(o(e),t=i(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var r=c(e,t);r&&r[d]&&(e[t]=n.value,n={configurable:u in n?n[u]:r[u],enumerable:l in n?n[l]:r[l],writable:!1})}return s(e,t,n)}:s:function(e,t,r){if(o(e),t=i(t),o(r),n)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw a("Accessors not supported");return"value"in r&&(e[t]=r.value),e},wn}function kn(){if(yn)return vn;yn=1;var e=Se(),t=xn(),n=dt();return vn=e?function(e,r,o){return t.f(e,r,n(1,o))}:function(e,t,n){return e[t]=n,e}}var Cn,On,Mn,Rn,Tn,In,An,Dn,Fn,Bn,Nn,_n,Pn,Ln={exports:{}};function $n(){if(On)return Cn;On=1;var e=mt(),t=gt(),n=tn(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),Cn=n.inspectSource}function jn(){if(In)return Tn;In=1;var e=nn(),t=an(),n=e("keys");return Tn=function(e){return n[e]||(n[e]=t(e))}}function Wn(){return Dn?An:(Dn=1,An={})}function zn(){if(Bn)return Fn;Bn=1;var e,t,n,r=function(){if(Rn)return Mn;Rn=1;var e=de(),t=gt(),n=$n(),r=e.WeakMap;return Mn=t(r)&&/native code/.test(n(r))}(),o=de(),i=mt(),a=bt(),s=kn(),c=on(),l=tn(),u=jn(),d=Wn(),m="Object already initialized",p=o.TypeError,f=o.WeakMap;if(r||l.state){var h=l.state||(l.state=new f),g=i(h.get),b=i(h.has),v=i(h.set);e=function(e,t){if(b(h,e))throw new p(m);return t.facade=e,v(h,e,t),t},t=function(e){return g(h,e)||{}},n=function(e){return b(h,e)}}else{var y=u("state");d[y]=!0,e=function(e,t){if(c(e,y))throw new p(m);return t.facade=e,s(e,y,t),t},t=function(e){return c(e,y)?e[y]:{}},n=function(e){return c(e,y)}}return Fn={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!a(n)||(r=t(n)).type!==e)throw p("Incompatible receiver, "+e+" required");return r}}}}function Un(){if(Pn)return Ln.exports;Pn=1;var e=de(),t=gt(),n=on(),r=kn(),o=en(),i=$n(),a=zn(),s=function(){if(_n)return Nn;_n=1;var e=Se(),t=on(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,o=t(n,"name"),i=o&&"something"===function(){}.name,a=o&&(!e||e&&r(n,"name").configurable);return Nn={EXISTS:o,PROPER:i,CONFIGURABLE:a}}().CONFIGURABLE,c=a.get,l=a.enforce,u=String(String).split("String");return(Ln.exports=function(i,a,c,d){var m,p=!!d&&!!d.unsafe,f=!!d&&!!d.enumerable,h=!!d&&!!d.noTargetGet,g=d&&void 0!==d.name?d.name:a;t(c)&&("Symbol("===String(g).slice(0,7)&&(g="["+String(g).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!n(c,"name")||s&&c.name!==g)&&r(c,"name",g),(m=l(c)).source||(m.source=u.join("string"==typeof g?g:""))),i!==e?(p?!h&&i[a]&&(f=!0):delete i[a],f?i[a]=c:r(i,a,c)):f?i[a]=c:o(a,c)})(Function.prototype,"toString",function(){return t(this)&&c(this).source||i(this)}),Ln.exports}var Vn,Hn,qn,Gn,Kn,Qn,Yn,Zn,Jn,Xn,er,tr,nr,rr,or,ir={};function ar(){if(Hn)return Vn;Hn=1;var e=Math.ceil,t=Math.floor;return Vn=function(n){var r=+n;return r!=r||0===r?0:(r>0?t:e)(r)}}function sr(){if(Gn)return qn;Gn=1;var e=ar(),t=Math.max,n=Math.min;return qn=function(r,o){var i=e(r);return i<0?t(i+o,0):n(i,o)}}function cr(){if(Qn)return Kn;Qn=1;var e=ar(),t=Math.min;return Kn=function(n){return n>0?t(e(n),9007199254740991):0}}function lr(){if(Zn)return Yn;Zn=1;var e=cr();return Yn=function(t){return e(t.length)}}function ur(){if(tr)return er;tr=1;var e=mt(),t=on(),n=ht(),r=function(){if(Xn)return Jn;Xn=1;var e=ht(),t=sr(),n=lr(),r=function(r){return function(o,i,a){var s,c=e(o),l=n(c),u=t(a,l);if(r&&i!=i){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((r||u in c)&&c[u]===i)return r||u||0;return!r&&-1}};return Jn={includes:r(!0),indexOf:r(!1)}}().indexOf,o=Wn(),i=e([].push);return er=function(e,a){var s,c=n(e),l=0,u=[];for(s in c)!t(o,s)&&t(c,s)&&i(u,s);for(;a.length>l;)t(c,s=a[l++])&&(~r(u,s)||i(u,s));return u},er}function dr(){return rr?nr:(rr=1,nr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var mr,pr,fr,hr,gr,br,vr,yr,wr,Er,Sr,xr={};function kr(){if(fr)return pr;fr=1;var e=vt(),t=mt(),n=function(){if(or)return ir;or=1;var e=ur(),t=dr().concat("length","prototype");return ir.f=Object.getOwnPropertyNames||function(n){return e(n,t)},ir}(),r=(mr||(mr=1,xr.f=Object.getOwnPropertySymbols),xr),o=Sn(),i=t([].concat);return pr=e("Reflect","ownKeys")||function(e){var t=n.f(o(e)),a=r.f;return a?i(t,a(e)):t}}function Cr(){if(gr)return hr;gr=1;var e=on(),t=kr(),n=mn(),r=xn();return hr=function(o,i,a){for(var s=t(i),c=r.f,l=n.f,u=0;u<s.length;u++){var d=s[u];e(o,d)||a&&e(a,d)||c(o,d,l(i,d))}},hr}function Or(){if(wr)return yr;wr=1;var e=de(),t=mn().f,n=kn(),r=Un(),o=en(),i=Cr(),a=function(){if(vr)return br;vr=1;var e=Ee(),t=gt(),n=/#|\.prototype\./,r=function(n,r){var c=i[o(n)];return c==s||c!=a&&(t(r)?e(r):!!r)},o=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},i=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return br=r}();return yr=function(s,c){var l,u,d,m,p,f=s.target,h=s.global,g=s.stat;if(l=h?e:g?e[f]||o(f,{}):(e[f]||{}).prototype)for(u in c){if(m=c[u],d=s.noTargetGet?(p=t(l,u))&&p.value:l[u],!a(h?u:f+(g?".":"#")+u,s.forced)&&void 0!==d){if(typeof m==typeof d)continue;i(m,d)}(s.sham||d&&d.sham)&&n(m,"sham",!0),r(l,u,m,s)}}}function Mr(){if(Sr)return Er;Sr=1;var e=de(),t=yt(),n=e.TypeError;return Er=function(e,r){if(t(r,e))return e;throw n("Incorrect invocation")}}var Rr,Tr,Ir,Ar,Dr,Fr,Br,Nr,_r,Pr,Lr,$r,jr,Wr,zr={};function Ur(){if(Tr)return Rr;Tr=1;var e=ur(),t=dr();return Rr=Object.keys||function(n){return e(n,t)}}function Vr(){if(Dr)return Ar;Dr=1;var e=vt();return Ar=e("document","documentElement")}function Hr(){if(Br)return Fr;Br=1;var e,t=Sn(),n=function(){if(Ir)return zr;Ir=1;var e=Se(),t=En(),n=xn(),r=Sn(),o=ht(),i=Ur();return zr.f=e&&!t?Object.defineProperties:function(e,t){r(e);for(var a,s=o(t),c=i(t),l=c.length,u=0;l>u;)n.f(e,a=c[u++],s[a]);return e},zr}(),r=dr(),o=Wn(),i=Vr(),a=un(),s=jn(),c="prototype",l="script",u=s("IE_PROTO"),d=function(){},m=function(e){return"<"+l+">"+e+"</"+l+">"},p=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},f=function(){try{e=new ActiveXObject("htmlfile")}catch(e){}var t,n,o;f="undefined"!=typeof document?document.domain&&e?p(e):(n=a("iframe"),o="java"+l+":",n.style.display="none",i.appendChild(n),n.src=String(o),(t=n.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):p(e);for(var s=r.length;s--;)delete f[c][r[s]];return f()};return o[u]=!0,Fr=Object.create||function(e,r){var o;return null!==e?(d[c]=t(e),o=new d,d[c]=null,o[u]=e):o=f(),void 0===r?o:n.f(o,r)}}function qr(){if(_r)return Nr;_r=1;var e=Ee();return Nr=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}function Gr(){if(Lr)return Pr;Lr=1;var e=de(),t=on(),n=gt(),r=rn(),o=jn(),i=qr(),a=o("IE_PROTO"),s=e.Object,c=s.prototype;return Pr=i?s.getPrototypeOf:function(e){var o=r(e);if(t(o,a))return o[a];var i=o.constructor;return n(i)&&o instanceof i?i.prototype:o instanceof s?c:null}}function Kr(){if(jr)return $r;jr=1;var e,t,n,r=Ee(),o=gt(),i=Hr(),a=Gr(),s=Un(),c=sn(),l=Xt(),u=c("iterator"),d=!1;return[].keys&&("next"in(n=[].keys())?(t=a(a(n)))!==Object.prototype&&(e=t):d=!0),null==e||r(function(){var t={};return e[u].call(t)!==t})?e={}:l&&(e=i(e)),o(e[u])||s(e,u,function(){return this}),$r={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:d}}!function(){if(Wr)return ue;Wr=1;var e=Or(),t=de(),n=Mr(),r=gt(),o=kn(),i=Ee(),a=on(),s=sn(),c=Kr().IteratorPrototype,l=Xt(),u=s("toStringTag"),d=t.Iterator,m=l||!r(d)||d.prototype!==c||!i(function(){d({})}),p=function(){n(this,c)};a(c,u)||o(c,u,"Iterator"),!m&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),p.prototype=c,e({global:!0,forced:m},{Iterator:p})}();var Qr,Yr,Zr,Jr,Xr,eo,to,no,ro,oo,io,ao,so,co,lo,uo,mo,po,fo,ho={};function go(){return Jr?Zr:(Jr=1,Zr={})}function bo(){if(eo)return Xr;eo=1;var e=sn(),t=go(),n=e("iterator"),r=Array.prototype;return Xr=function(e){return void 0!==e&&(t.Array===e||r[n]===e)}}function vo(){if(oo)return ro;oo=1;var e=de(),t=function(){if(no)return to;no=1;var e={};return e[sn()("toStringTag")]="z",to="[object z]"===String(e)}(),n=gt(),r=pt(),o=sn()("toStringTag"),i=e.Object,a="Arguments"==r(function(){return arguments}());return ro=t?r:function(e){var t,s,c;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(t=i(e),o))?s:a?r(t):"Object"==(c=r(t))&&n(t.callee)?"Arguments":c}}function yo(){if(ao)return io;ao=1;var e=vo(),t=Ot(),n=go(),r=sn()("iterator");return io=function(o){if(null!=o)return t(o,r)||t(o,"@@iterator")||n[e(o)]}}function wo(){if(co)return so;co=1;var e=de(),t=ke(),n=Ct(),r=Sn(),o=kt(),i=yo(),a=e.TypeError;return so=function(e,s){var c=arguments.length<2?i(e):s;if(n(c))return r(t(c,e));throw a(o(e)+" is not iterable")},so}function Eo(){if(uo)return lo;uo=1;var e=ke(),t=Sn(),n=Ot();return lo=function(r,o,i){var a,s;t(r);try{if(!(a=n(r,"return"))){if("throw"===o)throw i;return i}a=e(a,r)}catch(e){s=!0,a=e}if("throw"===o)throw i;if(s)throw a;return t(a),i}}function So(){if(po)return mo;po=1;var e=de(),t=function(){if(Yr)return Qr;Yr=1;var e=mt(),t=Ct(),n=xe(),r=e(e.bind);return Qr=function(e,o){return t(e),void 0===o?e:n?r(e,o):function(){return e.apply(o,arguments)}},Qr}(),n=ke(),r=Sn(),o=kt(),i=bo(),a=lr(),s=yt(),c=wo(),l=yo(),u=Eo(),d=e.TypeError,m=function(e,t){this.stopped=e,this.result=t},p=m.prototype;return mo=function(e,f,h){var g,b,v,y,w,E,S,x=h&&h.that,k=!(!h||!h.AS_ENTRIES),C=!(!h||!h.IS_ITERATOR),O=!(!h||!h.INTERRUPTED),M=t(f,x),R=function(e){return g&&u(g,"normal",e),new m(!0,e)},T=function(e){return k?(r(e),O?M(e[0],e[1],R):M(e[0],e[1])):O?M(e,R):M(e)};if(C)g=e;else{if(!(b=l(e)))throw d(o(e)+" is not iterable");if(i(b)){for(v=0,y=a(e);y>v;v++)if((w=T(e[v]))&&s(p,w))return w;return new m(!1)}g=c(e,b)}for(E=g.next;!(S=n(E,g)).done;){try{w=T(S.value)}catch(e){u(g,"throw",e)}if("object"==typeof w&&w&&s(p,w))return w}return new m(!1)}}!function(){if(fo)return ho;fo=1;var e=Or(),t=So(),n=Sn();e({target:"Iterator",proto:!0,real:!0},{forEach:function(e){t(n(this),e,{IS_ITERATOR:!0})}})}();var xo,ko={exports:{}};var Co=(xo||(xo=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new o(r,i||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,o=[];if(0===this._eventsCount)return o;for(r in e=this._events)t.call(e,r)&&o.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,o,i,a){var s=n?n+e:e;if(!this._events[s])return!1;var c,l,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,i),!0;case 6:return u.fn.call(u.context,t,r,o,i,a),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var m,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,o);break;default:if(!c)for(m=1,c=new Array(d-1);m<d;m++)c[m-1]=arguments[m];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,o){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||r&&s.context!==r||a(this,i);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||o&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[i]=1===l.length?l[0]:l:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(ko)),ko.exports);const Oo=new(Z(Co)),Mo={on:(e,t)=>Oo.on(e,t),once:(e,t)=>Oo.once(e,t),off:(e,t)=>Oo.off(e,t),emit:(e,...t)=>Oo.emit(e,...t)};Object.freeze(Mo);var Ro,To,Io,Ao,Do,Fo,Bo,No,_o,Po={};function Lo(){if(To)return Ro;To=1;var e=xe(),t=Function.prototype,n=t.apply,r=t.call;return Ro="object"==typeof Reflect&&Reflect.apply||(e?r.bind(n):function(){return r.apply(n,arguments)}),Ro}function $o(){if(Ao)return Io;Ao=1;var e=Un();return Io=function(t,n,r){for(var o in n)e(t,o,n[o],r);return t}}function jo(){if(Fo)return Do;Fo=1;var e=ke(),t=Ct(),n=Sn(),r=Hr(),o=kn(),i=$o(),a=sn(),s=zn(),c=Ot(),l=Kr().IteratorPrototype,u="IteratorProxy",d=s.set,m=s.getterFor(u),p=a("toStringTag");return Do=function(a,s){var f=function(e){e.type=u,e.next=t(e.iterator.next),e.done=!1,e.ignoreArg=!s,d(this,e)};return f.prototype=i(r(l),{next:function(t){var n=m(this),r=arguments.length?[n.ignoreArg?void 0:t]:s?[]:[void 0];n.ignoreArg=!1;var o=n.done?void 0:e(a,n,r);return{done:n.done,value:o}},return:function(t){var r=m(this),o=r.iterator;r.done=!0;var i=c(o,"return");return{done:!0,value:i?n(e(i,o,t)).value:t}},throw:function(t){var n=m(this),r=n.iterator;n.done=!0;var o=c(r,"throw");if(o)return e(o,r,t);throw t}}),s||o(f.prototype,p,"Generator"),f},Do}function Wo(){if(No)return Bo;No=1;var e=Sn(),t=Eo();return Bo=function(n,r,o,i){try{return i?r(e(o)[0],o[1]):r(o)}catch(e){t(n,"throw",e)}}}!function(){if(_o)return Po;_o=1;var e=Or(),t=Lo(),n=Ct(),r=Sn(),o=jo(),i=Wo(),a=o(function(e){for(var n,o,a=this.iterator,s=this.filterer,c=this.next;;){if(n=r(t(c,a,e)),this.done=!!n.done)return;if(o=n.value,i(a,s,o))return o}});e({target:"Iterator",proto:!0,real:!0},{filter:function(e){return new a({iterator:r(this),filterer:n(e)})}})}();var zo,Uo={};function Vo(e){return"function"==typeof e}function Ho(e){return null==e}function qo(e){return!Ho(e)&&"object"==typeof e&&!Array.isArray(e)}function Go(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ko(e,n,r){return t.createElement("div",{style:{padding:"0 20px"}},e)}function Qo(e){return(e||window).document.documentElement.clientHeight}function Yo(e){return-1!==["available","attached","streaming"].indexOf(e)}!function(){if(zo)return Uo;zo=1;var e=Or(),t=Lo(),n=Ct(),r=Sn(),o=jo(),i=Wo(),a=o(function(e){var n=this.iterator,o=r(t(this.next,n,e));if(!(this.done=!!o.done))return i(n,this.mapper,o.value)});e({target:"Iterator",proto:!0,real:!0},{map:function(e){return new a({iterator:r(this),mapper:n(e)})}})}();const Zo={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},Jo={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},Xo={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},ei={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},ti={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"};class ni{static getFirstMatch(e,t){const n=t.match(e);return n&&n.length>0&&n[1]||""}static getSecondMatch(e,t){const n=t.match(e);return n&&n.length>1&&n[2]||""}static matchAndReturnConst(e,t,n){if(e.test(t))return n}static getWindowsVersionName(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}}static getAndroidVersionName(e){const t=e.split(".").splice(0,2).map(e=>parseInt(e,10)||0);if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0}static getVersionPrecision(e){return e.split(".").length}static compareVersions(e,t,n=!1){const r=ni.getVersionPrecision(e),o=ni.getVersionPrecision(t);let i=Math.max(r,o),a=0;const s=ni.map([e,t],e=>{const t=i-ni.getVersionPrecision(e),n=e+new Array(t+1).join(".0");return ni.map(n.split("."),e=>new Array(20-e.length).join("0")+e).reverse()});for(n&&(a=i-Math.min(r,o)),i-=1;i>=a;){if(s[0][i]>s[1][i])return 1;if(s[0][i]===s[1][i]){if(i===a)return 0;i-=1}else if(s[0][i]<s[1][i])return-1}}static map(e,t){const n=[];let r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n}static find(e,t){let n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){const r=e[n];if(t(r,n))return r}}static assign(e,...t){const n=e;let r,o;if(Object.assign)return Object.assign(e,...t);for(r=0,o=t.length;r<o;r+=1){const e=t[r];if("object"==typeof e&&null!==e){Object.keys(e).forEach(t=>{n[t]=e[t]})}}return e}static getBrowserAlias(e){return Zo[e]}static getBrowserTypeByAlias(e){return Jo[e]||""}}const ri=/version\/(\d+(\.?_?\d+)+)/i,oi=[{test:[/googlebot/i],describe(e){const t={name:"Googlebot"},n=ni.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/opera/i],describe(e){const t={name:"Opera"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe(e){const t={name:"Opera"},n=ni.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe(e){const t={name:"Samsung Internet for Android"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe(e){const t={name:"NAVER Whale Browser"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe(e){const t={name:"MZ Browser"},n=ni.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/focus/i],describe(e){const t={name:"Focus"},n=ni.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/swing/i],describe(e){const t={name:"Swing"},n=ni.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/coast/i],describe(e){const t={name:"Opera Coast"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(e){const t={name:"Opera Touch"},n=ni.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe(e){const t={name:"Yandex Browser"},n=ni.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe(e){const t={name:"UC Browser"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe(e){const t={name:"Maxthon"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe(e){const t={name:"Epiphany"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe(e){const t={name:"Puffin"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe(e){const t={name:"Sleipnir"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe(e){const t={name:"K-Meleon"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe(e){const t={name:"WeChat"},n=ni.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe(e){const t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=ni.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe(e){const t={name:"Internet Explorer"},n=ni.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe(e){const t={name:"Microsoft Edge"},n=ni.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe(e){const t={name:"Microsoft Edge"},n=ni.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe(e){const t={name:"Vivaldi"},n=ni.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe(e){const t={name:"SeaMonkey"},n=ni.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe(e){const t={name:"Sailfish"},n=ni.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe(e){const t={name:"Amazon Silk"},n=ni.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe(e){const t={name:"PhantomJS"},n=ni.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe(e){const t={name:"SlimerJS"},n=ni.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t={name:"BlackBerry"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe(e){const t={name:"WebOS Browser"},n=ni.getFirstMatch(ri,e)||ni.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe(e){const t={name:"Bada"},n=ni.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe(e){const t={name:"Tizen"},n=ni.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe(e){const t={name:"QupZilla"},n=ni.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe(e){const t={name:"Firefox"},n=ni.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe(e){const t={name:"Electron"},n=ni.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe(e){const t={name:"Miui"},n=ni.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe(e){const t={name:"Chromium"},n=ni.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe(e){const t={name:"Chrome"},n=ni.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe(e){const t={name:"Google Search"},n=ni.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t={name:"Android Browser"},n=ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe(e){const t={name:"PlayStation 4"},n=ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe(e){const t={name:"Safari"},n=ni.getFirstMatch(ri,e);return n&&(t.version=n),t}},{test:[/.*/i],describe(e){const t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:ni.getFirstMatch(t,e),version:ni.getSecondMatch(t,e)}}}];var ii=[{test:[/Roku\/DVP/],describe(e){const t=ni.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:ei.Roku,version:t}}},{test:[/windows phone/i],describe(e){const t=ni.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:ei.WindowsPhone,version:t}}},{test:[/windows /i],describe(e){const t=ni.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=ni.getWindowsVersionName(t);return{name:ei.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(e){const t={name:ei.iOS},n=ni.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe(e){const t=ni.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=ni.getMacOSVersionName(t),r={name:ei.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe(e){const t=ni.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:ei.iOS,version:t}}},{test(e){const t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe(e){const t=ni.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=ni.getAndroidVersionName(t),r={name:ei.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe(e){const t=ni.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:ei.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(e){const t=ni.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||ni.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||ni.getFirstMatch(/\bbb(\d+)/i,e);return{name:ei.BlackBerry,version:t}}},{test:[/bada/i],describe(e){const t=ni.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:ei.Bada,version:t}}},{test:[/tizen/i],describe(e){const t=ni.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:ei.Tizen,version:t}}},{test:[/linux/i],describe:()=>({name:ei.Linux})},{test:[/CrOS/],describe:()=>({name:ei.ChromeOS})},{test:[/PlayStation 4/],describe(e){const t=ni.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:ei.PlayStation4,version:t}}}],ai=[{test:[/googlebot/i],describe:()=>({type:"bot",vendor:"Google"})},{test:[/huawei/i],describe(e){const t=ni.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:Xo.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:()=>({type:Xo.tablet,vendor:"Nexus"})},{test:[/ipad/i],describe:()=>({type:Xo.tablet,vendor:"Apple",model:"iPad"})},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:()=>({type:Xo.tablet,vendor:"Apple",model:"iPad"})},{test:[/kftt build/i],describe:()=>({type:Xo.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"})},{test:[/silk/i],describe:()=>({type:Xo.tablet,vendor:"Amazon"})},{test:[/tablet(?! pc)/i],describe:()=>({type:Xo.tablet})},{test(e){const t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe(e){const t=ni.getFirstMatch(/(ipod|iphone)/i,e);return{type:Xo.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:()=>({type:Xo.mobile,vendor:"Nexus"})},{test:[/[^-]mobi/i],describe:()=>({type:Xo.mobile})},{test:e=>"blackberry"===e.getBrowserName(!0),describe:()=>({type:Xo.mobile,vendor:"BlackBerry"})},{test:e=>"bada"===e.getBrowserName(!0),describe:()=>({type:Xo.mobile})},{test:e=>"windows phone"===e.getBrowserName(),describe:()=>({type:Xo.mobile,vendor:"Microsoft"})},{test(e){const t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:()=>({type:Xo.tablet})},{test:e=>"android"===e.getOSName(!0),describe:()=>({type:Xo.mobile})},{test:e=>"macos"===e.getOSName(!0),describe:()=>({type:Xo.desktop,vendor:"Apple"})},{test:e=>"windows"===e.getOSName(!0),describe:()=>({type:Xo.desktop})},{test:e=>"linux"===e.getOSName(!0),describe:()=>({type:Xo.desktop})},{test:e=>"playstation 4"===e.getOSName(!0),describe:()=>({type:Xo.tv})},{test:e=>"roku"===e.getOSName(!0),describe:()=>({type:Xo.tv})}],si=[{test:e=>"microsoft edge"===e.getBrowserName(!0),describe(e){if(/\sedg\//i.test(e))return{name:ti.Blink};const t=ni.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:ti.EdgeHTML,version:t}}},{test:[/trident/i],describe(e){const t={name:ti.Trident},n=ni.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:e=>e.test(/presto/i),describe(e){const t={name:ti.Presto},n=ni.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test(e){const t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe(e){const t={name:ti.Gecko},n=ni.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:()=>({name:ti.Blink})},{test:[/(apple)?webkit/i],describe(e){const t={name:ti.WebKit},n=ni.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];class ci{constructor(e,t=!1){if(null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}getUA(){return this._ua}test(e){return e.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const e=ni.find(oi,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const e=ni.find(ii,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os}getOSName(e){const{name:t}=this.getOS();return e?String(t).toLowerCase()||"":t||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(e=!1){const{type:t}=this.getPlatform();return e?String(t).toLowerCase()||"":t||""}parsePlatform(){this.parsedResult.platform={};const e=ni.find(ai,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const e=ni.find(si,e=>{if("function"==typeof e.test)return e.test(this);if(e.test instanceof Array)return e.test.some(e=>this.test(e));throw new Error("Browser's test function is not valid")});return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return ni.assign({},this.parsedResult)}satisfies(e){const t={};let n=0;const r={};let o=0;if(Object.keys(e).forEach(i=>{const a=e[i];"string"==typeof a?(r[i]=a,o+=1):"object"==typeof a&&(t[i]=a,n+=1)}),n>0){const e=Object.keys(t),n=ni.find(e,e=>this.isOS(e));if(n){const e=this.satisfies(t[n]);if(void 0!==e)return e}const r=ni.find(e,e=>this.isPlatform(e));if(r){const e=this.satisfies(t[r]);if(void 0!==e)return e}}if(o>0){const e=Object.keys(r),t=ni.find(e,e=>this.isBrowser(e,!0));if(void 0!==t)return this.compareVersion(r[t])}}isBrowser(e,t=!1){const n=this.getBrowserName().toLowerCase();let r=e.toLowerCase();const o=ni.getBrowserTypeByAlias(r);return t&&o&&(r=o.toLowerCase()),r===n}compareVersion(e){let t=[0],n=e,r=!1;const o=this.getBrowserVersion();if("string"==typeof o)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(ni.compareVersions(o,n,r))>-1}isOS(e){return this.getOSName(!0)===String(e).toLowerCase()}isPlatform(e){return this.getPlatformType(!0)===String(e).toLowerCase()}isEngine(e){return this.getEngineName(!0)===String(e).toLowerCase()}is(e,t=!1){return this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)}some(e=[]){return e.some(e=>this.is(e))}}
|
|
2
2
|
/*!
|
|
3
3
|
* Bowser - a browser detector
|
|
4
4
|
* https://github.com/lancedikson/bowser
|
|
5
5
|
* MIT License | (c) Dustin Diaz 2012-2015
|
|
6
6
|
* MIT License | (c) Denis Demchenko 2015-2019
|
|
7
|
-
*/const De=class{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Fe(e,t)}static parse(e){return new Fe(e).getResult()}static get BROWSER_MAP(){return Ee}static get ENGINE_MAP(){return Me}static get OS_MAP(){return xe}static get PLATFORMS_MAP(){return Se}}.getParser(window.navigator.userAgent),Ae="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,Be=De.getOSName(!0);let _e=window.navigator.userAgent.match("; KF");function Ne(){return function(){if("tablet"===De.getPlatformType(!0)||Le())return!0;return!1}()||"mobile"===De.getPlatformType(!0)}function Pe(){return Ne()&&navigator.userAgent.includes("Android")}function Le(){return!!De.satisfies({macos:{safari:">=13"}})&&Ae}function $e(){return De}function je(){return De.isBrowser("safari",!0)}function ze(){return"macos"===Be}function We(){return"ios"===Be}function Ue(e){window.navigator.userAgentData?.getHighEntropyValues&&window.navigator.userAgentData.getHighEntropyValues(["model"]).then(t=>{e.info(`Connection starting with device model: ${t.model}, platform: ${t.platform}`),_e=!!t.model.startsWith("KF")})}const Ve="auto-hide",He="Auto-hide toolbar",qe="Automatically hide the toolbar and display it only moving the mouse to the top border.",Ge="auto-hide-fullscreen",Ke="Auto-hide toolbar only in full screen",Qe="Fix the bar on the top only in windowed mode.",Ye="Always display the toolbar",Ze="Fix the bar on the top.",Je="Light mode",Xe="Dark mode",et="System default",tt={label:"Best responsiveness",description:"Provide most fluid experience.",minQuality:20,maxQuality:90},nt={label:"Best quality",description:"Provide best image quality.",minQuality:70,maxQuality:90},rt="adaptive",ot="current",it=[{width:1920,height:1080},{width:1440,height:900},{width:1024,height:768},{width:800,height:600}],at=()=>[...Ne()&&!_e?[{width:2560,height:1440},{width:2048,height:1080}]:[],{width:1920,height:1080},{width:1440,height:900},{width:1024,height:768},{width:800,height:600}],st=()=>[...Ne()&&!_e?[{width:1215,height:2160},{width:1080,height:2048}]:[],{width:1080,height:1920},{width:900,height:1440},{width:768,height:1024},{width:600,height:800}];let ct;function lt(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)")&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener}function dt(){return ct}lt()&&(ct=window.matchMedia("(prefers-color-scheme: dark)"));const ut=(e,t)=>{P(e.matches?L.Dark:L.Light,t)},mt=(e,t)=>{switch(e){case et:ct&&ut(ct,t);break;case Je:P(L.Light,t);break;case Xe:P(L.Dark,t)}},pt=se("Settings");let ft=null;try{ft=window.localStorage}catch(e){pt.warn(`Settings persistence disabled. Error accessing local storage: ${e.message}`)}const ht={sessionId:"",authToken:"",extensionData:"",promptReconnect:!0,logLevel:"info",wss:!0,enabledChannels:[],customChannels:[],displayCodecs:[],enableQU:!0,minQuality:30,maxQuality:0,maxDisplayWidth:0,maxDisplayHeight:0,minDisplayWidth:640,minDisplayHeight:480,debugLayer:!1,enableGraphicsDebugLayer:!1,clientHiDpiScaling:!0,enableHighPixelDensity:!1,enableWebCodecs:!0,losslessColorspace:"rgb",dynamicResolution:!0,enableShortcutEditor:!1,enableWebAuthN:!1,scaleToFit:Boolean(Ne()),volume:100,microphone:!1,webcam:!1,macOptionToAlt:!0,macCommandToControl:!1,controlToCommand:!0,appearanceMode:lt()?et:Je,toolbarBehavior:Ke,displayQuality:tt.label,metricsEnabled:!1,selectedResolution:rt,selectedWebcamId:null,highColorAccuracy:!1,forceKeyboardCombinations:!1,timezoneRedirectionEnabled:!1};function gt(){ft?.setItem("dcv-settings",JSON.stringify(ht))}function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt.apply(null,arguments)}var vt=function(t){return e.createElement("svg",bt({xmlns:"http://www.w3.org/2000/svg",width:39,height:70,viewBox:"0 0 39 69"},t),e.createElement("path",{d:"M20.3 0v28.441H0C0 19.688.871 12.38 7.047 5.793 10.664 2.512 15.324 0 20.3 0M1.602 29.496H39c.031 3.8.066 7.606.102 11.524.02 1.78.02 1.78.043 3.601l.011 2.879.024 1.469c.004 5.89-1.73 10.855-5.875 15.16-4.442 3.988-8.883 5.082-14.785 5.012-5.645-.403-9.41-2.934-13.176-6.989-3.485-4.297-3.903-8.804-3.844-14.14v-1.43c.008-1.746.023-3.488.035-5.234.024-3.91.043-7.82.067-11.852m2.671 2.633c-.043 3.27-.085 6.539-.132 9.91-.02 1.02-.04 2.04-.059 3.09-.074 6.684.492 12.016 5.379 17.05 3.402 2.852 7.371 4.368 11.828 4.301 4.969-.496 8.555-3.59 11.871-7.011 3.754-5.567 3.43-11.274 3.3-17.696-.042-3.18-.085-6.363-.132-9.644zM21.371 5.266c5.68.625 10.29 2.14 14.211 6.394C39.437 16.723 39 20.762 39 27.39H21.371zm2.672 3.16v16.328h12.285c0-4.79-.66-7.832-3.738-11.586-2.824-2.57-4.742-3.668-8.547-4.742m0 0",style:{stroke:"none",fillRule:"nonzero",fillOpacity:1}}))};function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yt.apply(null,arguments)}var wt=function(t){return e.createElement("svg",yt({xmlns:"http://www.w3.org/2000/svg",width:39,height:70,viewBox:"0 0 39 69"},t),e.createElement("path",{d:"M18.7 0c6.597.813 11.296 3.305 15.491 8.426C38.578 14.703 39 20.914 39 28.44H18.7zM0 29.496h37.398c.032 3.89.067 7.777.098 11.785l.047 3.688.012 2.941.023 1.504c.004 6.121-1.738 10.356-5.941 14.797-3.617 3.445-7.672 4.871-12.672 5.05-5.242-.183-9.813-1.945-13.621-5.527-3.43-3.773-5.418-7.879-5.406-13.011 0-.48.003-.961.003-1.457s.004-.996.008-1.508v-1.406q.008-2.585.016-5.168zm2.672 2.633c-.035 3.293-.067 6.586-.102 9.976-.015 1.028-.027 2.06-.043 3.118l-.011 2.492q-.011.626-.028 1.27c0 5.027 1.614 8.91 4.992 12.64 3.106 3.063 6.875 4.824 11.286 4.973 4.761-.227 9.214-2.45 12.527-5.828 2.953-3.77 3.68-7.997 3.59-12.645 0-.406-.004-.816-.004-1.238-.008-1.508-.031-3.012-.05-4.52-.036-3.379-.067-6.758-.102-10.238zM17.629 5.266V27.39H0c0-11.95 0-11.95 4.777-16.95C8.57 7.133 12.563 5.266 17.63 5.266M6.164 12.793c-3.21 3.523-3.492 7.324-3.492 11.96h12.285V8.427c-3.363 0-6.36 2.21-8.793 4.367m0 0",style:{stroke:"none",fillRule:"nonzero",fillOpacity:1}}))};let Et,St,xt={},Mt=[];function kt(e){St.queryFeature(e).then(t=>{pe(xt[e])&&xt[e](t)}).catch(t=>{Et.info(`Query for ${e} denied with message: ${t.message}`)})}function Ct(e){e.length>0&&function(e){e.forEach(e=>{-1!==Object.keys(xt).indexOf(e)?kt(e):(Mt.push(e),Et&&Et.info(`No callback for feature ${e} adding to pending.`))})}(e)}function Ot(e,t){e&&pe(t)?(xt[e]=t,Et.info(`Added feature listener for: ${e}`),Et.debug(`Callbacks ${Object.keys(xt)}`),Et.debug(`Pending updates ${Mt}`),-1!==Mt.indexOf(e)&&(kt(e),Mt.splice(Mt.indexOf(e),1))):Et.warn("Wrong parameters for addFeatureListener")}const Rt=ze()||We()?"⌘":"CTRL",Tt=Ne()?"":`[${Rt}+C]`,It=Ne()?"":`[${Rt}+V]`,Ft=`Press ${Tt} to copy content from remote clipboard.`,Dt=`Press ${It} to paste content to remote clipboard.`,At="Clipboard synced",Bt="success",_t=se("Clipboard");let Nt="",Pt="",Lt=!1;function $t({connection:e,copyEnabled:n,pasteEnabled:o,currentWindow:i}){const[a,s]=t.useState(!1),[c,l]=t.useState(""),[b,v]=t.useState({}),[y,w]=t.useState({}),E=()=>{s(!1),e.captureClipboardEvents(!1,i)},S=(e,t)=>{a?(v({status:e,message:t}),i.document.getElementById("modal-popover-trigger").click()):(w({status:e,message:t}),i.document.getElementById("icon-popover-trigger").click())},x=()=>{Lt||(S(Bt,At),("string"==typeof Nt||Nt instanceof String)&&l(Nt))},M=()=>{Lt||(S(Bt,At),("string"==typeof Pt||Pt instanceof String)&&l(Pt))},k=()=>{S("error","The clipboard data is too large to be transferred"),Lt=!0},C=e=>{switch(_t.info(`Received clipboard event ${e.name}`),e.name){case"established":break;case"copy":case"autoCopyDone":x();break;case"paste":case"autoPasteDone":M();break;case"dataSizeAlert":k();break;case"remoteError":"dataSizeAlert"===e.error&&k();break;case"newDataAvailable":e.autoCopy||S("info","Use the clipboard to copy data locally or remotely."),Nt=e.clipboardData["text/plain"],Lt=!1;break;case"pasteAvailableData":Pt=e.clipboardData,Lt=!1;break;default:_t.info("Unknown clipboard event.")}};return r(()=>(me.on("clipboard",C),()=>{me.off("clipboard",C)}),[i,a]),t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start"}},t.createElement("div",{style:{height:0}},t.createElement(d,{dismissButton:!1,position:"bottom",size:"large",triggerType:"custom",content:t.createElement(u,{type:y.status},y.message)},t.createElement("div",{id:"icon-popover-trigger"}))),t.createElement("div",{title:"Clipboard"},t.createElement(m,{iconName:"copy",variant:"icon",onClick:()=>{s(!0),l(""),e.captureClipboardEvents(!0,i)}}))),t.createElement(p,{onDismiss:E,visible:a,size:"large",header:"Copy and paste",footer:t.createElement(f,{float:"right"},t.createElement(m,{variant:"primary",onClick:E},"Done")),modalRoot:i.document.body},t.createElement(h,{size:"xl"},Ne()?t.createElement(h,{size:"m",direction:"horizontal"},n&&t.createElement(m,{onClick:()=>e.syncClipboards()},Ft),o&&t.createElement(m,{onClick:async()=>{const e=await navigator.clipboard.readText().catch(()=>{_t.warn("There was an error trying to gather clipboard text")}),t=new ClipboardEvent("paste",{dataType:"text/plain",clipboardData:new DataTransfer});e&&(t.clipboardData.items.add(e,"text/plain"),i.document.dispatchEvent(t))}},Dt)):t.createElement(f,null,n&&t.createElement(f,{variant:"p"},Ft),o&&t.createElement(f,{variant:"p"},Dt)),t.createElement(f,{variant:"p",margin:{bottom:"xs"}},"Content preview")),t.createElement("div",{style:{margin:"auto",width:"1px",height:0}},t.createElement(d,{dismissButton:!1,position:"top",size:"large",triggerType:"custom",content:t.createElement(u,{type:b.status},b.message)},t.createElement("div",{id:"modal-popover-trigger",style:{marginTop:"19.5px"}}))),t.createElement(g,{controlId:"textarea",value:(O=c,O.substring(0,5e3).replace(/\0/g,"").concat(O.length>5e3?" ...":"")),readOnly:!0,rows:10})));var O}$t.propTypes={connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,currentWindow:c.object};var jt,zt,Wt=n($t),Ut={};function Vt(){if(zt)return jt;zt=1;var e=function(e){return e&&e.Math===Math&&e};return jt=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof Y&&Y)||e("object"==typeof jt&&jt)||function(){return this}()||Function("return this")()}var Ht,qt,Gt,Kt,Qt,Yt,Zt,Jt,Xt={};function en(){return qt?Ht:(qt=1,Ht=function(e){try{return!!e()}catch(e){return!0}})}function tn(){if(Kt)return Gt;Kt=1;var e=en();return Gt=!e(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function nn(){if(Yt)return Qt;Yt=1;var e=en();return Qt=!e(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})}function rn(){if(Jt)return Zt;Jt=1;var e=nn(),t=Function.prototype.call;return Zt=e?t.bind(t):function(){return t.apply(t,arguments)},Zt}var on,an,sn,cn,ln,dn,un,mn,pn,fn,hn,gn,bn,vn,yn,wn,En,Sn,xn,Mn,kn,Cn,On,Rn,Tn,In,Fn,Dn,An,Bn,_n,Nn,Pn,Ln,$n,jn,zn,Wn,Un,Vn,Hn,qn={};function Gn(){return sn?an:(sn=1,an=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}})}function Kn(){if(ln)return cn;ln=1;var e=nn(),t=Function.prototype,n=t.call,r=e&&t.bind.bind(n,n);return cn=e?r:function(e){return function(){return n.apply(e,arguments)}},cn}function Qn(){if(un)return dn;un=1;var e=Kn(),t=e({}.toString),n=e("".slice);return dn=function(e){return n(t(e),8,-1)}}function Yn(){return hn?fn:(hn=1,fn=function(e){return null==e})}function Zn(){if(bn)return gn;bn=1;var e=Yn(),t=TypeError;return gn=function(n){if(e(n))throw new t("Can't call method on "+n);return n}}function Jn(){if(yn)return vn;yn=1;var e=function(){if(pn)return mn;pn=1;var e=Kn(),t=en(),n=Qn(),r=Object,o=e("".split);return mn=t(function(){return!r("z").propertyIsEnumerable(0)})?function(e){return"String"===n(e)?o(e,""):r(e)}:r}(),t=Zn();return vn=function(n){return e(t(n))}}function Xn(){if(En)return wn;En=1;var e="object"==typeof document&&document.all;return wn=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(e){return"function"==typeof e}}function er(){if(xn)return Sn;xn=1;var e=Xn();return Sn=function(t){return"object"==typeof t?null!==t:e(t)}}function tr(){if(kn)return Mn;kn=1;var e=Vt(),t=Xn();return Mn=function(n,r){return arguments.length<2?(o=e[n],t(o)?o:void 0):e[n]&&e[n][r];var o},Mn}function nr(){if(On)return Cn;On=1;var e=Kn();return Cn=e({}.isPrototypeOf)}function rr(){if(Fn)return In;Fn=1;var e,t,n=Vt(),r=function(){if(Tn)return Rn;Tn=1;var e=Vt().navigator,t=e&&e.userAgent;return Rn=t?String(t):""}(),o=n.process,i=n.Deno,a=o&&o.versions||i&&i.version,s=a&&a.v8;return s&&(t=(e=s.split("."))[0]>0&&e[0]<4?1:+(e[0]+e[1])),!t&&r&&(!(e=r.match(/Edge\/(\d+)/))||e[1]>=74)&&(e=r.match(/Chrome\/(\d+)/))&&(t=+e[1]),In=t}function or(){if(An)return Dn;An=1;var e=rr(),t=en(),n=Vt().String;return Dn=!!Object.getOwnPropertySymbols&&!t(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})}function ir(){if(_n)return Bn;_n=1;var e=or();return Bn=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ar(){if(Pn)return Nn;Pn=1;var e=tr(),t=Xn(),n=nr(),r=ir(),o=Object;return Nn=r?function(e){return"symbol"==typeof e}:function(r){var i=e("Symbol");return t(i)&&n(i.prototype,o(r))}}function sr(){if($n)return Ln;$n=1;var e=String;return Ln=function(t){try{return e(t)}catch(e){return"Object"}}}function cr(){if(zn)return jn;zn=1;var e=Xn(),t=sr(),n=TypeError;return jn=function(r){if(e(r))return r;throw new n(t(r)+" is not a function")}}function lr(){if(Un)return Wn;Un=1;var e=cr(),t=Yn();return Wn=function(n,r){var o=n[r];return t(o)?void 0:e(o)}}function dr(){if(Hn)return Vn;Hn=1;var e=rn(),t=Xn(),n=er(),r=TypeError;return Vn=function(o,i){var a,s;if("string"===i&&t(a=o.toString)&&!n(s=e(a,o)))return s;if(t(a=o.valueOf)&&!n(s=e(a,o)))return s;if("string"!==i&&t(a=o.toString)&&!n(s=e(a,o)))return s;throw new r("Can't convert object to primitive value")}}var ur,mr,pr,fr,hr,gr,br,vr,yr,wr,Er,Sr,xr,Mr,kr,Cr,Or,Rr,Tr,Ir,Fr,Dr,Ar,Br,_r={exports:{}};function Nr(){return mr?ur:(mr=1,ur=!1)}function Pr(){if(fr)return pr;fr=1;var e=Vt(),t=Object.defineProperty;return pr=function(n,r){try{t(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}}function Lr(){if(hr)return _r.exports;hr=1;var e=Nr(),t=Vt(),n=Pr(),r="__core-js_shared__",o=_r.exports=t[r]||n(r,{});return(o.versions||(o.versions=[])).push({version:"3.48.0",mode:e?"pure":"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE",source:"https://github.com/zloirock/core-js"}),_r.exports}function $r(){if(br)return gr;br=1;var e=Lr();return gr=function(t,n){return e[t]||(e[t]=n||{})}}function jr(){if(yr)return vr;yr=1;var e=Zn(),t=Object;return vr=function(n){return t(e(n))}}function zr(){if(Er)return wr;Er=1;var e=Kn(),t=jr(),n=e({}.hasOwnProperty);return wr=Object.hasOwn||function(e,r){return n(t(e),r)}}function Wr(){if(xr)return Sr;xr=1;var e=Kn(),t=0,n=Math.random(),r=e(1.1.toString);return Sr=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++t+n,36)}}function Ur(){if(kr)return Mr;kr=1;var e=Vt(),t=$r(),n=zr(),r=Wr(),o=or(),i=ir(),a=e.Symbol,s=t("wks"),c=i?a.for||a:a&&a.withoutSetter||r;return Mr=function(e){return n(s,e)||(s[e]=o&&n(a,e)?a[e]:c("Symbol."+e)),s[e]}}function Vr(){if(Or)return Cr;Or=1;var e=rn(),t=er(),n=ar(),r=lr(),o=dr(),i=Ur(),a=TypeError,s=i("toPrimitive");return Cr=function(i,c){if(!t(i)||n(i))return i;var l,d=r(i,s);if(d){if(void 0===c&&(c="default"),l=e(d,i,c),!t(l)||n(l))return l;throw new a("Can't convert object to primitive value")}return void 0===c&&(c="number"),o(i,c)}}function Hr(){if(Tr)return Rr;Tr=1;var e=Vr(),t=ar();return Rr=function(n){var r=e(n,"string");return t(r)?r:r+""}}function qr(){if(Ar)return Dr;Ar=1;var e=tn(),t=en(),n=function(){if(Fr)return Ir;Fr=1;var e=Vt(),t=er(),n=e.document,r=t(n)&&t(n.createElement);return Ir=function(e){return r?n.createElement(e):{}}}();return Dr=!e&&!t(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function Gr(){if(Br)return Xt;Br=1;var e=tn(),t=rn(),n=function(){if(on)return qn;on=1;var e={}.propertyIsEnumerable,t=Object.getOwnPropertyDescriptor,n=t&&!e.call({1:2},1);return qn.f=n?function(e){var n=t(this,e);return!!n&&n.enumerable}:e,qn}(),r=Gn(),o=Jn(),i=Hr(),a=zr(),s=qr(),c=Object.getOwnPropertyDescriptor;return Xt.f=e?c:function(e,l){if(e=o(e),l=i(l),s)try{return c(e,l)}catch(e){}if(a(e,l))return r(!t(n.f,e,l),e[l])},Xt}var Kr,Qr,Yr,Zr,Jr,Xr,eo,to={};function no(){if(Zr)return Yr;Zr=1;var e=er(),t=String,n=TypeError;return Yr=function(r){if(e(r))return r;throw new n(t(r)+" is not an object")}}function ro(){if(Jr)return to;Jr=1;var e=tn(),t=qr(),n=function(){if(Qr)return Kr;Qr=1;var e=tn(),t=en();return Kr=e&&t(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}(),r=no(),o=Hr(),i=TypeError,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c="enumerable",l="configurable",d="writable";return to.f=e?n?function(e,t,n){if(r(e),t=o(t),r(n),"function"==typeof e&&"prototype"===t&&"value"in n&&d in n&&!n[d]){var i=s(e,t);i&&i[d]&&(e[t]=n.value,n={configurable:l in n?n[l]:i[l],enumerable:c in n?n[c]:i[c],writable:!1})}return a(e,t,n)}:a:function(e,n,s){if(r(e),n=o(n),r(s),t)try{return a(e,n,s)}catch(e){}if("get"in s||"set"in s)throw new i("Accessors not supported");return"value"in s&&(e[n]=s.value),e},to}function oo(){if(eo)return Xr;eo=1;var e=tn(),t=ro(),n=Gn();return Xr=e?function(e,r,o){return t.f(e,r,n(1,o))}:function(e,t,n){return e[t]=n,e}}var io,ao,so,co,lo,uo,mo,po,fo,ho,go,bo,vo,yo,wo,Eo={exports:{}};function So(){if(co)return so;co=1;var e=Kn(),t=Xn(),n=Lr(),r=e(Function.toString);return t(n.inspectSource)||(n.inspectSource=function(e){return r(e)}),so=n.inspectSource}function xo(){if(po)return mo;po=1;var e=$r(),t=Wr(),n=e("keys");return mo=function(e){return n[e]||(n[e]=t(e))}}function Mo(){return ho?fo:(ho=1,fo={})}function ko(){if(bo)return go;bo=1;var e,t,n,r=function(){if(uo)return lo;uo=1;var e=Vt(),t=Xn(),n=e.WeakMap;return lo=t(n)&&/native code/.test(String(n))}(),o=Vt(),i=er(),a=oo(),s=zr(),c=Lr(),l=xo(),d=Mo(),u="Object already initialized",m=o.TypeError,p=o.WeakMap;if(r||c.state){var f=c.state||(c.state=new p);f.get=f.get,f.has=f.has,f.set=f.set,e=function(e,t){if(f.has(e))throw new m(u);return t.facade=e,f.set(e,t),t},t=function(e){return f.get(e)||{}},n=function(e){return f.has(e)}}else{var h=l("state");d[h]=!0,e=function(e,t){if(s(e,h))throw new m(u);return t.facade=e,a(e,h,t),t},t=function(e){return s(e,h)?e[h]:{}},n=function(e){return s(e,h)}}return go={set:e,get:t,has:n,enforce:function(r){return n(r)?t(r):e(r,{})},getterFor:function(e){return function(n){var r;if(!i(n)||(r=t(n)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}}function Co(){if(vo)return Eo.exports;vo=1;var e=Kn(),t=en(),n=Xn(),r=zr(),o=tn(),i=function(){if(ao)return io;ao=1;var e=tn(),t=zr(),n=Function.prototype,r=e&&Object.getOwnPropertyDescriptor,o=t(n,"name"),i=o&&"something"===function(){}.name,a=o&&(!e||e&&r(n,"name").configurable);return io={EXISTS:o,PROPER:i,CONFIGURABLE:a}}().CONFIGURABLE,a=So(),s=ko(),c=s.enforce,l=s.get,d=String,u=Object.defineProperty,m=e("".slice),p=e("".replace),f=e([].join),h=o&&!t(function(){return 8!==u(function(){},"length",{value:8}).length}),g=String(String).split("String"),b=Eo.exports=function(e,t,n){"Symbol("===m(d(t),0,7)&&(t="["+p(d(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!r(e,"name")||i&&e.name!==t)&&(o?u(e,"name",{value:t,configurable:!0}):e.name=t),h&&n&&r(n,"arity")&&e.length!==n.arity&&u(e,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?o&&u(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=c(e);return r(a,"source")||(a.source=f(g,"string"==typeof t?t:"")),e};return Function.prototype.toString=b(function(){return n(this)&&l(this).source||a(this)},"toString"),Eo.exports}function Oo(){if(wo)return yo;wo=1;var e=Xn(),t=ro(),n=Co(),r=Pr();return yo=function(o,i,a,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:i;if(e(a)&&n(a,l,s),s.global)c?o[i]=a:r(i,a);else{try{s.unsafe?o[i]&&(c=!0):delete o[i]}catch(e){}c?o[i]=a:t.f(o,i,{value:a,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return o}}var Ro,To,Io,Fo,Do,Ao,Bo,_o,No,Po,Lo,$o,jo,zo,Wo,Uo,Vo,Ho={};function qo(){if(Fo)return Io;Fo=1;var e=function(){if(To)return Ro;To=1;var e=Math.ceil,t=Math.floor;return Ro=Math.trunc||function(n){var r=+n;return(r>0?t:e)(r)},Ro}();return Io=function(t){var n=+t;return n!=n||0===n?0:e(n)}}function Go(){if(Ao)return Do;Ao=1;var e=qo(),t=Math.max,n=Math.min;return Do=function(r,o){var i=e(r);return i<0?t(i+o,0):n(i,o)}}function Ko(){if(_o)return Bo;_o=1;var e=qo(),t=Math.min;return Bo=function(n){var r=e(n);return r>0?t(r,9007199254740991):0}}function Qo(){if(Po)return No;Po=1;var e=Ko();return No=function(t){return e(t.length)}}function Yo(){if(zo)return jo;zo=1;var e=Kn(),t=zr(),n=Jn(),r=function(){if($o)return Lo;$o=1;var e=Jn(),t=Go(),n=Qo(),r=function(r){return function(o,i,a){var s=e(o),c=n(s);if(0===c)return!r&&-1;var l,d=t(a,c);if(r&&i!=i){for(;c>d;)if((l=s[d++])!=l)return!0}else for(;c>d;d++)if((r||d in s)&&s[d]===i)return r||d||0;return!r&&-1}};return Lo={includes:r(!0),indexOf:r(!1)}}().indexOf,o=Mo(),i=e([].push);return jo=function(e,a){var s,c=n(e),l=0,d=[];for(s in c)!t(o,s)&&t(c,s)&&i(d,s);for(;a.length>l;)t(c,s=a[l++])&&(~r(d,s)||i(d,s));return d},jo}var Zo,Jo,Xo,ei,ti,ni,ri,oi,ii,ai,si,ci,li,di,ui,mi,pi,fi,hi,gi,bi,vi,yi,wi,Ei,Si,xi,Mi,ki,Ci,Oi,Ri,Ti,Ii,Fi={};function Di(){if(Xo)return Jo;Xo=1;var e=tr(),t=Kn(),n=function(){if(Vo)return Ho;Vo=1;var e=Yo(),t=(Uo?Wo:(Uo=1,Wo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])).concat("length","prototype");return Ho.f=Object.getOwnPropertyNames||function(n){return e(n,t)},Ho}(),r=(Zo||(Zo=1,Fi.f=Object.getOwnPropertySymbols),Fi),o=no(),i=t([].concat);return Jo=e("Reflect","ownKeys")||function(e){var t=n.f(o(e)),a=r.f;return a?i(t,a(e)):t}}function Ai(){if(ti)return ei;ti=1;var e=zr(),t=Di(),n=Gr(),r=ro();return ei=function(o,i,a){for(var s=t(i),c=r.f,l=n.f,d=0;d<s.length;d++){var u=s[d];e(o,u)||a&&e(a,u)||c(o,u,l(i,u))}},ei}function Bi(){if(ii)return oi;ii=1;var e=Vt(),t=Gr().f,n=oo(),r=Oo(),o=Pr(),i=Ai(),a=function(){if(ri)return ni;ri=1;var e=en(),t=Xn(),n=/#|\.prototype\./,r=function(n,r){var c=i[o(n)];return c===s||c!==a&&(t(r)?e(r):!!r)},o=r.normalize=function(e){return String(e).replace(n,".").toLowerCase()},i=r.data={},a=r.NATIVE="N",s=r.POLYFILL="P";return ni=r}();return oi=function(s,c){var l,d,u,m,p,f=s.target,h=s.global,g=s.stat;if(l=h?e:g?e[f]||o(f,{}):e[f]&&e[f].prototype)for(d in c){if(m=c[d],u=s.dontCallGetSet?(p=t(l,d))&&p.value:l[d],!a(h?d:f+(g?".":"#")+d,s.forced)&&void 0!==u){if(typeof m==typeof u)continue;i(m,u)}(s.sham||u&&u.sham)&&n(m,"sham",!0),r(l,d,m,s)}}}function _i(){if(si)return ai;si=1;var e=nr(),t=TypeError;return ai=function(n,r){if(e(r,n))return n;throw new t("Incorrect invocation")}}function Ni(){if(ui)return di;ui=1;var e=er();return di=function(t){return e(t)||null===t}}function Pi(){if(pi)return mi;pi=1;var e=Ni(),t=String,n=TypeError;return mi=function(r){if(e(r))return r;throw new n("Can't set "+t(r)+" as a prototype")}}function Li(){if(hi)return fi;hi=1;var e=function(){if(li)return ci;li=1;var e=Kn(),t=cr();return ci=function(n,r,o){try{return e(t(Object.getOwnPropertyDescriptor(n,r)[o]))}catch(e){}}}(),t=er(),n=Zn(),r=Pi();return fi=Object.setPrototypeOf||("__proto__"in{}?function(){var o,i=!1,a={};try{(o=e(Object.prototype,"__proto__","set"))(a,[]),i=a instanceof Array}catch(e){}return function(e,a){return n(e),r(a),t(e)?(i?o(e,a):e.__proto__=a,e):e}}():void 0)}function $i(){if(bi)return gi;bi=1;var e=Xn(),t=er(),n=Li();return gi=function(r,o,i){var a,s;return n&&e(a=o.constructor)&&a!==i&&t(s=a.prototype)&&s!==i.prototype&&n(r,s),r}}function ji(){if(Ei)return wi;Ei=1;var e=function(){if(yi)return vi;yi=1;var e={};return e[Ur()("toStringTag")]="z",vi="[object z]"===String(e)}(),t=Xn(),n=Qn(),r=Ur()("toStringTag"),o=Object,i="Arguments"===n(function(){return arguments}());return wi=e?n:function(e){var a,s,c;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(s=function(e,t){try{return e[t]}catch(e){}}(a=o(e),r))?s:i?n(a):"Object"===(c=n(a))&&t(a.callee)?"Arguments":c}}function zi(){if(xi)return Si;xi=1;var e=ji(),t=String;return Si=function(n){if("Symbol"===e(n))throw new TypeError("Cannot convert a Symbol value to a string");return t(n)}}function Wi(){if(ki)return Mi;ki=1;var e=zi();return Mi=function(t,n){return void 0===t?arguments.length<2?"":n:e(t)},Mi}function Ui(){if(Ti)return Ri;Ti=1;var e=Kn(),t=Error,n=e("".replace),r=String(new t("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,i=o.test(r);return Ri=function(e,r){if(i&&"string"==typeof e&&!t.prepareStackTrace)for(;r--;)e=n(e,o,"");return e}}!function(){if(Ii)return Ut;Ii=1;var e=Bi(),t=Vt(),n=tr(),r=Gn(),o=ro().f,i=zr(),a=_i(),s=$i(),c=Wi(),l=Oi?Ci:(Oi=1,Ci={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}),d=Ui(),u=tn(),m=Nr(),p="DOMException",f=n("Error"),h=n(p),g=function(){a(this,b);var e=arguments.length,t=c(e<1?void 0:arguments[0]),n=c(e<2?void 0:arguments[1],"Error"),i=new h(t,n),l=new f(t);return l.name=p,o(i,"stack",r(1,d(l.stack,1))),s(i,this,g),i},b=g.prototype=h.prototype,v="stack"in new f(p),y="stack"in new h(1,2),w=h&&u&&Object.getOwnPropertyDescriptor(t,p),E=!(!w||w.writable&&w.configurable),S=v&&!E&&!y;e({global:!0,constructor:!0,forced:m||S},{DOMException:S?g:h});var x=n(p),M=x.prototype;if(M.constructor!==x)for(var k in m||o(M,"constructor",r(1,x)),l)if(i(l,k)){var C=l[k],O=C.s;i(x,O)||o(x,O,r(6,C.c))}}();const Vi=`OS: ${Le()?`iOS ${$e().getBrowserVersion()}(Desktop Mode on iOS Safari detected, estimating version from Safari)`:`${$e().getOSName()} ${$e().getOSVersion()}`}\nBrowser version: ${$e().getBrowserName()} ${$e().getBrowserVersion()} with ${$e().getEngineName()} engine\nPlatform: ${Le()?" Tablet (Desktop Mode on iOS Safari detected)":$e().getPlatformType()}\nWeb SDK version: ${l.version.versionStr}`,Hi=se("About");function qi(e){const[n,o]=t.useState(""),[i,a]=t.useState("");return r(()=>{null!==e.connection&&(o(Gi(e.connection.getServerInfo())),fetch("third-party-licenses.txt").then(e=>{const t=`Status code: ${e.status}, Status Text: ${e.statusText}`;if(Hi.debug(`Received response. ${t}`),[...e.headers.entries()].forEach(e=>Hi.debug(`Header: ${e[0]} with value: ${e[1]}`)),!e.ok)throw new Error(t);return e.text()}).then(e=>a(e)).catch(e=>Hi.warn(`Failed to fetch resource. Error: ${e}`)))},[e.connection]),t.createElement(p,{onDismiss:e.onDismiss,visible:e.visible,size:"large",header:"About Amazon DCV",modalRoot:window.document.body,disableContentPaddings:!0,footer:t.createElement(b,{gridDefinition:[{colspan:7},{colspan:5}]},t.createElement(f,null,"Copyright © 2017-2024, NICE s.r.l. or its affiliates. All rights reserved."),t.createElement(f,{float:"right"},t.createElement(v,{external:!0,externalIconAriaLabel:"Opens in a new tab",href:"EULA.txt"},"End User License Agreement")))},t.createElement(y,{tabs:[{label:"Client",id:"about-client",content:be(t.createElement(g,{rows:10,readOnly:!0,value:Vi}))},{label:"Server",id:"about-server",content:be(t.createElement(g,{rows:10,readOnly:!0,value:n}))},{label:"Third party notices",id:"third-party-notices",content:be(t.createElement(g,{rows:10,readOnly:!0,value:i}))}]}))}function Gi(e,t){let n="";return Object.keys(e).forEach(r=>{"version"===r?n+=`${ge(r)}: ${e[r].major}.${e[r].minor}.${e[r].revision}\n`:he(e[r])?n+=Gi(e[r],ge(r)):n+=t?`${t}-${r}: ${e[r]}\n`:`${ge(r)}: ${e[r]}\n`}),n}var Ki;function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qi.apply(null,arguments)}qi.propTypes={connection:c.object,visible:c.bool,onDismiss:c.func};var Yi=function(t){return e.createElement("svg",Qi({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ki||(Ki=e.createElement("path",{d:"M15 6h-5V1M1 6h5V1M1 10h5v5M15 10h-5v5M1 1l5 5M15 1l-5 5M6 10l-5 5M10 10l5 5"})))};const Zi=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Ji=se("Fullscreen");function Xi(e){return Boolean(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function ea({setFullscreen:e,currentDocument:n}){const[o,i]=t.useState(!1),a=()=>{const t=Xi(n);i(t),e(t)},s=()=>n.fullscreenEnabled||n.webkitFullscreenEnabled||n.mozFullScreenEnabled||n.msFullscreenEnabled;return r(()=>(s()&&Zi.forEach(e=>n.addEventListener(e,a)),()=>{s()&&Zi.forEach(e=>n.removeEventListener(e,a))}),[n,e]),t.createElement("div",{title:"Full Screen"},t.createElement(m,K({},o?{iconSvg:t.createElement(Yi,null)}:{iconName:"expand"},{variant:"icon",onClick:()=>{Xi(n)?(n.exitFullscreen&&n.exitFullscreen(),navigator?.keyboard?.unlock()):(()=>{const e=n.documentElement;e.requestFullscreen&&e.requestFullscreen(),navigator.permissions.query({name:"keyboard-lock"}).then(e=>{"denied"!==e?.state?(Ji.info("granted"===e?.state?"Keyboard lock enabled":"Requesting permission to lock keyboard"),navigator?.keyboard?.lock().catch(()=>{})):Ji.info("Keyboard lock permission denied")}).catch(()=>{Ji.debug("Keyboard-lock permission not supported by browser, defaulting to normal behaviour"),navigator?.keyboard?.lock()})})()}})))}ea.propTypes={setFullscreen:c.func,currentDocument:c.object};var ta=n(ea);const na=se("Display Layout");let ra,oa,ia,aa={},sa={},ca=null,la=0,da=0;const ua=(e,t,n)=>{const r=va(e),o=ba(e),i=r>o?at()[0]:st()[0],a=Math.max(ht.minDisplayWidth/r,ht.minDisplayHeight/o,1),s=Math.min(i.width/r,i.height/o);let c=r>o?n/o:t/r;return c<a?c=a:c>s&&(c=s),[Math.round(c*r),Math.round(c*o)]};function ma(){return oa}function pa(e){return ht.dynamicResolution&&ma()&&ht.selectedResolution===rt&&(e||ra&&ra.length>1)}function fa(e,t,n){let r,o;if(ra&&ra.length>0)1===ra.length||n?(r=ra[0].rect.width,o=ra[0].rect.height):ra.length>1&&!n&&(r=ra[1].rect.width,o=ra[1].rect.height);else{const e=t.document.getElementById("dcv-display");e?(r=e.getBoundingClientRect().width,o=e.getBoundingClientRect().height):(r=t.innerWidth,o=t.innerHeight)}pa(n)?(aa[n]&&(clearTimeout(aa[n]),aa[n]=null),aa[n]=setTimeout(()=>{!function(e,t,n){let r=va(t),o=ba(t);if(r=Math.min(r,ht.maxDisplayWidth||r),r=Math.max(r,ht.minDisplayWidth||r),o=Math.min(o,ht.maxDisplayHeight||o),o=Math.max(o,ht.minDisplayHeight||o),Ne()){const e=ua(t,r,o);r=e[0],o=e[1]}const i=()=>{const e=e=>Math.abs(sa[n].width-r)>e||Math.abs(sa[n].height-o)>e;return!Xi(t.document)&&!t.fullScreen||function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(sa[n])||e(2)};i()?(sa[n]={width:r,height:o},Ma(e,r,o,n),ze()&&je()&&ya(t.document.getElementById("dcv-display-frame"),"hidden")):ya(t.document.getElementById("dcv-display-frame"),"hidden")}(e,t,n),aa[n]=null},500)):(Ne()&&(aa[n]&&(clearTimeout(aa[n]),aa[n]=null),aa[n]=setTimeout(()=>{const i=ua(t,r,o);Ma(e,i[0],i[1],n),aa[n]=null},300)),Sa(r,o,t,n))}function ha(e,t){return`${e}x${t}`}function ga(e){return e.split("x")}function ba(e,t=!1){let n=0,r=e.document.getElementById("dcv-container"),o=e.document.getElementById("dcv-toolbar-container"),i=e.document.getElementById("dcv-display-frame");return r&&i?(n=t&&o?o.getBoundingClientRect().height:i.getBoundingClientRect().top-r.getBoundingClientRect().top,r.getBoundingClientRect().height-n):ve(e)}function va(e){const t=e.document.getElementById("dcv-container");return t?t.getBoundingClientRect().width:e.innerWidth}function ya(e,t){e&&(e.style.overflow=t)}function wa(e){const t=e.document.getElementById("dcv-display"),n=e.document.getElementById("dcv-display-frame");t&&n&&((()=>{const r=ba(e),o=t.getBoundingClientRect().height,i=o?`${Math.max(0,(r-o)/2).toString()}px`:0;t.style.marginTop=i,n.style.height=`${r.toString()}px`})(),(()=>{const r=va(e),o=t.getBoundingClientRect().width,i=o?`${Math.max(0,(r-o)/2).toString()}px`:0;t.style.marginLeft=i,n.style.width=`${r.toString()}px`})())}function Ea(e){const t=Ne()?function(){const e=va(window),t=ba(window),n=[],r=e>t?at():st(),o=r[0],i=ua(window,0,0),a=ua(window,o.width,o.height),s=i[0]/e,c=a[0]/e;return ca&&la===e&&da===t||(n.push({width:i[0],height:i[1]}),r.forEach(r=>{const o=r.height/t,i=r.width/e;o>s&&o<c&&-1===n.findIndex(t=>t.width===Math.round(o*e))&&n.push({width:Math.round(o*e),height:Math.round(o*t)}),i>s&&i<c&&-1===n.findIndex(t=>t.width===Math.round(i*e))&&n.push({width:Math.round(i*e),height:Math.round(i*t)})}),-1===n.findIndex(e=>e.width===a[0])&&n.push({width:a[0],height:a[1]}),la=e,da=t,ca=n.sort((e,t)=>t.width-e.width)),ca}():it;return t.filter(t=>{let n=!0;if(ht.minDisplayWidth&&(n=t.width>=ht.minDisplayWidth),n&&ht.maxDisplayWidth&&(n=t.width<=ht.maxDisplayWidth),n&&ht.minDisplayHeight&&(n=t.height>=ht.minDisplayHeight),n&&ht.maxDisplayWidth&&(n=t.height<=ht.maxDisplayHeight),n){const r=ga(e);t.width.toString()===r[0]&&t.height.toString()===r[1]&&(n=!1)}return n}).map(e=>({value:ha(e.width,e.height),label:ha(e.width,e.height)}))}function Sa(e,t,n,r){let o=1,i=1,a=1;const s=va(n),c=ba(n);if(wa(n),ya(n.document.getElementById("dcv-display-frame"),ht.scaleToFit?"hidden":"auto"),pa(r)||(sa[r]={}),ht.scaleToFit){if(i=s/e,a=c/t,o=Math.max(0,Math.floor(100*Math.min(1,i,a))/100),!o)return;na.info(`Requesting a display scaling factor of ${o}`),!function(e,t){const n=`scale(${e})`,r=t.getElementById("dcv-display"),o=t.getElementById("dcv-container");ia||(ia=function(){const e=window.CSS&&window.CSS.supports||window.supportsCSS;if(e&&e("( transform: scale(1) )"))return"transform";if(e&&e("( zoom: 0.8 )"))return"zoom";return"no-scale"}());if("transform"===ia)return r.style.transform=n,r.style.transformOrigin="0 0",o.style.overflow="hidden",!0;if("zoom"===ia)return r.style.zoom=e,o.style.overflow="hidden",!0;return o.style.overflow="auto",!1}(o,n.document)?na.info("CSS scaling or zoom unsupported!"):wa(n)}}function xa(e){ra=e}function Ma(e,t,n,r){let o,i,a=r?ra[0].name:ra[1].name,s=r?0:ra[0].rect.width;return ra&&ra.length>1?(o={name:a,rect:{x:s,y:0,width:t,height:n},primary:r},i=r?[o,ra[1]]:[ra[0],o],xa(i),e.requestDisplayLayout(i)):e.requestResolution(t,n)}function ka(e){const[n,o]=t.useState(ht.macOptionToAlt),[i,a]=t.useState(ht.macCommandToControl),[s,c]=t.useState(ht.controlToCommand),l=t=>{t?(ht.macOptionToAlt=n,ht.macCommandToControl=i,ht.controlToCommand=s,gt(),e.connection.setKeyboardQuirks({macOptionToAlt:n,macCommandToControl:i,forceKeyboardCombinations:ht.forceKeyboardCombinations,controlToCommand:s})):(o(ht.macOptionToAlt),a(ht.macCommandToControl),c(ht.controlToCommand))};return r(()=>(me.on("close-preferences",l),()=>{me.off("close-preferences",l)}),[n,i,s]),t.createElement(h,{size:"xxl"},!e.isClientMacOS&&e.isServerMacOS&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Control key setting"),t.createElement(w,{onChange:({detail:e})=>c(e.value),value:s,items:[{value:!0,label:"Use Control as remote Command key (⌘)"},{value:!1,label:"Use Control as remote Control (^)"}]})),e.isClientMacOS&&!e.isServerMacOS&&t.createElement(t.Fragment,null,t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Option key setting"),t.createElement(w,{onChange:({detail:e})=>o(e.value),value:n,items:[{value:!0,label:"Use Option (⌥) as remote Alt key"},{value:!1,label:"Use Option (⌥) as local modifier"}]})),t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Command key setting"),t.createElement(w,{onChange:({detail:e})=>a(e.value),value:i,items:[{value:!0,label:"Use Command (⌘) as remote Control key"},{value:!1,label:"Use Command (⌘) as remote Meta key"}]}))))}ka.propTypes={connection:c.object,isClientMacOS:c.bool,isServerMacOS:c.bool};const Ca={ERROR:{status:"error",color:"red",importance:3},WARNING:{status:"warning",color:"red",importance:2},SUCCESS:{status:"success",color:"green",importance:1},INFO:{status:"info",color:"blue",importance:1}};let Oa=0,Ra=[];function Ta(e,t){let n,r=(e=>({id:Oa++,level:fe(e.level)?Ca.INFO:e.level,header:fe(e.header)?"":e.header,description:fe(e.description)?null:e.description,progress:fe(e.progress)?null:e.progress,uploadedBytes:fe(e.progress)?null:e.uploadedBytes,totalBytes:fe(e.progress)?null:e.totalBytes,uploadedFiles:fe(e.progress)?null:e.uploadedFiles,totalFiles:fe(e.progress)?null:e.totalFiles,actions:fe(e.actions)?{}:e.actions,timestamp:Date.now()}))(e),o=-1;return fe(t)||(o=Ra.findIndex(e=>e.id===t)),-1===o?n=[r].concat(Ra.map(e=>({...e}))):(n=Ra.map(e=>({...e})),n[o]=r),Ra=n,me.emit("notifications-update",Ra),r.id}function Ia(e){const t=Ra.map(e=>({...e})).filter(t=>t.id!==e);Ra=t,me.emit("notifications-update",Ra)}function Fa(e,t,n,r,o,i){if(!fe(t)){const a=Ra.findIndex(e=>e.id===t);if(-1!==a){const t=Ra.map(e=>({...e}));t[a].progress=e,t[a].uploadedBytes=n,t[a].totalBytes=r,t[a].uploadedFiles=o,t[a].totalFiles=i,Ra=t,me.emit("notifications-update",Ra)}}}const Da=se("UI CameraSelect");let Aa=null;function Ba(e){const[n,i]=t.useState(),[a,s]=t.useState([]),[c,l]=t.useState(),d=o(!0),u=e=>{Ta({level:Ca.ERROR,header:"Error getting devices.",description:e.message,actions:{dismissable:!0}},null)},p=e=>{const t=[];e.filter(e=>"videoinput"===e.kind).forEach((e,n)=>{t.push({label:e.label||`Camera ${n+1}`,value:e.deviceId})}),s(t)},g=()=>{e.connection.getConnectedDevices().then(p).catch(u)},b=()=>{navigator.permissions.query({name:"camera"}).then(t=>{Aa&&(Aa.onchange=null),Aa=t,n||(t.onchange=b,g()),i(t.state),"granted"===t.state&&ye(e.webcamStatus)&&g()}).catch(e=>{e instanceof TypeError?Da.info(e.message):Da.warn(e.message)})},v=t=>{t?c&&(e.setWebcamId(c),ht.selectedWebcamId=c,gt()):l(ht.selectedWebcamId)},y=()=>t.createElement(m,{iconAlign:"right",href:"https://docs.aws.amazon.com/dcv/latest/userguide/using-webcam.html",target:"_blank",iconName:"external"},"Read more");r(()=>{a.filter(t=>e.webcamId===t.value).length?l(e.webcamId):a.length&&(l(a[0].value),e.setWebcamId(a[0].value))},[e.webcamId,n,a]),r(()=>{e.webcamStatus&&(Da.info(`Webcam enabled. Status: ${e.webcamStatus}`),d.current&&(b(),d.current=!1))},[e.webcamStatus]),r(()=>(me.on("close-preferences",v),me.on("device-change",g),()=>{me.off("close-preferences",v),me.off("device-change",g)}),[e.connection,e.setWebcamId,c]);const[w,x,M,k]=(()=>{let r="",o=null,i="info",a=!0;if("busy"===e.webcamStatus)r="Camera not available. Another user is already sharing a camera within the session.",o=y(),i="warning";else switch(n){case"prompt":r="Camera not available. Grant camera permission to use it.",o=t.createElement(m,{onClick:()=>navigator.mediaDevices.getUserMedia({video:!0})},"Allow detection"),i="info";break;case"denied":r="Camera not available. Grant camera permission to use it.",o=y(),i="warning";break;case"granted":"streaming"===e.webcamStatus?(r="The selected camera cannot be changed while the streaming is active.",o=y(),i="warning"):(r="Camera available. Check the browser settings to change this site's camera permission.",o=y(),i="info",a=!1)}return[r,o,i,a]})();return t.createElement(h,{size:"l"},t.createElement(E,{action:x,type:M},w),t.createElement("div",null,t.createElement(f,null,"Camera"),t.createElement(f,{color:"text-body-secondary",fontSize:"body-s",margin:{bottom:"s"}},"Select which camera to activate."),t.createElement("div",{style:{width:"70%"}},t.createElement(S,{selectedOption:(e=>{const t=a.filter(t=>e===t.value);return t.length?t[0]:null})(c),onChange:({detail:e})=>l(e.selectedOption.value),options:a,selectedAriaLabel:"Selected",disabled:k}))))}Ba.propTypes={connection:c.object,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func};const _a=se("Preferences");function Na(e){const[n,o]=t.useState("general"),[i,a]=t.useState(ht.selectedResolution),[s,c]=t.useState(ht.metricsEnabled),[d,u]=t.useState(!1),[g,b]=t.useState(!1),[v,E]=t.useState(ht.enableHighPixelDensity),[S,k]=t.useState(ht.displayQuality),[C,O]=t.useState(ht.appearanceMode),[R,T]=t.useState(ht.toolbarBehavior),[I,F]=t.useState(260),[D,A]=t.useState(0),[B,_]=t.useState(ht.timezoneRedirectionEnabled),N=e.connection.getServerInfo().os.startsWith("Darwin"),P=e=>{Ta({level:Ca.WARNING,header:"Timezone Redirection config error.",description:t.createElement("div",null,"Failed to ",B?"enable":"disable",".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})},L=()=>{me.emit("close-preferences",!1),a(ht.selectedResolution),E(ht.enableHighPixelDensity),k(ht.displayQuality),O(ht.appearanceMode),T(ht.toolbarBehavior),c(ht.metricsEnabled),b(ht.highColorAccuracy),_(ht.timezoneRedirectionEnabled),e.onDismiss()};return r(()=>{e.connection&&Ot("high-color-accuracy",e=>{u(e.available),b(e.enabled),F(e.available?350:300),e.available&&(ht.highColorAccuracy=e.enabled,gt())})},[e.connection]),r(()=>{A(e.timezoneRedirectionSetting),e.connection&&e.timezoneRedirectionSetting===l.TimezoneRedirectionSetting.CLIENT_DECIDES&&e.connection.enableTimezoneRedirection(B).catch(P)},[e.connection,e.timezoneRedirectionSetting]),t.createElement(p,{onDismiss:L,visible:e.visible,size:"large",header:"Preferences",modalRoot:window.document.body,disableContentPaddings:!0,footer:t.createElement(f,{float:"right"},t.createElement(h,{direction:"horizontal",size:"xs"},t.createElement(m,{variant:"link",onClick:L},"Cancel"),t.createElement(m,{variant:"primary",onClick:()=>{me.emit("close-preferences",!0),(()=>{let t;S!==ht.displayQuality&&(t=S===tt.label?tt:nt,e.connection.setDisplayQuality(t.minQuality,t.maxQuality),_a.info(`Switching to ${S} display mode`),ht.displayQuality=S)})(),C!==ht.appearanceMode&&(ht.appearanceMode=C,e.submitAppearanceModePreferences(C)),R!==ht.toolbarBehavior&&(ht.toolbarBehavior=R,e.submitToolbarBehaviorPreferences(R)),s!==ht.metricsEnabled&&(ht.metricsEnabled=s,e.submitMetricsPreferences(s)),(()=>{if(!d)return;const n=g?"enable":"disable";e.connection.requestDisplayConfig(g).catch(e=>{Ta({level:Ca.WARNING,header:"Display config error.",description:t.createElement("div",null,"Failed to ",n," high color accuracy.",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})})})(),i!==ht.selectedResolution&&(ht.selectedResolution=i===rt?rt:ot,e.submitResolutionPreferences(i),a(ht.selectedResolution)),ze()&&v!==ht.enableHighPixelDensity&&(ht.enableHighPixelDensity=v,e.connection.enableHighPixelDensity(v)),B!==ht.timezoneRedirectionEnabled&&(ht.timezoneRedirectionEnabled=B,D===l.TimezoneRedirectionSetting.CLIENT_DECIDES&&e.connection.enableTimezoneRedirection(B).catch(P)),gt(),e.onDismiss()}},"Save")))},t.createElement("div",{style:{height:I}},t.createElement(y,{activeTabId:n,onChange:({detail:e})=>o(e.activeTabId),tabs:[{label:"General",id:"general",content:be(t.createElement(x,{columns:2},t.createElement("div",null,t.createElement(h,{size:"xxl"},t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Appearance"),t.createElement(w,{onChange:({detail:e})=>O(e.value),value:C,items:[...lt()?[{value:et,label:et+(e.systemDefaultAppearanceMode?` (${ge(e.systemDefaultAppearanceMode)})`:"")}]:[],{value:Je,label:Je},{value:Xe,label:Xe}]})),D===l.TimezoneRedirectionSetting.CLIENT_DECIDES?t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Time Zone Redirection"),t.createElement(M,{onChange:({detail:e})=>_(e.checked),checked:B},B?"Enabled":"Disabled")):null)),t.createElement("div",null,t.createElement(f,{margin:{bottom:"s"}},"Toolbar behavior"),t.createElement(w,{onChange:({detail:e})=>T(e.value),value:R,items:[{value:He,label:He,description:qe},{value:Ke,label:Ke,description:Qe},{value:Ye,label:Ye,description:Ze}]}))))},{label:"Display",id:"display",content:be(t.createElement(x,{columns:2},t.createElement(h,{size:"xxl"},t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Streaming mode"),t.createElement(w,{onChange:({detail:e})=>k(e.value),value:S,items:[{value:tt.label,label:tt.label,description:tt.description},{value:nt.label,label:nt.label,description:nt.description}]})),d&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"High color accuracy (YUV 4:4:4)"),t.createElement(M,{onChange:({detail:e})=>b(e.checked),checked:g,description:"Streaming performance could be affected."},g?"Enabled":"Disabled")),t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Streaming metrics in the toolbar"),t.createElement(M,{onChange:({detail:e})=>c(e.checked),checked:s},s?"Enabled":"Disabled"))),t.createElement(h,{size:"xxl"},ze()&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"High pixel density"),t.createElement(M,{onChange:({detail:e})=>E(e.checked),checked:v},v?"Enabled":"Disabled")),ma()?t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Display resolution"),t.createElement(w,{onChange:({detail:e})=>a(e.value),value:i,items:[{value:rt,label:"Adapt automatically"},{value:ot,label:`${e.currentResolution} (Current)`},...Ea(e.currentResolution)]})):null)))},...(ze()?!N:N)?[{label:"Keyboard",id:"keyboard",content:be(t.createElement(ka,{connection:e.connection,isClientMacOS:ze(),isServerMacOS:N}))}]:[],...e.webcamStatus&&"not-available"!==e.webcamStatus?[{label:"Camera",id:"camera",content:be(t.createElement(Ba,{connection:e.connection,webcamStatus:e.webcamStatus,webcamId:e.webcamId,setWebcamId:e.setWebcamId}))}]:[]]})))}Na.propTypes={connection:c.object,visible:c.bool,onDismiss:c.func,submitResolutionPreferences:c.func,currentResolution:c.string,submitMetricsPreferences:c.func,submitAppearanceModePreferences:c.func,submitToolbarBehaviorPreferences:c.func,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func,systemDefaultAppearanceMode:c.oneOf([L.Light,L.Dark]),timezoneRedirectionSetting:c.number};const Pa=se("DropdownMenu");let La;function $a({connection:e,relativeMouseModeEnabled:n,sasEnabled:o,focusDisplay:i,screenshotEnabled:a,currentResolution:s,submitResolutionPreferences:c,submitMetricsPreferences:l,submitAppearanceModePreferences:d,submitToolbarBehaviorPreferences:u,webcamStatus:m,webcamId:p,setWebcamId:f,systemDefaultAppearanceMode:h,timezoneRedirectionSetting:g}){const[b,v]=t.useState(""),[y,w]=t.useState(!1),[E,S]=t.useState(!1),[x,M]=t.useState(!1),[C,O]=t.useState(0),[R,T]=t.useState(!1),I=n=>{switch(n){case"relativeMouseMode":navigator.permissions.query({name:"pointer-lock"}).then(t=>{"denied"!==t?.state?(Pa.info("granted"===t?.state?"Mouse lock enabled: enabling relative mouse":"Requesting permission to lock mouse, to enable relative mouse"),e.enterRelativeMouseMode()):(Pa.info("Mouse lock permission denied, couldn't enable relative mouse"),Ta({level:Ca.WARNING,header:"Permissions to mouse lock was not granted.",description:"Enable mouse lock permissions and try again.",actions:{dismissable:!0}}))}).catch(()=>{Pa.debug("Pointer-lock permission not supported by browser, defaulting to normal behaviour"),e.enterRelativeMouseMode()});break;case"trackpad-mode":e.setTrackpadMode(!E)&&(S(!E),me.emit("trackpadMode",!E));break;case"SAS":!function(e){e.sendKeyboardShortcut([{key:"Control",location:KeyboardEvent.DOM_KEY_LOCATION_LEFT},{key:"Alt",location:KeyboardEvent.DOM_KEY_LOCATION_LEFT},{key:"Delete",location:KeyboardEvent.DOM_KEY_LOCATION_STANDARD}])}(e),T(!0);break;case"preferences":M(!0);break;case"screenshot":!function(e){const n=e=>{Pa.error(`Failed to capture screenshot: ${e.message}`),Ta({level:Ca.ERROR,header:"Screenshot error",description:t.createElement("div",null,"Failed to capture screenshot.",t.createElement("br",null),"Error: ",e.message),actions:{dismissable:!0}})};La=setTimeout(()=>{Pa.warn("No response to the screenshot request"),n({message:"Timeout"}),La=null},2e4),e.getScreenshot().catch(e=>{La&&clearTimeout(La),n(e)})}(e);break;case"aboutDCV":w(!0);break;case"disconnection":e.disconnect()}};return r(()=>{null!==e&&v(e.getServerInfo().hostname)},[e]),r(()=>(me.on("screenshot",za),()=>{me.off("screenshot",za)}),[]),r(()=>{O(g)},[g]),r(()=>{R&&(i(),T(!1))},[R]),t.createElement("div",{title:"More"},t.createElement(k,{onItemClick:({detail:e})=>I(e.id),items:[...n&&!Ne()?[{text:"Use relative mouse [Ctrl + Shift + F8]",id:"relativeMouseMode"}]:[],...Ne()?[{text:(E?"Disable":"Enable")+" trackpad mode",id:"trackpad-mode"}]:[],...o?[{text:"Send Ctrl + Alt + Del",id:"SAS"}]:[],...a?[{text:"Save Screenshot",id:"screenshot"}]:[],{text:"Preferences",id:"preferences"},{text:"About Amazon DCV",id:"aboutDCV"},{text:"Disconnect",id:"disconnection"}]},b),t.createElement(qi,{connection:e,visible:y,onDismiss:()=>{w(!1)}}),t.createElement(Na,{connection:e,currentResolution:s,submitResolutionPreferences:c,visible:x,onDismiss:()=>{M(!1)},submitMetricsPreferences:l,submitAppearanceModePreferences:d,submitToolbarBehaviorPreferences:u,webcamStatus:m,webcamId:p,setWebcamId:f,systemDefaultAppearanceMode:h,timezoneRedirectionSetting:C}))}function ja(e){return btoa(function(e){let t,n=32768,r=[];for(t=0;t<e.length;t+=n)r.push(String.fromCharCode.apply(null,e.subarray(t,t+n)));return r.join("")}(new Uint8Array(e)))}function za(e){La&&clearTimeout(La),null!==e?(Pa.info("Retrieved screenshot"),Ta({level:Ca.INFO,header:"Screenshot captured.",description:"Screenshot ready to be downloaded.",actions:{accept:{text:"Download",callback:()=>function(e){const t=document.createElement("a");t.href=`data: image/png;base64,${ja(e)}`,"download"in t&&(t.download="connection.png"),t.target="_blank",t.click()}(e),remove:!0},decline:{text:"Decline",remove:!0}}})):(Pa.warn("Failed to capture screenshot"),Ta({level:Ca.ERROR,header:"Screenshot error.",description:"Failed to capture screenshot.",actions:{dismissable:!0}}))}$a.propTypes={connection:c.object,relativeMouseModeEnabled:c.bool,sasEnabled:c.bool,focusDisplay:c.func,screenshotEnabled:c.bool,currentResolution:c.string,submitResolutionPreferences:c.func,submitMetricsPreferences:c.func,submitAppearanceModePreferences:c.func,submitToolbarBehaviorPreferences:c.func,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func,systemDefaultAppearanceMode:c.oneOf([L.Light,L.Dark]),timezoneRedirectionSetting:c.number};var Wa,Ua,Va=n($a);function Ha(){return Ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ha.apply(null,arguments)}var qa=function(t){return e.createElement("svg",Ha({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Wa||(Wa=e.createElement("rect",{width:4,height:8,x:4,y:1,rx:2})),Ua||(Ua=e.createElement("path",{d:"M1 6v1a5 5 0 0 0 8 4M6 12v3M1 15h10M15.12 5.75l-4.5 4.5M15.12 10.25l-4.5-4.5"})))};const Ga=se("Microphone");function Ka({connection:e}){const[n,a]=i(ht.microphone),s=o(!1),c=t=>{s.current=t,a(t),ht.microphone=t,gt(),e.setMicrophone(t).catch(e=>{const n=`Failed to ${t?"enable":"disable"} microphone.`;Ga.warn(`${n} Disabling microphone. Error (code: ${e.code}): ${e.message}`),ht.microphone=t,gt(),Ta({level:Ca.ERROR,header:"Microphone error.",description:n,actions:{dismissable:!0}})}).finally(()=>{s.current=!1,Ga.info("[Audio] Setting microphone to "+(ht.microphone?"enabled":"disabled"))})};return r(()=>{c(ht.microphone)},[e]),t.createElement("div",{title:"Microphone"},t.createElement(m,K({},n?{iconName:"microphone"}:{iconSvg:t.createElement(qa,null)},{variant:"icon",onClick:()=>{s.current||c(!ht.microphone)}})))}Ka.propTypes={connection:c.object};var Qa,Ya=n(Ka);function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Za.apply(null,arguments)}var Ja,Xa=function(t){return e.createElement("svg",Za({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Qa||(Qa=e.createElement("path",{d:"M7 15V1L1 6v4zM15.01 5.75l-4.5 4.5M15.01 10.25l-4.5-4.5"})))};function es(){return es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},es.apply(null,arguments)}var ts,ns=function(t){return e.createElement("svg",es({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ja||(Ja=e.createElement("path",{d:"M7 15V1L1 6v4zM11 5v6"})))};function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rs.apply(null,arguments)}var os=function(t){return e.createElement("svg",rs({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),ts||(ts=e.createElement("path",{d:"M7 15V1L1 6v4zM15 3v10M11 5v6"})))};const is=se("Audio");function as({connection:e}){const[n,r]=t.useState(ht.volume),[o,i]=t.useState(ht.volume),a=t=>{r(t),ht.volume=t,gt(),e.setVolume(t),is.debug(`Client volume level set to ${t}`)};return t.createElement(d,{position:"bottom",size:"large",triggerType:"custom",header:"Volume",dismissButton:!1,content:t.createElement(h,{direction:"horizontal",size:"s"},t.createElement(m,{iconSvg:ss(n),variant:"icon",onClick:()=>{a(n?0:o)}}),t.createElement("input",{type:"range",style:{verticalAlign:"middle",width:"150px",height:"100%"},orient:"horizontal",min:"0",max:"100",step:"1",value:o,onChange:e=>{return t=Number(e.target.value),i(t),void a(t);var t}}),t.createElement("div",{style:{display:"flex",width:"3ch",textAlign:"center",alignItems:"center",justifyContent:"center",height:"100%"}},t.createElement("output",null,o)))},t.createElement("div",{title:"Audio"},t.createElement(m,{iconSvg:ss(n),variant:"icon"})))}function ss(e){return e<=0?t.createElement(Xa,null):e<=50?t.createElement(ns,null):t.createElement(os,null)}as.propTypes={connection:c.object};var cs=n(as);function ls(e){return e<1e3?`${e.toFixed(1)} bps`:e<1e6?`${(e/1e3).toFixed(1)} kbps`:`${(e/1e6).toFixed(1)} Mbps`}const ds=({label:e,color:n,children:r})=>t.createElement("div",null,t.createElement(f,{margin:{bottom:"xxxs"}},t.createElement(h,{direction:"horizontal",size:"xxs"},n&&t.createElement(us,{color:n}),t.createElement(f,{color:"text-label"},e))),t.createElement("div",null,r));ds.propTypes={label:c.string,color:c.string,children:c.node};const us=({color:e})=>t.createElement("svg",{width:"12",height:"12"},t.createElement("rect",{width:"12",height:"12",style:{fill:e,strokeWidth:"1",stroke:"rgb(0,0,0)"}}));us.propTypes={color:c.string};let ms=null,ps=[];function fs({connection:e}){const[n,i]=t.useState(0),[s,c]=t.useState(0),[l,d]=t.useState(0),[u,g]=t.useState(""),[y,w]=t.useState(""),[E,S]=t.useState([]),[x,M]=t.useState(!1),k=o();k.current=x;const R=()=>{const t=e.getStats();let n,r,o=0;if(ps.length>60){for(n=[],r=0;r<ps.length-1;r++)n.push(ps[r]);ps=n}for(0===ps.length?ps.push({x:0,y:t.traffic}):(ps.forEach(e=>{e.x++}),ps.unshift({x:0,y:t.traffic})),r=0;r<ps.length;r++)o+=ps[r].y;o/=ps.length,k.current&&(S(ps),i(t.traffic),c(o),d(t.peakTraffic)),g(t.latency>999?"> 1 s":`${Math.round(t.latency)} ms`),w(`${t.fps} fps`),ms=setTimeout(R,1e3)},T=a(()=>{M(!0)},[]);r(()=>(null!==e&&R(),()=>{clearTimeout(ms)}),[e]);const I=()=>t.createElement("div",{title:"Metrics"},t.createElement(m,{variant:"link",onClick:T},t.createElement(h,{direction:"horizontal",size:"m"},t.createElement(f,{fontWeight:"bold",color:"inherit"},y),t.createElement(f,{fontWeight:"bold",color:"inherit"},u))));return t.createElement("div",null,t.createElement(I,null),x&&t.createElement(p,{onDismiss:()=>{M(!1)},visible:x,size:"medium",header:"Streaming metrics",footer:t.createElement(b,{gridDefinition:[{colspan:4},{colspan:4},{colspan:4}]},t.createElement(ds,{label:"Current usage",color:z},ls(n)),t.createElement(ds,{label:"Average usage",color:W},ls(s)),t.createElement(ds,{label:"Peak usage",color:U},ls(l)))},t.createElement(h,{size:"xl"},t.createElement(b,{gridDefinition:[{colspan:6},{colspan:6}]},t.createElement(ds,{label:"Framerate"},y),t.createElement(ds,{label:"Network latency"},u)),t.createElement(C,{variant:"h3",actions:t.createElement(v,{external:!0,externalIconAriaLabel:"Opens in a new tab",href:"https://docs.aws.amazon.com/dcv/latest/userguide/using-streaming.html#using-streaming-metrics"},"Learn more")},"Download bandwidth"),t.createElement(O,{series:[{title:"Current usage",type:"line",data:E,color:z,valueFormatter:ls},{title:"Average usage",type:"threshold",y:s,color:W,valueFormatter:ls},...E.some(e=>e.y>=.8*l)?[{title:"Peak usage",type:"threshold",y:l,color:U,valueFormatter:ls}]:[]],i18nStrings:{xTickFormatter:e=>`${e} s`,yTickFormatter:ls},xDomain:[60,0],hideFilter:!0,hideLegend:!0,ariaLabel:"Single data series line chart",height:200,empty:t.createElement(f,{textAlign:"center",color:"inherit"},t.createElement("b",null,"No data available"),t.createElement(f,{variant:"p",color:"inherit"},"There is no data available"))}))))}fs.propTypes={connection:c.object};var hs,gs,bs,vs=n(fs);function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ys.apply(null,arguments)}var ws,Es,Ss,xs=function(t){return e.createElement("svg",ys({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),hs||(hs=e.createElement("path",{d:"M8 12v3M3 15h10"})),gs||(gs=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),bs||(bs=e.createElement("path",{d:"m10.25 4.25-4.5 4.5M10.25 8.75l-4.5-4.5"})))};function Ms(){return Ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ms.apply(null,arguments)}var ks,Cs,Os,Rs=function(t){return e.createElement("svg",Ms({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),ws||(ws=e.createElement("path",{d:"M8 12v3M3 15h10"})),Es||(Es=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Ss||(Ss=e.createElement("path",{d:"M5 6.5h6"})))};function Ts(){return Ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ts.apply(null,arguments)}var Is=function(t){return e.createElement("svg",Ts({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),ks||(ks=e.createElement("path",{d:"M8 12v3M3 15h10"})),Cs||(Cs=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Os||(Os=e.createElement("circle",{cx:8,cy:6.5,r:2})))};const Fs=se("Webcam");function Ds({connection:e,status:n,selectedWebcam:i,setSelectedWebcam:a}){const s=o(!1),c=o(!1),l=t=>{ht.webcam=t,c.current?Fs.debug(`Cannot set camera to ${t?"enabled":"disabled"} as a request is already in progress`):(c.current=!0,Fs.info("Setting camera to "+(t?"enabled":"disabled")),e.setWebcam(t,i).then(e=>{t&&a(e)}).catch(e=>{const n=`Failed to ${t?"enable":"disable"} camera.`;Fs.warn(`${n} Disabling camera. Error (code: ${e.code}): ${e.message}`),Ta({level:Ca.ERROR,header:"Camera error.",description:n,actions:{dismissable:!0}})}).finally(()=>{c.current=!1}))},d=()=>{l(!ht.webcam)};return r(()=>{"attached"===n&&(d(),s.current=!0)},[i]),r(()=>{"available"===n&&s.current&&(d(),s.current=!1)},[n]),r(()=>{l(ht.webcam)},[e]),t.createElement("div",{title:"Camera"},t.createElement(m,{iconSvg:As(n),variant:"icon",onClick:d}))}function As(e){switch(e){case"available":return t.createElement(xs,null);case"attached":return t.createElement(Rs,null);case"streaming":return t.createElement(Is,null);default:throw new Error(`Illegal camera serviceStatus: ${e}`)}}Ds.propTypes={connection:c.object,status:c.string,selectedWebcam:c.string,setSelectedWebcam:c.func};var Bs,_s=n(Ds);function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ns.apply(null,arguments)}var Ps=function(t){return e.createElement("svg",Ns({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Bs||(Bs=e.createElement("path",{d:"m14 6.5-3-3-3 3M11 4v10M8 9.5l-3 3-3-3M5 2v10"})))};const Ls=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}),$s={text:"Storage",href:null},js=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],zs=se("Filestorage");let Ws,Us=!1;function Vs({connection:e,downloadEnabled:n,uploadEnabled:i}){const[s,c]=t.useState(!1),l=o(!1),[d,u]=t.useState(!0),[g,b]=t.useState(!1),[y,w]=t.useState([]),[E,S]=t.useState([$s]),[x,M]=t.useState(1),[C,O]=t.useState($s.href),A=o($s.href),[B,_]=t.useState([]),[N,P]=t.useState(""),[L,$]=t.useState(""),[j,z]=t.useState(!1),[W,U]=t.useState(!1),[V,H]=t.useState(!1),q=o(null),G=o(null),K=o(null),Q=()=>Math.max(5,Math.floor((window.innerHeight-320-86)/42)),Y=()=>B.slice((x-1)*Q(),x*Q()),Z=(e,n)=>t.createElement("div",{style:{display:"flex",alignItems:"center",height:"100%"}},t.createElement(F,{name:e}),n&&t.createElement("span",{style:{marginLeft:"5px"}},n)),J=e=>{let n,r=e&&"/"!==e&&"Storage"!==e?e:"",o=[];zs.debug(`Changing to directory ${r}`),n=Ws.list(r),n.on("error",e=>{1===e.code||2===e.code?zs.info(`Aborted listing of ${r} folder`):(zs.warn(`Failed to list ${r} folder (${e.message})`),Ta({level:Ca.ERROR,header:"File storage error.",description:t.createElement("div",null,"Failed to list files in ",r," folder.",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}}),J())}).on("success",()=>{zs.debug("List files succeeded"),_(o),e!==C&&w([]),(e=>{let t=e.split("/"),n=[$s],r="";t.filter(e=>""!==e).forEach(e=>{r+=`/${e}`,n.push({text:e,path:r,href:null})}),S(n),O(e),A.current=e,M(1)})(r)}).on("newItems",e=>{zs.debug(`New items ${e.length}`),zs.debug(`update list folders ${C}`),o.push(...e)}).run()},X=()=>{Us?J(C):J()},ee=()=>{c(!0),e.getFileExplorer().then(t=>{Ws=t,X(),e.setUploadBandwidth(102400)}).catch(()=>{u(!1)})},te=()=>{l.current=!1,c(!1),e.setUploadBandwidth(10240),Us=!1,H(!1)},ne=(e,n)=>{let r,o,i=n||""===n?n:C;o=Ta({level:Ca.INFO,header:"Upload in progress.",description:`File ${e.name} is uploading to Storage ${C}`,progress:0,actions:{decline:{text:"Stop uploading",callback:()=>r.cancel(),remove:!0}}}),r=Ws.storeFile(e,i),r.on("error",n=>{1!==n.code&&Ta({level:Ca.ERROR,header:"Upload error.",description:t.createElement("div",null,"Failed to upload ",e.name," to Storage",i,".",t.createElement("br",null),"Error: ",n.message," (code: ",n.code,")"),actions:{dismissable:!0}},o)}).on("progress",(e,t)=>{Fa(Math.floor(100*e/t),o)}).on("success",()=>{Ta({level:Ca.SUCCESS,header:"File uploaded.",description:`File ${e.name} successfully uploaded to Storage${C}`,actions:{dismissable:!0}},o),Us=!0,X()}).run()},re=e=>{const t=e.target.files;t&&t.length>0?(zs.debug("A file to upload has been selected."),ne(t[0])):zs.debug("No file to upload has been selected.")},oe=e=>{Ws.retrieveFile(e).on("error",n=>{Ta({level:Ca.ERROR,header:"Download error.",description:t.createElement("div",null,"Impossible to download file ",e,".",t.createElement("br",null),"Error: ",n.message," (code: ",n.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Ta({level:Ca.SUCCESS,header:"File ready for download.",description:`File ${e} ready to be downloaded to your device.`,actions:{dismissable:!0}})}).run()},ie=()=>{N.length>0&&N!==L&&((()=>{let e,n="folder"===y[0].type,r=y[0].displayName,o=`${C}/${r}`,i=`${C}/${N}`;e=n?Ws.renameDirectory(o,i):Ws.renameFile(o,i),e.on("error",e=>{Ta({level:Ca.ERROR,header:"Rename error.",description:t.createElement("div",null,"Failed to rename ",(n?"folder ":"file ")+r," to ",N,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{zs.debug("Rename succeeded."),Ta({level:Ca.SUCCESS,header:(n?"Folder":"File")+" renamed.",description:`${n?"Folder":"File"} successfully renamed from ${r} to ${N}.`,actions:{dismissable:!0}}),Us=!0,X()}).run()})(),w([])),U(!1),P("")},ae=()=>{const e=B.map(e=>({...e}));e.shift(),_(e)},se=()=>{N.length>0?Ws.createDirectory(`${C}/${N}`).on("error",e=>{ae(),Ta({level:Ca.ERROR,header:"Folder creation error.",description:t.createElement("div",null,"Failed to create folder ",N,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{zs.debug("Mkdir succeeded"),Ta({level:Ca.SUCCESS,header:"Folder created.",description:`Folder ${N} successfully created.`,actions:{dismissable:!0}}),Us=!0,X()}).run():ae(),z(!1),P("")},ce=e=>{for(const t of e)if("file"!==t.kind)return!1;return!0},le=e=>{Us=!0,!je()&&!s&&i&&ce(e.dataTransfer.items)&&(l.current=!0,ee())},de=a(e=>{e.stopPropagation(),!e.relatedTarget&&l.current&&s&&te()}),ue=e=>{switch(e){case"download":oe(`${C}/${y[0].displayName}`);break;case"open":J(`${C}/${y[0].displayName}`);break;case"rename":$(y[0].displayName),P(y[0].displayName),U(!0);break;case"delete":Ws.deleteFile(`${C}/${y[0].displayName}`).on("error",e=>{Ta({level:Ca.ERROR,header:"Deletion error.",description:t.createElement("div",null,"Failed to delete file ",y[0].displayName,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{zs.debug("Remove succeeded"),Ta({level:Ca.SUCCESS,header:"File deleted.",description:`File ${y[0].displayName} successfully deleted.`,actions:{dismissable:!0}}),Us=!0,X()}).run();break;default:zs.warn("Invalid dropdown action selected")}},pe=e=>t.createElement(m,{onClick:()=>e.current.click()},t.createElement("input",{style:{display:"none"},type:"file",ref:e,onChange:re,onClick:e=>{e.target.value=""}}),"Upload file"),fe=t.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},t.createElement(h,{direction:"horizontal",size:"s"},t.createElement(k,{disabled:!y.length,onItemClick:({detail:e})=>ue(e.id),items:[...n?[{text:"Download",id:"download",disabled:y.length&&"file"!==y[0].type}]:[],{text:"Rename",id:"rename",disabled:y.length&&!Y().filter(e=>e.displayName===y[0].displayName).length}]},"Actions"),i&&pe(q),t.createElement(m,{onClick:()=>{_([{displayName:null,type:"folder"}].concat(B.map(e=>({...e})))),w([]),z(!0),M(1)}},"Create folder")),t.createElement(R,{currentPageIndex:x,onChange:({detail:e})=>M(e.currentPageIndex),pagesCount:Math.ceil(B.length/Q()),ariaLabels:{nextPageLabel:"Next page",previousPageLabel:"Previous page",pageLabel:e=>`Page ${e}`}})),he=[{id:"name",header:"Name",cell:function(e){return Z(e.type,(e=>{const r=(e,n)=>t.createElement(D,{ref:K,onChange:({detail:e})=>P(e.value),onBlur:e,onKeyUp:({detail:t})=>{13===t.keyCode&&e()},value:N,placeholder:n,disableBrowserAutocorrect:!0,inputMode:"text"});return W&&e.displayName===y[0].displayName?r(ie,e.displayName):j&&null===e.displayName?r(se,"New folder"):"file"===e.type?n?t.createElement(v,{ariaLabel:"Download",onFollow:()=>oe(`${C}/${e.displayName}`)},e.displayName):e.displayName:t.createElement(v,{ariaLabel:"Open",onFollow:g?()=>{}:()=>{J(`${C}/${e.displayName}`)}},e.displayName)})(e))},minWidth:380},{id:"lastModified",header:"Last modified",cell:function(e){return t.createElement(f,{variant:"p"},e.displayName&&e.lastModified?Ls.format(new Date(e.lastModified)):"-")},minWidth:180},{id:"size",header:"Size",cell:function(e){return t.createElement(f,{variant:"p"},"file"===e.type?Hs(e.size):"-")},minWidth:140}],ge=e=>{n&&(zs.debug("Asking to download resource"),e.accept())};return r(()=>()=>{Us=!1,Ws=null},[]),r(()=>{(W||j)&&(K.current.focus(),W&&K.current.select())},[W,j]),r(()=>(me.on("file-download",ge),()=>{me.off("file-download",ge)}),[n]),r(()=>(window.addEventListener("dragenter",le),window.addEventListener("dragleave",de),()=>{window.removeEventListener("dragenter",le),window.removeEventListener("dragleave",de)})),t.createElement("div",null,t.createElement("div",{title:"Filestorage"},t.createElement(m,{variant:"icon",iconSvg:t.createElement(Ps,null),onClick:ee})),t.createElement(p,{onDismiss:te,visible:s,header:"File storage",size:"large",modalRoot:window.document.body},d?t.createElement("div",{onDragEnter:e=>H(!je()&&ce(e.dataTransfer.items))},t.createElement(f,{margin:{bottom:"xs"},padding:{bottom:"xs"}},t.createElement(h,{size:"xxs"},t.createElement(h,{direction:"horizontal",size:"s"},Z("folder-open",""),t.createElement(T,{items:E,onClick:g?()=>{}:({detail:e})=>J(e.item.path)})),t.createElement("div",{style:{height:42*Q()+86,position:"relative"}},t.createElement(I,{resizableColumns:!0,loadingText:"Loading resources",selectionType:"single",columnDefinitions:he,items:Y(),selectedItems:y,onSelectionChange:({detail:e})=>w(e.selectedItems),header:fe,empty:t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5",margin:"m"},i&&!je()?t.createElement(t.Fragment,null,t.createElement("p",null,"Drag and drop a file to upload"),t.createElement("p",null," Or "),pe(G)):t.createElement("p",null,"Folder ",E[E.length-1].text," is empty"))}),V&&i&&t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",position:"absolute",alignItems:"center",bottom:"0px",width:"100%",height:42*Q(),opacity:"0.8",outline:"2px",border:"2px dashed gray",backgroundColor:"white"},onDrop:e=>{e.preventDefault(),H(!1),((e,n)=>{if(!e[0])return void zs.debug("Dropped file is null");const r=e[0].webkitGetAsEntry()||e[0].getAsEntry();if(r)if(r.isFile&&1===e.length)r.file(e=>{e.name.startsWith(".")||ne(e,n)},()=>zs.debug(`File not retrieved: ${r.name}`));else{b(!0);const r=Ws.uploadFiles(e,n),o=Ta({level:Ca.INFO,header:"Upload of dropped files in progress.",description:`Dropped files are uploading to Storage${n}`,progress:0,actions:{decline:{text:"Stop uploading",callback:()=>{r.cancel(),b(!1)},remove:!0}}});let i=0;r.on("error",e=>{1!==e.code&&(Ta({level:Ca.ERROR,header:"Upload dropped files error.",description:t.createElement("div",null,"Failed to upload dropped files",t.createElement("br",null),"Error: ",e.message," ",e.code?`(code: ${e.code})`:""),actions:{dismissable:!0}},o),b(!1))}).on("progress",(e,t,n,r,a,s,{destinationFolder:c,isDirectory:l})=>{Fa(Math.floor(e/t*100),o,e,t,n,r),A.current===c&&(l||n>i)&&J(c),i=n}).on("success",()=>{Ta({level:Ca.SUCCESS,header:"Dropped files uploaded.",description:`Dropped files successfully uploaded to Storage${n}`,actions:{dismissable:!0}},o),b(!1)}).run()}else zs.debug("Dropped file is null")})(e.dataTransfer.items,C||"")},onDragOver:e=>e.preventDefault(),onDragLeave:()=>H(!1)},t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5"},"Drag and drop your files to start uploading")))))):t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5"},"File storage is not available")))}function Hs(e){if(fe(e))return"-";if(0===e)return`0 ${js[0]}`;const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${js[t]}`}Vs.propTypes={connection:c.object,downloadEnabled:c.bool,uploadEnabled:c.bool};var qs=n(Vs);const Gs=1e3,Ks={MINUTE:60};Ks.HOUR=Ks.MINUTE**2,Ks.DAY=24*Ks.HOUR;const Qs=(e,t)=>Math.floor(e/t),Ys={just_now:{limit:10,updateInterval:1,text:e=>"now"},less_than_min:{limit:Ks.MINUTE,updateInterval:1,text:e=>"< 1m ago"},n_min_ago:{limit:Ks.HOUR,updateInterval:30,text:e=>`${Qs(e,Ks.MINUTE)}m ago`},n_hours_ago:{limit:Ks.DAY,updateInterval:15*Ks.MINUTE,text:e=>`${Qs(e,Ks.HOUR)}h ago`},n_days_ago:{text:e=>`${Qs(e,Ks.DAY)}d ago`}};function Zs(){const[e,n]=t.useState([]),o=e=>{return n=e,r=0,o=100,Number.isFinite(n)&&n>=r&&n<=o?t.createElement(_,{value:e}):null;var n,r,o};return r(()=>{const e=e=>n(Array.isArray(e)?e:[]);return me.on("notifications-update",e),()=>{me.off("notifications-update",e)}},[]),t.createElement(d,{position:"bottom",size:"medium",fixedWidth:!0,triggerType:"custom",dismissButton:!1,content:e.length?t.createElement("div",{style:{maxHeight:Math.floor(.8*window.innerHeight),overflow:"auto"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"2px 0"}},t.createElement(f,{fontSize:"heading-s",fontWeight:"normal",variant:"h2"},"Notifications"),t.createElement(m,{onClick:()=>{e.forEach(e=>{e.actions&&(e.actions.decline&&("function"==typeof e.actions.decline.callback&&e.actions.decline.callback(),e.actions.decline.remove&&Ia(e.id)),e.actions.dismissable&&Ia(e.id))})}},"Clear all")),Object.values(Ca).map(e=>e.importance).sort((e,t)=>t-e).filter((e,t,n)=>!t||e!==n[t-1]).map(n=>e.filter(e=>e.level.importance===n).map(e=>t.createElement(f,{margin:{horizontal:"xxxs",vertical:"m"},key:e.id},t.createElement(A,null,t.createElement(f,null,(e=>{const n=t.createElement(u,{type:e.level.status},e.header||ge(e.level.status));return"dismissable"in e.actions?t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n,t.createElement("div",{style:{paddingLeft:"10px"}},t.createElement(m,{variant:"icon",iconName:"close",iconAlign:"right",onClick:()=>Ia(e.id)}))):n})(e)),e.timestamp&&t.createElement(Xs,{timestamp:e.timestamp}),e.description&&t.createElement(f,{margin:{top:"xxs"}},e.description),e.uploadedFiles&&t.createElement(f,{margin:{top:"s"}},`Files uploaded: ${e.uploadedFiles} / ${e.totalFiles} `),e.uploadedBytes&&t.createElement(f,{margin:{top:"s"}},`Bytes uploaded: ${Hs(e.uploadedBytes)} / ${Hs(e.totalBytes)}`),null!==e.progress&&t.createElement(f,{margin:{top:"s"}},o(e.progress)),("decline"in e.actions||"accept"in e.actions)&&t.createElement(f,{margin:{top:"s"}},(e=>{const n=1===Object.keys(e.actions).filter(e=>-1!==["accept","decline"].indexOf(e)).length?"flex-start":"space-between";return t.createElement("div",{style:{display:"flex",justifyContent:n}},"decline"in e.actions&&t.createElement(m,{onClick:()=>{"function"==typeof e.actions.decline.callback&&e.actions.decline.callback(),e.actions.decline.remove&&Ia(e.id)}},e.actions.decline.text),"accept"in e.actions&&t.createElement("div",null,t.createElement(m,{variant:"primary",onClick:()=>{"function"==typeof e.actions.accept.callback&&e.actions.accept.callback(),e.actions.accept.remove&&Ia(e.id)}},e.actions.accept.text)))})(e))))))):t.createElement(f,{padding:{horizontal:"xxl",vertical:"m"},variant:"p",color:"text-status-inactive",textAlign:"center"},"No notifications to display")},t.createElement("div",{title:"Notifications"},t.createElement(B,{color:(()=>{let t="grey",n=-1;return e.forEach(e=>{e.level.importance>n&&(n=e.level.importance,t=e.level.color)}),t})()},e.length)))}var Js=n(Zs);function Xs(e){const[n,o]=t.useState((Date.now()-e.timestamp)/Gs),i=e=>Object.values(Ys).find(t=>!("limit"in t)||e<t.limit),a=e=>{o((Date.now()-e)/Gs)};return r(()=>{const t=i(n).updateInterval;let r=null;return t&&(r=setInterval(a,t*Gs,e.timestamp)),()=>{r&&(clearInterval(r),r=null)}},[]),t.createElement(f,{variant:"small",textAlign:"right",display:"block",fontWeight:"light"},i(s=n).text(s));var s}function ec(){return ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ec.apply(null,arguments)}Xs.propTypes={timestamp:c.number};var tc=function(t){return e.createElement("svg",ec({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{d:"M12 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H9.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round"}}),e.createElement("circle",{cx:12,cy:3.5,r:2.5,style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10}}),e.createElement("circle",{cx:4,cy:3.5,r:2.5,style:{stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10,fill:"#545b64"}}),e.createElement("path",{d:"M4 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H1.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round",fill:"#545b64"}}))};function nc(){return nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nc.apply(null,arguments)}var rc=function(t){return e.createElement("svg",nc({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("circle",{cx:8,cy:3.5,r:2.5,style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10}}),e.createElement("path",{d:"M8 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H5.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round"}}))};let oc=[];const ic=e=>({username:e.username,connectionIds:[e.connectionId],owner:e.owner}),ac=e=>{if(0!==oc.length){const t=e.map(e=>e.connectionId),n=oc.map(e=>e.connectionIds).flat();(e=>{let t,n;e.forEach(e=>{const r=oc.find(t=>t.connectionIds.includes(e));n=r.owner?"Session owner":"Collaborator",t=`${n} '${r.username}' has disconnected from this session.`,Ta({level:Ca.INFO,header:"Client disconnected.",description:t,actions:{dismissable:!0}})})})(n.filter(e=>!t.some(t=>e===t)));const r=e.filter(e=>!n.some(t=>e.connectionId===t));(e=>{let t,n;e.forEach(e=>{n=e.owner?"Session owner":"Collaborator",t=`${n} '${e.username}' has joined this session.`,Ta({level:Ca.INFO,header:"New client connected.",description:t,actions:{dismissable:!0}})})})(r)}};function sc(e){(e=>{me.emit("collaboration-status-update",e.length>1)})(e),ac(e),(e=>{oc=[];const t=e.length;for(let n=0;n<t;n++){const t=oc.find(t=>t.username===e[n].username);t?t.connectionIds.push(e[n].connectionId):oc.push(ic(e[n]))}oc.sort((e,t)=>e.username<t.username?-1:1)})(e),cc()}function cc(){me.emit("collaborator-list-update",oc)}function lc(e,t){t.forEach(t=>{t!==e.id&&e.disconnectCollaborator(t)})}function dc({connection:e}){const[n,o]=t.useState([]),[i,a]=t.useState(!1);return r(()=>{const t=t=>{a(t.some(t=>t.owner&&t.connectionIds.includes(e.id))),o(t)};return me.on("collaborator-list-update",t),cc(),()=>{me.off("collaborator-list-update",t)}},[]),t.createElement(d,{position:"bottom",size:"medium",triggerType:"custom",dismissButton:!1,content:n.length?t.createElement("div",{style:{maxHeight:Math.floor(.8*window.innerHeight),overflow:"auto"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"2px 0 15px"}},t.createElement(f,{fontSize:"heading-s",fontWeight:"normal",variant:"h2"},"Collaborators"),i&&n.length>2&&t.createElement("div",{style:{marginLeft:"30px"}},t.createElement(m,{onClick:()=>function(e){oc.forEach(t=>lc(e,t.connectionIds))}(e)},"Disconnect all"))),t.createElement(A,null,n.map(n=>n.username&&(n=>{const r=n.connectionIds.length>1&&n.connectionIds.includes(e.id)||i&&n.connectionIds.includes(e.id)&&n.connectionIds.length>1||i&&!n.connectionIds.includes(e.id);return t.createElement(f,{key:n.username},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",minWidth:"150px"}},t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(F,{svg:t.createElement(rc,null),size:"small"}),t.createElement("div",{style:{maxWidth:"200px"}},t.createElement(f,{fontSize:"body-m",fontWeight:"normal",variant:"p",margin:{left:"xs",right:"s"}},`${n.username}${n.connectionIds.length>1?` (${n.connectionIds.length} clients)`:""}`))),r&&t.createElement(m,{variant:"icon",iconName:"close",onClick:()=>lc(e,n.connectionIds)})))})(n)))):t.createElement(f,{padding:{horizontal:"xxl",vertical:"m"},variant:"p",color:"text-status-inactive",textAlign:"center"},"No collaborators to display")},t.createElement("div",{title:"Collaborators"},t.createElement(F,{svg:t.createElement(tc,null)})))}dc.propTypes={connection:c.object};var uc=n(dc);const mc="soft-kbd-div";let pc;function fc({connection:e,softKeyboardVisible:n,setSoftKeyboardVisible:i}){const a=o(!1);a.current=n;const s=e=>{e.setSelectionRange(e.value.length,e.value.length)},c=()=>{i(!0),pc.focus(),(We()||Le())&&(pc.click(),window.scrollTo(0,0),document.body.scrollTop=0,document.scrollingElement.scrollTop=0)},l=()=>{pc=document.getElementById("dcv-softkbd-hid-input"),pc&&c()},d=()=>{const e=document.createElement("input");e.setAttribute("id","dcv-softkbd-hid-input"),e.setAttribute("type","text"),e.style.caretColor="transparent",e.style.color="transparent",e.style.background="transparent",e.style.border="none",e.style.fontSize="1pt",e.style.height="1px",e.style.width="1px",e.defaultValue="&",e.value=Pe()?"&":"",e.setAttribute("writingSuggestions",!1),e.setAttribute("autocomplete","off"),pc=e},u=()=>{a.current?(pc=document.getElementById("dcv-softkbd-hid-input"),pc&&(pc.blur(),document.getElementById(mc).removeChild(pc)),i(!1)):(pc=document.getElementById("dcv-softkbd-hid-input"),pc||d(),document.getElementById(mc).appendChild(pc),c())};return r(()=>{const t=e.sendKeyboardEvent.bind(e),r=e=>{if(pc=document.getElementById("dcv-softkbd-hid-input"),pc){s(pc);const n=new KeyboardEvent("keydown",{key:e.data??"Backspace",location:KeyboardEvent.DOM_KEY_LOCATION_STANDARD,code:""}),r=new KeyboardEvent("keyup",n);t(n),t(r),pc.value="&",s(pc)}},o=e=>{"Unidentified"!==e.key&&t(e)},i=e=>{pc=document.getElementById("dcv-softkbd-hid-input"),pc&&(s(pc),o(e))},a=Pe()?o:t;return n&&((e,t,n)=>{pc=document.getElementById("dcv-softkbd-hid-input"),pc&&(pc.addEventListener("focusout",l),pc.addEventListener("keydown",e),pc.addEventListener("keyup",Pe()?n:e),pc.addEventListener("keypress",e),Pe()&&pc.addEventListener("input",t))})(a,r,i),()=>((e,t,n)=>{pc=document.getElementById("dcv-softkbd-hid-input"),pc&&(pc.removeEventListener("focusout",l),pc.removeEventListener("keydown",e),pc.removeEventListener("keyup",Pe()?n:e),pc.removeEventListener("keypress",e),Pe()&&pc.removeEventListener("input",t))})(a,r,i)},[e,n]),r(()=>(Ne()&&me.on("toggle-keyboard",u),d(),()=>{Ne()&&me.off("toggle-keyboard",u),pc=null,i(!1)}),[]),t.createElement(t.Fragment,null," ")}fc.propTypes={connection:c.object,softKeyboardVisible:c.bool,setSoftKeyboardVisible:c.func};var hc=n(fc);function gc(e,t){return gc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gc(e,t)}function bc(e){return bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bc(e)}function vc(e,t){if(t&&("object"===bc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function yc(e){return yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yc(e)}var wc,Ec,Sc,xc,Mc={exports:{}};function kc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=yc(e);if(t){var o=yc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vc(this,n)}}Mc.exports=function(){if(xc)return Sc;xc=1;var e=Ec?wc:(Ec=1,wc="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Sc=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var Cc,Oc,Rc,Tc,Ic,Fc=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gc(e,t)}(r,t.PureComponent);var e,n=kc(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).container=null,t.window=null,t.windowCheckerInterval=null,t.released=!1,t.state={mounted:!1},t}return(e=[{key:"render",value:function(){return this.state.mounted?Q.createPortal(this.props.children,this.container):null}},{key:"componentDidMount",value:function(){this.window||this.container||(this.openChild(),this.setState({mounted:!0}))}},{key:"openChild",value:function(){var e,t=this,n=this.props,r=n.url,o=n.title,i=n.name,a=n.features,s=n.onBlock,c=n.onOpen,l=n.center;if("string"!=typeof l||void 0!==a.width&&void 0!==a.height){if("parent"===l)a.left=window.top.outerWidth/2+window.top.screenX-a.width/2,a.top=window.top.outerHeight/2+window.top.screenY-a.height/2;else if("screen"===l){var d=void 0!==window.screenLeft?window.screenLeft:window.screen.left,u=void 0!==window.screenTop?window.screenTop:window.screen.top,m=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,p=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height;a.left=m/2-a.width/2+d,a.top=p/2-a.height/2+u}}else console.warn("width and height window features must be present when a center prop is provided");if(this.window=window.open(r,i,(e=a,Object.keys(e).reduce(function(t,n){var r=e[n];return"boolean"==typeof r?t.push("".concat(n,"=").concat(r?"yes":"no")):t.push("".concat(n,"=").concat(r)),t},[]).join(","))),this.container=this.window.document.createElement("div"),this.windowCheckerInterval=setInterval(function(){t.window&&!t.window.closed||t.release()},50),this.window){if(this.window.document.title=o,this.container=this.window.document.getElementById("new-window-container"),null===this.container)this.container=this.window.document.createElement("div"),this.container.setAttribute("id","new-window-container"),this.window.document.body.appendChild(this.container);else{var f=this.window.document.getElementById("new-window-container-static");this.window.document.body.removeChild(f)}this.props.copyStyles&&setTimeout(function(){return e=document,n=t.window.document,r=n.createDocumentFragment(),Array.from(e.styleSheets).forEach(function(e){var t;try{t=e.cssRules}catch(e){console.error(e)}if(t){var o=[];Array.from(e.cssRules).forEach(function(e){var t=e.type;if(t!==CSSRule.UNKNOWN_RULE){var n;n=t===CSSRule.KEYFRAMES_RULE?function(e){var t=["@keyframes",e.name,"{"];return Array.from(e.cssRules).forEach(function(e){t.push(e.keyText,"{",e.style.cssText,"}")}),t.push("}"),t.join(" ")}(e):[CSSRule.IMPORT_RULE,CSSRule.FONT_FACE_RULE].includes(t)?function(e){return e.cssText.split("url(").map(function(e){return"/"===e[1]?"".concat(e.slice(0,1)).concat(window.location.origin).concat(e.slice(1)):e}).join("url(")}(e):e.cssText,o.push(n)}});var i=n.createElement("style");i.textContent=o.join("\n"),r.appendChild(i)}else if(e.href){var a=n.createElement("link");a.rel="stylesheet",a.href=e.href,r.appendChild(a)}}),void n.head.appendChild(r);var e,n,r},0),"function"==typeof c&&c(this.window),this.window.addEventListener("beforeunload",function(){return t.release()})}else"function"==typeof s?s(null):console.warn("A new window could not be opened. Maybe it was blocked.")}},{key:"componentWillUnmount",value:function(){if(this.state.mounted&&this.window)if(this.props.closeOnUnmount)this.window.close();else if(this.props.children){var e=this.container.cloneNode(!0);e.setAttribute("id","new-window-container-static"),this.window.document.body.appendChild(e)}}},{key:"release",value:function(){if(!this.released){this.released=!0,clearInterval(this.windowCheckerInterval);var e=this.props.onUnload;"function"==typeof e&&e(null)}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,e),r}();function Dc(){return Dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dc.apply(null,arguments)}Rc={url:"",name:"",title:"",features:{width:"600px",height:"640px"},onBlock:null,onOpen:null,onUnload:null,center:"parent",copyStyles:!0,closeOnUnmount:!0},(Oc="defaultProps")in(Cc=Fc)?Object.defineProperty(Cc,Oc,{value:Rc,enumerable:!0,configurable:!0,writable:!0}):Cc[Oc]=Rc,Fc.propTypes={children:Mc.exports.node,url:Mc.exports.string,name:Mc.exports.string,title:Mc.exports.string,features:Mc.exports.object,onUnload:Mc.exports.func,onBlock:Mc.exports.func,onOpen:Mc.exports.func,center:Mc.exports.oneOf(["parent","screen"]),copyStyles:Mc.exports.bool,closeOnUnmount:Mc.exports.bool};var Ac,Bc,_c=function(t){return e.createElement("svg",Dc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Tc||(Tc=e.createElement("path",{d:"M5.5 12v3M.5 15h10M1 5h9v7H1z"})),Ic||(Ic=e.createElement("path",{d:"M5 4V1h9v7h-4"})))};function Nc(){return Nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nc.apply(null,arguments)}var Pc=function(t){return e.createElement("svg",Nc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ac||(Ac=e.createElement("path",{d:"M5.5 12v3M.5 15h10M5 1h9v7H5z"})),Bc||(Bc=e.createElement("path",{d:"M5 5H1v7h9V8M11.75 2.25l-4.5 4.5M11.75 6.75l-4.5-4.5"})))};const Lc=se("Multiscreen");function $c({connection:e,copyEnabled:n,pasteEnabled:o,appearanceMode:i,toolbarBehavior:a,pendingDisplays:s}){const[c,l]=t.useState(!1),[d,u]=t.useState(null),p=()=>{me.emit("close-secondary-display")},f=()=>{const t=il();l(!1),t&&e&&(ol(null),e.detachDisplay(t)),d&&!d.closed&&(d.close(),u(null))};return r(()=>(me.on("close-secondary-display",f),()=>{me.off("close-secondary-display",f)}),[d,e]),t.createElement(t.Fragment,null,t.createElement("div",{title:"Multiple screens"},t.createElement(m,{iconSvg:c?t.createElement(Pc,null):t.createElement(_c,null),variant:"icon",onClick:()=>{c?f():l(!0)}})),c&&t.createElement(Fc,{features:{height:window.innerHeight,width:window.innerWidth},name:"DCV Secondary Window",title:`${e.getServerInfo().hostname} - Amazon DCV`,onUnload:p,onBlock:p,onOpen:t=>{t.opener=null,u(t),me.once("open-secondary-display",()=>(t=>{t?s.length?(ol(s[0]),e.attachDisplay(t,{displayDivName:"dcv-display",displayId:s[0]}).then(e=>ol(e)).catch(e=>{Lc.error(`Cannot open secondary display (Error: ${e.code} ${e.message})`),f()})):e.attachDisplay(t,{displayDivName:"dcv-display"}).then(e=>ol(e)).catch(e=>{Lc.error(`Cannot open secondary display (Error: ${e.code} ${e.message})`),f()}):f()})(t))},closeOnUnmount:!0},t.createElement(al,{isPrimary:!1,connection:e,copyEnabled:n,pasteEnabled:o,window:d,appearanceMode:i,toolbarBehavior:a})))}$c.propTypes={connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,appearanceMode:c.oneOf([et,Je,Xe]),toolbarBehavior:c.oneOf([He,Ke,Ye]),pendingDisplays:c.arrayOf(c.number)};var jc=n($c);const zc=se("Viewer"),Wc={position:"relative",margin:"auto",outline:"none"},Uc={height:"100%",overflow:"hidden",position:"relative"},Vc={position:"absolute",width:"100%",zIndex:1e3,pointerEvents:"all"},Hc={display:"flex",flexFlow:"row wrap",alignItems:"center","--gap":"32px",marginLeft:"calc(var(--gap) / -2)",marginBottom:"calc(var(--gap) / -2)"},qc={marginLeft:"calc(var(--gap) / 2)",marginBottom:"calc(var(--gap) / 2)"},Gc=De.satisfies({chrome:">=137"})?10:1;let Kc,Qc,Yc=[],Zc=null,Jc=null,Xc=null;function el({isPrimary:e,connection:n,copyEnabled:i,pasteEnabled:c,window:d,appearanceMode:u,toolbarBehavior:p,uiConfig:g}){const[b,v]=t.useState(!0),[y,w]=t.useState(!1),[S,x]=t.useState(!1),[M,k]=t.useState(!1),[C,O]=t.useState(""),[R,T]=t.useState(""),[I,F]=t.useState(""),[D,A]=t.useState(""),[B,_]=t.useState(ht.selectedWebcamId),[P,z]=t.useState(i||!1),[W,U]=t.useState(!1),[K,Q]=t.useState(c||!1),[Y,Z]=t.useState(ht.metricsEnabled),[J,X]=t.useState(!1),[ee,te]=t.useState(!1),[ne,re]=t.useState(!1),[oe,ie]=t.useState(!1),[ae,ce]=t.useState(!1),[le,de]=t.useState(!1),[ue,pe]=t.useState(!1),[ge,be]=t.useState(!1),[we,Ee]=t.useState(!1),[Se,xe]=t.useState(!1),[Me,ke]=t.useState(null),[Ce,Oe]=t.useState(ht.appearanceMode),[Re,Te]=t.useState(ht.toolbarBehavior),[Ie,Fe]=t.useState(0),[De,Ae]=t.useState(""),[Be,_e]=t.useState(!1),[Pe,$e]=t.useState(!1),je=o(null),ze=o(null),qe=o(!1),Qe=o(null);qe.current=we,r(()=>{Ne()&&Ue(zc)},[]);const Ye=a(e=>!g||!he(g.toolbar)||!(e in g.toolbar)||g.toolbar[e],[g]),Ze=()=>{fa(n,d,e)},Je=e=>{zc.info(`network interruption alert: ${e}`),_e(e)},Xe=e=>{zc.info(`network offline alert: ${e}`),$e(e)},tt=e=>{ie(e)},nt=(t,r,o)=>{(fe(o)||0===o)&&(w(r),n.setDisplayQuality(ht.minQuality,ht.maxQuality),n.setMaxDisplayResolution(ht.maxDisplayWidth,ht.maxDisplayHeight),n.setMinDisplayResolution(ht.minDisplayWidth,ht.minDisplayHeight),oa=t,n.setKeyboardQuirks({macOptionToAlt:ht.macOptionToAlt,macCommandToControl:ht.macCommandToControl,forceKeyboardCombinations:ht.forceKeyboardCombinations,controlToCommand:ht.controlToCommand})),e||Kc?(Ee(!0),xe(!0)):zc.info(`Received first frame for an unknown displayId: ${o}`)},it=e=>{Fe(e.setting);const t=e.status;t&&De!==t&&(Ae(t),t===l.TimezoneRedirectionStatus.PERMISSION_ERROR?Ta({level:Ca.WARNING,header:"Time Zone Redirection.",description:"This user does not have permission to perform this operation.",actions:{dismissable:!0}}):t===l.TimezoneRedirectionStatus.GENERIC_ERROR&&Ta({level:Ca.WARNING,header:"Time Zone Redirection.",description:"The setting could not be saved. Please try again.",actions:{dismissable:!0}}))},at=(t,n,r)=>{const o=e||fe(r)||1===r.length?t:r[1].rect.width,i=e||fe(r)||1===r.length?n:r[1].rect.height;xa(r),-1!==[rt,ot].indexOf(ht.selectedResolution)?O(ha(o,i)):O(ht.selectedResolution),Sa(o,i,d,e)},st=a(t=>{!function(e,t,n,r){if(t===rt)ht.dynamicResolution=!0,fa(e,n,r);else if(ht.dynamicResolution=!1,t!==ot){const o=ga(t),i=Ne()?ua(n,o[0],o[1]):o;Ma(e,i[0],i[1],r)}gt()}(n,t,d,e)},[n,d,e]),ct=e=>{T(e.remote),"busy"===e.remote?Jc=Ta({level:Ca.WARNING,header:"Audio input unavailable.",description:"This browser or session does not support audio input.",actions:{dismissable:!0}},Jc):nl()},lt=e=>{F(e.remote),e.enabled?null!==Xc&&(Ia(Xc),Xc=null):(Xc=Ta({level:Ca.WARNING,header:"Audio output unavailable.",description:"This browser or session does not support audio output.",actions:{dismissable:!0}},Xc),nl())},pt=e=>{A(e.serviceStatus)},ft=({message:e,code:n})=>{Ta({level:Ca.ERROR,header:"Webcam error.",description:t.createElement("div",null,"Webcam could not be attached.",t.createElement("br",null),"Error: ",e," (code: ",n,")"),actions:{dismissable:!0}})},bt=e=>{z(e.enabled)},yt=e=>{Q(e.enabled)},Mt=e=>{w(e.enabled)},kt=e=>{te(e.enabled)},Ct=e=>{re(e.enabled)},Rt=e=>{k(e.enabled)},Tt=e=>{const t=e.currentTarget.getBoundingClientRect();e.clientY<=t.top+Gc&&null===Qe.current?Qe.current=setTimeout(()=>{Ee(!0),d.document.getElementById("dcv-display")?.blur(),Qe.current=null},1500):e.clientY>t.top+Gc&&null!==Qe.current&&(clearTimeout(Qe.current),Qe.current=null)},It=()=>{Ee(!1)},Ft=()=>{ze.current=setTimeout(()=>{Ee(!1)},1500)},Dt=()=>{clearTimeout(ze.current)},At=a(()=>{je.current?.focus()},[je]),Bt=e=>{be(e)},_t=e=>{if(!e.enabled){const e=d.document.getElementById("dcv-softkbd-hid-input");e&&d.document.getElementById("soft-kbd-div").removeChild(e)}ce(e.enabled)},Nt=e=>{ke(e.matches?L.Dark:L.Light),Ce===et&&ut(e,d.document.body)},Pt=()=>{zc.info("Three finger click, showing toolbar"),Ee(!qe.current)},Lt=(e,t)=>{const n=Yc.indexOf(e);t.closed?(-1!==n&&Yc.splice(n,1),e===Qc&&me.emit("close-secondary-display")):t.enabled?Kc=e===Qc:-1===n&&Yc.push(e)},$t=()=>{zc.error("Webgl rendering lost context, showing information banner."),Ta({level:Ca.ERROR,header:"There was an error with webgl rendering",description:"Webgl rendering lost context. Please refresh the page to reconnect.",actions:{dismissable:!1}})};r(()=>$(j.Compact,d.document.body),[d]),r(()=>(e&&me.on("filestorage-enabled",X),()=>{e&&me.off("filestorage-enabled",X)}),[e]),r(()=>(n&&(me.on("first-frame",nt),me.on("network-quality-warning",Je),me.on("network-quality-critical",Xe),me.on("trackpadMode",tt),e?(!function(e){Et=se("Feature Handler"),St=e}(n),me.on("display-availability",Lt),Ot("audio-in",ct),Ot("audio-out",lt),Ot("webcam",pt),Ot("webcam-error",ft),Ot("clipboard-copy",bt),Ot("clipboard-paste",yt),Ot("relative-mouse",Mt),Ot("file-download",kt),Ot("file-upload",Ct),Ot("display-multi",e=>pe(e.enabled&&!Ne())),Ot("keyboard-sas",e=>x(e.enabled)),Ot("screenshot",Rt),Ot("timezone-redirection",it)):me.emit("open-secondary-display")),()=>{me.off("first-frame",nt),me.off("network-quality-warning",Je),me.off("network-quality-critical",Xe),me.off("trackpadMode",tt),e&&(me.off("display-availability",Lt),xt={})}),[n,e]),r(()=>{if(!b){const t=()=>fa(n,d,e);if(Kc&&Yc.length){const e=Yc.indexOf(Qc);-1!==e&&Yc.splice(e,1),setTimeout(t,500)}else e&&xa([{name:"",rect:{x:0,y:0,width:ra&&ra[0]?ra[0].rect.width:800,height:ra&&ra[0]?ra[0].rect.height:600},primary:!1}]),t()}},[b]),r(()=>(me.on("collaboration-status-update",U),()=>{me.off("collaboration-status-update",U)})),r(()=>(me.on("display-layout",at),()=>{me.off("display-layout",at)}),[Re,n,d,e]),r(()=>{n&&Ne()&&Ot("keyboard",_t)},[n,d]),r(()=>{const t=()=>{me.emit("close-secondary-display"),n&&n.disconnect()};return e&&d.addEventListener("pagehide",t),()=>{e&&d.removeEventListener("pagehide",t)}},[n,d,e]),r(()=>(Se&&(d.addEventListener("resize",Ze),Zc=d.document.getElementById("dcv-display")?.getElementsByTagName("canvas"),Zc&&Zc.length>0&&Zc[0].addEventListener("webglcontextlost",$t),d.matchMedia("(orientation: portrait)").addEventListener("change",Ze),ge&&Re===Ke||Re===He?(d.document.getElementById("dcv-container")&&d.document.getElementById("dcv-container").addEventListener("mousemove",Tt),d.document.getElementById("dcv-display")&&(d.document.getElementById("dcv-display").addEventListener("focusin",It),Ne()&&d.document.getElementById("dcv-display").addEventListener("touchstart",It)),d.document.getElementById("dcv-toolbar-container")&&(d.document.getElementById("dcv-toolbar-container").addEventListener("mouseleave",Ft),d.document.getElementById("dcv-toolbar-container").addEventListener("mousemove",Dt)),Ne()&&me.on("toggle-toolbar",Pt),Ee(!1)):(clearTimeout(ze.current),clearTimeout(Qe.current),Ee(!0)),v(!1)),()=>{Zc&&Zc.length>0&&Zc[0].removeEventListener("webglcontextlost",$t),d.removeEventListener("resize",Ze),d.matchMedia("(orientation: portrait)").removeEventListener("change",Ze),clearTimeout(ze.current),clearTimeout(Qe.current),d.document.getElementById("dcv-container")&&d.document.getElementById("dcv-container").removeEventListener("mousemove",Tt),d.document.getElementById("dcv-display")&&(d.document.getElementById("dcv-display").removeEventListener("focusin",It),Ne()&&d.document.getElementById("dcv-display").removeEventListener("touchstart",It)),d.document.getElementById("dcv-toolbar-container")&&(d.document.getElementById("dcv-toolbar-container").removeEventListener("mouseleave",Ft),d.document.getElementById("dcv-toolbar-container").removeEventListener("mousemove",Dt)),Ne()&&me.off("toggle-toolbar",Pt)}),[Se,Re,ge,n,e,d]),r(()=>{b&&!we||fa(n,d,e)},[Re,ge]),r(()=>{const e=dt();return mt(Ce,d.document.body),e&&(ke(e.matches?L.Dark:L.Light),e.addEventListener("change",Nt)),()=>{e&&e.removeEventListener("change",Nt)}},[Ce]),r(()=>{u&&Oe(u)},[u]),r(()=>{p&&Te(p)},[p]);const jt=s(()=>ae&&e&&rl(t.createElement(t.Fragment,null,t.createElement(m,{variant:le?"primary":"normal",onClick:()=>{me.emit("toggle-keyboard")},ariaLabel:"Virtual keyboard"},(le?"Close":"Open")+" keyboard"),t.createElement(hc,{connection:n,softKeyboardVisible:le,setSoftKeyboardVisible:de}))),[e,le,ae]),zt=s(()=>t.createElement(h,{direction:"horizontal",size:"m"},e&&J&&t.createElement(qs,{connection:n,downloadEnabled:ee,uploadEnabled:ne}),(P||K)&&t.createElement(Wt,{connection:n,copyEnabled:P,pasteEnabled:K,currentWindow:d}),e&&tl(R)&&tl(I)&&t.createElement(Ya,{connection:n}),e&&tl(I)&&t.createElement(cs,{connection:n}),e&&ye(D)&&t.createElement(_s,{connection:n,status:D,selectedWebcam:B,setSelectedWebcam:_}),e&&ue&&Ye("multimonitorButton")&&t.createElement(jc,{connection:n,copyEnabled:P,pasteEnabled:K,appearanceMode:Ce,toolbarBehavior:Re,pendingDisplays:Yc}),Ye("fullscreenButton")&&d.document.documentElement.requestFullscreen&&!We()&&!Le()&&t.createElement(ta,{setFullscreen:Bt,currentDocument:d.document})),[e,J,n,ee,ne,P,K,R,I,D,B,_,ue,P,K,Ce,Re,Yc,Bt,Ye,d]),Ut=s(()=>t.createElement(f,{textAlign:"center"},t.createElement(vs,{connection:n})),[n]),Vt=s(()=>t.createElement(f,{float:"right"},t.createElement("div",{style:Hc},e&&jt,e&&W&&rl(t.createElement(uc,{connection:n})),rl(t.createElement(Js,null)),rl(t.createElement(Va,{connection:n,relativeMouseModeEnabled:y,sasEnabled:S,focusDisplay:At,screenshotEnabled:M,currentResolution:C,submitResolutionPreferences:st,submitMetricsPreferences:Z,submitAppearanceModePreferences:Oe,submitToolbarBehaviorPreferences:Te,webcamStatus:D,webcamId:B,setWebcamId:_,systemDefaultAppearanceMode:Me,timezoneRedirectionSetting:Ie})))),[e,jt,n,W,y,S,M,C,D,B,Me,Ie]),Ht=s(()=>t.createElement(f,{display:we?"block":"none",padding:{left:"s",right:"s",top:"xs",bottom:"xs"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},zt,e&&Y&&Ut,e&&Vt)),[we,zt,e,Y,Ut,Vt,jt]),qt=s(()=>t.createElement("div",{id:"dcv-toolbar-container",style:{backgroundColor:H,borderBottom:`1px solid ${V}`,...Re===He||ge&&Re===Ke?Vc:{}}},Ht),[Re,ge,Ht]),Gt=s(()=>t.createElement("div",{style:{backgroundColor:q}},t.createElement("div",{style:{height:ve(d)-1}},t.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(h,{size:"m"},t.createElement(f,{textAlign:"center"},t.createElement(N,{size:"large"})),t.createElement(f,{fontWeight:"light",variant:"h1"},"Connecting"))))),[d]),Kt=s(()=>t.createElement("div",{style:{display:Be?"block":"none",zIndex:"1009",position:"absolute",top:"4%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(E,{type:"warning",header:"Network connection is unstable"},"Please check your network connection or VPN.")),[d,Be]),Qt=s(()=>t.createElement("div",{style:{display:Pe?"block":"none",zIndex:"1009",position:"absolute",top:"4%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(E,{type:"error",header:"Network connection is not available"},"Please check your network connection or VPN.")),[d,Pe]),Yt=s(()=>{const e=d.document.getElementById("dcv-input");return n?.setTrackpadMode(oe),e?t.createElement("div",{id:"trackpad-mode-buttons",style:{position:"absolute",left:"87px",bottom:"87px",zIndex:"1",opacity:"0.7"},onMouseMove:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onMouseDown:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onMouseUp:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onTouchStart:e=>e.preventDefault(),onTouchEnd:e=>e.preventDefault()},t.createElement("button",{"aria-label":"Left mouse button",onTouchStart:()=>{n.sendMouseButton(1,!0)},onTouchEnd:()=>{n.sendMouseButton(1,!1)},onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),style:{height:"100px",backgroundColor:q,fill:G}},t.createElement(vt,null)),t.createElement("button",{"aria-label":"Right mouse button",onTouchStart:()=>{n.sendMouseButton(3,!0)},onTouchEnd:()=>{n.sendMouseButton(3,!1)},onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),style:{position:"relative",left:"17px",height:"100px",backgroundColor:q,fill:G}},t.createElement(wt,null))):null},[Se]),Zt=s(()=>ba(d,!(Re===Ve||ge&&Re===Ge)),[d,Re,ge]),Jt=s(()=>va(d),[d]);return t.createElement("div",{id:"dcv-container",style:Uc},b&&!we?Gt:Ye("visible")&&qt,Kt,Qt,t.createElement("div",{style:{display:b&&!we?"none":"block",backgroundColor:q}},!b&&oe&&Yt,t.createElement("div",{id:"dcv-display-frame",style:{height:Zt,width:Jt,overflow:ht.scaleToFit?"hidden":"auto"}},t.createElement("div",{id:"dcv-display",ref:je,style:Wc})),t.createElement("div",{id:"dcv-resource",tabIndex:"-1"}),t.createElement("div",{id:"soft-kbd-div",style:{position:"absolute",top:0,zIndex:-1e3}})))}function tl(e){return-1!==["available","attached","active"].indexOf(e)}function nl(){null!==Jc&&(Ia(Jc),Jc=null)}function rl(e){return t.createElement("div",{style:qc},e)}function ol(e){if(null===e){const e=Yc.indexOf(Qc);-1!==e&&Yc.splice(e,1)}Qc=e}function il(){return Qc}el.propTypes={isPrimary:c.bool,connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,window:c.object,appearanceMode:c.oneOf([et,Je,Xe]),toolbarBehavior:c.oneOf([He,Ke,Ye]),uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})})};var al=n(el);const sl=se("License Handler");let cl=null;function ll(e){let t=365,n="",r={};e.licenses.forEach(e=>{e.isDemo&&sl.info(`License status: product '${e.product}' is using a demo license (${e.leftDays} days left)`),e.leftDays>0&&e.leftDays<t&&(t=e.leftDays,n=e.product)}),0===e.numUnlicensed?(sl.debug(`License status: ${e.licenses.length} products licensed`),r.level=Ca.INFO,"demo"===e.licensingMode&&t<7?r.header="DCV demo license.":r.header="DCV license.",t<7?(sl.info(`License status: product '${n}' will expire in ${t} days`),r.description=`License of '${n}' will expire in ${t} days.`):"demo"===e.licensingMode&&(r.description="DCV is running with a demo license.")):(sl.warn(`License error (mode: ${e.licensingMode}), ${e.numUnlicensed}/${e.licenses.length} products unlicensed: ${JSON.stringify(e.licenses)}`),r.header="No license available.","ec2"===e.licensingMode?(r.level=Ca.WARNING,r.description="Please, check your EC2 configuration.",null!==e.documentationUrl&&""!==e.documentationUrl&&(r.actions={},r.actions.accept={text:"See documentation",callback:()=>{const t=document.createElement("a");t.href=e.documentationUrl,t.target="_blank",t.click()}})):(r.level=Ca.ERROR,r.description="Please, contact the administrator.")),r.description&&(cl=Ta(r,cl))}const dl=se("Printer");function ul(e){Ta({level:Ca.INFO,header:"File printed.",description:`${e.id} has been converted in printable format.`,actions:{accept:{text:"Download",callback:()=>{return t=e,dl.debug(`Accepting print resource ${t.id}`),void t.accept({disposition:"attachment"});var t},remove:!0},decline:{text:"Decline",callback:()=>{return t=e,dl.debug(`Removing print resource ${t.id}`),void t.decline();var t},remove:!0}}}),dl.debug(`Added printer notification for resource ${e.id}`)}const ml=se("DCVBaseViewer");let pl,fl;function hl(e){const[n,i]=t.useState(null),a=o(n),s=t=>{pe(e.onDisconnect)&&e.onDisconnect(t),a.current=null},c=e=>{let t,r=`${fe(e.namespace)?"":`${e.namespace}::`}${e.name}`;0!==ht.customChannels.length&&-1!==(()=>{const t=[];return ht.customChannels.forEach(n=>{if(fe(e.namespace)){const e=n.split("::",2);t.push(e[e.length-1])}else t.push(n)}),t})().indexOf(r)?n.openChannel(e.name,e.authToken,{onMessageReceived:e=>{ml.info(`Custom channel: received message ${new TextDecoder("utf-8").decode(e)}`),t(e)},onClose:e=>ml.info(`Custom channel closed: ${JSON.stringify(e)}`)},e.namespace).then(e=>{ml.info(`Opened custom channel ${e.channelName}`),t=t=>{e.sendMessage(t).then(()=>{ml.info("Success sending message.")}).catch(e=>{ml.error(`Failed to send message: ${JSON.stringify(e)}`)})}}).catch(e=>{ml.error(`Failed to open custom channel: ${e.message}`)}):ml.info(`Custom channel '${r}' not supported`)},d=e=>{switch(e.name){case"TwoFingerTouch":me.emit("toggle-keyboard");break;case"ThreeFingerTouch":me.emit("toggle-toolbar")}},u=()=>{ml.info("Calling client.connect");const n={displayLayout:(e,t,n)=>{me.emit("display-layout",e,t,n)},firstFrame:(e,t,n)=>{me.emit("first-frame",e,t,n)},displayAvailability:(e,t)=>{me.emit("display-availability",e,t)},disconnect:s,licenseNotification:ll,idleWarningNotification:e=>{!function(e){let t;e?(t=`DCV connection is idle and is going to be disconnected at ${e.toString()}`,ml.info(t),pl=Ta({level:Ca.WARNING,header:"Idle timeout.",description:t,actions:{dismissable:!0}},pl)):pl&&(Ia(pl),pl=null)}(e)},dataChannel:e=>{me.emit("custom-channel",e)},filePrinted:e=>{ul(e)},fileDownload:e=>{me.emit("file-download",e)},qualityIndicatorState:e=>{ml.info(`Quality Indicators: ${JSON.stringify(e)}`),function(e){let n=0,r=[],o="Quality status update.";switch(e.indicators.forEach(e=>{r.push(t.createElement(f,{key:e.name},`${e.name.replace("_"," ")} status: ${e.status}`)),e.changed&&ml.info(`Indicator ${e.name} has changed to status ${e.status}`),e.status>n&&(n=e.status)}),ml.info(`Current Quality Indicator overall alarm state: ${n}`),n){case 1:fl=Ta({level:Ca.WARNING,header:o,description:r,actions:{dismissable:!0}},fl);break;case 2:fl=Ta({level:Ca.ERROR,header:o,description:r,actions:{dismissable:!0}},fl);break;default:fl&&(Ia(fl),fl=null)}}(e)},filestorageEnabled:e=>{me.emit("filestorage-enabled",e)},...Ne()&&{gestureEvent:d},clipboardEvent:e=>{me.emit("clipboard",e)},deviceChangeEvent:function(){me.emit("device-change")},featuresUpdate:Ct,screenshot:e=>{me.emit("screenshot",e)},collaboratorList:e=>{sc(e)},networkQualityChange:e=>{!function(e){switch(ml.info(`Network Quality Change: ${e.quality}`),e.quality){case"WARNING":gl("network-quality-warning");break;case"CRITICAL":gl("network-quality-critical");break;default:gl()}}(e)}},r={url:e.config.url,sessionId:e.config.sessionId,authToken:e.config.authToken,enabledChannels:e.config.enabledChannels??ht.enabledChannels,displayCodecs:e.config.displayCodecs??ht.displayCodecs,divId:e.config.divId??"dcv-display",showDebugLayer:e.config.showDebugLayer??ht.debugLayer,enableGraphicsDebugLayer:e.config.enableGraphicsDebugLayer??ht.enableGraphicsDebugLayer,clientHiDpiScaling:e.config.clientHiDpiScaling??ht.clientHiDpiScaling,enableHighPixelDensity:e.config.enableHighPixelDensity??ht.enableHighPixelDensity,enableWebCodecs:e.config.enableWebCodecs??ht.enableWebCodecs,enableWebAuthN:e.config.enableWebAuthN??ht.enableWebAuthN,highColorAccuracy:e.config.highColorAccuracy??ht.highColorAccuracy,losslessColorspace:e.config.losslessColorspace??ht.losslessColorspace,baseUrl:e.config.baseUrl,resourceBaseUrl:e.config.resourceBaseUrl??"",extensionData:e.config.extensionData??"",volumeLevel:e.config.volumeLevel??ht.volume,clipboardAutoSync:e.config.clipboardAutoSync,dynamicAudioTuning:e.config.dynamicAudioTuning,observers:{...n,...e.config.observers},callbacks:e.config.callbacks};Object.keys(r).forEach(e=>{fe(r[e])&&delete r[e]}),l.connect(r).then(t=>{i(t),a.current=t;const n=e.customTitle||`${t.getServerInfo().hostname} - Amazon DCV`;document.title=n,e.customTitle&&ml.info(`Using custom browser title: ${e.customTitle}`),pe(e.onConnectionEstablished)&&e.onConnectionEstablished(t)}).catch(t=>{ml.error(`client.connect was rejected (${t.message})`),pe(e.onDisconnect)&&e.onDisconnect(t.message),a.current=null})};return r(()=>{e.config.sessionId&&e.config.authToken&&!n&&(oe.setLevel(e.logLevel),u())},[e.config.sessionId,e.config.authToken]),r(()=>()=>{ml.info("Calling connection.disconnect"),a.current&&a.current.disconnect()},[]),r(()=>(me.on("custom-channel",c),()=>{me.off("custom-channel",c)}),[n]),t.createElement(al,{isPrimary:!0,connection:n,window:window,uiConfig:e.uiConfig})}function gl(e=""){switch(me.emit("network-quality-warning",!1),me.emit("network-quality-critical",!1),e){case"network-quality-warning":case"network-quality-critical":me.emit(e,!0);break;case"":break;default:ml.warn(`Unknown input passed to emitNetworkQualitySignal: ${e}`)}}hl.propTypes={config:c.shape({url:c.string.isRequired,sessionId:c.string.isRequired,authToken:c.string.isRequired,baseUrl:c.string,resourceBaseUrl:c.string,extensionData:c.string,connectionMetadata:c.object,enabledChannels:c.array,connectionFailureRetryAttempts:c.number,connectionBlockRetryAttempts:c.number,losslessColorspace:c.string,divId:c.string,volumeLevel:c.number,clipboardAutoSync:c.bool,dynamicAudioTuning:c.bool,clientHiDpiScaling:c.bool,highColorAccuracy:c.bool,enableHighPixelDensity:c.bool,enableWebCodecs:c.bool,enableWebAuthN:c.bool,enableGraphicsDebugLayer:c.bool,showDebugLayer:c.oneOfType([c.bool,c.number]),displayCodecs:c.array,observers:c.object,callbacks:c.object,httpExtraSearchParams:c.func}).isRequired,uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})}),onDisconnect:c.func,logLevel:c.oneOf(Object.values(oe.levels)),onConnectionEstablished:c.func,customTitle:c.string};const bl=se("DCVViewer");function vl(e){const n={url:e.dcv.serverUrl,sessionId:e.dcv.sessionId,authToken:e.dcv.authToken,baseUrl:e.dcv.baseUrl,resourceBaseUrl:e.dcv.resourceBaseUrl,extensionData:e.dcv.extensionData,clipboardAutoSync:!0,dynamicAudioTuning:!0,observers:e.dcv.observers};return bl.info("Creating DCVViewer component."),t.createElement(hl,{config:n,uiConfig:e.uiConfig,onDisconnect:e.dcv.onDisconnect,logLevel:e.dcv.logLevel,customTitle:e.dcv.customTitle,onConnectionEstablished:e.dcv.onConnectionEstablished})}vl.propTypes={dcv:c.exact({sessionId:c.string.isRequired,authToken:c.string.isRequired,serverUrl:c.string.isRequired,baseUrl:c.string.isRequired,resourceBaseUrl:c.string,extensionData:c.string,onDisconnect:c.func,logLevel:c.oneOf(Object.values(oe.levels)),customTitle:c.string,observers:c.exact({httpExtraSearchParams:c.func,httpExtraHeaders:c.func}),onConnectionEstablished:c.func}).isRequired,uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})})};export{vl as DCVViewer};
|
|
7
|
+
*/const li=class{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new ci(e,t)}static parse(e){return new ci(e).getResult()}static get BROWSER_MAP(){return Jo}static get ENGINE_MAP(){return ti}static get OS_MAP(){return ei}static get PLATFORMS_MAP(){return Xo}}.getParser(window.navigator.userAgent),ui="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,di=li.getOSName(!0);let mi=window.navigator.userAgent.match("; KF");function pi(){return function(){if("tablet"===li.getPlatformType(!0)||hi())return!0;return!1}()||"mobile"===li.getPlatformType(!0)}function fi(){return pi()&&navigator.userAgent.includes("Android")}function hi(){return!!li.satisfies({macos:{safari:">=13"}})&&ui}function gi(){return li}function bi(){return li.isBrowser("safari",!0)}function vi(){return"macos"===di}function yi(){return"ios"===di}function wi(e){window.navigator.userAgentData?.getHighEntropyValues&&window.navigator.userAgentData.getHighEntropyValues(["model"]).then(t=>{e.info(`Connection starting with device model: ${t.model}, platform: ${t.platform}`),mi=!!t.model.startsWith("KF")})}const Ei="auto-hide",Si="Auto-hide toolbar",xi="Automatically hide the toolbar and display it only moving the mouse to the top border.",ki="auto-hide-fullscreen",Ci="Auto-hide toolbar only in full screen",Oi="Fix the bar on the top only in windowed mode.",Mi="Always display the toolbar",Ri="Fix the bar on the top.",Ti="Light mode",Ii="Dark mode",Ai="System default",Di={label:"Best responsiveness",description:"Provide most fluid experience.",minQuality:20,maxQuality:90},Fi={label:"Best quality",description:"Provide best image quality.",minQuality:70,maxQuality:90},Bi="adaptive",Ni="current",_i=[{width:1920,height:1080},{width:1440,height:900},{width:1024,height:768},{width:800,height:600}],Pi=()=>[...pi()&&!mi?[{width:2560,height:1440},{width:2048,height:1080}]:[],{width:1920,height:1080},{width:1440,height:900},{width:1024,height:768},{width:800,height:600}],Li=()=>[...pi()&&!mi?[{width:1215,height:2160},{width:1080,height:2048}]:[],{width:1080,height:1920},{width:900,height:1440},{width:768,height:1024},{width:600,height:800}];let $i;function ji(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)")&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener}function Wi(){return $i}ji()&&($i=window.matchMedia("(prefers-color-scheme: dark)"));const zi=(e,t)=>{P(e.matches?L.Dark:L.Light,t)},Ui=(e,t)=>{switch(e){case Ai:$i&&zi($i,t);break;case Ti:P(L.Light,t);break;case Ii:P(L.Dark,t)}},Vi=se("Settings");let Hi=null;try{Hi=window.localStorage}catch(e){Vi.warn(`Settings persistence disabled. Error accessing local storage: ${e.message}`)}const qi={sessionId:"",authToken:"",extensionData:"",promptReconnect:!0,logLevel:"info",wss:!0,enabledChannels:[],customChannels:[],displayCodecs:[],enableQU:!0,minQuality:30,maxQuality:0,maxDisplayWidth:0,maxDisplayHeight:0,minDisplayWidth:640,minDisplayHeight:480,debugLayer:!1,enableGraphicsDebugLayer:!1,clientHiDpiScaling:!0,enableHighPixelDensity:!1,enableWebCodecs:!0,losslessColorspace:"rgb",dynamicResolution:!0,enableShortcutEditor:!1,enableWebAuthN:!1,scaleToFit:Boolean(pi()),volume:100,microphone:!1,webcam:!1,macOptionToAlt:!0,macCommandToControl:!1,controlToCommand:!0,appearanceMode:ji()?Ai:Ti,toolbarBehavior:Ci,displayQuality:Di.label,metricsEnabled:!1,selectedResolution:Bi,selectedWebcamId:null,highColorAccuracy:!1,forceKeyboardCombinations:!1,timezoneRedirectionEnabled:!1};function Gi(){Hi?.setItem("dcv-settings",JSON.stringify(qi))}function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ki.apply(null,arguments)}var Qi=function(t){return e.createElement("svg",Ki({xmlns:"http://www.w3.org/2000/svg",width:39,height:70,viewBox:"0 0 39 69"},t),e.createElement("path",{d:"M20.3 0v28.441H0C0 19.688.871 12.38 7.047 5.793 10.664 2.512 15.324 0 20.3 0M1.602 29.496H39c.031 3.8.066 7.606.102 11.524.02 1.78.02 1.78.043 3.601l.011 2.879.024 1.469c.004 5.89-1.73 10.855-5.875 15.16-4.442 3.988-8.883 5.082-14.785 5.012-5.645-.403-9.41-2.934-13.176-6.989-3.485-4.297-3.903-8.804-3.844-14.14v-1.43c.008-1.746.023-3.488.035-5.234.024-3.91.043-7.82.067-11.852m2.671 2.633c-.043 3.27-.085 6.539-.132 9.91-.02 1.02-.04 2.04-.059 3.09-.074 6.684.492 12.016 5.379 17.05 3.402 2.852 7.371 4.368 11.828 4.301 4.969-.496 8.555-3.59 11.871-7.011 3.754-5.567 3.43-11.274 3.3-17.696-.042-3.18-.085-6.363-.132-9.644zM21.371 5.266c5.68.625 10.29 2.14 14.211 6.394C39.437 16.723 39 20.762 39 27.39H21.371zm2.672 3.16v16.328h12.285c0-4.79-.66-7.832-3.738-11.586-2.824-2.57-4.742-3.668-8.547-4.742m0 0",style:{stroke:"none",fillRule:"nonzero",fillOpacity:1}}))};function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yi.apply(null,arguments)}var Zi=function(t){return e.createElement("svg",Yi({xmlns:"http://www.w3.org/2000/svg",width:39,height:70,viewBox:"0 0 39 69"},t),e.createElement("path",{d:"M18.7 0c6.597.813 11.296 3.305 15.491 8.426C38.578 14.703 39 20.914 39 28.44H18.7zM0 29.496h37.398c.032 3.89.067 7.777.098 11.785l.047 3.688.012 2.941.023 1.504c.004 6.121-1.738 10.356-5.941 14.797-3.617 3.445-7.672 4.871-12.672 5.05-5.242-.183-9.813-1.945-13.621-5.527-3.43-3.773-5.418-7.879-5.406-13.011 0-.48.003-.961.003-1.457s.004-.996.008-1.508v-1.406q.008-2.585.016-5.168zm2.672 2.633c-.035 3.293-.067 6.586-.102 9.976-.015 1.028-.027 2.06-.043 3.118l-.011 2.492q-.011.626-.028 1.27c0 5.027 1.614 8.91 4.992 12.64 3.106 3.063 6.875 4.824 11.286 4.973 4.761-.227 9.214-2.45 12.527-5.828 2.953-3.77 3.68-7.997 3.59-12.645 0-.406-.004-.816-.004-1.238-.008-1.508-.031-3.012-.05-4.52-.036-3.379-.067-6.758-.102-10.238zM17.629 5.266V27.39H0c0-11.95 0-11.95 4.777-16.95C8.57 7.133 12.563 5.266 17.63 5.266M6.164 12.793c-3.21 3.523-3.492 7.324-3.492 11.96h12.285V8.427c-3.363 0-6.36 2.21-8.793 4.367m0 0",style:{stroke:"none",fillRule:"nonzero",fillOpacity:1}}))};let Ji,Xi,ea={},ta=[];function na(e){Xi.queryFeature(e).then(t=>{Vo(ea[e])&&ea[e](t)}).catch(t=>{Ji.info(`Query for ${e} denied with message: ${t.message}`)})}function ra(e){e.length>0&&function(e){e.forEach(e=>{-1!==Object.keys(ea).indexOf(e)?na(e):(ta.push(e),Ji&&Ji.info(`No callback for feature ${e} adding to pending.`))})}(e)}function oa(e,t){e&&Vo(t)?(ea[e]=t,Ji.info(`Added feature listener for: ${e}`),Ji.debug(`Callbacks ${Object.keys(ea)}`),Ji.debug(`Pending updates ${ta}`),-1!==ta.indexOf(e)&&(na(e),ta.splice(ta.indexOf(e),1))):Ji.warn("Wrong parameters for addFeatureListener")}const ia=vi()||yi()?"⌘":"CTRL",aa=pi()?"":`[${ia}+C]`,sa=pi()?"":`[${ia}+V]`,ca=`Press ${aa} to copy content from remote clipboard.`,la=`Press ${sa} to paste content to remote clipboard.`,ua="Clipboard synced",da="success",ma=se("Clipboard");let pa="",fa="",ha=!1;function ga({connection:e,copyEnabled:n,pasteEnabled:o,currentWindow:i}){const[a,s]=t.useState(!1),[c,l]=t.useState(""),[b,v]=t.useState({}),[y,w]=t.useState({}),E=()=>{s(!1),e.captureClipboardEvents(!1,i)},S=(e,t)=>{a?(v({status:e,message:t}),i.document.getElementById("modal-popover-trigger").click()):(w({status:e,message:t}),i.document.getElementById("icon-popover-trigger").click())},x=()=>{ha||(S(da,ua),("string"==typeof pa||pa instanceof String)&&l(pa))},k=()=>{ha||(S(da,ua),("string"==typeof fa||fa instanceof String)&&l(fa))},C=()=>{S("error","The clipboard data is too large to be transferred"),ha=!0},O=e=>{switch(ma.info(`Received clipboard event ${e.name}`),e.name){case"established":break;case"copy":case"autoCopyDone":x();break;case"paste":case"autoPasteDone":k();break;case"dataSizeAlert":C();break;case"remoteError":"dataSizeAlert"===e.error&&C();break;case"newDataAvailable":e.autoCopy||S("info","Use the clipboard to copy data locally or remotely."),pa=e.clipboardData["text/plain"],ha=!1;break;case"pasteAvailableData":fa=e.clipboardData,ha=!1;break;default:ma.info("Unknown clipboard event.")}};return r(()=>(Mo.on("clipboard",O),()=>{Mo.off("clipboard",O)}),[i,a]),t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start"}},t.createElement("div",{style:{height:0}},t.createElement(u,{dismissButton:!1,position:"bottom",size:"large",triggerType:"custom",content:t.createElement(d,{type:y.status},y.message)},t.createElement("div",{id:"icon-popover-trigger"}))),t.createElement("div",{title:"Clipboard"},t.createElement(m,{iconName:"copy",variant:"icon",onClick:()=>{s(!0),l(""),e.captureClipboardEvents(!0,i)}}))),t.createElement(p,{onDismiss:E,visible:a,size:"large",header:"Copy and paste",footer:t.createElement(f,{float:"right"},t.createElement(m,{variant:"primary",onClick:E},"Done")),modalRoot:i.document.body},t.createElement(h,{size:"xl"},pi()?t.createElement(h,{size:"m",direction:"horizontal"},n&&t.createElement(m,{onClick:()=>e.syncClipboards()},ca),o&&t.createElement(m,{onClick:async()=>{const e=await navigator.clipboard.readText().catch(()=>{ma.warn("There was an error trying to gather clipboard text")}),t=new ClipboardEvent("paste",{dataType:"text/plain",clipboardData:new DataTransfer});e&&(t.clipboardData.items.add(e,"text/plain"),i.document.dispatchEvent(t))}},la)):t.createElement(f,null,n&&t.createElement(f,{variant:"p"},ca),o&&t.createElement(f,{variant:"p"},la)),t.createElement(f,{variant:"p",margin:{bottom:"xs"}},"Content preview")),t.createElement("div",{style:{margin:"auto",width:"1px",height:0}},t.createElement(u,{dismissButton:!1,position:"top",size:"large",triggerType:"custom",content:t.createElement(d,{type:b.status},b.message)},t.createElement("div",{id:"modal-popover-trigger",style:{marginTop:"19.5px"}}))),t.createElement(g,{controlId:"textarea",value:(M=c,M.substring(0,5e3).replace(/\0/g,"").concat(M.length>5e3?" ...":"")),readOnly:!0,rows:10})));var M}ga.propTypes={connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,currentWindow:c.object};var ba,va,ya,wa,Ea,Sa,xa,ka,Ca,Oa,Ma,Ra=n(ga),Ta={};function Ia(){if(va)return ba;va=1;var e=de(),t=lr(),n=ar(),r=e.RangeError;return ba=function(e,o,i,a){var s=t(e),c=n(i),l=c<0?s+c:c;if(l>=s||l<0)throw r("Incorrect index");for(var u=new o(s),d=0;d<s;d++)u[d]=d===l?a:e[d];return u}}function Aa(){if(Sa)return Ea;Sa=1;var e=de(),t=gt(),n=e.String,r=e.TypeError;return Ea=function(e){if("object"==typeof e||t(e))return e;throw r("Can't set "+n(e)+" as a prototype")}}function Da(){if(ka)return xa;ka=1;var e=mt(),t=Sn(),n=Aa();return xa=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,i={};try{(r=e(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),o=i instanceof Array}catch(e){}return function(e,i){return t(e),n(i),o?r(e,i):e.__proto__=i,e}}():void 0)}function Fa(){if(Oa)return Ca;Oa=1;var e,t,n,r=wa?ya:(wa=1,ya="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView),o=Se(),i=de(),a=gt(),s=bt(),c=on(),l=vo(),u=kt(),d=kn(),m=Un(),p=xn().f,f=yt(),h=Gr(),g=Da(),b=sn(),v=an(),y=i.Int8Array,w=y&&y.prototype,E=i.Uint8ClampedArray,S=E&&E.prototype,x=y&&h(y),k=w&&h(w),C=Object.prototype,O=i.TypeError,M=b("toStringTag"),R=v("TYPED_ARRAY_TAG"),T=v("TYPED_ARRAY_CONSTRUCTOR"),I=r&&!!g&&"Opera"!==l(i.opera),A=!1,D={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},B=function(e){if(!s(e))return!1;var t=l(e);return c(D,t)||c(F,t)};for(e in D)(n=(t=i[e])&&t.prototype)?d(n,T,t):I=!1;for(e in F)(n=(t=i[e])&&t.prototype)&&d(n,T,t);if((!I||!a(x)||x===Function.prototype)&&(x=function(){throw O("Incorrect invocation")},I))for(e in D)i[e]&&g(i[e],x);if((!I||!k||k===C)&&(k=x.prototype,I))for(e in D)i[e]&&g(i[e].prototype,k);if(I&&h(S)!==k&&g(S,k),o&&!c(k,M))for(e in A=!0,p(k,M,{get:function(){return s(this)?this[R]:void 0}}),D)i[e]&&d(i[e],R,e);return Ca={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_CONSTRUCTOR:T,TYPED_ARRAY_TAG:A&&R,aTypedArray:function(e){if(B(e))return e;throw O("Target is not a typed array")},aTypedArrayConstructor:function(e){if(a(e)&&(!g||f(x,e)))return e;throw O(u(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(o){if(n)for(var a in D){var s=i[a];if(s&&c(s.prototype,e))try{delete s.prototype[e]}catch(n){try{s.prototype[e]=t}catch(e){}}}k[e]&&!n||m(k,e,n?t:I&&w[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,a;if(o){if(g){if(n)for(r in D)if((a=i[r])&&c(a,e))try{delete a[e]}catch(e){}if(x[e]&&!n)return;try{return m(x,e,n?t:I&&x[e]||t)}catch(e){}}for(r in D)!(a=i[r])||a[e]&&!n||m(a,e,t)}},isView:function(e){if(!s(e))return!1;var t=l(e);return"DataView"===t||c(D,t)||c(F,t)},isTypedArray:B,TypedArray:x,TypedArrayPrototype:k}}!function(){if(Ma)return Ta;Ma=1;var e=Ia(),t=Fa(),n=t.aTypedArray,r=t.exportTypedArrayMethod,o=t.TYPED_ARRAY_CONSTRUCTOR;r("with",{with:function(t,r){return e(n(this),this[o],t,r)}}.with)}();var Ba,Na,_a,Pa,La,$a,ja,Wa,za,Ua,Va,Ha={};function qa(){if(Na)return Ba;Na=1;var e=gt(),t=bt(),n=Da();return Ba=function(r,o,i){var a,s;return n&&e(a=o.constructor)&&a!==i&&t(s=a.prototype)&&s!==i.prototype&&n(r,s),r}}function Ga(){if(Pa)return _a;Pa=1;var e=de(),t=vo(),n=e.String;return _a=function(e){if("Symbol"===t(e))throw TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Ka(){if($a)return La;$a=1;var e=Ga();return La=function(t,n){return void 0===t?arguments.length<2?"":n:e(t)},La}function Qa(){if(Ua)return za;Ua=1;var e=mt()("".replace),t=String(Error("zxcasd").stack),n=/\n\s*at [^:]*:[^\n]*/,r=n.test(t);return za=function(t,o){if(r&&"string"==typeof t)for(;o--;)t=e(t,n,"");return t}}!function(){if(Va)return Ha;Va=1;var e=Or(),t=vt(),n=dt(),r=xn().f,o=on(),i=Mr(),a=qa(),s=Ka(),c=Wa?ja:(Wa=1,ja={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}),l=Qa(),u=Xt(),d="DOMException",m=t("Error"),p=t(d),f=function(){i(this,h);var e=arguments.length,t=s(e<1?void 0:arguments[0]),o=s(e<2?void 0:arguments[1],"Error"),c=new p(t,o),u=m(t);return u.name=d,r(c,"stack",n(1,l(u.stack,1))),a(c,this,f),c},h=f.prototype=p.prototype,g="stack"in m(d),b="stack"in new p(1,2),v=g&&!b;e({global:!0,forced:u||v},{DOMException:v?f:p});var y=t(d),w=y.prototype;if(w.constructor!==y)for(var E in u||r(w,"constructor",n(1,y)),c)if(o(c,E)){var S=c[E],x=S.s;o(y,x)||r(y,x,n(6,S.c))}}();const Ya=`OS: ${hi()?`iOS ${gi().getBrowserVersion()}(Desktop Mode on iOS Safari detected, estimating version from Safari)`:`${gi().getOSName()} ${gi().getOSVersion()}`}\nBrowser version: ${gi().getBrowserName()} ${gi().getBrowserVersion()} with ${gi().getEngineName()} engine\nPlatform: ${hi()?" Tablet (Desktop Mode on iOS Safari detected)":gi().getPlatformType()}\nWeb SDK version: ${l.version.versionStr}`,Za=se("About");function Ja(e){const[n,o]=t.useState(""),[i,a]=t.useState("");return r(()=>{null!==e.connection&&(o(Xa(e.connection.getServerInfo())),fetch("third-party-licenses.txt").then(e=>{const t=`Status code: ${e.status}, Status Text: ${e.statusText}`;if(Za.debug(`Received response. ${t}`),[...e.headers.entries()].forEach(e=>Za.debug(`Header: ${e[0]} with value: ${e[1]}`)),!e.ok)throw new Error(t);return e.text()}).then(e=>a(e)).catch(e=>Za.warn(`Failed to fetch resource. Error: ${e}`)))},[e.connection]),t.createElement(p,{onDismiss:e.onDismiss,visible:e.visible,size:"large",header:"About Amazon DCV",modalRoot:window.document.body,disableContentPaddings:!0,footer:t.createElement(b,{gridDefinition:[{colspan:7},{colspan:5}]},t.createElement(f,null,"Copyright © 2017-2024, NICE s.r.l. or its affiliates. All rights reserved."),t.createElement(f,{float:"right"},t.createElement(v,{external:!0,externalIconAriaLabel:"Opens in a new tab",href:"EULA.txt"},"End User License Agreement")))},t.createElement(y,{tabs:[{label:"Client",id:"about-client",content:Ko(t.createElement(g,{rows:10,readOnly:!0,value:Ya}))},{label:"Server",id:"about-server",content:Ko(t.createElement(g,{rows:10,readOnly:!0,value:n}))},{label:"Third party notices",id:"third-party-notices",content:Ko(t.createElement(g,{rows:10,readOnly:!0,value:i}))}]}))}function Xa(e,t){let n="";return Object.keys(e).forEach(r=>{"version"===r?n+=`${Go(r)}: ${e[r].major}.${e[r].minor}.${e[r].revision}\n`:qo(e[r])?n+=Xa(e[r],Go(r)):n+=t?`${t}-${r}: ${e[r]}\n`:`${Go(r)}: ${e[r]}\n`}),n}var es;function ts(){return ts=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ts.apply(null,arguments)}Ja.propTypes={connection:c.object,visible:c.bool,onDismiss:c.func};var ns=function(t){return e.createElement("svg",ts({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),es||(es=e.createElement("path",{d:"M15 6h-5V1M1 6h5V1M1 10h5v5M15 10h-5v5M1 1l5 5M15 1l-5 5M6 10l-5 5M10 10l5 5"})))};const rs=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],os=se("Fullscreen");function is(e){return Boolean(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function as({setFullscreen:e,currentDocument:n}){const[o,i]=t.useState(!1),a=()=>{const t=is(n);i(t),e(t)},s=()=>n.fullscreenEnabled||n.webkitFullscreenEnabled||n.mozFullScreenEnabled||n.msFullscreenEnabled;return r(()=>(s()&&rs.forEach(e=>n.addEventListener(e,a)),()=>{s()&&rs.forEach(e=>n.removeEventListener(e,a))}),[n,e]),t.createElement("div",{title:"Full Screen"},t.createElement(m,K({},o?{iconSvg:t.createElement(ns,null)}:{iconName:"expand"},{variant:"icon",onClick:()=>{is(n)?(n.exitFullscreen&&n.exitFullscreen(),navigator?.keyboard?.unlock()):(()=>{const e=n.documentElement;e.requestFullscreen&&e.requestFullscreen(),navigator.permissions.query({name:"keyboard-lock"}).then(e=>{"denied"!==e?.state?(os.info("granted"===e?.state?"Keyboard lock enabled":"Requesting permission to lock keyboard"),navigator?.keyboard?.lock().catch(()=>{})):os.info("Keyboard lock permission denied")}).catch(()=>{os.debug("Keyboard-lock permission not supported by browser, defaulting to normal behaviour"),navigator?.keyboard?.lock()})})()}})))}as.propTypes={setFullscreen:c.func,currentDocument:c.object};var ss=n(as);const cs=se("Display Layout");let ls,us,ds,ms={},ps={},fs=null,hs=0,gs=0;const bs=(e,t,n)=>{const r=ks(e),o=xs(e),i=r>o?Pi()[0]:Li()[0],a=Math.max(qi.minDisplayWidth/r,qi.minDisplayHeight/o,1),s=Math.min(i.width/r,i.height/o);let c=r>o?n/o:t/r;return c<a?c=a:c>s&&(c=s),[Math.round(c*r),Math.round(c*o)]};function vs(){return us}function ys(e){return qi.dynamicResolution&&vs()&&qi.selectedResolution===Bi&&(e||ls&&ls.length>1)}function ws(e,t,n){let r,o;if(ls&&ls.length>0)1===ls.length||n?(r=ls[0].rect.width,o=ls[0].rect.height):ls.length>1&&!n&&(r=ls[1].rect.width,o=ls[1].rect.height);else{const e=t.document.getElementById("dcv-display");e?(r=e.getBoundingClientRect().width,o=e.getBoundingClientRect().height):(r=t.innerWidth,o=t.innerHeight)}ys(n)?(ms[n]&&(clearTimeout(ms[n]),ms[n]=null),ms[n]=setTimeout(()=>{!function(e,t,n){let r=ks(t),o=xs(t);if(r=Math.min(r,qi.maxDisplayWidth||r),r=Math.max(r,qi.minDisplayWidth||r),o=Math.min(o,qi.maxDisplayHeight||o),o=Math.max(o,qi.minDisplayHeight||o),pi()){const e=bs(t,r,o);r=e[0],o=e[1]}const i=()=>{const e=e=>Math.abs(ps[n].width-r)>e||Math.abs(ps[n].height-o)>e;return!is(t.document)&&!t.fullScreen||function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}(ps[n])||e(2)};i()?(ps[n]={width:r,height:o},Is(e,r,o,n),vi()&&bi()&&Cs(t.document.getElementById("dcv-display-frame"),"hidden")):Cs(t.document.getElementById("dcv-display-frame"),"hidden")}(e,t,n),ms[n]=null},500)):(pi()&&(ms[n]&&(clearTimeout(ms[n]),ms[n]=null),ms[n]=setTimeout(()=>{const i=bs(t,r,o);Is(e,i[0],i[1],n),ms[n]=null},300)),Rs(r,o,t,n))}function Es(e,t){return`${e}x${t}`}function Ss(e){return e.split("x")}function xs(e,t=!1){let n=0,r=e.document.getElementById("dcv-container"),o=e.document.getElementById("dcv-toolbar-container"),i=e.document.getElementById("dcv-display-frame");return r&&i?(n=t&&o?o.getBoundingClientRect().height:i.getBoundingClientRect().top-r.getBoundingClientRect().top,r.getBoundingClientRect().height-n):Qo(e)}function ks(e){const t=e.document.getElementById("dcv-container");return t?t.getBoundingClientRect().width:e.innerWidth}function Cs(e,t){e&&(e.style.overflow=t)}function Os(e){const t=e.document.getElementById("dcv-display"),n=e.document.getElementById("dcv-display-frame");t&&n&&((()=>{const r=xs(e),o=t.getBoundingClientRect().height,i=o?`${Math.max(0,(r-o)/2).toString()}px`:0;t.style.marginTop=i,n.style.height=`${r.toString()}px`})(),(()=>{const r=ks(e),o=t.getBoundingClientRect().width,i=o?`${Math.max(0,(r-o)/2).toString()}px`:0;t.style.marginLeft=i,n.style.width=`${r.toString()}px`})())}function Ms(e){const t=pi()?function(){const e=ks(window),t=xs(window),n=[],r=e>t?Pi():Li(),o=r[0],i=bs(window,0,0),a=bs(window,o.width,o.height),s=i[0]/e,c=a[0]/e;return fs&&hs===e&&gs===t||(n.push({width:i[0],height:i[1]}),r.forEach(r=>{const o=r.height/t,i=r.width/e;o>s&&o<c&&-1===n.findIndex(t=>t.width===Math.round(o*e))&&n.push({width:Math.round(o*e),height:Math.round(o*t)}),i>s&&i<c&&-1===n.findIndex(t=>t.width===Math.round(i*e))&&n.push({width:Math.round(i*e),height:Math.round(i*t)})}),-1===n.findIndex(e=>e.width===a[0])&&n.push({width:a[0],height:a[1]}),hs=e,gs=t,fs=n.sort((e,t)=>t.width-e.width)),fs}():_i;return t.filter(t=>{let n=!0;if(qi.minDisplayWidth&&(n=t.width>=qi.minDisplayWidth),n&&qi.maxDisplayWidth&&(n=t.width<=qi.maxDisplayWidth),n&&qi.minDisplayHeight&&(n=t.height>=qi.minDisplayHeight),n&&qi.maxDisplayWidth&&(n=t.height<=qi.maxDisplayHeight),n){const r=Ss(e);t.width.toString()===r[0]&&t.height.toString()===r[1]&&(n=!1)}return n}).map(e=>({value:Es(e.width,e.height),label:Es(e.width,e.height)}))}function Rs(e,t,n,r){let o=1,i=1,a=1;const s=ks(n),c=xs(n);if(Os(n),Cs(n.document.getElementById("dcv-display-frame"),qi.scaleToFit?"hidden":"auto"),ys(r)||(ps[r]={}),qi.scaleToFit){if(i=s/e,a=c/t,o=Math.max(0,Math.floor(100*Math.min(1,i,a))/100),!o)return;cs.info(`Requesting a display scaling factor of ${o}`),!function(e,t){const n=`scale(${e})`,r=t.getElementById("dcv-display"),o=t.getElementById("dcv-container");ds||(ds=function(){const e=window.CSS&&window.CSS.supports||window.supportsCSS;if(e&&e("( transform: scale(1) )"))return"transform";if(e&&e("( zoom: 0.8 )"))return"zoom";return"no-scale"}());if("transform"===ds)return r.style.transform=n,r.style.transformOrigin="0 0",o.style.overflow="hidden",!0;if("zoom"===ds)return r.style.zoom=e,o.style.overflow="hidden",!0;return o.style.overflow="auto",!1}(o,n.document)?cs.info("CSS scaling or zoom unsupported!"):Os(n)}}function Ts(e){ls=e}function Is(e,t,n,r){let o,i,a=r?ls[0].name:ls[1].name,s=r?0:ls[0].rect.width;return ls&&ls.length>1?(o={name:a,rect:{x:s,y:0,width:t,height:n},primary:r},i=r?[o,ls[1]]:[ls[0],o],Ts(i),e.requestDisplayLayout(i)):e.requestResolution(t,n)}function As(e){const[n,o]=t.useState(qi.macOptionToAlt),[i,a]=t.useState(qi.macCommandToControl),[s,c]=t.useState(qi.controlToCommand),l=t=>{t?(qi.macOptionToAlt=n,qi.macCommandToControl=i,qi.controlToCommand=s,Gi(),e.connection.setKeyboardQuirks({macOptionToAlt:n,macCommandToControl:i,forceKeyboardCombinations:qi.forceKeyboardCombinations,controlToCommand:s})):(o(qi.macOptionToAlt),a(qi.macCommandToControl),c(qi.controlToCommand))};return r(()=>(Mo.on("close-preferences",l),()=>{Mo.off("close-preferences",l)}),[n,i,s]),t.createElement(h,{size:"xxl"},!e.isClientMacOS&&e.isServerMacOS&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Control key setting"),t.createElement(w,{onChange:({detail:e})=>c(e.value),value:s,items:[{value:!0,label:"Use Control as remote Command key (⌘)"},{value:!1,label:"Use Control as remote Control (^)"}]})),e.isClientMacOS&&!e.isServerMacOS&&t.createElement(t.Fragment,null,t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Option key setting"),t.createElement(w,{onChange:({detail:e})=>o(e.value),value:n,items:[{value:!0,label:"Use Option (⌥) as remote Alt key"},{value:!1,label:"Use Option (⌥) as local modifier"}]})),t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Command key setting"),t.createElement(w,{onChange:({detail:e})=>a(e.value),value:i,items:[{value:!0,label:"Use Command (⌘) as remote Control key"},{value:!1,label:"Use Command (⌘) as remote Meta key"}]}))))}As.propTypes={connection:c.object,isClientMacOS:c.bool,isServerMacOS:c.bool};const Ds={ERROR:{status:"error",color:"red",importance:3},WARNING:{status:"warning",color:"red",importance:2},SUCCESS:{status:"success",color:"green",importance:1},INFO:{status:"info",color:"blue",importance:1}};let Fs=0,Bs=[];function Ns(e,t){let n,r=(e=>({id:Fs++,level:Ho(e.level)?Ds.INFO:e.level,header:Ho(e.header)?"":e.header,description:Ho(e.description)?null:e.description,progress:Ho(e.progress)?null:e.progress,uploadedBytes:Ho(e.progress)?null:e.uploadedBytes,totalBytes:Ho(e.progress)?null:e.totalBytes,uploadedFiles:Ho(e.progress)?null:e.uploadedFiles,totalFiles:Ho(e.progress)?null:e.totalFiles,actions:Ho(e.actions)?{}:e.actions,timestamp:Date.now()}))(e),o=-1;return Ho(t)||(o=Bs.findIndex(e=>e.id===t)),-1===o?n=[r].concat(Bs.map(e=>({...e}))):(n=Bs.map(e=>({...e})),n[o]=r),Bs=n,Mo.emit("notifications-update",Bs),r.id}function _s(e){const t=Bs.map(e=>({...e})).filter(t=>t.id!==e);Bs=t,Mo.emit("notifications-update",Bs)}function Ps(e,t,n,r,o,i){if(!Ho(t)){const a=Bs.findIndex(e=>e.id===t);if(-1!==a){const t=Bs.map(e=>({...e}));t[a].progress=e,t[a].uploadedBytes=n,t[a].totalBytes=r,t[a].uploadedFiles=o,t[a].totalFiles=i,Bs=t,Mo.emit("notifications-update",Bs)}}}const Ls=se("UI CameraSelect");let $s=null;function js(e){const[n,i]=t.useState(),[a,s]=t.useState([]),[c,l]=t.useState(),u=o(!0),d=e=>{Ns({level:Ds.ERROR,header:"Error getting devices.",description:e.message,actions:{dismissable:!0}},null)},p=e=>{const t=[];e.filter(e=>"videoinput"===e.kind).forEach((e,n)=>{t.push({label:e.label||`Camera ${n+1}`,value:e.deviceId})}),s(t)},g=()=>{e.connection.getConnectedDevices().then(p).catch(d)},b=()=>{navigator.permissions.query({name:"camera"}).then(t=>{$s&&($s.onchange=null),$s=t,n||(t.onchange=b,g()),i(t.state),"granted"===t.state&&Yo(e.webcamStatus)&&g()}).catch(e=>{e instanceof TypeError?Ls.info(e.message):Ls.warn(e.message)})},v=t=>{t?c&&(e.setWebcamId(c),qi.selectedWebcamId=c,Gi()):l(qi.selectedWebcamId)},y=()=>t.createElement(m,{iconAlign:"right",href:"https://docs.aws.amazon.com/dcv/latest/userguide/using-webcam.html",target:"_blank",iconName:"external"},"Read more");r(()=>{a.filter(t=>e.webcamId===t.value).length?l(e.webcamId):a.length&&(l(a[0].value),e.setWebcamId(a[0].value))},[e.webcamId,n,a]),r(()=>{e.webcamStatus&&(Ls.info(`Webcam enabled. Status: ${e.webcamStatus}`),u.current&&(b(),u.current=!1))},[e.webcamStatus]),r(()=>(Mo.on("close-preferences",v),Mo.on("device-change",g),()=>{Mo.off("close-preferences",v),Mo.off("device-change",g)}),[e.connection,e.setWebcamId,c]);const[w,x,k,C]=(()=>{let r="",o=null,i="info",a=!0;if("busy"===e.webcamStatus)r="Camera not available. Another user is already sharing a camera within the session.",o=y(),i="warning";else switch(n){case"prompt":r="Camera not available. Grant camera permission to use it.",o=t.createElement(m,{onClick:()=>navigator.mediaDevices.getUserMedia({video:!0})},"Allow detection"),i="info";break;case"denied":r="Camera not available. Grant camera permission to use it.",o=y(),i="warning";break;case"granted":"streaming"===e.webcamStatus?(r="The selected camera cannot be changed while the streaming is active.",o=y(),i="warning"):(r="Camera available. Check the browser settings to change this site's camera permission.",o=y(),i="info",a=!1)}return[r,o,i,a]})();return t.createElement(h,{size:"l"},t.createElement(E,{action:x,type:k},w),t.createElement("div",null,t.createElement(f,null,"Camera"),t.createElement(f,{color:"text-body-secondary",fontSize:"body-s",margin:{bottom:"s"}},"Select which camera to activate."),t.createElement("div",{style:{width:"70%"}},t.createElement(S,{selectedOption:(e=>{const t=a.filter(t=>e===t.value);return t.length?t[0]:null})(c),onChange:({detail:e})=>l(e.selectedOption.value),options:a,selectedAriaLabel:"Selected",disabled:C}))))}js.propTypes={connection:c.object,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func};const Ws=se("Preferences");function zs(e){const[n,o]=t.useState("general"),[i,a]=t.useState(qi.selectedResolution),[s,c]=t.useState(qi.metricsEnabled),[u,d]=t.useState(!1),[g,b]=t.useState(!1),[v,E]=t.useState(qi.enableHighPixelDensity),[S,C]=t.useState(qi.displayQuality),[O,M]=t.useState(qi.appearanceMode),[R,T]=t.useState(qi.toolbarBehavior),[I,A]=t.useState(260),[D,F]=t.useState(0),[B,N]=t.useState(qi.timezoneRedirectionEnabled),_=e.connection.getServerInfo().os.startsWith("Darwin"),P=e=>{Ns({level:Ds.WARNING,header:"Timezone Redirection config error.",description:t.createElement("div",null,"Failed to ",B?"enable":"disable",".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})},L=()=>{Mo.emit("close-preferences",!1),a(qi.selectedResolution),E(qi.enableHighPixelDensity),C(qi.displayQuality),M(qi.appearanceMode),T(qi.toolbarBehavior),c(qi.metricsEnabled),b(qi.highColorAccuracy),N(qi.timezoneRedirectionEnabled),e.onDismiss()};return r(()=>{e.connection&&oa("high-color-accuracy",e=>{d(e.available),b(e.enabled),A(e.available?350:300),e.available&&(qi.highColorAccuracy=e.enabled,Gi())})},[e.connection]),r(()=>{F(e.timezoneRedirectionSetting),e.connection&&e.timezoneRedirectionSetting===l.TimezoneRedirectionSetting.CLIENT_DECIDES&&e.connection.enableTimezoneRedirection(B).catch(P)},[e.connection,e.timezoneRedirectionSetting]),t.createElement(p,{onDismiss:L,visible:e.visible,size:"large",header:"Preferences",modalRoot:window.document.body,disableContentPaddings:!0,footer:t.createElement(f,{float:"right"},t.createElement(h,{direction:"horizontal",size:"xs"},t.createElement(m,{variant:"link",onClick:L},"Cancel"),t.createElement(m,{variant:"primary",onClick:()=>{Mo.emit("close-preferences",!0),(()=>{let t;S!==qi.displayQuality&&(t=S===Di.label?Di:Fi,e.connection.setDisplayQuality(t.minQuality,t.maxQuality),Ws.info(`Switching to ${S} display mode`),qi.displayQuality=S)})(),O!==qi.appearanceMode&&(qi.appearanceMode=O,e.submitAppearanceModePreferences(O)),R!==qi.toolbarBehavior&&(qi.toolbarBehavior=R,e.submitToolbarBehaviorPreferences(R)),s!==qi.metricsEnabled&&(qi.metricsEnabled=s,e.submitMetricsPreferences(s)),(()=>{if(!u)return;const n=g?"enable":"disable";e.connection.requestDisplayConfig(g).catch(e=>{Ns({level:Ds.WARNING,header:"Display config error.",description:t.createElement("div",null,"Failed to ",n," high color accuracy.",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})})})(),i!==qi.selectedResolution&&(qi.selectedResolution=i===Bi?Bi:Ni,e.submitResolutionPreferences(i),a(qi.selectedResolution)),vi()&&v!==qi.enableHighPixelDensity&&(qi.enableHighPixelDensity=v,e.connection.enableHighPixelDensity(v)),B!==qi.timezoneRedirectionEnabled&&(qi.timezoneRedirectionEnabled=B,D===l.TimezoneRedirectionSetting.CLIENT_DECIDES&&e.connection.enableTimezoneRedirection(B).catch(P)),Gi(),e.onDismiss()}},"Save")))},t.createElement("div",{style:{height:I}},t.createElement(y,{activeTabId:n,onChange:({detail:e})=>o(e.activeTabId),tabs:[{label:"General",id:"general",content:Ko(t.createElement(x,{columns:2},t.createElement("div",null,t.createElement(h,{size:"xxl"},t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Appearance"),t.createElement(w,{onChange:({detail:e})=>M(e.value),value:O,items:[...ji()?[{value:Ai,label:Ai+(e.systemDefaultAppearanceMode?` (${Go(e.systemDefaultAppearanceMode)})`:"")}]:[],{value:Ti,label:Ti},{value:Ii,label:Ii}]})),D===l.TimezoneRedirectionSetting.CLIENT_DECIDES?t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Time Zone Redirection"),t.createElement(k,{onChange:({detail:e})=>N(e.checked),checked:B},B?"Enabled":"Disabled")):null)),t.createElement("div",null,t.createElement(f,{margin:{bottom:"s"}},"Toolbar behavior"),t.createElement(w,{onChange:({detail:e})=>T(e.value),value:R,items:[{value:Si,label:Si,description:xi},{value:Ci,label:Ci,description:Oi},{value:Mi,label:Mi,description:Ri}]}))))},{label:"Display",id:"display",content:Ko(t.createElement(x,{columns:2},t.createElement(h,{size:"xxl"},t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Streaming mode"),t.createElement(w,{onChange:({detail:e})=>C(e.value),value:S,items:[{value:Di.label,label:Di.label,description:Di.description},{value:Fi.label,label:Fi.label,description:Fi.description}]})),u&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"High color accuracy (YUV 4:4:4)"),t.createElement(k,{onChange:({detail:e})=>b(e.checked),checked:g,description:"Streaming performance could be affected."},g?"Enabled":"Disabled")),t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Streaming metrics in the toolbar"),t.createElement(k,{onChange:({detail:e})=>c(e.checked),checked:s},s?"Enabled":"Disabled"))),t.createElement(h,{size:"xxl"},vi()&&t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"High pixel density"),t.createElement(k,{onChange:({detail:e})=>E(e.checked),checked:v},v?"Enabled":"Disabled")),vs()?t.createElement(f,null,t.createElement(f,{margin:{bottom:"s"}},"Display resolution"),t.createElement(w,{onChange:({detail:e})=>a(e.value),value:i,items:[{value:Bi,label:"Adapt automatically"},{value:Ni,label:`${e.currentResolution} (Current)`},...Ms(e.currentResolution)]})):null)))},...(vi()?!_:_)?[{label:"Keyboard",id:"keyboard",content:Ko(t.createElement(As,{connection:e.connection,isClientMacOS:vi(),isServerMacOS:_}))}]:[],...e.webcamStatus&&"not-available"!==e.webcamStatus?[{label:"Camera",id:"camera",content:Ko(t.createElement(js,{connection:e.connection,webcamStatus:e.webcamStatus,webcamId:e.webcamId,setWebcamId:e.setWebcamId}))}]:[]]})))}zs.propTypes={connection:c.object,visible:c.bool,onDismiss:c.func,submitResolutionPreferences:c.func,currentResolution:c.string,submitMetricsPreferences:c.func,submitAppearanceModePreferences:c.func,submitToolbarBehaviorPreferences:c.func,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func,systemDefaultAppearanceMode:c.oneOf([L.Light,L.Dark]),timezoneRedirectionSetting:c.number};const Us=se("DropdownMenu");let Vs;function Hs({connection:e,relativeMouseModeEnabled:n,sasEnabled:o,focusDisplay:i,screenshotEnabled:a,currentResolution:s,submitResolutionPreferences:c,submitMetricsPreferences:l,submitAppearanceModePreferences:u,submitToolbarBehaviorPreferences:d,webcamStatus:m,webcamId:p,setWebcamId:f,systemDefaultAppearanceMode:h,timezoneRedirectionSetting:g}){const[b,v]=t.useState(""),[y,w]=t.useState(!1),[E,S]=t.useState(!1),[x,k]=t.useState(!1),[O,M]=t.useState(0),[R,T]=t.useState(!1),I=n=>{switch(n){case"relativeMouseMode":navigator.permissions.query({name:"pointer-lock"}).then(t=>{"denied"!==t?.state?(Us.info("granted"===t?.state?"Mouse lock enabled: enabling relative mouse":"Requesting permission to lock mouse, to enable relative mouse"),e.enterRelativeMouseMode()):(Us.info("Mouse lock permission denied, couldn't enable relative mouse"),Ns({level:Ds.WARNING,header:"Permissions to mouse lock was not granted.",description:"Enable mouse lock permissions and try again.",actions:{dismissable:!0}}))}).catch(()=>{Us.debug("Pointer-lock permission not supported by browser, defaulting to normal behaviour"),e.enterRelativeMouseMode()});break;case"trackpad-mode":e.setTrackpadMode(!E)&&(S(!E),Mo.emit("trackpadMode",!E));break;case"SAS":!function(e){e.sendKeyboardShortcut([{key:"Control",location:KeyboardEvent.DOM_KEY_LOCATION_LEFT},{key:"Alt",location:KeyboardEvent.DOM_KEY_LOCATION_LEFT},{key:"Delete",location:KeyboardEvent.DOM_KEY_LOCATION_STANDARD}])}(e),T(!0);break;case"preferences":k(!0);break;case"screenshot":!function(e){const n=e=>{Us.error(`Failed to capture screenshot: ${e.message}`),Ns({level:Ds.ERROR,header:"Screenshot error",description:t.createElement("div",null,"Failed to capture screenshot.",t.createElement("br",null),"Error: ",e.message),actions:{dismissable:!0}})};Vs=setTimeout(()=>{Us.warn("No response to the screenshot request"),n({message:"Timeout"}),Vs=null},2e4),e.getScreenshot().catch(e=>{Vs&&clearTimeout(Vs),n(e)})}(e);break;case"aboutDCV":w(!0);break;case"disconnection":e.disconnect()}};return r(()=>{null!==e&&v(e.getServerInfo().hostname)},[e]),r(()=>(Mo.on("screenshot",Gs),()=>{Mo.off("screenshot",Gs)}),[]),r(()=>{M(g)},[g]),r(()=>{R&&(i(),T(!1))},[R]),t.createElement("div",{title:"More"},t.createElement(C,{onItemClick:({detail:e})=>I(e.id),items:[...n&&!pi()?[{text:"Use relative mouse [Ctrl + Shift + F8]",id:"relativeMouseMode"}]:[],...pi()?[{text:(E?"Disable":"Enable")+" trackpad mode",id:"trackpad-mode"}]:[],...o?[{text:"Send Ctrl + Alt + Del",id:"SAS"}]:[],...a?[{text:"Save Screenshot",id:"screenshot"}]:[],{text:"Preferences",id:"preferences"},{text:"About Amazon DCV",id:"aboutDCV"},{text:"Disconnect",id:"disconnection"}]},b),t.createElement(Ja,{connection:e,visible:y,onDismiss:()=>{w(!1)}}),t.createElement(zs,{connection:e,currentResolution:s,submitResolutionPreferences:c,visible:x,onDismiss:()=>{k(!1)},submitMetricsPreferences:l,submitAppearanceModePreferences:u,submitToolbarBehaviorPreferences:d,webcamStatus:m,webcamId:p,setWebcamId:f,systemDefaultAppearanceMode:h,timezoneRedirectionSetting:O}))}function qs(e){return btoa(function(e){let t,n=32768,r=[];for(t=0;t<e.length;t+=n)r.push(String.fromCharCode.apply(null,e.subarray(t,t+n)));return r.join("")}(new Uint8Array(e)))}function Gs(e){Vs&&clearTimeout(Vs),null!==e?(Us.info("Retrieved screenshot"),Ns({level:Ds.INFO,header:"Screenshot captured.",description:"Screenshot ready to be downloaded.",actions:{accept:{text:"Download",callback:()=>function(e){const t=document.createElement("a");t.href=`data: image/png;base64,${qs(e)}`,"download"in t&&(t.download="connection.png"),t.target="_blank",t.click()}(e),remove:!0},decline:{text:"Decline",remove:!0}}})):(Us.warn("Failed to capture screenshot"),Ns({level:Ds.ERROR,header:"Screenshot error.",description:"Failed to capture screenshot.",actions:{dismissable:!0}}))}Hs.propTypes={connection:c.object,relativeMouseModeEnabled:c.bool,sasEnabled:c.bool,focusDisplay:c.func,screenshotEnabled:c.bool,currentResolution:c.string,submitResolutionPreferences:c.func,submitMetricsPreferences:c.func,submitAppearanceModePreferences:c.func,submitToolbarBehaviorPreferences:c.func,webcamStatus:c.string,webcamId:c.string,setWebcamId:c.func,systemDefaultAppearanceMode:c.oneOf([L.Light,L.Dark]),timezoneRedirectionSetting:c.number};var Ks,Qs,Ys=n(Hs);function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zs.apply(null,arguments)}var Js=function(t){return e.createElement("svg",Zs({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ks||(Ks=e.createElement("rect",{width:4,height:8,x:4,y:1,rx:2})),Qs||(Qs=e.createElement("path",{d:"M1 6v1a5 5 0 0 0 8 4M6 12v3M1 15h10M15.12 5.75l-4.5 4.5M15.12 10.25l-4.5-4.5"})))};const Xs=se("Microphone");function ec({connection:e}){const[n,a]=i(qi.microphone),s=o(!1),c=t=>{s.current=t,a(t),qi.microphone=t,Gi(),e.setMicrophone(t).catch(e=>{const n=`Failed to ${t?"enable":"disable"} microphone.`;Xs.warn(`${n} Disabling microphone. Error (code: ${e.code}): ${e.message}`),qi.microphone=t,Gi(),Ns({level:Ds.ERROR,header:"Microphone error.",description:n,actions:{dismissable:!0}})}).finally(()=>{s.current=!1,Xs.info("[Audio] Setting microphone to "+(qi.microphone?"enabled":"disabled"))})};return r(()=>{c(qi.microphone)},[e]),t.createElement("div",{title:"Microphone"},t.createElement(m,K({},n?{iconName:"microphone"}:{iconSvg:t.createElement(Js,null)},{variant:"icon",onClick:()=>{s.current||c(!qi.microphone)}})))}ec.propTypes={connection:c.object};var tc,nc=n(ec);function rc(){return rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rc.apply(null,arguments)}var oc,ic=function(t){return e.createElement("svg",rc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),tc||(tc=e.createElement("path",{d:"M7 15V1L1 6v4zM15.01 5.75l-4.5 4.5M15.01 10.25l-4.5-4.5"})))};function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ac.apply(null,arguments)}var sc,cc=function(t){return e.createElement("svg",ac({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),oc||(oc=e.createElement("path",{d:"M7 15V1L1 6v4zM11 5v6"})))};function lc(){return lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lc.apply(null,arguments)}var uc=function(t){return e.createElement("svg",lc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),sc||(sc=e.createElement("path",{d:"M7 15V1L1 6v4zM15 3v10M11 5v6"})))};const dc=se("Audio");function mc({connection:e}){const[n,r]=t.useState(qi.volume),[o,i]=t.useState(qi.volume),a=t=>{r(t),qi.volume=t,Gi(),e.setVolume(t),dc.debug(`Client volume level set to ${t}`)};return t.createElement(u,{position:"bottom",size:"large",triggerType:"custom",header:"Volume",dismissButton:!1,content:t.createElement(h,{direction:"horizontal",size:"s"},t.createElement(m,{iconSvg:pc(n),variant:"icon",onClick:()=>{a(n?0:o)}}),t.createElement("input",{type:"range",style:{verticalAlign:"middle",width:"150px",height:"100%"},orient:"horizontal",min:"0",max:"100",step:"1",value:o,onChange:e=>{return t=Number(e.target.value),i(t),void a(t);var t}}),t.createElement("div",{style:{display:"flex",width:"3ch",textAlign:"center",alignItems:"center",justifyContent:"center",height:"100%"}},t.createElement("output",null,o)))},t.createElement("div",{title:"Audio"},t.createElement(m,{iconSvg:pc(n),variant:"icon"})))}function pc(e){return e<=0?t.createElement(ic,null):e<=50?t.createElement(cc,null):t.createElement(uc,null)}mc.propTypes={connection:c.object};var fc,hc=n(mc),gc={};function bc(e){return e<1e3?`${e.toFixed(1)} bps`:e<1e6?`${(e/1e3).toFixed(1)} kbps`:`${(e/1e6).toFixed(1)} Mbps`}!function(){if(fc)return gc;fc=1;var e=Or(),t=So(),n=Ct(),r=Sn();e({target:"Iterator",proto:!0,real:!0},{some:function(e){return r(this),n(e),t(this,function(t,n){if(e(t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})}();const vc=({label:e,color:n,children:r})=>t.createElement("div",null,t.createElement(f,{margin:{bottom:"xxxs"}},t.createElement(h,{direction:"horizontal",size:"xxs"},n&&t.createElement(yc,{color:n}),t.createElement(f,{color:"text-label"},e))),t.createElement("div",null,r));vc.propTypes={label:c.string,color:c.string,children:c.node};const yc=({color:e})=>t.createElement("svg",{width:"12",height:"12"},t.createElement("rect",{width:"12",height:"12",style:{fill:e,strokeWidth:"1",stroke:"rgb(0,0,0)"}}));yc.propTypes={color:c.string};let wc=null,Ec=[];function Sc({connection:e}){const[n,i]=t.useState(0),[s,c]=t.useState(0),[l,u]=t.useState(0),[d,g]=t.useState(""),[y,w]=t.useState(""),[E,S]=t.useState([]),[x,k]=t.useState(!1),C=o();C.current=x;const R=()=>{const t=e.getStats();let n,r,o=0;if(Ec.length>60){for(n=[],r=0;r<Ec.length-1;r++)n.push(Ec[r]);Ec=n}for(0===Ec.length?Ec.push({x:0,y:t.traffic}):(Ec.forEach(e=>{e.x++}),Ec.unshift({x:0,y:t.traffic})),r=0;r<Ec.length;r++)o+=Ec[r].y;o/=Ec.length,C.current&&(S(Ec),i(t.traffic),c(o),u(t.peakTraffic)),g(t.latency>999?"> 1 s":`${Math.round(t.latency)} ms`),w(`${t.fps} fps`),wc=setTimeout(R,1e3)},T=a(()=>{k(!0)},[]);r(()=>(null!==e&&R(),()=>{clearTimeout(wc)}),[e]);const I=()=>t.createElement("div",{title:"Metrics"},t.createElement(m,{variant:"link",onClick:T},t.createElement(h,{direction:"horizontal",size:"m"},t.createElement(f,{fontWeight:"bold",color:"inherit"},y),t.createElement(f,{fontWeight:"bold",color:"inherit"},d))));return t.createElement("div",null,t.createElement(I,null),x&&t.createElement(p,{onDismiss:()=>{k(!1)},visible:x,size:"medium",header:"Streaming metrics",footer:t.createElement(b,{gridDefinition:[{colspan:4},{colspan:4},{colspan:4}]},t.createElement(vc,{label:"Current usage",color:W},bc(n)),t.createElement(vc,{label:"Average usage",color:z},bc(s)),t.createElement(vc,{label:"Peak usage",color:U},bc(l)))},t.createElement(h,{size:"xl"},t.createElement(b,{gridDefinition:[{colspan:6},{colspan:6}]},t.createElement(vc,{label:"Framerate"},y),t.createElement(vc,{label:"Network latency"},d)),t.createElement(O,{variant:"h3",actions:t.createElement(v,{external:!0,externalIconAriaLabel:"Opens in a new tab",href:"https://docs.aws.amazon.com/dcv/latest/userguide/using-streaming.html#using-streaming-metrics"},"Learn more")},"Download bandwidth"),t.createElement(M,{series:[{title:"Current usage",type:"line",data:E,color:W,valueFormatter:bc},{title:"Average usage",type:"threshold",y:s,color:z,valueFormatter:bc},...E.some(e=>e.y>=.8*l)?[{title:"Peak usage",type:"threshold",y:l,color:U,valueFormatter:bc}]:[]],i18nStrings:{xTickFormatter:e=>`${e} s`,yTickFormatter:bc},xDomain:[60,0],hideFilter:!0,hideLegend:!0,ariaLabel:"Single data series line chart",height:200,empty:t.createElement(f,{textAlign:"center",color:"inherit"},t.createElement("b",null,"No data available"),t.createElement(f,{variant:"p",color:"inherit"},"There is no data available"))}))))}Sc.propTypes={connection:c.object};var xc,kc,Cc,Oc=n(Sc);function Mc(){return Mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mc.apply(null,arguments)}var Rc,Tc,Ic,Ac=function(t){return e.createElement("svg",Mc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),xc||(xc=e.createElement("path",{d:"M8 12v3M3 15h10"})),kc||(kc=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Cc||(Cc=e.createElement("path",{d:"m10.25 4.25-4.5 4.5M10.25 8.75l-4.5-4.5"})))};function Dc(){return Dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dc.apply(null,arguments)}var Fc,Bc,Nc,_c=function(t){return e.createElement("svg",Dc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Rc||(Rc=e.createElement("path",{d:"M8 12v3M3 15h10"})),Tc||(Tc=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Ic||(Ic=e.createElement("path",{d:"M5 6.5h6"})))};function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pc.apply(null,arguments)}var Lc=function(t){return e.createElement("svg",Pc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Fc||(Fc=e.createElement("path",{d:"M8 12v3M3 15h10"})),Bc||(Bc=e.createElement("circle",{cx:8,cy:6.56,r:5.38})),Nc||(Nc=e.createElement("circle",{cx:8,cy:6.5,r:2})))};const $c=se("Webcam");function jc({connection:e,status:n,selectedWebcam:i,setSelectedWebcam:a}){const s=o(!1),c=o(!1),l=t=>{qi.webcam=t,c.current?$c.debug(`Cannot set camera to ${t?"enabled":"disabled"} as a request is already in progress`):(c.current=!0,$c.info("Setting camera to "+(t?"enabled":"disabled")),e.setWebcam(t,i).then(e=>{t&&a(e)}).catch(e=>{const n=`Failed to ${t?"enable":"disable"} camera.`;$c.warn(`${n} Disabling camera. Error (code: ${e.code}): ${e.message}`),Ns({level:Ds.ERROR,header:"Camera error.",description:n,actions:{dismissable:!0}})}).finally(()=>{c.current=!1}))},u=()=>{l(!qi.webcam)};return r(()=>{"attached"===n&&(u(),s.current=!0)},[i]),r(()=>{"available"===n&&s.current&&(u(),s.current=!1)},[n]),r(()=>{l(qi.webcam)},[e]),t.createElement("div",{title:"Camera"},t.createElement(m,{iconSvg:Wc(n),variant:"icon",onClick:u}))}function Wc(e){switch(e){case"available":return t.createElement(Ac,null);case"attached":return t.createElement(_c,null);case"streaming":return t.createElement(Lc,null);default:throw new Error(`Illegal camera serviceStatus: ${e}`)}}jc.propTypes={connection:c.object,status:c.string,selectedWebcam:c.string,setSelectedWebcam:c.func};var zc,Uc,Vc=n(jc),Hc={};function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qc.apply(null,arguments)}!function(){if(zc)return Hc;zc=1;var e=Or(),t=So(),n=Ct(),r=Sn();e({target:"Iterator",proto:!0,real:!0},{find:function(e){return r(this),n(e),t(this,function(t,n){if(e(t))return n(t)},{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})}();var Gc=function(t){return e.createElement("svg",qc({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Uc||(Uc=e.createElement("path",{d:"m14 6.5-3-3-3 3M11 4v10M8 9.5l-3 3-3-3M5 2v10"})))};const Kc=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}),Qc={text:"Storage",href:null},Yc=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],Zc=se("Filestorage");let Jc,Xc=!1;function el({connection:e,downloadEnabled:n,uploadEnabled:i}){const[s,c]=t.useState(!1),l=o(!1),[u,d]=t.useState(!0),[g,b]=t.useState(!1),[y,w]=t.useState([]),[E,S]=t.useState([Qc]),[x,k]=t.useState(1),[O,M]=t.useState(Qc.href),F=o(Qc.href),[B,N]=t.useState([]),[_,P]=t.useState(""),[L,$]=t.useState(""),[j,W]=t.useState(!1),[z,U]=t.useState(!1),[V,H]=t.useState(!1),q=o(null),G=o(null),K=o(null),Q=()=>Math.max(5,Math.floor((window.innerHeight-320-86)/42)),Y=()=>B.slice((x-1)*Q(),x*Q()),Z=(e,n)=>t.createElement("div",{style:{display:"flex",alignItems:"center",height:"100%"}},t.createElement(A,{name:e}),n&&t.createElement("span",{style:{marginLeft:"5px"}},n)),J=e=>{let n,r=e&&"/"!==e&&"Storage"!==e?e:"",o=[];Zc.debug(`Changing to directory ${r}`),n=Jc.list(r),n.on("error",e=>{1===e.code||2===e.code?Zc.info(`Aborted listing of ${r} folder`):(Zc.warn(`Failed to list ${r} folder (${e.message})`),Ns({level:Ds.ERROR,header:"File storage error.",description:t.createElement("div",null,"Failed to list files in ",r," folder.",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}}),J())}).on("success",()=>{Zc.debug("List files succeeded"),N(o),e!==O&&w([]),(e=>{let t=e.split("/"),n=[Qc],r="";t.filter(e=>""!==e).forEach(e=>{r+=`/${e}`,n.push({text:e,path:r,href:null})}),S(n),M(e),F.current=e,k(1)})(r)}).on("newItems",e=>{Zc.debug(`New items ${e.length}`),Zc.debug(`update list folders ${O}`),o.push(...e)}).run()},X=()=>{Xc?J(O):J()},ee=()=>{c(!0),e.getFileExplorer().then(t=>{Jc=t,X(),e.setUploadBandwidth(102400)}).catch(()=>{d(!1)})},te=()=>{l.current=!1,c(!1),e.setUploadBandwidth(10240),Xc=!1,H(!1)},ne=(e,n)=>{let r,o,i=n||""===n?n:O;o=Ns({level:Ds.INFO,header:"Upload in progress.",description:`File ${e.name} is uploading to Storage ${O}`,progress:0,actions:{decline:{text:"Stop uploading",callback:()=>r.cancel(),remove:!0}}}),r=Jc.storeFile(e,i),r.on("error",n=>{1!==n.code&&Ns({level:Ds.ERROR,header:"Upload error.",description:t.createElement("div",null,"Failed to upload ",e.name," to Storage",i,".",t.createElement("br",null),"Error: ",n.message," (code: ",n.code,")"),actions:{dismissable:!0}},o)}).on("progress",(e,t)=>{Ps(Math.floor(100*e/t),o)}).on("success",()=>{Ns({level:Ds.SUCCESS,header:"File uploaded.",description:`File ${e.name} successfully uploaded to Storage${O}`,actions:{dismissable:!0}},o),Xc=!0,X()}).run()},re=e=>{const t=e.target.files;t&&t.length>0?(Zc.debug("A file to upload has been selected."),ne(t[0])):Zc.debug("No file to upload has been selected.")},oe=e=>{Jc.retrieveFile(e).on("error",n=>{Ns({level:Ds.ERROR,header:"Download error.",description:t.createElement("div",null,"Impossible to download file ",e,".",t.createElement("br",null),"Error: ",n.message," (code: ",n.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Ns({level:Ds.SUCCESS,header:"File ready for download.",description:`File ${e} ready to be downloaded to your device.`,actions:{dismissable:!0}})}).run()},ie=()=>{_.length>0&&_!==L&&((()=>{let e,n="folder"===y[0].type,r=y[0].displayName,o=`${O}/${r}`,i=`${O}/${_}`;e=n?Jc.renameDirectory(o,i):Jc.renameFile(o,i),e.on("error",e=>{Ns({level:Ds.ERROR,header:"Rename error.",description:t.createElement("div",null,"Failed to rename ",(n?"folder ":"file ")+r," to ",_,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Zc.debug("Rename succeeded."),Ns({level:Ds.SUCCESS,header:(n?"Folder":"File")+" renamed.",description:`${n?"Folder":"File"} successfully renamed from ${r} to ${_}.`,actions:{dismissable:!0}}),Xc=!0,X()}).run()})(),w([])),U(!1),P("")},ae=()=>{const e=B.map(e=>({...e}));e.shift(),N(e)},se=()=>{_.length>0?Jc.createDirectory(`${O}/${_}`).on("error",e=>{ae(),Ns({level:Ds.ERROR,header:"Folder creation error.",description:t.createElement("div",null,"Failed to create folder ",_,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Zc.debug("Mkdir succeeded"),Ns({level:Ds.SUCCESS,header:"Folder created.",description:`Folder ${_} successfully created.`,actions:{dismissable:!0}}),Xc=!0,X()}).run():ae(),W(!1),P("")},ce=e=>{for(const t of e)if("file"!==t.kind)return!1;return!0},le=e=>{Xc=!0,!bi()&&!s&&i&&ce(e.dataTransfer.items)&&(l.current=!0,ee())},ue=a(e=>{e.stopPropagation(),!e.relatedTarget&&l.current&&s&&te()}),de=e=>{switch(e){case"download":oe(`${O}/${y[0].displayName}`);break;case"open":J(`${O}/${y[0].displayName}`);break;case"rename":$(y[0].displayName),P(y[0].displayName),U(!0);break;case"delete":Jc.deleteFile(`${O}/${y[0].displayName}`).on("error",e=>{Ns({level:Ds.ERROR,header:"Deletion error.",description:t.createElement("div",null,"Failed to delete file ",y[0].displayName,".",t.createElement("br",null),"Error: ",e.message," (code: ",e.code,")"),actions:{dismissable:!0}})}).on("success",()=>{Zc.debug("Remove succeeded"),Ns({level:Ds.SUCCESS,header:"File deleted.",description:`File ${y[0].displayName} successfully deleted.`,actions:{dismissable:!0}}),Xc=!0,X()}).run();break;default:Zc.warn("Invalid dropdown action selected")}},me=e=>t.createElement(m,{onClick:()=>e.current.click()},t.createElement("input",{style:{display:"none"},type:"file",ref:e,onChange:re,onClick:e=>{e.target.value=""}}),"Upload file"),pe=t.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},t.createElement(h,{direction:"horizontal",size:"s"},t.createElement(C,{disabled:!y.length,onItemClick:({detail:e})=>de(e.id),items:[...n?[{text:"Download",id:"download",disabled:y.length&&"file"!==y[0].type}]:[],{text:"Rename",id:"rename",disabled:y.length&&!Y().filter(e=>e.displayName===y[0].displayName).length}]},"Actions"),i&&me(q),t.createElement(m,{onClick:()=>{N([{displayName:null,type:"folder"}].concat(B.map(e=>({...e})))),w([]),W(!0),k(1)}},"Create folder")),t.createElement(R,{currentPageIndex:x,onChange:({detail:e})=>k(e.currentPageIndex),pagesCount:Math.ceil(B.length/Q()),ariaLabels:{nextPageLabel:"Next page",previousPageLabel:"Previous page",pageLabel:e=>`Page ${e}`}})),fe=[{id:"name",header:"Name",cell:function(e){return Z(e.type,(e=>{const r=(e,n)=>t.createElement(D,{ref:K,onChange:({detail:e})=>P(e.value),onBlur:e,onKeyUp:({detail:t})=>{13===t.keyCode&&e()},value:_,placeholder:n,disableBrowserAutocorrect:!0,inputMode:"text"});return z&&e.displayName===y[0].displayName?r(ie,e.displayName):j&&null===e.displayName?r(se,"New folder"):"file"===e.type?n?t.createElement(v,{ariaLabel:"Download",onFollow:()=>oe(`${O}/${e.displayName}`)},e.displayName):e.displayName:t.createElement(v,{ariaLabel:"Open",onFollow:g?()=>{}:()=>{J(`${O}/${e.displayName}`)}},e.displayName)})(e))},minWidth:380},{id:"lastModified",header:"Last modified",cell:function(e){return t.createElement(f,{variant:"p"},e.displayName&&e.lastModified?Kc.format(new Date(e.lastModified)):"-")},minWidth:180},{id:"size",header:"Size",cell:function(e){return t.createElement(f,{variant:"p"},"file"===e.type?tl(e.size):"-")},minWidth:140}],he=e=>{n&&(Zc.debug("Asking to download resource"),e.accept())};return r(()=>()=>{Xc=!1,Jc=null},[]),r(()=>{(z||j)&&(K.current.focus(),z&&K.current.select())},[z,j]),r(()=>(Mo.on("file-download",he),()=>{Mo.off("file-download",he)}),[n]),r(()=>(window.addEventListener("dragenter",le),window.addEventListener("dragleave",ue),()=>{window.removeEventListener("dragenter",le),window.removeEventListener("dragleave",ue)})),t.createElement("div",null,t.createElement("div",{title:"Filestorage"},t.createElement(m,{variant:"icon",iconSvg:t.createElement(Gc,null),onClick:ee})),t.createElement(p,{onDismiss:te,visible:s,header:"File storage",size:"large",modalRoot:window.document.body},u?t.createElement("div",{onDragEnter:e=>H(!bi()&&ce(e.dataTransfer.items))},t.createElement(f,{margin:{bottom:"xs"},padding:{bottom:"xs"}},t.createElement(h,{size:"xxs"},t.createElement(h,{direction:"horizontal",size:"s"},Z("folder-open",""),t.createElement(T,{items:E,onClick:g?()=>{}:({detail:e})=>J(e.item.path)})),t.createElement("div",{style:{height:42*Q()+86,position:"relative"}},t.createElement(I,{resizableColumns:!0,loadingText:"Loading resources",selectionType:"single",columnDefinitions:fe,items:Y(),selectedItems:y,onSelectionChange:({detail:e})=>w(e.selectedItems),header:pe,empty:t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5",margin:"m"},i&&!bi()?t.createElement(t.Fragment,null,t.createElement("p",null,"Drag and drop a file to upload"),t.createElement("p",null," Or "),me(G)):t.createElement("p",null,"Folder ",E[E.length-1].text," is empty"))}),V&&i&&t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",position:"absolute",alignItems:"center",bottom:"0px",width:"100%",height:42*Q(),opacity:"0.8",outline:"2px",border:"2px dashed gray",backgroundColor:"white"},onDrop:e=>{e.preventDefault(),H(!1),((e,n)=>{if(!e[0])return void Zc.debug("Dropped file is null");const r=e[0].webkitGetAsEntry()||e[0].getAsEntry();if(r)if(r.isFile&&1===e.length)r.file(e=>{e.name.startsWith(".")||ne(e,n)},()=>Zc.debug(`File not retrieved: ${r.name}`));else{b(!0);const r=Jc.uploadFiles(e,n),o=Ns({level:Ds.INFO,header:"Upload of dropped files in progress.",description:`Dropped files are uploading to Storage${n}`,progress:0,actions:{decline:{text:"Stop uploading",callback:()=>{r.cancel(),b(!1)},remove:!0}}});let i=0;r.on("error",e=>{1!==e.code&&(Ns({level:Ds.ERROR,header:"Upload dropped files error.",description:t.createElement("div",null,"Failed to upload dropped files",t.createElement("br",null),"Error: ",e.message," ",e.code?`(code: ${e.code})`:""),actions:{dismissable:!0}},o),b(!1))}).on("progress",(e,t,n,r,a,s,{destinationFolder:c,isDirectory:l})=>{Ps(Math.floor(e/t*100),o,e,t,n,r),F.current===c&&(l||n>i)&&J(c),i=n}).on("success",()=>{Ns({level:Ds.SUCCESS,header:"Dropped files uploaded.",description:`Dropped files successfully uploaded to Storage${n}`,actions:{dismissable:!0}},o),b(!1)}).run()}else Zc.debug("Dropped file is null")})(e.dataTransfer.items,O||"")},onDragOver:e=>e.preventDefault(),onDragLeave:()=>H(!1)},t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5"},"Drag and drop your files to start uploading")))))):t.createElement(f,{textAlign:"center",color:"inherit",variant:"h5"},"File storage is not available")))}function tl(e){if(Ho(e))return"-";if(0===e)return`0 ${Yc[0]}`;const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${Yc[t]}`}el.propTypes={connection:c.object,downloadEnabled:c.bool,uploadEnabled:c.bool};var nl=n(el);const rl=1e3,ol={MINUTE:60};ol.HOUR=ol.MINUTE**2,ol.DAY=24*ol.HOUR;const il=(e,t)=>Math.floor(e/t),al={just_now:{limit:10,updateInterval:1,text:e=>"now"},less_than_min:{limit:ol.MINUTE,updateInterval:1,text:e=>"< 1m ago"},n_min_ago:{limit:ol.HOUR,updateInterval:30,text:e=>`${il(e,ol.MINUTE)}m ago`},n_hours_ago:{limit:ol.DAY,updateInterval:15*ol.MINUTE,text:e=>`${il(e,ol.HOUR)}h ago`},n_days_ago:{text:e=>`${il(e,ol.DAY)}d ago`}};function sl(){const[e,n]=t.useState([]),o=e=>{return n=e,r=0,o=100,Number.isFinite(n)&&n>=r&&n<=o?t.createElement(N,{value:e}):null;var n,r,o};return r(()=>{const e=e=>n(Array.isArray(e)?e:[]);return Mo.on("notifications-update",e),()=>{Mo.off("notifications-update",e)}},[]),t.createElement(u,{position:"bottom",size:"medium",fixedWidth:!0,triggerType:"custom",dismissButton:!1,content:e.length?t.createElement("div",{style:{maxHeight:Math.floor(.8*window.innerHeight),overflow:"auto"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"2px 0"}},t.createElement(f,{fontSize:"heading-s",fontWeight:"normal",variant:"h2"},"Notifications"),t.createElement(m,{onClick:()=>{e.forEach(e=>{e.actions&&(e.actions.decline&&("function"==typeof e.actions.decline.callback&&e.actions.decline.callback(),e.actions.decline.remove&&_s(e.id)),e.actions.dismissable&&_s(e.id))})}},"Clear all")),Object.values(Ds).map(e=>e.importance).sort((e,t)=>t-e).filter((e,t,n)=>!t||e!==n[t-1]).map(n=>e.filter(e=>e.level.importance===n).map(e=>t.createElement(f,{margin:{horizontal:"xxxs",vertical:"m"},key:e.id},t.createElement(F,null,t.createElement(f,null,(e=>{const n=t.createElement(d,{type:e.level.status},e.header||Go(e.level.status));return"dismissable"in e.actions?t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n,t.createElement("div",{style:{paddingLeft:"10px"}},t.createElement(m,{variant:"icon",iconName:"close",iconAlign:"right",onClick:()=>_s(e.id)}))):n})(e)),e.timestamp&&t.createElement(ll,{timestamp:e.timestamp}),e.description&&t.createElement(f,{margin:{top:"xxs"}},e.description),e.uploadedFiles&&t.createElement(f,{margin:{top:"s"}},`Files uploaded: ${e.uploadedFiles} / ${e.totalFiles} `),e.uploadedBytes&&t.createElement(f,{margin:{top:"s"}},`Bytes uploaded: ${tl(e.uploadedBytes)} / ${tl(e.totalBytes)}`),null!==e.progress&&t.createElement(f,{margin:{top:"s"}},o(e.progress)),("decline"in e.actions||"accept"in e.actions)&&t.createElement(f,{margin:{top:"s"}},(e=>{const n=1===Object.keys(e.actions).filter(e=>-1!==["accept","decline"].indexOf(e)).length?"flex-start":"space-between";return t.createElement("div",{style:{display:"flex",justifyContent:n}},"decline"in e.actions&&t.createElement(m,{onClick:()=>{"function"==typeof e.actions.decline.callback&&e.actions.decline.callback(),e.actions.decline.remove&&_s(e.id)}},e.actions.decline.text),"accept"in e.actions&&t.createElement("div",null,t.createElement(m,{variant:"primary",onClick:()=>{"function"==typeof e.actions.accept.callback&&e.actions.accept.callback(),e.actions.accept.remove&&_s(e.id)}},e.actions.accept.text)))})(e))))))):t.createElement(f,{padding:{horizontal:"xxl",vertical:"m"},variant:"p",color:"text-status-inactive",textAlign:"center"},"No notifications to display")},t.createElement("div",{title:"Notifications"},t.createElement(B,{color:(()=>{let t="grey",n=-1;return e.forEach(e=>{e.level.importance>n&&(n=e.level.importance,t=e.level.color)}),t})()},e.length)))}var cl=n(sl);function ll(e){const[n,o]=t.useState((Date.now()-e.timestamp)/rl),i=e=>Object.values(al).find(t=>!("limit"in t)||e<t.limit),a=e=>{o((Date.now()-e)/rl)};return r(()=>{const t=i(n).updateInterval;let r=null;return t&&(r=setInterval(a,t*rl,e.timestamp)),()=>{r&&(clearInterval(r),r=null)}},[]),t.createElement(f,{variant:"small",textAlign:"right",display:"block",fontWeight:"light"},i(s=n).text(s));var s}function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ul.apply(null,arguments)}ll.propTypes={timestamp:c.number};var dl=function(t){return e.createElement("svg",ul({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("path",{d:"M12 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H9.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round"}}),e.createElement("circle",{cx:12,cy:3.5,r:2.5,style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10}}),e.createElement("circle",{cx:4,cy:3.5,r:2.5,style:{stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10,fill:"#545b64"}}),e.createElement("path",{d:"M4 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H1.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round",fill:"#545b64"}}))};function ml(){return ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ml.apply(null,arguments)}var pl=function(t){return e.createElement("svg",ml({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},t),e.createElement("circle",{cx:8,cy:3.5,r:2.5,style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeMiterlimit:10}}),e.createElement("path",{d:"M8 8a3 3 0 0 1 3 3v3.14a.86.86 0 0 1-.86.86H5.86a.86.86 0 0 1-.86-.86V11a3 3 0 0 1 3-3Z",style:{fill:"none",stroke:"#545b64",strokeWidth:2,strokeLinejoin:"round"}}))};let fl=[];const hl=e=>({username:e.username,connectionIds:[e.connectionId],owner:e.owner}),gl=e=>{if(0!==fl.length){const t=e.map(e=>e.connectionId),n=fl.map(e=>e.connectionIds).flat();(e=>{let t,n;e.forEach(e=>{const r=fl.find(t=>t.connectionIds.includes(e));n=r.owner?"Session owner":"Collaborator",t=`${n} '${r.username}' has disconnected from this session.`,Ns({level:Ds.INFO,header:"Client disconnected.",description:t,actions:{dismissable:!0}})})})(n.filter(e=>!t.some(t=>e===t)));const r=e.filter(e=>!n.some(t=>e.connectionId===t));(e=>{let t,n;e.forEach(e=>{n=e.owner?"Session owner":"Collaborator",t=`${n} '${e.username}' has joined this session.`,Ns({level:Ds.INFO,header:"New client connected.",description:t,actions:{dismissable:!0}})})})(r)}};function bl(e){(e=>{Mo.emit("collaboration-status-update",e.length>1)})(e),gl(e),(e=>{fl=[];const t=e.length;for(let n=0;n<t;n++){const t=fl.find(t=>t.username===e[n].username);t?t.connectionIds.push(e[n].connectionId):fl.push(hl(e[n]))}fl.sort((e,t)=>e.username<t.username?-1:1)})(e),vl()}function vl(){Mo.emit("collaborator-list-update",fl)}function yl(e,t){t.forEach(t=>{t!==e.id&&e.disconnectCollaborator(t)})}function wl({connection:e}){const[n,o]=t.useState([]),[i,a]=t.useState(!1);return r(()=>{const t=t=>{a(t.some(t=>t.owner&&t.connectionIds.includes(e.id))),o(t)};return Mo.on("collaborator-list-update",t),vl(),()=>{Mo.off("collaborator-list-update",t)}},[]),t.createElement(u,{position:"bottom",size:"medium",triggerType:"custom",dismissButton:!1,content:n.length?t.createElement("div",{style:{maxHeight:Math.floor(.8*window.innerHeight),overflow:"auto"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",padding:"2px 0 15px"}},t.createElement(f,{fontSize:"heading-s",fontWeight:"normal",variant:"h2"},"Collaborators"),i&&n.length>2&&t.createElement("div",{style:{marginLeft:"30px"}},t.createElement(m,{onClick:()=>function(e){fl.forEach(t=>yl(e,t.connectionIds))}(e)},"Disconnect all"))),t.createElement(F,null,n.map(n=>n.username&&(n=>{const r=n.connectionIds.length>1&&n.connectionIds.includes(e.id)||i&&n.connectionIds.includes(e.id)&&n.connectionIds.length>1||i&&!n.connectionIds.includes(e.id);return t.createElement(f,{key:n.username},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",minWidth:"150px"}},t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(A,{svg:t.createElement(pl,null),size:"small"}),t.createElement("div",{style:{maxWidth:"200px"}},t.createElement(f,{fontSize:"body-m",fontWeight:"normal",variant:"p",margin:{left:"xs",right:"s"}},`${n.username}${n.connectionIds.length>1?` (${n.connectionIds.length} clients)`:""}`))),r&&t.createElement(m,{variant:"icon",iconName:"close",onClick:()=>yl(e,n.connectionIds)})))})(n)))):t.createElement(f,{padding:{horizontal:"xxl",vertical:"m"},variant:"p",color:"text-status-inactive",textAlign:"center"},"No collaborators to display")},t.createElement("div",{title:"Collaborators"},t.createElement(A,{svg:t.createElement(dl,null)})))}wl.propTypes={connection:c.object};var El=n(wl);const Sl="soft-kbd-div";let xl;function kl({connection:e,softKeyboardVisible:n,setSoftKeyboardVisible:i}){const a=o(!1);a.current=n;const s=e=>{e.setSelectionRange(e.value.length,e.value.length)},c=()=>{i(!0),xl.focus(),(yi()||hi())&&(xl.click(),window.scrollTo(0,0),document.body.scrollTop=0,document.scrollingElement.scrollTop=0)},l=()=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&c()},u=()=>{const e=document.createElement("input");e.setAttribute("id","dcv-softkbd-hid-input"),e.setAttribute("type","text"),e.style.caretColor="transparent",e.style.color="transparent",e.style.background="transparent",e.style.border="none",e.style.fontSize="1pt",e.style.height="1px",e.style.width="1px",e.defaultValue="&",e.value=fi()?"&":"",e.setAttribute("writingSuggestions",!1),e.setAttribute("autocomplete","off"),xl=e},d=()=>{a.current?(xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(xl.blur(),document.getElementById(Sl).removeChild(xl)),i(!1)):(xl=document.getElementById("dcv-softkbd-hid-input"),xl||u(),document.getElementById(Sl).appendChild(xl),c())};return r(()=>{const t=e.sendKeyboardEvent.bind(e),r=e=>{if(xl=document.getElementById("dcv-softkbd-hid-input"),xl){s(xl);const n=new KeyboardEvent("keydown",{key:e.data??"Backspace",location:KeyboardEvent.DOM_KEY_LOCATION_STANDARD,code:""}),r=new KeyboardEvent("keyup",n);t(n),t(r),xl.value="&",s(xl)}},o=e=>{"Unidentified"!==e.key&&t(e)},i=e=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(s(xl),o(e))},a=fi()?o:t;return n&&((e,t,n)=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(xl.addEventListener("focusout",l),xl.addEventListener("keydown",e),xl.addEventListener("keyup",fi()?n:e),xl.addEventListener("keypress",e),fi()&&xl.addEventListener("input",t))})(a,r,i),()=>((e,t,n)=>{xl=document.getElementById("dcv-softkbd-hid-input"),xl&&(xl.removeEventListener("focusout",l),xl.removeEventListener("keydown",e),xl.removeEventListener("keyup",fi()?n:e),xl.removeEventListener("keypress",e),fi()&&xl.removeEventListener("input",t))})(a,r,i)},[e,n]),r(()=>(pi()&&Mo.on("toggle-keyboard",d),u(),()=>{pi()&&Mo.off("toggle-keyboard",d),xl=null,i(!1)}),[]),t.createElement(t.Fragment,null," ")}kl.propTypes={connection:c.object,softKeyboardVisible:c.bool,setSoftKeyboardVisible:c.func};var Cl=n(kl);function Ol(e,t){return Ol=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ol(e,t)}function Ml(e){return Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ml(e)}function Rl(e,t){if(t&&("object"===Ml(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Tl(e){return Tl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tl(e)}var Il,Al,Dl,Fl,Bl={exports:{}};function Nl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=Tl(e);if(t){var o=Tl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Rl(this,n)}}Bl.exports=function(){if(Fl)return Dl;Fl=1;var e=Al?Il:(Al=1,Il="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Dl=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}()();var _l,Pl,Ll,$l,jl,Wl=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ol(e,t)}(r,t.PureComponent);var e,n=Nl(r);function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=n.call(this,e)).container=null,t.window=null,t.windowCheckerInterval=null,t.released=!1,t.state={mounted:!1},t}return(e=[{key:"render",value:function(){return this.state.mounted?Q.createPortal(this.props.children,this.container):null}},{key:"componentDidMount",value:function(){this.window||this.container||(this.openChild(),this.setState({mounted:!0}))}},{key:"openChild",value:function(){var e,t=this,n=this.props,r=n.url,o=n.title,i=n.name,a=n.features,s=n.onBlock,c=n.onOpen,l=n.center;if("string"!=typeof l||void 0!==a.width&&void 0!==a.height){if("parent"===l)a.left=window.top.outerWidth/2+window.top.screenX-a.width/2,a.top=window.top.outerHeight/2+window.top.screenY-a.height/2;else if("screen"===l){var u=void 0!==window.screenLeft?window.screenLeft:window.screen.left,d=void 0!==window.screenTop?window.screenTop:window.screen.top,m=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,p=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height;a.left=m/2-a.width/2+u,a.top=p/2-a.height/2+d}}else console.warn("width and height window features must be present when a center prop is provided");if(this.window=window.open(r,i,(e=a,Object.keys(e).reduce(function(t,n){var r=e[n];return"boolean"==typeof r?t.push("".concat(n,"=").concat(r?"yes":"no")):t.push("".concat(n,"=").concat(r)),t},[]).join(","))),this.container=this.window.document.createElement("div"),this.windowCheckerInterval=setInterval(function(){t.window&&!t.window.closed||t.release()},50),this.window){if(this.window.document.title=o,this.container=this.window.document.getElementById("new-window-container"),null===this.container)this.container=this.window.document.createElement("div"),this.container.setAttribute("id","new-window-container"),this.window.document.body.appendChild(this.container);else{var f=this.window.document.getElementById("new-window-container-static");this.window.document.body.removeChild(f)}this.props.copyStyles&&setTimeout(function(){return e=document,n=t.window.document,r=n.createDocumentFragment(),Array.from(e.styleSheets).forEach(function(e){var t;try{t=e.cssRules}catch(e){console.error(e)}if(t){var o=[];Array.from(e.cssRules).forEach(function(e){var t=e.type;if(t!==CSSRule.UNKNOWN_RULE){var n;n=t===CSSRule.KEYFRAMES_RULE?function(e){var t=["@keyframes",e.name,"{"];return Array.from(e.cssRules).forEach(function(e){t.push(e.keyText,"{",e.style.cssText,"}")}),t.push("}"),t.join(" ")}(e):[CSSRule.IMPORT_RULE,CSSRule.FONT_FACE_RULE].includes(t)?function(e){return e.cssText.split("url(").map(function(e){return"/"===e[1]?"".concat(e.slice(0,1)).concat(window.location.origin).concat(e.slice(1)):e}).join("url(")}(e):e.cssText,o.push(n)}});var i=n.createElement("style");i.textContent=o.join("\n"),r.appendChild(i)}else if(e.href){var a=n.createElement("link");a.rel="stylesheet",a.href=e.href,r.appendChild(a)}}),void n.head.appendChild(r);var e,n,r},0),"function"==typeof c&&c(this.window),this.window.addEventListener("beforeunload",function(){return t.release()})}else"function"==typeof s?s(null):console.warn("A new window could not be opened. Maybe it was blocked.")}},{key:"componentWillUnmount",value:function(){if(this.state.mounted&&this.window)if(this.props.closeOnUnmount)this.window.close();else if(this.props.children){var e=this.container.cloneNode(!0);e.setAttribute("id","new-window-container-static"),this.window.document.body.appendChild(e)}}},{key:"release",value:function(){if(!this.released){this.released=!0,clearInterval(this.windowCheckerInterval);var e=this.props.onUnload;"function"==typeof e&&e(null)}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,e),r}();function zl(){return zl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zl.apply(null,arguments)}Ll={url:"",name:"",title:"",features:{width:"600px",height:"640px"},onBlock:null,onOpen:null,onUnload:null,center:"parent",copyStyles:!0,closeOnUnmount:!0},(Pl="defaultProps")in(_l=Wl)?Object.defineProperty(_l,Pl,{value:Ll,enumerable:!0,configurable:!0,writable:!0}):_l[Pl]=Ll,Wl.propTypes={children:Bl.exports.node,url:Bl.exports.string,name:Bl.exports.string,title:Bl.exports.string,features:Bl.exports.object,onUnload:Bl.exports.func,onBlock:Bl.exports.func,onOpen:Bl.exports.func,center:Bl.exports.oneOf(["parent","screen"]),copyStyles:Bl.exports.bool,closeOnUnmount:Bl.exports.bool};var Ul,Vl,Hl=function(t){return e.createElement("svg",zl({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),$l||($l=e.createElement("path",{d:"M5.5 12v3M.5 15h10M1 5h9v7H1z"})),jl||(jl=e.createElement("path",{d:"M5 4V1h9v7h-4"})))};function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ql.apply(null,arguments)}var Gl=function(t){return e.createElement("svg",ql({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve","aria-hidden":"true",viewBox:"0 0 16 16"},t),Ul||(Ul=e.createElement("path",{d:"M5.5 12v3M.5 15h10M5 1h9v7H5z"})),Vl||(Vl=e.createElement("path",{d:"M5 5H1v7h9V8M11.75 2.25l-4.5 4.5M11.75 6.75l-4.5-4.5"})))};const Kl=se("Multiscreen");function Ql({connection:e,copyEnabled:n,pasteEnabled:o,appearanceMode:i,toolbarBehavior:a,pendingDisplays:s}){const[c,l]=t.useState(!1),[u,d]=t.useState(null),p=()=>{Mo.emit("close-secondary-display")},f=()=>{const t=hu();l(!1),t&&e&&(fu(null),e.detachDisplay(t)),u&&!u.closed&&(u.close(),d(null))};return r(()=>(Mo.on("close-secondary-display",f),()=>{Mo.off("close-secondary-display",f)}),[u,e]),t.createElement(t.Fragment,null,t.createElement("div",{title:"Multiple screens"},t.createElement(m,{iconSvg:c?t.createElement(Gl,null):t.createElement(Hl,null),variant:"icon",onClick:()=>{c?f():l(!0)}})),c&&t.createElement(Wl,{features:{height:window.innerHeight,width:window.innerWidth},name:"DCV Secondary Window",title:`${e.getServerInfo().hostname} - Amazon DCV`,onUnload:p,onBlock:p,onOpen:t=>{t.opener=null,d(t),Mo.once("open-secondary-display",()=>(t=>{t?s.length?(fu(s[0]),e.attachDisplay(t,{displayDivName:"dcv-display",displayId:s[0]}).then(e=>fu(e)).catch(e=>{Kl.error(`Cannot open secondary display (Error: ${e.code} ${e.message})`),f()})):e.attachDisplay(t,{displayDivName:"dcv-display"}).then(e=>fu(e)).catch(e=>{Kl.error(`Cannot open secondary display (Error: ${e.code} ${e.message})`),f()}):f()})(t))},closeOnUnmount:!0},t.createElement(gu,{isPrimary:!1,connection:e,copyEnabled:n,pasteEnabled:o,window:u,appearanceMode:i,toolbarBehavior:a})))}Ql.propTypes={connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,appearanceMode:c.oneOf([Ai,Ti,Ii]),toolbarBehavior:c.oneOf([Si,Ci,Mi]),pendingDisplays:c.arrayOf(c.number)};var Yl=n(Ql);const Zl=se("Viewer"),Jl={position:"relative",margin:"auto",outline:"none"},Xl={height:"100%",overflow:"hidden",position:"relative"},eu={position:"absolute",width:"100%",zIndex:1e3,pointerEvents:"all"},tu={display:"flex",flexFlow:"row wrap",alignItems:"center","--gap":"32px",marginLeft:"calc(var(--gap) / -2)",marginBottom:"calc(var(--gap) / -2)"},nu={marginLeft:"calc(var(--gap) / 2)",marginBottom:"calc(var(--gap) / 2)"},ru=li.satisfies({chrome:">=137"})?10:1;let ou,iu,au=[],su=null,cu=null,lu=null;function uu({isPrimary:e,connection:n,copyEnabled:i,pasteEnabled:c,window:u,appearanceMode:d,toolbarBehavior:p,uiConfig:g,divId:b="dcv-display"}){const[v,y]=t.useState(!0),[w,S]=t.useState(!1),[x,k]=t.useState(!1),[C,O]=t.useState(!1),[M,R]=t.useState(""),[T,I]=t.useState(""),[A,D]=t.useState(""),[F,B]=t.useState(""),[N,P]=t.useState(qi.selectedWebcamId),[W,z]=t.useState(i||!1),[U,K]=t.useState(!1),[Q,Y]=t.useState(c||!1),[Z,J]=t.useState(qi.metricsEnabled),[X,ee]=t.useState(!1),[te,ne]=t.useState(!1),[re,oe]=t.useState(!1),[ie,ae]=t.useState(!1),[ce,le]=t.useState(!1),[ue,de]=t.useState(!1),[me,pe]=t.useState(!1),[fe,he]=t.useState(!1),[ge,be]=t.useState(!1),[ve,ye]=t.useState(!1),[we,Ee]=t.useState(null),[Se,xe]=t.useState(qi.appearanceMode),[ke,Ce]=t.useState(qi.toolbarBehavior),[Oe,Me]=t.useState(0),[Re,Te]=t.useState(""),[Ie,Ae]=t.useState(!1),[De,Fe]=t.useState(!1),Be=o(null),Ne=o(null),_e=o(!1),Pe=o(null);_e.current=ge,r(()=>{pi()&&wi(Zl)},[]);const Le=a(e=>!g||!qo(g.toolbar)||!(e in g.toolbar)||g.toolbar[e],[g]),$e=()=>{ws(n,u,e)},je=e=>{Zl.info(`network interruption alert: ${e}`),Ae(e)},We=e=>{Zl.info(`network offline alert: ${e}`),Fe(e)},ze=e=>{ae(e)},Ue=(t,r,o)=>{(Ho(o)||0===o)&&(S(r),n.setDisplayQuality(qi.minQuality,qi.maxQuality),n.setMaxDisplayResolution(qi.maxDisplayWidth,qi.maxDisplayHeight),n.setMinDisplayResolution(qi.minDisplayWidth,qi.minDisplayHeight),us=t,n.setKeyboardQuirks({macOptionToAlt:qi.macOptionToAlt,macCommandToControl:qi.macCommandToControl,forceKeyboardCombinations:qi.forceKeyboardCombinations,controlToCommand:qi.controlToCommand})),e||ou?(be(!0),ye(!0)):Zl.info(`Received first frame for an unknown displayId: ${o}`)},Ve=e=>{Me(e.setting);const t=e.status;t&&Re!==t&&(Te(t),t===l.TimezoneRedirectionStatus.PERMISSION_ERROR?Ns({level:Ds.WARNING,header:"Time Zone Redirection.",description:"This user does not have permission to perform this operation.",actions:{dismissable:!0}}):t===l.TimezoneRedirectionStatus.GENERIC_ERROR&&Ns({level:Ds.WARNING,header:"Time Zone Redirection.",description:"The setting could not be saved. Please try again.",actions:{dismissable:!0}}))},He=(t,n,r)=>{const o=e||Ho(r)||1===r.length?t:r[1].rect.width,i=e||Ho(r)||1===r.length?n:r[1].rect.height;Ts(r),-1!==[Bi,Ni].indexOf(qi.selectedResolution)?R(Es(o,i)):R(qi.selectedResolution),Rs(o,i,u,e)},qe=a(t=>{!function(e,t,n,r){if(t===Bi)qi.dynamicResolution=!0,ws(e,n,r);else if(qi.dynamicResolution=!1,t!==Ni){const o=Ss(t),i=pi()?bs(n,o[0],o[1]):o;Is(e,i[0],i[1],r)}Gi()}(n,t,u,e)},[n,u,e]),Ge=e=>{I(e.remote),"busy"===e.remote?cu=Ns({level:Ds.WARNING,header:"Audio input unavailable.",description:"This browser or session does not support audio input.",actions:{dismissable:!0}},cu):mu()},Ke=e=>{D(e.remote),e.enabled?null!==lu&&(_s(lu),lu=null):(lu=Ns({level:Ds.WARNING,header:"Audio output unavailable.",description:"This browser or session does not support audio output.",actions:{dismissable:!0}},lu),mu())},Qe=e=>{B(e.serviceStatus)},Ye=({message:e,code:n})=>{Ns({level:Ds.ERROR,header:"Webcam error.",description:t.createElement("div",null,"Webcam could not be attached.",t.createElement("br",null),"Error: ",e," (code: ",n,")"),actions:{dismissable:!0}})},Ze=e=>{z(e.enabled)},Je=e=>{Y(e.enabled)},Xe=e=>{S(e.enabled)},et=e=>{ne(e.enabled)},tt=e=>{oe(e.enabled)},nt=e=>{O(e.enabled)},rt=e=>{const t=e.currentTarget.getBoundingClientRect();e.clientY<=t.top+ru&&null===Pe.current?Pe.current=setTimeout(()=>{be(!0),u.document.getElementById(b)?.blur(),Pe.current=null},1500):e.clientY>t.top+ru&&null!==Pe.current&&(clearTimeout(Pe.current),Pe.current=null)},ot=()=>{be(!1)},it=()=>{Ne.current=setTimeout(()=>{be(!1)},1500)},at=()=>{clearTimeout(Ne.current)},st=a(()=>{Be.current?.focus()},[Be]),ct=e=>{he(e)},lt=e=>{if(!e.enabled){const e=u.document.getElementById("dcv-softkbd-hid-input");e&&u.document.getElementById("soft-kbd-div").removeChild(e)}le(e.enabled)},ut=e=>{Ee(e.matches?L.Dark:L.Light),Se===Ai&&zi(e,u.document.body)},dt=()=>{Zl.info("Three finger click, showing toolbar"),be(!_e.current)},mt=(e,t)=>{const n=au.indexOf(e);t.closed?(-1!==n&&au.splice(n,1),e===iu&&Mo.emit("close-secondary-display")):t.enabled?ou=e===iu:-1===n&&au.push(e)},pt=()=>{Zl.error("Webgl rendering lost context, showing information banner."),Ns({level:Ds.ERROR,header:"There was an error with webgl rendering",description:"Webgl rendering lost context. Please refresh the page to reconnect.",actions:{dismissable:!1}})};r(()=>$(j.Compact,u.document.body),[u]),r(()=>(e&&Mo.on("filestorage-enabled",ee),()=>{e&&Mo.off("filestorage-enabled",ee)}),[e]),r(()=>(n&&(Mo.on("first-frame",Ue),Mo.on("network-quality-warning",je),Mo.on("network-quality-critical",We),Mo.on("trackpadMode",ze),e?(!function(e){Ji=se("Feature Handler"),Xi=e}(n),Mo.on("display-availability",mt),oa("audio-in",Ge),oa("audio-out",Ke),oa("webcam",Qe),oa("webcam-error",Ye),oa("clipboard-copy",Ze),oa("clipboard-paste",Je),oa("relative-mouse",Xe),oa("file-download",et),oa("file-upload",tt),oa("display-multi",e=>pe(e.enabled&&!pi())),oa("keyboard-sas",e=>k(e.enabled)),oa("screenshot",nt),oa("timezone-redirection",Ve)):Mo.emit("open-secondary-display")),()=>{Mo.off("first-frame",Ue),Mo.off("network-quality-warning",je),Mo.off("network-quality-critical",We),Mo.off("trackpadMode",ze),e&&(Mo.off("display-availability",mt),ea={})}),[n,e]),r(()=>{if(!v){const t=()=>ws(n,u,e);if(ou&&au.length){const e=au.indexOf(iu);-1!==e&&au.splice(e,1),setTimeout(t,500)}else e&&Ts([{name:"",rect:{x:0,y:0,width:ls&&ls[0]?ls[0].rect.width:800,height:ls&&ls[0]?ls[0].rect.height:600},primary:!1}]),t()}},[v]),r(()=>(Mo.on("collaboration-status-update",K),()=>{Mo.off("collaboration-status-update",K)})),r(()=>(Mo.on("display-layout",He),()=>{Mo.off("display-layout",He)}),[ke,n,u,e]),r(()=>{n&&pi()&&oa("keyboard",lt)},[n,u]),r(()=>{const t=()=>{Mo.emit("close-secondary-display"),n&&n.disconnect()};return e&&u.addEventListener("pagehide",t),()=>{e&&u.removeEventListener("pagehide",t)}},[n,u,e]),r(()=>(ve&&(u.addEventListener("resize",$e),su=u.document.getElementById(b)?.getElementsByTagName("canvas"),su&&su.length>0&&su[0].addEventListener("webglcontextlost",pt),u.matchMedia("(orientation: portrait)").addEventListener("change",$e),fe&&ke===Ci||ke===Si?(u.document.getElementById(`${b}-container`)&&u.document.getElementById(`${b}-container`).addEventListener("mousemove",rt),u.document.getElementById(b)&&(u.document.getElementById(b).addEventListener("focusin",ot),pi()&&u.document.getElementById(b).addEventListener("touchstart",ot)),u.document.getElementById(`${b}-toolbar-container`)&&(u.document.getElementById(`${b}-toolbar-container`).addEventListener("mouseleave",it),u.document.getElementById(`${b}-toolbar-container`).addEventListener("mousemove",at)),pi()&&Mo.on("toggle-toolbar",dt),be(!1)):(clearTimeout(Ne.current),clearTimeout(Pe.current),be(!0)),y(!1)),()=>{su&&su.length>0&&su[0].removeEventListener("webglcontextlost",pt),u.removeEventListener("resize",$e),u.matchMedia("(orientation: portrait)").removeEventListener("change",$e),clearTimeout(Ne.current),clearTimeout(Pe.current),u.document.getElementById(`${b}-container`)&&u.document.getElementById(`${b}-container`).removeEventListener("mousemove",rt),u.document.getElementById(b)&&(u.document.getElementById(b).removeEventListener("focusin",ot),pi()&&u.document.getElementById(b).removeEventListener("touchstart",ot)),u.document.getElementById(`${b}-toolbar-container`)&&(u.document.getElementById(`${b}-toolbar-container`).removeEventListener("mouseleave",it),u.document.getElementById(`${b}-toolbar-container`).removeEventListener("mousemove",at)),pi()&&Mo.off("toggle-toolbar",dt)}),[ve,ke,fe,n,e,u]),r(()=>{v&&!ge||ws(n,u,e)},[ke,fe]),r(()=>{const e=Wi();return Ui(Se,u.document.body),e&&(Ee(e.matches?L.Dark:L.Light),e.addEventListener("change",ut)),()=>{e&&e.removeEventListener("change",ut)}},[Se]),r(()=>{d&&xe(d)},[d]),r(()=>{p&&Ce(p)},[p]);const ft=s(()=>ce&&e&&pu(t.createElement(t.Fragment,null,t.createElement(m,{variant:ue?"primary":"normal",onClick:()=>{Mo.emit("toggle-keyboard")},ariaLabel:"Virtual keyboard"},(ue?"Close":"Open")+" keyboard"),t.createElement(Cl,{connection:n,softKeyboardVisible:ue,setSoftKeyboardVisible:de}))),[e,ue,ce]),ht=s(()=>t.createElement(h,{direction:"horizontal",size:"m"},e&&X&&t.createElement(nl,{connection:n,downloadEnabled:te,uploadEnabled:re}),(W||Q)&&t.createElement(Ra,{connection:n,copyEnabled:W,pasteEnabled:Q,currentWindow:u}),e&&du(T)&&du(A)&&t.createElement(nc,{connection:n}),e&&du(A)&&t.createElement(hc,{connection:n}),e&&Yo(F)&&t.createElement(Vc,{connection:n,status:F,selectedWebcam:N,setSelectedWebcam:P}),e&&me&&Le("multimonitorButton")&&t.createElement(Yl,{connection:n,copyEnabled:W,pasteEnabled:Q,appearanceMode:Se,toolbarBehavior:ke,pendingDisplays:au}),Le("fullscreenButton")&&u.document.documentElement.requestFullscreen&&!yi()&&!hi()&&t.createElement(ss,{setFullscreen:ct,currentDocument:u.document})),[e,X,n,te,re,W,Q,T,A,F,N,P,me,W,Q,Se,ke,au,ct,Le,u]),gt=s(()=>t.createElement(f,{textAlign:"center"},t.createElement(Oc,{connection:n})),[n]),bt=s(()=>t.createElement(f,{float:"right"},t.createElement("div",{style:tu},e&&ft,e&&U&&pu(t.createElement(El,{connection:n})),pu(t.createElement(cl,null)),pu(t.createElement(Ys,{connection:n,relativeMouseModeEnabled:w,sasEnabled:x,focusDisplay:st,screenshotEnabled:C,currentResolution:M,submitResolutionPreferences:qe,submitMetricsPreferences:J,submitAppearanceModePreferences:xe,submitToolbarBehaviorPreferences:Ce,webcamStatus:F,webcamId:N,setWebcamId:P,systemDefaultAppearanceMode:we,timezoneRedirectionSetting:Oe})))),[e,ft,n,U,w,x,C,M,F,N,we,Oe]),vt=s(()=>t.createElement(f,{display:ge?"block":"none",padding:{left:"s",right:"s",top:"xs",bottom:"xs"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},ht,e&&Z&>,e&&bt)),[ge,ht,e,Z,gt,bt,ft]),yt=s(()=>t.createElement("div",{id:"dcv-toolbar-container",style:{backgroundColor:H,borderBottom:`1px solid ${V}`,...ke===Si||fe&&ke===Ci?eu:{}}},vt),[ke,fe,vt]),wt=s(()=>t.createElement("div",{style:{backgroundColor:q}},t.createElement("div",{style:{height:Qo(u)-1}},t.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(h,{size:"m"},t.createElement(f,{textAlign:"center"},t.createElement(_,{size:"large"})),t.createElement(f,{fontWeight:"light",variant:"h1"},"Connecting"))))),[u]),Et=s(()=>t.createElement("div",{style:{display:Ie?"block":"none",zIndex:"1009",position:"absolute",top:"4%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(E,{type:"warning",header:"Network connection is unstable"},"Please check your network connection or VPN.")),[u,Ie]),St=s(()=>t.createElement("div",{style:{display:De?"block":"none",zIndex:"1009",position:"absolute",top:"4%",left:"50%",transform:"translate(-50%, -50%)",WebkitTransform:"translate(-50%, -50%)",msTransform:"translate(-50%, -50%)"}},t.createElement(E,{type:"error",header:"Network connection is not available"},"Please check your network connection or VPN.")),[u,De]),xt=s(()=>{const e=u.document.getElementById("dcv-input");return n?.setTrackpadMode(ie),e?t.createElement("div",{id:"trackpad-mode-buttons",style:{position:"absolute",left:"87px",bottom:"87px",zIndex:"1",opacity:"0.7"},onMouseMove:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onMouseDown:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onMouseUp:t=>{const n=new MouseEvent(t.type,t);e.dispatchEvent(n),t.preventDefault()},onTouchStart:e=>e.preventDefault(),onTouchEnd:e=>e.preventDefault()},t.createElement("button",{"aria-label":"Left mouse button",onTouchStart:()=>{n.sendMouseButton(1,!0)},onTouchEnd:()=>{n.sendMouseButton(1,!1)},onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),style:{height:"100px",backgroundColor:q,fill:G}},t.createElement(Qi,null)),t.createElement("button",{"aria-label":"Right mouse button",onTouchStart:()=>{n.sendMouseButton(3,!0)},onTouchEnd:()=>{n.sendMouseButton(3,!1)},onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),style:{position:"relative",left:"17px",height:"100px",backgroundColor:q,fill:G}},t.createElement(Zi,null))):null},[ve]),kt=s(()=>xs(u,!(ke===Ei||fe&&ke===ki)),[u,ke,fe]),Ct=s(()=>ks(u),[u]);return t.createElement("div",{id:`${b}-container`,style:Xl},v&&!ge?wt:Le("visible")&&yt,Et,St,t.createElement("div",{style:{display:v&&!ge?"none":"block",backgroundColor:q}},!v&&ie&&xt,t.createElement("div",{id:`${b}-frame`,style:{height:kt,width:Ct,overflow:qi.scaleToFit?"hidden":"auto"}},t.createElement("div",{id:b,ref:Be,style:Jl})),t.createElement("div",{id:"dcv-resource",tabIndex:"-1"}),t.createElement("div",{id:"soft-kbd-div",style:{position:"absolute",top:0,zIndex:-1e3}})))}function du(e){return-1!==["available","attached","active"].indexOf(e)}function mu(){null!==cu&&(_s(cu),cu=null)}function pu(e){return t.createElement("div",{style:nu},e)}function fu(e){if(null===e){const e=au.indexOf(iu);-1!==e&&au.splice(e,1)}iu=e}function hu(){return iu}uu.propTypes={isPrimary:c.bool,connection:c.object,copyEnabled:c.bool,pasteEnabled:c.bool,window:c.object,appearanceMode:c.oneOf([Ai,Ti,Ii]),toolbarBehavior:c.oneOf([Si,Ci,Mi]),uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})}),divId:c.string};var gu=n(uu);const bu=se("License Handler");let vu=null;function yu(e){let t=365,n="",r={};e.licenses.forEach(e=>{e.isDemo&&bu.info(`License status: product '${e.product}' is using a demo license (${e.leftDays} days left)`),e.leftDays>0&&e.leftDays<t&&(t=e.leftDays,n=e.product)}),0===e.numUnlicensed?(bu.debug(`License status: ${e.licenses.length} products licensed`),r.level=Ds.INFO,"demo"===e.licensingMode&&t<7?r.header="DCV demo license.":r.header="DCV license.",t<7?(bu.info(`License status: product '${n}' will expire in ${t} days`),r.description=`License of '${n}' will expire in ${t} days.`):"demo"===e.licensingMode&&(r.description="DCV is running with a demo license.")):(bu.warn(`License error (mode: ${e.licensingMode}), ${e.numUnlicensed}/${e.licenses.length} products unlicensed: ${JSON.stringify(e.licenses)}`),r.header="No license available.","ec2"===e.licensingMode?(r.level=Ds.WARNING,r.description="Please, check your EC2 configuration.",null!==e.documentationUrl&&""!==e.documentationUrl&&(r.actions={},r.actions.accept={text:"See documentation",callback:()=>{const t=document.createElement("a");t.href=e.documentationUrl,t.target="_blank",t.click()}})):(r.level=Ds.ERROR,r.description="Please, contact the administrator.")),r.description&&(vu=Ns(r,vu))}const wu=se("Printer");function Eu(e){const t=e.clone();Ns({level:Ds.INFO,header:"File printed.",description:`${t.id} has been converted in printable format.`,actions:{accept:{text:"Download",callback:()=>{var e;e=t,wu.debug(`Accepting print resource ${e.id}`),e.accept({disposition:"attachment"})},remove:!0},decline:{text:"Decline",callback:()=>{return e=t,wu.debug(`Removing print resource ${e.id}`),void e.decline();var e},remove:!0}}}),wu.debug(`Added printer notification for resource ${e.id}`)}const Su=se("DCVBaseViewer");let xu,ku;function Cu(e){const[n,i]=t.useState(null),a=o(n),s=t=>{Vo(e.onDisconnect)&&e.onDisconnect(t),a.current=null},c=e=>{let t,r=`${Ho(e.namespace)?"":`${e.namespace}::`}${e.name}`;0!==qi.customChannels.length&&-1!==(()=>{const t=[];return qi.customChannels.forEach(n=>{if(Ho(e.namespace)){const e=n.split("::",2);t.push(e[e.length-1])}else t.push(n)}),t})().indexOf(r)?n.openChannel(e.name,e.authToken,{onMessageReceived:e=>{Su.info(`Custom channel: received message ${new TextDecoder("utf-8").decode(e)}`),t(e)},onClose:e=>Su.info(`Custom channel closed: ${JSON.stringify(e)}`)},e.namespace).then(e=>{Su.info(`Opened custom channel ${e.channelName}`),t=t=>{e.sendMessage(t).then(()=>{Su.info("Success sending message.")}).catch(e=>{Su.error(`Failed to send message: ${JSON.stringify(e)}`)})}}).catch(e=>{Su.error(`Failed to open custom channel: ${e.message}`)}):Su.info(`Custom channel '${r}' not supported`)},u=e=>{switch(e.name){case"TwoFingerTouch":Mo.emit("toggle-keyboard");break;case"ThreeFingerTouch":Mo.emit("toggle-toolbar")}},d=()=>{Su.info("Calling client.connect");const n={displayLayout:(e,t,n)=>{Mo.emit("display-layout",e,t,n)},firstFrame:(e,t,n)=>{Mo.emit("first-frame",e,t,n)},displayAvailability:(e,t)=>{Mo.emit("display-availability",e,t)},disconnect:s,licenseNotification:yu,idleWarningNotification:e=>{!function(e){let t;e?(t=`DCV connection is idle and is going to be disconnected at ${e.toString()}`,Su.info(t),xu=Ns({level:Ds.WARNING,header:"Idle timeout.",description:t,actions:{dismissable:!0}},xu)):xu&&(_s(xu),xu=null)}(e)},dataChannel:e=>{Mo.emit("custom-channel",e)},filePrinted:e=>{Eu(e)},fileDownload:e=>{Mo.emit("file-download",e)},qualityIndicatorState:e=>{Su.info(`Quality Indicators: ${JSON.stringify(e)}`),function(e){let n=0,r=[],o="Quality status update.";switch(e.indicators.forEach(e=>{r.push(t.createElement(f,{key:e.name},`${e.name.replace("_"," ")} status: ${e.status}`)),e.changed&&Su.info(`Indicator ${e.name} has changed to status ${e.status}`),e.status>n&&(n=e.status)}),Su.info(`Current Quality Indicator overall alarm state: ${n}`),n){case 1:ku=Ns({level:Ds.WARNING,header:o,description:r,actions:{dismissable:!0}},ku);break;case 2:ku=Ns({level:Ds.ERROR,header:o,description:r,actions:{dismissable:!0}},ku);break;default:ku&&(_s(ku),ku=null)}}(e)},filestorageEnabled:e=>{Mo.emit("filestorage-enabled",e)},...pi()&&{gestureEvent:u},clipboardEvent:e=>{Mo.emit("clipboard",e)},deviceChangeEvent:function(){Mo.emit("device-change")},featuresUpdate:ra,screenshot:e=>{Mo.emit("screenshot",e)},collaboratorList:e=>{bl(e)},networkQualityChange:e=>{!function(e){switch(Su.info(`Network Quality Change: ${e.quality}`),e.quality){case"WARNING":Ou("network-quality-warning");break;case"CRITICAL":Ou("network-quality-critical");break;default:Ou()}}(e)}},r={url:e.config.url,sessionId:e.config.sessionId,authToken:e.config.authToken,enabledChannels:e.config.enabledChannels??qi.enabledChannels,displayCodecs:e.config.displayCodecs??qi.displayCodecs,divId:e.config.divId??"dcv-display",showDebugLayer:e.config.showDebugLayer??qi.debugLayer,enableGraphicsDebugLayer:e.config.enableGraphicsDebugLayer??qi.enableGraphicsDebugLayer,clientHiDpiScaling:e.config.clientHiDpiScaling??qi.clientHiDpiScaling,enableHighPixelDensity:e.config.enableHighPixelDensity??qi.enableHighPixelDensity,enableWebCodecs:e.config.enableWebCodecs??qi.enableWebCodecs,enableWebAuthN:e.config.enableWebAuthN??qi.enableWebAuthN,highColorAccuracy:e.config.highColorAccuracy??qi.highColorAccuracy,losslessColorspace:e.config.losslessColorspace??qi.losslessColorspace,baseUrl:e.config.baseUrl,resourceBaseUrl:e.config.resourceBaseUrl??"",extensionData:e.config.extensionData??"",volumeLevel:e.config.volumeLevel??qi.volume,clipboardAutoSync:e.config.clipboardAutoSync,dynamicAudioTuning:e.config.dynamicAudioTuning,observers:{...n,...e.config.observers},callbacks:e.config.callbacks};Object.keys(r).forEach(e=>{Ho(r[e])&&delete r[e]}),l.connect(r).then(t=>{i(t),a.current=t;const n=e.customTitle||`${t.getServerInfo().hostname} - Amazon DCV`;document.title=n,e.customTitle&&Su.info(`Using custom browser title: ${e.customTitle}`),Vo(e.onConnectionEstablished)&&e.onConnectionEstablished(t)}).catch(t=>{Su.error(`client.connect was rejected (${t.message})`),Vo(e.onDisconnect)&&e.onDisconnect(t.message),a.current=null})};return r(()=>{e.config.sessionId&&e.config.authToken&&!n&&(oe.setLevel(e.logLevel),d())},[e.config.sessionId,e.config.authToken]),r(()=>()=>{Su.info("Calling connection.disconnect"),a.current&&a.current.disconnect()},[]),r(()=>(Mo.on("custom-channel",c),()=>{Mo.off("custom-channel",c)}),[n]),t.createElement(gu,{isPrimary:!0,connection:n,window:window,uiConfig:e.uiConfig,divId:e.config.divId??"dcv-display"})}function Ou(e=""){switch(Mo.emit("network-quality-warning",!1),Mo.emit("network-quality-critical",!1),e){case"network-quality-warning":case"network-quality-critical":Mo.emit(e,!0);break;case"":break;default:Su.warn(`Unknown input passed to emitNetworkQualitySignal: ${e}`)}}Cu.propTypes={config:c.shape({url:c.string.isRequired,sessionId:c.string.isRequired,authToken:c.string.isRequired,baseUrl:c.string,resourceBaseUrl:c.string,extensionData:c.string,connectionMetadata:c.object,enabledChannels:c.array,connectionFailureRetryAttempts:c.number,connectionBlockRetryAttempts:c.number,losslessColorspace:c.string,divId:c.string,volumeLevel:c.number,clipboardAutoSync:c.bool,dynamicAudioTuning:c.bool,clientHiDpiScaling:c.bool,highColorAccuracy:c.bool,enableHighPixelDensity:c.bool,enableWebCodecs:c.bool,enableWebAuthN:c.bool,enableGraphicsDebugLayer:c.bool,showDebugLayer:c.oneOfType([c.bool,c.number]),displayCodecs:c.array,observers:c.object,callbacks:c.object,httpExtraSearchParams:c.func}).isRequired,uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})}),onDisconnect:c.func,logLevel:c.oneOf(Object.values(oe.levels)),onConnectionEstablished:c.func,customTitle:c.string};const Mu=se("DCVViewer");function Ru(e){const n={url:e.dcv.serverUrl,sessionId:e.dcv.sessionId,authToken:e.dcv.authToken,baseUrl:e.dcv.baseUrl,resourceBaseUrl:e.dcv.resourceBaseUrl,extensionData:e.dcv.extensionData,clipboardAutoSync:!0,dynamicAudioTuning:!0,observers:e.dcv.observers,divId:e.dcv.divId};return Mu.info("Creating DCVViewer component."),t.createElement(Cu,{config:n,uiConfig:e.uiConfig,onDisconnect:e.dcv.onDisconnect,logLevel:e.dcv.logLevel,customTitle:e.dcv.customTitle,onConnectionEstablished:e.dcv.onConnectionEstablished})}Ru.propTypes={dcv:c.exact({sessionId:c.string.isRequired,authToken:c.string.isRequired,serverUrl:c.string.isRequired,baseUrl:c.string.isRequired,resourceBaseUrl:c.string,extensionData:c.string,onDisconnect:c.func,logLevel:c.oneOf(Object.values(oe.levels)),customTitle:c.string,observers:c.exact({httpExtraSearchParams:c.func,httpExtraHeaders:c.func}),onConnectionEstablished:c.func,divId:c.string}).isRequired,uiConfig:c.exact({toolbar:c.exact({visible:c.bool,fullscreenButton:c.bool,multimonitorButton:c.bool})})};export{Ru as DCVViewer};
|