ezuikit-js 8.2.0-beta.7 → 8.2.0-beta.8

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/index.mjs CHANGED
@@ -1,32 +1,32 @@
1
1
  /*
2
- * ezuikit.js v8.2.0-beta.7
2
+ * ezuikit.js v8.2.0-beta.8
3
3
  * ezuikit javascript for npm
4
4
  * Copyright (c) 2025-11-23 Ezviz-OpenBiz
5
5
  * Released under the MIT License.
6
6
  */
7
- import"abortcontroller-polyfill";import"formdata-polyfill";import e from"deepmerge";import t,{isMobile as n,parseEzopenUrl as i,switchEzopenUrl as r,getStaticPath as o}from"@ezuikit/utils-tools";import a from"screenfull";import s from"@ezuikit/utils-i18n";import l from"@ezuikit/utils-logger";import c from"debounce-promise";import d from"@ezuikit/utils-collect";import u from"@ezuikit/player-ezopen/dist/adapter.js";import p from"delegate";function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(':root{--ezplayer-default-color:#fff;--ezplayer-primary-color:#407aff;--ezplayer-active-color:var(--ezplayer-primary-color,#407aff);--ezplayer-disabled-color:#aaa;--ezplayer-font-size:14px;--ezplayer-icon-font-size:24px;--ezplayer-btn-height:var(--ezplayer-icon-font-size,24px);--ezplayer-border-radius:8px;--ezplayer-control-space:16px;--ezplayer-header-height:46px;--ezplayer-footer-height:80px;--ezplayer-fullscreen-control-space:26px;--ezplayer-panel-bg-color:rgba(0,0,0,.7);--ezplayer-mobile-control-space:16px;--ezplayer-mobile-header-height:45px;--ezplayer-mobile-footer-height:54px;--ezplayer-mobile-fullscreen-header-height:75px;--ezplayer-mobile-fullscreen-footer-height:110px;--ezplayer-mobile-fullscreen-control-space:26px;--ezplayer-mobile-extend-bg-color:#f5f7fa;--ezplayer-mobile-extend-default-color:#2c2c2c}body.ezplayer-body-mobile-noscroll{background-color:#000!important;height:100vh;overflow:hidden;touch-action:none}.ezplayer,.ezplayer-mobile-extend{background-color:#000;box-sizing:border-box;color:var(--ezplayer-default-color,#fff);display:flex;flex-direction:column;font-size:14px;font-size:var(--ezplayer-font-size,14px);padding:0;position:relative;--webkit-tap-highlight-color:transparent;outline:none}.ezplayer *,.ezplayer-mobile-extend *{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ezplayer:-webkit-full-screen{height:100%!important;width:100%!important}.ezplayer *{box-sizing:border-box}.ezplayer li,.ezplayer ul{box-sizing:border-box;list-style:none;margin:0;padding:0}.ezplayer-control{align-items:center;cursor:pointer;display:inline-flex;justify-content:center}.ezplayer-control-block,.ezplayer-control-text{cursor:unset}.ezplayer-control-block{align-items:center;box-sizing:border-box;color:var(--ezplayer-default-color,#fff);display:flex;flex-direction:column;justify-content:center;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ezplayer-btn,.ezplayer-icon,.ezplayer-text{display:inline-flex;transition:color .2s ease-in-out}.ezplayer-btn{cursor:pointer}.ezplayer-btn,.ezplayer-text{font-size:var(--ezplayer-font-size,14px)}.ezplayer-btn{align-items:center;border:1px solid var(--ezplayer-default-color,#fff);border-radius:12px;border-radius:calc(var(--ezplayer-btn-height, 24px)/2);display:inline-flex;height:var(--ezplayer-btn-height,26px);justify-content:center;padding:2px 10px;white-space:nowrap}.ezplayer-active{border-color:var(--ezplayer-active-color,#0099e5)!important;color:var(--ezplayer-active-color,#0099e5)!important}.ezplayer-disabled,.ezplayer-disabled .ezplayer-btn,.ezplayer-disabled .ezplayer-icon,.ezplayer-disabled .ezplayer-text{border-color:var(--ezplayer-disabled-color,#aaa)!important;color:var(--ezplayer-disabled-color)!important;cursor:not-allowed!important}.ezplayer-hide{display:none!important}.ezplayer-hide-transition{opacity:0!important;pointer-events:none!important}.ezplayer-overflow-hidden{overflow:hidden}.ezplayer-global-fullscreen .ezplayer-footer,.ezplayer-global-fullscreen .ezplayer-header,.ezplayer-global-fullscreen .ezplayer-rec-footer{display:none}.ezplayer-mobile .ezplayer-control-global-fullscreen{display:none!important}.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-0,.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-180{background-color:#000!important;bottom:0!important;height:100vw!important;height:var(--ezplayer-mobile-inner-width,100vw)!important;left:0!important;overflow:hidden;padding-right:env(safe-area-inset-bottom);position:fixed!important;right:0!important;top:0!important;transform:rotate(90.001deg) translateY(-100%)!important;-webkit-transform:rotate(90.001deg) translateY(-100%)!important;transform-origin:0 0!important;-webkit-transform-origin:0 0!important;width:100vh!important;width:var(--ezplayer-mobile-inner-height,100vh)!important;z-index:9999}.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-270,.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-90{background-color:#000!important;bottom:0!important;height:100vh!important;height:var(--ezplayer-mobile-inner-height,100vh)!important;left:0!important;overflow:hidden;position:fixed!important;right:0!important;top:0!important;transform:rotate(0deg) translateY(0)!important;-webkit-transform:rotate(0deg) translateY(0)!important;transform-origin:0 0!important;-webkit-transform-origin:0 0!important;width:100vw!important;width:var(--ezplayer-mobile-inner-width,100vw)!important;z-index:9999}.ezplayer-footer,.ezplayer-header{align-items:center;box-sizing:border-box;color:var(--ezplayer-default-color,#fff);display:flex;flex-wrap:nowrap;font-size:24px;justify-content:space-between;left:0;opacity:1;position:absolute;right:0;transition:opacity .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:20}.ezplayer-footer-left,.ezplayer-footer-right,.ezplayer-header-left,.ezplayer-header-right{display:inline-flex;flex-direction:row;flex-wrap:nowrap}.ezplayer-footer-left,.ezplayer-header-left{padding-left:20px}.ezplayer-footer-left .ezplayer-control,.ezplayer-header-left .ezplayer-control{margin-right:16px}.ezplayer-footer-left .ezplayer-control:last-child,.ezplayer-header-left .ezplayer-control:last-child{margin-right:0!important}.ezplayer-footer-right,.ezplayer-header-right{padding-right:20px}.ezplayer-footer-right .ezplayer-control,.ezplayer-header-right .ezplayer-control{margin-left:16px}.ezplayer-footer-right .ezplayer-control:first-child,.ezplayer-header-right .ezplayer-control:first-child{margin-left:0!important}.ezplayer-footer .ezplayer-control,.ezplayer-header .ezplayer-control{padding:2px}.ezplayer-footer .ezplayer-control-text+.ezplayer-control-text,.ezplayer-header .ezplayer-control-text+.ezplayer-control-text{margin-left:8px}.ezplayer-footer-more,.ezplayer-header-more{align-items:center;display:flex;flex-direction:row}.ezplayer-header{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAuCAMAAADeMYNYAAAAbFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0Iv+qAAAAJHRSTlOBdGtiTDoxGxIJy8bCvbm0sKyno56alZGMiHtbV1JFQSomIQDNbq/TAAAAPklEQVQI1xXBhQHAIAAEsau7uwv778iTkFNQUlHT0NLRMzAyMbOwsuHseOproAcnF6HePEQa68vHT6KpZmosd8UCpGNSKboAAAAASUVORK5CYII=");box-sizing:border-box;height:46px;margin:0;top:0}.ezplayer-header-left,.ezplayer-header-right{max-width:50%}.ezplayer-control-rec .ezplayer-icon:first-child{margin-left:0}.ezplayer-footer{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABQCAQAAAByztdQAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAd0SU1FB+kGBAsQDlySUqoAAAABb3JOVAHPoneaAAAAHElEQVQI12NgYGRiYGZiYGJiYEZiYJLECw5q9QCpgAFr/pGonwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wNi0wNFQxMToxNTo1OCswMDowMBLJutIAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDYtMDRUMTE6MTU6NTgrMDA6MDBjlAJuAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI1LTA2LTA0VDExOjE2OjE0KzAwOjAwnFz8PAAAAABJRU5ErkJggg==");bottom:0;box-sizing:border-box;height:80px;margin:0;padding-top:20px}.ezplayer-mobile .ezplayer-footer,.ezplayer-mobile .ezplayer-header{font-size:24px}.ezplayer-mobile .ezplayer-footer-left .ezplayer-control,.ezplayer-mobile .ezplayer-footer-right .ezplayer-control,.ezplayer-mobile .ezplayer-header-left .ezplayer-control,.ezplayer-mobile .ezplayer-header-right .ezplayer-control{height:24px;padding:0}.ezplayer-mobile .ezplayer-footer-left,.ezplayer-mobile .ezplayer-header-left{padding-left:15px}.ezplayer-mobile .ezplayer-footer-left .ezplayer-control,.ezplayer-mobile .ezplayer-header-left .ezplayer-control{margin-right:15px}.ezplayer-mobile .ezplayer-footer-right,.ezplayer-mobile .ezplayer-header-right{padding-right:15px}.ezplayer-mobile .ezplayer-footer-right .ezplayer-control,.ezplayer-mobile .ezplayer-header-right .ezplayer-control{margin-left:15px}.ezplayer-mobile .ezplayer-footer .ezplayer-control,.ezplayer-mobile .ezplayer-header .ezplayer-control{height:24px;min-width:24px}.ezplayer-mobile .ezplayer-footer .ezplayer-control-text,.ezplayer-mobile .ezplayer-header .ezplayer-control-text{font-size:14px}.ezplayer-mobile .ezplayer-header{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAtCAMAAACzkkr1AAAAV1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOl5NtAAAAHXRSTlOWj4JzaV9YUUQ9MywlGxQKioZ8eW9kTUk4IA8FAKPHi9EAAABMSURBVAjXJcKFDcAwAAOwjKHM+P+dUzTL+C0LWwvnsK7sPULAtnGM2HdOCcfB58nXxTmjFNw3Pw/XivdlIVhKbg1KsdbcO4zhMTDnB9pJBB0jNaXIAAAAAElFTkSuQmCC");background:linear-gradient(180deg,rgba(0,0,0,.6),transparent);height:45px;margin:0;padding:0}.ezplayer-mobile .ezplayer-footer{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAA2CAQAAABHVIAUAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAd0SU1FB+kHGQYOGOvM7YUAAAABb3JOVAHPoneaAAAAFUlEQVQY02NkYGRgYGFgxkUwjShZAMFnAW71uqvOAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI1LTA3LTI1VDA2OjE0OjAwKzAwOjAwy873zwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNS0wNy0yNVQwNjoxNDowMCswMDowMLqTT3MAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjUtMDctMjVUMDY6MTQ6MjQrMDA6MDBb7E3CAAAAAElFTkSuQmCC");background:linear-gradient(180deg,transparent,rgba(0,0,0,.6));height:54px;padding-top:0}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAABLCAQAAADw6J4LAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAd0SU1FB+kHGQYYHh43/WcAAAABb3JOVAHPoneaAAAAKUlEQVQY02NkOM3AwMLwF5X4h5dLOyXD13JmBiaG/8wMjAz/GRkYGRgADI9KMQ6gLKQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjUtMDctMjVUMDY6MjQ6MTQrMDA6MDBqybVDAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI1LTA3LTI1VDA2OjI0OjE0KzAwOjAwG5QN/wAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNS0wNy0yNVQwNjoyNDozMCswMDowMPrrD04AAAAASUVORK5CYII=");background:linear-gradient(180deg,rgba(0,0,0,.8),transparent);height:75px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAABuCAMAAAA6XjI3AAAAaVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnbPKNAAAAI3RSTlMAQrRXSTozKxUHxb+spqCNh4F1ZVAgDbqTenBqJRvKm5dgXO7N8BQAAABzSURBVBjThcRFDsQwFATRH2Z2mHP/Q447bmuWKT2VfJdIYg0DxTHt2g59T9sGUSQRDmFoBRJYjvPn+6SUKHNPPOt54L6h62hdYdEWaFuaZ2gaacxrqV9VJZX5JNPruuA8oSypKCjPyXVp1EbIMkpTOg7tB7gTDCt3nEtMAAAAAElFTkSuQmCC");background:linear-gradient(180deg,transparent 9%,rgba(0,0,0,.8));height:110px;padding-top:18px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-left,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-left{padding-left:50px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-left .ezplayer-control,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-left .ezplayer-control{margin-right:30px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-right,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-right{padding-right:50px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-right .ezplayer-control,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-right .ezplayer-control{margin-left:30px}.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-footer-left .ezplayer-control,.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-header-left .ezplayer-control{margin-right:26px}.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-footer-right .ezplayer-control,.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-header-right .ezplayer-control{margin-left:26px}.ezplayer-content{align-items:center;justify-content:center}.ezplayer-content,.ezplayer-content-wrapper{box-sizing:border-box;display:flex;flex:1 1 auto;height:100%;margin:0;outline:none;overflow:hidden;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:0}.ezplayer-content-wrapper{background-color:#000}.ezplayer-content-video{align-items:center;box-sizing:border-box;display:flex;flex:1 1 auto;height:100%;justify-content:center;margin:0;outline:none;padding:0;width:100%}.ezplayer-mobile-extend{background-color:#639;background-color:var(--ezplayer-mobile-extend-bg-color,#f5f7fa);color:var(--ezplayer-mobile-extend-default-color,#2c2c2c);display:flex;flex-direction:column}.ezplayer-mobile-extend-controls{background-color:#639;display:flex;height:66px;justify-content:space-around}.ezplayer-mobile-extend-controls .ezplayer-control{width:75px}.ezplayer-mobile-extend-control-panel{align-items:center;display:flex;flex-direction:column;min-height:390px}.ezplayer-mobile-extend-control-top{align-items:center;display:flex;height:36px;justify-content:space-between;padding-top:10px}.ezplayer-mobile-extend-control-top-left{display:inline-flex;padding-left:15px}.ezplayer-mobile-extend-control-top-right{display:inline-flex;justify-content:flex-end;padding-right:15px}.ezplayer-mobile-extend-control-content{display:flex;flex:1 1 auto;flex-direction:column;width:100%}.ezplayer-rec-footer{background-color:#000;box-sizing:border-box;display:block;height:36px;position:relative}.ezplayer-rec-footer-has-date-picker{padding-right:56px}.ezplayer-rec-footer-time-line{height:36px;overflow:hidden;width:100%}.ezplayer-rec-footer-date-picker{align-items:center;display:flex;height:36px;justify-content:flex-end;padding-right:20px;position:absolute;right:0;top:0;width:56px}.ezplayer-rec-footer-date-picker .ezplayer-icon-date{font-size:20px;margin-top:-5px}.drag-scroll{box-sizing:border-box;margin:0;padding:0}.drag-scroll-container{cursor:grab;height:450px;overflow:hidden;position:relative;-webkit-tap-highlight-color:transparent}.drag-scroll-container,.drag-scroll-content{box-sizing:border-box;display:flex;flex-direction:column;margin:0;padding:0;width:100%}.drag-scroll-content{gap:18px;height:auto;transform:translateZ(0);will-change:transform}.drag-scroll-scrollbar{background-color:#0000001a;border-radius:3px;bottom:0;box-sizing:border-box;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s;width:6px}.drag-scroll-scrollbar.drag-scroll-show{opacity:1}.drag-scroll-scrollbar-thumb{background:linear-gradient(180deg,#4a90e2,#357abd);border-radius:3px;box-sizing:border-box;position:absolute;transition:height .2s;width:100%}.epicker-body-noscroll{overflow:hidden;touch-action:none}.epicker{box-shadow:0 9px 28px 8px #0000000d;display:none;margin:0;opacity:0;padding:0;position:absolute;transition:opacity .3s ease;vertical-align:top;z-index:1000}.epicker,.epicker-body{box-sizing:border-box;flex-direction:column}.epicker-body{display:flex}.epicker.epicker-mobile .epicker-mask{background-color:#0000004d;bottom:0;box-sizing:border-box;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:9998}.epicker.epicker-mobile .epicker-body{align-items:center;bottom:0;left:0;position:fixed;right:0;z-index:9999}.ez-time-line-container{box-sizing:border-box;display:block;height:300px;min-width:190px;overflow:hidden;padding-right:29%;position:relative;text-align:left;white-space:nowrap;width:52%!important}.ez-time-line-time-scale-area{border-bottom:none;border-right:12px solid #bdcdff;border-top:none;box-sizing:border-box;color:#666;font-size:12px;height:60px;margin:0;padding:0;position:relative}.ez-time-line-time-label{height:14px;left:45%;line-height:14px;position:relative;top:53px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ez-time-line-time-unavail{background-color:#ddd;box-sizing:border-box;left:100%;position:absolute;width:12px}.ez-time-line-current{box-sizing:border-box;height:29px;min-width:80px;padding-left:2.66666%;position:absolute;text-align:left;top:40px;width:23%;z-index:1}.ez-time-line-current-content{height:58px;position:relative;width:100%}.ez-time-line-current-tip{align-items:center;display:inline-flex;font-size:58px;position:absolute;width:58px;z-index:1}.ez-time-line-current-tip-line{background-color:#648ffc;border-radius:1px;height:1.5px;position:absolute;top:50%;transform:translateY(-50%);width:102%}.ez-time-line-current-value{color:#fff;font-size:12px;height:58px;line-height:58px;pointer-events:none;position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:52px;z-index:1}.ez-time-line-time-cover-fold{align-items:flex-end;color:#fff;display:inline-flex;height:60px;position:absolute;right:-90px;transform:translate(22px);width:90px}.ez-time-line-time-cover-fold-img{border-radius:6px;height:50px;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:90px}.ez-time-line-time-cover-fold-img img{height:50px;-o-object-fit:cover;object-fit:cover;width:90px}.ez-time-line-time-cover-fold-img:before{background-color:rgba(0,0,0,.3);content:"";height:50px;left:0;position:absolute;top:0;width:90px;z-index:1}.ez-time-line-time-cover-fold-len{font-size:12px;font-size:11px;left:2px;position:absolute;top:2px;z-index:2}.ez-time-line-time-cover-fold-time{font-size:12px;font-size:11px;position:absolute;right:2px;top:2px;z-index:2}.ez-time-line-time-cover-fold-pause{bottom:2px;color:#fff;display:inline-flex;font-size:20px;position:absolute;right:0;z-index:2}.ez-time-line-cover-fold-placeholder{display:flex;height:60px;justify-content:center;position:absolute;width:90px}.ez-time-line-cover-fold-placeholder:after,.ez-time-line-cover-fold-placeholder:before{border-radius:6px;content:"";position:absolute}.ez-time-line-cover-fold-placeholder:before{background-color:#ededed;height:30px;top:0;width:70px}.ez-time-line-cover-fold-placeholder:after{background-color:#ccc;height:40px;top:5px;width:80px}.ez-time-line-item-cover-placeholder{align-items:center;background:linear-gradient(180deg,#b7c3cf,#d4d1d1 100%);color:#fff;display:flex;font-size:20px;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.ez-time-line-op{position:absolute;right:10%;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.ez-time-line-op-wrapper{display:inline-flex;flex-direction:column}.ez-time-line-icon-plus{margin-bottom:40px}.ez-time-line-icon-minus:not(.ez-time-line-disabled),.ez-time-line-icon-plus:not(.ez-time-line-disabled){align-items:center;border:1px solid #999;border-radius:8px;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:16px;height:30px;justify-content:center;padding:7px;transition:color .3s ease,border-color .3s ease;width:30px}.ez-time-line-icon-minus:not(.ez-time-line-disabled):active,.ez-time-line-icon-plus:not(.ez-time-line-disabled):active{border-color:#369fff;color:#369fff}.ez-time-line-disabled{border-color:#dedede!important;cursor:not-allowed!important}.ez-time-line-picker.epicker.epicker-mobile .epicker-body{align-items:normal;background-color:#fff;height:550px;max-height:70%}.ez-time-line-picker-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ez-time-line-picker-header{color:#2c2c2c;display:flex;font-size:18px;font-weight:500;height:65px;letter-spacing:0;line-height:45px;padding:10px 70px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ez-time-line-picker-close,.ez-time-line-picker-header{align-items:center;box-sizing:border-box;justify-content:center}.ez-time-line-picker-close{color:#20262c;cursor:pointer;display:inline-flex;font-size:24px;height:24px;left:15px;position:absolute;top:20px;transition:color .3s ease;width:24px}.ez-time-line-picker-close:active{color:#f05757}.ez-time-line-picker-content{box-sizing:border-box;flex:1 1 auto;overflow-x:hidden;overflow-y:auto}.ez-time-line-picker-item{margin-bottom:20px;padding-left:10px;padding-right:10px}.ez-time-line-picker-item-title{color:#666;font-size:14px;font-weight:400;letter-spacing:0;line-height:20px;margin-bottom:10px;padding-left:1.5%}.ez-time-line-picker-item-list{display:flex;flex-wrap:wrap}.ez-time-line-picker-item-content{background-color:#ddd;border-radius:8px;display:flex;margin:0 1.5% 10px;overflow:hidden;padding-top:18.769%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:30.333%}.ez-time-line-picker-item-content:before{background-color:rgba(0,0,0,.3);content:"";height:100%;left:0;position:absolute;top:0;width:100%}.ez-time-line-picker-item-time{left:5px}.ez-time-line-picker-item-duration,.ez-time-line-picker-item-time{color:#fff;font-size:12px;font-size:11px;font-weight:400;letter-spacing:0;line-height:13px;position:absolute;top:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}.ez-time-line-picker-item-duration{right:5px}.ez-time-line-picker-item-cover{height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:0}.ez-time-line-picker .ez-time-line-item-cover-placeholder{font-size:30px;z-index:1}.ezplayer .ezplayer-progress{align-items:center;background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);box-sizing:border-box;cursor:default;display:flex;flex-direction:column;justify-content:center;padding:36px 9px 11px;position:relative;width:38px}.ezplayer .ezplayer-progress,.ezplayer .ezplayer-progress-text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ezplayer .ezplayer-progress-text{font-size:12px;height:17px;left:0;line-height:17px;position:absolute;text-align:center;top:10px;width:100%}.ezplayer .ezplayer-progress-minus,.ezplayer .ezplayer-progress-plus{display:flex;height:25px;justify-content:center}.ezplayer .ezplayer-progress-minus .ezplayer-icon,.ezplayer .ezplayer-progress-plus .ezplayer-icon{color:#fff;cursor:pointer;display:inline-block;font-size:20px;height:20px;text-align:center;transition:color .3s ease,border-color .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:20px}.ezplayer .ezplayer-progress-minus .ezplayer-icon:active,.ezplayer .ezplayer-progress-plus .ezplayer-icon:active{color:var(--ezplayer-primary-color,#407aff)}@media (hover:hover){.ezplayer .ezplayer-progress-minus .ezplayer-icon:hover,.ezplayer .ezplayer-progress-plus .ezplayer-icon:hover{color:var(--ezplayer-primary-color,#407aff)}}.ezplayer .ezplayer-progress-plus{padding-bottom:5px}.ezplayer .ezplayer-progress-minus{padding-top:5px}.ezplayer .ezplayer-progress-slider{background-color:hsla(0,0%,100%,.75);border-radius:2px;cursor:pointer;flex:1 1 auto;position:relative;width:4px}.ezplayer .ezplayer-progress-slider-fill{background-color:var(--ezplayer-primary-color,#407aff);border-radius:4px;bottom:0;height:0;left:0;position:absolute;width:100%}.ezplayer .ezplayer-progress-slider-handle{align-items:center;background-color:var(--ezplayer-primary-color,#407aff);border-radius:50%;cursor:pointer;display:inline-flex;height:12px;justify-content:center;left:50%;position:absolute;top:0;transform:translate(-50%,-50%);width:12px}.ezplayer .ezplayer-progress-slider-handle:hover{box-shadow:0 0 2px var(--ezplayer-primary-color,#407aff)}.ezplayer .ezplayer-progress-slider-handle:before{background-color:#fff;border-radius:50%;content:"";display:inline;height:6px;width:6px}.ezplayer-icon{align-items:center;color:inherit;display:inline-flex;font-size:var(--ezplayer-icon-font-size,24px);font-style:normal;line-height:0;text-align:center;text-rendering:optimizeLegibility;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ezplayer-select-panel{background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);color:var(--ezplayer-default-color,#fff);display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;position:relative}.ezplayer-select-btn{width:50px}.ezplayer-select-btn span{display:inline-block;font-size:12px;font-size:calc(var(--ezplayer-font-size, 14px) - 2px);line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ezplayer-select-list{align-items:center;display:flex;flex-direction:column;font-size:var(--ezplayer-font-size,14px);list-style:none;margin:0;padding:12px 0!important;width:100%}.ezplayer-select-option{box-sizing:border-box;cursor:pointer;display:inline-flex;height:28px;justify-content:center;line-height:18px;list-style:none;padding:5px 20px!important;transition:color .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ezplayer-select-option span{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ezplayer-select-option:hover{color:var(--ezplayer-active-color)}.ezplayer-select-cancel,.ezplayer-select-close{display:none}.ezplayer-select-cancel{font-size:var(--ezplayer-font-size,14px)}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-panel{background-color:transparent;max-width:400px;padding-bottom:calc(54px + env(safe-area-inset-bottom));width:90%}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-list{align-items:center;background-color:#fff;border-radius:var(--ezplayer-border-radius,8px);display:flex;flex-direction:column;font-size:var(--ezplayer-font-size,14px);max-height:70vh;max-height:calc(90vh - 108px);overflow-x:hidden;overflow-y:auto;padding:20px 0!important}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel,.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option{align-items:center;box-sizing:border-box;color:#2c2c2c;display:inline-flex;height:36px;justify-content:center;line-height:26px;padding:5px 20px!important}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option{--webkit-tap-highlight-color:transparent!important}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:hover{color:#2c2c2c}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:active{background-color:#f8f8f8}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel{background-color:#fff;border-radius:var(--ezplayer-border-radius,8px);display:flex;height:54px;margin-top:8px}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel:active{color:var(--ezplayer-active-color)}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .epicker-body{bottom:0;left:unset;right:0;top:0;width:240px}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-panel{align-items:center;background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-bottom-right-radius:0;border-top-right-radius:0;height:100%;justify-content:center;padding-bottom:env(safe-area-inset-bottom);width:100%}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-list{background-color:transparent;border-radius:0;color:#fff;height:auto;margin:0;max-height:100%;width:100%}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-option,.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:hover{color:#fff}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:active{background-color:transparent;color:var(--ezplayer-active-color)}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel{display:none}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-close{display:inline-flex;left:10px;position:absolute;top:10px}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-close:active{color:var(--ezplayer-active-color)}.ezplayer-control-fullscreen .ezplayer-icon-exit-fullscreen,.ezplayer-control-global-fullscreen .ezplayer-icon-exit-global-fullscreen{display:none}.ezplayer-fullscreen .ezplayer-icon-exit-fullscreen{display:inline-flex}.ezplayer-fullscreen .ezplayer-icon-fullscreen{display:none}.ezplayer-global-fullscreen .ezplayer-icon-exit-global-fullscreen{display:inline-flex}.ezplayer-global-fullscreen .ezplayer-icon-global-fullscreen{display:none}.ezplayer-loading{background-color:rgba(0,0,0,.5);bottom:0;color:#fff;display:none;font-size:14px;height:100%;left:0;position:absolute;right:0;top:0;transition:transform .3s cubic-bezier(.78,.14,.15,.86);vertical-align:middle;width:100%;z-index:4}.ezplayer-loading-dot{display:inline-block;font-size:25px;height:25px;position:relative;width:25px}.ezplayer-loading-dot-item{background-color:#fff;border-radius:2px;display:block;height:10px;position:absolute;transform-origin:50% 50%;width:10px}.ezplayer-loading-dot-item:first-child{animation:animationShape1 2s linear 0s infinite normal;left:0;opacity:1;top:0}.ezplayer-loading-dot-item:nth-child(2){animation:animationShape2 2s linear 0s infinite normal;left:15px;opacity:.8;top:0}.ezplayer-loading-dot-item:nth-child(3){animation:animationShape3 2s linear 0s infinite normal;left:0;opacity:.5;top:15px}.ezplayer-loading-dot-item:nth-child(4){animation:animationShape4 2s linear 0s infinite normal;left:15px;opacity:.3;top:15px}.ezplayer-loading-dot-load{animation:rotation 1s infinite}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.ezplayer-load-blur{background:#fff;opacity:.5}}@keyframes ezdSpinMove{to{opacity:1}}@keyframes ezdRotate{to{transform:rotate(405deg)}}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes animationShape1{0%{transform:translate(0)}25%{transform:translateY(15px)}50%{transform:translate(15px,15px)}75%{transform:translate(15px)}to{transform:translate(translate)}}@keyframes animationShape2{0%{transform:translate(0)}25%{transform:translate(-15px)}50%{transform:translate(-15px,15px)}75%{transform:translateY(15px)}}@keyframes animationShape3{0%{transform:translate(0)}25%{transform:translate(15px)}50%{transform:translate(15px,-15px)}75%{transform:translateY(-15px)}}@keyframes animationShape4{0%{transform:translate(0)}25%{transform:translateY(-15px)}50%{transform:translate(-15px,-15px)}75%{transform:translate(-15px)}}.ezplayer-loading-text{margin-top:20px}.ezplayer-message{background-color:rgba(0,0,0,.4);bottom:0;color:#fff;display:none;font-size:16px;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;width:100%;z-index:5}.ezplayer-message-content{align-items:center;display:flex;flex-direction:column;justify-content:center}.ezplayer-message-msg{display:-webkit-box;margin-top:15px;max-width:500px;overflow:hidden;word-break:break-all;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:0 20px}.ezplayer-message-error{color:#ff4d4f}.ezplayer-toast{background-color:rgba(0,0,0,.8);border-radius:var(--ezplayer-border-radius,8px);box-shadow:0 9px 28px 8px rgba(0,0,0,.05),0 3px 16px 0 rgba(0,0,0,.03),0 3px 7px -4px rgba(0,0,0,.05);color:#fff;display:flex;font-size:14px;left:50%;line-height:22px;max-width:450px;overflow:hidden;padding:9px 16px;position:absolute;top:50px;transform:translateX(-50%);z-index:6}.ezplayer-toast-content{padding-left:24px;position:relative}.ezplayer-toast .ezplayer-icon{font-size:16px;left:0;position:absolute;top:3px}.ezplayer-toast .ezplayer-icon-info-circle{color:var(--ezplayer-default-color,#fff)}.ezplayer-toast .ezplayer-icon-warn-circle{color:#faad14}.ezplayer-toast .ezplayer-icon-close-circle{color:#ff4d4f}.ezplayer-mobile .ezplayer-toast{font-size:12px;line-height:20px}.ezplayer-mobile .ezplayer-toast-content{padding-left:20px}.ezplayer-mobile .ezplayer-toast .ezplayer-icon{font-size:14px}.ezplayer-poster{bottom:0;display:none;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.ezplayer-poster img{border:0;font-size:0;height:100%;outline:none;pointer-events:none;width:100%}.ezplayer-icon-volume{position:relative}.ezplayer-icon-volume svg .ezplayer-icon-volume-high,.ezplayer-icon-volume svg .ezplayer-icon-volume-low,.ezplayer-icon-volume svg .ezplayer-icon-volume-muted{display:none}.ezplayer-icon-volume.ezplayer-icon-volume-high svg .ezplayer-icon-volume-high,.ezplayer-icon-volume.ezplayer-icon-volume-high svg .ezplayer-icon-volume-low,.ezplayer-icon-volume.ezplayer-icon-volume-low svg .ezplayer-icon-volume-low,.ezplayer-icon-volume.ezplayer-icon-volume-muted svg .ezplayer-icon-volume-muted,.ezplayer-icon-volume.ezplayer-icon-volume-zero svg .ezplayer-icon-volume-muted{display:inline}.ezplayer-volume-progress{height:126px}.ezplayer-control-rec{box-sizing:border-box;display:inline-flex;flex-direction:row}.ezplayer-control-rec .ezplayer-icon-cloud-rec,.ezplayer-control-rec .ezplayer-icon-cloud-record,.ezplayer-control-rec .ezplayer-icon-sdk{color:#d4d7dd;cursor:pointer;margin-left:5px}.ezplayer-mobile-extend .ezplayer-control-rec{background-color:#f4f6fc;border:1px solid #ededed;border-radius:18px;height:30px}.ezplayer-mobile-extend .ezplayer-icon-cloud-rec,.ezplayer-mobile-extend .ezplayer-icon-cloud-record,.ezplayer-mobile-extend .ezplayer-icon-sdk{cursor:pointer;font-size:20px;margin-left:1px;padding:2px 7px}.ezplayer-mobile-extend .ezplayer-icon-cloud-rec.ezplayer-active,.ezplayer-mobile-extend .ezplayer-icon-cloud-record.ezplayer-active,.ezplayer-mobile-extend .ezplayer-icon-sdk.ezplayer-active{background-color:#fff;border-radius:12px;box-shadow:0 1px 4px 0 hsla(0,0%,68%,.2)}.ezplayer-mobile .ezplayer-icon-cloud-rec,.ezplayer-mobile .ezplayer-icon-cloud-record,.ezplayer-mobile .ezplayer-icon-sdk{margin-left:10px}.ezplayer-more-panel{align-items:center;background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);cursor:default;display:flex;flex-direction:row;padding:8px 10px}.ezplayer-more .ezplayer-control{margin-left:var(--ezplayer-control-space,16px)}.ezplayer-more .ezplayer-control:first-child{margin-left:0}.ezplayer-medium-height .ezplayer-zoom-panel,.ezplayer-mini-height .ezplayer-zoom-panel{height:100%;padding-bottom:var(--ezplayer-footer-height,80px);padding-top:0}.ezplayer-mini-height .ezplayer-zoom-panel{padding-bottom:calc(var(--ezplayer-footer-height, 80px) - 20px)}.ezplayer-mini-height .ezplayer-progress-slider{display:none!important}.ezplayer-mini-height .ezplayer-progress-plus{padding-bottom:0}.ezplayer-mini-height .ezplayer-progress-minus{padding-top:0}.ezplayer-zoom-panel{bottom:0;display:inline-flex;flex-direction:column;height:100%;justify-content:flex-end;left:20px;padding-bottom:calc(var(--ezplayer-footer-height, 80px) + 20px);padding-top:10%;pointer-events:none;position:absolute;top:0;z-index:23}.ezplayer-zoom-panel .ezplayer-progress{height:200px;max-height:95%;pointer-events:auto}.ezplayer-mobile .ezplayer-zoom-panel{padding-bottom:calc(var(--ezplayer-mobile-footer-height, 54px) + 10px);padding-top:5%}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-zoom-panel{padding-bottom:var(--ezplayer-mobile-fullscreen-footer-height,110px);padding-top:var(--ezplayer-mobile-fullscreen-header-height,75px)}.ezplayer-icon-talk-growth-dot1,.ezplayer-icon-talk-growth-dot2,.ezplayer-icon-talk-growth-dot3,.ezplayer-icon-talk-growth-dot4{color:var(--ezplayer-default-color,#fff)}.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot1,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot2,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot3,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot4,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-high .ezplayer-icon-talk-growth-dot2,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-high .ezplayer-icon-talk-growth-dot3,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-high .ezplayer-icon-talk-growth-dot4,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-low .ezplayer-icon-talk-growth-dot4,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-normal .ezplayer-icon-talk-growth-dot3,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-normal .ezplayer-icon-talk-growth-dot4{color:var(--ezplayer-active-color,#407aff)}.ezplayer-record-timer{align-items:center;background-color:#ff4c5c;border-radius:24px;color:#fff;display:inline-flex;flex-direction:row;left:50%;padding:2px 6px;position:absolute;top:60px;transform:translateX(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}.ezplayer-record-timer .ezplayer-icon-record-circle{font-size:14px}.ezplayer-record-timer-time{font-weight:400;letter-spacing:1px;line-height:20px;margin-left:2px}.ezplayer-select-definition .ezplayer-select-panel{width:100px}.ezplayer-control-definition .ezplayer-select-btn{width:75px}.ezplayer-control-device{width:100%}.ezplayer-control-device span{display:inline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ezplayer-pause{bottom:0;color:#fff!important;cursor:pointer!important;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:3}.ezplayer-pause-circle{align-items:center;background-color:rgba(0,0,0,.4);border-radius:50%;cursor:pointer;display:flex;font-size:20px;height:50px;justify-content:center;transition:transform .3s ease,opacity 1s ease;width:50px}.ezplayer-pause-circle:hover{opacity:.85}.ezplayer-pause-circle .ezplayer-icon-pause,.ezplayer-pause-circle .ezplayer-icon-play{font-size:32px}.ezplayer-pause-transform .ezplayer-pause-circle{opacity:0;transform:scale(1.1)}.ez-ptz-container{background:hsla(0,0%,100%,.8);border:1px solid hsla(0,0%,100%,.8);border-radius:100%;box-shadow:0 0 33px 4px rgba(0,0,0,.15);cursor:pointer;font-size:14px;height:80px;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:80px}.ez-ptz-icon{display:inline-block;height:0;position:absolute;width:0}.ez-ptz-icon.ez-ptz-icon-icon-active{border-bottom-color:#407aff}.ez-ptz-direction-top{border-bottom:8px solid #999;top:2px}.ez-ptz-direction-bottom,.ez-ptz-direction-top{border-left:4px solid transparent;border-right:4px solid transparent;left:calc(50% - 4px)}.ez-ptz-direction-bottom{border-top:8px solid #999;bottom:2px}.ez-ptz-direction-right{border-left:8px solid #999;right:2px}.ez-ptz-direction-left,.ez-ptz-direction-right{border-bottom:4px solid transparent;border-top:4px solid transparent;top:calc(50% - 4px)}.ez-ptz-direction-left{border-right:8px solid #999;left:2px}.ez-ptz-direction-top-left{top:calc(25% - 4px)}.ez-ptz-direction-left-bottom,.ez-ptz-direction-top-left{background:#999;border-radius:50%;height:4px;left:16px;width:4px}.ez-ptz-direction-bottom-right,.ez-ptz-direction-left-bottom{bottom:calc(25% - 4px)}.ez-ptz-direction-bottom-right,.ez-ptz-direction-right-top{background:#999;border-radius:50%;height:4px;right:16px;width:4px}.ez-ptz-direction-right-top{top:calc(25% - 4px)}.ez-ptz-direction-center{background:#407aff;border-radius:100%;height:23px;left:calc(50% - 12.4px);position:absolute;top:calc(50% - 12.4px);width:23px}.ez-ptz-container-wrap{align-items:center;box-sizing:content-box!important;display:flex;flex-direction:column;justify-content:center;width:100%}.ez-ptz-speed-container{width:100%}.ez-ptz-speed-progress-line{background:#fff;display:flex;height:1px;justify-content:space-between;margin:16px 0 8px}.ez-ptz-speed-progress-line-dot{background:#fff;border:2px solid #fff;border-radius:50%;cursor:pointer;height:9px;margin:-3px 0;width:9px}.ez-ptz-speed-progress-line-dot.ez-ptz-speed-active{border-color:#407aff}.ez-ptz-speed-progress-points{display:flex;justify-content:space-between}.ez-ptz-speed-progress-points-fast,.ez-ptz-speed-progress-points-mid,.ez-ptz-speed-progress-points-slow{color:#fff;cursor:pointer}.ez-ptz-btn-container{display:flex;justify-content:space-between;margin-top:14px;width:100%}.ez-ptz-btn-focal,.ez-ptz-btn-zoom{border:1px solid hsla(0,0%,100%,.5);border-radius:10px;box-sizing:content-box;display:flex;height:20px;padding-bottom:0}.ez-ptz-btn-focal-add,.ez-ptz-btn-focal-sub,.ez-ptz-btn-zoom-add,.ez-ptz-btn-zoom-sub{cursor:pointer;height:20px;text-align:center}.ez-ptz-btn-focal-add,.ez-ptz-btn-zoom-add{border-right:1px solid hsla(0,0%,100%,.5)}.ez-mobile-ptz{box-sizing:border-box}.ez-mobile-ptz-content{align-items:center;display:flex;justify-content:center}.ez-mobile-ptz-wrap{background-image:linear-gradient(180deg,#f6f8ff,hsla(0,0%,93%,.42) 50%);border-radius:100%;box-sizing:border-box;display:inline-block;overflow:hidden;padding:24px}.ez-mobile-ptz-container{background:hsla(0,0%,100%,.8);border:1px solid hsla(0,0%,100%,.8);border-radius:100%;box-sizing:border-box;cursor:pointer;height:260px;margin:auto;overflow:hidden;position:relative;width:260px}.ez-mobile-ptz-center{background:#fff;border:2px solid #eee;border-radius:100%;cursor:pointer;height:52px;left:calc(50% - 26px);position:absolute;top:calc(50% - 26px);width:52px}.ez-mobile-ptz-top{border-bottom:6px solid #aaa;border-left:6px solid transparent;border-right:6px solid transparent;cursor:pointer;display:inline-block;height:0;left:calc(50% - 6px);position:absolute;top:10px;width:0}.ez-mobile-ptz-top.ez-mobile-ptz-active{border-bottom-color:#1890ff}.ez-mobile-ptz-left{border-bottom:6px solid transparent;border-right:6px solid #aaa;border-top:6px solid transparent;cursor:pointer;display:inline-block;height:0;left:10px;position:absolute;top:calc(50% - 6px);width:0}.ez-mobile-ptz-left.ez-mobile-ptz-active{border-right-color:#1890ff}.ez-mobile-ptz-bottom{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #aaa;bottom:10px;display:inline-block;height:0;left:calc(50% - 6px);position:absolute;width:0}.ez-mobile-ptz-bottom.ez-mobile-ptz-active{border-top-color:#1890ff}.ez-mobile-ptz-right{border-bottom:6px solid transparent;border-left:6px solid #aaa;border-top:6px solid transparent;display:inline-block;height:0;position:absolute;right:10px;top:calc(50% - 6px);width:0}.ez-mobile-ptz-right.ez-mobile-ptz-active{border-left-color:#1890ff}.ezplayer-medium-height .ezplayer-ptz-panel,.ezplayer-mini-height .ezplayer-ptz-panel{padding-bottom:0;padding-top:0;right:0;z-index:22}.ezplayer-medium-height .ezplayer-ptz-panel .ezplayer-ptz-turntable,.ezplayer-mini-height .ezplayer-ptz-panel .ezplayer-ptz-turntable{border-bottom-right-radius:0;border-top-right-radius:0;max-height:none}.ezplayer-mini-height .ez-ptz-btn-container,.ezplayer-mini-height .ez-ptz-speed-container{display:none!important}.ezplayer-ptz-panel{box-sizing:border-box;flex-direction:column;max-width:70%;padding-bottom:var(--ezplayer-footer-height,80px);padding-top:var(--ezplayer-header-height,46px);pointer-events:none;position:absolute;right:10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:150px;z-index:3}.ezplayer-ptz-panel,.ezplayer-ptz-panel .ezplayer-ptz-turntable{align-items:center;display:flex;height:100%;justify-content:center}.ezplayer-ptz-panel .ezplayer-ptz-turntable{background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);flex:1 1 auto;max-height:283px;padding:20px;pointer-events:auto;width:100%}.ezplayer-mobile .ezplayer-control-ptz,.ezplayer-mobile .ezplayer-ptz-panel{display:none}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-control-ptz,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-ptz-panel{display:inline-flex}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-ptz-panel{padding-bottom:calc(var(--ezplayer-mobile-fullscreen-footer-height, 110px) - 20px);padding-top:var(--ezplayer-mobile-fullscreen-header-height,75px)}.ezplayer-mobile.ezplayer-fullscreen.ezplayer-medium-height .ezplayer-ptz-panel,.ezplayer-mobile.ezplayer-fullscreen.ezplayer-mini-height .ezplayer-ptz-panel{padding-bottom:0;padding-top:0}.ezplayer-mobile-extend .ezplayer-mobile-date-filter{align-items:center;background:#f4f6fc;border:1px solid #ededed;border-radius:8px;box-sizing:border-box;color:#2c2c2c;display:inline-flex;font-family:PingFang SC;font-size:16px;font-weight:500;height:36px;justify-content:center;letter-spacing:0;line-height:20px;padding:6px 10px}.ezplayer-mobile-extend .ezplayer-mobile-date-filter-value{margin-right:5px}.ezplayer-mobile-extend .ezplayer-icon-filter{font-size:20px}.ezplayer-control-time-line{overflow:hidden;padding-right:40px;position:relative}.ezplayer-control-time-line .ezplayer-time-line-scale-add,.ezplayer-control-time-line .ezplayer-time-line-scale-sub{align-items:center;background-color:#333;border-radius:2px;color:var(--ezplayer-default-color,#fff);cursor:pointer;display:inline-flex;height:14px;justify-content:center;overflow:hidden;position:absolute;right:0;transition:color .3s ease;width:14px}.ezplayer-control-time-line .ezplayer-icon-add,.ezplayer-control-time-line .ezplayer-icon-reduce{font-size:12px;font-weight:500}.ezplayer-control-time-line .ezplayer-icon-add:hover,.ezplayer-control-time-line .ezplayer-icon-reduce:hover{color:var(--ezplayer-primary-color,#407aff)}.ezplayer-control-time-line .ezplayer-time-line-scale-add{top:2px}.ezplayer-control-time-line .ezplayer-time-line-scale-sub{bottom:2px}.ezplayer-mobile-extend .ezplayer-control-time-line{display:block;height:300px;margin-top:10px;padding-right:0}');var m,A={exports:{}};var f,v,g=(m||(m=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,r,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,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,i),!0;case 4:return d.fn.call(d.context,t,i,r),!0;case 5:return d.fn.call(d.context,t,i,r,o),!0;case 6:return d.fn.call(d.context,t,i,r,o,a),!0}for(c=1,l=new Array(u-1);c<u;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var p,h=d.length;for(c=0;c<h;c++)switch(d[c].once&&this.removeListener(e,d[c].fn,void 0,!0),u){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,t);break;case 3:d[c].fn.call(d[c].context,t,i);break;case 4:d[c].fn.call(d[c].context,t,i,r);break;default:if(!l)for(p=1,l=new Array(u-1);p<u;p++)l[p-1]=arguments[p];d[c].fn.apply(d[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,c=[],d=s.length;l<d;l++)(s[l].fn!==t||r&&!s[l].once||i&&s[l].context!==i)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}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 i,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}(A)),A.exports),y=h(g);function T(){if(v)return f;function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function t(t,n){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,n){if(t){if("string"==typeof t)return e(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(i):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}(t))||n){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}v=1;var n=function(){function e(){this.pickers=[]}var n=e.prototype;return n.add=function(e){this.pickers.push(e)},n.remove=function(e){var t=this.pickers.indexOf(e);t>-1?this.pickers.splice(t,1):console.warn("Picker not found in the provider.")},n.closeOther=function(e){for(var n,i=t(this.pickers);!(n=i()).done;){var r,o,a,s,l=n.value;!l||e.target===l.$container||(null==(o=l.$container)||null==(r=o.contains)?void 0:r.call(o,e.target))||e.target===l.$wrapperContent||(null==(s=l.$wrapperContent)||null==(a=s.contains)?void 0:a.call(s,e.target))||(l.open=!1)}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),i=n.getInstance();function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}var o=["top","tl","tr","bottom","bl","br"],a="epicker",s={getPopupContainer:function(){return document.body},wrapClassName:"",open:!1,placement:"br",offset:[0,0],zIndex:1e3,content:"",trigger:"click",mouseLeaveDelay:.1,mouseEnterDelay:.1,isMobile:!1},l=function(){function e(e,t){var n,r;this._open=!1,this._OpenChange=!1,this._animationTimer=null,this._disabled=!1,this._timer=null,this._options=Object.assign({},s,t||{}),this._options.isMobile&&(this._options.trigger="click"),i.add(this),this.$container="function"==typeof e?e():e,this.$wrapperContent=document.createElement("div"),this._initContentStyle(),"function"==typeof this._options.getPopupContainer?this._$popupContainer=this._options.getPopupContainer():this._$popupContainer=document.body,["INPUT","CANVAS","VIDEO","IMG"].includes(null==(n=this._$popupContainer)?void 0:n.tagName)&&(console.warn("popup container node does not support child elements, default body!"),this._$popupContainer=document.body),this._$popupContainer!==document.body&&(this._$popupContainer.style.position="relative"),null==(r=this._$popupContainer)||r.appendChild(this.$wrapperContent),this._onContentClick=this._onContentClick.bind(this),this._onShow=this._onShow.bind(this),this._onWrapperShow=this._onWrapperShow.bind(this),this._onHide=this._onHide.bind(this),this._onDocumentClick=this._onDocumentClick.bind(this),this._eventListener(),this.open=!!this._options.open}var t=e.prototype;return t.setPlacement=function(e){this._disabled||(o.includes(e)?this._options.placement=e:console.warn(e+" is not a valid placement"),this._setPlacement())},t.destroy=function(){this._animationTimerClear(),this._removeHtml(),i.remove(this)},t.innerHTML=function(e){this.$body&&(this.$body.innerHTML=e||"",this._setPlacement())},t._onOpenChange=function(e){null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,!!e)},t._animationTimerClear=function(){this._animationTimer&&(clearTimeout(this._animationTimer),this._animationTimer=null)},t._removeHtml=function(){var e,t,n,i,r,o,s,l,c,d,u,p,h;(null==(e=this.$wrapperContent)||e.removeEventListener("click",this._onContentClick),null==(n=this.$container)||null==(t=n.removeEventListener)||t.call(n,"click",this._onContentClick),"click"===this._options.trigger&&(null==(r=this.$container)||null==(i=r.removeEventListener)||i.call(r,"click",this._onShow)),"hover"===this._options.trigger)&&(null==(s=this.$container)||null==(o=s.removeEventListener)||o.call(s,"mouseenter",this._onShow),null==(c=this.$container)||null==(l=c.removeEventListener)||l.call(c,"mouseover",this._onShow),null==(u=this.$container)||null==(d=u.removeEventListener)||d.call(u,"mouseleave",this._onHide),null==(p=this.$wrapperContent)||p.removeEventListener("mouseenter",this._onWrapperShow),null==(h=this.$wrapperContent)||h.removeEventListener("mouseleave",this._onHide));this._options.isMobile||(window.removeEventListener("blur",this._onHide),document.removeEventListener("visibilitychange",this._onHide),window.removeEventListener("resize",this._onHide),document.removeEventListener("click",this._onDocumentClick)),this._$mask&&(this._$mask.removeEventListener("click",this._onHide),this._$mask.remove(),this._$mask=null),this._options.isMobile&&document.body.classList.remove(a+"-body-noscroll"),this.$wrapperContent&&(this.$wrapperContent.remove(),this.$wrapperContent=null)},t._setPlacement=function(){var e,t;if(this._open&&!this._options.isMobile&&this.$container){var n,i=null==(t=this.$container)||null==(e=t.getBoundingClientRect)?void 0:e.call(t),r=this.$wrapperContent.getBoundingClientRect(),o=this._$popupContainer.getBoundingClientRect(),a=i.left-o.left,s=-(i.right-o.right),l=i.y-o.y,c=a+(i.width-r.width)/2,d=l-r.height,u=l+i.height;if(/^t/.test(this._options.placement)){var p,h,m;switch(this._options.placement){case"top":n=void 0;break;case"tl":n=void 0,c=a;break;case"tr":c=void 0,n=s}this.$wrapperContent.style.cssText+="\n "+(void 0!==n?"right: "+(n+((null==(p=this._options.offset)?void 0:p[0])||0))+"px;":"")+"\n "+(void 0!==c?"left: "+(c+((null==(h=this._options.offset)?void 0:h[0])||0))+"px;":"")+"\n top: "+(d+((null==(m=this._options.offset)?void 0:m[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n "}else if(/^b/.test(this._options.placement)){var A,f,v;switch(this._options.placement){case"bottom":n=void 0;break;case"bl":n=void 0,c=a;break;case"br":c=void 0,n=s}this.$wrapperContent&&(this.$wrapperContent.style.cssText+="\n "+(void 0!==n?"right: "+(n+((null==(A=this._options.offset)?void 0:A[0])||0))+"px;":"")+"\n "+(void 0!==c?"left: "+(c+((null==(f=this._options.offset)?void 0:f[0])||0))+"px;":"")+"\n top: "+(u+((null==(v=this._options.offset)?void 0:v[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n ")}}},t._initContentStyle=function(){if(this.$wrapperContent&&(this.$wrapperContent.classList.add(""+a,a+"-wrapper",a+"-"+this._options.placement),this.$wrapperContent.style.display="none",this._options.isMobile&&(this.$wrapperContent.classList.add(a+"-mobile"),this._$mask=document.createElement("div"),this._$mask.classList.add(a+"-mask"),this.$wrapperContent.appendChild(this._$mask)),this.$body=document.createElement("div"),this.$body.classList.add(a+"-body"),this.$wrapperContent.appendChild(this.$body),"string"==typeof this._options.content?this.innerHTML(this._options.content):"function"==typeof this._options.content&&this.innerHTML(null==this._options.content?void 0:this._options.content.call(this._options)),"string"==typeof this._options.wrapClassName))try{var e,t;null==(t=this.$wrapperContent)||(e=t.classList).add.apply(e,[].concat(this._options.wrapClassName.split(" ")))}catch(e){}},t._eventListener=function(){var e,t,n,i,r,o,a,s,l,c;(this.$wrapperContent.addEventListener("click",this._onContentClick),null==(t=this.$container)||null==(e=t.addEventListener)||e.call(t,"click",this._onContentClick),"click"===this._options.trigger&&(null==(i=this.$container)||null==(n=i.addEventListener)||n.call(i,"click",this._onShow)),"hover"===this._options.trigger)&&(null==(o=this.$container)||null==(r=o.addEventListener)||r.call(o,"mouseenter",this._onShow),null==(s=this.$container)||null==(a=s.addEventListener)||a.call(s,"mouseover",this._onShow),null==(c=this.$container)||null==(l=c.addEventListener)||l.call(c,"mouseleave",this._onHide),this.$wrapperContent.addEventListener("mouseenter",this._onWrapperShow),this.$wrapperContent.addEventListener("mouseleave",this._onHide));this._$mask&&this._$mask.addEventListener("click",this._onHide),this._options.isMobile||(window.addEventListener("blur",this._onHide),document.addEventListener("visibilitychange",this._onHide),window.addEventListener("resize",this._onHide),document.addEventListener("click",this._onDocumentClick))},t._onContentClick=function(e){i.closeOther(e)},t._onShow=function(){this._disabled||(this.open=!0)},t._onWrapperShow=function(){this._disabled||this._onShow()},t._onHide=function(e){this._open&&!this._disabled&&((null==e?void 0:e.target)===this._$mask&&(null==e||e.stopPropagation()),this.open=!1)},t._onDocumentClick=function(e){var t;if(!this.$wrapperContent.contains(e.target)&&this.$wrapperContent!==e.target&&!(null==(t=this.$container)?void 0:t.contains(e.target))&&this.$container!==e.target){if(this._disabled)return;this._onHide()}},r(e,[{key:"open",get:function(){return this._open},set:function(e){var t=this;this._disabled||this._open!==!!e&&(this._animationTimerClear(),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=e?setTimeout((function(){t.$wrapperContent&&(t.$wrapperContent.style.display="inline-flex",t.$wrapperContent.style.pointerEvents="",t._options.isMobile&&document.body.classList.add(a+"-body-noscroll"),t._animationTimer=setTimeout((function(){t._animationTimerClear(),t.$wrapperContent.style.opacity="1"}),0),requestAnimationFrame((function(){t._setPlacement()})),t._OpenChange=e,t._onOpenChange(e))}),1e3*(this._options.mouseEnterDelay<0?0:this._options.mouseEnterDelay)):setTimeout((function(){t.$wrapperContent&&(t.$wrapperContent.style.opacity="0",t.$wrapperContent.style.pointerEvents="none",t._options.isMobile&&document.body.classList.remove(a+"-body-noscroll"),t._animationTimer=setTimeout((function(){t._animationTimerClear(),t.$wrapperContent.style.display="none"}),301),t._OpenChange=e,t._onOpenChange(e))}),1e3*(this._options.mouseLeaveDelay<0?0:this._options.mouseLeaveDelay)),this._OpenChange===e&&this._timer&&(clearTimeout(this._timer),this._timer=null),this._open=!!e)}},{key:"disabled",get:function(){return this._disabled},set:function(e){var t,n,i,r,o,s;e?null==(i=this.$container)||null==(n=i.classList)||null==(t=n.add)||t.call(n,a+"-disabled"):null==(s=this.$container)||null==(o=s.classList)||null==(r=o.remove)||r.call(o,a+"-disabled");this._disabled=e}}]),e}();return l.VERSION="1.1.5",f=l}var _,b,C=h(T());function S(){if(b)return _;b=1;if("undefined"!=typeof Element&&!Element.prototype.matches){const e=Element.prototype;e.matches=(null==e?void 0:e.matchesSelector)||(null==e?void 0:e.mozMatchesSelector)||(null==e?void 0:e.msMatchesSelector)||(null==e?void 0:e.oMatchesSelector)||(null==e?void 0:e.webkitMatchesSelector)}var e="function"==typeof Element.prototype.closest?function(e,t){return e&&e.closest(t)}:function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}return null};function t(e,t,i,r,o){const a=n.apply(this,arguments);return e.addEventListener(i,a,o),{destroy:function(){e.removeEventListener(i,a,o)}}}function n(t,n,i,r){return function(i){i.delegateTarget=e(i.target,n),i.delegateTarget&&r.call(t,i)}}return _=function(e,n,i,r,o){return"function"==typeof e.addEventListener?t.apply(null,arguments):"function"==typeof i?t.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return t(e,n,i,r,o)})))},_}var E,w,k,P=h(S()),D={};function L(){if(w)return E;function e(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}w=1;var t={content:"",width:"100%",height:"400px",readonly:!1,hideScrollbar:!1},n="drag-scroll";return E=function(){function i(e,i){if(void 0===i&&(i={}),this._indicatorTimeout=null,this._$scrollbar=null,this._$scrollbarThumb=null,this._readonly=!1,!e)throw new Error("container is required");if(["VIDEO","CANVAS","IMG","TEXTAREA","INPUT"].includes(e.tagName))throw new Error("container cannot be 'VIDEO', 'CANVAS', 'IMG', 'TEXTAREA', 'INPUT' element");this.$container=e,this.options=Object.assign({},t,i),this.$container.classList.add(n,n+"-container"),this.$content=document.createElement("div"),this.$content.classList.add(n+"-content"),this.innerHtml(this.options.content),this.$container.appendChild(this.$content),this.isDragging=!1,this._startY=0,this.currentY=0,this.velocity=0,this._animationId=null,this._lastTimestamp=0,this._spring=.25,this._friction=.92,this._bounceDamping=.6,this._maxVelocity=30,this.options.hideScrollbar||this._renderScrollbar(),this._onMouseDown=this._onMouseDown.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this.readonly=this.options.readonly,this._init()}var r=i.prototype;return r.resize=function(e,t){var n="";/^\d+(\.\d+)?$/.test(e+"")?n="width: "+e+"px;":"string"==typeof e&&(n="width: "+e+";"),/^\d+(\.\d+)?$/.test(t+"")?n+="height: "+t+"px;":"string"==typeof t&&(n+="height: "+t+";"),this.$container.style.cssText+=n,this._applyTransform()},r.innerHtml=function(e){this.$content.innerHTML="function"==typeof e?e():e,this._applyTransform()},r.scrollToY=function(e,t){void 0===t&&(t=!0);var n=this.$content.scrollHeight-this.$container.clientHeight;e<0||e>n||(this.currentY=e,this.velocity=0,this._applyTransform(),t&&this._updateState())},r.destroy=function(){var e,t,n;this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=null),this._indicatorTimeout&&(clearTimeout(this._indicatorTimeout),this._indicatorTimeout=null),this.$container&&(this.$container.style.cursor="default"),null==(e=this._$scrollbarThumb)||e.remove(),this._$scrollbarThumb=null,null==(t=this._$scrollbar)||t.remove(),this._$scrollbar=null,null==(n=this.$content)||n.remove(),this.$content=null,this._removeEventListeners()},r._renderScrollbar=function(){this._$scrollbar=document.createElement("div"),this._$scrollbar.className=n+"-scrollbar",this._$scrollbarThumb=document.createElement("div"),this._$scrollbarThumb.className=n+"-scrollbar-thumb",this._$scrollbar.appendChild(this._$scrollbarThumb),this.$container.appendChild(this._$scrollbar)},r._init=function(){this.resize(this.options.width,this.options.height),this._addEventListeners(),this._updateScrollbar(),this._animationId=requestAnimationFrame(this._animate.bind(this))},r._addEventListeners=function(){this.$container.addEventListener("pointerdown",this._onMouseDown),document.addEventListener("pointermove",this._onMouseMove),document.addEventListener("pointerup",this._onMouseUp),document.addEventListener("pointercancel",this._onMouseUp)},r._removeEventListeners=function(){this.$container.removeEventListener("touchmove",this._onTouchMove),this.$container.removeEventListener("pointerdown",this._onMouseDown),document.removeEventListener("pointermove",this._onMouseMove),document.removeEventListener("pointerup",this._onMouseUp),document.removeEventListener("pointercancel",this._onMouseUp)},r._onMouseDown=function(e){this.canDrag&&(this._startDrag(e.clientY),null==this.options.onDragStart||this.options.onDragStart.call(this.options,e))},r._onTouchMove=function(e){e.preventDefault()},r._startDrag=function(e){var t,i;this.canDrag&&(this.isDragging=!0,this._startY=e,this.velocity=0,null==(i=this._$scrollbar)||null==(t=i.classList)||t.add(n+"-show"),this.$container.style.cursor="grabbing")},r._onMouseMove=function(e){this.canDrag&&this.isDragging&&(this._drag(e.clientY),null==this.options.onDragging||this.options.onDragging.call(this.options,0,this.currentY))},r._drag=function(e){if(this.canDrag){var t=this._startY-e;this._startY=e,this.currentY+=t,this.velocity=t,this.velocity=Math.max(Math.min(this.velocity,this._maxVelocity),-this._maxVelocity),this._applyTransform(),this._updateState()}},r._onMouseUp=function(e){this.canDrag&&this.isDragging&&(this.isDragging=!1,this._endDrag(),null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,e))},r._endDrag=function(){var e=this;this.$container.style.cursor="grab",setTimeout((function(){var t;e.isDragging||null==(t=e._$scrollbar)||t.classList.remove(n+"-show")}),1500)},r._applyTransform=function(){if(this.$content.offsetHeight<=this.$container.clientHeight)this.$content.style.transform="translate3d(0, 0, 0)";else{var e=this.$content.scrollHeight-this.$container.clientHeight;this.currentY<0?(this.currentY=0,this.velocity*=this._bounceDamping):this.currentY>e&&(this.currentY=e,this.velocity*=this._bounceDamping),this.$content.style.transform="translate3d(0, "+-this.currentY+"px, 0)",this._updateScrollbar()}},r._animate=function(e){if(void 0===e&&(e=0),this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=null),!(this.$content.offsetHeight<=this.$container.clientHeight)){this._lastTimestamp||(this._lastTimestamp=e);var t=Math.min(e-this._lastTimestamp,100)/16;if(this._lastTimestamp=e,!this.isDragging){this.velocity*=this._friction,this.currentY+=this.velocity;var n=this.$content.scrollHeight-this.$container.clientHeight;this.currentY<0?this.velocity-=this.currentY*this._spring*t:this.currentY>n&&(this.velocity-=(this.currentY-n)*this._spring*t),this._applyTransform(),this._updateState(),Math.abs(this.velocity)<.1&&this.currentY>=0&&this.currentY<=n&&(this.velocity=0)}}},r._updateScrollbar=function(){var e=this.$container.clientHeight,t=this.$content.scrollHeight,n=t-e;if(n<=0)this._$scrollbarThumb&&(this._$scrollbarThumb.style.height="0");else{var i=Math.max(e/t*e,20),r=this.currentY/n*(e-i);this._$scrollbarThumb&&(this._$scrollbarThumb.style.height=i+"px",this._$scrollbarThumb.style.transform="translateY("+r+"px)")}},r._updateState=function(){null==this.options.onChange||this.options.onChange.call(this.options,{x:0,y:this.currentY,velocity:+this.velocity.toFixed(1)})},e(i,[{key:"width",get:function(){return this.$container.clientWidth}},{key:"height",get:function(){return this.$container.clientHeight}},{key:"readonly",get:function(){return this._readonly},set:function(e){this._readonly!==e&&(this.$container.style.cursor=e?"not-allowed":"grab",this._readonly=e),this.$container.removeEventListener("touchmove",this._onTouchMove),e||this.$container.addEventListener("touchmove",this._onTouchMove,{passive:!1})}},{key:"canDrag",get:function(){var e=this.$content.offsetHeight;return!this.readonly&&e>this.$container.clientHeight}}]),i}()}
7
+ import"abortcontroller-polyfill";import"formdata-polyfill";import deepmerge from"deepmerge";import require$$1$1,{isMobile as isMobile$1,parseEzopenUrl,switchEzopenUrl,getStaticPath}from"@ezuikit/utils-tools";import screenfull from"screenfull";import require$$1 from"@ezuikit/utils-i18n";import Logger from"@ezuikit/utils-logger";import debounce$1 from"debounce-promise";import CollectUtils from"@ezuikit/utils-collect";import JsPlugin from"@ezuikit/player-ezopen/dist/adapter.js";import delegate$1 from"delegate";function getDefaultExportFromCjs$1(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}!function(css,ref){void 0===ref&&(ref={});var insertAt=ref.insertAt;if("undefined"!=typeof document){var head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css","top"===insertAt&&head.firstChild?head.insertBefore(style,head.firstChild):head.appendChild(style),style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css))}}(':root{--ezplayer-default-color:#fff;--ezplayer-primary-color:#407aff;--ezplayer-active-color:var(--ezplayer-primary-color,#407aff);--ezplayer-disabled-color:#aaa;--ezplayer-font-size:14px;--ezplayer-icon-font-size:24px;--ezplayer-btn-height:var(--ezplayer-icon-font-size,24px);--ezplayer-border-radius:8px;--ezplayer-control-space:16px;--ezplayer-header-height:46px;--ezplayer-footer-height:80px;--ezplayer-fullscreen-control-space:26px;--ezplayer-panel-bg-color:rgba(0,0,0,.7);--ezplayer-mobile-control-space:16px;--ezplayer-mobile-header-height:45px;--ezplayer-mobile-footer-height:54px;--ezplayer-mobile-fullscreen-header-height:75px;--ezplayer-mobile-fullscreen-footer-height:110px;--ezplayer-mobile-fullscreen-control-space:26px;--ezplayer-mobile-extend-bg-color:#f5f7fa;--ezplayer-mobile-extend-default-color:#2c2c2c}body.ezplayer-body-mobile-noscroll{background-color:#000!important;height:100vh;overflow:hidden;touch-action:none}.ezplayer,.ezplayer-mobile-extend{background-color:#000;box-sizing:border-box;color:var(--ezplayer-default-color,#fff);display:flex;flex-direction:column;font-size:14px;font-size:var(--ezplayer-font-size,14px);padding:0;position:relative;--webkit-tap-highlight-color:transparent;outline:none}.ezplayer *,.ezplayer-mobile-extend *{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ezplayer:-webkit-full-screen{height:100%!important;width:100%!important}.ezplayer *{box-sizing:border-box}.ezplayer li,.ezplayer ul{box-sizing:border-box;list-style:none;margin:0;padding:0}.ezplayer-control{align-items:center;cursor:pointer;display:inline-flex;justify-content:center}.ezplayer-control-block,.ezplayer-control-text{cursor:unset}.ezplayer-control-block{align-items:center;box-sizing:border-box;color:var(--ezplayer-default-color,#fff);display:flex;flex-direction:column;justify-content:center;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ezplayer-btn,.ezplayer-icon,.ezplayer-text{display:inline-flex;transition:color .2s ease-in-out}.ezplayer-btn{cursor:pointer}.ezplayer-btn,.ezplayer-text{font-size:var(--ezplayer-font-size,14px)}.ezplayer-btn{align-items:center;border:1px solid var(--ezplayer-default-color,#fff);border-radius:12px;border-radius:calc(var(--ezplayer-btn-height, 24px)/2);display:inline-flex;height:var(--ezplayer-btn-height,26px);justify-content:center;padding:2px 10px;white-space:nowrap}.ezplayer-active{border-color:var(--ezplayer-active-color,#0099e5)!important;color:var(--ezplayer-active-color,#0099e5)!important}.ezplayer-disabled,.ezplayer-disabled .ezplayer-btn,.ezplayer-disabled .ezplayer-icon,.ezplayer-disabled .ezplayer-text{border-color:var(--ezplayer-disabled-color,#aaa)!important;color:var(--ezplayer-disabled-color)!important;cursor:not-allowed!important}.ezplayer-hide{display:none!important}.ezplayer-hide-transition{opacity:0!important;pointer-events:none!important}.ezplayer-overflow-hidden{overflow:hidden}.ezplayer-global-fullscreen .ezplayer-footer,.ezplayer-global-fullscreen .ezplayer-header,.ezplayer-global-fullscreen .ezplayer-rec-footer{display:none}.ezplayer-mobile .ezplayer-control-global-fullscreen{display:none!important}.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-0,.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-180{background-color:#000!important;bottom:0!important;height:100vw!important;height:var(--ezplayer-mobile-inner-width,100vw)!important;left:0!important;overflow:hidden;padding-right:env(safe-area-inset-bottom);position:fixed!important;right:0!important;top:0!important;transform:rotate(90.001deg) translateY(-100%)!important;-webkit-transform:rotate(90.001deg) translateY(-100%)!important;transform-origin:0 0!important;-webkit-transform-origin:0 0!important;width:100vh!important;width:var(--ezplayer-mobile-inner-height,100vh)!important;z-index:9999}.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-270,.ezplayer-mobile.ezplayer-fullscreen.ezplayer-angle-90{background-color:#000!important;bottom:0!important;height:100vh!important;height:var(--ezplayer-mobile-inner-height,100vh)!important;left:0!important;overflow:hidden;position:fixed!important;right:0!important;top:0!important;transform:rotate(0deg) translateY(0)!important;-webkit-transform:rotate(0deg) translateY(0)!important;transform-origin:0 0!important;-webkit-transform-origin:0 0!important;width:100vw!important;width:var(--ezplayer-mobile-inner-width,100vw)!important;z-index:9999}.ezplayer-footer,.ezplayer-header{align-items:center;box-sizing:border-box;color:var(--ezplayer-default-color,#fff);display:flex;flex-wrap:nowrap;font-size:24px;justify-content:space-between;left:0;opacity:1;position:absolute;right:0;transition:opacity .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:20}.ezplayer-footer-left,.ezplayer-footer-right,.ezplayer-header-left,.ezplayer-header-right{display:inline-flex;flex-direction:row;flex-wrap:nowrap}.ezplayer-footer-left,.ezplayer-header-left{padding-left:20px}.ezplayer-footer-left .ezplayer-control,.ezplayer-header-left .ezplayer-control{margin-right:16px}.ezplayer-footer-left .ezplayer-control:last-child,.ezplayer-header-left .ezplayer-control:last-child{margin-right:0!important}.ezplayer-footer-right,.ezplayer-header-right{padding-right:20px}.ezplayer-footer-right .ezplayer-control,.ezplayer-header-right .ezplayer-control{margin-left:16px}.ezplayer-footer-right .ezplayer-control:first-child,.ezplayer-header-right .ezplayer-control:first-child{margin-left:0!important}.ezplayer-footer .ezplayer-control,.ezplayer-header .ezplayer-control{padding:2px}.ezplayer-footer .ezplayer-control-text+.ezplayer-control-text,.ezplayer-header .ezplayer-control-text+.ezplayer-control-text{margin-left:8px}.ezplayer-footer-more,.ezplayer-header-more{align-items:center;display:flex;flex-direction:row}.ezplayer-header{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAuCAMAAADeMYNYAAAAbFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0Iv+qAAAAJHRSTlOBdGtiTDoxGxIJy8bCvbm0sKyno56alZGMiHtbV1JFQSomIQDNbq/TAAAAPklEQVQI1xXBhQHAIAAEsau7uwv778iTkFNQUlHT0NLRMzAyMbOwsuHseOproAcnF6HePEQa68vHT6KpZmosd8UCpGNSKboAAAAASUVORK5CYII=");box-sizing:border-box;height:46px;margin:0;top:0}.ezplayer-header-left,.ezplayer-header-right{max-width:50%}.ezplayer-control-rec .ezplayer-icon:first-child{margin-left:0}.ezplayer-footer{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABQCAQAAAByztdQAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAd0SU1FB+kGBAsQDlySUqoAAAABb3JOVAHPoneaAAAAHElEQVQI12NgYGRiYGZiYGJiYEZiYJLECw5q9QCpgAFr/pGonwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNS0wNi0wNFQxMToxNTo1OCswMDowMBLJutIAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjUtMDYtMDRUMTE6MTU6NTgrMDA6MDBjlAJuAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI1LTA2LTA0VDExOjE2OjE0KzAwOjAwnFz8PAAAAABJRU5ErkJggg==");bottom:0;box-sizing:border-box;height:80px;margin:0;padding-top:20px}.ezplayer-mobile .ezplayer-footer,.ezplayer-mobile .ezplayer-header{font-size:24px}.ezplayer-mobile .ezplayer-footer-left .ezplayer-control,.ezplayer-mobile .ezplayer-footer-right .ezplayer-control,.ezplayer-mobile .ezplayer-header-left .ezplayer-control,.ezplayer-mobile .ezplayer-header-right .ezplayer-control{height:24px;padding:0}.ezplayer-mobile .ezplayer-footer-left,.ezplayer-mobile .ezplayer-header-left{padding-left:15px}.ezplayer-mobile .ezplayer-footer-left .ezplayer-control,.ezplayer-mobile .ezplayer-header-left .ezplayer-control{margin-right:15px}.ezplayer-mobile .ezplayer-footer-right,.ezplayer-mobile .ezplayer-header-right{padding-right:15px}.ezplayer-mobile .ezplayer-footer-right .ezplayer-control,.ezplayer-mobile .ezplayer-header-right .ezplayer-control{margin-left:15px}.ezplayer-mobile .ezplayer-footer .ezplayer-control,.ezplayer-mobile .ezplayer-header .ezplayer-control{height:24px;min-width:24px}.ezplayer-mobile .ezplayer-footer .ezplayer-control-text,.ezplayer-mobile .ezplayer-header .ezplayer-control-text{font-size:14px}.ezplayer-mobile .ezplayer-header{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAtCAMAAACzkkr1AAAAV1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOl5NtAAAAHXRSTlOWj4JzaV9YUUQ9MywlGxQKioZ8eW9kTUk4IA8FAKPHi9EAAABMSURBVAjXJcKFDcAwAAOwjKHM+P+dUzTL+C0LWwvnsK7sPULAtnGM2HdOCcfB58nXxTmjFNw3Pw/XivdlIVhKbg1KsdbcO4zhMTDnB9pJBB0jNaXIAAAAAElFTkSuQmCC");background:linear-gradient(180deg,rgba(0,0,0,.6),transparent);height:45px;margin:0;padding:0}.ezplayer-mobile .ezplayer-footer{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAA2CAQAAABHVIAUAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAd0SU1FB+kHGQYOGOvM7YUAAAABb3JOVAHPoneaAAAAFUlEQVQY02NkYGRgYGFgxkUwjShZAMFnAW71uqvOAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI1LTA3LTI1VDA2OjE0OjAwKzAwOjAwy873zwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNS0wNy0yNVQwNjoxNDowMCswMDowMLqTT3MAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjUtMDctMjVUMDY6MTQ6MjQrMDA6MDBb7E3CAAAAAElFTkSuQmCC");background:linear-gradient(180deg,transparent,rgba(0,0,0,.6));height:54px;padding-top:0}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAABLCAQAAADw6J4LAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAD/h4/MvwAAAAd0SU1FB+kHGQYYHh43/WcAAAABb3JOVAHPoneaAAAAKUlEQVQY02NkOM3AwMLwF5X4h5dLOyXD13JmBiaG/8wMjAz/GRkYGRgADI9KMQ6gLKQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjUtMDctMjVUMDY6MjQ6MTQrMDA6MDBqybVDAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI1LTA3LTI1VDA2OjI0OjE0KzAwOjAwG5QN/wAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNS0wNy0yNVQwNjoyNDozMCswMDowMPrrD04AAAAASUVORK5CYII=");background:linear-gradient(180deg,rgba(0,0,0,.8),transparent);height:75px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAABuCAMAAAA6XjI3AAAAaVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnbPKNAAAAI3RSTlMAQrRXSTozKxUHxb+spqCNh4F1ZVAgDbqTenBqJRvKm5dgXO7N8BQAAABzSURBVBjThcRFDsQwFATRH2Z2mHP/Q447bmuWKT2VfJdIYg0DxTHt2g59T9sGUSQRDmFoBRJYjvPn+6SUKHNPPOt54L6h62hdYdEWaFuaZ2gaacxrqV9VJZX5JNPruuA8oSypKCjPyXVp1EbIMkpTOg7tB7gTDCt3nEtMAAAAAElFTkSuQmCC");background:linear-gradient(180deg,transparent 9%,rgba(0,0,0,.8));height:110px;padding-top:18px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-left,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-left{padding-left:50px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-left .ezplayer-control,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-left .ezplayer-control{margin-right:30px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-right,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-right{padding-right:50px}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-footer-right .ezplayer-control,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-header-right .ezplayer-control{margin-left:30px}.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-footer-left .ezplayer-control,.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-header-left .ezplayer-control{margin-right:26px}.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-footer-right .ezplayer-control,.ezplayer-fullscreen:not(.ezplayer-mobile) .ezplayer-header-right .ezplayer-control{margin-left:26px}.ezplayer-content{align-items:center;justify-content:center}.ezplayer-content,.ezplayer-content-wrapper{box-sizing:border-box;display:flex;flex:1 1 auto;height:100%;margin:0;outline:none;overflow:hidden;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:0}.ezplayer-content-wrapper{background-color:#000}.ezplayer-content-video{align-items:center;box-sizing:border-box;display:flex;flex:1 1 auto;height:100%;justify-content:center;margin:0;outline:none;padding:0;width:100%}.ezplayer-mobile-extend{background-color:#639;background-color:var(--ezplayer-mobile-extend-bg-color,#f5f7fa);color:var(--ezplayer-mobile-extend-default-color,#2c2c2c);display:flex;flex-direction:column}.ezplayer-mobile-extend-controls{background-color:#639;display:flex;height:66px;justify-content:space-around}.ezplayer-mobile-extend-controls .ezplayer-control{width:75px}.ezplayer-mobile-extend-control-panel{align-items:center;display:flex;flex-direction:column;min-height:390px}.ezplayer-mobile-extend-control-top{align-items:center;display:flex;height:36px;justify-content:space-between;padding-top:10px}.ezplayer-mobile-extend-control-top-left{display:inline-flex;padding-left:15px}.ezplayer-mobile-extend-control-top-right{display:inline-flex;justify-content:flex-end;padding-right:15px}.ezplayer-mobile-extend-control-content{display:flex;flex:1 1 auto;flex-direction:column;width:100%}.ezplayer-rec-footer{background-color:#000;box-sizing:border-box;display:block;height:36px;position:relative}.ezplayer-rec-footer-has-date-picker{padding-right:56px}.ezplayer-rec-footer-time-line{height:36px;overflow:hidden;width:100%}.ezplayer-rec-footer-date-picker{align-items:center;display:flex;height:36px;justify-content:flex-end;padding-right:20px;position:absolute;right:0;top:0;width:56px}.ezplayer-rec-footer-date-picker .ezplayer-icon-date{font-size:20px;margin-top:-5px}.drag-scroll{box-sizing:border-box;margin:0;padding:0}.drag-scroll-container{cursor:grab;height:450px;overflow:hidden;position:relative;-webkit-tap-highlight-color:transparent}.drag-scroll-container,.drag-scroll-content{box-sizing:border-box;display:flex;flex-direction:column;margin:0;padding:0;width:100%}.drag-scroll-content{gap:18px;height:auto;transform:translateZ(0);will-change:transform}.drag-scroll-scrollbar{background-color:#0000001a;border-radius:3px;bottom:0;box-sizing:border-box;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s;width:6px}.drag-scroll-scrollbar.drag-scroll-show{opacity:1}.drag-scroll-scrollbar-thumb{background:linear-gradient(180deg,#4a90e2,#357abd);border-radius:3px;box-sizing:border-box;position:absolute;transition:height .2s;width:100%}.epicker-body-noscroll{overflow:hidden;touch-action:none}.epicker{box-shadow:0 9px 28px 8px #0000000d;display:none;margin:0;opacity:0;padding:0;position:absolute;transition:opacity .3s ease;vertical-align:top;z-index:1000}.epicker,.epicker-body{box-sizing:border-box;flex-direction:column}.epicker-body{display:flex}.epicker.epicker-mobile .epicker-mask{background-color:#0000004d;bottom:0;box-sizing:border-box;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:9998}.epicker.epicker-mobile .epicker-body{align-items:center;bottom:0;left:0;position:fixed;right:0;z-index:9999}.ez-time-line-container{box-sizing:border-box;display:block;height:300px;min-width:190px;overflow:hidden;padding-right:29%;position:relative;text-align:left;white-space:nowrap;width:52%!important}.ez-time-line-time-scale-area{border-bottom:none;border-right:12px solid #bdcdff;border-top:none;box-sizing:border-box;color:#666;font-size:12px;height:60px;margin:0;padding:0;position:relative}.ez-time-line-time-label{height:14px;left:45%;line-height:14px;position:relative;top:53px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ez-time-line-time-unavail{background-color:#ddd;box-sizing:border-box;left:100%;position:absolute;width:12px}.ez-time-line-current{box-sizing:border-box;height:29px;min-width:80px;padding-left:2.66666%;position:absolute;text-align:left;top:40px;width:23%;z-index:1}.ez-time-line-current-content{height:58px;position:relative;width:100%}.ez-time-line-current-tip{align-items:center;display:inline-flex;font-size:58px;position:absolute;width:58px;z-index:1}.ez-time-line-current-tip-line{background-color:#648ffc;border-radius:1px;height:1.5px;position:absolute;top:50%;transform:translateY(-50%);width:102%}.ez-time-line-current-value{color:#fff;font-size:12px;height:58px;line-height:58px;pointer-events:none;position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:52px;z-index:1}.ez-time-line-time-cover-fold{align-items:flex-end;color:#fff;display:inline-flex;height:60px;position:absolute;right:-90px;transform:translate(22px);width:90px}.ez-time-line-time-cover-fold-img{border-radius:6px;height:50px;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:90px}.ez-time-line-time-cover-fold-img img{height:50px;-o-object-fit:cover;object-fit:cover;width:90px}.ez-time-line-time-cover-fold-img:before{background-color:rgba(0,0,0,.3);content:"";height:50px;left:0;position:absolute;top:0;width:90px;z-index:1}.ez-time-line-time-cover-fold-len{font-size:12px;font-size:11px;left:2px;position:absolute;top:2px;z-index:2}.ez-time-line-time-cover-fold-time{font-size:12px;font-size:11px;position:absolute;right:2px;top:2px;z-index:2}.ez-time-line-time-cover-fold-pause{bottom:2px;color:#fff;display:inline-flex;font-size:20px;position:absolute;right:0;z-index:2}.ez-time-line-cover-fold-placeholder{display:flex;height:60px;justify-content:center;position:absolute;width:90px}.ez-time-line-cover-fold-placeholder:after,.ez-time-line-cover-fold-placeholder:before{border-radius:6px;content:"";position:absolute}.ez-time-line-cover-fold-placeholder:before{background-color:#ededed;height:30px;top:0;width:70px}.ez-time-line-cover-fold-placeholder:after{background-color:#ccc;height:40px;top:5px;width:80px}.ez-time-line-item-cover-placeholder{align-items:center;background:linear-gradient(180deg,#b7c3cf,#d4d1d1 100%);color:#fff;display:flex;font-size:20px;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1}.ez-time-line-op{position:absolute;right:10%;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}.ez-time-line-op-wrapper{display:inline-flex;flex-direction:column}.ez-time-line-icon-plus{margin-bottom:40px}.ez-time-line-icon-minus:not(.ez-time-line-disabled),.ez-time-line-icon-plus:not(.ez-time-line-disabled){align-items:center;border:1px solid #999;border-radius:8px;box-sizing:border-box;cursor:pointer;display:inline-flex;font-size:16px;height:30px;justify-content:center;padding:7px;transition:color .3s ease,border-color .3s ease;width:30px}.ez-time-line-icon-minus:not(.ez-time-line-disabled):active,.ez-time-line-icon-plus:not(.ez-time-line-disabled):active{border-color:#369fff;color:#369fff}.ez-time-line-disabled{border-color:#dedede!important;cursor:not-allowed!important}.ez-time-line-picker.epicker.epicker-mobile .epicker-body{align-items:normal;background-color:#fff;height:550px;max-height:70%}.ez-time-line-picker-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ez-time-line-picker-header{color:#2c2c2c;display:flex;font-size:18px;font-weight:500;height:65px;letter-spacing:0;line-height:45px;padding:10px 70px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ez-time-line-picker-close,.ez-time-line-picker-header{align-items:center;box-sizing:border-box;justify-content:center}.ez-time-line-picker-close{color:#20262c;cursor:pointer;display:inline-flex;font-size:24px;height:24px;left:15px;position:absolute;top:20px;transition:color .3s ease;width:24px}.ez-time-line-picker-close:active{color:#f05757}.ez-time-line-picker-content{box-sizing:border-box;flex:1 1 auto;overflow-x:hidden;overflow-y:auto}.ez-time-line-picker-item{margin-bottom:20px;padding-left:10px;padding-right:10px}.ez-time-line-picker-item-title{color:#666;font-size:14px;font-weight:400;letter-spacing:0;line-height:20px;margin-bottom:10px;padding-left:1.5%}.ez-time-line-picker-item-list{display:flex;flex-wrap:wrap}.ez-time-line-picker-item-content{background-color:#ddd;border-radius:8px;display:flex;margin:0 1.5% 10px;overflow:hidden;padding-top:18.769%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:30.333%}.ez-time-line-picker-item-content:before{background-color:rgba(0,0,0,.3);content:"";height:100%;left:0;position:absolute;top:0;width:100%}.ez-time-line-picker-item-time{left:5px}.ez-time-line-picker-item-duration,.ez-time-line-picker-item-time{color:#fff;font-size:12px;font-size:11px;font-weight:400;letter-spacing:0;line-height:13px;position:absolute;top:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2}.ez-time-line-picker-item-duration{right:5px}.ez-time-line-picker-item-cover{height:100%;left:0;-o-object-fit:cover;object-fit:cover;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:0}.ez-time-line-picker .ez-time-line-item-cover-placeholder{font-size:30px;z-index:1}.ezplayer .ezplayer-progress{align-items:center;background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);box-sizing:border-box;cursor:default;display:flex;flex-direction:column;justify-content:center;padding:36px 9px 11px;position:relative;width:38px}.ezplayer .ezplayer-progress,.ezplayer .ezplayer-progress-text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ezplayer .ezplayer-progress-text{font-size:12px;height:17px;left:0;line-height:17px;position:absolute;text-align:center;top:10px;width:100%}.ezplayer .ezplayer-progress-minus,.ezplayer .ezplayer-progress-plus{display:flex;height:25px;justify-content:center}.ezplayer .ezplayer-progress-minus .ezplayer-icon,.ezplayer .ezplayer-progress-plus .ezplayer-icon{color:#fff;cursor:pointer;display:inline-block;font-size:20px;height:20px;text-align:center;transition:color .3s ease,border-color .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:20px}.ezplayer .ezplayer-progress-minus .ezplayer-icon:active,.ezplayer .ezplayer-progress-plus .ezplayer-icon:active{color:var(--ezplayer-primary-color,#407aff)}@media (hover:hover){.ezplayer .ezplayer-progress-minus .ezplayer-icon:hover,.ezplayer .ezplayer-progress-plus .ezplayer-icon:hover{color:var(--ezplayer-primary-color,#407aff)}}.ezplayer .ezplayer-progress-plus{padding-bottom:5px}.ezplayer .ezplayer-progress-minus{padding-top:5px}.ezplayer .ezplayer-progress-slider{background-color:hsla(0,0%,100%,.75);border-radius:2px;cursor:pointer;flex:1 1 auto;position:relative;width:4px}.ezplayer .ezplayer-progress-slider-fill{background-color:var(--ezplayer-primary-color,#407aff);border-radius:4px;bottom:0;height:0;left:0;position:absolute;width:100%}.ezplayer .ezplayer-progress-slider-handle{align-items:center;background-color:var(--ezplayer-primary-color,#407aff);border-radius:50%;cursor:pointer;display:inline-flex;height:12px;justify-content:center;left:50%;position:absolute;top:0;transform:translate(-50%,-50%);width:12px}.ezplayer .ezplayer-progress-slider-handle:hover{box-shadow:0 0 2px var(--ezplayer-primary-color,#407aff)}.ezplayer .ezplayer-progress-slider-handle:before{background-color:#fff;border-radius:50%;content:"";display:inline;height:6px;width:6px}.ezplayer-icon{align-items:center;color:inherit;display:inline-flex;font-size:var(--ezplayer-icon-font-size,24px);font-style:normal;line-height:0;text-align:center;text-rendering:optimizeLegibility;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ezplayer-select-panel{background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);color:var(--ezplayer-default-color,#fff);display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;position:relative}.ezplayer-select-btn{width:50px}.ezplayer-select-btn span{display:inline-block;font-size:12px;font-size:calc(var(--ezplayer-font-size, 14px) - 2px);line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ezplayer-select-list{align-items:center;display:flex;flex-direction:column;font-size:var(--ezplayer-font-size,14px);list-style:none;margin:0;padding:12px 0!important;width:100%}.ezplayer-select-option{box-sizing:border-box;cursor:pointer;display:inline-flex;height:28px;justify-content:center;line-height:18px;list-style:none;padding:5px 20px!important;transition:color .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ezplayer-select-option span{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ezplayer-select-option:hover{color:var(--ezplayer-active-color)}.ezplayer-select-cancel,.ezplayer-select-close{display:none}.ezplayer-select-cancel{font-size:var(--ezplayer-font-size,14px)}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-panel{background-color:transparent;max-width:400px;padding-bottom:calc(54px + env(safe-area-inset-bottom));width:90%}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-list{align-items:center;background-color:#fff;border-radius:var(--ezplayer-border-radius,8px);display:flex;flex-direction:column;font-size:var(--ezplayer-font-size,14px);max-height:70vh;max-height:calc(90vh - 108px);overflow-x:hidden;overflow-y:auto;padding:20px 0!important}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel,.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option{align-items:center;box-sizing:border-box;color:#2c2c2c;display:inline-flex;height:36px;justify-content:center;line-height:26px;padding:5px 20px!important}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option{--webkit-tap-highlight-color:transparent!important}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:hover{color:#2c2c2c}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:active{background-color:#f8f8f8}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel{background-color:#fff;border-radius:var(--ezplayer-border-radius,8px);display:flex;height:54px;margin-top:8px}.ezplayer-mobile .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel:active{color:var(--ezplayer-active-color)}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .epicker-body{bottom:0;left:unset;right:0;top:0;width:240px}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-panel{align-items:center;background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-bottom-right-radius:0;border-top-right-radius:0;height:100%;justify-content:center;padding-bottom:env(safe-area-inset-bottom);width:100%}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-list{background-color:transparent;border-radius:0;color:#fff;height:auto;margin:0;max-height:100%;width:100%}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-option,.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:hover{color:#fff}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-option:active{background-color:transparent;color:var(--ezplayer-active-color)}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-cancel{display:none}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-close{display:inline-flex;left:10px;position:absolute;top:10px}.ezplayer-mobile.ezplayer-fullscreen .epicker-mobile.ezplayer-select-picker .ezplayer-select-close:active{color:var(--ezplayer-active-color)}.ezplayer-control-fullscreen .ezplayer-icon-exit-fullscreen,.ezplayer-control-global-fullscreen .ezplayer-icon-exit-global-fullscreen{display:none}.ezplayer-fullscreen .ezplayer-icon-exit-fullscreen{display:inline-flex}.ezplayer-fullscreen .ezplayer-icon-fullscreen{display:none}.ezplayer-global-fullscreen .ezplayer-icon-exit-global-fullscreen{display:inline-flex}.ezplayer-global-fullscreen .ezplayer-icon-global-fullscreen{display:none}.ezplayer-loading{background-color:rgba(0,0,0,.5);bottom:0;color:#fff;display:none;font-size:14px;height:100%;left:0;position:absolute;right:0;top:0;transition:transform .3s cubic-bezier(.78,.14,.15,.86);vertical-align:middle;width:100%;z-index:4}.ezplayer-loading-dot{display:inline-block;font-size:25px;height:25px;position:relative;width:25px}.ezplayer-loading-dot-item{background-color:#fff;border-radius:2px;display:block;height:10px;position:absolute;transform-origin:50% 50%;width:10px}.ezplayer-loading-dot-item:first-child{animation:animationShape1 2s linear 0s infinite normal;left:0;opacity:1;top:0}.ezplayer-loading-dot-item:nth-child(2){animation:animationShape2 2s linear 0s infinite normal;left:15px;opacity:.8;top:0}.ezplayer-loading-dot-item:nth-child(3){animation:animationShape3 2s linear 0s infinite normal;left:0;opacity:.5;top:15px}.ezplayer-loading-dot-item:nth-child(4){animation:animationShape4 2s linear 0s infinite normal;left:15px;opacity:.3;top:15px}.ezplayer-loading-dot-load{animation:rotation 1s infinite}@media (-ms-high-contrast:active),(-ms-high-contrast:none){.ezplayer-load-blur{background:#fff;opacity:.5}}@keyframes ezdSpinMove{to{opacity:1}}@keyframes ezdRotate{to{transform:rotate(405deg)}}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes animationShape1{0%{transform:translate(0)}25%{transform:translateY(15px)}50%{transform:translate(15px,15px)}75%{transform:translate(15px)}to{transform:translate(translate)}}@keyframes animationShape2{0%{transform:translate(0)}25%{transform:translate(-15px)}50%{transform:translate(-15px,15px)}75%{transform:translateY(15px)}}@keyframes animationShape3{0%{transform:translate(0)}25%{transform:translate(15px)}50%{transform:translate(15px,-15px)}75%{transform:translateY(-15px)}}@keyframes animationShape4{0%{transform:translate(0)}25%{transform:translateY(-15px)}50%{transform:translate(-15px,-15px)}75%{transform:translate(-15px)}}.ezplayer-loading-text{margin-top:20px}.ezplayer-message{background-color:rgba(0,0,0,.4);bottom:0;color:#fff;display:none;font-size:16px;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;width:100%;z-index:5}.ezplayer-message-content{align-items:center;display:flex;flex-direction:column;justify-content:center}.ezplayer-message-msg{display:-webkit-box;margin-top:15px;max-width:500px;overflow:hidden;word-break:break-all;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:0 20px}.ezplayer-message-error{color:#ff4d4f}.ezplayer-toast{background-color:rgba(0,0,0,.8);border-radius:var(--ezplayer-border-radius,8px);box-shadow:0 9px 28px 8px rgba(0,0,0,.05),0 3px 16px 0 rgba(0,0,0,.03),0 3px 7px -4px rgba(0,0,0,.05);color:#fff;display:flex;font-size:14px;left:50%;line-height:22px;max-width:450px;overflow:hidden;padding:9px 16px;position:absolute;top:50px;transform:translateX(-50%);z-index:6}.ezplayer-toast-content{padding-left:24px;position:relative}.ezplayer-toast .ezplayer-icon{font-size:16px;left:0;position:absolute;top:3px}.ezplayer-toast .ezplayer-icon-info-circle{color:var(--ezplayer-default-color,#fff)}.ezplayer-toast .ezplayer-icon-warn-circle{color:#faad14}.ezplayer-toast .ezplayer-icon-close-circle{color:#ff4d4f}.ezplayer-mobile .ezplayer-toast{font-size:12px;line-height:20px}.ezplayer-mobile .ezplayer-toast-content{padding-left:20px}.ezplayer-mobile .ezplayer-toast .ezplayer-icon{font-size:14px}.ezplayer-poster{bottom:0;display:none;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:2}.ezplayer-poster img{border:0;font-size:0;height:100%;outline:none;pointer-events:none;width:100%}.ezplayer-icon-volume{position:relative}.ezplayer-icon-volume svg .ezplayer-icon-volume-high,.ezplayer-icon-volume svg .ezplayer-icon-volume-low,.ezplayer-icon-volume svg .ezplayer-icon-volume-muted{display:none}.ezplayer-icon-volume.ezplayer-icon-volume-high svg .ezplayer-icon-volume-high,.ezplayer-icon-volume.ezplayer-icon-volume-high svg .ezplayer-icon-volume-low,.ezplayer-icon-volume.ezplayer-icon-volume-low svg .ezplayer-icon-volume-low,.ezplayer-icon-volume.ezplayer-icon-volume-muted svg .ezplayer-icon-volume-muted,.ezplayer-icon-volume.ezplayer-icon-volume-zero svg .ezplayer-icon-volume-muted{display:inline}.ezplayer-volume-progress{height:126px}.ezplayer-control-rec{box-sizing:border-box;display:inline-flex;flex-direction:row}.ezplayer-control-rec .ezplayer-icon-cloud-rec,.ezplayer-control-rec .ezplayer-icon-cloud-record,.ezplayer-control-rec .ezplayer-icon-sdk{color:#d4d7dd;cursor:pointer;margin-left:5px}.ezplayer-mobile-extend .ezplayer-control-rec{background-color:#f4f6fc;border:1px solid #ededed;border-radius:18px;height:30px}.ezplayer-mobile-extend .ezplayer-icon-cloud-rec,.ezplayer-mobile-extend .ezplayer-icon-cloud-record,.ezplayer-mobile-extend .ezplayer-icon-sdk{cursor:pointer;font-size:20px;margin-left:1px;padding:2px 7px}.ezplayer-mobile-extend .ezplayer-icon-cloud-rec.ezplayer-active,.ezplayer-mobile-extend .ezplayer-icon-cloud-record.ezplayer-active,.ezplayer-mobile-extend .ezplayer-icon-sdk.ezplayer-active{background-color:#fff;border-radius:12px;box-shadow:0 1px 4px 0 hsla(0,0%,68%,.2)}.ezplayer-mobile .ezplayer-icon-cloud-rec,.ezplayer-mobile .ezplayer-icon-cloud-record,.ezplayer-mobile .ezplayer-icon-sdk{margin-left:10px}.ezplayer-more-panel{align-items:center;background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);cursor:default;display:flex;flex-direction:row;padding:8px 10px}.ezplayer-more .ezplayer-control{margin-left:var(--ezplayer-control-space,16px)}.ezplayer-more .ezplayer-control:first-child{margin-left:0}.ezplayer-medium-height .ezplayer-zoom-panel,.ezplayer-mini-height .ezplayer-zoom-panel{height:100%;padding-bottom:var(--ezplayer-footer-height,80px);padding-top:0}.ezplayer-mini-height .ezplayer-zoom-panel{padding-bottom:calc(var(--ezplayer-footer-height, 80px) - 20px)}.ezplayer-mini-height .ezplayer-progress-slider{display:none!important}.ezplayer-mini-height .ezplayer-progress-plus{padding-bottom:0}.ezplayer-mini-height .ezplayer-progress-minus{padding-top:0}.ezplayer-zoom-panel{bottom:0;display:inline-flex;flex-direction:column;height:100%;justify-content:flex-end;left:20px;padding-bottom:calc(var(--ezplayer-footer-height, 80px) + 20px);padding-top:10%;pointer-events:none;position:absolute;top:0;z-index:23}.ezplayer-zoom-panel .ezplayer-progress{height:200px;max-height:95%;pointer-events:auto}.ezplayer-mobile .ezplayer-zoom-panel{padding-bottom:calc(var(--ezplayer-mobile-footer-height, 54px) + 10px);padding-top:5%}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-zoom-panel{padding-bottom:var(--ezplayer-mobile-fullscreen-footer-height,110px);padding-top:var(--ezplayer-mobile-fullscreen-header-height,75px)}.ezplayer-icon-talk-growth-dot1,.ezplayer-icon-talk-growth-dot2,.ezplayer-icon-talk-growth-dot3,.ezplayer-icon-talk-growth-dot4{color:var(--ezplayer-default-color,#fff)}.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot1,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot2,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot3,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-deafening .ezplayer-icon-talk-growth-dot4,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-high .ezplayer-icon-talk-growth-dot2,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-high .ezplayer-icon-talk-growth-dot3,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-high .ezplayer-icon-talk-growth-dot4,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-low .ezplayer-icon-talk-growth-dot4,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-normal .ezplayer-icon-talk-growth-dot3,.ezplayer-control-talk.ezplayer-active.ezplayer-talk-gain-normal .ezplayer-icon-talk-growth-dot4{color:var(--ezplayer-active-color,#407aff)}.ezplayer-record-timer{align-items:center;background-color:#ff4c5c;border-radius:24px;color:#fff;display:inline-flex;flex-direction:row;left:50%;padding:2px 6px;position:absolute;top:60px;transform:translateX(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:3}.ezplayer-record-timer .ezplayer-icon-record-circle{font-size:14px}.ezplayer-record-timer-time{font-weight:400;letter-spacing:1px;line-height:20px;margin-left:2px}.ezplayer-select-definition .ezplayer-select-panel{width:100px}.ezplayer-control-definition .ezplayer-select-btn{width:75px}.ezplayer-control-device{width:100%}.ezplayer-control-device span{display:inline;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ezplayer-pause{bottom:0;color:#fff!important;cursor:pointer!important;height:100%;left:0;overflow:hidden;position:absolute;right:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:3}.ezplayer-pause-circle{align-items:center;background-color:rgba(0,0,0,.4);border-radius:50%;cursor:pointer;display:flex;font-size:20px;height:50px;justify-content:center;transition:transform .3s ease,opacity 1s ease;width:50px}.ezplayer-pause-circle:hover{opacity:.85}.ezplayer-pause-circle .ezplayer-icon-pause,.ezplayer-pause-circle .ezplayer-icon-play{font-size:32px}.ezplayer-pause-transform .ezplayer-pause-circle{opacity:0;transform:scale(1.1)}.ez-ptz-container{background:hsla(0,0%,100%,.8);border:1px solid hsla(0,0%,100%,.8);border-radius:100%;box-shadow:0 0 33px 4px rgba(0,0,0,.15);cursor:pointer;font-size:14px;height:80px;overflow:hidden;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:80px}.ez-ptz-icon{display:inline-block;height:0;position:absolute;width:0}.ez-ptz-icon.ez-ptz-icon-icon-active{border-bottom-color:#407aff}.ez-ptz-direction-top{border-bottom:8px solid #999;top:2px}.ez-ptz-direction-bottom,.ez-ptz-direction-top{border-left:4px solid transparent;border-right:4px solid transparent;left:calc(50% - 4px)}.ez-ptz-direction-bottom{border-top:8px solid #999;bottom:2px}.ez-ptz-direction-right{border-left:8px solid #999;right:2px}.ez-ptz-direction-left,.ez-ptz-direction-right{border-bottom:4px solid transparent;border-top:4px solid transparent;top:calc(50% - 4px)}.ez-ptz-direction-left{border-right:8px solid #999;left:2px}.ez-ptz-direction-top-left{top:calc(25% - 4px)}.ez-ptz-direction-left-bottom,.ez-ptz-direction-top-left{background:#999;border-radius:50%;height:4px;left:16px;width:4px}.ez-ptz-direction-bottom-right,.ez-ptz-direction-left-bottom{bottom:calc(25% - 4px)}.ez-ptz-direction-bottom-right,.ez-ptz-direction-right-top{background:#999;border-radius:50%;height:4px;right:16px;width:4px}.ez-ptz-direction-right-top{top:calc(25% - 4px)}.ez-ptz-direction-center{background:#407aff;border-radius:100%;height:23px;left:calc(50% - 12.4px);position:absolute;top:calc(50% - 12.4px);width:23px}.ez-ptz-container-wrap{align-items:center;box-sizing:content-box!important;display:flex;flex-direction:column;justify-content:center;width:100%}.ez-ptz-speed-container{width:100%}.ez-ptz-speed-progress-line{background:#fff;display:flex;height:1px;justify-content:space-between;margin:16px 0 8px}.ez-ptz-speed-progress-line-dot{background:#fff;border:2px solid #fff;border-radius:50%;cursor:pointer;height:9px;margin:-3px 0;width:9px}.ez-ptz-speed-progress-line-dot.ez-ptz-speed-active{border-color:#407aff}.ez-ptz-speed-progress-points{display:flex;justify-content:space-between}.ez-ptz-speed-progress-points-fast,.ez-ptz-speed-progress-points-mid,.ez-ptz-speed-progress-points-slow{color:#fff;cursor:pointer}.ez-ptz-btn-container{display:flex;justify-content:space-between;margin-top:14px;width:100%}.ez-ptz-btn-focal,.ez-ptz-btn-zoom{border:1px solid hsla(0,0%,100%,.5);border-radius:10px;box-sizing:content-box;display:flex;height:20px;padding-bottom:0}.ez-ptz-btn-focal-add,.ez-ptz-btn-focal-sub,.ez-ptz-btn-zoom-add,.ez-ptz-btn-zoom-sub{cursor:pointer;height:20px;text-align:center}.ez-ptz-btn-focal-add,.ez-ptz-btn-zoom-add{border-right:1px solid hsla(0,0%,100%,.5)}.ez-mobile-ptz{box-sizing:border-box}.ez-mobile-ptz-content{align-items:center;display:flex;justify-content:center}.ez-mobile-ptz-wrap{background-image:linear-gradient(180deg,#f6f8ff,hsla(0,0%,93%,.42) 50%);border-radius:100%;box-sizing:border-box;display:inline-block;overflow:hidden;padding:24px}.ez-mobile-ptz-container{background:hsla(0,0%,100%,.8);border:1px solid hsla(0,0%,100%,.8);border-radius:100%;box-sizing:border-box;cursor:pointer;height:260px;margin:auto;overflow:hidden;position:relative;width:260px}.ez-mobile-ptz-center{background:#fff;border:2px solid #eee;border-radius:100%;cursor:pointer;height:52px;left:calc(50% - 26px);position:absolute;top:calc(50% - 26px);width:52px}.ez-mobile-ptz-top{border-bottom:6px solid #aaa;border-left:6px solid transparent;border-right:6px solid transparent;cursor:pointer;display:inline-block;height:0;left:calc(50% - 6px);position:absolute;top:10px;width:0}.ez-mobile-ptz-top.ez-mobile-ptz-active{border-bottom-color:#1890ff}.ez-mobile-ptz-left{border-bottom:6px solid transparent;border-right:6px solid #aaa;border-top:6px solid transparent;cursor:pointer;display:inline-block;height:0;left:10px;position:absolute;top:calc(50% - 6px);width:0}.ez-mobile-ptz-left.ez-mobile-ptz-active{border-right-color:#1890ff}.ez-mobile-ptz-bottom{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #aaa;bottom:10px;display:inline-block;height:0;left:calc(50% - 6px);position:absolute;width:0}.ez-mobile-ptz-bottom.ez-mobile-ptz-active{border-top-color:#1890ff}.ez-mobile-ptz-right{border-bottom:6px solid transparent;border-left:6px solid #aaa;border-top:6px solid transparent;display:inline-block;height:0;position:absolute;right:10px;top:calc(50% - 6px);width:0}.ez-mobile-ptz-right.ez-mobile-ptz-active{border-left-color:#1890ff}.ezplayer-medium-height .ezplayer-ptz-panel,.ezplayer-mini-height .ezplayer-ptz-panel{padding-bottom:0;padding-top:0;right:0;z-index:22}.ezplayer-medium-height .ezplayer-ptz-panel .ezplayer-ptz-turntable,.ezplayer-mini-height .ezplayer-ptz-panel .ezplayer-ptz-turntable{border-bottom-right-radius:0;border-top-right-radius:0;max-height:none}.ezplayer-mini-height .ez-ptz-btn-container,.ezplayer-mini-height .ez-ptz-speed-container{display:none!important}.ezplayer-ptz-panel{box-sizing:border-box;flex-direction:column;max-width:70%;padding-bottom:var(--ezplayer-footer-height,80px);padding-top:var(--ezplayer-header-height,46px);pointer-events:none;position:absolute;right:10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:150px;z-index:3}.ezplayer-ptz-panel,.ezplayer-ptz-panel .ezplayer-ptz-turntable{align-items:center;display:flex;height:100%;justify-content:center}.ezplayer-ptz-panel .ezplayer-ptz-turntable{background-color:var(--ezplayer-panel-bg-color,rgba(0,0,0,.7));border-radius:var(--ezplayer-border-radius,8px);flex:1 1 auto;max-height:283px;padding:20px;pointer-events:auto;width:100%}.ezplayer-mobile .ezplayer-control-ptz,.ezplayer-mobile .ezplayer-ptz-panel{display:none}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-control-ptz,.ezplayer-mobile.ezplayer-fullscreen .ezplayer-ptz-panel{display:inline-flex}.ezplayer-mobile.ezplayer-fullscreen .ezplayer-ptz-panel{padding-bottom:calc(var(--ezplayer-mobile-fullscreen-footer-height, 110px) - 20px);padding-top:var(--ezplayer-mobile-fullscreen-header-height,75px)}.ezplayer-mobile.ezplayer-fullscreen.ezplayer-medium-height .ezplayer-ptz-panel,.ezplayer-mobile.ezplayer-fullscreen.ezplayer-mini-height .ezplayer-ptz-panel{padding-bottom:0;padding-top:0}.ezplayer-mobile-extend .ezplayer-mobile-date-filter{align-items:center;background:#f4f6fc;border:1px solid #ededed;border-radius:8px;box-sizing:border-box;color:#2c2c2c;display:inline-flex;font-family:PingFang SC;font-size:16px;font-weight:500;height:36px;justify-content:center;letter-spacing:0;line-height:20px;padding:6px 10px}.ezplayer-mobile-extend .ezplayer-mobile-date-filter-value{margin-right:5px}.ezplayer-mobile-extend .ezplayer-icon-filter{font-size:20px}.ezplayer-control-time-line{overflow:hidden;padding-right:40px;position:relative}.ezplayer-control-time-line .ezplayer-time-line-scale-add,.ezplayer-control-time-line .ezplayer-time-line-scale-sub{align-items:center;background-color:#333;border-radius:2px;color:var(--ezplayer-default-color,#fff);cursor:pointer;display:inline-flex;height:14px;justify-content:center;overflow:hidden;position:absolute;right:0;transition:color .3s ease;width:14px}.ezplayer-control-time-line .ezplayer-icon-add,.ezplayer-control-time-line .ezplayer-icon-reduce{font-size:12px;font-weight:500}.ezplayer-control-time-line .ezplayer-icon-add:hover,.ezplayer-control-time-line .ezplayer-icon-reduce:hover{color:var(--ezplayer-primary-color,#407aff)}.ezplayer-control-time-line .ezplayer-time-line-scale-add{top:2px}.ezplayer-control-time-line .ezplayer-time-line-scale-sub{bottom:2px}.ezplayer-mobile-extend .ezplayer-control-time-line{display:block;height:300px;margin-top:10px;padding-right:0}');var hasRequiredEventemitter3,eventemitter3={exports:{}};var dist$6,hasRequiredDist$6,eventemitter3Exports=(hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(module){var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(fn,context,once){this.fn=fn,this.context=context,this.once=once||!1}function addListener(emitter,event,fn,context,once){if("function"!=typeof fn)throw new TypeError("The listener must be a function");var listener=new EE(fn,context||emitter,once),evt=prefix?prefix+event:event;return emitter._events[evt]?emitter._events[evt].fn?emitter._events[evt]=[emitter._events[evt],listener]:emitter._events[evt].push(listener):(emitter._events[evt]=listener,emitter._eventsCount++),emitter}function clearEvent(emitter,evt){0==--emitter._eventsCount?emitter._events=new Events:delete emitter._events[evt]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function(){var events,name,names=[];if(0===this._eventsCount)return names;for(name in events=this._events)has.call(events,name)&&names.push(prefix?name.slice(1):name);return Object.getOwnPropertySymbols?names.concat(Object.getOwnPropertySymbols(events)):names},EventEmitter.prototype.listeners=function(event){var evt=prefix?prefix+event:event,handlers=this._events[evt];if(!handlers)return[];if(handlers.fn)return[handlers.fn];for(var i=0,l=handlers.length,ee=new Array(l);i<l;i++)ee[i]=handlers[i].fn;return ee},EventEmitter.prototype.listenerCount=function(event){var evt=prefix?prefix+event:event,listeners=this._events[evt];return listeners?listeners.fn?1:listeners.length:0},EventEmitter.prototype.emit=function(event,a1,a2,a3,a4,a5){var evt=prefix?prefix+event:event;if(!this._events[evt])return!1;var args,i,listeners=this._events[evt],len=arguments.length;if(listeners.fn){switch(listeners.once&&this.removeListener(event,listeners.fn,void 0,!0),len){case 1:return listeners.fn.call(listeners.context),!0;case 2:return listeners.fn.call(listeners.context,a1),!0;case 3:return listeners.fn.call(listeners.context,a1,a2),!0;case 4:return listeners.fn.call(listeners.context,a1,a2,a3),!0;case 5:return listeners.fn.call(listeners.context,a1,a2,a3,a4),!0;case 6:return listeners.fn.call(listeners.context,a1,a2,a3,a4,a5),!0}for(i=1,args=new Array(len-1);i<len;i++)args[i-1]=arguments[i];listeners.fn.apply(listeners.context,args)}else{var j,length=listeners.length;for(i=0;i<length;i++)switch(listeners[i].once&&this.removeListener(event,listeners[i].fn,void 0,!0),len){case 1:listeners[i].fn.call(listeners[i].context);break;case 2:listeners[i].fn.call(listeners[i].context,a1);break;case 3:listeners[i].fn.call(listeners[i].context,a1,a2);break;case 4:listeners[i].fn.call(listeners[i].context,a1,a2,a3);break;default:if(!args)for(j=1,args=new Array(len-1);j<len;j++)args[j-1]=arguments[j];listeners[i].fn.apply(listeners[i].context,args)}}return!0},EventEmitter.prototype.on=function(event,fn,context){return addListener(this,event,fn,context,!1)},EventEmitter.prototype.once=function(event,fn,context){return addListener(this,event,fn,context,!0)},EventEmitter.prototype.removeListener=function(event,fn,context,once){var evt=prefix?prefix+event:event;if(!this._events[evt])return this;if(!fn)return clearEvent(this,evt),this;var listeners=this._events[evt];if(listeners.fn)listeners.fn!==fn||once&&!listeners.once||context&&listeners.context!==context||clearEvent(this,evt);else{for(var i=0,events=[],length=listeners.length;i<length;i++)(listeners[i].fn!==fn||once&&!listeners[i].once||context&&listeners[i].context!==context)&&events.push(listeners[i]);events.length?this._events[evt]=1===events.length?events[0]:events:clearEvent(this,evt)}return this},EventEmitter.prototype.removeAllListeners=function(event){var evt;return event?(evt=prefix?prefix+event:event,this._events[evt]&&clearEvent(this,evt)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=prefix,EventEmitter.EventEmitter=EventEmitter,module.exports=EventEmitter}(eventemitter3)),eventemitter3.exports),EventEmitter$1=getDefaultExportFromCjs$1(eventemitter3Exports);function requireDist$6(){if(hasRequiredDist$6)return dist$6;function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}hasRequiredDist$6=1;var PickerProvider=function(){function PickerProvider(){this.pickers=[]}var _proto=PickerProvider.prototype;return _proto.add=function(picker){this.pickers.push(picker)},_proto.remove=function(picker){var index=this.pickers.indexOf(picker);index>-1?this.pickers.splice(index,1):console.warn("Picker not found in the provider.")},_proto.closeOther=function(e){for(var _step,_iterator=_create_for_of_iterator_helper_loose(this.pickers);!(_step=_iterator()).done;){var _p_$container_contains,_p_$container,_p_$wrapperContent_contains,_p_$wrapperContent,p=_step.value;!p||e.target===p.$container||(null==(_p_$container=p.$container)||null==(_p_$container_contains=_p_$container.contains)?void 0:_p_$container_contains.call(_p_$container,e.target))||e.target===p.$wrapperContent||(null==(_p_$wrapperContent=p.$wrapperContent)||null==(_p_$wrapperContent_contains=_p_$wrapperContent.contains)?void 0:_p_$wrapperContent_contains.call(_p_$wrapperContent,e.target))||(p.open=!1)}},PickerProvider.getInstance=function(){return PickerProvider.instance||(PickerProvider.instance=new PickerProvider),PickerProvider.instance},PickerProvider}(),pickerProvider=PickerProvider.getInstance();function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}var _$PICKER_PLACEMENT$_=["top","tl","tr","bottom","bl","br"],__$PICKER_DEFAULT_OPTIONS$__={getPopupContainer:function(){return document.body},wrapClassName:"",open:!1,placement:"br",offset:[0,0],zIndex:1e3,content:"",trigger:"click",mouseLeaveDelay:.1,mouseEnterDelay:.1,isMobile:!1},Picker=function(){function Picker(container,options){var _this__$popupContainer,_this__$popupContainer1;this._open=!1,this._OpenChange=!1,this._animationTimer=null,this._disabled=!1,this._timer=null,this._options=Object.assign({},__$PICKER_DEFAULT_OPTIONS$__,options||{}),this._options.isMobile&&(this._options.trigger="click"),pickerProvider.add(this),this.$container="function"==typeof container?container():container,this.$wrapperContent=document.createElement("div"),this._initContentStyle(),"function"==typeof this._options.getPopupContainer?this._$popupContainer=this._options.getPopupContainer():this._$popupContainer=document.body,["INPUT","CANVAS","VIDEO","IMG"].includes(null==(_this__$popupContainer=this._$popupContainer)?void 0:_this__$popupContainer.tagName)&&(console.warn("popup container node does not support child elements, default body!"),this._$popupContainer=document.body),this._$popupContainer!==document.body&&(this._$popupContainer.style.position="relative"),null==(_this__$popupContainer1=this._$popupContainer)||_this__$popupContainer1.appendChild(this.$wrapperContent),this._onContentClick=this._onContentClick.bind(this),this._onShow=this._onShow.bind(this),this._onWrapperShow=this._onWrapperShow.bind(this),this._onHide=this._onHide.bind(this),this._onDocumentClick=this._onDocumentClick.bind(this),this._eventListener(),this.open=!!this._options.open}var _proto=Picker.prototype;return _proto.setPlacement=function(placement){this._disabled||(_$PICKER_PLACEMENT$_.includes(placement)?this._options.placement=placement:console.warn(placement+" is not a valid placement"),this._setPlacement())},_proto.destroy=function(){this._animationTimerClear(),this._removeHtml(),pickerProvider.remove(this)},_proto.innerHTML=function(html){this.$body&&(this.$body.innerHTML=html||"",this._setPlacement())},_proto._onOpenChange=function(open){null==this._options.onOpenChange||this._options.onOpenChange.call(this._options,!!open)},_proto._animationTimerClear=function(){this._animationTimer&&(clearTimeout(this._animationTimer),this._animationTimer=null)},_proto._removeHtml=function(){var _this_$wrapperContent,_this_$container_removeEventListener,_this_$container,_this_$container_removeEventListener1,_this_$container1,_this_$container_removeEventListener2,_this_$container2,_this_$container_removeEventListener3,_this_$container3,_this_$container_removeEventListener4,_this_$container4,_this_$wrapperContent1,_this_$wrapperContent2;(null==(_this_$wrapperContent=this.$wrapperContent)||_this_$wrapperContent.removeEventListener("click",this._onContentClick),null==(_this_$container=this.$container)||null==(_this_$container_removeEventListener=_this_$container.removeEventListener)||_this_$container_removeEventListener.call(_this_$container,"click",this._onContentClick),"click"===this._options.trigger&&(null==(_this_$container1=this.$container)||null==(_this_$container_removeEventListener1=_this_$container1.removeEventListener)||_this_$container_removeEventListener1.call(_this_$container1,"click",this._onShow)),"hover"===this._options.trigger)&&(null==(_this_$container2=this.$container)||null==(_this_$container_removeEventListener2=_this_$container2.removeEventListener)||_this_$container_removeEventListener2.call(_this_$container2,"mouseenter",this._onShow),null==(_this_$container3=this.$container)||null==(_this_$container_removeEventListener3=_this_$container3.removeEventListener)||_this_$container_removeEventListener3.call(_this_$container3,"mouseover",this._onShow),null==(_this_$container4=this.$container)||null==(_this_$container_removeEventListener4=_this_$container4.removeEventListener)||_this_$container_removeEventListener4.call(_this_$container4,"mouseleave",this._onHide),null==(_this_$wrapperContent1=this.$wrapperContent)||_this_$wrapperContent1.removeEventListener("mouseenter",this._onWrapperShow),null==(_this_$wrapperContent2=this.$wrapperContent)||_this_$wrapperContent2.removeEventListener("mouseleave",this._onHide));this._options.isMobile||(window.removeEventListener("blur",this._onHide),document.removeEventListener("visibilitychange",this._onHide),window.removeEventListener("resize",this._onHide),document.removeEventListener("click",this._onDocumentClick)),this._$mask&&(this._$mask.removeEventListener("click",this._onHide),this._$mask.remove(),this._$mask=null),this._options.isMobile&&document.body.classList.remove("epicker-body-noscroll"),this.$wrapperContent&&(this.$wrapperContent.remove(),this.$wrapperContent=null)},_proto._setPlacement=function(){var _this_$container_getBoundingClientRect,_this_$container;if(this._open&&!this._options.isMobile&&this.$container){var right,$containerRect=null==(_this_$container=this.$container)||null==(_this_$container_getBoundingClientRect=_this_$container.getBoundingClientRect)?void 0:_this_$container_getBoundingClientRect.call(_this_$container),$wrapperContentRect=this.$wrapperContent.getBoundingClientRect(),$popupContainerRect=this._$popupContainer.getBoundingClientRect(),containerLeft=$containerRect.left-$popupContainerRect.left,containerRight=-($containerRect.right-$popupContainerRect.right),containerTop=$containerRect.y-$popupContainerRect.y,left=containerLeft+($containerRect.width-$wrapperContentRect.width)/2,top=containerTop-$wrapperContentRect.height,bottom=containerTop+$containerRect.height;if(/^t/.test(this._options.placement)){var _this__options_offset,_this__options_offset1,_this__options_offset2;switch(this._options.placement){case"top":right=void 0;break;case"tl":right=void 0,left=containerLeft;break;case"tr":left=void 0,right=containerRight}this.$wrapperContent.style.cssText+="\n "+(void 0!==right?"right: "+(right+((null==(_this__options_offset=this._options.offset)?void 0:_this__options_offset[0])||0))+"px;":"")+"\n "+(void 0!==left?"left: "+(left+((null==(_this__options_offset1=this._options.offset)?void 0:_this__options_offset1[0])||0))+"px;":"")+"\n top: "+(top+((null==(_this__options_offset2=this._options.offset)?void 0:_this__options_offset2[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n "}else if(/^b/.test(this._options.placement)){var _this__options_offset3,_this__options_offset4,_this__options_offset5;switch(this._options.placement){case"bottom":right=void 0;break;case"bl":right=void 0,left=containerLeft;break;case"br":left=void 0,right=containerRight}this.$wrapperContent&&(this.$wrapperContent.style.cssText+="\n "+(void 0!==right?"right: "+(right+((null==(_this__options_offset3=this._options.offset)?void 0:_this__options_offset3[0])||0))+"px;":"")+"\n "+(void 0!==left?"left: "+(left+((null==(_this__options_offset4=this._options.offset)?void 0:_this__options_offset4[0])||0))+"px;":"")+"\n top: "+(bottom+((null==(_this__options_offset5=this._options.offset)?void 0:_this__options_offset5[1])||0))+"px;\n z-index:"+this._options.zIndex+";\n ")}}},_proto._initContentStyle=function(){if(this.$wrapperContent&&(this.$wrapperContent.classList.add("epicker","epicker-wrapper","epicker-"+this._options.placement),this.$wrapperContent.style.display="none",this._options.isMobile&&(this.$wrapperContent.classList.add("epicker-mobile"),this._$mask=document.createElement("div"),this._$mask.classList.add("epicker-mask"),this.$wrapperContent.appendChild(this._$mask)),this.$body=document.createElement("div"),this.$body.classList.add("epicker-body"),this.$wrapperContent.appendChild(this.$body),"string"==typeof this._options.content?this.innerHTML(this._options.content):"function"==typeof this._options.content&&this.innerHTML(null==this._options.content?void 0:this._options.content.call(this._options)),"string"==typeof this._options.wrapClassName))try{var _this_$wrapperContent_classList,_this_$wrapperContent;null==(_this_$wrapperContent=this.$wrapperContent)||(_this_$wrapperContent_classList=_this_$wrapperContent.classList).add.apply(_this_$wrapperContent_classList,[].concat(this._options.wrapClassName.split(" ")))}catch(_error){}},_proto._eventListener=function(){var _this_$container_addEventListener,_this_$container,_this_$container_addEventListener1,_this_$container1,_this_$container_addEventListener2,_this_$container2,_this_$container_addEventListener3,_this_$container3,_this_$container_addEventListener4,_this_$container4;(this.$wrapperContent.addEventListener("click",this._onContentClick),null==(_this_$container=this.$container)||null==(_this_$container_addEventListener=_this_$container.addEventListener)||_this_$container_addEventListener.call(_this_$container,"click",this._onContentClick),"click"===this._options.trigger&&(null==(_this_$container1=this.$container)||null==(_this_$container_addEventListener1=_this_$container1.addEventListener)||_this_$container_addEventListener1.call(_this_$container1,"click",this._onShow)),"hover"===this._options.trigger)&&(null==(_this_$container2=this.$container)||null==(_this_$container_addEventListener2=_this_$container2.addEventListener)||_this_$container_addEventListener2.call(_this_$container2,"mouseenter",this._onShow),null==(_this_$container3=this.$container)||null==(_this_$container_addEventListener3=_this_$container3.addEventListener)||_this_$container_addEventListener3.call(_this_$container3,"mouseover",this._onShow),null==(_this_$container4=this.$container)||null==(_this_$container_addEventListener4=_this_$container4.addEventListener)||_this_$container_addEventListener4.call(_this_$container4,"mouseleave",this._onHide),this.$wrapperContent.addEventListener("mouseenter",this._onWrapperShow),this.$wrapperContent.addEventListener("mouseleave",this._onHide));this._$mask&&this._$mask.addEventListener("click",this._onHide),this._options.isMobile||(window.addEventListener("blur",this._onHide),document.addEventListener("visibilitychange",this._onHide),window.addEventListener("resize",this._onHide),document.addEventListener("click",this._onDocumentClick))},_proto._onContentClick=function(e){pickerProvider.closeOther(e)},_proto._onShow=function(){this._disabled||(this.open=!0)},_proto._onWrapperShow=function(){this._disabled||this._onShow()},_proto._onHide=function(e){this._open&&!this._disabled&&((null==e?void 0:e.target)===this._$mask&&(null==e||e.stopPropagation()),this.open=!1)},_proto._onDocumentClick=function(event){var _this_$container;if(!this.$wrapperContent.contains(event.target)&&this.$wrapperContent!==event.target&&!(null==(_this_$container=this.$container)?void 0:_this_$container.contains(event.target))&&this.$container!==event.target){if(this._disabled)return;this._onHide()}},_create_class(Picker,[{key:"open",get:function(){return this._open},set:function(open){var _this=this;this._disabled||this._open!==!!open&&(this._animationTimerClear(),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=open?setTimeout((function(){_this.$wrapperContent&&(_this.$wrapperContent.style.display="inline-flex",_this.$wrapperContent.style.pointerEvents="",_this._options.isMobile&&document.body.classList.add("epicker-body-noscroll"),_this._animationTimer=setTimeout((function(){_this._animationTimerClear(),_this.$wrapperContent.style.opacity="1"}),0),requestAnimationFrame((function(){_this._setPlacement()})),_this._OpenChange=open,_this._onOpenChange(open))}),1e3*(this._options.mouseEnterDelay<0?0:this._options.mouseEnterDelay)):setTimeout((function(){_this.$wrapperContent&&(_this.$wrapperContent.style.opacity="0",_this.$wrapperContent.style.pointerEvents="none",_this._options.isMobile&&document.body.classList.remove("epicker-body-noscroll"),_this._animationTimer=setTimeout((function(){_this._animationTimerClear(),_this.$wrapperContent.style.display="none"}),301),_this._OpenChange=open,_this._onOpenChange(open))}),1e3*(this._options.mouseLeaveDelay<0?0:this._options.mouseLeaveDelay)),this._OpenChange===open&&this._timer&&(clearTimeout(this._timer),this._timer=null),this._open=!!open)}},{key:"disabled",get:function(){return this._disabled},set:function(disabled){var _this_$container_classList_add,_this_$container_classList,_this_$container,_this_$container_classList_remove,_this_$container_classList1,_this_$container1;disabled?null==(_this_$container=this.$container)||null==(_this_$container_classList=_this_$container.classList)||null==(_this_$container_classList_add=_this_$container_classList.add)||_this_$container_classList_add.call(_this_$container_classList,"epicker-disabled"):null==(_this_$container1=this.$container)||null==(_this_$container_classList1=_this_$container1.classList)||null==(_this_$container_classList_remove=_this_$container_classList1.remove)||_this_$container_classList_remove.call(_this_$container_classList1,"epicker-disabled");this._disabled=disabled}}]),Picker}();return Picker.VERSION="1.1.5",dist$6=Picker}var dist$5,hasRequiredDist$5,Picker=getDefaultExportFromCjs$1(requireDist$6());function requireDist$5(){if(hasRequiredDist$5)return dist$5;hasRequiredDist$5=1;if("undefined"!=typeof Element&&!Element.prototype.matches){const proto=Element.prototype;proto.matches=(null==proto?void 0:proto.matchesSelector)||(null==proto?void 0:proto.mozMatchesSelector)||(null==proto?void 0:proto.msMatchesSelector)||(null==proto?void 0:proto.oMatchesSelector)||(null==proto?void 0:proto.webkitMatchesSelector)}var closest$1="function"==typeof Element.prototype.closest?function(element,selector){return element&&element.closest(selector)}:function(element,selector){for(;element&&9!==element.nodeType;){if("function"==typeof element.matches&&element.matches(selector))return element;element=element.parentNode}return null};function _delegate(element,selector,type,callback,useCapture){const listenerFn=listener.apply(this,arguments);return element.addEventListener(type,listenerFn,useCapture),{destroy:function(){element.removeEventListener(type,listenerFn,useCapture)}}}function listener(element,selector,type,callback){return function(e){e.delegateTarget=closest$1(e.target,selector),e.delegateTarget&&callback.call(element,e)}}return dist$5=function(elements,selector,type,callback,useCapture){return"function"==typeof elements.addEventListener?_delegate.apply(null,arguments):"function"==typeof type?_delegate.bind(null,document).apply(null,arguments):("string"==typeof elements&&(elements=document.querySelectorAll(elements)),Array.prototype.map.call(elements,(function(element){return _delegate(element,selector,type,callback,useCapture)})))},dist$5}var dist$3,hasRequiredDist$4,hasRequiredDist$3,delegate=getDefaultExportFromCjs$1(requireDist$5()),dist$4={};function requireDist$4(){if(hasRequiredDist$4)return dist$3;function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}hasRequiredDist$4=1;var _$DRAG_SCROLL_DEFAULT_OPTIONS$_={content:"",width:"100%",height:"400px",readonly:!1,hideScrollbar:!1};return dist$3=function(){function DragScroll(container,options){if(void 0===options&&(options={}),this._indicatorTimeout=null,this._$scrollbar=null,this._$scrollbarThumb=null,this._readonly=!1,!container)throw new Error("container is required");if(["VIDEO","CANVAS","IMG","TEXTAREA","INPUT"].includes(container.tagName))throw new Error("container cannot be 'VIDEO', 'CANVAS', 'IMG', 'TEXTAREA', 'INPUT' element");this.$container=container,this.options=Object.assign({},_$DRAG_SCROLL_DEFAULT_OPTIONS$_,options),this.$container.classList.add("drag-scroll","drag-scroll-container"),this.$content=document.createElement("div"),this.$content.classList.add("drag-scroll-content"),this.innerHtml(this.options.content),this.$container.appendChild(this.$content),this.isDragging=!1,this._startY=0,this.currentY=0,this.velocity=0,this._animationId=null,this._lastTimestamp=0,this._spring=.25,this._friction=.92,this._bounceDamping=.6,this._maxVelocity=30,this.options.hideScrollbar||this._renderScrollbar(),this._onMouseDown=this._onMouseDown.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this.readonly=this.options.readonly,this._init()}var _proto=DragScroll.prototype;return _proto.resize=function(width,height){var css="";/^\d+(\.\d+)?$/.test(width+"")?css="width: "+width+"px;":"string"==typeof width&&(css="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?css+="height: "+height+"px;":"string"==typeof height&&(css+="height: "+height+";"),this.$container.style.cssText+=css,this._applyTransform()},_proto.innerHtml=function(html){this.$content.innerHTML="function"==typeof html?html():html,this._applyTransform()},_proto.scrollToY=function(y,triggerChange){void 0===triggerChange&&(triggerChange=!0);var maxScroll=this.$content.scrollHeight-this.$container.clientHeight;y<0||y>maxScroll||(this.currentY=y,this.velocity=0,this._applyTransform(),triggerChange&&this._updateState())},_proto.destroy=function(){var _this__$scrollbarThumb,_this__$scrollbar,_this_$content;this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=null),this._indicatorTimeout&&(clearTimeout(this._indicatorTimeout),this._indicatorTimeout=null),this.$container&&(this.$container.style.cursor="default"),null==(_this__$scrollbarThumb=this._$scrollbarThumb)||_this__$scrollbarThumb.remove(),this._$scrollbarThumb=null,null==(_this__$scrollbar=this._$scrollbar)||_this__$scrollbar.remove(),this._$scrollbar=null,null==(_this_$content=this.$content)||_this_$content.remove(),this.$content=null,this._removeEventListeners()},_proto._renderScrollbar=function(){this._$scrollbar=document.createElement("div"),this._$scrollbar.className="drag-scroll-scrollbar",this._$scrollbarThumb=document.createElement("div"),this._$scrollbarThumb.className="drag-scroll-scrollbar-thumb",this._$scrollbar.appendChild(this._$scrollbarThumb),this.$container.appendChild(this._$scrollbar)},_proto._init=function(){this.resize(this.options.width,this.options.height),this._addEventListeners(),this._updateScrollbar(),this._animationId=requestAnimationFrame(this._animate.bind(this))},_proto._addEventListeners=function(){this.$container.addEventListener("pointerdown",this._onMouseDown),document.addEventListener("pointermove",this._onMouseMove),document.addEventListener("pointerup",this._onMouseUp),document.addEventListener("pointercancel",this._onMouseUp)},_proto._removeEventListeners=function(){this.$container.removeEventListener("touchmove",this._onTouchMove),this.$container.removeEventListener("pointerdown",this._onMouseDown),document.removeEventListener("pointermove",this._onMouseMove),document.removeEventListener("pointerup",this._onMouseUp),document.removeEventListener("pointercancel",this._onMouseUp)},_proto._onMouseDown=function(e){this.canDrag&&(this._startDrag(e.clientY),null==this.options.onDragStart||this.options.onDragStart.call(this.options,e))},_proto._onTouchMove=function(e){e.preventDefault()},_proto._startDrag=function(clientY){var _this__$scrollbar_classList,_this__$scrollbar;this.canDrag&&(this.isDragging=!0,this._startY=clientY,this.velocity=0,null==(_this__$scrollbar=this._$scrollbar)||null==(_this__$scrollbar_classList=_this__$scrollbar.classList)||_this__$scrollbar_classList.add("drag-scroll-show"),this.$container.style.cursor="grabbing")},_proto._onMouseMove=function(e){this.canDrag&&this.isDragging&&(this._drag(e.clientY),null==this.options.onDragging||this.options.onDragging.call(this.options,0,this.currentY))},_proto._drag=function(clientY){if(this.canDrag){var deltaY=this._startY-clientY;this._startY=clientY,this.currentY+=deltaY,this.velocity=deltaY,this.velocity=Math.max(Math.min(this.velocity,this._maxVelocity),-this._maxVelocity),this._applyTransform(),this._updateState()}},_proto._onMouseUp=function(e){this.canDrag&&this.isDragging&&(this.isDragging=!1,this._endDrag(),null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,e))},_proto._endDrag=function(){var _this=this;this.$container.style.cursor="grab",setTimeout((function(){var _this__$scrollbar;_this.isDragging||null==(_this__$scrollbar=_this._$scrollbar)||_this__$scrollbar.classList.remove("drag-scroll-show")}),1500)},_proto._applyTransform=function(){if(this.$content.offsetHeight<=this.$container.clientHeight)this.$content.style.transform="translate3d(0, 0, 0)";else{var maxScroll=this.$content.scrollHeight-this.$container.clientHeight;this.currentY<0?(this.currentY=0,this.velocity*=this._bounceDamping):this.currentY>maxScroll&&(this.currentY=maxScroll,this.velocity*=this._bounceDamping),this.$content.style.transform="translate3d(0, "+-this.currentY+"px, 0)",this._updateScrollbar()}},_proto._animate=function(timestamp){if(void 0===timestamp&&(timestamp=0),this._animationId&&(cancelAnimationFrame(this._animationId),this._animationId=null),!(this.$content.offsetHeight<=this.$container.clientHeight)){this._lastTimestamp||(this._lastTimestamp=timestamp);var deltaTime=Math.min(timestamp-this._lastTimestamp,100)/16;if(this._lastTimestamp=timestamp,!this.isDragging){this.velocity*=this._friction,this.currentY+=this.velocity;var maxScroll=this.$content.scrollHeight-this.$container.clientHeight;this.currentY<0?this.velocity-=this.currentY*this._spring*deltaTime:this.currentY>maxScroll&&(this.velocity-=(this.currentY-maxScroll)*this._spring*deltaTime),this._applyTransform(),this._updateState(),Math.abs(this.velocity)<.1&&this.currentY>=0&&this.currentY<=maxScroll&&(this.velocity=0)}}},_proto._updateScrollbar=function(){var containerHeight=this.$container.clientHeight,contentHeight=this.$content.scrollHeight,maxScroll=contentHeight-containerHeight;if(maxScroll<=0)this._$scrollbarThumb&&(this._$scrollbarThumb.style.height="0");else{var thumbHeight=Math.max(containerHeight/contentHeight*containerHeight,20),thumbPosition=this.currentY/maxScroll*(containerHeight-thumbHeight);this._$scrollbarThumb&&(this._$scrollbarThumb.style.height=thumbHeight+"px",this._$scrollbarThumb.style.transform="translateY("+thumbPosition+"px)")}},_proto._updateState=function(){null==this.options.onChange||this.options.onChange.call(this.options,{x:0,y:this.currentY,velocity:+this.velocity.toFixed(1)})},_create_class(DragScroll,[{key:"width",get:function(){return this.$container.clientWidth}},{key:"height",get:function(){return this.$container.clientHeight}},{key:"readonly",get:function(){return this._readonly},set:function(value){this._readonly!==value&&(this.$container.style.cursor=value?"not-allowed":"grab",this._readonly=value),this.$container.removeEventListener("touchmove",this._onTouchMove),value||this.$container.addEventListener("touchmove",this._onTouchMove,{passive:!1})}},{key:"canDrag",get:function(){var offsetHeight=this.$content.offsetHeight;return!this.readonly&&offsetHeight>this.$container.clientHeight}}]),DragScroll}()}
8
8
  /*
9
9
  * @ezuikit/control-time-line v1.0.2
10
10
  * Copyright (c) 2025-11-16 Ezviz-OpenBiz
11
11
  * Released under the MIT License.
12
- */var z=function(){if(k)return D;k=1;var t=e,n=s,i=T(),r=L(),o=S(),a={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}},l={current:new Date,language:"zh",timeSections:[],readOnly:!1,className:"",timeWidth:0,width:"100%",timePointColor:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},c=function(){function e(e,i){if(this._current=new Date,this._readOnly=!1,this._width=0,this._height=0,this._destroyed=!1,this._timeWidth=0,this._timeSections=[],this.$container=e,!e)throw new Error("container is required");var r,o;this.options=t(l,i,{clone:!1}),this.options.timeSections&&Array.isArray(this.options.timeSections)&&(this._timeSections=this.options.timeSections),this.options.readOnly&&(this.readOnly=this.options.readOnly),this.options.className&&this.$container.classList.add(this.options.className),this.$container.style.position="relative",this.options.current&&(r=this.options.current,null!=(o=Date)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](r):r instanceof o)?this._current=this.options.current||new Date:this._current=new Date,this.i18n=new n(t(a,this.options.locales||{},{clone:!1}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height)}var i,r,o=e.prototype;return o.setReadOnly=function(e){this.readOnly=e},o.update=function(e){this._current=e},o.updateTimeSections=function(e){e&&Array.isArray(e)&&(this._timeSections=e)},o.resize=function(e,t){this._resize(e,t)},o._resize=function(e,t){var n="";/^\d+(\.\d+)?$/.test(e+"")?n+="width: "+e+"px;":e&&(n+="width: "+e+";"),/^\d+(\.\d+)?$/.test(t+"")?n+="height: "+t+"px;":t&&(n+="height: "+t+";"),this.$container&&(this.$container.style.cssText+=n),this._width=Math.floor(this.$container.clientWidth),this._height=Math.floor(this.$container.clientHeight)},o.setTimeWidth=function(e){[0,1,2,3,4,5].includes(e)&&(this._timeWidth=e)},o.destroy=function(){this._current=null,null==this.options.onDestroy||this.options.onDestroy.call(this.options),this._timeSections=[],this._readOnly=!1,this._destroyed=!0},i=e,(r=[{key:"current",get:function(){return this._current},set:function(e){this._current=e}},{key:"readOnly",get:function(){return this._readOnly},set:function(e){this._readOnly!==e&&(this._readOnly=e,this.$container.style.cursor=e?"not-allowed":"pointer")}},{key:"timeSections",get:function(){return this._timeSections}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"timeWidth",get:function(){return this._timeWidth}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(i.prototype,r),e}();c.LOCALES=a;var d=function(){function e(){}return e.toDate=function(e){var t,n,i=null;return"string"==typeof e&&e.includes(":")?i=new Date(e):"string"!=typeof e&&"number"!=typeof e||!/\d/.test(e+"")||10!==(e+"").length?"string"!=typeof e&&"number"!=typeof e||!/\d/.test(e+"")||13!==(e+"").length?(t=e,i=(null!=(n=Date)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](t):t instanceof n)?e:new Date):i=new Date(+e):i=new Date(1e3*+e),i},e.formatDateToHHmmss=function(t){var n=e.toDate(t);if(n){var i=n.getHours(),r=n.getMinutes(),o=n.getSeconds();return(i>9?i:"0"+i)+":"+(r>9?r:"0"+r)+":"+(o>9?o:"0"+o)}return"00:00:00"},e.subTime=function(e){return+e>9?e+"":"0"+e},e.tranTime=function(t,n){void 0===n&&(n="YYYY-MM-DD HH:mm:ss");var i=e.toDate(t);return i?"YYYY-MM-DD"===n?i.getFullYear()+"-"+e.subTime(i.getMonth()+1)+"-"+e.subTime(i.getDate()):"HH:mm:ss"===n?e.subTime(i.getHours())+":"+e.subTime(i.getMinutes())+":"+e.subTime(i.getSeconds()):"HH"===n?e.subTime(i.getHours()):"mm:ss"===n?e.subTime(i.getMinutes())+":"+e.subTime(i.getSeconds()):"HH:mm"===n?e.subTime(i.getHours())+":"+e.subTime(i.getMinutes()):"YYYYMMDDTHHmmssZ"===n?i.getFullYear()+""+e.subTime(i.getMonth()+1)+e.subTime(i.getDate())+"T"+e.subTime(i.getHours())+e.subTime(i.getMinutes())+e.subTime(i.getSeconds())+"Z":i.getFullYear()+"-"+e.subTime(i.getMonth()+1)+"-"+e.subTime(i.getDate())+" "+e.subTime(i.getHours())+":"+e.subTime(i.getMinutes())+":"+e.subTime(i.getSeconds()):""},e.timeToSecond=function(e){var t=e.split(":");return 60*Number(t[0])*60+60*Number(t[1])+(Number(t[2])||0)},e.minuteToTime=function(e){var t=Math.floor(e/60),n=e%60;return(t>9?t:"0"+t)+":"+(n>9?n:"0"+n)},e.timeToMinute=function(e){var t=e.split(":");return 60*Number(t[0])+Number(t[1])},e.isOverlap=function(e,t,n,i){return Math.max(e,n)<=Math.min(t,i)},e.tranTimeToString=function(t,n){var i,r,o=Math.floor((null==(i=e.toDate(n))?void 0:i.getTime())-(null==(r=e.toDate(t))?void 0:r.getTime()))/1e3,a=o%60,s=Math.floor(o/60);return(s>0?e.subTime(s)+"'":"0'")+e.subTime(a)+"''"},e}(),u=[[1,10,10,"单位 1秒"],[60,20,5,"单位 1分钟"],[600,20,6,"单位 10分钟"],[3600,30,6,"单位 1小时"],[14400,40,2,"单位 4小时"],[43200,80,2,"单位 12小时"]],p=[[1,10,10,"单位 1分钟"],[10,20,5,"单位 10分钟"],[30,20,6,"单位 30分钟"],[60,30,6,"单位 1小时"],[120,40,2,"单位 2小时"],[240,80,2,"单位 4小时"]];function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},h.apply(this,arguments)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}var A=Object.assign({},l,{height:400,width:"100%",timeWidth:0,readOnly:!1,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:!0}),f=function(e){function n(n,i){var r;return(r=e.call(this,n,t(A,i,{clone:!1}))||this)._isTouchStart=!1,r._dragScroll=null,r._moveStartX=0,r._moveStartY=0,r.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},r._plusClick=r._plusClick.bind(r),r._minusClick=r._minusClick.bind(r),r._onPickerClose=r._onPickerClose.bind(r),r._onClickItem=r._onClickItem.bind(r),r._onClickCoverFold=r._onClickCoverFold.bind(r),r._onImageError=r._onImageError.bind(r),r._render(),r.options.timeSections&&Array.isArray(r.options.timeSections)&&r.updateTimeSections(r.options.timeSections),r}!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&&m(e,t)}(n,e);var a,s,l=n.prototype;return l.setReadOnly=function(t){e.prototype.setReadOnly.call(this,t),this._dragScroll&&(this._dragScroll.readonly=t)},l.setTimeWidth=function(t){p[t]&&(e.prototype.setTimeWidth.call(this,t),this._matchTimeDot())},l.updateTimeSections=function(t,n){e.prototype.updateTimeSections.call(this,t);var i=t.map((function(e){return h({},e,{startTime:d.formatDateToHHmmss(e.startTime),endTime:d.formatDateToHHmmss(e.endTime)})}));if(i.length>0){void 0===n&&(n=i.length-1);var r=this.state.current;this._setState({availTimeLine:i,start:i[n].startTime,end:i[n].endTime,current:null===r?i[n].startTime:r}),this._matchTimeDot()}else this._setState({availTimeLine:[],current:d.formatDateToHHmmss(this.current||(new Date).getTime())}),this._matchTimeDot()},l.update=function(e){var t;e&&!(null==(t=this._dragScroll)?void 0:t.isDragging)&&(this._setState({current:d.tranTime(e,"HH:mm:ss")}),this._currentOffsetH())},l.destroy=function(){var t,n,i;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null}catch(e){}if(this._$itemList&&this._imageRemoveErrorEvent(this._$itemList.querySelectorAll("img.ez-time-line-img")||[]),this._$itemContainer&&this._$itemList)try{this._$itemContainer.removeChild(this._$itemList),this._$itemList=null}catch(e){}if(this._$itemContainer)try{this.$container.removeChild(this._$itemContainer),this._$itemContainer=null}catch(e){}if(this._$op)try{this.$container.removeChild(this._$op),this._$op=null}catch(e){}this._picker&&(this._imageRemoveErrorEvent((null==(i=this._picker.$body)||null==(n=i.querySelectorAll)?void 0:n.call(i,"img"))||[]),this._picker.destroy(),this._picker=null),this._removeEventListener(),null==(t=this._dragScroll)||t.destroy(),this._dragScroll=null,e.prototype.destroy.call(this)},l._setState=function(e){var t=this;Object.keys(e).forEach((function(n){var i,r;"current"===n&&e[n]?(t._setCurrentDOM(e[n]),t.state.current===e[n]||(null==(i=t._dragScroll)?void 0:i.isDragging)||(t.state[n]=e[n],t.current=new Date(d.tranTime((null==(r=t.timeSections[0])?void 0:r.endTime)||(new Date).getTime(),"YYYY-MM-DD")+" "+e[n]),null==t.options.onChange||t.options.onChange.call(t.options,t.current))):t.state[n]=e[n]}))},l._setCurrentDOM=function(e){this._$currentTime&&(this._$currentTime.querySelector(".ez-time-line-current-value").innerHTML=e)},l._matchTimeDot=function(){for(var e=this._scaleWidth,t=[],n=d.timeToMinute("24:00:00"),i=n=Math.floor(n/e)*e;i>=0;){var r=0,o=0;i==n&&(r=70),0==i&&(o=this.$container.clientHeight-70);var a=d.minuteToTime(i);t.push({id:i,current:a,label:"a"+i,marginTop:r,marginBottom:o,recArr:[],coverArr:this._filterTimeSectionsByTime(a)}),i-=e}this._setState({timeArr:t}),this._matchRecTimeDot()},l._matchRecTimeDot=function(){var e=this.state,t=e.availTimeLine,n=e.timeArr,i=this._scaleWidth,r=t.length;if(0===r)for(var o=0;o<n.length;o++)n[o].recArr=[];else{for(var a=0;a<n.length;a++)n[a].recArr=[];for(var s=0;s<r;s++){var l,c,u=t[s],p=d.timeToSecond(u.startTime),h=d.timeToSecond(u.endTime),m=Math.floor(p/(60*i))*i;l=(p-60*m)/i;var A=Math.floor(h/(60*i))*i;c=(h-60*A)/i;for(var f=0;f<n.length;f++)if(n[f].id==m&&n[f].id==A){var v=c-l,g=60-c;n[f].recArr.push({height:v,top:g})}else n[f].id==m?n[f].recArr.push({height:60-l,top:0}):n[f].id==A?n[f].recArr.push({height:c,top:60-c}):n[f].id>m&&n[f].id<A&&n[f].recArr.push({height:60,top:0})}}this._setState({timeArr:n}),this._renderDateLine()},l._renderDateLine=function(){var e=this,t=this.state.timeArr,n=this._$itemList;this._imageRemoveErrorEvent(n.querySelectorAll("img.ez-time-line-img")||[]),n.innerHTML="",t.forEach((function(t,i){var r=document.createElement("div");r.setAttribute("class","ez-time-line-time-scale-area"),t.marginTop&&(r.style.cssText+="margin-top: "+t.marginTop+"px;"),t.marginBottom&&(r.style.cssText+="margin-bottom: "+t.marginBottom+"px;"),r.style.cssText+="border-right-color: "+(e.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",r.setAttribute("data-time",t.current),r.setAttribute("data-index",i+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var o="";t.coverArr.length&&(o+='\n <div class="ez-time-line-time-cover-fold '+(t.coverArr.length>1?"ez-time-line-time-cover-fold-multiple":"")+'"\n data-start="'+t.current+'">\n '+(t.coverArr.length>1?'<div class="ez-time-line-cover-fold-placeholder" style="color: #FFF"></div>':"")+'\n <div class="ez-time-line-time-cover-fold-img">\n <img src="'+e._setImageScr(t.coverArr[0].coverPic)+'" class="ez-time-line-img"/>\n <span class="ez-time-line-time-cover-fold-len">\n '+(t.coverArr.length>1?e.i18n.t("foldTitle",{len:t.coverArr.length,unit:"videos"}):""+d.tranTime(t.coverArr[0].startTime,"HH:mm"))+"\n </span>\n "+(1===t.coverArr.length?'<span class="ez-time-line-time-cover-fold-time">'+d.tranTimeToString(t.coverArr[0].startTime,t.coverArr[0].endTime)+"</span>":"")+'\n <span class="ez-time-line-time-cover-fold-pause"><svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="pause">\n\t\t <path d="M9.43914 2.47881L13.4688 8.4912C14.3594 9.81998 13.4071 11.6047 11.8074 11.6047L3.74811 11.6047C2.14849 11.6047 1.19616 9.81998 2.08675 8.4912L6.11641 2.47881C6.90863 1.2968 8.64693 1.2968 9.43914 2.47881Z" fill-rule="evenodd" transform="matrix(0,1,-1,0,16.5781,2.22229)" />\n </svg>\n </span>\n </div>\n </div>'),t.recArr.forEach((function(t){o+='<div class="ez-time-line-time-unavail"\n style="height: '+t.height+"px;background-color:"+(e.options.timeSectionColor||"#369FFF")+"; top: "+t.top+'px">\n </div>'})),o+="<div id="+t.label+' class="ez-time-line-time-label" style="color: '+(e.options.timeTextColor||"#666")+'">'+t.current+"</div>",r.innerHTML=o,n.appendChild(r),e._imageErrorEvent(n.querySelectorAll("img.ez-time-line-img")||[])})),this._currentOffsetH()},l._currentOffsetH=function(){var e=this.state.current;if(e){var t,n=(86400-d.timeToSecond(e)||0)/this._scaleWidth;null==(t=this._dragScroll)||t.scrollToY(n+60,!1)}},l._render=function(){var e=this;if(this._$currentTime=document.createElement("div"),this._$currentTime.classList.add("ez-time-line-current"),this._$currentTime.innerHTML='<div class="ez-time-line-current-content" style="color: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip"><svg viewBox="0 0 57 24" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="tip">\n <path class="ez-time-line-icon-tip" fill-rule="evenodd" d="m4,0l44,0c2.2091,0 4,1.7909 4,4l0,3.8218l4.9399,3.3572c0.5839,0.3968 0.5839,1.2574 0,1.6542l-4.9399,3.3572l0,3.8096c0,2.2091 -1.7909,4 -4,4l-44,0c-2.2091,0 -4,-1.7909 -4,-4l0,-16c0,-2.2091 1.7909,-4 4,-4z"/>\n </svg></span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new r(this._$itemContainer,{hideScrollbar:!0,onChange:function(t){var n=e._offsetYToTime(t.y);n[1]!==e.state.current&&e._setCurrentDOM(n[0]>=86400?"23:59:59":n[1])},onDragStart:function(t){e._moveStartX=t.clientX,e._moveStartY=t.clientY,null==e.options.onDragStart||e.options.onDragStart.call(e.options,e.state.current)},onDragging:function(){null==e.options.onDragging||e.options.onDragging.call(e.options,e.state.current)},onDragEnd:function(){var t,n=e._offsetYToTime(null==(t=e._dragScroll)?void 0:t.currentY);n[1]!==e.state.current&&e._setState({current:n[0]>=86400?"23:59:59":n[1]}),null==e.options.onDragEnd||e.options.onDragEnd.call(e.options,e.state.current)}}),/\d/.test(this.options.height))this._$itemContainer.style.cssText+="height: "+this.options.height+"px";else if("string"==typeof this.options.height)this._$itemContainer.style.cssText+="height: "+this.options.height;else{var t=this.$container.clientHeight;this._$itemContainer.style.cssText+="height: "+t+"px"}this._$itemList=document.createElement("div"),this._$itemList.classList.add("ez-time-line-item"),this._dragScroll.$content.appendChild(this._$itemList),this.options.showTimeWidthBtn&&(this._$op=document.createElement("div"),this._$op.classList.add("ez-time-line-op"),this._$op.innerHTML='<span class="ez-time-line-op-wrapper"><span class="ez-time-line-icon-plus">\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n </span> <span class="ez-time-line-icon-minus">\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n </span></span>',this.$container.appendChild(this._$op)),this._picker=new i(null,{isMobile:!0,wrapClassName:"ez-time-line-picker",onOpenChange:function(t){var n,i;null==(i=e.options)||null==(n=i.onPickerOpenChange)||n.call(i,t)}}),this._addEventListener()},l._addEventListener=function(){var e,t;this.options.showTimeWidthBtn&&this._$op&&(null==(e=this._$op.querySelector(".ez-time-line-icon-plus"))||e.addEventListener("click",this._plusClick,!1),null==(t=this._$op.querySelector(".ez-time-line-icon-minus"))||t.addEventListener("click",this._minusClick,!1)),this._matchTimeDot(),this._picker&&(this._delegatePickerClose=o(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,!1),this._delegateItemContent=o(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,!1),this._delegateCoverFold=o(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,!1))},l._removeEventListener=function(){var e,t,n,i;this.options.showTimeWidthBtn&&this._$op&&(null==(e=this._$op.querySelector(".ez-time-line-icon-plus"))||e.removeEventListener("click",this._plusClick),null==(t=this._$op.querySelector(".ez-time-line-icon-minus"))||t.removeEventListener("click",this._minusClick)),this._picker&&(null==(i=this._picker.$body)||null==(n=i.querySelector(".ez-time-line-picker-close"))||n.removeEventListener("click",this._onPickerClose),this._delegateItemContent&&(this._delegateItemContent.forEach((function(e){e.destroy()})),this._delegateItemContent=null),this._delegatePickerClose&&(this._delegatePickerClose.forEach((function(e){e.destroy()})),this._delegatePickerClose=null),this._delegateCoverFold&&(this._delegateCoverFold.forEach((function(e){e.destroy()})),this._delegateCoverFold=null))},l._plusClick=function(){var e=this.timeWidth+1;e>0&&e<p.length&&this.setTimeWidth(e)},l._minusClick=function(){var e=this.timeWidth-1;e>=0&&e<p.length&&this.setTimeWidth(Math.floor(e))},l._timeSectionsToGroupsByHour=function(e){var t={};return e.forEach((function(e,n){var i=d.tranTime(e.startTime,"HH");t[+i]?t[+i].push(h({},e,{_index:n})):t[+i]=[h({},e,{_index:n})]})),t},l._filterTimeSectionsByTime=function(e){if(!e)return[];var t=d.timeToSecond(e+":00"),n=d.timeToSecond(e+":00")+60*this._scaleWidth;return this.timeSections.filter((function(e){var i=d.timeToSecond(d.tranTime(e.startTime,"HH:mm:ss"));return i>=t&&i<n}))},l._renderPickerContent=function(e){var t,n,i,r,o=this,a=this._filterTimeSectionsByTime(e),s=this._timeSectionsToGroupsByHour(a);null==(n=this._picker)||null==(t=n.innerHTML)||t.call(n,'<div class="ez-time-line-picker-container">\n <div class="ez-time-line-picker-header">\n <span class="ez-time-line-picker-close">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>\n '+this.i18n.t("title",{len:a.length,unit:a.length>1?"videos":"video"})+'\n </div>\n <div class="ez-time-line-picker-content">\n <div class="ez-time-line-picker-list">\n '+Object.keys(s).reverse().map((function(e){return'<div class="ez-time-line-picker-item">\n <div class="ez-time-line-picker-item-title">'+e+':00</div>\n <div class="ez-time-line-picker-item-list">\n '+s[e].reverse().map((function(e){return'<div class="ez-time-line-picker-item-content"\n data-start="'+d.tranTime(e.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+d.tranTime(e.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+e._index+'">\n <span class="ez-time-line-picker-item-time">'+d.tranTime(e.startTime,"HH:mm")+'</span>\n <span class="ez-time-line-picker-item-duration">\n '+d.tranTimeToString(e.startTime,e.endTime)+'\n </span>\n <img class="ez-time-line-picker-item-cover" src="'+o._setImageScr(e.coverPic)+'"/>\n </div>'})).join("")+"\n </div>\n </div>"})).join("")+"\n </div>\n </div>\n </div>\n </div>"),(null==(i=this._picker)?void 0:i.$body)&&this._imageErrorEvent((null==(r=this._picker)?void 0:r.$body.querySelectorAll("img"))||[])},l._imageErrorEvent=function(e){var t=this;void 0===e&&(e=[]),Array.from(e).forEach((function(e){e.hasAttribute("data-error")||e.addEventListener("error",t._onImageError)}))},l._imageRemoveErrorEvent=function(e){var t=this;void 0===e&&(e=[]),Array.from(e).forEach((function(e){e.removeEventListener("error",t._onImageError)}))},l._onImageError=function(e){var t=e.target;if(!t.hasAttribute("data-error")){var n,i=document.createElement("div");i.classList.add("ez-time-line-item-cover-placeholder"),i.innerHTML='\n <svg viewBox="0 0 19.1613 19.4583" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="picture">\n <path xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',null==(n=t.parentNode)||n.appendChild(i),t.remove()}},l._onPickerClose=function(){this._picker&&(this._picker.open=!1)},l._onClickItem=function(e){var t,n,i=null==(n=e.delegateTarget)||null==(t=n.getAttribute)?void 0:t.call(n,"data-index");this._picker&&(this._picker.open=!1),null==this.options.onPickerSelect||this.options.onPickerSelect.call(this.options,this.timeSections[+i])},l._onClickCoverFold=function(e){var t,n,i;e.preventDefault();var r=null==(i=e.delegateTarget)||null==(n=i.parentElement)||null==(t=n.getAttribute)?void 0:t.call(n,"data-time"),o=Math.abs(this._moveStartX-e.clientX),a=Math.abs(this._moveStartY-e.clientY);this._picker&&r&&!(o>=1||a>=1)&&(this._renderPickerContent(r),this._picker.open=!0)},l._setImageScr=function(e){if(e){var t="x=200&"+(this.options.coverQuery||"");return e+(e.includes("?")?"&":"?")+t}return""},l._offsetYToTime=function(e){var t,n=e;e<60&&(n=60,null==(t=this._dragScroll)||t.scrollToY(n));var i=86400-Math.floor((n-60)*this._scaleWidth);return[i,d.subTime(Math.floor(i/3600))+":"+d.subTime(Math.floor(i%3600/60))+":"+d.subTime(i%60)]},a=n,(s=[{key:"_scaleWidth",get:function(){return(p[this.timeWidth]||p[0])[0]}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(a.prototype,s),n}(c);function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},v.apply(this,arguments)}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}var y={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:!0},_=function(e){function n(n,i){var r;return(r=e.call(this,n,t(y,i,{clone:!0}))||this)._$canvas=null,r._ctx=null,r._timeWidthArray=u[0],r._centerPositionX=0,r._isMouseDown=!1,r._mousePosition=0,r._oldTime=null,r._isOver=!1,r._moved=!1,r._isCtrlKeyDown=!1,r._lastTouchDist=0,r.$container=n,r._mousemoveFun=r._mousemoveFun.bind(r),r._mouseoverFun=r._mouseoverFun.bind(r),r._mouseleaveFun=r._mouseleaveFun.bind(r),r._mousedownFun=r._mousedownFun.bind(r),r._mouseUpFun=r._mouseUpFun.bind(r),r._mousewheelFun=r._mousewheelFun.bind(r),r._touchstartFun=r._touchstartFun.bind(r),r._touchmoveFun=r._touchmoveFun.bind(r),r._touchendFun=r._touchendFun.bind(r),r._ctrlKeyDownFun=r._ctrlKeyDownFun.bind(r),r._ctrlKeyUpFun=r._ctrlKeyUpFun.bind(r),r._init(),r}!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&&g(e,t)}(n,e);var i,r,o=n.prototype;return o._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener()},o.resize=function(t,n){e.prototype.resize.call(this,t,n),this._$canvas&&t&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&n&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw()},o.setTimeWidth=function(e){this._update({timeWidth:e})},o.updateTimeSections=function(e){this._update({timeSections:e})},o.update=function(e){e&&!this._isMouseDown&&this._update({current:new Date(d.tranTime(e,"YYYY-MM-DD HH:mm:ss"))})},o._update=function(t){var n,i,r;void 0===t&&(t={}),(null==t?void 0:t.current)&&(n=t.current,null!=(i=Date)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](n):n instanceof i)&&(this.current=t.current),(null==t?void 0:t.timeSections)&&e.prototype.updateTimeSections.call(this,this._mergeTimeSections(t.timeSections)),"number"==typeof(null==t?void 0:t.timeWidth)&&(null==t?void 0:t.timeWidth)<u.length&&(e.prototype.setTimeWidth.call(this,t.timeWidth),this._timeWidthArray=u[Math.floor(this.timeWidth)]),"number"==typeof(null==t?void 0:t.timeWidth)&&this._timeWidthArray&&this._timeWidthArray[3]&&(null==(r=this._$canvas)||r.setAttribute("data-title",this._timeWidthArray[3])),this._draw()},o.setReadOnly=function(t){e.prototype.setReadOnly.call(this,t),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(t?"not-allowed":"pointer"))},o.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null}catch(e){}e.prototype.destroy.call(this)},o._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale()},o._drawScale=function(){var e=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var t={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},n=Math.floor(this.current.getTime()/1e3),i=(n-Math.floor(new Date(d.tranTime(new Date(1e3*n),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%this._timeWidthArray[0],r=this.height*this.options.dpr/20,o=this._curScaleSpacing*this.options.dpr,a=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-i)/this._timeWidthArray[0]*o),s=n-i,l=s+this._timeWidthArray[0],c=a-o;c>0;c-=o)0==(s-Math.floor(new Date(d.tranTime(new Date(1e3*s),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(c,r,c,r+(this.options.scaleOffsetTop+4)*this.options.dpr,e),this._drawTextString(d.tranTime(new Date(1e3*s)),c,r+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(c,r,c,r+this.options.scaleOffsetTop*this.options.dpr,e),s-=this._timeWidthArray[0];for(var u=a;u<=this.width*this.options.dpr;u+=o)0==(l-Math.floor(new Date(d.tranTime(new Date(1e3*l),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(u,r,u,r+(this.options.scaleOffsetTop+4)*this.options.dpr,e),this._drawTextString(d.tranTime(new Date(1e3*l)),u,r+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(u,r,u,r+this.options.scaleOffsetTop*this.options.dpr,e),l+=this._timeWidthArray[0];this._drawSolidLine(t.x,0,t.x,t.y,e,this.options.timePointColor)},o._drawSolidLine=function(e,t,n,i,r,o){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=o?o:this.options.timeScaleColor,this._ctx.lineWidth=r,this._ctx.beginPath(),this._ctx.moveTo(e,t),this._ctx.lineTo(n,i),this._ctx.stroke(),this._ctx.restore())},o._drawTextString=function(e,t,n,i){if(this._ctx){var r=e.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=i||"left",this._timeWidthArray[0]%60==0&&(r[1]=r[1].replace(/:00$/,"")),this._ctx.fillText(r[1],t,n+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==r[1]&&"00:00"!==r[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!=86400||(this._ctx.textAlign=i||"left",this._ctx.fillText(r[0],t,n+18*this.options.dpr))}},o._drawSections=function(){for(var e=this.timeSections||[],t=0;t<e.length;t++){var n=this._findPosition(e[t]);this._ctx&&d.isOverlap(0,this.width*this.options.dpr,n.x1,n.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(n.x1,0,n.x2-n.x1,this.height*this.options.dpr))}},o._findPosition=function(e){var t=(parseInt((e.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return{x1:t,x2:t+parseInt((e.endTime-e.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},o._mergeTimeSections=function(e){if(0===e.length)return e;for(var t=[(e=e.map((function(e){return 10===(e.startTime+"").length&&(e.startTime=1e3*e.startTime),10===(e.endTime+"").length&&(e.endTime=1e3*e.endTime),v({},e,{startTime:e.startTime,endTime:e.endTime})})))[0]],n=1;n<e.length;n++){var i=t[t.length-1],r=e[n];i.endTime>=r.startTime?i.endTime=Math.max(i.endTime,r.endTime):t.push(r)}return t},o._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",(function(e){e.preventDefault()}),{passive:!1}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,!1),document.addEventListener("keyup",this._ctrlKeyUpFun,!1),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:!1}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:!1}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:!1}))},o._removeEventListener=function(){this._$canvas&&(this._$canvas.removeEventListener("mousemove",this._mousemoveFun),this._$canvas.removeEventListener("mouseover",this._mouseoverFun),this._$canvas.removeEventListener("mouseleave",this._mouseleaveFun),this._$canvas.removeEventListener("mousedown",this._mousedownFun),this._$canvas.removeEventListener("mouseup",this._mouseUpFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun))},o._mousedownFun=function(e){this.readOnly||(this._isMouseDown=!0,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current))},o._mouseoverFun=function(){this.readOnly||(this._isOver=!0)},o._mouseleaveFun=function(e){this.readOnly||(this._isOver=!1,this._moveEndOrTouchEndFun(e))},o._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e)},o._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else{var t=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-t,this._update()}},o._mousewheelFun=function(e){e.preventDefault(),this.readOnly},o._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=!0)},o._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=!1)},o._getTouchDistance=function(e){var t=e[0],n=e[1],i=n.clientX-t.clientX,r=n.clientY-t.clientY;return Math.sqrt(i*i+r*r)},o._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=!0,1===e.touches.length){var t=e.touches[0];this._isMouseDown=!0,this._mousePosition=t.clientX}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches))},o._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var t=e.touches[0];this._moveUpdateFun(t.clientX)}else 2===e.touches.length&&(this._getTouchDistance(e.touches),this._lastTouchDist)},o._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e)},o._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=!1,this._moved&&(this._moved=!1,this._update({current:this.current}),this._oldTime=this.current,null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,this.current,this._isOver)),this._isOver&&Math.abs(this._mousePosition-(e.pageX||0))>5&&(null==this.options.onChange||this.options.onChange.call(this.options,this.current)),this._mousePosition=0,this._lastTouchDist=0)},o._moveUpdateFun=function(e){var t=this._mousePosition-e;if(0!==t){if(this._oldTime){var n=this._oldTime.getTime()+1e3*parseInt(t/this._curScaleSpacing*this._timeWidthArray[0]+"",10);this._update({current:new Date(n)}),null==this.options.onDragging||this.options.onDragging.call(this.options,new Date(n))}this._moved=!0}},i=n,(r=[{key:"_curScaleSpacing",get:function(){var e,t;return Math.floor((null==(e=this._timeWidthArray)?void 0:e[1])-(null==(t=this._timeWidthArray)?void 0:t[1])*+(this.timeWidth%1/2).toFixed(2))}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(i.prototype,r),n}(c);return _.TIME_WIDTH=u,D.BaseTimeLine=c,D.MobileTimeLine=f,D.TimeLine=_,D}(),x="ezplayer",O=0,I=1,R=2,M=["width","height","playing","volume","muted","loading","recType","isCurrentFullscreen","orientationAngle","zooming","zoom","recording","recordList","speed","urlInfo","videoLevelList","videoLevel"],N="CLEAR_TIMER_HEADER_FOOTER_ANIMATION",F=["rec","cloudRec","cloudRecord"],j=["deviceID","deviceName"],U=["capturePicture","volume","ptz","record","talk","definition","speed","globalFullscreen"],B={loading:"loading",play:"play",capturePicture:"capturePicture",volumechange:"volumechange",zoomChange:"zoomChange",zoomingChange:"zoomingChange",zoomTranslateChange:"zoomTranslateChange",audioInfo:"audioInfo",videoInfo:"videoInfo",firstFrameDisplay:"firstFrameDisplay",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen",fullscreenChange:"fullscreenChange",resize:"resize",orientationChange:"orientationChange",audioCodecUnsupported:"audioCodecUnsupported",changeTheme:"changeTheme",recTypeChange:"recTypeChange",definitionChange:"definitionChange",speedChange:"speedChange",recordingChange:"recordingChange",talkingChange:"talkingChange",talkVolumeChange:"talkVolumeChange",setLoggerOptions:"setLoggerOptions",records:"records",ptzSpeedChange:"ptzSpeedChange",setVideoLevelList:"setVideoLevelList",currentVideoLevel:"currentVideoLevel",currentVideoLevelAuto:"currentVideoLevelAuto",setAllDayRecTimes:"setAllDayRecTimes",getOSDTime:"getOSDTime",control:{play:"Control.play",playDestroy:"Control.playDestroy",capturePicture:"Control.capturePicture",capturePictureResult:"Control.capturePictureResult",capturePictureDestroy:"Control.capturePictureDestroy",volumechange:"Control.volumechange",volumePanelOpenChange:"Control.volumePanelOpenChange",volumeDestroy:"Control.volumeDestroy",controlsBarOpenChange:"Control.controlsBarOpenChange",headerMoreShowControlsChange:"Control.headerMoreShowControlsChange",headerMorePanelOpenChange:"Control.headerMorePanelOpenChange",footerMoreShowControlsChange:"Control.footerMoreShowControlsChange",footerMorePanelOpenChange:"Control.footerMorePanelOpenChange",deviceDestroy:"Control.deviceDestroy",recTypeChange:"Control.recTypeChange",recDestroy:"Control.recDestroy",definitionChange:"Control.definitionChange",definitionList:"Control.definitionList",definitionPanelOpenChange:"Control.definitionPanelOpenChange",definitionDestroy:"Control.definitionDestroy",speedChange:"Control.speedChange",speedPanelOpenChange:"Control.speedPanelOpenChange",speedDestroy:"Control.speedDestroy",ptzPanelOpenChange:"Control.ptzPanelOpenChange",ptzSpeedChange:"Control.ptzSpeedChange",ptzError:"Control.ptzError",ptzDestroy:"Control.ptzDestroy",recordingChange:"Control.recordingChange",recordDestroy:"Control.recordDestroy",talkingChange:"Control.talkingChange",talkError:"Control.talkError",talkDestroy:"Control.talkDestroy",zoomChange:"Control.zoomChange",zoomPanelOpenChange:"Control.zoomPanelOpenChange",zoomDestroy:"Control.zoomDestroy",fullscreenDestroy:"Control.fullscreenDestroy",globalFullscreenDestroy:"Control.globalFullscreenDestroy",datePanelOpenChange:"Control.datePanelOpenChange",dateChange:"Control.dateChange",dateDestroy:"Control.datePanelDestroy",timeLineChange:"Control.timeLineChange",timeLinePanelOpenChange:"Control.timeLinePanelOpenChange",timeLineDestroy:"Control.timeLineDestroy",beforeMountControls:"Control.beforeMountControls",mountedControls:"Control.mountedControls",beforeUnmountControls:"Control.beforeUnmountControls",unmountedControls:"Control.unmountedControls",posterDestroy:"Control.posterDestroy",loadingDestroy:"Control.loadingDestroy",messageDestroy:"Control.messageDestroy",contentDestroy:"Control.contentDestroy",contentRerender:"Control.contentRerender"},theme:{beforeDestroy:"Theme.beforeDestroy",destroyed:"Theme.destroyed",mobileExtendDestroy:"Theme.mobileExtendDestroy",recFooterDestroy:"Theme.recFooterDestroy"},message:"message"};
12
+ */var distExports$3=function(){if(hasRequiredDist$3)return dist$4;hasRequiredDist$3=1;var deepmerge$1=deepmerge,I18n=require$$1,Picker=requireDist$6(),DragScroll=requireDist$4(),delegate=requireDist$5(),_$TIMELINE_LOCALES$_={zh:{title:"包含{{len}}段录像",foldTitle:"{{len}}个录像"},en:{title:"Includes {{len}} {{unit}}",foldTitle:"{{len}} {{unit}}"}},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_={current:new Date,language:"zh",timeSections:[],readOnly:!1,className:"",timeWidth:0,width:"100%",timePointColor:"#1890ff",timeTextColor:"#FFF",timeScaleColor:"#FFF",timeSectionColor:"rgba(24, 144, 255, 0.5)",timeAxisBgColor:"#000",onChange:function(){},onDragStart:function(){},onDragging:function(){},onDragEnd:function(){},onDestroy:function(){}},BaseTimeLine=function(){function BaseTimeLine(container,options){if(this._current=new Date,this._readOnly=!1,this._width=0,this._height=0,this._destroyed=!1,this._timeWidth=0,this._timeSections=[],this.$container=container,!container)throw new Error("container is required");var left,right;this.options=deepmerge$1(_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:!1}),this.options.timeSections&&Array.isArray(this.options.timeSections)&&(this._timeSections=this.options.timeSections),this.options.readOnly&&(this.readOnly=this.options.readOnly),this.options.className&&this.$container.classList.add(this.options.className),this.$container.style.position="relative",this.options.current&&(left=this.options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?this._current=this.options.current||new Date:this._current=new Date,this.i18n=new I18n(deepmerge$1(_$TIMELINE_LOCALES$_,this.options.locales||{},{clone:!1}),{defaultLocale:this.options.language||"zh"}),this._timeWidth=this.options.timeWidth||0,this._resize(this.options.width||"100%",this.options.height)}var Constructor,protoProps,_proto=BaseTimeLine.prototype;return _proto.setReadOnly=function(readOnly){this.readOnly=readOnly},_proto.update=function(current){this._current=current},_proto.updateTimeSections=function(timeSections){timeSections&&Array.isArray(timeSections)&&(this._timeSections=timeSections)},_proto.resize=function(width,height){this._resize(width,height)},_proto._resize=function(width,height){var cssText="";/^\d+(\.\d+)?$/.test(width+"")?cssText+="width: "+width+"px;":width&&(cssText+="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?cssText+="height: "+height+"px;":height&&(cssText+="height: "+height+";"),this.$container&&(this.$container.style.cssText+=cssText),this._width=Math.floor(this.$container.clientWidth),this._height=Math.floor(this.$container.clientHeight)},_proto.setTimeWidth=function(timeWidth){[0,1,2,3,4,5].includes(timeWidth)&&(this._timeWidth=timeWidth)},_proto.destroy=function(){this._current=null,null==this.options.onDestroy||this.options.onDestroy.call(this.options),this._timeSections=[],this._readOnly=!1,this._destroyed=!0},Constructor=BaseTimeLine,(protoProps=[{key:"current",get:function(){return this._current},set:function(current){this._current=current}},{key:"readOnly",get:function(){return this._readOnly},set:function(readOnly){this._readOnly!==readOnly&&(this._readOnly=readOnly,this.$container.style.cursor=readOnly?"not-allowed":"pointer")}},{key:"timeSections",get:function(){return this._timeSections}},{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"timeWidth",get:function(){return this._timeWidth}}])&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),BaseTimeLine}();BaseTimeLine.LOCALES=_$TIMELINE_LOCALES$_;var TimeLineUtil=function(){function TimeLineUtil(){}return TimeLineUtil.toDate=function(time){var left,right,date=null;return"string"==typeof time&&time.includes(":")?date=new Date(time):"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||10!==(time+"").length?"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||13!==(time+"").length?(left=time,date=(null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)?time:new Date):date=new Date(+time):date=new Date(1e3*+time),date},TimeLineUtil.formatDateToHHmmss=function(time){var date=TimeLineUtil.toDate(time);if(date){var h=date.getHours(),m=date.getMinutes(),s=date.getSeconds();return(h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}return"00:00:00"},TimeLineUtil.subTime=function(m){return+m>9?m+"":"0"+m},TimeLineUtil.tranTime=function(time,fmt){void 0===fmt&&(fmt="YYYY-MM-DD HH:mm:ss");var newDate=TimeLineUtil.toDate(time);return newDate?"YYYY-MM-DD"===fmt?newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate()):"HH:mm:ss"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH"===fmt?TimeLineUtil.subTime(newDate.getHours()):"mm:ss"===fmt?TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):"HH:mm"===fmt?TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes()):"YYYYMMDDTHHmmssZ"===fmt?newDate.getFullYear()+""+TimeLineUtil.subTime(newDate.getMonth()+1)+TimeLineUtil.subTime(newDate.getDate())+"T"+TimeLineUtil.subTime(newDate.getHours())+TimeLineUtil.subTime(newDate.getMinutes())+TimeLineUtil.subTime(newDate.getSeconds())+"Z":newDate.getFullYear()+"-"+TimeLineUtil.subTime(newDate.getMonth()+1)+"-"+TimeLineUtil.subTime(newDate.getDate())+" "+TimeLineUtil.subTime(newDate.getHours())+":"+TimeLineUtil.subTime(newDate.getMinutes())+":"+TimeLineUtil.subTime(newDate.getSeconds()):""},TimeLineUtil.timeToSecond=function(time){var e=time.split(":");return 60*Number(e[0])*60+60*Number(e[1])+(Number(e[2])||0)},TimeLineUtil.minuteToTime=function(minute){var hour=Math.floor(minute/60),m=minute%60;return(hour>9?hour:"0"+hour)+":"+(m>9?m:"0"+m)},TimeLineUtil.timeToMinute=function(time){var e=time.split(":");return 60*Number(e[0])+Number(e[1])},TimeLineUtil.isOverlap=function(a_start,a_end,b_start,b_end){return Math.max(a_start,b_start)<=Math.min(a_end,b_end)},TimeLineUtil.tranTimeToString=function(start,end){var _TimeLineUtil_toDate,_TimeLineUtil_toDate1,secondNum=Math.floor((null==(_TimeLineUtil_toDate=TimeLineUtil.toDate(end))?void 0:_TimeLineUtil_toDate.getTime())-(null==(_TimeLineUtil_toDate1=TimeLineUtil.toDate(start))?void 0:_TimeLineUtil_toDate1.getTime()))/1e3,second=secondNum%60,minute=Math.floor(secondNum/60);return(minute>0?TimeLineUtil.subTime(minute)+"'":"0'")+TimeLineUtil.subTime(second)+"''"},TimeLineUtil}(),TIME_WIDTH=[[1,10,10,"单位 1秒"],[60,20,5,"单位 1分钟"],[600,20,6,"单位 10分钟"],[3600,30,6,"单位 1小时"],[14400,40,2,"单位 4小时"],[43200,80,2,"单位 12小时"]],MOBILE_TIME_WIDTH=[[1,10,10,"单位 1分钟"],[10,20,5,"单位 10分钟"],[30,20,6,"单位 30分钟"],[60,30,6,"单位 1小时"],[120,40,2,"单位 2小时"],[240,80,2,"单位 4小时"]];function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var _$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_=Object.assign({},_$BASE_TIME_LINE_DEFAULT_OPTIONS$_,{height:400,width:"100%",timeWidth:0,readOnly:!1,timePointColor:"#648FFC",timeTextColor:"#666666",timeScaleColor:"transparent",timeSectionColor:"#369FFF",timeAxisBgColor:"#BDCDFF",currentTimeBgColor:"#648FFC",currentTimeColor:"#FFFFFF",showTimeWidthBtn:!0}),MobileTimeLine=function(BaseTimeLine){function MobileTimeLine(container,options){var _this;return(_this=BaseTimeLine.call(this,container,deepmerge$1(_$MOBILE_TIME_LINE_DEFAULT_OPTIONS$_,options,{clone:!1}))||this)._isTouchStart=!1,_this._dragScroll=null,_this._moveStartX=0,_this._moveStartY=0,_this.state={start:"00:00:00",end:"24:00:00",current:null,timeArr:[],availTimeLine:[],index:0},_this._plusClick=_this._plusClick.bind(_this),_this._minusClick=_this._minusClick.bind(_this),_this._onPickerClose=_this._onPickerClose.bind(_this),_this._onClickItem=_this._onClickItem.bind(_this),_this._onClickCoverFold=_this._onClickCoverFold.bind(_this),_this._onImageError=_this._onImageError.bind(_this),_this._render(),_this.options.timeSections&&Array.isArray(_this.options.timeSections)&&_this.updateTimeSections(_this.options.timeSections),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$1(subClass,superClass)}(MobileTimeLine,BaseTimeLine);var Constructor,protoProps,_proto=MobileTimeLine.prototype;return _proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._dragScroll&&(this._dragScroll.readonly=readOnly)},_proto.setTimeWidth=function(timeWidth){MOBILE_TIME_WIDTH[timeWidth]&&(BaseTimeLine.prototype.setTimeWidth.call(this,timeWidth),this._matchTimeDot())},_proto.updateTimeSections=function(timeSections,defaultIndex){BaseTimeLine.prototype.updateTimeSections.call(this,timeSections);var list=timeSections.map((function(record){return _extends$1({},record,{startTime:TimeLineUtil.formatDateToHHmmss(record.startTime),endTime:TimeLineUtil.formatDateToHHmmss(record.endTime)})}));if(list.length>0){void 0===defaultIndex&&(defaultIndex=list.length-1);var current=this.state.current;this._setState({availTimeLine:list,start:list[defaultIndex].startTime,end:list[defaultIndex].endTime,current:null===current?list[defaultIndex].startTime:current}),this._matchTimeDot()}else this._setState({availTimeLine:[],current:TimeLineUtil.formatDateToHHmmss(this.current||(new Date).getTime())}),this._matchTimeDot()},_proto.update=function(time){var _this__dragScroll;time&&!(null==(_this__dragScroll=this._dragScroll)?void 0:_this__dragScroll.isDragging)&&(this._setState({current:TimeLineUtil.tranTime(time,"HH:mm:ss")}),this._currentOffsetH())},_proto.destroy=function(){var _this__dragScroll,_this__picker_$body_querySelectorAll,_this__picker_$body;if(this._scrollTimer&&(clearInterval(this._scrollTimer),this._scrollTimer=null),this._$currentTime)try{this.$container.removeChild(this._$currentTime),this._$currentTime=null}catch(error){}if(this._$itemList&&this._imageRemoveErrorEvent(this._$itemList.querySelectorAll("img.ez-time-line-img")||[]),this._$itemContainer&&this._$itemList)try{this._$itemContainer.removeChild(this._$itemList),this._$itemList=null}catch(error){}if(this._$itemContainer)try{this.$container.removeChild(this._$itemContainer),this._$itemContainer=null}catch(error){}if(this._$op)try{this.$container.removeChild(this._$op),this._$op=null}catch(error){}this._picker&&(this._imageRemoveErrorEvent((null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelectorAll=_this__picker_$body.querySelectorAll)?void 0:_this__picker_$body_querySelectorAll.call(_this__picker_$body,"img"))||[]),this._picker.destroy(),this._picker=null),this._removeEventListener(),null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.destroy(),this._dragScroll=null,BaseTimeLine.prototype.destroy.call(this)},_proto._setState=function(obj){var _this=this;Object.keys(obj).forEach((function(key){var _this__dragScroll,_this_timeSections_;"current"===key&&obj[key]?(_this._setCurrentDOM(obj[key]),_this.state.current===obj[key]||(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.isDragging)||(_this.state[key]=obj[key],_this.current=new Date(TimeLineUtil.tranTime((null==(_this_timeSections_=_this.timeSections[0])?void 0:_this_timeSections_.endTime)||(new Date).getTime(),"YYYY-MM-DD")+" "+obj[key]),null==_this.options.onChange||_this.options.onChange.call(_this.options,_this.current))):_this.state[key]=obj[key]}))},_proto._setCurrentDOM=function(time){this._$currentTime&&(this._$currentTime.querySelector(".ez-time-line-current-value").innerHTML=time)},_proto._matchTimeDot=function(){for(var scaleWidth=this._scaleWidth,timeArr=[],minute=TimeLineUtil.timeToMinute("24:00:00"),i=minute=Math.floor(minute/scaleWidth)*scaleWidth;i>=0;){var marginTop=0,marginBottom=0;i==minute&&(marginTop=70),0==i&&(marginBottom=this.$container.clientHeight-70);var time=TimeLineUtil.minuteToTime(i);timeArr.push({id:i,current:time,label:"a"+i,marginTop:marginTop,marginBottom:marginBottom,recArr:[],coverArr:this._filterTimeSectionsByTime(time)}),i-=scaleWidth}this._setState({timeArr:timeArr}),this._matchRecTimeDot()},_proto._matchRecTimeDot=function(){var _this_state=this.state,availTimeLine=_this_state.availTimeLine,timeArr=_this_state.timeArr,scaleWidth=this._scaleWidth,len=availTimeLine.length;if(0===len)for(var j=0;j<timeArr.length;j++)timeArr[j].recArr=[];else{for(var k=0;k<timeArr.length;k++)timeArr[k].recArr=[];for(var i=0;i<len;i++){var stAvailPercent,etAvailPercent,temp=availTimeLine[i],st=TimeLineUtil.timeToSecond(temp.startTime),et=TimeLineUtil.timeToSecond(temp.endTime),stMinute=Math.floor(st/(60*scaleWidth))*scaleWidth;stAvailPercent=(st-60*stMinute)/scaleWidth;var etMinute=Math.floor(et/(60*scaleWidth))*scaleWidth;etAvailPercent=(et-60*etMinute)/scaleWidth;for(var j1=0;j1<timeArr.length;j1++)if(timeArr[j1].id==stMinute&&timeArr[j1].id==etMinute){var height=etAvailPercent-stAvailPercent,top=60-etAvailPercent;timeArr[j1].recArr.push({height:height,top:top})}else timeArr[j1].id==stMinute?timeArr[j1].recArr.push({height:60-stAvailPercent,top:0}):timeArr[j1].id==etMinute?timeArr[j1].recArr.push({height:etAvailPercent,top:60-etAvailPercent}):timeArr[j1].id>stMinute&&timeArr[j1].id<etMinute&&timeArr[j1].recArr.push({height:60,top:0})}}this._setState({timeArr:timeArr}),this._renderDateLine()},_proto._renderDateLine=function(){var _this=this,timeArr=this.state.timeArr,container=this._$itemList;this._imageRemoveErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[]),container.innerHTML="",timeArr.forEach((function(item,index){var timeItemDOM=document.createElement("div");timeItemDOM.setAttribute("class","ez-time-line-time-scale-area"),item.marginTop&&(timeItemDOM.style.cssText+="margin-top: "+item.marginTop+"px;"),item.marginBottom&&(timeItemDOM.style.cssText+="margin-bottom: "+item.marginBottom+"px;"),timeItemDOM.style.cssText+="border-right-color: "+(_this.options.timeAxisBgColor||"rgba(189, 205, 255, 1)")+";",timeItemDOM.setAttribute("data-time",item.current),timeItemDOM.setAttribute("data-index",index+""),document.createElement("div").setAttribute("class","ez-time-line-scale");var timeItemHtml="";item.coverArr.length&&(timeItemHtml+='\n <div class="ez-time-line-time-cover-fold '+(item.coverArr.length>1?"ez-time-line-time-cover-fold-multiple":"")+'"\n data-start="'+item.current+'">\n '+(item.coverArr.length>1?'<div class="ez-time-line-cover-fold-placeholder" style="color: #FFF"></div>':"")+'\n <div class="ez-time-line-time-cover-fold-img">\n <img src="'+_this._setImageScr(item.coverArr[0].coverPic)+'" class="ez-time-line-img"/>\n <span class="ez-time-line-time-cover-fold-len">\n '+(item.coverArr.length>1?_this.i18n.t("foldTitle",{len:item.coverArr.length,unit:"videos"}):""+TimeLineUtil.tranTime(item.coverArr[0].startTime,"HH:mm"))+"\n </span>\n "+(1===item.coverArr.length?'<span class="ez-time-line-time-cover-fold-time">'+TimeLineUtil.tranTimeToString(item.coverArr[0].startTime,item.coverArr[0].endTime)+"</span>":"")+'\n <span class="ez-time-line-time-cover-fold-pause"><svg viewBox="0 0 20 20" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="pause">\n\t\t <path d="M9.43914 2.47881L13.4688 8.4912C14.3594 9.81998 13.4071 11.6047 11.8074 11.6047L3.74811 11.6047C2.14849 11.6047 1.19616 9.81998 2.08675 8.4912L6.11641 2.47881C6.90863 1.2968 8.64693 1.2968 9.43914 2.47881Z" fill-rule="evenodd" transform="matrix(0,1,-1,0,16.5781,2.22229)" />\n </svg>\n </span>\n </div>\n </div>'),item.recArr.forEach((function(i){timeItemHtml+='<div class="ez-time-line-time-unavail"\n style="height: '+i.height+"px;background-color:"+(_this.options.timeSectionColor||"#369FFF")+"; top: "+i.top+'px">\n </div>'})),timeItemHtml+="<div id="+item.label+' class="ez-time-line-time-label" style="color: '+(_this.options.timeTextColor||"#666")+'">'+item.current+"</div>",timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM),_this._imageErrorEvent(container.querySelectorAll("img.ez-time-line-img")||[])})),this._currentOffsetH()},_proto._currentOffsetH=function(){var current=this.state.current;if(current){var _this__dragScroll,y=(86400-TimeLineUtil.timeToSecond(current)||0)/this._scaleWidth;null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y+60,!1)}},_proto._render=function(){var _this=this;if(this._$currentTime=document.createElement("div"),this._$currentTime.classList.add("ez-time-line-current"),this._$currentTime.innerHTML='<div class="ez-time-line-current-content" style="color: '+(this.options.currentTimeBgColor||"#648FFC")+'">\n <span class="ez-time-line-current-tip"><svg viewBox="0 0 57 24" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="tip">\n <path class="ez-time-line-icon-tip" fill-rule="evenodd" d="m4,0l44,0c2.2091,0 4,1.7909 4,4l0,3.8218l4.9399,3.3572c0.5839,0.3968 0.5839,1.2574 0,1.6542l-4.9399,3.3572l0,3.8096c0,2.2091 -1.7909,4 -4,4l-44,0c-2.2091,0 -4,-1.7909 -4,-4l0,-16c0,-2.2091 1.7909,-4 4,-4z"/>\n </svg></span>\n <span class="ez-time-line-current-tip-line" style="background-color: '+(this.options.timePointColor||"#648FFC")+';"></span>\n <div class="ez-time-line-current-value" style="color: '+(this.options.currentTimeColor||"#FFFFFF")+'">00:00:00</div>\n </div>',this.$container.appendChild(this._$currentTime),this._$itemContainer=document.createElement("div"),this._$itemContainer.classList.add("ez-time-line-container"),this.$container.appendChild(this._$itemContainer),this._dragScroll=new DragScroll(this._$itemContainer,{hideScrollbar:!0,onChange:function(state){var result=_this._offsetYToTime(state.y);result[1]!==_this.state.current&&_this._setCurrentDOM(result[0]>=86400?"23:59:59":result[1])},onDragStart:function(e){_this._moveStartX=e.clientX,_this._moveStartY=e.clientY,null==_this.options.onDragStart||_this.options.onDragStart.call(_this.options,_this.state.current)},onDragging:function(){null==_this.options.onDragging||_this.options.onDragging.call(_this.options,_this.state.current)},onDragEnd:function(){var _this__dragScroll,result=_this._offsetYToTime(null==(_this__dragScroll=_this._dragScroll)?void 0:_this__dragScroll.currentY);result[1]!==_this.state.current&&_this._setState({current:result[0]>=86400?"23:59:59":result[1]}),null==_this.options.onDragEnd||_this.options.onDragEnd.call(_this.options,_this.state.current)}}),/\d/.test(this.options.height))this._$itemContainer.style.cssText+="height: "+this.options.height+"px";else if("string"==typeof this.options.height)this._$itemContainer.style.cssText+="height: "+this.options.height;else{var height=this.$container.clientHeight;this._$itemContainer.style.cssText+="height: "+height+"px"}this._$itemList=document.createElement("div"),this._$itemList.classList.add("ez-time-line-item"),this._dragScroll.$content.appendChild(this._$itemList),this.options.showTimeWidthBtn&&(this._$op=document.createElement("div"),this._$op.classList.add("ez-time-line-op"),this._$op.innerHTML='<span class="ez-time-line-op-wrapper"><span class="ez-time-line-icon-plus">\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="plus">\n <path d="M0 0L10.6667 0" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5" transform="matrix(0,1,-1,0,8,2.66663)"/>\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n </span> <span class="ez-time-line-icon-minus">\n <svg viewBox="0 0 16 16" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="minus">\n <path d="M2.66669 8L13.3334 8" stroke="rgb(44,44,44)" stroke-linecap="round" stroke-width="1.5"/>\n </svg>\n </span></span>',this.$container.appendChild(this._$op)),this._picker=new Picker(null,{isMobile:!0,wrapClassName:"ez-time-line-picker",onOpenChange:function(isOpen){var _this_options_onPickerOpenChange,_this_options;null==(_this_options=_this.options)||null==(_this_options_onPickerOpenChange=_this_options.onPickerOpenChange)||_this_options_onPickerOpenChange.call(_this_options,isOpen)}}),this._addEventListener()},_proto._addEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.addEventListener("click",this._plusClick,!1),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.addEventListener("click",this._minusClick,!1)),this._matchTimeDot(),this._picker&&(this._delegatePickerClose=delegate(this._picker.$body,".ez-time-line-picker-close","click",this._onPickerClose,!1),this._delegateItemContent=delegate(this._picker.$body,".ez-time-line-picker-item-content","click",this._onClickItem,!1),this._delegateCoverFold=delegate(this._$itemList,".ez-time-line-time-cover-fold","click",this._onClickCoverFold,!1))},_proto._removeEventListener=function(){var _this__$op_querySelector,_this__$op_querySelector1,_this__picker_$body_querySelector,_this__picker_$body;this.options.showTimeWidthBtn&&this._$op&&(null==(_this__$op_querySelector=this._$op.querySelector(".ez-time-line-icon-plus"))||_this__$op_querySelector.removeEventListener("click",this._plusClick),null==(_this__$op_querySelector1=this._$op.querySelector(".ez-time-line-icon-minus"))||_this__$op_querySelector1.removeEventListener("click",this._minusClick)),this._picker&&(null==(_this__picker_$body=this._picker.$body)||null==(_this__picker_$body_querySelector=_this__picker_$body.querySelector(".ez-time-line-picker-close"))||_this__picker_$body_querySelector.removeEventListener("click",this._onPickerClose),this._delegateItemContent&&(this._delegateItemContent.forEach((function(delegation){delegation.destroy()})),this._delegateItemContent=null),this._delegatePickerClose&&(this._delegatePickerClose.forEach((function(delegation){delegation.destroy()})),this._delegatePickerClose=null),this._delegateCoverFold&&(this._delegateCoverFold.forEach((function(delegation){delegation.destroy()})),this._delegateCoverFold=null))},_proto._plusClick=function(){var timeWidth=this.timeWidth+1;timeWidth>0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(timeWidth)},_proto._minusClick=function(){var timeWidth=this.timeWidth-1;timeWidth>=0&&timeWidth<MOBILE_TIME_WIDTH.length&&this.setTimeWidth(Math.floor(timeWidth))},_proto._timeSectionsToGroupsByHour=function(list){var obj={};return list.forEach((function(item,index){var hour=TimeLineUtil.tranTime(item.startTime,"HH");obj[+hour]?obj[+hour].push(_extends$1({},item,{_index:index})):obj[+hour]=[_extends$1({},item,{_index:index})]})),obj},_proto._filterTimeSectionsByTime=function(start){if(!start)return[];var startSecond=TimeLineUtil.timeToSecond(start+":00"),endSecond=TimeLineUtil.timeToSecond(start+":00")+60*this._scaleWidth;return this.timeSections.filter((function(item){var _$start=TimeLineUtil.timeToSecond(TimeLineUtil.tranTime(item.startTime,"HH:mm:ss"));return _$start>=startSecond&&_$start<endSecond}))},_proto._renderPickerContent=function(start){var _this__picker_innerHTML,_this__picker,_this__picker1,_this__picker2,_this=this,list=this._filterTimeSectionsByTime(start),hourGroups=this._timeSectionsToGroupsByHour(list);null==(_this__picker=this._picker)||null==(_this__picker_innerHTML=_this__picker.innerHTML)||_this__picker_innerHTML.call(_this__picker,'<div class="ez-time-line-picker-container">\n <div class="ez-time-line-picker-header">\n <span class="ez-time-line-picker-close">\n <svg viewBox="0 0 24 24" fill="none" width="1em" height="1em" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close">\n\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,0.707114,-0.707114,0.707099,6.34277,6.34326)" />\n\t\t <path d="M0 0L15.9998 0" stroke-linecap="round" stroke-width="1.5" transform="matrix(0.707099,-0.707114,0.707114,0.707099,6.34277,17.6567)" />\n </svg>\n </span>\n '+this.i18n.t("title",{len:list.length,unit:list.length>1?"videos":"video"})+'\n </div>\n <div class="ez-time-line-picker-content">\n <div class="ez-time-line-picker-list">\n '+Object.keys(hourGroups).reverse().map((function(key){return'<div class="ez-time-line-picker-item">\n <div class="ez-time-line-picker-item-title">'+key+':00</div>\n <div class="ez-time-line-picker-item-list">\n '+hourGroups[key].reverse().map((function(item){return'<div class="ez-time-line-picker-item-content"\n data-start="'+TimeLineUtil.tranTime(item.startTime,"YYYYMMDDTHHmmssZ")+'"\n data-end="'+TimeLineUtil.tranTime(item.endTime,"YYYYMMDDTHHmmssZ")+'"\n data-index="'+item._index+'">\n <span class="ez-time-line-picker-item-time">'+TimeLineUtil.tranTime(item.startTime,"HH:mm")+'</span>\n <span class="ez-time-line-picker-item-duration">\n '+TimeLineUtil.tranTimeToString(item.startTime,item.endTime)+'\n </span>\n <img class="ez-time-line-picker-item-cover" src="'+_this._setImageScr(item.coverPic)+'"/>\n </div>'})).join("")+"\n </div>\n </div>"})).join("")+"\n </div>\n </div>\n </div>\n </div>"),(null==(_this__picker1=this._picker)?void 0:_this__picker1.$body)&&this._imageErrorEvent((null==(_this__picker2=this._picker)?void 0:_this__picker2.$body.querySelectorAll("img"))||[])},_proto._imageErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach((function(img){img.hasAttribute("data-error")||img.addEventListener("error",_this._onImageError)}))},_proto._imageRemoveErrorEvent=function(list){var _this=this;void 0===list&&(list=[]),Array.from(list).forEach((function(img){img.removeEventListener("error",_this._onImageError)}))},_proto._onImageError=function(e){var img=e.target;if(!img.hasAttribute("data-error")){var _img_parentNode,placeholder=document.createElement("div");placeholder.classList.add("ez-time-line-item-cover-placeholder"),placeholder.innerHTML='\n <svg viewBox="0 0 19.1613 19.4583" fill="currentColor" width="1em" height="1em" focusable="false" aria-hidden="true" data-icon="picture">\n <path xmlns="http://www.w3.org/2000/svg" id="形状结合" d="M15.3276 2.63477L3.83173 2.63477C2.70848 2.63477 1.79541 3.55027 1.79541 4.68419L1.79541 14.7737C1.79541 15.9076 2.70848 16.8231 3.83173 16.8231L15.3276 16.8231C16.4504 16.8231 17.364 15.9074 17.364 14.7737L17.364 4.68419C17.364 3.55027 16.4509 2.63477 15.3276 2.63477ZM3.83247 3.851L15.3284 3.851C15.7936 3.851 16.1671 4.22551 16.1671 4.68429L16.1671 14.7738C16.1671 15.2323 15.7932 15.6071 15.3284 15.6071L3.83247 15.6071C3.36725 15.6071 2.99373 15.2326 2.99373 14.7738L2.99373 12.2622L6.7356 9.56381L6.78139 9.53916C6.84532 9.51493 6.91856 9.52524 6.9742 9.56947L13.2644 14.5698L13.3381 14.62C13.5918 14.7666 13.9197 14.7063 14.105 14.4658C14.3089 14.2014 14.263 13.8192 14.0026 13.6122L7.71239 8.61184L7.60526 8.5346C7.12945 8.22451 6.51026 8.23473 6.04222 8.57224L2.99373 10.7706L2.99373 4.68429C2.99373 4.22551 3.36725 3.851 3.83247 3.851ZM10.5794 7.29679C10.5794 6.06542 11.5624 5.0672 12.7749 5.0672C13.9875 5.0672 14.9705 6.06542 14.9705 7.29679C14.9705 8.52817 13.9875 9.52639 12.7749 9.52639C11.5624 9.52639 10.5794 8.52817 10.5794 7.29679ZM13.7722 7.2967C13.7722 6.73699 13.3254 6.28325 12.7742 6.28325C12.223 6.28325 11.7762 6.73699 11.7762 7.2967C11.7762 7.85642 12.223 8.31015 12.7742 8.31015C13.3254 8.31015 13.7722 7.85642 13.7722 7.2967Z" fill-rule="evenodd"/>\n </svg>\n ',null==(_img_parentNode=img.parentNode)||_img_parentNode.appendChild(placeholder),img.remove()}},_proto._onPickerClose=function(){this._picker&&(this._picker.open=!1)},_proto._onClickItem=function(e){var _e_delegateTarget_getAttribute,_e_delegateTarget,index=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_getAttribute=_e_delegateTarget.getAttribute)?void 0:_e_delegateTarget_getAttribute.call(_e_delegateTarget,"data-index");this._picker&&(this._picker.open=!1),null==this.options.onPickerSelect||this.options.onPickerSelect.call(this.options,this.timeSections[+index])},_proto._onClickCoverFold=function(e){var _e_delegateTarget_parentElement_getAttribute,_e_delegateTarget_parentElement,_e_delegateTarget;e.preventDefault();var time=null==(_e_delegateTarget=e.delegateTarget)||null==(_e_delegateTarget_parentElement=_e_delegateTarget.parentElement)||null==(_e_delegateTarget_parentElement_getAttribute=_e_delegateTarget_parentElement.getAttribute)?void 0:_e_delegateTarget_parentElement_getAttribute.call(_e_delegateTarget_parentElement,"data-time"),moveX=Math.abs(this._moveStartX-e.clientX),moveY=Math.abs(this._moveStartY-e.clientY);this._picker&&time&&!(moveX>=1||moveY>=1)&&(this._renderPickerContent(time),this._picker.open=!0)},_proto._setImageScr=function(src){if(src){var query="x=200&"+(this.options.coverQuery||"");return src+(src.includes("?")?"&":"?")+query}return""},_proto._offsetYToTime=function(offsetY){var _this__dragScroll,y=offsetY;offsetY<60&&(y=60,null==(_this__dragScroll=this._dragScroll)||_this__dragScroll.scrollToY(y));var second=86400-Math.floor((y-60)*this._scaleWidth);return[second,TimeLineUtil.subTime(Math.floor(second/3600))+":"+TimeLineUtil.subTime(Math.floor(second%3600/60))+":"+TimeLineUtil.subTime(second%60)]},Constructor=MobileTimeLine,(protoProps=[{key:"_scaleWidth",get:function(){return(MOBILE_TIME_WIDTH[this.timeWidth]||MOBILE_TIME_WIDTH[0])[0]}}])&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),MobileTimeLine}(BaseTimeLine);function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}var _$TIMELINE_DEFAULT_OPTIONS$_={height:36,dpr:window.devicePixelRatio||2,scaleOffsetTop:4,showYearMonthDay:!0},TimeLine=function(BaseTimeLine){function TimeLine(container,options){var _this;return(_this=BaseTimeLine.call(this,container,deepmerge$1(_$TIMELINE_DEFAULT_OPTIONS$_,options,{clone:!0}))||this)._$canvas=null,_this._ctx=null,_this._timeWidthArray=TIME_WIDTH[0],_this._centerPositionX=0,_this._isMouseDown=!1,_this._mousePosition=0,_this._oldTime=null,_this._isOver=!1,_this._moved=!1,_this._isCtrlKeyDown=!1,_this._lastTouchDist=0,_this.$container=container,_this._mousemoveFun=_this._mousemoveFun.bind(_this),_this._mouseoverFun=_this._mouseoverFun.bind(_this),_this._mouseleaveFun=_this._mouseleaveFun.bind(_this),_this._mousedownFun=_this._mousedownFun.bind(_this),_this._mouseUpFun=_this._mouseUpFun.bind(_this),_this._mousewheelFun=_this._mousewheelFun.bind(_this),_this._touchstartFun=_this._touchstartFun.bind(_this),_this._touchmoveFun=_this._touchmoveFun.bind(_this),_this._touchendFun=_this._touchendFun.bind(_this),_this._ctrlKeyDownFun=_this._ctrlKeyDownFun.bind(_this),_this._ctrlKeyUpFun=_this._ctrlKeyUpFun.bind(_this),_this._init(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}(TimeLine,BaseTimeLine);var Constructor,protoProps,_proto=TimeLine.prototype;return _proto._init=function(){this._$canvas=document.createElement("canvas"),this._ctx=this._$canvas.getContext("2d"),this.readOnly||(this._$canvas.style.cssText+="cursor: pointer;"),this.$container.appendChild(this._$canvas),this.resize(this.width,this.height),this._update({current:this.current,timeWidth:this.timeWidth,timeSections:this.timeSections}),this._addEventListener()},_proto.resize=function(width,height){BaseTimeLine.prototype.resize.call(this,width,height),this._$canvas&&width&&(this._$canvas.width=this.width*this.options.dpr,this._$canvas.style.cssText+="width: "+this.width+"px;"),this._$canvas&&height&&(this._$canvas.height=this.height*this.options.dpr,this._$canvas.style.cssText+="height: "+this.height+"px;"),this._draw()},_proto.setTimeWidth=function(timeWidth){this._update({timeWidth:timeWidth})},_proto.updateTimeSections=function(timeSections){this._update({timeSections:timeSections})},_proto.update=function(time){time&&!this._isMouseDown&&this._update({current:new Date(TimeLineUtil.tranTime(time,"YYYY-MM-DD HH:mm:ss"))})},_proto._update=function(options){var left,right,_this__$canvas;void 0===options&&(options={}),(null==options?void 0:options.current)&&(left=options.current,null!=(right=Date)&&"undefined"!=typeof Symbol&&right[Symbol.hasInstance]?right[Symbol.hasInstance](left):left instanceof right)&&(this.current=options.current),(null==options?void 0:options.timeSections)&&BaseTimeLine.prototype.updateTimeSections.call(this,this._mergeTimeSections(options.timeSections)),"number"==typeof(null==options?void 0:options.timeWidth)&&(null==options?void 0:options.timeWidth)<TIME_WIDTH.length&&(BaseTimeLine.prototype.setTimeWidth.call(this,options.timeWidth),this._timeWidthArray=TIME_WIDTH[Math.floor(this.timeWidth)]),"number"==typeof(null==options?void 0:options.timeWidth)&&this._timeWidthArray&&this._timeWidthArray[3]&&(null==(_this__$canvas=this._$canvas)||_this__$canvas.setAttribute("data-title",this._timeWidthArray[3])),this._draw()},_proto.setReadOnly=function(readOnly){BaseTimeLine.prototype.setReadOnly.call(this,readOnly),this._$canvas&&(this._$canvas.style.cssText+="cursor: "+(readOnly?"not-allowed":"pointer"))},_proto.destroy=function(){if(this._removeEventListener(),this._$canvas)try{this.$container.removeChild(this._$canvas),this._$canvas=null}catch(e){}BaseTimeLine.prototype.destroy.call(this)},_proto._draw=function(){this._ctx&&(this._ctx.fillStyle=this.options.timeAxisBgColor,this._ctx.fillRect(0,0,this.width*this.options.dpr,this.height*this.options.dpr)),this._drawSections(),this._drawScale()},_proto._drawScale=function(){var lineWidth=1*this.options.dpr;this._centerPositionX=parseInt(this.width*this.options.dpr/2+"");for(var centerPosition={x:this.width*this.options.dpr/2,y:this.height*this.options.dpr},curScaleTime=Math.floor(this.current.getTime()/1e3),offsetSecond=(curScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*curScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%this._timeWidthArray[0],padding=this.height*this.options.dpr/20,spacing=this._curScaleSpacing*this.options.dpr,rightLastScaleTimeX=Math.floor(this._centerPositionX+(this._timeWidthArray[0]-offsetSecond)/this._timeWidthArray[0]*spacing),leftLastScaleTime=curScaleTime-offsetSecond,rightLastScaleTime=leftLastScaleTime+this._timeWidthArray[0],x=rightLastScaleTimeX-spacing;x>0;x-=spacing)0==(leftLastScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x,padding,x,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*leftLastScaleTime)),x,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x,padding,x,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),leftLastScaleTime-=this._timeWidthArray[0];for(var x1=rightLastScaleTimeX;x1<=this.width*this.options.dpr;x1+=spacing)0==(rightLastScaleTime-Math.floor(new Date(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime),"YYYY-MM-DD")+" 00:00:00").getTime()/1e3))%(this._timeWidthArray[0]*this._timeWidthArray[2])?(this._drawSolidLine(x1,padding,x1,padding+(this.options.scaleOffsetTop+4)*this.options.dpr,lineWidth),this._drawTextString(TimeLineUtil.tranTime(new Date(1e3*rightLastScaleTime)),x1,padding+(this.options.scaleOffsetTop+4+4)*this.options.dpr,"center")):this._drawSolidLine(x1,padding,x1,padding+this.options.scaleOffsetTop*this.options.dpr,lineWidth),rightLastScaleTime+=this._timeWidthArray[0];this._drawSolidLine(centerPosition.x,0,centerPosition.x,centerPosition.y,lineWidth,this.options.timePointColor)},_proto._drawSolidLine=function(startX,startY,endX,endY,lineWidth,color){this._ctx&&(this._ctx.save(),this._ctx.strokeStyle=null!=color?color:this.options.timeScaleColor,this._ctx.lineWidth=lineWidth,this._ctx.beginPath(),this._ctx.moveTo(startX,startY),this._ctx.lineTo(endX,endY),this._ctx.stroke(),this._ctx.restore())},_proto._drawTextString=function(text,x,y,align){if(this._ctx){var timeTexts=text.split(" ");this._ctx.font=12*this.options.dpr*1+"px serif",this._ctx.fillStyle=this.options.timeTextColor,this._ctx.textAlign=align||"left",this._timeWidthArray[0]%60==0&&(timeTexts[1]=timeTexts[1].replace(/:00$/,"")),this._ctx.fillText(timeTexts[1],x,y+8*this.options.dpr),!this.options.showYearMonthDay||"00:00:00"!==timeTexts[1]&&"00:00"!==timeTexts[1]&&this._timeWidthArray[0]*this._timeWidthArray[2]!=86400||(this._ctx.textAlign=align||"left",this._ctx.fillText(timeTexts[0],x,y+18*this.options.dpr))}},_proto._drawSections=function(){for(var timeArr=this.timeSections||[],i=0;i<timeArr.length;i++){var position=this._findPosition(timeArr[i]);this._ctx&&TimeLineUtil.isOverlap(0,this.width*this.options.dpr,position.x1,position.x2)&&(this._ctx.fillStyle=this.options.timeSectionColor,this._ctx.fillRect(position.x1,0,position.x2-position.x1,this.height*this.options.dpr))}},_proto._findPosition=function(item){var x1=(parseInt((item.startTime-this.current.getTime())/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing+this.width/2)*this.options.dpr;return{x1:x1,x2:x1+parseInt((item.endTime-item.startTime)/1e3+"",10)/this._timeWidthArray[0]*this._curScaleSpacing*this.options.dpr}},_proto._mergeTimeSections=function(timeSections){if(0===timeSections.length)return timeSections;for(var merged=[(timeSections=timeSections.map((function(item){return 10===(item.startTime+"").length&&(item.startTime=1e3*item.startTime),10===(item.endTime+"").length&&(item.endTime=1e3*item.endTime),_extends({},item,{startTime:item.startTime,endTime:item.endTime})})))[0]],i=1;i<timeSections.length;i++){var prev=merged[merged.length-1],curr=timeSections[i];prev.endTime>=curr.startTime?prev.endTime=Math.max(prev.endTime,curr.endTime):merged.push(curr)}return merged},_proto._addEventListener=function(){this._$canvas&&(this._$canvas.addEventListener("mousemove",this._mousemoveFun),this._$canvas.addEventListener("mouseover",this._mouseoverFun),this._$canvas.addEventListener("mouseleave",this._mouseleaveFun),this._$canvas.addEventListener("mousedown",this._mousedownFun),this._$canvas.addEventListener("mouseup",this._mouseUpFun),this._$canvas.addEventListener("wheel",this._mousewheelFun),this.$container.addEventListener("wheel",(function(e){e.preventDefault()}),{passive:!1}),this._$canvas.addEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.addEventListener("keyup",this._ctrlKeyUpFun),document.addEventListener("keydown",this._ctrlKeyDownFun,!1),document.addEventListener("keyup",this._ctrlKeyUpFun,!1),this._$canvas.addEventListener("touchstart",this._touchstartFun,{passive:!1}),this._$canvas.addEventListener("touchmove",this._touchmoveFun,{passive:!1}),this._$canvas.addEventListener("touchend",this._touchendFun,{passive:!1}))},_proto._removeEventListener=function(){this._$canvas&&(this._$canvas.removeEventListener("mousemove",this._mousemoveFun),this._$canvas.removeEventListener("mouseover",this._mouseoverFun),this._$canvas.removeEventListener("mouseleave",this._mouseleaveFun),this._$canvas.removeEventListener("mousedown",this._mousedownFun),this._$canvas.removeEventListener("mouseup",this._mouseUpFun),this._$canvas.removeEventListener("wheel",this._mousewheelFun),this._$canvas.removeEventListener("keydown",this._ctrlKeyDownFun),this._$canvas.removeEventListener("keyup",this._ctrlKeyUpFun),document.removeEventListener("keydown",this._ctrlKeyDownFun),document.removeEventListener("keyup",this._ctrlKeyUpFun),this._$canvas.removeEventListener("touchstart",this._touchstartFun),this._$canvas.removeEventListener("touchmove",this._touchmoveFun),this._$canvas.removeEventListener("touchend",this._touchendFun))},_proto._mousedownFun=function(e){this.readOnly||(this._isMouseDown=!0,this._mousePosition=e.pageX,this._oldTime=this.current,null==this.options.onDragStart||this.options.onDragStart.call(this.options,this.current))},_proto._mouseoverFun=function(){this.readOnly||(this._isOver=!0)},_proto._mouseleaveFun=function(e){this.readOnly||(this._isOver=!1,this._moveEndOrTouchEndFun(e))},_proto._mouseUpFun=function(e){this._moveEndOrTouchEndFun(e)},_proto._mousemoveFun=function(e){if(!this.readOnly)if(this._isMouseDown&&this._isOver)this._moveUpdateFun(e.pageX);else{var left=parseInt(this.$container.offsetLeft+"",10);this._mousePosition=e.pageX-left,this._update()}},_proto._mousewheelFun=function(e){e.preventDefault(),this.readOnly},_proto._ctrlKeyDownFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=!0)},_proto._ctrlKeyUpFun=function(e){(e.ctrlKey||"Control"===e.key)&&(this._isCtrlKeyDown=!1)},_proto._getTouchDistance=function(touches){var touch1=touches[0],touch2=touches[1],dx=touch2.clientX-touch1.clientX,dy=touch2.clientY-touch1.clientY;return Math.sqrt(dx*dx+dy*dy)},_proto._touchstartFun=function(e){if(!this.readOnly)if(this._oldTime=this.current,this._isOver=!0,1===e.touches.length){var touch=e.touches[0];this._isMouseDown=!0,this._mousePosition=touch.clientX}else 2===e.touches.length&&(this._lastTouchDist=this._getTouchDistance(e.touches))},_proto._touchmoveFun=function(e){if(e.preventDefault(),e.stopPropagation(),!this.readOnly)if(1===e.touches.length){var touch=e.touches[0];this._moveUpdateFun(touch.clientX)}else 2===e.touches.length&&(this._getTouchDistance(e.touches),this._lastTouchDist)},_proto._touchendFun=function(e){this.readOnly||this._moveEndOrTouchEndFun(e)},_proto._moveEndOrTouchEndFun=function(e){e.preventDefault(),this.readOnly||this._isMouseDown&&(this._isMouseDown=!1,this._moved&&(this._moved=!1,this._update({current:this.current}),this._oldTime=this.current,null==this.options.onDragEnd||this.options.onDragEnd.call(this.options,this.current,this._isOver)),this._isOver&&Math.abs(this._mousePosition-(e.pageX||0))>5&&(null==this.options.onChange||this.options.onChange.call(this.options,this.current)),this._mousePosition=0,this._lastTouchDist=0)},_proto._moveUpdateFun=function(x){var mouseOffset=this._mousePosition-x;if(0!==mouseOffset){if(this._oldTime){var currentTime=this._oldTime.getTime()+1e3*parseInt(mouseOffset/this._curScaleSpacing*this._timeWidthArray[0]+"",10);this._update({current:new Date(currentTime)}),null==this.options.onDragging||this.options.onDragging.call(this.options,new Date(currentTime))}this._moved=!0}},Constructor=TimeLine,(protoProps=[{key:"_curScaleSpacing",get:function(){var _this__timeWidthArray,_this__timeWidthArray1;return Math.floor((null==(_this__timeWidthArray=this._timeWidthArray)?void 0:_this__timeWidthArray[1])-(null==(_this__timeWidthArray1=this._timeWidthArray)?void 0:_this__timeWidthArray1[1])*+(this.timeWidth%1/2).toFixed(2))}}])&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),TimeLine}(BaseTimeLine);return TimeLine.TIME_WIDTH=TIME_WIDTH,dist$4.BaseTimeLine=BaseTimeLine,dist$4.MobileTimeLine=MobileTimeLine,dist$4.TimeLine=TimeLine,dist$4}(),THEME_SCALE_MODE_TYPE_full=0,THEME_SCALE_MODE_TYPE_auto=1,THEME_SCALE_MODE_TYPE_fullAuto=2,THEME_PROPS=["width","height","playing","volume","muted","loading","recType","isCurrentFullscreen","orientationAngle","zooming","zoom","recording","recordList","speed","urlInfo","videoLevelList","videoLevel"],REC_GROUP=["rec","cloudRec","cloudRecord"],DEVICE_INFO_GROUP=["deviceID","deviceName"],PAUSE_DISABLED_BTN=["capturePicture","volume","ptz","record","talk","definition","speed","globalFullscreen"],EVENTS$1={loading:"loading",play:"play",capturePicture:"capturePicture",volumechange:"volumechange",zoomChange:"zoomChange",zoomingChange:"zoomingChange",zoomTranslateChange:"zoomTranslateChange",audioInfo:"audioInfo",videoInfo:"videoInfo",firstFrameDisplay:"firstFrameDisplay",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen",fullscreenChange:"fullscreenChange",resize:"resize",orientationChange:"orientationChange",audioCodecUnsupported:"audioCodecUnsupported",changeTheme:"changeTheme",recTypeChange:"recTypeChange",definitionChange:"definitionChange",speedChange:"speedChange",recordingChange:"recordingChange",talkingChange:"talkingChange",talkVolumeChange:"talkVolumeChange",setLoggerOptions:"setLoggerOptions",records:"records",ptzSpeedChange:"ptzSpeedChange",setVideoLevelList:"setVideoLevelList",currentVideoLevel:"currentVideoLevel",currentVideoLevelAuto:"currentVideoLevelAuto",setAllDayRecTimes:"setAllDayRecTimes",getOSDTime:"getOSDTime",control:{play:"Control.play",playDestroy:"Control.playDestroy",capturePicture:"Control.capturePicture",capturePictureResult:"Control.capturePictureResult",capturePictureDestroy:"Control.capturePictureDestroy",volumechange:"Control.volumechange",volumePanelOpenChange:"Control.volumePanelOpenChange",volumeDestroy:"Control.volumeDestroy",controlsBarOpenChange:"Control.controlsBarOpenChange",headerMoreShowControlsChange:"Control.headerMoreShowControlsChange",headerMorePanelOpenChange:"Control.headerMorePanelOpenChange",footerMoreShowControlsChange:"Control.footerMoreShowControlsChange",footerMorePanelOpenChange:"Control.footerMorePanelOpenChange",deviceDestroy:"Control.deviceDestroy",recTypeChange:"Control.recTypeChange",recDestroy:"Control.recDestroy",definitionChange:"Control.definitionChange",definitionList:"Control.definitionList",definitionPanelOpenChange:"Control.definitionPanelOpenChange",definitionDestroy:"Control.definitionDestroy",speedChange:"Control.speedChange",speedPanelOpenChange:"Control.speedPanelOpenChange",speedDestroy:"Control.speedDestroy",ptzPanelOpenChange:"Control.ptzPanelOpenChange",ptzSpeedChange:"Control.ptzSpeedChange",ptzError:"Control.ptzError",ptzDestroy:"Control.ptzDestroy",recordingChange:"Control.recordingChange",recordDestroy:"Control.recordDestroy",talkingChange:"Control.talkingChange",talkError:"Control.talkError",talkDestroy:"Control.talkDestroy",zoomChange:"Control.zoomChange",zoomPanelOpenChange:"Control.zoomPanelOpenChange",zoomDestroy:"Control.zoomDestroy",fullscreenDestroy:"Control.fullscreenDestroy",globalFullscreenDestroy:"Control.globalFullscreenDestroy",datePanelOpenChange:"Control.datePanelOpenChange",dateChange:"Control.dateChange",dateDestroy:"Control.datePanelDestroy",timeLineChange:"Control.timeLineChange",timeLinePanelOpenChange:"Control.timeLinePanelOpenChange",timeLineDestroy:"Control.timeLineDestroy",beforeMountControls:"Control.beforeMountControls",mountedControls:"Control.mountedControls",beforeUnmountControls:"Control.beforeUnmountControls",unmountedControls:"Control.unmountedControls",posterDestroy:"Control.posterDestroy",loadingDestroy:"Control.loadingDestroy",messageDestroy:"Control.messageDestroy",contentDestroy:"Control.contentDestroy",contentRerender:"Control.contentRerender"},theme:{beforeDestroy:"Theme.beforeDestroy",destroyed:"Theme.destroyed",mobileExtendDestroy:"Theme.mobileExtendDestroy",recFooterDestroy:"Theme.recFooterDestroy"},message:"message"};
13
13
  /*
14
14
  * @ezuikit/player-theme v2.0.0-beta.4
15
15
  * Copyright (c) 2025-11-17 Ezviz-OpenBiz
16
16
  * Released under the MIT License.
17
- */function V(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function Y(e,t){return Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Y(e,t)}var Z=function(e){function t(t){var n,i,r,o;return(n=e.call(this)||this).locale=null,n.__options={},n._disabled=!1,n._active=!1,n.__options=t,n.locale=(r=n.__options.locales,void 0===(o=n.__options.language)&&(o="zh"),(null==r?void 0:r[o])||(null==r?void 0:r.zh)||{}),n.$container=document.createElement(t.tagName||"span"),n.$container.classList.add(x+"-control"),"text"===(null==t?void 0:t.controlType)?n.$container.classList.add(x+"-control-text"):"block"===(null==t?void 0:t.controlType)?n.$container.classList.add(x+"-control-block"):n.$container.classList.add(x+"-control-btn"),(null==t?void 0:t.classNameSuffix)&&n.$container.classList.add(x+"-control-"+(null==t?void 0:t.classNameSuffix)),(null==t?void 0:t.className)&&n.$container.classList.add(t.className),t.getPopupContainer?n.$popupContainer=null==t.getPopupContainer?void 0:t.getPopupContainer.call(t):n.$popupContainer=document.body,n.$popupContainer.appendChild(n.$container),n._onDBlClick=n._onDBlClick.bind(n),n._onClick(),"block"!==(null==(i=n.__options)?void 0:i.controlType)&&n.$container.addEventListener("dblclick",n._onDBlClick),n}!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&&Y(e,t)}(t,e);var n=t.prototype;return n.reset=function(e){this._camelCaseName&&this.emit("Control."+this._camelCaseName+"Reset",e)},n.resetPopupContainer=function(e,t,n){e!==this.$popupContainer&&(this.$popupContainer.contains(this.$container)&&this.$popupContainer.removeChild(this.$container),this.$popupContainer=e,"prepend"===t?this.$popupContainer.prepend(this.$container):"before"===t?n&&this.$popupContainer.insertBefore(this.$container,n):this.$popupContainer.appendChild(this.$container),this._camelCaseName&&this.emit("Control."+this._camelCaseName+"ResetContainer",this.__options.classNameSuffix,e))},n.hide=function(){this.$container&&(this.$container.style.display="none",this.$container.classList.add(x+"-hide"))},n.destroy=function(){var e,t,n;this._camelCaseName&&this.emit("Control."+this._camelCaseName+"Destroy"),"block"!==(null==(e=this.__options)?void 0:e.controlType)&&this.$container.addEventListener("dblclick",this._onDBlClick),this._active=!1,this.removeAllListeners(),null==(n=this.$container)||null==(t=n.remove)||t.call(n),this.$container=null},n._updateDisabledState=function(e){var t,n;e?null==(t=this.$container)||t.classList.add(x+"-disabled"):null==(n=this.$container)||n.classList.remove(x+"-disabled")},n._updateActiveState=function(e){var t,n;e?null==(t=this.$container)||t.classList.add(x+"-active"):null==(n=this.$container)||n.classList.remove(x+"-active")},n._onClick=function(){var e=this;this.$container.addEventListener("click",(function(t){var n;(null==(n=e.$container)?void 0:n.classList.contains(x+"-disabled"))||null==e._onControlClick||e._onControlClick.call(e,t)}))},n._onDBlClick=function(e){e.stopPropagation(),e.preventDefault()},n._onControlClick=function(e){null==this.__options.onClick||this.__options.onClick.call(this.__options,e)},V(t,[{key:"active",get:function(){return this._active},set:function(e){this._disabled&&!this._active||(this._active=e,this._updateActiveState(e))}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=e,this._updateDisabledState(e)}},{key:"_camelCaseName",get:function(){return this.__options.classNameSuffix?this.__options.classNameSuffix.replace(/[-_\s]+(.)?/g,(function(e,t){return t?t.toUpperCase():""})).replace(/^(.)/,(function(e){return e.toLowerCase()})):null}}]),t}(y);function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},H.apply(this,arguments)}function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}var Q={},K=function(e){function t(t){var n;return void 0===t&&(t={}),(n=e.call(this,Object.assign({},Q,H({},t,{tagName:"div",controlType:"block",classNameSuffix:"loading"})))||this)._options=Object.assign({},t),n.$container.classList.add(x+"-loading",x+"-hide"),n._html(),n}!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&&G(e,t)}(t,e);var n=t.prototype;return n._html=function(){var e;"function"==typeof this._options.render?this.$container.innerHTML=this._options.render():this.$container.innerHTML='\n <span class="'+x+"-loading-dot "+x+'-loading-dot-load">\n <i class="'+x+'-loading-dot-item"></i>\n <i class="'+x+'-loading-dot-item"></i>\n <i class="'+x+'-loading-dot-item"></i>\n <i class="'+x+'-loading-dot-item"></i>\n </span>\n <div class="'+x+'-loading-text">'+((null==(e=this.locale)?void 0:e.LOADING)||"loading...")+"</div>\n "},n.show=function(e){e&&(this.$container.innerHTML=e),this.$container.style.display="flex",this.$container.classList.remove(x+"-hide"),this.$popupContainer.classList.add(x+"-has-loading")},n.hide=function(){e.prototype.hide.call(this),this.$popupContainer.classList.remove(x+"-has-loading")},t}(Z);function W(){return W=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},W.apply(this,arguments)}function J(e,t){return J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},J(e,t)}var q={poster:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3P/2wCEAAkJCQkJCQoLCwoODw0PDhQSERESFB4WFxYXFh4uHSEdHSEdLikxKCUoMSlJOTMzOUlUR0NHVGZbW2aBeoGoqOIBCQkJCQkJCgsLCg4PDQ8OFBIRERIUHhYXFhcWHi4dIR0dIR0uKTEoJSgxKUk5MzM5SVRHQ0dUZltbZoF6gaio4v/CABEIA/0HHgMBIgACEQEDEQH/xAAZAAEBAQEBAQAAAAAAAAAAAAAAAQIEAwf/2gAIAQEAAAAA+WgAgAQAACTxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHUAEACAAAE8YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdQBAAgAAAPPzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOoCABAAAAGfEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6ggAIAAAATxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAADqIACAAAACPLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAADqgAIAAAAEMeYAAAAAAAAAAAAAAAAAAAAAAAAAAAAADpACAAAABAz5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOkAgAAAAQCeUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6QIAAAAEAHjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOkIAAAAEAEeeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOkQAAAAQAQYwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0oAAAAIAIDGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAAAIAIBnzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6AAAACACAGfMAAAAAAAAAAAAAAAAAAAAAAAAAAAAADoAAAAgAgBE8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAAIAIAQTzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6AAACACACBPMAAAAAAAAAAAAAAAAAAAAAAAAAAAAADoAAAgAgAgE8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAIAIAIAZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0AAEAEAEAImAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgABABACAEGcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdAAIAIAQAgMwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6ABABACACBbAJEkAAAAAAAAAAAAAAAAAAAAAAAAAAAAdACACACAEDWjAEDMgAAAAAAAAAAAAAAAAAAAAAAAAAAAOgEAEAEAIGtoYBAJJAAAAAAAAAAAAAAAAAAAAAAAAAAAB0CACACAEBvREyEAgzAAAAAAAAAAAAAAAAAAAAAAAAAAADoQAQAQAgLuoJkICBc5AAAAAAAAAAAAAAAAAAAAAAAAAAAdEAEAIAQC+iAzBAIKkyAAAAAAAAAAAAAAAAAAAAAAAAAAB7gEAIAQA9ADAQEFQzAAAAAAAAAAAAAAAAAAAAAAAAAAAe4EAIAIAboCZEAgqDMAAAAAAAAAAAAAAAAAAAAAAAAAAD3CAEAEAJrYCSEAgqBMgAAAAAAAAAAAAAAAAAAAAAAAAAB7kAEAIARfQAmRAQLASQAAAAAAAAAAAAAAAAAAAAAAAAAAe8AEAIAQb0AjJAIKgIkAAAAAAAAAAAAAAAAAAAAAAAAAAPYAgBACCvQBEiAQVAQkAAAAAAAAAAAAAAAAAAAAAAAAAAPYCAEAIKa0AjJAQKgQMgAAAAAAAAAAAAAAAAAAAAAAAAAHsEAIAQKNaBCRAIKgIEgAAAAAAAAAAAAAAAAAAAAAAAAAD2IAIAQUR6UQMkBBUBASAAAAAAAAAAAAAAAAAAAAAAAAAAPaACAEFEL6CBIgEFQICIAAAAAAAAAAAAAAAAAAAAAAAAAA9QCAEFEDWyCIgEFQECEAAAAAAAAAAAAAAAAAAAAAAAAAAeoEAIKIBraCIQECwEBCAAAAAAAAAAAAAAAAAAAAAAAAAAPUIAQUIA1tBEQCCoCBBAAAAAAAAAAAAAAAAAAAAAAAAAAHqQAgoQBGthEQCCoCBAgAAAAAAAAAAAAAAAAAAAAAAAAAD1gBBQgBDWyEIBBUCAgQAAAAAAAAAAAAAAAAAAAAAAAAAB6AEFEAIF9IEQCCoCBAgAAAAAAAAAAAAAAAAAAAAAAAAAB6AQUQAgD0CEBAsBAQIAAAAAAAAAAAAAAAAAAAAAAAAAAegQUQAgCPSkIBBUCAgQAAAAAAAAAAAAAAAAAAAAAAAAAAehBRACAINbQgEFQECAgAAAAAAAAAAAAAAAAAAAAAAAAAA9IKEAQAgXYQECwEBAgAAAAAAAAAAAAAAAAAAAAAAAAAAbKEAQAgDWiAQVAQIEAAAAAAAAAAAAAAAAAAAAAAAAAABuhAEAIAi+iAQVAQICAAAAAAAAAAAAAAAAAAAAAAAAAAA9BACAIAgb1AIKgQECAAAAAAAAAAAAAAAAAAAAAAAAAAAeiAEAQBALsCCoCBAQAAAAAAAAAAAAAAAAAAAAAAAAAADYBAEAIAXYQLAQECAAAAAAAAAAAAAAAAAAAAAAAAAAANgQBACAA1oQVAQIEAAAAAAAAAAAAAAAAAAAAAAAAAAANhAEAIAAXaCoCBAQAAAAAAAAAAAAAAAAAAAAAAAAAAA2QAgCAAAugsBAQIAAAAAAAAAAAAAAAAAAAAAAAAAW6qkSSwAgCAAAFtVAQIEAAAAAAAAAAAAAAAAAAAAAAAADWta1SgDlAQBAAAALdQEBBAAAAAAAAAAAAAAAAAAAAAAAAF1vdUFAHKCAIAAAAFqkBCAAAAAAAAAAAAAAAAAAAAAAAANem6CgoByiAEAAAAAKAQAAAAAAAAAAAAAAAAAAAAAAABdetFCgoByoAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABd+ihQUFAcgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfpSgoUFAcgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANemgUKCgoHGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAu/QBQUFBQcYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9dAChQUFBxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA160AKCgoKHGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG/SgAUKCgocYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9NqABQUFBRxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALvZQAFBQoKOMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC72FAAUKCgpxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAemqFAAUFCgpxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3soUABQoKCuMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANegoUABQUKCuMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX0oUKAAoUFBeMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAu6oUUABQUKByAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG9FChQAFCgoOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrYUKKAAoKChyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXahRQoAChQUOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdKKFCgAUFBRyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuxQooUABQoKOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGtBRQoUACgoKcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXSihRQoACgoU5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2UKKFCgAUFBXIAAAAAAAAAAAAAAAAAAAAAAAAAAAAALtFFCihQAFBQrkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGtIoUUKFAAUKC8gAAAAAAAAAAAAAAAAAAAAAAAAAAAABdKiihRQoACgoXkAAAAAAAAAAAAAAAAAAAAAAAAAAAAALpSUKKFCgAKFBygAAAAAAAAAAAAAAAAAAAAAAAAAAAAGqVFFCihQAFBQ5QAAAAAAAAAAAAAAAAAAAAAAAAAAAADYpFFFChQAFChygAAAAAAAAAAAAAAAAAAAAAAAAAAAALaKihRQooACgo5QAAAAAAAAAAAAAAAAAAAAAAAAAAAAFtCoooUUKAAoUcoAAAAAAAAAAAAAAAAAAAAAAAAAAAADRRUUKKFCgAUFOUAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0oVFFCihQAFCnKAAAAAAAAAAAAAAAAAAAAAAAAAAAABaKKihRQoUACgrlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtCioooUUKAAoLygAAAAAAAAAAAAAAAAAAAAAAAAAAAAVRRUUKKFCgAUF5QAAAAAAAAAAAAAAAAAAAAAAAAAAAAKUUVFFCihQAFBzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUooqKFFChQAFDmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoooqKKFFCgAKHMAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRSUKKFCgAKOYAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRUUUKKFAAUcwAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiikUUUKFAAU5gAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiioooUKKAApzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFIooUUKAArmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFRQooUKABXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKFRRQooUABeYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKKihRQoUABzgAAAAAAAAAAAAAAAAAAAAAAAAAAAABRQoqKKFFCgAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFRQooUKABzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoUUVFFCihQAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiiooUUKFABzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUKKKiihRQoAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRSUKKFCgBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFRRQooUAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAooopFFFChQBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiioooUKKAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUUUUiihRQoBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRUUKKFCgOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKFRRQooUBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoooqKFFChQOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFCioooUUKBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUUUVFCihQoOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAChRRUUUKKFBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKKihRQoUOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoooqKKFFChzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFJQooUKOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUUUBQBQKH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAQID/9oACAECEAAAAOoCAASAAAAAAAAAAAAAAANgQAAyAAAAAAAAAAAAAAA2EAACQAAAAAAAAAAAAAADZAAAJAAAAAAAAAAAAAAANwAAAZAAAAAAAAAAAAAAA0AAAJAAAAAAAAAAAAAAANAAAIQAAAAAAAAAAAAAADQAAIEAAAAAAAAAAAAAAA0AAIBAAAAAAAAAAAAAAANAAIAQAAAAAAAAAAAAAADQAIAEAAAAAAAAAAAAAAA0AIAAIAAAAAAAAAAAAAANAIABSBAAAAAAAAAAAAAANAQAFEsBAAAAAAAAAAAAAA0EABNBAIAAAAAAAAAAAAADRAARoJYEAAAAAAAAAAAAAAoAELqBAQAAAAAAAAAAAAACgAgtCAgAAAAAAAAAAAAACgCLDQICAAAAAAAAAAAAAAKAiwNBAQAAAAAAAAAAAAAAoIsA0ECAAAAAAAAAAAAAACiLADQgIAAAAAAAAAAAAAAKiwANEBAAAAAAAAAAAAAAAAAC1AgAAAAAAAAAAAAAAAAAtgIAAAAAAAAAAAAAAAAAFBAAAAAAAAAAAAAAAAAAKEAAAAAAAAAAAAAAAAAAUgAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAtKMAAAAAAAAAAAAAAAAAaoFOYAAAAAAAAAAAAAAAAtoBTmAAAAAAAAAAAAAAAAaFAK5gAAAAAAAAAAAAAAAWgoBeYAAAAAAAAAAAAAAALQKAXmAAAAAAAAAAAAAAAFoBQDAAAAAAAAAAAAAAAAtAFAMAAAAAAAAAAAAAAAFUAKAwAAAAAAAAAAAAAAAUoAoDAAAAAAAAAAAAAAACigBQMAAAAAAAAAAAAAAAUFAFAwAAAAAAAAAAAAAABQUAKDAAAAAAAAAAAAAAACgoAoMAAAAAAAAAAAAAAAKCgBQwAAAAAAAAAAAAAAAUFAFDAAAAAAAAAAAAAAABQUAKMAAAAAAAAAAAAAAACgoAUwAAAAAAAAAAAAAAAFBQBTAAAAAAAAAAAAAAAAUFACsAAAAAAAAAAAAAAAAoKAKwAAAAAAAAAAAAAAACgoAXAAAAAAAAAAAAAAAAWUFAFwAAAAAAAAAAAAAAABQUAMgAAAAAAAAAAAAAAAsoKAMgAAAAAAAAAAAAAAAKCgDIAAAAAAAAAAAAAAABQUAyAAAAAAAAAAAAAAAAUFAMgAAAAAAAAAAAAAAACgoDIAAAAAAAAAAAAAAAAoKAyAAAAAAAAAAAAAAAAFBQMgAAAAAAAAAAAAAAAAoKDIAAAAAAAAAAAAAAAAKCgyAAAAAAAAAAAAAAAABQUMgAAAAAAAAAAAAAAAAUFDIAAAAAAAAAAAAAAAAAoD//EABYBAQEBAAAAAAAAAAAAAAAAAAABAv/aAAgBAxAAAADAAoigoAAAAAAAAAAAAAADIBSKAoAAAAAAAAAAAAAADIFIoAoAAAAAAAAAAAAAADIUigAUAAAAAAAAAAAAAADJSKAAUAAAAAAAAAAAAAADNIoAAoAAAAAAAAAAAAAACIUAAoAAAAAAAAAAAAAAAyUAApKAAAAAAAAAAAAAAAzQABUUAAAAAAAAAAAAAAAgABUUAAAAAAAAAAAAAAAIABUUAAAAAAAAAAAAAAACABUUAAAAAAAAAAAAAAAAgBUUBAoAAAAAAAAAAAAAAgFJQEBQAAAAAAAAAAAAAAgUlAJKFAAAAAAAAAAAAAACCooBIooAAAAAAAAAAAAAAIqKAGVCgAAAAAAAAAAAAAAIoAIBQAAAAAAAAAAAAAAIoACAoAAAAAAAAAAAAAAAAAM0KAAAAAAAAAAAAAAAAACBQAAAAAAAAAAAAAAAAAIKAAAAAAAAAAAAAAAAAAgoAAAAAAAAAAAAAAAAACFAAAAAAAAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAASgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAloAAAAAAAAAAAAAAAAEQA0AAAAAAAAAAAAAAAAEgANAAAAAAAAAAAAAAAAElgANAAAAAAAAAAAAAAAAIlQANAAAAAAAAAAAAAAAAgSwANAAAAAAAAAAAAAAABASoANAAAAAAAAAAAAAAACAJYANAAAAAAAAAAAAAAABAIsANAAAAAAAAAAAAAAAEsASoA0AAAAAAAAAAAAAAAJYAlgDQAAAAAAAAAAAAAAAIAlQDQAAAAAAAAAAAAAAASwBLANAAAAAAAAAAAAAAAAQBKgNAAAAAAAAAAAAAAAAlgCWA0AAAAAAAAAAAAAAAAQCVA0AAAAAAAAAAAAAAABLAEsDQAAAAAAAAAAAAAAAAgEqDQAAAAAAAAAAAAAAACWAJYNAAAAAAAAAAAAAAAAEsAlQ0AAAAAAAAAAAAAAAASwBLDQAAAAAAAAAAAAAAAAlgEWNAAAAAAAAAAAAAAAACWAJU0AAAAAAAAAAAAAAAAEsASzQAAAAAAAAAAAAAAAAEASqAAAAAAAAAAAAAAAACWAJaAAAAAAAAAAAAAAAAAgCWgAAAAAAAAAAAAAAAASwBNAAAAAAAAAAAAAAAAACATQAAAAAAAAAAAAAAAACWAKAAAAAAAAAAAAAAAAAEAoAAAAAAAAAAAAAAAABLAKAAAAAAAAAAAAAAAAAJYCgAAAAAAAAAAAAAAAACWAoAAAAAAAAAAAAAAAAASwKAAAAAAAAAAAAAAAAAAg//EACgQAAEEAQIFBAMBAAAAAAAAAAEAAhFwMTBREhNAQYADECBQIWBh0P/aAAgBAQABPwD5QPeAoC/HURoOEi5SINyPFyOEi5Tcjs3I+5HYPmScm5HZuR1yOuR2Lkdi5Di5Di5Di5Di5Di5DchuR3vBUFQbdgrhRAnQgKFBtYNUAe51ItINJQAHRxZ4b8j0JFlgSgI+Z6IiyQJQEaB6MiyAI60ixgI0TbTRpHpjYY+iNhNGkbkPUmwG3IMaR8vRnSNtNzcjc3I3NyNzcjc3IM+ZIxcjbkFyi5AYuVpuWZuQGLlBuUG5QVNYQdlwO2XLcuU5co7rlHdcr+rlHdco7rlO3C5blwO2XC7Y/UzVQBPZD0yh6Q3QY3ZQB2+4BqUMcUPTHcoNA7ffypp8NJQYO6AA/RZUqVKlTSwYSg0C4Qw90ABcIYSgALhAJQaBcQZvcQEoNi4g2UBFxNbvcYbvcbWxcbRFxgXG0XGBcYE3IBFxgXGB5jgXGLkFxi5B5jjzHFyDzHFyD/AKp0pUqVKlSpUqVKlSpUqVK//EAB0RAAMAAgIDAAAAAAAAAAAAAAABEWBwEpCAoLD/2gAIAQIBAT8A30/QDhCeJ8zFLca7Hl0RQhCIiIjijjk8Jl8JuCfXf//EABoRAAICAwAAAAAAAAAAAAAAAAARAaAQYLD/2gAIAQMBAT8AtfzYjYxjyx7Q+5f/AP/Z"},X=function(e){function t(t){var n;return void 0===t&&(t={}),(n=e.call(this,Object.assign({},q,W({},t,{tagName:"div",controlType:"block",classNameSuffix:"poster"})))||this)._options=Object.assign({},q,t),n.$container.classList.add(x+"-poster",x+"-hide"),n._imgLoadErrorEvent=n._imgLoadErrorEvent.bind(n),n._options.poster&&n.setPoster(n._options.poster),n}!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&&J(e,t)}(t,e);var n=t.prototype;return n._imgLoadErrorEvent=function(e){var t;null==this._options.onLoadImgError||this._options.onLoadImgError.call(this._options,(null==(t=e.target)?void 0:t.getAttribute("src"))||"")},n.setPoster=function(e){var t;""!==(e=null!=e?e:this._options.poster)?(this.$container.innerHTML='<img class="'+x+'-poster-img" src="'+e+'" />',null==(t=this.$container.querySelector("."+x+"-poster-img"))||t.addEventListener("error",this._imgLoadErrorEvent)):this.$container.innerHTML=""},n.show=function(){this.$container&&(this.$container.style.display="flex",this.$container.classList.remove(x+"-hide"))},n.hide=function(){var t,n;e.prototype.hide.call(this),null==(n=this.$container)||null==(t=n.querySelector("."+x+"-poster-img"))||t.removeEventListener("error",this._imgLoadErrorEvent)},n.destroy=function(){this.hide(),e.prototype.destroy.call(this)},t}(Z),ee='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="play">\n <rect x="6.5" y="5.5" rx="1.25" width="2.5" height="13"/>\n <rect x="15" y="5.5" rx="1.25" width="2.5" height="13"/>\n </svg>',te='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="pause"> <path d="M17.5 13.66L9.1 19.26C7.78 20.14 6 19.19 6 17.59L6 6.4C6 4.8 7.78 3.85 9.1 4.73L17.5 10.33C18.69 11.12 18.69 12.87 17.5 13.66Z" /></svg>',ne=function(e){return'<svg width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" fill="none" focusable="false" aria-hidden="true" data-icon="volume">\n \t<path class="'+e+'-icon-volume-muted" d="M20.57 9.69L16.07 14.19" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path class="'+e+'-icon-volume-muted" d="M20.57 14.19L16.07 9.69" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \x3c!-- 音低 --\x3e\n <path class="'+e+'-icon-volume-low" d="M15.53 15.97C16.69 15.25 17.49 13.75 17.49 12C17.49 10.25 16.69 8.75 15.53 8.02" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t\x3c!-- 音高 --\x3e\n <path class="'+e+'-icon-volume-high" d="M18.5 19.06C20.31 17.5 21.49 14.93 21.49 12C21.49 9.07 20.31 6.48 18.49 4.93" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M5.87 8.62L9.85 5.25C10.5 4.7 11.49 5.16 11.49 6.01L11.49 17.98C11.49 18.83 10.5 19.29 9.85 18.74L5.87 15.37" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M5.87 15.37L3.49 15.37C2.94 15.37 2.49 14.92 2.49 14.37L2.49 9.62C2.49 9.07 2.94 8.62 3.49 8.62L5.87 8.62" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>'},ie='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="mobile-fullscreen">\n <path d="M4 2.9082L11 2.9082C12.5188 2.9082 13.75 4.1394 13.75 5.6582L13.75 17.6582C13.75 19.177 12.5188 20.4082 11 20.4082L4 20.4082C2.4812 20.4082 1.25 19.177 1.25 17.6582L1.25 5.6582C1.25 4.1394 2.4812 2.9082 4 2.9082ZM4 4.4082L11 4.4082C11.6903 4.4082 12.25 4.9679 12.25 5.6582L12.25 17.6582C12.25 18.3485 11.6903 18.9082 11 18.9082L4 18.9082C3.30969 18.9082 2.75 18.3485 2.75 17.6582L2.75 5.6582C2.75 4.9679 3.30969 4.4082 4 4.4082ZM22.1511 18.3113C22.1511 19.3595 21.2467 20.1652 20.1509 20.2362L19.993 20.2413L15.2939 20.2413C14.8798 20.2413 14.5439 19.9055 14.5439 19.4913C14.5439 19.1116 14.8262 18.7979 15.1921 18.7482L15.2939 18.7413L19.993 18.7413C20.344 18.7413 20.5962 18.5592 20.6432 18.3732L20.6511 18.3113L20.6511 12.4895C20.6511 12.3048 20.4338 12.1042 20.1062 12.066L19.993 12.0594L15.2939 12.0594C14.8798 12.0594 14.5439 11.7238 14.5439 11.3094C14.5439 10.9298 14.8262 10.616 15.1921 10.5663L15.2939 10.5594L19.993 10.5594C21.1055 10.5594 22.0605 11.3175 22.145 12.3416L22.1511 12.4895L22.1511 18.3113ZM10.3225 16.1035C10.3225 15.6893 9.98669 15.3535 9.57251 15.3535L5.84644 15.3535L5.74463 15.3604C5.37854 15.41 5.09644 15.7239 5.09644 16.1035C5.09644 16.5177 5.43225 16.8535 5.84644 16.8535L9.57251 16.8535L9.67432 16.8467C10.0404 16.797 10.3225 16.4832 10.3225 16.1035Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',re='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="webFullscreen">\n \t<path d="M18.4009 2.40125L5.59972 2.40125C4.74849 2.39276 3.9297 2.72729 3.32788 3.32935C2.72607 3.9314 2.39188 4.75031 2.40062 5.6015L2.40062 18.4015C2.3922 19.2527 2.7267 20.0715 3.32874 20.6733C3.93079 21.2751 4.74969 21.6093 5.60091 21.6006L18.4009 21.6006C19.2519 21.609 20.0705 21.2747 20.6723 20.6729C21.2741 20.0711 21.6084 19.2525 21.6 18.4015L21.6 5.60034C21.6084 4.74933 21.2741 3.93073 20.6723 3.32892C20.0705 2.72711 19.2519 2.39282 18.4009 2.40125ZM18.401 20.3213C19.4246 20.3213 20.321 19.4249 20.321 18.4014L20.321 5.60022C20.321 4.5766 19.4246 3.68024 18.401 3.68024L5.59987 3.68024C4.57631 3.68024 3.67993 4.5766 3.67993 5.60022L3.67993 18.4014C3.67993 19.4249 4.57631 20.3213 5.59987 20.3213L18.401 20.3213ZM14.5599 5.27087L18.3997 5.27087L18.3997 5.27209C18.7849 5.27087 19.0405 5.52527 19.0405 5.91168L19.0405 9.75153C19.0405 10.1331 18.7849 10.3887 18.401 10.3911C18.0158 10.3887 17.7602 10.1331 17.7602 9.75153L17.7602 7.44763L14.0487 11.1591C13.9313 11.2808 13.7695 11.3494 13.6005 11.3494C13.4315 11.3494 13.2697 11.2808 13.1523 11.1591C13.0292 11.0428 12.9594 10.8809 12.9594 10.7115C12.9594 10.5421 13.0292 10.3802 13.1523 10.2639L16.8638 6.55005L14.5599 6.55005C14.1735 6.54883 13.9179 6.29443 13.9203 5.91046C13.9179 5.52411 14.1735 5.26971 14.5599 5.27087ZM10.594 12.6625L6.88254 16.3751L6.88254 14.0712C6.88254 13.686 6.62695 13.4304 6.24297 13.4304C5.85898 13.4304 5.60338 13.686 5.60219 14.0712L5.60219 17.9111C5.60219 18.2939 5.85898 18.5483 6.24297 18.5507L10.0828 18.5507C10.4668 18.5483 10.7224 18.2939 10.7224 17.9099C10.7224 17.5247 10.4668 17.2691 10.0816 17.2703L7.77771 17.2703L11.4904 13.5588C11.6133 13.4421 11.6829 13.2801 11.6829 13.1107C11.6829 12.9412 11.6133 12.7791 11.4904 12.6625C11.3737 12.5396 11.2117 12.47 11.0422 12.47C10.8727 12.47 10.7107 12.5396 10.594 12.6625Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',oe='\n <svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="exitWebFullscreen">\n \t<path d="M18.4009 2.40125L5.59978 2.40125C4.74855 2.39276 3.92976 2.72729 3.32794 3.32935C2.72614 3.9314 2.39194 4.75031 2.40068 5.6015L2.40068 18.4015C2.39226 19.2527 2.72676 20.0715 3.3288 20.6733C3.93085 21.2751 4.74976 21.6093 5.60097 21.6006L18.4009 21.6006C19.252 21.609 20.0706 21.2747 20.6723 20.6729C21.2741 20.0711 21.6085 19.2525 21.6 18.4015L21.6 5.60034C21.6085 4.74933 21.2741 3.93073 20.6723 3.32892C20.0706 2.72711 19.252 2.39282 18.4009 2.40125ZM18.4012 20.3212C19.4247 20.3212 20.3211 19.4248 20.3211 18.4012L20.3211 5.6001C20.3211 4.57648 19.4247 3.68011 18.4012 3.68011L5.59999 3.68011C4.57643 3.68011 3.68005 4.57648 3.68005 5.6001L3.68005 18.4012C3.68005 19.4248 4.57643 20.3212 5.59999 20.3212L18.4012 20.3212ZM17.4401 11.3494L13.6002 11.3494L13.6002 11.3483C13.215 11.3494 12.9594 11.095 12.9594 10.7087L12.9594 6.86877C12.9594 6.48718 13.215 6.23163 13.599 6.22925C13.9842 6.23163 14.2398 6.48718 14.2398 6.86877L14.2398 9.17273L17.9512 5.46124C18.0686 5.3396 18.2304 5.27087 18.3994 5.27087C18.5685 5.27087 18.7303 5.3396 18.8476 5.46124C18.9708 5.57751 19.0406 5.73944 19.0406 5.90881C19.0406 6.07825 18.9708 6.24011 18.8476 6.35645L15.1362 10.0703L17.4401 10.0703C17.8265 10.0715 18.082 10.3259 18.0797 10.7099C18.082 11.0963 17.8265 11.3506 17.4401 11.3494ZM6.69115 18.358L10.4026 14.6454L10.4026 16.9493C10.4026 17.3345 10.6582 17.5901 11.0422 17.5901C11.4262 17.5901 11.6818 17.3345 11.683 16.9493L11.683 13.1094C11.683 12.7266 11.4262 12.4722 11.0422 12.4698L7.20233 12.4698C6.81834 12.4722 6.56276 12.7266 6.56276 13.1106C6.56276 13.4958 6.81834 13.7514 7.20354 13.7502L9.50746 13.7502L5.79478 17.4617C5.67188 17.5784 5.60228 17.7404 5.60228 17.9099C5.60228 18.0793 5.67188 18.2413 5.79478 18.358C5.91145 18.481 6.07349 18.5505 6.24297 18.5505C6.41243 18.5505 6.57446 18.481 6.69115 18.358Z" clip-rule="evenodd" fill-rule="evenodd"/>\n</svg>',ae='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="fullscreen">\n <path d="M8 4L6 4C4.89 4 4 4.89 4 6L4 8" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M4 16L4 18C4 19.1 4.89 20 6 20L8 20" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M16 20L18 20C19.1 20 20 19.1 20 18L20 16" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M20 8L20 6C20 4.89 19.1 4 18 4L16 4" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',se='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="exitFullscreen">\n <path d="M4 8L6 8C7.1 8 8 7.1 8 6L8 4" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M8 20L8 18C8 16.89 7.1 16 6 16L4 16" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M20 16L18 16C16.89 16 16 16.89 16 18L16 20" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M16 4L16 6C16 7.1 16.89 8 18 8L20 8" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',le='<svg width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close"><path d="M6.34 6.34L17.65 17.65" stroke-width="1.5" stroke-linecap="round"/><path d="M6.34 17.65L17.65 6.34" stroke-width="1.5" stroke-linecap="round"/></svg>',ce='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="close-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.5844 5.40312C10.6531 5.40312 10.7094 5.45937 10.7094 5.52812C10.7094 5.55781 10.7 5.5875 10.6812 5.60938L8.64844 8.03125L10.6781 10.4516C10.6969 10.475 10.7078 10.5031 10.7078 10.5328C10.7078 10.6031 10.6516 10.6578 10.5828 10.6578L9.55156 10.6531L8 8.80312L6.44844 10.6547L5.41563 10.6594C5.34688 10.6594 5.29063 10.6031 5.29063 10.5344C5.29063 10.5047 5.30156 10.4766 5.32031 10.4531L7.35313 8.03281L5.32031 5.61094C5.30156 5.5875 5.29063 5.55937 5.29063 5.52969C5.29063 5.45937 5.34688 5.40469 5.41563 5.40469L6.44844 5.40937L8 7.25937L9.55313 5.40781L10.5844 5.40312Z" fill-rule="evenodd" />\n </svg>',de='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="ptz">\n <circle cx="12" cy="12" r="2.771739" stroke-width="1.5"/>\n <path d="M9.06 5.14L10.76 3.8C11.48 3.23 12.51 3.23 13.23 3.8L14.93 5.14" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M4.87 14.93L3.54 13.23C2.97 12.51 2.97 11.48 3.54 10.76L4.87 9.06" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M18.91 14.93L20.24 13.23C20.81 12.51 20.81 11.48 20.24 10.76L18.91 9.06" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M9.06 18.69L10.76 20.02C11.48 20.59 12.51 20.59 13.23 20.02L14.93 18.69" stroke-width="1.5" stroke-linecap="round"/>\n </svg>',ue='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="sdk">\n <path d="M6.20253 2.50012L11.6496 2.50012C12.2335 2.50012 12.7939 2.72827 13.2069 3.13391L15.3547 5.24329C15.7677 5.64893 16 6.19934 16 6.77271L16 15.1062C16 16.3011 15.0142 17.2694 13.7975 17.2694L6.20253 17.2694C4.98578 17.2694 4 16.3011 4 15.1062L4 4.66333C4 3.46826 4.98578 2.50012 6.20253 2.50012ZM8.07051 6.09814C8.02467 5.76025 7.73502 5.49976 7.38452 5.49976C7.00217 5.49976 6.69221 5.80969 6.69221 6.19202L6.69221 8.49976L6.69853 8.59375C6.74437 8.93164 7.03403 9.19202 7.38452 9.19202C7.76688 9.19202 8.07683 8.88208 8.07683 8.49976L8.07683 6.19202L8.07051 6.09814ZM9.69238 5.49976C10.0429 5.49976 10.3325 5.76025 10.3784 6.09814L10.3847 6.19202L10.3847 8.49976C10.3847 8.88208 10.0747 9.19202 9.69238 9.19202C9.34189 9.19202 9.05223 8.93164 9.00639 8.59375L9.00008 8.49976L9.00008 6.19202C9.00008 5.80969 9.31003 5.49976 9.69238 5.49976ZM12.686 6.09814C12.6402 5.76025 12.3505 5.49976 12 5.49976C11.6176 5.49976 11.3077 5.80969 11.3077 6.19202L11.3077 8.49976L11.314 8.59375C11.3598 8.93164 11.6495 9.19202 12 9.19202C12.3824 9.19202 12.6923 8.88208 12.6923 8.49976L12.6923 6.19202L12.686 6.09814Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',pe='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="cloud">\n <path d="M9.76489 4.00439C7.65723 4.08447 5.79883 5.23486 4.89697 6.94995L4.78638 7.17236C2.60205 7.62524 1 9.40649 1 11.5239C1 14.0032 3.17749 16 5.84619 16L9.32983 16L9.32983 13.3784L7.66479 13.3784C7.21924 13.3784 6.99634 12.8398 7.31128 12.5249L9.63892 10.197C9.83423 10.002 10.1509 10.002 10.3462 10.197L12.6738 12.5249C12.9888 12.8398 12.7659 13.3784 12.3203 13.3784L10.6553 13.3784L10.6553 16L14.9846 16C17.1948 16 19 14.3445 19 12.2856L18.9954 12.1052C18.9058 10.3704 17.533 8.95557 15.7456 8.63818L15.6372 8.62036L15.6152 8.4624C15.2087 5.93188 12.8438 4 10 4L9.76489 4.00439Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',he='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="cloud-record">\n <path d="M9.76489 4.00439C7.65723 4.08447 5.79883 5.23486 4.89697 6.94995L4.78638 7.17236C2.60205 7.62524 1 9.40649 1 11.5239C1 14.0032 3.17749 16 5.84619 16L14.9846 16C17.1948 16 19 14.3445 19 12.2856L18.9954 12.1052C18.9058 10.3704 17.533 8.95557 15.7456 8.63818L15.6372 8.62036L15.6152 8.4624C15.2087 5.93188 12.8438 4 10 4L9.76489 4.00439ZM10.8674 13.9116L6.89038 13.9116C6.26294 13.9116 5.75391 13.3889 5.75391 12.7449L5.75391 9.24487C5.75391 8.60034 6.26294 8.07812 6.89038 8.07812L10.8674 8.07812C11.4954 8.07812 12.0039 8.60034 12.0039 9.24487L12.0039 10.2937C12.2932 10.0627 12.9229 9.63184 13.4836 9.271C13.8145 9.05811 14.2461 9.24219 14.2461 9.63599L14.2461 12.3655C14.2461 12.759 13.8142 12.9434 13.4836 12.7307C12.9321 12.3755 12.303 11.9438 12.0039 11.707L12.0039 12.7449C12.0039 13.3889 11.4954 13.9116 10.8674 13.9116Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',me='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="filter">\n <path d="M12.57 9.92L16.31 5.76C16.55 5.49 16.69 5.15 16.69 4.79C16.69 3.98 16.03 3.33 15.23 3.33L4.79 3.33C4.43 3.33 4.09 3.46 3.82 3.7L3.72 3.79C3.21 4.33 3.19 5.18 3.7 5.75L7.38 9.91L7.38 15.66C7.38 16.11 7.7 16.51 8.14 16.63L11.32 17.43C11.95 17.59 12.57 17.11 12.57 16.46L12.57 9.92ZM4.88 4.83L8.88 9.35L8.88 15.27L11.07 15.82L11.07 9.34L15.13 4.83L4.88 4.83Z" fill-rule="evenodd"/>\n </svg>',Ae='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="more">\n <path d="M4 6.8L20.8 6.8" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M4 12.39L12.4 12.39" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M4 18L8.19 18" stroke-width="1.5" stroke-linecap="round"/>\n </svg>',fe='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="more-dot">\n <path d="M8.75 3.75C8.75 3.05964 9.30964 2.5 10 2.5C10.6904 2.5 11.25 3.05964 11.25 3.75C11.25 4.44036 10.6904 5 10 5C9.30964 5 8.75 4.44036 8.75 3.75ZM8.75 10C8.75 9.30964 9.30964 8.75 10 8.75C10.6904 8.75 11.25 9.30964 11.25 10C11.25 10.6904 10.6904 11.25 10 11.25C9.30964 11.25 8.75 10.6904 8.75 10ZM10 15C9.30964 15 8.75 15.5596 8.75 16.25C8.75 16.9404 9.30964 17.5 10 17.5C10.6904 17.5 11.25 16.9404 11.25 16.25C11.25 15.5596 10.6904 15 10 15Z" fill-rule="evenodd" />\n </svg>',ve='<svg width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="minus-circle">\n \t\t<path fill="currentColor" d="M10 3.75C13.4518 3.75 16.25 6.54822 16.25 10C16.25 13.4518 13.4518 16.25 10 16.25C6.54822 16.25 3.75 13.4518 3.75 10C3.75 6.54822 6.54822 3.75 10 3.75ZM10 5C7.23857 5 5 7.23858 5 10C5 12.7614 7.23857 15 10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5Z" fill-rule="evenodd" />\n\t\t <path stroke="currentColor" d="M7.46729 10.0588L12.4673 10.0588" stroke-linecap="round" stroke-width="1.25" />\n </svg>',ge='<svg width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="plus-circle">\n <path fill="currentColor" d="M10 3.75C13.4518 3.75 16.25 6.54822 16.25 10C16.25 13.4518 13.4518 16.25 10 16.25C6.54822 16.25 3.75 13.4518 3.75 10C3.75 6.54822 6.54822 3.75 10 3.75ZM10 5C7.23857 5 5 7.23858 5 10C5 12.7614 7.23857 15 10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5Z" fill-rule="evenodd" />\n <path stroke="currentColor" d="M7.46729 10.0588L12.4673 10.0588" stroke-linecap="round" stroke-width="1.25" />\n <path stroke="currentColor" d="M0 0L5 0" stroke-linecap="round" stroke-width="1.25" transform="matrix(0,1,-1,0,9.96729,7.55884)" />\n </svg>',ye='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="record">\n <path d="M4.53 19C3.03 19 1.8 17.74 1.8 16.2L1.8 7.8C1.8 6.25 3.03 5 4.53 5L14.08 5C15.58 5 16.8 6.25 16.8 7.8L16.8 16.2C16.8 17.74 15.58 19 14.08 19L4.53 19Z" stroke-width="1.5" stroke-linejoin="round"/>\n <path d="M17.25 13.64C17.94 14.2 18.97 15.03 20.36 16.15C21.09 16.74 22.19 16.21 22.19 15.27L22.19 8.72C22.19 7.78 21.09 7.25 20.36 7.84C18.99 8.94 17.96 9.77 17.28 10.32" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',Te='<svg width="1em" height="1em" viewBox="0 0 14 14" fill="currentColor" stroke="none" focusable="false" aria-hidden="true" data-icon="record-circle">\n\t\t<path d="M7.00044 2.5C9.70278 2.5 11.8935 4.69068 11.8935 7.39302C11.8935 10.0954 9.70278 12.286 7.00044 12.286C4.2981 12.286 2.10742 10.0954 2.10742 7.39302C2.10742 4.69068 4.2981 2.5 7.00044 2.5ZM7.00044 3.5C4.85039 3.5 3.10742 5.24296 3.10742 7.39302C3.10742 9.54307 4.85039 11.286 7.00044 11.286C9.15049 11.286 10.8935 9.54307 10.8935 7.39302C10.8935 5.24296 9.15049 3.5 7.00044 3.5ZM9.50049 7.39252C9.50049 6.01181 8.3812 4.89252 7.00049 4.89252C5.61978 4.89252 4.50049 6.01181 4.50049 7.39252C4.50049 8.77323 5.61978 9.89252 7.00049 9.89252C8.3812 9.89252 9.50049 8.77323 9.50049 7.39252Z" fill-rule="evenodd" />\n </svg>\n ',_e='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="talk">\n \t<path stroke="none" d="M12.22 18.95C12.65 18.95 13.01 19.21 13.07 19.54L13.08 19.64L13.08 21.78C13.08 22.16 12.69 22.47 12.22 22.47C11.78 22.47 11.42 22.21 11.37 21.87L11.36 21.78L11.36 19.64C11.36 19.26 11.74 18.95 12.22 18.95Z" fill-rule="evenodd"/>\n <path d="M19.53 11.37L19.53 11.58C19.53 15.74 16.15 19.11 11.99 19.11C7.83 19.11 4.46 15.74 4.46 11.58L4.46 11.43" fill="none" stroke-width="1.5" stroke-linecap="round"/>\n <path stroke="none" d="M12.05 1.52C9.3 1.52 7.07 3.58 7.07 6.12L7.07 12.07C7.07 14.61 9.3 16.67 12.05 16.67C14.79 16.67 17.02 14.61 17.02 12.07L17.02 6.12C17.02 3.58 14.79 1.52 12.05 1.52ZM8.57 12.07L8.57 6.12C8.57 5.94 8.59 5.75 8.63 5.57C8.67 5.36 8.74 5.16 8.83 4.96C8.86 4.89 8.9 4.82 8.93 4.75C9.09 4.46 9.3 4.21 9.55 3.97C9.64 3.89 9.73 3.81 9.83 3.74C10.08 3.55 10.35 3.4 10.66 3.28C10.79 3.23 10.93 3.19 11.06 3.15C11.38 3.07 11.71 3.02 12.05 3.02C12.38 3.02 12.71 3.07 13.03 3.15C13.17 3.19 13.3 3.23 13.43 3.28C13.74 3.4 14.02 3.55 14.27 3.74C14.36 3.81 14.45 3.89 14.54 3.97C14.79 4.21 15 4.46 15.16 4.75C15.2 4.82 15.23 4.89 15.26 4.96C15.35 5.16 15.42 5.36 15.46 5.57C15.5 5.75 15.52 5.94 15.52 6.12L15.52 12.07C15.52 12.26 15.5 12.44 15.46 12.63C15.42 12.83 15.35 13.04 15.26 13.24C15.23 13.31 15.2 13.38 15.16 13.45C15 13.73 14.79 13.99 14.54 14.22C14.45 14.3 14.36 14.38 14.27 14.45C14.02 14.64 13.74 14.79 13.43 14.91C13.3 14.96 13.17 15.01 13.03 15.05C12.71 15.13 12.38 15.17 12.05 15.17C11.71 15.17 11.38 15.13 11.06 15.05C10.93 15.01 10.79 14.96 10.66 14.91C10.35 14.79 10.08 14.64 9.83 14.45C9.73 14.38 9.64 14.3 9.55 14.22C9.3 13.99 9.09 13.73 8.93 13.45C8.9 13.38 8.86 13.31 8.83 13.24C8.74 13.04 8.67 12.83 8.63 12.63C8.59 12.44 8.57 12.26 8.57 12.07Z" fill-rule="evenodd"/>\n </svg>',be=function(e){return'<svg width="1em" height="1em" viewBox="0 0 24 24" focusable="false" aria-hidden="true" data-icon="talk-growth">\n \t\t<g fill="currentColor" stroke="currentColor">\n <path stroke="none" d="M9.22313 18.9543C9.6588 18.9543 10.0189 19.2133 10.0759 19.5494L10.0837 19.6428L10.0837 21.7847C10.0837 22.1649 9.69841 22.4732 9.22313 22.4732C8.78745 22.4732 8.42739 22.2142 8.37041 21.8781L8.36255 21.7847L8.36255 19.6428C8.36255 19.2626 8.74784 18.9543 9.22313 18.9543Z" fill-rule="evenodd" />\n <path d="M16.5323 11.3779L16.5323 11.5872C16.5323 15.7472 13.1599 19.1197 8.99981 19.1197C4.83971 19.1197 1.46729 15.7472 1.46729 11.5872L1.46729 11.4335" fill-rule="evenodd" fill="none" stroke-width="1.5" />\n <path stroke="none" d="M4.07861 6.12978C4.07861 3.589 6.30476 1.5293 9.05085 1.5293C11.7969 1.5293 14.0231 3.589 14.0231 6.12978L14.0231 12.075C14.0231 14.6158 11.7969 16.6755 9.05085 16.6755C6.30476 16.6755 4.07861 14.6158 4.07861 12.075L4.07861 6.12978ZM5.57861 12.075L5.57861 6.12978C5.57861 5.94083 5.597 5.75561 5.63376 5.57412C5.67605 5.36539 5.74265 5.16158 5.83357 4.9627C5.86625 4.8912 5.90164 4.82121 5.93974 4.75272C6.09781 4.4685 6.30245 4.21019 6.55365 3.97777C6.64206 3.89597 6.73424 3.81921 6.83019 3.7475C7.0816 3.55959 7.3589 3.40632 7.66207 3.28767C7.79552 3.23545 7.93107 3.19114 8.06871 3.15475C8.38503 3.07111 8.71241 3.0293 9.05085 3.0293C9.38929 3.0293 9.71668 3.07112 10.033 3.15475C10.1706 3.19114 10.3062 3.23545 10.4396 3.28767C10.7428 3.40632 11.0201 3.55959 11.2715 3.74749C11.3675 3.81921 11.4596 3.89596 11.548 3.97777C11.7993 4.2102 12.0039 4.46853 12.162 4.75276C12.2001 4.82124 12.2354 4.89122 12.2681 4.9627C12.359 5.16157 12.4256 5.36536 12.4679 5.57407C12.5047 5.75558 12.5231 5.94082 12.5231 6.12978L12.5231 12.075C12.5231 12.264 12.5047 12.4492 12.4679 12.6307C12.4256 12.8394 12.359 13.0432 12.2681 13.2421C12.2355 13.3136 12.2001 13.3835 12.162 13.452C12.0039 13.7362 11.7993 13.9946 11.548 14.227C11.4596 14.3088 11.3675 14.3856 11.2715 14.4573C11.0201 14.6452 10.7428 14.7985 10.4396 14.9171C10.3062 14.9693 10.1706 15.0136 10.033 15.05C9.71667 15.1337 9.38929 15.1755 9.05085 15.1755C8.71241 15.1755 8.38503 15.1337 8.06871 15.05C7.93107 15.0136 7.79552 14.9693 7.66207 14.9171C7.3589 14.7985 7.0816 14.6452 6.83019 14.4573C6.73424 14.3856 6.64206 14.3088 6.55365 14.227C6.30244 13.9946 6.09779 13.7363 5.93972 13.452C5.90163 13.3836 5.86625 13.3136 5.83357 13.2421C5.74265 13.0432 5.67605 12.8394 5.63377 12.6307C5.597 12.4492 5.57861 12.264 5.57861 12.075Z" fill-rule="evenodd" />\n </g>\n <g class="'+e+'-icon-talk-growth-dot">\n <path class="'+e+'-icon-talk-growth-dot1" d="M19.1333 6.40039L22.8667 6.40039" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="'+e+'-icon-talk-growth-dot2" d="M19.1333 10.1338L21.9331 10.1338" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="'+e+'-icon-talk-growth-dot3" d="M19.1333 13.8672L20.9995 13.8672" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="'+e+'-icon-talk-growth-dot4" d="M19.1333 17.6001L20.0669 17.6001" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n </g>\n </svg>'},Ce='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="capture-picture">\n \t<path d="M6.94 7.51C7.34 7.51 7.7 7.28 7.86 6.91L8.43 5.6C8.59 5.23 8.95 5 9.35 5L14.69 5C15.04 5 15.37 5.18 15.55 5.49L16.45 7.02C16.63 7.33 16.96 7.51 17.31 7.51L18.5 7.51C19.6 7.51 20.5 8.41 20.5 9.51L20.5 17C20.5 18.1 19.6 19 18.5 19L5.5 19C4.39 19 3.5 18.1 3.5 17L3.5 9.51C3.5 8.41 4.39 7.51 5.5 7.51L6.94 7.51Z" stroke-width="1.5"/>\n\t <circle cx="12" cy="12.525146" r="3.068097" stroke-width="1.5"/>\n </svg>',Se='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="zoom">\n <ellipse cx="10.914795" cy="11.25" rx="8.004043" ry="8.25" stroke-width="1.5"/>\n <path d="M14.31 11.04L8.05 11.14" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M11.13 14.22L11.23 7.95" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M16.45 17.83L19.36 20.83" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',Ee='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="info-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM7.25 5.25C7.25 5.66421 7.58579 6 8 6C8.41421 6 8.75 5.66421 8.75 5.25C8.75 4.83579 8.41421 4.5 8 4.5C7.58579 4.5 7.25 4.83579 7.25 5.25ZM8.5 7.125C8.5 7.05625 8.44375 7 8.375 7L7.625 7C7.55625 7 7.5 7.05625 7.5 7.125L7.5 11.375C7.5 11.4438 7.55625 11.5 7.625 11.5L8.375 11.5C8.44375 11.5 8.5 11.4438 8.5 11.375L8.5 7.125Z" fill-rule="evenodd"/>\n </svg>',we='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="info-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM7.5 8.875C7.5 8.94375 7.55625 9 7.625 9L8.375 9C8.44375 9 8.5 8.94375 8.5 8.875L8.5 4.625C8.5 4.55625 8.44375 4.5 8.375 4.5L7.625 4.5C7.55625 4.5 7.5 4.55625 7.5 4.625L7.5 8.875ZM7.25 10.75C7.25 11.1642 7.58579 11.5 8 11.5C8.41421 11.5 8.75 11.1642 8.75 10.75C8.75 10.3358 8.41421 10 8 10C7.58579 10 7.25 10.3358 7.25 10.75Z" fill-rule="evenodd" />\n </svg>',ke='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="date">\n <g>\n <path d="m13.35,5.9c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-3.3c0,-0.3 0.2,-0.5 0.5,-0.5s0.5,0.2 0.5,0.5l0,3.3c0,0.3 -0.3,0.5 -0.5,0.5z" />\n <path d="m6.65,5.9c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-3.3c0,-0.3 0.2,-0.5 0.5,-0.5s0.5,0.2 0.5,0.5l0,3.3c0,0.3 -0.2,0.5 -0.5,0.5z" />\n <path d="m17.45,8.4l-15,0c-0.3,0 -0.5,-0.2 -0.5,-0.5s0.2,-0.5 0.5,-0.5l15,0c0.3,0 0.5,0.2 0.5,0.5s-0.2,0.5 -0.5,0.5z" />\n <path d="m15.85,18.4l-11.7,0c-1.2,0 -2.2,-1 -2.2,-2.2l0,-10.8c0,-1.2 1,-2.2 2.2,-2.2l11.7,0c1.2,0 2.2,1 2.2,2.2l0,10.8c-0.1,1.3 -1,2.2 -2.2,2.2zm-11.7,-14.1c-0.6,0 -1.2,0.5 -1.2,1.2l0,10.8c0,0.6 0.5,1.2 1.2,1.2l11.7,0c0.6,0 1.2,-0.5 1.2,-1.2l0,-10.9c0,-0.6 -0.5,-1.2 -1.2,-1.2l-11.7,0l0,0.1z" />\n <path d="m9.95,12c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5s0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7s-0.3,0.7 -0.7,0.7z" />\n <path d="m14.15,12c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2c0.4,0 0.7,0.3 0.7,0.7s-0.3,0.7 -0.7,0.7zm0,-1c-0.2,0 -0.3,0.1 -0.3,0.3c0,0.2 0.3,0.4 0.5,0.2c0.1,-0.1 0.1,-0.1 0.1,-0.2c0,-0.2 -0.1,-0.3 -0.3,-0.3z" />\n <path d="m5.85,15.3c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7c0,0.4 -0.3,0.7 -0.7,0.7z" />\n <path d="m9.95,15.3c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7c0.1,0.4 -0.3,0.7 -0.7,0.7z" />\n </g>\n </svg>',Pe='<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="add">\n <path d="M10.5859 2.96875L9.41406 2.96875C9.3099 2.96875 9.25781 3.02083 9.25781 3.125L9.25781 9.25781L3.4375 9.25781C3.38542 9.25781 3.34635 9.27083 3.32031 9.29688C3.29427 9.32292 3.28125 9.36198 3.28125 9.41406L3.28125 10.5859C3.28125 10.6901 3.33333 10.7422 3.4375 10.7422L9.25781 10.7422L9.25781 16.875C9.25781 16.9792 9.3099 17.0312 9.41406 17.0312L10.5859 17.0312C10.6901 17.0312 10.7422 16.9792 10.7422 16.875L10.7422 10.7422L16.5625 10.7422C16.6667 10.7422 16.7188 10.6901 16.7188 10.5859L16.7188 9.41406C16.7188 9.3099 16.6667 9.25781 16.5625 9.25781L10.7422 9.25781L10.7422 3.125C10.7422 3.07292 10.7292 3.03385 10.7031 3.00781C10.6771 2.98177 10.638 2.96875 10.5859 2.96875Z" fill-rule="evenodd" /></svg>',De='<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="reduce">\n \t<path d="M3.4375 9.25781L16.5625 9.25781C16.6667 9.25781 16.7188 9.3099 16.7188 9.41406L16.7188 10.5859C16.7188 10.6901 16.6667 10.7422 16.5625 10.7422L3.4375 10.7422C3.33333 10.7422 3.28125 10.6901 3.28125 10.5859L3.28125 9.41406C3.28125 9.3099 3.33333 9.25781 3.4375 9.25781Z" fill-rule="evenodd" />\n </svg>';function Le(e,t,n){void 0===n&&(n={});var i="";return n&&Object.keys(n).forEach((function(e){void 0!==n[e]&&null!==n[e]&&(i+=e+'="'+n[e]+'"')})),'<span class="'+x+"-icon "+x+"-icon-"+t+'" '+i+">"+e+"</span>"}var ze=function(e){return void 0===e&&(e={}),Le(ee,"play",e)},xe=function(e){return void 0===e&&(e={}),Le(te,"pause",e)},Oe=function(e){return void 0===e&&(e={}),Le(ne(x),"volume",e)},Ie=function(e){return void 0===e&&(e={}),Le(ie,"mobile-fullscreen",e)},Re=function(e){return void 0===e&&(e={}),Le(oe,"exit-fullscreen",e)},Me=function(e){return void 0===e&&(e={}),Le(re,"fullscreen",e)},Ne=function(e){return void 0===e&&(e={}),Le(se,"exit-global-fullscreen",e)},$e=function(e){return void 0===e&&(e={}),Le(ae,"global-fullscreen",e)},Fe=function(e){return void 0===e&&(e={}),Le(Ce,"capture-picture",e)},je=function(e){return void 0===e&&(e={}),Le(de,"ptz",e)},Ue=function(e){return void 0===e&&(e={}),Le(ye,"record",e)},Be=function(e){return void 0===e&&(e={}),Le(Te,"record-circle",e)},Ve=function(e){return void 0===e&&(e={}),Le(_e,"talk",e)},Ye=function(e){return void 0===e&&(e={}),Le(be(x),"talk-growth",e)},Ze=function(e){return void 0===e&&(e={}),Le(Se,"zoom",e)},He=function(e){return void 0===e&&(e={}),Le(Ae,"more",e)},Ge=function(e){return void 0===e&&(e={}),Le(fe,"more-dot",e)},Qe=function(e){return void 0===e&&(e={}),Le(ve,"minus-circle",e)},Ke=function(e){return void 0===e&&(e={}),Le(ge,"plus-circle",e)},We=function(e){return void 0===e&&(e={}),Le(ue,"sdk",e)},Je=function(e){return void 0===e&&(e={}),Le(pe,"cloud-rec",e)},qe=function(e){return void 0===e&&(e={}),Le(he,"cloud-record",e)},Xe=function(e){return void 0===e&&(e={}),Le(le,"close",e)},et=function(e){return void 0===e&&(e={}),Le(ce,"close-circle",e)},tt=function(e){return void 0===e&&(e={}),Le(we,"warn-circle",e)},nt=function(e){return void 0===e&&(e={}),Le(Ee,"info-circle",e)},it=function(e){return void 0===e&&(e={}),Le(ke,"date",e)},rt=function(e){return void 0===e&&(e={}),Le(me,"filter",e)},ot=function(e){return void 0===e&&(e={}),Le(Pe,"add",e)},at=function(e){return void 0===e&&(e={}),Le(De,"reduce",e)};function st(){return st=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},st.apply(this,arguments)}function lt(e,t){return lt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},lt(e,t)}var ct={},dt=function(e){function t(t){var n;return void 0===t&&(t={}),(n=e.call(this,Object.assign({},ct,st({},t,{tagName:"div",controlType:"block"})))||this).options=Object.assign({},ct,t),n.$container.classList.add(x+"-message",x+"-hide"),n}!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&&lt(e,t)}(t,e);var n=t.prototype;return n.info=function(e,t){void 0===t&&(t=2),this._toast(e,"info",t)},n.warn=function(e,t){void 0===t&&(t=2),this._toast(e,"warn",t)},n.toastError=function(e,t){void 0===t&&(t=2),this._toast(e,"error",t)},n.error=function(e,t){void 0===t&&(t=0),this._show(this._getIcon("error")+'<div class="'+x+'-message-msg">'+(e||"")+"</div>",t,"error")},n._toast=function(e,t,n){var i=this;void 0===t&&(t="info"),void 0===n&&(n=2),this._toastTimer&&clearTimeout(this._toastTimer),this._toastTimer=null,this.options.rootContainer&&(this._$toast||(this._$toast=document.createElement("div"),this._$toast.classList.add(x+"-toast")),this._$toast.innerHTML='<div class="'+x+'-toast-content">'+this._getIcon(t)+'<span class="'+x+"-toast-msg "+x+"-toast-"+t+'">'+(e||"")+"</span></div>",this.options.rootContainer.appendChild(this._$toast),n>0&&(this._toastTimer=setTimeout((function(){var e;null==(e=i._$toast)||e.remove(),i._$toast=null,i._toastTimer&&clearTimeout(i._toastTimer),i._toastTimer=null}),1e3*n)))},n._show=function(e,t,n){var i=this;void 0===t&&(t=0),void 0===n&&(n="info"),this._timer&&(clearTimeout(this._timer),this._timer=null),this.$popupContainer.classList.add(x+"-has-message",x+"-has-message-"+n),"function"==typeof this.options.render?this.$container.innerHTML=this.options.render(e,t,n):this.$container.innerHTML='<div class="'+x+"-message-content "+x+"-message-"+n+'">'+(e||"")+"</div>",this.$container.style.display="flex",this.$container.classList.remove(x+"-hide"),t>0&&(this._timer=setTimeout((function(){i.hide(),i._timer&&clearTimeout(i._timer),i._timer=null}),1e3*t))},n.destroy=function(){var t;this._timer&&(clearTimeout(this._timer),this._timer=null),this._toastTimer&&clearTimeout(this._toastTimer),this._toastTimer=null,null==(t=this._$toast)||t.remove(),this._$toast=null,this.hide(),e.prototype.destroy.call(this)},n.hide=function(){var t=this;this.$container.innerHTML="",Array.from(this.$popupContainer.classList).forEach((function(e){new RegExp("^"+x+"-has-message","ig").test(e)&&t.$popupContainer.classList.remove(e)})),e.prototype.hide.call(this)},n._getIcon=function(e){var t=nt();switch(e){case"warn":t=tt();break;case"error":t=et();break;default:t=nt()}return t},t}(Z);function ut(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function pt(){return pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pt.apply(this,arguments)}function ht(e,t){return ht=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ht(e,t)}var mt=function(e){function t(t){var n;return(n=e.call(this,pt({},t,{tagName:"span",controlType:"button",classNameSuffix:"play"}))||this)._playing=!1,n._options=t,n._playing=!!t.props.playing,n.on(B.play,(function(e){n._playing!==e&&(n._playing=e,n._render())})),n._render(),n}!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&&ht(e,t)}(t,e);var n=t.prototype;return n._onControlClick=function(e){this._playing=!this._playing,this.emit(B.control.play,this._playing),null==this._options.onClick||this._options.onClick.call(this._options,e,this._playing),this._render()},n._render=function(){var e,t;this._playing?this.$container.innerHTML=ze({title:null==(e=this.locale)?void 0:e.BTN_PLAY}):this.$container.innerHTML=xe({title:null==(t=this.locale)?void 0:t.BTN_PAUSE})},ut(t,[{key:"playing",get:function(){return this._playing}}]),t}(Z);function At(e,t){var n=null,i=0;return function(){for(var r=this,o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=Date.now(),c=t-(l-i);c<=0?(i=l,e.apply(this,a)):n||(n=setTimeout((function(){i=Date.now(),n=null,e.apply(r,a)}),c))}}function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function vt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var gt=function(){function e(){}return e.orientationEventListener=function(t){var n=null,i=function(){var t,n;if(null==(t=screen)?void 0:t.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type||screen.mozOrientation||screen.msOrientation};if(void 0!==(null==(n=window)?void 0:n.orientation)){var i=window.orientation;return{angle:i>=0?i:360+i,type:90===Math.abs(i)?"landscape":"portrait"}}return e.isMobile?{angle:window.innerWidth>window.innerHeight?90:0,type:window.innerWidth>window.innerHeight?"landscape":"portrait"}:{angle:0,type:"unknow"}},r=i(),o=function(){var e=null==i?void 0:i();e.angle===r.angle&&e.type===r.type||(null==t||t(e),r=e)},a=function(){n&&clearTimeout(n),o&&(n=setTimeout(o,200))};return screen.orientation?screen.orientation.addEventListener("change",o):"onorientationchange"in window?window.addEventListener("orientationchange",o):e.isMobile&&window.addEventListener("resize",a),[r,function(){screen.orientation&&o?screen.orientation.removeEventListener("change",o):"onorientationchange"in window&&o?window.removeEventListener("orientationchange",o):e.isMobile&&window.removeEventListener("resize",a),o=null,a=null,i=null,n&&(clearTimeout(n),n=null)}]},e.resizeObserver=function(e,t){var n=function(n,i){for(var r,o=vt(n);!(r=o()).done;){r.value.target===e&&t&&t(n,i)}},i=new ResizeObserver(At(n,50));return i.observe(e),{unobserve:function(){try{null==i||i.unobserve(e)}catch(e){}n=null},disconnect:function(){null==i||i.disconnect(),i=null,n=null}}},e}();function yt(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}gt.isMobile=n();var Tt={step:.01,range:[0,1],draggable:!0,disabled:!1,showPercent:!1,showPlus:!1,showMinus:!1,isRotated:!1,onChange:function(){},renderText:function(e,t){return(100*t).toFixed(0)}},_t=function(){function e(e){var t,n;if(this._percent=0,this._value=0,this._disabled=!1,this._delegateSliderMouseDown=null,this._delegateSliderHandleMouseDown=null,this._delegateProgressMouseDown=null,this._delegatePlusClick=null,this._delegateMinusClick=null,this._isRotated=!1,this.options=Object.assign({},Tt,e),2!==(null==(t=this.options.range)?void 0:t.length))throw new Error("Progress range must be an array with two elements.");if(this.options.range[0]>=this.options.range[1])throw new Error("Progress range first element must be less than the second element.");this._isRotated=this.options.isRotated||!1,this.$container=e.container,this._render(),this._eventListeners();var i=null!=(n=this.options.defaultValue)?n:this.options.range[0];this._value=+i.toFixed(2),this._percent=+((i-this.options.range[0])/(this.options.range[1]-this.options.range[0])).toFixed(2),this._updateUI(),this.disabled=this.options.disabled}var t=e.prototype;return t.isRotate=function(e){this._isRotated=e},t.destroy=function(){var e,t,n,i,r,o,a,s,l,c;null==(t=this._delegateSliderMouseDown)||null==(e=t.destroy)||e.call(t),this._delegateSliderMouseDown=null,null==(i=this._delegateSliderHandleMouseDown)||null==(n=i.destroy)||n.call(i),this._delegateSliderHandleMouseDown=null,null==(o=this._delegateProgressMouseDown)||null==(r=o.destroy)||r.call(o),this._delegateProgressMouseDown=null,null==(s=this._delegatePlusClick)||null==(a=s.destroy)||a.call(s),this._delegatePlusClick=null,null==(c=this._delegateMinusClick)||null==(l=c.destroy)||l.call(c),this._delegateMinusClick=null,this.$content&&this.$container.removeChild(this.$content),this.$content=null},t._updateValuePercent=function(e,t){if("percent"===e){if(t<0||t>1)return;this._percent!==t&&(this._percent=+t.toFixed(2),this._convertPercentToValue(this._percent),null==this.options.onChange||this.options.onChange.call(this.options,this._value,this._percent,this.options.range),this._updateUI())}else if("value"===e){if(t<this.options.range[0]||t>this.options.range[1])return;this._value!==t&&(this._value=+t.toFixed(2),this._convertValueToPercent(this._value),null==this.options.onChange||this.options.onChange.call(this.options,this._value,this._percent,this.options.range),this._updateUI())}},t._convertPercentToValue=function(e){this._value=+(this.options.range[0]+(this.options.range[1]-this.options.range[0])*e).toFixed(2)},t._convertValueToPercent=function(e){this._percent=+((e-this.options.range[0])/(this.options.range[1]-this.options.range[0])).toFixed(2)},t._render=function(){var e;this.$content=document.createElement("div"),this.$content.className=x+"-progress "+(null!=(e=this.options.className)?e:""),this.$content.innerHTML=(this.options.showPercent?'<div class="'+x+'-progress-text">'+(null==this.options.renderText?void 0:this.options.renderText.call(this.options,this._value,this._percent,this.options.range))+"</div>":"")+"\n "+(this.options.showPlus?'<div class="'+x+'-progress-plus">\n '+Ke()+"\n </div>":"")+'\n <div class="'+x+'-progress-slider">\n <div class="'+x+'-progress-slider-fill"></div>\n <div class="'+x+'-progress-slider-handle" style="top: 100%"></div>\n </div>\n '+(this.options.showMinus?'<div class="'+x+'-progress-minus">\n '+Qe()+"\n </div>":""),this.$container.appendChild(this.$content)},t._updateUI=function(){var e=this.$content;if(null==e||e.setAttribute("data-value",this._value+""),e.querySelector("."+x+"-progress-slider-fill")){var t=+(100*this._percent).toFixed(0);this.options.showPercent&&(e.querySelector("."+x+"-progress-text").innerHTML=null==this.options.renderText?void 0:this.options.renderText.call(this.options,this._value,this._percent,this.options.range)),e.querySelector("."+x+"-progress-slider-fill").style.height=t+"%",e.querySelector("."+x+"-progress-slider-handle").style.top=100-t+"%"}},t._eventListeners=function(){var e=this,t=window.PointerEvent?"pointerdown":"mousedown";if(this._delegateSliderMouseDown=P(this.$content,"."+x+"-progress-slider",t,(function(t){var n,i;if(t.stopPropagation(),!t.delegateTarget.classList.contains(x+"-disabled")&&!e._disabled){var r=e.$content.querySelector("."+x+"-progress-slider").getBoundingClientRect(),o=0;if(gt.isMobile&&e._isRotated)o=+(Math.max(0,Math.min(t.clientX-r.x,r.width))/r.width).toFixed(2);else o=+(Math.max(0,Math.min(r.height-(t.clientY-r.y),r.height))/r.height).toFixed(2);e._convertPercentToValue(o),null==(i=e.options)||null==(n=i.onProgressClick)||n.call(i,e._value,o,e.options.range),e.percent=o}})),this._delegateSliderHandleMouseDown=P(this.$content,"."+x+"-progress-slider-handle",t,(function(t){if(t.stopPropagation(),e.options.draggable&&!t.delegateTarget.classList.contains(x+"-disabled")&&!e._disabled){var n=e._isRotated?t.clientX:t.clientY,i=e.$content.querySelector("."+x+"-progress-slider-fill").offsetHeight,r=e.$content.querySelector("."+x+"-progress-slider").offsetHeight,o=At((function(t){if(t.stopPropagation(),e.options.draggable&&!e._disabled){var o=n-(e._isRotated?t.clientX:t.clientY),a=i+(e._isRotated?-o:o);a=Math.max(0,Math.min(a,r)),e.percent=+(a/r).toFixed(2)}}),20),a=e.$content,s=window.PointerEvent?"pointermove":"mousemove",l=window.PointerEvent?"pointerup":"mouseup",c=window.PointerEvent?"pointerleave":"mouseleave";a.addEventListener(s,o),a.addEventListener(l,d),a.addEventListener(c,d)}function d(){a.removeEventListener(s,o),o=null,a.removeEventListener(l,d),a.removeEventListener(c,d)}})),this.options.showPlus){var n=window.PointerEvent?"pointerdown":"click";this._delegatePlusClick=P(this.$content,"."+x+"-progress-plus",n,(function(t){if(t.stopPropagation(),!t.delegateTarget.classList.contains(x+"-disabled")&&!e._disabled){var n=e._value+e.options.step;n<=e.options.range[1]?e.value=n:e.value=e.options.range[1],null==e.options.onPlusClick||e.options.onPlusClick.call(e.options,e.value,e.percent,e.options.range)}}))}if(this.options.showMinus){var i=window.PointerEvent?"pointerdown":"click";this._delegateMinusClick=P(this.$content,"."+x+"-progress-minus",i,(function(t){if(t.stopPropagation(),!t.delegateTarget.classList.contains(x+"-disabled")&&!e._disabled){var n=e._value-e.options.step;n>=e.options.range[0]?e.value=n:e.value=e.options.range[0],null==e.options.onMinusClick||e.options.onMinusClick.call(e.options,e.value,e.percent,e.options.range)}}),!0)}["mousedown","touchstart","touchmove","dblclick"].forEach((function(t){P(e.$container,"."+x+"-progress",t,(function(e){e.stopPropagation(),e.preventDefault()}))}))},yt(e,[{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=e}},{key:"value",get:function(){return this._value},set:function(e){this._updateValuePercent("value",e)}},{key:"percent",get:function(){return this._percent},set:function(e){this._updateValuePercent("percent",e)}}]),e}();function bt(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function Ct(){return Ct=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ct.apply(this,arguments)}function St(e,t){return St=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},St(e,t)}var Et={volume:.8,muted:!1,open:!1,trigger:"hover",onOpenChange:function(){},onChange:function(){}},wt=function(t){function n(n){var i,r,o,a,s,l,c;(void 0===n&&(n={}),(i=t.call(this,Ct({},n,{tagName:"span",classNameSuffix:"volume",controlType:"button"}))||this)._muted=!1,i._volume=0,i._lastVolume=0,i._progress=null,i._options=e(Et,n,{clone:!1}),i._render(),i._volume=(null==(r=i._options.props)?void 0:r.volume)>=1?1:(null==(o=i._options.props)?void 0:o.volume)<=0?0:+(null==(a=i._options.props)?void 0:a.volume.toFixed(2)),i._lastVolume=i._volume,i._muted=!!(null==(s=i._options.props)?void 0:s.muted)||!1,gt.isMobile||"ezopen"===i._options.PLAY_TYPE)||(i.picker=new C(i.$container,{getPopupContainer:function(){return i.$container},trigger:i._options.trigger,open:i._options.open,offset:[0,-10],placement:"top",onOpenChange:function(e){null==i._options.onOpenChange||i._options.onOpenChange.call(i._options,e,i._muted?i._lastVolume:i.volume,i._muted),i.emit(B.control.volumePanelOpenChange,e,i._lastVolume,i._muted)}}),i._progress=new _t({container:i.picker.$body,defaultValue:(null==(l=i._options.props)?void 0:l.muted)?0:null==(c=i._options.props)?void 0:c.volume,range:[0,1],step:.1,showPercent:!0,className:x+"-volume-progress",onProgressClick:function(){i.muted=!1},onChange:function(e){e!==i._volume&&(i.volume=e)}}));return i._updateUI(),i._addEventListener(),i.on(B.audioCodecUnsupported,(function(){i.disabled=!0})),i.on(B.volumechange,(function(e,t){i._muted!==t&&(i.muted=t),i._lastVolume!==e&&(i.volume=e)})),i}!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&&St(e,t)}(n,t);var i=n.prototype;return i.destroy=function(){var e,n,i;null==(n=this._progress)||null==(e=n.destroy)||e.call(n),this._progress=null,null==(i=this.picker)||i.destroy(),this.picker=null,t.prototype.destroy.call(this)},i._toggleMute=function(){if(!this.disabled){var e;if(0===this._lastVolume)return this.volume=(null==(e=this._options.props)?void 0:e.volume)||.5,void(this.muted=!1);this.muted?this.muted=!1:this.muted=!0}},i._updateUI=function(){var e,t;(this._$content.classList.remove(x+"-icon-volume-muted"),this._$content.classList.remove(x+"-icon-volume-zero"),this._$content.classList.remove(x+"-icon-volume-low"),this._$content.classList.remove(x+"-icon-volume-high"),this._muted)?(this._volume=0,this._$content.classList.add(x+"-icon-volume-muted"),this._$content.setAttribute("title",(null==this||null==(e=this.locale)?void 0:e.BTN_MUTED)||"muted")):(this._$content.classList.remove(x+"-icon-volume-muted"),0===this._volume?this._$content.classList.add(x+"-icon-volume-zero"):this._volume<=.5?this._$content.classList.add(x+"-icon-volume-low"):this._$content.classList.add(x+"-icon-volume-high"),this._$content.setAttribute("title",(null==this||null==(t=this.locale)?void 0:t.BTN_VOLUME)||"volume"))},i._render=function(){var e;this.$container.innerHTML=Oe({title:null==(e=this.locale)?void 0:e.BTN_VOLUME})},i._onControlClick=function(){},i._addEventListener=function(){var e=this;P(this.$container,"."+x+"-control-volume","mousedown",(function(){e.$container.classList.contains(x+"-disabled")||e._toggleMute()}))},bt(n,[{key:"muted",get:function(){return this._muted},set:function(e){this._muted!==e&&(e?(this._volume=0,this._progress&&(this._progress.value=0)):(this._volume=this._lastVolume,this._progress&&(this._progress.value=this._lastVolume)),this._muted=e,null==this._options.onChange||this._options.onChange.call(this._options,this.volume,e),this.emit(B.control.volumechange,this.volume,e)),this._updateUI()}},{key:"volume",get:function(){return this._lastVolume},set:function(e){if(e>=0&&e<=1){var t=+e.toFixed(2);this._lastVolume!==t&&(this._volume=t,this._lastVolume=this._volume,this._progress&&(this._progress.value=t),null==this._options.onChange||this._options.onChange.call(this._options,t,this._muted),this.emit(B.control.volumechange,t,this._muted)),this._updateUI()}}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=e,this.picker&&(this.picker.disabled=e),this._updateDisabledState(e)}},{key:"_$content",get:function(){return this.$container.querySelector("."+x+"-icon-volume")}}]),n}(Z);function kt(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Pt(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){kt(o,i,r,a,s,"next",e)}function s(e){kt(o,i,r,a,s,"throw",e)}a(void 0)}))}}function Dt(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var Lt={prefix:"ezplayer"},zt=function(){function e(){this.fullscreens=[]}var t=e.prototype;return t.add=function(e,t){if(e){var n=this.fullscreens.findIndex((function(t){return t.element===e}));n>=0?(this.fullscreens[n].onChange||(this.fullscreens[n].onChange=[]),this.fullscreens[n].onChange.push(t)):this.fullscreens.push({element:e,onChange:[t]})}},t.getChanges=function(e){var t=this.fullscreens.find((function(t){return t.element===e}));return t&&(null==t?void 0:t.onChange)||[]},t.remove=function(e,t){var n=this.fullscreens.findIndex((function(t){return t.element===e}));if(n>=0){var i,r=null==(i=this.fullscreens[n].onChange)?void 0:i.find((function(e){return e===t}));if(r){var o,a=null==(o=this.fullscreens[n].onChange)?void 0:o.filter((function(e){return e!==r}));this.fullscreens[n].onChange=a}(!this.fullscreens[n].onChange||this.fullscreens[n].onChange&&0===this.fullscreens[n].onChange.length)&&this.fullscreens.splice(n,1)}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e}(),xt=zt.getInstance(),Ot=function(){function e(e,t){void 0===t&&(t={}),this._isCurrentFullscreen=!1,this._isFullscreen=!1,this._currentFullscreenElementList=[],this.$container=e,this._options=Object.assign({},Lt,t),this._options.onChange&&gt.isMobile&&xt.add(this.$container,this._options.onChange),this._isFullscreen=!!this._options.isFullscreen,this._fullscreenchange2=this._fullscreenchange2.bind(this),a.isEnabled&&a.on("change",this._fullscreenchange2)}var t=e.prototype;return t.fullscreen=function(){return Pt((function(){return Dt(this,(function(e){switch(e.label){case 0:return gt.isMobile?(this._fullscreenchange(this.$container,!0),[3,3]):[3,1];case 1:return[4,a.request(this.$container)];case 2:return[2,e.sent()];case 3:return[2]}}))})).call(this)},t.exitFullscreen=function(){return Pt((function(){return Dt(this,(function(e){switch(e.label){case 0:return gt.isMobile?(this._fullscreenchange(this.$container,!1),[3,3]):[3,1];case 1:return this._isFullscreen?[4,a.exit()]:[3,3];case 2:return[2,e.sent()];case 3:return[2]}}))})).call(this)},t.toggle=function(){return Pt((function(){return Dt(this,(function(e){switch(e.label){case 0:return gt.isMobile?(this._fullscreenchange(this.$container,!this._isCurrentFullscreen),[3,3]):[3,1];case 1:return[4,a.toggle(this.$container)];case 2:return[2,e.sent()];case 3:return[2]}}))})).call(this)},t.destroy=function(){a.isEnabled&&a.off("change",this._fullscreenchange2),gt.isMobile&&this._options.onChange&&xt.remove(this.$container,this._options.onChange),this._fullscreenchange2=null},t._fullscreenchange2=function(){this._fullscreenchange()},t._fullscreenchange=function(e,t){var n,i,r,o=this;if(this._isFullscreen=a.isFullscreen,e)this._isCurrentFullscreen=!!t,this._currentFullscreenElementList=[];else if(this._isFullscreen){var s=a.element,l=this._currentFullscreenElementList.indexOf(s);s&&-1===l?this._currentFullscreenElementList.unshift(s):s&&l>=1&&this._currentFullscreenElementList.shift();var c=this._currentFullscreenElementList.indexOf(this.$container);this._isCurrentFullscreen=c>=0}else this._isCurrentFullscreen=!1,this._currentFullscreenElementList=[];this._isCurrentFullscreen?null==(n=this.$container)||n.classList.add(this._options.prefix+"-fullscreen"):(null==(i=this.$container)||i.classList.remove(this._options.prefix+"-fullscreen"),null==(r=this.$container)||r.classList.remove(this._options.prefix+"-global-fullscreen"));gt.isMobile?xt.getChanges(this.$container).forEach((function(e){e({isCurrentFullscreen:o._isCurrentFullscreen,isFullscreen:o._isFullscreen,isMobile:gt.isMobile})})):null==this._options.onChange||this._options.onChange.call(this._options,{isCurrentFullscreen:this._isCurrentFullscreen,isFullscreen:this._isFullscreen,isMobile:gt.isMobile}),gt.isMobile&&(this._isCurrentFullscreen?document.body.classList.add(this._options.prefix+"-body-mobile-noscroll"):document.body.classList.remove(this._options.prefix+"-body-mobile-noscroll"))},e}();function It(){return It=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},It.apply(this,arguments)}function Rt(e,t){return Rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Rt(e,t)}var Mt=function(e){function t(t){var n,i,r;if((n=e.call(this,It({tagName:"span",classNameSuffix:"fullscreen",controlType:"button"},t))||this).isCurrentFullscreen=!1,n.options=t,n.isCurrentFullscreen=!!(null==(i=t.props)?void 0:i.isCurrentFullscreen),n._$rootContainer=null==(r=n.options)?void 0:r.rootContainer,!n._$rootContainer)throw new Error("Fullscreen option fullscreenContainer is required!");return n._fullscreenChange=n._fullscreenChange.bind(n),n._fullscreenUtil=new Ot(n._$rootContainer,{onChange:n._fullscreenChange,isFullscreen:n.isCurrentFullscreen}),n._render(),n._event(),n}!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&&Rt(e,t)}(t,e);var n=t.prototype;return n.destroy=function(){var t;this.$container.innerHTML="",null==(t=this._fullscreenUtil)||t.destroy(),this._fullscreenUtil=null,e.prototype.destroy.call(this)},n._render=function(){var e,t,n;gt.isMobile?this.$container.innerHTML=Ie({title:null==(e=this.locale)?void 0:e.BTN_FULLSCREEN}):this.$container.innerHTML=Re({title:null==(t=this.locale)?void 0:t.BTN_EXIT_FULLSCREEN})+Me({title:null==(n=this.locale)?void 0:n.BTN_FULLSCREEN})},n._fullscreenChange=function(e){this.isCurrentFullscreen=e.isCurrentFullscreen,this._render(),null==this.options.onChange||this.options.onChange.call(this.options,e)},n._onControlClick=function(){var e,t;this.isCurrentFullscreen?null==(e=this._fullscreenUtil)||e.exitFullscreen():null==(t=this._fullscreenUtil)||t.fullscreen()},n._event=function(){},t}(Z);function Nt(){return Nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Nt.apply(this,arguments)}function $t(e,t){return $t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$t(e,t)}var Ft=function(e){function t(t){var n,i;return(n=e.call(this,Nt({},t,{tagName:"div",controlType:"block",classNameSuffix:"rec"}))||this)._options=t,n.recType=(null==(i=t.props)?void 0:i.recType)||"rec",n._onClickIcon(),n._onDBlClick=n._onDBlClick.bind(n),n.$container.addEventListener("dblclick",n._onDBlClick),n}!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&&$t(e,t)}(t,e);var n=t.prototype;return n.destroy=function(){var t;this.$container.removeEventListener("dblclick",this._onDBlClick),null==(t=this._delegation)||t.destroy(),this._delegation=null,e.prototype.destroy.call(this)},n.addRecType=function(e){var t="";switch(e){case"rec":var n;t=We({title:null==(n=this.locale)?void 0:n.BTN_REC,"data-type":"rec"});break;case"cloudRec":var i;t=Je({title:null==(i=this.locale)?void 0:i.BTN_CLOUDREC,"data-type":"cloudRec"});break;case"cloudRecord":var r;t=qe({title:null==(r=this.locale)?void 0:r.BTN_CLOUDRECORD,"data-type":"cloudRecord"})}if(t){var o=this.$container.innerHTML;this.$container.innerHTML=o+t,this._activeIcon(this.recType)}},n._activeIcon=function(e){switch(this.$container.querySelectorAll("."+x+"-icon").forEach((function(e){e.classList.remove(x+"-active")})),e){case"rec":var t;null==(t=this.$container.querySelector("."+x+"-icon-sdk"))||t.classList.add(x+"-active");break;case"cloudRec":var n;null==(n=this.$container.querySelector("."+x+"-icon-cloud-rec"))||n.classList.add(x+"-active");break;case"cloudRecord":var i;null==(i=this.$container.querySelector("."+x+"-icon-cloud-record"))||i.classList.add(x+"-active")}},n._onClickIcon=function(){var e=this;this._delegation=P(this.$container,"."+x+"-icon","click",(function(t){var n=t.delegateTarget;if(!n.classList.contains(x+"-disabled")){var i=n.getAttribute("data-type");e.recType!==i&&(e.recType=i,e._activeIcon(i),e.emit(B.control.recTypeChange,i),null==e._options.onChange||e._options.onChange.call(e._options,i))}}))},n._onControlClick=function(e){},t}(Z),jt={391001:"取流地址或端口非法",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",399030:"取流失败,请重试",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍等...",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为0.5倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_AUTO:"自动",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_STANDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SUPER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放",BTN_PAUSE:"结束播放",BTN_VOLUME:"声音",BTN_MUTED:"静音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_GLOBAL_FULLSCREEN:"全局全屏",BTN_EXIT_GLOBAL_FULLSCREEN:"退出全局全屏",BTN_FULLSCREEN:"全屏",BTN_EXIR_FULLSCREEN:"退出全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",BTN_CALENDAR:"日历",BTN_MORE:"更多",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数{{zoom}}X",ZOOM_SUB_MIN:"已经缩小到最小倍数{{zoom}}X",ZOOM_LIMIT_MAX:"超出最大倍率{{zoom}}X",ZOOM_LIMIT_MIN:"超出最小倍率{{zoom}}X",ZOOM_NOT_ENABLED:"放大未开启","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印",FETCH_THEME_FAILED:"获取主题模板失败",cancel:"取消",ok:"确定",close:"关闭"},Ut={391001:"Illegal streaming address or port",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399030:"Stream retrieval failed, please try again",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"loading...",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 0.5 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_AUTO:"Auto",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_STANDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SUPER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play",BTN_PAUSE:"Pause",BTN_VOLUME:"Volume",BTN_MUTED:"Muted",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_GLOBAL_FULLSCREEN:"Global fullscreen",BTN_EXIT_GLOBAL_FULLSCREEN:"Exit global fullscreen",BTN_FULLSCREEN:"Fullscreen",BTN_EXIR_FULLSCREEN:"Exit fullscreen",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",BTN_CALENDAR:"Calendar",BTN_MORE:"More",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of {{zoom}}X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of {{zoom}}X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of {{zoom}}X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of {{zoom}}X",ZOOM_NOT_ENABLED:"Zoom not enabled","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark",FETCH_THEME_FAILED:"Failed to fetch theme template",cancel:"Cancel",ok:"Ok",close:"Close"},Bt={autoFocus:3,footer:{btnList:[{iconId:"play",part:"left",isrender:1},{iconId:"volume",part:"left",defaultActive:1,isrender:1},{iconId:"fullscreen",part:"right",defaultActive:0,isrender:1},{iconId:"globalFullscreen",part:"right",defaultActive:0,isrender:1}]}},Vt={pcLive:{autoFocus:3,header:{btnList:[{iconId:"deviceID",part:"left",isrender:1},{iconId:"deviceName",part:"left",isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",isrender:1},{iconId:"capturePicture",part:"left",isrender:1},{iconId:"sound",part:"left",isrender:1},{iconId:"pantile",part:"left",isrender:1},{iconId:"recordvideo",part:"left",isrender:1},{iconId:"talk",part:"left",isrender:1},{iconId:"zoom",part:"left",isrender:1},{iconId:"hd",part:"right",isrender:1},{iconId:"webExpend",part:"right",isrender:1},{iconId:"expend",part:"right",isrender:1}]}},pcRec:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},mobileLive:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}},mobileRec:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}},security:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}},voice:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}}};function Yt(e,t){return Yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Yt(e,t)}var Zt=function(e){function t(t){var n;((n=e.call(this)||this)._scaleMode=0,n._originWidth=0,n._originHeight=0,n._width=0,n._height=0,n.options=t,n._scaleMode=t.scaleMode||0,n.$wrapper=document.createElement("div"),n.$wrapper.className=x+"-content-wrapper",n.$content=document.createElement("div"),n.$content.className=x+"-content",n.$video=document.createElement("div"),n.$video.className=x+"-content-video",n.$content.appendChild(n.$video),n.$wrapper.appendChild(n.$content),"function"==typeof t.getContainer)&&t.getContainer().appendChild(n.$wrapper);return n.on(B.videoInfo,(function(e,t){n._rerender(e,t)})),n.on(B.resize,(function(){n._rerender()})),n}!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&&Yt(e,t)}(t,e);var n=t.prototype;return n._rerender=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0);var n=this.$wrapper.clientWidth,i=this.$wrapper.clientHeight;if(this._width!==n||this._height!==i||this._originWidth!==e||this._originHeight!==t){this._width=n,this._height=i,e>0&&t>0&&(this._originWidth=e,this._originHeight=t);var r="contain";if(this._scaleMode===O&&(r="fill"),this._scaleMode===R&&(r="cover"),n>0&&i>0&&this._originWidth>0&&this._originHeight>0&&this.$video){var o=(n-this._originWidth)/2,a=(i-this._originHeight)/2,s=n/this._originWidth,l=i/this._originHeight,c=s>l?l:s;this._scaleMode!==I&&s!==l&&(c=s+","+l),this._scaleMode===R&&(c=s>l?s:l),this.$video.style.cssText+="\n width: "+this._originWidth+"px;\n height: "+this._originHeight+"px;\n position: absolute;\n object-fit:"+r+";\n left: "+o+"px;\n top: "+a+"px;\n transform-origin: 50% 50%;\n transform: scale("+c+");\n ",this.emit(B.control.contentRerender,{scaleMode:this._scaleMode,objectFill:r,scale:c,width:this._originWidth,height:this._originHeight})}}},n.setScaleMode=function(e){void 0===e&&(e=0),this._scaleMode=e,this._rerender()},n.destroy=function(){var e;this.$video&&(this.$video.remove(),this.$video=null),this.$content&&(this.$content.remove(),this.$content=null),null==(e=this.$wrapper)||e.remove(),this.$wrapper=null,this.emit(B.control.contentDestroy),this.removeAllListeners()},t}(y);function Ht(){return Ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ht.apply(this,arguments)}function Gt(e,t){return Gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Gt(e,t)}var Qt=function(e){function t(t){var n;return(n=e.call(this,Ht({},t,{tagName:"span",controlType:"button",classNameSuffix:"more"}))||this).list=[],n.options=t,n._render(),n}!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&&Gt(e,t)}(t,e);var n=t.prototype;return n._render=function(){var e,t,n=this;this.$container.innerHTML=gt.isMobile?He({title:null==(e=this.locale)?void 0:e.BTN_MORE}):Ge({title:null==(t=this.locale)?void 0:t.BTN_MORE}),this.picker=new C(this.$container,{getPopupContainer:function(){return n.$container},trigger:gt.isMobile?"click":"hover",wrapClassName:x+"-more "+this.options.wrapClassName,open:!!this.options.open,isMobile:!1,offset:this.options.offset||[0,0],placement:this.options.placement||"tr",onOpenChange:this.options.onOpenChange}),this.picker.$body&&(this.$panel=document.createElement("div"),this.$panel.classList.add(x+"-more-panel"),this.picker.$body.appendChild(this.$panel),this.picker.$body.addEventListener("dblclick",this._onDBlClick))},n.add=function(e,t,n){this.list.unshift({part:t,key:e,control:n})},n.remove=function(e){var t=this.list.findIndex((function(t){return t.control===e}));-1!==t&&this.list.splice(t,1)},n.destroy=function(){var t;(this.list=[],this.picker)&&(null==(t=this.picker.$body)||t.removeEventListener("dblclick",this._onDBlClick),this.picker.destroy(),this.picker=null);e.prototype.destroy.call(this)},n._onControlClick=function(e){},t}(Z);function Kt(e,t){var n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var a=this;clearTimeout(n),n=setTimeout((function(){return e.apply(a,r)}),t)}}var Wt=[B.getOSDTime,B.setAllDayRecTimes,B.talkVolumeChange];function Jt(e,t){Object.values(t).forEach((function(t){var n=t;Wt.includes(n)||("string"==typeof n?e.on(n,(function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];try{e.logger.log("[Event]",n,JSON.stringify(i))}catch(t){var o;(o=e.logger).warn.apply(o,[].concat(["[Event]",n],i))}})):"[object Object]"===Object.prototype.toString.call(n)&&Jt(e,t))}))}function qt(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function Xt(){return Xt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Xt.apply(this,arguments)}function en(e,t){return en=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},en(e,t)}var tn,nn,rn={open:!1,max:8},on=function(e){function t(t){var n;return(n=e.call(this,Xt({},t,{tagName:"span",controlType:"button",classNameSuffix:"zoom"}))||this)._value=1,n._isRotated=!1,n._options=Object.assign({},rn,t||{}),n._render(),n.emit(B.zoomChange,(function(e){n._progress&&(n.value=e)})),n}!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&&en(e,t)}(t,e);var n=t.prototype;return n._render=function(){var e,t,n,i,r=this;this.$container.innerHTML=Ze({title:null==(e=this.locale)?void 0:e.BTN_ZOOM}),this._$zoomPanel=document.createElement("div"),this._$zoomPanel.className=x+"-zoom-panel "+x+"-hide",null==(t=this._options.rootContainer)||t.appendChild(this._$zoomPanel);var o=this._options.max<=1?8:Math.floor(this._options.max);this._isRotated=!!(null==(n=this._options.props)?void 0:n.isCurrentFullscreen)&&[0,180].includes(null==(i=this._options.props)?void 0:i.orientationAngle),this._progress=new _t({container:this._$zoomPanel,defaultValue:1,range:[1,o],step:1,showMinus:!0,showPlus:!0,showPercent:!0,isRotated:this._isRotated,onChange:function(e,t,n){e!==r._value&&(r._value=e,null==r._options.onChange||r._options.onChange.call(r._options,e,t,n),r.emit(B.control.zoomChange,e,t,n))},renderText:function(e){return e+"X"}})},n.reset=function(t){var n,i;this.active&&(null==(i=this._$zoomPanel)||null==(n=i.classList)||n.add(x+"-hide"),this._progress.value=1,this.active=!1,e.prototype.reset.call(this,t))},n.destroy=function(){var t;this._options.rootContainer&&this._$zoomPanel&&(null==(t=this._options.rootContainer)||t.removeChild(this._$zoomPanel),this._$zoomPanel=null);e.prototype.destroy.call(this)},n._onControlClick=function(t){this.active=!this.active,e.prototype._onControlClick.call(this,t)},qt(t,[{key:"value",get:function(){return this._value},set:function(e){this._progress&&this._value!==e&&(this._progress.value=e,this._value=e)}},{key:"active",get:function(){return this._active},set:function(e){var t,n,i,r;(this._active=e,this._updateActiveState(e),this.active)?(null==(n=this._$zoomPanel)||null==(t=n.classList)||t.remove(x+"-hide"),this.emit(B.control.zoomPanelOpenChange,!0)):(null==(r=this._$zoomPanel)||null==(i=r.classList)||i.add(x+"-hide"),this._progress.value=1,this.emit(B.control.zoomPanelOpenChange,!1))}},{key:"isRotated",get:function(){return this._isRotated},set:function(e){this._progress&&this._progress.isRotate(e)}}]),t}(Z);function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}
17
+ */function _create_class$9(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of$r(o,p){return _set_prototype_of$r=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$r(o,p)}var Control=function(EventEmitter){function Control(options){var _this,_this___options,locales,language;return(_this=EventEmitter.call(this)||this).locale=null,_this.__options={},_this._disabled=!1,_this._active=!1,_this.__options=options,_this.locale=(locales=_this.__options.locales,void 0===(language=_this.__options.language)&&(language="zh"),(null==locales?void 0:locales[language])||(null==locales?void 0:locales.zh)||{}),_this.$container=document.createElement(options.tagName||"span"),_this.$container.classList.add("ezplayer-control"),"text"===(null==options?void 0:options.controlType)?_this.$container.classList.add("ezplayer-control-text"):"block"===(null==options?void 0:options.controlType)?_this.$container.classList.add("ezplayer-control-block"):_this.$container.classList.add("ezplayer-control-btn"),(null==options?void 0:options.classNameSuffix)&&_this.$container.classList.add("ezplayer-control-"+(null==options?void 0:options.classNameSuffix)),(null==options?void 0:options.className)&&_this.$container.classList.add(options.className),options.getPopupContainer?_this.$popupContainer=null==options.getPopupContainer?void 0:options.getPopupContainer.call(options):_this.$popupContainer=document.body,_this.$popupContainer.appendChild(_this.$container),_this._onDBlClick=_this._onDBlClick.bind(_this),_this._onClick(),"block"!==(null==(_this___options=_this.__options)?void 0:_this___options.controlType)&&_this.$container.addEventListener("dblclick",_this._onDBlClick),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$r(subClass,superClass)}(Control,EventEmitter);var _proto=Control.prototype;return _proto.reset=function(hide){this._camelCaseName&&this.emit("Control."+this._camelCaseName+"Reset",hide)},_proto.resetPopupContainer=function(popupContainer,append,element){popupContainer!==this.$popupContainer&&(this.$popupContainer.contains(this.$container)&&this.$popupContainer.removeChild(this.$container),this.$popupContainer=popupContainer,"prepend"===append?this.$popupContainer.prepend(this.$container):"before"===append?element&&this.$popupContainer.insertBefore(this.$container,element):this.$popupContainer.appendChild(this.$container),this._camelCaseName&&this.emit("Control."+this._camelCaseName+"ResetContainer",this.__options.classNameSuffix,popupContainer))},_proto.hide=function(){this.$container&&(this.$container.style.display="none",this.$container.classList.add("ezplayer-hide"))},_proto.destroy=function(){var _this___options,_this_$container_remove,_this_$container;this._camelCaseName&&this.emit("Control."+this._camelCaseName+"Destroy"),"block"!==(null==(_this___options=this.__options)?void 0:_this___options.controlType)&&this.$container.addEventListener("dblclick",this._onDBlClick),this._active=!1,this.removeAllListeners(),null==(_this_$container=this.$container)||null==(_this_$container_remove=_this_$container.remove)||_this_$container_remove.call(_this_$container),this.$container=null},_proto._updateDisabledState=function(disabled){var _this_$container,_this_$container1;disabled?null==(_this_$container=this.$container)||_this_$container.classList.add("ezplayer-disabled"):null==(_this_$container1=this.$container)||_this_$container1.classList.remove("ezplayer-disabled")},_proto._updateActiveState=function(active){var _this_$container,_this_$container1;active?null==(_this_$container=this.$container)||_this_$container.classList.add("ezplayer-active"):null==(_this_$container1=this.$container)||_this_$container1.classList.remove("ezplayer-active")},_proto._onClick=function(){var _this=this;this.$container.addEventListener("click",(function(e){var _this_$container;(null==(_this_$container=_this.$container)?void 0:_this_$container.classList.contains("ezplayer-disabled"))||null==_this._onControlClick||_this._onControlClick.call(_this,e)}))},_proto._onDBlClick=function(e){e.stopPropagation(),e.preventDefault()},_proto._onControlClick=function(e){null==this.__options.onClick||this.__options.onClick.call(this.__options,e)},_create_class$9(Control,[{key:"active",get:function(){return this._active},set:function(active){this._disabled&&!this._active||(this._active=active,this._updateActiveState(active))}},{key:"disabled",get:function(){return this._disabled},set:function(disabled){this._disabled=disabled,this._updateDisabledState(disabled)}},{key:"_camelCaseName",get:function(){return this.__options.classNameSuffix?this.__options.classNameSuffix.replace(/[-_\s]+(.)?/g,(function(_,c){return c?c.toUpperCase():""})).replace(/^(.)/,(function(first){return first.toLowerCase()})):null}}]),Control}(EventEmitter$1);function _extends$q(){return _extends$q=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$q.apply(this,arguments)}function _set_prototype_of$q(o,p){return _set_prototype_of$q=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$q(o,p)}var LOADING_DEFAULT_OPTIONS={},Loading=function(Control){function Loading(options){var _this;return void 0===options&&(options={}),(_this=Control.call(this,Object.assign({},LOADING_DEFAULT_OPTIONS,_extends$q({},options,{tagName:"div",controlType:"block",classNameSuffix:"loading"})))||this)._options=Object.assign({},options),_this.$container.classList.add("ezplayer-loading","ezplayer-hide"),_this._html(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$q(subClass,superClass)}(Loading,Control);var _proto=Loading.prototype;return _proto._html=function(){var _this_locale;"function"==typeof this._options.render?this.$container.innerHTML=this._options.render():this.$container.innerHTML='\n <span class="ezplayer-loading-dot ezplayer-loading-dot-load">\n <i class="ezplayer-loading-dot-item"></i>\n <i class="ezplayer-loading-dot-item"></i>\n <i class="ezplayer-loading-dot-item"></i>\n <i class="ezplayer-loading-dot-item"></i>\n </span>\n <div class="ezplayer-loading-text">'+((null==(_this_locale=this.locale)?void 0:_this_locale.LOADING)||"loading...")+"</div>\n "},_proto.show=function(html){html&&(this.$container.innerHTML=html),this.$container.style.display="flex",this.$container.classList.remove("ezplayer-hide"),this.$popupContainer.classList.add("ezplayer-has-loading")},_proto.hide=function(){Control.prototype.hide.call(this),this.$popupContainer.classList.remove("ezplayer-has-loading")},Loading}(Control);function _extends$p(){return _extends$p=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$p.apply(this,arguments)}function _set_prototype_of$p(o,p){return _set_prototype_of$p=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$p(o,p)}var POSTER_OPTIONS={poster:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3P/2wCEAAkJCQkJCQoLCwoODw0PDhQSERESFB4WFxYXFh4uHSEdHSEdLikxKCUoMSlJOTMzOUlUR0NHVGZbW2aBeoGoqOIBCQkJCQkJCgsLCg4PDQ8OFBIRERIUHhYXFhcWHi4dIR0dIR0uKTEoJSgxKUk5MzM5SVRHQ0dUZltbZoF6gaio4v/CABEIA/0HHgMBIgACEQEDEQH/xAAZAAEBAQEBAQAAAAAAAAAAAAAAAQIEAwf/2gAIAQEAAAAA+WgAgAQAACTxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHUAEACAAAE8YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdQBAAgAAAPPzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOoCABAAAAGfEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6ggAIAAAATxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAADqIACAAAACPLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAADqgAIAAAAEMeYAAAAAAAAAAAAAAAAAAAAAAAAAAAAADpACAAAABAz5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOkAgAAAAQCeUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6QIAAAAEAHjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOkIAAAAEAEeeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOkQAAAAQAQYwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0oAAAAIAIDGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAAAIAIBnzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6AAAACACAGfMAAAAAAAAAAAAAAAAAAAAAAAAAAAAADoAAAAgAgBE8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAAIAIAQTzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6AAACACACBPMAAAAAAAAAAAAAAAAAAAAAAAAAAAAADoAAAgAgAgE8wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgAAIAIAIAZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0AAEAEAEAImAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOgABABACAEGcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdAAIAIAQAgMwCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6ABABACACBbAJEkAAAAAAAAAAAAAAAAAAAAAAAAAAAAdACACACAEDWjAEDMgAAAAAAAAAAAAAAAAAAAAAAAAAAAOgEAEAEAIGtoYBAJJAAAAAAAAAAAAAAAAAAAAAAAAAAAB0CACACAEBvREyEAgzAAAAAAAAAAAAAAAAAAAAAAAAAAADoQAQAQAgLuoJkICBc5AAAAAAAAAAAAAAAAAAAAAAAAAAAdEAEAIAQC+iAzBAIKkyAAAAAAAAAAAAAAAAAAAAAAAAAAB7gEAIAQA9ADAQEFQzAAAAAAAAAAAAAAAAAAAAAAAAAAAe4EAIAIAboCZEAgqDMAAAAAAAAAAAAAAAAAAAAAAAAAAD3CAEAEAJrYCSEAgqBMgAAAAAAAAAAAAAAAAAAAAAAAAAB7kAEAIARfQAmRAQLASQAAAAAAAAAAAAAAAAAAAAAAAAAAe8AEAIAQb0AjJAIKgIkAAAAAAAAAAAAAAAAAAAAAAAAAAPYAgBACCvQBEiAQVAQkAAAAAAAAAAAAAAAAAAAAAAAAAAPYCAEAIKa0AjJAQKgQMgAAAAAAAAAAAAAAAAAAAAAAAAAHsEAIAQKNaBCRAIKgIEgAAAAAAAAAAAAAAAAAAAAAAAAAD2IAIAQUR6UQMkBBUBASAAAAAAAAAAAAAAAAAAAAAAAAAAPaACAEFEL6CBIgEFQICIAAAAAAAAAAAAAAAAAAAAAAAAAA9QCAEFEDWyCIgEFQECEAAAAAAAAAAAAAAAAAAAAAAAAAAeoEAIKIBraCIQECwEBCAAAAAAAAAAAAAAAAAAAAAAAAAAPUIAQUIA1tBEQCCoCBBAAAAAAAAAAAAAAAAAAAAAAAAAAHqQAgoQBGthEQCCoCBAgAAAAAAAAAAAAAAAAAAAAAAAAAD1gBBQgBDWyEIBBUCAgQAAAAAAAAAAAAAAAAAAAAAAAAAB6AEFEAIF9IEQCCoCBAgAAAAAAAAAAAAAAAAAAAAAAAAAB6AQUQAgD0CEBAsBAQIAAAAAAAAAAAAAAAAAAAAAAAAAAegQUQAgCPSkIBBUCAgQAAAAAAAAAAAAAAAAAAAAAAAAAAehBRACAINbQgEFQECAgAAAAAAAAAAAAAAAAAAAAAAAAAA9IKEAQAgXYQECwEBAgAAAAAAAAAAAAAAAAAAAAAAAAAAbKEAQAgDWiAQVAQIEAAAAAAAAAAAAAAAAAAAAAAAAAABuhAEAIAi+iAQVAQICAAAAAAAAAAAAAAAAAAAAAAAAAAA9BACAIAgb1AIKgQECAAAAAAAAAAAAAAAAAAAAAAAAAAAeiAEAQBALsCCoCBAQAAAAAAAAAAAAAAAAAAAAAAAAAADYBAEAIAXYQLAQECAAAAAAAAAAAAAAAAAAAAAAAAAAANgQBACAA1oQVAQIEAAAAAAAAAAAAAAAAAAAAAAAAAAANhAEAIAAXaCoCBAQAAAAAAAAAAAAAAAAAAAAAAAAAAA2QAgCAAAugsBAQIAAAAAAAAAAAAAAAAAAAAAAAAAW6qkSSwAgCAAAFtVAQIEAAAAAAAAAAAAAAAAAAAAAAAADWta1SgDlAQBAAAALdQEBBAAAAAAAAAAAAAAAAAAAAAAAAF1vdUFAHKCAIAAAAFqkBCAAAAAAAAAAAAAAAAAAAAAAAANem6CgoByiAEAAAAAKAQAAAAAAAAAAAAAAAAAAAAAAABdetFCgoByoAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABd+ihQUFAcgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADfpSgoUFAcgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANemgUKCgoHGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAu/QBQUFBQcYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9dAChQUFBxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA160AKCgoKHGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG/SgAUKCgocYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9NqABQUFBRxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALvZQAFBQoKOMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC72FAAUKCgpxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAemqFAAUFCgpxgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3soUABQoKCuMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANegoUABQUKCuMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX0oUKAAoUFBeMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAu6oUUABQUKByAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG9FChQAFCgoOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABrYUKKAAoKChyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXahRQoAChQUOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAADdKKFCgAUFBRyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuxQooUABQoKOQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGtBRQoUACgoKcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXSihRQoACgoU5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2UKKFCgAUFBXIAAAAAAAAAAAAAAAAAAAAAAAAAAAAALtFFCihQAFBQrkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGtIoUUKFAAUKC8gAAAAAAAAAAAAAAAAAAAAAAAAAAAABdKiihRQoACgoXkAAAAAAAAAAAAAAAAAAAAAAAAAAAAALpSUKKFCgAKFBygAAAAAAAAAAAAAAAAAAAAAAAAAAAAGqVFFCihQAFBQ5QAAAAAAAAAAAAAAAAAAAAAAAAAAAADYpFFFChQAFChygAAAAAAAAAAAAAAAAAAAAAAAAAAAALaKihRQooACgo5QAAAAAAAAAAAAAAAAAAAAAAAAAAAAFtCoooUUKAAoUcoAAAAAAAAAAAAAAAAAAAAAAAAAAAADRRUUKKFCgAUFOUAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0oVFFCihQAFCnKAAAAAAAAAAAAAAAAAAAAAAAAAAAABaKKihRQoUACgrlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtCioooUUKAAoLygAAAAAAAAAAAAAAAAAAAAAAAAAAAAVRRUUKKFCgAUF5QAAAAAAAAAAAAAAAAAAAAAAAAAAAAKUUVFFCihQAFBzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUooqKFFChQAFDmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoooqKKFFCgAKHMAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRSUKKFCgAKOYAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRUUUKKFAAUcwAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiikUUUKFAAU5gAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiioooUKKAApzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFIooUUKAArmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFRQooUKABXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKFRRQooUABeYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKKihRQoUABzgAAAAAAAAAAAAAAAAAAAAAAAAAAAABRQoqKKFFCgAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFRQooUKABzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoUUVFFCihQAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiiooUUKFABzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUKKKiihRQoAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRSUKKFCgBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFRRQooUAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAooopFFFChQBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiiioooUKKAOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUUUUiihRQoBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAABRRRUUKKFCgOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKFRRQooUBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoooqKFFChQOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFCioooUUKBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUUUVFCihQoOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAChRRUUUKKFBzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKKKKihRQoUOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoooqKKFFChzgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFJQooUKOcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUUUBQBQKH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAQID/9oACAECEAAAAOoCAASAAAAAAAAAAAAAAANgQAAyAAAAAAAAAAAAAAA2EAACQAAAAAAAAAAAAAADZAAAJAAAAAAAAAAAAAAANwAAAZAAAAAAAAAAAAAAA0AAAJAAAAAAAAAAAAAAANAAAIQAAAAAAAAAAAAAADQAAIEAAAAAAAAAAAAAAA0AAIBAAAAAAAAAAAAAAANAAIAQAAAAAAAAAAAAAADQAIAEAAAAAAAAAAAAAAA0AIAAIAAAAAAAAAAAAAANAIABSBAAAAAAAAAAAAAANAQAFEsBAAAAAAAAAAAAAA0EABNBAIAAAAAAAAAAAAADRAARoJYEAAAAAAAAAAAAAAoAELqBAQAAAAAAAAAAAAACgAgtCAgAAAAAAAAAAAAACgCLDQICAAAAAAAAAAAAAAKAiwNBAQAAAAAAAAAAAAAAoIsA0ECAAAAAAAAAAAAAACiLADQgIAAAAAAAAAAAAAAKiwANEBAAAAAAAAAAAAAAAAAC1AgAAAAAAAAAAAAAAAAAtgIAAAAAAAAAAAAAAAAAFBAAAAAAAAAAAAAAAAAAKEAAAAAAAAAAAAAAAAAAUgAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAtKMAAAAAAAAAAAAAAAAAaoFOYAAAAAAAAAAAAAAAAtoBTmAAAAAAAAAAAAAAAAaFAK5gAAAAAAAAAAAAAAAWgoBeYAAAAAAAAAAAAAAALQKAXmAAAAAAAAAAAAAAAFoBQDAAAAAAAAAAAAAAAAtAFAMAAAAAAAAAAAAAAAFUAKAwAAAAAAAAAAAAAAAUoAoDAAAAAAAAAAAAAAACigBQMAAAAAAAAAAAAAAAUFAFAwAAAAAAAAAAAAAABQUAKDAAAAAAAAAAAAAAACgoAoMAAAAAAAAAAAAAAAKCgBQwAAAAAAAAAAAAAAAUFAFDAAAAAAAAAAAAAAABQUAKMAAAAAAAAAAAAAAACgoAUwAAAAAAAAAAAAAAAFBQBTAAAAAAAAAAAAAAAAUFACsAAAAAAAAAAAAAAAAoKAKwAAAAAAAAAAAAAAACgoAXAAAAAAAAAAAAAAAAWUFAFwAAAAAAAAAAAAAAABQUAMgAAAAAAAAAAAAAAAsoKAMgAAAAAAAAAAAAAAAKCgDIAAAAAAAAAAAAAAABQUAyAAAAAAAAAAAAAAAAUFAMgAAAAAAAAAAAAAAACgoDIAAAAAAAAAAAAAAAAoKAyAAAAAAAAAAAAAAAAFBQMgAAAAAAAAAAAAAAAAoKDIAAAAAAAAAAAAAAAAKCgyAAAAAAAAAAAAAAAABQUMgAAAAAAAAAAAAAAAAUFDIAAAAAAAAAAAAAAAAAoD//EABYBAQEBAAAAAAAAAAAAAAAAAAABAv/aAAgBAxAAAADAAoigoAAAAAAAAAAAAAADIBSKAoAAAAAAAAAAAAAADIFIoAoAAAAAAAAAAAAAADIUigAUAAAAAAAAAAAAAADJSKAAUAAAAAAAAAAAAAADNIoAAoAAAAAAAAAAAAAACIUAAoAAAAAAAAAAAAAAAyUAApKAAAAAAAAAAAAAAAzQABUUAAAAAAAAAAAAAAAgABUUAAAAAAAAAAAAAAAIABUUAAAAAAAAAAAAAAACABUUAAAAAAAAAAAAAAAAgBUUBAoAAAAAAAAAAAAAAgFJQEBQAAAAAAAAAAAAAAgUlAJKFAAAAAAAAAAAAAACCooBIooAAAAAAAAAAAAAAIqKAGVCgAAAAAAAAAAAAAAIoAIBQAAAAAAAAAAAAAAIoACAoAAAAAAAAAAAAAAAAAM0KAAAAAAAAAAAAAAAAACBQAAAAAAAAAAAAAAAAAIKAAAAAAAAAAAAAAAAAAgoAAAAAAAAAAAAAAAAACFAAAAAAAAAAAAAAAAAAEUAAAAAAAAAAAAAAAAAASgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAloAAAAAAAAAAAAAAAAEQA0AAAAAAAAAAAAAAAAEgANAAAAAAAAAAAAAAAAElgANAAAAAAAAAAAAAAAAIlQANAAAAAAAAAAAAAAAAgSwANAAAAAAAAAAAAAAABASoANAAAAAAAAAAAAAAACAJYANAAAAAAAAAAAAAAABAIsANAAAAAAAAAAAAAAAEsASoA0AAAAAAAAAAAAAAAJYAlgDQAAAAAAAAAAAAAAAIAlQDQAAAAAAAAAAAAAAASwBLANAAAAAAAAAAAAAAAAQBKgNAAAAAAAAAAAAAAAAlgCWA0AAAAAAAAAAAAAAAAQCVA0AAAAAAAAAAAAAAABLAEsDQAAAAAAAAAAAAAAAAgEqDQAAAAAAAAAAAAAAACWAJYNAAAAAAAAAAAAAAAAEsAlQ0AAAAAAAAAAAAAAAASwBLDQAAAAAAAAAAAAAAAAlgEWNAAAAAAAAAAAAAAAACWAJU0AAAAAAAAAAAAAAAAEsASzQAAAAAAAAAAAAAAAAEASqAAAAAAAAAAAAAAAACWAJaAAAAAAAAAAAAAAAAAgCWgAAAAAAAAAAAAAAAASwBNAAAAAAAAAAAAAAAAACATQAAAAAAAAAAAAAAAACWAKAAAAAAAAAAAAAAAAAEAoAAAAAAAAAAAAAAAABLAKAAAAAAAAAAAAAAAAAJYCgAAAAAAAAAAAAAAAACWAoAAAAAAAAAAAAAAAAASwKAAAAAAAAAAAAAAAAAAg//EACgQAAEEAQIFBAMBAAAAAAAAAAEAAhFwMTBREhNAQYADECBQIWBh0P/aAAgBAQABPwD5QPeAoC/HURoOEi5SINyPFyOEi5Tcjs3I+5HYPmScm5HZuR1yOuR2Lkdi5Di5Di5Di5Di5Di5DchuR3vBUFQbdgrhRAnQgKFBtYNUAe51ItINJQAHRxZ4b8j0JFlgSgI+Z6IiyQJQEaB6MiyAI60ixgI0TbTRpHpjYY+iNhNGkbkPUmwG3IMaR8vRnSNtNzcjc3I3NyNzcjc3IM+ZIxcjbkFyi5AYuVpuWZuQGLlBuUG5QVNYQdlwO2XLcuU5co7rlHdcr+rlHdco7rlO3C5blwO2XC7Y/UzVQBPZD0yh6Q3QY3ZQB2+4BqUMcUPTHcoNA7ffypp8NJQYO6AA/RZUqVKlTSwYSg0C4Qw90ABcIYSgALhAJQaBcQZvcQEoNi4g2UBFxNbvcYbvcbWxcbRFxgXG0XGBcYE3IBFxgXGB5jgXGLkFxi5B5jjzHFyDzHFyD/AKp0pUqVKlSpUqVKlSpUqVK//EAB0RAAMAAgIDAAAAAAAAAAAAAAABEWBwEpCAoLD/2gAIAQIBAT8A30/QDhCeJ8zFLca7Hl0RQhCIiIjijjk8Jl8JuCfXf//EABoRAAICAwAAAAAAAAAAAAAAAAARAaAQYLD/2gAIAQMBAT8AtfzYjYxjyx7Q+5f/AP/Z"},Poster=function(Control){function Poster(options){var _this;return void 0===options&&(options={}),(_this=Control.call(this,Object.assign({},POSTER_OPTIONS,_extends$p({},options,{tagName:"div",controlType:"block",classNameSuffix:"poster"})))||this)._options=Object.assign({},POSTER_OPTIONS,options),_this.$container.classList.add("ezplayer-poster","ezplayer-hide"),_this._imgLoadErrorEvent=_this._imgLoadErrorEvent.bind(_this),_this._options.poster&&_this.setPoster(_this._options.poster),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$p(subClass,superClass)}(Poster,Control);var _proto=Poster.prototype;return _proto._imgLoadErrorEvent=function(error){var _error_target;null==this._options.onLoadImgError||this._options.onLoadImgError.call(this._options,(null==(_error_target=error.target)?void 0:_error_target.getAttribute("src"))||"")},_proto.setPoster=function(poster){var _this_$container_querySelector;""!==(poster=null!=poster?poster:this._options.poster)?(this.$container.innerHTML='<img class="ezplayer-poster-img" src="'+poster+'" />',null==(_this_$container_querySelector=this.$container.querySelector(".ezplayer-poster-img"))||_this_$container_querySelector.addEventListener("error",this._imgLoadErrorEvent)):this.$container.innerHTML=""},_proto.show=function(){this.$container&&(this.$container.style.display="flex",this.$container.classList.remove("ezplayer-hide"))},_proto.hide=function(){var _this_$container_querySelector,_this_$container;Control.prototype.hide.call(this),null==(_this_$container=this.$container)||null==(_this_$container_querySelector=_this_$container.querySelector(".ezplayer-poster-img"))||_this_$container_querySelector.removeEventListener("error",this._imgLoadErrorEvent)},_proto.destroy=function(){this.hide(),Control.prototype.destroy.call(this)},Poster}(Control),Icons_play='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="play">\n <rect x="6.5" y="5.5" rx="1.25" width="2.5" height="13"/>\n <rect x="15" y="5.5" rx="1.25" width="2.5" height="13"/>\n </svg>',Icons_pause='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="pause"> <path d="M17.5 13.66L9.1 19.26C7.78 20.14 6 19.19 6 17.59L6 6.4C6 4.8 7.78 3.85 9.1 4.73L17.5 10.33C18.69 11.12 18.69 12.87 17.5 13.66Z" /></svg>',Icons_volume=function(prefix){return'<svg width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" fill="none" focusable="false" aria-hidden="true" data-icon="volume">\n \t<path class="'+prefix+'-icon-volume-muted" d="M20.57 9.69L16.07 14.19" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path class="'+prefix+'-icon-volume-muted" d="M20.57 14.19L16.07 9.69" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \x3c!-- 音低 --\x3e\n <path class="'+prefix+'-icon-volume-low" d="M15.53 15.97C16.69 15.25 17.49 13.75 17.49 12C17.49 10.25 16.69 8.75 15.53 8.02" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t\x3c!-- 音高 --\x3e\n <path class="'+prefix+'-icon-volume-high" d="M18.5 19.06C20.31 17.5 21.49 14.93 21.49 12C21.49 9.07 20.31 6.48 18.49 4.93" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M5.87 8.62L9.85 5.25C10.5 4.7 11.49 5.16 11.49 6.01L11.49 17.98C11.49 18.83 10.5 19.29 9.85 18.74L5.87 15.37" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M5.87 15.37L3.49 15.37C2.94 15.37 2.49 14.92 2.49 14.37L2.49 9.62C2.49 9.07 2.94 8.62 3.49 8.62L5.87 8.62" stroke-width="1.500000" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>'},Icons_mobileFullscreen='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="mobile-fullscreen">\n <path d="M4 2.9082L11 2.9082C12.5188 2.9082 13.75 4.1394 13.75 5.6582L13.75 17.6582C13.75 19.177 12.5188 20.4082 11 20.4082L4 20.4082C2.4812 20.4082 1.25 19.177 1.25 17.6582L1.25 5.6582C1.25 4.1394 2.4812 2.9082 4 2.9082ZM4 4.4082L11 4.4082C11.6903 4.4082 12.25 4.9679 12.25 5.6582L12.25 17.6582C12.25 18.3485 11.6903 18.9082 11 18.9082L4 18.9082C3.30969 18.9082 2.75 18.3485 2.75 17.6582L2.75 5.6582C2.75 4.9679 3.30969 4.4082 4 4.4082ZM22.1511 18.3113C22.1511 19.3595 21.2467 20.1652 20.1509 20.2362L19.993 20.2413L15.2939 20.2413C14.8798 20.2413 14.5439 19.9055 14.5439 19.4913C14.5439 19.1116 14.8262 18.7979 15.1921 18.7482L15.2939 18.7413L19.993 18.7413C20.344 18.7413 20.5962 18.5592 20.6432 18.3732L20.6511 18.3113L20.6511 12.4895C20.6511 12.3048 20.4338 12.1042 20.1062 12.066L19.993 12.0594L15.2939 12.0594C14.8798 12.0594 14.5439 11.7238 14.5439 11.3094C14.5439 10.9298 14.8262 10.616 15.1921 10.5663L15.2939 10.5594L19.993 10.5594C21.1055 10.5594 22.0605 11.3175 22.145 12.3416L22.1511 12.4895L22.1511 18.3113ZM10.3225 16.1035C10.3225 15.6893 9.98669 15.3535 9.57251 15.3535L5.84644 15.3535L5.74463 15.3604C5.37854 15.41 5.09644 15.7239 5.09644 16.1035C5.09644 16.5177 5.43225 16.8535 5.84644 16.8535L9.57251 16.8535L9.67432 16.8467C10.0404 16.797 10.3225 16.4832 10.3225 16.1035Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',Icons_fullscreen='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="webFullscreen">\n \t<path d="M18.4009 2.40125L5.59972 2.40125C4.74849 2.39276 3.9297 2.72729 3.32788 3.32935C2.72607 3.9314 2.39188 4.75031 2.40062 5.6015L2.40062 18.4015C2.3922 19.2527 2.7267 20.0715 3.32874 20.6733C3.93079 21.2751 4.74969 21.6093 5.60091 21.6006L18.4009 21.6006C19.2519 21.609 20.0705 21.2747 20.6723 20.6729C21.2741 20.0711 21.6084 19.2525 21.6 18.4015L21.6 5.60034C21.6084 4.74933 21.2741 3.93073 20.6723 3.32892C20.0705 2.72711 19.2519 2.39282 18.4009 2.40125ZM18.401 20.3213C19.4246 20.3213 20.321 19.4249 20.321 18.4014L20.321 5.60022C20.321 4.5766 19.4246 3.68024 18.401 3.68024L5.59987 3.68024C4.57631 3.68024 3.67993 4.5766 3.67993 5.60022L3.67993 18.4014C3.67993 19.4249 4.57631 20.3213 5.59987 20.3213L18.401 20.3213ZM14.5599 5.27087L18.3997 5.27087L18.3997 5.27209C18.7849 5.27087 19.0405 5.52527 19.0405 5.91168L19.0405 9.75153C19.0405 10.1331 18.7849 10.3887 18.401 10.3911C18.0158 10.3887 17.7602 10.1331 17.7602 9.75153L17.7602 7.44763L14.0487 11.1591C13.9313 11.2808 13.7695 11.3494 13.6005 11.3494C13.4315 11.3494 13.2697 11.2808 13.1523 11.1591C13.0292 11.0428 12.9594 10.8809 12.9594 10.7115C12.9594 10.5421 13.0292 10.3802 13.1523 10.2639L16.8638 6.55005L14.5599 6.55005C14.1735 6.54883 13.9179 6.29443 13.9203 5.91046C13.9179 5.52411 14.1735 5.26971 14.5599 5.27087ZM10.594 12.6625L6.88254 16.3751L6.88254 14.0712C6.88254 13.686 6.62695 13.4304 6.24297 13.4304C5.85898 13.4304 5.60338 13.686 5.60219 14.0712L5.60219 17.9111C5.60219 18.2939 5.85898 18.5483 6.24297 18.5507L10.0828 18.5507C10.4668 18.5483 10.7224 18.2939 10.7224 17.9099C10.7224 17.5247 10.4668 17.2691 10.0816 17.2703L7.77771 17.2703L11.4904 13.5588C11.6133 13.4421 11.6829 13.2801 11.6829 13.1107C11.6829 12.9412 11.6133 12.7791 11.4904 12.6625C11.3737 12.5396 11.2117 12.47 11.0422 12.47C10.8727 12.47 10.7107 12.5396 10.594 12.6625Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',Icons_exitFullscreen='\n <svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" focusable="false" aria-hidden="true" data-icon="exitWebFullscreen">\n \t<path d="M18.4009 2.40125L5.59978 2.40125C4.74855 2.39276 3.92976 2.72729 3.32794 3.32935C2.72614 3.9314 2.39194 4.75031 2.40068 5.6015L2.40068 18.4015C2.39226 19.2527 2.72676 20.0715 3.3288 20.6733C3.93085 21.2751 4.74976 21.6093 5.60097 21.6006L18.4009 21.6006C19.252 21.609 20.0706 21.2747 20.6723 20.6729C21.2741 20.0711 21.6085 19.2525 21.6 18.4015L21.6 5.60034C21.6085 4.74933 21.2741 3.93073 20.6723 3.32892C20.0706 2.72711 19.252 2.39282 18.4009 2.40125ZM18.4012 20.3212C19.4247 20.3212 20.3211 19.4248 20.3211 18.4012L20.3211 5.6001C20.3211 4.57648 19.4247 3.68011 18.4012 3.68011L5.59999 3.68011C4.57643 3.68011 3.68005 4.57648 3.68005 5.6001L3.68005 18.4012C3.68005 19.4248 4.57643 20.3212 5.59999 20.3212L18.4012 20.3212ZM17.4401 11.3494L13.6002 11.3494L13.6002 11.3483C13.215 11.3494 12.9594 11.095 12.9594 10.7087L12.9594 6.86877C12.9594 6.48718 13.215 6.23163 13.599 6.22925C13.9842 6.23163 14.2398 6.48718 14.2398 6.86877L14.2398 9.17273L17.9512 5.46124C18.0686 5.3396 18.2304 5.27087 18.3994 5.27087C18.5685 5.27087 18.7303 5.3396 18.8476 5.46124C18.9708 5.57751 19.0406 5.73944 19.0406 5.90881C19.0406 6.07825 18.9708 6.24011 18.8476 6.35645L15.1362 10.0703L17.4401 10.0703C17.8265 10.0715 18.082 10.3259 18.0797 10.7099C18.082 11.0963 17.8265 11.3506 17.4401 11.3494ZM6.69115 18.358L10.4026 14.6454L10.4026 16.9493C10.4026 17.3345 10.6582 17.5901 11.0422 17.5901C11.4262 17.5901 11.6818 17.3345 11.683 16.9493L11.683 13.1094C11.683 12.7266 11.4262 12.4722 11.0422 12.4698L7.20233 12.4698C6.81834 12.4722 6.56276 12.7266 6.56276 13.1106C6.56276 13.4958 6.81834 13.7514 7.20354 13.7502L9.50746 13.7502L5.79478 17.4617C5.67188 17.5784 5.60228 17.7404 5.60228 17.9099C5.60228 18.0793 5.67188 18.2413 5.79478 18.358C5.91145 18.481 6.07349 18.5505 6.24297 18.5505C6.41243 18.5505 6.57446 18.481 6.69115 18.358Z" clip-rule="evenodd" fill-rule="evenodd"/>\n</svg>',Icons_globalFullscreen='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="fullscreen">\n <path d="M8 4L6 4C4.89 4 4 4.89 4 6L4 8" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M4 16L4 18C4 19.1 4.89 20 6 20L8 20" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M16 20L18 20C19.1 20 20 19.1 20 18L20 16" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M20 8L20 6C20 4.89 19.1 4 18 4L16 4" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',Icons_exitGlobalFullscreen='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="exitFullscreen">\n <path d="M4 8L6 8C7.1 8 8 7.1 8 6L8 4" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M8 20L8 18C8 16.89 7.1 16 6 16L4 16" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M20 16L18 16C16.89 16 16 16.89 16 18L16 20" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n \t<path d="M16 4L16 6C16 7.1 16.89 8 18 8L20 8" stroke-width="1.488819" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',Icons_close='<svg width="1em" height="1em" viewBox="0 0 24 24" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="close"><path d="M6.34 6.34L17.65 17.65" stroke-width="1.5" stroke-linecap="round"/><path d="M6.34 17.65L17.65 6.34" stroke-width="1.5" stroke-linecap="round"/></svg>',Icons_closeCircleOutLined='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="close-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.5844 5.40312C10.6531 5.40312 10.7094 5.45937 10.7094 5.52812C10.7094 5.55781 10.7 5.5875 10.6812 5.60938L8.64844 8.03125L10.6781 10.4516C10.6969 10.475 10.7078 10.5031 10.7078 10.5328C10.7078 10.6031 10.6516 10.6578 10.5828 10.6578L9.55156 10.6531L8 8.80312L6.44844 10.6547L5.41563 10.6594C5.34688 10.6594 5.29063 10.6031 5.29063 10.5344C5.29063 10.5047 5.30156 10.4766 5.32031 10.4531L7.35313 8.03281L5.32031 5.61094C5.30156 5.5875 5.29063 5.55937 5.29063 5.52969C5.29063 5.45937 5.34688 5.40469 5.41563 5.40469L6.44844 5.40937L8 7.25937L9.55313 5.40781L10.5844 5.40312Z" fill-rule="evenodd" />\n </svg>',Icons_ptz='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="ptz">\n <circle cx="12" cy="12" r="2.771739" stroke-width="1.5"/>\n <path d="M9.06 5.14L10.76 3.8C11.48 3.23 12.51 3.23 13.23 3.8L14.93 5.14" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M4.87 14.93L3.54 13.23C2.97 12.51 2.97 11.48 3.54 10.76L4.87 9.06" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M18.91 14.93L20.24 13.23C20.81 12.51 20.81 11.48 20.24 10.76L18.91 9.06" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M9.06 18.69L10.76 20.02C11.48 20.59 12.51 20.59 13.23 20.02L14.93 18.69" stroke-width="1.5" stroke-linecap="round"/>\n </svg>',Icons_sdk='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="sdk">\n <path d="M6.20253 2.50012L11.6496 2.50012C12.2335 2.50012 12.7939 2.72827 13.2069 3.13391L15.3547 5.24329C15.7677 5.64893 16 6.19934 16 6.77271L16 15.1062C16 16.3011 15.0142 17.2694 13.7975 17.2694L6.20253 17.2694C4.98578 17.2694 4 16.3011 4 15.1062L4 4.66333C4 3.46826 4.98578 2.50012 6.20253 2.50012ZM8.07051 6.09814C8.02467 5.76025 7.73502 5.49976 7.38452 5.49976C7.00217 5.49976 6.69221 5.80969 6.69221 6.19202L6.69221 8.49976L6.69853 8.59375C6.74437 8.93164 7.03403 9.19202 7.38452 9.19202C7.76688 9.19202 8.07683 8.88208 8.07683 8.49976L8.07683 6.19202L8.07051 6.09814ZM9.69238 5.49976C10.0429 5.49976 10.3325 5.76025 10.3784 6.09814L10.3847 6.19202L10.3847 8.49976C10.3847 8.88208 10.0747 9.19202 9.69238 9.19202C9.34189 9.19202 9.05223 8.93164 9.00639 8.59375L9.00008 8.49976L9.00008 6.19202C9.00008 5.80969 9.31003 5.49976 9.69238 5.49976ZM12.686 6.09814C12.6402 5.76025 12.3505 5.49976 12 5.49976C11.6176 5.49976 11.3077 5.80969 11.3077 6.19202L11.3077 8.49976L11.314 8.59375C11.3598 8.93164 11.6495 9.19202 12 9.19202C12.3824 9.19202 12.6923 8.88208 12.6923 8.49976L12.6923 6.19202L12.686 6.09814Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',Icons_cloudRec='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="cloud">\n <path d="M9.76489 4.00439C7.65723 4.08447 5.79883 5.23486 4.89697 6.94995L4.78638 7.17236C2.60205 7.62524 1 9.40649 1 11.5239C1 14.0032 3.17749 16 5.84619 16L9.32983 16L9.32983 13.3784L7.66479 13.3784C7.21924 13.3784 6.99634 12.8398 7.31128 12.5249L9.63892 10.197C9.83423 10.002 10.1509 10.002 10.3462 10.197L12.6738 12.5249C12.9888 12.8398 12.7659 13.3784 12.3203 13.3784L10.6553 13.3784L10.6553 16L14.9846 16C17.1948 16 19 14.3445 19 12.2856L18.9954 12.1052C18.9058 10.3704 17.533 8.95557 15.7456 8.63818L15.6372 8.62036L15.6152 8.4624C15.2087 5.93188 12.8438 4 10 4L9.76489 4.00439Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',Icons_cloudRecord='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="cloud-record">\n <path d="M9.76489 4.00439C7.65723 4.08447 5.79883 5.23486 4.89697 6.94995L4.78638 7.17236C2.60205 7.62524 1 9.40649 1 11.5239C1 14.0032 3.17749 16 5.84619 16L14.9846 16C17.1948 16 19 14.3445 19 12.2856L18.9954 12.1052C18.9058 10.3704 17.533 8.95557 15.7456 8.63818L15.6372 8.62036L15.6152 8.4624C15.2087 5.93188 12.8438 4 10 4L9.76489 4.00439ZM10.8674 13.9116L6.89038 13.9116C6.26294 13.9116 5.75391 13.3889 5.75391 12.7449L5.75391 9.24487C5.75391 8.60034 6.26294 8.07812 6.89038 8.07812L10.8674 8.07812C11.4954 8.07812 12.0039 8.60034 12.0039 9.24487L12.0039 10.2937C12.2932 10.0627 12.9229 9.63184 13.4836 9.271C13.8145 9.05811 14.2461 9.24219 14.2461 9.63599L14.2461 12.3655C14.2461 12.759 13.8142 12.9434 13.4836 12.7307C12.9321 12.3755 12.303 11.9438 12.0039 11.707L12.0039 12.7449C12.0039 13.3889 11.4954 13.9116 10.8674 13.9116Z" clip-rule="evenodd" fill-rule="evenodd"/>\n </svg>',Icons_filter='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="filter">\n <path d="M12.57 9.92L16.31 5.76C16.55 5.49 16.69 5.15 16.69 4.79C16.69 3.98 16.03 3.33 15.23 3.33L4.79 3.33C4.43 3.33 4.09 3.46 3.82 3.7L3.72 3.79C3.21 4.33 3.19 5.18 3.7 5.75L7.38 9.91L7.38 15.66C7.38 16.11 7.7 16.51 8.14 16.63L11.32 17.43C11.95 17.59 12.57 17.11 12.57 16.46L12.57 9.92ZM4.88 4.83L8.88 9.35L8.88 15.27L11.07 15.82L11.07 9.34L15.13 4.83L4.88 4.83Z" fill-rule="evenodd"/>\n </svg>',Icons_more='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="more">\n <path d="M4 6.8L20.8 6.8" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M4 12.39L12.4 12.39" stroke-width="1.5" stroke-linecap="round"/>\n <path d="M4 18L8.19 18" stroke-width="1.5" stroke-linecap="round"/>\n </svg>',Icons_moreDot='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="more-dot">\n <path d="M8.75 3.75C8.75 3.05964 9.30964 2.5 10 2.5C10.6904 2.5 11.25 3.05964 11.25 3.75C11.25 4.44036 10.6904 5 10 5C9.30964 5 8.75 4.44036 8.75 3.75ZM8.75 10C8.75 9.30964 9.30964 8.75 10 8.75C10.6904 8.75 11.25 9.30964 11.25 10C11.25 10.6904 10.6904 11.25 10 11.25C9.30964 11.25 8.75 10.6904 8.75 10ZM10 15C9.30964 15 8.75 15.5596 8.75 16.25C8.75 16.9404 9.30964 17.5 10 17.5C10.6904 17.5 11.25 16.9404 11.25 16.25C11.25 15.5596 10.6904 15 10 15Z" fill-rule="evenodd" />\n </svg>',Icons_minusCircle='<svg width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="minus-circle">\n \t\t<path fill="currentColor" d="M10 3.75C13.4518 3.75 16.25 6.54822 16.25 10C16.25 13.4518 13.4518 16.25 10 16.25C6.54822 16.25 3.75 13.4518 3.75 10C3.75 6.54822 6.54822 3.75 10 3.75ZM10 5C7.23857 5 5 7.23858 5 10C5 12.7614 7.23857 15 10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5Z" fill-rule="evenodd" />\n\t\t <path stroke="currentColor" d="M7.46729 10.0588L12.4673 10.0588" stroke-linecap="round" stroke-width="1.25" />\n </svg>',Icons_plusCircle='<svg width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="plus-circle">\n <path fill="currentColor" d="M10 3.75C13.4518 3.75 16.25 6.54822 16.25 10C16.25 13.4518 13.4518 16.25 10 16.25C6.54822 16.25 3.75 13.4518 3.75 10C3.75 6.54822 6.54822 3.75 10 3.75ZM10 5C7.23857 5 5 7.23858 5 10C5 12.7614 7.23857 15 10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5Z" fill-rule="evenodd" />\n <path stroke="currentColor" d="M7.46729 10.0588L12.4673 10.0588" stroke-linecap="round" stroke-width="1.25" />\n <path stroke="currentColor" d="M0 0L5 0" stroke-linecap="round" stroke-width="1.25" transform="matrix(0,1,-1,0,9.96729,7.55884)" />\n </svg>',Icons_record='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="record">\n <path d="M4.53 19C3.03 19 1.8 17.74 1.8 16.2L1.8 7.8C1.8 6.25 3.03 5 4.53 5L14.08 5C15.58 5 16.8 6.25 16.8 7.8L16.8 16.2C16.8 17.74 15.58 19 14.08 19L4.53 19Z" stroke-width="1.5" stroke-linejoin="round"/>\n <path d="M17.25 13.64C17.94 14.2 18.97 15.03 20.36 16.15C21.09 16.74 22.19 16.21 22.19 15.27L22.19 8.72C22.19 7.78 21.09 7.25 20.36 7.84C18.99 8.94 17.96 9.77 17.28 10.32" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',Icons_recordCircle='<svg width="1em" height="1em" viewBox="0 0 14 14" fill="currentColor" stroke="none" focusable="false" aria-hidden="true" data-icon="record-circle">\n\t\t<path d="M7.00044 2.5C9.70278 2.5 11.8935 4.69068 11.8935 7.39302C11.8935 10.0954 9.70278 12.286 7.00044 12.286C4.2981 12.286 2.10742 10.0954 2.10742 7.39302C2.10742 4.69068 4.2981 2.5 7.00044 2.5ZM7.00044 3.5C4.85039 3.5 3.10742 5.24296 3.10742 7.39302C3.10742 9.54307 4.85039 11.286 7.00044 11.286C9.15049 11.286 10.8935 9.54307 10.8935 7.39302C10.8935 5.24296 9.15049 3.5 7.00044 3.5ZM9.50049 7.39252C9.50049 6.01181 8.3812 4.89252 7.00049 4.89252C5.61978 4.89252 4.50049 6.01181 4.50049 7.39252C4.50049 8.77323 5.61978 9.89252 7.00049 9.89252C8.3812 9.89252 9.50049 8.77323 9.50049 7.39252Z" fill-rule="evenodd" />\n </svg>\n ',Icons_talk='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="talk">\n \t<path stroke="none" d="M12.22 18.95C12.65 18.95 13.01 19.21 13.07 19.54L13.08 19.64L13.08 21.78C13.08 22.16 12.69 22.47 12.22 22.47C11.78 22.47 11.42 22.21 11.37 21.87L11.36 21.78L11.36 19.64C11.36 19.26 11.74 18.95 12.22 18.95Z" fill-rule="evenodd"/>\n <path d="M19.53 11.37L19.53 11.58C19.53 15.74 16.15 19.11 11.99 19.11C7.83 19.11 4.46 15.74 4.46 11.58L4.46 11.43" fill="none" stroke-width="1.5" stroke-linecap="round"/>\n <path stroke="none" d="M12.05 1.52C9.3 1.52 7.07 3.58 7.07 6.12L7.07 12.07C7.07 14.61 9.3 16.67 12.05 16.67C14.79 16.67 17.02 14.61 17.02 12.07L17.02 6.12C17.02 3.58 14.79 1.52 12.05 1.52ZM8.57 12.07L8.57 6.12C8.57 5.94 8.59 5.75 8.63 5.57C8.67 5.36 8.74 5.16 8.83 4.96C8.86 4.89 8.9 4.82 8.93 4.75C9.09 4.46 9.3 4.21 9.55 3.97C9.64 3.89 9.73 3.81 9.83 3.74C10.08 3.55 10.35 3.4 10.66 3.28C10.79 3.23 10.93 3.19 11.06 3.15C11.38 3.07 11.71 3.02 12.05 3.02C12.38 3.02 12.71 3.07 13.03 3.15C13.17 3.19 13.3 3.23 13.43 3.28C13.74 3.4 14.02 3.55 14.27 3.74C14.36 3.81 14.45 3.89 14.54 3.97C14.79 4.21 15 4.46 15.16 4.75C15.2 4.82 15.23 4.89 15.26 4.96C15.35 5.16 15.42 5.36 15.46 5.57C15.5 5.75 15.52 5.94 15.52 6.12L15.52 12.07C15.52 12.26 15.5 12.44 15.46 12.63C15.42 12.83 15.35 13.04 15.26 13.24C15.23 13.31 15.2 13.38 15.16 13.45C15 13.73 14.79 13.99 14.54 14.22C14.45 14.3 14.36 14.38 14.27 14.45C14.02 14.64 13.74 14.79 13.43 14.91C13.3 14.96 13.17 15.01 13.03 15.05C12.71 15.13 12.38 15.17 12.05 15.17C11.71 15.17 11.38 15.13 11.06 15.05C10.93 15.01 10.79 14.96 10.66 14.91C10.35 14.79 10.08 14.64 9.83 14.45C9.73 14.38 9.64 14.3 9.55 14.22C9.3 13.99 9.09 13.73 8.93 13.45C8.9 13.38 8.86 13.31 8.83 13.24C8.74 13.04 8.67 12.83 8.63 12.63C8.59 12.44 8.57 12.26 8.57 12.07Z" fill-rule="evenodd"/>\n </svg>',Icons_talkGrowth=function(prefix){return'<svg width="1em" height="1em" viewBox="0 0 24 24" focusable="false" aria-hidden="true" data-icon="talk-growth">\n \t\t<g fill="currentColor" stroke="currentColor">\n <path stroke="none" d="M9.22313 18.9543C9.6588 18.9543 10.0189 19.2133 10.0759 19.5494L10.0837 19.6428L10.0837 21.7847C10.0837 22.1649 9.69841 22.4732 9.22313 22.4732C8.78745 22.4732 8.42739 22.2142 8.37041 21.8781L8.36255 21.7847L8.36255 19.6428C8.36255 19.2626 8.74784 18.9543 9.22313 18.9543Z" fill-rule="evenodd" />\n <path d="M16.5323 11.3779L16.5323 11.5872C16.5323 15.7472 13.1599 19.1197 8.99981 19.1197C4.83971 19.1197 1.46729 15.7472 1.46729 11.5872L1.46729 11.4335" fill-rule="evenodd" fill="none" stroke-width="1.5" />\n <path stroke="none" d="M4.07861 6.12978C4.07861 3.589 6.30476 1.5293 9.05085 1.5293C11.7969 1.5293 14.0231 3.589 14.0231 6.12978L14.0231 12.075C14.0231 14.6158 11.7969 16.6755 9.05085 16.6755C6.30476 16.6755 4.07861 14.6158 4.07861 12.075L4.07861 6.12978ZM5.57861 12.075L5.57861 6.12978C5.57861 5.94083 5.597 5.75561 5.63376 5.57412C5.67605 5.36539 5.74265 5.16158 5.83357 4.9627C5.86625 4.8912 5.90164 4.82121 5.93974 4.75272C6.09781 4.4685 6.30245 4.21019 6.55365 3.97777C6.64206 3.89597 6.73424 3.81921 6.83019 3.7475C7.0816 3.55959 7.3589 3.40632 7.66207 3.28767C7.79552 3.23545 7.93107 3.19114 8.06871 3.15475C8.38503 3.07111 8.71241 3.0293 9.05085 3.0293C9.38929 3.0293 9.71668 3.07112 10.033 3.15475C10.1706 3.19114 10.3062 3.23545 10.4396 3.28767C10.7428 3.40632 11.0201 3.55959 11.2715 3.74749C11.3675 3.81921 11.4596 3.89596 11.548 3.97777C11.7993 4.2102 12.0039 4.46853 12.162 4.75276C12.2001 4.82124 12.2354 4.89122 12.2681 4.9627C12.359 5.16157 12.4256 5.36536 12.4679 5.57407C12.5047 5.75558 12.5231 5.94082 12.5231 6.12978L12.5231 12.075C12.5231 12.264 12.5047 12.4492 12.4679 12.6307C12.4256 12.8394 12.359 13.0432 12.2681 13.2421C12.2355 13.3136 12.2001 13.3835 12.162 13.452C12.0039 13.7362 11.7993 13.9946 11.548 14.227C11.4596 14.3088 11.3675 14.3856 11.2715 14.4573C11.0201 14.6452 10.7428 14.7985 10.4396 14.9171C10.3062 14.9693 10.1706 15.0136 10.033 15.05C9.71667 15.1337 9.38929 15.1755 9.05085 15.1755C8.71241 15.1755 8.38503 15.1337 8.06871 15.05C7.93107 15.0136 7.79552 14.9693 7.66207 14.9171C7.3589 14.7985 7.0816 14.6452 6.83019 14.4573C6.73424 14.3856 6.64206 14.3088 6.55365 14.227C6.30244 13.9946 6.09779 13.7363 5.93972 13.452C5.90163 13.3836 5.86625 13.3136 5.83357 13.2421C5.74265 13.0432 5.67605 12.8394 5.63377 12.6307C5.597 12.4492 5.57861 12.264 5.57861 12.075Z" fill-rule="evenodd" />\n </g>\n <g class="'+prefix+'-icon-talk-growth-dot">\n <path class="'+prefix+'-icon-talk-growth-dot1" d="M19.1333 6.40039L22.8667 6.40039" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="'+prefix+'-icon-talk-growth-dot2" d="M19.1333 10.1338L21.9331 10.1338" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="'+prefix+'-icon-talk-growth-dot3" d="M19.1333 13.8672L20.9995 13.8672" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n <path class="'+prefix+'-icon-talk-growth-dot4" d="M19.1333 17.6001L20.0669 17.6001" stroke="currentColor" stroke-linecap="round" stroke-width="1.86666667" />\n </g>\n </svg>'},Icons_capturePicture='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="capture-picture">\n \t<path d="M6.94 7.51C7.34 7.51 7.7 7.28 7.86 6.91L8.43 5.6C8.59 5.23 8.95 5 9.35 5L14.69 5C15.04 5 15.37 5.18 15.55 5.49L16.45 7.02C16.63 7.33 16.96 7.51 17.31 7.51L18.5 7.51C19.6 7.51 20.5 8.41 20.5 9.51L20.5 17C20.5 18.1 19.6 19 18.5 19L5.5 19C4.39 19 3.5 18.1 3.5 17L3.5 9.51C3.5 8.41 4.39 7.51 5.5 7.51L6.94 7.51Z" stroke-width="1.5"/>\n\t <circle cx="12" cy="12.525146" r="3.068097" stroke-width="1.5"/>\n </svg>',Icons_zoom='<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" focusable="false" aria-hidden="true" data-icon="zoom">\n <ellipse cx="10.914795" cy="11.25" rx="8.004043" ry="8.25" stroke-width="1.5"/>\n <path d="M14.31 11.04L8.05 11.14" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M11.13 14.22L11.23 7.95" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n <path d="M16.45 17.83L19.36 20.83" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>\n </svg>',Icons_infoCircleOutLined='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="info-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM7.25 5.25C7.25 5.66421 7.58579 6 8 6C8.41421 6 8.75 5.66421 8.75 5.25C8.75 4.83579 8.41421 4.5 8 4.5C7.58579 4.5 7.25 4.83579 7.25 5.25ZM8.5 7.125C8.5 7.05625 8.44375 7 8.375 7L7.625 7C7.55625 7 7.5 7.05625 7.5 7.125L7.5 11.375C7.5 11.4438 7.55625 11.5 7.625 11.5L8.375 11.5C8.44375 11.5 8.5 11.4438 8.5 11.375L8.5 7.125Z" fill-rule="evenodd"/>\n </svg>',Icons_warnCircleOutLined='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" focusable="false" aria-hidden="true" data-icon="info-circle">\n <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM7.5 8.875C7.5 8.94375 7.55625 9 7.625 9L8.375 9C8.44375 9 8.5 8.94375 8.5 8.875L8.5 4.625C8.5 4.55625 8.44375 4.5 8.375 4.5L7.625 4.5C7.55625 4.5 7.5 4.55625 7.5 4.625L7.5 8.875ZM7.25 10.75C7.25 11.1642 7.58579 11.5 8 11.5C8.41421 11.5 8.75 11.1642 8.75 10.75C8.75 10.3358 8.41421 10 8 10C7.58579 10 7.25 10.3358 7.25 10.75Z" fill-rule="evenodd" />\n </svg>',Icons_date='<svg width="1em" height="1em" viewBox="0 0 20 20" fill="currentColor" focusable="false" aria-hidden="true" data-icon="date">\n <g>\n <path d="m13.35,5.9c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-3.3c0,-0.3 0.2,-0.5 0.5,-0.5s0.5,0.2 0.5,0.5l0,3.3c0,0.3 -0.3,0.5 -0.5,0.5z" />\n <path d="m6.65,5.9c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-3.3c0,-0.3 0.2,-0.5 0.5,-0.5s0.5,0.2 0.5,0.5l0,3.3c0,0.3 -0.2,0.5 -0.5,0.5z" />\n <path d="m17.45,8.4l-15,0c-0.3,0 -0.5,-0.2 -0.5,-0.5s0.2,-0.5 0.5,-0.5l15,0c0.3,0 0.5,0.2 0.5,0.5s-0.2,0.5 -0.5,0.5z" />\n <path d="m15.85,18.4l-11.7,0c-1.2,0 -2.2,-1 -2.2,-2.2l0,-10.8c0,-1.2 1,-2.2 2.2,-2.2l11.7,0c1.2,0 2.2,1 2.2,2.2l0,10.8c-0.1,1.3 -1,2.2 -2.2,2.2zm-11.7,-14.1c-0.6,0 -1.2,0.5 -1.2,1.2l0,10.8c0,0.6 0.5,1.2 1.2,1.2l11.7,0c0.6,0 1.2,-0.5 1.2,-1.2l0,-10.9c0,-0.6 -0.5,-1.2 -1.2,-1.2l-11.7,0l0,0.1z" />\n <path d="m9.95,12c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5s0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7s-0.3,0.7 -0.7,0.7z" />\n <path d="m14.15,12c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2c0.4,0 0.7,0.3 0.7,0.7s-0.3,0.7 -0.7,0.7zm0,-1c-0.2,0 -0.3,0.1 -0.3,0.3c0,0.2 0.3,0.4 0.5,0.2c0.1,-0.1 0.1,-0.1 0.1,-0.2c0,-0.2 -0.1,-0.3 -0.3,-0.3z" />\n <path d="m5.85,15.3c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7c0,0.4 -0.3,0.7 -0.7,0.7z" />\n <path d="m9.95,15.3c-0.4,0 -0.7,-0.3 -0.7,-0.7c0,-0.2 0.1,-0.4 0.2,-0.5c0.1,-0.1 0.3,-0.2 0.5,-0.2l0,0l0,0c0.4,0 0.7,0.3 0.7,0.7c0.1,0.4 -0.3,0.7 -0.7,0.7z" />\n </g>\n </svg>',Icons_add='<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="add">\n <path d="M10.5859 2.96875L9.41406 2.96875C9.3099 2.96875 9.25781 3.02083 9.25781 3.125L9.25781 9.25781L3.4375 9.25781C3.38542 9.25781 3.34635 9.27083 3.32031 9.29688C3.29427 9.32292 3.28125 9.36198 3.28125 9.41406L3.28125 10.5859C3.28125 10.6901 3.33333 10.7422 3.4375 10.7422L9.25781 10.7422L9.25781 16.875C9.25781 16.9792 9.3099 17.0312 9.41406 17.0312L10.5859 17.0312C10.6901 17.0312 10.7422 16.9792 10.7422 16.875L10.7422 10.7422L16.5625 10.7422C16.6667 10.7422 16.7188 10.6901 16.7188 10.5859L16.7188 9.41406C16.7188 9.3099 16.6667 9.25781 16.5625 9.25781L10.7422 9.25781L10.7422 3.125C10.7422 3.07292 10.7292 3.03385 10.7031 3.00781C10.6771 2.98177 10.638 2.96875 10.5859 2.96875Z" fill-rule="evenodd" /></svg>',Icons_reduce='<svg fill="currentColor" width="1em" height="1em" viewBox="0 0 20 20" focusable="false" aria-hidden="true" data-icon="reduce">\n \t<path d="M3.4375 9.25781L16.5625 9.25781C16.6667 9.25781 16.7188 9.3099 16.7188 9.41406L16.7188 10.5859C16.7188 10.6901 16.6667 10.7422 16.5625 10.7422L3.4375 10.7422C3.33333 10.7422 3.28125 10.6901 3.28125 10.5859L3.28125 9.41406C3.28125 9.3099 3.33333 9.25781 3.4375 9.25781Z" fill-rule="evenodd" />\n </svg>';function createIcon(svg,type,attr){void 0===attr&&(attr={});var attrStr="";return attr&&Object.keys(attr).forEach((function(key){void 0!==attr[key]&&null!==attr[key]&&(attrStr+=key+'="'+attr[key]+'"')})),'<span class="ezplayer-icon ezplayer-icon-'+type+'" '+attrStr+">"+svg+"</span>"}var IconComponents_play=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_play,"play",attr)},IconComponents_pause=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_pause,"pause",attr)},IconComponents_volume=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_volume("ezplayer"),"volume",attr)},IconComponents_mobileFullscreen=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_mobileFullscreen,"mobile-fullscreen",attr)},IconComponents_exitFullscreen=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_exitFullscreen,"exit-fullscreen",attr)},IconComponents_fullscreen=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_fullscreen,"fullscreen",attr)},IconComponents_exitGlobalFullscreen=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_exitGlobalFullscreen,"exit-global-fullscreen",attr)},IconComponents_globalFullscreen=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_globalFullscreen,"global-fullscreen",attr)},IconComponents_capturePicture=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_capturePicture,"capture-picture",attr)},IconComponents_ptz=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_ptz,"ptz",attr)},IconComponents_record=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_record,"record",attr)},IconComponents_recordCircle=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_recordCircle,"record-circle",attr)},IconComponents_talk=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_talk,"talk",attr)},IconComponents_talkGrowth=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_talkGrowth("ezplayer"),"talk-growth",attr)},IconComponents_zoom=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_zoom,"zoom",attr)},IconComponents_more=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_more,"more",attr)},IconComponents_moreDot=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_moreDot,"more-dot",attr)},IconComponents_minusCircle=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_minusCircle,"minus-circle",attr)},IconComponents_plusCircle=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_plusCircle,"plus-circle",attr)},IconComponents_sdk=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_sdk,"sdk",attr)},IconComponents_cloudRec=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_cloudRec,"cloud-rec",attr)},IconComponents_cloudRecord=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_cloudRecord,"cloud-record",attr)},IconComponents_close=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_close,"close",attr)},IconComponents_closeCircleOutLined=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_closeCircleOutLined,"close-circle",attr)},IconComponents_warnCircleOutLined=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_warnCircleOutLined,"warn-circle",attr)},IconComponents_infoCircleOutLined=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_infoCircleOutLined,"info-circle",attr)},IconComponents_date=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_date,"date",attr)},IconComponents_filter=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_filter,"filter",attr)},IconComponents_add=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_add,"add",attr)},IconComponents_reduce=function(attr){return void 0===attr&&(attr={}),createIcon(Icons_reduce,"reduce",attr)};function _extends$o(){return _extends$o=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$o.apply(this,arguments)}function _set_prototype_of$o(o,p){return _set_prototype_of$o=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$o(o,p)}var MESSAGE_DEFAULT_OPTIONS={},Message=function(Control){function Message(options){var _this;return void 0===options&&(options={}),(_this=Control.call(this,Object.assign({},MESSAGE_DEFAULT_OPTIONS,_extends$o({},options,{tagName:"div",controlType:"block"})))||this).options=Object.assign({},MESSAGE_DEFAULT_OPTIONS,options),_this.$container.classList.add("ezplayer-message","ezplayer-hide"),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$o(subClass,superClass)}(Message,Control);var _proto=Message.prototype;return _proto.info=function(msg,duration){void 0===duration&&(duration=2),this._toast(msg,"info",duration)},_proto.warn=function(msg,duration){void 0===duration&&(duration=2),this._toast(msg,"warn",duration)},_proto.toastError=function(msg,duration){void 0===duration&&(duration=2),this._toast(msg,"error",duration)},_proto.error=function(msg,duration){void 0===duration&&(duration=0),this._show(this._getIcon("error")+'<div class="ezplayer-message-msg">'+(msg||"")+"</div>",duration,"error")},_proto._toast=function(msg,type,duration){var _this=this;void 0===type&&(type="info"),void 0===duration&&(duration=2),this._toastTimer&&clearTimeout(this._toastTimer),this._toastTimer=null,this.options.rootContainer&&(this._$toast||(this._$toast=document.createElement("div"),this._$toast.classList.add("ezplayer-toast")),this._$toast.innerHTML='<div class="ezplayer-toast-content">'+this._getIcon(type)+'<span class="ezplayer-toast-msg ezplayer-toast-'+type+'">'+(msg||"")+"</span></div>",this.options.rootContainer.appendChild(this._$toast),duration>0&&(this._toastTimer=setTimeout((function(){var _this__$toast;null==(_this__$toast=_this._$toast)||_this__$toast.remove(),_this._$toast=null,_this._toastTimer&&clearTimeout(_this._toastTimer),_this._toastTimer=null}),1e3*duration)))},_proto._show=function(msg,duration,type){var _this=this;void 0===duration&&(duration=0),void 0===type&&(type="info"),this._timer&&(clearTimeout(this._timer),this._timer=null),this.$popupContainer.classList.add("ezplayer-has-message","ezplayer-has-message-"+type),"function"==typeof this.options.render?this.$container.innerHTML=this.options.render(msg,duration,type):this.$container.innerHTML='<div class="ezplayer-message-content ezplayer-message-'+type+'">'+(msg||"")+"</div>",this.$container.style.display="flex",this.$container.classList.remove("ezplayer-hide"),duration>0&&(this._timer=setTimeout((function(){_this.hide(),_this._timer&&clearTimeout(_this._timer),_this._timer=null}),1e3*duration))},_proto.destroy=function(){var _this__$toast;this._timer&&(clearTimeout(this._timer),this._timer=null),this._toastTimer&&clearTimeout(this._toastTimer),this._toastTimer=null,null==(_this__$toast=this._$toast)||_this__$toast.remove(),this._$toast=null,this.hide(),Control.prototype.destroy.call(this)},_proto.hide=function(){var _this=this;this.$container.innerHTML="",Array.from(this.$popupContainer.classList).forEach((function(className){new RegExp("^ezplayer-has-message","ig").test(className)&&_this.$popupContainer.classList.remove(className)})),Control.prototype.hide.call(this)},_proto._getIcon=function(type){var icon=IconComponents_infoCircleOutLined();switch(type){case"warn":icon=IconComponents_warnCircleOutLined();break;case"error":icon=IconComponents_closeCircleOutLined();break;default:icon=IconComponents_infoCircleOutLined()}return icon},Message}(Control);function _create_class$8(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$n(){return _extends$n=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$n.apply(this,arguments)}function _set_prototype_of$n(o,p){return _set_prototype_of$n=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$n(o,p)}var Play=function(Control){function Play(options){var _this;return(_this=Control.call(this,_extends$n({},options,{tagName:"span",controlType:"button",classNameSuffix:"play"}))||this)._playing=!1,_this._options=options,_this._playing=!!options.props.playing,_this.on(EVENTS$1.play,(function(playing){_this._playing!==playing&&(_this._playing=playing,_this._render())})),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$n(subClass,superClass)}(Play,Control);var _proto=Play.prototype;return _proto._onControlClick=function(e){this._playing=!this._playing,this.emit(EVENTS$1.control.play,this._playing),null==this._options.onClick||this._options.onClick.call(this._options,e,this._playing),this._render()},_proto._render=function(){var _this_locale,_this_locale1;this._playing?this.$container.innerHTML=IconComponents_play({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_PLAY}):this.$container.innerHTML=IconComponents_pause({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_PAUSE})},_create_class$8(Play,[{key:"playing",get:function(){return this._playing}}]),Play}(Control);function throttle(func,wait){var timeout=null,lastCall=0;return function(){for(var _this=this,_len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];var now=Date.now(),remaining=wait-(now-lastCall);remaining<=0?(lastCall=now,func.apply(this,args)):timeout||(timeout=setTimeout((function(){lastCall=Date.now(),timeout=null,func.apply(_this,args)}),remaining))}}function _array_like_to_array$2(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _create_for_of_iterator_helper_loose$2(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array$2(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array$2(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Utils=function(){function Utils(){}return Utils.orientationEventListener=function(change){var _orientationTimer=null,getOrientation=function(){var _screen,_window;if(null==(_screen=screen)?void 0:_screen.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type||screen.mozOrientation||screen.msOrientation};if(void 0!==(null==(_window=window)?void 0:_window.orientation)){var angle=window.orientation;return{angle:angle>=0?angle:360+angle,type:90===Math.abs(angle)?"landscape":"portrait"}}return Utils.isMobile?{angle:window.innerWidth>window.innerHeight?90:0,type:window.innerWidth>window.innerHeight?"landscape":"portrait"}:{angle:0,type:"unknow"}},orientation=getOrientation(),onOrientationChange=function(){var newOrientation=null==getOrientation?void 0:getOrientation();newOrientation.angle===orientation.angle&&newOrientation.type===orientation.type||(null==change||change(newOrientation),orientation=newOrientation)},onResize=function(){_orientationTimer&&clearTimeout(_orientationTimer),onOrientationChange&&(_orientationTimer=setTimeout(onOrientationChange,200))};return screen.orientation?screen.orientation.addEventListener("change",onOrientationChange):"onorientationchange"in window?window.addEventListener("orientationchange",onOrientationChange):Utils.isMobile&&window.addEventListener("resize",onResize),[orientation,function(){screen.orientation&&onOrientationChange?screen.orientation.removeEventListener("change",onOrientationChange):"onorientationchange"in window&&onOrientationChange?window.removeEventListener("orientationchange",onOrientationChange):Utils.isMobile&&window.removeEventListener("resize",onResize),onOrientationChange=null,onResize=null,getOrientation=null,_orientationTimer&&(clearTimeout(_orientationTimer),_orientationTimer=null)}]},Utils.resizeObserver=function(node,callback){var observerFn=function(entries,observer){for(var _step,_iterator=_create_for_of_iterator_helper_loose$2(entries);!(_step=_iterator()).done;){_step.value.target===node&&callback&&callback(entries,observer)}},observer=new ResizeObserver(throttle(observerFn,50));return observer.observe(node),{unobserve:function(){try{null==observer||observer.unobserve(node)}catch(error){}observerFn=null},disconnect:function(){null==observer||observer.disconnect(),observer=null,observerFn=null}}},Utils}();function _create_class$7(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}Utils.isMobile=isMobile$1();var PROGRESS_DEFAULT_OPTIONS={step:.01,range:[0,1],draggable:!0,disabled:!1,showPercent:!1,showPlus:!1,showMinus:!1,isRotated:!1,onChange:function(){},renderText:function(_,percent){return(100*percent).toFixed(0)}},Progress=function(){function Progress(options){var _this_options_range,_this_options_defaultValue;if(this._percent=0,this._value=0,this._disabled=!1,this._delegateSliderMouseDown=null,this._delegateSliderHandleMouseDown=null,this._delegateProgressMouseDown=null,this._delegatePlusClick=null,this._delegateMinusClick=null,this._isRotated=!1,this.options=Object.assign({},PROGRESS_DEFAULT_OPTIONS,options),2!==(null==(_this_options_range=this.options.range)?void 0:_this_options_range.length))throw new Error("Progress range must be an array with two elements.");if(this.options.range[0]>=this.options.range[1])throw new Error("Progress range first element must be less than the second element.");this._isRotated=this.options.isRotated||!1,this.$container=options.container,this._render(),this._eventListeners();var value=null!=(_this_options_defaultValue=this.options.defaultValue)?_this_options_defaultValue:this.options.range[0];this._value=+value.toFixed(2),this._percent=+((value-this.options.range[0])/(this.options.range[1]-this.options.range[0])).toFixed(2),this._updateUI(),this.disabled=this.options.disabled}var _proto=Progress.prototype;return _proto.isRotate=function(rotated){this._isRotated=rotated},_proto.destroy=function(){var _this__delegateSliderMouseDown_destroy,_this__delegateSliderMouseDown,_this__delegateSliderHandleMouseDown_destroy,_this__delegateSliderHandleMouseDown,_this__delegateProgressMouseDown_destroy,_this__delegateProgressMouseDown,_this__delegatePlusClick_destroy,_this__delegatePlusClick,_this__delegateMinusClick_destroy,_this__delegateMinusClick;null==(_this__delegateSliderMouseDown=this._delegateSliderMouseDown)||null==(_this__delegateSliderMouseDown_destroy=_this__delegateSliderMouseDown.destroy)||_this__delegateSliderMouseDown_destroy.call(_this__delegateSliderMouseDown),this._delegateSliderMouseDown=null,null==(_this__delegateSliderHandleMouseDown=this._delegateSliderHandleMouseDown)||null==(_this__delegateSliderHandleMouseDown_destroy=_this__delegateSliderHandleMouseDown.destroy)||_this__delegateSliderHandleMouseDown_destroy.call(_this__delegateSliderHandleMouseDown),this._delegateSliderHandleMouseDown=null,null==(_this__delegateProgressMouseDown=this._delegateProgressMouseDown)||null==(_this__delegateProgressMouseDown_destroy=_this__delegateProgressMouseDown.destroy)||_this__delegateProgressMouseDown_destroy.call(_this__delegateProgressMouseDown),this._delegateProgressMouseDown=null,null==(_this__delegatePlusClick=this._delegatePlusClick)||null==(_this__delegatePlusClick_destroy=_this__delegatePlusClick.destroy)||_this__delegatePlusClick_destroy.call(_this__delegatePlusClick),this._delegatePlusClick=null,null==(_this__delegateMinusClick=this._delegateMinusClick)||null==(_this__delegateMinusClick_destroy=_this__delegateMinusClick.destroy)||_this__delegateMinusClick_destroy.call(_this__delegateMinusClick),this._delegateMinusClick=null,this.$content&&this.$container.removeChild(this.$content),this.$content=null},_proto._updateValuePercent=function(type,value){if("percent"===type){if(value<0||value>1)return;this._percent!==value&&(this._percent=+value.toFixed(2),this._convertPercentToValue(this._percent),null==this.options.onChange||this.options.onChange.call(this.options,this._value,this._percent,this.options.range),this._updateUI())}else if("value"===type){if(value<this.options.range[0]||value>this.options.range[1])return;this._value!==value&&(this._value=+value.toFixed(2),this._convertValueToPercent(this._value),null==this.options.onChange||this.options.onChange.call(this.options,this._value,this._percent,this.options.range),this._updateUI())}},_proto._convertPercentToValue=function(percent){this._value=+(this.options.range[0]+(this.options.range[1]-this.options.range[0])*percent).toFixed(2)},_proto._convertValueToPercent=function(value){this._percent=+((value-this.options.range[0])/(this.options.range[1]-this.options.range[0])).toFixed(2)},_proto._render=function(){var _this_options_className;this.$content=document.createElement("div"),this.$content.className="ezplayer-progress "+(null!=(_this_options_className=this.options.className)?_this_options_className:""),this.$content.innerHTML=(this.options.showPercent?'<div class="ezplayer-progress-text">'+(null==this.options.renderText?void 0:this.options.renderText.call(this.options,this._value,this._percent,this.options.range))+"</div>":"")+"\n "+(this.options.showPlus?'<div class="ezplayer-progress-plus">\n '+IconComponents_plusCircle()+"\n </div>":"")+'\n <div class="ezplayer-progress-slider">\n <div class="ezplayer-progress-slider-fill"></div>\n <div class="ezplayer-progress-slider-handle" style="top: 100%"></div>\n </div>\n '+(this.options.showMinus?'<div class="ezplayer-progress-minus">\n '+IconComponents_minusCircle()+"\n </div>":""),this.$container.appendChild(this.$content)},_proto._updateUI=function(){var $progress=this.$content;if(null==$progress||$progress.setAttribute("data-value",this._value+""),$progress.querySelector(".ezplayer-progress-slider-fill")){var percent=+(100*this._percent).toFixed(0);this.options.showPercent&&($progress.querySelector(".ezplayer-progress-text").innerHTML=null==this.options.renderText?void 0:this.options.renderText.call(this.options,this._value,this._percent,this.options.range)),$progress.querySelector(".ezplayer-progress-slider-fill").style.height=percent+"%",$progress.querySelector(".ezplayer-progress-slider-handle").style.top=100-percent+"%"}},_proto._eventListeners=function(){var _this=this,mousedownName=window.PointerEvent?"pointerdown":"mousedown";if(this._delegateSliderMouseDown=delegate(this.$content,".ezplayer-progress-slider",mousedownName,(function(e){var _this_options_onProgressClick,_this_options;if(e.stopPropagation(),!e.delegateTarget.classList.contains("ezplayer-disabled")&&!_this._disabled){var rect=_this.$content.querySelector(".ezplayer-progress-slider").getBoundingClientRect(),percent=0;if(Utils.isMobile&&_this._isRotated)percent=+(Math.max(0,Math.min(e.clientX-rect.x,rect.width))/rect.width).toFixed(2);else percent=+(Math.max(0,Math.min(rect.height-(e.clientY-rect.y),rect.height))/rect.height).toFixed(2);_this._convertPercentToValue(percent),null==(_this_options=_this.options)||null==(_this_options_onProgressClick=_this_options.onProgressClick)||_this_options_onProgressClick.call(_this_options,_this._value,percent,_this.options.range),_this.percent=percent}})),this._delegateSliderHandleMouseDown=delegate(this.$content,".ezplayer-progress-slider-handle",mousedownName,(function(e){if(e.stopPropagation(),_this.options.draggable&&!e.delegateTarget.classList.contains("ezplayer-disabled")&&!_this._disabled){var startY=_this._isRotated?e.clientX:e.clientY,startHeight=_this.$content.querySelector(".ezplayer-progress-slider-fill").offsetHeight,sliderHeight=_this.$content.querySelector(".ezplayer-progress-slider").offsetHeight,handleMouseMove=throttle((function(e){if(e.stopPropagation(),_this.options.draggable&&!_this._disabled){var deltaY=startY-(_this._isRotated?e.clientX:e.clientY),newHeight=startHeight+(_this._isRotated?-deltaY:deltaY);newHeight=Math.max(0,Math.min(newHeight,sliderHeight)),_this.percent=+(newHeight/sliderHeight).toFixed(2)}}),20),$container=_this.$content,mousemoveName=window.PointerEvent?"pointermove":"mousemove",mouseupName=window.PointerEvent?"pointerup":"mouseup",mouseleaveName=window.PointerEvent?"pointerleave":"mouseleave";$container.addEventListener(mousemoveName,handleMouseMove),$container.addEventListener(mouseupName,handleMouseUp),$container.addEventListener(mouseleaveName,handleMouseUp)}function handleMouseUp(){$container.removeEventListener(mousemoveName,handleMouseMove),handleMouseMove=null,$container.removeEventListener(mouseupName,handleMouseUp),$container.removeEventListener(mouseleaveName,handleMouseUp)}})),this.options.showPlus){var clickName=window.PointerEvent?"pointerdown":"click";this._delegatePlusClick=delegate(this.$content,".ezplayer-progress-plus",clickName,(function(e){if(e.stopPropagation(),!e.delegateTarget.classList.contains("ezplayer-disabled")&&!_this._disabled){var value=_this._value+_this.options.step;value<=_this.options.range[1]?_this.value=value:_this.value=_this.options.range[1],null==_this.options.onPlusClick||_this.options.onPlusClick.call(_this.options,_this.value,_this.percent,_this.options.range)}}))}if(this.options.showMinus){var clickName1=window.PointerEvent?"pointerdown":"click";this._delegateMinusClick=delegate(this.$content,".ezplayer-progress-minus",clickName1,(function(e){if(e.stopPropagation(),!e.delegateTarget.classList.contains("ezplayer-disabled")&&!_this._disabled){var value=_this._value-_this.options.step;value>=_this.options.range[0]?_this.value=value:_this.value=_this.options.range[0],null==_this.options.onMinusClick||_this.options.onMinusClick.call(_this.options,_this.value,_this.percent,_this.options.range)}}),!0)}["mousedown","touchstart","touchmove","dblclick"].forEach((function(name){delegate(_this.$container,".ezplayer-progress",name,(function(e){e.stopPropagation(),e.preventDefault()}))}))},_create_class$7(Progress,[{key:"disabled",get:function(){return this._disabled},set:function(disabled){this._disabled=disabled}},{key:"value",get:function(){return this._value},set:function(value){this._updateValuePercent("value",value)}},{key:"percent",get:function(){return this._percent},set:function(percent){this._updateValuePercent("percent",percent)}}]),Progress}();function _create_class$6(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$m(){return _extends$m=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$m.apply(this,arguments)}function _set_prototype_of$m(o,p){return _set_prototype_of$m=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$m(o,p)}var VOLUME_DEFAULT_OPTIONS={volume:.8,muted:!1,open:!1,trigger:"hover",onOpenChange:function(){},onChange:function(){}},Volume=function(Control){function Volume(options){var _this,_this__options_props,_this__options_props1,_this__options_props2,_this__options_props3,_this__options_props4,_this__options_props5;(void 0===options&&(options={}),(_this=Control.call(this,_extends$m({},options,{tagName:"span",classNameSuffix:"volume",controlType:"button"}))||this)._muted=!1,_this._volume=0,_this._lastVolume=0,_this._progress=null,_this._options=deepmerge(VOLUME_DEFAULT_OPTIONS,options,{clone:!1}),_this._render(),_this._volume=(null==(_this__options_props=_this._options.props)?void 0:_this__options_props.volume)>=1?1:(null==(_this__options_props1=_this._options.props)?void 0:_this__options_props1.volume)<=0?0:+(null==(_this__options_props2=_this._options.props)?void 0:_this__options_props2.volume.toFixed(2)),_this._lastVolume=_this._volume,_this._muted=!!(null==(_this__options_props3=_this._options.props)?void 0:_this__options_props3.muted)||!1,Utils.isMobile||"ezopen"===_this._options.PLAY_TYPE)||(_this.picker=new Picker(_this.$container,{getPopupContainer:function(){return _this.$container},trigger:_this._options.trigger,open:_this._options.open,offset:[0,-10],placement:"top",onOpenChange:function(open){null==_this._options.onOpenChange||_this._options.onOpenChange.call(_this._options,open,_this._muted?_this._lastVolume:_this.volume,_this._muted),_this.emit(EVENTS$1.control.volumePanelOpenChange,open,_this._lastVolume,_this._muted)}}),_this._progress=new Progress({container:_this.picker.$body,defaultValue:(null==(_this__options_props4=_this._options.props)?void 0:_this__options_props4.muted)?0:null==(_this__options_props5=_this._options.props)?void 0:_this__options_props5.volume,range:[0,1],step:.1,showPercent:!0,className:"ezplayer-volume-progress",onProgressClick:function(){_this.muted=!1},onChange:function(value){value!==_this._volume&&(_this.volume=value)}}));return _this._updateUI(),_this._addEventListener(),_this.on(EVENTS$1.audioCodecUnsupported,(function(){_this.disabled=!0})),_this.on(EVENTS$1.volumechange,(function(volume,muted){_this._muted!==muted&&(_this.muted=muted),_this._lastVolume!==volume&&(_this.volume=volume)})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$m(subClass,superClass)}(Volume,Control);var _proto=Volume.prototype;return _proto.destroy=function(){var _this__progress_destroy,_this__progress,_this_picker;null==(_this__progress=this._progress)||null==(_this__progress_destroy=_this__progress.destroy)||_this__progress_destroy.call(_this__progress),this._progress=null,null==(_this_picker=this.picker)||_this_picker.destroy(),this.picker=null,Control.prototype.destroy.call(this)},_proto._toggleMute=function(){if(!this.disabled){var _this__options_props;if(0===this._lastVolume)return this.volume=(null==(_this__options_props=this._options.props)?void 0:_this__options_props.volume)||.5,void(this.muted=!1);this.muted?this.muted=!1:this.muted=!0}},_proto._updateUI=function(){var _this_locale,_this_locale1;(this._$content.classList.remove("ezplayer-icon-volume-muted"),this._$content.classList.remove("ezplayer-icon-volume-zero"),this._$content.classList.remove("ezplayer-icon-volume-low"),this._$content.classList.remove("ezplayer-icon-volume-high"),this._muted)?(this._volume=0,this._$content.classList.add("ezplayer-icon-volume-muted"),this._$content.setAttribute("title",(null==this||null==(_this_locale=this.locale)?void 0:_this_locale.BTN_MUTED)||"muted")):(this._$content.classList.remove("ezplayer-icon-volume-muted"),0===this._volume?this._$content.classList.add("ezplayer-icon-volume-zero"):this._volume<=.5?this._$content.classList.add("ezplayer-icon-volume-low"):this._$content.classList.add("ezplayer-icon-volume-high"),this._$content.setAttribute("title",(null==this||null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_VOLUME)||"volume"))},_proto._render=function(){var _this_locale;this.$container.innerHTML=IconComponents_volume({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_VOLUME})},_proto._onControlClick=function(){},_proto._addEventListener=function(){var _this=this;delegate(this.$container,".ezplayer-control-volume","mousedown",(function(){_this.$container.classList.contains("ezplayer-disabled")||_this._toggleMute()}))},_create_class$6(Volume,[{key:"muted",get:function(){return this._muted},set:function(muted){this._muted!==muted&&(muted?(this._volume=0,this._progress&&(this._progress.value=0)):(this._volume=this._lastVolume,this._progress&&(this._progress.value=this._lastVolume)),this._muted=muted,null==this._options.onChange||this._options.onChange.call(this._options,this.volume,muted),this.emit(EVENTS$1.control.volumechange,this.volume,muted)),this._updateUI()}},{key:"volume",get:function(){return this._lastVolume},set:function(volume){if(volume>=0&&volume<=1){var _volume=+volume.toFixed(2);this._lastVolume!==_volume&&(this._volume=_volume,this._lastVolume=this._volume,this._progress&&(this._progress.value=_volume),null==this._options.onChange||this._options.onChange.call(this._options,_volume,this._muted),this.emit(EVENTS$1.control.volumechange,_volume,this._muted)),this._updateUI()}}},{key:"disabled",get:function(){return this._disabled},set:function(disabled){this._disabled=disabled,this.picker&&(this.picker.disabled=disabled),this._updateDisabledState(disabled)}},{key:"_$content",get:function(){return this.$container.querySelector(".ezplayer-icon-volume")}}]),Volume}(Control);function asyncGeneratorStep$5$1(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$5$1(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$5$1(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$5$1(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _ts_generator$5(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var FULLSCREEN_DEFAULT={prefix:"ezplayer"},Provider$1=function(){function Provider(){this.fullscreens=[]}var _proto=Provider.prototype;return _proto.add=function(element,onChange){if(element){var index=this.fullscreens.findIndex((function(item){return item.element===element}));index>=0?(this.fullscreens[index].onChange||(this.fullscreens[index].onChange=[]),this.fullscreens[index].onChange.push(onChange)):this.fullscreens.push({element:element,onChange:[onChange]})}},_proto.getChanges=function(element){var item=this.fullscreens.find((function(item){return item.element===element}));return item&&(null==item?void 0:item.onChange)||[]},_proto.remove=function(element,onChange){var index=this.fullscreens.findIndex((function(item){return item.element===element}));if(index>=0){var _this_fullscreens_index_onChange,targetItem=null==(_this_fullscreens_index_onChange=this.fullscreens[index].onChange)?void 0:_this_fullscreens_index_onChange.find((function(item){return item===onChange}));if(targetItem){var _this_fullscreens_index_onChange1,changes=null==(_this_fullscreens_index_onChange1=this.fullscreens[index].onChange)?void 0:_this_fullscreens_index_onChange1.filter((function(change){return change!==targetItem}));this.fullscreens[index].onChange=changes}(!this.fullscreens[index].onChange||this.fullscreens[index].onChange&&0===this.fullscreens[index].onChange.length)&&this.fullscreens.splice(index,1)}},Provider.getInstance=function(){return Provider.instance||(Provider.instance=new Provider),Provider.instance},Provider}(),__fullscreenProvider__=Provider$1.getInstance(),Fullscreen$1=function(){function Fullscreen(container,options){void 0===options&&(options={}),this._isCurrentFullscreen=!1,this._isFullscreen=!1,this._currentFullscreenElementList=[],this.$container=container,this._options=Object.assign({},FULLSCREEN_DEFAULT,options),this._options.onChange&&Utils.isMobile&&__fullscreenProvider__.add(this.$container,this._options.onChange),this._isFullscreen=!!this._options.isFullscreen,this._fullscreenchange2=this._fullscreenchange2.bind(this),screenfull.isEnabled&&screenfull.on("change",this._fullscreenchange2)}var _proto=Fullscreen.prototype;return _proto.fullscreen=function(){return _async_to_generator$5$1((function(){return _ts_generator$5(this,(function(_state){switch(_state.label){case 0:return Utils.isMobile?(this._fullscreenchange(this.$container,!0),[3,3]):[3,1];case 1:return[4,screenfull.request(this.$container)];case 2:return[2,_state.sent()];case 3:return[2]}}))})).call(this)},_proto.exitFullscreen=function(){return _async_to_generator$5$1((function(){return _ts_generator$5(this,(function(_state){switch(_state.label){case 0:return Utils.isMobile?(this._fullscreenchange(this.$container,!1),[3,3]):[3,1];case 1:return this._isFullscreen?[4,screenfull.exit()]:[3,3];case 2:return[2,_state.sent()];case 3:return[2]}}))})).call(this)},_proto.toggle=function(){return _async_to_generator$5$1((function(){return _ts_generator$5(this,(function(_state){switch(_state.label){case 0:return Utils.isMobile?(this._fullscreenchange(this.$container,!this._isCurrentFullscreen),[3,3]):[3,1];case 1:return[4,screenfull.toggle(this.$container)];case 2:return[2,_state.sent()];case 3:return[2]}}))})).call(this)},_proto.destroy=function(){screenfull.isEnabled&&screenfull.off("change",this._fullscreenchange2),Utils.isMobile&&this._options.onChange&&__fullscreenProvider__.remove(this.$container,this._options.onChange),this._fullscreenchange2=null},_proto._fullscreenchange2=function(){this._fullscreenchange()},_proto._fullscreenchange=function(element,isFullscreen){var _this_$container,_this_$container1,_this_$container2,_this=this;if(this._isFullscreen=screenfull.isFullscreen,element)this._isCurrentFullscreen=!!isFullscreen,this._currentFullscreenElementList=[];else if(this._isFullscreen){var targetElement=screenfull.element,index1=this._currentFullscreenElementList.indexOf(targetElement);targetElement&&-1===index1?this._currentFullscreenElementList.unshift(targetElement):targetElement&&index1>=1&&this._currentFullscreenElementList.shift();var containerIndex=this._currentFullscreenElementList.indexOf(this.$container);this._isCurrentFullscreen=containerIndex>=0}else this._isCurrentFullscreen=!1,this._currentFullscreenElementList=[];this._isCurrentFullscreen?null==(_this_$container=this.$container)||_this_$container.classList.add(this._options.prefix+"-fullscreen"):(null==(_this_$container1=this.$container)||_this_$container1.classList.remove(this._options.prefix+"-fullscreen"),null==(_this_$container2=this.$container)||_this_$container2.classList.remove(this._options.prefix+"-global-fullscreen"));Utils.isMobile?__fullscreenProvider__.getChanges(this.$container).forEach((function(change){change({isCurrentFullscreen:_this._isCurrentFullscreen,isFullscreen:_this._isFullscreen,isMobile:Utils.isMobile})})):null==this._options.onChange||this._options.onChange.call(this._options,{isCurrentFullscreen:this._isCurrentFullscreen,isFullscreen:this._isFullscreen,isMobile:Utils.isMobile}),Utils.isMobile&&(this._isCurrentFullscreen?document.body.classList.add(this._options.prefix+"-body-mobile-noscroll"):document.body.classList.remove(this._options.prefix+"-body-mobile-noscroll"))},Fullscreen}();function _extends$l(){return _extends$l=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$l.apply(this,arguments)}function _set_prototype_of$l(o,p){return _set_prototype_of$l=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$l(o,p)}var Fullscreen=function(Control){function Fullscreen(options){var _this,_options_props,_this_options;if((_this=Control.call(this,_extends$l({tagName:"span",classNameSuffix:"fullscreen",controlType:"button"},options))||this).isCurrentFullscreen=!1,_this.options=options,_this.isCurrentFullscreen=!!(null==(_options_props=options.props)?void 0:_options_props.isCurrentFullscreen),_this._$rootContainer=null==(_this_options=_this.options)?void 0:_this_options.rootContainer,!_this._$rootContainer)throw new Error("Fullscreen option fullscreenContainer is required!");return _this._fullscreenChange=_this._fullscreenChange.bind(_this),_this._fullscreenUtil=new Fullscreen$1(_this._$rootContainer,{onChange:_this._fullscreenChange,isFullscreen:_this.isCurrentFullscreen}),_this._render(),_this._event(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$l(subClass,superClass)}(Fullscreen,Control);var _proto=Fullscreen.prototype;return _proto.destroy=function(){var _this__fullscreenUtil;this.$container.innerHTML="",null==(_this__fullscreenUtil=this._fullscreenUtil)||_this__fullscreenUtil.destroy(),this._fullscreenUtil=null,Control.prototype.destroy.call(this)},_proto._render=function(){var _this_locale,_this_locale1,_this_locale2;Utils.isMobile?this.$container.innerHTML=IconComponents_mobileFullscreen({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_FULLSCREEN}):this.$container.innerHTML=IconComponents_exitFullscreen({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_EXIT_FULLSCREEN})+IconComponents_fullscreen({title:null==(_this_locale2=this.locale)?void 0:_this_locale2.BTN_FULLSCREEN})},_proto._fullscreenChange=function(info){this.isCurrentFullscreen=info.isCurrentFullscreen,this._render(),null==this.options.onChange||this.options.onChange.call(this.options,info)},_proto._onControlClick=function(){var _this__fullscreenUtil,_this__fullscreenUtil1;this.isCurrentFullscreen?null==(_this__fullscreenUtil=this._fullscreenUtil)||_this__fullscreenUtil.exitFullscreen():null==(_this__fullscreenUtil1=this._fullscreenUtil)||_this__fullscreenUtil1.fullscreen()},_proto._event=function(){},Fullscreen}(Control);function _extends$k(){return _extends$k=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$k.apply(this,arguments)}function _set_prototype_of$k(o,p){return _set_prototype_of$k=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$k(o,p)}var Rec=function(Control){function Rec(options){var _this,_options_props;return(_this=Control.call(this,_extends$k({},options,{tagName:"div",controlType:"block",classNameSuffix:"rec"}))||this)._options=options,_this.recType=(null==(_options_props=options.props)?void 0:_options_props.recType)||"rec",_this._onClickIcon(),_this._onDBlClick=_this._onDBlClick.bind(_this),_this.$container.addEventListener("dblclick",_this._onDBlClick),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$k(subClass,superClass)}(Rec,Control);var _proto=Rec.prototype;return _proto.destroy=function(){var _this__delegation;this.$container.removeEventListener("dblclick",this._onDBlClick),null==(_this__delegation=this._delegation)||_this__delegation.destroy(),this._delegation=null,Control.prototype.destroy.call(this)},_proto.addRecType=function(id){var spanIcon="";switch(id){case"rec":var _this_locale;spanIcon=IconComponents_sdk({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_REC,"data-type":"rec"});break;case"cloudRec":var _this_locale1;spanIcon=IconComponents_cloudRec({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_CLOUDREC,"data-type":"cloudRec"});break;case"cloudRecord":var _this_locale2;spanIcon=IconComponents_cloudRecord({title:null==(_this_locale2=this.locale)?void 0:_this_locale2.BTN_CLOUDRECORD,"data-type":"cloudRecord"})}if(spanIcon){var innerHTML=this.$container.innerHTML;this.$container.innerHTML=innerHTML+spanIcon,this._activeIcon(this.recType)}},_proto._activeIcon=function(type){switch(this.$container.querySelectorAll(".ezplayer-icon").forEach((function($item){$item.classList.remove("ezplayer-active")})),type){case"rec":var _this_$container_querySelector;null==(_this_$container_querySelector=this.$container.querySelector(".ezplayer-icon-sdk"))||_this_$container_querySelector.classList.add("ezplayer-active");break;case"cloudRec":var _this_$container_querySelector1;null==(_this_$container_querySelector1=this.$container.querySelector(".ezplayer-icon-cloud-rec"))||_this_$container_querySelector1.classList.add("ezplayer-active");break;case"cloudRecord":var _this_$container_querySelector2;null==(_this_$container_querySelector2=this.$container.querySelector(".ezplayer-icon-cloud-record"))||_this_$container_querySelector2.classList.add("ezplayer-active")}},_proto._onClickIcon=function(){var _this=this;this._delegation=delegate(this.$container,".ezplayer-icon","click",(function(e){var target=e.delegateTarget;if(!target.classList.contains("ezplayer-disabled")){var type=target.getAttribute("data-type");_this.recType!==type&&(_this.recType=type,_this._activeIcon(type),_this.emit(EVENTS$1.control.recTypeChange,type),null==_this._options.onChange||_this._options.onChange.call(_this._options,type))}}))},_proto._onControlClick=function(e){},Rec}(Control),zh={391001:"取流地址或端口非法",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",399030:"取流失败,请重试",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍等...",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为0.5倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_AUTO:"自动",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_STANDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SUPER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放",BTN_PAUSE:"结束播放",BTN_VOLUME:"声音",BTN_MUTED:"静音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_GLOBAL_FULLSCREEN:"全局全屏",BTN_EXIT_GLOBAL_FULLSCREEN:"退出全局全屏",BTN_FULLSCREEN:"全屏",BTN_EXIR_FULLSCREEN:"退出全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",BTN_CALENDAR:"日历",BTN_MORE:"更多",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数{{zoom}}X",ZOOM_SUB_MIN:"已经缩小到最小倍数{{zoom}}X",ZOOM_LIMIT_MAX:"超出最大倍率{{zoom}}X",ZOOM_LIMIT_MIN:"超出最小倍率{{zoom}}X",ZOOM_NOT_ENABLED:"放大未开启","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印",FETCH_THEME_FAILED:"获取主题模板失败",cancel:"取消",ok:"确定",close:"关闭"},en={391001:"Illegal streaming address or port",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399030:"Stream retrieval failed, please try again",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"loading...",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 0.5 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_AUTO:"Auto",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_STANDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SUPER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play",BTN_PAUSE:"Pause",BTN_VOLUME:"Volume",BTN_MUTED:"Muted",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_GLOBAL_FULLSCREEN:"Global fullscreen",BTN_EXIT_GLOBAL_FULLSCREEN:"Exit global fullscreen",BTN_FULLSCREEN:"Fullscreen",BTN_EXIR_FULLSCREEN:"Exit fullscreen",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",BTN_CALENDAR:"Calendar",BTN_MORE:"More",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of {{zoom}}X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of {{zoom}}X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of {{zoom}}X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of {{zoom}}X",ZOOM_NOT_ENABLED:"Zoom not enabled","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark",FETCH_THEME_FAILED:"Failed to fetch theme template",cancel:"Cancel",ok:"Ok",close:"Close"},LiveTemplate={autoFocus:3,footer:{btnList:[{iconId:"play",part:"left",isrender:1},{iconId:"volume",part:"left",defaultActive:1,isrender:1},{iconId:"fullscreen",part:"right",defaultActive:0,isrender:1},{iconId:"globalFullscreen",part:"right",defaultActive:0,isrender:1}]}},TEMPLATES={pcLive:{autoFocus:3,header:{btnList:[{iconId:"deviceID",part:"left",isrender:1},{iconId:"deviceName",part:"left",isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",isrender:1},{iconId:"capturePicture",part:"left",isrender:1},{iconId:"sound",part:"left",isrender:1},{iconId:"pantile",part:"left",isrender:1},{iconId:"recordvideo",part:"left",isrender:1},{iconId:"talk",part:"left",isrender:1},{iconId:"zoom",part:"left",isrender:1},{iconId:"hd",part:"right",isrender:1},{iconId:"webExpend",part:"right",isrender:1},{iconId:"expend",part:"right",isrender:1}]}},pcRec:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}},mobileLive:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}},mobileRec:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}},security:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}},voice:{header:{btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1}]},footer:{btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1}]}}};function _set_prototype_of$j(o,p){return _set_prototype_of$j=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$j(o,p)}var Content=function(EventEmitter){function Content(options){var _this;((_this=EventEmitter.call(this)||this)._scaleMode=0,_this._originWidth=0,_this._originHeight=0,_this._width=0,_this._height=0,_this.options=options,_this._scaleMode=options.scaleMode||0,_this.$wrapper=document.createElement("div"),_this.$wrapper.className="ezplayer-content-wrapper",_this.$content=document.createElement("div"),_this.$content.className="ezplayer-content",_this.$video=document.createElement("div"),_this.$video.className="ezplayer-content-video",_this.$content.appendChild(_this.$video),_this.$wrapper.appendChild(_this.$content),"function"==typeof options.getContainer)&&options.getContainer().appendChild(_this.$wrapper);return _this.on(EVENTS$1.videoInfo,(function(originWidth,originHeight){_this._rerender(originWidth,originHeight)})),_this.on(EVENTS$1.resize,(function(){_this._rerender()})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$j(subClass,superClass)}(Content,EventEmitter);var _proto=Content.prototype;return _proto._rerender=function(originWidth,originHeight){void 0===originWidth&&(originWidth=0),void 0===originHeight&&(originHeight=0);var width=this.$wrapper.clientWidth,height=this.$wrapper.clientHeight;if(this._width!==width||this._height!==height||this._originWidth!==originWidth||this._originHeight!==originHeight){this._width=width,this._height=height,originWidth>0&&originHeight>0&&(this._originWidth=originWidth,this._originHeight=originHeight);var objectFill="contain";if(this._scaleMode===THEME_SCALE_MODE_TYPE_full&&(objectFill="fill"),this._scaleMode===THEME_SCALE_MODE_TYPE_fullAuto&&(objectFill="cover"),width>0&&height>0&&this._originWidth>0&&this._originHeight>0&&this.$video){var left=(width-this._originWidth)/2,top=(height-this._originHeight)/2,wScale=width/this._originWidth,hScale=height/this._originHeight,scale=wScale>hScale?hScale:wScale;this._scaleMode!==THEME_SCALE_MODE_TYPE_auto&&wScale!==hScale&&(scale=wScale+","+hScale),this._scaleMode===THEME_SCALE_MODE_TYPE_fullAuto&&(scale=wScale>hScale?wScale:hScale),this.$video.style.cssText+="\n width: "+this._originWidth+"px;\n height: "+this._originHeight+"px;\n position: absolute;\n object-fit:"+objectFill+";\n left: "+left+"px;\n top: "+top+"px;\n transform-origin: 50% 50%;\n transform: scale("+scale+");\n ",this.emit(EVENTS$1.control.contentRerender,{scaleMode:this._scaleMode,objectFill:objectFill,scale:scale,width:this._originWidth,height:this._originHeight})}}},_proto.setScaleMode=function(scaleMode){void 0===scaleMode&&(scaleMode=0),this._scaleMode=scaleMode,this._rerender()},_proto.destroy=function(){var _this_$wrapper;this.$video&&(this.$video.remove(),this.$video=null),this.$content&&(this.$content.remove(),this.$content=null),null==(_this_$wrapper=this.$wrapper)||_this_$wrapper.remove(),this.$wrapper=null,this.emit(EVENTS$1.control.contentDestroy),this.removeAllListeners()},Content}(EventEmitter$1);function _extends$j(){return _extends$j=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$j.apply(this,arguments)}function _set_prototype_of$i(o,p){return _set_prototype_of$i=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$i(o,p)}var More=function(Control){function More(options){var _this;return(_this=Control.call(this,_extends$j({},options,{tagName:"span",controlType:"button",classNameSuffix:"more"}))||this).list=[],_this.options=options,_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$i(subClass,superClass)}(More,Control);var _proto=More.prototype;return _proto._render=function(){var _this_locale,_this_locale1,_this=this;this.$container.innerHTML=Utils.isMobile?IconComponents_more({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_MORE}):IconComponents_moreDot({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_MORE}),this.picker=new Picker(this.$container,{getPopupContainer:function(){return _this.$container},trigger:Utils.isMobile?"click":"hover",wrapClassName:"ezplayer-more "+this.options.wrapClassName,open:!!this.options.open,isMobile:!1,offset:this.options.offset||[0,0],placement:this.options.placement||"tr",onOpenChange:this.options.onOpenChange}),this.picker.$body&&(this.$panel=document.createElement("div"),this.$panel.classList.add("ezplayer-more-panel"),this.picker.$body.appendChild(this.$panel),this.picker.$body.addEventListener("dblclick",this._onDBlClick))},_proto.add=function(key,part,control){this.list.unshift({part:part,key:key,control:control})},_proto.remove=function(control){var index=this.list.findIndex((function(item){return item.control===control}));-1!==index&&this.list.splice(index,1)},_proto.destroy=function(){var _this_picker_$body;(this.list=[],this.picker)&&(null==(_this_picker_$body=this.picker.$body)||_this_picker_$body.removeEventListener("dblclick",this._onDBlClick),this.picker.destroy(),this.picker=null);Control.prototype.destroy.call(this)},_proto._onControlClick=function(e){},More}(Control);function debounce(func,wait){var timeout;return function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];var context=this;clearTimeout(timeout),timeout=setTimeout((function(){return func.apply(context,args)}),wait)}}var ignoreList$1=[EVENTS$1.getOSDTime,EVENTS$1.setAllDayRecTimes,EVENTS$1.talkVolumeChange];function _bindEventLogger(theme,events){Object.values(events).forEach((function(eventName){var typedEventName=eventName;ignoreList$1.includes(typedEventName)||("string"==typeof typedEventName?theme.on(typedEventName,(function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];try{theme.logger.log("[Event]",typedEventName,JSON.stringify(args))}catch(error){var _theme_logger;(_theme_logger=theme.logger).warn.apply(_theme_logger,[].concat(["[Event]",typedEventName],args))}})):"[object Object]"===Object.prototype.toString.call(typedEventName)&&_bindEventLogger(theme,eventName))}))}function _create_class$5(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$i(){return _extends$i=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$i.apply(this,arguments)}function _set_prototype_of$h(o,p){return _set_prototype_of$h=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$h(o,p)}var dist$2,hasRequiredDist$2,ZOOM_DEFAULT_OPTIONS={open:!1,max:8},Zoom$1=function(Control){function Zoom(options){var _this;return(_this=Control.call(this,_extends$i({},options,{tagName:"span",controlType:"button",classNameSuffix:"zoom"}))||this)._value=1,_this._isRotated=!1,_this._options=Object.assign({},ZOOM_DEFAULT_OPTIONS,options||{}),_this._render(),_this.emit(EVENTS$1.zoomChange,(function(zoom){_this._progress&&(_this.value=zoom)})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$h(subClass,superClass)}(Zoom,Control);var _proto=Zoom.prototype;return _proto._render=function(){var _this_locale,_this__options_rootContainer,_this__options_props,_this__options_props1,_this=this;this.$container.innerHTML=IconComponents_zoom({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_ZOOM}),this._$zoomPanel=document.createElement("div"),this._$zoomPanel.className="ezplayer-zoom-panel ezplayer-hide",null==(_this__options_rootContainer=this._options.rootContainer)||_this__options_rootContainer.appendChild(this._$zoomPanel);var max=this._options.max<=1?8:Math.floor(this._options.max);this._isRotated=!!(null==(_this__options_props=this._options.props)?void 0:_this__options_props.isCurrentFullscreen)&&[0,180].includes(null==(_this__options_props1=this._options.props)?void 0:_this__options_props1.orientationAngle),this._progress=new Progress({container:this._$zoomPanel,defaultValue:1,range:[1,max],step:1,showMinus:!0,showPlus:!0,showPercent:!0,isRotated:this._isRotated,onChange:function(value,percent,range){value!==_this._value&&(_this._value=value,null==_this._options.onChange||_this._options.onChange.call(_this._options,value,percent,range),_this.emit(EVENTS$1.control.zoomChange,value,percent,range))},renderText:function(value){return value+"X"}})},_proto.reset=function(hide){var _this__$zoomPanel_classList,_this__$zoomPanel;this.active&&(null==(_this__$zoomPanel=this._$zoomPanel)||null==(_this__$zoomPanel_classList=_this__$zoomPanel.classList)||_this__$zoomPanel_classList.add("ezplayer-hide"),this._progress.value=1,this.active=!1,Control.prototype.reset.call(this,hide))},_proto.destroy=function(){var _this__options_rootContainer;this._options.rootContainer&&this._$zoomPanel&&(null==(_this__options_rootContainer=this._options.rootContainer)||_this__options_rootContainer.removeChild(this._$zoomPanel),this._$zoomPanel=null);Control.prototype.destroy.call(this)},_proto._onControlClick=function(e){this.active=!this.active,Control.prototype._onControlClick.call(this,e)},_create_class$5(Zoom,[{key:"value",get:function(){return this._value},set:function(value){this._progress&&this._value!==value&&(this._progress.value=value,this._value=value)}},{key:"active",get:function(){return this._active},set:function(active){var _this__$zoomPanel_classList,_this__$zoomPanel,_this__$zoomPanel_classList1,_this__$zoomPanel1;(this._active=active,this._updateActiveState(active),this.active)?(null==(_this__$zoomPanel=this._$zoomPanel)||null==(_this__$zoomPanel_classList=_this__$zoomPanel.classList)||_this__$zoomPanel_classList.remove("ezplayer-hide"),this.emit(EVENTS$1.control.zoomPanelOpenChange,!0)):(null==(_this__$zoomPanel1=this._$zoomPanel)||null==(_this__$zoomPanel_classList1=_this__$zoomPanel1.classList)||_this__$zoomPanel_classList1.add("ezplayer-hide"),this._progress.value=1,this.emit(EVENTS$1.control.zoomPanelOpenChange,!1))}},{key:"isRotated",get:function(){return this._isRotated},set:function(rotated){this._progress&&this._progress.isRotate(rotated)}}]),Zoom}(Control);function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}
18
18
  /*
19
19
  * @ezuikit/control-zoom v0.0.2
20
20
  * Copyright (c) 2025-11-12 Ezviz-OpenBiz
21
21
  * Released under the MIT License.
22
- */var sn=function(){if(nn)return tn;function e(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}nn=1;var t=[0,0],n={initialZoom:1,defaultCursor:"pointer",scrollVelocity:.1,animDuration:.25,allowZoom:!0,allowPan:!0,onChange:function(){},onTranslateChange:function(){},onTap:function(){},max:8,min:1,zoomStep:.1,allowTouchEvents:!1,allowWheel:!0,ignoredMouseButtons:[],doubleTouchMaxDelay:300,decelerationDuration:750},i=function(){function i(e,i){var r=this;this._dragging=!1,this.destroy=function(){r.setAllowZoom(!1),r.reset(),r.removeEventListeners()},this.setTransform=function(e){r.transform=e},this.getTransform=function(){return r.transform},this.updateTranslate=function(){var e=0,t=0;e=r.percentPos[0]<0?r.percentPos[0]<-.5*(r.zoom-1)?-.5*(r.zoom-1):r.percentPos[0]:r.percentPos[0]>.5*(r.zoom-1)?.5*(r.zoom-1):r.percentPos[0],t=r.percentPos[1]<0?r.percentPos[1]<-.5*(r.zoom-1)?-.5*(r.zoom-1):r.percentPos[1]:r.percentPos[1]>.5*(r.zoom-1)?.5*(r.zoom-1):r.percentPos[1],r.percentPos=[e,t]},this.update=function(){r.container&&(r.updateTranslate(),r.container.style.transition="transform ease-out "+r.transition+"s",r.container.style.transform="translate3d("+100*r.percentPos[0]+"%, "+100*r.percentPos[1]+"%, 0) scale("+r.zoom+")")},this.setAllowZoom=function(e){r.options.allowZoom=e},this.setZoom=function(e,t){e=parseFloat(e.toFixed(r.getPrecision(r.options.zoomStep))),r.zoom!==e&&(r.zoom=e,r.update(),null==r.options.onChange||r.options.onChange.call(r.options,+r.zoom.toFixed(r.getPrecision(r.options.zoomStep)),t))},this.getZoom=function(){return r.zoom},this.setPos=function(e){var t,n,i=null==(t=r.container)?void 0:t.clientWidth,o=null==(n=r.container)?void 0:n.clientHeight;+r.pos[0]===e[0]&&+r.pos[1]===e[1]||(r.percentPos=[e[0]/i,e[1]/o],r.update(),null==r.options.onTranslateChange||r.options.onTranslateChange.call(r.options,{posX:e[0],posY:e[1]}))},this.setTransitionDuration=function(e){r.transition=e,r.update()},this.setCursor=function(e){r.container&&(r.container.style.cssText+="cursor:"+e+";",r.cursor=e)},this.zoomIn=function(e){var t,n,i=r.pos[0],o=r.pos[1],a=r.zoom,s=a+e<(null!=(t=r.options.max)?t:8)?a+e:null!=(n=r.options.max)?n:8;s!==a&&(i=i*(s-1)/(a>1?a-1:a),o=o*(s-1)/(a>1?a-1:a)),r.setZoom(s),r.setPos([i,o]),r.setTransitionDuration(r.options.animDuration)},this.zoomOut=function(e){var t,n,i=r.pos[0],o=r.pos[1],a=r.zoom,s=a-e>(null!=(t=r.options.min)?t:1)?a-e:null!=(n=r.options.min)?n:1;s!==a&&(i=i*(s-1)/(a-1),o=o*(s-1)/(a-1)),r.setZoom(s),r.setPos([i,o]),r.setTransitionDuration(r.options.animDuration)},this.zoomToZone=function(e,t,n,i){var o;if(r.container){var a,s=r.pos[0],l=r.pos[1],c=(null==(o=r.container)?void 0:o.parentNode).getBoundingClientRect(),d=r.zoom,u=c.width/n,p=c.height/i,h=Math.min(u,p,null!=(a=r.options.max)?a:8),m=r.container.getBoundingClientRect(),A=[m.width/d/2,m.height/d/2],f=[e+n/2,t+i/2];s=(A[0]-f[0])*h,l=(A[1]-f[1])*h,r.setZoom(h),r.setPos([s,l]),r.setTransitionDuration(r.options.animDuration)}},this.getNewPosition=function(e,n,i){var o=[r.zoom,r.pos[0],r.pos[1]][0];if(1===i||!r)return t;var a=[r.container.clientWidth,r.container.clientHeight],s=a[0],l=a[1];if(i>o)return[0,0];var c=-(e-s/2)/(s/2)*i/2,d=-(n-l/2)/(l/2)*i/2;return c>i/2-.5&&(c=3.5),d>i/2-.5&&(d=3.5),[s*c,l*d]},this.fullZoomInOnPosition=function(e,t){var i,o=null!=(i=r.options.max)?i:n.max;r.setZoom(null!=o?o:n.max),r.setPos(r.getNewPosition(e,t,o)),r.setTransitionDuration(r.options.animDuration)},this.getLimitedShift=function(e,t,n,i,r){if(e>0){if(i>t)return 0;if(i+e>t)return t-i}else if(e<0){if(r<n)return 0;if(r+e<n)return n-r}return e},this.getCursor=function(e,t){return e&&t?"move":e?"ew-resize":t?"ns-resize":"auto"},this.move=function(e,t,n){if(void 0===n&&(n=0),r.container){var i=r.pos[0],o=r.pos[1],a=r.container.getBoundingClientRect(),s=r.container.parentNode.getBoundingClientRect(),l=r.transform?t:e,c=r.transform?e:t,d=r.transform?[a.height>s.bottom-s.top,c>0&&a.top-s.top<0,c<0&&a.bottom-s.bottom>0]:[a.width>s.right-s.left,l>0&&a.left-s.left<0,l<0&&a.right-s.right>0],u=d[0]||d[1]||d[2];u&&(r.transform?i+=r.getLimitedShift(c,s.top,s.bottom,a.top,a.bottom):i+=r.getLimitedShift(l,s.left,s.right,a.left,a.right));var p=r.transform?[a.width>s.right-s.left,l>0&&a.right-s.right<0,l<0&&a.left-s.left>0]:[a.height>s.bottom-s.top,c>0&&a.top-s.top<0,c<0&&a.bottom-s.bottom>0],h=p[0]||p[1]||p[2];if(h)if(r.transform){o+=function(e,t,n,i,r){if(e>0){if(r<n+1)return 0;if(r+e<n+1)return n-r}else if(e<0){if(i+1>t)return 0;if(i+1+e>t)return t-i}return e}(l,s.left,s.right,a.left,a.right)}else o+=r.getLimitedShift(c,s.top,s.bottom,a.top,a.bottom);var m=r.getCursor(u,h);r.setPos([i,o]),r.setCursor(m),r.setTransitionDuration(n)}},this.isDoubleTapping=function(){var e,t,n,i,o=(new Date).getTime();return o-(null!=(e=r.lastTouchTime)?e:0)<(null!=(t=r.options.doubleTouchMaxDelay)?t:300)&&o-(null!=(n=r.lastDoubleTapTime)?n:0)>(null!=(i=r.options.doubleTouchMaxDelay)?i:750)?(r.lastDoubleTapTime=o,!0):(r.lastTouchTime=o,!1)},this.startDeceleration=function(e,t){var n=null,i=function(o){null===n&&(n=o);var a,s,l,c=o-n,d=((null!=(a=r.options.decelerationDuration)?a:750)-c)/(null!=(s=r.options.decelerationDuration)?s:750),u=[e*d,t*d],p=u[0],h=u[1];c<(null!=(l=r.options.decelerationDuration)?l:750)&&Math.max(Math.abs(p),Math.abs(h))>1?(r.move(p,h,0),r.lastRequestAnimationId=requestAnimationFrame(i)):r.lastRequestAnimationId=null};r.lastRequestAnimationId=requestAnimationFrame(i)},this.reset=function(){r.setZoom(r.options.initialZoom,!0),r.cursor=r.options.defaultCursor,r.setTransitionDuration(r.options.animDuration),r.setPos(t)},this.addScale=function(e){void 0===e&&(e=1),r.handleZoomAdd(e)},this.handleZoomAdd=function(e){if(void 0===e&&(e=1),r.options.allowZoom&&r.options.allowWheel){var t,n=parseFloat((r.zoom+e).toFixed(r.getPrecision(r.options.zoomStep)));n>(null!=(t=r.options.max)?t:8)&&(n=8),r.setZoom(n),r.setPos(r.pos),r.setTransitionDuration(.05)}},this.subScale=function(e){void 0===e&&(e=1),r.handleZoomSub(e)},this.handleZoomSub=function(e){if(void 0===e&&(e=1),r.options.allowZoom&&r.options.allowWheel){var t=parseFloat((r.zoom-e).toFixed(r.getPrecision(r.options.zoomStep)));t<1&&(t=1),r.setZoom(t),r.setPos(r.pos),r.setTransitionDuration(.05)}},this.handleMouseWheel=function(e){if(e.preventDefault(),r.options.allowZoom&&r.options.allowWheel){var t,n,i=e.deltaY<0?r.options.scrollVelocity:0-r.options.scrollVelocity,o=parseFloat(Math.max(Math.min(r.zoom+i,null!=(t=r.options.max)?t:8),null!=(n=r.options.min)?n:1).toFixed(r.getPrecision(r.options.zoomStep)));r.setZoom(o),r.setTransitionDuration(.05)}},this.handleMouseStart=function(e){var t;e.preventDefault(),r.options.allowPan&&!(null==(t=r.options.ignoredMouseButtons)?void 0:t.includes(e.button))&&(r._dragging=!0,r.lastRequestAnimationId&&cancelAnimationFrame(r.lastRequestAnimationId),r.lastCursor=r.getCoordinates(e))},this.handleMouseMove=function(e){e.preventDefault(),r.options.allowPan&&r.lastCursor&&r._dragging&&r._touchOrMouseDrag(e)},this.handleMouseStop=function(e){e.preventDefault(),r.lastShift&&(r.startDeceleration(r.lastShift[0],r.lastShift[1]),r.lastShift=null),r.lastCursor=null,r.setCursor("auto"),r._dragging=!1},this.handleTouchStart=function(e){var t=r.isDoubleTapping();r.isMultiTouch=e.touches.length,r.options.allowTouchEvents||e.preventDefault(),r.lastRequestAnimationId&&cancelAnimationFrame(r.lastRequestAnimationId);var n=r.getCoordinates(e.touches[0]),i=n[0],o=n[1];if(r.isMultiTouch>1)r.lastCursor=[i,o];else if(t&&r.options.allowZoom)if(1===r.zoom){var a=r.container.getBoundingClientRect();a.top,a.left;var s,l,c=a.x,d=a.y;i=(l=[i-(c=(s=r.transform?[d,c]:[c,d])[0]),o-(d=s[1])])[0],o=l[1],r.fullZoomInOnPosition(i,o)}else r.reset();else r._tapStartTime=(new Date).getTime(),r.options.allowPan&&(r.lastCursor=[i,o])},this.handleTouchMove=function(e){if(r.options.allowTouchEvents||e.preventDefault(),r.lastCursor)if(1===r.isMultiTouch)r._touchOrMouseDrag(e.touches[0]),r.lastTouchDistance=null;else if(r.isMultiTouch>1){var t=r.zoom,n=r.getCoordinates(e.touches[0]),i=n[0],o=n[1],a=r.getCoordinates(e.touches[1]),s=a[0],l=a[1],c=Math.sqrt(Math.pow(s-i,2)+Math.pow(l-o,2));if(r.lastTouchDistance&&c&&c!==r.lastTouchDistance){var d,u,p;if(r.options.allowZoom)if((t+=(c-r.lastTouchDistance)/100)>(null!=(d=r.options.max)?d:8))t=null!=(p=r.options.max)?p:8;else if(t<(null!=(u=r.options.min)?u:1)){var h;t=null!=(h=r.options.min)?h:1}r.setZoom(t),r.setTransitionDuration(0)}r.lastCursor=[i,o],r.lastTouchDistance=c}},this.handleTouchStop=function(){r.lastShift&&(r.startDeceleration(r.lastShift[0],r.lastShift[1]),r.lastShift=null),r._tapStartTime&&(new Date).getTime()-r._tapStartTime<200&&(null==r.options.onTap||r.options.onTap.call(r.options)),r._tapStartTime=void 0,r.lastCursor=null,r.lastTouchDistance=null,r.isMultiTouch=0},this.container=e,this.options=Object.assign({},n,i||{}),this.percentPos=t,this.transition=this.options.animDuration,this.zoom=1,this.cursor="auto",this.lastCursor=[0,0],this.lastShift=null,this.lastTouchDistance=null,this.lastRequestAnimationId=null,this.lastTouchTime=(new Date).getTime(),this.lastDoubleTapTime=(new Date).getTime(),this.transform=!1,this.isMultiTouch=1,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseStart=this.handleMouseStart.bind(this),this.handleMouseStop=this.handleMouseStop.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchStop=this.handleTouchStop.bind(this),this.getZoom=this.getZoom.bind(this),this.setZoom=this.setZoom.bind(this)}var r=i.prototype;return r.setUpEventListeners=function(){var e=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==e||e.addEventListener("wheel",this.handleMouseWheel,{passive:!1})),null==e||e.addEventListener("mousedown",this.handleMouseStart,{passive:!1}),null==e||e.addEventListener("mousemove",this.handleMouseMove,{passive:!1}),null==e||e.addEventListener("mouseup",this.handleMouseStop,{passive:!1}),null==e||e.addEventListener("mouseleave",this.handleMouseStop,{passive:!1})):(null==e||e.addEventListener("touchstart",this.handleTouchStart,{passive:!1}),null==e||e.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),null==e||e.addEventListener("touchend",this.handleTouchStop,{passive:!1}),null==e||e.addEventListener("touchcancel",this.handleTouchStop,{passive:!1}))},r.removeEventListeners=function(){var e=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==e||e.removeEventListener("wheel",this.handleMouseWheel)),null==e||e.removeEventListener("mousedown",this.handleMouseStart),null==e||e.removeEventListener("mousemove",this.handleMouseMove),null==e||e.removeEventListener("mouseup",this.handleMouseStop),null==e||e.removeEventListener("mouseleave",this.handleMouseStop)):(null==e||e.removeEventListener("touchstart",this.handleTouchStart),null==e||e.removeEventListener("touchmove",this.handleTouchMove),null==e||e.removeEventListener("touchend",this.handleTouchStop),null==e||e.removeEventListener("touchcancel",this.handleTouchStop))},r.getPrecision=function(e){void 0===e&&(e=1);var t=e.toString();return t.includes(".")?t.split(".")[1].length:1},r.getCoordinates=function(e){var t=this.container.clientHeight,n=this.container.clientTop,i=this.container.clientLeft,r=this.transform?[e.clientY,t-e.clientX]:[e.clientX-n,e.clientY-i];return[r[0],r[1]]},r._touchOrMouseDrag=function(e){if(this.lastCursor){var t=this.getCoordinates(e),n=t[0],i=t[1],r=n-this.lastCursor[0],o=i-this.lastCursor[1];this.move(r,o,0),this.lastCursor=[n,i],this.lastShift=[r,o]}},e(i,[{key:"pos",get:function(){return[this.container.clientWidth*this.percentPos[0],this.container.clientHeight*this.percentPos[1]]}}]),i}();return i.VERSION="0.0.2",tn=i}(),ln=an(sn);function cn(){return cn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},cn.apply(this,arguments)}function dn(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function un(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){dn(o,i,r,a,s,"next",e)}function s(e){dn(o,i,r,a,s,"throw",e)}a(void 0)}))}}function pn(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function hn(e,t){return un((function(){var n,i,r;return pn(this,(function(o){switch(o.label){case 0:return r=e.options.env.domain+"/api/service/media/template/getDetail?accessToken="+(e.options.accessToken||(null==(i=e.options.token)||null==(n=i.httpToken)?void 0:n.url))+"&id="+t,[4,fetch(r,{method:"GET"}).then((function(e){return un((function(){return pn(this,(function(t){switch(t.label){case 0:return[4,e.json()];case 1:return[2,t.sent()]}}))}))()})).then((function(e){if(e.meta){var t,n,i,r;if((null==(n=e.data)||null==(t=n.footer)?void 0:t.btnList)&&gt.isMobile)null==(r=e.data)||null==(i=r.footer)||i.btnList.forEach((function(t,n){var i,r;"webExpend"===t.iconId?(null==(r=e.data)||null==(i=r.footer)?void 0:i.btnList)[n]={}:"expend"===t.iconId&&(t.iconId="webExpend")}));return e.data||null}return null}))];case 1:return[2,o.sent()]}}))}))()}function mn(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function An(){return An=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},An.apply(this,arguments)}function fn(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var vn={sound:"volume",webExpend:"fullscreen",expend:"globalFullscreen",pantile:"ptz",recordvideo:"record",hd:"definition"};function gn(e){return[e.filter((function(e){return"left"===e.part})),e.filter((function(e){return"right"===e.part}))]}function yn(e,t){return(n=function(){var n,i,r;return fn(this,(function(o){switch(o.label){case 0:return n=t,"string"==typeof t&&t.length<32?"simple"===t?[2,null]:(n=Vt[t],t||(null==(i=e.logger)||i.warn("Theme template "+t+" is not exist!"),n=null),[2,n]):[3,1];case 1:if("string"!=typeof t||32!==t.length)return[3,6];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,hn(e,t)];case 3:return(r=o.sent())?[2,r]:(e.emit(B.message,e.i18n.t("FETCH_THEME_FAILED"),"themeError"),[3,5]);case 4:return o.sent(),e.emit(B.message,e.i18n.t("FETCH_THEME_FAILED"),"themeError"),[3,5];case 5:return[3,7];case 6:return"[object Object]"===Object.prototype.toString.call(t)?[2,t]:[2,null];case 7:return[2]}}))},function(){var e=this,t=arguments;return new Promise((function(i,r){var o=n.apply(e,t);function a(e){mn(o,i,r,a,s,"next",e)}function s(e){mn(o,i,r,a,s,"throw",e)}a(void 0)}))})();var n}function Tn(e,t){void 0===t&&(t=.8);return/^#([A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)?function(e,t){return void 0===t&&(t=.8),3!==(e=e.replace(/^#/,"")).length&&4!==e.length||(e=e.split("").map((function(e){return e+e})).join("")),"rgba("+parseInt(e.substring(0,2),16)+", "+parseInt(e.substring(2,4),16)+", "+parseInt(e.substring(4,6),16)+", "+t+")"}(e,t):/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d.]+)?\s*\)$/.test(e)?function(e,t){void 0===t&&(t=.8);var n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)\)/);return n?"rgba("+n[1]+", "+n[2]+", "+n[3]+", "+t+")":""}(e,t):""}var _n=function(){function e(e){if(void 0===e&&(e={}),this._options=e,this.$container=document.createElement("div"),this._defaultClass=x+"-"+this._options.cType,this._options.cType&&this.$container.classList.add(this._defaultClass),(null==e?void 0:e.className)&&this.$container.classList.add(e.className),(null==e?void 0:e.color)&&(this.$container.style.cssText+="--"+x+"-default-color: "+e.color+";"),(null==e?void 0:e.activeColor)&&(this.$container.style.cssText+="--"+x+"-active-color: "+e.activeColor+";"),null==e?void 0:e.backgroundColor){var t=Tn(null==e?void 0:e.backgroundColor);t?"header"===this._options.cType?t="background: linear-gradient(0deg, transparent 0, "+t+");":"footer"===this._options.cType&&(t="background: linear-gradient(180deg, transparent 0, "+t+");"):t="background: "+(null==e?void 0:e.backgroundColor)+";",this.$container.style.cssText+=t+";"}e.getPopupContainer?this.$popupContainer=null==e.getPopupContainer?void 0:e.getPopupContainer.call(e):this.$popupContainer=document.body,this.$left=document.createElement("div"),this.$left.classList.add(this._defaultClass+"-left"),this.$right=document.createElement("div"),this.$right.classList.add(this._defaultClass+"-right"),this.$container.appendChild(this.$left),this.$container.appendChild(this.$right),this.$popupContainer.appendChild(this.$container)}return e.prototype.destroy=function(){var e;null==(e=this.$popupContainer)||e.removeChild(this.$container)},e}();function bn(){return bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},bn.apply(this,arguments)}function Cn(e,t){return Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Cn(e,t)}var Sn=function(e){function t(t){return void 0===t&&(t={}),e.call(this,bn({},t,{cType:"footer"}))||this}return 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&&Cn(e,t)}(t,e),t}(_n);function En(){return En=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},En.apply(this,arguments)}function wn(e,t){return wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wn(e,t)}var kn=function(e){function t(t){return void 0===t&&(t={}),e.call(this,En({},t,{cType:"header"}))||this}return 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&&wn(e,t)}(t,e),t}(_n);function Pn(){return Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Pn.apply(this,arguments)}function Dn(e,t){return Dn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Dn(e,t)}var Ln=function(e){function t(t){return e.call(this,Pn({},t,{controlType:"button",classNameSuffix:"global-fullscreen"}))||this}!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&&Dn(e,t)}(t,e);var n=t.prototype;return n._render=function(){var e,t;this.$container.innerHTML=Ne({title:null==(e=this.locale)?void 0:e.BTN_EXIT_GLOBAL_FULLSCREEN})+$e({title:null==(t=this.locale)?void 0:t.BTN_GLOBAL_FULLSCREEN})},n._onControlClick=function(){var e,t;this.isCurrentFullscreen&&this._$rootContainer.classList.contains(x+"-global-fullscreen")?(this._$rootContainer.classList.remove(x+"-global-fullscreen"),null==(e=this._fullscreenUtil)||e.exitFullscreen()):(this._$rootContainer.classList.add(x+"-global-fullscreen"),null==(t=this._fullscreenUtil)||t.fullscreen())},t}(Mt);function zn(){return zn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},zn.apply(this,arguments)}function xn(e,t){return xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xn(e,t)}var On,In=function(e){function t(t){var n;return(n=e.call(this,zn({},t,{tagName:"span",classNameSuffix:"capture-picture"}))||this)._timer=null,n.options=t,n._render(),"function"==typeof n.options.onCapture&&n.on(B.control.capturePictureResult,n.options.onCapture),n}!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&&xn(e,t)}(t,e);var n=t.prototype;return n.destroy=function(){this._timer&&(clearTimeout(this._timer),this._timer=null),e.prototype.destroy.call(this)},n._render=function(){var e;this.$container.innerHTML=Fe({title:null==(e=this.locale)?void 0:e.BTN_CAPTURE})},n._onControlClick=function(t){var n,i,r=this;this.active=!0,this.emit(B.control.capturePicture,{type:null!=(n=this.options.type)?n:"download",quality:this.options.quality||.9,cloudRecUpload:null==(i=this.options.cloudRecUpload)||i}),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=setTimeout((function(){r._timer&&(clearTimeout(r._timer),r._timer=null),r.active=!1}),200),e.prototype._onControlClick.call(this,t)},t}(Z),Rn={};var Mn=function(){if(On)return Rn;On=1;var n=e,i=t,r={language:"zh",env:{domain:"https://open.ys7.com"},accessToken:"",speed:2,locales:{zh:{GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距"},en:{GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length"}}},o={1:1,2:3,3:7,slow:1,mid:3,fast:7},a="ez-ptz",s="ez-mobile-ptz",l=a+"-speed-active",c=a+"-direction",d=function(){function e(e,t){var i,a,s;if(void 0===t&&(t={}),!e)throw new Error("Ptz container is required");(this.options=n(r,t,{clone:!1}),null==(i=this.options.locales)?void 0:i[this.options.language])?this.locale=null==(a=this.options.locales)?void 0:a[this.options.language]:this.locale=null==(s=this.options.locales)?void 0:s.zh;this.$container=e,this.speed=o[this.options.speed||2]}var t=e.prototype;return t.updateOptions=function(e){this.options=n(this.options,e,{clone:!1})},t.destroy=function(){},e}();function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}var p=function(e){function t(t,n){var i;return(i=e.call(this,t,n)||this)._touchstart=i._touchstart.bind(i),i._touchend=i._touchend.bind(i),i._render(),i}!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&&u(e,t)}(t,e);var n=t.prototype;return n.destroy=function(){this._removeEventListener(),this.$content&&(this.$content.remove(),this.$content=null),e.prototype.destroy.call(this)},n._render=function(){this.$content=document.createElement("div"),this.$content.classList.add(s+"-content"),this.$content.innerHTML='\n <div class="'+s+'-wrap">\n <div class="'+s+'-container">\n <div class="'+s+"-center "+s+'-center"></div>\n <div class="'+s+"-icon "+s+"-top "+s+'-default"></div>\n <div class="'+s+"-icon "+s+"-left "+s+'-default"></div>\n <div class="'+s+"-icon "+s+"-bottom "+s+'-default"></div>\n <div class="'+s+"-icon "+s+"-right "+s+'-default"></div>\n </div>\n </div>\n ',this.$container.appendChild(this.$content),this._addEventListener()},n._addEventListener=function(){var e=this.$content.querySelector("."+s+"-wrap"),t="PointerEvent"in window?"pointerdown":"touchstart",n="PointerEvent"in window?"pointerup":"touchend";e&&(e.addEventListener(t,this._touchstart),e.addEventListener(n,this._touchend))},n._touchstart=function(e){e.preventDefault(),this._handlePtzTouch(e,"start")},n._touchend=function(e){e.preventDefault(),this._handlePtzTouch(e,"stop")},n._removeEventListener=function(){var e=this.$content.querySelector("."+s+"-wrap"),t="PointerEvent"in window?"pointerdown":"touchstart",n="PointerEvent"in window?"pointerup":"touchend";e&&(e.removeEventListener(t,this._touchstart),e.removeEventListener(n,this._touchend))},n._handlePtzTouch=function(e,t){var n,i,r,o,a,l,c;if(!this.options.accessToken&&!(null==(i=this.options.token)||null==(n=i.deviceToken)?void 0:n.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");var d,u=this.$content.querySelector("."+s+"-wrap"),p=u.getBoundingClientRect(),h=p.left+130,m=p.top+130,A=(e.x||(null==(r=e.changedTouches[0])?void 0:r.clientX))-h,f=(e.y||(null==(o=e.changedTouches[0])?void 0:o.clientY))-m,v=0,g=(null==(a=this.options.env)?void 0:a.domain)+"/api/lapp/device/ptz/start",y=this.options.accessToken||(null==(c=this.options.token)||null==(l=c.deviceToken)?void 0:l.video),T=u.querySelectorAll("."+s+"-icon");(Math.abs(A)>Math.abs(f)?A>0?(v=3,T[3].className=T[3].className.replace(s+"-default",s+"-active")):(v=2,T[1].className=T[1].className.replace(s+"-default",s+"-active")):f>0?(v=1,T[2].className=T[2].className.replace(s+"-default",s+"-active")):(v=0,T[0].className=T[0].className.replace(s+"-default",s+"-active")),u.style.cssText="background-image:linear-gradient("+(0===v?180:1===v?0:2===v?90:270)+"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)","stop"===t)&&(g=(null==(d=this.options.env)?void 0:d.domain)+"/api/lapp/device/ptz/stop",u.style.cssText="",T[3].className=T[3].className.replace(s+"-active",s+"-default"),T[1].className=T[1].className.replace(s+"-active",s+"-default"),T[2].className=T[2].className.replace(s+"-active",s+"-default"),T[0].className=T[0].className.replace(s+"-active",s+"-default"));var _=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{direction:v,speed:this.speed,type:t}),b=new FormData;b.append("deviceSerial",this.options.deviceSerial+""),b.append("channelNo",this.options.channelNo+""),b.append("speed","1"),b.append("direction",v+""),b.append("accessToken",y),fetch(g,{method:"POST",body:b}).then((function(e){return e.json()})).then((function(e){200===e.code||[60005,60002,60003,60004].includes(+e.code)&&(u.style.cssText="background-image:linear-gradient("+(0===v?180:1===v?0:2===v?90:270)+"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"),null==_||_(e)})).catch((function(e){})).finally((function(){_=null}))},t}(d);function h(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){h(o,i,r,a,s,"next",e)}function s(e){h(o,i,r,a,s,"throw",e)}a(void 0)}))}}function A(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function v(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var g=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this)._isMobile=i.isMobile(),r._isRotate=!1,r._clearTimer=null,r._$wrapper=document.createElement("div"),r._$wrapper.className=a+"-container-wrap",r._$directionCircleContainer=document.createElement("div"),r._$directionCircleContainer.classList.add(a+"-container"),r._$directionCircleContainer.innerHTML='\n <div class="'+a+"-main "+c+'-center"></div>\n <div class="'+a+"-icon "+c+'-top" data-direction="0"></div>\n <div class="'+a+"-icon "+c+'-top-left" data-direction="4"></div>\n <div class="'+a+"-icon "+c+'-left" data-direction="2"></div>\n <div class="'+a+"-icon "+c+'-left-bottom" data-direction="5"></div>\n <div class="'+a+"-icon "+c+'-bottom" data-direction="1"></div>\n <div class="'+a+"-icon "+c+'-bottom-right" data-direction="7"></div>\n <div class="'+a+"-icon "+c+'-right" data-direction="3"></div>\n <div class="'+a+"-icon "+c+'-right-top" data-direction="6"></div>\n ',r._$wrapper.appendChild(r._$directionCircleContainer),r._$speedContainer=document.createElement("div"),r._$speedContainer.classList.add(a+"-speed-container"),r._$speedContainer.innerHTML='\n <div class="'+a+'-speed-progress" title="'+r.locale.PTZ_SPEED+'">\n <div class="'+a+'-speed-progress-line">\n <div class="'+a+"-speed-progress-line-dot "+(1===r.speed?l:"")+'" data-id="slow" data-index="1" data-value="1"></div>\n <div class="'+a+"-speed-progress-line-dot "+(3===r.speed?l:"")+'" data-id="mid" data-index="2" data-value="3"></div>\n <div class="'+a+"-speed-progress-line-dot "+(7===r.speed?l:"")+'" data-id="fast" data-index="3" data-value="7"></div>\n </div>\n <div class="'+a+'-speed-progress-points">\n <div class="'+a+'-speed-progress-points-slow">\n '+r.locale.PTZ_SLOW+'\n </div>\n <div class="'+a+'-speed-progress-points-mid">\n '+r.locale.PTZ_MID+'\n </div>\n <div class="'+a+'-speed-progress-points-fast">\n '+r.locale.PTZ_FAST+"\n </div>\n </div>\n </div>\n ",r._$wrapper.appendChild(r._$speedContainer),r._$btnContainer=document.createElement("div"),r._$btnContainer.classList.add(a+"-btn-container"),r._$btnContainer.innerHTML='\n <div class="'+a+'-btn-zoom" title="'+r.locale.DEVICE_ZOOM+'" style="user-select: none;">\n <div class="'+a+'-btn-zoom-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" fill="#ffffff"></path>\n <path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#ffffff">\n </path>\n <path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="'+a+'-btn-zoom-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" fill="#ffffff"></path>\n <path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n <div class="'+a+'-btn-focal" title="'+r.locale.DEVICE_FOCUS+'" style="user-select: none;">\n <div class="'+a+'-btn-focal-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" fill="#ffffff"></path>\n <path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="'+a+'-btn-focal-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" fill="#ffffff"></path>\n <path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n ',r._$wrapper.appendChild(r._$btnContainer),t.appendChild(r._$wrapper),r._$directionCircleContainer.onmousedown=function(e){e.preventDefault(),e.stopPropagation(),r._handlePtzTouch(e,"start")},r._$directionCircleContainer.onmouseup=function(e){e.preventDefault(),e.stopPropagation(),r._handlePtzTouch(e,"stop")},r._$directionCircleContainer.ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),r._handlePtzTouch(e,"start")},r._$directionCircleContainer.ontouchend=function(e){e.preventDefault(),e.stopPropagation(),r._handlePtzTouch(e,"stop")},r._onSwitchSpeed=function(e){var t=Array.from(r._$speedContainer.querySelectorAll("."+a+"-speed-progress-line-dot"));if(t.includes(e.target)&&!e.target.classList.contains(l)){t.forEach((function(t){t===e.target?t.classList.add(l):t.classList.remove(l)}));var n=e.target.getAttribute("data-value"),i=e.target.getAttribute("data-index");r.speed=+n,null==r.options.onSpeedChange||r.options.onSpeedChange.call(r.options,+i)}},r._$speedContainer.onmouseup=r._onSwitchSpeed,r._isMobile&&(r._$speedContainer.ontouchend=r._onSwitchSpeed),r._$btnContainer.querySelector("."+a+"-btn-zoom-add")&&(r._$btnContainer.querySelector("."+a+"-btn-zoom-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","add","start")},r._$btnContainer.querySelector("."+a+"-btn-zoom-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","add","stop")}),r._$btnContainer.querySelector("."+a+"-btn-zoom-sub")&&(r._$btnContainer.querySelector("."+a+"-btn-zoom-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","sub","start")},r._$btnContainer.querySelector("."+a+"-btn-zoom-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","sub","stop")}),r._$btnContainer.querySelector("."+a+"-btn-focal-add")&&(r._$btnContainer.querySelector("."+a+"-btn-focal-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","add","start")},r._$btnContainer.querySelector("."+a+"-btn-focal-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","add","stop")}),r._$btnContainer.querySelector("."+a+"-btn-focal-sub")&&(r._$btnContainer.querySelector("."+a+"-btn-focal-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","sub","start")},r._$btnContainer.querySelector("."+a+"-btn-focal-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","sub","stop")}),r._isMobile&&(r._$btnContainer.querySelector("."+a+"-btn-zoom-add")&&(r._$btnContainer.querySelector("."+a+"-btn-zoom-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","add","start")},r._$btnContainer.querySelector("."+a+"-btn-zoom-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","add","stop")}),r._$btnContainer.querySelector("."+a+"-btn-zoom-sub")&&(r._$btnContainer.querySelector("."+a+"-btn-zoom-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","sub","start")},r._$btnContainer.querySelector("."+a+"-btn-zoom-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("zoom","sub","stop")}),r._$btnContainer.querySelector("."+a+"-btn-focal-add")&&(r._$btnContainer.querySelector("."+a+"-btn-focal-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","add","start")},r._$btnContainer.querySelector("."+a+"-btn-focal-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","add","stop")}),r._$btnContainer.querySelector("."+a+"-btn-focal-sub")&&(r._$btnContainer.querySelector("."+a+"-btn-focal-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","sub","start")},r._$btnContainer.querySelector("."+a+"-btn-focal-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),r._handleBtnTouch("focal","sub","stop")})),r}!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&&f(e,t)}(t,e);var n=t.prototype;return n.destroy=function(){this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer&&(this._$directionCircleContainer.remove(),this._$directionCircleContainer=null),this._$speedContainer&&(this._onSwitchSpeed=null,this._$speedContainer.remove(),this._$speedContainer=null),this._$btnContainer&&(this._$btnContainer.remove(),this._$btnContainer=null),this._$wrapper&&(this._$wrapper.remove(),this._$wrapper=null),e.prototype.destroy.call(this)},n._handlePtzTouch=function(e,t){var n,i,r,o,a,s=this;if(!this.options.accessToken&&!(null==(i=this.options.token)||null==(n=i.deviceToken)?void 0:n.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzQueue||(this._ptzQueue=Promise.resolve());var l=this._$directionCircleContainer.getBoundingClientRect(),c=l.left+(this._$directionCircleContainer.clientWidth+2)/2,d=l.top+(this._$directionCircleContainer.clientHeight+2)/2,u=e.x||e.changedTouches[0].clientX,p=e.y||e.changedTouches[0].clientY,h=0,A=(null==(r=this.options.env)?void 0:r.domain)+"/api/lapp/device/ptz/start",f=this.options.accessToken||(null==(a=this.options.token)||null==(o=a.deviceToken)?void 0:o.video),g=0;function y(e,t){var n=Math.atan2(t,e);n<0&&(n+=2*Math.PI);var i=n*(180/Math.PI)-225-12.5;return i<0&&(i+=360),Math.floor(i/45)+1}var T,_=u-c,b=p-d;if(this.isRotate)switch(y(_,b)){case 1:h=2,g=90;break;case 2:h=4,g=135;break;case 3:h=0,g=180;break;case 4:h=6,g=225;break;case 5:h=3,g=270;break;case 6:h=7,g=315;break;case 7:h=1,g=0;break;case 8:h=5,g=45}else switch(y(_,b)){case 1:h=0,g=180;break;case 2:h=6,g=225;break;case 3:h=3,g=270;break;case 4:h=7,g=315;break;case 5:h=1,g=0;break;case 6:h=5,g=45;break;case 7:h=2,g=90;break;case 8:h=4,g=135}(this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer.style.cssText="start"===t?"background-image:linear-gradient("+g+"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)":"","stop"===t)&&(A=(null==(T=this.options.env)?void 0:T.domain)+"/api/lapp/device/ptz/stop");var C=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{areaId:y(_,b),direction:h,backDeg:g,isRotate:this.isRotate,speed:this.speed,type:t}),S=new FormData;S.append("deviceSerial",this.options.deviceSerial+""),S.append("channelNo",this.options.channelNo+""),S.append("speed",this.speed+""),S.append("direction",h+""),S.append("accessToken",f),this._ptzQueue=this._ptzQueue.then((function(){return m((function(){var e;return v(this,(function(n){switch(n.label){case 0:return e=this,[4,fetch(A,{method:"POST",body:S}).then((function(e){return m((function(){return v(this,(function(t){switch(t.label){case 0:return[4,e.json()];case 1:return[2,t.sent()]}}))}))()})).then((function(t){var n;null==C||C(t);var i=t.code||(null==t||null==(n=t.result)?void 0:n.code);return[6e4,60001,60002,60003,60004,60005,60006,10002].includes(+i)&&(e._$directionCircleContainer.style.cssText="background-image:linear-gradient("+g+"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"),t})).catch((function(e){})).finally((function(){C=null,"stop"===t&&(e._clearTimer=setTimeout((function(){e._$directionCircleContainer.style.cssText=""}),1e3))}))];case 1:return[2,n.sent()]}}))})).call(s)})),"stop"===t&&(this._ptzQueue=this._ptzQueue.finally((function(){})))},n._handleBtnTouch=function(e,t,n){var i,r,o,a,s=this;if(!this.options.accessToken&&!(null==(i=this.options.token)?void 0:i.deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzOperation||(this._ptzOperation=Promise.resolve());var l=8;l="zoom"===e?"add"===t?8:9:"add"===t?10:11;var c,d=(null==(r=this.options.env)?void 0:r.domain)+"/api/lapp/device/ptz/start",u=this.options.accessToken||(null==(a=this.options.token)||null==(o=a.deviceToken)?void 0:o.video);"stop"===n&&(d=(null==(c=this.options.env)?void 0:c.domain)+"/api/lapp/device/ptz/stop");var p=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{btn:e,option:t,type:n}),h=new FormData;h.append("deviceSerial",this.options.deviceSerial+""),h.append("channelNo",this.options.channelNo+""),h.append("speed",this.speed+""),h.append("direction",l+""),h.append("accessToken",u),this._ptzOperation=this._ptzOperation.then((function(){return m((function(){return v(this,(function(e){switch(e.label){case 0:return[4,fetch(d,{method:"POST",body:h}).then((function(e){return m((function(){return v(this,(function(t){switch(t.label){case 0:return[4,e.json()];case 1:return[2,t.sent()]}}))}))()})).then((function(e){return null==p||p(e),e})).catch((function(e){})).finally((function(){p=null}))];case 1:return[2,e.sent()]}}))}))()})),"stop"===n&&(this._ptzOperation=this._ptzOperation.finally((function(){s._ptzOperation=null})))},A(t,[{key:"isRotate",get:function(){return this._isRotate},set:function(e){this._isRotate=e}}]),t}(d);return Rn.BasePtz=d,Rn.MobilePtz=p,Rn.Ptz=g,Rn}();function Nn(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function $n(){return $n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$n.apply(this,arguments)}function Fn(e,t){return Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fn(e,t)}var jn=function(e){function t(t){var n;return(n=e.call(this,$n({},t,{tagName:"span",controlType:"button",classNameSuffix:"ptz"}))||this)._isRotated=!1,n._options=t,n._render(),n._onDBlPanelClick=n._onDBlPanelClick.bind(n),n}!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&&Fn(e,t)}(t,e);var n=t.prototype;return n.destroy=function(){var t,n,i;this._ptzControl&&(this._ptzControl.destroy(),this._ptzControl=null),this._ptzControl1&&(this._ptzControl1.destroy(),this._ptzControl1=null),null==(t=this.$panel)||t.removeEventListener("dblclick",this._onDBlPanelClick),null==(i=this.$panel)||null==(n=i.remove)||n.call(i),e.prototype.destroy.call(this)},n._render=function(){var e;this.$container.innerHTML=je({title:null==(e=this.locale)?void 0:e.BTN_PTZ}),this._renderPanel()},n._renderPanel=function(){this._options.rootContainer&&(this.$panel=document.createElement("div"),this.$panel.classList.add(x+"-ptz-panel",x+"-hide"),this._options.rootContainer.appendChild(this.$panel),this.$turntable=document.createElement("div"),this.$turntable.classList.add(x+"-ptz-turntable"),this.$panel.appendChild(this.$turntable),this._ptzControl=new Mn.Ptz(this.$turntable,$n({},this._options,{onSpeedChange:this._onSpeedChange.bind(this),onDirection:this._onDirection.bind(this)})),this.$panel.addEventListener("dblclick",this._onDBlPanelClick))},n.renderMobileExtend=function(e){this._ptzControl1||(this._ptzControl1=new Mn.MobilePtz(e,$n({},this._options,{onSpeedChange:this._onSpeedChange.bind(this),onDirection:this._onDirection.bind(this)})))},n.updateOptions=function(e){this._ptzControl&&this._ptzControl.updateOptions(e),this._ptzControl1&&this._ptzControl.updateOptions(e)},n._onSpeedChange=function(e){this.emit(B.control.ptzSpeedChange,e),null==this._options.onSpeedChange||this._options.onSpeedChange.call(this._options,e)},n._onDirection=function(e){var t=this;return function(n){var i,r=+(n.code||(null==n||null==(i=n.result)?void 0:i.code));"start"===e.type&&200!==r&&t.emit(B.control.ptzError,{code:r,localeKey:"zoom"===e.btn&&6e4===r?"NOT_SUPPORT_DEVICE_ZOOM":"focal"===e.btn&&60006===r?"NOT_SUPPORT_FOCUS":"38"+r,msg:n.msg})}},n._onControlClick=function(t){e.prototype._onControlClick.call(this,t),this.active=!this.active},n._onDBlPanelClick=function(e){e.stopPropagation(),e.preventDefault()},n.reset=function(e){this.active=!1},Nn(t,[{key:"isRotated",get:function(){return this._isRotated},set:function(e){this._ptzControl.isRotate=e,this._isRotated=e}},{key:"active",get:function(){return this._active},set:function(e){this._disabled&&!this._active||(this._active=e,this._updateActiveState(e),this._active?this.$panel.classList.remove(x+"-hide"):this.$panel.classList.add(x+"-hide"))}}]),t}(Z);function Un(e,t){void 0===t&&(t="MM:SS");var n=Math.floor(e/3600),i=Math.floor(e%3600/60),r=e%60,o=function(e){return e.toString().padStart(2,"0")};return t.replace("HH",o(n)).replace("MM",o(i)).replace("SS",o(r))}function Bn(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function Vn(){return Vn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Vn.apply(this,arguments)}function Yn(e,t){return Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Yn(e,t)}var Zn={maxDuration:3600},Hn=function(e){function t(t){var n;return(n=e.call(this,Vn({},t,{tagName:"span",controlType:"button",classNameSuffix:"record"}))||this)._seconds=0,n._options=Object.assign({},Zn,t),n._render(),n}!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&&Yn(e,t)}(t,e);var n=t.prototype;return n._render=function(){var e;this.$container.innerHTML=Ue({title:null==(e=this.locale)?void 0:e.BTN_RECORDVIDEO})},n._renderTimer=function(){var e,t,n=this;this._timerNode=document.createElement("span"),this._timerNode.className=x+"-record-timer",null==(t=this._options)||null==(e=t.rootContainer)||e.appendChild(this._timerNode),this._timerNode.innerHTML=Be()+'<span class="'+x+'-record-timer-time">'+Un(this._seconds)+"<span>";var i=this._timerNode.querySelector("."+x+"-record-timer-time");this._timer=setInterval((function(){n._seconds++,n._seconds>=n._options.maxDuration?n._destroyTimer():i&&(i.innerHTML=""+Un(n._seconds))}),1e3)},n.reset=function(){this.active&&(this.active=!1,e.prototype.reset.call(this))},n.destroy=function(){this._destroyTimer(),e.prototype.destroy.call(this)},n._destroyTimer=function(){this._seconds=0,this._timer&&(clearInterval(this._timer),this._timer=null),this._timerNode&&(this._timerNode.remove(),this._timerNode=null),this._active=!1},n._onControlClick=function(t){this.active=!this.active,e.prototype._onControlClick.call(this,t)},Bn(t,[{key:"active",get:function(){return this._active},set:function(e){this._disabled&&!this._active||this._active!==e&&(this._active=e,this._updateActiveState(e),this.active?this._renderTimer():this._destroyTimer(),this.emit(B.control.recordingChange,this._active))}}]),t}(Z);function Gn(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Qn(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function Kn(){return Kn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Kn.apply(this,arguments)}function Wn(e,t){return Wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wn(e,t)}function Jn(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var qn=function(e){function t(t){var n;return(n=e.call(this,Kn({},t,{tagName:"span",controlType:"button",classNameSuffix:"talk"}))||this)._value=0,n._options=t,n._render(),n.on(B.talkingChange,(function(e){n.active!==e&&(n.active=e,n._render())})),n.on(B.talkVolumeChange,(function(e){var t,i;n.value=e,null==(i=n._options)||null==(t=i.onChange)||t.call(i,e)})),n}!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&&Wn(e,t)}(t,e);var n=t.prototype;return n._render=function(){var e,t;this.$container.innerHTML=this.active?Ye({title:null==(e=this.locale)?void 0:e.BTN_TALK}):Ve({title:null==(t=this.locale)?void 0:t.BTN_TALK})},n.reset=function(t){this.active&&(this._value=0,this.active=!1,this._render(),this.emit(B.control.talkingChange,!1),e.prototype.reset.call(this,t))},n.destroy=function(){this.active&&this.reset(),e.prototype.destroy.call(this)},n._onControlClick=function(t){var n,i=this;return(n=function(){return Jn(this,(function(n){return e.prototype._onControlClick.call(i,t),this.active=!this.active,this.emit(B.control.talkingChange,this.active),this._render(),[2]}))},function(){var e=this,t=arguments;return new Promise((function(i,r){var o=n.apply(e,t);function a(e){Gn(o,i,r,a,s,"next",e)}function s(e){Gn(o,i,r,a,s,"throw",e)}a(void 0)}))}).call(this)},Qn(t,[{key:"value",get:function(){return this._value},set:function(e){if(this.active&&!(e<0||e>1)){this._value=e;var t="silent";e>0&&e<.25?t="low":e>=.25&&e<.5?t="normal":e>=.5&&e<.75?t="high":e>=.75&&(t="deafening");var n=Array.from(this.$container.classList).find((function(e){return e.startsWith(x+"-talk-gain-")}));n&&this.$container.classList.remove(n),this.$container.classList.add(x+"-talk-gain-"+t)}}}]),t}(Z);function Xn(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function ei(){return ei=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ei.apply(this,arguments)}function ti(e,t){return ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ti(e,t)}var ni={fieldNames:{label:"label",value:"value"},renderLabel:function(e){return"<span>"+(e||"")+"</span>"},onChange:function(){},onOpenChange:function(){}},ii=function(t){function n(n){var i,r,o,a;(i=t.call(this,ei({tagName:"span",type:"button",controlType:"button"},ni,n))||this)._options=e(ni,n,{clone:!1}),i.list=n.list||[],void 0===n.value&&null===n.value||(i._value=n.value+"");var s=null!=(a=null==(r=i._options.fieldNames)?void 0:r.value)?a:"value";return i._picker=new C(i.$container,{getPopupContainer:function(){return gt.isMobile?n.rootContainer:i.$container},trigger:gt.isMobile?"click":"hover",isMobile:gt.isMobile,wrapClassName:x+"-select-picker "+x+"-select-"+n.classNameSuffix,open:i._options.open,offset:[0,-10],placement:"top",onOpenChange:function(e){var t=i.list.find((function(e){return e[s]+""===i.value}));null==i._options.onOpenChange||i._options.onOpenChange.call(i._options,e,i.value,t)}}),i.list&&i.updateOptions(i.list),i._onSelectChange(),i._activeOption(),i._onDBlPanelClick=i._onDBlPanelClick.bind(i),null==(o=i._picker.$body)||o.addEventListener("dblclick",i._onDBlPanelClick),i}!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&&ti(e,t)}(n,t);var i=n.prototype;return i.updateOptions=function(e){var t=this;if(void 0===e&&(e=[]),(null==e?void 0:e.length)>0&&this._picker){var n,i,r,o,a,s,l=null!=(a=null==(n=this._options.fieldNames)?void 0:n.label)?a:"label",c=null!=(s=null==(i=this._options.fieldNames)?void 0:i.value)?s:"value";null==(o=this._picker)||o.innerHTML('<div class="'+x+'-select-panel">\n <ul class="'+x+'-select-list">\n '+e.map((function(e){return'\n <li class="'+x+"-select-option "+(+e[c]===t.value?x+"-active":"")+'" data-value="'+e[c]+'">\n <span>'+e[l]+"</span>\n </li>\n "})).join("")+"\n </ul>\n "+(gt.isMobile?'<div class="'+x+'-select-cancel">\n <span>'+((null==(r=this.locale)?void 0:r.cancel)||"取消")+"</span>\n </div>":"")+"\n "+(gt.isMobile?'<span class="'+x+'-select-close">'+Xe()+"</span>":"")+"\n <div>"),this.list=e,this._activeOption()}else if(0===(null==e?void 0:e.length)){var d,u;null==(u=this._picker)||null==(d=u.innerHTML)||d.call(u,"")}},i._render=function(e){var t;if(0!==this.list.length){var n,i=null!=(n=null==(t=this._options.fieldNames)?void 0:t.label)?n:"label";if(this.$container.querySelector("."+x+"-select-btn"))this.$container.querySelector("."+x+"-select-btn").innerHTML=null==this._options.renderLabel?void 0:this._options.renderLabel.call(this._options,null==e?void 0:e[i],e,this.list);else{var r=document.createElement("span");r.classList.add(x+"-btn",x+"-select-btn"),r.innerHTML=null==this._options.renderLabel?void 0:this._options.renderLabel.call(this._options,null==e?void 0:e[i],e,this.list),this.$container.appendChild(r),this._options.title&&r.setAttribute("title",this._options.title)}}},i._activeOption=function(){var e=this;if(this._picker){var t,n,i,r,o=null!=(r=null==(t=this._options.fieldNames)?void 0:t.value)?r:"value",a=null==(n=this._picker.$body)?void 0:n.querySelector("."+x+"-active");null==a||a.classList.remove(x+"-active");var s=null==(i=this._picker.$body)?void 0:i.querySelector("."+x+'-select-option[data-value="'+this.value+'"]');null==s||s.classList.add(x+"-active");var l=this.list.find((function(t){return t[o]+""===e.value}));this._render(l)}},i._onSelectChange=function(){var e=this;if(this._picker){var t,n,i=null!=(n=null==(t=this._options.fieldNames)?void 0:t.value)?n:"value";this._delegationOption=P(this._picker.$body,"."+x+"-select-option","click",(function(t){var n=t.delegateTarget;if(t.stopPropagation(),!n.classList.contains(x+"-disabled")){var r=n.getAttribute("data-value");if(e.value!==r){e.value=r;var o=e.list.find((function(t){return t[i]+""===e.value}));null==e._options.onChange||e._options.onChange.call(e._options,e.value,o),e._picker.open=!1}}})),this._delegationClose=P(this._picker.$body,"."+x+"-select-close","click",(function(t){t.stopPropagation(),e._picker.open=!1})),this._delegationCancel=P(this._picker.$body,"."+x+"-select-cancel","click",(function(t){t.stopPropagation(),e._picker.open=!1}))}},i.destroy=function(){var e,n,i,r,o,a,s,l;(null==(n=this._delegationOption)||null==(e=n.destroy)||e.call(n),this._delegationOption=null,null==(r=this._delegationClose)||null==(i=r.destroy)||i.call(r),this._delegationClose=null,null==(a=this._delegationCancel)||null==(o=a.destroy)||o.call(a),this._delegationCancel=null,this._picker)&&(null==(s=this._picker.$body)||s.removeEventListener("dblclick",this._onDBlPanelClick),null==(l=this._picker)||l.destroy(),this._picker=null);t.prototype.destroy.call(this)},i._onDBlPanelClick=function(e){e.stopPropagation(),e.preventDefault()},i._onControlClick=function(e){null==this._options.onClick||this._options.onClick.call(this._options,e)},Xn(n,[{key:"value",get:function(){return this._value},set:function(e){this.value!==e&&(this._value=e,this._activeOption())}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=e,this._picker.disabled=e,this._updateDisabledState(e)}}]),n}(Z);function ri(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oi(){return oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},oi.apply(this,arguments)}function ai(e,t){return ai=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ai(e,t)}var si=["VIDEO_LEVEL_FLUENT","VIDEO_LEVEL_STANDARD","VIDEO_LEVEL_HEIGH","VIDEO_LEVEL_SUPER","VIDEO_LEVEL_EXTREME","VIDEO_LEVEL_3K","VIDEO_LEVEL_4k"],li={value:1,list:[]};function ci(e,t){return void 0===t&&(t={}),e.map((function(e){var n=+e.level,i=e.name;return i||(i=null==t?void 0:t[si[n]]),"VIDEO_LEVEL_AUTO"===i?i=null==t?void 0:t[i]:si.includes(i)&&(i=null==t?void 0:t[si[n]]),{name:i,level:e.level+"",streamTypeIn:e.streamTypeIn,type:e.type}}))}var di=function(e){function t(t){var n,i,r,o;return void 0===t&&(t={}),(n=e.call(this,oi({},li,{value:null==(i=t.props)?void 0:i.videoLevel},t,{fieldNames:{label:"name",value:"level"},list:ci((null==t?void 0:t.list)||(null==(r=t.props)?void 0:r.videoLevelList)||[],(null==t?void 0:t.locales[t.language])||{}),title:null==t||null==(o=t.locales[t.language])?void 0:o.BTN_HD,controlType:"button",classNameSuffix:"definition",renderLabel:function(e,i,r){var o;if("auto"===(null==i?void 0:i.level)){var a,s=r.find((function(e){return e.level===ri(n)._level}));return"<span>"+(null==t||null==(a=t.locales[t.language])?void 0:a.VIDEO_LEVEL_AUTO)+"("+((null==s?void 0:s.name)||"")+")</span>"}return"<span>"+(e||(null==(o=r[0])?void 0:o.name)||"")+"</span>"},onChange:function(e,i){var r;null==t||null==(r=t.onChange)||r.call(t,e,i),"auto"===e?ri(n).emit(B.control.definitionChange,"auto",ri(n)._level):(ri(n)._level=e,ri(n).emit(B.control.definitionChange,e,i))},onOpenChange:function(e,i,r){var o;null==t||null==(o=t.onOpenChange)||o.call(t,e,i,r),ri(n).emit(B.control.definitionPanelOpenChange,e,i,r)}}))||this)._level="",n.options=t||{},n.on(B.setVideoLevelList,(function(t){e.prototype.updateOptions.call(ri(n),ci(t,n.locale))})),n.on(B.currentVideoLevel,(function(e,i){var r,o="object"==(void 0===e?"undefined":(r=e)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)?e.level:e;if(n._level=i+"","auto"===o){var a,s=n.list.find((function(e){return e.level===n._level}));n.$container.querySelector("."+x+"-select-btn").innerHTML="\n <span>"+(null==t||null==(a=t.locales[t.language])?void 0:a.VIDEO_LEVEL_AUTO)+"("+((null==s?void 0:s.name)||"")+")</span>\n "}else n.value!==n._level+""&&(n.value=n._level+"")})),n}return 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&&ai(e,t)}(t,e),t.prototype.reset=function(t){e.prototype.reset.call(this,t)},t}(ii);function ui(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pi(){return pi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pi.apply(this,arguments)}function hi(e,t){return hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},hi(e,t)}var mi,Ai,fi={list:[.5,1,2,4].reverse().map((function(e){return{label:e+"x",value:e}}))},vi=function(e){function t(t){var n,i,r;return(n=e.call(this,pi({},fi,t,{value:(t.props.speed||1)+"",classNameSuffix:"speed",controlType:"button",title:null==t||null==(r=t.locales)||null==(i=r[t.language])?void 0:i.BTN_SPEED,onChange:function(e,i){var r;e=+e,null==t||null==(r=t.onChange)||r.call(t,e,i),ui(n).emit(B.control.speedChange,e,i)},onOpenChange:function(e,i,r){var o;i=+i,null==t||null==(o=t.onOpenChange)||o.call(t,e,i,r),ui(n).emit(B.control.speedPanelOpenChange,e,i,r)}}))||this).on(B.speedChange,(function(e){n.value!==e+""&&(n.value=e+"")})),n}return 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&&hi(e,t)}(t,e),t.prototype.reset=function(t){this.value="1",e.prototype.reset.call(this,t)},t}(ii);var gi=function(){if(Ai)return mi;function e(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function t(t){return function(){var n=this,i=arguments;return new Promise((function(r,o){var a=t.apply(n,i);function s(t){e(a,r,o,s,l,"next",t)}function l(t){e(a,r,o,s,l,"throw",t)}s(void 0)}))}}function n(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}Ai=1;var i=function(){function e(){}return e.loadScript=function(i){return t((function(){return n(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t,n){return e.LoadedScr.includes(i)?t(i):e.LoadingScrQueue[i]?e.LoadingScrQueue[i].push(t):(e.LoadingScrQueue[i]=[t],i.includes(".js")?((r=document.createElement("script")).src=i,r.async=!0):i.includes(".css")&&((r=document.createElement("link")).rel="stylesheet",r.href=i),r.onload=function(){e.LoadedScr.push(i),e.LoadingScrQueue[i].forEach((function(e){return e(i)})),e.LoadingScrQueue[i]=[]},r.onerror=function(){return n(new Error("Failed to load "+i))},void document.head.appendChild(r));var r}))];case 1:return[2,t.sent()]}}))}))()},e.loadScriptsBatch=function(i){return t((function(){return n(this,(function(t){switch(t.label){case 0:return[4,Promise.all(i.map(e.loadScript))];case 1:return[2,t.sent()]}}))}))()},e.remove=function(e){e.forEach((function(e){var t=document.querySelector('script[src="'+e+'"]')||document.querySelector('link[href="'+e+'"]');t&&t.remove()}))},e.clear=function(){e.remove(e.LoadedScr)},e}();function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}i.LoadedScr=[],i.LoadingScrQueue={};var o={staticPath:".",place:"top-right",language:"zh-CN",current:new Date,maxDate:new Date};return mi=function(){function e(e,t){var n=this;this._open=!1,this._change=!0,this.$container=e,this.options=Object.assign({},o,t),this.options.staticPath=(this.options.staticPath||"").replace(/\/$/,""),this.options.current&&(this._date=this.options.current),this._init(),this.$container.addEventListener("click",(function(){n._open?n.hide():n.show()})),document.body.addEventListener("click",(function(e){n.$container.contains(e.target)||n.hide()}))}var t=e.prototype;return t._init=function(){var e=this;this.$container.style.cssText+=";position: relative;",this.$container.classList.add("datepicker-inline-"+this.options.place),i.loadScriptsBatch([this.options.staticPath+"/rec/jquery.min.js",this.options.staticPath+"/rec/datepicker.min.css"]).then((function(){i.loadScriptsBatch([e.options.staticPath+"/rec/datepicker.js"]).then((function(){i.loadScriptsBatch([e.options.staticPath+"/rec/datepicker.zh-CN.js",e.options.staticPath+"/rec/datepicker.en-US.js"]).then((function(){window.$(e.$container).datepicker({date:e.options.current,language:e.options.language,endDate:e.options.maxDate,inline:!0}),e.hide(),window.$(e.$container).on("pick.datepicker",(function(t){var n,i,r,o,a,s;"year"===t.view&&(null==(n=e._date)?void 0:n.getFullYear())!==t.date.getFullYear()?null==e.options.onYearChange||e.options.onYearChange.call(e.options,t.date):"month"!==t.view||(null==(i=e._date)?void 0:i.getMonth())===t.date.getMonth()&&(null==(r=e._date)?void 0:r.getFullYear())===t.date.getFullYear()?!["day","pick"].includes(t.view||t.type)||(null==(o=e._date)?void 0:o.getDate())===t.date.getDate()&&(null==(a=e._date)?void 0:a.getMonth())===t.date.getMonth()&&(null==(s=e._date)?void 0:s.getFullYear())===t.date.getFullYear()||(e._change&&(null==e.options.onChange||e.options.onChange.call(e.options,t.date)),e._date=new Date(t.date.getTime())):null==e.options.onMonthChange||e.options.onMonthChange.call(e.options,t.date),"day"===t.view&&e.hide(),e._change=!0}))}))}))}))},t.setDate=function(e,t){void 0===t&&(t=!0),this.$container.querySelector(".datepicker-inline")&&(this._change=t,window.$(this.$container).datepicker("setDate",e))},t.hide=function(){var e=this.$container.querySelector(".datepicker-inline");e&&(this._open&&(this._open=!1,null==this.options.onPanelChange||this.options.onPanelChange.call(this.options,!1,this._date)),e.classList.add("datepicker-hide"))},t.show=function(){var e,t,n=this.$container.querySelector(".datepicker-inline");n&&(this._open||(this._open=!0,null==this.options.onPanelChange||this.options.onPanelChange.call(this.options,!0,this._date)),this._date&&this.setDate(this._date,!1),null==(e=(t=window.$(this.$container)).datepicker)||e.call(t,"showView"),"bottom-left"===this.options.place?n.style.cssText+="top: "+(this.$container.clientHeight+10)+"px; bottom: auto; right: auto; left: 0px":n.style.cssText+="bottom: "+(this.$container.clientHeight+10)+"px; top: auto",n.classList.remove("datepicker-hide"))},t.destroy=function(){this.hide(),this._date=void 0,window.$(this.$container).datepicker("destroy")},r(e,[{key:"date",get:function(){return this._date}}]),e}()}(),yi=an(gi),Ti=function(){function e(){}return e.formate=function(t,n,i){void 0===i&&(i=0);var r=t;"string"==typeof t?r=e.strToDate(t):"number"==typeof t&&(r=new Date(t));var o=(r=new Date(r.getTime()-3600*i*1e3)).getFullYear(),a=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0"),l=String(r.getHours()).padStart(2,"0"),c=String(r.getMinutes()).padStart(2,"0"),d=String(r.getSeconds()).padStart(2,"0");switch(n){case"YYYY-MM-DD hh:mm:ss":return o+"-"+a+"-"+s+" "+l+":"+c+":"+d;case"YYYYMMDDhhmmss":return""+o+a+s+l+c+d;case"YYYY/MM/DD hh:mm:ss":return o+"/"+a+"/"+s+" "+l+":"+c+":"+d;case"YYYYMMDDThhmmssZ":return""+o+a+s+"T"+l+c+d+"Z";case"YYYY/MM/DD":return o+"/"+a+"/"+s;case"YYYYMMDD":return""+o+a+s;case"YYYY-MM-DD":return o+"-"+a+"-"+s;case"YYYY":return""+o;case"MM":return""+a;case"DD":return""+s;case"hh:mm:ss":return l+":"+c+":"+d;case"hh":return""+l;case"mm":return""+c;case"ss":return""+d;default:throw new Error("Unsupported format type")}},e.diff=function(t,n,i){var r=t;"string"==typeof t?r=e.strToDate(t):"number"==typeof t&&(r=new Date(t));var o=n;"string"==typeof n?r=e.strToDate(n):"number"==typeof n&&(r=new Date(n));var a=r.getTime()-o.getTime();switch(i){case"year":return r.getFullYear()-o.getFullYear();case"month":var s=12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth());return r.getDate()<o.getDate()&&s--,s;case"day":return a/60/60/24;case"hour":return a/60/60;case"minute":return a/60;case"second":return a;default:throw new Error("Unsupported diff type")}},e.now=function(){return Date.now()},e.strToDate=function(e){var t=(e+"").replace(/-/gi,"").replace(/:/gi,"").replace(/\//gi,"").replace(/ /gi,"").replace(/T|Z/gi,"");if(10===(e+"").length)return new Date(+e);if(13===(e+"").length)return new Date(+e);var n=t.slice(0,4),i=t.slice(4,6),r=t.slice(6,8),o=t.slice(8,10),a=t.slice(10,12),s=t.slice(12,14);return new Date(n+"/"+i+"/"+r+" "+o+":"+a+":"+s)},e.padStart=function(e){return e<10?"0"+e:e+""},e}();function _i(){return _i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},_i.apply(this,arguments)}function bi(e,t){return bi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},bi(e,t)}var Ci=function(e){function t(t){var n,i,r,o;return(n=e.call(this,_i({},t,{tagName:"span",controlType:"button",classNameSuffix:"date"}))||this).options=t,n._value=Ti.formate((null==(o=n.options.props)||null==(r=o.urlInfo)||null==(i=r.searchParams)?void 0:i.begin)||new Date,"YYYY-MM-DD"),n._render(),n}!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&&bi(e,t)}(t,e);var i=t.prototype;return i._render=function(){var e,t,i=this;n()?this.$container.innerHTML='\n <span class="'+x+'-mobile-date-filter" title="'+((null==(e=this.locale)?void 0:e.BTN_CALENDAR)||"")+'">\n <span class="'+x+'-mobile-date-filter-value">'+this._getDateStr()+"</span>\n "+rt()+"\n <span>":this.$container.innerHTML=it({title:null==(t=this.locale)?void 0:t.BTN_CALENDAR});this.dataPickerUtil=new yi(this.$container,{staticPath:this.options.staticPath,language:"zh"===this.options.language?"zh-CN":"en-US",current:new Date(this._value+" 00:00:00"),maxDate:this.options.maxDate||new Date,place:n()?"bottom-left":"top-right",onChange:function(e){e&&i._value!==Ti.formate(e,"YYYY-MM-DD")&&(i._value=Ti.formate(e,"YYYY-MM-DD"),null==i.options.onChange||i.options.onChange.call(i.options,e),i.emit(B.control.dateChange,e),e&&i.$container.querySelector("."+x+"-mobile-date-filter-value")&&(i.$container.querySelector("."+x+"-mobile-date-filter-value").innerHTML=i._getDateStr()))},onPanelChange:function(e,t){null==i.options.onPanelChange||i.options.onPanelChange.call(i.options,e,t),i.emit(B.control.datePanelOpenChange,e,t)}})},i.setDate=function(e,t){var n;void 0===t&&(t=!0),null==(n=this.dataPickerUtil)||n.setDate(e,t),e&&!t&&this._value!==Ti.formate(e,"YYYY-MM-DD")&&(this._value=Ti.formate(e,"YYYY-MM-DD"),e&&this.$container.querySelector("."+x+"-mobile-date-filter-value")&&(this.$container.querySelector("."+x+"-mobile-date-filter-value").innerHTML=this._getDateStr()))},i.reset=function(){var t;null==(t=this.dataPickerUtil)||t.hide(),e.prototype.reset.call(this)},i.destroy=function(){this.dataPickerUtil&&(this.dataPickerUtil.destroy(),this.dataPickerUtil=null),e.prototype.destroy.call(this)},i._getDateStr=function(){var e=this._value.split("-");return e[1]+"."+e[2]},i._onControlClick=function(t){e.prototype._onControlClick.call(this,t)},t}(Z);function Si(){return Si=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Si.apply(this,arguments)}function Ei(e,t){return Ei=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ei(e,t)}var wi=function(e){function t(t){var n,i,r;return(n=e.call(this,Si({},t,{tagName:"div",controlType:"block",classNameSuffix:"time-line"}))||this)._$add=null,n._$reduce=null,n._currentTime=0,n.records=[],n._currentTime=0,n._options=t,n.records=(null==(r=n._options)||null==(i=r.props)?void 0:i.recordList)||[],n._render(),n.on(B.setAllDayRecTimes,(function(e){var t,i;n.records=e,null==(i=n.timeLineUtil)||null==(t=i.updateTimeSections)||t.call(i,e)})),n.on(B.getOSDTime,(function(e){if(e){var t,i,r=new Date(1e3*e);n._currentTime=r.getTime(),null==(i=n.timeLineUtil)||null==(t=i.update)||t.call(i,r)}})),n}!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&&Ei(e,t)}(t,e);var i=t.prototype;return i._render=function(){var e,t,i=this,r={language:this._options.language||"zh",coverQuery:this._options.coverQuery||"",onChange:function(e){i._currentTime!==(null==e?void 0:e.getTime())&&(null==i._options.onChange||i._options.onChange.call(i._options,e),i.emit(B.control.timeLineChange,e))},onPickerOpenChange:function(e){i.emit(B.control.timeLinePanelOpenChange,e)},onPickerSelect:function(e){var t=null;try{t=10===(e.startTime+"").length?new Date(1e3*e.startTime):(e.startTime,new Date(e.startTime)),null==i._options.onChange||i._options.onChange.call(i._options,t),i.emit(B.control.timeLineChange,t)}catch(e){}}};n()?this.timeLineUtil=new z.MobileTimeLine(this.$container,r):(this.timeLineUtil=new z.TimeLine(this.$container,r),this._renderAddReduce()),null==(t=this.timeLineUtil)||null==(e=t.updateTimeSections)||e.call(t,this.records),this.timeLineUtil.update(new Date)},i.setWidth=function(e){n()||this.timeLineUtil.resize(e)},i._renderAddReduce=function(){var e=this;this._$add=document.createElement("span"),this._$add.classList.add(x+"-time-line-scale-add"),this._$add.innerHTML=ot(),this._$add.addEventListener("click",(function(){if(e.timeLineUtil){var t=Math.floor(e.timeLineUtil.timeWidth);e.timeLineUtil.setTimeWidth(t+1)}})),this._$reduce=document.createElement("span"),this._$reduce.classList.add(x+"-time-line-scale-sub"),this._$reduce.innerHTML=at(),this._$reduce.addEventListener("click",(function(){if(e.timeLineUtil){var t=Math.floor(e.timeLineUtil.timeWidth);e.timeLineUtil.setTimeWidth(t-1)}})),this.$container.appendChild(this._$add),this.$container.appendChild(this._$reduce)},i.destroy=function(){this._$add&&(this._$add.remove(),this._$add=null),this._$reduce&&(this._$reduce.remove(),this._$reduce=null),this.timeLineUtil&&(this.timeLineUtil.destroy(),this.timeLineUtil=null),e.prototype.destroy.call(this)},i._onControlClick=function(e){null==this._options.onClick||this._options.onClick.call(this._options,e)},t}(Z);function ki(){return ki=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ki.apply(this,arguments)}function Pi(e,t){return Pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pi(e,t)}var Di=function(e){function t(t){var n;return(n=e.call(this,ki({},t,{tagName:"span",controlType:"text",classNameSuffix:"device"}))||this)._render(),n}!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&&Pi(e,t)}(t,e);var n=t.prototype;return n._render=function(){var e,t;this.$container.innerHTML='<span class="'+x+"-text "+x+'-text-device">'+this._splicingString(this.__options.deviceName,null==(t=this.__options.props)||null==(e=t.urlInfo)?void 0:e.deviceSerial)+"</span>"},n.update=function(e,t){if(this.$container.querySelector("."+x+"-text-device")){var n=this.$container.querySelector("."+x+"-text-device"),i=this._splicingString(e,t);null==n||n.setAttribute("title",i),n.innerHTML=i}},n._splicingString=function(e,t){return(e||"")+(t?e?"("+t+")":""+t:"")},t}(Z),Li={play:mt,volume:wt,device:Di,capturePicture:In,ptz:jn,record:Hn,talk:qn,zoom:on,definition:di,fullscreen:Mt,globalFullscreen:Ln,rec:Ft,speed:vi,date:Ci,timeLine:wi};function zi(e,t){return zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},zi(e,t)}var xi=function(e){function t(t,n){var i;return void 0===n&&(n={hasDatePicker:!0}),(i=e.call(this)||this).options=n,i.$container=t,i.$popupContainer=document.createElement("div"),i.$popupContainer.classList.add(x+"-rec-footer"),i.options.hasDatePicker&&i.$popupContainer.classList.add(x+"-rec-footer-has-date-picker"),i.$container.appendChild(i.$popupContainer),i.$timeLineContainer=document.createElement("div"),i.$timeLineContainer.classList.add(x+"-rec-footer-time-line"),i.options.hasDatePicker&&(i.$popupContainer.appendChild(i.$timeLineContainer),i.$datePickerContainer=document.createElement("div"),i.$datePickerContainer.classList.add(x+"-rec-footer-date-picker"),i.$popupContainer.appendChild(i.$datePickerContainer)),i.$popupContainer.addEventListener("dblclick",(function(e){e.preventDefault(),e.stopPropagation()})),i}return 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&&zi(e,t)}(t,e),t.prototype.destroy=function(){var e,t,n,i;(this.$datePickerContainer&&(this.$datePickerContainer.remove(),this.$datePickerContainer=null),this.$timeLineContainer)&&(null==(t=this.$timeLineContainer)||null==(e=t.remove)||e.call(t),this.$timeLineContainer=null);this.$popupContainer&&(null==(i=this.$popupContainer)||null==(n=i.remove)||n.call(i),this.$popupContainer=null);this.emit(B.theme.recFooterDestroy)},t}(y);function Oi(e,t){return Oi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Oi(e,t)}var Ii=function(e){function t(t){var n;return(n=e.call(this)||this)._$siblingContainer=t,n.render(),n}!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&&Oi(e,t)}(t,e);var n=t.prototype;return n.render=function(){this.$container||(this.$container=document.createElement("div"),this.$container.classList.add(x+"-mobile-extend"),null==this._$siblingContainer.insertAdjacentElement||this._$siblingContainer.insertAdjacentElement.call(this._$siblingContainer,"afterend",this.$container),this.$controlPanel=document.createElement("div"),this.$controlPanel.classList.add(x+"-mobile-extend-control-panel"),this.$container.appendChild(this.$controlPanel),this.$content=document.createElement("div"),this.$content.classList.add(x+"-mobile-extend-control-content"),this.$controlPanel.appendChild(this.$content),this.$top=document.createElement("div"),this.$top.classList.add(x+"-mobile-extend-control-top"),this.$content.appendChild(this.$top),this.$topLeft=document.createElement("div"),this.$topLeft.classList.add(x+"-mobile-extend-control-top-left"),this.$top.appendChild(this.$topLeft),this.$topRight=document.createElement("div"),this.$topRight.classList.add(x+"-mobile-extend-control-top-right"),this.$top.appendChild(this.$topRight))},n.destroy=function(){var e;null==(e=this.$container)||e.remove(),this.emit(B.theme.mobileExtendDestroy)},t}(y);function Ri(){return Ri=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ri.apply(this,arguments)}function Mi(e,t){return Mi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mi(e,t)}var Ni={},$i=function(e){function t(t){var n;return void 0===t&&(t={}),(n=e.call(this,Object.assign({},Ni,Ri({},t,{tagName:"div",controlType:"block",classNameSuffix:"pause"})))||this)._timer=null,n._timer2=null,n._timer3=null,n._firstFlag=!1,n._options=Object.assign({},Ni,t),n.$container.classList.add(x+"-pause",x+"-hide"),n}!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&&Mi(e,t)}(t,e);var n=t.prototype;return n.show=function(e,t){var n,i,r=this;this.$container&&(this._firstFlag?this.$container.style.cssText+="pointer-events: none;":this._firstFlag=!0,this.$container.innerHTML=e?'<div class="'+x+'-pause-circle">'+ze()+"</div>":'<div class="'+x+'-pause-circle">'+xe()+"</div>",this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer2&&(clearTimeout(this._timer2),this._timer2=null),null==(i=this.$container)||null==(n=i.classList)||n.remove(x+"-hide"),this._timer=setTimeout((function(){var e,n;r._timer&&(clearTimeout(r._timer),r._timer=null),t||(null==(n=r.$container)||null==(e=n.classList)||e.add(x+"-pause-transform"),r._timer2=setTimeout((function(){var e,t,n,i;r._timer2&&(clearTimeout(r._timer2),r._timer2=null),null==(t=r.$container)||null==(e=t.classList)||e.add(x+"-hide"),null==(i=r.$container)||null==(n=i.classList)||n.remove(x+"-pause-transform")}),300))}),10))},n.destroy=function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer2&&(clearTimeout(this._timer2),this._timer2=null),this._timer3&&(clearTimeout(this._timer3),this._timer3=null),this.hide(),e.prototype.destroy.call(this)},n._onControlClick=function(e){var t=this;if(e.stopPropagation(),e.preventDefault(),this._firstFlag){if(this._timer3)return clearTimeout(this._timer3),void(this._timer3=null);this._timer3=setTimeout((function(){t._timer3&&(clearTimeout(t._timer3),t._timer3=null),t.emit(B.control.play,!0,"pause")}),250)}},t}(Z),Fi=function(e){if(e.controls){var t=Object.keys(e.controls).length>0||e._header||e._footer;if(e._interactiveResult&&(null==e._interactiveResult.cleanup||e._interactiveResult.cleanup.call(e._interactiveResult),e._interactiveResult=null),t&&e.emit(B.control.beforeUnmountControls),Object.keys(e.controls).length>0){for(var n in e.controls){var i,r;null==(i=(r=e.controls[n]).destroy)||i.call(r)}e.controls=null}e._pauseControl&&(null==e._pauseControl.destroy||e._pauseControl.destroy.call(e._pauseControl)),e._loadingControl&&(null==e._loadingControl.destroy||e._loadingControl.destroy.call(e._loadingControl)),e.messageControl&&(null==e.messageControl.destroy||e.messageControl.destroy.call(e.messageControl)),e.posterControl&&(null==e.posterControl.destroy||e.posterControl.destroy.call(e.posterControl)),e._headerMoreControl&&(null==e._headerMoreControl.destroy||e._headerMoreControl.destroy.call(e._headerMoreControl),e._headerMoreControl=null),e._footerMoreControl&&(null==e._footerMoreControl.destroy||e._footerMoreControl.destroy.call(e._footerMoreControl),e._footerMoreControl=null),e._recFooter&&(e._recFooter.destroy(),e._recFooter=null),e._mobileExtend&&(e._mobileExtend.destroy(),e._mobileExtend=null),e._header&&(e._header.destroy(),e._header=null),e._footer&&(e._footer.destroy(),e._footer=null),e._onPauseTimingFunc&&(e._onPauseTimingFunc=null),t&&e.emit(B.control.unmountedControls)}};function ji(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Ui(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Bi(){return Bi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Bi.apply(this,arguments)}function Vi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ji(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ji(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Yi(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var Zi=["ptz"];function Hi(e,t,n,i){if(void 0===i&&(i={}),e.$container)for(var r,o=Vi(n);!(r=o()).done;){var a,s,l,c,d,u,p=r.value;if(!(((null==(a=e.options.mobileExtendOptions)?void 0:a.controls)||[]).includes(p.iconId)&&"ptz"!==p.iconId||(null==(l=e.options.mobileExtendOptions)||null==(s=l.controls)?void 0:s.includes("rec"))&&F.includes(p.iconId))||!gt.isMobile)if(F.includes(p.iconId)&&e._header)Wi(e,e._header.$right,p.iconId,i);else if(j.includes(p.iconId))null!==e.options.deviceOptions&&((null==(c=e.controls)?void 0:c.deviceControl)||(e.controls.deviceControl=new Li.device(Bi({rootContainer:e.$container,getPopupContainer:function(){return t},recType:e.recType,language:e.options.language,locales:e.i18n.translations,type:e.options.type,deviceSerial:e.urlInfo.deviceSerial,channelNo:e.urlInfo.channelNo},(null==(d=e.options)?void 0:d.deviceOptions)||{},{props:i}))));else if(Li[p.iconId]){if(null!==e.options[p.iconId+"Options"])e.controls[p.iconId+"Control"]=new Li[p.iconId](Bi({rootContainer:e.$container,getPopupContainer:function(){return t},language:e.options.language||"zh",locales:e.i18n.translations},Zi.includes(p.iconId)?{env:e.options.env,accessToken:e.options.accessToken,token:e.options.token,deviceSerial:e.urlInfo.deviceSerial,channelNo:e.urlInfo.channelNo}:{},{PLAY_TYPE:e.options.type},(null==(u=e.options)?void 0:u[p.iconId+"Options"])||{},{props:i}))}else e.logger.warn("["+p.iconId+"] control does not exist")}}function Gi(e,t){return(n=function(){var n,i,r,o,a,s,l,c,d,u,p,h,m,A,f,v,g,y,T,_,b,C,S,E,w,k,P,D;return Yi(this,(function(L){switch(L.label){case 0:return[4,yn(e,t)];case 1:if(s=L.sent(),Fi(e),"[object Object]"!==Object.prototype.toString.call(s))return[2];if(null!==e.options.loadingOptions&&(e._loadingControl=new K(Bi({language:e.options.language,locales:e.i18n.translations},e.options.loadingOptions||{},{getPopupContainer:function(){return e.$container}}))),null!==e.options.pauseOptions&&(e._pauseControl=new $i(Bi({language:e.options.language,locales:e.i18n.translations},e.options.pauseOptions||{},{getPopupContainer:function(){return e.contentControl.$wrapper}})),e.options.autoPlay||e._pauseControl.show(!1,!0)),null!==e.options.messageOptions&&(e.messageControl=new dt(Bi({rootContainer:e.$container},e.options.messageOptions||{},{getPopupContainer:function(){return e.contentControl.$wrapper}}))),null!==e.options.posterOptions&&(e.posterControl=new X(Bi({},e.options.posterOptions||{},{getPopupContainer:function(){return e.contentControl.$video}}))),e.controls={},e.emit(B.control.beforeMountControls),l=function(e){var t,n,i,r={};r.autoFocus=null!=(i=null==e?void 0:e.autoFocus)?i:3,r.poster=(null==e?void 0:e.poster)||"";var o,a,s,l,c,d,u=[],p=[],h=((null==e||null==(t=e.header)?void 0:t.btnList)||[]).filter((function(e){return 1===e.isrender&&["deviceID","deviceName"].includes(e.iconId)?(u.push(e),!1):1===e.isrender&&F.includes(e.iconId)?(p.push(p[0]?An({},e,{part:p[0].part}):e),!1):1===e.isrender})).map((function(e){return vn[e.iconId]&&(e.iconId=vn[e.iconId]),e})),m=((null==e||null==(n=e.footer)?void 0:n.btnList)||[]).filter((function(e){return 1===e.isrender&&j.includes(e.iconId)?(u.push(e),!1):1===e.isrender&&F.includes(e.iconId)?(p.push(p[0]?An({},e,{part:p[0].part}):e),!1):1===e.isrender})).map((function(e){return vn[e.iconId]&&(e.iconId=vn[e.iconId]),e}));return h.length>0||u.length>0||p.length>0?(r.header={},r.header.color=null==e||null==(o=e.header)?void 0:o.color,r.header.backgroundColor=null==e||null==(a=e.header)?void 0:a.backgroundColor,r.header.activeColor=null==e||null==(s=e.header)?void 0:s.activeColor,r.header.btnList=[].concat(u||[],p||[],h||[])):r.header=void 0,m.length>0?(r.footer={},r.footer.color=null==e||null==(l=e.footer)?void 0:l.color,r.footer.backgroundColor=null==e||null==(c=e.footer)?void 0:c.backgroundColor,r.footer.activeColor=null==e||null==(d=e.footer)?void 0:d.activeColor,r.footer.btnList=m):r.footer=void 0,r}(s),e._themeData=l,l.poster&&e.setPoster(l.poster),e._playing||null==(n=e.posterControl)||n.show(),0===(c=M.reduce((function(t,n){return t[n]=e[n],t}),{})).width&&(c.width=Math.floor(e.$container.clientWidth)),0===c.height&&(c.height=Math.floor(e.$container.clientHeight)),l.header&&(e._header=new kn({getPopupContainer:function(){return e.$container},color:l.header.color,activeColor:l.header.activeColor,backgroundColor:l.header.backgroundColor}),d=gn(l.header.btnList||[]),u=d[0],p=d[1],Hi(e,e._header.$left,u,c),Hi(e,e._header.$right,p,c)),l.footer&&(e._footer=new Sn({getPopupContainer:function(){return e.$container},color:l.footer.color,activeColor:l.footer.activeColor,backgroundColor:l.footer.backgroundColor}),(e._header||e._footer)&&0!==(null==l?void 0:l.autoFocus)&&(e._interactiveResult=function(e,t,n){void 0===t&&(t=3e3);var i=null,r=!1,o=!1,a=e.querySelector("."+x+"-header"),s=e.querySelector("."+x+"-footer"),l=function(){i&&(clearTimeout(i),i=null)},c=function(){null==l||l(),null==a||a.classList.remove(x+"-hide-transition"),null==s||s.classList.remove(x+"-hide-transition"),r||n(!0),r=!0},d=function(){o||(null==l||l(),e.classList.contains(x+"-player-pause")||(null==a||a.classList.add(x+"-hide-transition"),null==s||s.classList.add(x+"-hide-transition"),r&&n(!1),r=!1))},u=function(){null==c||c(),i=setTimeout((function(){null==l||l(),null==d||d()}),t)},p=function(e){var t;null==e||null==(t=e.stopPropagation)||t.call(e),null==l||l()},h=function(){r?null==d||d():null==u||u()},m=function(e){var t;null==e||null==(t=e.stopPropagation)||t.call(e),null==u||u()};if(u(),gt.isMobile&&h){var A="click";e.addEventListener(A,h),s&&s.addEventListener(A,m),a&&a.addEventListener(A,m)}else{var f,v,g,y,T=window.PointerEvent?"pointerdown":"click";e.addEventListener(T,u),e.addEventListener("mousemove",u),e.addEventListener("mouseleave",d),s&&(null==s||null==(f=s.addEventListener)||f.call(s,T,p),null==s||null==(v=s.addEventListener)||v.call(s,"mousemove",p)),a&&(null==a||null==(g=a.addEventListener)||g.call(a,T,p),null==a||null==(y=a.addEventListener)||y.call(a,"mousemove",p))}return{cleanup:function(){if(e){if(gt.isMobile&&h){var t="click";e.removeEventListener(t,h),s&&u&&s.removeEventListener(t,m),a&&u&&a.removeEventListener(t,m)}if(u){var n,i,r,A,f=window.PointerEvent?"pointerdown":"click";e.removeEventListener(f,u),e.removeEventListener("mousemove",u),e.removeEventListener("mouseleave",d),s&&l&&(null==s||null==(n=s.removeEventListener)||n.call(s,f,p),null==s||null==(i=s.removeEventListener)||i.call(s,"mousemove",p)),a&&l&&(null==a||null==(r=a.removeEventListener)||r.call(a,f,p),null==a||null==(A=a.removeEventListener)||A.call(a,"mousemove",p))}d&&e.removeEventListener("mouseleave",d),h=null,u=null,d=null,c=null,m=null,p=null,null==l||l(),l=null,o=!1}},clearTimeout:function(){null==l||l(),o=!0},setTimeoutShow:function(){null==u||u(),o=!1},hide:d}}(e.$container,1e3*((null==s?void 0:s.autoFocus)||3),(function(t){e.emit(B.control.controlsBarOpenChange,t)})),e._onPauseTimingFunc&&(e.removeListener(N,e._onPauseTimingFunc),e._onPauseTimingFunc=null),e._onPauseTimingFunc=function(t){var n,i,r,o;t?null==(i=e._interactiveResult)||null==(n=i.clearTimeout)||n.call(i):e._playing&&(null==(o=e._interactiveResult)||null==(r=o.setTimeoutShow)||r.call(o))},e.on(N,e._onPauseTimingFunc),e._onPauseTimingFunc(!e._playing)),(null==(h=e.controls)?void 0:h.volumeControl)&&(e.controls.volumeControl.disabled=!0),(null==(m=e.controls)?void 0:m.globalFullscreenControl)&&!e.playing&&(e.controls.globalFullscreenControl.disabled=!0),A=gn(l.footer.btnList||[]),f=A[0],v=A[1],Hi(e,e._footer.$left,f,c),Hi(e,e._footer.$right,v,c)),y=[].concat((null==(i=l.header)?void 0:i.btnList)||[],null!=(g=null==(r=l.footer)?void 0:r.btnList)?g:[]),T=y.some((function(e){return F.includes(e.iconId)})),gt.isMobile||null===e.options.timeLineOptions||e.options.disabledTimeLine||!T||(e._recFooter=new xi(e.$container,{hasDatePicker:null!==e.options.dateOptions}),Qi(e,e._recFooter.$timeLineContainer,c),e._footer&&(e._footer.$container.style.cssText+="bottom: 36px;"),null!==e.options.dateOptions&&Ki(e,e._recFooter.$datePickerContainer,c)),gt.isMobile&&(null==(a=e.options.mobileExtendOptions)||null==(o=a.controls)?void 0:o.length)){if(!(w=y.some((function(e){return"ptz"===e.iconId})))&&!T)return[2];e._mobileExtend=new Ii(e.$container),null!==e.options.dateOptions&&(null==(_=e.options.mobileExtendOptions)?void 0:_.controls.includes("date"))&&T&&Ki(e,e._mobileExtend.$topLeft,c),null!==e.options.recOptions&&(null==(b=e.options.mobileExtendOptions)?void 0:b.controls.includes("rec"))&&T&&[].concat((null==(k=l.header)?void 0:k.btnList)||[],null!=(D=null==(P=l.footer)?void 0:P.btnList)?D:[]).forEach((function(t){var n;F.includes(t.iconId)&&Wi(e,null==(n=e._mobileExtend)?void 0:n.$topRight,t.iconId,c)})),null===e.options.timeLineOptions&&e.options.disabledTimeLine||!(null==(C=e.options.mobileExtendOptions)?void 0:C.controls.includes("timeLine"))||!T||Qi(e,e._mobileExtend.$content,c),gt.isMobile&&(null==(E=e.options.mobileExtendOptions)||null==(S=E.controls)?void 0:S.includes("ptz"))&&w&&e.controls.ptzControl&&e.controls.ptzControl.renderMobileExtend(e._mobileExtend.$content)}return e.emit(B.control.mountedControls),e.playing||e._disabled(!0),function(e){var t,n,i,r,o,a,s,l,c,d,u,p,h,m,A;e._recFooter&&e._recFooter.on(B.theme.recFooterDestroy,(function(){e.emit(B.theme.recFooterDestroy)})),e._mobileExtend&&e._mobileExtend.on(B.theme.mobileExtendDestroy,(function(){e.emit(B.theme.mobileExtendDestroy)})),e._pauseControl&&e._pauseControl.on(B.control.play,(function(t,n){e.playing||(e.playing=t,e.emit(B.control.play,t,n))})),(null==(t=e.controls)?void 0:t.playControl)&&(e.controls.playControl.on(B.control.play,(function(t){e.playing!==t&&(e.playing=t,e.emit(B.control.play,t))})),e.controls.playControl.on(B.control.playDestroy,(function(){e.emit(B.control.playDestroy)}))),(null==(n=e.controls)?void 0:n.volumeControl)&&(e.controls.volumeControl.on(B.control.volumechange,(function(t,n){e.muted!==n&&(e.muted=n),e.volume!==t&&(e.volume=t),e.emit(B.control.volumechange,t,n)})),e.controls.volumeControl.on(B.control.volumePanelOpenChange,(function(t,n,i){e.emit(B.control.volumePanelOpenChange,t,n,i)})),e.controls.volumeControl.on(B.control.volumeDestroy,(function(){e.emit(B.control.volumeDestroy)}))),(null==(i=e.controls)?void 0:i.ptzControl)&&(e.controls.ptzControl.on(B.control.ptzPanelOpenChange,(function(t){gt.isMobile&&e.emit(N,t),e.emit(B.control.ptzPanelOpenChange,t)})),e.controls.ptzControl.on(B.control.ptzSpeedChange,(function(t){e.emit(B.control.ptzSpeedChange,t),e.emit(B.ptzSpeedChange,t)})),e.controls.ptzControl.on(B.control.ptzError,(function(t){e.emit(B.control.ptzError,t);var n=e.i18n.t(t.localeKey);/^\[missing/.test(n)&&(n=t.msg),e.emit(B.message,n+" ["+t.code+"]","ptzError",2)})),e.controls.ptzControl.on(B.control.ptzDestroy,(function(){e.emit(B.control.ptzDestroy)}))),(null==(r=e.controls)?void 0:r.recordControl)&&(e.controls.recordControl.on(B.control.recordingChange,(function(t){e.recording!==t&&e.emit(B.control.recordingChange,t)})),e.controls.recordControl.on(B.control.recordDestroy,(function(){e.emit(B.control.recordDestroy)}))),(null==(o=e.controls)?void 0:o.talkControl)&&(e.controls.talkControl.on(B.control.talkingChange,(function(t){e.talking!==t&&e.emit(B.control.talkingChange,t)})),e.controls.talkControl.on(B.control.talkDestroy,(function(){e.emit(B.control.talkDestroy)}))),(null==(a=e.controls)?void 0:a.zoomControl)&&(e.controls.zoomControl.on(B.control.zoomChange,(function(t,n,i){e.zoom!==t&&(e.zoom=t,e.emit(B.control.zoomChange,t))})),e.controls.zoomControl.on(B.control.zoomPanelOpenChange,(function(t,n){e.zooming!==t&&(e.zooming=t,e.emit(B.control.zoomPanelOpenChange,t))})),e.controls.zoomControl.on(B.control.zoomDestroy,(function(){e.zooming&&(e.zoom=1,e.zooming=!1),e.emit(B.control.zoomDestroy)}))),(null==(s=e.controls)?void 0:s.definitionControl)&&(e.controls.definitionControl.on(B.control.definitionPanelOpenChange,(function(t,n,i){e.emit(N,t,n),e.emit(B.control.definitionPanelOpenChange,t,n,i)})),e.controls.definitionControl.on(B.control.definitionChange,(function(t,n){e.emit(B.control.definitionChange,t,n)})),e.controls.definitionControl.on(B.control.definitionDestroy,(function(){e.emit(B.control.definitionDestroy)}))),(null==(l=e.controls)?void 0:l.speedControl)&&(e.controls.speedControl.on(B.control.speedPanelOpenChange,(function(t,n,i){e.emit(N,t,n),e.emit(B.control.speedPanelOpenChange,t,n,i)})),e.controls.speedControl.on(B.control.speedChange,(function(t,n){e.emit(B.control.speedChange,t,n)})),e.controls.speedControl.on(B.control.speedDestroy,(function(){e.emit(B.control.speedDestroy)}))),(null==(c=e.controls)?void 0:c.capturePictureControl)&&(e.controls.capturePictureControl.on(B.control.capturePicture,(function(t){e.emit(B.control.capturePicture,t)})),e.controls.capturePictureControl.on(B.control.capturePictureDestroy,(function(){e.emit(B.control.capturePictureDestroy)}))),(null==(d=e.controls)?void 0:d.fullscreenControl)&&e.controls.fullscreenControl.on(B.control.fullscreenDestroy,(function(){e.emit(B.control.fullscreenDestroy)})),(null==(u=e.controls)?void 0:u.globalFullscreenControl)&&e.controls.globalFullscreenControl.on(B.control.globalFullscreenDestroy,(function(){e.emit(B.control.globalFullscreenDestroy)})),(null==(p=e.controls)?void 0:p.deviceControl)&&e.controls.deviceControl.on(B.control.deviceDestroy,(function(){e.emit(B.control.deviceDestroy)})),(null==(h=e.controls)?void 0:h.recControl)&&(e.controls.recControl.on(B.control.recTypeChange,(function(t){var n;e.recType!==t&&(e.recType=t,e.emit(B.control.recTypeChange,t),(null==(n=e._headerMoreControl)?void 0:n.picker)&&(e._headerMoreControl.picker.open=!1))})),e.controls.recControl.on(B.control.recDestroy,(function(){e.emit(B.control.recDestroy)}))),(null==(m=e.controls)?void 0:m.timeLineControl)&&(e.controls.timeLineControl.on(B.control.timeLineChange,(function(t){e.emit(B.control.timeLineChange,t)})),e.controls.timeLineControl.on(B.control.timeLinePanelOpenChange,(function(t){var n,i,r;(null==(n=e.controls.dateControl)?void 0:n.dataPickerUtil)&&(null==(r=e.controls.dateControl)||null==(i=r.dataPickerUtil)||i.hide()),e.emit(B.control.timeLinePanelOpenChange,t)})),e.controls.timeLineControl.on(B.control.timeLineDestroy,(function(){e.emit(B.control.timeLineDestroy)}))),(null==(A=e.controls)?void 0:A.dateControl)&&(e.controls.dateControl.on(B.control.datePanelOpenChange,(function(t,n){e.emit(B.control.datePanelOpenChange,t,n)})),e.controls.dateControl.on(B.control.dateChange,(function(t){e.emit(B.control.dateChange,t)})),e.controls.dateControl.on(B.control.dateDestroy,(function(){e.emit(B.control.recDestroy)}))),e.contentControl&&e.contentControl.on(B.control.contentRerender,(function(t){e.emit(B.control.contentRerender,t)}))}(e),[2]}}))},function(){var e=this,t=arguments;return new Promise((function(i,r){var o=n.apply(e,t);function a(e){Ui(o,i,r,a,s,"next",e)}function s(e){Ui(o,i,r,a,s,"throw",e)}a(void 0)}))})();var n}var Qi=function(e,t,n){var i,r;(void 0===n&&(n={}),e.controls.timeLineControl||null===e.options.timeLineOptions)||(e.controls.timeLineControl=new Li.timeLine(Bi({getPopupContainer:function(){return t},language:e.options.language,locales:e.i18n.translations,coverQuery:(null==(i=e.urlInfo)?void 0:i.validateCode)?"decodekey="+e.urlInfo.validateCode:""},(null==(r=e.options)?void 0:r.timeLineOptions)||{},{props:n})))},Ki=function(e,t,n){var i;(void 0===n&&(n={}),e.controls.dateControl||null===e.options.dateOptions)||(e.controls.dateControl=new Li.date(Bi({getPopupContainer:function(){return t},language:e.options.language,locales:e.i18n.translations,staticPath:e.options.staticPath},(null==(i=e.options)?void 0:i.dateOptions)||{},{props:n})))},Wi=function(e,t,n,i){var r,o,a,s;(void 0===i&&(i={}),!(null==(r=e.controls)?void 0:r.recControl)&&null!==e.options.recOptions&&t)&&(e.controls.recControl=new Li.rec(Bi({getPopupContainer:function(){return t},recType:e.recType,language:e.options.language,locales:e.i18n.translations},(null==(s=e.options)?void 0:s.recOptions)||{},{props:i})));(null==(o=e.controls)?void 0:o.recControl)&&(null==(a=e.controls)?void 0:a.recControl).addRecType(n)};function Ji(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function qi(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Xi(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){qi(o,i,r,a,s,"next",e)}function s(e){qi(o,i,r,a,s,"throw",e)}a(void 0)}))}}function er(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function tr(){return tr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},tr.apply(this,arguments)}function nr(e,t){return nr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nr(e,t)}function ir(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ji(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ji(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rr(e,t){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var or={dblClickFullscreen:!0,language:"zh",autoPlay:!0,scaleMode:O,loggerOptions:{level:"INFO",showTime:!0},env:{domain:"https://open.ys7.com"},mobileExtendOptions:{controls:["ptz","timeLine","rec","date"]}},ar=function(t){function n(e){var n,r,o,a,s,l,c,d,u,p,h,m,A,f,v,g,y,T,_,b,C;((n=t.call(this)||this).options=or,n.staticPath="",n.controls={},n._seekDate=null,n.recType="",n._headerMoreControl=null,n._footerMoreControl=null,n._header=null,n._footer=null,n._recFooter=null,n._mobileExtend=null,n._interactiveResult=null,n._themeData=null,n._fullscreen=null,n.zoomUtil=null,n._cleanupOrientation=null,n._cleanUpResizeObserver=null,n._width=0,n._height=0,n._isCurrentFullscreen=!1,n._orientationAngle=0,n._playing=!1,n._loading=!1,n._volume=0,n._muted=!1,n._zoom=1,n._zooming=!1,n._recording=!1,n._talking=!1,n._speed=1,n._videoLevelAuto=!1,n.videoLevelList=[],n.recordList=[],n._resizeOverflowTimer=null,n._onPauseTimingFunc=null,n.destroyed=!1,n.urlInfo=null,n.scaleMode=0,n._initOptions(e),"ezopen"===n.options.type)&&(n.urlInfo=i(n.options.url),(null==(d=n.urlInfo)||null==(c=d.searchParams)?void 0:c.spaceId)&&(n.options.spaceId=n.urlInfo.searchParams.spaceId),"rec"===n.urlInfo.type&&(n._seekDate=(null==(p=n.urlInfo)||null==(u=p.searchParams)?void 0:u.begin)?Ti.strToDate(null==(m=n.urlInfo)||null==(h=m.searchParams)?void 0:h.begin):Ti.strToDate(Ti.formate(new Date,"YYYY/MM/DD")+" 00:00:00")));return n._getRecType(n.options.url),Jt(n,B),null==e.onInitializing||e.onInitializing.call(e,n),n.options.autoPlay&&(n.playing=!0),n._initClassName(),n.contentControl=new Zt({getContainer:function(){return n.$container},scaleMode:n.scaleMode}),function(e,t,n){e.zoomUtil=new ln(t,cn({},n||{},{min:1,onChange:function(t,i){var r;t!==e._zoom&&(e.zoom=t,null==n||null==(r=n.onChange)||r.call(n,t,i))},onTranslateChange:function(t){var i;e.emit(B.zoomTranslateChange,t),null==n||null==(i=n.onTranslateChange)||i.call(n,t)},onTap:null==n?void 0:n.onTap}))}(n,n.contentControl.$content,tr({},n.options.zoomOptions||{},{onTap:function(){var e,t;null==(t=n._interactiveResult)||null==(e=t.setTimeoutShow)||e.call(t)}})),n._volume=null!=(f=null!=(A=null==(r=n.options.volumeOptions)?void 0:r.volume)?A:n.options.volume)?f:.8,n._muted=null!=(g=null!=(v=null==(o=n.options.volumeOptions)?void 0:o.muted)?v:n.options.muted)&&g,n._speed=null!=(T=null!=(y=null==(a=n.options.speedOptions)?void 0:a.value)?y:n.options.value)?T:1,n._mobileInnerWidthHeight=n._mobileInnerWidthHeight.bind(n),n._throttleMobileInnerWidthHeight=At(n._mobileInnerWidthHeight,20).bind(n),n._onDblClickFullscreen=Kt(n._onDblClickFullscreen,20).bind(n),n._headerMoreControlShow=Kt(n._headerMoreControlShow.bind(n),200),n._footerMoreControlShow=Kt(n._footerMoreControlShow.bind(n),200),n.destroyed=!1,n._renderTheme(["flv","hls","mp4"].includes(e.type)?Bt:null!=(b=null!=(_=null==(s=n.options)?void 0:s.template)?_:null==(l=n.options)?void 0:l.themeData)?b:null),n._addEventListener(),null==(C=n)||C.on(B.audioCodecUnsupported,(function(){var e;(null==(e=C.controls)?void 0:e.volumeControl)&&C.controls.volumeControl.emit(B.audioCodecUnsupported)})),null==C||C.on(B.message,(function(e,t,n){var i;if(/error$/gi.test(t)&&["ptzError","talkError","themeError","3DZoomError"].includes(t))null==(i=C.messageControl)||i.toastError(e,n);else if(/error$/gi.test(t)){var r;0===(n||0)&&(C.playing=!1),null==(r=C.messageControl)||r.error(e,n)}else if("warn"===t){var o;null==(o=C.messageControl)||o.warn(e,n)}else if("info"===t){var a;null==(a=C.messageControl)||a.info(e,n)}})),null==C||C.on(B.audioInfo,(function(e){var t;(null==C||null==(t=C.controls)?void 0:t.volumeControl)&&(e.audioFormatName||e.encType)&&(C.controls.volumeControl.disabled=!1)})),null==C||C.on(B.videoInfo,(function(e){var t,n;e&&(null==(n=C.contentControl)||null==(t=n.emit)||t.call(n,B.videoInfo,e.width,e.height))})),null==C||C.on(B.resize,(function(){var e,t;null==(t=C.contentControl)||null==(e=t.emit)||e.call(t,B.resize)})),null==C||C.on("getDeviceInfo",(function(e){})),null==C||C.on(B.firstFrameDisplay,(function(){C._disabled(!1)})),null==C||C.on(B.play,(function(e){var t,n;e&&(null==(n=C.messageControl)||n.hide()),(null==C||null==(t=C.controls)?void 0:t.globalFullscreenControl)&&(C.controls.globalFullscreenControl.disabled=!e)})),C.on(B.talkingChange,(function(e){var t,n,i,r;C._talking=e,e!==(null==(n=C.controls)||null==(t=n.talkControl)?void 0:t.active)&&(null==(r=C.controls)||null==(i=r.talkControl)||i.emit(B.talkingChange,e))})),C.on(B.talkVolumeChange,(function(e){var t,n,i;null==(i=C.controls)||null==(n=i.talkControl)||null==(t=n.emit)||t.call(n,B.talkVolumeChange,e)})),C.on(B.recordingChange,(function(e){var t,n;C._recording=e,e!==(null==(n=C.controls)||null==(t=n.recordControl)?void 0:t.active)&&(C.controls.recordControl.active=e)})),C.on(B.setVideoLevelList,(function(e){var t,n,i;null==(i=C.controls)||null==(n=i.definitionControl)||null==(t=n.emit)||t.call(n,B.setVideoLevelList,e||[])})),C.on(B.currentVideoLevel,(function(e,t){var n,i,r;null==(r=C.controls)||null==(i=r.definitionControl)||null==(n=i.emit)||n.call(i,B.currentVideoLevel,e,t)})),C.on(B.zoomingChange,(function(e){var t,n;(null==(n=C.controls)||null==(t=n.zoomControl)?void 0:t.active)!==e&&(C.controls.zoomControl.active=e)})),C.on(B.zoomChange,(function(e){var t,n;(null==(n=C.controls)||null==(t=n.zoomControl)?void 0:t.value)!==e&&(C.controls.zoomControl.value=e)})),C.on(B.speedChange,(function(e){var t,n,i;null==(i=C.controls)||null==(n=i.speedControl)||null==(t=n.emit)||t.call(n,B.speedChange,e)})),C.on(B.setAllDayRecTimes,(function(e){var t,n,i;null==(i=C.controls)||null==(n=i.timeLineControl)||null==(t=n.emit)||t.call(n,B.setAllDayRecTimes,e.list)})),C.on(B.getOSDTime,(function(e){var t,n,i;null==(i=C.controls)||null==(n=i.timeLineControl)||null==(t=n.emit)||t.call(n,B.getOSDTime,e.data)})),null==C||C.on(B.fullscreenChange,(function(e){var t,n,i,r;[0,180].includes(C.orientationAngle)&&e.isMobile&&e.isCurrentFullscreen?null==(n=C.zoomUtil)||null==(t=n.setTransform)||t.call(n,!0):null==(r=C.zoomUtil)||null==(i=r.setTransform)||i.call(r,!1)})),null==C||C.on(B.orientationChange,(function(e){var t,n,i,r;[0,180].includes(e)&&gt.isMobile&&C.isCurrentFullscreen?null==(n=C.zoomUtil)||null==(t=n.setTransform)||t.call(n,!0):null==(r=C.zoomUtil)||null==(i=r.setTransform)||i.call(r,!1)})),n}!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&&nr(e,t)}(n,t);var r=n.prototype;return r.resize=function(e,t){!function(e,t,n){var i="";/^\d+(\.\d+)?$/.test(t+"")?i+="width: "+t+"px;":t&&(i+="width: "+t+";"),/^\d+(\.\d+)?$/.test(n+"")?i+="height: "+n+"px;":n&&(i+="height: "+n+";"),e.$container&&(e.$container.style.cssText+=i)}(this,e,t)},r.fullscreen=function(){return Xi((function(){var e;return rr(this,(function(t){switch(t.label){case 0:return[4,null==(e=this._fullscreen)?void 0:e.fullscreen()];case 1:return[2,t.sent()]}}))})).call(this)},r.exitFullscreen=function(){return Xi((function(){var e;return rr(this,(function(t){switch(t.label){case 0:return[4,null==(e=this._fullscreen)?void 0:e.exitFullscreen()];case 1:return[2,t.sent()]}}))})).call(this)},r.changeTheme=function(e){this._renderTheme(e),null==this.emit||this.emit.call(this,B.changeTheme,e)},r.setPoster=function(e){var t;null==(t=this.posterControl)||t.setPoster(e)},r.setLoggerOptions=function(e){var t;void 0===e&&(e={}),null==(t=this.logger)||t.setOptions(e),null==this||this.emit(B.setLoggerOptions,e)},r.setScaleMode=function(e){if([0,1,2].includes(+e)){var t,n;this.scaleMode=+e,null==(n=this.contentControl)||null==(t=n.setScaleMode)||t.call(n,+e);for(var i,r=this.$container.classList,o=ir(r);!(i=o()).done;){var a=i.value;a.startsWith(x+"-scale-mode-")&&r.remove(a)}0===this.scaleMode?this.$container.classList.add(x+"-scale-mode-full"):1===this.scaleMode?this.$container.classList.add(x+"-scale-mode-auto"):2===this.scaleMode&&this.$container.classList.add(x+"-scale-mode-full-auto")}else{var s;null==(s=this.logger)||s.warn("scaleMode must be 0 | 1 | 2")}},r.destroy=function(){var e,t,n=this;this.$container&&!this.destroyed&&(this.emit(B.theme.beforeDestroy),this._removeEventListener(),Fi(this),null==(e=this.contentControl)||e.destroy(),this.contentControl=null,this._resizeOverflowTimer&&(clearTimeout(this._resizeOverflowTimer),this._resizeOverflowTimer=null),Array.from((null==(t=this.$container)?void 0:t.classList)||[]).forEach((function(e){new RegExp("^"+x+"-","g").test(e)&&n.$container.classList.remove(e)})),this.$container.classList.remove(""+x),this._themeData=null,this.i18n&&(this.i18n=null),this.recType="",this.emit(B.theme.destroyed),this.removeAllListeners(),this.logger&&(this.logger=null),this.destroyed=!0)},r._initOptions=function(t){var i,r,o,a;if(void 0===t&&(t={}),this.options=e(or,t,{clone:!1}),"function"==typeof this.options.container?this.$container=this.options.container():this.$container=this.options.container,!this.$container)throw new Error("container option is required!");if(["VIDEO","CANVAS"].includes(this.$container.tagName))throw new Error("container node cannot be video or canvas!");this.staticPath=this.options.staticPath,this.logger=l(tr({},this.options.loggerOptions||{},{name:(null==(i=this.options.loggerOptions)?void 0:i.name)||this.options.type.toUpperCase()})),this.logger.log(navigator.userAgent||"unknown"),this.logger.log("[Theme Version] ",n.THEME_VERSION),"container"in this.options&&delete this.options.container;try{this.logger.log("[options] \n",JSON.stringify(this.options))}catch(e){this.logger.log("[options] \n",this.options)}var c,d=this.options.language||"zh",u=e({zh:jt,en:Ut},this.options.locales||{},{clone:!1});(this.i18n=new s(u,{defaultLocale:d}),(null==(o=this.options.definitionOptions)||null==(r=o.list)?void 0:r.length)>0||(null==(a=this.options.videoLevelList)?void 0:a.length)>0)&&(this.videoLevelList=(null==(c=this.options.definitionOptions)?void 0:c.list)||this.options.videoLevelList);this.setScaleMode(this.options.scaleMode)},r._initClassName=function(){var e,t;this.$container.classList.add(x,gt.isMobile?x+"-mobile":x+"-pc"),["ezopen","flv","hls","mp4"].includes(this.options.type)&&this.$container.classList.add(x+"-"+this.options.type),["en","zh"].includes(this.options.language||"zh")&&this.$container.classList.add(x+"-lang-"+(this.options.language||"zh")),"string"==typeof this.options.className&&this.$container.classList.add(this.options.className),this.resize(null==(e=this.options)?void 0:e.width,null==(t=this.options)?void 0:t.height)},r._renderTheme=function(e){return Xi((function(){return rr(this,(function(t){return Gi(this,e),[2]}))})).call(this)},r._mobileInnerWidthHeight=function(){if(gt.isMobile){var e,t,n,i,r=Math.floor(window.innerHeight),o=Math.floor(window.innerWidth);null==(t=this.$container)||null==(e=t.style)||e.setProperty("--"+x+"-mobile-inner-height",r+"px"),null==(i=this.$container)||null==(n=i.style)||n.setProperty("--"+x+"-mobile-inner-width",o+"px")}},r._addEventListener=function(){var e=this;this._fullscreen=new Ot(this.$container,{prefix:x,onChange:function(t){var n;(t.isCurrentFullscreen?e.emit(B.fullscreen):e._isCurrentFullscreen&&e.emit(B.exitFullscreen),e._isCurrentFullscreen=t.isCurrentFullscreen,e.emit(B.fullscreenChange,tr({},t,{orientationAngle:e._orientationAngle})),e._isRotated(),gt.isMobile&&!e._isCurrentFullscreen)&&((null==(n=e.controls)?void 0:n.ptzControl)&&e.controls.ptzControl.reset())}});var t=function(t){if(e.$container){var n;switch(null==(n=e.$container.classList)||n.remove(x+"-angle-0",x+"-angle-90",x+"-angle-180",x+"-angle-270"),t.angle){case 0:e.$container.classList.add(x+"-angle-0");break;case 90:e.$container.classList.add(x+"-angle-90");break;case 180:e.$container.classList.add(x+"-angle-180");break;case 270:e.$container.classList.add(x+"-angle-270")}e.orientationAngle!==t.angle&&e.emit(B.orientationChange,t.angle),e._orientationAngle=t.angle,e._mobileInnerWidthHeight(),e._isRotated()}},i=gt.orientationEventListener(t),r=i[0],o=i[1];this._cleanupOrientation=o,t(r),this._mobileInnerWidthHeight(),window.addEventListener("resize",this._throttleMobileInnerWidthHeight),this._cleanUpResizeObserver=gt.resizeObserver(this.$container,At((function(){var t,i,r=Math.floor(e.$container.clientWidth),o=Math.floor(e.$container.clientHeight);(r>200&&r<=375?(e.$container.classList.add(x+"-medium-width"),e.$container.classList.remove(x+"-mini-width")):(r<=200?e.$container.classList.add(x+"-mini-width"):e.$container.classList.remove(x+"-mini-width"),e.$container.classList.remove(x+"-medium-width")),o>200&&o<=375?(e.$container.classList.add(x+"-medium-height"),e.$container.classList.remove(x+"-mini-height")):(o<=200?e.$container.classList.add(x+"-mini-height"):e.$container.classList.remove(x+"-mini-height"),e.$container.classList.remove(x+"-medium-height")),e.width!==r||e.height!==o)&&(e.emit(n.EVENTS.resize,{width:r,height:o,isCurrentFullscreen:e.isCurrentFullscreen,orientationAngle:e.orientationAngle}),e._width=r,e._height=o,(null==(i=e.controls)?void 0:i.timeLineControl)&&e.controls.timeLineControl.setWidth(r-20-36),e._headerMoreControlShow(),e._footerMoreControlShow());null==(t=e.$container)||t.classList.add(x+"-overflow-hidden"),e._resizeOverflowTimer&&(clearTimeout(e._resizeOverflowTimer),e._resizeOverflowTimer=null),e._resizeOverflowTimer=setTimeout((function(){var t;e._resizeOverflowTimer&&(clearTimeout(e._resizeOverflowTimer),e._resizeOverflowTimer=null),null==(t=e.$container)||t.classList.remove(x+"-overflow-hidden")}),200)}),20)),this.options.dblClickFullscreen&&!gt.isMobile&&this.$container.addEventListener("dblclick",this._onDblClickFullscreen)},r._headerMoreControlShow=function(){var e=this;if(this._header){var t,i,r,o,a=(null==(i=this._header)||null==(t=i.$left)?void 0:t.clientWidth)||0,s=(null==(o=this._header)||null==(r=o.$right)?void 0:r.clientWidth)||0,l=a+s+30>this._width;if(l){var c,d,u;if(!this._headerMoreControl&&(null==(c=this.controls)?void 0:c.recControl))this._headerMoreControl=new Qt({language:this.options.language,locales:this.i18n.translations,rootContainer:this.$container,getPopupContainer:function(){var t;return null==(t=e._header)?void 0:t.$right},placement:"br",controls:this.controls,open:!1,offset:[0,8],wrapClassName:x+"-header-more",onOpenChange:function(t){e.emit(B.control.headerMorePanelOpenChange,t)}}),null==(u=this.controls)||null==(d=u.recControl)||d.resetPopupContainer(this._headerMoreControl.$panel);this.emit(n.EVENTS.control.headerMoreShowControlsChange,l)}else if(this._width-a-s>100){var p,h,m,A,f;if(this._headerMoreControl&&(null==(p=this.controls)?void 0:p.recControl))null==(A=this.controls)||null==(m=A.recControl)||m.resetPopupContainer(null==(h=this._header)?void 0:h.$right),null==(f=this._headerMoreControl)||f.destroy(),this._headerMoreControl=null,this.emit(n.EVENTS.control.headerMoreShowControlsChange,!1)}}},r._footerMoreControlShow=function(){var e=this,t=function(){if(e._footer){var i,r,o=(null==(i=e._footer.$left)?void 0:i.clientWidth)||0,a=(null==(r=e._footer.$right)?void 0:r.clientWidth)||0;if(o+a+26>e._width){var s,l,c,d,u,p,h;!e._footerMoreControl&&(null==(s=e._footer)?void 0:s.$right)&&(e._footerMoreControl=new Qt({language:e.options.language,locales:e.i18n.translations,rootContainer:e.$container,getPopupContainer:function(){var t;return null==(t=e._footer)?void 0:t.$right},placement:"tr",controls:e.controls,open:!1,offset:[0,-8],wrapClassName:x+"-footer-more",onOpenChange:function(t){e.emit(B.control.footerMorePanelOpenChange,t)}}));var m=((null==(c=e._themeData)||null==(l=c.footer)?void 0:l.btnList)||[]).filter((function(t){var n,i=((null==(n=e._footerMoreControl)?void 0:n.list)||[]).findIndex((function(n){var i;return n.control===(null==(i=e.controls)?void 0:i[t.iconId+"Control"])}));return-1===i}));if(m.length<=0)return;if(0===(null==(u=e._footerMoreControl)||null==(d=u.list)?void 0:d.length))for(var A,f=ir([m.pop(),m.pop()]);!(A=f()).done;){var v=A.value;if(v){var g,y,T,_,b,C=v.iconId+"Control";null==(T=e.controls)||null==(y=T[C])||null==(g=y.resetPopupContainer)||g.call(y,e._footerMoreControl.$panel,"prepend"),null==(b=e._footerMoreControl)||b.add(C,v.part,null==(_=e.controls)?void 0:_[C])}}else if(e._footerMoreControl){var S=m.pop();if(!S)return;var E,w,k,P,D,L=S.iconId+"Control";null==(k=e.controls)||null==(w=k[L])||null==(E=w.resetPopupContainer)||E.call(w,e._footerMoreControl.$panel,"prepend"),null==(D=e._footerMoreControl)||D.add(L,S.part,null==(P=e.controls)?void 0:P[L])}e.emit(n.EVENTS.control.footerMoreShowControlsChange,!!e._footerMoreControl,null==(h=e._footerMoreControl)||null==(p=h.list)?void 0:p.map((function(e){return e.key}))),e._footerMoreControl&&t()}else if(e._width-o-a>110){var z,O;if(null==(O=e._footerMoreControl)||null==(z=O.list)?void 0:z.length){var I,R,M,N,$,F=null==(I=e._footerMoreControl)?void 0:I.list.shift();if(F){var j,U,V;if("left"===F.part)null==(V=F.control)||null==(U=V.resetPopupContainer)||U.call(V,e._footer.$left,"append");else if("right"===F.part){var Y,Z,H,G,Q,K;if(0===(null==(Z=e._footerMoreControl)||null==(Y=Z.list)?void 0:Y.length))null==(G=F.control)||null==(H=G.resetPopupContainer)||H.call(G,e._footer.$right,"append");else null==(K=F.control)||null==(Q=K.resetPopupContainer)||Q.call(K,e._footer.$right,"before",e._footerMoreControl.$container)}null==(j=e._footerMoreControl)||j.remove(F.control)}if(1===(null==(M=e._footerMoreControl)||null==(R=M.list)?void 0:R.length)){var W,J,q,X=null==(W=e._footerMoreControl)?void 0:W.list.shift();if(X){var ee,te,ne;if("left"===X.part)null==(ne=X.control)||null==(te=ne.resetPopupContainer)||te.call(ne,e._footer.$left,"append");else if("right"===X.part){var ie,re;null==(re=X.control)||null==(ie=re.resetPopupContainer)||ie.call(re,e._footer.$right,"append")}null==(ee=e._footerMoreControl)||ee.remove(X.control)}null==(q=e._footerMoreControl)||null==(J=q.destroy)||J.call(q),e._footerMoreControl=null}e.emit(n.EVENTS.control.footerMoreShowControlsChange,!!e._footerMoreControl,null==($=e._footerMoreControl)||null==(N=$.list)?void 0:N.map((function(e){return e.key}))),t()}}}};t()},r._removeEventListener=function(){var e,t,n,i;this._isCurrentFullscreen&&(null==(i=this._fullscreen)||i.exitFullscreen());null==(e=this._fullscreen)||e.destroy(),this._fullscreen=null,null==this._cleanupOrientation||this._cleanupOrientation.call(this),this._cleanupOrientation=null,null==(n=this._cleanUpResizeObserver)||null==(t=n.unobserve)||t.call(n),this._cleanUpResizeObserver=null,window.removeEventListener("resize",this._throttleMobileInnerWidthHeight),this._throttleMobileInnerWidthHeight=null,this.options.dblClickFullscreen&&!gt.isMobile&&this.$container.removeEventListener("dblclick",this._onDblClickFullscreen)},r._setVideoLevelList=function(e){this.videoLevelList=e},r._disabled=function(e){var t=this;void 0===e&&(e=!0),U.forEach((function(n){var i;(null==(i=t.controls)?void 0:i[n+"Control"])&&(t.controls[n+"Control"].disabled=e)}))},r._onDblClickFullscreen=function(){this.isCurrentFullscreen?this.exitFullscreen():this.fullscreen()},r._getRecType=function(e){if("ezopen"===this.options.type&&/^ezopen:\/\//.test(e)){var t,n=i(e);if("rec"===n.type)return"cloud"===n.recType&&"7"===(null==n||null==(t=n.searchParams)?void 0:t.busType)?(this.recType="cloudRecord","cloudRecord"):"cloud"===n.recType?(this.recType="cloudRec","cloudRec"):(this.recType="rec","rec")}return this.recType="",""},r.resetControl=function(){var e=this;this.zooming&&1!==this.zoom&&(this.zoom=1),["ptz","talk","record","speed"].forEach((function(t){var n;(null==(n=e.controls)?void 0:n[t+"Control"])&&e.controls[t+"Control"].reset()}))},r._isRotated=function(){var e,t,n,i;gt.isMobile&&(this.isCurrentFullscreen&&[0,180].includes(this._orientationAngle)?((null==(e=this.controls)?void 0:e.ptzControl)&&(this.controls.ptzControl.isRotated=!0),(null==(t=this.controls)?void 0:t.zoomControl)&&(this.controls.zoomControl.isRotated=!0)):((null==(n=this.controls)?void 0:n.ptzControl)&&(this.controls.ptzControl.isRotated=!1),(null==(i=this.controls)?void 0:i.zoomControl)&&(this.controls.zoomControl.isRotated=!1)))},er(n,[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"playing",get:function(){return this._playing},set:function(e){var t,n,i,r,o,a=this;if(this._playing!==e){var s,l,c,d;if(this._playing=e,e||(this.loading=!1,["ptz","talk","record"].forEach((function(e){var t;(null==(t=a.controls)?void 0:t[e+"Control"])&&a.controls[e+"Control"].reset()})),this._disabled(!0)),this.emit(B.play,e),null==(s=this.controls)?void 0:s.playControl)if(this.controls.playControl.playing!==e)null==(d=this.controls)||d.playControl.emit(B.play,e);null==(c=this._pauseControl)||null==(l=c.show)||l.call(c,e)}this._playing&&(null==(t=this.messageControl)||t.hide());this._playing?null==(i=this._interactiveResult)||null==(n=i.setTimeoutShow)||n.call(i):null==(o=this._interactiveResult)||null==(r=o.clearTimeout)||r.call(o)}},{key:"loading",get:function(){return this._loading},set:function(e){var t,n;(this._loading=e,e)?null==(t=this._loadingControl)||t.show():null==(n=this._loadingControl)||n.hide();this._loading!==e&&this.emit(B.loading,e)}},{key:"volume",get:function(){return this._volume},set:function(e){var t,n,i;e>=0&&e<=1&&(this._volume!==e&&(this._volume=e,this.emit(B.volumechange,e,this._muted),(null==(t=this.controls)?void 0:t.volumeControl)&&(null==(i=this.controls)||null==(n=i.volumeControl)?void 0:n.volume)!==e&&this.controls.volumeControl.emit(B.volumechange,e,this._muted)))}},{key:"muted",get:function(){return this._muted},set:function(e){var t,n,i;this._muted!==e&&(this._muted=e,this.emit(B.volumechange,this._volume,this._muted),(null==(t=this.controls)?void 0:t.volumeControl)&&(null==(i=this.controls)||null==(n=i.volumeControl)?void 0:n.muted)!==e&&this.controls.volumeControl.emit(B.volumechange,this._volume,e))}},{key:"zooming",get:function(){return this._zooming},set:function(e){var t,n,i,r,o,a,s,l,c,d;this._zooming!==e&&(this._zooming=e,this.emit(B.zoomingChange,e),this.zoomUtil&&(e?(null==(n=this.zoomUtil)||null==(t=n.setUpEventListeners)||t.call(n),null==(r=this.zoomUtil)||null==(i=r.setAllowZoom)||i.call(r,!0)):(null==(a=this.zoomUtil)||null==(o=a.reset)||o.call(a),null==(l=this.zoomUtil)||null==(s=l.removeEventListeners)||s.call(l),null==(d=this.zoomUtil)||null==(c=d.setAllowZoom)||c.call(d,!1))))}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t,n,i,r,o;if(!this._zooming)return null==(i=this.messageControl)||null==(n=i.info)||n.call(i,this.i18n.t("ZOOM_NOT_ENABLED")),void(null==(r=this.logger)||r.warn(this.i18n.t("ZOOM_NOT_ENABLED")));e=+e.toFixed(1);var a,s,l,c,d,u,p,h,m,A,f=null!=(o=null==(t=this.options.zoomOptions)?void 0:t.max)?o:rn.max;if(e>f)return null==(s=this.messageControl)||null==(a=s.info)||a.call(s,this.i18n.t("ZOOM_LIMIT_MAX",{zoom:f})),void(null==(l=this.logger)||l.warn(this.i18n.t("ZOOM_LIMIT_MAX",{zoom:f})));if(e<1)return null==(d=this.messageControl)||null==(c=d.info)||c.call(d,this.i18n.t("ZOOM_LIMIT_MIN",{zoom:"1"})),void(null==(u=this.logger)||u.warn(this.i18n.t("ZOOM_LIMIT_MIN",{zoom:"1"})));if(e===f)null==(h=this.messageControl)||null==(p=h.info)||p.call(h,this.i18n.t("ZOOM_ADD_MAX",{zoom:f}));else if(1===e){var v,g;null==(g=this.messageControl)||null==(v=g.info)||v.call(g,this.i18n.t("ZOOM_SUB_MIN",{zoom:1}))}e!==this._zoom&&(this._zoom=e,this.emit(B.zoomChange,e),null==this||null==(A=this.zoomUtil)||null==(m=A.setZoom)||m.call(A,e))}},{key:"talking",get:function(){return this._talking}},{key:"speed",get:function(){return this._speed},set:function(e){(e=+e)!==this._speed&&(this._speed=e,this.emit(B.speedChange,e))}},{key:"talkGain",get:function(){var e,t,n;return(null==(t=this.controls)||null==(e=t.talkControl)?void 0:e.active)?(null==(n=this.controls)?void 0:n.talkControl).value:null}},{key:"recording",get:function(){return this._recording}},{key:"ptzing",get:function(){var e,t;return null==(t=this.controls)||null==(e=t.ptzControl)?void 0:e.active}},{key:"videoLevelAuto",get:function(){return this._videoLevelAuto}},{key:"isCurrentFullscreen",get:function(){return this._isCurrentFullscreen}},{key:"orientationAngle",get:function(){return this._orientationAngle}},{key:"hasHeaderMoreControl",get:function(){return!!this._headerMoreControl}},{key:"hasFooterMoreControl",get:function(){return!!this._footerMoreControl}}]),n}(y);ar.TEMPLATES=Vt,ar.EVENTS=B,ar.LOCALES={zh:jt,en:Ut},ar.THEME_VERSION="2.0.0-beta.4",Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e};const sr=(e,t,n,i)=>{var r=document.getElementsByTagName("head")[0].getElementsByTagName("script"),o=!1;if(n)o=n();else for(var a=0;a<r.length;a++)r[a].getAttribute("src")==e&&(o=!0,r[a].readyState?r[a].onreadystatechange=function(){"complete"!=r[a].readyState&&"loaded"!=r[a].readyState||(r[a].onreadystatechange=null,t(i))}:r[a].onload=()=>{t(i)});if(!o){try{if(!document.querySelector(`script[src="${e}"]`)){var s=document.createElement("script");s.setAttribute("src",e),s.setAttribute("crossorigin",!0),s.onload=()=>t(i),document.getElementsByTagName("head")[0].appendChild(s)}}catch(e){}setTimeout((()=>{t(i)}),15)}},lr=e=>{for(var t=document.getElementsByTagName("head")[0].getElementsByTagName("script"),n=0;n<t.length;n++)if(t[n].getAttribute("src")==e)return void document.getElementsByTagName("head")[0].removeChild(t[n])},cr=(e,t)=>{var n=new RegExp("(\\?|#|&)"+e+"=(.*?)(#|&|$)"),i=(t||window.location.href).match(n);return decodeURIComponent(i?i[2]:"")},dr=(e,t)=>{var n=t.parentNode;n.lastChild==t?n.appendChild(e):n.insertBefore(e,t.nextSibling)},ur=e=>({deviceSerial:e.split("/")[3],channelNo:e.split("/")[4].split(".")[0],validCode:2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"",hd:-1!==e.indexOf(".hd"),type:-1!==e.indexOf(".cloud.rec")?"cloud.rec":-1!==e.indexOf(".rec")?"rec":"live"}),pr=()=>!!window&&navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i);var hr={391001:"取流地址或端口非法",391004:"连接到流媒体服务失败",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为0.5倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_AUTO:"自动",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_STANDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SUPER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放/结束播放",BTN_SOUND:"声音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_EXPEND:"全局全屏",BTN_WEBEXPEND:"网页全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数8.0X",ZOOM_SUB_MIN:"已经缩小到最小倍数1.0X",ZOOM_LIMIT_MAX:"超出最大倍率8.0X",ZOOM_LIMIT_MIN:"超出最小倍率1.0X","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印",TALK_PERMISSION_DENIED:"对讲失败,请检查麦克风权限",TALK_ERROR:"对讲失败,请检查麦克风或网络",TALK_TALKING:"当前已经有设备正在对讲",videoFormat:"编码格式",frameRate:"帧率",systemFormat:"封装格式",resolution:"分辨率",bitrate:"码率",frameLostRate:"丢帧率",lagRate:"卡顿比"},mr={391001:"Illegal streaming address or port",391004:"Failed to connect to streaming service",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"Loading, please wait",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 0.5 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_AUTO:"Auto",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_STANDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SUPER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play/end playback",BTN_SOUND:"Sound",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of 8.0X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of 1.0X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of 8.0X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of 1.0X","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark",TALK_PERMISSION_DENIED:"Permission denied",TALK_ERROR:"Talk failed, please check microphone or network",TALK_TALKING:"Currently devices that are talking to each other",videoFormat:"Video format",frameRate:"Frame fate",systemFormat:"System format",resolution:"Resolution",bitrate:"Bitrate",frameLostRate:"Frame Lost rate",lagRate:"Lag rate"};
22
+ */var distExports$2=function(){if(hasRequiredDist$2)return dist$2;function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}hasRequiredDist$2=1;var ZOOM_DEFAULT_POSITION=[0,0],DefaultOptions={initialZoom:1,defaultCursor:"pointer",scrollVelocity:.1,animDuration:.25,allowZoom:!0,allowPan:!0,onChange:function(){},onTranslateChange:function(){},onTap:function(){},max:8,min:1,zoomStep:.1,allowTouchEvents:!1,allowWheel:!0,ignoredMouseButtons:[],doubleTouchMaxDelay:300,decelerationDuration:750},Zoom=function(){function Zoom(container,options){var _this=this;this._dragging=!1,this.destroy=function(){_this.setAllowZoom(!1),_this.reset(),_this.removeEventListeners()},this.setTransform=function(trans){_this.transform=trans},this.getTransform=function(){return _this.transform},this.updateTranslate=function(){var translateX=0,translateY=0;translateX=_this.percentPos[0]<0?_this.percentPos[0]<-.5*(_this.zoom-1)?-.5*(_this.zoom-1):_this.percentPos[0]:_this.percentPos[0]>.5*(_this.zoom-1)?.5*(_this.zoom-1):_this.percentPos[0],translateY=_this.percentPos[1]<0?_this.percentPos[1]<-.5*(_this.zoom-1)?-.5*(_this.zoom-1):_this.percentPos[1]:_this.percentPos[1]>.5*(_this.zoom-1)?.5*(_this.zoom-1):_this.percentPos[1],_this.percentPos=[translateX,translateY]},this.update=function(){_this.container&&(_this.updateTranslate(),_this.container.style.transition="transform ease-out "+_this.transition+"s",_this.container.style.transform="translate3d("+100*_this.percentPos[0]+"%, "+100*_this.percentPos[1]+"%, 0) scale("+_this.zoom+")")},this.setAllowZoom=function(allow){_this.options.allowZoom=allow},this.setZoom=function(zoom,reset){zoom=parseFloat(zoom.toFixed(_this.getPrecision(_this.options.zoomStep))),_this.zoom!==zoom&&(_this.zoom=zoom,_this.update(),null==_this.options.onChange||_this.options.onChange.call(_this.options,+_this.zoom.toFixed(_this.getPrecision(_this.options.zoomStep)),reset))},this.getZoom=function(){return _this.zoom},this.setPos=function(pos){var _this_container,_this_container1,containerWidth=null==(_this_container=_this.container)?void 0:_this_container.clientWidth,containerHeight=null==(_this_container1=_this.container)?void 0:_this_container1.clientHeight;+_this.pos[0]===pos[0]&&+_this.pos[1]===pos[1]||(_this.percentPos=[pos[0]/containerWidth,pos[1]/containerHeight],_this.update(),null==_this.options.onTranslateChange||_this.options.onTranslateChange.call(_this.options,{posX:pos[0],posY:pos[1]}))},this.setTransitionDuration=function(duration){_this.transition=duration,_this.update()},this.setCursor=function(cursor){_this.container&&(_this.container.style.cssText+="cursor:"+cursor+";",_this.cursor=cursor)},this.zoomIn=function(value){var _this_options_max,_this_options_max1,newPosX=_this.pos[0],newPosY=_this.pos[1],prevZoom=_this.zoom,newZoom=prevZoom+value<(null!=(_this_options_max=_this.options.max)?_this_options_max:8)?prevZoom+value:null!=(_this_options_max1=_this.options.max)?_this_options_max1:8;newZoom!==prevZoom&&(newPosX=newPosX*(newZoom-1)/(prevZoom>1?prevZoom-1:prevZoom),newPosY=newPosY*(newZoom-1)/(prevZoom>1?prevZoom-1:prevZoom)),_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration)},this.zoomOut=function(value){var _this_options_min,_this_options_min1,newPosX=_this.pos[0],newPosY=_this.pos[1],prevZoom=_this.zoom,newZoom=prevZoom-value>(null!=(_this_options_min=_this.options.min)?_this_options_min:1)?prevZoom-value:null!=(_this_options_min1=_this.options.min)?_this_options_min1:1;newZoom!==prevZoom&&(newPosX=newPosX*(newZoom-1)/(prevZoom-1),newPosY=newPosY*(newZoom-1)/(prevZoom-1)),_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration)},this.zoomToZone=function(relX,relY,relWidth,relHeight){var _this_container;if(_this.container){var _this_options_max,newPosX=_this.pos[0],newPosY=_this.pos[1],parentRect=(null==(_this_container=_this.container)?void 0:_this_container.parentNode).getBoundingClientRect(),prevZoom=_this.zoom,optimalZoomX=parentRect.width/relWidth,optimalZoomY=parentRect.height/relHeight,newZoom=Math.min(optimalZoomX,optimalZoomY,null!=(_this_options_max=_this.options.max)?_this_options_max:8),rect=_this.container.getBoundingClientRect(),_ref=[rect.width/prevZoom/2,rect.height/prevZoom/2],_ref1=[relX+relWidth/2,relY+relHeight/2];newPosX=(_ref[0]-_ref1[0])*newZoom,newPosY=(_ref[1]-_ref1[1])*newZoom,_this.setZoom(newZoom),_this.setPos([newPosX,newPosY]),_this.setTransitionDuration(_this.options.animDuration)}},this.getNewPosition=function(x,y,newZoom){var prevZoom=[_this.zoom,_this.pos[0],_this.pos[1]][0];if(1===newZoom||!_this)return ZOOM_DEFAULT_POSITION;var _ref1=[_this.container.clientWidth,_this.container.clientHeight],clientWidth=_ref1[0],clientHeight=_ref1[1];if(newZoom>prevZoom)return[0,0];var w=-(x-clientWidth/2)/(clientWidth/2)*newZoom/2,h=-(y-clientHeight/2)/(clientHeight/2)*newZoom/2;return w>newZoom/2-.5&&(w=3.5),h>newZoom/2-.5&&(h=3.5),[clientWidth*w,clientHeight*h]},this.fullZoomInOnPosition=function(x,y){var _this_options_max,zoom=null!=(_this_options_max=_this.options.max)?_this_options_max:DefaultOptions.max;_this.setZoom(null!=zoom?zoom:DefaultOptions.max),_this.setPos(_this.getNewPosition(x,y,zoom)),_this.setTransitionDuration(_this.options.animDuration)},this.getLimitedShift=function(shift,minLimit,maxLimit,minElement,maxElement){if(shift>0){if(minElement>minLimit)return 0;if(minElement+shift>minLimit)return minLimit-minElement}else if(shift<0){if(maxElement<maxLimit)return 0;if(maxElement+shift<maxLimit)return maxLimit-maxElement}return shift},this.getCursor=function(canMoveOnX,canMoveOnY){return canMoveOnX&&canMoveOnY?"move":canMoveOnX?"ew-resize":canMoveOnY?"ns-resize":"auto"},this.move=function(shiftX,shiftY,transitionDuration){if(void 0===transitionDuration&&(transitionDuration=0),_this.container){var newPosX=_this.pos[0],newPosY=_this.pos[1],rect=_this.container.getBoundingClientRect(),parentRect=_this.container.parentNode.getBoundingClientRect(),shiftHorizontal=_this.transform?shiftY:shiftX,shiftVertical=_this.transform?shiftX:shiftY,_ref=_this.transform?[rect.height>parentRect.bottom-parentRect.top,shiftVertical>0&&rect.top-parentRect.top<0,shiftVertical<0&&rect.bottom-parentRect.bottom>0]:[rect.width>parentRect.right-parentRect.left,shiftHorizontal>0&&rect.left-parentRect.left<0,shiftHorizontal<0&&rect.right-parentRect.right>0],canMoveOnX=_ref[0]||_ref[1]||_ref[2];canMoveOnX&&(_this.transform?newPosX+=_this.getLimitedShift(shiftVertical,parentRect.top,parentRect.bottom,rect.top,rect.bottom):newPosX+=_this.getLimitedShift(shiftHorizontal,parentRect.left,parentRect.right,rect.left,rect.right));var _ref1=_this.transform?[rect.width>parentRect.right-parentRect.left,shiftHorizontal>0&&rect.right-parentRect.right<0,shiftHorizontal<0&&rect.left-parentRect.left>0]:[rect.height>parentRect.bottom-parentRect.top,shiftVertical>0&&rect.top-parentRect.top<0,shiftVertical<0&&rect.bottom-parentRect.bottom>0],canMoveOnY=_ref1[0]||_ref1[1]||_ref1[2];if(canMoveOnY)if(_this.transform){newPosY+=function(shift,minLimit,maxLimit,minElement,maxElement){if(shift>0){if(maxElement<maxLimit+1)return 0;if(maxElement+shift<maxLimit+1)return maxLimit-maxElement}else if(shift<0){if(minElement+1>minLimit)return 0;if(minElement+1+shift>minLimit)return minLimit-minElement}return shift}(shiftHorizontal,parentRect.left,parentRect.right,rect.left,rect.right)}else newPosY+=_this.getLimitedShift(shiftVertical,parentRect.top,parentRect.bottom,rect.top,rect.bottom);var cursor=_this.getCursor(canMoveOnX,canMoveOnY);_this.setPos([newPosX,newPosY]),_this.setCursor(cursor),_this.setTransitionDuration(transitionDuration)}},this.isDoubleTapping=function(){var _this_lastTouchTime,_this_options_doubleTouchMaxDelay,_this_lastDoubleTapTime,_this_options_doubleTouchMaxDelay1,touchTime=(new Date).getTime();return touchTime-(null!=(_this_lastTouchTime=_this.lastTouchTime)?_this_lastTouchTime:0)<(null!=(_this_options_doubleTouchMaxDelay=_this.options.doubleTouchMaxDelay)?_this_options_doubleTouchMaxDelay:300)&&touchTime-(null!=(_this_lastDoubleTapTime=_this.lastDoubleTapTime)?_this_lastDoubleTapTime:0)>(null!=(_this_options_doubleTouchMaxDelay1=_this.options.doubleTouchMaxDelay)?_this_options_doubleTouchMaxDelay1:750)?(_this.lastDoubleTapTime=touchTime,!0):(_this.lastTouchTime=touchTime,!1)},this.startDeceleration=function(lastShiftOnX,lastShiftOnY){var startTimestamp=null,startDecelerationMove=function(timestamp){null===startTimestamp&&(startTimestamp=timestamp);var _this_options_decelerationDuration,_this_options_decelerationDuration1,_this_options_decelerationDuration2,progress=timestamp-startTimestamp,ratio=((null!=(_this_options_decelerationDuration=_this.options.decelerationDuration)?_this_options_decelerationDuration:750)-progress)/(null!=(_this_options_decelerationDuration1=_this.options.decelerationDuration)?_this_options_decelerationDuration1:750),_ref=[lastShiftOnX*ratio,lastShiftOnY*ratio],shiftX=_ref[0],shiftY=_ref[1];progress<(null!=(_this_options_decelerationDuration2=_this.options.decelerationDuration)?_this_options_decelerationDuration2:750)&&Math.max(Math.abs(shiftX),Math.abs(shiftY))>1?(_this.move(shiftX,shiftY,0),_this.lastRequestAnimationId=requestAnimationFrame(startDecelerationMove)):_this.lastRequestAnimationId=null};_this.lastRequestAnimationId=requestAnimationFrame(startDecelerationMove)},this.reset=function(){_this.setZoom(_this.options.initialZoom,!0),_this.cursor=_this.options.defaultCursor,_this.setTransitionDuration(_this.options.animDuration),_this.setPos(ZOOM_DEFAULT_POSITION)},this.addScale=function(scale){void 0===scale&&(scale=1),_this.handleZoomAdd(scale)},this.handleZoomAdd=function(scale){if(void 0===scale&&(scale=1),_this.options.allowZoom&&_this.options.allowWheel){var _this_options_max,newZoom=parseFloat((_this.zoom+scale).toFixed(_this.getPrecision(_this.options.zoomStep)));newZoom>(null!=(_this_options_max=_this.options.max)?_this_options_max:8)&&(newZoom=8),_this.setZoom(newZoom),_this.setPos(_this.pos),_this.setTransitionDuration(.05)}},this.subScale=function(scale){void 0===scale&&(scale=1),_this.handleZoomSub(scale)},this.handleZoomSub=function(scale){if(void 0===scale&&(scale=1),_this.options.allowZoom&&_this.options.allowWheel){var newZoom=parseFloat((_this.zoom-scale).toFixed(_this.getPrecision(_this.options.zoomStep)));newZoom<1&&(newZoom=1),_this.setZoom(newZoom),_this.setPos(_this.pos),_this.setTransitionDuration(.05)}},this.handleMouseWheel=function(event){if(event.preventDefault(),_this.options.allowZoom&&_this.options.allowWheel){var _this_options_max,_this_options_min,velocity=event.deltaY<0?_this.options.scrollVelocity:0-_this.options.scrollVelocity,newZoom=parseFloat(Math.max(Math.min(_this.zoom+velocity,null!=(_this_options_max=_this.options.max)?_this_options_max:8),null!=(_this_options_min=_this.options.min)?_this_options_min:1).toFixed(_this.getPrecision(_this.options.zoomStep)));_this.setZoom(newZoom),_this.setTransitionDuration(.05)}},this.handleMouseStart=function(event){var _this_options_ignoredMouseButtons;event.preventDefault(),_this.options.allowPan&&!(null==(_this_options_ignoredMouseButtons=_this.options.ignoredMouseButtons)?void 0:_this_options_ignoredMouseButtons.includes(event.button))&&(_this._dragging=!0,_this.lastRequestAnimationId&&cancelAnimationFrame(_this.lastRequestAnimationId),_this.lastCursor=_this.getCoordinates(event))},this.handleMouseMove=function(event){event.preventDefault(),_this.options.allowPan&&_this.lastCursor&&_this._dragging&&_this._touchOrMouseDrag(event)},this.handleMouseStop=function(event){event.preventDefault(),_this.lastShift&&(_this.startDeceleration(_this.lastShift[0],_this.lastShift[1]),_this.lastShift=null),_this.lastCursor=null,_this.setCursor("auto"),_this._dragging=!1},this.handleTouchStart=function(event){var isThisDoubleTapping=_this.isDoubleTapping();_this.isMultiTouch=event.touches.length,_this.options.allowTouchEvents||event.preventDefault(),_this.lastRequestAnimationId&&cancelAnimationFrame(_this.lastRequestAnimationId);var _this_getCoordinates=_this.getCoordinates(event.touches[0]),posX=_this_getCoordinates[0],posY=_this_getCoordinates[1];if(_this.isMultiTouch>1)_this.lastCursor=[posX,posY];else if(isThisDoubleTapping&&_this.options.allowZoom)if(1===_this.zoom){var _this_container_getBoundingClientRect=_this.container.getBoundingClientRect();_this_container_getBoundingClientRect.top,_this_container_getBoundingClientRect.left;var ref,ref1,x=_this_container_getBoundingClientRect.x,y=_this_container_getBoundingClientRect.y;posX=(ref1=[posX-(x=(ref=_this.transform?[y,x]:[x,y])[0]),posY-(y=ref[1])])[0],posY=ref1[1],_this.fullZoomInOnPosition(posX,posY)}else _this.reset();else _this._tapStartTime=(new Date).getTime(),_this.options.allowPan&&(_this.lastCursor=[posX,posY])},this.handleTouchMove=function(event){if(_this.options.allowTouchEvents||event.preventDefault(),_this.lastCursor)if(1===_this.isMultiTouch)_this._touchOrMouseDrag(event.touches[0]),_this.lastTouchDistance=null;else if(_this.isMultiTouch>1){var newZoom=_this.zoom,_this_getCoordinates=_this.getCoordinates(event.touches[0]),pos1X=_this_getCoordinates[0],pos1Y=_this_getCoordinates[1],_this_getCoordinates1=_this.getCoordinates(event.touches[1]),pos2X=_this_getCoordinates1[0],pos2Y=_this_getCoordinates1[1],distance=Math.sqrt(Math.pow(pos2X-pos1X,2)+Math.pow(pos2Y-pos1Y,2));if(_this.lastTouchDistance&&distance&&distance!==_this.lastTouchDistance){var _this_options_max,_this_options_min,_this_options_max1;if(_this.options.allowZoom)if((newZoom+=(distance-_this.lastTouchDistance)/100)>(null!=(_this_options_max=_this.options.max)?_this_options_max:8))newZoom=null!=(_this_options_max1=_this.options.max)?_this_options_max1:8;else if(newZoom<(null!=(_this_options_min=_this.options.min)?_this_options_min:1)){var _this_options_min1;newZoom=null!=(_this_options_min1=_this.options.min)?_this_options_min1:1}_this.setZoom(newZoom),_this.setTransitionDuration(0)}_this.lastCursor=[pos1X,pos1Y],_this.lastTouchDistance=distance}},this.handleTouchStop=function(){_this.lastShift&&(_this.startDeceleration(_this.lastShift[0],_this.lastShift[1]),_this.lastShift=null),_this._tapStartTime&&(new Date).getTime()-_this._tapStartTime<200&&(null==_this.options.onTap||_this.options.onTap.call(_this.options)),_this._tapStartTime=void 0,_this.lastCursor=null,_this.lastTouchDistance=null,_this.isMultiTouch=0},this.container=container,this.options=Object.assign({},DefaultOptions,options||{}),this.percentPos=ZOOM_DEFAULT_POSITION,this.transition=this.options.animDuration,this.zoom=1,this.cursor="auto",this.lastCursor=[0,0],this.lastShift=null,this.lastTouchDistance=null,this.lastRequestAnimationId=null,this.lastTouchTime=(new Date).getTime(),this.lastDoubleTapTime=(new Date).getTime(),this.transform=!1,this.isMultiTouch=1,this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseStart=this.handleMouseStart.bind(this),this.handleMouseStop=this.handleMouseStop.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchStop=this.handleTouchStop.bind(this),this.getZoom=this.getZoom.bind(this),this.setZoom=this.setZoom.bind(this)}var _proto=Zoom.prototype;return _proto.setUpEventListeners=function(){var refCurrentValue=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==refCurrentValue||refCurrentValue.addEventListener("wheel",this.handleMouseWheel,{passive:!1})),null==refCurrentValue||refCurrentValue.addEventListener("mousedown",this.handleMouseStart,{passive:!1}),null==refCurrentValue||refCurrentValue.addEventListener("mousemove",this.handleMouseMove,{passive:!1}),null==refCurrentValue||refCurrentValue.addEventListener("mouseup",this.handleMouseStop,{passive:!1}),null==refCurrentValue||refCurrentValue.addEventListener("mouseleave",this.handleMouseStop,{passive:!1})):(null==refCurrentValue||refCurrentValue.addEventListener("touchstart",this.handleTouchStart,{passive:!1}),null==refCurrentValue||refCurrentValue.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),null==refCurrentValue||refCurrentValue.addEventListener("touchend",this.handleTouchStop,{passive:!1}),null==refCurrentValue||refCurrentValue.addEventListener("touchcancel",this.handleTouchStop,{passive:!1}))},_proto.removeEventListeners=function(){var refCurrentValue=this.container;window.matchMedia("(pointer: fine)").matches?(this.options.allowWheel&&(null==refCurrentValue||refCurrentValue.removeEventListener("wheel",this.handleMouseWheel)),null==refCurrentValue||refCurrentValue.removeEventListener("mousedown",this.handleMouseStart),null==refCurrentValue||refCurrentValue.removeEventListener("mousemove",this.handleMouseMove),null==refCurrentValue||refCurrentValue.removeEventListener("mouseup",this.handleMouseStop),null==refCurrentValue||refCurrentValue.removeEventListener("mouseleave",this.handleMouseStop)):(null==refCurrentValue||refCurrentValue.removeEventListener("touchstart",this.handleTouchStart),null==refCurrentValue||refCurrentValue.removeEventListener("touchmove",this.handleTouchMove),null==refCurrentValue||refCurrentValue.removeEventListener("touchend",this.handleTouchStop),null==refCurrentValue||refCurrentValue.removeEventListener("touchcancel",this.handleTouchStop))},_proto.getPrecision=function(value){void 0===value&&(value=1);var valueStr=value.toString();return valueStr.includes(".")?valueStr.split(".")[1].length:1},_proto.getCoordinates=function(event){var clientHeight=this.container.clientHeight,clientTop=this.container.clientTop,clientLeft=this.container.clientLeft,_ref=this.transform?[event.clientY,clientHeight-event.clientX]:[event.clientX-clientTop,event.clientY-clientLeft];return[_ref[0],_ref[1]]},_proto._touchOrMouseDrag=function(event){if(this.lastCursor){var _this_getCoordinates=this.getCoordinates(event),posX=_this_getCoordinates[0],posY=_this_getCoordinates[1],shiftX=posX-this.lastCursor[0],shiftY=posY-this.lastCursor[1];this.move(shiftX,shiftY,0),this.lastCursor=[posX,posY],this.lastShift=[shiftX,shiftY]}},_create_class(Zoom,[{key:"pos",get:function(){return[this.container.clientWidth*this.percentPos[0],this.container.clientHeight*this.percentPos[1]]}}]),Zoom}();return Zoom.VERSION="0.0.2",dist$2=Zoom}(),Zoom=getDefaultExportFromCjs(distExports$2);function _extends$h(){return _extends$h=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$h.apply(this,arguments)}function asyncGeneratorStep$4$1(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$4$1(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$4$1(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$4$1(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _ts_generator$4(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}function getThemeDataByTemplate(theme,id){return _async_to_generator$4$1((function(){var _theme_options_token_httpToken,_theme_options_token,url;return _ts_generator$4(this,(function(_state){switch(_state.label){case 0:return url=theme.options.env.domain+"/api/service/media/template/getDetail?accessToken="+(theme.options.accessToken||(null==(_theme_options_token=theme.options.token)||null==(_theme_options_token_httpToken=_theme_options_token.httpToken)?void 0:_theme_options_token_httpToken.url))+"&id="+id,[4,fetch(url,{method:"GET"}).then((function(response){return _async_to_generator$4$1((function(){return _ts_generator$4(this,(function(_state){switch(_state.label){case 0:return[4,response.json()];case 1:return[2,_state.sent()]}}))}))()})).then((function(res){if(res.meta){var _res_data_footer,_res_data,_res_data_footer1,_res_data1;if((null==(_res_data=res.data)||null==(_res_data_footer=_res_data.footer)?void 0:_res_data_footer.btnList)&&Utils.isMobile)null==(_res_data1=res.data)||null==(_res_data_footer1=_res_data1.footer)||_res_data_footer1.btnList.forEach((function(btn,index){var _res_data_footer,_res_data;"webExpend"===btn.iconId?(null==(_res_data=res.data)||null==(_res_data_footer=_res_data.footer)?void 0:_res_data_footer.btnList)[index]={}:"expend"===btn.iconId&&(btn.iconId="webExpend")}));return res.data||null}return null}))];case 1:return[2,_state.sent()]}}))}))()}function asyncGeneratorStep$3$1(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _extends$g(){return _extends$g=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$g.apply(this,arguments)}function _ts_generator$3(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var replaceKey={sound:"volume",webExpend:"fullscreen",expend:"globalFullscreen",pantile:"ptz",recordvideo:"record",hd:"definition"};function _filterLeftRightControls(btnList){return[btnList.filter((function(item){return"left"===item.part})),btnList.filter((function(item){return"right"===item.part}))]}function getThemeData(theme,data){return(fn=function(){var themeData,_theme_logger,template;return _ts_generator$3(this,(function(_state){switch(_state.label){case 0:return themeData=data,"string"==typeof data&&data.length<32?"simple"===data?[2,null]:(themeData=TEMPLATES[data],data||(null==(_theme_logger=theme.logger)||_theme_logger.warn("Theme template "+data+" is not exist!"),themeData=null),[2,themeData]):[3,1];case 1:if("string"!=typeof data||32!==data.length)return[3,6];_state.label=2;case 2:return _state.trys.push([2,4,,5]),[4,getThemeDataByTemplate(theme,data)];case 3:return(template=_state.sent())?[2,template]:(theme.emit(EVENTS$1.message,theme.i18n.t("FETCH_THEME_FAILED"),"themeError"),[3,5]);case 4:return _state.sent(),theme.emit(EVENTS$1.message,theme.i18n.t("FETCH_THEME_FAILED"),"themeError"),[3,5];case 5:return[3,7];case 6:return"[object Object]"===Object.prototype.toString.call(data)?[2,data]:[2,null];case 7:return[2]}}))},function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$3$1(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$3$1(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))})();var fn}function rgbOrHexToRgbaWithOpacity(color,opacity){void 0===opacity&&(opacity=.8);return/^#([A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(color)?function(hex,opacity){return void 0===opacity&&(opacity=.8),3!==(hex=hex.replace(/^#/,"")).length&&4!==hex.length||(hex=hex.split("").map((function(char){return char+char})).join("")),"rgba("+parseInt(hex.substring(0,2),16)+", "+parseInt(hex.substring(2,4),16)+", "+parseInt(hex.substring(4,6),16)+", "+opacity+")"}(color,opacity):/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d.]+)?\s*\)$/.test(color)?function(rgbString,opacity){void 0===opacity&&(opacity=.8);var rgbMatch=rgbString.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)\)/);return rgbMatch?"rgba("+rgbMatch[1]+", "+rgbMatch[2]+", "+rgbMatch[3]+", "+opacity+")":""}(color,opacity):""}var Component=function(){function Component(options){if(void 0===options&&(options={}),this._options=options,this.$container=document.createElement("div"),this._defaultClass="ezplayer-"+this._options.cType,this._options.cType&&this.$container.classList.add(this._defaultClass),(null==options?void 0:options.className)&&this.$container.classList.add(options.className),(null==options?void 0:options.color)&&(this.$container.style.cssText+="--ezplayer-default-color: "+options.color+";"),(null==options?void 0:options.activeColor)&&(this.$container.style.cssText+="--ezplayer-active-color: "+options.activeColor+";"),null==options?void 0:options.backgroundColor){var bgColor=rgbOrHexToRgbaWithOpacity(null==options?void 0:options.backgroundColor);bgColor?"header"===this._options.cType?bgColor="background: linear-gradient(0deg, transparent 0, "+bgColor+");":"footer"===this._options.cType&&(bgColor="background: linear-gradient(180deg, transparent 0, "+bgColor+");"):bgColor="background: "+(null==options?void 0:options.backgroundColor)+";",this.$container.style.cssText+=bgColor+";"}options.getPopupContainer?this.$popupContainer=null==options.getPopupContainer?void 0:options.getPopupContainer.call(options):this.$popupContainer=document.body,this.$left=document.createElement("div"),this.$left.classList.add(this._defaultClass+"-left"),this.$right=document.createElement("div"),this.$right.classList.add(this._defaultClass+"-right"),this.$container.appendChild(this.$left),this.$container.appendChild(this.$right),this.$popupContainer.appendChild(this.$container)}return Component.prototype.destroy=function(){var _this_$popupContainer;null==(_this_$popupContainer=this.$popupContainer)||_this_$popupContainer.removeChild(this.$container)},Component}();function _extends$f(){return _extends$f=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$f.apply(this,arguments)}function _set_prototype_of$g(o,p){return _set_prototype_of$g=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$g(o,p)}var Footer=function(Component){function Footer(options){return void 0===options&&(options={}),Component.call(this,_extends$f({},options,{cType:"footer"}))||this}return function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$g(subClass,superClass)}(Footer,Component),Footer}(Component);function _extends$e(){return _extends$e=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$e.apply(this,arguments)}function _set_prototype_of$f(o,p){return _set_prototype_of$f=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$f(o,p)}var Header=function(Component){function Header(options){return void 0===options&&(options={}),Component.call(this,_extends$e({},options,{cType:"header"}))||this}return function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$f(subClass,superClass)}(Header,Component),Header}(Component);function _extends$d$1(){return _extends$d$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$d$1.apply(this,arguments)}function _set_prototype_of$e(o,p){return _set_prototype_of$e=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$e(o,p)}var GlobalFullscreen=function(Fullscreen){function GlobalFullscreen(options){return Fullscreen.call(this,_extends$d$1({},options,{controlType:"button",classNameSuffix:"global-fullscreen"}))||this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$e(subClass,superClass)}(GlobalFullscreen,Fullscreen);var _proto=GlobalFullscreen.prototype;return _proto._render=function(){var _this_locale,_this_locale1;this.$container.innerHTML=IconComponents_exitGlobalFullscreen({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_EXIT_GLOBAL_FULLSCREEN})+IconComponents_globalFullscreen({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_GLOBAL_FULLSCREEN})},_proto._onControlClick=function(){var _this__fullscreenUtil,_this__fullscreenUtil1;this.isCurrentFullscreen&&this._$rootContainer.classList.contains("ezplayer-global-fullscreen")?(this._$rootContainer.classList.remove("ezplayer-global-fullscreen"),null==(_this__fullscreenUtil=this._fullscreenUtil)||_this__fullscreenUtil.exitFullscreen()):(this._$rootContainer.classList.add("ezplayer-global-fullscreen"),null==(_this__fullscreenUtil1=this._fullscreenUtil)||_this__fullscreenUtil1.fullscreen())},GlobalFullscreen}(Fullscreen);function _extends$c$1(){return _extends$c$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$c$1.apply(this,arguments)}function _set_prototype_of$d(o,p){return _set_prototype_of$d=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$d(o,p)}var hasRequiredDist$1,CapturePicture=function(Control){function CapturePicture(options){var _this;return(_this=Control.call(this,_extends$c$1({},options,{tagName:"span",classNameSuffix:"capture-picture"}))||this)._timer=null,_this.options=options,_this._render(),"function"==typeof _this.options.onCapture&&_this.on(EVENTS$1.control.capturePictureResult,_this.options.onCapture),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$d(subClass,superClass)}(CapturePicture,Control);var _proto=CapturePicture.prototype;return _proto.destroy=function(){this._timer&&(clearTimeout(this._timer),this._timer=null),Control.prototype.destroy.call(this)},_proto._render=function(){var _this_locale;this.$container.innerHTML=IconComponents_capturePicture({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_CAPTURE})},_proto._onControlClick=function(e){var _this_options_type,_this_options_cloudRecUpload,_this=this;this.active=!0,this.emit(EVENTS$1.control.capturePicture,{type:null!=(_this_options_type=this.options.type)?_this_options_type:"download",quality:this.options.quality||.9,cloudRecUpload:null==(_this_options_cloudRecUpload=this.options.cloudRecUpload)||_this_options_cloudRecUpload}),this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer=setTimeout((function(){_this._timer&&(clearTimeout(_this._timer),_this._timer=null),_this.active=!1}),200),Control.prototype._onControlClick.call(this,e)},CapturePicture}(Control),dist$1={};var distExports$1=function(){if(hasRequiredDist$1)return dist$1;hasRequiredDist$1=1;var deepmerge$1=deepmerge,utilsTools=require$$1$1,PTZ_DEFAULT_OPTIONS={language:"zh",env:{domain:"https://open.ys7.com"},accessToken:"",speed:2,locales:{zh:{GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距"},en:{GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length"}}},PTZ_SPEED={1:1,2:3,3:7,slow:1,mid:3,fast:7},BasePtz=function(){function BasePtz(container,options){var _this_options_locales,_this_options_locales1,_this_options_locales2;if(void 0===options&&(options={}),!container)throw new Error("Ptz container is required");(this.options=deepmerge$1(PTZ_DEFAULT_OPTIONS,options,{clone:!1}),null==(_this_options_locales=this.options.locales)?void 0:_this_options_locales[this.options.language])?this.locale=null==(_this_options_locales1=this.options.locales)?void 0:_this_options_locales1[this.options.language]:this.locale=null==(_this_options_locales2=this.options.locales)?void 0:_this_options_locales2.zh;this.$container=container,this.speed=PTZ_SPEED[this.options.speed||2]}var _proto=BasePtz.prototype;return _proto.updateOptions=function(options){this.options=deepmerge$1(this.options,options,{clone:!1})},_proto.destroy=function(){},BasePtz}();function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var MobilePtz=function(BasePtz){function MobilePtz(container,options){var _this;return(_this=BasePtz.call(this,container,options)||this)._touchstart=_this._touchstart.bind(_this),_this._touchend=_this._touchend.bind(_this),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$1(subClass,superClass)}(MobilePtz,BasePtz);var _proto=MobilePtz.prototype;return _proto.destroy=function(){this._removeEventListener(),this.$content&&(this.$content.remove(),this.$content=null),BasePtz.prototype.destroy.call(this)},_proto._render=function(){this.$content=document.createElement("div"),this.$content.classList.add("ez-mobile-ptz-content"),this.$content.innerHTML='\n <div class="ez-mobile-ptz-wrap">\n <div class="ez-mobile-ptz-container">\n <div class="ez-mobile-ptz-center ez-mobile-ptz-center"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-top ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-left ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-bottom ez-mobile-ptz-default"></div>\n <div class="ez-mobile-ptz-icon ez-mobile-ptz-right ez-mobile-ptz-default"></div>\n </div>\n </div>\n ',this.$container.appendChild(this.$content),this._addEventListener()},_proto._addEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.addEventListener(touchstart,this._touchstart),$warp.addEventListener(touchend,this._touchend))},_proto._touchstart=function(e){e.preventDefault(),this._handlePtzTouch(e,"start")},_proto._touchend=function(e){e.preventDefault(),this._handlePtzTouch(e,"stop")},_proto._removeEventListener=function(){var $warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),touchstart="PointerEvent"in window?"pointerdown":"touchstart",touchend="PointerEvent"in window?"pointerup":"touchend";$warp&&($warp.removeEventListener(touchstart,this._touchstart),$warp.removeEventListener(touchend,this._touchend))},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_e_changedTouches_,_e_changedTouches_1,_this_options_env,_this_options_token_deviceToken1,_this_options_token1;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");var _this_options_env1,$warp=this.$content.querySelector(".ez-mobile-ptz-wrap"),rect=$warp.getBoundingClientRect(),containerCenterX=rect.left+130,containerCenterY=rect.top+130,left=(e.x||(null==(_e_changedTouches_=e.changedTouches[0])?void 0:_e_changedTouches_.clientX))-containerCenterX,top=(e.y||(null==(_e_changedTouches_1=e.changedTouches[0])?void 0:_e_changedTouches_1.clientY))-containerCenterY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),$icons=$warp.querySelectorAll(".ez-mobile-ptz-icon");(Math.abs(left)>Math.abs(top)?left>0?(direction=3,$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=2,$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):top>0?(direction=1,$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")):(direction=0,$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-default","ez-mobile-ptz-active")),$warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop",$warp.style.cssText="",$icons[3].className=$icons[3].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[1].className=$icons[1].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[2].className=$icons[2].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"),$icons[0].className=$icons[0].className.replace("ez-mobile-ptz-active","ez-mobile-ptz-default"));var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{direction:direction,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed","1"),data.append("direction",direction+""),data.append("accessToken",token),fetch(url,{method:"POST",body:data}).then((function(response){return response.json()})).then((function(rt){200===rt.code||[60005,60002,60003,60004].includes(+rt.code)&&($warp.style.cssText="background-image:linear-gradient("+(0===direction?180:1===direction?0:2===direction?90:270)+"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"),null==operationResultCb||operationResultCb(rt)})).catch((function(err){})).finally((function(){operationResultCb=null}))},MobilePtz}(BasePtz);function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}function _ts_generator(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var Ptz=function(BasePtz){function Ptz(container,options){var _this;return void 0===options&&(options={}),(_this=BasePtz.call(this,container,options)||this)._isMobile=utilsTools.isMobile(),_this._isRotate=!1,_this._clearTimer=null,_this._$wrapper=document.createElement("div"),_this._$wrapper.className="ez-ptz-container-wrap",_this._$directionCircleContainer=document.createElement("div"),_this._$directionCircleContainer.classList.add("ez-ptz-container"),_this._$directionCircleContainer.innerHTML='\n <div class="ez-ptz-main ez-ptz-direction-center"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top" data-direction="0"></div>\n <div class="ez-ptz-icon ez-ptz-direction-top-left" data-direction="4"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left" data-direction="2"></div>\n <div class="ez-ptz-icon ez-ptz-direction-left-bottom" data-direction="5"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom" data-direction="1"></div>\n <div class="ez-ptz-icon ez-ptz-direction-bottom-right" data-direction="7"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right" data-direction="3"></div>\n <div class="ez-ptz-icon ez-ptz-direction-right-top" data-direction="6"></div>\n ',_this._$wrapper.appendChild(_this._$directionCircleContainer),_this._$speedContainer=document.createElement("div"),_this._$speedContainer.classList.add("ez-ptz-speed-container"),_this._$speedContainer.innerHTML='\n <div class="ez-ptz-speed-progress" title="'+_this.locale.PTZ_SPEED+'">\n <div class="ez-ptz-speed-progress-line">\n <div class="ez-ptz-speed-progress-line-dot '+(1===_this.speed?"ez-ptz-speed-active":"")+'" data-id="slow" data-index="1" data-value="1"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(3===_this.speed?"ez-ptz-speed-active":"")+'" data-id="mid" data-index="2" data-value="3"></div>\n <div class="ez-ptz-speed-progress-line-dot '+(7===_this.speed?"ez-ptz-speed-active":"")+'" data-id="fast" data-index="3" data-value="7"></div>\n </div>\n <div class="ez-ptz-speed-progress-points">\n <div class="ez-ptz-speed-progress-points-slow">\n '+_this.locale.PTZ_SLOW+'\n </div>\n <div class="ez-ptz-speed-progress-points-mid">\n '+_this.locale.PTZ_MID+'\n </div>\n <div class="ez-ptz-speed-progress-points-fast">\n '+_this.locale.PTZ_FAST+"\n </div>\n </div>\n </div>\n ",_this._$wrapper.appendChild(_this._$speedContainer),_this._$btnContainer=document.createElement("div"),_this._$btnContainer.classList.add("ez-ptz-btn-container"),_this._$btnContainer.innerHTML='\n <div class="ez-ptz-btn-zoom" title="'+_this.locale.DEVICE_ZOOM+'" style="user-select: none;">\n <div class="ez-ptz-btn-zoom-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" fill="#ffffff"></path>\n <path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" fill="#ffffff">\n </path>\n <path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-zoom-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" fill="#ffffff"></path>\n <path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n <div class="ez-ptz-btn-focal" title="'+_this.locale.DEVICE_FOCUS+'" style="user-select: none;">\n <div class="ez-ptz-btn-focal-add" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" fill="#ffffff"></path>\n <path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" fill="#ffffff"></path>\n </svg>\n </div>\n <div class="ez-ptz-btn-focal-sub" style="user-select: none;">\n <svg viewBox="0 0 1088 1024" version="1.1" width="20" height="20">\n <path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" fill="#ffffff"></path>\n <path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" fill="#ffffff"></path>\n </svg>\n </div>\n </div>\n ',_this._$wrapper.appendChild(_this._$btnContainer),container.appendChild(_this._$wrapper),_this._$directionCircleContainer.onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start")},_this._$directionCircleContainer.onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop")},_this._$directionCircleContainer.ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"start")},_this._$directionCircleContainer.ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handlePtzTouch(e,"stop")},_this._onSwitchSpeed=function(e){var list=Array.from(_this._$speedContainer.querySelectorAll(".ez-ptz-speed-progress-line-dot"));if(list.includes(e.target)&&!e.target.classList.contains("ez-ptz-speed-active")){list.forEach((function(item){item===e.target?item.classList.add("ez-ptz-speed-active"):item.classList.remove("ez-ptz-speed-active")}));var value=e.target.getAttribute("data-value"),index=e.target.getAttribute("data-index");_this.speed=+value,null==_this.options.onSpeedChange||_this.options.onSpeedChange.call(_this.options,+index)}},_this._$speedContainer.onmouseup=_this._onSwitchSpeed,_this._isMobile&&(_this._$speedContainer.ontouchend=_this._onSwitchSpeed),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop")}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop")}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop")}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmousedown=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").onmouseup=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop")}),_this._isMobile&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","add","stop")}),_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-zoom-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("zoom","sub","stop")}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-add").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","add","stop")}),_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub")&&(_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchstart=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","start")},_this._$btnContainer.querySelector(".ez-ptz-btn-focal-sub").ontouchend=function(e){e.preventDefault(),e.stopPropagation(),_this._handleBtnTouch("focal","sub","stop")})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}(Ptz,BasePtz);var _proto=Ptz.prototype;return _proto.destroy=function(){this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer&&(this._$directionCircleContainer.remove(),this._$directionCircleContainer=null),this._$speedContainer&&(this._onSwitchSpeed=null,this._$speedContainer.remove(),this._$speedContainer=null),this._$btnContainer&&(this._$btnContainer.remove(),this._$btnContainer=null),this._$wrapper&&(this._$wrapper.remove(),this._$wrapper=null),BasePtz.prototype.destroy.call(this)},_proto._handlePtzTouch=function(e,type){var _this_options_token_deviceToken,_this_options_token,_this_options_env,_this_options_token_deviceToken1,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token.deviceToken)?void 0:_this_options_token_deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzQueue||(this._ptzQueue=Promise.resolve());var container=this._$directionCircleContainer.getBoundingClientRect(),containerCenterX=container.left+(this._$directionCircleContainer.clientWidth+2)/2,containerCenterY=container.top+(this._$directionCircleContainer.clientHeight+2)/2,eventX=e.x||e.changedTouches[0].clientX,eventY=e.y||e.changedTouches[0].clientY,direction=0,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken1=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken1.video),backDeg=0;function getAreaId(x,y){var rad=Math.atan2(y,x);rad<0&&(rad+=2*Math.PI);var deg=rad*(180/Math.PI)-225-12.5;return deg<0&&(deg+=360),Math.floor(deg/45)+1}var _this_options_env1,left=eventX-containerCenterX,top=eventY-containerCenterY;if(this.isRotate)switch(getAreaId(left,top)){case 1:direction=2,backDeg=90;break;case 2:direction=4,backDeg=135;break;case 3:direction=0,backDeg=180;break;case 4:direction=6,backDeg=225;break;case 5:direction=3,backDeg=270;break;case 6:direction=7,backDeg=315;break;case 7:direction=1,backDeg=0;break;case 8:direction=5,backDeg=45}else switch(getAreaId(left,top)){case 1:direction=0,backDeg=180;break;case 2:direction=6,backDeg=225;break;case 3:direction=3,backDeg=270;break;case 4:direction=7,backDeg=315;break;case 5:direction=1,backDeg=0;break;case 6:direction=5,backDeg=45;break;case 7:direction=2,backDeg=90;break;case 8:direction=4,backDeg=135}(this._clearTimer&&(clearTimeout(this._clearTimer),this._clearTimer=null),this._$directionCircleContainer.style.cssText="start"===type?"background-image:linear-gradient("+backDeg+"deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)":"","stop"===type)&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{areaId:getAreaId(left,top),direction:direction,backDeg:backDeg,isRotate:this.isRotate,speed:this.speed,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzQueue=this._ptzQueue.then((function(){return _async_to_generator((function(){var _this;return _ts_generator(this,(function(_state){switch(_state.label){case 0:return _this=this,[4,fetch(url,{method:"POST",body:data}).then((function(response){return _async_to_generator((function(){return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,response.json()];case 1:return[2,_state.sent()]}}))}))()})).then((function(rt){var _rt_result;null==operationResultCb||operationResultCb(rt);var code=rt.code||(null==rt||null==(_rt_result=rt.result)?void 0:_rt_result.code);return[6e4,60001,60002,60003,60004,60005,60006,10002].includes(+code)&&(_this._$directionCircleContainer.style.cssText="background-image:linear-gradient("+backDeg+"deg, #f45656 0%, rgba(100,143,252,0.00) 30%)"),rt})).catch((function(err){})).finally((function(){operationResultCb=null,"stop"===type&&(_this._clearTimer=setTimeout((function(){_this._$directionCircleContainer.style.cssText=""}),1e3))}))];case 1:return[2,_state.sent()]}}))})).call(_this)})),"stop"===type&&(this._ptzQueue=this._ptzQueue.finally((function(){})))},_proto._handleBtnTouch=function(btn,option,type){var _this_options_token,_this_options_env,_this_options_token_deviceToken,_this_options_token1,_this=this;if(!this.options.accessToken&&!(null==(_this_options_token=this.options.token)?void 0:_this_options_token.deviceToken.video))throw new Error("Ptz accessToken or token.deviceToken.video is required");this._ptzOperation||(this._ptzOperation=Promise.resolve());var direction=8;direction="zoom"===btn?"add"===option?8:9:"add"===option?10:11;var _this_options_env1,url=(null==(_this_options_env=this.options.env)?void 0:_this_options_env.domain)+"/api/lapp/device/ptz/start",token=this.options.accessToken||(null==(_this_options_token1=this.options.token)||null==(_this_options_token_deviceToken=_this_options_token1.deviceToken)?void 0:_this_options_token_deviceToken.video);"stop"===type&&(url=(null==(_this_options_env1=this.options.env)?void 0:_this_options_env1.domain)+"/api/lapp/device/ptz/stop");var operationResultCb=null==this.options.onDirection?void 0:this.options.onDirection.call(this.options,{btn:btn,option:option,type:type}),data=new FormData;data.append("deviceSerial",this.options.deviceSerial+""),data.append("channelNo",this.options.channelNo+""),data.append("speed",this.speed+""),data.append("direction",direction+""),data.append("accessToken",token),this._ptzOperation=this._ptzOperation.then((function(){return _async_to_generator((function(){return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,fetch(url,{method:"POST",body:data}).then((function(response){return _async_to_generator((function(){return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,response.json()];case 1:return[2,_state.sent()]}}))}))()})).then((function(rt){return null==operationResultCb||operationResultCb(rt),rt})).catch((function(err){})).finally((function(){operationResultCb=null}))];case 1:return[2,_state.sent()]}}))}))()})),"stop"===type&&(this._ptzOperation=this._ptzOperation.finally((function(){_this._ptzOperation=null})))},_create_class(Ptz,[{key:"isRotate",get:function(){return this._isRotate},set:function(isRotate){this._isRotate=isRotate}}]),Ptz}(BasePtz);return dist$1.BasePtz=BasePtz,dist$1.MobilePtz=MobilePtz,dist$1.Ptz=Ptz,dist$1}();function _create_class$4(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$b$1(){return _extends$b$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$b$1.apply(this,arguments)}function _set_prototype_of$c(o,p){return _set_prototype_of$c=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$c(o,p)}var Ptz$1=function(Control){function Ptz(options){var _this;return(_this=Control.call(this,_extends$b$1({},options,{tagName:"span",controlType:"button",classNameSuffix:"ptz"}))||this)._isRotated=!1,_this._options=options,_this._render(),_this._onDBlPanelClick=_this._onDBlPanelClick.bind(_this),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$c(subClass,superClass)}(Ptz,Control);var _proto=Ptz.prototype;return _proto.destroy=function(){var _this_$panel,_this_$panel_remove,_this_$panel1;this._ptzControl&&(this._ptzControl.destroy(),this._ptzControl=null),this._ptzControl1&&(this._ptzControl1.destroy(),this._ptzControl1=null),null==(_this_$panel=this.$panel)||_this_$panel.removeEventListener("dblclick",this._onDBlPanelClick),null==(_this_$panel1=this.$panel)||null==(_this_$panel_remove=_this_$panel1.remove)||_this_$panel_remove.call(_this_$panel1),Control.prototype.destroy.call(this)},_proto._render=function(){var _this_locale;this.$container.innerHTML=IconComponents_ptz({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_PTZ}),this._renderPanel()},_proto._renderPanel=function(){this._options.rootContainer&&(this.$panel=document.createElement("div"),this.$panel.classList.add("ezplayer-ptz-panel","ezplayer-hide"),this._options.rootContainer.appendChild(this.$panel),this.$turntable=document.createElement("div"),this.$turntable.classList.add("ezplayer-ptz-turntable"),this.$panel.appendChild(this.$turntable),this._ptzControl=new distExports$1.Ptz(this.$turntable,_extends$b$1({},this._options,{onSpeedChange:this._onSpeedChange.bind(this),onDirection:this._onDirection.bind(this)})),this.$panel.addEventListener("dblclick",this._onDBlPanelClick))},_proto.renderMobileExtend=function($container){this._ptzControl1||(this._ptzControl1=new distExports$1.MobilePtz($container,_extends$b$1({},this._options,{onSpeedChange:this._onSpeedChange.bind(this),onDirection:this._onDirection.bind(this)})))},_proto.updateOptions=function(options){this._ptzControl&&this._ptzControl.updateOptions(options),this._ptzControl1&&this._ptzControl.updateOptions(options)},_proto._onSpeedChange=function(speed){this.emit(EVENTS$1.control.ptzSpeedChange,speed),null==this._options.onSpeedChange||this._options.onSpeedChange.call(this._options,speed)},_proto._onDirection=function(requestData){var _this=this;return function(responseResult){var _responseResult_result,code=+(responseResult.code||(null==responseResult||null==(_responseResult_result=responseResult.result)?void 0:_responseResult_result.code));"start"===requestData.type&&200!==code&&_this.emit(EVENTS$1.control.ptzError,{code:code,localeKey:"zoom"===requestData.btn&&6e4===code?"NOT_SUPPORT_DEVICE_ZOOM":"focal"===requestData.btn&&60006===code?"NOT_SUPPORT_FOCUS":"38"+code,msg:responseResult.msg})}},_proto._onControlClick=function(e){Control.prototype._onControlClick.call(this,e),this.active=!this.active},_proto._onDBlPanelClick=function(e){e.stopPropagation(),e.preventDefault()},_proto.reset=function(hide){this.active=!1},_create_class$4(Ptz,[{key:"isRotated",get:function(){return this._isRotated},set:function(rotated){this._ptzControl.isRotate=rotated,this._isRotated=rotated}},{key:"active",get:function(){return this._active},set:function(active){this._disabled&&!this._active||(this._active=active,this._updateActiveState(active),this._active?this.$panel.classList.remove("ezplayer-hide"):this.$panel.classList.add("ezplayer-hide"))}}]),Ptz}(Control);function formatTime(seconds,format){void 0===format&&(format="MM:SS");var hours=Math.floor(seconds/3600),minutes=Math.floor(seconds%3600/60),secs=seconds%60,pad=function(num){return num.toString().padStart(2,"0")};return format.replace("HH",pad(hours)).replace("MM",pad(minutes)).replace("SS",pad(secs))}function _create_class$3(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$a$1(){return _extends$a$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$a$1.apply(this,arguments)}function _set_prototype_of$b(o,p){return _set_prototype_of$b=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$b(o,p)}var RECORD_DEFAULT_OPTIONS={maxDuration:3600},Record=function(Control){function Record(options){var _this;return(_this=Control.call(this,_extends$a$1({},options,{tagName:"span",controlType:"button",classNameSuffix:"record"}))||this)._seconds=0,_this._options=Object.assign({},RECORD_DEFAULT_OPTIONS,options),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$b(subClass,superClass)}(Record,Control);var _proto=Record.prototype;return _proto._render=function(){var _this_locale;this.$container.innerHTML=IconComponents_record({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_RECORDVIDEO})},_proto._renderTimer=function(){var _this__options_rootContainer,_this__options,_this=this;this._timerNode=document.createElement("span"),this._timerNode.className="ezplayer-record-timer",null==(_this__options=this._options)||null==(_this__options_rootContainer=_this__options.rootContainer)||_this__options_rootContainer.appendChild(this._timerNode),this._timerNode.innerHTML=IconComponents_recordCircle()+'<span class="ezplayer-record-timer-time">'+formatTime(this._seconds)+"<span>";var $time=this._timerNode.querySelector(".ezplayer-record-timer-time");this._timer=setInterval((function(){_this._seconds++,_this._seconds>=_this._options.maxDuration?_this._destroyTimer():$time&&($time.innerHTML=""+formatTime(_this._seconds))}),1e3)},_proto.reset=function(){this.active&&(this.active=!1,Control.prototype.reset.call(this))},_proto.destroy=function(){this._destroyTimer(),Control.prototype.destroy.call(this)},_proto._destroyTimer=function(){this._seconds=0,this._timer&&(clearInterval(this._timer),this._timer=null),this._timerNode&&(this._timerNode.remove(),this._timerNode=null),this._active=!1},_proto._onControlClick=function(e){this.active=!this.active,Control.prototype._onControlClick.call(this,e)},_create_class$3(Record,[{key:"active",get:function(){return this._active},set:function(active){this._disabled&&!this._active||this._active!==active&&(this._active=active,this._updateActiveState(active),this.active?this._renderTimer():this._destroyTimer(),this.emit(EVENTS$1.control.recordingChange,this._active))}}]),Record}(Control);function asyncGeneratorStep$2$1(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _create_class$2(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$9$1(){return _extends$9$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$9$1.apply(this,arguments)}function _set_prototype_of$a(o,p){return _set_prototype_of$a=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$a(o,p)}function _ts_generator$2(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var Talk=function(Control){function Talk(options){var _this;return(_this=Control.call(this,_extends$9$1({},options,{tagName:"span",controlType:"button",classNameSuffix:"talk"}))||this)._value=0,_this._options=options,_this._render(),_this.on(EVENTS$1.talkingChange,(function(talking){_this.active!==talking&&(_this.active=talking,_this._render())})),_this.on(EVENTS$1.talkVolumeChange,(function(value){var _this__options_onChange,_this__options;_this.value=value,null==(_this__options=_this._options)||null==(_this__options_onChange=_this__options.onChange)||_this__options_onChange.call(_this__options,value)})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$a(subClass,superClass)}(Talk,Control);var _proto=Talk.prototype;return _proto._render=function(){var _this_locale,_this_locale1;this.$container.innerHTML=this.active?IconComponents_talkGrowth({title:null==(_this_locale=this.locale)?void 0:_this_locale.BTN_TALK}):IconComponents_talk({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_TALK})},_proto.reset=function(hide){this.active&&(this._value=0,this.active=!1,this._render(),this.emit(EVENTS$1.control.talkingChange,!1),Control.prototype.reset.call(this,hide))},_proto.destroy=function(){this.active&&this.reset(),Control.prototype.destroy.call(this)},_proto._onControlClick=function(e){var fn,_this=this;return(fn=function(){return _ts_generator$2(this,(function(_state){return Control.prototype._onControlClick.call(_this,e),this.active=!this.active,this.emit(EVENTS$1.control.talkingChange,this.active),this._render(),[2]}))},function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$2$1(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$2$1(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}).call(this)},_create_class$2(Talk,[{key:"value",get:function(){return this._value},set:function(value){if(this.active&&!(value<0||value>1)){this._value=value;var gainType="silent";value>0&&value<.25?gainType="low":value>=.25&&value<.5?gainType="normal":value>=.5&&value<.75?gainType="high":value>=.75&&(gainType="deafening");var className=Array.from(this.$container.classList).find((function(className){return className.startsWith("ezplayer-talk-gain-")}));className&&this.$container.classList.remove(className),this.$container.classList.add("ezplayer-talk-gain-"+gainType)}}}]),Talk}(Control);function _create_class$1(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$8$1(){return _extends$8$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$8$1.apply(this,arguments)}function _set_prototype_of$9(o,p){return _set_prototype_of$9=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$9(o,p)}var SELECT_DEFAULT_OPTIONS={fieldNames:{label:"label",value:"value"},renderLabel:function(label){return"<span>"+(label||"")+"</span>"},onChange:function(){},onOpenChange:function(){}},Select=function(Control){function Select(options){var _this,_this__options_fieldNames,_this__picker_$body,_this__options_fieldNames_value;(_this=Control.call(this,_extends$8$1({tagName:"span",type:"button",controlType:"button"},SELECT_DEFAULT_OPTIONS,options))||this)._options=deepmerge(SELECT_DEFAULT_OPTIONS,options,{clone:!1}),_this.list=options.list||[],void 0===options.value&&null===options.value||(_this._value=options.value+"");var valueKey=null!=(_this__options_fieldNames_value=null==(_this__options_fieldNames=_this._options.fieldNames)?void 0:_this__options_fieldNames.value)?_this__options_fieldNames_value:"value";return _this._picker=new Picker(_this.$container,{getPopupContainer:function(){return Utils.isMobile?options.rootContainer:_this.$container},trigger:Utils.isMobile?"click":"hover",isMobile:Utils.isMobile,wrapClassName:"ezplayer-select-picker ezplayer-select-"+options.classNameSuffix,open:_this._options.open,offset:[0,-10],placement:"top",onOpenChange:function(open){var item=_this.list.find((function(item){return item[valueKey]+""===_this.value}));null==_this._options.onOpenChange||_this._options.onOpenChange.call(_this._options,open,_this.value,item)}}),_this.list&&_this.updateOptions(_this.list),_this._onSelectChange(),_this._activeOption(),_this._onDBlPanelClick=_this._onDBlPanelClick.bind(_this),null==(_this__picker_$body=_this._picker.$body)||_this__picker_$body.addEventListener("dblclick",_this._onDBlPanelClick),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$9(subClass,superClass)}(Select,Control);var _proto=Select.prototype;return _proto.updateOptions=function(list){var _this=this;if(void 0===list&&(list=[]),(null==list?void 0:list.length)>0&&this._picker){var _this__options_fieldNames,_this__options_fieldNames1,_this_locale,_this__picker,_this__options_fieldNames_label,_this__options_fieldNames_value,labelKey=null!=(_this__options_fieldNames_label=null==(_this__options_fieldNames=this._options.fieldNames)?void 0:_this__options_fieldNames.label)?_this__options_fieldNames_label:"label",valueKey=null!=(_this__options_fieldNames_value=null==(_this__options_fieldNames1=this._options.fieldNames)?void 0:_this__options_fieldNames1.value)?_this__options_fieldNames_value:"value";null==(_this__picker=this._picker)||_this__picker.innerHTML('<div class="ezplayer-select-panel">\n <ul class="ezplayer-select-list">\n '+list.map((function(item){return'\n <li class="ezplayer-select-option '+(+item[valueKey]===_this.value?"ezplayer-active":"")+'" data-value="'+item[valueKey]+'">\n <span>'+item[labelKey]+"</span>\n </li>\n "})).join("")+"\n </ul>\n "+(Utils.isMobile?'<div class="ezplayer-select-cancel">\n <span>'+((null==(_this_locale=this.locale)?void 0:_this_locale.cancel)||"取消")+"</span>\n </div>":"")+"\n "+(Utils.isMobile?'<span class="ezplayer-select-close">'+IconComponents_close()+"</span>":"")+"\n <div>"),this.list=list,this._activeOption()}else if(0===(null==list?void 0:list.length)){var _this__picker_innerHTML,_this__picker1;null==(_this__picker1=this._picker)||null==(_this__picker_innerHTML=_this__picker1.innerHTML)||_this__picker_innerHTML.call(_this__picker1,"")}},_proto._render=function(item){var _this__options_fieldNames;if(0!==this.list.length){var _this__options_fieldNames_label,labelKey=null!=(_this__options_fieldNames_label=null==(_this__options_fieldNames=this._options.fieldNames)?void 0:_this__options_fieldNames.label)?_this__options_fieldNames_label:"label";if(this.$container.querySelector(".ezplayer-select-btn"))this.$container.querySelector(".ezplayer-select-btn").innerHTML=null==this._options.renderLabel?void 0:this._options.renderLabel.call(this._options,null==item?void 0:item[labelKey],item,this.list);else{var $span=document.createElement("span");$span.classList.add("ezplayer-btn","ezplayer-select-btn"),$span.innerHTML=null==this._options.renderLabel?void 0:this._options.renderLabel.call(this._options,null==item?void 0:item[labelKey],item,this.list),this.$container.appendChild($span),this._options.title&&$span.setAttribute("title",this._options.title)}}},_proto._activeOption=function(){var _this=this;if(this._picker){var _this__options_fieldNames,_this__picker_$body,_this__picker_$body1,_this__options_fieldNames_value,valueKey=null!=(_this__options_fieldNames_value=null==(_this__options_fieldNames=this._options.fieldNames)?void 0:_this__options_fieldNames.value)?_this__options_fieldNames_value:"value",$active=null==(_this__picker_$body=this._picker.$body)?void 0:_this__picker_$body.querySelector(".ezplayer-active");null==$active||$active.classList.remove("ezplayer-active");var $target=null==(_this__picker_$body1=this._picker.$body)?void 0:_this__picker_$body1.querySelector('.ezplayer-select-option[data-value="'+this.value+'"]');null==$target||$target.classList.add("ezplayer-active");var target=this.list.find((function(item){return item[valueKey]+""===_this.value}));this._render(target)}},_proto._onSelectChange=function(){var _this=this;if(this._picker){var _this__options_fieldNames,_this__options_fieldNames_value,valueKey=null!=(_this__options_fieldNames_value=null==(_this__options_fieldNames=this._options.fieldNames)?void 0:_this__options_fieldNames.value)?_this__options_fieldNames_value:"value";this._delegationOption=delegate(this._picker.$body,".ezplayer-select-option","click",(function(e){var target=e.delegateTarget;if(e.stopPropagation(),!target.classList.contains("ezplayer-disabled")){var value=target.getAttribute("data-value");if(_this.value!==value){_this.value=value;var item=_this.list.find((function(item){return item[valueKey]+""===_this.value}));null==_this._options.onChange||_this._options.onChange.call(_this._options,_this.value,item),_this._picker.open=!1}}})),this._delegationClose=delegate(this._picker.$body,".ezplayer-select-close","click",(function(e){e.stopPropagation(),_this._picker.open=!1})),this._delegationCancel=delegate(this._picker.$body,".ezplayer-select-cancel","click",(function(e){e.stopPropagation(),_this._picker.open=!1}))}},_proto.destroy=function(){var _this__delegationOption_destroy,_this__delegationOption,_this__delegationClose_destroy,_this__delegationClose,_this__delegationCancel_destroy,_this__delegationCancel,_this__picker_$body,_this__picker;(null==(_this__delegationOption=this._delegationOption)||null==(_this__delegationOption_destroy=_this__delegationOption.destroy)||_this__delegationOption_destroy.call(_this__delegationOption),this._delegationOption=null,null==(_this__delegationClose=this._delegationClose)||null==(_this__delegationClose_destroy=_this__delegationClose.destroy)||_this__delegationClose_destroy.call(_this__delegationClose),this._delegationClose=null,null==(_this__delegationCancel=this._delegationCancel)||null==(_this__delegationCancel_destroy=_this__delegationCancel.destroy)||_this__delegationCancel_destroy.call(_this__delegationCancel),this._delegationCancel=null,this._picker)&&(null==(_this__picker_$body=this._picker.$body)||_this__picker_$body.removeEventListener("dblclick",this._onDBlPanelClick),null==(_this__picker=this._picker)||_this__picker.destroy(),this._picker=null);Control.prototype.destroy.call(this)},_proto._onDBlPanelClick=function(e){e.stopPropagation(),e.preventDefault()},_proto._onControlClick=function(e){null==this._options.onClick||this._options.onClick.call(this._options,e)},_create_class$1(Select,[{key:"value",get:function(){return this._value},set:function(value){this.value!==value&&(this._value=value,this._activeOption())}},{key:"disabled",get:function(){return this._disabled},set:function(disabled){this._disabled=disabled,this._picker.disabled=disabled,this._updateDisabledState(disabled)}}]),Select}(Control);function _assert_this_initialized$1(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _extends$7$1(){return _extends$7$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$7$1.apply(this,arguments)}function _set_prototype_of$8(o,p){return _set_prototype_of$8=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$8(o,p)}var DEFINITION_LEVELS_LOCALE=["VIDEO_LEVEL_FLUENT","VIDEO_LEVEL_STANDARD","VIDEO_LEVEL_HEIGH","VIDEO_LEVEL_SUPER","VIDEO_LEVEL_EXTREME","VIDEO_LEVEL_3K","VIDEO_LEVEL_4k"],DEFINITION_DEFAULT_OPTIONS={value:1,list:[]};function __filter(list,locale){return void 0===locale&&(locale={}),list.map((function(item){var levelKey=+item.level,name=item.name;return name||(name=null==locale?void 0:locale[DEFINITION_LEVELS_LOCALE[levelKey]]),"VIDEO_LEVEL_AUTO"===name?name=null==locale?void 0:locale[name]:DEFINITION_LEVELS_LOCALE.includes(name)&&(name=null==locale?void 0:locale[DEFINITION_LEVELS_LOCALE[levelKey]]),{name:name,level:item.level+"",streamTypeIn:item.streamTypeIn,type:item.type}}))}var Definition=function(Select){function Definition(options){var _this,_options_props,_options_props1,_options_locales_options_language;return void 0===options&&(options={}),(_this=Select.call(this,_extends$7$1({},DEFINITION_DEFAULT_OPTIONS,{value:null==(_options_props=options.props)?void 0:_options_props.videoLevel},options,{fieldNames:{label:"name",value:"level"},list:__filter((null==options?void 0:options.list)||(null==(_options_props1=options.props)?void 0:_options_props1.videoLevelList)||[],(null==options?void 0:options.locales[options.language])||{}),title:null==options||null==(_options_locales_options_language=options.locales[options.language])?void 0:_options_locales_options_language.BTN_HD,controlType:"button",classNameSuffix:"definition",renderLabel:function(label,item,list){var _list_;if("auto"===(null==item?void 0:item.level)){var _options_locales_options_language,realItem=list.find((function(it){return it.level===_assert_this_initialized$1(_this)._level}));return"<span>"+(null==options||null==(_options_locales_options_language=options.locales[options.language])?void 0:_options_locales_options_language.VIDEO_LEVEL_AUTO)+"("+((null==realItem?void 0:realItem.name)||"")+")</span>"}return"<span>"+(label||(null==(_list_=list[0])?void 0:_list_.name)||"")+"</span>"},onChange:function(value,item){var _options_onChange;null==options||null==(_options_onChange=options.onChange)||_options_onChange.call(options,value,item),"auto"===value?_assert_this_initialized$1(_this).emit(EVENTS$1.control.definitionChange,"auto",_assert_this_initialized$1(_this)._level):(_assert_this_initialized$1(_this)._level=value,_assert_this_initialized$1(_this).emit(EVENTS$1.control.definitionChange,value,item))},onOpenChange:function(open,value,item){var _options_onOpenChange;null==options||null==(_options_onOpenChange=options.onOpenChange)||_options_onOpenChange.call(options,open,value,item),_assert_this_initialized$1(_this).emit(EVENTS$1.control.definitionPanelOpenChange,open,value,item)}}))||this)._level="",_this.options=options||{},_this.on(EVENTS$1.setVideoLevelList,(function(list){Select.prototype.updateOptions.call(_assert_this_initialized$1(_this),__filter(list,_this.locale))})),_this.on(EVENTS$1.currentVideoLevel,(function(item,realLevel){var obj,l="object"==(void 0===item?"undefined":(obj=item)&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj)?item.level:item;if(_this._level=realLevel+"","auto"===l){var _options_locales_options_language,realItem=_this.list.find((function(it){return it.level===_this._level}));_this.$container.querySelector(".ezplayer-select-btn").innerHTML="\n <span>"+(null==options||null==(_options_locales_options_language=options.locales[options.language])?void 0:_options_locales_options_language.VIDEO_LEVEL_AUTO)+"("+((null==realItem?void 0:realItem.name)||"")+")</span>\n "}else _this.value!==_this._level+""&&(_this.value=_this._level+"")})),_this}return function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$8(subClass,superClass)}(Definition,Select),Definition.prototype.reset=function(hide){Select.prototype.reset.call(this,hide)},Definition}(Select);function _assert_this_initialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _extends$6$1(){return _extends$6$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$6$1.apply(this,arguments)}function _set_prototype_of$7(o,p){return _set_prototype_of$7=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$7(o,p)}var dist,hasRequiredDist,SPEED_DEFAULT_OPTIONS={list:[.5,1,2,4].reverse().map((function(speed){return{label:speed+"x",value:speed}}))},Speed=function(Select){function Speed(options){var _this,_options_locales_options_language,_options_locales;return(_this=Select.call(this,_extends$6$1({},SPEED_DEFAULT_OPTIONS,options,{value:(options.props.speed||1)+"",classNameSuffix:"speed",controlType:"button",title:null==options||null==(_options_locales=options.locales)||null==(_options_locales_options_language=_options_locales[options.language])?void 0:_options_locales_options_language.BTN_SPEED,onChange:function(value,item){var _options_onChange;value=+value,null==options||null==(_options_onChange=options.onChange)||_options_onChange.call(options,value,item),_assert_this_initialized(_this).emit(EVENTS$1.control.speedChange,value,item)},onOpenChange:function(open,value,item){var _options_onOpenChange;value=+value,null==options||null==(_options_onOpenChange=options.onOpenChange)||_options_onOpenChange.call(options,open,value,item),_assert_this_initialized(_this).emit(EVENTS$1.control.speedPanelOpenChange,open,value,item)}}))||this).on(EVENTS$1.speedChange,(function(speed){_this.value!==speed+""&&(_this.value=speed+"")})),_this}return function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$7(subClass,superClass)}(Speed,Select),Speed.prototype.reset=function(hide){this.value="1",Select.prototype.reset.call(this,hide)},Speed}(Select);var distExports=function(){if(hasRequiredDist)return dist;function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _ts_generator(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}hasRequiredDist=1;var AppendJS=function(){function AppendJS(){}return AppendJS.loadScript=function(src){return _async_to_generator((function(){return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,new Promise((function(resolve,reject){return AppendJS.LoadedScr.includes(src)?resolve(src):AppendJS.LoadingScrQueue[src]?AppendJS.LoadingScrQueue[src].push(resolve):(AppendJS.LoadingScrQueue[src]=[resolve],src.includes(".js")?((link=document.createElement("script")).src=src,link.async=!0):src.includes(".css")&&((link=document.createElement("link")).rel="stylesheet",link.href=src),link.onload=function(){AppendJS.LoadedScr.push(src),AppendJS.LoadingScrQueue[src].forEach((function(resolve){return resolve(src)})),AppendJS.LoadingScrQueue[src]=[]},link.onerror=function(){return reject(new Error("Failed to load "+src))},void document.head.appendChild(link));var link}))];case 1:return[2,_state.sent()]}}))}))()},AppendJS.loadScriptsBatch=function(srcArr){return _async_to_generator((function(){return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,Promise.all(srcArr.map(AppendJS.loadScript))];case 1:return[2,_state.sent()]}}))}))()},AppendJS.remove=function(src){src.forEach((function(item){var link=document.querySelector('script[src="'+item+'"]')||document.querySelector('link[href="'+item+'"]');link&&link.remove()}))},AppendJS.clear=function(){AppendJS.remove(AppendJS.LoadedScr)},AppendJS}();function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}AppendJS.LoadedScr=[],AppendJS.LoadingScrQueue={};var DEFAULT_OPTIONS={staticPath:".",place:"top-right",language:"zh-CN",current:new Date,maxDate:new Date};return dist=function(){function DatePicker(container,options){var _this=this;this._open=!1,this._change=!0,this.$container=container,this.options=Object.assign({},DEFAULT_OPTIONS,options),this.options.staticPath=(this.options.staticPath||"").replace(/\/$/,""),this.options.current&&(this._date=this.options.current),this._init(),this.$container.addEventListener("click",(function(){_this._open?_this.hide():_this.show()})),document.body.addEventListener("click",(function(e){_this.$container.contains(e.target)||_this.hide()}))}var _proto=DatePicker.prototype;return _proto._init=function(){var _this=this;this.$container.style.cssText+=";position: relative;",this.$container.classList.add("datepicker-inline-"+this.options.place),AppendJS.loadScriptsBatch([this.options.staticPath+"/rec/jquery.min.js",this.options.staticPath+"/rec/datepicker.min.css"]).then((function(){AppendJS.loadScriptsBatch([_this.options.staticPath+"/rec/datepicker.js"]).then((function(){AppendJS.loadScriptsBatch([_this.options.staticPath+"/rec/datepicker.zh-CN.js",_this.options.staticPath+"/rec/datepicker.en-US.js"]).then((function(){window.$(_this.$container).datepicker({date:_this.options.current,language:_this.options.language,endDate:_this.options.maxDate,inline:!0}),_this.hide(),window.$(_this.$container).on("pick.datepicker",(function(e){var _this__date,_this__date1,_this__date2,_this__date3,_this__date4,_this__date5;"year"===e.view&&(null==(_this__date=_this._date)?void 0:_this__date.getFullYear())!==e.date.getFullYear()?null==_this.options.onYearChange||_this.options.onYearChange.call(_this.options,e.date):"month"!==e.view||(null==(_this__date1=_this._date)?void 0:_this__date1.getMonth())===e.date.getMonth()&&(null==(_this__date2=_this._date)?void 0:_this__date2.getFullYear())===e.date.getFullYear()?!["day","pick"].includes(e.view||e.type)||(null==(_this__date3=_this._date)?void 0:_this__date3.getDate())===e.date.getDate()&&(null==(_this__date4=_this._date)?void 0:_this__date4.getMonth())===e.date.getMonth()&&(null==(_this__date5=_this._date)?void 0:_this__date5.getFullYear())===e.date.getFullYear()||(_this._change&&(null==_this.options.onChange||_this.options.onChange.call(_this.options,e.date)),_this._date=new Date(e.date.getTime())):null==_this.options.onMonthChange||_this.options.onMonthChange.call(_this.options,e.date),"day"===e.view&&_this.hide(),_this._change=!0}))}))}))}))},_proto.setDate=function(date,change){void 0===change&&(change=!0),this.$container.querySelector(".datepicker-inline")&&(this._change=change,window.$(this.$container).datepicker("setDate",date))},_proto.hide=function(){var $datepicker=this.$container.querySelector(".datepicker-inline");$datepicker&&(this._open&&(this._open=!1,null==this.options.onPanelChange||this.options.onPanelChange.call(this.options,!1,this._date)),$datepicker.classList.add("datepicker-hide"))},_proto.show=function(){var _window_$_datepicker,_window_$,$datepicker=this.$container.querySelector(".datepicker-inline");$datepicker&&(this._open||(this._open=!0,null==this.options.onPanelChange||this.options.onPanelChange.call(this.options,!0,this._date)),this._date&&this.setDate(this._date,!1),null==(_window_$_datepicker=(_window_$=window.$(this.$container)).datepicker)||_window_$_datepicker.call(_window_$,"showView"),"bottom-left"===this.options.place?$datepicker.style.cssText+="top: "+(this.$container.clientHeight+10)+"px; bottom: auto; right: auto; left: 0px":$datepicker.style.cssText+="bottom: "+(this.$container.clientHeight+10)+"px; top: auto",$datepicker.classList.remove("datepicker-hide"))},_proto.destroy=function(){this.hide(),this._date=void 0,window.$(this.$container).datepicker("destroy")},_create_class(DatePicker,[{key:"date",get:function(){return this._date}}]),DatePicker}()}(),DatePickerUtil=getDefaultExportFromCjs(distExports),DateTime$1=function(){function DateTime(){}return DateTime.formate=function(date,formatType,timeZone){void 0===timeZone&&(timeZone=0);var dateTime=date;"string"==typeof date?dateTime=DateTime.strToDate(date):"number"==typeof date&&(dateTime=new Date(date));var year=(dateTime=new Date(dateTime.getTime()-3600*timeZone*1e3)).getFullYear(),month=String(dateTime.getMonth()+1).padStart(2,"0"),day=String(dateTime.getDate()).padStart(2,"0"),hours=String(dateTime.getHours()).padStart(2,"0"),minutes=String(dateTime.getMinutes()).padStart(2,"0"),seconds=String(dateTime.getSeconds()).padStart(2,"0");switch(formatType){case"YYYY-MM-DD hh:mm:ss":return year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;case"YYYYMMDDhhmmss":return""+year+month+day+hours+minutes+seconds;case"YYYY/MM/DD hh:mm:ss":return year+"/"+month+"/"+day+" "+hours+":"+minutes+":"+seconds;case"YYYYMMDDThhmmssZ":return""+year+month+day+"T"+hours+minutes+seconds+"Z";case"YYYY/MM/DD":return year+"/"+month+"/"+day;case"YYYYMMDD":return""+year+month+day;case"YYYY-MM-DD":return year+"-"+month+"-"+day;case"YYYY":return""+year;case"MM":return""+month;case"DD":return""+day;case"hh:mm:ss":return hours+":"+minutes+":"+seconds;case"hh":return""+hours;case"mm":return""+minutes;case"ss":return""+seconds;default:throw new Error("Unsupported format type")}},DateTime.diff=function(date1,date2,diffType){var dateTime1=date1;"string"==typeof date1?dateTime1=DateTime.strToDate(date1):"number"==typeof date1&&(dateTime1=new Date(date1));var dateTime2=date2;"string"==typeof date2?dateTime1=DateTime.strToDate(date2):"number"==typeof date2&&(dateTime1=new Date(date2));var diffSecond=dateTime1.getTime()-dateTime2.getTime();switch(diffType){case"year":return dateTime1.getFullYear()-dateTime2.getFullYear();case"month":var months=12*(dateTime1.getFullYear()-dateTime2.getFullYear())+(dateTime1.getMonth()-dateTime2.getMonth());return dateTime1.getDate()<dateTime2.getDate()&&months--,months;case"day":return diffSecond/60/60/24;case"hour":return diffSecond/60/60;case"minute":return diffSecond/60;case"second":return diffSecond;default:throw new Error("Unsupported diff type")}},DateTime.now=function(){return Date.now()},DateTime.strToDate=function(str){var time=(str+"").replace(/-/gi,"").replace(/:/gi,"").replace(/\//gi,"").replace(/ /gi,"").replace(/T|Z/gi,"");if(10===(str+"").length)return new Date(+str);if(13===(str+"").length)return new Date(+str);var year=time.slice(0,4),month=time.slice(4,6),day=time.slice(6,8),hour=time.slice(8,10),minute=time.slice(10,12),second=time.slice(12,14);return new Date(year+"/"+month+"/"+day+" "+hour+":"+minute+":"+second)},DateTime.padStart=function(num){return num<10?"0"+num:num+""},DateTime}();function _extends$5$1(){return _extends$5$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$5$1.apply(this,arguments)}function _set_prototype_of$6(o,p){return _set_prototype_of$6=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$6(o,p)}var DatePickerControl=function(Control){function DatePickerControl(options){var _this,_this_options_props_urlInfo_searchParams,_this_options_props_urlInfo,_this_options_props;return(_this=Control.call(this,_extends$5$1({},options,{tagName:"span",controlType:"button",classNameSuffix:"date"}))||this).options=options,_this._value=DateTime$1.formate((null==(_this_options_props=_this.options.props)||null==(_this_options_props_urlInfo=_this_options_props.urlInfo)||null==(_this_options_props_urlInfo_searchParams=_this_options_props_urlInfo.searchParams)?void 0:_this_options_props_urlInfo_searchParams.begin)||new Date,"YYYY-MM-DD"),_this._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$6(subClass,superClass)}(DatePickerControl,Control);var _proto=DatePickerControl.prototype;return _proto._render=function(){var _this_locale,_this_locale1,_this=this;isMobile$1()?this.$container.innerHTML='\n <span class="ezplayer-mobile-date-filter" title="'+((null==(_this_locale=this.locale)?void 0:_this_locale.BTN_CALENDAR)||"")+'">\n <span class="ezplayer-mobile-date-filter-value">'+this._getDateStr()+"</span>\n "+IconComponents_filter()+"\n <span>":this.$container.innerHTML=IconComponents_date({title:null==(_this_locale1=this.locale)?void 0:_this_locale1.BTN_CALENDAR});this.dataPickerUtil=new DatePickerUtil(this.$container,{staticPath:this.options.staticPath,language:"zh"===this.options.language?"zh-CN":"en-US",current:new Date(this._value+" 00:00:00"),maxDate:this.options.maxDate||new Date,place:isMobile$1()?"bottom-left":"top-right",onChange:function(date){date&&_this._value!==DateTime$1.formate(date,"YYYY-MM-DD")&&(_this._value=DateTime$1.formate(date,"YYYY-MM-DD"),null==_this.options.onChange||_this.options.onChange.call(_this.options,date),_this.emit(EVENTS$1.control.dateChange,date),date&&_this.$container.querySelector(".ezplayer-mobile-date-filter-value")&&(_this.$container.querySelector(".ezplayer-mobile-date-filter-value").innerHTML=_this._getDateStr()))},onPanelChange:function(open,date){null==_this.options.onPanelChange||_this.options.onPanelChange.call(_this.options,open,date),_this.emit(EVENTS$1.control.datePanelOpenChange,open,date)}})},_proto.setDate=function(date,change){var _this_dataPickerUtil;void 0===change&&(change=!0),null==(_this_dataPickerUtil=this.dataPickerUtil)||_this_dataPickerUtil.setDate(date,change),date&&!change&&this._value!==DateTime$1.formate(date,"YYYY-MM-DD")&&(this._value=DateTime$1.formate(date,"YYYY-MM-DD"),date&&this.$container.querySelector(".ezplayer-mobile-date-filter-value")&&(this.$container.querySelector(".ezplayer-mobile-date-filter-value").innerHTML=this._getDateStr()))},_proto.reset=function(){var _this_dataPickerUtil;null==(_this_dataPickerUtil=this.dataPickerUtil)||_this_dataPickerUtil.hide(),Control.prototype.reset.call(this)},_proto.destroy=function(){this.dataPickerUtil&&(this.dataPickerUtil.destroy(),this.dataPickerUtil=null),Control.prototype.destroy.call(this)},_proto._getDateStr=function(){var arr=this._value.split("-");return arr[1]+"."+arr[2]},_proto._onControlClick=function(e){Control.prototype._onControlClick.call(this,e)},DatePickerControl}(Control);function _extends$4$1(){return _extends$4$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$4$1.apply(this,arguments)}function _set_prototype_of$5(o,p){return _set_prototype_of$5=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$5(o,p)}var TimeLineControl=function(Control){function TimeLineControl(options){var _this,_this__options_props,_this__options;return(_this=Control.call(this,_extends$4$1({},options,{tagName:"div",controlType:"block",classNameSuffix:"time-line"}))||this)._$add=null,_this._$reduce=null,_this._currentTime=0,_this.records=[],_this._currentTime=0,_this._options=options,_this.records=(null==(_this__options=_this._options)||null==(_this__options_props=_this__options.props)?void 0:_this__options_props.recordList)||[],_this._render(),_this.on(EVENTS$1.setAllDayRecTimes,(function(records){var _this_timeLineUtil_updateTimeSections,_this_timeLineUtil;_this.records=records,null==(_this_timeLineUtil=_this.timeLineUtil)||null==(_this_timeLineUtil_updateTimeSections=_this_timeLineUtil.updateTimeSections)||_this_timeLineUtil_updateTimeSections.call(_this_timeLineUtil,records)})),_this.on(EVENTS$1.getOSDTime,(function(time){if(time){var _this_timeLineUtil_update,_this_timeLineUtil,date=new Date(1e3*time);_this._currentTime=date.getTime(),null==(_this_timeLineUtil=_this.timeLineUtil)||null==(_this_timeLineUtil_update=_this_timeLineUtil.update)||_this_timeLineUtil_update.call(_this_timeLineUtil,date)}})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$5(subClass,superClass)}(TimeLineControl,Control);var _proto=TimeLineControl.prototype;return _proto._render=function(){var _this_timeLineUtil_updateTimeSections,_this_timeLineUtil,_this=this,_timeLineOptions={language:this._options.language||"zh",coverQuery:this._options.coverQuery||"",onChange:function(date){_this._currentTime!==(null==date?void 0:date.getTime())&&(null==_this._options.onChange||_this._options.onChange.call(_this._options,date),_this.emit(EVENTS$1.control.timeLineChange,date))},onPickerOpenChange:function(open){_this.emit(EVENTS$1.control.timeLinePanelOpenChange,open)},onPickerSelect:function(item){var date=null;try{date=10===(item.startTime+"").length?new Date(1e3*item.startTime):(item.startTime,new Date(item.startTime)),null==_this._options.onChange||_this._options.onChange.call(_this._options,date),_this.emit(EVENTS$1.control.timeLineChange,date)}catch(error){}}};isMobile$1()?this.timeLineUtil=new distExports$3.MobileTimeLine(this.$container,_timeLineOptions):(this.timeLineUtil=new distExports$3.TimeLine(this.$container,_timeLineOptions),this._renderAddReduce()),null==(_this_timeLineUtil=this.timeLineUtil)||null==(_this_timeLineUtil_updateTimeSections=_this_timeLineUtil.updateTimeSections)||_this_timeLineUtil_updateTimeSections.call(_this_timeLineUtil,this.records),this.timeLineUtil.update(new Date)},_proto.setWidth=function(width){isMobile$1()||this.timeLineUtil.resize(width)},_proto._renderAddReduce=function(){var _this=this;this._$add=document.createElement("span"),this._$add.classList.add("ezplayer-time-line-scale-add"),this._$add.innerHTML=IconComponents_add(),this._$add.addEventListener("click",(function(){if(_this.timeLineUtil){var currentScale=Math.floor(_this.timeLineUtil.timeWidth);_this.timeLineUtil.setTimeWidth(currentScale+1)}})),this._$reduce=document.createElement("span"),this._$reduce.classList.add("ezplayer-time-line-scale-sub"),this._$reduce.innerHTML=IconComponents_reduce(),this._$reduce.addEventListener("click",(function(){if(_this.timeLineUtil){var currentScale=Math.floor(_this.timeLineUtil.timeWidth);_this.timeLineUtil.setTimeWidth(currentScale-1)}})),this.$container.appendChild(this._$add),this.$container.appendChild(this._$reduce)},_proto.destroy=function(){this._$add&&(this._$add.remove(),this._$add=null),this._$reduce&&(this._$reduce.remove(),this._$reduce=null),this.timeLineUtil&&(this.timeLineUtil.destroy(),this.timeLineUtil=null),Control.prototype.destroy.call(this)},_proto._onControlClick=function(e){null==this._options.onClick||this._options.onClick.call(this._options,e)},TimeLineControl}(Control);function _extends$3$1(){return _extends$3$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$3$1.apply(this,arguments)}function _set_prototype_of$4(o,p){return _set_prototype_of$4=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$4(o,p)}var Device=function(Control){function Device(options){var _this;return(_this=Control.call(this,_extends$3$1({},options,{tagName:"span",controlType:"text",classNameSuffix:"device"}))||this)._render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$4(subClass,superClass)}(Device,Control);var _proto=Device.prototype;return _proto._render=function(){var _this___options_props_urlInfo,_this___options_props;this.$container.innerHTML='<span class="ezplayer-text ezplayer-text-device">'+this._splicingString(this.__options.deviceName,null==(_this___options_props=this.__options.props)||null==(_this___options_props_urlInfo=_this___options_props.urlInfo)?void 0:_this___options_props_urlInfo.deviceSerial)+"</span>"},_proto.update=function(deviceName,deviceSerial){if(this.$container.querySelector(".ezplayer-text-device")){var $span=this.$container.querySelector(".ezplayer-text-device"),text=this._splicingString(deviceName,deviceSerial);null==$span||$span.setAttribute("title",text),$span.innerHTML=text}},_proto._splicingString=function(deviceName,deviceSerial){return(deviceName||"")+(deviceSerial?deviceName?"("+deviceSerial+")":""+deviceSerial:"")},Device}(Control),Controls={play:Play,volume:Volume,device:Device,capturePicture:CapturePicture,ptz:Ptz$1,record:Record,talk:Talk,zoom:Zoom$1,definition:Definition,fullscreen:Fullscreen,globalFullscreen:GlobalFullscreen,rec:Rec,speed:Speed,date:DatePickerControl,timeLine:TimeLineControl};function _set_prototype_of$3(o,p){return _set_prototype_of$3=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$3(o,p)}var RecFooter=function(EventEmitter){function RecFooter(container,options){var _this;return void 0===options&&(options={hasDatePicker:!0}),(_this=EventEmitter.call(this)||this).options=options,_this.$container=container,_this.$popupContainer=document.createElement("div"),_this.$popupContainer.classList.add("ezplayer-rec-footer"),_this.options.hasDatePicker&&_this.$popupContainer.classList.add("ezplayer-rec-footer-has-date-picker"),_this.$container.appendChild(_this.$popupContainer),_this.$timeLineContainer=document.createElement("div"),_this.$timeLineContainer.classList.add("ezplayer-rec-footer-time-line"),_this.options.hasDatePicker&&(_this.$popupContainer.appendChild(_this.$timeLineContainer),_this.$datePickerContainer=document.createElement("div"),_this.$datePickerContainer.classList.add("ezplayer-rec-footer-date-picker"),_this.$popupContainer.appendChild(_this.$datePickerContainer)),_this.$popupContainer.addEventListener("dblclick",(function(e){e.preventDefault(),e.stopPropagation()})),_this}return function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$3(subClass,superClass)}(RecFooter,EventEmitter),RecFooter.prototype.destroy=function(){var _this_$timeLineContainer_remove,_this_$timeLineContainer,_this_$popupContainer_remove,_this_$popupContainer;(this.$datePickerContainer&&(this.$datePickerContainer.remove(),this.$datePickerContainer=null),this.$timeLineContainer)&&(null==(_this_$timeLineContainer=this.$timeLineContainer)||null==(_this_$timeLineContainer_remove=_this_$timeLineContainer.remove)||_this_$timeLineContainer_remove.call(_this_$timeLineContainer),this.$timeLineContainer=null);this.$popupContainer&&(null==(_this_$popupContainer=this.$popupContainer)||null==(_this_$popupContainer_remove=_this_$popupContainer.remove)||_this_$popupContainer_remove.call(_this_$popupContainer),this.$popupContainer=null);this.emit(EVENTS$1.theme.recFooterDestroy)},RecFooter}(EventEmitter$1);function _set_prototype_of$2(o,p){return _set_prototype_of$2=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$2(o,p)}var MobileExtend=function(EventEmitter){function MobileExtend($siblingContainer){var _this;return(_this=EventEmitter.call(this)||this)._$siblingContainer=$siblingContainer,_this.render(),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$2(subClass,superClass)}(MobileExtend,EventEmitter);var _proto=MobileExtend.prototype;return _proto.render=function(){this.$container||(this.$container=document.createElement("div"),this.$container.classList.add("ezplayer-mobile-extend"),null==this._$siblingContainer.insertAdjacentElement||this._$siblingContainer.insertAdjacentElement.call(this._$siblingContainer,"afterend",this.$container),this.$controlPanel=document.createElement("div"),this.$controlPanel.classList.add("ezplayer-mobile-extend-control-panel"),this.$container.appendChild(this.$controlPanel),this.$content=document.createElement("div"),this.$content.classList.add("ezplayer-mobile-extend-control-content"),this.$controlPanel.appendChild(this.$content),this.$top=document.createElement("div"),this.$top.classList.add("ezplayer-mobile-extend-control-top"),this.$content.appendChild(this.$top),this.$topLeft=document.createElement("div"),this.$topLeft.classList.add("ezplayer-mobile-extend-control-top-left"),this.$top.appendChild(this.$topLeft),this.$topRight=document.createElement("div"),this.$topRight.classList.add("ezplayer-mobile-extend-control-top-right"),this.$top.appendChild(this.$topRight))},_proto.destroy=function(){var _this_$container;null==(_this_$container=this.$container)||_this_$container.remove(),this.emit(EVENTS$1.theme.mobileExtendDestroy)},MobileExtend}(EventEmitter$1);function _extends$2$1(){return _extends$2$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$2$1.apply(this,arguments)}function _set_prototype_of$1(o,p){return _set_prototype_of$1=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of$1(o,p)}var PAUSE_DEFAULT_OPTIONS={},Pause=function(Control){function Pause(options){var _this;return void 0===options&&(options={}),(_this=Control.call(this,Object.assign({},PAUSE_DEFAULT_OPTIONS,_extends$2$1({},options,{tagName:"div",controlType:"block",classNameSuffix:"pause"})))||this)._timer=null,_this._timer2=null,_this._timer3=null,_this._firstFlag=!1,_this._options=Object.assign({},PAUSE_DEFAULT_OPTIONS,options),_this.$container.classList.add("ezplayer-pause","ezplayer-hide"),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of$1(subClass,superClass)}(Pause,Control);var _proto=Pause.prototype;return _proto.show=function(playing,always){var _this_$container_classList,_this_$container,_this=this;this.$container&&(this._firstFlag?this.$container.style.cssText+="pointer-events: none;":this._firstFlag=!0,this.$container.innerHTML=playing?'<div class="ezplayer-pause-circle">'+IconComponents_play()+"</div>":'<div class="ezplayer-pause-circle">'+IconComponents_pause()+"</div>",this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer2&&(clearTimeout(this._timer2),this._timer2=null),null==(_this_$container=this.$container)||null==(_this_$container_classList=_this_$container.classList)||_this_$container_classList.remove("ezplayer-hide"),this._timer=setTimeout((function(){var _this_$container_classList,_this_$container;_this._timer&&(clearTimeout(_this._timer),_this._timer=null),always||(null==(_this_$container=_this.$container)||null==(_this_$container_classList=_this_$container.classList)||_this_$container_classList.add("ezplayer-pause-transform"),_this._timer2=setTimeout((function(){var _this_$container_classList,_this_$container,_this_$container_classList1,_this_$container1;_this._timer2&&(clearTimeout(_this._timer2),_this._timer2=null),null==(_this_$container=_this.$container)||null==(_this_$container_classList=_this_$container.classList)||_this_$container_classList.add("ezplayer-hide"),null==(_this_$container1=_this.$container)||null==(_this_$container_classList1=_this_$container1.classList)||_this_$container_classList1.remove("ezplayer-pause-transform")}),300))}),10))},_proto.destroy=function(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._timer2&&(clearTimeout(this._timer2),this._timer2=null),this._timer3&&(clearTimeout(this._timer3),this._timer3=null),this.hide(),Control.prototype.destroy.call(this)},_proto._onControlClick=function(e){var _this=this;if(e.stopPropagation(),e.preventDefault(),this._firstFlag){if(this._timer3)return clearTimeout(this._timer3),void(this._timer3=null);this._timer3=setTimeout((function(){_this._timer3&&(clearTimeout(_this._timer3),_this._timer3=null),_this.emit(EVENTS$1.control.play,!0,"pause")}),250)}},Pause}(Control),_unmountedControls=function(theme){if(theme.controls){var hasControls=Object.keys(theme.controls).length>0||theme._header||theme._footer;if(theme._interactiveResult&&(null==theme._interactiveResult.cleanup||theme._interactiveResult.cleanup.call(theme._interactiveResult),theme._interactiveResult=null),hasControls&&theme.emit(EVENTS$1.control.beforeUnmountControls),Object.keys(theme.controls).length>0){for(var key in theme.controls){var _theme_controls_key_destroy,_theme_controls_key;null==(_theme_controls_key_destroy=(_theme_controls_key=theme.controls[key]).destroy)||_theme_controls_key_destroy.call(_theme_controls_key)}theme.controls=null}theme._pauseControl&&(null==theme._pauseControl.destroy||theme._pauseControl.destroy.call(theme._pauseControl)),theme._loadingControl&&(null==theme._loadingControl.destroy||theme._loadingControl.destroy.call(theme._loadingControl)),theme.messageControl&&(null==theme.messageControl.destroy||theme.messageControl.destroy.call(theme.messageControl)),theme.posterControl&&(null==theme.posterControl.destroy||theme.posterControl.destroy.call(theme.posterControl)),theme._headerMoreControl&&(null==theme._headerMoreControl.destroy||theme._headerMoreControl.destroy.call(theme._headerMoreControl),theme._headerMoreControl=null),theme._footerMoreControl&&(null==theme._footerMoreControl.destroy||theme._footerMoreControl.destroy.call(theme._footerMoreControl),theme._footerMoreControl=null),theme._recFooter&&(theme._recFooter.destroy(),theme._recFooter=null),theme._mobileExtend&&(theme._mobileExtend.destroy(),theme._mobileExtend=null),theme._header&&(theme._header.destroy(),theme._header=null),theme._footer&&(theme._footer.destroy(),theme._footer=null),theme._onPauseTimingFunc&&(theme._onPauseTimingFunc=null),hasControls&&theme.emit(EVENTS$1.control.unmountedControls)}};function _array_like_to_array$1(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function asyncGeneratorStep$1$1(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _extends$1$1(){return _extends$1$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$1$1.apply(this,arguments)}function _create_for_of_iterator_helper_loose$1(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array$1(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array$1(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _ts_generator$1(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var AUTH_KEY=["ptz"];function _renderControls(theme,$container,btnList,props){if(void 0===props&&(props={}),theme.$container)for(var _step,_iterator=_create_for_of_iterator_helper_loose$1(btnList);!(_step=_iterator()).done;){var _theme_options_mobileExtendOptions,_theme_options_mobileExtendOptions_controls,_theme_options_mobileExtendOptions1,_theme_controls,_theme_options,_theme_options1,item=_step.value;if(!(((null==(_theme_options_mobileExtendOptions=theme.options.mobileExtendOptions)?void 0:_theme_options_mobileExtendOptions.controls)||[]).includes(item.iconId)&&"ptz"!==item.iconId||(null==(_theme_options_mobileExtendOptions1=theme.options.mobileExtendOptions)||null==(_theme_options_mobileExtendOptions_controls=_theme_options_mobileExtendOptions1.controls)?void 0:_theme_options_mobileExtendOptions_controls.includes("rec"))&&REC_GROUP.includes(item.iconId))||!Utils.isMobile)if(REC_GROUP.includes(item.iconId)&&theme._header)_renderRecType(theme,theme._header.$right,item.iconId,props);else if(DEVICE_INFO_GROUP.includes(item.iconId))null!==theme.options.deviceOptions&&((null==(_theme_controls=theme.controls)?void 0:_theme_controls.deviceControl)||(theme.controls.deviceControl=new Controls.device(_extends$1$1({rootContainer:theme.$container,getPopupContainer:function(){return $container},recType:theme.recType,language:theme.options.language,locales:theme.i18n.translations,type:theme.options.type,deviceSerial:theme.urlInfo.deviceSerial,channelNo:theme.urlInfo.channelNo},(null==(_theme_options=theme.options)?void 0:_theme_options.deviceOptions)||{},{props:props}))));else if(Controls[item.iconId]){if(null!==theme.options[item.iconId+"Options"])theme.controls[item.iconId+"Control"]=new Controls[item.iconId](_extends$1$1({rootContainer:theme.$container,getPopupContainer:function(){return $container},language:theme.options.language||"zh",locales:theme.i18n.translations},AUTH_KEY.includes(item.iconId)?{env:theme.options.env,accessToken:theme.options.accessToken,token:theme.options.token,deviceSerial:theme.urlInfo.deviceSerial,channelNo:theme.urlInfo.channelNo}:{},{PLAY_TYPE:theme.options.type},(null==(_theme_options1=theme.options)?void 0:_theme_options1[item.iconId+"Options"])||{},{props:props}))}else theme.logger.warn("["+item.iconId+"] control does not exist")}}function _renderTheme(theme,data){return(fn=function(){var _theme_posterControl,_filterThemeData_header,_filterThemeData_footer,_theme_options_mobileExtendOptions_controls,_theme_options_mobileExtendOptions,themeData,filterThemeData,props,_$_filterLeftRightControls,leftBtns,rightBtns,_theme_controls,_theme_controls1,_$_filterLeftRightControls1,leftBtns1,rightBtns1,_filterThemeData_footer_btnList,list,_needTimeLine,_theme_options_mobileExtendOptions1,_theme_options_mobileExtendOptions2,_theme_options_mobileExtendOptions3,_theme_options_mobileExtendOptions_controls1,_theme_options_mobileExtendOptions4,hasPtz,_filterThemeData_header1,_filterThemeData_footer1,_filterThemeData_footer_btnList1;return _ts_generator$1(this,(function(_state){switch(_state.label){case 0:return[4,getThemeData(theme,data)];case 1:if(themeData=_state.sent(),_unmountedControls(theme),"[object Object]"!==Object.prototype.toString.call(themeData))return[2];if(null!==theme.options.loadingOptions&&(theme._loadingControl=new Loading(_extends$1$1({language:theme.options.language,locales:theme.i18n.translations},theme.options.loadingOptions||{},{getPopupContainer:function(){return theme.$container}}))),null!==theme.options.pauseOptions&&(theme._pauseControl=new Pause(_extends$1$1({language:theme.options.language,locales:theme.i18n.translations},theme.options.pauseOptions||{},{getPopupContainer:function(){return theme.contentControl.$wrapper}})),theme.options.autoPlay||theme._pauseControl.show(!1,!0)),null!==theme.options.messageOptions&&(theme.messageControl=new Message(_extends$1$1({rootContainer:theme.$container},theme.options.messageOptions||{},{getPopupContainer:function(){return theme.contentControl.$wrapper}}))),null!==theme.options.posterOptions&&(theme.posterControl=new Poster(_extends$1$1({},theme.options.posterOptions||{},{getPopupContainer:function(){return theme.contentControl.$video}}))),theme.controls={},theme.emit(EVENTS$1.control.beforeMountControls),filterThemeData=function(themeData){var _themeData_header,_themeData_footer,_themeData_autoFocus,data={};data.autoFocus=null!=(_themeData_autoFocus=null==themeData?void 0:themeData.autoFocus)?_themeData_autoFocus:3,data.poster=(null==themeData?void 0:themeData.poster)||"";var _themeData_header1,_themeData_header2,_themeData_header3,_themeData_footer1,_themeData_footer2,_themeData_footer3,deviceControls=[],recControls=[],headerBtnList=((null==themeData||null==(_themeData_header=themeData.header)?void 0:_themeData_header.btnList)||[]).filter((function(item){return 1===item.isrender&&["deviceID","deviceName"].includes(item.iconId)?(deviceControls.push(item),!1):1===item.isrender&&REC_GROUP.includes(item.iconId)?(recControls.push(recControls[0]?_extends$g({},item,{part:recControls[0].part}):item),!1):1===item.isrender})).map((function(item){return replaceKey[item.iconId]&&(item.iconId=replaceKey[item.iconId]),item})),footerBtnList=((null==themeData||null==(_themeData_footer=themeData.footer)?void 0:_themeData_footer.btnList)||[]).filter((function(item){return 1===item.isrender&&DEVICE_INFO_GROUP.includes(item.iconId)?(deviceControls.push(item),!1):1===item.isrender&&REC_GROUP.includes(item.iconId)?(recControls.push(recControls[0]?_extends$g({},item,{part:recControls[0].part}):item),!1):1===item.isrender})).map((function(item){return replaceKey[item.iconId]&&(item.iconId=replaceKey[item.iconId]),item}));return headerBtnList.length>0||deviceControls.length>0||recControls.length>0?(data.header={},data.header.color=null==themeData||null==(_themeData_header1=themeData.header)?void 0:_themeData_header1.color,data.header.backgroundColor=null==themeData||null==(_themeData_header2=themeData.header)?void 0:_themeData_header2.backgroundColor,data.header.activeColor=null==themeData||null==(_themeData_header3=themeData.header)?void 0:_themeData_header3.activeColor,data.header.btnList=[].concat(deviceControls||[],recControls||[],headerBtnList||[])):data.header=void 0,footerBtnList.length>0?(data.footer={},data.footer.color=null==themeData||null==(_themeData_footer1=themeData.footer)?void 0:_themeData_footer1.color,data.footer.backgroundColor=null==themeData||null==(_themeData_footer2=themeData.footer)?void 0:_themeData_footer2.backgroundColor,data.footer.activeColor=null==themeData||null==(_themeData_footer3=themeData.footer)?void 0:_themeData_footer3.activeColor,data.footer.btnList=footerBtnList):data.footer=void 0,data}(themeData),theme._themeData=filterThemeData,filterThemeData.poster&&theme.setPoster(filterThemeData.poster),theme._playing||null==(_theme_posterControl=theme.posterControl)||_theme_posterControl.show(),0===(props=THEME_PROPS.reduce((function(acc,cur){return acc[cur]=theme[cur],acc}),{})).width&&(props.width=Math.floor(theme.$container.clientWidth)),0===props.height&&(props.height=Math.floor(theme.$container.clientHeight)),filterThemeData.header&&(theme._header=new Header({getPopupContainer:function(){return theme.$container},color:filterThemeData.header.color,activeColor:filterThemeData.header.activeColor,backgroundColor:filterThemeData.header.backgroundColor}),_$_filterLeftRightControls=_filterLeftRightControls(filterThemeData.header.btnList||[]),leftBtns=_$_filterLeftRightControls[0],rightBtns=_$_filterLeftRightControls[1],_renderControls(theme,theme._header.$left,leftBtns,props),_renderControls(theme,theme._header.$right,rightBtns,props)),filterThemeData.footer&&(theme._footer=new Footer({getPopupContainer:function(){return theme.$container},color:filterThemeData.footer.color,activeColor:filterThemeData.footer.activeColor,backgroundColor:filterThemeData.footer.backgroundColor}),(theme._header||theme._footer)&&0!==(null==filterThemeData?void 0:filterThemeData.autoFocus)&&(theme._interactiveResult=function($container,second,callback){void 0===second&&(second=3e3);var _timer=null,_open=!1,_alwaysDisplay=!1,_$header=$container.querySelector(".ezplayer-header"),_$footer=$container.querySelector(".ezplayer-footer"),_clearTimeout=function(){_timer&&(clearTimeout(_timer),_timer=null)},_show=function(){null==_clearTimeout||_clearTimeout(),null==_$header||_$header.classList.remove("ezplayer-hide-transition"),null==_$footer||_$footer.classList.remove("ezplayer-hide-transition"),_open||callback(!0),_open=!0},_hide=function(){_alwaysDisplay||(null==_clearTimeout||_clearTimeout(),$container.classList.contains("ezplayer-player-pause")||(null==_$header||_$header.classList.add("ezplayer-hide-transition"),null==_$footer||_$footer.classList.add("ezplayer-hide-transition"),_open&&callback(!1),_open=!1))},_setTimeoutShow=function(){null==_show||_show(),_timer=setTimeout((function(){null==_clearTimeout||_clearTimeout(),null==_hide||_hide()}),second)},_headerFooterMousemove=function(e){var _e_stopPropagation;null==e||null==(_e_stopPropagation=e.stopPropagation)||_e_stopPropagation.call(e),null==_clearTimeout||_clearTimeout()},_touchStart=function(){_open?null==_hide||_hide():null==_setTimeoutShow||_setTimeoutShow()},_headerFooterTouchStart=function(e){var _e_stopPropagation;null==e||null==(_e_stopPropagation=e.stopPropagation)||_e_stopPropagation.call(e),null==_setTimeoutShow||_setTimeoutShow()};if(_setTimeoutShow(),Utils.isMobile&&_touchStart)$container.addEventListener("click",_touchStart),_$footer&&_$footer.addEventListener("click",_headerFooterTouchStart),_$header&&_$header.addEventListener("click",_headerFooterTouchStart);else{var _$footer_addEventListener,_$footer_addEventListener1,_$header_addEventListener,_$header_addEventListener1,eventName1=window.PointerEvent?"pointerdown":"click";$container.addEventListener(eventName1,_setTimeoutShow),$container.addEventListener("mousemove",_setTimeoutShow),$container.addEventListener("mouseleave",_hide),_$footer&&(null==_$footer||null==(_$footer_addEventListener=_$footer.addEventListener)||_$footer_addEventListener.call(_$footer,eventName1,_headerFooterMousemove),null==_$footer||null==(_$footer_addEventListener1=_$footer.addEventListener)||_$footer_addEventListener1.call(_$footer,"mousemove",_headerFooterMousemove)),_$header&&(null==_$header||null==(_$header_addEventListener=_$header.addEventListener)||_$header_addEventListener.call(_$header,eventName1,_headerFooterMousemove),null==_$header||null==(_$header_addEventListener1=_$header.addEventListener)||_$header_addEventListener1.call(_$header,"mousemove",_headerFooterMousemove))}return{cleanup:function(){if($container){if(Utils.isMobile&&_touchStart&&($container.removeEventListener("click",_touchStart),_$footer&&_setTimeoutShow&&_$footer.removeEventListener("click",_headerFooterTouchStart),_$header&&_setTimeoutShow&&_$header.removeEventListener("click",_headerFooterTouchStart)),_setTimeoutShow){var _$footer_removeEventListener,_$footer_removeEventListener1,_$header_removeEventListener,_$header_removeEventListener1,eventName1=window.PointerEvent?"pointerdown":"click";$container.removeEventListener(eventName1,_setTimeoutShow),$container.removeEventListener("mousemove",_setTimeoutShow),$container.removeEventListener("mouseleave",_hide),_$footer&&_clearTimeout&&(null==_$footer||null==(_$footer_removeEventListener=_$footer.removeEventListener)||_$footer_removeEventListener.call(_$footer,eventName1,_headerFooterMousemove),null==_$footer||null==(_$footer_removeEventListener1=_$footer.removeEventListener)||_$footer_removeEventListener1.call(_$footer,"mousemove",_headerFooterMousemove)),_$header&&_clearTimeout&&(null==_$header||null==(_$header_removeEventListener=_$header.removeEventListener)||_$header_removeEventListener.call(_$header,eventName1,_headerFooterMousemove),null==_$header||null==(_$header_removeEventListener1=_$header.removeEventListener)||_$header_removeEventListener1.call(_$header,"mousemove",_headerFooterMousemove))}_hide&&$container.removeEventListener("mouseleave",_hide),_touchStart=null,_setTimeoutShow=null,_hide=null,_show=null,_headerFooterTouchStart=null,_headerFooterMousemove=null,null==_clearTimeout||_clearTimeout(),_clearTimeout=null,_alwaysDisplay=!1}},clearTimeout:function(){null==_clearTimeout||_clearTimeout(),_alwaysDisplay=!0},setTimeoutShow:function(){null==_setTimeoutShow||_setTimeoutShow(),_alwaysDisplay=!1},hide:_hide}}(theme.$container,1e3*((null==themeData?void 0:themeData.autoFocus)||3),(function(open){theme.emit(EVENTS$1.control.controlsBarOpenChange,open)})),theme._onPauseTimingFunc&&(theme.removeListener("CLEAR_TIMER_HEADER_FOOTER_ANIMATION",theme._onPauseTimingFunc),theme._onPauseTimingFunc=null),theme._onPauseTimingFunc=function(open){var _theme__interactiveResult_clearTimeout,_theme__interactiveResult,_theme__interactiveResult_setTimeoutShow,_theme__interactiveResult1;open?null==(_theme__interactiveResult=theme._interactiveResult)||null==(_theme__interactiveResult_clearTimeout=_theme__interactiveResult.clearTimeout)||_theme__interactiveResult_clearTimeout.call(_theme__interactiveResult):theme._playing&&(null==(_theme__interactiveResult1=theme._interactiveResult)||null==(_theme__interactiveResult_setTimeoutShow=_theme__interactiveResult1.setTimeoutShow)||_theme__interactiveResult_setTimeoutShow.call(_theme__interactiveResult1))},theme.on("CLEAR_TIMER_HEADER_FOOTER_ANIMATION",theme._onPauseTimingFunc),theme._onPauseTimingFunc(!theme._playing)),(null==(_theme_controls=theme.controls)?void 0:_theme_controls.volumeControl)&&(theme.controls.volumeControl.disabled=!0),(null==(_theme_controls1=theme.controls)?void 0:_theme_controls1.globalFullscreenControl)&&!theme.playing&&(theme.controls.globalFullscreenControl.disabled=!0),_$_filterLeftRightControls1=_filterLeftRightControls(filterThemeData.footer.btnList||[]),leftBtns1=_$_filterLeftRightControls1[0],rightBtns1=_$_filterLeftRightControls1[1],_renderControls(theme,theme._footer.$left,leftBtns1,props),_renderControls(theme,theme._footer.$right,rightBtns1,props)),list=[].concat((null==(_filterThemeData_header=filterThemeData.header)?void 0:_filterThemeData_header.btnList)||[],null!=(_filterThemeData_footer_btnList=null==(_filterThemeData_footer=filterThemeData.footer)?void 0:_filterThemeData_footer.btnList)?_filterThemeData_footer_btnList:[]),_needTimeLine=list.some((function(item){return REC_GROUP.includes(item.iconId)})),Utils.isMobile||null===theme.options.timeLineOptions||theme.options.disabledTimeLine||!_needTimeLine||(theme._recFooter=new RecFooter(theme.$container,{hasDatePicker:null!==theme.options.dateOptions}),_renderTimeLine(theme,theme._recFooter.$timeLineContainer,props),theme._footer&&(theme._footer.$container.style.cssText+="bottom: 36px;"),null!==theme.options.dateOptions&&_renderDatePicker(theme,theme._recFooter.$datePickerContainer,props)),Utils.isMobile&&(null==(_theme_options_mobileExtendOptions=theme.options.mobileExtendOptions)||null==(_theme_options_mobileExtendOptions_controls=_theme_options_mobileExtendOptions.controls)?void 0:_theme_options_mobileExtendOptions_controls.length)){if(!(hasPtz=list.some((function(item){return"ptz"===item.iconId})))&&!_needTimeLine)return[2];theme._mobileExtend=new MobileExtend(theme.$container),null!==theme.options.dateOptions&&(null==(_theme_options_mobileExtendOptions1=theme.options.mobileExtendOptions)?void 0:_theme_options_mobileExtendOptions1.controls.includes("date"))&&_needTimeLine&&_renderDatePicker(theme,theme._mobileExtend.$topLeft,props),null!==theme.options.recOptions&&(null==(_theme_options_mobileExtendOptions2=theme.options.mobileExtendOptions)?void 0:_theme_options_mobileExtendOptions2.controls.includes("rec"))&&_needTimeLine&&[].concat((null==(_filterThemeData_header1=filterThemeData.header)?void 0:_filterThemeData_header1.btnList)||[],null!=(_filterThemeData_footer_btnList1=null==(_filterThemeData_footer1=filterThemeData.footer)?void 0:_filterThemeData_footer1.btnList)?_filterThemeData_footer_btnList1:[]).forEach((function(item){var _theme__mobileExtend;REC_GROUP.includes(item.iconId)&&_renderRecType(theme,null==(_theme__mobileExtend=theme._mobileExtend)?void 0:_theme__mobileExtend.$topRight,item.iconId,props)})),null===theme.options.timeLineOptions&&theme.options.disabledTimeLine||!(null==(_theme_options_mobileExtendOptions3=theme.options.mobileExtendOptions)?void 0:_theme_options_mobileExtendOptions3.controls.includes("timeLine"))||!_needTimeLine||_renderTimeLine(theme,theme._mobileExtend.$content,props),Utils.isMobile&&(null==(_theme_options_mobileExtendOptions4=theme.options.mobileExtendOptions)||null==(_theme_options_mobileExtendOptions_controls1=_theme_options_mobileExtendOptions4.controls)?void 0:_theme_options_mobileExtendOptions_controls1.includes("ptz"))&&hasPtz&&theme.controls.ptzControl&&theme.controls.ptzControl.renderMobileExtend(theme._mobileExtend.$content)}return theme.emit(EVENTS$1.control.mountedControls),theme.playing||theme._disabled(!0),function(theme){var _theme_controls,_theme_controls1,_theme_controls2,_theme_controls3,_theme_controls4,_theme_controls5,_theme_controls6,_theme_controls7,_theme_controls8,_theme_controls9,_theme_controls10,_theme_controls11,_theme_controls12,_theme_controls13,_theme_controls14;theme._recFooter&&theme._recFooter.on(EVENTS$1.theme.recFooterDestroy,(function(){theme.emit(EVENTS$1.theme.recFooterDestroy)})),theme._mobileExtend&&theme._mobileExtend.on(EVENTS$1.theme.mobileExtendDestroy,(function(){theme.emit(EVENTS$1.theme.mobileExtendDestroy)})),theme._pauseControl&&theme._pauseControl.on(EVENTS$1.control.play,(function(playing,form){theme.playing||(theme.playing=playing,theme.emit(EVENTS$1.control.play,playing,form))})),(null==(_theme_controls=theme.controls)?void 0:_theme_controls.playControl)&&(theme.controls.playControl.on(EVENTS$1.control.play,(function(playing){theme.playing!==playing&&(theme.playing=playing,theme.emit(EVENTS$1.control.play,playing))})),theme.controls.playControl.on(EVENTS$1.control.playDestroy,(function(){theme.emit(EVENTS$1.control.playDestroy)}))),(null==(_theme_controls1=theme.controls)?void 0:_theme_controls1.volumeControl)&&(theme.controls.volumeControl.on(EVENTS$1.control.volumechange,(function(volume,muted){theme.muted!==muted&&(theme.muted=muted),theme.volume!==volume&&(theme.volume=volume),theme.emit(EVENTS$1.control.volumechange,volume,muted)})),theme.controls.volumeControl.on(EVENTS$1.control.volumePanelOpenChange,(function(open,volume,muted){theme.emit(EVENTS$1.control.volumePanelOpenChange,open,volume,muted)})),theme.controls.volumeControl.on(EVENTS$1.control.volumeDestroy,(function(){theme.emit(EVENTS$1.control.volumeDestroy)}))),(null==(_theme_controls2=theme.controls)?void 0:_theme_controls2.ptzControl)&&(theme.controls.ptzControl.on(EVENTS$1.control.ptzPanelOpenChange,(function(open){Utils.isMobile&&theme.emit("CLEAR_TIMER_HEADER_FOOTER_ANIMATION",open),theme.emit(EVENTS$1.control.ptzPanelOpenChange,open)})),theme.controls.ptzControl.on(EVENTS$1.control.ptzSpeedChange,(function(speed){theme.emit(EVENTS$1.control.ptzSpeedChange,speed),theme.emit(EVENTS$1.ptzSpeedChange,speed)})),theme.controls.ptzControl.on(EVENTS$1.control.ptzError,(function(info){theme.emit(EVENTS$1.control.ptzError,info);var message=theme.i18n.t(info.localeKey);/^\[missing/.test(message)&&(message=info.msg),theme.emit(EVENTS$1.message,message+" ["+info.code+"]","ptzError",2)})),theme.controls.ptzControl.on(EVENTS$1.control.ptzDestroy,(function(){theme.emit(EVENTS$1.control.ptzDestroy)}))),(null==(_theme_controls3=theme.controls)?void 0:_theme_controls3.recordControl)&&(theme.controls.recordControl.on(EVENTS$1.control.recordingChange,(function(recording){theme.recording!==recording&&theme.emit(EVENTS$1.control.recordingChange,recording)})),theme.controls.recordControl.on(EVENTS$1.control.recordDestroy,(function(){theme.emit(EVENTS$1.control.recordDestroy)}))),(null==(_theme_controls4=theme.controls)?void 0:_theme_controls4.talkControl)&&(theme.controls.talkControl.on(EVENTS$1.control.talkingChange,(function(talking){theme.talking!==talking&&theme.emit(EVENTS$1.control.talkingChange,talking)})),theme.controls.talkControl.on(EVENTS$1.control.talkDestroy,(function(){theme.emit(EVENTS$1.control.talkDestroy)}))),(null==(_theme_controls5=theme.controls)?void 0:_theme_controls5.zoomControl)&&(theme.controls.zoomControl.on(EVENTS$1.control.zoomChange,(function(value,_percent,_range){theme.zoom!==value&&(theme.zoom=value,theme.emit(EVENTS$1.control.zoomChange,value))})),theme.controls.zoomControl.on(EVENTS$1.control.zoomPanelOpenChange,(function(open,_zoom){theme.zooming!==open&&(theme.zooming=open,theme.emit(EVENTS$1.control.zoomPanelOpenChange,open))})),theme.controls.zoomControl.on(EVENTS$1.control.zoomDestroy,(function(){theme.zooming&&(theme.zoom=1,theme.zooming=!1),theme.emit(EVENTS$1.control.zoomDestroy)}))),(null==(_theme_controls6=theme.controls)?void 0:_theme_controls6.definitionControl)&&(theme.controls.definitionControl.on(EVENTS$1.control.definitionPanelOpenChange,(function(open,definition,item){theme.emit("CLEAR_TIMER_HEADER_FOOTER_ANIMATION",open,definition),theme.emit(EVENTS$1.control.definitionPanelOpenChange,open,definition,item)})),theme.controls.definitionControl.on(EVENTS$1.control.definitionChange,(function(definition,item){theme.emit(EVENTS$1.control.definitionChange,definition,item)})),theme.controls.definitionControl.on(EVENTS$1.control.definitionDestroy,(function(){theme.emit(EVENTS$1.control.definitionDestroy)}))),(null==(_theme_controls7=theme.controls)?void 0:_theme_controls7.speedControl)&&(theme.controls.speedControl.on(EVENTS$1.control.speedPanelOpenChange,(function(open,speed,item){theme.emit("CLEAR_TIMER_HEADER_FOOTER_ANIMATION",open,speed),theme.emit(EVENTS$1.control.speedPanelOpenChange,open,speed,item)})),theme.controls.speedControl.on(EVENTS$1.control.speedChange,(function(speed,item){theme.emit(EVENTS$1.control.speedChange,speed,item)})),theme.controls.speedControl.on(EVENTS$1.control.speedDestroy,(function(){theme.emit(EVENTS$1.control.speedDestroy)}))),(null==(_theme_controls8=theme.controls)?void 0:_theme_controls8.capturePictureControl)&&(theme.controls.capturePictureControl.on(EVENTS$1.control.capturePicture,(function(options){theme.emit(EVENTS$1.control.capturePicture,options)})),theme.controls.capturePictureControl.on(EVENTS$1.control.capturePictureDestroy,(function(){theme.emit(EVENTS$1.control.capturePictureDestroy)}))),(null==(_theme_controls9=theme.controls)?void 0:_theme_controls9.fullscreenControl)&&theme.controls.fullscreenControl.on(EVENTS$1.control.fullscreenDestroy,(function(){theme.emit(EVENTS$1.control.fullscreenDestroy)})),(null==(_theme_controls10=theme.controls)?void 0:_theme_controls10.globalFullscreenControl)&&theme.controls.globalFullscreenControl.on(EVENTS$1.control.globalFullscreenDestroy,(function(){theme.emit(EVENTS$1.control.globalFullscreenDestroy)})),(null==(_theme_controls11=theme.controls)?void 0:_theme_controls11.deviceControl)&&theme.controls.deviceControl.on(EVENTS$1.control.deviceDestroy,(function(){theme.emit(EVENTS$1.control.deviceDestroy)})),(null==(_theme_controls12=theme.controls)?void 0:_theme_controls12.recControl)&&(theme.controls.recControl.on(EVENTS$1.control.recTypeChange,(function(type){var _theme__headerMoreControl;theme.recType!==type&&(theme.recType=type,theme.emit(EVENTS$1.control.recTypeChange,type),(null==(_theme__headerMoreControl=theme._headerMoreControl)?void 0:_theme__headerMoreControl.picker)&&(theme._headerMoreControl.picker.open=!1))})),theme.controls.recControl.on(EVENTS$1.control.recDestroy,(function(){theme.emit(EVENTS$1.control.recDestroy)}))),(null==(_theme_controls13=theme.controls)?void 0:_theme_controls13.timeLineControl)&&(theme.controls.timeLineControl.on(EVENTS$1.control.timeLineChange,(function(date){theme.emit(EVENTS$1.control.timeLineChange,date)})),theme.controls.timeLineControl.on(EVENTS$1.control.timeLinePanelOpenChange,(function(open){var _theme_controls_dateControl,_theme_controls_dateControl_dataPickerUtil,_theme_controls_dateControl1;(null==(_theme_controls_dateControl=theme.controls.dateControl)?void 0:_theme_controls_dateControl.dataPickerUtil)&&(null==(_theme_controls_dateControl1=theme.controls.dateControl)||null==(_theme_controls_dateControl_dataPickerUtil=_theme_controls_dateControl1.dataPickerUtil)||_theme_controls_dateControl_dataPickerUtil.hide()),theme.emit(EVENTS$1.control.timeLinePanelOpenChange,open)})),theme.controls.timeLineControl.on(EVENTS$1.control.timeLineDestroy,(function(){theme.emit(EVENTS$1.control.timeLineDestroy)}))),(null==(_theme_controls14=theme.controls)?void 0:_theme_controls14.dateControl)&&(theme.controls.dateControl.on(EVENTS$1.control.datePanelOpenChange,(function(open,date){theme.emit(EVENTS$1.control.datePanelOpenChange,open,date)})),theme.controls.dateControl.on(EVENTS$1.control.dateChange,(function(date){theme.emit(EVENTS$1.control.dateChange,date)})),theme.controls.dateControl.on(EVENTS$1.control.dateDestroy,(function(){theme.emit(EVENTS$1.control.recDestroy)}))),theme.contentControl&&theme.contentControl.on(EVENTS$1.control.contentRerender,(function(info){theme.emit(EVENTS$1.control.contentRerender,info)}))}(theme),[2]}}))},function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$1$1(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$1$1(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))})();var fn}var _renderTimeLine=function(theme,container,props){var _theme_urlInfo,_theme_options;(void 0===props&&(props={}),theme.controls.timeLineControl||null===theme.options.timeLineOptions)||(theme.controls.timeLineControl=new Controls.timeLine(_extends$1$1({getPopupContainer:function(){return container},language:theme.options.language,locales:theme.i18n.translations,coverQuery:(null==(_theme_urlInfo=theme.urlInfo)?void 0:_theme_urlInfo.validateCode)?"decodekey="+theme.urlInfo.validateCode:""},(null==(_theme_options=theme.options)?void 0:_theme_options.timeLineOptions)||{},{props:props})))},_renderDatePicker=function(theme,container,props){var _theme_options;(void 0===props&&(props={}),theme.controls.dateControl||null===theme.options.dateOptions)||(theme.controls.dateControl=new Controls.date(_extends$1$1({getPopupContainer:function(){return container},language:theme.options.language,locales:theme.i18n.translations,staticPath:theme.options.staticPath},(null==(_theme_options=theme.options)?void 0:_theme_options.dateOptions)||{},{props:props})))},_renderRecType=function(theme,container,recType,props){var _theme_controls,_theme_controls1,_theme_controls2,_theme_options;(void 0===props&&(props={}),!(null==(_theme_controls=theme.controls)?void 0:_theme_controls.recControl)&&null!==theme.options.recOptions&&container)&&(theme.controls.recControl=new Controls.rec(_extends$1$1({getPopupContainer:function(){return container},recType:theme.recType,language:theme.options.language,locales:theme.i18n.translations},(null==(_theme_options=theme.options)?void 0:_theme_options.recOptions)||{},{props:props})));(null==(_theme_controls1=theme.controls)?void 0:_theme_controls1.recControl)&&(null==(_theme_controls2=theme.controls)?void 0:_theme_controls2.recControl).addRecType(recType)};function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function asyncGeneratorStep$7(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$7(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$7(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$7(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _create_class(Constructor,protoProps,staticProps){return protoProps&&function(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}(Constructor.prototype,protoProps),Constructor}function _extends$r(){return _extends$r=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$r.apply(this,arguments)}function _set_prototype_of(o,p){return _set_prototype_of=Object.setPrototypeOf||function(o,p){return o.__proto__=p,o},_set_prototype_of(o,p)}function _create_for_of_iterator_helper_loose(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(it)return(it=it.call(o)).next.bind(it);if(Array.isArray(o)||(it=function(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(o,minLen):void 0}}(o))||allowArrayLike){it&&(o=it);var i=0;return function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _ts_generator(thisArg,body){var f,y,t,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]},g=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return g.next=verb(0),g.throw=verb(1),g.return=verb(2),"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;g&&(g=0,op[0]&&(_=0)),_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var THEME_DEFAULT_OPTIONS={dblClickFullscreen:!0,language:"zh",autoPlay:!0,scaleMode:THEME_SCALE_MODE_TYPE_full,loggerOptions:{level:"INFO",showTime:!0},env:{domain:"https://open.ys7.com"},mobileExtendOptions:{controls:["ptz","timeLine","rec","date"]}},Theme=function(EventEmitter){function Theme(options){var _this,_this_options_volumeOptions,_this_options_volumeOptions1,_this_options_speedOptions,_this_options,_this_options1,_this_urlInfo_searchParams,_this_urlInfo,_this_urlInfo_searchParams1,_this_urlInfo1,_this_urlInfo_searchParams2,_this_urlInfo2,_this_options_volumeOptions_volume,_ref,_this_options_volumeOptions_muted,_ref1,_this_options_speedOptions_value,_ref2,_this_options_template,_ref3,theme;((_this=EventEmitter.call(this)||this).options=THEME_DEFAULT_OPTIONS,_this.staticPath="",_this.controls={},_this._seekDate=null,_this.recType="",_this._headerMoreControl=null,_this._footerMoreControl=null,_this._header=null,_this._footer=null,_this._recFooter=null,_this._mobileExtend=null,_this._interactiveResult=null,_this._themeData=null,_this._fullscreen=null,_this.zoomUtil=null,_this._cleanupOrientation=null,_this._cleanUpResizeObserver=null,_this._width=0,_this._height=0,_this._isCurrentFullscreen=!1,_this._orientationAngle=0,_this._playing=!1,_this._loading=!1,_this._volume=0,_this._muted=!1,_this._zoom=1,_this._zooming=!1,_this._recording=!1,_this._talking=!1,_this._speed=1,_this._videoLevelAuto=!1,_this.videoLevelList=[],_this.recordList=[],_this._resizeOverflowTimer=null,_this._onPauseTimingFunc=null,_this.destroyed=!1,_this.urlInfo=null,_this.scaleMode=0,_this._initOptions(options),"ezopen"===_this.options.type)&&(_this.urlInfo=parseEzopenUrl(_this.options.url),(null==(_this_urlInfo=_this.urlInfo)||null==(_this_urlInfo_searchParams=_this_urlInfo.searchParams)?void 0:_this_urlInfo_searchParams.spaceId)&&(_this.options.spaceId=_this.urlInfo.searchParams.spaceId),"rec"===_this.urlInfo.type&&(_this._seekDate=(null==(_this_urlInfo1=_this.urlInfo)||null==(_this_urlInfo_searchParams1=_this_urlInfo1.searchParams)?void 0:_this_urlInfo_searchParams1.begin)?DateTime$1.strToDate(null==(_this_urlInfo2=_this.urlInfo)||null==(_this_urlInfo_searchParams2=_this_urlInfo2.searchParams)?void 0:_this_urlInfo_searchParams2.begin):DateTime$1.strToDate(DateTime$1.formate(new Date,"YYYY/MM/DD")+" 00:00:00")));return _this._getRecType(_this.options.url),_bindEventLogger(_this,EVENTS$1),null==options.onInitializing||options.onInitializing.call(options,_this),_this.options.autoPlay&&(_this.playing=!0),_this._initClassName(),_this.contentControl=new Content({getContainer:function(){return _this.$container},scaleMode:_this.scaleMode}),function(theme,container,options){theme.zoomUtil=new Zoom(container,_extends$h({},options||{},{min:1,onChange:function(zoom,reset){var _options_onChange;zoom!==theme._zoom&&(theme.zoom=zoom,null==options||null==(_options_onChange=options.onChange)||_options_onChange.call(options,zoom,reset))},onTranslateChange:function(pos){var _options_onTranslateChange;theme.emit(EVENTS$1.zoomTranslateChange,pos),null==options||null==(_options_onTranslateChange=options.onTranslateChange)||_options_onTranslateChange.call(options,pos)},onTap:null==options?void 0:options.onTap}))}(_this,_this.contentControl.$content,_extends$r({},_this.options.zoomOptions||{},{onTap:function(){var _this__interactiveResult_setTimeoutShow,_this__interactiveResult;null==(_this__interactiveResult=_this._interactiveResult)||null==(_this__interactiveResult_setTimeoutShow=_this__interactiveResult.setTimeoutShow)||_this__interactiveResult_setTimeoutShow.call(_this__interactiveResult)}})),_this._volume=null!=(_ref=null!=(_this_options_volumeOptions_volume=null==(_this_options_volumeOptions=_this.options.volumeOptions)?void 0:_this_options_volumeOptions.volume)?_this_options_volumeOptions_volume:_this.options.volume)?_ref:.8,_this._muted=null!=(_ref1=null!=(_this_options_volumeOptions_muted=null==(_this_options_volumeOptions1=_this.options.volumeOptions)?void 0:_this_options_volumeOptions1.muted)?_this_options_volumeOptions_muted:_this.options.muted)&&_ref1,_this._speed=null!=(_ref2=null!=(_this_options_speedOptions_value=null==(_this_options_speedOptions=_this.options.speedOptions)?void 0:_this_options_speedOptions.value)?_this_options_speedOptions_value:_this.options.value)?_ref2:1,_this._mobileInnerWidthHeight=_this._mobileInnerWidthHeight.bind(_this),_this._throttleMobileInnerWidthHeight=throttle(_this._mobileInnerWidthHeight,20).bind(_this),_this._onDblClickFullscreen=debounce(_this._onDblClickFullscreen,20).bind(_this),_this._headerMoreControlShow=debounce(_this._headerMoreControlShow.bind(_this),200),_this._footerMoreControlShow=debounce(_this._footerMoreControlShow.bind(_this),200),_this.destroyed=!1,_this._renderTheme(["flv","hls","mp4"].includes(options.type)?LiveTemplate:null!=(_ref3=null!=(_this_options_template=null==(_this_options=_this.options)?void 0:_this_options.template)?_this_options_template:null==(_this_options1=_this.options)?void 0:_this_options1.themeData)?_ref3:null),_this._addEventListener(),null==(theme=_this)||theme.on(EVENTS$1.audioCodecUnsupported,(function(){var _theme_controls;(null==(_theme_controls=theme.controls)?void 0:_theme_controls.volumeControl)&&theme.controls.volumeControl.emit(EVENTS$1.audioCodecUnsupported)})),null==theme||theme.on(EVENTS$1.message,(function(message,type,duration){var _theme_messageControl;if(/error$/gi.test(type)&&["ptzError","talkError","themeError","3DZoomError"].includes(type))null==(_theme_messageControl=theme.messageControl)||_theme_messageControl.toastError(message,duration);else if(/error$/gi.test(type)){var _theme_messageControl1;0===(duration||0)&&(theme.playing=!1),null==(_theme_messageControl1=theme.messageControl)||_theme_messageControl1.error(message,duration)}else if("warn"===type){var _theme_messageControl2;null==(_theme_messageControl2=theme.messageControl)||_theme_messageControl2.warn(message,duration)}else if("info"===type){var _theme_messageControl3;null==(_theme_messageControl3=theme.messageControl)||_theme_messageControl3.info(message,duration)}})),null==theme||theme.on(EVENTS$1.audioInfo,(function(info){var _theme_controls;(null==theme||null==(_theme_controls=theme.controls)?void 0:_theme_controls.volumeControl)&&(info.audioFormatName||info.encType)&&(theme.controls.volumeControl.disabled=!1)})),null==theme||theme.on(EVENTS$1.videoInfo,(function(info){var _theme_contentControl_emit,_theme_contentControl;info&&(null==(_theme_contentControl=theme.contentControl)||null==(_theme_contentControl_emit=_theme_contentControl.emit)||_theme_contentControl_emit.call(_theme_contentControl,EVENTS$1.videoInfo,info.width,info.height))})),null==theme||theme.on(EVENTS$1.resize,(function(){var _theme_contentControl_emit,_theme_contentControl;null==(_theme_contentControl=theme.contentControl)||null==(_theme_contentControl_emit=_theme_contentControl.emit)||_theme_contentControl_emit.call(_theme_contentControl,EVENTS$1.resize)})),null==theme||theme.on("getDeviceInfo",(function(info){})),null==theme||theme.on(EVENTS$1.firstFrameDisplay,(function(){theme._disabled(!1)})),null==theme||theme.on(EVENTS$1.play,(function(playing){var _theme_controls,_theme_messageControl;playing&&(null==(_theme_messageControl=theme.messageControl)||_theme_messageControl.hide()),(null==theme||null==(_theme_controls=theme.controls)?void 0:_theme_controls.globalFullscreenControl)&&(theme.controls.globalFullscreenControl.disabled=!playing)})),theme.on(EVENTS$1.talkingChange,(function(talking){var _theme_controls_talkControl,_theme_controls,_theme_controls_talkControl1,_theme_controls1;theme._talking=talking,talking!==(null==(_theme_controls=theme.controls)||null==(_theme_controls_talkControl=_theme_controls.talkControl)?void 0:_theme_controls_talkControl.active)&&(null==(_theme_controls1=theme.controls)||null==(_theme_controls_talkControl1=_theme_controls1.talkControl)||_theme_controls_talkControl1.emit(EVENTS$1.talkingChange,talking))})),theme.on(EVENTS$1.talkVolumeChange,(function(value){var _theme_controls_talkControl_emit,_theme_controls_talkControl,_theme_controls;null==(_theme_controls=theme.controls)||null==(_theme_controls_talkControl=_theme_controls.talkControl)||null==(_theme_controls_talkControl_emit=_theme_controls_talkControl.emit)||_theme_controls_talkControl_emit.call(_theme_controls_talkControl,EVENTS$1.talkVolumeChange,value)})),theme.on(EVENTS$1.recordingChange,(function(recording){var _theme_controls_recordControl,_theme_controls;theme._recording=recording,recording!==(null==(_theme_controls=theme.controls)||null==(_theme_controls_recordControl=_theme_controls.recordControl)?void 0:_theme_controls_recordControl.active)&&(theme.controls.recordControl.active=recording)})),theme.on(EVENTS$1.setVideoLevelList,(function(list){var _theme_controls_definitionControl_emit,_theme_controls_definitionControl,_theme_controls;null==(_theme_controls=theme.controls)||null==(_theme_controls_definitionControl=_theme_controls.definitionControl)||null==(_theme_controls_definitionControl_emit=_theme_controls_definitionControl.emit)||_theme_controls_definitionControl_emit.call(_theme_controls_definitionControl,EVENTS$1.setVideoLevelList,list||[])})),theme.on(EVENTS$1.currentVideoLevel,(function(item,level){var _theme_controls_definitionControl_emit,_theme_controls_definitionControl,_theme_controls;null==(_theme_controls=theme.controls)||null==(_theme_controls_definitionControl=_theme_controls.definitionControl)||null==(_theme_controls_definitionControl_emit=_theme_controls_definitionControl.emit)||_theme_controls_definitionControl_emit.call(_theme_controls_definitionControl,EVENTS$1.currentVideoLevel,item,level)})),theme.on(EVENTS$1.zoomingChange,(function(zooming){var _theme_controls_zoomControl1,_theme_controls1;(null==(_theme_controls1=theme.controls)||null==(_theme_controls_zoomControl1=_theme_controls1.zoomControl)?void 0:_theme_controls_zoomControl1.active)!==zooming&&(theme.controls.zoomControl.active=zooming)})),theme.on(EVENTS$1.zoomChange,(function(zoom){var _theme_controls_zoomControl,_theme_controls;(null==(_theme_controls=theme.controls)||null==(_theme_controls_zoomControl=_theme_controls.zoomControl)?void 0:_theme_controls_zoomControl.value)!==zoom&&(theme.controls.zoomControl.value=zoom)})),theme.on(EVENTS$1.speedChange,(function(speed){var _theme_controls_speedControl_emit,_theme_controls_speedControl,_theme_controls;null==(_theme_controls=theme.controls)||null==(_theme_controls_speedControl=_theme_controls.speedControl)||null==(_theme_controls_speedControl_emit=_theme_controls_speedControl.emit)||_theme_controls_speedControl_emit.call(_theme_controls_speedControl,EVENTS$1.speedChange,speed)})),theme.on(EVENTS$1.setAllDayRecTimes,(function(list){var _theme_controls_timeLineControl_emit,_theme_controls_timeLineControl,_theme_controls;null==(_theme_controls=theme.controls)||null==(_theme_controls_timeLineControl=_theme_controls.timeLineControl)||null==(_theme_controls_timeLineControl_emit=_theme_controls_timeLineControl.emit)||_theme_controls_timeLineControl_emit.call(_theme_controls_timeLineControl,EVENTS$1.setAllDayRecTimes,list.list)})),theme.on(EVENTS$1.getOSDTime,(function(time){var _theme_controls_timeLineControl_emit,_theme_controls_timeLineControl,_theme_controls;null==(_theme_controls=theme.controls)||null==(_theme_controls_timeLineControl=_theme_controls.timeLineControl)||null==(_theme_controls_timeLineControl_emit=_theme_controls_timeLineControl.emit)||_theme_controls_timeLineControl_emit.call(_theme_controls_timeLineControl,EVENTS$1.getOSDTime,time.data)})),null==theme||theme.on(EVENTS$1.fullscreenChange,(function(info){var _theme_zoomUtil_setTransform,_theme_zoomUtil,_theme_zoomUtil_setTransform1,_theme_zoomUtil1;[0,180].includes(theme.orientationAngle)&&info.isMobile&&info.isCurrentFullscreen?null==(_theme_zoomUtil=theme.zoomUtil)||null==(_theme_zoomUtil_setTransform=_theme_zoomUtil.setTransform)||_theme_zoomUtil_setTransform.call(_theme_zoomUtil,!0):null==(_theme_zoomUtil1=theme.zoomUtil)||null==(_theme_zoomUtil_setTransform1=_theme_zoomUtil1.setTransform)||_theme_zoomUtil_setTransform1.call(_theme_zoomUtil1,!1)})),null==theme||theme.on(EVENTS$1.orientationChange,(function(angle){var _theme_zoomUtil_setTransform,_theme_zoomUtil,_theme_zoomUtil_setTransform1,_theme_zoomUtil1;[0,180].includes(angle)&&Utils.isMobile&&theme.isCurrentFullscreen?null==(_theme_zoomUtil=theme.zoomUtil)||null==(_theme_zoomUtil_setTransform=_theme_zoomUtil.setTransform)||_theme_zoomUtil_setTransform.call(_theme_zoomUtil,!0):null==(_theme_zoomUtil1=theme.zoomUtil)||null==(_theme_zoomUtil_setTransform1=_theme_zoomUtil1.setTransform)||_theme_zoomUtil_setTransform1.call(_theme_zoomUtil1,!1)})),_this}!function(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}(Theme,EventEmitter);var _proto=Theme.prototype;return _proto.resize=function(width,height){!function(theme,width,height){var cssText="";/^\d+(\.\d+)?$/.test(width+"")?cssText+="width: "+width+"px;":width&&(cssText+="width: "+width+";"),/^\d+(\.\d+)?$/.test(height+"")?cssText+="height: "+height+"px;":height&&(cssText+="height: "+height+";"),theme.$container&&(theme.$container.style.cssText+=cssText)}(this,width,height)},_proto.fullscreen=function(){return _async_to_generator$7((function(){var _this__fullscreen;return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,null==(_this__fullscreen=this._fullscreen)?void 0:_this__fullscreen.fullscreen()];case 1:return[2,_state.sent()]}}))})).call(this)},_proto.exitFullscreen=function(){return _async_to_generator$7((function(){var _this__fullscreen;return _ts_generator(this,(function(_state){switch(_state.label){case 0:return[4,null==(_this__fullscreen=this._fullscreen)?void 0:_this__fullscreen.exitFullscreen()];case 1:return[2,_state.sent()]}}))})).call(this)},_proto.changeTheme=function(themeData){this._renderTheme(themeData),null==this.emit||this.emit.call(this,EVENTS$1.changeTheme,themeData)},_proto.setPoster=function(poster){var _this_posterControl;null==(_this_posterControl=this.posterControl)||_this_posterControl.setPoster(poster)},_proto.setLoggerOptions=function(options){var _this_logger;void 0===options&&(options={}),null==(_this_logger=this.logger)||_this_logger.setOptions(options),null==this||this.emit(EVENTS$1.setLoggerOptions,options)},_proto.setScaleMode=function(scaleMode){if([0,1,2].includes(+scaleMode)){var _this_contentControl_setScaleMode,_this_contentControl;this.scaleMode=+scaleMode,null==(_this_contentControl=this.contentControl)||null==(_this_contentControl_setScaleMode=_this_contentControl.setScaleMode)||_this_contentControl_setScaleMode.call(_this_contentControl,+scaleMode);for(var _step,classList=this.$container.classList,_iterator=_create_for_of_iterator_helper_loose(classList);!(_step=_iterator()).done;){var item=_step.value;item.startsWith("ezplayer-scale-mode-")&&classList.remove(item)}0===this.scaleMode?this.$container.classList.add("ezplayer-scale-mode-full"):1===this.scaleMode?this.$container.classList.add("ezplayer-scale-mode-auto"):2===this.scaleMode&&this.$container.classList.add("ezplayer-scale-mode-full-auto")}else{var _this_logger;null==(_this_logger=this.logger)||_this_logger.warn("scaleMode must be 0 | 1 | 2")}},_proto.destroy=function(){var _this_contentControl,_this_$container,_this=this;this.$container&&!this.destroyed&&(this.emit(EVENTS$1.theme.beforeDestroy),this._removeEventListener(),_unmountedControls(this),null==(_this_contentControl=this.contentControl)||_this_contentControl.destroy(),this.contentControl=null,this._resizeOverflowTimer&&(clearTimeout(this._resizeOverflowTimer),this._resizeOverflowTimer=null),Array.from((null==(_this_$container=this.$container)?void 0:_this_$container.classList)||[]).forEach((function(className){new RegExp("^ezplayer-","g").test(className)&&_this.$container.classList.remove(className)})),this.$container.classList.remove("ezplayer"),this._themeData=null,this.i18n&&(this.i18n=null),this.recType="",this.emit(EVENTS$1.theme.destroyed),this.removeAllListeners(),this.logger&&(this.logger=null),this.destroyed=!0)},_proto._initOptions=function(options){var _this_options_loggerOptions,_this_options_definitionOptions_list,_this_options_definitionOptions,_this_options_videoLevelList;if(void 0===options&&(options={}),this.options=deepmerge(THEME_DEFAULT_OPTIONS,options,{clone:!1}),"function"==typeof this.options.container?this.$container=this.options.container():this.$container=this.options.container,!this.$container)throw new Error("container option is required!");if(["VIDEO","CANVAS"].includes(this.$container.tagName))throw new Error("container node cannot be video or canvas!");this.staticPath=this.options.staticPath,this.logger=Logger(_extends$r({},this.options.loggerOptions||{},{name:(null==(_this_options_loggerOptions=this.options.loggerOptions)?void 0:_this_options_loggerOptions.name)||this.options.type.toUpperCase()})),this.logger.log(navigator.userAgent||"unknown"),this.logger.log("[Theme Version] ",Theme.THEME_VERSION),"container"in this.options&&delete this.options.container;try{this.logger.log("[options] \n",JSON.stringify(this.options))}catch(error){this.logger.log("[options] \n",this.options)}var _this_options_definitionOptions1,language=this.options.language||"zh",locales=deepmerge({zh:zh,en:en},this.options.locales||{},{clone:!1});(this.i18n=new require$$1(locales,{defaultLocale:language}),(null==(_this_options_definitionOptions=this.options.definitionOptions)||null==(_this_options_definitionOptions_list=_this_options_definitionOptions.list)?void 0:_this_options_definitionOptions_list.length)>0||(null==(_this_options_videoLevelList=this.options.videoLevelList)?void 0:_this_options_videoLevelList.length)>0)&&(this.videoLevelList=(null==(_this_options_definitionOptions1=this.options.definitionOptions)?void 0:_this_options_definitionOptions1.list)||this.options.videoLevelList);this.setScaleMode(this.options.scaleMode)},_proto._initClassName=function(){var _this_options,_this_options1;this.$container.classList.add("ezplayer",Utils.isMobile?"ezplayer-mobile":"ezplayer-pc"),["ezopen","flv","hls","mp4"].includes(this.options.type)&&this.$container.classList.add("ezplayer-"+this.options.type),["en","zh"].includes(this.options.language||"zh")&&this.$container.classList.add("ezplayer-lang-"+(this.options.language||"zh")),"string"==typeof this.options.className&&this.$container.classList.add(this.options.className),this.resize(null==(_this_options=this.options)?void 0:_this_options.width,null==(_this_options1=this.options)?void 0:_this_options1.height)},_proto._renderTheme=function(data){return _async_to_generator$7((function(){return _ts_generator(this,(function(_state){return _renderTheme(this,data),[2]}))})).call(this)},_proto._mobileInnerWidthHeight=function(){if(Utils.isMobile){var _this_$container_style,_this_$container,_this_$container_style1,_this_$container1,height=Math.floor(window.innerHeight),width=Math.floor(window.innerWidth);null==(_this_$container=this.$container)||null==(_this_$container_style=_this_$container.style)||_this_$container_style.setProperty("--ezplayer-mobile-inner-height",height+"px"),null==(_this_$container1=this.$container)||null==(_this_$container_style1=_this_$container1.style)||_this_$container_style1.setProperty("--ezplayer-mobile-inner-width",width+"px")}},_proto._addEventListener=function(){var _this=this;this._fullscreen=new Fullscreen$1(this.$container,{prefix:"ezplayer",onChange:function(info){var _this_controls;(info.isCurrentFullscreen?_this.emit(EVENTS$1.fullscreen):_this._isCurrentFullscreen&&_this.emit(EVENTS$1.exitFullscreen),_this._isCurrentFullscreen=info.isCurrentFullscreen,_this.emit(EVENTS$1.fullscreenChange,_extends$r({},info,{orientationAngle:_this._orientationAngle})),_this._isRotated(),Utils.isMobile&&!_this._isCurrentFullscreen)&&((null==(_this_controls=_this.controls)?void 0:_this_controls.ptzControl)&&_this.controls.ptzControl.reset())}});var rotateOrientation=function(orientation){if(_this.$container){var _this_$container_classList;switch(null==(_this_$container_classList=_this.$container.classList)||_this_$container_classList.remove("ezplayer-angle-0","ezplayer-angle-90","ezplayer-angle-180","ezplayer-angle-270"),orientation.angle){case 0:_this.$container.classList.add("ezplayer-angle-0");break;case 90:_this.$container.classList.add("ezplayer-angle-90");break;case 180:_this.$container.classList.add("ezplayer-angle-180");break;case 270:_this.$container.classList.add("ezplayer-angle-270")}_this.orientationAngle!==orientation.angle&&_this.emit(EVENTS$1.orientationChange,orientation.angle),_this._orientationAngle=orientation.angle,_this._mobileInnerWidthHeight(),_this._isRotated()}},_Utils_orientationEventListener=Utils.orientationEventListener(rotateOrientation),orientation=_Utils_orientationEventListener[0],cleanupOrientation=_Utils_orientationEventListener[1];this._cleanupOrientation=cleanupOrientation,rotateOrientation(orientation),this._mobileInnerWidthHeight(),window.addEventListener("resize",this._throttleMobileInnerWidthHeight),this._cleanUpResizeObserver=Utils.resizeObserver(this.$container,throttle((function(){var _this_$container,_this_controls,width=Math.floor(_this.$container.clientWidth),height=Math.floor(_this.$container.clientHeight);(width>200&&width<=375?(_this.$container.classList.add("ezplayer-medium-width"),_this.$container.classList.remove("ezplayer-mini-width")):(width<=200?_this.$container.classList.add("ezplayer-mini-width"):_this.$container.classList.remove("ezplayer-mini-width"),_this.$container.classList.remove("ezplayer-medium-width")),height>200&&height<=375?(_this.$container.classList.add("ezplayer-medium-height"),_this.$container.classList.remove("ezplayer-mini-height")):(height<=200?_this.$container.classList.add("ezplayer-mini-height"):_this.$container.classList.remove("ezplayer-mini-height"),_this.$container.classList.remove("ezplayer-medium-height")),_this.width!==width||_this.height!==height)&&(_this.emit(Theme.EVENTS.resize,{width:width,height:height,isCurrentFullscreen:_this.isCurrentFullscreen,orientationAngle:_this.orientationAngle}),_this._width=width,_this._height=height,(null==(_this_controls=_this.controls)?void 0:_this_controls.timeLineControl)&&_this.controls.timeLineControl.setWidth(width-20-36),_this._headerMoreControlShow(),_this._footerMoreControlShow());null==(_this_$container=_this.$container)||_this_$container.classList.add("ezplayer-overflow-hidden"),_this._resizeOverflowTimer&&(clearTimeout(_this._resizeOverflowTimer),_this._resizeOverflowTimer=null),_this._resizeOverflowTimer=setTimeout((function(){var _this_$container;_this._resizeOverflowTimer&&(clearTimeout(_this._resizeOverflowTimer),_this._resizeOverflowTimer=null),null==(_this_$container=_this.$container)||_this_$container.classList.remove("ezplayer-overflow-hidden")}),200)}),20)),this.options.dblClickFullscreen&&!Utils.isMobile&&this.$container.addEventListener("dblclick",this._onDblClickFullscreen)},_proto._headerMoreControlShow=function(){var _this=this;if(this._header){var _this__header_$left,_this__header,_this__header_$right,_this__header1,leftWidth=(null==(_this__header=this._header)||null==(_this__header_$left=_this__header.$left)?void 0:_this__header_$left.clientWidth)||0,rightWidth=(null==(_this__header1=this._header)||null==(_this__header_$right=_this__header1.$right)?void 0:_this__header_$right.clientWidth)||0,showHeaderMore=leftWidth+rightWidth+30>this._width;if(showHeaderMore){var _this_controls,_this_controls_recControl,_this_controls1;if(!this._headerMoreControl&&(null==(_this_controls=this.controls)?void 0:_this_controls.recControl))this._headerMoreControl=new More({language:this.options.language,locales:this.i18n.translations,rootContainer:this.$container,getPopupContainer:function(){var _this__header;return null==(_this__header=_this._header)?void 0:_this__header.$right},placement:"br",controls:this.controls,open:!1,offset:[0,8],wrapClassName:"ezplayer-header-more",onOpenChange:function(open){_this.emit(EVENTS$1.control.headerMorePanelOpenChange,open)}}),null==(_this_controls1=this.controls)||null==(_this_controls_recControl=_this_controls1.recControl)||_this_controls_recControl.resetPopupContainer(this._headerMoreControl.$panel);this.emit(Theme.EVENTS.control.headerMoreShowControlsChange,showHeaderMore)}else if(this._width-leftWidth-rightWidth>100){var _this_controls2,_this__header2,_this_controls_recControl1,_this_controls3,_this__headerMoreControl;if(this._headerMoreControl&&(null==(_this_controls2=this.controls)?void 0:_this_controls2.recControl))null==(_this_controls3=this.controls)||null==(_this_controls_recControl1=_this_controls3.recControl)||_this_controls_recControl1.resetPopupContainer(null==(_this__header2=this._header)?void 0:_this__header2.$right),null==(_this__headerMoreControl=this._headerMoreControl)||_this__headerMoreControl.destroy(),this._headerMoreControl=null,this.emit(Theme.EVENTS.control.headerMoreShowControlsChange,!1)}}},_proto._footerMoreControlShow=function(){var _this=this,displayMore=function(){if(_this._footer){var _this__footer_$left,_this__footer_$right,leftWidth=(null==(_this__footer_$left=_this._footer.$left)?void 0:_this__footer_$left.clientWidth)||0,rightWidth=(null==(_this__footer_$right=_this._footer.$right)?void 0:_this__footer_$right.clientWidth)||0;if(leftWidth+rightWidth+26>_this._width){var _this__footer,_this__themeData_footer,_this__themeData,_this__footerMoreControl_list,_this__footerMoreControl,_this__footerMoreControl_list1,_this__footerMoreControl1;!_this._footerMoreControl&&(null==(_this__footer=_this._footer)?void 0:_this__footer.$right)&&(_this._footerMoreControl=new More({language:_this.options.language,locales:_this.i18n.translations,rootContainer:_this.$container,getPopupContainer:function(){var _this__footer;return null==(_this__footer=_this._footer)?void 0:_this__footer.$right},placement:"tr",controls:_this.controls,open:!1,offset:[0,-8],wrapClassName:"ezplayer-footer-more",onOpenChange:function(open){_this.emit(EVENTS$1.control.footerMorePanelOpenChange,open)}}));var list=((null==(_this__themeData=_this._themeData)||null==(_this__themeData_footer=_this__themeData.footer)?void 0:_this__themeData_footer.btnList)||[]).filter((function(item){var _this__footerMoreControl,index=((null==(_this__footerMoreControl=_this._footerMoreControl)?void 0:_this__footerMoreControl.list)||[]).findIndex((function(item1){var _this_controls;return item1.control===(null==(_this_controls=_this.controls)?void 0:_this_controls[item.iconId+"Control"])}));return-1===index}));if(list.length<=0)return;if(0===(null==(_this__footerMoreControl=_this._footerMoreControl)||null==(_this__footerMoreControl_list=_this__footerMoreControl.list)?void 0:_this__footerMoreControl_list.length))for(var _step,_iterator=_create_for_of_iterator_helper_loose([list.pop(),list.pop()]);!(_step=_iterator()).done;){var item=_step.value;if(item){var _this_controls_key_resetPopupContainer,_this_controls_key,_this_controls,_this_controls1,_this__footerMoreControl2,key=item.iconId+"Control";null==(_this_controls=_this.controls)||null==(_this_controls_key=_this_controls[key])||null==(_this_controls_key_resetPopupContainer=_this_controls_key.resetPopupContainer)||_this_controls_key_resetPopupContainer.call(_this_controls_key,_this._footerMoreControl.$panel,"prepend"),null==(_this__footerMoreControl2=_this._footerMoreControl)||_this__footerMoreControl2.add(key,item.part,null==(_this_controls1=_this.controls)?void 0:_this_controls1[key])}}else if(_this._footerMoreControl){var item1=list.pop();if(!item1)return;var _this_controls_key_resetPopupContainer1,_this_controls_key1,_this_controls2,_this_controls3,_this__footerMoreControl3,key1=item1.iconId+"Control";null==(_this_controls2=_this.controls)||null==(_this_controls_key1=_this_controls2[key1])||null==(_this_controls_key_resetPopupContainer1=_this_controls_key1.resetPopupContainer)||_this_controls_key_resetPopupContainer1.call(_this_controls_key1,_this._footerMoreControl.$panel,"prepend"),null==(_this__footerMoreControl3=_this._footerMoreControl)||_this__footerMoreControl3.add(key1,item1.part,null==(_this_controls3=_this.controls)?void 0:_this_controls3[key1])}_this.emit(Theme.EVENTS.control.footerMoreShowControlsChange,!!_this._footerMoreControl,null==(_this__footerMoreControl1=_this._footerMoreControl)||null==(_this__footerMoreControl_list1=_this__footerMoreControl1.list)?void 0:_this__footerMoreControl_list1.map((function(item){return item.key}))),_this._footerMoreControl&&displayMore()}else if(_this._width-leftWidth-rightWidth>110){var _this__footerMoreControl_list2,_this__footerMoreControl4;if(null==(_this__footerMoreControl4=_this._footerMoreControl)||null==(_this__footerMoreControl_list2=_this__footerMoreControl4.list)?void 0:_this__footerMoreControl_list2.length){var _this__footerMoreControl5,_this__footerMoreControl_list3,_this__footerMoreControl6,_this__footerMoreControl_list4,_this__footerMoreControl7,item2=null==(_this__footerMoreControl5=_this._footerMoreControl)?void 0:_this__footerMoreControl5.list.shift();if(item2){var _this__footerMoreControl8,_item_control_resetPopupContainer,_item_control;if("left"===item2.part)null==(_item_control=item2.control)||null==(_item_control_resetPopupContainer=_item_control.resetPopupContainer)||_item_control_resetPopupContainer.call(_item_control,_this._footer.$left,"append");else if("right"===item2.part){var _this__footerMoreControl_list5,_this__footerMoreControl9,_item_control_resetPopupContainer1,_item_control1,_item_control_resetPopupContainer2,_item_control2;if(0===(null==(_this__footerMoreControl9=_this._footerMoreControl)||null==(_this__footerMoreControl_list5=_this__footerMoreControl9.list)?void 0:_this__footerMoreControl_list5.length))null==(_item_control1=item2.control)||null==(_item_control_resetPopupContainer1=_item_control1.resetPopupContainer)||_item_control_resetPopupContainer1.call(_item_control1,_this._footer.$right,"append");else null==(_item_control2=item2.control)||null==(_item_control_resetPopupContainer2=_item_control2.resetPopupContainer)||_item_control_resetPopupContainer2.call(_item_control2,_this._footer.$right,"before",_this._footerMoreControl.$container)}null==(_this__footerMoreControl8=_this._footerMoreControl)||_this__footerMoreControl8.remove(item2.control)}if(1===(null==(_this__footerMoreControl6=_this._footerMoreControl)||null==(_this__footerMoreControl_list3=_this__footerMoreControl6.list)?void 0:_this__footerMoreControl_list3.length)){var _this__footerMoreControl10,_this__footerMoreControl_destroy,_this__footerMoreControl11,item11=null==(_this__footerMoreControl10=_this._footerMoreControl)?void 0:_this__footerMoreControl10.list.shift();if(item11){var _this__footerMoreControl12,_item1_control_resetPopupContainer,_item1_control;if("left"===item11.part)null==(_item1_control=item11.control)||null==(_item1_control_resetPopupContainer=_item1_control.resetPopupContainer)||_item1_control_resetPopupContainer.call(_item1_control,_this._footer.$left,"append");else if("right"===item11.part){var _item1_control_resetPopupContainer1,_item1_control1;null==(_item1_control1=item11.control)||null==(_item1_control_resetPopupContainer1=_item1_control1.resetPopupContainer)||_item1_control_resetPopupContainer1.call(_item1_control1,_this._footer.$right,"append")}null==(_this__footerMoreControl12=_this._footerMoreControl)||_this__footerMoreControl12.remove(item11.control)}null==(_this__footerMoreControl11=_this._footerMoreControl)||null==(_this__footerMoreControl_destroy=_this__footerMoreControl11.destroy)||_this__footerMoreControl_destroy.call(_this__footerMoreControl11),_this._footerMoreControl=null}_this.emit(Theme.EVENTS.control.footerMoreShowControlsChange,!!_this._footerMoreControl,null==(_this__footerMoreControl7=_this._footerMoreControl)||null==(_this__footerMoreControl_list4=_this__footerMoreControl7.list)?void 0:_this__footerMoreControl_list4.map((function(item){return item.key}))),displayMore()}}}};displayMore()},_proto._removeEventListener=function(){var _this__fullscreen,_this__cleanUpResizeObserver_unobserve,_this__cleanUpResizeObserver,_this__fullscreen1;this._isCurrentFullscreen&&(null==(_this__fullscreen1=this._fullscreen)||_this__fullscreen1.exitFullscreen());null==(_this__fullscreen=this._fullscreen)||_this__fullscreen.destroy(),this._fullscreen=null,null==this._cleanupOrientation||this._cleanupOrientation.call(this),this._cleanupOrientation=null,null==(_this__cleanUpResizeObserver=this._cleanUpResizeObserver)||null==(_this__cleanUpResizeObserver_unobserve=_this__cleanUpResizeObserver.unobserve)||_this__cleanUpResizeObserver_unobserve.call(_this__cleanUpResizeObserver),this._cleanUpResizeObserver=null,window.removeEventListener("resize",this._throttleMobileInnerWidthHeight),this._throttleMobileInnerWidthHeight=null,this.options.dblClickFullscreen&&!Utils.isMobile&&this.$container.removeEventListener("dblclick",this._onDblClickFullscreen)},_proto._setVideoLevelList=function(list){this.videoLevelList=list},_proto._disabled=function(disabled){var _this=this;void 0===disabled&&(disabled=!0),PAUSE_DISABLED_BTN.forEach((function(btn){var _this_controls;(null==(_this_controls=_this.controls)?void 0:_this_controls[btn+"Control"])&&(_this.controls[btn+"Control"].disabled=disabled)}))},_proto._onDblClickFullscreen=function(){this.isCurrentFullscreen?this.exitFullscreen():this.fullscreen()},_proto._getRecType=function(url){if("ezopen"===this.options.type&&/^ezopen:\/\//.test(url)){var _urlInfo_searchParams,urlInfo=parseEzopenUrl(url);if("rec"===urlInfo.type)return"cloud"===urlInfo.recType&&"7"===(null==urlInfo||null==(_urlInfo_searchParams=urlInfo.searchParams)?void 0:_urlInfo_searchParams.busType)?(this.recType="cloudRecord","cloudRecord"):"cloud"===urlInfo.recType?(this.recType="cloudRec","cloudRec"):(this.recType="rec","rec")}return this.recType="",""},_proto.resetControl=function(){var _this=this;this.zooming&&1!==this.zoom&&(this.zoom=1),["ptz","talk","record","speed"].forEach((function(key){var _this_controls;(null==(_this_controls=_this.controls)?void 0:_this_controls[key+"Control"])&&_this.controls[key+"Control"].reset()}))},_proto._isRotated=function(){var _this_controls,_this_controls1,_this_controls2,_this_controls3;Utils.isMobile&&(this.isCurrentFullscreen&&[0,180].includes(this._orientationAngle)?((null==(_this_controls=this.controls)?void 0:_this_controls.ptzControl)&&(this.controls.ptzControl.isRotated=!0),(null==(_this_controls1=this.controls)?void 0:_this_controls1.zoomControl)&&(this.controls.zoomControl.isRotated=!0)):((null==(_this_controls2=this.controls)?void 0:_this_controls2.ptzControl)&&(this.controls.ptzControl.isRotated=!1),(null==(_this_controls3=this.controls)?void 0:_this_controls3.zoomControl)&&(this.controls.zoomControl.isRotated=!1)))},_create_class(Theme,[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"playing",get:function(){return this._playing},set:function(playing){var _this_messageControl,_this__interactiveResult_setTimeoutShow,_this__interactiveResult1,_this__interactiveResult_clearTimeout,_this__interactiveResult,_this=this;if(this._playing!==playing){var _this_controls,_this__pauseControl_show,_this__pauseControl,_this_controls1;if(this._playing=playing,playing||(this.loading=!1,["ptz","talk","record"].forEach((function(key){var _this_controls;(null==(_this_controls=_this.controls)?void 0:_this_controls[key+"Control"])&&_this.controls[key+"Control"].reset()})),this._disabled(!0)),this.emit(EVENTS$1.play,playing),null==(_this_controls=this.controls)?void 0:_this_controls.playControl)if(this.controls.playControl.playing!==playing)null==(_this_controls1=this.controls)||_this_controls1.playControl.emit(EVENTS$1.play,playing);null==(_this__pauseControl=this._pauseControl)||null==(_this__pauseControl_show=_this__pauseControl.show)||_this__pauseControl_show.call(_this__pauseControl,playing)}this._playing&&(null==(_this_messageControl=this.messageControl)||_this_messageControl.hide());this._playing?null==(_this__interactiveResult1=this._interactiveResult)||null==(_this__interactiveResult_setTimeoutShow=_this__interactiveResult1.setTimeoutShow)||_this__interactiveResult_setTimeoutShow.call(_this__interactiveResult1):null==(_this__interactiveResult=this._interactiveResult)||null==(_this__interactiveResult_clearTimeout=_this__interactiveResult.clearTimeout)||_this__interactiveResult_clearTimeout.call(_this__interactiveResult)}},{key:"loading",get:function(){return this._loading},set:function(loading){var _this__loadingControl,_this__loadingControl1;(this._loading=loading,loading)?null==(_this__loadingControl=this._loadingControl)||_this__loadingControl.show():null==(_this__loadingControl1=this._loadingControl)||_this__loadingControl1.hide();this._loading!==loading&&this.emit(EVENTS$1.loading,loading)}},{key:"volume",get:function(){return this._volume},set:function(volume){var _this_controls,_this_controls_volumeControl,_this_controls1;volume>=0&&volume<=1&&(this._volume!==volume&&(this._volume=volume,this.emit(EVENTS$1.volumechange,volume,this._muted),(null==(_this_controls=this.controls)?void 0:_this_controls.volumeControl)&&(null==(_this_controls1=this.controls)||null==(_this_controls_volumeControl=_this_controls1.volumeControl)?void 0:_this_controls_volumeControl.volume)!==volume&&this.controls.volumeControl.emit(EVENTS$1.volumechange,volume,this._muted)))}},{key:"muted",get:function(){return this._muted},set:function(muted){var _this_controls,_this_controls_volumeControl,_this_controls1;this._muted!==muted&&(this._muted=muted,this.emit(EVENTS$1.volumechange,this._volume,this._muted),(null==(_this_controls=this.controls)?void 0:_this_controls.volumeControl)&&(null==(_this_controls1=this.controls)||null==(_this_controls_volumeControl=_this_controls1.volumeControl)?void 0:_this_controls_volumeControl.muted)!==muted&&this.controls.volumeControl.emit(EVENTS$1.volumechange,this._volume,muted))}},{key:"zooming",get:function(){return this._zooming},set:function(zooming){var _this_zoomUtil_setUpEventListeners,_this_zoomUtil,_this_zoomUtil_setAllowZoom,_this_zoomUtil1,_this_zoomUtil_reset,_this_zoomUtil2,_this_zoomUtil_removeEventListeners,_this_zoomUtil3,_this_zoomUtil_setAllowZoom1,_this_zoomUtil4;this._zooming!==zooming&&(this._zooming=zooming,this.emit(EVENTS$1.zoomingChange,zooming),this.zoomUtil&&(zooming?(null==(_this_zoomUtil=this.zoomUtil)||null==(_this_zoomUtil_setUpEventListeners=_this_zoomUtil.setUpEventListeners)||_this_zoomUtil_setUpEventListeners.call(_this_zoomUtil),null==(_this_zoomUtil1=this.zoomUtil)||null==(_this_zoomUtil_setAllowZoom=_this_zoomUtil1.setAllowZoom)||_this_zoomUtil_setAllowZoom.call(_this_zoomUtil1,!0)):(null==(_this_zoomUtil2=this.zoomUtil)||null==(_this_zoomUtil_reset=_this_zoomUtil2.reset)||_this_zoomUtil_reset.call(_this_zoomUtil2),null==(_this_zoomUtil3=this.zoomUtil)||null==(_this_zoomUtil_removeEventListeners=_this_zoomUtil3.removeEventListeners)||_this_zoomUtil_removeEventListeners.call(_this_zoomUtil3),null==(_this_zoomUtil4=this.zoomUtil)||null==(_this_zoomUtil_setAllowZoom1=_this_zoomUtil4.setAllowZoom)||_this_zoomUtil_setAllowZoom1.call(_this_zoomUtil4,!1))))}},{key:"zoom",get:function(){return this._zoom},set:function(zoom){var _this_options_zoomOptions,_this_messageControl_info,_this_messageControl,_this_logger,_this_options_zoomOptions_max;if(!this._zooming)return null==(_this_messageControl=this.messageControl)||null==(_this_messageControl_info=_this_messageControl.info)||_this_messageControl_info.call(_this_messageControl,this.i18n.t("ZOOM_NOT_ENABLED")),void(null==(_this_logger=this.logger)||_this_logger.warn(this.i18n.t("ZOOM_NOT_ENABLED")));zoom=+zoom.toFixed(1);var _this_messageControl_info1,_this_messageControl1,_this_logger1,_this_messageControl_info2,_this_messageControl2,_this_logger2,_this_messageControl_info3,_this_messageControl3,_this_zoomUtil_setZoom,_this_zoomUtil,ZOOM_MAX=null!=(_this_options_zoomOptions_max=null==(_this_options_zoomOptions=this.options.zoomOptions)?void 0:_this_options_zoomOptions.max)?_this_options_zoomOptions_max:ZOOM_DEFAULT_OPTIONS.max;if(zoom>ZOOM_MAX)return null==(_this_messageControl1=this.messageControl)||null==(_this_messageControl_info1=_this_messageControl1.info)||_this_messageControl_info1.call(_this_messageControl1,this.i18n.t("ZOOM_LIMIT_MAX",{zoom:ZOOM_MAX})),void(null==(_this_logger1=this.logger)||_this_logger1.warn(this.i18n.t("ZOOM_LIMIT_MAX",{zoom:ZOOM_MAX})));if(zoom<1)return null==(_this_messageControl2=this.messageControl)||null==(_this_messageControl_info2=_this_messageControl2.info)||_this_messageControl_info2.call(_this_messageControl2,this.i18n.t("ZOOM_LIMIT_MIN",{zoom:"1"})),void(null==(_this_logger2=this.logger)||_this_logger2.warn(this.i18n.t("ZOOM_LIMIT_MIN",{zoom:"1"})));if(zoom===ZOOM_MAX)null==(_this_messageControl3=this.messageControl)||null==(_this_messageControl_info3=_this_messageControl3.info)||_this_messageControl_info3.call(_this_messageControl3,this.i18n.t("ZOOM_ADD_MAX",{zoom:ZOOM_MAX}));else if(1===zoom){var _this_messageControl_info4,_this_messageControl4;null==(_this_messageControl4=this.messageControl)||null==(_this_messageControl_info4=_this_messageControl4.info)||_this_messageControl_info4.call(_this_messageControl4,this.i18n.t("ZOOM_SUB_MIN",{zoom:1}))}zoom!==this._zoom&&(this._zoom=zoom,this.emit(EVENTS$1.zoomChange,zoom),null==this||null==(_this_zoomUtil=this.zoomUtil)||null==(_this_zoomUtil_setZoom=_this_zoomUtil.setZoom)||_this_zoomUtil_setZoom.call(_this_zoomUtil,zoom))}},{key:"talking",get:function(){return this._talking}},{key:"speed",get:function(){return this._speed},set:function(speed){(speed=+speed)!==this._speed&&(this._speed=speed,this.emit(EVENTS$1.speedChange,speed))}},{key:"talkGain",get:function(){var _this_controls_talkControl,_this_controls,_this_controls1;return(null==(_this_controls=this.controls)||null==(_this_controls_talkControl=_this_controls.talkControl)?void 0:_this_controls_talkControl.active)?(null==(_this_controls1=this.controls)?void 0:_this_controls1.talkControl).value:null}},{key:"recording",get:function(){return this._recording}},{key:"ptzing",get:function(){var _this_controls_ptzControl,_this_controls;return null==(_this_controls=this.controls)||null==(_this_controls_ptzControl=_this_controls.ptzControl)?void 0:_this_controls_ptzControl.active}},{key:"videoLevelAuto",get:function(){return this._videoLevelAuto}},{key:"isCurrentFullscreen",get:function(){return this._isCurrentFullscreen}},{key:"orientationAngle",get:function(){return this._orientationAngle}},{key:"hasHeaderMoreControl",get:function(){return!!this._headerMoreControl}},{key:"hasFooterMoreControl",get:function(){return!!this._footerMoreControl}}]),Theme}(EventEmitter$1);Theme.TEMPLATES=TEMPLATES,Theme.EVENTS=EVENTS$1,Theme.LOCALES={zh:zh,en:en},Theme.THEME_VERSION="2.0.0-beta.4",Date.prototype.Format=function(fmt){var o={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var k in/(y+)/.test(fmt)&&(fmt=fmt.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),o)new RegExp("("+k+")").test(fmt)&&(fmt=fmt.replace(RegExp.$1,1==RegExp.$1.length?o[k]:("00"+o[k]).substr((""+o[k]).length)));return fmt};const addJs=(filepath,callback,isReadyFun,callbackValue)=>{var headerScript=document.getElementsByTagName("head")[0].getElementsByTagName("script"),isReady=!1;if(isReadyFun)isReady=isReadyFun();else for(var i=0;i<headerScript.length;i++)headerScript[i].getAttribute("src")==filepath&&(isReady=!0,headerScript[i].readyState?headerScript[i].onreadystatechange=function(){"complete"!=headerScript[i].readyState&&"loaded"!=headerScript[i].readyState||(headerScript[i].onreadystatechange=null,callback(callbackValue))}:headerScript[i].onload=()=>{callback(callbackValue)});if(!isReady){try{if(!document.querySelector(`script[src="${filepath}"]`)){var oJs=document.createElement("script");oJs.setAttribute("src",filepath),oJs.setAttribute("crossorigin",!0),oJs.onload=()=>callback(callbackValue),document.getElementsByTagName("head")[0].appendChild(oJs)}}catch(error){}setTimeout((()=>{callback(callbackValue)}),15)}},removeJs=filepath=>{for(var headerScript=document.getElementsByTagName("head")[0].getElementsByTagName("script"),i=0;i<headerScript.length;i++)if(headerScript[i].getAttribute("src")==filepath)return void document.getElementsByTagName("head")[0].removeChild(headerScript[i])},getQueryString=(name,url)=>{var r=new RegExp("(\\?|#|&)"+name+"=(.*?)(#|&|$)"),m=(url||window.location.href).match(r);return decodeURIComponent(m?m[2]:"")},insertAfter=(newElement,targetElement)=>{var parent=targetElement.parentNode;parent.lastChild==targetElement?parent.appendChild(newElement):parent.insertBefore(newElement,targetElement.nextSibling)},matchEzopenUrl=ezopenUrl=>({deviceSerial:ezopenUrl.split("/")[3],channelNo:ezopenUrl.split("/")[4].split(".")[0],validCode:2===ezopenUrl.split("/")[2].split("@").length?ezopenUrl.split("/")[2].split("@")[0]:"",hd:-1!==ezopenUrl.indexOf(".hd"),type:-1!==ezopenUrl.indexOf(".cloud.rec")?"cloud.rec":-1!==ezopenUrl.indexOf(".rec")?"rec":"live"}),isMobile=()=>!!window&&navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|Opera Mini)/i);var zh_CN={391001:"取流地址或端口非法",391004:"连接到流媒体服务失败",395e3:"服务内部异常,请稍后重试",395400:"预览取流参数异常",395402:"设备当前时段无录像,请选择其他时间段",395403:"服务异常,请重试或联系客服",395404:"设备不在线,请优化网络后重启设备再试",395405:"设备侧网络问题,请检查优化网络后重启设备再试",395406:"token过期,请重试",395407:"客户端的URL格式错误",395409:"预览开启隐私保护",395410:"服务异常,请重试或联系客服",395411:"无权查看当前设备",395412:"服务异常,请重试或联系客服",395413:"服务异常,请重试或联系客服",395415:"设备通道错误",395416:"当前观看路数达到设备最大限制,请重启设备或联系设备售后处理",395451:"设备不支持该码流类型,请检查设备通道支持情况或联系硬件售后",395452:"设备侧网络较差,请检查优化网络后重启设备再试",395454:"设备侧网络较差,请检查优化网络后重启设备再试",395455:"设备通道异常,请检查通道配置后重试",395456:"设备通道异常,请检查通道配置后重试",395457:"服务异常,请重试或联系客服",395458:"服务异常,请重试或联系客服",395459:"服务异常,请重试或联系客服",395460:"服务异常,请重试或联系客服",395492:"服务异常,请重试或联系客服",395500:"服务异常,请重试或联系客服",395501:"服务异常,请重试或联系客服",395503:"服务异常,请重试或联系客服",395504:"服务异常,请重试或联系客服",395505:"服务异常,请重试或联系客服",395506:"暂不支持该设备直接取流,请连接NVR后重试或联系客服",395507:"设备4G无限流量套餐仅支持萤石云视频APP使用,请联系APP客服更换套餐",395530:"服务异常,请重试或联系客服",395544:"视频源不存在,请检查设备配置",395545:"服务异常,请重试或联系客服",395546:"同时观看人数达到账号最大限制,请联系客服",395547:"同时观看人数达到账号最大限制,请联系客服",395556:"服务异常,请重试或联系客服",395557:"设备取流失败,请联系硬件售后",395558:"查找录像开始时间错误",395560:"服务异常,请重试或联系客服",395561:"服务异常,请重试或联系客服",395562:"服务异常,请重试或联系客服",395563:"服务异常,请重试或联系客服",395564:"服务异常,请重试或联系客服",395566:"服务异常,请重试或联系客服",395567:"服务异常,请重试或联系客服",395568:"服务异常,请重试或联系客服",395569:"服务异常,请重试或联系客服",395600:"服务异常,请重试或联系客服",395601:"服务异常,请重试或联系客服",395602:"服务异常,请重试或联系客服",395610:"服务异常,请重试或联系客服",395620:"服务异常,请重试或联系客服",395701:"服务异常,请重试或联系客服",395702:"服务异常,请重试或联系客服",395703:"服务异常,请重试或联系客服",396001:"服务异常,请重试或联系客服",396099:"服务异常,请重试或联系客服",396101:"服务异常,请重试或联系客服",396102:"服务异常,请重试或联系客服",396103:"服务异常,请重试或联系客服",396104:"服务异常,请重试或联系客服",396105:"设备异常,请重试或联系客服",396106:"设备通道异常,请检查通道配置后重试",396107:"设备异常,请重试或联系客服",396108:"服务异常,请重试或联系客服",396109:"服务异常,请重试或联系客服",396110:"设备异常,请重试或联系客服",396501:"设备异常,请重试或联系客服",396502:"设备异常,请重试或联系客服",396503:"设备异常,请重试或联系客服",396504:"设备异常,请重试或联系客服",396505:"设备异常,请重试或联系客服",396506:"设备异常,请重试或联系客服",396508:"设备异常,请重试或联系客服",396509:"设备异常,请重试或联系客服",396510:"设备异常,请重试或联系客服",396511:"设备异常,请重试或联系客服",396512:"设备异常,请重试或联系客服",396513:"设备异常,请重试或联系客服",396514:"设备异常,请重试或联系客服",396515:"设备异常,请重试或联系客服",396516:"设备异常,请重试或联系客服",396517:"设备异常,请重试或联系客服",396518:"设备异常,请重试或联系客服",396519:"设备网络异常,请检查优化网络后重启设备再试",396520:"设备网络异常,请检查优化网络后重启设备再试",396700:"服务异常,请重试或联系客服",396701:"回放结束",397001:"服务异常,请重试或联系客服",397002:"服务异常,请重试或联系客服",397003:"服务异常,请重试或联系客服",397004:"服务异常,请重试或联系客服",397005:"设备取流连接断开,请检查网络后重试",397006:"服务异常,请重试或联系客服",397007:"服务异常,请重试或联系客服",399e3:"服务异常,请重试或联系客服",399001:"客户端网络超时",399002:"服务异常,请重试或联系客服",399016:"token失效,请更新并重试",399048:"同时观看人数达到账号最大限制,请联系客服",399049:"免费版并发数达到上限,请升级企业版使用多并发能力",3810001:"操作失败",3810002:"账号异常,操作失败",3810005:"账号异常,操作失败",3820002:"设备不存在,请检查设备连接情况",3820006:"操作失败,请检查设备网络情况",3820007:"操作失败,请检查设备网络情况",3820008:"操作过于频繁,稍后再试",3820014:"操作失败",3820032:"通道不存在请检查设备连接情况",3849999:"操作失败,请重试",386e4:"操作失败,设备不支持该操作",3860001:"操作失败,用户无权限",3860002:"设备已旋转到上限位",3860003:"设备已旋转到下限位",3860004:"设备已旋转到左限位",3860005:"设备已旋转到右限位",3860006:"操作失败,请重试",3860009:"设备正在操作中",3860020:"操作失败",BTN_RETRY:"重试",BTN_RELOAD:"重新加载",LOADING:"加载中,请稍后",TIMEFORMAT_ERROR:"时间格式有误,请确认",USE_MULTITHREADING_WARING:"您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见",OPEN_INSTRUCTIONS:"开启说明",INIT_FINSHED:"初始化播放器完成",INIT_SUCCESS:"初始化播放器成功",GET_PLAYURL_FAILED:"获取播放地址失败",VIDEO_LOADING:"视频加载中",DISCONNECT:"连接断开,请重试",DEVICE_ENCRYPTED:"设备已加密",NO_RECORD:"未找到录像片段",PLAY_FAILED:"播放失败,请检查设备及客户端网络",PLAY_SUCCESS:"播放成功",STOP_SUCCESS:"停止成功",CHANGE_PLAYURL_SUCCESS:"切换播放地址成功",CHANGE_PLAYURL_FAILED:"切换播放地址失败",GET_OSD_TIME:"获取OSD时间",GET_OSD_TIME_FAILED:"获取OSD时间失败",SET_POSTER:"设置播放器封面",RESIZE:"调整播放器尺寸",SPEED:"倍速",SPEED_RATE:"倍",SPEED_CANCEL:"取消",GET_SPEED:"获取当前播放速率",MAX_SPEED_LIMIT:"播放速度最大为4倍速度",MIN_SPEED_LIMIT:"播放速度最小为0.5倍速度",SEEK_CANNOT_CROSS_DAYS:"seek时间不能跨日期",SEEK_TIMEFORMAT_ERROR:"seek时间格式错误",PAUSE:"暂停",PAUSE_FAILED:"暂停失败",RESUME:"恢复播放",RESUME_FAILED:"恢复播放失败",CALL_END:"通话已结束",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"该设备在当天没有云录制的录像",CHANGE_VIDEO_LEVEL:"切换清晰度",CHANGE_VIDEO_LEVEL_FAIL:"切换清晰度失败",GET_VIDEO_LEVEL_LIST:"获取设备支持的清晰度列表",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"请输入正确的清度",VIDEO_LEVEL_NOT_SUPPORT:"当前设备不支持该清晰度",VIDEO_LEVEL_AUTO:"自动",VIDEO_LEVEL_FLUENT:"流畅",VIDEO_LEVEL_STANDARD:"标清",VIDEO_LEVEL_HEIGH:"高清",VIDEO_LEVEL_SUPER:"超清",VIDEO_LEVEL_EXTREME:"极清",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"重置主题",BTN_PLAY:"播放/结束播放",BTN_SOUND:"声音",BTN_RECORDVIDEO:"录屏",BTN_CAPTURE:"截图",BTN_TALK:"对讲",BTN_ZOOM:"电子放大",BTN_3D_ZOOM:"3D定位",BTN_PTZ:"云台控制",BTN_EXPEND:"全局全屏",BTN_WEBEXPEND:"网页全屏",BTN_HD:"画面清晰度",BTN_SPEED:"回放倍速",BTN_CLOUDREC:"云存储回放",BTN_CLOUDRECORD:"云录制",BTN_REC:"本地存储",DEVICE_NAME:"设备名称",DEVICE_ID:"设备序列号",CAPTURE_SUCCESS:"截图成功",CAPTURE_FAILED:"截图失败",START_RECORD_SUCCESS:"开始录制成功",START_RECORD_FAILED:"开始录制失败",STOP_RECORD_SUCCESS:"停止录制成功",STOP_RECORD_FAILED:"停止录制失败",RECORD_TIPS:"今日录像",RECORDS:"个录像",OPEN_SOUND:"开启声音",CLOSE_SOUND:"关闭声音",SOUND_OPENED:"当前已经有画面正在播放声音",ZOOM:"电子放大",START_ZOOM:"开启电子放大",CLOSE_ZOOM:"关闭电子放大",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"已经放大到最大倍数8.0X",ZOOM_SUB_MIN:"已经缩小到最小倍数1.0X",ZOOM_LIMIT_MAX:"超出最大倍率8.0X",ZOOM_LIMIT_MIN:"超出最小倍率1.0X","3D_ZOOM":"3D定位","3D_ZOOM_DISABLE":"未启用3D定位功能","3D_ZOOM_FAILED":"3D定位失败,请重试",START_3D_ZOOM:"开启3D定位",CLOSE_3D_ZOOM:"关闭3D定位",DEVICE_NOT_SUPPORT_3D_ZOOM:"当前设备不支持3D定位功能","3D_ZOOM_ACTIVED":"3D定位已处于开启状态","3D_ZOOM_NOT_ACTIVED":"未启用3D定位功能","3D_ZOOM_CLOSED":"3D定位已处于关闭状态",CHANGE_ZOOM_TYPE:"改变缩放模式",FULLSCREEN:"全局全屏",FULLSCREEN_EXIT:"退出全局全屏",GET_WEB_FULLSCREEN_STATUS:"获取浏览器网页全屏状态",WEB_FULLSCREEN:"开启网页全屏",WEB_FULLSCREEN_EXIT:"退出网页全屏",DESTROY:"销毁",GET_CAPACITY:"获取设备能力级",GET_PTZ_STATUS:"获取当前云台状态",GET_PTZ_STATUS_FAILED:"未加载Theme模块,无法获取云台状态",MOBILE_HIDE_PTZ:"移动端,非全屏状态不展示云台",OPTION_PTZ_FAILED:"未加载Theme模块,无法操作云台",MOBILE_PTZ_TIPS:"请通过操控云台来调整摄像机视角",PTZ_FAST:"快",PTZ_MID:"中",PTZ_SLOW:"慢",PTZ_SPEED:"调整云台转动速度",DEVICE_ZOOM:"控制设备放大/缩小画面",DEVICE_FOCUS:"调整设备焦距",NOT_SUPPORT_DEVICE_ZOOM:"当前设备不支持物理缩放",NOT_SUPPORT_FOCUS:"当前设备不支持变焦",MIRROR:"镜像翻转",MIRROR_TYPE_ERROR:"翻转参数类型错误",CHANGE_FEC_TYPE:"切换鱼眼矫正类型",DEVICE_NOT_SUPPORT:"设备不支持鱼眼模式",TYPE_NOT_SUPPORT:"鱼眼矫正类型暂时不支持",FEC_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正",NO_CANVAS_ID:"鱼眼矫正类型需要分屏,但是没有传正确的分屏的canvas id",SET_FEC_PARAMS:"设置3D矫正视角参数",GET_FEC_PARAMS:"获取3D矫正视角参数",SET_FEC_PARAMS_FAILED:"该矫正类型不能设置3D矫正视角参数",GET_FEC_PARAMS_FAILED:"该矫正类型不能获取3D矫正视角参数",GET_FEC_PARAMS_SUPPORT_VERSION:"当前只有V3软解支持鱼眼矫正获取3D矫正视角参数",SET_WATERMARK:"设置水印",TALK_PERMISSION_DENIED:"对讲失败,请检查麦克风权限",TALK_ERROR:"对讲失败,请检查麦克风或网络",TALK_TALKING:"当前已经有设备正在对讲",videoFormat:"编码格式",frameRate:"帧率",systemFormat:"封装格式",resolution:"分辨率",bitrate:"码率",frameLostRate:"丢帧率",lagRate:"卡顿比"},en_US={391001:"Illegal streaming address or port",391004:"Failed to connect to streaming service",395e3:"Internal service exception, please try again later",395400:"Preview streaming parameter exception",395402:"Device has no recording in the current time period, please select another time period",395403:"Service exception, please try again or contact customer service",395404:"The device is not online, Please optimize the network and restart the device to try again",395405:"Device side network is poor, please check and optimize the network and restart the device to try again",395406:"Token expired, please try again",395407:"Client URL format error",395409:"Service exception, please try again or contact customer service",395410:"Service exception, please try again or contact customer service",395411:"No permission to view the current device",395412:"Service exception, please try again or contact customer service",395413:"Service exception, please try again or contact customer service",395415:"Device channel error",395416:"The current number of viewing channels has reached the maximum limit of the device. Please restart the device or contact the device after-sales service",395451:"The device does not support this bitstream type. Please check the device channel support or contact the hardware after-sales service",395452:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395454:"The network on the device side is poor. Please check and optimize the network and restart the device to try again",395455:"The device channel is abnormal. Please check the channel configuration and try again",395456:"The device channel is abnormal. Please check the channel configuration and try again",395457:"Service exception, please try again or contact customer service",395458:"Service exception, please try again or contact customer service",395459:"Service exception, please try again or contact customer service",395460:"Service exception, please try again or contact customer service",395492:"Service exception, please try again or contact customer service",395500:"Service exception, please try again or contact customer service",395501:"Service exception, please try again or contact customer service",395503:"Service exception, please try again or contact customer service",395504:"Service exception, please try again or contact customer service",395505:"Service exception, please try again or contact customer service",395506:"Direct streaming of this device is not supported at present, please try again or contact customer service after connecting to NVR",395507:"Device 4G unlimited traffic package only supports EZVIZ Cloud Video APP, please contact APP customer service to change the package",395530:"Service exception, please try again or contact customer service",395544:"Video source does not exist, please check device configuration",395545:"Service exception, please try again or contact customer service",395546:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395547:"The number of simultaneous viewers has reached the maximum limit of the account, please contact customer service",395556:"Service exception, please try again or contact customer service",395557:"Device streaming failed, please contact hardware after-sales",395558:"Error in finding the start time of recording",395560:"Service exception, please try again or contact customer service",395561:"Service exception, please try again or contact customer service",395562:"Service exception, please try again or contact customer service",395563:"Service exception, please try again or contact customer service",395564:"Service exception, please try again or contact customer service",395566:"Service exception, please try again or contact customer service",395567:"Service exception, please try again or contact customer service",395568:"Service exception, please try again or contact customer service",395569:"Service exception, please try again or contact customer service",395600:"Service exception, please try again or contact customer service",395601:"Service exception, please try again or contact customer service",395602:"Service exception, please try again or contact customer service",395610:"Service exception, please try again or contact customer service",395620:"Service exception, please try again or contact customer service",395701:"Service exception, please try again or contact customer service",395702:"Service exception, please try again or contact customer service",395703:"Service exception, please try again or contact customer service",396001:"Service exception, please try again or contact customer service",396099:"Service exception, please try again or contact customer service",396101:"Service exception, please try again or contact customer service",396102:"Service exception, please try again or contact customer service",396103:"Service exception, please try again or contact customer service",396104:"Service exception, please try again or contact customer service",396105:"Device abnormality, please try again or contact customer service",396106:"Device channel abnormality, please check the channel configuration and try again",396107:"Device abnormality, please try again or contact customer service",396108:"Service exception, please try again or contact customer service",396109:"Service exception, please try again or contact customer service",396110:"Device abnormality, please try again or contact customer service",396501:"Device abnormality, please try again or contact customer service",396502:"Device abnormality, please try again or contact customer service",396503:"Device abnormality, please try again or contact customer service",396504:"Device abnormality, please try again or contact customer service",396505:"Device abnormality, please try again or contact customer service",396506:"Device abnormality, please try again or contact customer service",396508:"Device abnormality, please try again or contact customer service",396509:"Device abnormality, please try again or contact customer service",396510:"Device abnormality, please try again or contact customer service",396511:"Device abnormality, please try again or contact customer service",396512:"Device abnormality, please try again or contact customer service",396513:"Device abnormality, please try again or contact customer service",396514:"Device abnormality, please try again or contact customer service",396515:"Device abnormality, please try again or contact customer service",396516:"Device abnormality, please try again or contact customer service",396517:"Device abnormality, please try again or contact customer service",396518:"Device abnormality, please try again or contact customer service",396519:"Device network abnormality, please check and optimize the network and restart the device to try again",396520:"Device network abnormality, please check and optimize the network and restart the device to try again",396700:"Service exception, please try again or contact customer service",396701:"Playback ends",397001:"Service exception, please try again or contact customer service",397002:"Service exception, please try again or contact customer service",397003:"Service exception, please try again or contact customer service",397004:"Service exception, please try again or contact customer service",397005:"Device streaming connection is disconnected, please check the network and try again",397006:"Service exception, please try again or contact customer service",397007:"Service exception, please try again or contact customer service",399e3:"Service exception, please try again or contact customer service",399001:"Client network timeout",399002:"Service exception, please try again or contact customer service",399016:"Token invalid, please update and retry",399048:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",399049:"The number of simultaneous viewers has reached the maximum account limit, please contact customer service",3810001:"Operation failed",3810002:"Account exception, operation failed",3810005:"Account exception, operation failed",3820002:"Device does not exist, please check the device connection status",3820006:"Operation failed, please check the network condition of the device",3820007:"Operation failed, please check the network condition of the device",3820008:"The operation is too frequent, please try again later",3820014:"Operation failed",3820032:"The channel does not exist. Please check the device connection status",3849999:"Operation failed, please try again",386e4:"Operation failed, the device does not support this operation",3860001:"Operation failed, user does not have permission",3860002:"The device has been rotated to the upper limit position",3860003:"The device has been rotated to the lower limit position",3860004:"The device has rotated to the left limit position",3860005:"The device has been rotated to the right limit position",3860006:"Operation failed, please try again",3860009:"The device is currently in operation",3860020:"Operation failed",BTN_RETRY:"Retry",BTN_RELOAD:"Reload",LOADING:"Loading, please wait",TIMEFORMAT_ERROR:"The time format is wrong, please confirm",USE_MULTITHREADING_WARING:"Your current browser can enable the multi-threaded feature of Google Labs to get a better playback experience and avoid browser freezes and crashes. For details, see:",OPEN_INSTRUCTIONS:"Enablement instructions",INIT_FINSHED:"Initialize the player completed",INIT_SUCCESS:"Initialize the player successfully",GET_PLAYURL_FAILED:"Failed to obtain the playback address",VIDEO_LOADING:"Video loading",DISCONNECT:"Connection disconnected, please try again",DEVICE_ENCRYPTED:"Device encrypted",NO_RECORD:"No video clips found",PLAY_FAILED:"Play failed, please check the device and client network",PLAY_SUCCESS:"Play successfully",STOP_SUCCESS:"Stop successfully",CHANGE_PLAYURL_SUCCESS:"Switch the playback address successfully",CHANGE_PLAYURL_FAILED:"Switch the playback address failed",GET_OSD_TIME:"Get OSD time",GET_OSD_TIME_FAILED:"Failed to get OSD time",SET_POSTER:"Set the player cover",RESIZE:"Adjust the player size",SPEED:"speeds",SPEED_RATE:"X",SPEED_CANCEL:"Cancel",GET_SPEED:"Get the current playback rate",MAX_SPEED_LIMIT:"The maximum playback speed is 4 times the speed",MIN_SPEED_LIMIT:"The minimum playback speed is 0.5 times the speed",SEEK_CANNOT_CROSS_DAYS:"The seek time cannot cross dates",SEEK_TIMEFORMAT_ERROR:"The seek time format is wrong",PAUSE:"Pause",PAUSE_FAILED:"Pause failed",RESUME:"Resume playback",RESUME_FAILED:"Resume playback failed",CALL_END:"Call ended",USER_DO_NOT_OWN_DEVICE:"loadingSetTextWithBtn",NO_CLOUD_RECORD:"The device has no cloud recorded video on that day",CHANGE_VIDEO_LEVEL:"Switch definition",CHANGE_VIDEO_LEVEL_FAIL:"Switch definition failed",GET_VIDEO_LEVEL_LIST:"Get the definition list supported by the device",PLEASE_INPUT_RIGHT_VIDEO_LEVEL:"Please enter the correct definition",VIDEO_LEVEL_NOT_SUPPORT:"The current device does not support this definition",VIDEO_LEVEL_AUTO:"Auto",VIDEO_LEVEL_FLUENT:"Fluent",VIDEO_LEVEL_STANDARD:"Standard",VIDEO_LEVEL_HEIGH:"heigh",VIDEO_LEVEL_SUPER:"Super",VIDEO_LEVEL_EXTREME:"Extreme",VIDEO_LEVEL_3K:"3K",VIDEO_LEVEL_4k:"4K",RESET_THEME:"Reset theme",BTN_PLAY:"Play/end playback",BTN_SOUND:"Sound",BTN_RECORDVIDEO:"Screen recording",BTN_CAPTURE:"Screenshot",BTN_TALK:"Intercom",BTN_ZOOM:"Electronic zoom",BTN_3D_ZOOM:"3D positioning",BTN_PTZ:"PTZ control",BTN_EXPEND:"Global full screen",BTN_WEBEXPEND:"Web page full screen",BTN_HD:"Image definition",BTN_SPEED:"Playback speed",BTN_CLOUDREC:"Cloud storage playback",BTN_CLOUDRECORD:"Cloud recording",BTN_REC:"Local storage",DEVICE_NAME:"Device name",DEVICE_ID:"Device serial number",CAPTURE_SUCCESS:"Screenshot successful",CAPTURE_FAILED:"Screenshot failed",START_RECORD_SUCCESS:"Start recording successful",START_RECORD_FAILED:"Screenshot failed",STOP_RECORD_SUCCESS:"Stop recording successful",STOP_RECORD_FAILED:"Stop recording failed",RECORD_TIPS:"Today's recording",RECORDS:" in total",OPEN_SOUND:"Turn on sound",CLOSE_SOUND:"Turn off sound",SOUND_OPENED:"There is already a picture playing sound at the moment",ZOOM:"Electronic zoom",START_ZOOM:"Turn on electronic zoom",CLOSE_ZOOM:"Turn off electronic zoom",ZOOM_ADD:"+",ZOOM_SUB:"-",ZOOM_ADD_MAX:"It has been enlarged to a maximum magnification of 8.0X",ZOOM_SUB_MIN:"It has been reduced to the minimum multiple of 1.0X",ZOOM_LIMIT_MAX:"Exceeding maximum magnification of 8.0X",ZOOM_LIMIT_MIN:"Exceeding the minimum magnification of 1.0X","3D_ZOOM":"3D positioning","3D_ZOOM_DISABLE":"3D positioning function not enabled","3D_ZOOM_FAILED":"3D positioning failed, please try again",START_3D_ZOOM:"Turn on 3D positioning",CLOSE_3D_ZOOM:"Turn off 3D positioning",DEVICE_NOT_SUPPORT_3D_ZOOM:"Current device does not support 3D positioning function","3D_ZOOM_ACTIVED":"3D positioning is already enabled","3D_ZOOM_NOT_ACTIVED":"3D positioning function is not enabled","3D_ZOOM_CLOSED":"3D positioning is already disabled",CHANGE_ZOOM_TYPE:"Change zoom mode",FULLSCREEN:"Global full screen",FULLSCREEN_EXIT:"Exit global full screen",GET_WEB_FULLSCREEN_STATUS:"Get browser web page full screen status",WEB_FULLSCREEN:"Turn on web page full screen",WEB_FULLSCREEN_EXIT:"Exit full screen webpage",DESTROY:"Destroy",GET_CAPACITY:"Get device capability level",GET_PTZ_STATUS:"Get current PTZ status",GET_PTZ_STATUS_FAILED:"Theme module is not loaded, PTZ status cannot be obtained",MOBILE_HIDE_PTZ:"Mobile terminal, PTZ is not displayed in non-full screen state",OPTION_PTZ_FAILED:"Theme module is not loaded, PTZ cannot be operated",MOBILE_PTZ_TIPS:"Adjust camera angle by manipulating gimbal",PTZ_FAST:"F",PTZ_MID:"M",PTZ_SLOW:"S",PTZ_SPEED:"Adjust the PTZ rotation speed",DEVICE_ZOOM:"Control the device to zoom in/out of the screen",DEVICE_FOCUS:"Adjusting the device's focal length",NOT_SUPPORT_DEVICE_ZOOM:"Device does not support physical zoom",NOT_SUPPORT_FOCUS:"Device does not support adjusting the focal length",MIRROR:"Mirror flip",MIRROR_TYPE_ERROR:"Flip parameter type error",CHANGE_FEC_TYPE:"Switch fisheye correction type",DEVICE_NOT_SUPPORT:"Device does not support fisheye mode",TYPE_NOT_SUPPORT:"Fisheye correction type is not supported temporarily",FEC_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction",NO_CANVAS_ID:"Fisheye correction type requires split screen, but the correct split screen canvas id is not passed",SET_FEC_PARAMS:"Set 3D correction perspective parameters",GET_FEC_PARAMS:"Get 3D correction perspective parameters",SET_FEC_PARAMS_FAILED:"This correction type cannot set 3D correction perspective parameters",GET_FEC_PARAMS_FAILED:"This correction type cannot get 3D correction perspective parameters",GET_FEC_PARAMS_SUPPORT_VERSION:"Currently only V3 software solution supports fisheye correction Get 3D correction perspective parameters",SET_WATERMARK:"Set watermark",TALK_PERMISSION_DENIED:"Permission denied",TALK_ERROR:"Talk failed, please check microphone or network",TALK_TALKING:"Currently devices that are talking to each other",videoFormat:"Video format",frameRate:"Frame fate",systemFormat:"System format",resolution:"Resolution",bitrate:"Bitrate",frameLostRate:"Frame Lost rate",lagRate:"Lag rate"};
23
23
  /*
24
24
  * TalkControl v0.0.2
25
25
  * talk
26
26
  * Copyright (c) 2025-11-20 Ezviz-OpenBiz
27
27
  * Released under the MIT License.
28
28
  */
29
- class Ar{on(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t))}emit(e,t){e&&this.events[e]&&this.events[e].forEach((e=>e(t)))}off(e,t){e&&t&&this.events[e]&&this.events[e].splice(this.events[e].indexOf(t),1)}once(e,t){const n=this;this.on(e,(function i(){const r=Array.prototype.slice.call(arguments);t.apply(null,r),n.off(e,i)}))}removeAllListener(){this.events={}}constructor(){this.events={}}}!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).adapter=e()}((function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[a]={exports:{}};t[a][0].call(d.exports,(function(e){return r(t[a][1][e]||e)}),d,d.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){var i=(0,e("./adapter_factory.js").adapterFactory)({window:window});window.adapter=i,t.exports=i},{"./adapter_factory.js":2}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.adapterFactory=
29
+ class t{on(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t))}emit(e,t){e&&this.events[e]&&this.events[e].forEach((e=>e(t)))}off(e,t){e&&t&&this.events[e]&&this.events[e].splice(this.events[e].indexOf(t),1)}once(e,t){const r=this;this.on(e,(function n(){const i=Array.prototype.slice.call(arguments);t.apply(null,i),r.off(e,n)}))}removeAllListener(){this.events={}}constructor(){this.events={}}}!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).adapter=e()}((function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var l=r[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){var n=(0,e("./adapter_factory.js").adapterFactory)({window:window});window.adapter=n,t.exports=n},{"./adapter_factory.js":2}],2:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.adapterFactory=
30
30
  /*
31
31
  * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
32
32
  *
@@ -34,4 +34,4 @@ class Ar{on(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t)
34
34
  * that can be found in the LICENSE file in the root of the source
35
35
  * tree.
36
36
  */
37
- function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},n=i.log,c=i.detectBrowser(e),d={browserDetails:c,commonShim:l,extractVersion:i.extractVersion,disableLog:i.disableLog,disableWarnings:i.disableWarnings};switch(c.browser){case"chrome":if(!r||!r.shimPeerConnection||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),d;n("adapter.js shimming chrome."),d.browserShim=r,r.shimGetUserMedia(e),r.shimMediaStream(e),r.shimPeerConnection(e),r.shimOnTrack(e),r.shimAddTrackRemoveTrack(e),r.shimGetSendersWithDtmf(e),r.shimGetStats(e),r.shimSenderReceiverGetStats(e),r.fixNegotiationNeeded(e),l.shimRTCIceCandidate(e),l.shimConnectionState(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e),l.removeAllowExtmapMixed(e);break;case"firefox":if(!a||!a.shimPeerConnection||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),d;n("adapter.js shimming firefox."),d.browserShim=a,a.shimGetUserMedia(e),a.shimPeerConnection(e),a.shimOnTrack(e),a.shimRemoveStream(e),a.shimSenderGetStats(e),a.shimReceiverGetStats(e),a.shimRTCDataChannel(e),a.shimAddTransceiver(e),a.shimCreateOffer(e),a.shimCreateAnswer(e),l.shimRTCIceCandidate(e),l.shimConnectionState(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e);break;case"edge":if(!o||!o.shimPeerConnection||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),d;n("adapter.js shimming edge."),d.browserShim=o,o.shimGetUserMedia(e),o.shimGetDisplayMedia(e),o.shimPeerConnection(e),o.shimReplaceTrack(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e);break;case"safari":if(!s||!t.shimSafari)return n("Safari shim is not included in this adapter release."),d;n("adapter.js shimming safari."),d.browserShim=s,s.shimRTCIceServerUrls(e),s.shimCreateOfferLegacy(e),s.shimCallbacksAPI(e),s.shimLocalStreamsAPI(e),s.shimRemoteStreamsAPI(e),s.shimTrackEventTransceiver(e),s.shimGetUserMedia(e),l.shimRTCIceCandidate(e),l.shimMaxMessageSize(e),l.shimSendThrowTypeError(e),l.removeAllowExtmapMixed(e);break;default:n("Unsupported browser!")}return d};var i=c(e("./utils")),r=c(e("./chrome/chrome_shim")),o=c(e("./edge/edge_shim")),a=c(e("./firefox/firefox_shim")),s=c(e("./safari/safari_shim")),l=c(e("./common_shim"));function c(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i="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},r=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},n.shimOnTrack=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(i){var r;r=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===i.track.id})):{track:i.track};var o=new Event("track");o.track=i.track,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],n.dispatchEvent(o)})),t.stream.getTracks().forEach((function(i){var r;r=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===i.id})):{track:i};var o=new Event("track");o.track=i,o.receiver=r,o.transceiver={receiver:r},o.streams=[t.stream],n.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else a.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))},n.shimGetSendersWithDtmf=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,i){var r=n.apply(this,arguments);return r||(r=t(this,e),this._senders.push(r)),r};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],a.apply(this,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},n.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),i=n[0],r=n[1],o=n[2];if(arguments.length>0&&"function"==typeof i)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof i))return t.apply(this,[]);var a=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},s=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};return arguments.length>=2?t.apply(this,[function(e){r(s(a(e)))},i]):new Promise((function(n,i){t.apply(e,[function(e){n(s(a(e)))},i])})).then(r,o)}}},n.shimSenderReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return a.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var r=e.RTCPeerConnection.prototype.getReceivers;r&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=r.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),a.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return a.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],n=void 0,i=void 0,r=void 0;return this.getSenders().forEach((function(e){e.track===t&&(n?r=!0:n=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(i?r=!0:i=e),e.track===t})),r||n&&i?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():i?i.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return o.apply(this,arguments)}}}},n.shimAddTrackRemoveTrackWithNative=l,n.shimAddTrackRemoveTrack=function(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return l(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var r=new e.MediaStream(t.getTracks());this._streams[t.id]=r,this._reverseStreams[r.id]=t,t=r}i.apply(this,[t])};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var i=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then((function(){i.dispatchEvent(new Event("negotiationneeded"))}));else{var a=new e.MediaStream([t]);this._streams[n.id]=a,this._reverseStreams[a.id]=n,this.addStream(a)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=s({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[function(n){var i=d(e,n);t[0].apply(null,[i])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then((function(t){return d(e,t)}))}));e.RTCPeerConnection.prototype[t]=i[t]}));var o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=(e=this,n=(t=arguments[0]).sdp,Object.keys(e._reverseStreams||[]).forEach((function(t){var i=e._reverseStreams[t],r=e._streams[i.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})),o.apply(this,arguments)):o.apply(this,arguments);var e,t,n};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:d(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var n=void 0;Object.keys(this._streams).forEach((function(i){t._streams[i].getTracks().find((function(t){return e.track===t}))&&(n=t._streams[i])})),n&&(1===n.getTracks().length?this.removeStream(this._reverseStreams[n.id]):n.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var i=e._reverseStreams[t],r=e._streams[i.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}},n.shimPeerConnection=function(e){var t=a.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=s({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]}));var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},n.fixNegotiationNeeded=function(e){a.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils.js"));function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var i=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(i)&&this._shimmedLocalStreams[n.id].push(i):this._shimmedLocalStreams[n.id]=[n,i],i};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var i=this.getSenders();n.apply(this,arguments);var r=this.getSenders().filter((function(e){return-1===i.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(r)};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],i.apply(this,arguments)};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var i=t._shimmedLocalStreams[n].indexOf(e);-1!==i&&t._shimmedLocalStreams[n].splice(i,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),r.apply(this,arguments)}}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&"function"==typeof t&&(e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var i=n.video&&n.video.width,r=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},i&&(n.video.mandatory.maxWidth=i),r&&(n.video.mandatory.maxHeight=r),e.navigator.mediaDevices.getUserMedia(n)}))})}},{}],5:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="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};n.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices){var n=r.detectBrowser(e),a=function(e){if("object"!==(void 0===e?"undefined":i(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"===i(e[n])?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var a={};"number"==typeof r.ideal?(a[o("min",n)]=r.ideal,t.optional.push(a),(a={})[o("max",n)]=r.ideal,t.optional.push(a)):(a[o("",n)]=r.ideal,t.optional.push(a))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach((function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,r){if(n.version>=61)return r(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===i(e.audio)){var s=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=a(e.audio)}if(e&&"object"===i(e.video)){var l=e.video.facingMode;l=l&&("object"===(void 0===l?"undefined":i(l))?l:{ideal:l});var c=n.version<66;if(l&&("user"===l.exact||"environment"===l.exact||"user"===l.ideal||"environment"===l.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||c)){delete e.video.facingMode;var d=void 0;if("environment"===l.exact||"environment"===l.ideal?d=["back","rear"]:"user"!==l.exact&&"user"!==l.ideal||(d=["front"]),d)return t.mediaDevices.enumerateDevices().then((function(t){var n=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return d.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!n&&t.length&&d.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=l.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=a(e.video),o("chrome: "+JSON.stringify(e)),r(e)}))}e.video=a(e.video)}return o("chrome: "+JSON.stringify(e)),r(e)},l=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,n,i){s(e,(function(e){t.webkitGetUserMedia(e,n,(function(e){i&&i(l(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){var c=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return s(e,(function(e){return c(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(l(e))}))}))}}}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils.js")),o=r.log},{"../utils.js":15}],6:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="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};n.shimRTCIceCandidate=function(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),r=o.default.parseCandidate(e.candidate),a=Object.assign(n,r);return a.toJSON=function(){return{candidate:a.candidate,sdpMid:a.sdpMid,sdpMLineIndex:a.sdpMLineIndex,usernameFragment:a.usernameFragment}},a}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,a.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},n.shimMaxMessageSize=function(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e,i;if(this._sctp=null,"chrome"===t.browser&&t.version>=76&&"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0}),function(e){if(!e||!e.sdp)return!1;var t=o.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=o.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){var r,a=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n}(arguments[0]),s=(e=a,i=65536,"firefox"===t.browser&&(i=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),i),l=function(e,n){var i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);var r=o.default.matchPrefix(e.sdp,"a=max-message-size:");return r.length>0?i=parseInt(r[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i}(arguments[0],a);r=0===s&&0===l?Number.POSITIVE_INFINITY:0===s||0===l?Math.max(s,l):Math.min(s,l);var c={};Object.defineProperty(c,"maxMessageSize",{get:function(){return r}}),this._sctp=c}return n.apply(this,arguments)}}},n.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return n(e,this),e},a.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var i=arguments[0],r=i.length||i.size||i.byteLength;if("open"===e.readyState&&t.sctp&&r>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}},n.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}},n.removeAllowExtmapMixed=function(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),n.apply(this,arguments)}}}};var r,o=(r=e("sdp"))&&r.__esModule?r:{default:r},a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("./utils"))},{"./utils":15,sdp:17}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var r=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return r.shimGetDisplayMedia}}),n.shimPeerConnection=function(e){var t=a.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var i=(0,l.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,s.filterIceServers)(e.iceServers,t.version),a.log("ICE servers after filtering:",e.iceServers)),new i(e)},e.RTCPeerConnection.prototype=i.prototype},n.shimReplaceTrack=function(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)};var o,a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils")),s=e("./filtericeservers"),l=(o=e("rtcpeerconnection-shim"))&&o.__esModule?o:{default:o}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.filterIceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&i.deprecated("RTCIceServer.url","RTCIceServer.urls");var r="string"==typeof t;return r&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!n?(n=!0,!0):t&&!n})),delete e.url,e.urls=r?t[0]:t,!!t.length}}))};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15}],9:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=function(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}},{}],10:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetUserMedia=function(e){var t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return n(e).catch((function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}},{}],11:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var i="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},r=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return r.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimOnTrack=function(e){"object"===(void 0===e?"undefined":i(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},n.shimPeerConnection=function(e){var t=a.detectBrowser(e);if("object"===(void 0===e?"undefined":i(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],i=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=i[t]})),t.version<68){var n=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),n=e[0],i=e[1],a=e[2];return o.apply(this,[n||null]).then((function(e){if(t.version<53&&!i)try{e.forEach((function(e){e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(i,a)}}},n.shimSenderGetStats=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},n.shimReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n}),a.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},n.shimRemoveStream=function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;a.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)}))})},n.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},n.shimAddTransceiver=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var i=t.apply(this,arguments);if(n){var r=i.sender,o=r.getParameters();"encodings"in o||(o.encodings=e.sendEncodings,this.setParametersPromises.push(r.setParameters(o).catch((function(){}))))}return i})}},n.shimCreateOffer=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}},n.shimCreateAnswer=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}},{}],13:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="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};n.shimGetUserMedia=function(e){var t=r.detectBrowser(e),n=e&&e.navigator,o=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,i){r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,i)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var a=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":i(e))&&"object"===i(e.audio)&&(e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","mozAutoGainControl"),a(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},o&&o.prototype.getSettings){var l=o.prototype.getSettings;o.prototype.getSettings=function(){var e=l.apply(this,arguments);return a(e,"mozAutoGainControl","autoGainControl"),a(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var c=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":i(e))&&(e=JSON.parse(JSON.stringify(e)),a(e,"autoGainControl","mozAutoGainControl"),a(e,"noiseSuppression","mozNoiseSuppression")),c.apply(this,[e])}}}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"))},{"../utils":15}],14:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="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};n.shimLocalStreamsAPI=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(i){return t.call(n,i,e)})),e.getVideoTracks().forEach((function(i){return t.call(n,i,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){var n=arguments[1];return n&&(this._localStreams?this._localStreams.includes(n)||this._localStreams.push(n):this._localStreams=[n]),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var n=this._localStreams.indexOf(e);if(-1!==n){this._localStreams.splice(n,1);var i=e.getTracks();this.getSenders().forEach((function(e){i.includes(e.track)&&t.removeTrack(e)}))}})}},n.shimRemoteStreamsAPI=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}},n.shimCallbacksAPI=function(e){if("object"===(void 0===e?"undefined":i(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var i=arguments.length>=2?arguments[2]:arguments[0],r=n.apply(this,[i]);return t?(r.then(e,t),Promise.resolve()):r},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};var l=function(e,t,n){var i=o.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i};t.setLocalDescription=l,l=function(e,t,n){var i=a.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.setRemoteDescription=l,l=function(e,t,n){var i=s.apply(this,[e]);return n?(i.then(t,n),Promise.resolve()):i},t.addIceCandidate=l}},n.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var n=t.mediaDevices,i=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=function(e){return i(o(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,i){t.mediaDevices.getUserMedia(e).then(n,i)}.bind(t))},n.shimConstraints=o,n.shimRTCIceServerUrls=function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var i=[],o=0;o<e.iceServers.length;o++){var a=e.iceServers[o];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,i.push(a)):i.push(e.iceServers[o])}e.iceServers=i}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},n.shimTrackEventTransceiver=function(e){"object"===(void 0===e?"undefined":i(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},n.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var n=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveAudio||n||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var i=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":"recvonly"===i.direction&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):!0!==e.offerToReceiveVideo||i||this.addTransceiver("video")}return t.apply(this,arguments)}};var r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(e("../utils"));function o(e){return e&&void 0!==e.video?Object.assign({},e,{video:r.compactObject(e.video)}):e}},{"../utils":15}],15:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var i="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};n.extractVersion=o,n.wrapPeerConnectionEvent=function(e,t,n){if(e.RTCPeerConnection){var i=e.RTCPeerConnection.prototype,r=i.addEventListener;i.addEventListener=function(e,i){if(e!==t)return r.apply(this,arguments);var o=function(e){var t=n(e);t&&i(t)};return this._eventMap=this._eventMap||{},this._eventMap[i]=o,r.apply(this,[e,o])};var o=i.removeEventListener;i.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var i=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,i])},Object.defineProperty(i,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},n.disableLog=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":i(e))+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},n.disableWarnings=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":i(e))+". Please use a boolean."):"adapter.js deprecation warnings "+(e?"disabled":"enabled")},n.log=function(){if("object"===("undefined"==typeof window?"undefined":i(window))){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},n.deprecated=function(e,t){},n.detectBrowser=function(e){var t=e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=o(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)n.browser="chrome",n.version=o(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=o(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=o(t.userAgent,/AppleWebKit\/(\d+)\./,1),n.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return n},n.compactObject=function e(t){return a(t)?Object.keys(t).reduce((function(n,i){var r=a(t[i]),o=r?e(t[i]):t[i],s=r&&!Object.keys(o).length;return void 0===o||s?n:Object.assign(n,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},i,o))}),{}):t},n.walkStats=s,n.filterStats=function(e,t,n){var i=n?"outbound-rtp":"inbound-rtp",r=new Map;if(null===t)return r;var o=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((function(t){e.forEach((function(n){n.type===i&&n.trackId===t.id&&s(e,n,r)}))})),r};var r=!0;function o(e,t,n){var i=e.match(t);return i&&i.length>=n&&parseInt(i[n],10)}function a(e){return"[object Object]"===Object.prototype.toString.call(e)}function s(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((function(i){i.endsWith("Id")?s(e,e.get(t[i]),n):i.endsWith("Ids")&&t[i].forEach((function(t){s(e,e.get(t),n)}))})))}},{}],16:[function(e,t,n){var i=e("sdp");function r(e,t,n,r,o){var a=i.writeRtpDescription(e.kind,t);if(a+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var l="msid:"+(r?r.id:"-")+" "+s+"\r\n";a+="a="+l,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+l,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+l,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),a}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},i=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},r=function(e,t,n,r){var o=i(e.parameters.apt,n),a=i(t.parameters.apt,r);return o&&a&&o.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(i){for(var o=0;o<t.codecs.length;o++){var a=t.codecs[o];if(i.name.toLowerCase()===a.name.toLowerCase()&&i.clockRate===a.clockRate){if("rtx"===i.name.toLowerCase()&&i.parameters&&a.parameters.apt&&!r(i,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(i.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<i.rtcpFeedback.length;t++)if(i.rtcpFeedback[t].type===e.type&&i.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var i=0;i<t.headerExtensions.length;i++){var r=t.headerExtensions[i];if(e.uri===r.uri){n.headerExtensions.push(r);break}}})),n}function a(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function s(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function l(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}t.exports=function(e,t){function n(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function c(t,n,i,r){var o=new Event("track");o.track=n,o.receiver=i,o.transceiver={receiver:i},o.streams=r,e.setTimeout((function(){t._dispatchEvent("track",o)}))}var d=function(n){var r=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){r[e]=o[e].bind(o)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",n=JSON.parse(JSON.stringify(n||{})),this.usingBundle="max-bundle"===n.bundlePolicy,"negotiate"===n.rtcpMuxPolicy)throw l("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(n.rtcpMuxPolicy||(n.rtcpMuxPolicy="require"),n.iceTransportPolicy){case"all":case"relay":break;default:n.iceTransportPolicy="all"}switch(n.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:n.bundlePolicy="balanced"}if(n.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var i=e.urls||e.url;e.url&&e.urls;var r="string"==typeof i;return r&&(i=[i]),i=i.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||n?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)})),delete e.url,e.urls=r?i[0]:i,!!i.length}}))}(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var a=n.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy}));else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=i.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},d.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,i={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)i.iceTransport=this.transceivers[0].iceTransport,i.dtlsTransport=this.transceivers[0].dtlsTransport;else{var r=this._createIceAndDtlsTransports();i.iceTransport=r.iceTransport,i.dtlsTransport=r.dtlsTransport}return t||this.transceivers.push(i),i},d.prototype.addTrack=function(t,n){if(this._isClosed)throw l("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var i;if(this.transceivers.find((function(e){return e.track===t})))throw l("InvalidAccessError","Track already exists.");for(var r=0;r<this.transceivers.length;r++)this.transceivers[r].track||this.transceivers[r].kind!==t.kind||(i=this.transceivers[r]);return i||(i=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),i.track=t,i.stream=n,i.rtpSender=new e.RTCRtpSender(t,i.dtlsTransport),i.rtpSender},d.prototype.addStream=function(e){var n=this;if(t>=15025)e.getTracks().forEach((function(t){n.addTrack(t,e)}));else{var i=e.clone();e.getTracks().forEach((function(e,t){var n=i.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),i.getTracks().forEach((function(e){n.addTrack(e,i)}))}},d.prototype.removeTrack=function(t){if(this._isClosed)throw l("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw l("InvalidAccessError","Sender was not created by this connection.");var i=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(i)&&this.localStreams.indexOf(i)>-1&&this.localStreams.splice(this.localStreams.indexOf(i),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},d.prototype._createIceGatherer=function(t,n){var i=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var r=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(r,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;r.state=n?"completed":"gathering",null!==i.transceivers[t].bufferedCandidateEvents&&i.transceivers[t].bufferedCandidateEvents.push(e)},r.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),r},d.prototype._gather=function(t,n){var r=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var a=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(r.usingBundle&&n>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:n};var s=e.candidate,l=!s||0===Object.keys(s).length;if(l)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),s.component=1,s.ufrag=o.getLocalParameters().usernameFragment;var c=i.writeCandidate(s);a.candidate=Object.assign(a.candidate,i.parseCandidate(c)),a.candidate.candidate=c,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var d=i.getMediaSections(r._localDescription.sdp);d[a.candidate.sdpMLineIndex]+=l?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",r._localDescription.sdp=i.getDescription(r._localDescription.sdp)+d.join("");var u=r.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==r.iceGatheringState&&(r.iceGatheringState="gathering",r._emitGatheringStateChange()),l||r._dispatchEvent("icecandidate",a),u&&(r._dispatchEvent("icecandidate",new Event("icecandidate")),r.iceGatheringState="complete",r._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var i=new e.RTCDtlsTransport(n);return i.ondtlsstatechange=function(){t._updateConnectionState()},i.onerror=function(){Object.defineProperty(i,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:i}},d.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var i=this.transceivers[e].dtlsTransport;i&&(delete i.ondtlsstatechange,delete i.onerror,delete this.transceivers[e].dtlsTransport)},d.prototype._transceive=function(e,n,r){var a=o(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:i.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),r&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},d.prototype.setLocalDescription=function(e){var t,n,r=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(l("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,r.signalingState)||r._isClosed)return Promise.reject(l("InvalidStateError","Can not set local "+e.type+" in state "+r.signalingState));if("offer"===e.type)t=i.splitSections(e.sdp),n=t.shift(),t.forEach((function(e,t){var n=i.parseRtpParameters(e);r.transceivers[t].localCapabilities=n})),r.transceivers.forEach((function(e,t){r._gather(e.mid,t)}));else if("answer"===e.type){t=i.splitSections(r._remoteDescription.sdp),n=t.shift();var s=i.matchPrefix(n,"a=ice-lite").length>0;t.forEach((function(e,t){var a=r.transceivers[t],l=a.iceGatherer,c=a.iceTransport,d=a.dtlsTransport,u=a.localCapabilities,p=a.remoteCapabilities;if(!(i.isRejected(e)&&0===i.matchPrefix(e,"a=bundle-only").length||a.rejected)){var h=i.getIceParameters(e,n),m=i.getDtlsParameters(e,n);s&&(m.role="server"),r.usingBundle&&0!==t||(r._gather(a.mid,t),"new"===c.state&&c.start(l,h,s?"controlling":"controlled"),"new"===d.state&&d.start(m));var A=o(u,p);r._transceive(a,A.codecs.length>0,!1)}}))}return r._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?r._updateSignalingState("have-local-offer"):r._updateSignalingState("stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(r){var d=this;if(-1===["offer","answer"].indexOf(r.type))return Promise.reject(l("TypeError",'Unsupported type "'+r.type+'"'));if(!a("setRemoteDescription",r.type,d.signalingState)||d._isClosed)return Promise.reject(l("InvalidStateError","Can not set remote "+r.type+" in state "+d.signalingState));var u={};d.remoteStreams.forEach((function(e){u[e.id]=e}));var p=[],h=i.splitSections(r.sdp),m=h.shift(),A=i.matchPrefix(m,"a=ice-lite").length>0,f=i.matchPrefix(m,"a=group:BUNDLE ").length>0;d.usingBundle=f;var v=i.matchPrefix(m,"a=ice-options:")[0];return d.canTrickleIceCandidates=!!v&&v.substr(14).split(" ").indexOf("trickle")>=0,h.forEach((function(a,l){var c=i.splitLines(a),h=i.getKind(a),v=i.isRejected(a)&&0===i.matchPrefix(a,"a=bundle-only").length,g=c[0].substr(2).split(" ")[2],y=i.getDirection(a,m),T=i.parseMsid(a),_=i.getMid(a)||i.generateIdentifier();if(v||"application"===h&&("DTLS/SCTP"===g||"UDP/DTLS/SCTP"===g))d.transceivers[l]={mid:_,kind:h,protocol:g,rejected:!0};else{var b,C,S,E,w,k,P,D,L;!v&&d.transceivers[l]&&d.transceivers[l].rejected&&(d.transceivers[l]=d._createTransceiver(h,!0));var z,x,O=i.parseRtpParameters(a);v||(z=i.getIceParameters(a,m),(x=i.getDtlsParameters(a,m)).role="client"),P=i.parseRtpEncodingParameters(a);var I=i.parseRtcpParameters(a),R=i.matchPrefix(a,"a=end-of-candidates",m).length>0,M=i.matchPrefix(a,"a=candidate:").map((function(e){return i.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===r.type||"answer"===r.type)&&!v&&f&&l>0&&d.transceivers[l]&&(d._disposeIceAndDtlsTransports(l),d.transceivers[l].iceGatherer=d.transceivers[0].iceGatherer,d.transceivers[l].iceTransport=d.transceivers[0].iceTransport,d.transceivers[l].dtlsTransport=d.transceivers[0].dtlsTransport,d.transceivers[l].rtpSender&&d.transceivers[l].rtpSender.setTransport(d.transceivers[0].dtlsTransport),d.transceivers[l].rtpReceiver&&d.transceivers[l].rtpReceiver.setTransport(d.transceivers[0].dtlsTransport)),"offer"!==r.type||v)"answer"!==r.type||v||(C=(b=d.transceivers[l]).iceGatherer,S=b.iceTransport,E=b.dtlsTransport,w=b.rtpReceiver,k=b.sendEncodingParameters,D=b.localCapabilities,d.transceivers[l].recvEncodingParameters=P,d.transceivers[l].remoteCapabilities=O,d.transceivers[l].rtcpParameters=I,M.length&&"new"===S.state&&(!A&&!R||f&&0!==l?M.forEach((function(e){s(b.iceTransport,e)})):S.setRemoteCandidates(M)),f&&0!==l||("new"===S.state&&S.start(C,z,"controlling"),"new"===E.state&&E.start(x)),!o(b.localCapabilities,b.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&b.sendEncodingParameters[0].rtx&&delete b.sendEncodingParameters[0].rtx,d._transceive(b,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!w||"sendrecv"!==y&&"sendonly"!==y?delete b.rtpReceiver:(L=w.track,T?(u[T.stream]||(u[T.stream]=new e.MediaStream),n(L,u[T.stream]),p.push([L,w,u[T.stream]])):(u.default||(u.default=new e.MediaStream),n(L,u.default),p.push([L,w,u.default]))));else{(b=d.transceivers[l]||d._createTransceiver(h)).mid=_,b.iceGatherer||(b.iceGatherer=d._createIceGatherer(l,f)),M.length&&"new"===b.iceTransport.state&&(!R||f&&0!==l?M.forEach((function(e){s(b.iceTransport,e)})):b.iceTransport.setRemoteCandidates(M)),D=e.RTCRtpReceiver.getCapabilities(h),t<15019&&(D.codecs=D.codecs.filter((function(e){return"rtx"!==e.name}))),k=b.sendEncodingParameters||[{ssrc:1001*(2*l+2)}];var N,$=!1;"sendrecv"===y||"sendonly"===y?($=!b.rtpReceiver,w=b.rtpReceiver||new e.RTCRtpReceiver(b.dtlsTransport,h),$&&(L=w.track,T&&"-"===T.stream||(T?(u[T.stream]||(u[T.stream]=new e.MediaStream,Object.defineProperty(u[T.stream],"id",{get:function(){return T.stream}})),Object.defineProperty(L,"id",{get:function(){return T.track}}),N=u[T.stream]):(u.default||(u.default=new e.MediaStream),N=u.default)),N&&(n(L,N),b.associatedRemoteMediaStreams.push(N)),p.push([L,w,N]))):b.rtpReceiver&&b.rtpReceiver.track&&(b.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===b.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),b.associatedRemoteMediaStreams=[]),b.localCapabilities=D,b.remoteCapabilities=O,b.rtpReceiver=w,b.rtcpParameters=I,b.sendEncodingParameters=k,b.recvEncodingParameters=P,d._transceive(d.transceivers[l],!1,$)}}})),void 0===d._dtlsRole&&(d._dtlsRole="offer"===r.type?"active":"passive"),d._remoteDescription={type:r.type,sdp:r.sdp},"offer"===r.type?d._updateSignalingState("have-remote-offer"):d._updateSignalingState("stable"),Object.keys(u).forEach((function(t){var n=u[t];if(n.getTracks().length){if(-1===d.remoteStreams.indexOf(n)){d.remoteStreams.push(n);var i=new Event("addstream");i.stream=n,e.setTimeout((function(){d._dispatchEvent("addstream",i)}))}p.forEach((function(e){var t=e[0],i=e[1];n.id===e[2].id&&c(d,t,i,[n])}))}})),p.forEach((function(e){e[2]||c(d,e[0],e[1],[])})),e.setTimeout((function(){d&&d.transceivers&&d.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&e.iceTransport.addRemoteCandidate({})}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},d.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},d.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},d.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},d.prototype.createOffer=function(){var n=this;if(n._isClosed)return Promise.reject(l("InvalidStateError","Can not call createOffer after close"));var o=n.transceivers.filter((function(e){return"audio"===e.kind})).length,a=n.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(n.transceivers.forEach((function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));o>0||a>0;)o>0&&(n._createTransceiver("audio"),o--),a>0&&(n._createTransceiver("video"),a--);var c=i.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.transceivers.forEach((function(r,o){var a=r.track,s=r.kind,l=r.mid||i.generateIdentifier();r.mid=l,r.iceGatherer||(r.iceGatherer=n._createIceGatherer(o,n.usingBundle));var c=e.RTCRtpSender.getCapabilities(s);t<15019&&(c.codecs=c.codecs.filter((function(e){return"rtx"!==e.name}))),c.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),r.remoteCapabilities&&r.remoteCapabilities.codecs&&r.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),c.headerExtensions.forEach((function(e){(r.remoteCapabilities&&r.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=r.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];a&&t>=15019&&"video"===s&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),r.wantReceive&&(r.rtpReceiver=new e.RTCRtpReceiver(r.dtlsTransport,s)),r.localCapabilities=c,r.sendEncodingParameters=d})),"max-compat"!==n._config.bundlePolicy&&(c+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),c+="a=ice-options:trickle\r\n",n.transceivers.forEach((function(e,t){c+=r(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),c+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,c+="a="+i.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(c+="a=end-of-candidates\r\n"))}));var d=new e.RTCSessionDescription({type:"offer",sdp:c});return Promise.resolve(d)},d.prototype.createAnswer=function(){var n=this;if(n._isClosed)return Promise.reject(l("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==n.signalingState&&"have-local-pranswer"!==n.signalingState)return Promise.reject(l("InvalidStateError","Can not call createAnswer in signalingState "+n.signalingState));var a=i.writeSessionBoilerplate(n._sdpSessionId,n._sdpSessionVersion++);n.usingBundle&&(a+="a=group:BUNDLE "+n.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=i.getMediaSections(n._remoteDescription.sdp).length;n.transceivers.forEach((function(e,i){if(!(i+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var l;e.stream&&("audio"===e.kind?l=e.stream.getAudioTracks()[0]:"video"===e.kind&&(l=e.stream.getVideoTracks()[0]),l&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var c=o(e.localCapabilities,e.remoteCapabilities);!c.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=r(e,c,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var c=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(c)},d.prototype.addIceCandidate=function(e){var t,n=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(r,o){if(!n._remoteDescription)return o(l("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var c=0;c<n.transceivers.length;c++)if(n.transceivers[c].mid===e.sdpMid){a=c;break}var d=n.transceivers[a];if(!d)return o(l("OperationError","Can not add ICE candidate"));if(d.rejected)return r();var u=Object.keys(e.candidate).length>0?i.parseCandidate(e.candidate):{};if("tcp"===u.protocol&&(0===u.port||9===u.port))return r();if(u.component&&1!==u.component)return r();if((0===a||a>0&&d.iceTransport!==n.transceivers[0].iceTransport)&&!s(d.iceTransport,u))return o(l("OperationError","Can not add ICE candidate"));var p=e.candidate.trim();0===p.indexOf("a=")&&(p=p.substr(2)),(t=i.getMediaSections(n._remoteDescription.sdp))[a]+="a="+(u.type?p:"end-of-candidates")+"\r\n",n._remoteDescription.sdp=i.getDescription(n._remoteDescription.sdp)+t.join("")}else for(var h=0;h<n.transceivers.length&&(n.transceivers[h].rejected||(n.transceivers[h].iceTransport.addRemoteCandidate({}),(t=i.getMediaSections(n._remoteDescription.sdp))[h]+="a=end-of-candidates\r\n",n._remoteDescription.sdp=i.getDescription(n._remoteDescription.sdp)+t.join(""),!n.usingBundle));h++);r()}))},d.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var n=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?n=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(n=e.rtpReceiver)})),!n)throw l("InvalidAccessError","Invalid selector.");return n.getStats()}var i=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&i.push(e[t].getStats())}))})),Promise.all(i).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var i=n.prototype.getStats;n.prototype.getStats=function(){return i.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var i;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(i=e[n]).type]||i.type,t.set(n,e[n])})),t}))}}}));var u=["createOffer","createAnswer"];return u.forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(u=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=d.prototype[e];d.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),d}},{sdp:17}],17:[function(e,t,n){var i={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};i.localCName=i.generateIdentifier(),i.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},i.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},i.getDescription=function(e){var t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){var t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},i.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},i=8;i<t.length;i+=2)switch(t[i]){case"raddr":n.relatedAddress=t[i+1];break;case"rport":n.relatedPort=parseInt(t[i+1],10);break;case"tcptype":n.tcpType=t[i+1];break;case"ufrag":n.ufrag=t[i+1],n.usernameFragment=t[i+1];break;default:n[t[i]]=t[i+1]}return n},i.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},i.parseIceOptions=function(e){return e.substr(14).split(" ")},i.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},i.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},i.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},i.parseFmtp=function(e){for(var t,n={},i=e.substr(e.indexOf(" ")+1).split(";"),r=0;r<i.length;r++)n[(t=i[r].trim().split("="))[0].trim()]=t[1];return n},i.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var i=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?i.push(t+"="+e.parameters[t]):i.push(t)})),t+="a=fmtp:"+n+" "+i.join(";")+"\r\n"}return t},i.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},i.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},i.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},i=e.indexOf(":",t);return i>-1?(n.attribute=e.substr(t+1,i-t-1),n.value=e.substr(i+1)):n.attribute=e.substr(t+1),n},i.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},i.getMid=function(e){var t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},i.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},i.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:i.matchPrefix(e+t,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},i.getIceParameters=function(e,t){var n=i.splitLines(e);return{usernameFragment:(n=n.concat(i.splitLines(t))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:n.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},i.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},i.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],a=i.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){var s=i.parseRtpMap(a),l=i.matchPrefix(e,"a=fmtp:"+o+" ");switch(s.parameters=l.length?i.parseFmtp(l[0]):{},s.rtcpFeedback=i.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(i.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return i.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(i.parseExtmap(e))})),t},i.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)}));var r=0;return t.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(n+="a=maxptime:"+r+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=i.writeExtmap(e)})),n},i.parseRtpEncodingParameters=function(e){var t,n=[],r=i.parseRtpParameters(e),o=-1!==r.fecMechanisms.indexOf("RED"),a=-1!==r.fecMechanisms.indexOf("ULPFEC"),s=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),l=s.length>0&&s[0].ssrc,c=i.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));c.length>0&&c[0].length>1&&c[0][0]===l&&(t=c[0][1]),r.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var i={ssrc:l,codecPayloadType:parseInt(e.parameters.apt,10)};l&&t&&(i.rtx={ssrc:t}),n.push(i),o&&((i=JSON.parse(JSON.stringify(i))).fec={ssrc:l,mechanism:a?"red+ulpfec":"red"},n.push(i))}})),0===n.length&&l&&n.push({ssrc:l});var d=i.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},i.parseRtcpParameters=function(e){var t={},n=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var r=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=r.length>0,t.compound=0===r.length;var o=i.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},i.parseMsid=function(e){var t,n=i.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var r=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(t=r[0].value.split(" "))[0],track:t[1]}:void 0},i.parseSctpDescription=function(e){var t,n=i.parseMLine(e),r=i.matchPrefix(e,"a=max-message-size:");r.length>0&&(t=parseInt(r[0].substr(19),10)),isNaN(t)&&(t=65536);var o=i.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(i.matchPrefix(e,"a=sctpmap:").length>0){var a=i.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},i.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(e,t,n){var r=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||i.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.writeMediaSection=function(e,t,n,r){var o=i.writeRtpDescription(e.kind,t);if(o+=i.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=i.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+i.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+i.localCName+"\r\n"),o},i.getDirection=function(e,t){for(var n=i.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return t?i.getDirection(t):"sendrecv"},i.getKind=function(e){return i.splitLines(e)[0].split(" ")[0].substr(2)},i.isRejected=function(e){return"0"===e.split(" ",2)[1]},i.parseMLine=function(e){var t=i.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},i.parseOLine=function(e){var t=i.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},i.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=i.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"==typeof t&&(t.exports=i)},{}]},{},[1])(1)}));var fr={1:"客户端排队超时",2:"服务端处理超时",3:"TTS服务与设备端连接失败",4:"TTS服务内部处理异常",5:"TTS接收到的消息类型不正确",6:"客户端需要重定向",7:"客户端的URL格式错误",8:"请求对讲过程中TTS服务端认证token失败",9:"设备加密算法不匹配或者设备操作码错误码",10:"设备正在对讲",11:"服务端与设备连接超时",12:"设备不在线",13:"设备已开启隐私保护",14:"token无权限",15:"session不存在",16:"验证token失败",17:"设备监听超时",18:"设备链路断开",19:"设备处于隐私遮蔽状态",20:"设备当前正在声源定位",21:"token认证失败",22:"ticket未开启",23:"ticket bizcode错误",24:"RPC Auth http不通",25:"RPC Case集群不可用",26:"RPC 流媒体向设备发送或接收信令超时/cas响应超时",27:"RPC请求超时",1003:"设备对讲过程中推流链路异常断开"},vr={};function gr(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}Tr.sessions={},Tr.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){var e=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),t=33;return window.navigator.userAgent.match("Linux")&&(t=35),e>=26&&e<=t||Tr.extension.isInstalled()}return!0};var yr={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var n=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",n(i)}else n(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&window.clearTimeout(t.data.id)}))}};function Tr(e,t){if(void 0===Tr.initDone)return e.error("Library not initialized"),{};if(!Tr.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(Tr.log("Library initialized: "+Tr.initDone),(e=e||{}).success="function"==typeof e.success?e.success:Tr.noop,e.error="function"==typeof e.error?e.error:Tr.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:Tr.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var n=!1,i=null,r={},o=null,a=null,s=0,l=e.server;Tr.isArray(l)?(Tr.log("Multiple servers provided ("+l.length+"), will use the first that works"),l=null,a=e.server,Tr.debug(a)):0===l.indexOf("ws")?(n=!0,Tr.log("Using WebSockets to contact Janus: "+l)):(n=!1,Tr.log("Using REST API to contact Janus: "+l));var c=e.iceServers;null==c&&(c=[{urls:"stun:stun.l.google.com:19302"}]);var d=e.iceTransportPolicy,u=e.bundlePolicy,p=e.ipv6;null==p&&(p=!1);var h=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(h=!0===e.withCredentials);var m=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(m=e.max_poll_events),m<1&&(m=1);var A=null;void 0!==e.token&&null!==e.token&&(A=e.token);var f=null;void 0!==e.apisecret&&null!==e.apisecret&&(f=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var v=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(v=e.keepAlivePeriod),isNaN(v)&&(v=25e3);var g=6e4;function y(e){var t={high:9e5,medium:3e5,low:1e5};return null!=e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(g=e.longPollTimeout),isNaN(g)&&(g=6e4);var T=!1,_=null,b={},C=this,S=0,E={};function w(){if(null!=_)if(Tr.debug("Long poll..."),T){var t=l+"/"+_+"?rid="+(new Date).getTime();null!=m&&(t=t+"&maxev="+m),null!=A&&(t=t+"&token="+encodeURIComponent(A)),null!=f&&(t=t+"&apisecret="+encodeURIComponent(f)),Tr.httpAPICall(t,{verb:"GET",withCredentials:h,success:k,timeout:g,error:function(t,n){if(Tr.error(t+":",n),++S>3)return T=!1,void e.error("Lost connection to the server (is it down?)");w()}})}else Tr.warn("Is the server down? (connected=false)")}function k(e,t){if(S=0,n||null==_||!0===t||w(),n||!Tr.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(l=e.sender))return void Tr.warn("Missing sender...");if(null==(d=b[l]))return void Tr.debug("This handle is not attached to this session");var r=e.candidate;Tr.debug("Got a trickled candidate on session "+_),Tr.debug(r);var o=d.webrtcStuff;o.pc&&o.remoteSdp?(Tr.debug("Adding remote candidate:",r),r&&!0!==r.completed?o.pc.addIceCandidate(r):o.pc.addIceCandidate(Tr.endOfCandidates)):(Tr.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),o.candidates||(o.candidates=[]),o.candidates.push(r),Tr.debug(o.candidates))}else{if("webrtcup"===e.rtcgw)return Tr.debug("Got a webrtcup event on session "+_),Tr.debug(e),null==(l=e.sender)?void Tr.warn("Missing sender..."):null==(d=b[l])?void Tr.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(Tr.debug("Got a hangup event on session "+_),Tr.debug(e),null==(l=e.sender))return void Tr.warn("Missing sender...");if(null==(d=b[l]))return void Tr.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(Tr.debug("Got a detached event on session "+_),Tr.debug(e),null==(l=e.sender))return void Tr.warn("Missing sender...");if(null==(d=b[l]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(Tr.debug("Got a media event on session "+_),Tr.debug(e),null==(l=e.sender))return void Tr.warn("Missing sender...");if(null==(d=b[l]))return void Tr.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(Tr.debug("Got a slowlink event on session "+_),Tr.debug(e),null==(l=e.sender))return void Tr.warn("Missing sender...");if(null==(d=b[l]))return void Tr.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{var a,s;if("error"===e.rtcgw)return Tr.error("Ooops: "+e.error.code+" "+e.error.reason),Tr.debug(e),void(null!=(a=e.transaction)&&(null!=(s=E[a])&&s(e),delete E[a]));if("event"===e.rtcgw){var l;if(Tr.debug("Got a plugin event on session "+_),Tr.debug(e),null==(l=e.sender))return void Tr.warn("Missing sender...");var c=e.plugindata;if(null==c)return void Tr.warn("Missing plugindata...");Tr.debug(" -- Event is coming from "+l+" ("+c.plugin+")");var d,u=c.data;if(Tr.debug(u),null==(d=b[l]))return void Tr.warn("This handle is not attached to this session");var p=e.jsep;null!=p&&(Tr.debug("Handling SDP as well..."),Tr.debug(p));var h=d.onmessage;null!=h?(Tr.debug("Notifying application..."),h(u,p)):Tr.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return Tr.error("Timeout on session "+_),Tr.debug(e),void(n&&i.close(3504,"Gateway timeout"));Tr.warn("Unknown message/event '"+e.rtcgw+"' on session "+_),Tr.debug(e)}}}else Tr.debug("Got a success on session "+_),null!=(a=e.transaction)&&(null!=(s=E[a])&&s(e),delete E[a]);else null!=(a=e.transaction)&&(null!=(s=E[a])&&s(e),delete E[a]);else Tr.vdebug("Got a keepalive on session "+_);else for(var m=0;m<e.length;m++)k(e[m],!0)}function P(){if(null!==l&&n&&T){o=setTimeout(P,v);var e={rtcgw:"keepalive",session_id:_,transaction:Tr.randomString(12)};null!=A&&(e.token=A),null!=f&&(e.apisecret=f),i.send(JSON.stringify(e))}}function D(c){var d=Tr.randomString(12),u={rtcgw:"create",transaction:d,token:t.stream,device:t.deviceSerial,channel:t.channel,authBizType:"TALK"};if(c.reconnect&&(T=!1,u.rtcgw="claim",u.session_id=_,i&&(i.onopen=null,i.onerror=null,i.onclose=null,o&&(clearTimeout(o),o=null))),null!=A&&(u.token=A),null!=f&&(u.apisecret=f),null===l&&Tr.isArray(a)&&(0===(l=a[s]).indexOf("ws")?(n=!0,Tr.log("Server #"+(s+1)+": trying WebSockets to contact Janus ("+l+")")):(n=!1,Tr.log("Server #"+(s+1)+": trying REST API to contact Janus ("+l+")"))),n)for(var p in i=Tr.newWebSocket(l,"rtcgw-protocol"),r={error:function(){if(Tr.error("Error connecting to the Janus WebSockets server... "+l),Tr.isArray(a)&&!c.reconnect)return++s==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(l=null,void setTimeout((function(){D(c)}),200));c.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){E[d]=function(e){if(Tr.debug(e),"success"!==e.rtcgw)return Tr.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);o=setTimeout(P,v),T=!0,_=e.session_id?e.session_id:e.data.id,c.reconnect?Tr.log("Claimed session: "+_):Tr.log("Created session: "+_),Tr.sessions[_]=C,c.success()},i.send(JSON.stringify(u))},message:function(e){k(JSON.parse(e.data))},close:function(){null!==l&&T&&(T=!1,e.error("Lost connection to the server (is it down?)"))}})i.addEventListener(p,r[p]);else Tr.httpAPICall(l,{verb:"POST",withCredentials:h,body:u,success:function(e){if(Tr.debug(e),"success"!==e.rtcgw)return Tr.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);T=!0,_=e.session_id?e.session_id:e.data.id,c.reconnect?Tr.log("Claimed session: "+_):Tr.log("Created session: "+_),Tr.sessions[_]=C,w(),c.success()},error:function(e,t){if(Tr.error(e+":",t),Tr.isArray(a)&&!c.reconnect)return++s==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(l=null,void setTimeout((function(){D(c)}),200));""===t?c.error(e+": Is the server down?"):c.error(e+": "+t)}})}function L(e,t){if((t=t||{}).success="function"==typeof t.success?t.success:Tr.noop,t.error="function"==typeof t.error?t.error:Tr.noop,!T)return Tr.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var r=b[e];if(null==r||null===r.webrtcStuff||void 0===r.webrtcStuff)return Tr.warn("Invalid handle"),void t.error("Invalid handle");var o=t.message,a=t.jsep,s=Tr.randomString(12),c={rtcgw:"message",body:o,transaction:s};if(null!==r.token&&void 0!==r.token&&(c.token=r.token),null!=f&&(c.apisecret=f),null!=a&&(c.jsep=a),Tr.debug("Sending message to plugin (handle="+e+"):"),Tr.debug(c),n)return c.session_id=_,c.handle_id=e,E[s]=function(e){if(Tr.debug("Message sent!"),Tr.debug(e),"success"===e.rtcgw){var n=e.plugindata;if(null==n)return Tr.warn("Request succeeded, but missing plugindata..."),void t.success();Tr.log("Synchronous transaction successful ("+n.plugin+")");var i=n.data;return Tr.debug(i),void t.success(i)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(Tr.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(Tr.error("Unknown error"),t.error("Unknown error"))},void i.send(JSON.stringify(c));Tr.httpAPICall(l+"/"+_+"/"+e,{verb:"POST",withCredentials:h,body:c,success:function(e){if(Tr.debug("Message sent!"),Tr.debug(e),"success"===e.rtcgw){var n=e.plugindata;if(null==n)return Tr.warn("Request succeeded, but missing plugindata..."),void t.success();Tr.log("Synchronous transaction successful ("+n.plugin+")");var i=n.data;return Tr.debug(i),void t.success(i)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(Tr.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(Tr.error("Unknown error"),t.error("Unknown error"))},error:function(e,n){Tr.error(e+":",n),t.error(e+": "+n)}})}function z(e,t){if(T){var r=b[e];if(null!=r&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){var o={rtcgw:"trickle",candidate:t,transaction:Tr.randomString(12)};if(null!==r.token&&void 0!==r.token&&(o.token=r.token),null!=f&&(o.apisecret=f),Tr.vdebug("Sending trickle candidate (handle="+e+"):"),Tr.vdebug(o),n)return o.session_id=_,o.handle_id=e,void i.send(JSON.stringify(o));Tr.httpAPICall(l+"/"+_+"/"+e,{verb:"POST",withCredentials:h,body:o,success:function(e){Tr.vdebug("Candidate sent!"),Tr.vdebug(e),"ack"===e.rtcgw||Tr.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){Tr.error(e+":",t)}})}else Tr.warn("Invalid handle")}else Tr.warn("Is the server down? (connected=false)")}function x(e,t,n,i){var r=b[e];if(null!=r&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){var o=r.webrtcStuff,a=function(e){Tr.log("Received state change on data channel:",e);var t=e.target.label,n=o.dataChannel[t]?o.dataChannel[t].readyState:"null";if(Tr.log("State change on <"+t+"> data channel: "+n),"open"===n){if(o.dataChannel[t].pending&&o.dataChannel[t].pending.length>0){for(var i in Tr.log("Sending pending messages on <"+t+">:",o.dataChannel[t].pending.length),o.dataChannel[t].pending){var a=o.dataChannel[t].pending[i];Tr.log("Sending string on data channel <"+t+">: "+a),o.dataChannel[t].send(a)}o.dataChannel[t].pending=[]}r.ondataopen(t)}};o.dataChannel[t]=n||o.pc.createDataChannel(t,{ordered:!1}),o.dataChannel[t].onmessage=function(e){Tr.log("Received message on data channel:",e);var t=e.target.label;r.ondata(e.data,t)},o.dataChannel[t].onopen=a,o.dataChannel[t].onclose=a,o.dataChannel[t].onerror=function(e){Tr.error("Got error on data channel:",e)},o.dataChannel[t].pending=[],i&&o.dataChannel[t].pending.push(i)}else Tr.warn("Invalid handle")}function O(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Tr.noop,t.error="function"==typeof t.error?t.error:Tr.noop;var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Tr.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff,r=t.text;if(null==r)return Tr.warn("Invalid text"),void t.error("Invalid text");var o=t.label?t.label:Tr.dataChanDefaultLabel;return i.dataChannel[o]?"open"!==i.dataChannel[o].readyState?(i.dataChannel[o].pending.push(r),void t.success()):(Tr.log("Sending string on data channel <"+o+">: "+r),i.dataChannel[o].send(r),void t.success()):(x(e,o,!1,r),void t.success())}function I(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Tr.noop,t.error="function"==typeof t.error?t.error:Tr.noop;var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Tr.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var r=i.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!r)return Tr.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=r.dtmf,i.dtmfSender&&(Tr.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(e){Tr.debug("Sent DTMF tone: "+e.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return Tr.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var o=t.dtmf;if(null==o)return Tr.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var a=o.tones;if(null==a)return Tr.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=o.duration;null==s&&(s=500);var l=o.gap;null==l&&(l=50),Tr.debug("Sending DTMF string "+a+" (duration "+s+"ms, gap "+l+"ms)"),i.dtmfSender.insertDTMF(a,s,l),t.success()}function R(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Tr.noop,t.error="function"==typeof t.error?t.error:Tr.noop;var r=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(r=!0===t.asyncRequest);var o=!0;void 0!==t.noRequest&&null!==t.noRequest&&(o=!0===t.noRequest),Tr.log("Destroying handle "+e+" (async="+r+")"),Z(e);var a=b[e];if(null==a||a.detached)return delete b[e],void t.success();if(o)return delete b[e],void t.success();if(!T)return Tr.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var s={rtcgw:"detach",transaction:Tr.randomString(12)};if(null!==a.token&&void 0!==a.token&&(s.token=a.token),null!=f&&(s.apisecret=f),n)return s.session_id=_,s.handle_id=e,i.send(JSON.stringify(s)),delete b[e],void t.success();Tr.httpAPICall(l+"/"+_+"/"+e,{verb:"POST",async:r,withCredentials:h,body:s,success:function(n){Tr.log("Destroyed handle:"),Tr.debug(n),"success"!==n.rtcgw&&Tr.error("Ooops: "+n.error.code+" "+n.error.reason),delete b[e],t.success()},error:function(n,i){Tr.error(n+":",i),delete b[e],t.success()}})}function M(e,t,n,i,r){return N.apply(this,arguments)}function N(){var e;return e=function*(e,t,n,i,r){var o=b[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Tr.warn("Invalid handle"),void i.error("Invalid handle");var a=o.webrtcStuff;Tr.debug("streamsDone:",r),r&&(Tr.debug(" -- Audio tracks:",r.getAudioTracks()),Tr.debug(" -- Video tracks:",r.getVideoTracks()));var s=!1;if(a.myStream&&n.update&&!a.streamExternal){if((!n.update&&H(n)||n.update&&(n.addAudio||n.replaceAudio))&&r.getAudioTracks()&&r.getAudioTracks().length)if(a.myStream.addTrack(r.getAudioTracks()[0]),Tr.unifiedPlan){Tr.log((n.replaceAudio?"Replacing":"Adding")+" audio track:",r.getAudioTracks()[0]);var l=null;if((g=a.pc.getTransceivers())&&g.length>0)for(var h in g)if((_=g[h]).sender&&_.sender.track&&"audio"===_.sender.track.kind||_.receiver&&_.receiver.track&&"audio"===_.receiver.track.kind){l=_;break}let t=null;try{t=yield i.customizeStream(r)}catch(e){i.error(e)}var m,A,f,v;l&&l.sender?l.sender.replaceTrack((null==t||null==(A=t.getAudioTracks)||null==(m=A.call(t))?void 0:m[0])||r.getAudioTracks()[0]):a.pc.addTrack((null==t||null==(v=t.getAudioTracks)||null==(f=v.call(t))?void 0:f[0])||r.getAudioTracks()[0],t||r)}else Tr.log((n.replaceAudio?"Replacing":"Adding")+" audio track:",r.getAudioTracks()[0]),a.pc.addTrack(r.getAudioTracks()[0],r);if((!n.update&&Q(n)||n.update&&(n.addVideo||n.replaceVideo))&&r.getVideoTracks()&&r.getVideoTracks().length)if(a.myStream.addTrack(r.getVideoTracks()[0]),Tr.unifiedPlan){Tr.log((n.replaceVideo?"Replacing":"Adding")+" video track:",r.getVideoTracks()[0]);var g,T=null;if((g=a.pc.getTransceivers())&&g.length>0)for(var h in g){var _;if((_=g[h]).sender&&_.sender.track&&"video"===_.sender.track.kind||_.receiver&&_.receiver.track&&"video"===_.receiver.track.kind){T=_;break}}T&&T.sender?T.sender.replaceTrack(r.getVideoTracks()[0]):a.pc.addTrack(r.getVideoTracks()[0],r)}else Tr.log((n.replaceVideo?"Replacing":"Adding")+" video track:",r.getVideoTracks()[0]),a.pc.addTrack(r.getVideoTracks()[0],r)}else a.myStream=r,s=!0;if(!a.pc){var C={iceServers:c,iceTransportPolicy:d,bundlePolicy:u};"chrome"===Tr.webRTCAdapter.browserDetails.browser&&(C.sdpSemantics=Tr.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan");var S={optional:[{DtlsSrtpKeyAgreement:!0}]};if(!0===p&&S.optional.push({googIPv6:!0}),i.rtcConstraints&&"object"==typeof i.rtcConstraints)for(var h in Tr.debug("Adding custom PeerConnection constraints:",i.rtcConstraints),i.rtcConstraints)S.optional.push(i.rtcConstraints[h]);"edge"===Tr.webRTCAdapter.browserDetails.browser&&(C.bundlePolicy="max-bundle"),Tr.log("Creating PeerConnection"),Tr.debug(S),a.pc=new RTCPeerConnection(C,S),a.pc.getStats&&(a.volume={},a.bitrate.value="0 kbits/sec"),Tr.log("Preparing local SDP and gathering candidates (trickle="+a.trickle+")"),a.pc.oniceconnectionstatechange=function(e){a.pc&&o.iceState(a.pc.iceConnectionState)},a.pc.onicecandidate=function(t){if(null==t.candidate||"edge"===Tr.webRTCAdapter.browserDetails.browser&&t.candidate.candidate.indexOf("endOfCandidates")>0)Tr.log("End of candidates."),a.iceDone=!0,!0===a.trickle?z(e,{completed:!0}):function(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Tr.noop,t.error="function"==typeof t.error?t.error:Tr.noop;var n=b[e];if(null!=n&&null!==n.webrtcStuff&&void 0!==n.webrtcStuff){var i=n.webrtcStuff;Tr.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1),Tr.debug(t),i.sdpSent=!0,t.success(i.mySdp)):Tr.warn("Local SDP instance is invalid, not sending anything...")}else Tr.warn("Invalid handle, not sending anything")}(e,i);else{var n={candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex};!0===a.trickle&&z(e,n)}},a.pc.ontrack=function(e){Tr.log("Handling Remote Track"),Tr.debug(e),e.streams&&(a.remoteStream=e.streams[0],o.onremotestream(a.remoteStream),e.track.onended||(Tr.log("Adding onended callback to track:",e.track),e.track.onended=function(e){Tr.log("Remote track muted/removed:",e),a.remoteStream&&(a.remoteStream.removeTrack(e.target),o.onremotestream(a.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){try{a.remoteStream.addTrack(e.target),o.onremotestream(a.remoteStream)}catch(e){Tr.error(e)}}))}}if(s&&null!=r){Tr.log("Adding local stream");var E=!0===i.simulcast2,w=r.getTracks();for(let t=0;t<w.length;t++){let n=w[t];if(E)if("audio"===n.kind)a.pc.addTrack(n,r);else{Tr.log("Enabling rid-based simulcasting:",n);const e=y(i.simulcastMaxBitrates);a.pc.addTransceiver(n,{direction:"sendrecv",streams:[r],sendEncodings:[{rid:"h",active:!0,maxBitrate:e.high},{rid:"m",active:!0,maxBitrate:e.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:e.low,scaleResolutionDownBy:4}]})}else if("audio"===n.kind){var k,P;let t=null;try{t=yield i.customizeStream(r)}catch(e){i.error(e)}a.pc.addTrack((null==t||null==(P=t.getAudioTracks)||null==(k=P.call(t))?void 0:k[0])||n,t||r)}else a.pc.addTrack(n,r)}}(function(e){return"edge"==Tr.webRTCAdapter.browserDetails.browser?(Tr.warn("Edge doesn't support data channels yet"),!1):null!=e&&!0===e.data})(n)&&!a.dataChannel[Tr.dataChanDefaultLabel]&&(Tr.log("Creating data channel"),x(e,Tr.dataChanDefaultLabel,!1),a.pc.ondatachannel=function(t){Tr.log("Data channel created by Janus:",t),x(e,t.channel.label,t.channel)}),a.myStream&&o.onlocalstream(a.myStream),null==t?function(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Tr.noop,n.error="function"==typeof n.error?n.error:Tr.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Tr.noop;var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Tr.warn("Invalid handle"),void n.error("Invalid handle");var r=i.webrtcStuff,o=!0===n.simulcast;o?Tr.log("Creating offer (iceDone="+r.iceDone+", simulcast="+o+")"):Tr.log("Creating offer (iceDone="+r.iceDone+")");var a={};if(Tr.unifiedPlan){var s=null,l=null,c=r.pc.getTransceivers();if(c&&c.length>0)for(var d in c){var u=c[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(l||(l=u))}var p=H(t),h=G(t);p||h?p&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Tr.log("Setting audio transceiver to sendrecv:",s)):p&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Tr.log("Setting audio transceiver to sendonly:",s)):!p&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Tr.log("Setting audio transceiver to recvonly:",s)):(s=r.pc.addTransceiver("audio",{direction:"recvonly"}),Tr.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",Tr.log("Setting audio transceiver to inactive:",s));var m=Q(t),A=K(t);m||A?m&&A?l&&(l.setDirection?l.setDirection("sendrecv"):l.direction="sendrecv",Tr.log("Setting video transceiver to sendrecv:",l)):m&&!A?l&&(l.setDirection?l.setDirection("sendonly"):l.direction="sendonly",Tr.log("Setting video transceiver to sendonly:",l)):!m&&A&&(l?(l.setDirection?l.setDirection("recvonly"):l.direction="recvonly",Tr.log("Setting video transceiver to recvonly:",l)):(l=r.pc.addTransceiver("video",{direction:"recvonly"}),Tr.log("Adding recvonly video transceiver:",l))):t.removeVideo&&l&&(l.setDirection?l.setDirection("inactive"):l.direction="inactive",Tr.log("Setting video transceiver to inactive:",l))}else a.offerToReceiveAudio=G(t),a.offerToReceiveVideo=K(t);!0===n.iceRestart&&(a.iceRestart=!0),Tr.debug(a);var f=Q(t);if(f&&o&&"firefox"===Tr.webRTCAdapter.browserDetails.browser){var v=r.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(v){var g=v.getParameters();g||(g={});const e=y(n.simulcastMaxBitrates);g.encodings=[{rid:"h",active:!0,maxBitrate:e.high},{rid:"m",active:!0,maxBitrate:e.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:e.low,scaleResolutionDownBy:4}],v.setParameters(g)}}r.pc.createOffer(a).then((function(e){var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Tr.log("Setting local description"),f&&o&&("chrome"===Tr.webRTCAdapter.browserDetails.browser||"safari"===Tr.webRTCAdapter.browserDetails.browser?(Tr.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),n=!1,i=[-1],r=[-1],o=null,a=null,s=null,l=null,c=-1,d=0;d<t.length;d++)if(p=t[d].match(/m=(\w+) */)){if("video"===p[1]){if(!(i[0]<0)){c=d;break}n=!0}else if(i[0]>-1){c=d;break}}else if(n){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)i[0]=u[1],r[0]=u[2],t.splice(d,1),d--;else{if(i[0]){if((m=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(o=m[1]),(m=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(a=m[1]),(m=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=m[1]),(m=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(l=m[1]),0===t[d].indexOf("a=ssrc:"+r[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}if(i[0]<0)for(c=-1,n=!1,d=0;d<t.length;d++){var p;if(p=t[d].match(/m=(\w+) */)){if("video"===p[1]){if(!(i[0]<0)){c=d;break}n=!0}else if(i[0]>-1){c=d;break}}else if(n){if(i[0]<0){var h=t[d].match(/a=ssrc:(\d+)/);if(h){i[0]=h[1],t.splice(d,1),d--;continue}}else{var m;if((m=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(o=m[1]),(m=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(a=m[1]),(m=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=m[1]),(m=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(l=m[1]),0===t[d].indexOf("a=ssrc:"+r[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}if(i[0]<0)return Tr.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;for(c<0&&(c=t.length),i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),r[1]=Math.floor(4294967295*Math.random()),r[2]=Math.floor(4294967295*Math.random()),d=0;d<i.length;d++)o&&(t.splice(c,0,"a=ssrc:"+i[d]+" cname:"+o),c++),a&&(t.splice(c,0,"a=ssrc:"+i[d]+" msid:"+a),c++),s&&(t.splice(c,0,"a=ssrc:"+i[d]+" mslabel:"+s),c++),l&&(t.splice(c,0,"a=ssrc:"+i[d]+" label:"+l),c++),o&&(t.splice(c,0,"a=ssrc:"+r[d]+" cname:"+o),c++),a&&(t.splice(c,0,"a=ssrc:"+r[d]+" msid:"+a),c++),s&&(t.splice(c,0,"a=ssrc:"+r[d]+" mslabel:"+s),c++),l&&(t.splice(c,0,"a=ssrc:"+r[d]+" label:"+l),c++);return t.splice(c,0,"a=ssrc-group:FID "+i[2]+" "+r[2]),t.splice(c,0,"a=ssrc-group:FID "+i[1]+" "+r[1]),t.splice(c,0,"a=ssrc-group:FID "+i[0]+" "+r[0]),t.splice(c,0,"a=ssrc-group:SIM "+i[0]+" "+i[1]+" "+i[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n"),e}(e.sdp)):"firefox"!==Tr.webRTCAdapter.browserDetails.browser&&Tr.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),r.mySdp=e.sdp,r.pc.setLocalDescription(e).catch(n.error),r.mediaConstraints=a,r.iceDone||r.trickle?(Tr.log("Offer ready"),Tr.debug(n),n.success(e)):Tr.log("Waiting for all candidates...")}),n.error)}(e,n,i):a.pc.setRemoteDescription(t).then((function(){if(Tr.log("Remote description accepted!"),a.remoteSdp=t.sdp,a.candidates&&a.candidates.length>0){for(var r=0;r<a.candidates.length;r++){var o=a.candidates[r];Tr.debug("Adding remote candidate:",o),o&&!0!==o.completed?a.pc.addIceCandidate(o):a.pc.addIceCandidate(Tr.endOfCandidates)}a.candidates=[]}!function(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Tr.noop,n.error="function"==typeof n.error?n.error:Tr.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Tr.noop;var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Tr.warn("Invalid handle"),void n.error("Invalid handle");var r=i.webrtcStuff,o=!0===n.simulcast;o?Tr.log("Creating answer (iceDone="+r.iceDone+", simulcast="+o+")"):Tr.log("Creating answer (iceDone="+r.iceDone+")");var a=null;if(Tr.unifiedPlan){a={};var s=null,l=null,c=r.pc.getTransceivers();if(c&&c.length>0)for(var d in c){var u=c[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(l||(l=u))}var p=H(t),h=G(t);if(p||h){if(p&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Tr.log("Setting audio transceiver to sendrecv:",s)}catch(e){Tr.error(e)}}else if(p&&!h)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Tr.log("Setting audio transceiver to sendonly:",s))}catch(e){Tr.error(e)}else if(!p&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Tr.log("Setting audio transceiver to recvonly:",s)}catch(e){Tr.error(e)}else s=r.pc.addTransceiver("audio",{direction:"recvonly"}),Tr.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",Tr.log("Setting audio transceiver to inactive:",s)}catch(e){Tr.error(e)}var m=Q(t),A=K(t);if(m||A){if(m&&A){if(l)try{l.setDirection?l.setDirection("sendrecv"):l.direction="sendrecv",Tr.log("Setting video transceiver to sendrecv:",l)}catch(e){Tr.error(e)}}else if(m&&!A){if(l)try{l.setDirection?l.setDirection("sendonly"):l.direction="sendonly",Tr.log("Setting video transceiver to sendonly:",l)}catch(e){Tr.error(e)}}else if(!m&&A)if(l)try{l.setDirection?l.setDirection("recvonly"):l.direction="recvonly",Tr.log("Setting video transceiver to recvonly:",l)}catch(e){Tr.error(e)}else l=r.pc.addTransceiver("video",{direction:"recvonly"}),Tr.log("Adding recvonly video transceiver:",l)}else if(t.removeVideo&&l)try{l.setDirection?l.setDirection("inactive"):l.direction="inactive",Tr.log("Setting video transceiver to inactive:",l)}catch(e){Tr.error(e)}}else a="firefox"==Tr.webRTCAdapter.browserDetails.browser||"edge"==Tr.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:G(t),offerToReceiveVideo:K(t)}:{mandatory:{OfferToReceiveAudio:G(t),OfferToReceiveVideo:K(t)}};Tr.debug(a);var f=Q(t);if(f&&o&&"firefox"===Tr.webRTCAdapter.browserDetails.browser){Tr.log("Enabling Simulcasting for Firefox (RID)");var v=r.pc.getSenders()[1];Tr.log(v);var g=v.getParameters();Tr.log(g);const e=y(n.simulcastMaxBitrates);v.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:e.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:e.medium},{rid:"low",active:!0,priority:"low",maxBitrate:e.low}]})}r.pc.createAnswer(a).then((function(e){Tr.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Tr.log("Setting local description"),f&&o&&("chrome"===Tr.webRTCAdapter.browserDetails.browser?Tr.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Tr.webRTCAdapter.browserDetails.browser&&Tr.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),r.mySdp=e.sdp,r.pc.setLocalDescription(e).catch(n.error),r.mediaConstraints=a,r.iceDone||r.trickle?n.success(e):Tr.log("Waiting for all candidates...")}),n.error)}(e,n,i)}),i.error)},N=function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){gr(o,i,r,a,s,"next",e)}function s(e){gr(o,i,r,a,s,"throw",e)}a(void 0)}))},N.apply(this,arguments)}function $(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Tr.noop,n.error="function"==typeof n.error?n.error:Y,n.customizeStream="function"==typeof n.customizeStream?n.customizeStream:Tr.noop;var i=n.jsep;if(t&&i)return Tr.error("Provided a JSEP to a createOffer"),void n.error("Provided a JSEP to a createOffer");if(!(t||i&&i.type&&i.sdp))return Tr.error("A valid JSEP is required for createAnswer"),void n.error("A valid JSEP is required for createAnswer");n.media=n.media||{audio:!0,video:!0};var r=n.media,o=b[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Tr.warn("Invalid handle"),void n.error("Invalid handle");var a,s=o.webrtcStuff;if(s.trickle=null==(a=n.trickle)||!0===a,void 0===s.pc||null===s.pc)r.update=!1,r.keepAudio=!1,r.keepVideo=!1;else if(void 0!==s.pc&&null!==s.pc){if(Tr.log("Updating existing media session"),r.update=!0,null!==n.stream&&void 0!==n.stream)n.stream!==s.myStream&&Tr.log("Renegotiation involves a new external stream");else{if(r.addAudio){if(r.keepAudio=!1,r.replaceAudio=!1,r.removeAudio=!1,r.audioSend=!0,s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length)return Tr.error("Can't add audio stream, there already is one"),void n.error("Can't add audio stream, there already is one")}else r.removeAudio?(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!1,r.audioSend=!1):r.replaceAudio&&(r.keepAudio=!1,r.addAudio=!1,r.removeAudio=!1,r.audioSend=!0);if(null===s.myStream||void 0===s.myStream?(r.replaceAudio&&(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!0,r.audioSend=!0),H(r)&&(r.keepAudio=!1,r.addAudio=!0)):null===s.myStream.getAudioTracks()||void 0===s.myStream.getAudioTracks()||0===s.myStream.getAudioTracks().length?(r.replaceAudio&&(r.keepAudio=!1,r.replaceAudio=!1,r.addAudio=!0,r.audioSend=!0),H(r)&&(r.keepVideo=!1,r.addAudio=!0)):!H(r)||r.removeAudio||r.replaceAudio||(r.keepAudio=!0),r.addVideo){if(r.keepVideo=!1,r.replaceVideo=!1,r.removeVideo=!1,r.videoSend=!0,s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length)return Tr.error("Can't add video stream, there already is one"),void n.error("Can't add video stream, there already is one")}else r.removeVideo?(r.keepVideo=!1,r.replaceVideo=!1,r.addVideo=!1,r.videoSend=!1):r.replaceVideo&&(r.keepVideo=!1,r.addVideo=!1,r.removeVideo=!1,r.videoSend=!0);null===s.myStream||void 0===s.myStream||null===s.myStream.getVideoTracks()||void 0===s.myStream.getVideoTracks()||0===s.myStream.getVideoTracks().length?(r.replaceVideo&&(r.keepVideo=!1,r.replaceVideo=!1,r.addVideo=!0,r.videoSend=!0),Q(r)&&(r.keepVideo=!1,r.addVideo=!0)):!Q(r)||r.removeVideo||r.replaceVideo||(r.keepVideo=!0),r.addData&&(r.data=!0)}if(H(r)&&r.keepAudio&&Q(r)&&r.keepVideo)return o.consentDialog(!1),void M(e,i,r,n,s.myStream)}if(r.update&&!s.streamExternal){if(r.removeAudio||r.replaceAudio){if(s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length){var l=s.myStream.getAudioTracks()[0];Tr.log("Removing audio track:",l),s.myStream.removeTrack(l);try{l.stop()}catch(k){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var c=!0;if(r.replaceAudio&&Tr.unifiedPlan&&(c=!1),c)for(var d in s.pc.getSenders())(l=s.pc.getSenders()[d])&&l.track&&"audio"===l.track.kind&&(Tr.log("Removing audio sender:",l),s.pc.removeTrack(l))}}if(r.removeVideo||r.replaceVideo){if(s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length){l=s.myStream.getVideoTracks()[0],Tr.log("Removing video track:",l),s.myStream.removeTrack(l);try{l.stop()}catch(P){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var u=!0;if(r.replaceVideo&&Tr.unifiedPlan&&(u=!1),u)for(var d in s.pc.getSenders())(l=s.pc.getSenders()[d])&&l.track&&"video"===l.track.kind&&(Tr.log("Removing video sender:",l),s.pc.removeTrack(l))}}}if(null!==n.stream&&void 0!==n.stream){var p=n.stream;if(Tr.log("MediaStream provided by the application"),Tr.debug(p),r.update&&s.myStream&&s.myStream!==n.stream&&!s.streamExternal){try{var h=s.myStream.getTracks();for(var m in h){var A=h[m];Tr.log(A),null!=A&&A.stop()}}catch(D){}s.myStream=null}return s.streamExternal=!0,o.consentDialog(!1),void M(e,i,r,n,p)}if(H(r)||Q(r)){if(!Tr.isGetUserMediaAvailable())return void n.error("getUserMedia not available");var f={mandatory:{},optional:[]};o.consentDialog(!0);var v=H(r);!0===v&&null!=r&&null!=r&&"object"==typeof r.audio&&(v=r.audio);var g=Q(r);if(!0===g&&null!=r&&null!=r){var y=!0===n.simulcast,T=!0===n.simulcast2;if(!y&&!T||i||void 0!==r.video&&!1!==r.video||(r.video="hires"),r.video&&"screen"!=r.video&&"window"!=r.video)if("object"==typeof r.video)g=r.video;else{var _=0,C=0;"lowres"===r.video?(C=240,_=320):"lowres-16:9"===r.video?(C=180,_=320):"hires"===r.video||"hires-16:9"===r.video||"hdres"===r.video?(C=720,_=1280):"fhdres"===r.video?(C=1080,_=1920):"4kres"===r.video?(C=2160,_=3840):"stdres"===r.video?(C=480,_=640):"stdres-16:9"===r.video?(C=360,_=640):(Tr.log("Default video setting is stdres 4:3"),C=480,_=640),Tr.log("Adding media constraint:",r.video),g={height:{ideal:C},width:{ideal:_}},Tr.log("Adding video constraint:",g)}else if("screen"===r.video||"window"===r.video){if(r.screenshareFrameRate||(r.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){o.consentDialog(!1),H(r)&&!r.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(o){t.addTrack(o.getAudioTracks()[0]),M(e,i,r,n,t)})):M(e,i,r,n,t)}),(function(e){o.consentDialog(!1),n.error(e)}));function L(t,a){o.consentDialog(!1),t?n.error(t):M(e,i,r,n,a)}function z(e,t,n){Tr.log("Adding media constraint (screen capture)"),Tr.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){n?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(n){e.addTrack(n.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){o.consentDialog(!1),t(e)}))}if("chrome"===Tr.webRTCAdapter.browserDetails.browser){var S=Tr.webRTCAdapter.browserDetails.version,E=33;window.navigator.userAgent.match("Linux")&&(E=35),S>=26&&S<=E?z(f={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:r.screenshareFrameRate,maxFrameRate:r.screenshareFrameRate,chromeMediaSource:"screen"}},audio:H(r)&&!r.keepAudio},L):Tr.extension.getScreen((function(e,t){if(e)return o.consentDialog(!1),n.error(e);(f={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:r.screenshareFrameRate,maxFrameRate:r.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,z(f,L,H(r)&&!r.keepAudio)}))}else if("firefox"===Tr.webRTCAdapter.browserDetails.browser){if(!(Tr.webRTCAdapter.browserDetails.version>=33)){var w=new Error("NavigatorUserMediaError");return w.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",o.consentDialog(!1),void n.error(w)}z(f={video:{mozMediaSource:r.video,mediaSource:r.video},audio:H(r)&&!r.keepAudio},(function(e,t){if(L(e,t),!e)var n=t.currentTime,i=window.setInterval((function(){t||window.clearInterval(i),t.currentTime==n&&(window.clearInterval(i),t.onended&&t.onended()),n=t.currentTime}),500)}))}return}}null!=r&&"screen"===r.video||navigator.mediaDevices.enumerateDevices().then((function(t){var a=t.some((function(e){return"audioinput"===e.kind})),s=function(e){if(null==e)return!1;if("object"!=typeof e.video||"object"!=typeof e.video.mandatory)return!1;var t=e.video.mandatory;return t.chromeMediaSource?"desktop"===t.chromeMediaSource||"screen"===t.chromeMediaSource:t.mozMediaSource?"window"===t.mozMediaSource||"screen"===t.mozMediaSource:!!t.mediaSource&&("window"===t.mediaSource||"screen"===t.mediaSource)}(r)||t.some((function(e){return"videoinput"===e.kind})),l=H(r),c=Q(r),d=function(e){return null!=e&&!1!==e.audio&&!1!==e.audioSend&&void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio}(r),u=function(e){return null!=e&&!1!==e.video&&!1!==e.videoSend&&void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo}(r);if(l||c||d||u){var h=!!l&&a,m=!!c&&s;if(!h&&!m)return o.consentDialog(!1),n.error("No capture device found"),!1;if(!h&&d)return o.consentDialog(!1),n.error("Audio capture is required, but no capture device found"),!1;if(!m&&u)return o.consentDialog(!1),n.error("Video capture is required, but no capture device found"),!1}var A={audio:!(!a||r.keepAudio)&&v,video:!(!s||r.keepVideo)&&g};Tr.debug("getUserMedia constraints",A),A.audio||A.video?navigator.mediaDevices.getUserMedia(A).then((function(t){o.consentDialog(!1),M(e,i,r,n,t)})).catch((function(e){o.consentDialog(!1),n.error({code:e.code,name:e.name,message:e.message})})):(o.consentDialog(!1),M(e,i,r,n,p))})).catch((function(e){o.consentDialog(!1),n.error("enumerateDevices error",e)}))}else M(e,i,r,n)}function F(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Tr.noop,t.error="function"==typeof t.error?t.error:Y;var n=t.jsep,i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Tr.warn("Invalid handle"),void t.error("Invalid handle");var r=i.webrtcStuff;if(null!=n){if(null===r.pc)return Tr.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");r.pc.setRemoteDescription(n).then((function(){if(Tr.log("Remote description accepted!"),r.remoteSdp=n.sdp,r.candidates&&r.candidates.length>0){for(var e=0;e<r.candidates.length;e++){var i=r.candidates[e];Tr.debug("Adding remote candidate:",i),i&&!0!==i.completed?r.pc.addIceCandidate(i):r.pc.addIceCandidate(Tr.endOfCandidates)}r.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function j(e,t){var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Tr.warn("Invalid handle"),0;var i=t?"remote":"local",r=n.webrtcStuff;return r.volume[i]||(r.volume[i]={value:0}),r.pc.getStats&&"chrome"===Tr.webRTCAdapter.browserDetails.browser?!t||null!==r.remoteStream&&void 0!==r.remoteStream?t||null!==r.myStream&&void 0!==r.myStream?null===r.volume[i].timer||void 0===r.volume[i].timer?(Tr.log("Starting "+i+" volume monitor"),r.volume[i].timer=setInterval((function(){r.pc.getStats((function(e){for(var n=e.result(),o=0;o<n.length;o++){var a=n[o];"ssrc"==a.type&&(t&&a.stat("audioOutputLevel")?r.volume[i].value=parseInt(a.stat("audioOutputLevel")):!t&&a.stat("audioInputLevel")&&(r.volume[i].value=parseInt(a.stat("audioInputLevel"))))}}))}),200),0):r.volume[i].value:(Tr.warn("Local stream unavailable"),0):(Tr.warn("Remote stream unavailable"),0):(Tr.warn("Getting the "+i+" volume unsupported by browser"),0)}function U(e,t){var n=b[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Tr.warn("Invalid handle"),!0;var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?(Tr.warn("Invalid PeerConnection"),!0):void 0===i.myStream||null===i.myStream?(Tr.warn("Invalid local MediaStream"),!0):t?null===i.myStream.getVideoTracks()||void 0===i.myStream.getVideoTracks()||0===i.myStream.getVideoTracks().length?(Tr.warn("No video track"),!0):!i.myStream.getVideoTracks()[0].enabled:null===i.myStream.getAudioTracks()||void 0===i.myStream.getAudioTracks()||0===i.myStream.getAudioTracks().length?(Tr.warn("No audio track"),!0):!i.myStream.getAudioTracks()[0].enabled}function B(e,t,n){var i=b[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Tr.warn("Invalid handle"),!1;var r=i.webrtcStuff;return null===r.pc||void 0===r.pc?(Tr.warn("Invalid PeerConnection"),!1):void 0===r.myStream||null===r.myStream?(Tr.warn("Invalid local MediaStream"),!1):t?null===r.myStream.getVideoTracks()||void 0===r.myStream.getVideoTracks()||0===r.myStream.getVideoTracks().length?(Tr.warn("No video track"),!1):(r.myStream.getVideoTracks()[0].enabled=!n,!0):null===r.myStream.getAudioTracks()||void 0===r.myStream.getAudioTracks()||0===r.myStream.getAudioTracks().length?(Tr.warn("No audio track"),!1):(r.myStream.getAudioTracks()[0].enabled=!n,!0)}function V(e){var t=b[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Tr.warn("Invalid handle"),"Invalid handle";var n=t.webrtcStuff;return null===n.pc||void 0===n.pc?"Invalid PeerConnection":n.pc.getStats?null===n.bitrate.timer||void 0===n.bitrate.timer?(Tr.log("Starting bitrate timer (via getStats)"),n.bitrate.timer=setInterval((function(){n.pc.getStats().then((function(e){e.forEach((function(e){if(e){var t=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(n.bitrate.bsnow=e.bytesReceived,n.bitrate.tsnow=e.timestamp,null===n.bitrate.bsbefore||null===n.bitrate.tsbefore)n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow;else{var i=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==Tr.webRTCAdapter.browserDetails.browser&&(i/=1e3);var r=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/i);"safari"===Tr.webRTCAdapter.browserDetails.browser&&(r=parseInt(r/1e3)),n.bitrate.value=r+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):n.bitrate.value:(Tr.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function Y(e){Tr.error("WebRTC error:",e)}function Z(e,t){Tr.log("Cleaning WebRTC stuff");var r=b[e];if(null!=r){var o=r.webrtcStuff;if(null!=o){if(!0===t){var a={rtcgw:"hangup",transaction:Tr.randomString(12)};null!==r.token&&void 0!==r.token&&(a.token=r.token),null!=f&&(a.apisecret=f),Tr.debug("Sending hangup request (handle="+e+"):",a),n?(a.session_id=_,a.handle_id=e,i.send(JSON.stringify(a))):Tr.httpAPICall(l+"/"+_+"/"+e,{verb:"POST",withCredentials:h,body:a})}o.remoteStream=null,o.volume&&(o.volume.local&&o.volume.local.timer&&clearInterval(o.volume.local.timer),o.volume.remote&&o.volume.remote.timer&&clearInterval(o.volume.remote.timer)),o.volume={},o.bitrate.timer&&clearInterval(o.bitrate.timer),o.bitrate.timer=null,o.bitrate.bsnow=null,o.bitrate.bsbefore=null,o.bitrate.tsnow=null,o.bitrate.tsbefore=null,o.bitrate.value=null;try{if(!o.streamExternal&&null!==o.myStream&&void 0!==o.myStream){Tr.log("Stopping local stream tracks");var s=o.myStream.getTracks();for(var c in s){var d=s[c];Tr.log(d),null!=d&&d.stop()}}}catch(e){}o.streamExternal=!1,o.myStream=null;try{o.pc.close()}catch(e){}o.pc=null,o.candidates=null,o.mySdp=null,o.remoteSdp=null,o.iceDone=!1,o.dataChannel={},o.dtmfSender=null}r.oncleanup()}}function H(e){return null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function G(e){return null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function Q(e){return null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function K(e){return null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}D(e),this.getServer=function(){return l},this.isConnected=function(){return T},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:Tr.noop,e.error="function"==typeof e.error?e.error:Tr.noop,e.reconnect=!0,D(e)},this.getSessionId=function(){return _},this.destroy=function(t){!function(t){(t=t||{}).success="function"==typeof t.success?t.success:Tr.noop;var a=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(a=!0===t.asyncRequest);var s=!0;void 0!==t.notifyDestroyed&&null!==t.notifyDestroyed&&(s=!0===t.notifyDestroyed);var c=!1;if(void 0!==t.cleanupHandles&&null!==t.cleanupHandles&&(c=!0===t.cleanupHandles),Tr.log("Destroying session "+_+" (async="+a+")"),!T)return Tr.warn("Is the server down? (connected=false)"),void t.success();if(null==_)return Tr.warn("No session to destroy"),t.success(),void(s&&e.destroyed());if(c)for(var d in b)R(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:Tr.randomString(12)};if(null!=A&&(u.token=A),null!=f&&(u.apisecret=f),n){u.session_id=_;var p=function(){for(var e in r)i.removeEventListener(e,r[e]);i.removeEventListener("message",m),i.removeEventListener("error",v),o&&clearTimeout(o),i.close()},m=function(n){var i=JSON.parse(n.data);i.session_id==u.session_id&&i.transaction==u.transaction&&(p(),t.success(),s&&e.destroyed())},v=function(n){p(),t.error("Failed to destroy the server: Is the server down?"),s&&e.destroyed()};return i.addEventListener("message",m),i.addEventListener("error",v),void i.send(JSON.stringify(u))}Tr.httpAPICall(l+"/"+_,{verb:"POST",async:a,withCredentials:h,body:u,success:function(n){Tr.log("Destroyed session:"),Tr.debug(n),_=null,T=!1,"success"!==n.rtcgw&&Tr.error("Ooops: "+n.error.code+" "+n.error.reason),t.success(),s&&e.destroyed()},error:function(n,i){Tr.error(n+":",i),_=null,T=!1,t.success(),s&&e.destroyed()}})}(t)},this.attach=function(e){!function(e){if((e=e||{}).success="function"==typeof e.success?e.success:Tr.noop,e.error="function"==typeof e.error?e.error:Tr.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:Tr.noop,e.iceState="function"==typeof e.iceState?e.iceState:Tr.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:Tr.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:Tr.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:Tr.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:Tr.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:Tr.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:Tr.noop,e.ondata="function"==typeof e.ondata?e.ondata:Tr.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:Tr.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:Tr.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:Tr.noop,!T)return Tr.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var t=e.plugin;if(null==t)return Tr.error("Invalid plugin"),void e.error("Invalid plugin");var r=e.opaqueId,o=e.token?e.token:A,a=Tr.randomString(12),s={rtcgw:"attach",plugin:t,opaque_id:r,transaction:a};if(null!=o&&(s.token=o),null!=f&&(s.apisecret=f),n)return E[a]=function(n){if("success"!==n.rtcgw)return Tr.error("Ooops: "+n.error.code+" "+n.error.reason),void e.error("Ooops: "+n.error.code+" "+n.error.reason);var i=n.data.id;Tr.log("Created handle: "+i);var r={session:C,plugin:t,id:i,token:o,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return t},getVolume:function(){return j(i,!0)},getRemoteVolume:function(){return j(i,!0)},getLocalVolume:function(){return j(i,!1)},isAudioMuted:function(){return U(i,!1)},muteAudio:function(){return B(i,!1,!0)},unmuteAudio:function(){return B(i,!1,!1)},isVideoMuted:function(){return U(i,!0)},muteVideo:function(){return B(i,!0,!0)},unmuteVideo:function(){return B(i,!0,!1)},getBitrate:function(){return V(i)},send:function(e){L(i,e)},data:function(e){O(i,e)},dtmf:function(e){I(i,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){$(i,!0,e)},createAnswer:function(e){$(i,!1,e)},handleRemoteJsep:function(e){F(i,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Z(i,!0===e)},detach:function(e){R(i,e)}};b[i]=r,e.success(r)},s.session_id=_,void i.send(JSON.stringify(s));Tr.httpAPICall(l+"/"+_,{verb:"POST",withCredentials:h,body:s,success:function(n){if(Tr.debug(n),"success"!==n.rtcgw)return Tr.error("Ooops: "+n.error.code+" "+n.error.reason),void e.error("Ooops: "+n.error.code+" "+n.error.reason);var i=n.data.id;Tr.log("Created handle: "+i);var r={session:C,plugin:t,id:i,token:o,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return i},getPlugin:function(){return t},getVolume:function(){return j(i,!0)},getRemoteVolume:function(){return j(i,!0)},getLocalVolume:function(){return j(i,!1)},isAudioMuted:function(){return U(i,!1)},muteAudio:function(){return B(i,!1,!0)},unmuteAudio:function(){return B(i,!1,!1)},isVideoMuted:function(){return U(i,!0)},muteVideo:function(){return B(i,!0,!0)},unmuteVideo:function(){return B(i,!0,!1)},getBitrate:function(){return V(i)},send:function(e){L(i,e)},data:function(e){O(i,e)},dtmf:function(e){I(i,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){$(i,!0,e)},createAnswer:function(e){$(i,!1,e)},handleRemoteJsep:function(e){F(i,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Z(i,!0===e)},detach:function(e){R(i,e)}};b[i]=r,e.success(r)},error:function(e,t){Tr.error(e+":",t)}})}(e)}}Tr.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},extension:e&&e.extension||yr,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||window.adapter,httpAPICall:function(e,i){var r={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(r.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(r.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(r.body=JSON.stringify(i.body));var o=t(e,r).catch((function(e){return n.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==i.timeout){var a=new n((function(e,t){var n=setTimeout((function(){return clearTimeout(n),t({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));o=n.race([o,a])}return o.then((function(e){return e.ok?typeof i.success==typeof Tr.noop?e.json().then((function(e){i.success(e)})).catch((function(t){return n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:n.reject({message:"API call failed",response:e})})).catch((function(e){typeof i.error==typeof Tr.noop&&i.error(e.message||"<< internal error >>",e)})),o}}},Tr.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||yr,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var i=void 0!==n.body?{contentType:"application/json",data:JSON.stringify(n.body)}:{},r=void 0!==n.withCredentials?{xhrFields:{withCredentials:n.withCredentials}}:{};return t.ajax(t.extend(i,r,{url:e,type:n.verb,cache:!1,dataType:"json",async:n.async,timeout:n.timeout,success:function(e){typeof n.success==typeof Tr.noop&&n.success(e)},error:function(e,t,i){typeof n.error==typeof Tr.noop&&n.error(t,i)}}))}}},Tr.noop=function(){},Tr.dataChanDefaultLabel="JanusDataChannel",Tr.endOfCandidates=null,Tr.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:Tr.noop,!0===Tr.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),Tr.trace=Tr.noop,Tr.debug=Tr.noop,Tr.vdebug=Tr.noop,Tr.log=Tr.noop,Tr.warn=Tr.noop,Tr.error=Tr.noop,!0===e.debug||"all"===e.debug)Tr.trace=console.trace.bind(console)||Tr.noop,Tr.debug=console.debug.bind(console)||Tr.noop,Tr.vdebug=console.debug.bind(console)||Tr.noop,Tr.log=console.log.bind(console)||Tr.noop,Tr.warn=console.warn.bind(console)||Tr.noop,Tr.error=console.error.bind(console)||Tr.noop;else if(Array.isArray(e.debug))for(var t in e.debug)switch(e.debug[t]){case"trace":Tr.trace=console.trace.bind(console)||Tr.noop;break;case"debug":Tr.debug=console.debug.bind(console)||Tr.noop;break;case"vdebug":Tr.vdebug=console.debug.bind(console)||Tr.noop;break;case"log":Tr.log=console.log.bind(console)||Tr.noop;break;case"warn":Tr.warn=console.warn.bind(console)||Tr.noop;break;case"error":Tr.error=console.error.bind(console)||Tr.noop}var n=e.dependencies||Tr.useDefaultDependencies();Tr.isArray=n.isArray,Tr.webRTCAdapter=n.webRTCAdapter,Tr.httpAPICall=n.httpAPICall,Tr.newWebSocket=n.newWebSocket,Tr.extension=n.extension,Tr.extension.init(),Tr.listDevices=function(e,t){e="function"==typeof e?e:Tr.noop,null==t&&(t={audio:!0,video:!0}),Tr.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(n){Tr.debug(n),e(n);try{var i=t.getTracks();for(var r in i){var o=i[r];null!=o&&o.stop()}}catch(e){}}))})).catch((function(t){Tr.error(t),e([])})):(Tr.warn("navigator.mediaDevices unavailable"),e([]))},Tr.attachMediaStream=function(e,t){try{"chrome"===Tr.webRTCAdapter.browserDetails.browser?Tr.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:Tr.error("Error attaching stream to element"):e.srcObject=t}catch(e){}},Tr.reattachMediaStream=function(e,t){try{"chrome"===Tr.webRTCAdapter.browserDetails.browser?Tr.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:Tr.error("Error reattaching stream to element"):e.srcObject=t.srcObject}catch(e){}};var i=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",r=window["on"+i];if(window.addEventListener(i,(function(e){for(var t in Tr.log("Closing window"),Tr.sessions)null!==Tr.sessions[t]&&void 0!==Tr.sessions[t]&&Tr.sessions[t].destroyOnUnload&&(Tr.log("Destroying session "+t),Tr.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));r&&"function"==typeof r&&r()})),Tr.safariVp8=!1,"safari"===Tr.webRTCAdapter.browserDetails.browser&&Tr.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var o=RTCRtpSender.getCapabilities("video").codecs[t];if(o&&o.mimeType&&"video/vp8"===o.mimeType.toLowerCase()){Tr.safariVp8=!0;break}}Tr.safariVp8?Tr.log("This version of Safari supports VP8"):Tr.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var a=new RTCPeerConnection({},{});a.createOffer({offerToReceiveVideo:!0}).then((function(e){Tr.safariVp8=-1!==e.sdp.indexOf("VP8"),Tr.safariVp8?Tr.log("This version of Safari supports VP8"):Tr.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),a.close(),a=null}))}if(Tr.unifiedPlan=!1,"firefox"===Tr.webRTCAdapter.browserDetails.browser&&Tr.webRTCAdapter.browserDetails.version>=59)Tr.unifiedPlan=!0;else if("chrome"===Tr.webRTCAdapter.browserDetails.browser&&Tr.webRTCAdapter.browserDetails.version<72)Tr.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){const t=new RTCPeerConnection;try{t.addTransceiver("audio"),Tr.unifiedPlan=!0}catch(e){}t.close()}else Tr.unifiedPlan=!1;Tr.initDone=!0,e.callback()}},Tr.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Tr.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Tr.randomString=function(e){for(var t="",n=0;n<e;n++){var i=Math.floor(62*Math.random());t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".substring(i,i+1)}return t};const _r={eventEmitter:null,language:"zh"};class br{constructor(e){this.startTalk=(e,t)=>{const n=this;if("function"==typeof t&&!t())return void n.eventEmitter.emit("handleTalkError",{code:-1,msg:"startTalk terminate"});const{customizeStream:i,audio:r}=e;Tr.isWebrtcSupported()&&(this.janus=new Tr({server:e.rtcUrl,success:function(){n.janus&&n.janus.attach({plugin:"rtcgw.plugin.tts",opaqueId:n.opaqueId,success:function(t){n.tts=window.tts=t;let o={request:"start",url:e.talkLink,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===e.talkType&&(o.devProto="gb28181"),n.tts.createOffer({media:{audio:r||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:i,success:function(e){n.tts.send({message:o,jsep:e})},error:function(e){var t;n.eventEmitter.emit("handleTalkError",e),(null==(t=n.tts)?void 0:t.detach)&&n.tts.detach()}})},error:function(e){n.eventEmitter.emit("handleTalkError",e)},consentDialog:function(e){},iceState:function(e){},mediaState:function(e,t){},webrtcState:function(e){},slowLink:function(e,t){},onmessage:function(e,t){null!=t&&n.tts.handleRemoteJsep({jsep:t});let i=e.result;if(null!=i){if("done"===i)return null!==n.spinner&&void 0!==n.spinner&&n.spinner.stop(),void(n.spinner=null);"msg"===i&&n.eventEmitter.emit("handleTalkMessage",e),i.status}e.rtcgw&&"ttsup"===e.rtcgw&&n.eventEmitter.emit("handleTalkSuccess",e),e.code&&0!==e.code&&n.eventEmitter.emit("handleTalkError",{code:e.code,msg:n.i18n.t(e.code)})},onlocalstream:function(e){const t=document.getElementById("myaudio");t&&Tr.attachMediaStream(t,e),"completed"!==n.tts.webrtcStuff.pc.iceConnectionState&&"connected"!==n.tts.webrtcStuff.pc.iceConnectionState&&(null==n.spinner?document.getElementById("audioright"):n.spinner.spin()),e.getAudioTracks()},onremotestream:function(e){const t=document.getElementById("peeraudio");t&&Tr.attachMediaStream(t,e);let n=e.getAudioTracks();if(null==n||0===n.length);else{const e=document.getElementById("peeraudio");e&&e.play()}},ondataopen:function(e){},ondata:function(e){},oncleanup:function(){null!==n.spinner&&void 0!==n.spinner&&n.spinner.stop(),n.spinner=null}})},error:function(e){n.eventEmitter.emit("handleTalkError",e)}},{stream:e.stream,deviceSerial:e.deviceSerial,channel:e.channelNo}))},this.stopTalk=e=>{if("function"!=typeof e||e())if(this.tts&&(this.tts.detach(),this.tts=null),this.janus){try{this.janus.destroy({success:()=>{this.eventEmitter.emit("handleStopTalkSuccess",this.janus)},error:e=>{this.eventEmitter.emit("handleStopTalkError",e)}})}catch(e){this.eventEmitter.emit("handleStopTalkError",e)}this.janus=void 0,this.tts=null}else this.eventEmitter.emit("handleStopTalkError",{code:-1,msg:"stopTalk terminate"});else this.eventEmitter.emit("handleStopTalkError",{code:-1,msg:"stopTalk terminate"})},this.destroy=()=>{},this.tts=null,this.opaqueId="tts-"+Tr.randomString(12),this.spinner=null,this.options=Object.assign({},_r,e||{}),this.eventEmitter=e.eventEmitter,this.i18n=new s({zh:fr,en:vr}),this.i18n.switchTranslation(this.options.language||"zh"),Tr.init({debug:"all"})}}function Cr(){return Cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Cr.apply(this,arguments)}const Sr="stopTalk",Er="talkVolumeChange",wr={deviceSerial:"",channelNo:"1",accessToken:"",env:{domain:"https://open.ys7.com"},capacity:{support_talk:null,support_switch_talkmode:null}};class kr{updateOptions(e){this.options=Object.assign(this.options,e||{})}constructor(e){this.destroy=()=>{this.stopTalk(),document.body.removeChild(this.audioLeft),document.body.removeChild(this.audioRight)},this.startTalk=e=>{this.eventEmitter.emit("beforeTalk",{});const t=this;new Promise(((e,t)=>{var n,i,r,o;(null==(n=this.options.capacity)?void 0:n.support_switch_talkmode)&&"1"==this.options.capacity.support_switch_talkmode?fetch(this.options.env.domain+"/api/service/device/talkMode"+`?deviceSerial=${this.options.deviceSerial}`,{method:"GET",headers:{accessToken:(null==(r=this.options.token)||null==(i=r.deviceToken)?void 0:i.global)||(null==(o=this.options)?void 0:o.accessToken)}}).then((e=>e.json())).then((t=>{var n,i,r;t.meta&&200==t.meta.code?(null==(n=t.data)?void 0:n.valueInfo)&&0==t.data.valueInfo.mode?fetch(this.options.env.domain+"/api/v3/device/talkMode"+`?deviceSerial=${this.options.deviceSerial}&channelNo=${this.options.channelNo}&mode=1`,{method:"PUT",headers:{accessToken:(null==(r=this.options.token)||null==(i=r.deviceToken)?void 0:i.video)||this.options.accessToken}}).then((e=>e.json())).then((t=>{t.meta&&200==t.meta.code?e({}):e({code:-1,msg:"对讲模式切换失败",res:t})})).catch((t=>{e({code:-1,msg:"对讲模式切换失败",res:t})})):e({}):e({code:-1,msg:"获取当前对讲模式失败",res:t})})).catch((t=>{e({code:-1,msg:"获取当前对讲模式失败",res:t})})):e({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((n=>{var i,r,o;if((null==(i=this.options.capacity)?void 0:i.support_talk)&&(!this.options.capacity||"3"!==this.options.capacity.support_talk&&"1"!==this.options.capacity.support_talk))return!1;const a=new FormData;a.append("accessToken",(null==(o=this.options.token)||null==(r=o.deviceToken)?void 0:r.video)||this.options.accessToken),a.append("deviceSerial",this.options.deviceSerial),a.append("channelNo",this.options.channelNo),fetch(this.options.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:a}).then((e=>e.json())).then((n=>{if(200==n.code){const o=n.data;if(o){var i,r;let n=o.rtcUrl;-1===n.indexOf("ws")&&(n=n.replace("https","wss").replace("rtcgw","rtcgw-ws")),this.talkOptions.rtcUrl=n,this.talkOptions.ttsUrl="tts://"+o.ttsUrl,this.talkOptions.deviceSerial=this.options.deviceSerial,this.talkOptions.channelNo=this.options.channelNo,this.talkOptions.talkLink=this.talkOptions.ttsUrl.split("?")[0]+"/talk?dev="+this.talkOptions.deviceSerial+"&chann="+this.talkOptions.channelNo+"&encodetype=2",o.ttsUrl.indexOf("gb28181")>-1&&(this.talkOptions.talkType="gb28181"),e&&e(o.ttsUrl.indexOf("gb28181")>-1||-1!==this.talkOptions.deviceSerial.indexOf(":")),this.talkOptions.stream=o.stream?o.stream:(null==(r=this.options.token)||null==(i=r.streamToken)?void 0:i.talk)||this.options.accessToken,this.ttsTalk.startTalk(Cr({},this.talkOptions,{customizeStream:t._customizeStream.bind(t),audio:!this.microphoneId||{deviceId:this.microphoneId}})),this.isTalking=!0,this.observeVolumeChange({interval:100}),this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:this,msg:"开启对讲"})}}else this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:this,msg:n.msg});this.ttsTalk.eventEmitter.on("handleTalkSuccess",(e=>{this.isTalking=!0,this.observeVolumeChange({interval:100}),this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:this,msg:"开启对讲"})})),this.ttsTalk.eventEmitter.on("handleTalkError",(e=>{this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:e.code,target:this,msg:e.msg})}))}))})).catch((e=>{}))},this.stopTalk=()=>{var e;try{this.ttsTalk.stopTalk(),this.isTalking=!1}catch(e){var t;null==(t=this.eventEmitter)||t.emit(Sr,{eventType:Sr,code:-1,msg:"结束对讲"})}this.gainNode=null,this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null),this.eventEmitter&&setTimeout((()=>{var e;null==(e=this.eventEmitter)||e.emit(Er,{eventType:Er,code:0,target:this,data:0,msg:"音量变化"})}),200);const n=document.getElementById("myaudio").srcObject;n&&n.getTracks()[0].stop(),null==(e=this.eventEmitter)||e.emit(Sr,{eventType:Sr,code:0,target:this,msg:"结束对讲"})},this.changeTalkChannelNo=e=>{this.talkOptions.channelNo=e},this._customizeStream=e=>new Promise(((t,n)=>{const i=new window.AudioContext;this.gainNode=i.createGain();const r=i.createMediaStreamSource(e);var o;this.gainNode.gain.value=null!=(o=this.volumeGain)?o:1;const a=i.createMediaStreamDestination();r.connect(this.gainNode),this.gainNode.connect(a),t(a.stream)})),this.setVolumeGain=e=>{const t=e;return"number"==typeof t&&t>=0?(this.volumeGain=Math.min(t,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}},this.observeVolumeChange=e=>{const{interval:t}=e;this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null),this.volumeChangeInterval=setInterval((()=>{var e,t,n,i,r;null==(r=window.tts)||null==(i=r.webrtcStuff)||null==(n=i.pc)||null==(t=n.getStats)||null==(e=t.call(n))||e.then((e=>{e.forEach((e=>{var t;"media-source"===e.type&&(null==(t=this.eventEmitter)||t.emit("talkVolumeChange",{eventType:"talkVolumeChange",code:0,target:this,data:e.audioLevel,msg:"音量变化"}))}))}))}),t)},this.getMicrophonePermission=()=>new Promise(((e,t)=>{navigator.mediaDevices.getUserMedia({audio:!0}).then((t=>{t.getTracks().forEach((e=>{e.stop()})),e({code:0,msg:"成功",res:null})})).catch((t=>{e({code:-1,msg:"获取麦克风权限失败",res:t})}))})),this.getMicrophonesList=()=>new Promise(((e,t)=>{navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((t=>{const n=[];t.forEach((e=>{"audioinput"==e.kind&&n.push(e)})),e({code:0,msg:"成功",res:n})})):e({code:-1,msg:"未查询到相关设备",res:null})})),this.setProfile=e=>{const{microphoneId:t}=e;t!==this.microphoneId&&(this.microphoneId=t,this.isTalking&&(this.stopTalk(),setTimeout((()=>{this.ttsTalk.startTalk(Cr({},this.talkOptions,{customizeStream:this._customizeStream.bind(this),audio:!this.microphoneId||{deviceId:this.microphoneId}})),this.isTalking=!0}),300)))},this.options=Object.assign({},wr,e||{}),this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null,this.eventEmitter=new Ar,this.ttsTalk=new br({eventEmitter:this.eventEmitter}),this.isTalking=!1;const t=document.createElement("div");t.id="audioleft";const n=document.createElement("audio");n.id="myaudio",n.muted=!0,n.setAttribute("autoplay","true"),n.setAttribute("controls","true"),t.appendChild(n),t.style.display="none";const i=document.createElement("div");i.id="audioright",i.style.display="none";const r=document.createElement("audio");r.id="peeraudio",r.setAttribute("autoplay","true"),r.setAttribute("controls","true"),i.appendChild(r),this.talkOptions={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:this.options.deviceSerial,channelNo:this.options.channelNo},this.audioLeft=t,this.audioRight=i,document.body.appendChild(t),document.body.appendChild(i)}}kr.VERSION="0.0.2";const Pr=()=>{var e=window.navigator.userAgent.toLowerCase(),t=(/version.*safari/.test(e),/chrome/.test(e));/gecko/.test(e)&&/webkit/.test(e);if(pr())return!1;if(t){function n(){for(var e=window.navigator.userAgent.split(" "),t="",n=0;n<e.length;n++)/chrome/i.test(e[n])&&(t=e[n]);return!!t&&Number(t.split("/")[1].split(".")[0])}return n()>91&&!!window.SharedArrayBuffer}return!1},Dr=e=>{if(e&&e.retcode)return String(e.retcode);if(e&&e.code){return`1${String(e.code).padStart(5,"0")}`}if(e&&e.errorCode){return`39${String(e.errorCode).padStart(4,"0")}`}return"400001"};function Lr(){var e,t={},n=navigator.userAgent.toLowerCase();if((e=n.match(/rv:([\d.]+)\) like gecko/))||(e=n.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=n.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=n.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=n.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=n.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=n.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){let e=t.chrome,n=e.indexOf(".");return Number(e.substring(0,n))}return-1}function zr(e){return Lr()>=94}function xr(e){if(Lr()>=107){let e={codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"};window.VideoDecoder&&VideoDecoder.isConfigSupported(e).then((e=>{e.supported}))}}const Or="https://open.ys7.com",Ir="ezuikit_addressList",Rr="ezuikit_reloadAddressList",Mr={loggerOptions:{level:"INFO",showTime:!0,name:"ezuikit"},autoplay:!0,env:{domain:Or},host:Or.replace("https://",""),streamInfoCBType:1,videoLevelList:null},Nr=[16,8,4,2,1,.5],$r=[{videoLevel:1,streamTypeIn:1,type:"compatible"},{videoLevel:2,streamTypeIn:1,type:"compatible"}],Fr={auto:"VIDEO_LEVEL_AUTO",0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_STANDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SUPER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},jr={init:"init",decoderLoad:"decoderLoad",decoderLoaded:"decoderLoaded",firstFrameDisplay:"firstFrameDisplay",streamInfoCB:"streamInfoCB",videoInfo:"videoInfo",audioInfo:"audioInfo",play:"play",stop:"stop",changeVideoLevel:"changeVideoLevel",reSetTheme:"reSetTheme",changePlayUrl:"changePlayUrl",getOSDTime:"getOSDTime",capturePicture:"capturePicture",startSave:"startSave",stopSave:"stopSave",openSound:"openSound",closeSound:"closeSound",enable3DZoom:"enable3DZoom",close3DZoom:"close3DZoom",changeZoomType:"changeZoomType",setPoster:"setPoster",resize:"resize",fast:"fast",slow:"slow",speedChange:"speedChange",seek:"seek",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen",fullscreenChange:"fullscreenChange",destroy:"destroy",getDeviceCapacity:"getDeviceCapacity",pause:"pause",resume:"resume",getVideoLevelList:"getVideoLevelList",setVideoLevelList:"setVideoLevelList",currentVideoLevel:"currentVideoLevel",autoVideoLevel:"autoVideoLevel",getVideoLevel:"getVideoLevel",getPtzStatus:"getPtzStatus",getPlayRate:"getPlayRate",setMirrorFlip:"setMirrorFlip",setFECCorrectType:"setFECCorrectType",setFEC3DViewParam:"setFEC3DViewParam",getFEC3DViewParam:"getFEC3DViewParam",setWaterMarkFont:"setWaterMarkFont",talkVolumeChange:"talkVolumeChange",startTalk:"startTalk",stopTalk:"stopTalk",talkSuccess:"talkSuccess",talkError:"talkError",recTypeChange:"recTypeChange",recTimeChange:"recTimeChange",setLoggerOptions:"setLoggerOptions",setDisplayRegion:"setDisplayRegion",setAllDayRecTimes:"setAllDayRecTimes",setRecTimes:"setRecTimes",changeTheme:"changeTheme",date:{openDatePanel:"openDatePanel",closeDatePanel:"closeDatePanel",recStartTimeChange:"recStartTimeChange"},ptz:{openPtz:"openPtz",closePtz:"closePtz",ptzDirection:"ptzDirection",ptzSpeedChange:"ptzSpeedChange",ptzBtnClick:"ptzBtnClick"},zoom:{startZoom:"startZoom",closeZoom:"closeZoom",onZoomChange:"onZoomChange",openZoom:"openZoom",closeZoom:"closeZoom"},timeLine:{timeWidthChange:"timeWidthChange"},http:{getCloudRecordTimes:"getCloudRecordTimes",getLocalRecTimes:"getLocalRecTimes",getCloudRecTimes:"getCloudRecTimes",getDeviceInfo:"getDeviceInfo",getDeviceList:"getDeviceList",setVideoLevel:"setVideoLevel",getDeviceSupportQuality:"getDeviceSupportQuality",getStreamAddressList:"getStreamAddressList"}};class Ur{static formate(e,t,n=0){let i=e;"string"==typeof e?i=Ur.strToDate(e):"number"==typeof e&&(i=new Date(e)),i=new Date(i.getTime()-3600*n*1e3);const r=i.getFullYear(),o=String(i.getMonth()+1).padStart(2,"0"),a=String(i.getDate()).padStart(2,"0"),s=String(i.getHours()).padStart(2,"0"),l=String(i.getMinutes()).padStart(2,"0"),c=String(i.getSeconds()).padStart(2,"0");switch(t){case"YYYY-MM-DD hh:mm:ss":return`${r}-${o}-${a} ${s}:${l}:${c}`;case"YYYYMMDDhhmmss":return`${r}${o}${a}${s}${l}${c}`;case"YYYY/MM/DD hh:mm:ss":return`${r}/${o}/${a} ${s}:${l}:${c}`;case"YYYYMMDDThhmmssZ":return`${r}${o}${a}T${s}${l}${c}Z`;case"YYYY/MM/DD":return`${r}/${o}/${a}`;case"YYYYMMDD":return`${r}${o}${a}`;case"YYYY-MM-DD":return`${r}-${o}-${a}`;case"YYYY":return`${r}`;case"MM":return`${o}`;case"DD":return`${a}`;case"hh:mm:ss":return`${s}:${l}:${c}`;case"hh":return`${s}`;case"mm":return`${l}`;case"ss":return`${c}`;default:throw new Error("Unsupported format type")}}static diff(e,t,n){let i=e;"string"==typeof e?i=Ur.strToDate(e):"number"==typeof e&&(i=new Date(e));let r=t;"string"==typeof t?i=Ur.strToDate(t):"number"==typeof t&&(i=new Date(t));const o=i.getTime()-r.getTime();switch(n){case"year":return i.getFullYear()-r.getFullYear();case"month":let e=12*(i.getFullYear()-r.getFullYear())+(i.getMonth()-r.getMonth());return i.getDate()<r.getDate()&&e--,e;case"day":return o/60/60/24;case"hour":return o/60/60;case"minute":return o/60;case"second":return o;default:throw new Error("Unsupported diff type")}}static now(){return Date.now()}static strToDate(e){const t=(e+"").replace(/-/gi,"").replace(/:/gi,"").replace(/\//gi,"").replace(/ /gi,"").replace(/T|Z/gi,"");if(10===(e+"").length)return new Date(1e3*+e);if(13===(e+"").length)return new Date(+e);var n=t.slice(0,4),i=t.slice(4,6),r=t.slice(6,8),o=t.slice(8,10),a=t.slice(10,12),s=t.slice(12,14);return new Date(n+"/"+i+"/"+r+" "+o+":"+a+":"+s)}static padStart(e){return e<10?"0"+e:e+""}}function Br(){return Br=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Br.apply(this,arguments)}function Vr(e,t=0){return(e||[]).map((e=>Br({},e,{startTime:e.startTime-3600*(t||0),endTime:e.endTime-3600*(t||0)}))).sort(((e,t)=>e.startTime-t.startTime))}function Yr(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Zr(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){Yr(o,i,r,a,s,"next",e)}function s(e){Yr(o,i,r,a,s,"throw",e)}a(void 0)}))}}function Hr(){return Hr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Hr.apply(this,arguments)}const Gr="/api/service/appKey/get",Qr="/api/lapp/device/info",Kr="/api/service/media/stream/server/info?version=2.0&protocol=4",Wr="/api/lapp/device/capacity",Jr="/api/v3/device/setVideoLevel",qr="/api/lapp/live/url/ezopen",Xr="/api/service/cloudrecord/video/info/list",eo="/api/lapp/video/by/time",to="/api/v3/device/local/video/unify/query",no="/api/lapp/device/ptz/mirror",io="/api/service/device/capacity/video/quality";class ro{updateOptions(t){this._options=e(this._options,t,{clone:!1}),this._options.baseURL||(this._options.baseURL=Or),this._options.baseURL=this._options.baseURL.replace(/\/$/,"")}_fetch(e,t={}){var n=this;return Zr((function*(){const i=/http[s]?:\/\//.test(e)?e:`${n._options.baseURL}${e}`,r=new AbortController,o=r.signal;n.controllers.push(r);const a=null===(null==t?void 0:t.headers)?{}:Hr({clientType:"ezuikit"},n._options.accessToken?{accessToken:n._options.accessToken}:{},{deviceSerial:n._options.deviceSerial,localIndex:n._options.channelNo},(null==t?void 0:t.headers)||{}),s=Hr({},t||{},{headers:Hr({},a),signal:o});return"base"!==n._options.sdkType&&(delete s.headers,delete s.signal),fetch(i,s).finally((()=>{const e=n.controllers.findIndex((e=>e===r));e>-1&&n.controllers.splice(e,1)}))}))()}get(e,t={}){return this._fetch(e,Hr({},t||{},{method:"get"}))}post(e,t={}){return this._fetch(e,Hr({},t||{},{method:"post"}))}put(e,t={}){return this._fetch(e,Hr({},t||{},{method:"put"}))}delete(e,t={}){return this._fetch(e,Hr({},t||{},{method:"delete"}))}getAppKey(){var e=this;return Zr((function*(){var t,n;return"custom"===e._options.sdkType?new Promise((e=>{e({meta:{code:200,message:"操作成功",moreInfo:{}},data:{appKey:"ezuikit-custom"}})})):e.get(`${Gr}?checkToken=${e._options.accessToken||(null==(n=e._options.token)||null==(t=n.deviceToken)?void 0:t.video)}&sn=${e._options.deviceSerial}&cno=${e._options.channelNo}`,{headers:null}).then((e=>e.json())).catch((()=>""))}))()}getDeviceInfo(){var e=this;return Zr((function*(){var t,n;const i=new FormData;return i.append("accessToken",e._options.accessToken||(null==(n=e._options.token)||null==(t=n.deviceToken)?void 0:t.global)||""),i.append("deviceSerial",e._options.deviceSerial),e.post(Qr,{body:i,headers:null}).then((e=>e.json())).then((e=>200==+e.code?e.data:{}))}))()}getDeviceCapacity(){var e=this;return Zr((function*(){var t,n;let i=new FormData;return i.append("accessToken",e._options.accessToken||(null==(n=e._options.token)||null==(t=n.deviceToken)?void 0:t.video)||""),i.append("deviceSerial",e._options.deviceSerial),e.post(Wr,{body:i,headers:null}).then((e=>e.json())).then((e=>200==+e.code?e.data:{})).catch((()=>({})))}))()}getStreamAddressList(){var e=this;return Zr((function*(){var t,n;return"custom"===e._options.sdkType?new Promise((e=>{e([0,{domain:"",port:0,backups:[]}])})):e.get(Kr,{headers:{accessToken:e._options.accessToken||(null==(n=e._options.token)||null==(t=n.deviceToken)?void 0:t.video)}}).then((e=>e.json())).then((t=>{if(t.meta&&200==t.meta.code){var n;let r={};try{r=JSON.parse(localStorage.getItem(Ir)||"{}")}catch(e){}let o=t=>{const n=e._options.deviceSerial+"_"+e._options.channelNo,i=new Date;r[n]=[{domain:t.domain?t.domain:t.addr?t.addr:"",port:t.port,expire:new Date(i.setHours(i.getHours()+12)).Format("yyyyMMddThhmmssZ")}],Array.isArray(t.backups)&&t.backups.map((e=>{r[n].push({domain:e.domain?e.domain:e.addr?e.addr:"",port:e.port,expire:new Date(i.setHours(i.getHours()+12)).Format("yyyyMMddThhmmssZ")})}));try{window.localStorage.setItem(Ir,JSON.stringify(r))}catch(e){}},a=(e,t)=>{if(e.length!==t.length)return!1;let n=[...e].sort(((e,t)=>e.domain>t.domain?1:-1)),i=[...t].sort(((e,t)=>e.domain>t.domain?1:-1));for(let e=0;e<n.length;e++)if(n[e].domain!==i[e].domain)return!1;return!0};if(t.data&&Array.isArray(r[e._options.deviceSerial+"_"+e._options.channelNo])){let n=Array.isArray(t.data.backups)?[...t.data.backups]:[];var i;if(n.push({domain:t.data.domain,port:t.data.port}),a(r[e._options.deviceSerial+"_"+e._options.channelNo],n))(null==(i=r[e._options.deviceSerial+"_"+e._options.channelNo][0])?void 0:i.expire)<=(new Date).Format("yyyyMMddThhmmssZ")&&o(t.data);else o(t.data)}return o=null,a=null,[(null==(n=r[e._options.deviceSerial+"_"+e._options.channelNo])?void 0:n.length)||0,t.data]}return[0,{}]}))}))()}getDeviceSupportQuality(e={}){var t=this;return Zr((function*(){var n,i;const r=e.accessToken||t._options.accessToken||(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.video),o=e.channelNo||t._options.channelNo;let a=[];return t.get(io+`?accessToken=${r}&deviceSerial=${t._options.deviceSerial}&channelNo=${o}`,{headers:null}).then((e=>e.json())).then((e=>((e.meta&&200===e.meta.code&&e.data&&e.data.length>0?e.data:$r).map((e=>{e.videoLevel>6||e.videoLevel<0||a.push({name:Fr[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:e.type})})),a.sort(((e,t)=>e.level>t.level?1:-1))))).catch((()=>($r.map((e=>{a.push({name:Fr[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:"compatible"})})),a)))}))()}getDeviceList(e={}){var t=this;return Zr((function*(){var n,i;const r=e.accessToken||t._options.accessToken||(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.video),o=e.deviceSerial||t._options.deviceSerial;return t.post(`/api/lapp/device/camera/list?accessToken=${r}&deviceSerial=${o}`).then((e=>e.json())).then((e=>200==+(null==e?void 0:e.code)?e.data:[])).catch((()=>[]))}))()}setVideoLevel(e){var t=this;return Zr((function*(){var n,i,r,o;const a=new FormData;return a.append("videoLevel",e+""),"custom"===t._options.sdkType&&(a.append("accessToken",t._options.accessToken),a.append("deviceSerial",t._options.deviceSerial),a.append("localIndex",t._options.channelNo+"")),+e<0?{}:t.post(`${Jr}?accessToken=${t._options.accessToken||(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.video)}`,{headers:{accessToken:t._options.accessToken||(null==(o=t._options.token)||null==(r=o.deviceToken)?void 0:r.video)},body:a}).then((e=>e.json())).then((e=>e))}))()}getEzopenUrl(e){var t=this;return Zr((function*(){var n,i,r,o,a;let s=new FormData;if(s.append("isFlv","false"),s.append("userAgent",(null==(i=window)||null==(n=i.navigator)?void 0:n.userAgent)||""),s.append("isHttp","false"),s.append("needStreamToken",(null==(r=t._options)?void 0:r.accessToken)?"1":"0"),s.append("accessToken",t._options.accessToken||(null==(a=t._options.token)||null==(o=a.deviceToken)?void 0:o.video)||""),s.append("ezopen",e),t._options.ezopenParams&&"[object Object]"===Object.prototype.toString.call(t._options.ezopenParams))for(var l in t._options.ezopenParams)s.append(l,t._options.ezopenParams[l]);return t.post(qr,{body:s,headers:{sdkVersion:"8.2.2"}}).then((e=>e.json())).then((n=>{if(200==+(null==n?void 0:n.code)||0==n.retcode){var i,r,o;let s="",l="";const c=null==(o=t._options)||null==(r=o.token)||null==(i=r.streamToken)?void 0:i[n.data.indexOf("live")>-1||n.data.indexOf("cloud")>-1?"live":"rec"];if(n.ext&&n.ext.token)s+=n.data,l=t._options.accessToken?n.ext.token:c;else if(n.data){var a;if("string"==typeof n.data&&c)s+=n.data,l=c;else s+=(null==(a=n.data)?void 0:a.url)||"",l=t._options.accessToken?n.data.token:c}if(s="live"===(-1!==e.indexOf("live")?"live":"playback")?s+"&ssn="+(l||"")+"&auth=1&biz=4&cln=100":s+"&ssn="+(l||"")+"&auth=1&cln=100",t._options.wsParams&&"[object Object]"===Object.prototype.toString.call(t._options.wsParams))for(const e in t._options.wsParams)s+="&"+e+"="+t._options.wsParams[e]||"";return s.replace(/&&/gi,"&")}return n})).catch((()=>""))}))()}getCloudRecordTimes(e){var t=this;return Zr((function*(){var n,i;const r={startTime:e.begin?Ur.formate(e.begin,"YYYY-MM-DD hh:mm:ss"):void 0,endTime:e.end?Ur.formate(e.end,"YYYY-MM-DD hh:mm:ss"):void 0,spaceId:e.spaceId||void 0},o=Object.keys(r).reduce(((e,t)=>null==r[t]?e:e+=`&${t}=${encodeURIComponent(r[t])}`),"").replace("&","");return t.get(Xr+`?${o}`,{headers:{accessToken:(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.global)||t._options.accessToken}}).then((e=>e.json())).then((t=>{var n;if(200==+(null==t||null==(n=t.meta)?void 0:n.code)){const n=Vr((t.data||[]).map((e=>(e.endTime=parseInt(Ur.strToDate(e.stopTime).getTime()/1e3+"",10),e.startTime=parseInt(Ur.strToDate(e.startTime).getTime()/1e3+"",10),e.busType=7,e.iStorageVersion=e.istorageVersion,e))));return n.length>0&&(n[0].startTime<parseInt(Ur.strToDate(Ur.formate(e.begin,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10)&&(n[0].startTime=parseInt(Ur.strToDate(Ur.formate(e.begin,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10)),n[n.length-1].endTime>parseInt(Ur.strToDate(Ur.formate(e.end,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10)&&(n[n.length-1].endTime=parseInt(Ur.strToDate(Ur.formate(e.end,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10))),n}return[]})).catch((()=>[]))}))()}getCloudTimes(e){var t=this;return Zr((function*(){var n,i;const r=new FormData;r.append("recType",e.url&&-1===e.url.indexOf(".cloud")?"2":"1"),r.append("version","2.0"),r.append("deviceSerial",t._options.deviceSerial),r.append("channelNo",t._options.channelNo+""),r.append("accessToken",t._options.accessToken||(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.video)||""),e.begin&&r.append("startTime",Ur.strToDate(e.begin+"").getTime()+""),e.end&&r.append("endTime",Ur.strToDate(e.end+"").getTime()+"");let o=[];const a=Zr((function*(e){try{yield t.post(`${eo}`,{headers:null,body:e}).then((e=>e.json())).then(Zr((function*(t){if(200==+t.code&&t.data){var n,i,r,s,l;let d=[];if(Array.isArray(t.data))d=t.data;else if((null==(n=t.data)?void 0:n.files)&&(null==(r=t.data)||null==(i=r.files)?void 0:i.length)>0){var c;d=(null==(c=t.data)?void 0:c.files)||[]}if(o=o.concat(d),!(null==(s=t.data)?void 0:s.isAll)&&(null==(l=t.data)?void 0:l.nextFileTime))return e.append("startTime",t.data.nextFileTime),yield a(e)}})))}catch(e){}}));yield a(r),o=o.map((e=>Hr({},e,{endTime:parseInt(e.endTime/1e3+"",10),startTime:parseInt(e.startTime/1e3+"",10)})));const s=Vr(o,t._options.timeZone||0);return s.length>0&&(s[0].startTime<parseInt(Ur.strToDate(e.begin+"").getTime()/1e3+"",10)&&(s[0].startTime=parseInt(Ur.strToDate(e.begin+"").getTime()/1e3+"",10)),s[s.length-1].endTime>parseInt(Ur.strToDate(e.end+"").getTime()/1e3+"",10)&&(s[s.length-1].endTime=parseInt(Ur.strToDate(e.end+"").getTime()/1e3+"",10))),s}))()}getLocalRecTimes(e){var t=this;return Zr((function*(){if("custom"===t._options.sdkType){var n,i;const r=new FormData;r.append("recType","2"),r.append("version","2.0"),r.append("deviceSerial",t._options.deviceSerial),r.append("channelNo",t._options.channelNo+""),r.append("accessToken",t._options.accessToken||(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.video)||""),e.begin&&r.append("startTime",Ur.strToDate(e.begin+"").getTime()+""),e.end&&r.append("endTime",Ur.strToDate(e.end+"").getTime()+"");let o=[];const a=Zr((function*(e){try{yield t.post(`${eo}`,{body:e}).then((e=>e.json())).then(Zr((function*(t){if(200==+t.code&&t.data){var n,i,r,s,l;let d=[];if(Array.isArray(t.data))d=t.data;else if((null==(n=t.data)?void 0:n.files)&&(null==(r=t.data)||null==(i=r.files)?void 0:i.length)>0){var c;d=(null==(c=t.data)?void 0:c.files)||[]}if(o=o.concat(d),!(null==(s=t.data)?void 0:s.isAll)&&(null==(l=t.data)?void 0:l.nextFileTime))return e.append("startTime",t.data.nextFileTime),yield a(e)}})))}catch(e){}}));yield a(r),o=o.map((e=>Hr({},e,{endTime:parseInt(e.endTime/1e3+"",10),startTime:parseInt(e.startTime/1e3+"",10)})));const s=Vr(o||[],t._options.timeZone||0);return s.length>0&&(s[0].startTime<parseInt(Ur.strToDate(e.begin+"").getTime()/1e3+"",10)&&(s[0].startTime=parseInt(Ur.strToDate(e.begin+"").getTime()/1e3+"",10)),s[s.length-1].endTime>parseInt(Ur.strToDate(e.end+"").getTime()/1e3+"",10)&&(s[s.length-1].endTime=parseInt(Ur.strToDate(e.end+"").getTime()/1e3+"",10))),s}{const n=parseInt(Ur.strToDate(e.begin+"").getTime()/1e3+"",10),i=parseInt(Ur.strToDate(e.end+"").getTime()/1e3+"",10),r=Zr((function*(e){let n=[];try{var i,o,a,s,l,c;const u=yield t.get(`${to}?startTime=${e.startTime}&endTime=${e.endTime}&pageSize=${e.pageSize||200}`,{headers:{accessToken:t._options.accessToken||(null==(o=t._options.token)||null==(i=o.deviceToken)?void 0:i.video),deviceSerial:t._options.deviceSerial}}).then((e=>e.json()));if(200!=+(null==u||null==(a=u.meta)?void 0:a.code))return n;var d;if((null==u||null==(l=u.data)||null==(s=l.records)?void 0:s.length)&&(n=n.concat(u.data.records||[])),null==u||null==(c=u.data)?void 0:c.hasMore)n=n.concat(yield r(Hr({},e,{startTime:null==u||null==(d=u.data)?void 0:d.nextFileTime})))}catch(e){}return n})),o=Vr((yield r({startTime:n,endTime:i}))||[]||[],t._options.timeZone||0);return o.length>0&&(o[0].startTime<n&&(o[0].startTime=n),o[o.length-1].endTime>i&&(o[o.length-1].endTime=i)),o}}))()}postDevicePtzMirror(e){var t=this;return Zr((function*(){var n,i;const r=new FormData;r.append("command",e+""),r.append("accessToken",t._options.accessToken||(null==(i=t._options.token)||null==(n=i.deviceToken)?void 0:n.video)||""),r.append("deviceSerial",t._options.deviceSerial),r.append("channelNo",t._options.channelNo+""),t.post(no,{body:r})}))()}abort(){this.controllers.length>0&&(this.controllers.forEach((e=>{e.abort("abort fetch")})),this.controllers=[])}destroy(){this.abort()}constructor(t){this.controllers=[],this._options=e({baseURL:Or},t,{clone:!1}),this._options.baseURL||(this._options.baseURL=Or),this._options.baseURL=this._options.baseURL.replace(/\/$/,"")}}function oo(){return oo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},oo.apply(this,arguments)}const ao=[{id:"zh",env:"https://open.ys7.com",logHost:"https://log.ys7.com/statistics.do/opensdk_ezuikit"},{id:"us",env:"https://iusopen.ezvizlife.com",logHost:"https://uslog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"eu",env:"https://ieuopen.ezvizlife.com",logHost:"https://eulog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"sa",env:"https://isaopen.ezvizlife.com",logHost:"https://salog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"sgp",env:"https://isgpopen.ezvizlife.com",logHost:"https://sgplog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"rus",env:"https://irusopen.ezvizlife.com",logHost:"https://ruslog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"india",env:"https://iindiaopen.ezvizlife.com",logHost:"https://indialog.ezvizlife.com/statistics.do/opensdk_ezuikit"}];class so{changeUrl(e){var t,n;null==(n=this.collect)||null==(t=n.changeUrl)||t.call(n,this.getCollectUrl(e))}getCollectUrl(e){const t=ao.findIndex((t=>t.env===e));return t>-1?ao[t].logHost:""}report(e,t){var n;this.monitorReport&&(null==(n=this.collect)||n.send(oo({action:e,appKey:this.appKey},t,{logInfo:oo({pluginVersion:this.pluginVersion},t.logInfo||{})})))}updateParams(e){var t;null==(t=this.collect)||t.updateExtendsInfo(e)}updateAppKey(e){this.appKey=e}setForbidden(e){var t;null==(t=this.collect)||t.setForbidden(e)}constructor(e){this.collect=null,this.appKey="",this.monitorReport=!0,this.pluginVersion="";const t=this.getCollectUrl(e.domain);this.pluginVersion=e.pluginVersion,t&&(this.monitorReport=e.monitorReport,this.collect=new d(oo({},e,{url:t})))}}function lo(e,t,n=0,i){let r=e,o=t;return e&&14===e.length&&t&&14===t.length?(Ur.formate(e,"YYYYMMDD")!==Ur.formate(t,"YYYYMMDD")&&(o=e.slice(0,8)+"235959"),t=(e=e.slice(0,8)+"000000").slice(0,8)+"235959"):e&&14===e.length?(t=(e=e.slice(0,8)+"000000").slice(0,8)+"235959",o=e.slice(0,8)+"235959"):t&&14===t.length?(e=t.slice(0,8)+"000000",t=t.slice(0,8)+"235959",r=e):(r=e=Ur.formate(new Date,"YYYYMMDD")+"000000",o=t=Ur.formate(new Date,"YYYYMMDD")+"235959"),([void 0,"",null].includes(n)||(n=parseInt(n))>=24||n<=-24||isNaN(n))&&(n=0),7==+i?{begin:e,end:t,timeZone:n,originBegin:r,originEnd:o}:{begin:e=Ur.formate(Ur.strToDate(e).getTime()+60*n*60*1e3,"YYYYMMDDhhmmss"),end:t=Ur.formate(Ur.strToDate(t).getTime()+60*n*60*1e3,"YYYYMMDDhhmmss"),timeZone:n,originBegin:r,originEnd:o}}function co(){return co=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},co.apply(this,arguments)}function uo(e){return"string"!=typeof e&&"number"!=typeof e||!/\d/.test(e+"")||10!==(e+"").length?e:1e3*e}function po(e,t=[],n,i){function r(e){const n={};return t.forEach((t=>{n[t]=e[t]})),n.istorageVersion&&(n.iStorageVersion=n.istorageVersion,delete n.istorageVersion),n}const o=Ur.strToDate(n).getTime(),a=Ur.strToDate(i).getTime();return(e=[...e].map((e=>co({},e,{startTime:uo(e.startTime),endTime:uo(e.endTime)}))).filter((e=>e.startTime>=o&&e.endTime<=a||(e.startTime<o&&e.endTime>o||(e.startTime<a&&e.endTime>a||void 0))))).length>0&&(e[0].startTime=o,e[e.length-1].endTime=a),e.reduce(((e,t,n)=>0===n?(e.push(r(t)),e):(e[e.length-1].downloadPath===t.downloadPath?e[e.length-1].endTime=t.endTime:e.push(r(t)),e)),[])}const ho=(e,t)=>{var n,i;const r=`${e.env.domain}/api/v3/device/setVideoLevel?accessToken=${e.accessToken||e.token.deviceToken.video} `,o=new FormData;return o.append("videoLevel",parseInt(t+"")),null==(i=e.logger)||null==(n=i.log)||n.call(i,"[https request] setVideoLevel()","videoLevel",t),t<0?Promise.resolve({}):fetch(r,{method:"POST",headers:{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:e.deviceSerial,localIndex:e.channelNo},body:o}).then((e=>e.json())).then((t=>(null==e.emit||e.emit.call(e,jr.http.setVideoLevel,t),t)))};let mo=Or;class Ao{setDomain(e){mo=e||mo}fetch(e,t){return e="string"==typeof e?/^http/.test(e)?e:mo+e:e,new Promise(((n,i)=>{fetch(e,t).then((e=>{try{return e.json()}catch(e){i({code:-1,msg:"data json parse error"})}})).then((e=>{200==+e.code||e.meta&&200===e.meta.code?n(e):i(e)})).catch((e=>{i(e)}))}))}constructor(e){return Ao.instant?Ao.instant:(mo=e||mo,Ao.instant=this)}}function fo(){return fo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},fo.apply(this,arguments)}class vo{getState(){return this.state}setState(e){this.state=fo({},this.state,e)}constructor(e,t={rejection:!1,play:!1,pantile:!1,recordvideo:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}){this.id=e,this.state=t}}function go(){return go=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},go.apply(this,arguments)}const yo=new class{getGlobalState(){return this.globalState}setGlobalState(e){this.globalState=go({},this.globalState,e)}constructor(){this.createInstance=(e,t={})=>{this.instances.has(e)&&this.removeInstance(e);const n=new vo(e,t);this.instances.set(e,n)},this.getInstance=e=>this.instances.has(e)?this.instances.get(e):null,this.removeInstance=e=>{if(!this.instances.has(e))return null;this.instances.delete(e)},this.listInstances=()=>Array.from(this.instances.values()),this.instances=new Map,this.globalState={talk:!1,expend:!1,webExpend:!1,sound:!1,audioOnly:!1}}};function To(e){const t=document.getElementById(`${e}-player`);t&&t.remove()}function _o(e){const t=[{max:400,label:"360P"},{max:520,label:"480P"},{max:900,label:"720P"},{max:1200,label:"1080P"},{max:1600,label:"2K"},{max:2400,label:"4K"},{max:4500,label:"8K"}];for(const n of t)if(e<=n.max)return n.label}function bo(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Co(){return Co=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Co.apply(this,arguments)}function So(){var e;return e=function*(e){let t={},n="";var i;return"rec"===e.urlInfo.type&&(t=lo(e.urlInfo.searchParams.begin,e.urlInfo.searchParams.end,null==(i=e.urlInfo.searchParams)?void 0:i.timeZone,e.urlInfo.searchParams.busType),e.timeZone=t.timeZone,n="&begin="+Ur.formate(t.originBegin,"YYYYMMDDThhmmssZ")+"&end="+Ur.formate(t.originEnd,"YYYYMMDDThhmmssZ")+"&timeZone="+t.timeZone),-1!==e.url.indexOf(".cloud")&&"7"===e.urlInfo.searchParams.busType?yield e._services.getCloudRecordTimes({begin:t.begin,end:t.end,spaceId:e._spaceId}).then((i=>{if(e.cloudRecordRecList=i||[],null==e.emit||e.emit.call(e,jr.http.getCloudRecordTimes,i||[]),null==e.emit||e.emit.call(e,jr.setAllDayRecTimes,{type:"cloudRecordTimes",list:i||[]}),e.recordList=i||[],i.length){const r=po(i,["downloadPath","ownerId","iStorageVersion","spaceId","startTime","endTime","videoType","busType"],t.originBegin,t.originEnd);if(null==e.emit||e.emit.call(e,jr.setRecTimes,i),0===r.length)return"";const o=JSON.stringify(r).replace("\\","");return n+"&recSlice="+o.replace("\\","")+"&r="+Math.random()}return null==e.emit||e.emit.call(e,jr.setRecTimes,[]),""})):-1!==e.url.indexOf(".cloud")&&"7"!==e.urlInfo.searchParams.busType||"base"!==e.sdkType?yield e._services.getCloudTimes({begin:t.begin,end:t.end,url:e.url}).then((i=>{if(e.cloudRecList=i||[],null==e.emit||e.emit.call(e,jr.http.getCloudRecTimes,i||[]),null==e.emit||e.emit.call(e,jr.setAllDayRecTimes,{type:"cloudRecTimes",list:i}),e.recordList=i||[],i.length){const r=po(i,["downloadPath","ownerId","iStorageVersion","startTime","endTime","videoType"],t.originBegin,t.originEnd);if(null==e.emit||e.emit.call(e,jr.setRecTimes,r),0===r.length)return"";const o=JSON.stringify(r.map((t=>{var n,i;return Co({},t,{startTime:t.startTime+3600*((null==(n=e.urlInfo.searchParams)?void 0:n.timeZone)||0)*1e3,endTime:t.endTime+3600*((null==(i=e.urlInfo.searchParams)?void 0:i.timeZone)||0)*1e3})}))).replace("\\","");return n+"&recSlice="+o.replace("\\","")+"&r="+Math.random()}return null==e.emit||e.emit.call(e,jr.setRecTimes,[]),""})):-1!==e.url.indexOf(".rec")?(e._services.getLocalRecTimes({begin:t.begin,end:t.end}).then((t=>{e.localRecList=t,null==e.emit||e.emit.call(e,jr.http.getLocalRecTimes,t||[]),null==e.emit||e.emit.call(e,jr.setAllDayRecTimes,{type:"localTimes",list:t||[]}),e.recordList=t||[],null==e.emit||e.emit.call(e,jr.setRecTimes,t||[])})),n):void 0},So=function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){bo(o,i,r,a,s,"next",e)}function s(e){bo(o,i,r,a,s,"throw",e)}a(void 0)}))},So.apply(this,arguments)}function Eo(e){var t,n;return e.url.indexOf(".live")>-1?(null==(n=e.logger)||null==(t=n.log)||t.call(n,"[https request] _getDeviceSupportQualityServicesAndGetDeviceListServices()"),new Promise((t=>{const n=e.params.videoLevelList?Promise.resolve(e.params.videoLevelList):function(e){var t,n;return null==(n=e.logger)||null==(t=n.log)||t.call(n,"[https request] getDeviceSupportQuality()"),e._services.getDeviceSupportQuality().then((t=>(e.videoLevelList=t,e._setVideoLevelList(e.videoLevelList),null==e.emit||e.emit.call(e,jr.http.getDeviceSupportQuality,t),t)))}(e);Promise.all([n,e._services.getDeviceList()]).then((n=>{var i,r,o,a;null==(r=e.logger)||null==(i=r.log)||i.call(r,"[https request] getDeviceList()"),null==e.emit||e.emit.call(e,jr.http.getDeviceList,n[1]||[]);const s=n[1].find((t=>t.channelNo===+e.urlInfo.channelNo));s||t([[],[]]),e._setVideoLevelList(e.videoLevelList),null==e.emit||e.emit.call(e,jr.setVideoLevelList,n[0]||[]);let l={};l="compatible"===(null==(o=e.videoLevelList[0])?void 0:o.type)?e.url.indexOf(".hd.live")>0?e.videoLevelList[1]:e.videoLevelList[0]:e.videoLevelList.find((e=>e.level==(null==s?void 0:s.videoLevel)))||{},(null==l?void 0:l.streamTypeIn)?(e.videoLevel=l.level,e.streamTypeIn=l.streamTypeIn):(null==(a=e.videoLevelList)?void 0:a.length)>0?(e.videoLevel=e.videoLevelList[0].level,e.streamTypeIn=e.videoLevelList[0].streamTypeIn,l=e.videoLevelList[0]):e.logger.warn(`the current video quality(${null==s?void 0:s.videoLevel}) is not in the list!`),null==e.emit||e.emit.call(e,jr.currentVideoLevel,l,e.videoLevel),t(n)}))}))):Promise.resolve([[],[]])}function wo(e){var t;return null==(t=e.logger)||t.log("[https request] getStreamAddressList()"),e._services.getStreamAddressList().then((t=>{e.maxReloadTime=t[0],null==e.emit||e.emit.call(e,jr.http.getStreamAddressList,t[1])}))}function ko(){return ko=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ko.apply(this,arguments)}let Po=!1;function Do(e,t,n,i){const r=Date.now();return Po=!0,e.playing=!0,e.loading=!0,new Promise(((o,a)=>{var s,l;(null==(s=e.logger)||s.log("_pluginPlay()",JSON.stringify(t)),t)||(null==(l=e.logger)||l.error("play address error"),a({code:-1,msg:"play address error"}));e.wsUrl=t,e._recOSDTimer&&(clearInterval(e._recOSDTimer),e._recOSDTimer=null),e._seekIntervaltimer&&(clearInterval(e._seekIntervaltimer),e._seekIntervaltimer=null);const c=t.split("?")[0].replace("/live","").replace("/playback","");let d=(-1===t.indexOf("/live")?-1!==t.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+t.split("?")[1];d=(d.replace(/&stream=\d/,"")+"&stream="+(["/cloudplayback?","/playback?"].includes(d)?1:e.streamTypeIn||1)).replace(/&&/gi,"&");const u={playURL:d};if(e._gotWsUrlTime=(new Date).getTime(),e.isStoping=!1,e.jSPlugin){var p,h;if(null==e.logger.log||e.logger.log.call(e.logger,"JS_Play()"),null==(p=e.urlInfo)?void 0:p.validateCode)null==(h=e.jSPlugin)||h.JS_SetSecretKey(0,e.urlInfo.validateCode);e.jSPlugin.JS_Play(c,u,0).then((()=>{if(e.isStoping&&o({code:1,msg:"playing is stopping"}),1===e.videoPlayState||4===e.videoPlayState){var t;e.videoPlayState=2;const o=Date.now();null==(t=e._collect)||t.report(2,{logInfo:{domain:c,loadTime:o-e.videoInitTime,loadTimeDesc:{initTime:e._initTime,stopTime:n,getWsTime:r-i,createWsTime:o-r}},loadTime:o-e.videoInitTime,initTime:e._initTime,getWsTime:r-i,createWsTime:o-r})}e.jSPlugin&&e._FECSplitIds&&e._FECCorrectType&&e.jSPlugin.JS_FECCorrectType(e._FECCorrectType,e._FECSplitIds),e.waterMark_JSPlugin&&e.setWaterMarkFont(e.waterMark_JSPlugin),o({code:0,wss:c,wsParams:u})})).catch((t=>{var n,i;let r=null==(n=e.i18n)?void 0:n.t("PLAY_FAILED"),o=-1;if(null==(i=e.jSPlugin)?void 0:i.bPlay)return!1;var s,l,c;(null==t?void 0:t.errorCode)&&(null==(l=e.Theme)||null==(s=l.setDisabled)||s.call(l,!0),r=null==(c=e.i18n)?void 0:c.t("39"+t.errorCode),o=t.errorCode);e.isCall,a({msg:r,code:o})}))}}))}function Lo(e,t,n=()=>{}){var r,o,a,s,l,c,d,u,p,h,m,A,f,v,g,y,T;e.playing=!0,e.loading=!0,null==(a=e.controls)||null==(o=a.zoomControl)||null==(r=o.setZoom)||r.call(o);const[_,b]=function(e,t,n,r){let o="",a=i(e);t.url&&/^ezopen:\/\//.test(t.url)&&(o=t.url,a=i(o));t.deviceSerial&&(a.deviceSerial=t.deviceSerial);t.channelNo&&(a.channelNo=t.channelNo);t.validCode&&(a.validateCode=t.validCode);t.host&&(a.hostname=t.host);const s=t.type||(a.recType?a.recType+"."+a.type:a.type);"live"===s?(a.type="live",!0===t.hd?a.definition="hd":!1===t.hd&&(a.definition="sd"),a.searchParams={},a.search=""):["rec","cloud.rec","miniRec"].includes(s)&&(a.recType="cloud.rec"===s?"cloud":"",a.type="rec",a.definition="",a.searchParams=a.searchParams||{},t.begin&&(a.searchParams.begin=t.begin),t.end&&(a.searchParams.end=t.end),"cloudRecord"===n&&"cloud"===a.recType&&(a.searchParams.busType="7",r&&(a.searchParams.spaceId=r)));return a.search=Object.entries(a.searchParams||{}).reduce(((e,[t,n])=>""===n?e:e+=`${t}=${encodeURIComponent(n)}&`),"?").replace(/&$/,""),o=`${a.protocol}//${a.validateCode?`${a.validateCode}@`:""}${a.hostname}/${a.deviceSerial}/${a.channelNo}${"rec"===a.type&&a.recType?"."+a.recType:""}${"live"===a.type&&"hd"===a.definition?"."+a.definition:""}.${a.type}${a.search}`,o=o.replace(/\?$/,""),a=i(o),[o,a]}(e.url,t,e.recType,e._spaceId);var C,S,E,w;((null==b?void 0:b.origin)===(null==(s=e.urlInfo)?void 0:s.origin)&&(null==b?void 0:b.pathname)===(null==(l=e.urlInfo)?void 0:l.pathname)&&Ur.formate((null==(c=b.searchParams)?void 0:c.begin)||new Date,"YYYYMMDD")===Ur.formate((null==(d=e.urlInfo.searchParams)?void 0:d.begin)||new Date,"YYYYMMDD")&&(null==(u=b.searchParams)?void 0:u.busType)===(null==(p=e.urlInfo.searchParams)?void 0:p.busType)&&(null==(h=b.searchParams)?void 0:h.spaceId)===(null==(m=e.urlInfo.searchParams)?void 0:m.spaceId)||e.emit(jr.setAllDayRecTimes,{type:"",list:[]}),e.url=_,e.host=null==b?void 0:b.hostname,e.deviceSerial=b.deviceSerial,e.channelNo=b.channelNo,e.accessToken=t.accessToken||e.accessToken,e.token=t.token||e.token,null==(A=e._services)||A.updateOptions({accessToken:e.accessToken,token:e.token,channelNo:e.channelNo,deviceSerial:e.deviceSerial}),null==(f=e.controls)?void 0:f.ptzControl)&&(null==(S=e.controls)||null==(C=S.ptzControl)||C.updateOptions({accessToken:e.accessToken,token:e.token,channelNo:e.channelNo,deviceSerial:e.deviceSerial}));e.Talk&&(null==(w=e.Talk)||null==(E=w.updateOptions)||E.call(w,{accessToken:e.accessToken,token:e.token,channelNo:e.channelNo,deviceSerial:e.deviceSerial}));if(null==(v=e.controls)?void 0:v.dateControl){var k,P,D;const t=(null==(k=b.searchParams)?void 0:k.begin)||new Date;null==(D=e.controls)||null==(P=D.dateControl)||P.setDate(new Date(Ur.formate(t,"YYYY-MM-DD hh:mm:ss")),!1)}if(b.deviceSerial!==e.urlInfo.deviceSerial||b.hostname!==e.urlInfo.hostname?(e._deviceSerialChangeServices(),"live"===b.type&&Eo(e)):b.channelNo!==e.urlInfo.channelNo&&(wo(e),"live"===b.type&&Eo(e)),e.videoInitTime=Date.now(),e.videoPlayState=4,t.url)try{let t=JSON.parse(localStorage.getItem(Ir)||"{}");t[e.deviceSerial+"_"+e.channelNo]||(t=ko({},t,{[e.deviceSerial+"_"+e.channelNo]:[]}),localStorage.setItem(Ir,JSON.stringify(t)))}catch(e){}e.urlInfo=b;const L="cloud"===b.recType?"cloud.rec":b.type;null==(g=e._collect)||g.updateParams({protocol:"ezopen",url:_,serial:e.deviceSerial,no:e.channelNo,env:e.env.domain,type:L});let z=Object.assign({},e.params);return null==(y=e._collect)||y.report(4,{logInfo:{type:L,params:z}}),(null==(T=e.jSPlugin)?void 0:T.player)&&(e.jSPlugin.player.playbackRate=1,e.jSPlugin.player._playbackRate=1,e.speed=1),n(),new Promise(((n,i)=>{const r={url:_};return t.token&&(r.token=t.token),t.accessToken&&(r.accessToken=t.accessToken),e.play(r).then((()=>{var t;const i=["url","deviceSerial","channelNo","accessToken","token"].reduce(((t,n)=>(t[n]=e[n],t)),{});null==e.emit||e.emit.call(e,jr.changePlayUrl,{eventType:jr.changePlayUrl,code:0,data:i,msg:null==(t=e.i18n)?void 0:t.t("CHANGE_PLAYURL_SUCCESS")}),n(_)})).catch((e=>{i(e)}))}))}function zo(e,t){let n=-1;var i,r;if(t===e.speed)return null==(i=e.logger)||i.warn("the speed value has not changed!"),0;t&&(Nr.includes(+t)?(e.jSPlugin.JS_Speed(t),n=1,e.speed=t):null==(r=e.logger)||r.warn("current speed is not supported!"));return n}function xo(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Oo(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){xo(o,i,r,a,s,"next",e)}function s(e){xo(o,i,r,a,s,"throw",e)}a(void 0)}))}}function Io(){return Io=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Io.apply(this,arguments)}function Ro(){return Ro=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ro.apply(this,arguments)}class Mo{upload(){this.onBeforeUpload(this.body);const e={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,e).then((e=>e.json())).then((e=>{this.onUploadComplete({body:this.body,response:e})})).catch((e=>{e.name})),e.body&&"FormData"==e.body.constructor.name&&"signal"in e&&e.signal.addEventListener("progress",(e=>{e.lengthComputable&&this.onUploadProgress(Ro({},this.body,{progress:e.loaded/e.total}))}))}cancel(){this.controller.abort()}constructor(e){this.url=e.url||"",this.method=e.method||"POST",this.headers=e.headers||{},this.body=e.body||{},this.onBeforeUpload=e.onBeforeUpload||function(){},this.onUploadProgress=e.onUploadProgress||function(){},this.onUploadComplete=e.onUploadComplete||function(){},this.controller=new AbortController}}function No(e){var t,n,i;if(!e.use3DZoom)return null==e.emit||e.emit.call(e,jr.enable3DZoom,{eventType:jr.enable3DZoom,code:-1,msg:null==(t=e.i18n)?void 0:t.t("3D_ZOOM_DISABLE")}),e.emit("message",null==(n=e.i18n)?void 0:n.t("3D_ZOOM_DISABLE"),"3DZoomError"),Promise.resolve({code:-1,msg:null==(i=e.i18n)?void 0:i.t("3D_ZOOM_DISABLE")});if(e.is3DZooming)return new Promise((function(t){var n,i;null==e.emit||e.emit.call(e,jr.enable3DZoom,{eventType:jr.enable3DZoom,code:0,msg:null==(n=e.i18n)?void 0:n.t("3D_ZOOM_ACTIVED")}),t({code:0,msg:null==(i=e.i18n)?void 0:i.t("3D_ZOOM_ACTIVED")})}));if(e.support3DZoom){var r,o;e.is3DZooming=!0;let t=null==(r=e.jSPlugin)?void 0:r.JS_Enable3DZoom(0,(t=>{const n=e.width,i=e.height,r=function(e,t){if(!e||!e.startPos||!e.endPos)return-1;const n=e.startPos[0],i=e.startPos[1],r=e.endPos[0],o=e.endPos[1];return t?r>n&&o<i?1:r<n&&o>i?0:-1:r>n&&o>i?1:r<n&&o<i?0:-1}(t,e.isCurrentFullscreen);if(r>-1)try{const o=function(e,t,n,i=5){if(!(e&&t&&n&&n.startPos&&n.endPos))return-1;const r=n.startPos[0],o=n.startPos[1],a=n.endPos[0],s=n.endPos[1],l=Math.abs(a-r),c=Math.abs(s-o),d=parseInt((r+a)/2+""),u=parseInt((o+s)/2+""),p=Math.round(e*t/(l*c));return{startPointX:parseInt(r/e*256+""),startPointY:parseInt(o/t*256+""),endPointX:parseInt(a/e*256+""),endPointY:parseInt(s/t*256+""),zoomRate:p>i?i:p,targetCenterX:d,targetCenterY:u,targetWidth:l,targetHeight:c}}(n,i,t,e.capacity&&e.capacity.support_zoomOut_maxTime?e.capacity.support_zoomOut_maxTime:5);if(-1===o)return;const a=e.env.domain+`/api/v3/das/device/3d/zoom?accessToken=${e.accessToken||e.token.deviceToken.video}&deviceSerial=${e.urlInfo.deviceSerial}&channelNo=${e.urlInfo.channelNo}&command=${0==r?9:8}&zoomTimes=${o.zoomRate}&startPointX=${o.startPointX}&startPointY=${o.startPointY}&endPointX=${o.endPointX}&endPointY=${o.endPointY}&length=${parseInt(i)}&width=${parseInt(n)}&midPointX=${o.targetCenterX}&midPointY=${o.targetCenterY}&lengthX=${o.targetWidth}&lengthY=${o.targetHeight}`;fetch(a,{method:"POST"}).then((e=>e.json())).then((t=>{200!=t.code&&e.emit("message",t.msg,"3DZoomError")})).catch((t=>{var n;e.emit("message",null==(n=e.i18n)?void 0:n.t("3D_ZOOM_FAILED"),"3DZoomError")}))}catch(t){var o;e.emit("message",null==(o=e.i18n)?void 0:o.t("3D_ZOOM_FAILED"),"3DZoomError")}}));return null==e.emit||e.emit.call(e,jr.enable3DZoom,{eventType:jr.enable3DZoom,code:t,msg:null==(o=e.i18n)?void 0:o.t("START_3D_ZOOM")}),0===t?Promise.resolve({code:-1}):Promise.resolve({code:0})}return e.is3DZooming=!1,new Promise((function(t){null==e.emit||e.emit.call(e,jr.enable3DZoom,{eventType:jr.enable3DZoom,code:-1,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),e.emit("message",e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM"),"3DZoomError"),t({code:-1,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")})}))}function $o(e,t){var n,i,r,o,a,s,l,c,d;return!e._FECCorrectType||((null==(n=e.jSPlugin)?void 0:n.isHardH264)||(null==(i=e.jSPlugin)?void 0:i.isHardH265))&&(null==(r=e.jSPlugin)?void 0:r.useHardDev)?(null==e.emit||e.emit.call(e,jr.getFEC3DViewParam,{eventType:jr.getFEC3DViewParam,code:-1,msg:e.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")}),Promise.resolve({code:-1,msg:e.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")})):(null==(o=e.jSPlugin)?void 0:o.FEC_Set3DViewParam)&&e._FECCorrectType&&(3===(null==(a=e._FECCorrectType)?void 0:a.place)&&1536===(null==(s=e._FECCorrectType)?void 0:s.correctType)||1===(null==(l=e._FECCorrectType)?void 0:l.place)&&2304===(null==(c=e._FECCorrectType)?void 0:c.correctType))?null==(d=e.jSPlugin)?void 0:d.FEC_Get3DViewParam(t).then((t=>(null==e.emit||e.emit.call(e,jr.getFEC3DViewParam,{eventType:jr.getFEC3DViewParam,code:0,data:t,msg:e.i18n.t("FEC.SET_FEC_PARAMS")}),{code:0,data:t}))).catch((()=>(null==e.emit||e.emit.call(e,jr.getFEC3DViewParam,{eventType:jr.getFEC3DViewParam,code:-1}),{code:-1}))):(null==e.emit||e.emit.call(e,jr.getFEC3DViewParam,{eventType:jr.getFEC3DViewParam,code:-1,msg:e.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.resolve({code:-1,msg:e.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}const Fo="[Ptz]";class jo{static _instanceStyle(){if(jo._STYLE)return;jo._STYLE=document.createElement("style"),jo._STYLE.id="ezuikit-ptz-style";const e=pr();jo._STYLE.innerHTML=`\n .ez-ptz-container {\n position: relative;\n width: 80px;\n height: 80px;\n background: rgba(255, 255, 255, 0.70);\n box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n border: 1px solid rgba(255, 255, 255, 0.70);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n user-select: none;\n }\n .ez-ptz-container .ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n top: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.top.active {\n border-bottom-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n bottom: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom.active {\n border-top-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-left: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n right: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.right.active {\n border-left-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-right: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n left: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-main.center {\n width: 23px;\n height: 23px;\n background: #407AFF;\n border-radius: 100%;\n top: calc(50% - 12.4px);\n left: calc(50% - 12.4px);\n position: absolute;\n }\n\n .ez-ptz-wrap {\n position: absolute;\n right: 0px;\n top: 0;\n width: 85px;\n height: 100%;\n padding: 0 20px;\n flex-direction: column;\n justify-content: center;\n background: rgba(0,0,0,0.9);\n box-sizing: content-box !important;\n }\n\n .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }\n\n .ez-ptzspeed-progress-line{\n height: 1px;\n background: #ffffff;\n margin: 16px 0 8px;\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-line-dot{\n width: 5px;\n height: 5px;\n border: 2px solid #ffffff;\n border-radius: 50%;\n background: #ffffff;\n margin: -3px 0;\n cursor: pointer;\n }\n\n .ez-ptzspeed-progress-line-dot.active{\n border-color: #407AFF;\n }\n\n .ez-ptzspeed-progress-points{\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-points-slow{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-mid{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-fast{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzbtn-container{\n width: 100%;\n height:${e?"60px":"18px"};\n margin-top: 14px;\n display: ${e?"block":"flex"};\n }\n\n .ez-ptzbtn-focal,\n .ez-ptzbtn-zoom{\n width: ${e?"100%":"50%"};\n height: 20px;\n display: flex;\n border: 1px solid rgba(255,255,255,0.5);\n border-radius: 10px;\n padding-bottom: 0px;\n box-sizing: content-box;\n }\n\n .ez-ptzbtn-zoom-add,\n .ez-ptzbtn-zoom-sub,\n .ez-ptzbtn-focal-add,\n .ez-ptzbtn-focal-sub{\n width: ${e?"50%":"24px"};\n height: 20px;\n cursor: pointer;\n text-align: center;\n }\n\n .ez-ptzbtn-zoom{\n margin: ${e?"0 0 8px":"0 4px 0 0"};\n }\n\n .ez-ptzbtn-zoom-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n\n .ez-ptzbtn-focal-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n `,document.getElementsByTagName("head")[0].appendChild(jo._STYLE)}destroy(){}show(){document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`)&&(document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`).style="display: flex;box-sizing: content-box;"),this.showPtz=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit(jr.ptz.openPtz,{eventType:"openPtz",code:0,target:this,msg:"开启云台"})}hide(){document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`)&&(document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`).style="display: none"),this.showPtz=!1,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit(jr.ptz.closePtz,{eventType:"closePtz",code:0,target:this,msg:"关闭云台"})}_handlePtzTouch(e,t){var n,i;this._ptzQueue||(this._ptzQueue=Promise.resolve());var r=document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).getBoundingClientRect(),o=r.left+41,a=r.top+41,s=e.x||e.changedTouches[0].clientX,l=e.y||e.changedTouches[0].clientY,c=0;let d=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",u=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,p=0;function h(e,t){let n=Math.atan2(t,e);n<0&&(n+=2*Math.PI);let i=n*(180/Math.PI)-225-12.5;return i<0&&(i+=360),Math.floor(i/45)+1}const m=/^rotate\(90/.test(document.getElementById(`${this.jSPlugin.id}-wrap`).style.transform),A=s-o,f=l-a;if(m)switch(h(A,f)){case 1:c=2,p=90;break;case 2:c=4,p=135;break;case 3:c=0,p=180;break;case 4:c=6,p=225;break;case 5:c=3,p=270;break;case 6:c=7,p=315;break;case 7:c=1,p=0;break;case 8:c=5,p=45}else switch(h(A,f)){case 1:c=0,p=180;break;case 2:c=6,p=225;break;case 3:c=3,p=270;break;case 4:c=7,p=315;break;case 5:c=1,p=0;break;case 6:c=5,p=45;break;case 7:c=2,p=90;break;case 8:c=4,p=135}document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).style="start"===t?`background-image:linear-gradient(${p}deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)`:"","stop"===t&&(d=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",u=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video);var v=new FormData;v.append("deviceSerial",ur(this.jSPlugin.url).deviceSerial),v.append("channelNo",ur(this.jSPlugin.url).channelNo),v.append("speed",this.jSPlugin.ptzSpeed),v.append("direction",c),v.append("accessToken",u),this._ptzQueue=this._ptzQueue.then((()=>fetch(d,{method:"POST",body:v}).then((e=>e.json())).then((e=>{var n;const i=e.code||(null==e||null==(n=e.result)?void 0:n.code);if("start"===t&&200!=i){var r,o,a,s;const t=this.jSPlugin.i18n.t("38"+i)||e.msg;null==(r=this.pluginStatus)||r.loadingSetText({text:t,color:"red",delayClear:2e3}),null==(s=this.jSPlugin)||null==(a=s.logger)||a.error("[errors]",(null==(o=this.jSPlugin)?void 0:o.i18n.t("38"+i))+`(${i})`)}return[60002,60003,60004,60005,60006].indexOf(i)>-1&&(document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).style=`background-image:linear-gradient(${p}deg, #f45656 0%, rgba(100,143,252,0.00) 30%)`),e})).catch((e=>{})))),"stop"===t&&(this._ptzQueue=this._ptzQueue.finally((()=>{}))),null==(i=this.jSPlugin)||null==(n=i.eventEmitter)||n.emit(jr.ptz.ptzDirection,{areaId:h(A,f),direction:c,backDeg:p,isRotate:m,ptzSpeed:this.jSPlugin.ptzSpeed,type:t})}_handleBtnTouch(e,t,n){var i,r,o,a;this._ptzOperation||(this._ptzOperation=Promise.resolve());let s=8;s="zoom"===e?"add"===t?8:9:"add"===t?10:11;let l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;"stop"===n&&(l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",c=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),null==(r=this.jSPlugin)||null==(i=r.logger)||i.log(Fo,e,t,n),null==(a=this.jSPlugin)||null==(o=a.eventEmitter)||o.emit(jr.ptz.ptzBtnClick,{btn:e,option:t,type:n});const d=new FormData;d.append("deviceSerial",ur(this.jSPlugin.url).deviceSerial),d.append("channelNo",ur(this.jSPlugin.url).channelNo),d.append("speed",this.jSPlugin.ptzSpeed),d.append("direction",s),d.append("accessToken",c),this._ptzOperation=this._ptzOperation.then((()=>fetch(l,{method:"POST",body:d}).then((e=>e.json())).then((t=>{var i;const r=t.code||(null==t||null==(i=t.result)?void 0:i.code);if("start"===n&&200!=r){var o,a;const n=6e4==r||60006==r?"zoom"===e?this.jSPlugin.i18n.t("NOT_SUPPORT_DEVICE_ZOOM"):this.jSPlugin.i18n.t("NOT_SUPPORT_FOCUS"):t.msg;this.pluginStatus.loadingSetText({text:n,color:"red",delayClear:2e3}),null==(a=this.jSPlugin)||null==(o=a.logger)||o.error("[errors]",n)}return t})).catch((e=>{})))),"stop"===n&&(this._ptzOperation=this._ptzOperation.finally((()=>{this._ptzOperation=null})))}constructor(e){var t;if(this.jSPlugin=e,null==(t=this.jSPlugin.logger)||t.log(Fo,"init"),this.pluginStatus=this.jSPlugin.pluginStatus,this.showPtz=!1,document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;const n=document.createElement("div");n.id=this.jSPlugin.id+"-ez-ptz-item",n.className="ez-ptz-wrap",n.style="display:none;",jo._instanceStyle(),n.innerHTML=`\n <div class="ez-ptz-container" id="${this.jSPlugin.id}-ez-ptz-container" style="position: relative;width: 80px;height: 80px;background: rgba(255, 255, 255, 0.80);box-shadow: 0px 0px 33px 4px rgba(0, 0, 0, 0.15);border: 1px solid rgba(255, 255, 255, 0.80);border-radius: 100%;cursor: pointer;overflow: hidden;user-select: none;">\n <div class="ez-ptz-main center"></div>\n <div class="ez-ptz-icon top"></div>\n <div class="ez-ptz-icon top-left"></div>\n <div class="ez-ptz-icon left"></div>\n <div class="ez-ptz-icon left-bottom"></div>\n <div class="ez-ptz-icon bottom"></div>\n <div class="ez-ptz-icon bottom-right"></div>\n <div class="ez-ptz-icon right"></div>\n <div class="ez-ptz-icon right-top"></div>\n </div>\n <div class="ez-ptzspeed-container" id="${this.jSPlugin.id}-ez-ptzspeed-container" style="user-select: none;">\n <div class="ez-ptzspeed-progress" title="${this.jSPlugin.i18n.t("PTZ_SPEED")}">\n <div class="ez-ptzspeed-progress-line">\n <div class="ez-ptzspeed-progress-line-dot" id="${this.jSPlugin.id}-ptzspeed-slow-dot"></div>\n <div class="ez-ptzspeed-progress-line-dot active" id="${this.jSPlugin.id}-ptzspeed-mid-dot"></div>\n <div class="ez-ptzspeed-progress-line-dot" id="${this.jSPlugin.id}-ptzspeed-fast-dot"></div>\n </div>\n <div class="ez-ptzspeed-progress-points">\n <div class="ez-ptzspeed-progress-points-slow" id="${this.jSPlugin.id}-ptzspeed-slow">\n ${this.jSPlugin.i18n.t("PTZ_SLOW")}\n </div>\n <div class="ez-ptzspeed-progress-points-mid" id="${this.jSPlugin.id}-ptzspeed-mid">\n ${this.jSPlugin.i18n.t("PTZ_MID")}\n </div>\n <div class="ez-ptzspeed-progress-points-fast" id="${this.jSPlugin.id}-ptzspeed-fast">\n ${this.jSPlugin.i18n.t("PTZ_FAST")}\n </div>\n </div>\n </div>\n </div>\n <div class="ez-ptzbtn-container">\n <div class="ez-ptzbtn-zoom" title="${this.jSPlugin.i18n.t("DEVICE_ZOOM")}" style="user-select: none;">\n <div class="ez-ptzbtn-zoom-add" id="${this.jSPlugin.id}-ez-ptzbtn-zoom-add" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705043060101" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" p-id="8153" fill="#ffffff"></path><path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" p-id="8154" fill="#ffffff"></path><path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" p-id="8155" fill="#ffffff"></path></svg>\n </div>\n <div class="ez-ptzbtn-zoom-sub" id="${this.jSPlugin.id}-ez-ptzbtn-zoom-sub" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705043081103" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8395" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" p-id="8396" fill="#ffffff"></path><path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" p-id="8397" fill="#ffffff"></path></svg>\n </div>\n </div>\n <div class="ez-ptzbtn-focal" title="${this.jSPlugin.i18n.t("DEVICE_FOCUS")}" style="user-select: none;">\n <div class="ez-ptzbtn-focal-add" id="${this.jSPlugin.id}-ez-ptzbtn-focal-add" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705048602135" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5018" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" p-id="5019" fill="#ffffff"></path><path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" p-id="5020" fill="#ffffff"></path></svg>\n </div>\n <div class="ez-ptzbtn-focal-sub" id="${this.jSPlugin.id}-ez-ptzbtn-focal-sub" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705048615893" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5352" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" p-id="5353" fill="#ffffff"></path><path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" p-id="5354" fill="#ffffff"></path></svg>\n </div>\n </div>\n </div>\n `,document.getElementById(`${e.id}-wrap`).appendChild(n),document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"start")},document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"start")},document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzspeed-container`).onmouseup=e=>{var t;e.target.id&&(e.target.id.indexOf("slow")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("mid")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("fast")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.add("active")),null==(t=this.jSPlugin)||t.eventEmitter.emit(jr.ptz.ptzSpeedChange,this.jSPlugin.ptzSpeed))},document.getElementById(`${this.jSPlugin.id}-ez-ptzspeed-container`).ontouchend=e=>{var t,n;e.target.id&&(e.target.id.indexOf("slow")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("mid")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("fast")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.add("active")),null==(n=this.jSPlugin)||null==(t=n.eventEmitter)||t.emit(jr.ptz.ptzSpeedChange,this.jSPlugin.ptzSpeed))},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","stop")}}}class Uo{static _instanceStyle(){if(Uo._STYLE)return;const e=document.documentElement.clientWidth/375||1;Uo._STYLE=document.createElement("style"),Uo._STYLE.innerHTML=`@keyframes slideContentUp {0% {bottom: -${366*e}px;}\n 25% {bottom: -${244*e}px;}\n 50% {bottom: -${122*e}px;}\n 100% {bottom:0;}} .open-popup{animation:slideContentUp 0.3s 1 linear; -webkit-animation: slideContentUp 0.3s 1 linear;}`,document.getElementsByTagName("head")[0].appendChild(Uo._STYLE)}initPopupCustom(){document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom`)?document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom`).style.display="flex":this.randerPopup()}randerPopup(){const e=document.documentElement.clientWidth/375||1,t=document.getElementById(`${this.jSPlugin.id}-wrap`);var n=document.createElement("div");n.style="display:flex;",n.id=`${this.jSPlugin.id}-wrap-popup-custom`,n.innerHTML=`<div id="${this.jSPlugin.id}-wrap-popup-custom-mask" style="height:100%;width:100%;position:fixed;top:0;left:0;z-index:9998;background-color: rgba(0,0,0,0.75);overflow:hidden;">\n </div>\n <div id="${this.jSPlugin.id}-wrap-popup-board" class="open-popup" style="bottom:0;height: ${this.heightPop*e}px;position:fixed;left: 0; width: 100%;background-color:#ffffff;z-index: 9999;border-radius: 16px 16px 0px 0px;">\n <div style="margin-top: ${20*e}px;padding: 0 ${15*e}px;width: 100%;display:flex;flex-direction: row;align-items: center;">\n <div id="${this.jSPlugin.id}-popup-board-close">\n <svg width="${24*e}px" height="${24*e}px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/close</title>\n <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="common/Close/Dark">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n </g>\n </g>\n </svg>\n </div>\n <div id="popup-board-title-content" style="width: ${180*e}px;font-size: ${18*e}px;margin-left: ${59*e}px;font-family: PingFangSC-Medium;color: #2C2C2C;font-weight: 500;text-align: center;"></div>\n </div>\n <div id="${this.jSPlugin.id}-popup-board-content" style="width:100%;padding: 0 ${15*e}px;height: ${(this.heightPop-48)*e}px;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;"></div>\n </div>\n `,t.appendChild(n),document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom-mask`).onclick=()=>{this.closePopupCustom()},document.getElementById(`${this.jSPlugin.id}-popup-board-close`).onclick=()=>{this.closePopupCustom()}}closePopupCustom(e=()=>{}){e();let t=document.getElementById(`${this.jSPlugin.id}-wrap`),n=document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom`);t&&n&&t.removeChild(n)}initPopupContent(e,t){document.getElementById("popup-board-title-content").innerText=e||"",t&&document.getElementById(`${this.jSPlugin.id}-popup-board-content`).appendChild(t)}constructor(e,t){this.jSPlugin=e,this.heightPop=t||366,Uo._instanceStyle(),this.initPopupCustom()}}var Bo=function(e){this.state={id:e.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var t=this;this.setState=function(e){Object.keys(e).forEach((function(n){t.state[n]=e[n],"scrollTop"===n&&document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.scrollTo(0,e[n]),"current"===n&&document.getElementById("time-line-current")&&(document.getElementById("time-line-current").innerHTML=e[n])}))},this.setDisabled=function(e){this.setState({disabled:e}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.style.overflowY=e?"hidden":"scroll")},this.timeToSecond=function(e){const t=e.split(":");let n=Number(t[0]);const i=Number(t[1]),r=Number(t[2]);return 60*n*60+60*i+(r||0)},this.minuteToTime=function(e){let t=Math.floor(e/60),n=e%60;return(t>9?t:"0"+t)+":"+(n>9?n:"0"+n)},this.timeToMinute=function(e){const t=e.split(":");return 60*Number(t[0])+Number(t[1])},this.getPlayParam=e.getPlayParam,this.checkIsAppleDevice=function(){var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),n=e.indexOf("iPad")>-1,i=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||n||i)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(t.state.disabled)return!1;e.ontouchstart()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(t.state.disabled)return!1;e.ontouchmove()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(t.state.disabled)return!1;var n;new Promise((function(e,t){let i=-1;n=setInterval((()=>{var t,r;let o=null==(r=document.getElementById("time-line-item"))||null==(t=r.parentNode)?void 0:t.scrollTop;o!==i?i=o:(clearInterval(n),e(o))}),100)})).then((e=>{t.rectTopTotime(e),t.getPlayParam({current:t.state.current})})),e.ontouchend()}),!1)):(document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(t.state.disabled)return!1;e.ontouchstart()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(t.state.disabled)return!1;e.ontouchmove()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchend=function(){if(t.state.disabled)return!1;var n;new Promise((function(e,t){let i=-1;n=setInterval((()=>{var t,r;let o=null==(r=document.getElementById("time-line-item"))||null==(t=r.parentNode)?void 0:t.scrollTop;o!==i?i=o:(clearInterval(n),e(o))}),100)})).then((e=>{t.rectTopTotime(e),t.getPlayParam({current:t.state.current})})),e.ontouchend()})),this.matchTimeDot()};Bo.prototype.changeScale=function(e){this.setState({timelag:e}),this.matchTimeDot()},Bo.prototype.setDateLine=function(e,t){if(e.length>0){void 0===t&&(t=e.length-1);const{current:n}=this.state;this.setState({availTimeLine:e,start:e[t].st,end:e[t].et,current:0===n?e[t].st:n}),this.matchRecTimeDot(),this.primaryOffsetH()}else this.setState({availTimeLine:[]}),this.matchRecTimeDot()},Bo.prototype.matchTimeDot=function(){const{start:e,end:t,timelag:n,availTimeLine:i}=this.state;var r=[];let o=this.timeToMinute(t);o=Math.floor(o/n)*n;for(let e=o;e>=0;){let t=0,i=0,a=[];e==o&&(t=70),0==e&&(i=230);let s=this.minuteToTime(e);r.push({id:e,current:s,label:"a"+e,marginTop:t,marginBottom:i,recArr:a}),e-=n}this.setState({timeArr:r}),this.renderDateLine()},Bo.prototype.matchRecTimeDot=function(){const{start:e,end:t,timelag:n,availTimeLine:i,timeArr:r}=this.state;let o=i.length;if(0===o)for(var a=0;a<r.length;a++)r[a].recArr=[];else{for(var s=0;s<r.length;s++)r[s].recArr=[];for(let e=0;e<o;e++){const t=i[e];let o,s,d=this.timeToSecond(t.st),u=this.timeToSecond(t.et),p=0,h=0;o=Math.floor(d/(60*n))*n,p=(d-60*o)/n,s=Math.floor(u/(60*n))*n,h=(u-60*s)/n;for(a=0;a<r.length;a++)if(r[a].id==o&&r[a].id==s){var l=h-p,c=60-h;r[a].recArr.push({height:l,top:c})}else r[a].id==o?r[a].recArr.push({height:60-p,top:0}):r[a].id==s?r[a].recArr.push({height:h,top:60-h}):r[a].id>o&&r[a].id<s&&r[a].recArr.push({height:60,top:0})}}this.setState({timeArr:r}),this.renderDateLine()},Bo.prototype.renderDateLine=function(){const{id:e,timeArr:t}=this.state;var n=document.getElementById("time-line-item");n.innerHTML="",t.forEach(((e,t)=>{var i=document.createElement("div");i.setAttribute("class","time-item"),i.style=`margin-top: ${e.marginTop}px; margin-bottom: ${e.marginBottom}px; border-right-color: ${e.borderColor};`,document.createElement("div").setAttribute("class","scale");var r='<div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale" style="width:10px"></div>';e.recArr.forEach(((e,t)=>{r+=`<div class="item-unavail" style="height: ${e.height}px;background-color:#A8B9ED; top: ${e.top}px"></div>`})),r+=`<div id=${e.label} style="position: relative; top: 51px; left: 40%"> ${e.current}</div>`,i.innerHTML=r,n.appendChild(i)}))},Bo.prototype.primaryOffsetH=function(){const{start:e,timelag:t,timeArr:n,current:i}=this.state,r=n[0].current,o=this.timeToSecond(r)-this.timeToSecond(0===i?e:i),a=Math.ceil(o/t)+60;this.setState({scrollTop:a})},Bo.prototype.currentOffsetH=function(){const{current:e,timelag:t,timeArr:n}=this.state,i=n[0].current,r=this.timeToSecond(i)-this.timeToSecond(e),o=Math.ceil(r/t)+60;this.setState({scrollTop:o})},Bo.prototype.rectTopTotime=function(e){let t,n,{timelag:i}=this.state,r=Math.floor(e/60),o=e-60*r;if(0==o)t=this.state.timeArr[r-1].current,n=0;else{const e=this.state.timeArr[r].current;let a=this.timeToMinute(e);const s=(60-o)*i,l=Math.floor(s/60)+a,c=60*Math.floor(s/60);n=Math.ceil(s-c),t=this.minuteToTime(l)}this.setState({current:t+":"+(n>9?n:"0"+n),scrollTop:e})},Bo.prototype.stepScrollTimeLine=function(e){this.setState({current:e}),this.currentOffsetH()},Bo.prototype.secondCountDown=function(e){const{current:t}=this.state,n=t.split(":");let i=60*Number(n[0])*60+60*Number(n[1])+Number(n[2])+1,r=Math.floor(i/3600),o=Math.floor((i-3600*r)/60),a=i-3600*r-60*o;this.setState({current:(r>9?r:"0"+r)+":"+(o>9?o:"0"+o)+":"+(a>9?a:"0"+a)})};const Vo=Bo;function Yo(e){10===(e+"").length&&(e*=1e3);var t=new Date(e),n=t.getHours(),i=t.getMinutes(),r=t.getSeconds();return(n>9?n:"0"+n)+":"+(i>9?i:"0"+i)+":"+(r>9?r:"0"+r)}Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),t)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[n]:("00"+t[n]).substr((""+t[n]).length)));return e};class Zo{static _instanceStyle(){Zo._STYLE||(Zo._STYLE=document.createElement("style"),Zo._STYLE.id="ezuikit-mobile-rec-style",Zo._STYLE.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(Zo._STYLE))}recInit(){this.createDom(),this.initTimeLine(),this.injectJsCss(this.jSPlugin),this.syncTimeLine(),this.bindEvent()}injectJsCss(e){this.unInjectJsCss();const t=this,n=document.getElementById(`${e.id}-wrap`);((e,t)=>{try{if(document.querySelector(`link[href="${e}"]`))return}catch(e){}for(var n=document.getElementsByTagName("head")[0].getElementsByTagName("link"),i=!1,r=0;r<n.length;r++)n[r].getAttribute("href")==e&&(i=!0);if(!i){var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=e,o.onload=t,document.getElementsByTagName("head")[0].appendChild(o)}})(`${e.staticPath}/rec/datepicker.min.css`),sr(`${e.staticPath}/rec/jquery.min.js`,(e=>{sr(`${e.staticPath}/rec/datepicker.js`,(e=>{sr(`${e.staticPath}/rec/datepicker.${t.datepickerLang[e.language]}.js`,(e=>{let i=n.getElementsByClassName("datepicker-container")[0];!i&&$(`#${e.id}-datepicker`).datepicker&&$(`#${e.id}-datepicker`).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:t.datepickerLang[e.language],date:new Date(cr("begin",e.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:n}),i=n.getElementsByClassName("datepicker-container")[0],i&&(i.style.display="none",i.style.bottom="-314px",i.style.right="0px"),t.datepickerVisible=!1,$(`#${e.id}-datepicker`).on("pick.datepicker",(n=>{let r={begin:new Date(n.date).Format("yyyyMMddhhmmss")};if(t.begin=n.date,t.end=new Date(n.date).Format("yyyy-MM-dd")+" 23:59:59",n.date>new Date||new Date(n.date).Format("yyyyMMdd")===new Date(document.getElementById(`${e.id}-datepicker`).getAttribute("data-value")).Format("yyyyMMdd"))n.preventDefault();else{const i=new Date(n.date).Format("yyyy/MM/dd");document.getElementById(`${e.id}-datepicker`)&&document.getElementById(`${e.id}-datepicker`).setAttribute("data-value",i),t.date=i,e.eventEmitter.emit(jr.date.recStartTimeChange,{code:0,data:{time:i}}),e.Theme.decoderState&&e.Theme.decoderState.state&&(e.Theme.decoderState.state.cloudRec?r={begin:new Date(n.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:e.Theme.decoderState.state.rec&&(r={begin:new Date(n.date).Format("yyyyMMddhhmmss"),type:"rec"}))}e.changePlayUrl(r,(()=>{}),!1).then((()=>{setTimeout((()=>{const e=document.getElementById("date");e&&(e.value=new Date(n.date).Format("yyyy-MM-dd"))}),0),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound(),t.syncTimeLine()})),t.changeRecSpeed(1),t.resetMobileZoomStatus(),i&&(i.style.display="none"),t.datepickerVisible=!1})),$(`#${e.id}-datepicker`).off("click").on("click",(n=>{var r,o;t.datepickerVisible?i&&(i.style.display="none",null==e||null==(r=e.eventEmitter)||r.emit(jr.date.closeDatePanel)):i&&(i.style.display="inline",null==e||null==(o=e.eventEmitter)||o.emit(jr.date.openDatePanel));t.datepickerVisible=!t.datepickerVisible})),document.getElementById("date-picker")&&document.getElementById("date-picker").addEventListener("focus",(function(e){e.target.blur()}))}),(()=>{}),e)}),(()=>{}),e)}),(()=>{}),e)}createDom(){const e=document.createElement("div");e.id="date-switch-container-wrap",e.className="date-switch-container-wrap",e.style="",e.innerHTML=`\n <div class="date-switch-container">\n <div class="current-date" id="current-date">${this.jSPlugin.i18n.t("RECORD_TIPS")}</div>\n <div class="date-container">\n <label for="date" style="width: 40px;height: 40px;">\n <div class="date-icon"></div>\n </label>\n <div autocomplete="off" data-toggle="${this.jSPlugin.id}-datepicker" id="${this.jSPlugin.id}-datepicker" name="${this.jSPlugin.id}-datepicker" data-value="${this.date.replace(/\//g,"-")||(new Date).Format("yyyy-MM-dd")}" style="opacity:0;width:32px;height:34px;cursor:pointer;"> </div>\n </div>\n </div>\n `,dr(e,document.getElementById(`${this.jSPlugin.id}-wrap`));const t=document.createElement("div");t.id="rec-type-container-wrap",t.className="rec-type-container-wrap",t.style="",t.innerHTML=`\n <div class="rec-type-container">\n <div class="rec-type-text"><span id="recCount">${this.recList.length}</span>${this.jSPlugin.i18n.t("RECORDS")}</div>\n <div class="rec-type-switch">\n <label>\n <input type="checkbox" name="type" id="cloudType" value="1" hidden />\n <label for="cloudType" class="advice">\n <span>\n ${this.jSPlugin._isCloudRecord?'<svg width="20.000000" height="20.000000" viewBox="0 0 20 20" fill="#CCCCCC" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M14.87 7.7L16.96 6.71C17.64 6.39 18.45 6.69 18.76 7.38C18.85 7.56 18.89 7.76 18.89 7.96L18.89 12.03C18.89 12.79 18.28 13.4 17.53 13.4C17.31 13.4 17.08 13.35 16.88 13.24L14.87 12.13L14.87 7.7Z" fill="#648FFC" fill-opacity="1.000000" fill-rule="evenodd" />\n <path d="M14.87 7.7L16.96 6.71C17.64 6.39 18.45 6.69 18.76 7.38C18.85 7.56 18.89 7.76 18.89 7.96L18.89 12.03C18.89 12.79 18.28 13.4 17.53 13.4C17.31 13.4 17.08 13.35 16.88 13.24L14.87 12.13" stroke="#2C2C2C" stroke-opacity="0" stroke-width="1.250000" />\n <mask id="mask_1435_272" fill="white">\n <path d="M15.2407 6.22559C15.2407 5.08887 14.3291 4.16699 13.2046 4.16699L3.70264 4.16699C2.57812 4.16699 1.6665 5.08887 1.6665 6.22559L1.6665 13.7749C1.6665 14.9121 2.57812 15.8335 3.70264 15.8335L13.2046 15.8335C14.3291 15.8335 15.2407 14.9121 15.2407 13.7749L15.2407 6.22559ZM7.39282 7.53711C7.39282 7.19189 7.08911 6.91211 6.71411 6.91211L5.35669 6.91211L5.27759 6.91602C4.93994 6.95215 4.67798 7.21631 4.67798 7.53711C4.67798 7.88232 4.98193 8.16211 5.35669 8.16211L6.71411 8.16211L6.79321 8.15771C7.13086 8.12158 7.39282 7.85742 7.39282 7.53711Z" clip-rule="evenodd" fill="" fill-opacity="1.000000" fill-rule="evenodd" />\n </mask>\n <path d="M15.2407 6.22559C15.2407 5.08887 14.3291 4.16699 13.2046 4.16699L3.70264 4.16699C2.57812 4.16699 1.6665 5.08887 1.6665 6.22559L1.6665 13.7749C1.6665 14.9121 2.57812 15.8335 3.70264 15.8335L13.2046 15.8335C14.3291 15.8335 15.2407 14.9121 15.2407 13.7749L15.2407 6.22559ZM7.39282 7.53711C7.39282 7.19189 7.08911 6.91211 6.71411 6.91211L5.35669 6.91211L5.27759 6.91602C4.93994 6.95215 4.67798 7.21631 4.67798 7.53711C4.67798 7.88232 4.98193 8.16211 5.35669 8.16211L6.71411 8.16211L6.79321 8.15771C7.13086 8.12158 7.39282 7.85742 7.39282 7.53711Z" clip-rule="evenodd" fill="" fill-opacity="1.000000" fill-rule="evenodd" mask="url(#mask_1435_272)" />\n <path d="" fill="" fill-opacity="0.000000" fill-rule="nonzero" />\n </svg>':'<svg fill="#CCCCCC" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="2 0 20 20">\n <path d="M12.6,5c-2.3,0.1-4.3,1.4-5.3,3.3L7.2,8.6c-2.4,0.5-4.1,2.5-4.1,4.9c0,2.8,2.4,5,5.2,5h9.9\n c2.4,0,4.3-1.9,4.3-4.2l0-0.2c-0.1-2-1.6-3.5-3.5-3.9l-0.1,0l0-0.2c-0.4-2.8-3-5-6.1-5L12.6,5z"/>\n </svg>'}\n </span>\n <span>\n <svg fill="#CCCCCC" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="2 0 20 20">\n <path d="M14.3,4c0.6,0,1.2,0.2,1.7,0.7l0,0L18.3,7C18.7,7.4,19,8,19,8.6l0,0v9c0,1.3-1.1,2.3-2.4,2.3\n\tl0,0H8.4C7.1,20,6,19,6,17.7l0,0V6.3C6,5,7.1,4,8.4,4l0,0H14.3z M9.7,7.2C9.3,7.2,8.9,7.6,8.9,8l0,0v2.5l0,0.1\n\tc0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C10.4,7.5,10,7.2,9.7,7.2z M12.2,7.2c-0.4,0-0.8,0.3-0.8,0.8l0,0v2.5\n\tl0,0.1c0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C12.9,7.5,12.5,7.2,12.2,7.2z M14.7,7.2c-0.4,0-0.8,0.3-0.8,0.8l0,0\n\tv2.5l0,0.1c0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C15.4,7.5,15,7.2,14.7,7.2z"/>\n </svg>\n </span>\n </label>\n </label>\n </div>\n </div>\n `,dr(t,e);const n=document.createElement("div");n.id="mobile-rec-wrap",n.className="mobileRec-wrap",n.style="",n.innerHTML='\n <div class="time-line-container">\n <div class="current-time">\n <div class="current-time-bg" id="time-line-current">00:00:00</div>\n </div>\n <div class="time-line-item-container">\n <div class="time-line-item" id="time-line-item">\n </div>\n </div>\n </div>\n ',dr(n,t)}initTimeLine(){var e,t,n;null==(t=this.jSPlugin)||null==(e=t.logger)||e.log("[TimeLine] init"),this.TimeLineOBJ=new Vo({id:"time-line-item",getPlayParam:e=>{const t=this;var n=e.current,i=new Date(this.date).Format("yyyyMMdd").substr(0,8)+(e.current?n.replace(/:/g,""):e.current.replace(/:/g,""));if("cloud.rec"===this.type||this.jSPlugin.useSeek&&this.jSPlugin.capacity&&"1"==this.jSPlugin.capacity.support_seek_playback){if(!this.isSeeking&&t.recList.length>0)if(new Date(`${this.date} ${e.current}`).valueOf()>=t.lastDate)this.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),this.syncTimeLine();else{const{play:e}=this.jSPlugin.Theme.decoderState.state;e?this.unSyncTimeLine().then((()=>{this.isSeeking=!0,this.jSPlugin.pluginStatus.loadingStart(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),this.jSPlugin.pluginStatus.loadingSetText({text:this.jSPlugin.i18n.t("LOADING")}),this.jSPlugin.Theme.setDisabled(!0),this.jSPlugin.seek(i.substr(8,6),"235959").then((()=>{const e=setInterval((()=>{this.jSPlugin.getOSDTime().then((n=>{new Date(1e3*n.data).Format("yyyyMMddhhmmss")>=i&&(this.isSeeking=!1,this.syncTimeLine(),clearInterval(e),this.jSPlugin.pluginStatus.loadingStop(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.Theme.setDisabled(!1),this.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin),t.jSPlugin.Theme.decoderState.state.sound&&t.jSPlugin.openSound())}))}),500)}))})):this.unSyncTimeLine().then((()=>{this.jSPlugin.pluginStatus.loadingStart(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),this.jSPlugin.pluginStatus.loadingSetText({text:this.jSPlugin.i18n.t("LOADING")}),this.jSPlugin.Theme.setDisabled(!0);let e=this.jSPlugin.url;e.indexOf("begin")>-1?e=e.replace(/(begin=)(\d+)/,(function(e,t,n){return t+i})):e+=`?begin=${i}`,this.jSPlugin.play({url:e}).then((()=>{this.syncTimeLine(),this.jSPlugin.pluginStatus.loadingStop(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.Theme.setDisabled(!1),t.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin)})).catch((e=>{}))}))}}else{const e=()=>{setTimeout((()=>{this.disabled=!1}),this.seekFrequency)},n=e=>{this.disabled=!0,this.unSyncTimeLine().then((()=>{this.jSPlugin.pluginStatus.loadingStart(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),this.jSPlugin.pluginStatus.loadingSetText({text:this.jSPlugin.i18n.t("LOADING")}),this.jSPlugin.Theme.setDisabled(!0);let n=this.jSPlugin.url;n.indexOf("begin")>-1?n=n.replace(/(begin=)(\d+)/,(function(e,t,n){return t+i})):n+=`?begin=${i}`,this.jSPlugin.play({url:n,unSaveUrl:!0,showPoster:!0}).then((()=>{e&&e(),this.syncTimeLine(),this.jSPlugin.pluginStatus.loadingStop(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.Theme.setDisabled(!1),t.jSPlugin.waterMark_JSPlugin&&t.jSPlugin.setWaterMarkFont(t.jSPlugin.waterMark_JSPlugin),this.jSPlugin.Theme.decoderState.state.sound&&this.jSPlugin.openSound()})).catch((e=>{}))})),this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state&&this.jSPlugin.Theme.decoderState.state.zoom&&(this.jSPlugin.Theme.setDecoderState({zoom:!1}),this.jSPlugin.Zoom.stopZoom())};this.disabled?(this.seekTimer&&clearTimeout(this.seekTimer),this.seekTimer=setTimeout((()=>{n(e)}),this.seekFrequency)):n(e)}},ontouchstart:()=>{this.operating=!0,this.unSyncTimeLine()},ontouchmove:()=>{0==this.operating&&(this.operating=!0,this.unSyncTimeLine())},ontouchend:()=>{this.operating=!1}}),this.TimeLineOBJ.setDateLine(this.recList),null==(n=this.jSPlugin)||n.eventEmitter.on(jr.setAllDayRecTimes,(e=>{if(Array.isArray(e.list)){const t=e.list.length;document.getElementById("recCount")&&(document.getElementById("recCount").innerHTML=t);let n=[];for(let i=t-1;i>=0;i--){let t=e.list[i],r=Yo(t.endTime),o=Yo(t.startTime);n.push({st:o,et:r})}this.TimeLineOBJ.setDateLine(n),e.list.length>0&&(this.recList=n,this.lastDate=1e3*e.list[e.list.length-1].endTime)}}))}unInjectJsCss(){yo.listInstances().length<=1&&((e=>{for(var t=document.getElementsByTagName("head")[0].getElementsByTagName("link"),n=0;n<t.length;n++)if(t[n].getAttribute("href")==e)return void document.getElementsByTagName("head")[0].removeChild(t[n])})(`${this.jSPlugin.staticPath}/rec/datepicker.min.css`),lr(`${this.jSPlugin.staticPath}/rec/jquery.min.js`),lr(`${this.jSPlugin.staticPath}/rec/datepicker.js`),lr(`${this.jSPlugin.staticPath}/rec/datepicker.${this.datepickerLang[this.jSPlugin.language]}.js`))}destroy(){var e,t;null==(t=this.jSPlugin)||null==(e=t.logger)||e.log("[MobileRec] destroy"),this.unInjectJsCss()}syncTimeLine(){this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((e=>{clearInterval(e)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];const e=this;this.TimeLineOBJ&&(this.jSPlugin.recTimer=setInterval((()=>{if(this.operating)return!1;this.jSPlugin.getOSDTime().then((t=>{t.data>0&&e.TimeLineOBJ.stepScrollTimeLine(function(e){var t=new Date(e),n=t.getHours(),i=t.getMinutes(),r=t.getSeconds();return(n>9?n:"0"+n)+":"+(i>9?i:"0"+i)+":"+(r>9?r:"0"+r)}(1e3*t.data))})).catch((e=>{}))}),500),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer))}unSyncTimeLine(){const e=this;return new Promise((function(t,n){e.jSPlugin.recTimer&&(clearInterval(e.jSPlugin.recTimer),e.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[e.jSPlugin.id])&&(window.recTimer[e.jSPlugin.id].map((e=>{clearInterval(e)})),window.recTimer[e.jSPlugin.id]=[]):window.recTimer={},t()}))}bindEvent(){document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(e=>{var t;e.target.checked,this.type=e.target.checked?"rec":"cloud.rec",null==(t=this.jSPlugin)||t.eventEmitter.emit(jr.recTypeChange,{code:0,data:{type:this.jSPlugin._isCloudRecord&&"cloud.rec"===this.type?"cloudRecord":"rec"===this.type?"local":"cloud"}}),this.jSPlugin.changePlayUrl({type:this.type,begin:`${new Date(this.date).Format("yyyyMMdd")}000000`},(()=>{this.jSPlugin._isCloudRecord&&this.jSPlugin.Theme.changeTheme("mobileRec")})).then((()=>{this.syncTimeLine(),this.changeRecSpeed(1),this.resetMobileZoomStatus(),this.jSPlugin.Theme.decoderState.state.sound&&this.jSPlugin.openSound()})).catch((e=>{}))}))}constructor(e,t,n){var i;if(null==e||null==(i=e.logger)||i.log("[MobileRec] init"),this.changeRecSpeed=t,this.resetMobileZoomStatus=n,this.isMobile=!0,this.jSPlugin=e,this.date=(new Date).Format("yyyy-MM-dd"),this.begin=((new Date).Format("yyyy-MM-dd")+" 00:00:00").replace(/-/g,"/"),this.end=((new Date).Format("yyyy-MM-dd")+" 23:59:59").replace(/-/g,"/"),this.initBegin=null,this.initEnd=null,this.type=ur(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.datepickerLang={zh:"zh-CN",en:"en-US"},this.datepickerVisible=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),Zo._instanceStyle(),cr("begin",this.jSPlugin.url)){var r=cr("begin",this.jSPlugin.url);this.date=r.slice(0,4)+"/"+r.slice(4,6)+"/"+r.slice(6,8),this.begin=this.date+` ${r.slice(8,10)||"00"}:${r.slice(10,12)||"00"}:${r.slice(12,14)||"00"}`,this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(cr("end",this.jSPlugin.url)){var o=cr("end",this.jSPlugin.url);this.end=this.date+` ${o.slice(8,10)||"23"}:${o.slice(10,12)||"59"}:${o.slice(12,14)||"59"}`,this.initEnd=this.end}this.recInit()}}function Ho(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Go(){var e;return e=function*(e){var t;const n=yo.getInstance(e.id);if(n){const t=n.getState();t.sound&&e.closeSound(),t.talk&&e.stopTalk(),t.recordvideo&&(yield e.stopSave())}var i,r,o;if(e._$streamInfo&&(null==(o=e.jSPlugin)||null==(r=o.player)||null==(i=r.setStreamInfoCallBackType)||i.call(r,1),e._$streamInfo.remove(),e._$streamInfo=null,e.showStreamInfo=!1,e.streamInfo={}),e._recOSDTimer&&(clearInterval(e._recOSDTimer),e._recOSDTimer=null),e._seekIntervaltimer&&(clearInterval(e._seekIntervaltimer),e._seekIntervaltimer=null),e.Talk&&"function"==typeof e.Talk.destroy&&e.Talk.destroy(),e._services)try{e._services.destroy()}catch(e){}e._collect=null;var a=e.jSPlugin.JS_DestroyWorker(0);if(yo&&e.id&&yo.removeInstance(e.id),yo&&0===yo.listInstances().length){if(jo._STYLE){const e=document.getElementById(jo._STYLE.id);e&&document.getElementsByTagName("head")[0].removeChild(e),jo._STYLE=null}if(Uo._STYLE){const e=document.getElementById(Uo._STYLE.id);e&&document.getElementsByTagName("head")[0].removeChild(e),Uo._STYLE=null}if(Zo._STYLE){const e=document.getElementById(Zo._STYLE.id);e&&document.getElementsByTagName("head")[0].removeChild(e),Zo._STYLE=null}}return null==e.emit||e.emit.call(e,jr.destroy,{eventType:jr.destroy,code:0,msg:null==(t=e.i18n)?void 0:t.t("DESTROY")}),e.videoInfo=null,e.audioInfo=null,e.jSPlugin=null,e.eventEmitter&&(e.eventEmitter.removeAllListeners(),e.eventEmitter=null),a},Go=function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){Ho(o,i,r,a,s,"next",e)}function s(e){Ho(o,i,r,a,s,"throw",e)}a(void 0)}))},Go.apply(this,arguments)}const Qo=[jr.getOSDTime,jr.streamInfoCB,jr.http.getCloudRecordTimes,jr.http.getLocalRecTimes,jr.http.getCloudRecTimes,jr.setAllDayRecTimes,jr.setRecTimes,jr.talkVolumeChange];function Ko(e,t=jr){Object.keys(t).forEach((n=>{"object"!=typeof t[n]?null==e||e.on(t[n],(i=>{var r;if(!Qo.includes(n))if("object"==typeof i&&"[object Object]"===Object.prototype.toString.call(i)||Array.isArray(i)){delete i.target;try{var o;null==(o=e.logger)||o.log("[events]",t[n],JSON.stringify(i))}catch(e){}}else null==(r=e.logger)||r.log("[events]",t[n],i)})):Ko(e,t[n])}))}function Wo(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function Jo(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){Wo(o,i,r,a,s,"next",e)}function s(e){Wo(o,i,r,a,s,"throw",e)}a(void 0)}))}}function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qo.apply(this,arguments)}function Xo(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function ea(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){Xo(o,i,r,a,s,"next",e)}function s(e){Xo(o,i,r,a,s,"throw",e)}a(void 0)}))}}function ta(e,t,n,i,r,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function na(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function a(e){ta(o,i,r,a,s,"next",e)}function s(e){ta(o,i,r,a,s,"throw",e)}a(void 0)}))}}function ia(){return ia=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ia.apply(this,arguments)}let ra=null;class oa extends ar{static preInit(e){const t=void 0!==e.sdkType?e.sdkType:"base";return new Promise(((n,r)=>{var o,a;ra={params:e};const s=i(e.url);let l={},c="";const d=new ro({sdkType:t,baseURL:e.env?e.env.domain:Or,accessToken:e.accessToken,deviceSerial:s.deviceSerial,channelNo:s.channelNo,token:e.token||{},ezopenParams:(null==(o=e.extraParams)?void 0:o.ezopenParams)||{},timeZone:null==(a=s.searchParams)?void 0:a.timeZone}),u=[d.getEzopenUrl(e.url),d.getDeviceSupportQuality(e),d.getDeviceList(e)];if(e.url.indexOf(".rec")>-1){var p;if("rec"===s.type)l=lo(s.searchParams.begin,s.searchParams.end,null==(p=s.searchParams)?void 0:p.timeZone,s.searchParams.busType),ra.timeZone=l.timeZone,c="&begin="+Ur.formate(l.originBegin,"YYYYMMDDThhmmssZ")+"&end="+Ur.formate(l.originEnd,"YYYYMMDDThhmmssZ")+"&timeZone="+l.timeZone;e.isCloudRec&&-1!==e.url.indexOf(".cloud")&&"7"===s.searchParams.busType?u.push(d.getCloudRecordTimes({begin:l.begin,end:l.end,spaceId:s.searchParams.spaceId})):-1!==e.url.indexOf(".cloud")&&"7"!==s.searchParams.busType||"base"!==t?u.push(d.getCloudTimes({begin:l.begin,end:l.end,url:e.url})):u.push(d.getLocalRecTimes({begin:l.begin,end:l.end}))}Promise.all(u).then((i=>{void 0!==i[0].code&&200!=i[0].code&&r(i[0]),ra.getEzopenUrlRes=i[0],ra.getDeviceSupportQualityRes=i[1],ra.getDeviceListRes=i[2];const o=i[3];if(e.url.indexOf(".rec")>-1&&o)if(e.isCloudRec&&-1!==e.url.indexOf(".cloud")&&"7"===s.searchParams.busType){if(ra.cloudRecordRecList=o||[],o.length){const e=po(o,["downloadPath","ownerId","iStorageVersion","spaceId","startTime","endTime","videoType","busType"],l.originBegin,l.originEnd);0===e.length&&(ra.getRecTimesRes="",n(ra));const t=JSON.stringify(e).replace("\\","");ra.getRecTimesRes=c+"&recSlice="+t.replace("\\","")+"&r="+Math.random(),n(ra)}else ra.getRecTimesRes="",n(ra);const e=JSON.stringify(playbackSlices).replace("\\","");ra.getRecTimesRes=c+"&recSlice="+e.replace("\\","")+"&r="+Math.random(),n(ra)}else ra.getRecTimesRes="",n(ra);else if(-1!==e.url.indexOf(".cloud")&&"7"!==s.searchParams.busType||"base"!==t)if(ra.cloudRecList=o||[],o.length){0===po(o,["downloadPath","ownerId","iStorageVersion","startTime","endTime","videoType"],l.originBegin,l.originEnd).length&&(ra.getRecTimesRes="",n(ra))}else-1!==e.url.indexOf(".rec")?(ra.localRecList=o||[],ra.getRecTimesRes=c,n(ra)):n(ra);else n(ra)})).catch((e=>{r(e)}))}))}_init(){this.logger.log("_init()");const e=this;this.videoInitTime=Date.now(),this.videoPlayState=1;let t=Object.assign({},this.params);const n=Date.now();Promise.all([this._initGetDeviceSupportQuality(),this._initEZUIKitPlayer(this.params),this._getRealUrlServices(this.params.url)]).then((e=>{if(e[2]&&this.autoplay){var i;const r=e[2].split("?")[0].replace("/live","").replace("/playback","");null==(i=this._collect)||i.report(1,{logInfo:{domain:r,params:t,preInit:null!==ra}}),Do(this,e[2],0,n).then((e=>{var t,n;0===e.code&&(this.options.muted||(null==(n=this.options)||null==(t=n.volumeOptions)?void 0:t.muted)||setTimeout((()=>{this.openSound()}),100));(null==ra?void 0:ra.cloudRecordRecList)?null==this.emit||this.emit.call(this,jr.setAllDayRecTimes,{type:"cloudRecordTimes",list:ra.cloudRecordRecList}):(null==ra?void 0:ra.cloudRecList)?null==this.emit||this.emit.call(this,jr.setAllDayRecTimes,{type:"cloudRecTimes",list:ra.cloudRecList}):(null==ra?void 0:ra.localRecList)&&(null==this.emit||this.emit.call(this,jr.setAllDayRecTimes,{type:"localTimes",list:ra.localRecList}))})).catch((e=>{var t,n,i;if(this.playing=!1,1===this.videoPlayState||4===this.videoPlayState){var o;this.videoPlayState=3;const t=Date.now();null==(o=this._collect)||o.report(3,{logInfo:{domain:r,loadTime:t-this.videoInitTime,err:e},errorCode:Dr(e),loadTime:t-this.videoInitTime})}this.isInspect||this.emit("message",e&&e.msg||(null==(i=this.i18n)||null==(n=i.t)?void 0:n.call(i,"GET_PLAYURL_FAILED")),"fetchError");null==(t=this.logger)||t.error(e)}))}})).catch((t=>{var n,i,r;if(this.playing=!1,1===e.videoPlayState||4===e.videoPlayState){var o;e.videoPlayState=3;const n=Date.now();null==(o=e._collect)||o.report(3,{logInfo:{loadTime:n-e.videoInitTime,err:t},errorCode:Dr(t),loadTime:n-e.videoInitTime})}e.isInspect||this.emit("message",t&&t.msg||(null==(r=this.i18n)||null==(i=r.t)?void 0:i.call(r,"GET_PLAYURL_FAILED")),"fetchError");null==(n=this.logger)||n.error(t)})).finally((()=>{this.playing&&this._deviceSerialChangeServices(),setTimeout((()=>{ra=null}),5e3),e._initTime=(new Date).getTime()-e.videoInitTime})),yo.createInstance(this.id,{rejection:!1,play:!1,pantile:!1,recordvideo:!1,talk:!1,expend:!1,webExpend:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}),this.initSuccessTime=(new Date).getTime(),this.Talk=new kr({deviceSerial:this.urlInfo.deviceSerial,accessToken:this.params.accessToken,capacity:this.capacity,channelNo:this.params.talkChannelNo||"0",env:this.env}),this.Talk&&this.Talk.eventEmitter.on("handleTalkError",(t=>{var n;this.logger.warn("talk error:",t),this.emit("talkingChange",!1),(null==t?void 0:t.message)&&"Permission denied"===t.message?this.emit("message",e.i18n.t("TALK_PERMISSION_DENIED"),"talkError"):this.emit("message",e.i18n.t("TALK_ERROR"),"talkError"),(null==(n=this.controls)?void 0:n.volumeControl)&&(this.controls.volumeControl.disabled=!1);try{this.Talk.stopTalk()}catch(e){}this.__talk_muted__&&(null==this.openSound||this.openSound.call(this)),this.__talk_muted__=!1,this._talking=!1;const i=yo.getGlobalState(),r=yo.getInstance(this.id);i.talk&&yo.setGlobalState({talk:!1}),r.getState().talk&&r.setState({talk:!1})}))}_initEZUIKitPlayer(e){var t;return null==(t=this.logger)||t.log("_initEZUIKitPlayer()"),function(e){var t,n,i,r;null==(t=e.logger)||t.log("initDecoder()"),e.emit(jr.decoderLoad);const o=e.url.includes("busType=7")?"v1":e.params.decoderType;e.jSPlugin=new u({szId:e.params.id,container:e.contentControl.$video,width:e.width,height:e.height,szBasePath:"",staticPath:e.staticPath,downloadRecord:e.downloadRecord,env:e.env,decoderType:o,decodeEngine:void 0!==e.params.decodeEngine?e.params.decodeEngine:1,autoPlay:!1,dpr:e.params.dpr,url:e.params.url,debugDownloadData:e.params.debugDownloadData,disableRenderPrivateData:e.disableRenderPrivateData,logger:{level:e.params.loggerOptions.level,showTime:!!e.params.loggerOptions.showTime},streamInfoCBType:e.params.streamInfoCBType});let a=!1,s=0,l=0;const c=e;return e.jSPlugin.EventCallback={openStreamCallback:()=>{e._openStreamTime=(new Date).getTime(),a=!1},getStreamHeaderCallback:()=>{a=!1},getVideoStreamCallback:()=>{e.getVideoStreamTime=(new Date).getTime(),e.isCall},firstFrameCallback:t=>{switch(t){case 0:e.decodeEngine="v3-soft";break;case 1:e.decodeEngine="v3-hard";break;case 2:e.decodeEngine="v1-soft"}try{const t=JSON.parse(window.localStorage.getItem(Ir)||"{}");Array.isArray(t[c.deviceSerial+"_"+c.channelNo])&&(e.maxReloadTime=t[c.deviceSerial+"_"+c.channelNo].length)}catch(e){}e.startPlayTime&&((new Date).valueOf(),e.startPlayTime=null);const n=e.jSPlugin._JSPlayM4_GetFrameInfo(0);n.frameRate&&(e.frameDecordTime=Math.round(1e3/n.frameRate).toFixed(2)),e.displayStreamInfo(e.showStreamInfo)},appearFirstFrameCallback:()=>{var t;e.appearFirstFrameTime=(new Date).getTime(),document.getElementById(`${e.id}-player`)&&(document.getElementById(`${e.id}-player`).style.display="block"),"function"==typeof e.params.handleFirstFrameDisplay&&e.params.handleFirstFrameDisplay({retcode:0,id:e.params.id,type:"handleFirstFrameDisplay"}),null==e||e.emit(jr.firstFrameDisplay),"function"==typeof e.params.handleSuccess&&e.params.handleSuccess({retcode:0,id:e.id,type:"handleSuccess"}),e.recType&&(e._recOSDTimer&&(clearInterval(e._recOSDTimer),e._recOSDTimer=null),e._recOSDTimer=setInterval(Jo((function*(){null==e.getOSDTime||e.getOSDTime.call(e)})),1e3)),e.muted||e.openSound(),e.loading=!1,null==(t=e.posterControl)||t.hide()},averageStreamSuccessCallback:()=>{e.averageStreamSuccessTime=e.initSuccessTime-e._initTime+(e._gotWsUrlTime-e._startGetWsUrlTime)+(e.appearFirstFrameTime-e._openStreamTime)},loadEventHandler:function(){},pluginErrorHandler:(t,n,i)=>{if(1003===n);else if(1!=(null==i?void 0:i.errorCode)){var r;const t=()=>{const t=Date.now();if(1===e.videoPlayState||2===e.videoPlayState||4===e.videoPlayState){var n;const r=e.wsUrl.split("?")[0].replace("/live","").replace("/playback","");null==(n=c._collect)||n.report(3,{domain:r,logInfo:{err:i,loadTime:t-e.videoInitTime},errorCode:Dr(i),loadTime:t-e.videoInitTime})}1===e.videoPlayState||4===e.videoPlayState?e.videoPlayState=3:2===e.videoPlayState&&(e.videoPlayState=5);let r=e.i18n.t("DISCONNECT");r=e.i18n.t("39"+i.errorCode),e.Theme&&e.Theme.setDecoderState({play:!1}),e.isCall||e.isInspect||e.emit("message",r,"socketError"),"function"==typeof e.params.handleError&&e.params.handleError({msg:r,retcode:i.errorCode,id:e.id,type:"handleError"})};(null==(r=e.reloadCodeBalckList)?void 0:r.indexOf(i.errorCode))>-1&&"1004"!=i.errorCode?t():e._reload(i).catch((e=>{-3==e.code&&"1004"!=i.errorCode&&t()}))}},setRunTimeInfoCallBack:({pstRuntimeInfo:t})=>{if(5===t.nErrorCode&&(c.isInspect||e.playing&&(c.emit("message",e.i18n.t("DEVICE_ENCRYPTED"),"validateCodeError"),e.stop())),!a&&9!==t.nErrorCode&&1024!==t.nErrorCode&&352321537!==t.nErrorCode&&262144!==t.nErrorCode){var n;To(e.id);const r=-1,o=t,a=(null==(n=e.urlInfo.searchParams)?void 0:n.begin)||Ur.formate(new Date,"YYYYMMDD")+"000000",s=t=>{var n;const i=null==(n=e.urlInfo.searchParams)?void 0:n.begin;"function"==typeof e.params.handleError&&e.params.handleError({retcode:r,data:qo({},o,{time:/\d{10}/.test(t)?Ur.formate(t,"YYYYMMDDhhmmss"):i||Ur.formate(new Date,"YYYYMMDD")+"000000"}),id:c.params.id,type:"handleRunTimeInfoError"})};var i;e._tempSeekTime?s(null==(i=e._tempSeekTime)?void 0:i.getTime()):e.getOSDTime().then((t=>{"rec"===e.urlInfo.type&&(e._seekDate=/\d{10}/.test((null==t?void 0:t.data)+"")?Ur.strToDate(null==t?void 0:t.data):a?Ur.strToDate(a):new Date(Ur.formate(new Date,"YYYY-MM-DD")+" 00:00:00")),s(null==t?void 0:t.data)})),setTimeout((()=>{e.stop()}),1e3)}a=!0},setAdditionDataCallBack:function(t){"function"==typeof e.params.handleAdditionData&&e.params.handleAdditionData({retcode:0,data:t,id:e.id,type:"handleAdditionData"})},stutterDetectedCallback:t=>{if(5===t.type&&(e.streamInfo.codeRate=t.codeRate+"/Kbps",e._updateStreamInfo({codeRate:e.streamInfo.codeRate})),1===t.type&&(e.streamInfo.frameLostRate=(100*t.frameLossNum/t.frameNumInterval).toFixed(2)+"%",e._updateStreamInfo({frameLostRate:e.streamInfo.frameLostRate})),2===t.type){const o=(t.runtimeInfo||t.pstRuntimeInfo||{}).nAverageDecodeTime*t.account-e.frameDecordTime*t.account;if(o>0&&(o>=150&&o<250&&(l+=10),o>=250&&o<400&&(l+=20),o>=400&&o<650&&(l+=30),o>=650&&(l+=40)),s===e.lagRateCycle){const t=parseFloat((l/e.lagRateCycle).toFixed(2));var n;if(e.streamInfo.lagRate=t+"%",e._updateStreamInfo({lagRate:e.streamInfo.lagRate}),e.autoVideoLevel)if(t>15)null==(n=e.eventEmitter)||n.emit(jr.autoVideoLevel,{code:1,lagRate:t});else if(t>1.5&&t<=15){var i;null==(i=e.eventEmitter)||i.emit(jr.autoVideoLevel,{code:0,lagRate:t})}else{var r;null==(r=e.eventEmitter)||r.emit(jr.autoVideoLevel,{code:2,lagRate:t})}s=0,l=0}else s++}}},void 0!==e.params.handleTalkSuccess&&(e.handleTalkSuccess=e.params.handleTalkSuccess),void 0!==e.params.handleTalkError&&(e.handleTalkError=e.params.handleTalkError),null==(n=e.jSPlugin.player)||n.event.on(jr.streamInfoCB,(t=>{var n;const i={videoFormat:(t.data.videoFormatName+"").indexOf("5")>-1?"H265":"H264",frameRate:t.data.frameRate+"FPS",systemFormat:4==t.data.systemFormat?"RTP":2==t.data.systemFormat?"PS":3==t.data.systemFormat?"TS":"other",resolution:_o(t.data.height)};e.streamInfo=qo({},e.streamInfo,i),e._updateStreamInfo(i),null==(n=e.eventEmitter)||n.emit(jr.streamInfoCB,t.data)})),null==(i=e.jSPlugin.player)||i.event.on(jr.videoInfo,(t=>{null==e||e.emit(jr.videoInfo,t.data),e.videoInfo=t.data})),null==(r=e.jSPlugin.player)||r.event.on(jr.audioInfo,(t=>{null==e||e.emit(jr.audioInfo,t.data),e.audioInfo=t.data})),new Promise((t=>{var n;null==(n=e.jSPlugin.player)||n.event.on("initializing",(n=>{var i;"function"==typeof e.params.handleInitSuccess&&e.params.handleInitSuccess({retcode:0,id:e.params.id,type:"handleInitSuccess"}),"loaded"===(null==n||null==(i=n.data)?void 0:i.cmd)&&(null==e||e.emit(jr.decoderLoaded),t())}))}))}(this)}_reload(e){const t=this;return new Promise((function(n,i){try{let c=JSON.parse(localStorage.getItem(Ir));const d=t.deviceSerial+"_"+t.channelNo;if(Array.isArray(c[d])&&c[d].length>0){t.maxReloadTime-=1;let l=c[d].shift();if(c[d].push(l),localStorage.setItem(Ir,JSON.stringify(c)),t.maxReloadTime>0){var r,o,a;const s=t.wsUrl.split("?")[0].replace("/live","").replace("/playback","");if(null==(r=t._collect)||r.report(6,{logInfo:{wsUrl:t.wsUrl,domain:s,error:Dr(e)}}),!/^wss\:\/\//.test(t.wsUrl))return void i({code:-4,msg:"地址不可用"});if((null==(o=c[d])?void 0:o[0].domain)&&(null==(a=c[d])?void 0:a[0].port)){const e=t.wsUrl.split("?")[0];t.wsUrl=t.wsUrl.replace(e,e.replace(/(wss:\/\/)[^\/]+/,`$1${c[d][0].domain}:${c[d][0].port}`))}t.url.indexOf("rec")>-1&&t._seekDate&&(t.wsUrl=t.wsUrl.replace(/&begin=\d{8}T\d{6}Z/,"&begin="+t._seekDate.Format("yyyyMMddThhmmssZ")));const l=Date.now();t.stop((()=>{}),!0).then((e=>{Do(t,t.wsUrl,0,l).then((e=>{if(0===e.code){var i,r;const e=(null==(i=c[t.deviceSerial+"_"+t.channelNo])?void 0:i[0].domain)||"",o=t.wsUrl.split("?")[0].replace("/live","").replace("/playback","");null==(r=t._collect)||r.report(7,{logInfo:{wsUrl:e,domain:o,reloadRes:{code:1,msg:"发起重试成功"}}});yo.getInstance(t.id).getState().sound&&setTimeout((()=>{t.openSound()}),2e3),n({code:1,msg:"发起重试成功"})}}))})).catch((e=>{var n,r;const o=(null==(n=c[t.deviceSerial+"_"+t.channelNo])?void 0:n[0].domain)||"",a=o.split("?")[0].replace("/live","").replace("/playback","");null==(r=t._collect)||r.report(8,{logInfo:{wsUrl:o,domain:a,reloadRes:{code:-1,msg:"发起重试失败",stopError:e}}}),i({code:-1,msg:"发起重试失败",stopError:e})}))}else{var s;null==(s=t._collect)||s.report(8,{logInfo:{reloadRes:{code:-2,msg:"所有备用机房地址取流失败"}}}),i({code:-2,msg:"所有备用机房地址取流失败"}),t.emit("message",t.i18n.t("PLAY_FAILED"),"reloadError")}}else{var l;null==(l=t._collect)||l.report(8,{logInfo:{reloadRes:{code:-3,msg:"无可用的备用机房地址"}}}),i({code:-3,msg:"无可用的备用机房地址"})}}catch(e){var c;null==(c=t._collect)||c.report(8,{logInfo:{reloadRes:{code:-4,msg:"备用机房地址重试中断",error:e}}}),i({code:-4,msg:"备用机房地址重试中断"})}}))}_getRealUrlServices(e){var t=this;return na((function*(){var n,r;null==(r=t.logger)||null==(n=r.log)||n.call(r,"_getRealUrlServices()");const o=t;t.urlInfo=i(e);const a=-1!==e.indexOf(".cloud");return t._startGetWsUrlTime=(new Date).getTime(),new Promise(((n,i)=>{t._beforeGetRealUrlServices(e).then((e=>{let r="";if(""!==e[0]&&"string"==typeof e[0])r=e[0],"rec"===t.urlInfo.type&&(r=r.replace(/begin=\w+/gi,"").replace(/end=\w+/gi,"").replace(/timeZone=\w+/gi,""),r+=e[1]),r=r.replace(/&&/gi,"&"),a&&""===e[1]&&("7"===t.urlInfo.searchParams.busType?i({retcode:"420004",msg:o.i18n.t("NO_CLOUD_RECORD")}):i({retcode:"420003",msg:o.i18n.t("NO_RECORD")})),r.replace(/&&/gi,"&"),n(o._handleRealUrl(r));else{var s;const r=JSON.parse(localStorage.getItem(Ir)),a=r&&r[o.deviceSerial+"_"+o.channelNo]||[];a.length>0&&a[0].wsUrl&&!["10002","10001","10031"].includes(null==(s=e[0])?void 0:s.code)?n(a[0].wsUrl):(t.messageControl.hide(),i(ia({},e[0],{type:"fail"})))}})).catch((e=>{}))}))}))()}_beforeGetRealUrlServices(e){if(ra&&ra.getEzopenUrlRes)return e.indexOf(".rec")>-1&&void 0!==ra.getRecTimesRes?Promise.resolve([ra.getEzopenUrlRes,ra.getRecTimesRes]):Promise.resolve([ra.getEzopenUrlRes]);"rec"===this.urlInfo.type&&"cloud"===this.urlInfo.recType&&e.indexOf("busType=7")>-1&&this._spaceId&&(e=/spaceId=\d*/.test(e)?e.replace(/spaceId=\d*/,`spaceId=${this._spaceId}`):(e+"&spaceId="+this._spaceId).replace("?&","?").replace("&&","&"));let t=[this._services.getEzopenUrl(e)];return e.indexOf(".rec")>-1&&t.push(function(e){return So.apply(this,arguments)}(this)),Promise.all(t)}_play(e){return function(e,t){return null==e.emit||e.emit.call(e,jr.play),e._playStartTime=(new Date).getTime(),"string"==typeof t&&(t={url:t}),t&&!t.unSaveUrl&&("string"==typeof t.url&&(e.url=t.url),e.urlInfo=i(e.url),e.deviceSerial=e.urlInfo.deviceSerial,e.channelNo=e.urlInfo.channelNo),e.playing=!0,e.loading=!0,e._getRecType((null==t?void 0:t.url)||e.url),new Promise(((n,i)=>{var r;e.isStoping=!0,null==(r=e.jSPlugin)||r.JS_Stop("string"!=typeof t&&(null==t?void 0:t.showPoster)?t.showPoster:0).then((()=>{To(e.id),e.stopTime=Date.now();const r=Date.now();e._getRealUrlServices("string"!=typeof t&&(null==t?void 0:t.url)?t.url:e.url,t&&"string"!=typeof t&&!!t.url).then((t=>{Do(e,t,e.stopTime-e._playStartTime,r).then((t=>{e.muted||setTimeout((()=>{e.openSound()}),500),n({code:0})})).catch((e=>{i(e)}))})).catch((t=>{var n,r,o;let a=t.msg?t.msg:null==(n=e.i18n)?void 0:n.t("PLAY_FAILED");e.playing=!1,e.isCall||e.isInspect,null==(o=e.params)||null==(r=o.handleError)||r.call(o,{code:t.oError?t.oError.errorCode:t.code||-1,msg:a,id:e.params.id,type:"handleError"}),e.emit("message",a,"playError"),i({code:t.oError?t.oError.errorCode:t.code||-1,msg:a,id:e.id,type:"handleError"})}))}))}))}(this,e)}stop(e=()=>{},t){return function(e,t=()=>{},n){var i;return e.playing=!1,e.autoVideoLevelResume=e.autoVideoLevel,null==(i=e.jSPlugin)?void 0:i.JS_Stop(n).then((()=>{null==e.emit||e.emit.call(e,jr.stop,{eventType:jr.stop,code:0,msg:e.i18n.t("STOP_SUCCESS")}),t()}))}(this,e,t)}pause(e){return function(e,t){return e.playing=!1,new Promise(((n,i)=>{var r,o;null==(r=e.jSPlugin)||r.JS_CloseSound(0),null==(o=e.jSPlugin)||o.JS_Pause(0,t).then((t=>{null==e.emit||e.emit.call(e,jr.pause,{eventType:jr.pause,code:0,msg:e.i18n.t("PAUSE")}),n()})).catch((t=>{null==e.emit||e.emit.call(e,jr.pause,{eventType:jr.pause,code:-1,msg:t||e.i18n.t("PAUSE_FAILED")}),i(t)}))}))}(this,e)}_resume(e){return function(e,t){return new Promise(((n,i)=>{var r;if(e.validateCode&&""!=e.validateCode&&(null==(r=e.jSPlugin)||r.JS_SetSecretKey(0,e.validateCode)),!Po)return e.play().then((()=>{n({})})).catch((e=>{i(e)}));e.jSPlugin.JS_Resume(t).then((t=>{var i;e.playing=!0,setTimeout((()=>{var t;-1!==e.url.indexOf(".rec")&&1!=e.speed&&(null==(t=e.jSPlugin)||t.JS_Speed(e._speed))}),500),null==e.emit||e.emit.call(e,jr.resume,{eventType:jr.resume,code:0,msg:null==(i=e.i18n)?void 0:i.t("RESUME")}),n(t)})).catch((t=>{var n;null==e.emit||e.emit.call(e,jr.resume,{eventType:jr.resume,code:-1,msg:t||(null==(n=e.i18n)?void 0:n.t("RESUME_FAILED"))}),i(t)}))}))}(this,e)}changeVideoLevel(e){return function(e,t){if("object"==typeof t?"auto"===t.level:"auto"===t)return e.autoVideoLevel=!0,null==e.emit||e.emit.call(e,jr.currentVideoLevel,"auto",e.videoLevel),null==e.emit||e.emit.call(e,jr.changeVideoLevel,{eventType:jr.changeVideoLevel,code:0,data:"auto",msg:e.i18n.t("CHANGE_VIDEO_LEVEL")}),Promise.resolve({code:1,data:t});const n=(e.videoLevelList||[]).find((e=>+e.level==+("object"==typeof t?t.level:t)));var i;return n?(e.videoLevel=n.level,e.streamTypeIn=n.streamTypeIn,e.autoVideoLevel=!1,null==e||e.emit(jr.currentVideoLevel,n,e.videoLevel),new Promise(Oo((function*(i){let r=e.url;if("compatible"===(null==n?void 0:n.type))r.indexOf(".hd.live")>=0?r=r.replace(".hd.live",".live"):r.indexOf(".live")>=0&&(r=r.replace(".live",".hd.live"));else try{var o,a,s,l;null==(a=e.logger)||null==(o=a.log)||o.call(a,"[https request] setVideoLevel()","videoLevel",JSON.stringify(t));const n=yield null==(s=e._services)?void 0:s.setVideoLevel(e.videoLevel);null==e||null==(l=e.emit)||l.call(e,jr.http.setVideoLevel,n)}catch(e){}e.changePlayUrl({url:e.url},(()=>{}),!1).then((n=>{null==e||e.emit(jr.changeVideoLevel,{eventType:jr.changeVideoLevel,code:0,data:t,msg:e.i18n.t("CHANGE_VIDEO_LEVEL")}),i({code:0,data:t,msg:e.i18n.t("CHANGE_VIDEO_LEVEL")})})).catch((()=>{null==e||e.emit(jr.changeVideoLevel,{eventType:jr.changeVideoLevel,code:-1,data:t,msg:e.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")}),i({code:-1,data:t,msg:e.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")})}))})))):(null==e.emit||e.emit.call(e,jr.changeVideoLevel,{eventType:jr.changeVideoLevel,code:-2,data:t,msg:e.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+JSON.stringify(t)}),null==(i=e.logger)||i.warn("video level does not exist!"),Promise.resolve({code:-2,data:t}))}(this,e)}_setVideoLevel(e){return ho(this,e)}reSetTheme(e=[]){}_changePlayUrl(e,t=()=>{},n=!0){return Lo(this,e,t)}getOSDTime(){return e=this,new Promise(((t,n)=>{var i;null==(i=e.jSPlugin)||i.JS_GetOSDTime(0).then((n=>{e.__noSyncOSD||(null==e||e.emit(jr.getOSDTime,{eventType:jr.getOSDTime,code:0,data:n,msg:e.i18n.t("GET_OSD_TIME")}),n&&n>0&&(e._seekDate=new Date(1e3*n))),t({code:0,retcode:0,data:n})})).catch((t=>{null==e||e.emit(jr.getOSDTime,{eventType:jr.getOSDTime,code:-1,msg:t||e.i18n.t("GET_OSD_TIME")}),n({code:-1,retcode:-1,data:t})}))}));var e}capturePicture(e,t=!1,n,i=!0){return function(e,t,n=!1,i=!0,r=!0){var o;t=t||(new Date).getTime()+"";var a=null==(o=e.jSPlugin)?void 0:o.JS_CapturePicture(0,t,"JPEG",n,!!i);return new Promise(((n,i)=>{a.then((i=>{const o={id:e.id,code:0,data:i.data,type:"handleCapturePicture"};null==e||e.emit(jr.capturePicture,{eventType:jr.capturePicture,code:0,data:i.data,msg:e.i18n.t("CAPTURE_SUCCESS")}),"function"==typeof e.params.handleCapturePicture&&e.params.handleCapturePicture(o),-1!==e.url.indexOf(".cloud")&&-1!==e.url.indexOf("busType=7")&&!1!==r&&fetch(e.env.domain+"/api/service/cloud/upload/url"+`?fileName=${t}&fileType=pic&expireDays=-1&urlExpireTime=1&bizType=ezuikit&accessToken=${e.accessToken||e.token.httpToken.url}`,{method:"GET"}).then((e=>e.json())).then((t=>{if(t.data&&t.data[0]){let n=new FormData;Object.keys(t.data[0].fields).map((e=>{n.append(e,t.data[0].fields[e])}));let r=atob(i.data.base64.split(",")[1]),o=[];for(let e=0;e<r.length;e++)o.push(r.charCodeAt(e));let a=new Blob([new Uint8Array(o)],{type:"image/jpeg"});n.append("file",a,"image.jpeg");const s=new Mo({url:t.data[0].url,method:"POST",body:n,headers:{accessToken:e.accessToken||e.token.httpToken.url},onUploadComplete:t=>{var n;t.response&&t.response.meta&&200==t.response.meta.code&&(null==(n=e.logger)||n.log(`${i.data.fileName} upload to cloud storage completed`))}});s.upload()}else{var n;null==(n=e.logger)||n.error("Cloud recording file upload address acquisition failed",t.meta.message)}})).catch((t=>{var n;null==(n=e.logger)||n.error("Cloud recording file upload failed: ",t)})),n(o)})).catch((t=>{null==e||e.emit(jr.capturePicture,{eventType:jr.capturePicture,code:-1,msg:t||e.i18n.t("CAPTURE_FAILED")});const n=Object.assign({id:e.id,type:"handleCapturePicture",code:-1},t);"function"==typeof e.params.handleCapturePicture&&e.params.handleCapturePicture(n),i(n)}))}))}(this,e,t,n,i)}startSave(e,t){return this.recording||!this.playing?Promise.resolve():(this.autoVideoLevelResume=this.autoVideoLevel,this.autoVideoLevel=!1,function(e,t,n){var i;return e._playing?(null==(i=e.jSPlugin)?void 0:i.JS_StartSave(t,((t,n)=>{e.recordRes={url:t,file:n}}),n||e.urlInfo.validateCode)).then((()=>{null==e.emit||e.emit.call(e,jr.startSave,{eventType:jr.startSave,code:0,msg:e.i18n.t("START_RECORD_SUCCESS")}),null==e.emit||e.emit.call(e,ar.EVENTS.recordingChange,!0),yo.getInstance(e.id).setState({recordvideo:!0}),e._recording=!0})).catch((()=>{null==e.emit||e.emit.call(e,jr.startSave,{eventType:jr.startSave,code:-1,msg:e.i18n.t("START_RECORD_FAILED")}),null==e.emit||e.emit.call(e,ar.EVENTS.recordingChange,!1)})):Promise.resolve()}(this,e,t||this.urlInfo.validateCode))}startRecord(e,t){return this.startSave(e,t)}stopSave(){return this.recording?(this.autoVideoLevel=this.autoVideoLevelResume,function(e){var t,n;const i=yo.getInstance(e.id);return(null==i?void 0:i.getState().recordvideo)?(null==(n=e.Theme)||null==(t=n.setDecoderState)||t.call(n,{recordvideo:!1}),new Promise(((t,n)=>{var r;return null==(r=e.jSPlugin)?void 0:r.JS_StopSave().then((()=>{setTimeout((()=>{null==e||e.emit(jr.stopSave,{eventType:jr.stopSave,code:0,data:e.recordRes,msg:e.i18n.t("STOP_RECORD_SUCCESS")}),null==e.emit||e.emit.call(e,ar.EVENTS.recordingChange,!1),i.setState({recordvideo:!1}),setTimeout((()=>{e.recordRes=null}),50),e._recording=!1,t(Io({},e.recordRes||{}))}),200)})).catch((()=>{null==e||e.emit(jr.stopSave,{eventType:jr.stopSave,code:-1,msg:e.i18n.t("STOP_RECORD_FAILED")}),e.recordRes=null,n()}))}))):Promise.resolve()}(this)):Promise.resolve()}stopRecord(){return this.stopSave()}openSound(){return function(e){if(e._talking)return Promise.resolve();e.__muted=!1;const t=yo.getInstance(e.id);var n=null==e.jSPlugin.JS_OpenSound?void 0:e.jSPlugin.JS_OpenSound.call(e.jSPlugin,0);return null==e.emit||e.emit.call(e,jr.openSound,{eventType:jr.openSound,code:n,msg:e.i18n.t("OPEN_SOUND")}),yo.setGlobalState({sound:!0}),t.setState({sound:!0}),Array.isArray(yo.listInstances())&&yo.listInstances().map((t=>{t.state.sound&&t.id!=e.id&&yo.getInstance(t.id).setState({sound:!1})})),e.muted=!1,Promise.resolve(n)}(this)}closeSound(){return function(e){if(e._talking)return Promise.resolve();e.__muted=!0;var t=e.jSPlugin.JS_CloseSound(0);return null==e||e.emit(jr.closeSound,{eventType:jr.closeSound,code:t,msg:e.i18n.t("CLOSE_SOUND")}),yo.getInstance(e.id).setState({sound:!1}),yo.setGlobalState({sound:!1}),e.muted=!0,Promise.resolve(t)}(this)}enableZoom(){var e;(e=this).use3DZoom||e.zooming||(e.zooming=!0,null==e||e.emit(jr.zoom.openZoom))}closeZoom(){var e;!(e=this).use3DZoom&&e.zooming&&(e.zooming=!1,null==e.emit||e.emit.call(e,jr.zoom.closeZoom))}zoomAdd(e){!function(e,t){const n=e.zoom+(t||1);!e.use3DZoom&&e.zooming&&(e.zoom=n)}(this,e)}zoomSub(e){!function(e,t){const n=e.zoom-(t||1);!e.use3DZoom&&e.zooming&&(e.zoom=n)}(this,e)}enable3DZoom(){return No(this)}close3DZoom(){return function(e){if(!e.use3DZoom)return new Promise((function(t,n){var i,r;null==e.emit||e.emit.call(e,jr.close3DZoom,{eventType:jr.close3DZoom,code:-1,msg:null==(i=e.i18n)?void 0:i.t("3D_ZOOM_NOT_ACTIVED")}),t({code:-1,msg:null==(r=e.i18n)?void 0:r.t("3D_ZOOM_NOT_ACTIVED")})}));if(e.is3DZooming){var t;e.Theme&&e.Theme.setDecoderState({zoom:!1});const n=e.jSPlugin.JS_Disable3DZoom(0);return e.is3DZooming=!1,null==e.emit||e.emit.call(e,jr.close3DZoom,{eventType:jr.close3DZoom,code:n,msg:null==(t=e.i18n)?void 0:t.t("CLOSE_3D_ZOOM")}),Promise.resolve({code:n})}return new Promise((function(t,n){var i,r;null==e.emit||e.emit.call(e,jr.close3DZoom,{eventType:jr.close3DZoom,code:0,msg:null==(i=e.i18n)?void 0:i.t("3D_ZOOM_CLOSED")}),t({code:0,msg:null==(r=e.i18n)?void 0:r.t("3D_ZOOM_CLOSED")})}))}(this)}changeZoomType(e){return function(e,t){var n;if(t&&e.capacity&&!e.support3DZoom)return null==e.emit||e.emit.call(e,jr.changeZoomType,{eventType:jr.changeZoomType,code:-1,msg:null==(n=e.i18n)?void 0:n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),Promise.resolve({code:-1,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")});if(e.is3DZooming)e.close3DZoom();else if(e.Theme&&e.Theme.decoderState.state.zoom){var i,r;null==(r=e.Zoom)||null==(i=r.stopZoom)||i.call(r)}return e.Theme&&e.Theme.setDecoderState({zoom:!1}),e.use3DZoom=t,new Promise((n=>{setTimeout((()=>{var i,r;const o=document.getElementById(`${e.id}-zoom-content`);t?o&&(o.title=e.i18n.t("3D_ZOOM")):o&&(o.title=e.i18n.t("ZOOM")),e.isMobile&&t&&e.enable3DZoom(),null==e.emit||e.emit.call(e,jr.changeZoomType,{eventType:jr.changeZoomType,code:0,msg:null==(i=e.i18n)?void 0:i.t("CHANGE_ZOOM_TYPE")}),n({code:0,msg:null==(r=e.i18n)?void 0:r.t("CHANGE_ZOOM_TYPE")})}),500)}))}(this,e)}reSize(e,t){this.resize(e,t)}fast(e){return function(e,t){if(t)zo(e,t);else{const t=Nr.findIndex((t=>t===e.speed));var n;if(!(t>0&&t<=Nr.length-1))return null==(n=e.logger)||n.warn("it is already the maximum speed!"),"function"==typeof e.params.handleError&&e.params.handleError({msg:e.i18n.t("MAX_SPEED_LIMIT"),retcode:1003,code:-1,id:e.id,type:"fast"}),Promise.resolve({code:-1,data:{speed:e.speed,msg:e.i18n.t("MAX_SPEED_LIMIT")}});zo(e,Nr[t-1])}return new Promise((t=>{null==e.emit||e.emit.call(e,jr.fast,{eventType:jr.fast,code:0,data:e.speed,msg:e.i18n.t("SPEED")}),t({code:0,data:{speed:e.speed}})}))}(this,e)}slow(e){return function(e,t){if(t)zo(e,t);else{const t=Nr.findIndex((t=>t===e.speed));var n;if(!(t>=0&&t<Nr.length-1))return null==(n=e.logger)||n.warn("it is already the minimum speed!"),"function"==typeof e.params.handleError&&e.params.handleError({msg:e.i18n.t("MIN_SPEED_LIMIT"),retcode:1003,code:-1,id:e.id,type:"slow"}),Promise.resolve({code:-1,data:{speed:e.speed,msg:e.i18n.t("MIN_SPEED_LIMIT")}});zo(e,Nr[t+1])}return new Promise((t=>{null==e.emit||e.emit.call(e,jr.slow,{eventType:jr.slow,code:0,data:e.speed,msg:e.i18n.t("SPEED")}),t({code:0,data:{speed:e.speed}})}))}(this,e)}seek(e,t){return function(e,t,n){var i,r;if(e.loading=!0,t=t.replace(/T|Z|\/|-/gi,"").replace(/ /gi,"").replace(/:/gi,""),n=(n||"").replace(/T|Z|\/|-/gi,"").replace(/ /gi,"").replace(/:/gi,""),!/^(\d{14}|\d{6})$/.test(t)||n&&!/^(\d{14}|\d{6})$/.test(n)){var o,a,s;return"function"==typeof e.params.handleError&&e.params.handleError({msg:null==(s=e.i18n)?void 0:s.t("SEEK_TIMEFORMAT_ERROR"),retcode:-1,id:e.id,type:"handleError"}),null==e.emit||e.emit.call(e,jr.seek,{eventType:jr.seek,code:-2,msg:e.i18n.t("SEEK_TIMEFORMAT_ERROR")}),null==(a=e.logger)||a.error(null==(o=e.i18n)?void 0:o.t("SEEK_TIMEFORMAT_ERROR")),Promise.resolve(!1)}if(t=(e.urlInfo.searchParams.begin||Ur.formate(new Date,"YYYYMMDD")+"000000").slice(0,14-t.length)+t,n=n||t.replace(/\d{6}$/,"235959"),n=t.slice(0,14-n.length)+n,t.slice(0,8)!==n.slice(0,8)){var l,c,d;return"function"==typeof e.params.handleError&&e.params.handleError({msg:null==(d=e.i18n)?void 0:d.t("SEEK_CANNOT_CROSS_DAYS"),retcode:-1,code:-1,id:e.id,type:"handleError"}),null==e.emit||e.emit.call(e,jr.seek,{eventType:jr.seek,code:-1,msg:e.i18n.t("SEEK_CANNOT_CROSS_DAYS")}),null==(c=e.logger)||c.error(null==(l=e.i18n)?void 0:l.t("SEEK_CANNOT_CROSS_DAYS")),Promise.resolve(!1)}return Ur.strToDate(t).getTime()>=Ur.strToDate(n).getTime()?("function"==typeof e.params.handleError&&e.params.handleError({msg:"start time is greater than the end time",retcode:-1,code:-1,id:e.id,type:"handleError"}),null==e.emit||e.emit.call(e,jr.seek,{eventType:jr.seek,code:-1,msg:"start time is greater than the end time"}),null==(r=e.logger)||r.error("start time is greater than the end time"),Promise.resolve(!1)):(null==(i=e.jSPlugin)||i.JS_Seek(0,Ur.formate(t,"YYYYMMDDThhmmssZ"),Ur.formate(n,"YYYYMMDDThhmmssZ")),null==e.emit||e.emit.call(e,jr.seek,{eventType:jr.seek,seekTime:Ur.strToDate(t).getTime(),data:{begin:Ur.strToDate(t).getTime(),end:Ur.strToDate(n).getTime()}}),Promise.resolve(!0))}(this,e,t)}get isCurrentBrowserFullscreen(){return this.isCurrentFullscreen}startTalk(){!function(e){var t;if(!e._playing)return;const n=yo.getGlobalState(),i=yo.getInstance(e.id);var r,o,a,s;if(window.__CURRENT_PLAYER_TALK_ID=e.id,n.talk)return null==(o=e.logger)||o.warn(null==e||null==(r=e.i18n)?void 0:r.t("TALK_TALKING")),null==e||e.emit(jr.startTalk,{eventType:jr.startTalk,code:430005,msg:null==e||null==(a=e.i18n)?void 0:a.t("TALK_TALKING")}),null==e||e.emit("message",null==e||null==(s=e.i18n)?void 0:s.t("TALK_TALKING"),"warn"),void(null==e||e.emit(ar.EVENTS.talkingChange,!1));null==(t=e.Talk)||t.startTalk((t=>{var n,r,o,a;e.muted||t||(e.closeSound(),e.__talk_muted__=!0),(null==(n=e.controls)?void 0:n.volumeControl)&&(e.controls.volumeControl.disabled=!0),null==(a=e.Talk)||null==(o=a.eventEmitter)||null==(r=o.once)||r.call(o,"startTalk",(t=>{var n;null==e||null==(n=e.eventEmitter)||n.emit(jr.startTalk,t)})),e._talking=!0,null==e||e.emit(ar.EVENTS.talkingChange,!0),yo.setGlobalState({talk:!0}),i.setState({talk:!0})}))}(this)}stopTalk(){!function(e){var t,n,i;const r=yo.getGlobalState(),o=yo.getInstance(e.id);window.__CURRENT_PLAYER_TALK_ID="",r.talk?(null==(n=e.Talk)||null==(t=n.stopTalk)||t.call(n),null==e.emit||e.emit.call(e,jr.stopTalk,{eventType:jr.stopTalk,code:0,msg:"success"}),e._talking=!1,null==e||e.emit(ar.EVENTS.talkingChange,!1),(null==(i=e.controls)?void 0:i.volumeControl)&&e._playing&&(e.controls.volumeControl.disabled=!1),e.__talk_muted__&&(null==e.openSound||e.openSound.call(e)),e.__talk_muted__=!1,r.talk&&yo.setGlobalState({talk:!1}),o.getState().talk&&o.setState({talk:!1})):null==e.emit||e.emit.call(e,jr.stopTalk,{eventType:jr.stopTalk,code:-1,msg:"设备未发起对讲"})}(this)}setVolumeGain(e){return function(e,t){var n;return null==(n=e.Talk)?void 0:n.setVolumeGain(t)}(this,e)}getMicrophonePermission(){return null==(e=this.Talk)?void 0:e.getMicrophonePermission();var e}getMicrophonesList(){return null==(t=this.Talk)||null==(e=t.getMicrophonesList)?void 0:e.call(t);var e,t}setProfile(e){!function(e,t){var n,i;null==(i=e.Talk)||null==(n=i.setProfile)||n.call(i,t)}(this,e)}destroy(){var e=this,t=()=>super.destroy;return na((function*(){return ra=null,function(e){Go.apply(this,arguments)}(e),t().call(e),0}))()}getDeviceCapacity(){var e,t;(e=this).capacity={},null==(t=e.logger)||t.log("[https request] getDeviceCapacity()"),e._services.getDeviceCapacity().then((t=>{var n,i;e.capacity=t,e.support3DZoom=!1,e.capacity&&"1"==e.capacity.support_3d_position&&e.url.indexOf(".live")>-1&&(e.support3DZoom=!0,e.params.use3DZoom&&(e.use3DZoom=!0)),e.capacity&&"1"==e.capacity.support_device_auto_video_level&&(e.videoLevelList.push({level:"auto",name:"VIDEO_LEVEL_AUTO",streamTypeIn:1}),null==e.emit||e.emit.call(e,jr.setVideoLevelList,e.videoLevelList),null==e.on||e.on.call(e,jr.autoVideoLevel,(t=>{const n=e.videoLevelList.findIndex((t=>t.level===e.videoLevel));switch(t.code){case 0:break;case 1:const s=e.videoLevelList[n-1];var i,r;s&&"auto"!==s.level&&e.videoLevelList[n].streamTypeIn===s.streamTypeIn&&(null==(r=e.logger)||null==(i=r.log)||i.call(r,`卡顿比:${t.lagRate}%,降低清晰度至${s.level}`),e._setVideoLevel(s.level).then((()=>{var t;e.videoLevel=s.level,null==e||null==(t=e.emit)||t.call(e,jr.currentVideoLevel,"auto",e.videoLevel),setTimeout((()=>{const t=e.jSPlugin._JSPlayM4_GetFrameInfo(0);e._updateStreamInfo({resolution:_o(t.height)})}),5e3)})));break;case 2:const l=e.videoLevelList[n+1];var o,a;l&&"auto"!==l.level&&e.videoLevelList[n].streamTypeIn===l.streamTypeIn&&(null==(a=e.logger)||null==(o=a.log)||o.call(a,`卡顿比:${t.lagRate}%,提升清晰度至${l.level}`),e._setVideoLevel(l.level).then((()=>{e.videoLevel=l.level,null==e.emit||e.emit.call(e,jr.currentVideoLevel,"auto",e.videoLevel),setTimeout((()=>{const t=e.jSPlugin._JSPlayM4_GetFrameInfo(0);e._updateStreamInfo({resolution:_o(t.height)})}),5e3)})))}}))),null==e.emit||e.emit.call(e,jr.getDeviceCapacity,{eventType:jr.getDeviceCapacity,code:0,data:t,msg:null==(i=e.i18n)||null==(n=i.t)?void 0:n.call(i,"GET_CAPACITY")})}))}getVideoLevelList(){return function(e){var t,n;let i=[];return i=(null==(t=e.params.videoLevelList)?void 0:t.length)>=0?e.params.videoLevelList:e.videoLevelList,null==e.emit||e.emit.call(e,jr.getVideoLevelList,{eventType:jr.getVideoLevelList,code:0,data:i,msg:null==(n=e.i18n)?void 0:n.t("GET_VIDEO_LEVEL_LIST")}),i}(this)}getVideoLevel(){return null==(e=this)||e.emit(jr.getVideoLevel,{eventType:jr.getVideoLevel,code:0,data:e.videoLevel}),e.videoLevel;var e}getPtzStatus(){return(null==(t=(e=this).controls)?void 0:t.ptzControl)?(null==e.emit||e.emit.call(e,jr.getPtzStatus,{eventType:jr.getPtzStatus,code:0,data:e.controls.ptzControl.active,msg:e.i18n.t("GET_PTZ_STATUS")}),e.controls.ptzControl.active):(null==e.emit||e.emit.call(e,jr.getPtzStatus,{eventType:jr.getPtzStatus,code:-1,data:!1,msg:e.i18n.t("GET_PTZ_STATUS_FAILED")}),!1);var e,t}openPtz(){var e,t;if(null==(e=this.controls)?void 0:e.ptzControl)return(t=this).controls.ptzControl?(t.isMobile?t.isCurrentFullscreen?t.controls.ptzControl.active=!0:null==t.emit||t.emit.call(t,jr.ptz.openPtz,{eventType:jr.ptz.openPtz,code:-1,msg:t.i18n.t("MOBILE_HIDE_PTZ")}):t.controls.ptzControl.active=!0,{code:0}):(null==t.emit||t.emit.call(t,jr.ptz.openPtz,{eventType:jr.ptz.openPtz,code:-1,msg:t.i18n.t("OPTION_PTZ_FAILED")}),{code:-1,msg:t.i18n.t("OPTION_PTZ_FAILED")});this.logger.warn(this.i18n.t("OPTION_PTZ_FAILED"))}closePtz(){var e,t,n;if(null==(e=this.controls)?void 0:e.ptzControl)return(null==(n=(t=this).controls)?void 0:n.ptzControl)?(t.controls.ptzControl.active=!1,{code:0}):{code:-1,msg:t.i18n.t("OPTION_PTZ_FAILED")};this.logger.warn(this.i18n.t("OPTION_PTZ_FAILED"))}getPlayRate(){return null==this.emit||this.emit.call(this,jr.getPlayRate,{eventType:jr.getPlayRate,code:0,data:this.speed,target:this,msg:this.i18n.t("GET_SPEED")}),this.speed}setMirrorFlip(e){var t,n;return"number"!=typeof e?(null==this.emit||this.emit.call(this,jr.setMirrorFlip,{eventType:jr.setMirrorFlip,code:-1,target:this,msg:this.i18n.t("MIRROR_TYPE_ERROR")}),Promise.reject({code:-1,msg:this.i18n.t("MIRROR_TYPE_ERROR")})):(null==this.emit||this.emit.call(this,jr.setMirrorFlip,{eventType:jr.setMirrorFlip,code:0,target:this,msg:this.i18n.t("MIRROR")}),null==(n=this.logger)||null==(t=n.log)||t.call(n,"[https request] postDevicePtzMirror() command",e),this._services.postDevicePtzMirror(e))}setFECCorrectType(e,t){return $o(this,e)}setFEC3DViewParam(e){return function(e,t){var n,i,r;return!e._FECCorrectType||((null==(n=e.jSPlugin)?void 0:n.isHardH264)||(null==(i=e.jSPlugin)?void 0:i.isHardH265))&&(null==(r=e.jSPlugin)?void 0:r.useHardDev)?(null==e.emit||e.emit.call(e,jr.setFEC3DViewParam,{eventType:jr.setFEC3DViewParam,code:-1,msg:e.i18n.t("FEC.FEC_SUPPORT_VERSION")}),Promise.resolve({code:-1,msg:e.i18n.t("FEC.FEC_SUPPORT_VERSION")})):e.jSPlugin.FEC_Set3DViewParam&&e._FECCorrectType&&(3===e._FECCorrectType.place&&1536===e._FECCorrectType.correctType||1===e._FECCorrectType.place&&2304===e._FECCorrectType.correctType)?e.jSPlugin.FEC_Set3DViewParam(t).then((()=>(null==e.emit||e.emit.call(e,jr.setFEC3DViewParam,{eventType:jr.setFEC3DViewParam,code:0,msg:e.i18n.t("FEC.SET_FEC_PARAMS")}),{code:0}))).catch((()=>(null==e.emit||e.emit.call(e,jr.setFEC3DViewParam,{eventType:jr.setFEC3DViewParam,code:-1}),{code:-1}))):(null==e.emit||e.emit.call(e,jr.setFEC3DViewParam,{eventType:jr.setFEC3DViewParam,code:-1,msg:e.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.resolve({code:-1,msg:e.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}(this,e)}getFEC3DViewParam(e){return $o(this,e)}setWaterMarkFont(e){return function(e,t){return null==e.emit||e.emit.call(e,jr.setWaterMarkFont,{eventType:jr.setWaterMarkFont,code:0,data:t,msg:e.i18n.t("SET_WATERMARK")}),e.waterMark_JSPlugin=t,e.jSPlugin.JS_SetWaterMarkFont(t)}(this,e)}setTimeLineClickable(e){this.timeLineClickable=e,this.Theme&&this.Theme.Rec&&this.Theme.Rec.timeLine&&this.Theme.Rec.timeLine.setTimeLineClickable(e)}setLoggerOptions(e={}){var t,n;super.setLoggerOptions(e),null==(n=this.jSPlugin)||null==(t=n.player)||t.setLogger({level:e.level,showTime:e.showTime})}setDisplayRegion(e,t,n,i){var r,o;null==this.emit||this.emit.call(this,jr.setDisplayRegion,{left:e,right:t,top:n,bottom:i}),null==(o=this.jSPlugin)||null==(r=o.player)||r.setDisplayRegion(e,t,n,i)}_initGetDeviceSupportQuality(){return this.url.indexOf(".live")>-1?new Promise((e=>{this._beforeInitGetDeviceSupportQuality().then((t=>{if(["0","1","2","3","4","5","6","pp","qp"].includes(this._quality+"")||this._quality<0){const t=this.params.videoLevelList||this.videoLevelList;let i={};if("pp"===this._quality)i=t[0];else if("qp"===this._quality)try{i=t[t.length-1]}catch(e){}else i=t.find((e=>e.level===+this._quality));var n;if(i)ho(this,i.level).then((()=>{e()})),this.videoLevel=i.level,this.streamTypeIn=i.streamTypeIn,null==this.emit||this.emit.call(this,jr.currentVideoLevel,i,i.level);else null==(n=this.logger)||n.warn(`quality(${this._quality}) does not exist!`),e()}else e()}))})):Promise.resolve()}_beforeInitGetDeviceSupportQuality(){if(ra&&ra.getDeviceSupportQualityRes&&ra.getDeviceListRes){var e,t;const n=ra.getDeviceListRes.find((e=>e.channelNo===+this.urlInfo.channelNo));this._setVideoLevelList(this.params.videoLevelList?this.params.videoLevelList:ra.getDeviceSupportQualityRes);let i={};return i="compatible"===(null==(e=this.videoLevelList[0])?void 0:e.type)?this.url.indexOf(".hd.live")>0?this.videoLevelList[1]:this.videoLevelList[0]:this.videoLevelList.find((e=>e.level==(null==n?void 0:n.videoLevel)))||{},(null==i?void 0:i.streamTypeIn)?(this.videoLevel=i.level,this.streamTypeIn=i.streamTypeIn):(null==(t=this.videoLevelList)?void 0:t.length)>0&&(this.videoLevel=this.videoLevelList[0].level,this.streamTypeIn=this.videoLevelList[0].streamTypeIn,i=this.videoLevelList[0]),Promise.resolve([[ra.getDeviceSupportQualityRes,ra.getDeviceListRes]])}let n=[Eo(this)];return Promise.all(n)}_deviceSerialChangeServices(){var e=this;return na((function*(){var t,n,i,r;return Promise.all([null==(t=e._services)?void 0:t.getAppKey().then((t=>{var n,i,r,o,a,s;200===(null==t||null==(n=t.meta)?void 0:n.code)?(null==(o=e.logger)||null==(r=o.log)||r.call(o,"[https response] getAppKey()",JSON.stringify(t.data)),null==(a=e._collect)||a.updateAppKey(t.data.appKey)):null==(s=e._collect)||s.updateAppKey("test");return(null==t||null==(i=t.data)?void 0:i.appKey)||""})),(n=e,null==(i=n.logger)||i.log("[https request] getDeviceInfo()"),null==(r=n._services)?void 0:r.getDeviceInfo().then((e=>{var t,i;return n.deviceInfo=e,null==n.emit||n.emit.call(n,jr.http.getDeviceInfo,e),null==(i=n.controls)||null==(t=i.deviceControl)||t.update(null==e?void 0:e.deviceName,null==e?void 0:e.deviceSerial,""),e}))),e.getDeviceCapacity(),wo(e)])}))()}supportSeek(){var e,t,n;return("cloud"===(null==(e=this.urlInfo)?void 0:e.recType)||this.options.useSeek&&"1"===(null==(t=this.capacity)?void 0:t.support_seek_playback))&&!(null==(n=this.urlInfo)?void 0:n.deviceSerial.includes(":"))}_isLive(){return this.url.indexOf(".live")>=0}_updateStreamInfo(e){this.showStreamInfo&&Object.keys(e).length>0&&Object.keys(e).map((t=>{const n=this.$container.querySelector(`.ezplayer-streamInfo-${t}-value`);n&&(n.innerHTML=e[t])}))}displayStreamInfo(e){this.showStreamInfo=e;const t="ezplayer-streamInfo";if(e&&this.$container){var n,i;null==(i=this.jSPlugin)||null==(n=i.player)||n.setStreamInfoCallBackType(0);const e=`\n <div class="${t}-videoFormat">${this.i18n.t("videoFormat")}: <span class="${t}-videoFormat-value">${this.streamInfo.videoFormat}</span></div>\n <div class="${t}-frameRate">${this.i18n.t("frameRate")}: <span class="${t}-frameRate-value">${this.streamInfo.frameRate}</span></div>\n <div class="${t}-systemFormat">${this.i18n.t("systemFormat")}: <span class="${t}-systemFormat-value">${this.streamInfo.systemFormat}</span></div>\n <div class="${t}-resolution">${this.i18n.t("resolution")}: <span class="${t}-resolution-value">${this.streamInfo.resolution}</span></div>\n <div class="${t}-codeRate">${this.i18n.t("bitrate")}: <span class="${t}-codeRate-value">${this.streamInfo.codeRate}</span></div>\n <div class="${t}-frameLostRate">${this.i18n.t("frameLostRate")}: <span class="${t}-frameLostRate-value">${this.streamInfo.frameLostRate}</span></div>\n <div class="${t}-lagRate">${this.i18n.t("lagRate")}: <span class="${t}-lagRate-value">${this.streamInfo.lagRate}</span></div>\n `;var r;if(this._$streamInfo||(this._$streamInfo=document.createElement("div"),this._$streamInfo.classList.add(`${t}`),this._$streamInfo.style.cssText=`\n position: absolute;\n ${this.isMobile?"top:32px;":"top: 48px;"}\n ${this.isMobile?"font-size:12px;":"font-size:14px;"}\n right: 10px; color: #52C41A; width: 170px; background-color: rgba(0,0,0,0.6);\n user-select: none;\n pointer-events: none;\n padding: 10px;\n z-index:2;\n `),this._$streamInfo)this._$streamInfo.innerHTML=e,null==(r=this.$container)||r.appendChild(this._$streamInfo)}else{var o,a;this._$streamInfo&&(this._$streamInfo.remove(),this._$streamInfo=null),null==(a=this.jSPlugin)||null==(o=a.player)||o.setStreamInfoCallBackType(1)}}constructor(t){var a,s,l,d,u,p,h,m,A,f,v,g,y,T;if(super(ia({},e(Mr,t,{clone:!1}),(null==(a=t.videoLevelList)?void 0:a.length)||(null==t||null==(l=t.definitionOptions)||null==(s=l.list)?void 0:s.length)?{definitionOptions:{value:null==t||null==(d=t.definitionOptions)?void 0:d.value,list:(null==t||null==(u=t.definitionOptions)?void 0:u.list)||t.videoLevelList}}:{},{capturePictureOptions:ia({type:0!=t.download?"download":"base64"},t.capturePictureOptions||{}),staticPath:(null==(p=t.staticPath)?void 0:p.startsWith("http"))?t.staticPath:o(t.staticPath||"https://openstatic.ys7.com/ezuikit_js/v8.2.2/ezuikit_static"),autoPlay:e(Mr,t,{clone:!1}).autoplay,container:document.getElementById(t.id),type:"ezopen"})),this._services=null,this._recOSDTimer=null,this.videoInfo={},this.audioInfo={},this.urlInfo={},this._$streamInfo=null,this._handleRealUrl=e=>e,this.params=e(Mr,ia({},t,{videoLevelList:(null==t||null==(h=t.definitionOptions)?void 0:h.list)||t.videoLevelList}),{clone:!1}),!t.id)throw new Error("id param is required!");if(!document.getElementById(t.id))throw new Error(`#${this.params.id} node does not exist`);this.i18n.appendTranslations({zh:hr,en:mr}),this.eventEmitter={on:this.on.bind(this),emit:this.emit.bind(this),off:this.off.bind(this),once:this.once.bind(this),removeAllListeners:this.removeAllListeners.bind(this)},this.params.autoplay&&(this.loading=!0),this.autoplay=this.params.autoplay,this.logger.setOptions({name:(this.params.loggerOptions.name+" #"+t.id).replace(/^ /,"")}),this.logger.log("[version]",oa.version),this.isStoping=!1,this.sdkType=void 0!==this.params.sdkType?this.params.sdkType:"base",this.talkChannelNo=t.talkChannelNo||null,Ko(this),this.emit(jr.init),this.timeZone=0,this.ptzSpeed=t.ptzSpeed||2,this.download=void 0===t.download||t.download,this.downloadRecord=void 0===t.downloadRecord||t.downloadRecord,this.timeLineClickable=void 0!==t.timeLineClickable&&t.timeLineClickable,this.onTimeLineClick=void 0!==t.onTimeLineClick?t.onTimeLineClick:null,this.recordRes={},this.disableRenderPrivateData=void 0===t.disableRenderPrivateData||t.disableRenderPrivateData,this.ptzSpeedOptions={slow:1,mid:2,fast:3},window.EZUIKit[t.id]={state:{EZUIKitPlayer:{talkInit:window.EZUIKit[t.id]&&window.EZUIKit[t.id].state&&window.EZUIKit[t.id].state.EZUIKitPlayer.talkInit||!1}}},this.urlInfo=i(t.url),this._services=new ro({sdkType:this.sdkType,baseURL:this.params.env?this.params.env.domain:Or,accessToken:t.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo,token:t.token||{},ezopenParams:(null==(m=t.extraParams)?void 0:m.ezopenParams)||{},timeZone:null==(A=this.urlInfo.searchParams)?void 0:A.timeZone}),this.logger.log("[Services] init"),new Ao(this.params.env?this.params.env.domain:null),this.id=t.id,this.isCall=t.isCall||!1,this.callTime=t.callTime||null,this.hangUpCallback=t.hangUpCallback||null,this.isNeedBellRing=!1!==t.isNeedBellRing,this.url=t.url,this.accessToken=t.accessToken,this.deviceSerial=this.urlInfo.deviceSerial,this.channelNo=this.urlInfo.channelNo,this.poster=t.poster,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.capacity=null,this.playTimer=null,this.env={domain:Or},void 0!==t.env&&(this.env=Object.assign(this.env,t.env)),this.isMobile=n(),this.support3DZoom=!1,this.use3DZoom=!1,this.is3DZooming=!1,this.useHardDev=void 0!==t.useHardDev&&t.useHardDev,this._spaceId=cr("spaceId",this.url)||this.options.spaceId,this.waterMark_JSPlugin=!1,this.useSeek=t.useSeek,this.dpr=t.dpr||1,this.decoderType=t.decoderType||"auto",this.videoLevel=1,this.streamTypeIn=1,this.autoVideoLevel=!1,this.autoVideoLevelResume=!1,this.lagRateCycle=t.lagRateCycle||30,this.showStreamInfo=void 0!==t.showStreamInfo&&t.showStreamInfo,this.streamInfo={videoFormat:"",frameRate:"0FPS",systemFormat:"",resolution:"",codeRate:"0Kbps",frameLostRate:"0%",lagRate:"0%"},this.frameDecordTime=0,this.language=t.language||"zh",this.languageList=t.languageList||["zh","en"],-1===this.languageList.indexOf(this.language)&&(this.logger.warn(`language [${this.language}] is currently not supported and has been switched to zh`),this.language="zh"),this.token=t.token||{},this.deviceInfo={},this._quality=t.quality,this.isInspect=t.isInspect||!1,this.inspectRecordingDuration=t.inspectRecordingDuration||144e5,this.inspectVideoWidth=t.inspectVideoWidth||290,this.inspectVideoHeight=t.inspectVideoHeight||170,this._FECCorrectType=null,this._FECSplitIds="",this.initSuccessTime=0,this._initTime=0,this._gotWsUrlTime=0,this._startGetWsUrlTime=0,this.appearFirstFrameTime=0,this._openStreamTime=0,this.maxReloadTime=0,this.maxAddressAccount=t.maxAddressAccount||1e3,this.reloadCodeBalckList=t.reloadCodeBalckList||[5402,5406,5411,5507,5546,9048,9049,5451,5558,6701];const _=!this.useHardDev&&Pr()||this.useHardDev&&!zr()&&!xr()&&Pr()||this.useHardDev&&(zr()||xr()||Pr());this.isV3=_,void 0!==t.isMobile&&(this.isMobile=t.isMobile),this._monitorReport=!1!==t.dataReport&&("https:"===(null==(v=window)||null==(f=v.location)?void 0:f.protocol)&&!function(e){const t=e.split(".").map((function(e){return!Number.isNaN(e)}));return 4===t.length&&t.every(Boolean)}(null==(y=window)||null==(g=y.location)?void 0:g.hostname)),this._collect=new so({domain:null==(T=this.env)?void 0:T.domain,monitorReport:this._monitorReport,pluginVersion:this.isV3?"v3":"v1",extendsInfo:{v:"8.2.2",getDynamic:()=>{var e;return{protocol:"ezopen",url:this.url,serial:this.urlInfo.deviceSerial,no:this.urlInfo.channelNo,env:null==(e=this.env)?void 0:e.domain,type:this.urlInfo.type}}}}),this.logger.log("[Collect] init");let b=JSON.parse(localStorage.getItem(Ir))||{},C=Object.keys(b);C.length>this.maxAddressAccount&&C.map(((e,t)=>{t<C.length&&t>C.length-this.maxAddressAccount||delete b[e]}));try{const e=this.deviceSerial+"_"+this.channelNo;b[e]||(b=ia({},b,{[e]:[]}),localStorage.setItem(Ir,JSON.stringify(b))),localStorage.getItem(Rr)&&localStorage.removeItem(Rr)}catch(e){}var S;this.logger.log("[options]",JSON.stringify(this.params)),this.startPlayTime=(new Date).valueOf(),this._init(),this.play=c((e=>this._play(e)),500,!0),this.resume=c((e=>this._resume(e)),500,!0),this.changePlayUrl=c(((e,t,n)=>this._changePlayUrl(e,t,n)),500),window.addEventListener("beforeunload",(()=>{if(!this.destroyed)try{yo.removeInstance(this.id),this.stop()}catch(e){}})),null==(S=this)||S.on(jr.talkSuccess,(e=>{S.Theme&&!S.Theme.decoderState.state.talk&&S.id===e.id&&S.Theme.setDecoderState({talk:!0});const t=yo.getGlobalState(),n=yo.getInstance(S.id);t.talk||yo.setGlobalState({talk:!0}),n.getState().talk||n.setState({talk:!0})})),null==S||S.on(jr.talkError,(()=>{var e,t;null==(t=S.Theme)||null==(e=t.setDecoderState)||e.call(t,{talk:!1});const n=yo.getGlobalState(),i=yo.getInstance(S.id);n.talk&&yo.setGlobalState({talk:!1}),i.getState().talk&&i.setState({talk:!1})})),null==S||S.on(jr.stop,(()=>{S.stopSave()})),null==S||S.on(jr.pause,(()=>{S.stopSave()})),function(e){var t,n;e.on(ar.EVENTS.changeTheme,(()=>{e.recording&&e.stopRecord()})),e.on(ar.EVENTS.control.play,(t=>{t?e.recType&&e._recOSDTimer?e.resume():e.play():e.pause()})),e.on(ar.EVENTS.control.capturePicture,(t=>{const n="download"===t.type;e.capturePicture(void 0,!1,n,t.cloudRecUpload).then((t=>{var n,i;null==(i=e.controls)||null==(n=i.capturePictureControl)||n.emit(ar.EVENTS.control.capturePictureResult,t)}))})),e.on(ar.EVENTS.volumechange,((t,n)=>{n!==e.__muted&&(n?e.closeSound():e.openSound())})),e.on(ar.EVENTS.control.recordingChange,(t=>{t?e.startSave():e.stopSave()})),e.on(ar.EVENTS.control.talkingChange,(t=>{t?e.startTalk():e.stopTalk()})),null==(n=e.Talk)||null==(t=n.eventEmitter)||t.on("talkVolumeChange",(({data:t})=>{e.emit(ar.EVENTS.talkVolumeChange,t)})),e.on(ar.EVENTS.control.definitionChange,(t=>{e.resetControl(),e.changeVideoLevel(t)})),e.on(ar.EVENTS.control.speedChange,(t=>{e.fast(t)})),e.on(ar.EVENTS.control.recTypeChange,(t=>{var n,i;e.resetControl(),e._recOSDTimer&&(clearInterval(e._recOSDTimer),e._recOSDTimer=null),e._seekIntervaltimer&&(clearInterval(e._seekIntervaltimer),e._seekIntervaltimer=null);const o=(null==(i=e.urlInfo)||null==(n=i.searchParams)?void 0:n.spaceId)||e.options.spaceId,a=r(e.url,{type:"rec",recType:"rec"===t?"":"cloud",search:"cloudRecord"===t?"busType=7"+(o?`&spaceId=${o}`:""):"busType="+(o?"&spaceId=":"")});e._speed=1,e.changePlayUrl({url:a})})),e.on(ar.EVENTS.control.dateChange,(t=>{const n=Ur.formate(t,"YYYYMMDD");e.resetControl(),e._recOSDTimer&&(clearInterval(e._recOSDTimer),e._recOSDTimer=null),e._seekIntervaltimer&&(clearInterval(e._seekIntervaltimer),e._seekIntervaltimer=null);const i=r(e.url,{search:`begin=${n+"000000"}&end=${n+"235959"}`});e._speed=1,e.changePlayUrl({url:i})})),e.on(ar.EVENTS.control.timeLineChange,(t=>{var n;e.recording&&e.stopSave();let i="";var o,a,s,l;if("string"==typeof t?i=Ur.formate((null==(a=e.urlInfo)||null==(o=a.searchParams)?void 0:o.begin)?Ur.strToDate(null==(l=e.urlInfo)||null==(s=l.searchParams)?void 0:s.begin):new Date,"YYYYMMDD")+`${t.replace(/:/gi,"")}`:t instanceof Date&&(i=Ur.formate(t,"YYYYMMDDhhmmss")),null==(n=e.recordList)?void 0:n.length){const t=Ur.strToDate(e.recordList[e.recordList.length-1].endTime).getTime();if(Ur.strToDate(i).getTime()>=t)return void e.logger.warn("seek time is greater than the last record end time")}if(e._recOSDTimer&&(clearInterval(e._recOSDTimer),e._recOSDTimer=null),e._seekIntervaltimer&&(clearInterval(e._seekIntervaltimer),e._seekIntervaltimer=null),e.supportSeek()&&e.playing){var c;e.__noSyncOSD=!0;const t=Ur.strToDate(i).getTime()>(null==(c=e._seekDate)?void 0:c.getTime());e._seekDate=Ur.strToDate(i),e.seek(i.substr(8,6),"235959").then((()=>{e.__noSyncOSD=!0,e._seekIntervaltimer=setInterval((()=>{e.getOSDTime().then((n=>{n.data&&(t&&1e3*n.data>=Ur.strToDate(i).getTime()||!t&&1e3*n.data-2e3>=Ur.strToDate(i).getTime())&&(e.loading=!1,clearInterval(e._seekIntervaltimer),e.__noSyncOSD=!1,e._seekIntervaltimer=null,e.loading=!1,e._recOSDTimer=setInterval(ea((function*(){null==e.getOSDTime||e.getOSDTime.call(e)})),1e3))}))}),1e3)}))}else{const t=r(e.url,{search:`begin=${i}`});e.play({url:t,unSaveUrl:!0,showPoster:!0})}})),e.on("Control.contentRerender",(t=>{var n,i,r;null==(r=e.jSPlugin)||null==(i=r.player)||null==(n=i.emit)||n.call(i,"Control.contentRerender",t)}))}(this)}}oa.Talk=kr,oa.provider=yo,oa.LOCALES={zh:hr,en:mr},oa.EVENTS=jr,oa.version="8.2.2",oa.prototype.tokenSchema={streamToken:{live:{actionType:"PREVIEW",resourceCategory:"global"},rec:{actionType:"PLAYBACK",resourceCategory:"global"},talk:{actionType:"TALK",resourceCategory:"global"}},deviceToken:{video:{action:"*",resourceCategory:"video"},global:{action:"*",resourceCategory:"global"}},httpToken:{url:{urlPattern:"/**"}}},oa.prototype.deepCheck=(e,t,n=1)=>{if(n<0)return{};let i={};for(const r in e)if(void 0!==e[r]&&void 0===t[r])i[r]=e[r];else if("object"==typeof e[r]&&!Array.isArray(e[r])){const o=oa.prototype.deepCheck(e[r],t[r],n-1);Object.keys(o).length>0&&(i[r]=o)}return i},oa.prototype.checkToken=e=>oa.prototype.deepCheck(oa.prototype.tokenSchema,e);class aa{on(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t))}emit(e,t){e&&this.events[e]&&this.events[e].forEach((e=>e(t)))}off(e,t){e&&t&&this.events[e]&&this.events[e].splice(this.events[e].indexOf(t),1)}once(e,t){const n=this;this.on(e,(function i(){const r=Array.prototype.slice.call(arguments);t.apply(null,r),n.off(e,i)}))}removeAllListener(){this.events={}}constructor(){this.events={}}}function sa(){return sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},sa.apply(this,arguments)}const la={list:[],pageSize:4,pageIndex:0,autoTurn:!1,autoPlay:!0,delay:1e4,loop:!1,selectScreen:0,text:"请选择播放设备",imgUrl:"",onScreenSelect:()=>{},onPageChange:()=>{}};class ca{_initScreen(e){const t=this.status.list[e];if(t&&"container"in t&&t.container)return t.container;const n=document.createElement("div");var i;if(n.id=this.container.id+"-screen-"+e,n.style.cssText=null!=(i=this.status.screenStyle)?i:`\n width: ${this.status.list[e]&&this.status.list[e].width?this.status.list[e].width:600}px;\n height: ${this.status.list[e]&&this.status.list[e].height?this.status.list[e].height:400}px;\n position: relative;\n overflow: hidden;\n background-color: #000;\n background-image: url('${this.status.imgUrl}');\n background-size: 100% 100%;\n `,this.status.text){const t=document.createElement("span");var r;t.style.cssText=null!=(r=this.status.textStyle)?r:"\n color: #fff;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n ",t.innerText=this.status.text,n.appendChild(t);const i=this.container.children[e];i?this.container.insertBefore(n,i):this.container.appendChild(n)}return n}_destroyScreen(e){const t=document.getElementById(`${this.container.id}-screen-${e}`);t&&this.container.removeChild(t)}constructor(e,t){if(this.destroyScreen=(e,t)=>{this.screenList[e].destroy(),delete this.screenList[e],this._destroyScreen(e),!t&&this._initScreen(e)},this._emitInitPlayerResult=(e,t)=>{const n={eventType:"initPlayer",code:e,msg:t};this.eventEmitter.emit("initPlayer",n)},this.initPlayer=(e,t,n)=>{const i=this.status.pageIndex,r=this.status.pageSize,o=this.status.list;let a;if(void 0!==n){const e=void 0!==t?t:this.status.selectScreen;this.screenList[e]?(this.screenList[e].player&&this.screenList[e].player.destroy().then((()=>{this._destroyScreen(e),this._initScreen(e)})),a=new oa(n),this.screenList[e].options=n,this.screenList[e].player=a):(a=new oa(n),this.screenList.push({options:n,player:a})),this.status.list.push(n),this._emitInitPlayerResult(0,"初始化成功")}else if(o.length>0)if(void 0!==e)if(e>=0&&e<o.length){const n=void 0!==t?t:this.status.selectScreen;this.screenList[n].player&&this.screenList[n].player.destroy().then((()=>{this._destroyScreen(n),this._initScreen(n)})),a=new oa(sa({id:this.container.id+"-screen-"+n,audioOnly:!1},o[e],{handleInitSuccess:()=>{this.screenSelect(this.status.selectScreen)}})),this.screenList[n].options=o[e],this.screenList[n].player=a,this._emitInitPlayerResult(0,"初始化成功")}else this._emitInitPlayerResult(-1,"当前下标超出范围");else o.map(((e,t)=>{t>=i*r&&t<(i+1)*r&&(a=new oa(sa({id:this.container.id+"-screen-"+t,audioOnly:!1},e)),this.screenList[t]={options:e,player:a})})),this._emitInitPlayerResult(0,"初始化成功");return a},this._emitPageResult=(e,t,n)=>{const i={eventType:e,code:t,msg:n,data:{pageSize:this.status.pageSize,pageIndex:this.status.pageIndex}};this.eventEmitter.emit(e,i),this.options.onPageChange&&this.options.onPageChange(i)},this.setList=e=>{this.status.list=e},this.getList=()=>this.status.list,this.nextPage=()=>{const{pageSize:e,loop:t,list:n}=this.status,i=this.status.pageIndex+1,r=i*e<n.length;if(r||t){this.status.pageIndex=r?i:0;const t=this.status.pageIndex*e,o=t+e,a=n.slice(t,o);if(a.forEach(((e,t)=>{this.screenList[t].player&&this.screenList[t].player.destroy().then((()=>{this._destroyScreen(t),this._initScreen(t)})),this.status.autoPlay?(this.screenList[t].options=e,this.screenList[t].player=new oa(sa({id:`${this.container.id}-screen-${t}`,audioOnly:!1},e))):delete this.screenList[t].player})),a.length<e&&this.screenList.length>a.length)for(let e=a.length;e<this.screenList.length;e++)this.screenList[e].player&&this.screenList[e].player.destroy&&this.screenList[e].player.destroy(),this.screenList[e]={},this._destroyScreen(e),this._initScreen(e);this._emitPageResult("nextPage",r?0:1,r?"下翻页成功":"回到第一页")}else this._emitPageResult("nextPage",-1,"已到最后一页")},this.lastPage=()=>{const{pageSize:e,loop:t,list:n}=this.status;let i=this.status.pageIndex-1;const r=i>=0;if(!r&&t){const t=Math.floor(n.length/e),r=n.length%e==0;i=r?t-1:t;let o=i*e,a=o+e;const s=n.slice(o,a);if(!r)for(let e=s.length;e<this.screenList.length;e++)this.screenList[e].player&&this.screenList[e].player.destroy&&this.screenList[e].player.destroy(),this.screenList[e]={},this._destroyScreen(e),this._initScreen(e);s.forEach(((e,t)=>{this.screenList[t].player&&this.screenList[t].player.destroy().then((()=>{this._destroyScreen(t),this._initScreen(t)})),this.status.autoPlay?(this.screenList[t].options=e,this.screenList[t].player=new oa(sa({id:`${this.container.id}-screen-${t}`,audioOnly:!1},e))):delete this.screenList[t].player})),this.status.pageIndex=i,this._emitPageResult("lastPage",1,"翻至最后一页")}else if(r){const t=i*e,r=t+e;n.slice(t,r).forEach(((e,t)=>{this.screenList[t].player&&this.screenList[t].player.destroy().then((()=>{this._destroyScreen(t),this._initScreen(t)})),this.status.autoPlay?(this.screenList[t].options=e,this.screenList[t].player=new oa(sa({id:`${this.container.id}-screen-${t}`,audioOnly:!1},e))):delete this.screenList[t].player})),this.status.pageIndex=i,this._emitPageResult("lastPage",0,"上翻页成功")}else this._emitPageResult("lastPage",-1,"已到第一页")},this.pageTo=e=>{const t=this.status.pageSize,n=this.status.list,i=Math.ceil(n.length/t);if(e>=0&&e<i){this.status.pageIndex=e,n.slice(e*t,(e+1)*t).map(((e,t)=>{this.screenList[t].player&&this.screenList[t].player.destroy().then((()=>{this._destroyScreen(t),this._initScreen(t)})),this.status.autoPlay?(this.screenList[t].options=e,this.screenList[t].player=new oa(sa({id:`${this.container.id}-screen-${t}`,audioOnly:!1},e))):delete this.screenList[t].player}));const i={eventType:"pageTo",code:0,msg:"跳转成功",data:{pageSize:t,pageIndex:e}};this.eventEmitter.emit("pageTo",i),this.options.onPageChange&&this.options.onPageChange(t,e)}else{const e={eventType:"pageTo",code:-1,msg:"目标页码超出范围",data:{pageSize:t,pageIndex:this.status.pageIndex}};this.eventEmitter.emit("pageTo",e),this.options.onPageChange&&this.options.onPageChange(e)}},this.startTurn=()=>{const e=this.status.delay;this.status.autoTurn=!0,this.turnInterval=setInterval((()=>{this.nextPage()}),e)},this.stopTurn=()=>{this.status.autoTurn=!1,clearInterval(this.turnInterval)},this.setDelay=e=>{this.stopTurn(),this.status.delay=e,this.startTurn()},this.setLoop=e=>{this.status.loop=e,this.status.pageSize>=this.status.list.length&&(this.status.loop=!1)},this.changePageSize=e=>{const t=this.status.pageIndex,n=this.screenList;let i=this.status.list.slice(t*e);if(e<n.length){for(let t=e;t<n.length;t++)n[t].player&&n[t].player.destroy&&n[t].player.destroy(),this._destroyScreen(t);this.screenList=n.slice(0,e)}else if(e>n.length)for(let t=n.length;t<e;t++)this._initScreen(t),i[t]&&this.status.autoPlay?(this.screenList[t].options=i[t],n[t].player=new oa(sa({id:`${this.container.id}-screen-${t}`,audioOnly:!1},i[t]))):n[t]={};this.status.pageSize=e},this.screenSelect=e=>{this.status.selectScreen=e;const t=this.screenList;return this.options.onScreenSelect&&this.options.onScreenSelect(e,t[e]),t[e]},this.setText=e=>{this.status.text=e},this.setBackground=e=>{this.status.imgUrl=e,this.screenList.map(((t,n)=>{const i=document.getElementById(`${this.container.id}-screen-${n}`);i&&(i.style.backgroundImage=`url(${e})`)}))},this.destroy=(e=!1)=>{let t=[];this.screenList.map(((e,n)=>{e.player&&(t.push(e.player.destroy()),delete e.player)})),Promise.all(t).then((()=>{const t=document.getElementById(this.container.id);if(t&&(t.innerHTML="",t.id=this.container.id+"-destroyed"),e){const e=document.querySelector('style[innerHTML*=".screen-select"]');e&&document.head.removeChild(e),this.screenList=[]}else if(this.status.pageSize>0)for(let e=0;e<this.status.pageSize;e++)this._initScreen(e)}))},this.getScreen=e=>{const t=void 0!==e?e:this.status.selectScreen;return this.screenList[t]},this.getScreenList=()=>this.screenList,this.getDeviceList=()=>this.status.list,this.container=e,this.options=Object.assign({},la,t||{}),this.status=Object.assign({},la,t||{}),this.status.pageSize>=this.status.list.length&&(this.status.loop=!1),this.screenList=[],this.turnInterval=-1,this.eventEmitter=new aa,this.status.pageSize>0){const e=document.getElementById(this.container.id);e&&(e.innerHTML="");for(let e=0;e<this.status.pageSize;e++)this.screenList.push({}),this._initScreen(e)}this.status.autoPlay&&this.initPlayer(),this.status.autoTurn&&this.startTurn(),this.initPlayer=this.initPlayer.bind(this),this.nextPage=this.nextPage.bind(this),this.lastPage=this.lastPage.bind(this),this.startTurn=this.startTurn.bind(this),this.stopTurn=this.stopTurn.bind(this),this.setDelay=this.setDelay.bind(this),this.setLoop=this.setLoop.bind(this),this.changePageSize=this.changePageSize.bind(this),this.pageTo=this.pageTo.bind(this),this.screenSelect=this.screenSelect.bind(this),this.setText=this.setText.bind(this),this.setBackground=this.setBackground.bind(this),this.destroy=this.destroy.bind(this),this.getScreen=this.getScreen.bind(this),this.getScreenList=this.getScreenList.bind(this),this.getDeviceList=this.getDeviceList.bind(this),this.destroyScreen=this.destroyScreen.bind(this)}}function da(){return da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},da.apply(this,arguments)}const ua={list:[],id:"ezuikit-inspection-player",defaultSelect:0,selectStyle:".screen-select::before { content: '';position: absolute;top: 0;left: 0;right: 0;bottom: 0;border: 2px solid red;box-sizing: border-box;z-index: 9999; pointer-events: none; }"};var pa=0;function ha(e){return"__private_"+pa+++"_"+e}var ma=null;function Aa(e){e.responseMsg.eventName}function fa(){ma.JS_SetWindowControlCallback({cbIntegrationCallBack:Aa}),ma.JS_StartService("window",{dllPath:"./chain/cloudTransform.dll"}).then((function(){ma.JS_CreateWnd("playWnd",900,500).then((function(){}))}))}function va(){ma=null}function ga(e){ma=null}var ya=ha("__event");class Ta{alarmMsg(){ma.JS_RequestInterface({funcName:"TransFunctionResult",arguments:encodeURI(JSON.stringify({request:{body:{alarmTypes:[10800,0,0,0,0],channelId:"066dde0465dd4abaab6afe355baf9d0b",endTime:"1621007999000",startTime:"1620921600000"},callBack:"GetAlarmMsgOrders",majorKey:"",method:"POST",storeId:"",url:"/videoplugin/message/getMessageByTypes"},response:{code:0,message:null,data:[{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620921217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920678e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919513e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919483e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919333e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918913e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918305e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917858e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917658e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917244e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917064e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916668e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916529e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916343e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916081e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915825e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915394e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915197e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914971e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914644e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914533e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914457e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914376e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914284e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913431e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912354e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912275e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912093e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091189e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911839e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091176e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911682e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091127e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911184e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910982e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910781e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910727e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910677e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910647e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910588e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910544e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091041e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091035e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910278e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910124e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909939e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909847e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909817e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909664e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909605e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909575e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090912e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909028e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908999e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908969e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908909e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090888e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908835e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090875e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090872e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908652e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908582e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908552e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908456e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090805e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907918e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907758e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907625e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907386e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907292e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907127e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906828e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906797e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906747e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906717e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906632e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906368e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906013e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905946e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905823e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905622e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905511e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905382e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905352e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905322e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905262e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905196e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090515e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904813e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090473e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209047e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904618e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904286e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904173e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904053e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904023e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903854e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903723e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903643e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903573e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903505e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209032e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090312e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902977e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090286e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090277e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902639e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902517e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902373e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090232e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902253e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902198e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902132e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090194e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090185e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901685e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901638e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090152e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901489e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901424e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901271e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901233e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900915e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900774e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900744e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090065e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090044e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900409e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900175e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900134e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900069e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900016e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899908e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899826e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899756e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899467e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899406e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899265e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899211e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089914e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089911e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089905e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898785e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898666e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898507e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898248e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898218e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898088e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089802e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089796e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089785e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089769e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089763e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16208976e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089757e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089754e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897475e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897369e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897339e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897279e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897237e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897207e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897172e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896985e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896874e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896814e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896783e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896621e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896447e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896358e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896307e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896277e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896214e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089604e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895953e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895921e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895868e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089577e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895704e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089559e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089548e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895377e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895347e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895171e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895136e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895017e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894896e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894738e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894539e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894359e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894213e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894183e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893964e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893934e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893754e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893606e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089353e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893452e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893423e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893357e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892904e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892824e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892764e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892479e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892311e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892281e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892209e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892063e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089187e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089181e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891708e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891655e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891585e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891401e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891257e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891178e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891128e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891033e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089094e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890794e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890714e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890469e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890179e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890108e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890041e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889937e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889635e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889451e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889317e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889227e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889139e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888902e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888837e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888767e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888737e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888706e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888633e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888413e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888353e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888323e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888249e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888162e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888e6},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887859e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887776e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887734e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887692e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887619e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887355e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088732e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887289e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887126e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887066e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088697e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886884e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886804e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886728e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886538e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886396e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886334e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886246e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886111e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885956e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885894e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885696e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885514e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885341e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885306e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885276e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885186e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885114e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885037e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884975e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884945e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884911e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088478e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884696e3}],success:!0}}))})}constructor(e){Object.defineProperty(this,ya,{value:_a}),this.changeModel=(e,t)=>{let n=this;this.switchVideo=parseInt(e),ma&&ma.JS_RequestInterface({funcName:"ChangeModel",arguments:encodeURI(JSON.stringify({model:e}))}).then((function(i){0==e?n.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode}):n.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode,startTime:t.startTime,endTime:t.endTime})}))},this.init=e=>{let t=this;if(!e.appKey||!e.accessToken)return void t.showTips(!1,"请输入appkey和token");void 0!==e.appKey&&(this.appKey=e.appKey),void 0!==e.accessToken&&(this.accessToken=e.accessToken),void 0!==e.platformId&&(this.platformId=e.platformId);let n={layout:+t.layout,userName:"",waterMark:"",waterMark:"1",iWndType:0,intelligenceEnable:1,isRecord:1,isSetPos:1,motionDetectEnable:0,playBackAlarmOverlyingEnable:0,response:{code:0,message:null,data:{appKey:e.appKey,ezvizToken:e.accessToken,videoLevel:0,logLevel:3,showMainTool:1,showSubTool:1,waterMark:"1",userName:"openteam",platformId:e.platformId}}};ma.JS_RequestInterface({funcName:"Init",arguments:encodeURI(JSON.stringify(n))}).then((function(e){t.showTips(!0,"视频初始化成功!")}))},this.play=e=>{let t=this;if(!e.deviceSerial||!e.channelNo)return;void 0!==e.deviceSerial&&(this.deviceSerial=e.deviceSerial),void 0!==e.channelNo&&(this.channelNo=e.channelNo),void 0!==e.startTime&&e.startTime&&(this.startTime=e.startTime+" 00:00:00"),void 0!==e.endTime&&e.endTime&&(this.endTime=e.endTime+" 23:59:59"),void 0!==e.validateCode&&e.validateCode&&(this.validateCode=e.validateCode);let n={response:{code:0,message:null,data:{deviceSerial:e.deviceSerial,channelCode:e.channelNo,channelNo:+e.channelNo,codeIsEncrypt:0,validateCode:e.validateCode,deviceClass:t.deviceClass,deviceType:"10222",channelId:"2222222222",channelName:"channelNameTest",storeName:"storeName",storeId:"storeid",startTime:this.startTime,endTime:this.endTime}}};"1"===t.deviceClass?(n.response.data.channelCode=t.channelNo,n.response.data.platformId=t.platformId):n.response.data.channelNo=+t.channelNo,1===this.switchVideo&&(this.startTime&&(n.response.data.startTime=this.startTime),this.endTime&&(n.response.data.endTime=this.endTime)),ma.JS_RequestInterface({funcName:0===this.switchVideo?"StartPreview":"StartPlayback",arguments:encodeURI(JSON.stringify(n))}).then((function(e){t.showTips(!0,"预览/回放成功!")})).catch((e=>{}))},this.showCBInfo=e=>{this.callbackMessage=this.callbackMessage+JSON.stringify(e)+"\n\n"},this.showTips=(e,t)=>{},this.hideVideo=()=>{ma.JS_HideWnd()},this.showVideo=()=>{ma.JS_ShowWnd()},this.GetLayout=()=>{ma.JS_RequestInterface({funcName:"GetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){}))},this.capturePicture=e=>{ma.JS_RequestInterface({funcName:"CaptureJPGEx",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){}))},this.stop=(e=-1)=>{ma.JS_RequestInterface({funcName:"StopPlay",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){}))},this.setLayout=e=>{let t=parseInt(e);isNaN(t)||0==t||t>=13||(this.layout=t,ma.JS_RequestInterface({funcName:"SetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{layout:t}}}))}).then((function(e){})))},this.setSoundVolumn=(e=-1,t)=>{ma.JS_RequestInterface({funcName:"SoundVolumn",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e),volumn:parseInt(t)}}}))}).then((function(e){}))},this.testMute=()=>{var e=parseInt(prompt("请输入窗口ID"));ma.JS_RequestInterface({funcName:"MuteOnOff",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){}))},this.testSelectWnd=()=>{var e=parseInt(prompt("请输入窗口ID"));ma.JS_RequestInterface({funcName:"SelectPlayWnd",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){}))},this.setVideoLevel=(e,t)=>{ma.JS_RequestInterface({funcName:"SetVideoLevel",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:1==this.switchVideo?0:parseInt(e),level:parseInt(t,10)}}}))}).then((function(e){}))},this.startTalk=e=>{ma.JS_RequestInterface({funcName:"StartTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){}))},this.stopTalk=e=>{ma.JS_RequestInterface({funcName:"StopTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){}))},this.startSave=e=>{ma.JS_RequestInterface({funcName:"StartRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){}))},this.stopSave=e=>{ma.JS_RequestInterface({funcName:"StopRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){}))},this.appKey="b9a3ad6e8026410095d8252169fa430a",this.accessToken="at.2vtum8873rrcwbrv431qb6pn94dkbv23-8dw2twn355-1u3x014-wrthellzk",this.deviceSerial="C33368372",this.channelNo="1",this.validateCode="",this.deviceClass="0",this.platformId="",this.startTime="",this.endTime="",this.layout=2,this.switchVideo=0,this.tips="调用成功",this.successTip=!1,this.tipsShow=!1,ma=function(e,t,n,i){return new WebControl({szPluginContainer:e,iServicePortStart:14510,iServicePortEnd:14519,cbConnectSuccess:t,cbConnectError:n,cbConnectClose:i})}("playWnd",fa,va,ga),function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,ya)[ya]()}}function _a(){window.onscroll=function(){null!=ma&&ma.JS_Resize(900,500)},window.onresize=function(){null!=ma&&ma.JS_Resize(900,500)},window.onunload=function(){try{ma.JS_HideWnd(),null!=ma&&(ma.JS_DestroyWnd().then((function(){}),(function(){})),ma.JS_StopService("window").then((function(){ma.JS_Disconnect().then((function(){}),(function(){}))})))}catch(e){}},window.onpagehide=function(){try{ma.JS_HideWnd()}catch(e){}}}window.EZUIKit={};const ba={EZUIKitPlayer:oa,EZUIKitInspection:ca,EZUIKitInspectionUI:class{constructor(e,t){this.init=()=>{const e=document.getElementById(this.options.id+"-destroyed");var t;e&&(null==(t=e.parentNode)||t.removeChild(e));const n=document.createElement("div");n.id=this.options.id,n.style.cssText="\n position: relative;\n overflow: hidden;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n height: 100%;\n ",this.container.append(n),this.$inspection=n,this.inspection=new ca(this.$inspection,da({},this.options,{onScreenSelect:(e,t)=>{if(this.inspection){for(let e=0;e<this.inspection.screenList.length;e++){const t=this.$inspection.children[e];t&&t.classList.remove("screen-select")}const t=this.$inspection.children[e];t&&t.classList.add("screen-select")}this.options.onScreenSelect&&this.options.onScreenSelect(e,t)}}));for(let e=0;e<this.inspection.screenList.length;e++)p(this.$inspection,"#"+this.options.id+"-screen-"+e,"click",(t=>{this.screenSelect(e)}));this.screenSelect(this.options.defaultSelect)},this.initPlayer=(e,t,n)=>{this.inspection&&this.inspection.initPlayer(e,t,n)},this.destroy=(e=!1)=>{this.inspection&&this.inspection.destroy(e)},this.nextPage=()=>{var e;null==(e=this.inspection)||e.nextPage()},this.lastPage=()=>{var e;null==(e=this.inspection)||e.lastPage()},this.startTurn=()=>{var e;null==(e=this.inspection)||e.startTurn()},this.stopTurn=()=>{var e;null==(e=this.inspection)||e.stopTurn()},this.setDelay=e=>{var t;null==(t=this.inspection)||t.setDelay(e)},this.setLoop=e=>{var t;null==(t=this.inspection)||t.setLoop(e)},this.changePageSize=e=>{var t;null==(t=this.inspection)||t.changePageSize(e)},this.pageTo=e=>{var t;null==(t=this.inspection)||t.pageTo(e)},this.screenSelect=e=>{var t;if(this.inspection)return null==(t=this.inspection)?void 0:t.screenSelect(e)},this.setText=e=>{var t;return null==(t=this.inspection)?void 0:t.setText(e)},this.setBackground=e=>{var t;return null==(t=this.inspection)?void 0:t.setBackground(e)},this.getScreen=e=>{var t;return null==(t=this.inspection)?void 0:t.getScreen(e)},this.getScreenList=()=>{var e;return null==(e=this.inspection)?void 0:e.getScreenList()},this.destroyScreen=e=>{var t;return null==(t=this.inspection)?void 0:t.destroyScreen(e)},this.getDeviceList=()=>{var e;return null==(e=this.inspection)?void 0:e.getDeviceList()},this.stopAll=()=>{var e;const t=null==(e=this.inspection)?void 0:e.getScreenList();if(t)for(let e=0;e<t.length;e++)t[e].player&&(t[e].options.url.indexOf("live")>0?t[e].player.stop((()=>{}),!0):t[e].player.pause())},this.playAll=()=>{var e;const t=null==(e=this.inspection)?void 0:e.getScreenList();if(t)for(let e=0;e<t.length;e++)t[e].player&&(t[e].options.url.indexOf("live")>0?t[e].player.play():t[e].player.resume())},this.muteAll=()=>{var e;const t=null==(e=this.inspection)?void 0:e.getScreenList();if(t)for(let e=0;e<t.length;e++)t[e].player&&t[e].player.closeSound()},this.unmuteAll=()=>{var e;const t=null==(e=this.inspection)?void 0:e.getScreenList();if(t)for(let e=0;e<t.length;e++)t[e].player&&t[e].player.openSound()},this.container=e,this.options=Object.assign({},ua,t||{}),this.$inspection=document.createElement("div");const n=document.createElement("style");n.innerHTML=this.options.selectStyle,document.head.appendChild(n),this.init(),this.initPlayer=this.initPlayer.bind(this),this.nextPage=this.nextPage.bind(this),this.lastPage=this.lastPage.bind(this),this.startTurn=this.startTurn.bind(this),this.stopTurn=this.stopTurn.bind(this),this.setDelay=this.setDelay.bind(this),this.setLoop=this.setLoop.bind(this),this.changePageSize=this.changePageSize.bind(this),this.pageTo=this.pageTo.bind(this),this.screenSelect=this.screenSelect.bind(this),this.setText=this.setText.bind(this),this.setBackground=this.setBackground.bind(this),this.destroy=this.destroy.bind(this),this.getScreen=this.getScreen.bind(this),this.getScreenList=this.getScreenList.bind(this),this.destroyScreen=this.destroyScreen.bind(this),this.getDeviceList=this.getDeviceList.bind(this),this.stopAll=this.stopAll.bind(this),this.playAll=this.playAll.bind(this),this.muteAll=this.muteAll.bind(this),this.unmuteAll=this.unmuteAll.bind(this)}},EZUIKitHD:Ta};export{Ta as EZUIKitHD,oa as EZUIKitPlayer,ba as default};
37
+ function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},d=n.log,l=n.detectBrowser(t),u={browserDetails:l,commonShim:c,extractVersion:n.extractVersion,disableLog:n.disableLog,disableWarnings:n.disableWarnings};switch(l.browser){case"chrome":if(!i||!i.shimPeerConnection||!r.shimChrome)return d("Chrome shim is not included in this adapter release."),u;d("adapter.js shimming chrome."),u.browserShim=i,i.shimGetUserMedia(t),i.shimMediaStream(t),i.shimPeerConnection(t),i.shimOnTrack(t),i.shimAddTrackRemoveTrack(t),i.shimGetSendersWithDtmf(t),i.shimGetStats(t),i.shimSenderReceiverGetStats(t),i.fixNegotiationNeeded(t),c.shimRTCIceCandidate(t),c.shimConnectionState(t),c.shimMaxMessageSize(t),c.shimSendThrowTypeError(t),c.removeAllowExtmapMixed(t);break;case"firefox":if(!a||!a.shimPeerConnection||!r.shimFirefox)return d("Firefox shim is not included in this adapter release."),u;d("adapter.js shimming firefox."),u.browserShim=a,a.shimGetUserMedia(t),a.shimPeerConnection(t),a.shimOnTrack(t),a.shimRemoveStream(t),a.shimSenderGetStats(t),a.shimReceiverGetStats(t),a.shimRTCDataChannel(t),a.shimAddTransceiver(t),a.shimCreateOffer(t),a.shimCreateAnswer(t),c.shimRTCIceCandidate(t),c.shimConnectionState(t),c.shimMaxMessageSize(t),c.shimSendThrowTypeError(t);break;case"edge":if(!o||!o.shimPeerConnection||!r.shimEdge)return d("MS edge shim is not included in this adapter release."),u;d("adapter.js shimming edge."),u.browserShim=o,o.shimGetUserMedia(t),o.shimGetDisplayMedia(t),o.shimPeerConnection(t),o.shimReplaceTrack(t),c.shimMaxMessageSize(t),c.shimSendThrowTypeError(t);break;case"safari":if(!s||!r.shimSafari)return d("Safari shim is not included in this adapter release."),u;d("adapter.js shimming safari."),u.browserShim=s,s.shimRTCIceServerUrls(t),s.shimCreateOfferLegacy(t),s.shimCallbacksAPI(t),s.shimLocalStreamsAPI(t),s.shimRemoteStreamsAPI(t),s.shimTrackEventTransceiver(t),s.shimGetUserMedia(t),c.shimRTCIceCandidate(t),c.shimMaxMessageSize(t),c.shimSendThrowTypeError(t),c.removeAllowExtmapMixed(t);break;default:d("Unsupported browser!")}return u};var n=d(e("./utils")),i=d(e("./chrome/chrome_shim")),o=d(e("./edge/edge_shim")),a=d(e("./firefox/firefox_shim")),s=d(e("./safari/safari_shim")),c=d(e("./common_shim"));function d(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=r.shimGetUserMedia=void 0;var n="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},i=e("./getusermedia");Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),r.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},r.shimOnTrack=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(n){var i;i=e.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find((function(e){return e.track&&e.track.id===n.track.id})):{track:n.track};var o=new Event("track");o.track=n.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],r.dispatchEvent(o)})),t.stream.getTracks().forEach((function(n){var i;i=e.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find((function(e){return e.track&&e.track.id===n.id})):{track:n};var o=new Event("track");o.track=n,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],r.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else a.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))},r.shimGetSendersWithDtmf=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){var i=r.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){r._senders.push(t(r,e))}))};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],a.apply(this,[e]),e.getTracks().forEach((function(e){var r=t._senders.find((function(t){return t.track===e}));r&&t._senders.splice(t._senders.indexOf(r),1)}))}}else if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},r.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,r=Array.prototype.slice.call(arguments),n=r[0],i=r[1],o=r[2];if(arguments.length>0&&"function"==typeof n)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof n))return t.apply(this,[]);var a=function(e){var t={};return e.result().forEach((function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){r[t]=e.stat(t)})),t[r.id]=r})),t},s=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};return arguments.length>=2?t.apply(this,[function(e){i(s(a(e)))},n]):new Promise((function(r,n){t.apply(e,[function(e){r(s(a(e)))},n])})).then(i,o)}}},r.shimSenderReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return a.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var i=e.RTCPeerConnection.prototype.getReceivers;i&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=i.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),a.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return a.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],r=void 0,n=void 0,i=void 0;return this.getSenders().forEach((function(e){e.track===t&&(r?i=!0:r=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(n?i=!0:n=e),e.track===t})),i||r&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return o.apply(this,arguments)}}}},r.shimAddTrackRemoveTrackWithNative=c,r.shimAddTrackRemoveTrack=function(e){if(e.RTCPeerConnection){var t=a.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return c(e);var r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=r.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var r=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(r.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var i=new e.MediaStream(t.getTracks());this._streams[t.id]=i,this._reverseStreams[i.id]=t,t=i}n.apply(this,[t])};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){var n=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[r.id];if(o)o.addTrack(t),Promise.resolve().then((function(){n.dispatchEvent(new Event("negotiationneeded"))}));else{var a=new e.MediaStream([t]);this._streams[r.id]=a,this._reverseStreams[a.id]=r,this.addStream(a)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=s({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[function(r){var n=o(e,r);t[0].apply(null,[n])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):r.apply(this,arguments).then((function(t){return o(e,t)}))}));e.RTCPeerConnection.prototype[t]=n[t]}));var d=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=(e=this,r=(t=arguments[0]).sdp,Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:r})),d.apply(this,arguments)):d.apply(this,arguments);var e,t,r};var l=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=l.get.apply(this);return""===e.type?e:o(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var r=void 0;Object.keys(this._streams).forEach((function(n){t._streams[n].getTracks().find((function(t){return e.track===t}))&&(r=t._streams[n])})),r&&(1===r.getTracks().length?this.removeStream(this._reverseStreams[r.id]):r.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function o(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],i=e._streams[n.id];r=r.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}},r.shimPeerConnection=function(e){var t=a.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection){t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=s({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]}));var r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?t.version<78&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}},r.fixNegotiationNeeded=function(e){a.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils.js"));function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var n=this.getSenders();r.apply(this,arguments);var i=this.getSenders().filter((function(e){return-1===n.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(i)};var n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(r){var n=t._shimmedLocalStreams[r].indexOf(e);-1!==n&&t._shimmedLocalStreams[r].splice(n,1),1===t._shimmedLocalStreams[r].length&&delete t._shimmedLocalStreams[r]})),i.apply(this,arguments)}}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&"function"==typeof t&&(e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((function(t){var n=r.video&&r.video.width,i=r.video&&r.video.height,o=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},n&&(r.video.mandatory.maxWidth=n),i&&(r.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(r)}))})}},{}],5:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n="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};r.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices){var r=i.detectBrowser(e),a=function(e){if("object"!==(void 0===e?"undefined":n(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var i="object"===n(e[r])?e[r]:{ideal:e[r]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];var a={};"number"==typeof i.ideal?(a[o("min",r)]=i.ideal,t.optional.push(a),(a={})[o("max",r)]=i.ideal,t.optional.push(a)):(a[o("",r)]=i.ideal,t.optional.push(a))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",r)]=i.exact):["min","max"].forEach((function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,r)]=i[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,i){if(r.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===n(e.audio)){var s=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=a(e.audio)}if(e&&"object"===n(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":n(c))?c:{ideal:c});var d=r.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||d)){delete e.video.facingMode;var l=void 0;if("environment"===c.exact||"environment"===c.ideal?l=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(l=["front"]),l)return t.mediaDevices.enumerateDevices().then((function(t){var r=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return l.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!r&&t.length&&l.includes("back")&&(r=t[t.length-1]),r&&(e.video.deviceId=c.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=a(e.video),o("chrome: "+JSON.stringify(e)),i(e)}))}e.video=a(e.video)}return o("chrome: "+JSON.stringify(e)),i(e)},c=function(e){return r.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,r,n){s(e,(function(e){t.webkitGetUserMedia(e,r,(function(e){n&&n(c(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){var d=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return s(e,(function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(c(e))}))}))}}}};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils.js")),o=i.log},{"../utils.js":15}],6:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n="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};r.shimRTCIceCandidate=function(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var r=new t(e),i=a.default.parseCandidate(e.candidate),o=Object.assign(r,i);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,s.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},r.shimMaxMessageSize=function(e){if(e.RTCPeerConnection){var t=s.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e,n;if(this._sctp=null,"chrome"===t.browser&&t.version>=76&&"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0}),function(e){if(!e||!e.sdp)return!1;var t=a.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=a.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){var c,i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),o=(e=i,n=65536,"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n),s=function(e,r){var n=65536;"firefox"===t.browser&&57===t.version&&(n=65535);var i=a.default.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?n=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(n=2147483637),n}(arguments[0],i);c=0===o&&0===s?Number.POSITIVE_INFINITY:0===o||0===s?Math.max(o,s):Math.min(o,s);var d={};Object.defineProperty(d,"maxMessageSize",{get:function(){return c}}),this._sctp=d}return r.apply(this,arguments)}}},r.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var r=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=r.apply(this,arguments);return t(e,this),e},s.wrapPeerConnectionEvent(e,"datachannel",(function(e){return t(e.channel,e.target),e}))}function t(e,t){var r=e.send;e.send=function(){var n=arguments[0],i=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}},r.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}},r.removeAllowExtmapMixed=function(e){if(e.RTCPeerConnection){var t=s.detectBrowser(e);if(!("chrome"===t.browser&&t.version>=71)){var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(e){return e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")&&(e.sdp=e.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n")),r.apply(this,arguments)}}}};var i,a=(i=e("sdp"))&&i.__esModule?i:{default:i},s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("./utils"))},{"./utils":15,sdp:17}],7:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=r.shimGetUserMedia=void 0;var n=e("./getusermedia");Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var i=e("./getdisplaymedia");Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return i.shimGetDisplayMedia}}),r.shimPeerConnection=function(e){var t=a.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){r.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var n=(0,d.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,s.filterIceServers)(e.iceServers,t.version),a.log("ICE servers after filtering:",e.iceServers)),new n(e)},e.RTCPeerConnection.prototype=n.prototype},r.shimReplaceTrack=function(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)};var o,a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils")),s=e("./filtericeservers"),d=(o=e("rtcpeerconnection-shim"))&&o.__esModule?o:{default:o}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.filterIceServers=function(e,t){var r=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&n.deprecated("RTCIceServer.url","RTCIceServer.urls");var i="string"==typeof t;return i&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!r?(r=!0,!0):t&&!r})),delete e.url,e.urls=i?t[0]:t,!!t.length}}))};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils"))},{"../utils":15}],9:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}},{}],10:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e){var t=e&&e.navigator,r=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return r(e).catch((function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}},{}],11:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=r.shimGetUserMedia=void 0;var n="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},i=e("./getusermedia");Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),r.shimOnTrack=function(e){"object"===(void 0===e?"undefined":n(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},r.shimPeerConnection=function(e){var t=a.detectBrowser(e);if("object"===(void 0===e?"undefined":n(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){if(!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]})),t.version<68){var r=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}var i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),r=e[0],n=e[1],a=e[2];return o.apply(this,[r||null]).then((function(e){if(t.version<53&&!n)try{e.forEach((function(e){e.type=i[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,r){e.set(r,Object.assign({},t,{type:i[t.type]||t.type}))}))}return e})).then(n,a)}}},r.shimSenderGetStats=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},r.shimReceiverGetStats=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r}),a.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},r.shimRemoveStream=function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;a.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(r){r.track&&e.getTracks().includes(r.track)&&t.removeTrack(r)}))})},r.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},r.shimAddTransceiver=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],r=e&&"sendEncodings"in e;r&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var n=t.apply(this,arguments);if(r){var i=n.sender,o=i.getParameters();"encodings"in o||(o.encodings=e.sendEncodings,this.setParametersPromises.push(i.setParameters(o).catch((function(){}))))}return n})}},r.shimCreateOffer=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,r=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,r)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}},r.shimCreateAnswer=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,r=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,r)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils"))},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}},{}],13:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n="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};r.shimGetUserMedia=function(e){var t=i.detectBrowser(e),r=e&&e.navigator,o=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,n){i.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,n)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var a=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":n(e))&&"object"===n(e.audio)&&(e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","mozAutoGainControl"),a(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},o&&o.prototype.getSettings){var c=o.prototype.getSettings;o.prototype.getSettings=function(){var e=c.apply(this,arguments);return a(e,"mozAutoGainControl","autoGainControl"),a(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var d=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":n(e))&&(e=JSON.parse(JSON.stringify(e)),a(e,"autoGainControl","mozAutoGainControl"),a(e,"noiseSuppression","mozNoiseSuppression")),d.apply(this,[e])}}}};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils"))},{"../utils":15}],14:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n="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};r.shimLocalStreamsAPI=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(n){return t.call(r,n,e)})),e.getVideoTracks().forEach((function(n){return t.call(r,n,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){var r=arguments[1];return r&&(this._localStreams?this._localStreams.includes(r)||this._localStreams.push(r):this._localStreams=[r]),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var r=this._localStreams.indexOf(e);if(-1!==r){this._localStreams.splice(r,1);var n=e.getTracks();this.getSenders().forEach((function(e){n.includes(e.track)&&t.removeTrack(e)}))}})}},r.shimRemoteStreamsAPI=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var r=new Event("addstream");r.stream=e,t.dispatchEvent(r)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}}))}),t.apply(e,arguments)}}},r.shimCallbacksAPI=function(e){if("object"===(void 0===e?"undefined":n(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,r=t.createOffer,i=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],n=i.apply(this,[r]);return t?(n.then(e,t),Promise.resolve()):n};var c=function(e,t,r){var n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=c,c=function(e,t,r){var n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=c,c=function(e,t,r){var n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=c}},r.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var r=t.mediaDevices,n=r.getUserMedia.bind(r);t.mediaDevices.getUserMedia=function(e){return n(o(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))},r.shimConstraints=o,r.shimRTCIceServerUrls=function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){for(var n=[],o=0;o<e.iceServers.length;o++){var a=e.iceServers[o];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(i.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,n.push(a)):n.push(e.iceServers[o])}e.iceServers=n}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},r.shimTrackEventTransceiver=function(e){"object"===(void 0===e?"undefined":n(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},r.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var n=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../utils"));function o(e){return e&&void 0!==e.video?Object.assign({},e,{video:i.compactObject(e.video)}):e}},{"../utils":15}],15:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n="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};r.extractVersion=a,r.wrapPeerConnectionEvent=function(e,t,r){if(e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=r(e);t&&n(t)};return this._eventMap=this._eventMap||{},this._eventMap[n]=o,i.apply(this,[e,o])};var o=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[r])return o.apply(this,arguments);var n=this._eventMap[r];return delete this._eventMap[r],o.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},r.disableLog=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":n(e))+". Please use a boolean."):(i=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},r.disableWarnings=function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":n(e))+". Please use a boolean."):"adapter.js deprecation warnings "+(e?"disabled":"enabled")},r.log=function(){if("object"===("undefined"==typeof window?"undefined":n(window))){if(i)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},r.deprecated=function(e,t){},r.detectBrowser=function(e){var t=e.navigator,r={browser:null,version:null};if(void 0===e||!e.navigator)return r.browser="Not a browser.",r;if(t.mozGetUserMedia)r.browser="firefox",r.version=a(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)r.browser="chrome",r.version=a(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))r.browser="edge",r.version=a(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return r.browser="Not a supported browser.",r;r.browser="safari",r.version=a(t.userAgent,/AppleWebKit\/(\d+)\./,1),r.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return r},r.compactObject=function e(t){return s(t)?Object.keys(t).reduce((function(r,n){var i=s(t[n]),o=i?e(t[n]):t[n],a=i&&!Object.keys(o).length;return void 0===o||a?r:Object.assign(r,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,o))}),{}):t},r.walkStats=c,r.filterStats=function(e,t,r){var n=r?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var o=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((function(t){e.forEach((function(r){r.type===n&&r.trackId===t.id&&c(e,r,i)}))})),i};var i=!0;function a(e,t,r){var n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function s(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((function(n){n.endsWith("Id")?c(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((function(t){c(e,e.get(t),r)}))})))}},{}],16:[function(e,t,r){var n=e("sdp");function i(e,t,r,i,o){var a=n.writeRtpDescription(e.kind,t);if(a+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":o||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(i?i.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),a}function o(e,t){var r={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var r=0;r<t.length;r++)if(t[r].payloadType===e||t[r].preferredPayloadType===e)return t[r]},i=function(e,t,r,i){var o=n(e.parameters.apt,r),a=n(t.parameters.apt,i);return o&&a&&o.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(n){for(var o=0;o<t.codecs.length;o++){var a=t.codecs[o];if(n.name.toLowerCase()===a.name.toLowerCase()&&n.clockRate===a.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&a.parameters.apt&&!i(n,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(n.numChannels,a.numChannels),r.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var n=0;n<t.headerExtensions.length;n++){var i=t.headerExtensions[n];if(e.uri===i.uri){r.headerExtensions.push(i);break}}})),r}function a(e,t,r){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(r)}function s(e,t){var r=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return r||e.addRemoteCandidate(t),!r}function c(e,t){var r=new Error(t);return r.name=e,r.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],r}t.exports=function(e,t){function r(t,r){r.addTrack(t),r.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function d(t,r,n,i){var o=new Event("track");o.track=r,o.receiver=n,o.transceiver={receiver:n},o.streams=i,e.setTimeout((function(){t._dispatchEvent("track",o)}))}var l=function(r){var i=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){i[e]=o[e].bind(o)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",r=JSON.parse(JSON.stringify(r||{})),this.usingBundle="max-bundle"===r.bundlePolicy,"negotiate"===r.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(r.rtcpMuxPolicy||(r.rtcpMuxPolicy="require"),r.iceTransportPolicy){case"all":case"relay":break;default:r.iceTransportPolicy="all"}switch(r.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:r.bundlePolicy="balanced"}if(r.iceServers=function(e,t){var r=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&e.urls;var i="string"==typeof n;return i&&(n=[n]),n=n.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||r?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(r=!0,!0)})),delete e.url,e.urls=i?n[0]:n,!!n.length}}))}(r.iceServers||[],t),this._iceGatherers=[],r.iceCandidatePoolSize)for(var a=r.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:r.iceServers,gatherPolicy:r.iceTransportPolicy}));else r.iceCandidatePoolSize=0;this._config=r,this.transceivers=[],this._sdpSessionId=n.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(l.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(l.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),l.prototype.onicecandidate=null,l.prototype.onaddstream=null,l.prototype.ontrack=null,l.prototype.onremovestream=null,l.prototype.onsignalingstatechange=null,l.prototype.oniceconnectionstatechange=null,l.prototype.onconnectionstatechange=null,l.prototype.onicegatheringstatechange=null,l.prototype.onnegotiationneeded=null,l.prototype.ondatachannel=null,l.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},l.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},l.prototype.getConfiguration=function(){return this._config},l.prototype.getLocalStreams=function(){return this.localStreams},l.prototype.getRemoteStreams=function(){return this.remoteStreams},l.prototype._createTransceiver=function(e,t){var r=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&r)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();n.iceTransport=i.iceTransport,n.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(n),n},l.prototype.addTrack=function(t,r){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var i=0;i<this.transceivers.length;i++)this.transceivers[i].track||this.transceivers[i].kind!==t.kind||(n=this.transceivers[i]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(r)&&this.localStreams.push(r),n.track=t,n.stream=r,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},l.prototype.addStream=function(e){var r=this;if(t>=15025)e.getTracks().forEach((function(t){r.addTrack(t,e)}));else{var n=e.clone();e.getTracks().forEach((function(e,t){var r=n.getTracks()[t];e.addEventListener("enabled",(function(e){r.enabled=e.enabled}))})),n.getTracks().forEach((function(e){r.addTrack(e,n)}))}},l.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var r=this.transceivers.find((function(e){return e.rtpSender===t}));if(!r)throw c("InvalidAccessError","Sender was not created by this connection.");var n=r.stream;r.rtpSender.stop(),r.rtpSender=null,r.track=null,r.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},l.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var r=t.getSenders().find((function(t){return t.track===e}));r&&t.removeTrack(r)}))},l.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},l.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},l.prototype._createIceGatherer=function(t,r){var n=this;if(r&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var r=!e.candidate||0===Object.keys(e.candidate).length;i.state=r?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},l.prototype._gather=function(t,r){var i=this,o=this.transceivers[r].iceGatherer;if(!o.onlocalcandidate){var a=this.transceivers[r].bufferedCandidateEvents;this.transceivers[r].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[r].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&r>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:r};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),s.component=1,s.ufrag=o.getLocalParameters().usernameFragment;var d=n.writeCandidate(s);a.candidate=Object.assign(a.candidate,n.parseCandidate(d)),a.candidate.candidate=d,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var l=n.getMediaSections(i._localDescription.sdp);l[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",i._localDescription.sdp=n.getDescription(i._localDescription.sdp)+l.join("");var u=i.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),c||i._dispatchEvent("icecandidate",a),u&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},l.prototype._createIceAndDtlsTransports=function(){var t=this,r=new e.RTCIceTransport(null);r.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(r);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:r,dtlsTransport:n}},l.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var r=this.transceivers[e].iceTransport;r&&(delete r.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},l.prototype._transceive=function(e,r,i){var a=o(e.localCapabilities,e.remoteCapabilities);r&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:n.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),i&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},l.prototype.setLocalDescription=function(e){var t,r,i=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,i.signalingState)||i._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+i.signalingState));if("offer"===e.type)t=n.splitSections(e.sdp),r=t.shift(),t.forEach((function(e,t){var r=n.parseRtpParameters(e);i.transceivers[t].localCapabilities=r})),i.transceivers.forEach((function(e,t){i._gather(e.mid,t)}));else if("answer"===e.type){t=n.splitSections(i._remoteDescription.sdp),r=t.shift();var s=n.matchPrefix(r,"a=ice-lite").length>0;t.forEach((function(e,t){var a=i.transceivers[t],c=a.iceGatherer,d=a.iceTransport,l=a.dtlsTransport,u=a.localCapabilities,p=a.remoteCapabilities;if(!(n.isRejected(e)&&0===n.matchPrefix(e,"a=bundle-only").length||a.rejected)){var f=n.getIceParameters(e,r),v=n.getDtlsParameters(e,r);s&&(v.role="server"),i.usingBundle&&0!==t||(i._gather(a.mid,t),"new"===d.state&&d.start(c,f,s?"controlling":"controlled"),"new"===l.state&&l.start(v));var m=o(u,p);i._transceive(a,m.codecs.length>0,!1)}}))}return i._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?i._updateSignalingState("have-local-offer"):i._updateSignalingState("stable"),Promise.resolve()},l.prototype.setRemoteDescription=function(i){var l=this;if(-1===["offer","answer"].indexOf(i.type))return Promise.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!a("setRemoteDescription",i.type,l.signalingState)||l._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+l.signalingState));var u={};l.remoteStreams.forEach((function(e){u[e.id]=e}));var p=[],f=n.splitSections(i.sdp),v=f.shift(),m=n.matchPrefix(v,"a=ice-lite").length>0,h=n.matchPrefix(v,"a=group:BUNDLE ").length>0;l.usingBundle=h;var g=n.matchPrefix(v,"a=ice-options:")[0];return l.canTrickleIceCandidates=!!g&&g.substr(14).split(" ").indexOf("trickle")>=0,f.forEach((function(a,c){var d=n.splitLines(a),f=n.getKind(a),g=n.isRejected(a)&&0===n.matchPrefix(a,"a=bundle-only").length,y=d[0].substr(2).split(" ")[2],S=n.getDirection(a,v),b=n.parseMsid(a),T=n.getMid(a)||n.generateIdentifier();if(g||"application"===f&&("DTLS/SCTP"===y||"UDP/DTLS/SCTP"===y))l.transceivers[c]={mid:T,kind:f,protocol:y,rejected:!0};else{var C,w,k,R,P,E,D,_,I;!g&&l.transceivers[c]&&l.transceivers[c].rejected&&(l.transceivers[c]=l._createTransceiver(f,!0));var x,M,O=n.parseRtpParameters(a);g||(x=n.getIceParameters(a,v),(M=n.getDtlsParameters(a,v)).role="client"),D=n.parseRtpEncodingParameters(a);var A=n.parseRtcpParameters(a),j=n.matchPrefix(a,"a=end-of-candidates",v).length>0,L=n.matchPrefix(a,"a=candidate:").map((function(e){return n.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===i.type||"answer"===i.type)&&!g&&h&&c>0&&l.transceivers[c]&&(l._disposeIceAndDtlsTransports(c),l.transceivers[c].iceGatherer=l.transceivers[0].iceGatherer,l.transceivers[c].iceTransport=l.transceivers[0].iceTransport,l.transceivers[c].dtlsTransport=l.transceivers[0].dtlsTransport,l.transceivers[c].rtpSender&&l.transceivers[c].rtpSender.setTransport(l.transceivers[0].dtlsTransport),l.transceivers[c].rtpReceiver&&l.transceivers[c].rtpReceiver.setTransport(l.transceivers[0].dtlsTransport)),"offer"!==i.type||g)"answer"!==i.type||g||(w=(C=l.transceivers[c]).iceGatherer,k=C.iceTransport,R=C.dtlsTransport,P=C.rtpReceiver,E=C.sendEncodingParameters,_=C.localCapabilities,l.transceivers[c].recvEncodingParameters=D,l.transceivers[c].remoteCapabilities=O,l.transceivers[c].rtcpParameters=A,L.length&&"new"===k.state&&(!m&&!j||h&&0!==c?L.forEach((function(e){s(C.iceTransport,e)})):k.setRemoteCandidates(L)),h&&0!==c||("new"===k.state&&k.start(w,x,"controlling"),"new"===R.state&&R.start(M)),!o(C.localCapabilities,C.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&C.sendEncodingParameters[0].rtx&&delete C.sendEncodingParameters[0].rtx,l._transceive(C,"sendrecv"===S||"recvonly"===S,"sendrecv"===S||"sendonly"===S),!P||"sendrecv"!==S&&"sendonly"!==S?delete C.rtpReceiver:(I=P.track,b?(u[b.stream]||(u[b.stream]=new e.MediaStream),r(I,u[b.stream]),p.push([I,P,u[b.stream]])):(u.default||(u.default=new e.MediaStream),r(I,u.default),p.push([I,P,u.default]))));else{(C=l.transceivers[c]||l._createTransceiver(f)).mid=T,C.iceGatherer||(C.iceGatherer=l._createIceGatherer(c,h)),L.length&&"new"===C.iceTransport.state&&(!j||h&&0!==c?L.forEach((function(e){s(C.iceTransport,e)})):C.iceTransport.setRemoteCandidates(L)),_=e.RTCRtpReceiver.getCapabilities(f),t<15019&&(_.codecs=_.codecs.filter((function(e){return"rtx"!==e.name}))),E=C.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var N,V=!1;"sendrecv"===S||"sendonly"===S?(V=!C.rtpReceiver,P=C.rtpReceiver||new e.RTCRtpReceiver(C.dtlsTransport,f),V&&(I=P.track,b&&"-"===b.stream||(b?(u[b.stream]||(u[b.stream]=new e.MediaStream,Object.defineProperty(u[b.stream],"id",{get:function(){return b.stream}})),Object.defineProperty(I,"id",{get:function(){return b.track}}),N=u[b.stream]):(u.default||(u.default=new e.MediaStream),N=u.default)),N&&(r(I,N),C.associatedRemoteMediaStreams.push(N)),p.push([I,P,N]))):C.rtpReceiver&&C.rtpReceiver.track&&(C.associatedRemoteMediaStreams.forEach((function(t){var r=t.getTracks().find((function(e){return e.id===C.rtpReceiver.track.id}));r&&function(t,r){r.removeTrack(t),r.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(r,t)})),C.associatedRemoteMediaStreams=[]),C.localCapabilities=_,C.remoteCapabilities=O,C.rtpReceiver=P,C.rtcpParameters=A,C.sendEncodingParameters=E,C.recvEncodingParameters=D,l._transceive(l.transceivers[c],!1,V)}}})),void 0===l._dtlsRole&&(l._dtlsRole="offer"===i.type?"active":"passive"),l._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?l._updateSignalingState("have-remote-offer"):l._updateSignalingState("stable"),Object.keys(u).forEach((function(t){var r=u[t];if(r.getTracks().length){if(-1===l.remoteStreams.indexOf(r)){l.remoteStreams.push(r);var n=new Event("addstream");n.stream=r,e.setTimeout((function(){l._dispatchEvent("addstream",n)}))}p.forEach((function(e){var t=e[0],n=e[1];r.id===e[2].id&&d(l,t,n,[r])}))}})),p.forEach((function(e){e[2]||d(l,e[0],e[1],[])})),e.setTimeout((function(){l&&l.transceivers&&l.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&e.iceTransport.addRemoteCandidate({})}))}),4e3),Promise.resolve()},l.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},l.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},l.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},l.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",r)}},l.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var r=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",r)}},l.prototype.createOffer=function(){var r=this;if(r._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var o=r.transceivers.filter((function(e){return"audio"===e.kind})).length,a=r.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(o=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(r.transceivers.forEach((function(e){"audio"===e.kind?--o<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));o>0||a>0;)o>0&&(r._createTransceiver("audio"),o--),a>0&&(r._createTransceiver("video"),a--);var d=n.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.transceivers.forEach((function(i,o){var a=i.track,s=i.kind,c=i.mid||n.generateIdentifier();i.mid=c,i.iceGatherer||(i.iceGatherer=r._createIceGatherer(o,r.usingBundle));var d=e.RTCRtpSender.getCapabilities(s);t<15019&&(d.codecs=d.codecs.filter((function(e){return"rtx"!==e.name}))),d.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),i.remoteCapabilities&&i.remoteCapabilities.codecs&&i.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),d.headerExtensions.forEach((function(e){(i.remoteCapabilities&&i.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var l=i.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];a&&t>=15019&&"video"===s&&!l[0].rtx&&(l[0].rtx={ssrc:l[0].ssrc+1}),i.wantReceive&&(i.rtpReceiver=new e.RTCRtpReceiver(i.dtlsTransport,s)),i.localCapabilities=d,i.sendEncodingParameters=l})),"max-compat"!==r._config.bundlePolicy&&(d+="a=group:BUNDLE "+r.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),d+="a=ice-options:trickle\r\n",r.transceivers.forEach((function(e,t){d+=i(e,e.localCapabilities,"offer",e.stream,r._dtlsRole),d+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===r.iceGatheringState||0!==t&&r.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,d+="a="+n.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(d+="a=end-of-candidates\r\n"))}));var l=new e.RTCSessionDescription({type:"offer",sdp:d});return Promise.resolve(l)},l.prototype.createAnswer=function(){var r=this;if(r._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==r.signalingState&&"have-local-pranswer"!==r.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+r.signalingState));var a=n.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.usingBundle&&(a+="a=group:BUNDLE "+r.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=n.getMediaSections(r._remoteDescription.sdp).length;r.transceivers.forEach((function(e,n){if(!(n+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;e.stream&&("audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var d=o(e.localCapabilities,e.remoteCapabilities);!d.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=i(e,d,"answer",e.stream,r._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var d=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(d)},l.prototype.addIceCandidate=function(e){var t,r=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(i,o){if(!r._remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var d=0;d<r.transceivers.length;d++)if(r.transceivers[d].mid===e.sdpMid){a=d;break}var l=r.transceivers[a];if(!l)return o(c("OperationError","Can not add ICE candidate"));if(l.rejected)return i();var u=Object.keys(e.candidate).length>0?n.parseCandidate(e.candidate):{};if("tcp"===u.protocol&&(0===u.port||9===u.port))return i();if(u.component&&1!==u.component)return i();if((0===a||a>0&&l.iceTransport!==r.transceivers[0].iceTransport)&&!s(l.iceTransport,u))return o(c("OperationError","Can not add ICE candidate"));var p=e.candidate.trim();0===p.indexOf("a=")&&(p=p.substr(2)),(t=n.getMediaSections(r._remoteDescription.sdp))[a]+="a="+(u.type?p:"end-of-candidates")+"\r\n",r._remoteDescription.sdp=n.getDescription(r._remoteDescription.sdp)+t.join("")}else for(var f=0;f<r.transceivers.length&&(r.transceivers[f].rejected||(r.transceivers[f].iceTransport.addRemoteCandidate({}),(t=n.getMediaSections(r._remoteDescription.sdp))[f]+="a=end-of-candidates\r\n",r._remoteDescription.sdp=n.getDescription(r._remoteDescription.sdp)+t.join(""),!r.usingBundle));f++);i()}))},l.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var r=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?r=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(r=e.rtpReceiver)})),!r)throw c("InvalidAccessError","Invalid selector.");return r.getStats()}var n=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&n.push(e[t].getStats())}))})),Promise.all(n).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var r=e[t];if(r&&r.prototype&&r.prototype.getStats){var n=r.prototype.getStats;r.prototype.getStats=function(){return n.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(r){var n;e[r].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(n=e[r]).type]||n.type,t.set(r,e[r])})),t}))}}}));var u=["createOffer","createAnswer"];return u.forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(u=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),l}},{sdp:17}],17:[function(e,t,r){var n={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},n.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},n.getDescription=function(e){var t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){var t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},n.parseCandidate=function(e){for(var t,r={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":r.relatedAddress=t[n+1];break;case"rport":r.relatedPort=parseInt(t[n+1],10);break;case"tcptype":r.tcpType=t[n+1];break;case"ufrag":r.ufrag=t[n+1],r.usernameFragment=t[n+1];break;default:r[t[n]]=t[n+1]}return r},n.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},n.parseIceOptions=function(e){return e.substr(14).split(" ")},n.parseRtpMap=function(e){var t=e.substr(9).split(" "),r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},n.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},n.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var t,r={},n=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<n.length;i++)r[(t=n[i].trim().split("="))[0].trim()]=t[1];return r},n.writeFmtp=function(e){var t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},n.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},n.writeRtcpFb=function(e){var t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},n.parseSsrcMedia=function(e){var t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},n.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},n.getMid=function(e){var t=n.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},n.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},n.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:n.matchPrefix(e+t,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},n.getIceParameters=function(e,t){var r=n.splitLines(e);return{usernameFragment:(r=r.concat(n.splitLines(t))).filter((function(e){return 0===e.indexOf("a=ice-ufrag:")}))[0].substr(12),password:r.filter((function(e){return 0===e.indexOf("a=ice-pwd:")}))[0].substr(10)}},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(" "),i=3;i<r.length;i++){var o=r[i],a=n.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){var s=n.parseRtpMap(a),c=n.matchPrefix(e,"a=fmtp:"+o+" ");switch(s.parameters=c.length?n.parseFmtp(c[0]):{},s.rtcpFeedback=n.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(n.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return n.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(n.parseExtmap(e))})),t},n.writeRtpDescription=function(e,t){var r="";r+="m="+e+" ",r+=t.codecs.length>0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(r+="a=maxptime:"+i+"\r\n"),r+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){r+=n.writeExtmap(e)})),r},n.parseRtpEncodingParameters=function(e){var t,r=[],i=n.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,d=n.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));d.length>0&&d[0].length>1&&d[0][0]===c&&(t=d[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(n.rtx={ssrc:t}),r.push(n),o&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},r.push(n))}})),0===r.length&&c&&r.push({ssrc:c});var l=n.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,r.forEach((function(e){e.maxBitrate=l}))),r},n.parseRtcpParameters=function(e){var t={},r=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);var i=n.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=n.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},n.parseMsid=function(e){var t,r=n.matchPrefix(e,"a=msid:");if(1===r.length)return{stream:(t=r[0].substr(7).split(" "))[0],track:t[1]};var i=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},n.parseSctpDescription=function(e){var t,r=n.parseMLine(e),i=n.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=n.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:r.fmt,maxMessageSize:t};if(n.matchPrefix(e,"a=sctpmap:").length>0){var a=n.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},n.writeSctpDescription=function(e,t){var r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(e,t,r){var i=void 0!==t?t:2;return"v=0\r\no="+(r||"thisisadapterortc")+" "+(e||n.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,r,i){var o=n.writeRtpDescription(e.kind,t);if(o+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),o},n.getDirection=function(e,t){for(var r=n.splitLines(e),i=0;i<r.length;i++)switch(r[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[i].substr(2)}return t?n.getDirection(t):"sendrecv"},n.getKind=function(e){return n.splitLines(e)[0].split(" ")[0].substr(2)},n.isRejected=function(e){return"0"===e.split(" ",2)[1]},n.parseMLine=function(e){var t=n.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},n.parseOLine=function(e){var t=n.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=n.splitLines(e),r=0;r<t.length;r++)if(t[r].length<2||"="!==t[r].charAt(1))return!1;return!0},"object"==typeof t&&(t.exports=n)},{}]},{},[1])(1)}));var r={1:"客户端排队超时",2:"服务端处理超时",3:"TTS服务与设备端连接失败",4:"TTS服务内部处理异常",5:"TTS接收到的消息类型不正确",6:"客户端需要重定向",7:"客户端的URL格式错误",8:"请求对讲过程中TTS服务端认证token失败",9:"设备加密算法不匹配或者设备操作码错误码",10:"设备正在对讲",11:"服务端与设备连接超时",12:"设备不在线",13:"设备已开启隐私保护",14:"token无权限",15:"session不存在",16:"验证token失败",17:"设备监听超时",18:"设备链路断开",19:"设备处于隐私遮蔽状态",20:"设备当前正在声源定位",21:"token认证失败",22:"ticket未开启",23:"ticket bizcode错误",24:"RPC Auth http不通",25:"RPC Case集群不可用",26:"RPC 流媒体向设备发送或接收信令超时/cas响应超时",27:"RPC请求超时",1003:"设备对讲过程中推流链路异常断开"},n={};function i(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}a.sessions={},a.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){var e=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),t=33;return window.navigator.userAgent.match("Linux")&&(t=35),e>=26&&e<=t||a.extension.isInstalled()}return!0};var o={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var r=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var n=new Error("NavigatorUserMediaError");n.name="You cancelled the request for permission, giving up...",r(n)}else r(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&window.clearTimeout(t.data.id)}))}};function a(e,t){if(void 0===a.initDone)return e.error("Library not initialized"),{};if(!a.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(a.log("Library initialized: "+a.initDone),(e=e||{}).success="function"==typeof e.success?e.success:a.noop,e.error="function"==typeof e.error?e.error:a.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:a.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var r=!1,n=null,o={},s=null,c=null,d=0,l=e.server;a.isArray(l)?(a.log("Multiple servers provided ("+l.length+"), will use the first that works"),l=null,c=e.server,a.debug(c)):0===l.indexOf("ws")?(r=!0,a.log("Using WebSockets to contact Janus: "+l)):(r=!1,a.log("Using REST API to contact Janus: "+l));var u=e.iceServers;null==u&&(u=[{urls:"stun:stun.l.google.com:19302"}]);var p=e.iceTransportPolicy,f=e.bundlePolicy,v=e.ipv6;null==v&&(v=!1);var m=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(m=!0===e.withCredentials);var h=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(h=e.max_poll_events),h<1&&(h=1);var g=null;void 0!==e.token&&null!==e.token&&(g=e.token);var y=null;void 0!==e.apisecret&&null!==e.apisecret&&(y=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var S=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(S=e.keepAlivePeriod),isNaN(S)&&(S=25e3);var b=6e4;function T(e){var t={high:9e5,medium:3e5,low:1e5};return null!=e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(b=e.longPollTimeout),isNaN(b)&&(b=6e4);var C=!1,w=null,k={},R=this,P=0,E={};function D(){if(null!=w)if(a.debug("Long poll..."),C){var t=l+"/"+w+"?rid="+(new Date).getTime();null!=h&&(t=t+"&maxev="+h),null!=g&&(t=t+"&token="+encodeURIComponent(g)),null!=y&&(t=t+"&apisecret="+encodeURIComponent(y)),a.httpAPICall(t,{verb:"GET",withCredentials:m,success:_,timeout:b,error:function(t,r){if(a.error(t+":",r),++P>3)return C=!1,void e.error("Lost connection to the server (is it down?)");D()}})}else a.warn("Is the server down? (connected=false)")}function _(e,t){if(P=0,r||null==w||!0===t||D(),r||!a.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(d=e.sender))return void a.warn("Missing sender...");if(null==(u=k[d]))return void a.debug("This handle is not attached to this session");var i=e.candidate;a.debug("Got a trickled candidate on session "+w),a.debug(i);var o=u.webrtcStuff;o.pc&&o.remoteSdp?(a.debug("Adding remote candidate:",i),i&&!0!==i.completed?o.pc.addIceCandidate(i):o.pc.addIceCandidate(a.endOfCandidates)):(a.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),o.candidates||(o.candidates=[]),o.candidates.push(i),a.debug(o.candidates))}else{if("webrtcup"===e.rtcgw)return a.debug("Got a webrtcup event on session "+w),a.debug(e),null==(d=e.sender)?void a.warn("Missing sender..."):null==(u=k[d])?void a.debug("This handle is not attached to this session"):void u.webrtcState(!0);if("hangup"===e.rtcgw){if(a.debug("Got a hangup event on session "+w),a.debug(e),null==(d=e.sender))return void a.warn("Missing sender...");if(null==(u=k[d]))return void a.debug("This handle is not attached to this session");u.webrtcState(!1,e.reason),u.hangup()}else if("detached"===e.rtcgw){if(a.debug("Got a detached event on session "+w),a.debug(e),null==(d=e.sender))return void a.warn("Missing sender...");if(null==(u=k[d]))return;u.detached=!0,u.ondetached(),u.detach()}else if("media"===e.rtcgw){if(a.debug("Got a media event on session "+w),a.debug(e),null==(d=e.sender))return void a.warn("Missing sender...");if(null==(u=k[d]))return void a.debug("This handle is not attached to this session");u.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(a.debug("Got a slowlink event on session "+w),a.debug(e),null==(d=e.sender))return void a.warn("Missing sender...");if(null==(u=k[d]))return void a.debug("This handle is not attached to this session");u.slowLink(e.uplink,e.lost)}else{var s,c;if("error"===e.rtcgw)return a.error("Ooops: "+e.error.code+" "+e.error.reason),a.debug(e),void(null!=(s=e.transaction)&&(null!=(c=E[s])&&c(e),delete E[s]));if("event"===e.rtcgw){var d;if(a.debug("Got a plugin event on session "+w),a.debug(e),null==(d=e.sender))return void a.warn("Missing sender...");var l=e.plugindata;if(null==l)return void a.warn("Missing plugindata...");a.debug(" -- Event is coming from "+d+" ("+l.plugin+")");var u,p=l.data;if(a.debug(p),null==(u=k[d]))return void a.warn("This handle is not attached to this session");var f=e.jsep;null!=f&&(a.debug("Handling SDP as well..."),a.debug(f));var v=u.onmessage;null!=v?(a.debug("Notifying application..."),v(p,f)):a.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return a.error("Timeout on session "+w),a.debug(e),void(r&&n.close(3504,"Gateway timeout"));a.warn("Unknown message/event '"+e.rtcgw+"' on session "+w),a.debug(e)}}}else a.debug("Got a success on session "+w),null!=(s=e.transaction)&&(null!=(c=E[s])&&c(e),delete E[s]);else null!=(s=e.transaction)&&(null!=(c=E[s])&&c(e),delete E[s]);else a.vdebug("Got a keepalive on session "+w);else for(var m=0;m<e.length;m++)_(e[m],!0)}function I(){if(null!==l&&r&&C){s=setTimeout(I,S);var e={rtcgw:"keepalive",session_id:w,transaction:a.randomString(12)};null!=g&&(e.token=g),null!=y&&(e.apisecret=y),n.send(JSON.stringify(e))}}function x(i){var u=a.randomString(12),p={rtcgw:"create",transaction:u,token:t.stream,device:t.deviceSerial,channel:t.channel,authBizType:"TALK"};if(i.reconnect&&(C=!1,p.rtcgw="claim",p.session_id=w,n&&(n.onopen=null,n.onerror=null,n.onclose=null,s&&(clearTimeout(s),s=null))),null!=g&&(p.token=g),null!=y&&(p.apisecret=y),null===l&&a.isArray(c)&&(0===(l=c[d]).indexOf("ws")?(r=!0,a.log("Server #"+(d+1)+": trying WebSockets to contact Janus ("+l+")")):(r=!1,a.log("Server #"+(d+1)+": trying REST API to contact Janus ("+l+")"))),r)for(var f in n=a.newWebSocket(l,"rtcgw-protocol"),o={error:function(){if(a.error("Error connecting to the Janus WebSockets server... "+l),a.isArray(c)&&!i.reconnect)return++d==c.length?void i.error("Error connecting to any of the provided Janus servers: Is the server down?"):(l=null,void setTimeout((function(){x(i)}),200));i.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){E[u]=function(e){if(a.debug(e),"success"!==e.rtcgw)return a.error("Ooops: "+e.error.code+" "+e.error.reason),void i.error(e.error.reason);s=setTimeout(I,S),C=!0,w=e.session_id?e.session_id:e.data.id,i.reconnect?a.log("Claimed session: "+w):a.log("Created session: "+w),a.sessions[w]=R,i.success()},n.send(JSON.stringify(p))},message:function(e){_(JSON.parse(e.data))},close:function(){null!==l&&C&&(C=!1,e.error("Lost connection to the server (is it down?)"))}})n.addEventListener(f,o[f]);else a.httpAPICall(l,{verb:"POST",withCredentials:m,body:p,success:function(e){if(a.debug(e),"success"!==e.rtcgw)return a.error("Ooops: "+e.error.code+" "+e.error.reason),void i.error(e.error.reason);C=!0,w=e.session_id?e.session_id:e.data.id,i.reconnect?a.log("Claimed session: "+w):a.log("Created session: "+w),a.sessions[w]=R,D(),i.success()},error:function(e,t){if(a.error(e+":",t),a.isArray(c)&&!i.reconnect)return++d==c.length?void i.error("Error connecting to any of the provided Janus servers: Is the server down?"):(l=null,void setTimeout((function(){x(i)}),200));""===t?i.error(e+": Is the server down?"):i.error(e+": "+t)}})}function M(e,t){if((t=t||{}).success="function"==typeof t.success?t.success:a.noop,t.error="function"==typeof t.error?t.error:a.noop,!C)return a.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var i=k[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return a.warn("Invalid handle"),void t.error("Invalid handle");var o=t.message,s=t.jsep,c=a.randomString(12),d={rtcgw:"message",body:o,transaction:c};if(null!==i.token&&void 0!==i.token&&(d.token=i.token),null!=y&&(d.apisecret=y),null!=s&&(d.jsep=s),a.debug("Sending message to plugin (handle="+e+"):"),a.debug(d),r)return d.session_id=w,d.handle_id=e,E[c]=function(e){if(a.debug("Message sent!"),a.debug(e),"success"===e.rtcgw){var r=e.plugindata;if(null==r)return a.warn("Request succeeded, but missing plugindata..."),void t.success();a.log("Synchronous transaction successful ("+r.plugin+")");var n=r.data;return a.debug(n),void t.success(n)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(a.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(a.error("Unknown error"),t.error("Unknown error"))},void n.send(JSON.stringify(d));a.httpAPICall(l+"/"+w+"/"+e,{verb:"POST",withCredentials:m,body:d,success:function(e){if(a.debug("Message sent!"),a.debug(e),"success"===e.rtcgw){var r=e.plugindata;if(null==r)return a.warn("Request succeeded, but missing plugindata..."),void t.success();a.log("Synchronous transaction successful ("+r.plugin+")");var n=r.data;return a.debug(n),void t.success(n)}"ack"===e.rtcgw?t.success():void 0!==e.error&&null!==e.error?(a.error("Ooops: "+e.error.code+" "+e.error.reason),t.error(e.error.code+" "+e.error.reason)):(a.error("Unknown error"),t.error("Unknown error"))},error:function(e,r){a.error(e+":",r),t.error(e+": "+r)}})}function O(e,t){if(C){var i=k[e];if(null!=i&&null!==i.webrtcStuff&&void 0!==i.webrtcStuff){var o={rtcgw:"trickle",candidate:t,transaction:a.randomString(12)};if(null!==i.token&&void 0!==i.token&&(o.token=i.token),null!=y&&(o.apisecret=y),a.vdebug("Sending trickle candidate (handle="+e+"):"),a.vdebug(o),r)return o.session_id=w,o.handle_id=e,void n.send(JSON.stringify(o));a.httpAPICall(l+"/"+w+"/"+e,{verb:"POST",withCredentials:m,body:o,success:function(e){a.vdebug("Candidate sent!"),a.vdebug(e),"ack"===e.rtcgw||a.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){a.error(e+":",t)}})}else a.warn("Invalid handle")}else a.warn("Is the server down? (connected=false)")}function A(e,t,r,n){var i=k[e];if(null!=i&&null!==i.webrtcStuff&&void 0!==i.webrtcStuff){var o=i.webrtcStuff,s=function(e){a.log("Received state change on data channel:",e);var t=e.target.label,r=o.dataChannel[t]?o.dataChannel[t].readyState:"null";if(a.log("State change on <"+t+"> data channel: "+r),"open"===r){if(o.dataChannel[t].pending&&o.dataChannel[t].pending.length>0){for(var n in a.log("Sending pending messages on <"+t+">:",o.dataChannel[t].pending.length),o.dataChannel[t].pending){var s=o.dataChannel[t].pending[n];a.log("Sending string on data channel <"+t+">: "+s),o.dataChannel[t].send(s)}o.dataChannel[t].pending=[]}i.ondataopen(t)}};o.dataChannel[t]=r||o.pc.createDataChannel(t,{ordered:!1}),o.dataChannel[t].onmessage=function(e){a.log("Received message on data channel:",e);var t=e.target.label;i.ondata(e.data,t)},o.dataChannel[t].onopen=s,o.dataChannel[t].onclose=s,o.dataChannel[t].onerror=function(e){a.error("Got error on data channel:",e)},o.dataChannel[t].pending=[],n&&o.dataChannel[t].pending.push(n)}else a.warn("Invalid handle")}function j(e,t){(t=t||{}).success="function"==typeof t.success?t.success:a.noop,t.error="function"==typeof t.error?t.error:a.noop;var r=k[e];if(null==r||null===r.webrtcStuff||void 0===r.webrtcStuff)return a.warn("Invalid handle"),void t.error("Invalid handle");var n=r.webrtcStuff,i=t.text;if(null==i)return a.warn("Invalid text"),void t.error("Invalid text");var o=t.label?t.label:a.dataChanDefaultLabel;return n.dataChannel[o]?"open"!==n.dataChannel[o].readyState?(n.dataChannel[o].pending.push(i),void t.success()):(a.log("Sending string on data channel <"+o+">: "+i),n.dataChannel[o].send(i),void t.success()):(A(e,o,!1,i),void t.success())}function L(e,t){(t=t||{}).success="function"==typeof t.success?t.success:a.noop,t.error="function"==typeof t.error?t.error:a.noop;var r=k[e];if(null==r||null===r.webrtcStuff||void 0===r.webrtcStuff)return a.warn("Invalid handle"),void t.error("Invalid handle");var n=r.webrtcStuff;if(null===n.dtmfSender||void 0===n.dtmfSender){if(void 0!==n.pc&&null!==n.pc){var i=n.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!i)return a.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");n.dtmfSender=i.dtmf,n.dtmfSender&&(a.log("Created DTMF Sender"),n.dtmfSender.ontonechange=function(e){a.debug("Sent DTMF tone: "+e.tone)})}if(null===n.dtmfSender||void 0===n.dtmfSender)return a.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var o=t.dtmf;if(null==o)return a.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var s=o.tones;if(null==s)return a.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var c=o.duration;null==c&&(c=500);var d=o.gap;null==d&&(d=50),a.debug("Sending DTMF string "+s+" (duration "+c+"ms, gap "+d+"ms)"),n.dtmfSender.insertDTMF(s,c,d),t.success()}function N(e,t){(t=t||{}).success="function"==typeof t.success?t.success:a.noop,t.error="function"==typeof t.error?t.error:a.noop;var i=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(i=!0===t.asyncRequest);var o=!0;void 0!==t.noRequest&&null!==t.noRequest&&(o=!0===t.noRequest),a.log("Destroying handle "+e+" (async="+i+")"),H(e);var s=k[e];if(null==s||s.detached)return delete k[e],void t.success();if(o)return delete k[e],void t.success();if(!C)return a.warn("Is the server down? (connected=false)"),void t.error("Is the server down? (connected=false)");var c={rtcgw:"detach",transaction:a.randomString(12)};if(null!==s.token&&void 0!==s.token&&(c.token=s.token),null!=y&&(c.apisecret=y),r)return c.session_id=w,c.handle_id=e,n.send(JSON.stringify(c)),delete k[e],void t.success();a.httpAPICall(l+"/"+w+"/"+e,{verb:"POST",async:i,withCredentials:m,body:c,success:function(r){a.log("Destroyed handle:"),a.debug(r),"success"!==r.rtcgw&&a.error("Ooops: "+r.error.code+" "+r.error.reason),delete k[e],t.success()},error:function(r,n){a.error(r+":",n),delete k[e],t.success()}})}function V(e,t,r,n,i){return G.apply(this,arguments)}function G(){var e;return e=function*(e,t,r,n,i){var o=k[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return a.warn("Invalid handle"),void n.error("Invalid handle");var s=o.webrtcStuff;a.debug("streamsDone:",i),i&&(a.debug(" -- Audio tracks:",i.getAudioTracks()),a.debug(" -- Video tracks:",i.getVideoTracks()));var c=!1;if(s.myStream&&r.update&&!s.streamExternal){if((!r.update&&K(r)||r.update&&(r.addAudio||r.replaceAudio))&&i.getAudioTracks()&&i.getAudioTracks().length)if(s.myStream.addTrack(i.getAudioTracks()[0]),a.unifiedPlan){a.log((r.replaceAudio?"Replacing":"Adding")+" audio track:",i.getAudioTracks()[0]);var d=null;if((S=s.pc.getTransceivers())&&S.length>0)for(var l in S)if((C=S[l]).sender&&C.sender.track&&"audio"===C.sender.track.kind||C.receiver&&C.receiver.track&&"audio"===C.receiver.track.kind){d=C;break}let e=null;try{e=yield n.customizeStream(i)}catch(e){n.error(e)}var m,h,g,y;d&&d.sender?d.sender.replaceTrack((null==e||null==(h=e.getAudioTracks)||null==(m=h.call(e))?void 0:m[0])||i.getAudioTracks()[0]):s.pc.addTrack((null==e||null==(y=e.getAudioTracks)||null==(g=y.call(e))?void 0:g[0])||i.getAudioTracks()[0],e||i)}else a.log((r.replaceAudio?"Replacing":"Adding")+" audio track:",i.getAudioTracks()[0]),s.pc.addTrack(i.getAudioTracks()[0],i);if((!r.update&&Y(r)||r.update&&(r.addVideo||r.replaceVideo))&&i.getVideoTracks()&&i.getVideoTracks().length)if(s.myStream.addTrack(i.getVideoTracks()[0]),a.unifiedPlan){a.log((r.replaceVideo?"Replacing":"Adding")+" video track:",i.getVideoTracks()[0]);var S,b=null;if((S=s.pc.getTransceivers())&&S.length>0)for(var l in S){var C;if((C=S[l]).sender&&C.sender.track&&"video"===C.sender.track.kind||C.receiver&&C.receiver.track&&"video"===C.receiver.track.kind){b=C;break}}b&&b.sender?b.sender.replaceTrack(i.getVideoTracks()[0]):s.pc.addTrack(i.getVideoTracks()[0],i)}else a.log((r.replaceVideo?"Replacing":"Adding")+" video track:",i.getVideoTracks()[0]),s.pc.addTrack(i.getVideoTracks()[0],i)}else s.myStream=i,c=!0;if(!s.pc){var w={iceServers:u,iceTransportPolicy:p,bundlePolicy:f};"chrome"===a.webRTCAdapter.browserDetails.browser&&(w.sdpSemantics=a.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan");var R={optional:[{DtlsSrtpKeyAgreement:!0}]};if(!0===v&&R.optional.push({googIPv6:!0}),n.rtcConstraints&&"object"==typeof n.rtcConstraints)for(var l in a.debug("Adding custom PeerConnection constraints:",n.rtcConstraints),n.rtcConstraints)R.optional.push(n.rtcConstraints[l]);"edge"===a.webRTCAdapter.browserDetails.browser&&(w.bundlePolicy="max-bundle"),a.log("Creating PeerConnection"),a.debug(R),s.pc=new RTCPeerConnection(w,R),s.pc.getStats&&(s.volume={},s.bitrate.value="0 kbits/sec"),a.log("Preparing local SDP and gathering candidates (trickle="+s.trickle+")"),s.pc.oniceconnectionstatechange=function(e){s.pc&&o.iceState(s.pc.iceConnectionState)},s.pc.onicecandidate=function(t){if(null==t.candidate||"edge"===a.webRTCAdapter.browserDetails.browser&&t.candidate.candidate.indexOf("endOfCandidates")>0)a.log("End of candidates."),s.iceDone=!0,!0===s.trickle?O(e,{completed:!0}):function(e,t){(t=t||{}).success="function"==typeof t.success?t.success:a.noop,t.error="function"==typeof t.error?t.error:a.noop;var r=k[e];if(null!=r&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){var n=r.webrtcStuff;a.log("Sending offer/answer SDP..."),null!==n.mySdp&&void 0!==n.mySdp?(n.mySdp={type:n.pc.localDescription.type,sdp:n.pc.localDescription.sdp},!1===n.trickle&&(n.mySdp.trickle=!1),a.debug(t),n.sdpSent=!0,t.success(n.mySdp)):a.warn("Local SDP instance is invalid, not sending anything...")}else a.warn("Invalid handle, not sending anything")}(e,n);else{var r={candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex};!0===s.trickle&&O(e,r)}},s.pc.ontrack=function(e){a.log("Handling Remote Track"),a.debug(e),e.streams&&(s.remoteStream=e.streams[0],o.onremotestream(s.remoteStream),e.track.onended||(a.log("Adding onended callback to track:",e.track),e.track.onended=function(e){a.log("Remote track muted/removed:",e),s.remoteStream&&(s.remoteStream.removeTrack(e.target),o.onremotestream(s.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){try{s.remoteStream.addTrack(e.target),o.onremotestream(s.remoteStream)}catch(e){a.error(e)}}))}}if(c&&null!=i){a.log("Adding local stream");var P=!0===n.simulcast2,E=i.getTracks();for(let e=0;e<E.length;e++){let t=E[e];if(P)if("audio"===t.kind)s.pc.addTrack(t,i);else{a.log("Enabling rid-based simulcasting:",t);const e=T(n.simulcastMaxBitrates);s.pc.addTransceiver(t,{direction:"sendrecv",streams:[i],sendEncodings:[{rid:"h",active:!0,maxBitrate:e.high},{rid:"m",active:!0,maxBitrate:e.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:e.low,scaleResolutionDownBy:4}]})}else if("audio"===t.kind){var D,_;let e=null;try{e=yield n.customizeStream(i)}catch(e){n.error(e)}s.pc.addTrack((null==e||null==(_=e.getAudioTracks)||null==(D=_.call(e))?void 0:D[0])||t,e||i)}else s.pc.addTrack(t,i)}}(function(e){return"edge"==a.webRTCAdapter.browserDetails.browser?(a.warn("Edge doesn't support data channels yet"),!1):null!=e&&!0===e.data})(r)&&!s.dataChannel[a.dataChanDefaultLabel]&&(a.log("Creating data channel"),A(e,a.dataChanDefaultLabel,!1),s.pc.ondatachannel=function(t){a.log("Data channel created by Janus:",t),A(e,t.channel.label,t.channel)}),s.myStream&&o.onlocalstream(s.myStream),null==t?function(e,t,r){(r=r||{}).success="function"==typeof r.success?r.success:a.noop,r.error="function"==typeof r.error?r.error:a.noop,r.customizeSdp="function"==typeof r.customizeSdp?r.customizeSdp:a.noop;var n=k[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return a.warn("Invalid handle"),void r.error("Invalid handle");var i=n.webrtcStuff,o=!0===r.simulcast;o?a.log("Creating offer (iceDone="+i.iceDone+", simulcast="+o+")"):a.log("Creating offer (iceDone="+i.iceDone+")");var s={};if(a.unifiedPlan){var c=null,d=null,l=i.pc.getTransceivers();if(l&&l.length>0)for(var u in l){var p=l[u];p.sender&&p.sender.track&&"audio"===p.sender.track.kind||p.receiver&&p.receiver.track&&"audio"===p.receiver.track.kind?c||(c=p):(p.sender&&p.sender.track&&"video"===p.sender.track.kind||p.receiver&&p.receiver.track&&"video"===p.receiver.track.kind)&&(d||(d=p))}var f=K(t),v=$(t);f||v?f&&v?c&&(c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",a.log("Setting audio transceiver to sendrecv:",c)):f&&!v?c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",a.log("Setting audio transceiver to sendonly:",c)):!f&&v&&(c?(c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",a.log("Setting audio transceiver to recvonly:",c)):(c=i.pc.addTransceiver("audio",{direction:"recvonly"}),a.log("Adding recvonly audio transceiver:",c))):t.removeAudio&&c&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive",a.log("Setting audio transceiver to inactive:",c));var m=Y(t),h=Q(t);m||h?m&&h?d&&(d.setDirection?d.setDirection("sendrecv"):d.direction="sendrecv",a.log("Setting video transceiver to sendrecv:",d)):m&&!h?d&&(d.setDirection?d.setDirection("sendonly"):d.direction="sendonly",a.log("Setting video transceiver to sendonly:",d)):!m&&h&&(d?(d.setDirection?d.setDirection("recvonly"):d.direction="recvonly",a.log("Setting video transceiver to recvonly:",d)):(d=i.pc.addTransceiver("video",{direction:"recvonly"}),a.log("Adding recvonly video transceiver:",d))):t.removeVideo&&d&&(d.setDirection?d.setDirection("inactive"):d.direction="inactive",a.log("Setting video transceiver to inactive:",d))}else s.offerToReceiveAudio=$(t),s.offerToReceiveVideo=Q(t);!0===r.iceRestart&&(s.iceRestart=!0),a.debug(s);var y=Y(t);if(y&&o&&"firefox"===a.webRTCAdapter.browserDetails.browser){var S=i.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(S){var b=S.getParameters();b||(b={});const e=T(r.simulcastMaxBitrates);b.encodings=[{rid:"h",active:!0,maxBitrate:e.high},{rid:"m",active:!0,maxBitrate:e.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:e.low,scaleResolutionDownBy:4}],S.setParameters(b)}}i.pc.createOffer(s).then((function(e){var t={type:e.type,sdp:e.sdp};r.customizeSdp(t),e.sdp=t.sdp,a.log("Setting local description"),y&&o&&("chrome"===a.webRTCAdapter.browserDetails.browser||"safari"===a.webRTCAdapter.browserDetails.browser?(a.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),r=!1,n=[-1],i=[-1],o=null,s=null,c=null,d=null,l=-1,u=0;u<t.length;u++)if(f=t[u].match(/m=(\w+) */)){if("video"===f[1]){if(!(n[0]<0)){l=u;break}r=!0}else if(n[0]>-1){l=u;break}}else if(r){var p=t[u].match(/a=ssrc-group:FID (\d+) (\d+)/);if(p)n[0]=p[1],i[0]=p[2],t.splice(u,1),u--;else{if(n[0]){if((m=t[u].match("a=ssrc:"+n[0]+" cname:(.+)"))&&(o=m[1]),(m=t[u].match("a=ssrc:"+n[0]+" msid:(.+)"))&&(s=m[1]),(m=t[u].match("a=ssrc:"+n[0]+" mslabel:(.+)"))&&(c=m[1]),(m=t[u].match("a=ssrc:"+n[0]+" label:(.+)"))&&(d=m[1]),0===t[u].indexOf("a=ssrc:"+i[0])){t.splice(u,1),u--;continue}if(0===t[u].indexOf("a=ssrc:"+n[0])){t.splice(u,1),u--;continue}}0!=t[u].length||(t.splice(u,1),u--)}}if(n[0]<0)for(l=-1,r=!1,u=0;u<t.length;u++){var f;if(f=t[u].match(/m=(\w+) */)){if("video"===f[1]){if(!(n[0]<0)){l=u;break}r=!0}else if(n[0]>-1){l=u;break}}else if(r){if(n[0]<0){var v=t[u].match(/a=ssrc:(\d+)/);if(v){n[0]=v[1],t.splice(u,1),u--;continue}}else{var m;if((m=t[u].match("a=ssrc:"+n[0]+" cname:(.+)"))&&(o=m[1]),(m=t[u].match("a=ssrc:"+n[0]+" msid:(.+)"))&&(s=m[1]),(m=t[u].match("a=ssrc:"+n[0]+" mslabel:(.+)"))&&(c=m[1]),(m=t[u].match("a=ssrc:"+n[0]+" label:(.+)"))&&(d=m[1]),0===t[u].indexOf("a=ssrc:"+i[0])){t.splice(u,1),u--;continue}if(0===t[u].indexOf("a=ssrc:"+n[0])){t.splice(u,1),u--;continue}}0!=t[u].length||(t.splice(u,1),u--)}}if(n[0]<0)return a.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;for(l<0&&(l=t.length),n[1]=Math.floor(4294967295*Math.random()),n[2]=Math.floor(4294967295*Math.random()),i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),u=0;u<n.length;u++)o&&(t.splice(l,0,"a=ssrc:"+n[u]+" cname:"+o),l++),s&&(t.splice(l,0,"a=ssrc:"+n[u]+" msid:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+n[u]+" mslabel:"+c),l++),d&&(t.splice(l,0,"a=ssrc:"+n[u]+" label:"+d),l++),o&&(t.splice(l,0,"a=ssrc:"+i[u]+" cname:"+o),l++),s&&(t.splice(l,0,"a=ssrc:"+i[u]+" msid:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+i[u]+" mslabel:"+c),l++),d&&(t.splice(l,0,"a=ssrc:"+i[u]+" label:"+d),l++);return t.splice(l,0,"a=ssrc-group:FID "+n[2]+" "+i[2]),t.splice(l,0,"a=ssrc-group:FID "+n[1]+" "+i[1]),t.splice(l,0,"a=ssrc-group:FID "+n[0]+" "+i[0]),t.splice(l,0,"a=ssrc-group:SIM "+n[0]+" "+n[1]+" "+n[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n"),e}(e.sdp)):"firefox"!==a.webRTCAdapter.browserDetails.browser&&a.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),i.mySdp=e.sdp,i.pc.setLocalDescription(e).catch(r.error),i.mediaConstraints=s,i.iceDone||i.trickle?(a.log("Offer ready"),a.debug(r),r.success(e)):a.log("Waiting for all candidates...")}),r.error)}(e,r,n):s.pc.setRemoteDescription(t).then((function(){if(a.log("Remote description accepted!"),s.remoteSdp=t.sdp,s.candidates&&s.candidates.length>0){for(var i=0;i<s.candidates.length;i++){var o=s.candidates[i];a.debug("Adding remote candidate:",o),o&&!0!==o.completed?s.pc.addIceCandidate(o):s.pc.addIceCandidate(a.endOfCandidates)}s.candidates=[]}!function(e,t,r){(r=r||{}).success="function"==typeof r.success?r.success:a.noop,r.error="function"==typeof r.error?r.error:a.noop,r.customizeSdp="function"==typeof r.customizeSdp?r.customizeSdp:a.noop;var n=k[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return a.warn("Invalid handle"),void r.error("Invalid handle");var i=n.webrtcStuff,o=!0===r.simulcast;o?a.log("Creating answer (iceDone="+i.iceDone+", simulcast="+o+")"):a.log("Creating answer (iceDone="+i.iceDone+")");var s=null;if(a.unifiedPlan){s={};var c=null,d=null,l=i.pc.getTransceivers();if(l&&l.length>0)for(var u in l){var p=l[u];p.sender&&p.sender.track&&"audio"===p.sender.track.kind||p.receiver&&p.receiver.track&&"audio"===p.receiver.track.kind?c||(c=p):(p.sender&&p.sender.track&&"video"===p.sender.track.kind||p.receiver&&p.receiver.track&&"video"===p.receiver.track.kind)&&(d||(d=p))}var f=K(t),v=$(t);if(f||v){if(f&&v){if(c)try{c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",a.log("Setting audio transceiver to sendrecv:",c)}catch(e){a.error(e)}}else if(f&&!v)try{c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",a.log("Setting audio transceiver to sendonly:",c))}catch(e){a.error(e)}else if(!f&&v)if(c)try{c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",a.log("Setting audio transceiver to recvonly:",c)}catch(e){a.error(e)}else c=i.pc.addTransceiver("audio",{direction:"recvonly"}),a.log("Adding recvonly audio transceiver:",c)}else if(t.removeAudio&&c)try{c.setDirection?c.setDirection("inactive"):c.direction="inactive",a.log("Setting audio transceiver to inactive:",c)}catch(e){a.error(e)}var m=Y(t),h=Q(t);if(m||h){if(m&&h){if(d)try{d.setDirection?d.setDirection("sendrecv"):d.direction="sendrecv",a.log("Setting video transceiver to sendrecv:",d)}catch(e){a.error(e)}}else if(m&&!h){if(d)try{d.setDirection?d.setDirection("sendonly"):d.direction="sendonly",a.log("Setting video transceiver to sendonly:",d)}catch(e){a.error(e)}}else if(!m&&h)if(d)try{d.setDirection?d.setDirection("recvonly"):d.direction="recvonly",a.log("Setting video transceiver to recvonly:",d)}catch(e){a.error(e)}else d=i.pc.addTransceiver("video",{direction:"recvonly"}),a.log("Adding recvonly video transceiver:",d)}else if(t.removeVideo&&d)try{d.setDirection?d.setDirection("inactive"):d.direction="inactive",a.log("Setting video transceiver to inactive:",d)}catch(e){a.error(e)}}else s="firefox"==a.webRTCAdapter.browserDetails.browser||"edge"==a.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:$(t),offerToReceiveVideo:Q(t)}:{mandatory:{OfferToReceiveAudio:$(t),OfferToReceiveVideo:Q(t)}};a.debug(s);var g=Y(t);if(g&&o&&"firefox"===a.webRTCAdapter.browserDetails.browser){a.log("Enabling Simulcasting for Firefox (RID)");var y=i.pc.getSenders()[1];a.log(y);var S=y.getParameters();a.log(S);const e=T(r.simulcastMaxBitrates);y.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:e.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:e.medium},{rid:"low",active:!0,priority:"low",maxBitrate:e.low}]})}i.pc.createAnswer(s).then((function(e){a.debug(e);var t={type:e.type,sdp:e.sdp};r.customizeSdp(t),e.sdp=t.sdp,a.log("Setting local description"),g&&o&&("chrome"===a.webRTCAdapter.browserDetails.browser?a.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==a.webRTCAdapter.browserDetails.browser&&a.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),i.mySdp=e.sdp,i.pc.setLocalDescription(e).catch(r.error),i.mediaConstraints=s,i.iceDone||i.trickle?r.success(e):a.log("Waiting for all candidates...")}),r.error)}(e,r,n)}),n.error)},G=function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,c,"next",e)}function c(e){i(a,n,o,s,c,"throw",e)}s(void 0)}))},G.apply(this,arguments)}function U(e,t,r){(r=r||{}).success="function"==typeof r.success?r.success:a.noop,r.error="function"==typeof r.error?r.error:q,r.customizeStream="function"==typeof r.customizeStream?r.customizeStream:a.noop;var n=r.jsep;if(t&&n)return a.error("Provided a JSEP to a createOffer"),void r.error("Provided a JSEP to a createOffer");if(!(t||n&&n.type&&n.sdp))return a.error("A valid JSEP is required for createAnswer"),void r.error("A valid JSEP is required for createAnswer");r.media=r.media||{audio:!0,video:!0};var i=r.media,o=k[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return a.warn("Invalid handle"),void r.error("Invalid handle");var s,c=o.webrtcStuff;if(c.trickle=null==(s=r.trickle)||!0===s,void 0===c.pc||null===c.pc)i.update=!1,i.keepAudio=!1,i.keepVideo=!1;else if(void 0!==c.pc&&null!==c.pc){if(a.log("Updating existing media session"),i.update=!0,null!==r.stream&&void 0!==r.stream)r.stream!==c.myStream&&a.log("Renegotiation involves a new external stream");else{if(i.addAudio){if(i.keepAudio=!1,i.replaceAudio=!1,i.removeAudio=!1,i.audioSend=!0,c.myStream&&c.myStream.getAudioTracks()&&c.myStream.getAudioTracks().length)return a.error("Can't add audio stream, there already is one"),void r.error("Can't add audio stream, there already is one")}else i.removeAudio?(i.keepAudio=!1,i.replaceAudio=!1,i.addAudio=!1,i.audioSend=!1):i.replaceAudio&&(i.keepAudio=!1,i.addAudio=!1,i.removeAudio=!1,i.audioSend=!0);if(null===c.myStream||void 0===c.myStream?(i.replaceAudio&&(i.keepAudio=!1,i.replaceAudio=!1,i.addAudio=!0,i.audioSend=!0),K(i)&&(i.keepAudio=!1,i.addAudio=!0)):null===c.myStream.getAudioTracks()||void 0===c.myStream.getAudioTracks()||0===c.myStream.getAudioTracks().length?(i.replaceAudio&&(i.keepAudio=!1,i.replaceAudio=!1,i.addAudio=!0,i.audioSend=!0),K(i)&&(i.keepVideo=!1,i.addAudio=!0)):!K(i)||i.removeAudio||i.replaceAudio||(i.keepAudio=!0),i.addVideo){if(i.keepVideo=!1,i.replaceVideo=!1,i.removeVideo=!1,i.videoSend=!0,c.myStream&&c.myStream.getVideoTracks()&&c.myStream.getVideoTracks().length)return a.error("Can't add video stream, there already is one"),void r.error("Can't add video stream, there already is one")}else i.removeVideo?(i.keepVideo=!1,i.replaceVideo=!1,i.addVideo=!1,i.videoSend=!1):i.replaceVideo&&(i.keepVideo=!1,i.addVideo=!1,i.removeVideo=!1,i.videoSend=!0);null===c.myStream||void 0===c.myStream||null===c.myStream.getVideoTracks()||void 0===c.myStream.getVideoTracks()||0===c.myStream.getVideoTracks().length?(i.replaceVideo&&(i.keepVideo=!1,i.replaceVideo=!1,i.addVideo=!0,i.videoSend=!0),Y(i)&&(i.keepVideo=!1,i.addVideo=!0)):!Y(i)||i.removeVideo||i.replaceVideo||(i.keepVideo=!0),i.addData&&(i.data=!0)}if(K(i)&&i.keepAudio&&Y(i)&&i.keepVideo)return o.consentDialog(!1),void V(e,n,i,r,c.myStream)}if(i.update&&!c.streamExternal){if(i.removeAudio||i.replaceAudio){if(c.myStream&&c.myStream.getAudioTracks()&&c.myStream.getAudioTracks().length){var d=c.myStream.getAudioTracks()[0];a.log("Removing audio track:",d),c.myStream.removeTrack(d);try{d.stop()}catch(D){}}if(c.pc.getSenders()&&c.pc.getSenders().length){var l=!0;if(i.replaceAudio&&a.unifiedPlan&&(l=!1),l)for(var u in c.pc.getSenders())(d=c.pc.getSenders()[u])&&d.track&&"audio"===d.track.kind&&(a.log("Removing audio sender:",d),c.pc.removeTrack(d))}}if(i.removeVideo||i.replaceVideo){if(c.myStream&&c.myStream.getVideoTracks()&&c.myStream.getVideoTracks().length){d=c.myStream.getVideoTracks()[0],a.log("Removing video track:",d),c.myStream.removeTrack(d);try{d.stop()}catch(_){}}if(c.pc.getSenders()&&c.pc.getSenders().length){var p=!0;if(i.replaceVideo&&a.unifiedPlan&&(p=!1),p)for(var u in c.pc.getSenders())(d=c.pc.getSenders()[u])&&d.track&&"video"===d.track.kind&&(a.log("Removing video sender:",d),c.pc.removeTrack(d))}}}if(null!==r.stream&&void 0!==r.stream){var f=r.stream;if(a.log("MediaStream provided by the application"),a.debug(f),i.update&&c.myStream&&c.myStream!==r.stream&&!c.streamExternal){try{var v=c.myStream.getTracks();for(var m in v){var h=v[m];a.log(h),null!=h&&h.stop()}}catch(I){}c.myStream=null}return c.streamExternal=!0,o.consentDialog(!1),void V(e,n,i,r,f)}if(K(i)||Y(i)){if(!a.isGetUserMediaAvailable())return void r.error("getUserMedia not available");var g={mandatory:{},optional:[]};o.consentDialog(!0);var y=K(i);!0===y&&null!=i&&null!=i&&"object"==typeof i.audio&&(y=i.audio);var S=Y(i);if(!0===S&&null!=i&&null!=i){var b=!0===r.simulcast,T=!0===r.simulcast2;if(!b&&!T||n||void 0!==i.video&&!1!==i.video||(i.video="hires"),i.video&&"screen"!=i.video&&"window"!=i.video)if("object"==typeof i.video)S=i.video;else{var C=0,w=0;"lowres"===i.video?(w=240,C=320):"lowres-16:9"===i.video?(w=180,C=320):"hires"===i.video||"hires-16:9"===i.video||"hdres"===i.video?(w=720,C=1280):"fhdres"===i.video?(w=1080,C=1920):"4kres"===i.video?(w=2160,C=3840):"stdres"===i.video?(w=480,C=640):"stdres-16:9"===i.video?(w=360,C=640):(a.log("Default video setting is stdres 4:3"),w=480,C=640),a.log("Adding media constraint:",i.video),S={height:{ideal:w},width:{ideal:C}},a.log("Adding video constraint:",S)}else if("screen"===i.video||"window"===i.video){if(i.screenshareFrameRate||(i.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){o.consentDialog(!1),K(i)&&!i.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(o){t.addTrack(o.getAudioTracks()[0]),V(e,n,i,r,t)})):V(e,n,i,r,t)}),(function(e){o.consentDialog(!1),r.error(e)}));function x(t,a){o.consentDialog(!1),t?r.error(t):V(e,n,i,r,a)}function M(e,t,r){a.log("Adding media constraint (screen capture)"),a.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){r?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(r){e.addTrack(r.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){o.consentDialog(!1),t(e)}))}if("chrome"===a.webRTCAdapter.browserDetails.browser){var R=a.webRTCAdapter.browserDetails.version,P=33;window.navigator.userAgent.match("Linux")&&(P=35),R>=26&&R<=P?M(g={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:i.screenshareFrameRate,maxFrameRate:i.screenshareFrameRate,chromeMediaSource:"screen"}},audio:K(i)&&!i.keepAudio},x):a.extension.getScreen((function(e,t){if(e)return o.consentDialog(!1),r.error(e);(g={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:i.screenshareFrameRate,maxFrameRate:i.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,M(g,x,K(i)&&!i.keepAudio)}))}else if("firefox"===a.webRTCAdapter.browserDetails.browser){if(!(a.webRTCAdapter.browserDetails.version>=33)){var E=new Error("NavigatorUserMediaError");return E.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",o.consentDialog(!1),void r.error(E)}M(g={video:{mozMediaSource:i.video,mediaSource:i.video},audio:K(i)&&!i.keepAudio},(function(e,t){if(x(e,t),!e)var r=t.currentTime,n=window.setInterval((function(){t||window.clearInterval(n),t.currentTime==r&&(window.clearInterval(n),t.onended&&t.onended()),r=t.currentTime}),500)}))}return}}null!=i&&"screen"===i.video||navigator.mediaDevices.enumerateDevices().then((function(t){var s=t.some((function(e){return"audioinput"===e.kind})),c=function(e){if(null==e)return!1;if("object"!=typeof e.video||"object"!=typeof e.video.mandatory)return!1;var t=e.video.mandatory;return t.chromeMediaSource?"desktop"===t.chromeMediaSource||"screen"===t.chromeMediaSource:t.mozMediaSource?"window"===t.mozMediaSource||"screen"===t.mozMediaSource:!!t.mediaSource&&("window"===t.mediaSource||"screen"===t.mediaSource)}(i)||t.some((function(e){return"videoinput"===e.kind})),d=K(i),l=Y(i),u=function(e){return null!=e&&!1!==e.audio&&!1!==e.audioSend&&void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio}(i),p=function(e){return null!=e&&!1!==e.video&&!1!==e.videoSend&&void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo}(i);if(d||l||u||p){var v=!!d&&s,m=!!l&&c;if(!v&&!m)return o.consentDialog(!1),r.error("No capture device found"),!1;if(!v&&u)return o.consentDialog(!1),r.error("Audio capture is required, but no capture device found"),!1;if(!m&&p)return o.consentDialog(!1),r.error("Video capture is required, but no capture device found"),!1}var h={audio:!(!s||i.keepAudio)&&y,video:!(!c||i.keepVideo)&&S};a.debug("getUserMedia constraints",h),h.audio||h.video?navigator.mediaDevices.getUserMedia(h).then((function(t){o.consentDialog(!1),V(e,n,i,r,t)})).catch((function(e){o.consentDialog(!1),r.error({code:e.code,name:e.name,message:e.message})})):(o.consentDialog(!1),V(e,n,i,r,f))})).catch((function(e){o.consentDialog(!1),r.error("enumerateDevices error",e)}))}else V(e,n,i,r)}function F(e,t){(t=t||{}).success="function"==typeof t.success?t.success:a.noop,t.error="function"==typeof t.error?t.error:q;var r=t.jsep,n=k[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return a.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null!=r){if(null===i.pc)return a.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");i.pc.setRemoteDescription(r).then((function(){if(a.log("Remote description accepted!"),i.remoteSdp=r.sdp,i.candidates&&i.candidates.length>0){for(var e=0;e<i.candidates.length;e++){var n=i.candidates[e];a.debug("Adding remote candidate:",n),n&&!0!==n.completed?i.pc.addIceCandidate(n):i.pc.addIceCandidate(a.endOfCandidates)}i.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function z(e,t){var r=k[e];if(null==r||null===r.webrtcStuff||void 0===r.webrtcStuff)return a.warn("Invalid handle"),0;var n=t?"remote":"local",i=r.webrtcStuff;return i.volume[n]||(i.volume[n]={value:0}),i.pc.getStats&&"chrome"===a.webRTCAdapter.browserDetails.browser?!t||null!==i.remoteStream&&void 0!==i.remoteStream?t||null!==i.myStream&&void 0!==i.myStream?null===i.volume[n].timer||void 0===i.volume[n].timer?(a.log("Starting "+n+" volume monitor"),i.volume[n].timer=setInterval((function(){i.pc.getStats((function(e){for(var r=e.result(),o=0;o<r.length;o++){var a=r[o];"ssrc"==a.type&&(t&&a.stat("audioOutputLevel")?i.volume[n].value=parseInt(a.stat("audioOutputLevel")):!t&&a.stat("audioInputLevel")&&(i.volume[n].value=parseInt(a.stat("audioInputLevel"))))}}))}),200),0):i.volume[n].value:(a.warn("Local stream unavailable"),0):(a.warn("Remote stream unavailable"),0):(a.warn("Getting the "+n+" volume unsupported by browser"),0)}function J(e,t){var r=k[e];if(null==r||null===r.webrtcStuff||void 0===r.webrtcStuff)return a.warn("Invalid handle"),!0;var n=r.webrtcStuff;return null===n.pc||void 0===n.pc?(a.warn("Invalid PeerConnection"),!0):void 0===n.myStream||null===n.myStream?(a.warn("Invalid local MediaStream"),!0):t?null===n.myStream.getVideoTracks()||void 0===n.myStream.getVideoTracks()||0===n.myStream.getVideoTracks().length?(a.warn("No video track"),!0):!n.myStream.getVideoTracks()[0].enabled:null===n.myStream.getAudioTracks()||void 0===n.myStream.getAudioTracks()||0===n.myStream.getAudioTracks().length?(a.warn("No audio track"),!0):!n.myStream.getAudioTracks()[0].enabled}function B(e,t,r){var n=k[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return a.warn("Invalid handle"),!1;var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?(a.warn("Invalid PeerConnection"),!1):void 0===i.myStream||null===i.myStream?(a.warn("Invalid local MediaStream"),!1):t?null===i.myStream.getVideoTracks()||void 0===i.myStream.getVideoTracks()||0===i.myStream.getVideoTracks().length?(a.warn("No video track"),!1):(i.myStream.getVideoTracks()[0].enabled=!r,!0):null===i.myStream.getAudioTracks()||void 0===i.myStream.getAudioTracks()||0===i.myStream.getAudioTracks().length?(a.warn("No audio track"),!1):(i.myStream.getAudioTracks()[0].enabled=!r,!0)}function W(e){var t=k[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return a.warn("Invalid handle"),"Invalid handle";var r=t.webrtcStuff;return null===r.pc||void 0===r.pc?"Invalid PeerConnection":r.pc.getStats?null===r.bitrate.timer||void 0===r.bitrate.timer?(a.log("Starting bitrate timer (via getStats)"),r.bitrate.timer=setInterval((function(){r.pc.getStats().then((function(e){e.forEach((function(e){if(e){var t=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(r.bitrate.bsnow=e.bytesReceived,r.bitrate.tsnow=e.timestamp,null===r.bitrate.bsbefore||null===r.bitrate.tsbefore)r.bitrate.bsbefore=r.bitrate.bsnow,r.bitrate.tsbefore=r.bitrate.tsnow;else{var n=r.bitrate.tsnow-r.bitrate.tsbefore;"safari"==a.webRTCAdapter.browserDetails.browser&&(n/=1e3);var i=Math.round(8*(r.bitrate.bsnow-r.bitrate.bsbefore)/n);"safari"===a.webRTCAdapter.browserDetails.browser&&(i=parseInt(i/1e3)),r.bitrate.value=i+" kbits/sec",r.bitrate.bsbefore=r.bitrate.bsnow,r.bitrate.tsbefore=r.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):r.bitrate.value:(a.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function q(e){a.error("WebRTC error:",e)}function H(e,t){a.log("Cleaning WebRTC stuff");var i=k[e];if(null!=i){var o=i.webrtcStuff;if(null!=o){if(!0===t){var s={rtcgw:"hangup",transaction:a.randomString(12)};null!==i.token&&void 0!==i.token&&(s.token=i.token),null!=y&&(s.apisecret=y),a.debug("Sending hangup request (handle="+e+"):",s),r?(s.session_id=w,s.handle_id=e,n.send(JSON.stringify(s))):a.httpAPICall(l+"/"+w+"/"+e,{verb:"POST",withCredentials:m,body:s})}o.remoteStream=null,o.volume&&(o.volume.local&&o.volume.local.timer&&clearInterval(o.volume.local.timer),o.volume.remote&&o.volume.remote.timer&&clearInterval(o.volume.remote.timer)),o.volume={},o.bitrate.timer&&clearInterval(o.bitrate.timer),o.bitrate.timer=null,o.bitrate.bsnow=null,o.bitrate.bsbefore=null,o.bitrate.tsnow=null,o.bitrate.tsbefore=null,o.bitrate.value=null;try{if(!o.streamExternal&&null!==o.myStream&&void 0!==o.myStream){a.log("Stopping local stream tracks");var c=o.myStream.getTracks();for(var d in c){var u=c[d];a.log(u),null!=u&&u.stop()}}}catch(e){}o.streamExternal=!1,o.myStream=null;try{o.pc.close()}catch(e){}o.pc=null,o.candidates=null,o.mySdp=null,o.remoteSdp=null,o.iceDone=!1,o.dataChannel={},o.dtmfSender=null}i.oncleanup()}}function K(e){return null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function $(e){return null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function Y(e){return null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function Q(e){return null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}x(e),this.getServer=function(){return l},this.isConnected=function(){return C},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:a.noop,e.error="function"==typeof e.error?e.error:a.noop,e.reconnect=!0,x(e)},this.getSessionId=function(){return w},this.destroy=function(t){!function(t){(t=t||{}).success="function"==typeof t.success?t.success:a.noop;var i=!0;void 0!==t.asyncRequest&&null!==t.asyncRequest&&(i=!0===t.asyncRequest);var c=!0;void 0!==t.notifyDestroyed&&null!==t.notifyDestroyed&&(c=!0===t.notifyDestroyed);var d=!1;if(void 0!==t.cleanupHandles&&null!==t.cleanupHandles&&(d=!0===t.cleanupHandles),a.log("Destroying session "+w+" (async="+i+")"),!C)return a.warn("Is the server down? (connected=false)"),void t.success();if(null==w)return a.warn("No session to destroy"),t.success(),void(c&&e.destroyed());if(d)for(var u in k)N(u,{noRequest:!0});var p={rtcgw:"destroy",transaction:a.randomString(12)};if(null!=g&&(p.token=g),null!=y&&(p.apisecret=y),r){p.session_id=w;var f=function(){for(var e in o)n.removeEventListener(e,o[e]);n.removeEventListener("message",v),n.removeEventListener("error",h),s&&clearTimeout(s),n.close()},v=function(r){var n=JSON.parse(r.data);n.session_id==p.session_id&&n.transaction==p.transaction&&(f(),t.success(),c&&e.destroyed())},h=function(r){f(),t.error("Failed to destroy the server: Is the server down?"),c&&e.destroyed()};return n.addEventListener("message",v),n.addEventListener("error",h),void n.send(JSON.stringify(p))}a.httpAPICall(l+"/"+w,{verb:"POST",async:i,withCredentials:m,body:p,success:function(r){a.log("Destroyed session:"),a.debug(r),w=null,C=!1,"success"!==r.rtcgw&&a.error("Ooops: "+r.error.code+" "+r.error.reason),t.success(),c&&e.destroyed()},error:function(r,n){a.error(r+":",n),w=null,C=!1,t.success(),c&&e.destroyed()}})}(t)},this.attach=function(e){!function(e){if((e=e||{}).success="function"==typeof e.success?e.success:a.noop,e.error="function"==typeof e.error?e.error:a.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:a.noop,e.iceState="function"==typeof e.iceState?e.iceState:a.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:a.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:a.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:a.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:a.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:a.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:a.noop,e.ondata="function"==typeof e.ondata?e.ondata:a.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:a.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:a.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:a.noop,!C)return a.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var t=e.plugin;if(null==t)return a.error("Invalid plugin"),void e.error("Invalid plugin");var i=e.opaqueId,o=e.token?e.token:g,s=a.randomString(12),c={rtcgw:"attach",plugin:t,opaque_id:i,transaction:s};if(null!=o&&(c.token=o),null!=y&&(c.apisecret=y),r)return E[s]=function(r){if("success"!==r.rtcgw)return a.error("Ooops: "+r.error.code+" "+r.error.reason),void e.error("Ooops: "+r.error.code+" "+r.error.reason);var n=r.data.id;a.log("Created handle: "+n);var i={session:R,plugin:t,id:n,token:o,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return t},getVolume:function(){return z(n,!0)},getRemoteVolume:function(){return z(n,!0)},getLocalVolume:function(){return z(n,!1)},isAudioMuted:function(){return J(n,!1)},muteAudio:function(){return B(n,!1,!0)},unmuteAudio:function(){return B(n,!1,!1)},isVideoMuted:function(){return J(n,!0)},muteVideo:function(){return B(n,!0,!0)},unmuteVideo:function(){return B(n,!0,!1)},getBitrate:function(){return W(n)},send:function(e){M(n,e)},data:function(e){j(n,e)},dtmf:function(e){L(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){U(n,!0,e)},createAnswer:function(e){U(n,!1,e)},handleRemoteJsep:function(e){F(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){H(n,!0===e)},detach:function(e){N(n,e)}};k[n]=i,e.success(i)},c.session_id=w,void n.send(JSON.stringify(c));a.httpAPICall(l+"/"+w,{verb:"POST",withCredentials:m,body:c,success:function(r){if(a.debug(r),"success"!==r.rtcgw)return a.error("Ooops: "+r.error.code+" "+r.error.reason),void e.error("Ooops: "+r.error.code+" "+r.error.reason);var n=r.data.id;a.log("Created handle: "+n);var i={session:R,plugin:t,id:n,token:o,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return t},getVolume:function(){return z(n,!0)},getRemoteVolume:function(){return z(n,!0)},getLocalVolume:function(){return z(n,!1)},isAudioMuted:function(){return J(n,!1)},muteAudio:function(){return B(n,!1,!0)},unmuteAudio:function(){return B(n,!1,!1)},isVideoMuted:function(){return J(n,!0)},muteVideo:function(){return B(n,!0,!0)},unmuteVideo:function(){return B(n,!0,!1)},getBitrate:function(){return W(n)},send:function(e){M(n,e)},data:function(e){j(n,e)},dtmf:function(e){L(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){U(n,!0,e)},createAnswer:function(e){U(n,!1,e)},handleRemoteJsep:function(e){F(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){H(n,!0===e)},detach:function(e){N(n,e)}};k[n]=i,e.success(i)},error:function(e,t){a.error(e+":",t)}})}(e)}}a.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,r=e&&e.Promise||Promise,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},extension:e&&e.extension||o,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||window.adapter,httpAPICall:function(e,n){var i={method:n.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===n.verb&&(i.headers["Content-Type"]="application/json"),void 0!==n.withCredentials&&(i.credentials=!0===n.withCredentials?"include":n.withCredentials?n.withCredentials:"omit"),void 0!==n.body&&(i.body=JSON.stringify(n.body));var o=t(e,i).catch((function(e){return r.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==n.timeout){var s=new r((function(e,t){var r=setTimeout((function(){return clearTimeout(r),t({message:"Request timed out",timeout:n.timeout})}),n.timeout)}));o=r.race([o,s])}return o.then((function(e){return e.ok?typeof n.success==typeof a.noop?e.json().then((function(e){n.success(e)})).catch((function(t){return r.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:r.reject({message:"API call failed",response:e})})).catch((function(e){typeof n.error==typeof a.noop&&n.error(e.message||"<< internal error >>",e)})),o}}},a.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,r=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new r(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||o,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,r){var n=void 0!==r.body?{contentType:"application/json",data:JSON.stringify(r.body)}:{},i=void 0!==r.withCredentials?{xhrFields:{withCredentials:r.withCredentials}}:{};return t.ajax(t.extend(n,i,{url:e,type:r.verb,cache:!1,dataType:"json",async:r.async,timeout:r.timeout,success:function(e){typeof r.success==typeof a.noop&&r.success(e)},error:function(e,t,n){typeof r.error==typeof a.noop&&r.error(t,n)}}))}}},a.noop=function(){},a.dataChanDefaultLabel="JanusDataChannel",a.endOfCandidates=null,a.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:a.noop,!0===a.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),a.trace=a.noop,a.debug=a.noop,a.vdebug=a.noop,a.log=a.noop,a.warn=a.noop,a.error=a.noop,!0===e.debug||"all"===e.debug)a.trace=console.trace.bind(console)||a.noop,a.debug=console.debug.bind(console)||a.noop,a.vdebug=console.debug.bind(console)||a.noop,a.log=console.log.bind(console)||a.noop,a.warn=console.warn.bind(console)||a.noop,a.error=console.error.bind(console)||a.noop;else if(Array.isArray(e.debug))for(var t in e.debug)switch(e.debug[t]){case"trace":a.trace=console.trace.bind(console)||a.noop;break;case"debug":a.debug=console.debug.bind(console)||a.noop;break;case"vdebug":a.vdebug=console.debug.bind(console)||a.noop;break;case"log":a.log=console.log.bind(console)||a.noop;break;case"warn":a.warn=console.warn.bind(console)||a.noop;break;case"error":a.error=console.error.bind(console)||a.noop}var r=e.dependencies||a.useDefaultDependencies();a.isArray=r.isArray,a.webRTCAdapter=r.webRTCAdapter,a.httpAPICall=r.httpAPICall,a.newWebSocket=r.newWebSocket,a.extension=r.extension,a.extension.init(),a.listDevices=function(e,t){e="function"==typeof e?e:a.noop,null==t&&(t={audio:!0,video:!0}),a.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(r){a.debug(r),e(r);try{var n=t.getTracks();for(var i in n){var o=n[i];null!=o&&o.stop()}}catch(e){}}))})).catch((function(t){a.error(t),e([])})):(a.warn("navigator.mediaDevices unavailable"),e([]))},a.attachMediaStream=function(e,t){try{"chrome"===a.webRTCAdapter.browserDetails.browser?a.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:a.error("Error attaching stream to element"):e.srcObject=t}catch(e){}},a.reattachMediaStream=function(e,t){try{"chrome"===a.webRTCAdapter.browserDetails.browser?a.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:a.error("Error reattaching stream to element"):e.srcObject=t.srcObject}catch(e){}};var n=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",i=window["on"+n];if(window.addEventListener(n,(function(e){for(var t in a.log("Closing window"),a.sessions)null!==a.sessions[t]&&void 0!==a.sessions[t]&&a.sessions[t].destroyOnUnload&&(a.log("Destroying session "+t),a.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));i&&"function"==typeof i&&i()})),a.safariVp8=!1,"safari"===a.webRTCAdapter.browserDetails.browser&&a.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var o=RTCRtpSender.getCapabilities("video").codecs[t];if(o&&o.mimeType&&"video/vp8"===o.mimeType.toLowerCase()){a.safariVp8=!0;break}}a.safariVp8?a.log("This version of Safari supports VP8"):a.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var s=new RTCPeerConnection({},{});s.createOffer({offerToReceiveVideo:!0}).then((function(e){a.safariVp8=-1!==e.sdp.indexOf("VP8"),a.safariVp8?a.log("This version of Safari supports VP8"):a.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),s.close(),s=null}))}if(a.unifiedPlan=!1,"firefox"===a.webRTCAdapter.browserDetails.browser&&a.webRTCAdapter.browserDetails.version>=59)a.unifiedPlan=!0;else if("chrome"===a.webRTCAdapter.browserDetails.browser&&a.webRTCAdapter.browserDetails.version<72)a.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){const e=new RTCPeerConnection;try{e.addTransceiver("audio"),a.unifiedPlan=!0}catch(e){}e.close()}else a.unifiedPlan=!1;a.initDone=!0,e.callback()}},a.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},a.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},a.randomString=function(e){for(var r="",n=0;n<e;n++){var i=Math.floor(62*Math.random());r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".substring(i,i+1)}return r};const s={eventEmitter:null,language:"zh"};class c{constructor(t){this.startTalk=(e,t)=>{const r=this;if("function"==typeof t&&!t())return void r.eventEmitter.emit("handleTalkError",{code:-1,msg:"startTalk terminate"});const{customizeStream:n,audio:i}=e;a.isWebrtcSupported()&&(this.janus=new a({server:e.rtcUrl,success:function(){r.janus&&r.janus.attach({plugin:"rtcgw.plugin.tts",opaqueId:r.opaqueId,success:function(t){r.tts=window.tts=t;let o={request:"start",url:e.talkLink,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===e.talkType&&(o.devProto="gb28181"),r.tts.createOffer({media:{audio:i||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:n,success:function(e){r.tts.send({message:o,jsep:e})},error:function(e){var t;r.eventEmitter.emit("handleTalkError",e),(null==(t=r.tts)?void 0:t.detach)&&r.tts.detach()}})},error:function(e){r.eventEmitter.emit("handleTalkError",e)},consentDialog:function(e){},iceState:function(e){},mediaState:function(e,t){},webrtcState:function(e){},slowLink:function(e,t){},onmessage:function(e,t){null!=t&&r.tts.handleRemoteJsep({jsep:t});let n=e.result;if(null!=n){if("done"===n)return null!==r.spinner&&void 0!==r.spinner&&r.spinner.stop(),void(r.spinner=null);"msg"===n&&r.eventEmitter.emit("handleTalkMessage",e),n.status}e.rtcgw&&"ttsup"===e.rtcgw&&r.eventEmitter.emit("handleTalkSuccess",e),e.code&&0!==e.code&&r.eventEmitter.emit("handleTalkError",{code:e.code,msg:r.i18n.t(e.code)})},onlocalstream:function(e){const t=document.getElementById("myaudio");t&&a.attachMediaStream(t,e),"completed"!==r.tts.webrtcStuff.pc.iceConnectionState&&"connected"!==r.tts.webrtcStuff.pc.iceConnectionState&&(null==r.spinner?document.getElementById("audioright"):r.spinner.spin()),e.getAudioTracks()},onremotestream:function(e){const t=document.getElementById("peeraudio");t&&a.attachMediaStream(t,e);let r=e.getAudioTracks();if(null==r||0===r.length);else{const e=document.getElementById("peeraudio");e&&e.play()}},ondataopen:function(e){},ondata:function(e){},oncleanup:function(){null!==r.spinner&&void 0!==r.spinner&&r.spinner.stop(),r.spinner=null}})},error:function(e){r.eventEmitter.emit("handleTalkError",e)}},{stream:e.stream,deviceSerial:e.deviceSerial,channel:e.channelNo}))},this.stopTalk=e=>{if("function"!=typeof e||e())if(this.tts&&(this.tts.detach(),this.tts=null),this.janus){try{this.janus.destroy({success:()=>{this.eventEmitter.emit("handleStopTalkSuccess",this.janus)},error:e=>{this.eventEmitter.emit("handleStopTalkError",e)}})}catch(e){this.eventEmitter.emit("handleStopTalkError",e)}this.janus=void 0,this.tts=null}else this.eventEmitter.emit("handleStopTalkError",{code:-1,msg:"stopTalk terminate"});else this.eventEmitter.emit("handleStopTalkError",{code:-1,msg:"stopTalk terminate"})},this.destroy=()=>{},this.tts=null,this.opaqueId="tts-"+a.randomString(12),this.spinner=null,this.options=Object.assign({},s,t||{}),this.eventEmitter=t.eventEmitter,this.i18n=new require$$1({zh:r,en:n}),this.i18n.switchTranslation(this.options.language||"zh"),a.init({debug:"all"})}}function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}const u="stopTalk",p$1="talkVolumeChange",f={deviceSerial:"",channelNo:"1",accessToken:"",env:{domain:"https://open.ys7.com"},capacity:{support_talk:null,support_switch_talkmode:null}};class v{updateOptions(e){this.options=Object.assign(this.options,e||{})}constructor(e){this.destroy=()=>{this.stopTalk(),document.body.removeChild(this.audioLeft),document.body.removeChild(this.audioRight)},this.startTalk=e=>{this.eventEmitter.emit("beforeTalk",{});const t=this;new Promise(((e,t)=>{var r,n,i,o;(null==(r=this.options.capacity)?void 0:r.support_switch_talkmode)&&"1"==this.options.capacity.support_switch_talkmode?fetch(this.options.env.domain+"/api/service/device/talkMode"+`?deviceSerial=${this.options.deviceSerial}`,{method:"GET",headers:{accessToken:(null==(i=this.options.token)||null==(n=i.deviceToken)?void 0:n.global)||(null==(o=this.options)?void 0:o.accessToken)}}).then((e=>e.json())).then((t=>{var r,n,i;t.meta&&200==t.meta.code?(null==(r=t.data)?void 0:r.valueInfo)&&0==t.data.valueInfo.mode?fetch(this.options.env.domain+"/api/v3/device/talkMode"+`?deviceSerial=${this.options.deviceSerial}&channelNo=${this.options.channelNo}&mode=1`,{method:"PUT",headers:{accessToken:(null==(i=this.options.token)||null==(n=i.deviceToken)?void 0:n.video)||this.options.accessToken}}).then((e=>e.json())).then((t=>{t.meta&&200==t.meta.code?e({}):e({code:-1,msg:"对讲模式切换失败",res:t})})).catch((t=>{e({code:-1,msg:"对讲模式切换失败",res:t})})):e({}):e({code:-1,msg:"获取当前对讲模式失败",res:t})})).catch((t=>{e({code:-1,msg:"获取当前对讲模式失败",res:t})})):e({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((r=>{var n,i,o;if((null==(n=this.options.capacity)?void 0:n.support_talk)&&(!this.options.capacity||"3"!==this.options.capacity.support_talk&&"1"!==this.options.capacity.support_talk))return!1;const a=new FormData;a.append("accessToken",(null==(o=this.options.token)||null==(i=o.deviceToken)?void 0:i.video)||this.options.accessToken),a.append("deviceSerial",this.options.deviceSerial),a.append("channelNo",this.options.channelNo),fetch(this.options.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:a}).then((e=>e.json())).then((r=>{if(200==r.code){const o=r.data;if(o){var n,i;let r=o.rtcUrl;-1===r.indexOf("ws")&&(r=r.replace("https","wss").replace("rtcgw","rtcgw-ws")),this.talkOptions.rtcUrl=r,this.talkOptions.ttsUrl="tts://"+o.ttsUrl,this.talkOptions.deviceSerial=this.options.deviceSerial,this.talkOptions.channelNo=this.options.channelNo,this.talkOptions.talkLink=this.talkOptions.ttsUrl.split("?")[0]+"/talk?dev="+this.talkOptions.deviceSerial+"&chann="+this.talkOptions.channelNo+"&encodetype=2",o.ttsUrl.indexOf("gb28181")>-1&&(this.talkOptions.talkType="gb28181"),e&&e(o.ttsUrl.indexOf("gb28181")>-1||-1!==this.talkOptions.deviceSerial.indexOf(":")),this.talkOptions.stream=o.stream?o.stream:(null==(i=this.options.token)||null==(n=i.streamToken)?void 0:n.talk)||this.options.accessToken,this.ttsTalk.startTalk(d({},this.talkOptions,{customizeStream:t._customizeStream.bind(t),audio:!this.microphoneId||{deviceId:this.microphoneId}})),this.isTalking=!0,this.observeVolumeChange({interval:100}),this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:this,msg:"开启对讲"})}}else this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:this,msg:r.msg});this.ttsTalk.eventEmitter.on("handleTalkSuccess",(e=>{this.isTalking=!0,this.observeVolumeChange({interval:100}),this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:this,msg:"开启对讲"})})),this.ttsTalk.eventEmitter.on("handleTalkError",(e=>{this.eventEmitter&&this.eventEmitter.emit("startTalk",{eventType:"startTalk",code:e.code,target:this,msg:e.msg})}))}))})).catch((e=>{}))},this.stopTalk=()=>{var e;try{this.ttsTalk.stopTalk(),this.isTalking=!1}catch(e){var t;null==(t=this.eventEmitter)||t.emit(u,{eventType:u,code:-1,msg:"结束对讲"})}this.gainNode=null,this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null),this.eventEmitter&&setTimeout((()=>{var e;null==(e=this.eventEmitter)||e.emit(p$1,{eventType:p$1,code:0,target:this,data:0,msg:"音量变化"})}),200);const r=document.getElementById("myaudio").srcObject;r&&r.getTracks()[0].stop(),null==(e=this.eventEmitter)||e.emit(u,{eventType:u,code:0,target:this,msg:"结束对讲"})},this.changeTalkChannelNo=e=>{this.talkOptions.channelNo=e},this._customizeStream=e=>new Promise(((t,r)=>{const n=new window.AudioContext;this.gainNode=n.createGain();const i=n.createMediaStreamSource(e);var o;this.gainNode.gain.value=null!=(o=this.volumeGain)?o:1;const a=n.createMediaStreamDestination();i.connect(this.gainNode),this.gainNode.connect(a),t(a.stream)})),this.setVolumeGain=e=>{const t=e;return"number"==typeof t&&t>=0?(this.volumeGain=Math.min(t,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}},this.observeVolumeChange=e=>{const{interval:t}=e;this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null),this.volumeChangeInterval=setInterval((()=>{var e,t,r,n,i;null==(i=window.tts)||null==(n=i.webrtcStuff)||null==(r=n.pc)||null==(t=r.getStats)||null==(e=t.call(r))||e.then((e=>{e.forEach((e=>{var t;"media-source"===e.type&&(null==(t=this.eventEmitter)||t.emit("talkVolumeChange",{eventType:"talkVolumeChange",code:0,target:this,data:e.audioLevel,msg:"音量变化"}))}))}))}),t)},this.getMicrophonePermission=()=>new Promise(((e,t)=>{navigator.mediaDevices.getUserMedia({audio:!0}).then((t=>{t.getTracks().forEach((e=>{e.stop()})),e({code:0,msg:"成功",res:null})})).catch((t=>{e({code:-1,msg:"获取麦克风权限失败",res:t})}))})),this.getMicrophonesList=()=>new Promise(((e,t)=>{navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((t=>{const r=[];t.forEach((e=>{"audioinput"==e.kind&&r.push(e)})),e({code:0,msg:"成功",res:r})})):e({code:-1,msg:"未查询到相关设备",res:null})})),this.setProfile=e=>{const{microphoneId:t}=e;t!==this.microphoneId&&(this.microphoneId=t,this.isTalking&&(this.stopTalk(),setTimeout((()=>{this.ttsTalk.startTalk(d({},this.talkOptions,{customizeStream:this._customizeStream.bind(this),audio:!this.microphoneId||{deviceId:this.microphoneId}})),this.isTalking=!0}),300)))},this.options=Object.assign({},f,e||{}),this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null,this.eventEmitter=new t,this.ttsTalk=new c({eventEmitter:this.eventEmitter}),this.isTalking=!1;const r=document.createElement("div");r.id="audioleft";const n=document.createElement("audio");n.id="myaudio",n.muted=!0,n.setAttribute("autoplay","true"),n.setAttribute("controls","true"),r.appendChild(n),r.style.display="none";const i=document.createElement("div");i.id="audioright",i.style.display="none";const o=document.createElement("audio");o.id="peeraudio",o.setAttribute("autoplay","true"),o.setAttribute("controls","true"),i.appendChild(o),this.talkOptions={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:this.options.deviceSerial,channelNo:this.options.channelNo},this.audioLeft=r,this.audioRight=i,document.body.appendChild(r),document.body.appendChild(i)}}v.VERSION="0.0.2";const isVersion2Available=()=>{var ua=window.navigator.userAgent.toLowerCase(),info_ch=(/version.*safari/.test(ua),/chrome/.test(ua));/gecko/.test(ua)&&/webkit/.test(ua);if(isMobile())return!1;if(info_ch){function getChromeVersion(){for(var arr=window.navigator.userAgent.split(" "),chromeVersion="",i=0;i<arr.length;i++)/chrome/i.test(arr[i])&&(chromeVersion=arr[i]);return!!chromeVersion&&Number(chromeVersion.split("/")[1].split(".")[0])}return getChromeVersion()>91&&!!window.SharedArrayBuffer}return!1},errorCodeTransform=err=>{if(err&&err.retcode)return String(err.retcode);if(err&&err.code){return`1${String(err.code).padStart(5,"0")}`}if(err&&err.errorCode){return`39${String(err.errorCode).padStart(4,"0")}`}return"400001"};function getExplore(){var s,Sys={},ua=navigator.userAgent.toLowerCase();if((s=ua.match(/rv:([\d.]+)\) like gecko/))||(s=ua.match(/msie ([\d\.]+)/))?Sys.ie=s[1]:(s=ua.match(/edge\/([\d\.]+)/))?Sys.edge=s[1]:(s=ua.match(/firefox\/([\d\.]+)/))?Sys.firefox=s[1]:(s=ua.match(/(?:opera|opr).([\d\.]+)/))?Sys.opera=s[1]:(s=ua.match(/chrome\/([\d\.]+)/))?Sys.chrome=s[1]:(s=ua.match(/version\/([\d\.]+).*safari/))&&(Sys.safari=s[1]),Sys.chrome){let chromeStr=Sys.chrome,startIndex=chromeStr.indexOf(".");return Number(chromeStr.substring(0,startIndex))}return-1}function isSupHardDecAVC(callback){return getExplore()>=94}function isSupHardDecHEVC(callback){if(getExplore()>=107){let config={codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"};window.VideoDecoder&&VideoDecoder.isConfigSupported(config).then((configInfo=>{configInfo.supported}))}}const DOMAIN="https://open.ys7.com",DEFAULT_OPTIONS={loggerOptions:{level:"INFO",showTime:!0,name:"ezuikit"},autoplay:!0,env:{domain:DOMAIN},host:DOMAIN.replace("https://",""),streamInfoCBType:1,videoLevelList:null},SPEED_LIST=[16,8,4,2,1,.5],VIDEO_LEVEL=[{videoLevel:1,streamTypeIn:1,type:"compatible"},{videoLevel:2,streamTypeIn:1,type:"compatible"}],VIDEO_LEVEL_NAME={auto:"VIDEO_LEVEL_AUTO",0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_STANDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SUPER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},EVENTS={init:"init",decoderLoad:"decoderLoad",decoderLoaded:"decoderLoaded",firstFrameDisplay:"firstFrameDisplay",streamInfoCB:"streamInfoCB",videoInfo:"videoInfo",audioInfo:"audioInfo",play:"play",stop:"stop",changeVideoLevel:"changeVideoLevel",reSetTheme:"reSetTheme",changePlayUrl:"changePlayUrl",getOSDTime:"getOSDTime",capturePicture:"capturePicture",startSave:"startSave",stopSave:"stopSave",openSound:"openSound",closeSound:"closeSound",enable3DZoom:"enable3DZoom",close3DZoom:"close3DZoom",changeZoomType:"changeZoomType",setPoster:"setPoster",resize:"resize",fast:"fast",slow:"slow",speedChange:"speedChange",seek:"seek",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen",fullscreenChange:"fullscreenChange",destroy:"destroy",getDeviceCapacity:"getDeviceCapacity",pause:"pause",resume:"resume",getVideoLevelList:"getVideoLevelList",setVideoLevelList:"setVideoLevelList",currentVideoLevel:"currentVideoLevel",autoVideoLevel:"autoVideoLevel",getVideoLevel:"getVideoLevel",getPtzStatus:"getPtzStatus",getPlayRate:"getPlayRate",setMirrorFlip:"setMirrorFlip",setFECCorrectType:"setFECCorrectType",setFEC3DViewParam:"setFEC3DViewParam",getFEC3DViewParam:"getFEC3DViewParam",setWaterMarkFont:"setWaterMarkFont",talkVolumeChange:"talkVolumeChange",startTalk:"startTalk",stopTalk:"stopTalk",talkSuccess:"talkSuccess",talkError:"talkError",recTypeChange:"recTypeChange",recTimeChange:"recTimeChange",setLoggerOptions:"setLoggerOptions",setDisplayRegion:"setDisplayRegion",setAllDayRecTimes:"setAllDayRecTimes",setRecTimes:"setRecTimes",changeTheme:"changeTheme",date:{openDatePanel:"openDatePanel",closeDatePanel:"closeDatePanel",recStartTimeChange:"recStartTimeChange"},ptz:{openPtz:"openPtz",closePtz:"closePtz",ptzDirection:"ptzDirection",ptzSpeedChange:"ptzSpeedChange",ptzBtnClick:"ptzBtnClick"},zoom:{startZoom:"startZoom",closeZoom:"closeZoom",onZoomChange:"onZoomChange",openZoom:"openZoom",closeZoom:"closeZoom"},timeLine:{timeWidthChange:"timeWidthChange"},http:{getCloudRecordTimes:"getCloudRecordTimes",getLocalRecTimes:"getLocalRecTimes",getCloudRecTimes:"getCloudRecTimes",getDeviceInfo:"getDeviceInfo",getDeviceList:"getDeviceList",setVideoLevel:"setVideoLevel",getDeviceSupportQuality:"getDeviceSupportQuality",getStreamAddressList:"getStreamAddressList"}};class DateTime{static formate(date,formatType,timeZone=0){let dateTime=date;"string"==typeof date?dateTime=DateTime.strToDate(date):"number"==typeof date&&(dateTime=new Date(date)),dateTime=new Date(dateTime.getTime()-3600*timeZone*1e3);const year=dateTime.getFullYear(),month=String(dateTime.getMonth()+1).padStart(2,"0"),day=String(dateTime.getDate()).padStart(2,"0"),hours=String(dateTime.getHours()).padStart(2,"0"),minutes=String(dateTime.getMinutes()).padStart(2,"0"),seconds=String(dateTime.getSeconds()).padStart(2,"0");switch(formatType){case"YYYY-MM-DD hh:mm:ss":return`${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;case"YYYYMMDDhhmmss":return`${year}${month}${day}${hours}${minutes}${seconds}`;case"YYYY/MM/DD hh:mm:ss":return`${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;case"YYYYMMDDThhmmssZ":return`${year}${month}${day}T${hours}${minutes}${seconds}Z`;case"YYYY/MM/DD":return`${year}/${month}/${day}`;case"YYYYMMDD":return`${year}${month}${day}`;case"YYYY-MM-DD":return`${year}-${month}-${day}`;case"YYYY":return`${year}`;case"MM":return`${month}`;case"DD":return`${day}`;case"hh:mm:ss":return`${hours}:${minutes}:${seconds}`;case"hh":return`${hours}`;case"mm":return`${minutes}`;case"ss":return`${seconds}`;default:throw new Error("Unsupported format type")}}static diff(date1,date2,diffType){let dateTime1=date1;"string"==typeof date1?dateTime1=DateTime.strToDate(date1):"number"==typeof date1&&(dateTime1=new Date(date1));let dateTime2=date2;"string"==typeof date2?dateTime1=DateTime.strToDate(date2):"number"==typeof date2&&(dateTime1=new Date(date2));const diffSecond=dateTime1.getTime()-dateTime2.getTime();switch(diffType){case"year":return dateTime1.getFullYear()-dateTime2.getFullYear();case"month":let months=12*(dateTime1.getFullYear()-dateTime2.getFullYear())+(dateTime1.getMonth()-dateTime2.getMonth());return dateTime1.getDate()<dateTime2.getDate()&&months--,months;case"day":return diffSecond/60/60/24;case"hour":return diffSecond/60/60;case"minute":return diffSecond/60;case"second":return diffSecond;default:throw new Error("Unsupported diff type")}}static now(){return Date.now()}static strToDate(str){const time=(str+"").replace(/-/gi,"").replace(/:/gi,"").replace(/\//gi,"").replace(/ /gi,"").replace(/T|Z/gi,"");if(10===(str+"").length)return new Date(1e3*+str);if(13===(str+"").length)return new Date(+str);var year=time.slice(0,4),month=time.slice(4,6),day=time.slice(6,8),hour=time.slice(8,10),minute=time.slice(10,12),second=time.slice(12,14);return new Date(year+"/"+month+"/"+day+" "+hour+":"+minute+":"+second)}static padStart(num){return num<10?"0"+num:num+""}}function _extends$d(){return _extends$d=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$d.apply(this,arguments)}function mergeTimes(list,timeZone=0){return(list||[]).map((item=>_extends$d({},item,{startTime:item.startTime-3600*(timeZone||0),endTime:item.endTime-3600*(timeZone||0)}))).sort(((a,b)=>a.startTime-b.startTime))}function asyncGeneratorStep$6(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$6(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$6(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$6(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _extends$c(){return _extends$c=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$c.apply(this,arguments)}const API_getAppKey="/api/service/appKey/get",API_getDeviceInfo="/api/lapp/device/info",API_getStreamAddressList="/api/service/media/stream/server/info?version=2.0&protocol=4",API_getDeviceCapacity="/api/lapp/device/capacity",API_setVideoLevel="/api/v3/device/setVideoLevel",API_ezopen="/api/lapp/live/url/ezopen",API_getCloudRecordTimes="/api/service/cloudrecord/video/info/list",API_getCloudTimes="/api/lapp/video/by/time",API_getLocalRecTimes="/api/v3/device/local/video/unify/query",API_ptzMirror="/api/lapp/device/ptz/mirror",API_getDeviceSupportQuality="/api/service/device/capacity/video/quality";class Services{updateOptions(options){this._options=deepmerge(this._options,options,{clone:!1}),this._options.baseURL||(this._options.baseURL=DOMAIN),this._options.baseURL=this._options.baseURL.replace(/\/$/,"")}_fetch(url,options={}){var _this=this;return _async_to_generator$6((function*(){const fetchUrl=/http[s]?:\/\//.test(url)?url:`${_this._options.baseURL}${url}`,controller=new AbortController,signal=controller.signal;_this.controllers.push(controller);const headers=null===(null==options?void 0:options.headers)?{}:_extends$c({clientType:"ezuikit"},_this._options.accessToken?{accessToken:_this._options.accessToken}:{},{deviceSerial:_this._options.deviceSerial,localIndex:_this._options.channelNo},(null==options?void 0:options.headers)||{}),fetchOptions=_extends$c({},options||{},{headers:_extends$c({},headers),signal:signal});return"base"!==_this._options.sdkType&&(delete fetchOptions.headers,delete fetchOptions.signal),fetch(fetchUrl,fetchOptions).finally((()=>{const index=_this.controllers.findIndex((item=>item===controller));index>-1&&_this.controllers.splice(index,1)}))}))()}get(url,options={}){return this._fetch(url,_extends$c({},options||{},{method:"get"}))}post(url,options={}){return this._fetch(url,_extends$c({},options||{},{method:"post"}))}put(url,options={}){return this._fetch(url,_extends$c({},options||{},{method:"put"}))}delete(url,options={}){return this._fetch(url,_extends$c({},options||{},{method:"delete"}))}getAppKey(){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;return"custom"===_this._options.sdkType?new Promise((resolve=>{resolve({meta:{code:200,message:"操作成功",moreInfo:{}},data:{appKey:"ezuikit-custom"}})})):_this.get(`${API_getAppKey}?checkToken=${_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)}&sn=${_this._options.deviceSerial}&cno=${_this._options.channelNo}`,{headers:null}).then((response=>response.json())).catch((()=>""))}))()}getDeviceInfo(){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;const formData=new FormData;return formData.append("accessToken",_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.global)||""),formData.append("deviceSerial",_this._options.deviceSerial),_this.post(API_getDeviceInfo,{body:formData,headers:null}).then((response=>response.json())).then((res=>200==+res.code?res.data:{}))}))()}getDeviceCapacity(){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;let formData=new FormData;return formData.append("accessToken",_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)||""),formData.append("deviceSerial",_this._options.deviceSerial),_this.post(API_getDeviceCapacity,{body:formData,headers:null}).then((response=>response.json())).then((res=>200==+res.code?res.data:{})).catch((()=>({})))}))()}getStreamAddressList(){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;return"custom"===_this._options.sdkType?new Promise((resolve=>{resolve([0,{domain:"",port:0,backups:[]}])})):_this.get(API_getStreamAddressList,{headers:{accessToken:_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)}}).then((response=>response.json())).then((res=>{if(res.meta&&200==res.meta.code){var _addressList_;let addressList={};try{addressList=JSON.parse(localStorage.getItem("ezuikit_addressList")||"{}")}catch(error){}let updatereloadAddress=object=>{const listKey=_this._options.deviceSerial+"_"+_this._options.channelNo,date=new Date;addressList[listKey]=[{domain:object.domain?object.domain:object.addr?object.addr:"",port:object.port,expire:new Date(date.setHours(date.getHours()+12)).Format("yyyyMMddThhmmssZ")}],Array.isArray(object.backups)&&object.backups.map((item=>{addressList[listKey].push({domain:item.domain?item.domain:item.addr?item.addr:"",port:item.port,expire:new Date(date.setHours(date.getHours()+12)).Format("yyyyMMddThhmmssZ")})}));try{window.localStorage.setItem("ezuikit_addressList",JSON.stringify(addressList))}catch(error){}},arraysAreEqual=(arr1,arr2)=>{if(arr1.length!==arr2.length)return!1;let sortedArr1=[...arr1].sort(((a,b)=>a.domain>b.domain?1:-1)),sortedArr2=[...arr2].sort(((a,b)=>a.domain>b.domain?1:-1));for(let i=0;i<sortedArr1.length;i++)if(sortedArr1[i].domain!==sortedArr2[i].domain)return!1;return!0};if(res.data&&Array.isArray(addressList[_this._options.deviceSerial+"_"+_this._options.channelNo])){let tmrResArr=Array.isArray(res.data.backups)?[...res.data.backups]:[];var _addressList__;if(tmrResArr.push({domain:res.data.domain,port:res.data.port}),arraysAreEqual(addressList[_this._options.deviceSerial+"_"+_this._options.channelNo],tmrResArr))(null==(_addressList__=addressList[_this._options.deviceSerial+"_"+_this._options.channelNo][0])?void 0:_addressList__.expire)<=(new Date).Format("yyyyMMddThhmmssZ")&&updatereloadAddress(res.data);else updatereloadAddress(res.data)}return updatereloadAddress=null,arraysAreEqual=null,[(null==(_addressList_=addressList[_this._options.deviceSerial+"_"+_this._options.channelNo])?void 0:_addressList_.length)||0,res.data]}return[0,{}]}))}))()}getDeviceSupportQuality(params={}){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;const token=params.accessToken||_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video),channelNo=params.channelNo||_this._options.channelNo;let result=[];return _this.get(API_getDeviceSupportQuality+`?accessToken=${token}&deviceSerial=${_this._options.deviceSerial}&channelNo=${channelNo}`,{headers:null}).then((response=>response.json())).then((res=>((res.meta&&200===res.meta.code&&res.data&&res.data.length>0?res.data:VIDEO_LEVEL).map((item=>{item.videoLevel>6||item.videoLevel<0||result.push({name:VIDEO_LEVEL_NAME[item.videoLevel],level:item.videoLevel,streamTypeIn:item.streamTypeIn,type:item.type})})),result.sort(((a,b)=>a.level>b.level?1:-1))))).catch((()=>(VIDEO_LEVEL.map((item=>{result.push({name:VIDEO_LEVEL_NAME[item.videoLevel],level:item.videoLevel,streamTypeIn:item.streamTypeIn,type:"compatible"})})),result)))}))()}getDeviceList(params={}){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;const token=params.accessToken||_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video),deviceSerial=params.deviceSerial||_this._options.deviceSerial;return _this.post(`/api/lapp/device/camera/list?accessToken=${token}&deviceSerial=${deviceSerial}`).then((response=>response.json())).then((res=>200==+(null==res?void 0:res.code)?res.data:[])).catch((()=>[]))}))()}setVideoLevel(videoLevel){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token,_this__options_token_deviceToken1,_this__options_token1;const data=new FormData;return data.append("videoLevel",videoLevel+""),"custom"===_this._options.sdkType&&(data.append("accessToken",_this._options.accessToken),data.append("deviceSerial",_this._options.deviceSerial),data.append("localIndex",_this._options.channelNo+"")),+videoLevel<0?{}:_this.post(`${API_setVideoLevel}?accessToken=${_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)}`,{headers:{accessToken:_this._options.accessToken||(null==(_this__options_token1=_this._options.token)||null==(_this__options_token_deviceToken1=_this__options_token1.deviceToken)?void 0:_this__options_token_deviceToken1.video)},body:data}).then((response=>response.json())).then((res=>res))}))()}getEzopenUrl(url){var _this=this;return _async_to_generator$6((function*(){var _window_navigator,_window,_this__options,_this__options_token_deviceToken,_this__options_token;let formData=new FormData;if(formData.append("isFlv","false"),formData.append("userAgent",(null==(_window=window)||null==(_window_navigator=_window.navigator)?void 0:_window_navigator.userAgent)||""),formData.append("isHttp","false"),formData.append("needStreamToken",(null==(_this__options=_this._options)?void 0:_this__options.accessToken)?"1":"0"),formData.append("accessToken",_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)||""),formData.append("ezopen",url),_this._options.ezopenParams&&"[object Object]"===Object.prototype.toString.call(_this._options.ezopenParams))for(var key in _this._options.ezopenParams)formData.append(key,_this._options.ezopenParams[key]);return _this.post(API_ezopen,{body:formData,headers:{sdkVersion:"8.2.2"}}).then((response=>response.json())).then((res=>{if(200==+(null==res?void 0:res.code)||0==res.retcode){var _this__options_token_streamToken,_this__options_token,_this__options;let realUrl="",token="";const streamToken=null==(_this__options=_this._options)||null==(_this__options_token=_this__options.token)||null==(_this__options_token_streamToken=_this__options_token.streamToken)?void 0:_this__options_token_streamToken[res.data.indexOf("live")>-1||res.data.indexOf("cloud")>-1?"live":"rec"];if(res.ext&&res.ext.token)realUrl+=res.data,token=_this._options.accessToken?res.ext.token:streamToken;else if(res.data){var _res_data;if("string"==typeof res.data&&streamToken)realUrl+=res.data,token=streamToken;else realUrl+=(null==(_res_data=res.data)?void 0:_res_data.url)||"",token=_this._options.accessToken?res.data.token:streamToken}if(realUrl="live"===(-1!==url.indexOf("live")?"live":"playback")?realUrl+"&ssn="+(token||"")+"&auth=1&biz=4&cln=100":realUrl+"&ssn="+(token||"")+"&auth=1&cln=100",_this._options.wsParams&&"[object Object]"===Object.prototype.toString.call(_this._options.wsParams))for(const key in _this._options.wsParams)realUrl+="&"+key+"="+_this._options.wsParams[key]||"";return realUrl.replace(/&&/gi,"&")}return res})).catch((()=>""))}))()}getCloudRecordTimes(body){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;const query={startTime:body.begin?DateTime.formate(body.begin,"YYYY-MM-DD hh:mm:ss"):void 0,endTime:body.end?DateTime.formate(body.end,"YYYY-MM-DD hh:mm:ss"):void 0,spaceId:body.spaceId||void 0},queryStr=Object.keys(query).reduce(((acc,key)=>null==query[key]?acc:acc+=`&${key}=${encodeURIComponent(query[key])}`),"").replace("&","");return _this.get(API_getCloudRecordTimes+`?${queryStr}`,{headers:{accessToken:(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.global)||_this._options.accessToken}}).then((response=>response.json())).then((res=>{var _res_meta;if(200==+(null==res||null==(_res_meta=res.meta)?void 0:_res_meta.code)){const mergeList=mergeTimes((res.data||[]).map((item=>(item.endTime=parseInt(DateTime.strToDate(item.stopTime).getTime()/1e3+"",10),item.startTime=parseInt(DateTime.strToDate(item.startTime).getTime()/1e3+"",10),item.busType=7,item.iStorageVersion=item.istorageVersion,item))));return mergeList.length>0&&(mergeList[0].startTime<parseInt(DateTime.strToDate(DateTime.formate(body.begin,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10)&&(mergeList[0].startTime=parseInt(DateTime.strToDate(DateTime.formate(body.begin,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10)),mergeList[mergeList.length-1].endTime>parseInt(DateTime.strToDate(DateTime.formate(body.end,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10)&&(mergeList[mergeList.length-1].endTime=parseInt(DateTime.strToDate(DateTime.formate(body.end,"YYYY-MM-DD hh:mm:ss")).getTime()/1e3+"",10))),mergeList}return[]})).catch((()=>[]))}))()}getCloudTimes(body){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;const data=new FormData;data.append("recType",body.url&&-1===body.url.indexOf(".cloud")?"2":"1"),data.append("version","2.0"),data.append("deviceSerial",_this._options.deviceSerial),data.append("channelNo",_this._options.channelNo+""),data.append("accessToken",_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)||""),body.begin&&data.append("startTime",DateTime.strToDate(body.begin+"").getTime()+""),body.end&&data.append("endTime",DateTime.strToDate(body.end+"").getTime()+"");let list=[];const getCloudTimesHttp=_async_to_generator$6((function*(data){try{yield _this.post(`${API_getCloudTimes}`,{headers:null,body:data}).then((response=>response.json())).then(_async_to_generator$6((function*(res){if(200==+res.code&&res.data){var _res_data,_res_data_files,_res_data1,_res_data2,_res_data3;let files=[];if(Array.isArray(res.data))files=res.data;else if((null==(_res_data=res.data)?void 0:_res_data.files)&&(null==(_res_data1=res.data)||null==(_res_data_files=_res_data1.files)?void 0:_res_data_files.length)>0){var _res_data4;files=(null==(_res_data4=res.data)?void 0:_res_data4.files)||[]}if(list=list.concat(files),!(null==(_res_data2=res.data)?void 0:_res_data2.isAll)&&(null==(_res_data3=res.data)?void 0:_res_data3.nextFileTime))return data.append("startTime",res.data.nextFileTime),yield getCloudTimesHttp(data)}})))}catch(error){}}));yield getCloudTimesHttp(data),list=list.map((item=>_extends$c({},item,{endTime:parseInt(item.endTime/1e3+"",10),startTime:parseInt(item.startTime/1e3+"",10)})));const mergeList=mergeTimes(list,_this._options.timeZone||0);return mergeList.length>0&&(mergeList[0].startTime<parseInt(DateTime.strToDate(body.begin+"").getTime()/1e3+"",10)&&(mergeList[0].startTime=parseInt(DateTime.strToDate(body.begin+"").getTime()/1e3+"",10)),mergeList[mergeList.length-1].endTime>parseInt(DateTime.strToDate(body.end+"").getTime()/1e3+"",10)&&(mergeList[mergeList.length-1].endTime=parseInt(DateTime.strToDate(body.end+"").getTime()/1e3+"",10))),mergeList}))()}getLocalRecTimes(params){var _this=this;return _async_to_generator$6((function*(){if("custom"===_this._options.sdkType){var _this__options_token_deviceToken,_this__options_token;const data=new FormData;data.append("recType","2"),data.append("version","2.0"),data.append("deviceSerial",_this._options.deviceSerial),data.append("channelNo",_this._options.channelNo+""),data.append("accessToken",_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)||""),params.begin&&data.append("startTime",DateTime.strToDate(params.begin+"").getTime()+""),params.end&&data.append("endTime",DateTime.strToDate(params.end+"").getTime()+"");let list=[];const getLocalTimesHttp=_async_to_generator$6((function*(data){try{yield _this.post(`${API_getCloudTimes}`,{body:data}).then((response=>response.json())).then(_async_to_generator$6((function*(res){if(200==+res.code&&res.data){var _res_data,_res_data_files,_res_data1,_res_data2,_res_data3;let files=[];if(Array.isArray(res.data))files=res.data;else if((null==(_res_data=res.data)?void 0:_res_data.files)&&(null==(_res_data1=res.data)||null==(_res_data_files=_res_data1.files)?void 0:_res_data_files.length)>0){var _res_data4;files=(null==(_res_data4=res.data)?void 0:_res_data4.files)||[]}if(list=list.concat(files),!(null==(_res_data2=res.data)?void 0:_res_data2.isAll)&&(null==(_res_data3=res.data)?void 0:_res_data3.nextFileTime))return data.append("startTime",res.data.nextFileTime),yield getLocalTimesHttp(data)}})))}catch(error){}}));yield getLocalTimesHttp(data),list=list.map((item=>_extends$c({},item,{endTime:parseInt(item.endTime/1e3+"",10),startTime:parseInt(item.startTime/1e3+"",10)})));const mergeList=mergeTimes(list||[],_this._options.timeZone||0);return mergeList.length>0&&(mergeList[0].startTime<parseInt(DateTime.strToDate(params.begin+"").getTime()/1e3+"",10)&&(mergeList[0].startTime=parseInt(DateTime.strToDate(params.begin+"").getTime()/1e3+"",10)),mergeList[mergeList.length-1].endTime>parseInt(DateTime.strToDate(params.end+"").getTime()/1e3+"",10)&&(mergeList[mergeList.length-1].endTime=parseInt(DateTime.strToDate(params.end+"").getTime()/1e3+"",10))),mergeList}{const startTime=parseInt(DateTime.strToDate(params.begin+"").getTime()/1e3+"",10),endTime=parseInt(DateTime.strToDate(params.end+"").getTime()/1e3+"",10),getLocalVideoUnifyQueryHttp=_async_to_generator$6((function*(params){let list=[];try{var _this__options_token_deviceToken,_this__options_token,_data_meta,_data_data_records,_data_data,_data_data1;const data=yield _this.get(`${API_getLocalRecTimes}?startTime=${params.startTime}&endTime=${params.endTime}&pageSize=${params.pageSize||200}`,{headers:{accessToken:_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video),deviceSerial:_this._options.deviceSerial}}).then((res=>res.json()));if(200!=+(null==data||null==(_data_meta=data.meta)?void 0:_data_meta.code))return list;var _data_data2;if((null==data||null==(_data_data=data.data)||null==(_data_data_records=_data_data.records)?void 0:_data_data_records.length)&&(list=list.concat(data.data.records||[])),null==data||null==(_data_data1=data.data)?void 0:_data_data1.hasMore)list=list.concat(yield getLocalVideoUnifyQueryHttp(_extends$c({},params,{startTime:null==data||null==(_data_data2=data.data)?void 0:_data_data2.nextFileTime})))}catch(error){}return list})),mergeList=mergeTimes((yield getLocalVideoUnifyQueryHttp({startTime:startTime,endTime:endTime}))||[]||[],_this._options.timeZone||0);return mergeList.length>0&&(mergeList[0].startTime<startTime&&(mergeList[0].startTime=startTime),mergeList[mergeList.length-1].endTime>endTime&&(mergeList[mergeList.length-1].endTime=endTime)),mergeList}}))()}postDevicePtzMirror(command){var _this=this;return _async_to_generator$6((function*(){var _this__options_token_deviceToken,_this__options_token;const data=new FormData;data.append("command",command+""),data.append("accessToken",_this._options.accessToken||(null==(_this__options_token=_this._options.token)||null==(_this__options_token_deviceToken=_this__options_token.deviceToken)?void 0:_this__options_token_deviceToken.video)||""),data.append("deviceSerial",_this._options.deviceSerial),data.append("channelNo",_this._options.channelNo+""),_this.post(API_ptzMirror,{body:data})}))()}abort(){this.controllers.length>0&&(this.controllers.forEach((controller=>{controller.abort("abort fetch")})),this.controllers=[])}destroy(){this.abort()}constructor(options){this.controllers=[],this._options=deepmerge({baseURL:DOMAIN},options,{clone:!1}),this._options.baseURL||(this._options.baseURL=DOMAIN),this._options.baseURL=this._options.baseURL.replace(/\/$/,"")}}function _extends$b(){return _extends$b=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$b.apply(this,arguments)}const LOG_ENV_LIST=[{id:"zh",env:"https://open.ys7.com",logHost:"https://log.ys7.com/statistics.do/opensdk_ezuikit"},{id:"us",env:"https://iusopen.ezvizlife.com",logHost:"https://uslog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"eu",env:"https://ieuopen.ezvizlife.com",logHost:"https://eulog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"sa",env:"https://isaopen.ezvizlife.com",logHost:"https://salog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"sgp",env:"https://isgpopen.ezvizlife.com",logHost:"https://sgplog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"rus",env:"https://irusopen.ezvizlife.com",logHost:"https://ruslog.ezvizlife.com/statistics.do/opensdk_ezuikit"},{id:"india",env:"https://iindiaopen.ezvizlife.com",logHost:"https://indialog.ezvizlife.com/statistics.do/opensdk_ezuikit"}];class Collect{changeUrl(domain){var _this_collect_changeUrl,_this_collect;null==(_this_collect=this.collect)||null==(_this_collect_changeUrl=_this_collect.changeUrl)||_this_collect_changeUrl.call(_this_collect,this.getCollectUrl(domain))}getCollectUrl(domain){const index=LOG_ENV_LIST.findIndex((i=>i.env===domain));return index>-1?LOG_ENV_LIST[index].logHost:""}report(action,params){var _this_collect;this.monitorReport&&(null==(_this_collect=this.collect)||_this_collect.send(_extends$b({action:action,appKey:this.appKey},params,{logInfo:_extends$b({pluginVersion:this.pluginVersion},params.logInfo||{})})))}updateParams(params){var _this_collect;null==(_this_collect=this.collect)||_this_collect.updateExtendsInfo(params)}updateAppKey(appKey){this.appKey=appKey}setForbidden(forbidden){var _this_collect;null==(_this_collect=this.collect)||_this_collect.setForbidden(forbidden)}constructor(options){this.collect=null,this.appKey="",this.monitorReport=!0,this.pluginVersion="";const url=this.getCollectUrl(options.domain);this.pluginVersion=options.pluginVersion,url&&(this.monitorReport=options.monitorReport,this.collect=new CollectUtils(_extends$b({},options,{url:url})))}}function formatPlaybackBeginEndTimeZone(begin,end,timeZone=0,busType){let originBegin=begin,originEnd=end;return begin&&14===begin.length&&end&&14===end.length?(DateTime.formate(begin,"YYYYMMDD")!==DateTime.formate(end,"YYYYMMDD")&&(originEnd=begin.slice(0,8)+"235959"),end=(begin=begin.slice(0,8)+"000000").slice(0,8)+"235959"):begin&&14===begin.length?(end=(begin=begin.slice(0,8)+"000000").slice(0,8)+"235959",originEnd=begin.slice(0,8)+"235959"):end&&14===end.length?(begin=end.slice(0,8)+"000000",end=end.slice(0,8)+"235959",originBegin=begin):(originBegin=begin=DateTime.formate(new Date,"YYYYMMDD")+"000000",originEnd=end=DateTime.formate(new Date,"YYYYMMDD")+"235959"),([void 0,"",null].includes(timeZone)||(timeZone=parseInt(timeZone))>=24||timeZone<=-24||isNaN(timeZone))&&(timeZone=0),7==+busType?{begin:begin,end:end,timeZone:timeZone,originBegin:originBegin,originEnd:originEnd}:{begin:begin=DateTime.formate(DateTime.strToDate(begin).getTime()+60*timeZone*60*1e3,"YYYYMMDDhhmmss"),end:end=DateTime.formate(DateTime.strToDate(end).getTime()+60*timeZone*60*1e3,"YYYYMMDDhhmmss"),timeZone:timeZone,originBegin:originBegin,originEnd:originEnd}}function _extends$a(){return _extends$a=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$a.apply(this,arguments)}function getTime(time){return"string"!=typeof time&&"number"!=typeof time||!/\d/.test(time+"")||10!==(time+"").length?time:1e3*time}function mergeRecSliceByDownloadPath(slices,pickKeys=[],begin,end){function pickObject(obj){const newObj={};return pickKeys.forEach((key=>{newObj[key]=obj[key]})),newObj.istorageVersion&&(newObj.iStorageVersion=newObj.istorageVersion,delete newObj.istorageVersion),newObj}const startTime=DateTime.strToDate(begin).getTime(),endTime=DateTime.strToDate(end).getTime();return(slices=[...slices].map((item=>_extends$a({},item,{startTime:getTime(item.startTime),endTime:getTime(item.endTime)}))).filter((item=>item.startTime>=startTime&&item.endTime<=endTime||(item.startTime<startTime&&item.endTime>startTime||(item.startTime<endTime&&item.endTime>endTime||void 0))))).length>0&&(slices[0].startTime=startTime,slices[slices.length-1].endTime=endTime),slices.reduce(((acc,cur,index)=>0===index?(acc.push(pickObject(cur)),acc):(acc[acc.length-1].downloadPath===cur.downloadPath?acc[acc.length-1].endTime=cur.endTime:acc.push(pickObject(cur)),acc)),[])}const setVideoLevel=(jsPlugin,videoLevel)=>{var _jsPlugin_logger_log,_jsPlugin_logger;const url=`${jsPlugin.env.domain}/api/v3/device/setVideoLevel?accessToken=${jsPlugin.accessToken||jsPlugin.token.deviceToken.video} `,data=new FormData;return data.append("videoLevel",parseInt(videoLevel+"")),null==(_jsPlugin_logger=jsPlugin.logger)||null==(_jsPlugin_logger_log=_jsPlugin_logger.log)||_jsPlugin_logger_log.call(_jsPlugin_logger,"[https request] setVideoLevel()","videoLevel",videoLevel),videoLevel<0?Promise.resolve({}):fetch(url,{method:"POST",headers:{accessToken:jsPlugin.accessToken||jsPlugin.token.deviceToken.video,deviceSerial:jsPlugin.deviceSerial,localIndex:jsPlugin.channelNo},body:data}).then((response=>response.json())).then((res=>(null==jsPlugin.emit||jsPlugin.emit.call(jsPlugin,EVENTS.http.setVideoLevel,res),res)))};let HttpFetch_DOMAIN=DOMAIN;class HttpFetch{setDomain(domain){HttpFetch_DOMAIN=domain||HttpFetch_DOMAIN}fetch(input,init){return input="string"==typeof input?/^http/.test(input)?input:HttpFetch_DOMAIN+input:input,new Promise(((resolve,reject)=>{fetch(input,init).then((res=>{try{return res.json()}catch(error){reject({code:-1,msg:"data json parse error"})}})).then((res=>{200==+res.code||res.meta&&200===res.meta.code?resolve(res):reject(res)})).catch((err=>{reject(err)}))}))}constructor(domain){return HttpFetch.instant?HttpFetch.instant:(HttpFetch_DOMAIN=domain||HttpFetch_DOMAIN,HttpFetch.instant=this)}}function _extends$9(){return _extends$9=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$9.apply(this,arguments)}class Instance{getState(){return this.state}setState(newState){this.state=_extends$9({},this.state,newState)}constructor(id,initialState={rejection:!1,play:!1,pantile:!1,recordvideo:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}){this.id=id,this.state=initialState}}function _extends$8(){return _extends$8=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$8.apply(this,arguments)}const p=new class{getGlobalState(){return this.globalState}setGlobalState(newState){this.globalState=_extends$8({},this.globalState,newState)}constructor(){this.createInstance=(id,initialState={})=>{this.instances.has(id)&&this.removeInstance(id);const instance=new Instance(id,initialState);this.instances.set(id,instance)},this.getInstance=id=>this.instances.has(id)?this.instances.get(id):null,this.removeInstance=id=>{if(!this.instances.has(id))return null;this.instances.delete(id)},this.listInstances=()=>Array.from(this.instances.values()),this.instances=new Map,this.globalState={talk:!1,expend:!1,webExpend:!1,sound:!1,audioOnly:!1}}};function removePlayerCanvas(id){const $canvas=document.getElementById(`${id}-player`);$canvas&&$canvas.remove()}function getResolutionCategory(height){const resolutionRanges=[{max:400,label:"360P"},{max:520,label:"480P"},{max:900,label:"720P"},{max:1200,label:"1080P"},{max:1600,label:"2K"},{max:2400,label:"4K"},{max:4500,label:"8K"}];for(const range of resolutionRanges)if(height<=range.max)return range.label}function asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _extends$7(){return _extends$7=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$7.apply(this,arguments)}function __getRecTimesService(){var fn;return fn=function*(player){let obj={},paramstring="";var _player_urlInfo_searchParams;return"rec"===player.urlInfo.type&&(obj=formatPlaybackBeginEndTimeZone(player.urlInfo.searchParams.begin,player.urlInfo.searchParams.end,null==(_player_urlInfo_searchParams=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.timeZone,player.urlInfo.searchParams.busType),player.timeZone=obj.timeZone,paramstring="&begin="+DateTime.formate(obj.originBegin,"YYYYMMDDThhmmssZ")+"&end="+DateTime.formate(obj.originEnd,"YYYYMMDDThhmmssZ")+"&timeZone="+obj.timeZone),-1!==player.url.indexOf(".cloud")&&"7"===player.urlInfo.searchParams.busType?yield player._services.getCloudRecordTimes({begin:obj.begin,end:obj.end,spaceId:player._spaceId}).then((list=>{if(player.cloudRecordRecList=list||[],null==player.emit||player.emit.call(player,EVENTS.http.getCloudRecordTimes,list||[]),null==player.emit||player.emit.call(player,EVENTS.setAllDayRecTimes,{type:"cloudRecordTimes",list:list||[]}),player.recordList=list||[],list.length){const playbackSlices=mergeRecSliceByDownloadPath(list,["downloadPath","ownerId","iStorageVersion","spaceId","startTime","endTime","videoType","busType"],obj.originBegin,obj.originEnd);if(null==player.emit||player.emit.call(player,EVENTS.setRecTimes,list),0===playbackSlices.length)return"";const recSliceArrJSON=JSON.stringify(playbackSlices).replace("\\","");return paramstring+"&recSlice="+recSliceArrJSON.replace("\\","")+"&r="+Math.random()}return null==player.emit||player.emit.call(player,EVENTS.setRecTimes,[]),""})):-1!==player.url.indexOf(".cloud")&&"7"!==player.urlInfo.searchParams.busType||"base"!==player.sdkType?yield player._services.getCloudTimes({begin:obj.begin,end:obj.end,url:player.url}).then((list=>{if(player.cloudRecList=list||[],null==player.emit||player.emit.call(player,EVENTS.http.getCloudRecTimes,list||[]),null==player.emit||player.emit.call(player,EVENTS.setAllDayRecTimes,{type:"cloudRecTimes",list:list}),player.recordList=list||[],list.length){const playbackSlices=mergeRecSliceByDownloadPath(list,["downloadPath","ownerId","iStorageVersion","startTime","endTime","videoType"],obj.originBegin,obj.originEnd);if(null==player.emit||player.emit.call(player,EVENTS.setRecTimes,playbackSlices),0===playbackSlices.length)return"";const recSliceArrJSON=JSON.stringify(playbackSlices.map((item=>{var _player_urlInfo_searchParams,_player_urlInfo_searchParams1;return _extends$7({},item,{startTime:item.startTime+3600*((null==(_player_urlInfo_searchParams=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.timeZone)||0)*1e3,endTime:item.endTime+3600*((null==(_player_urlInfo_searchParams1=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams1.timeZone)||0)*1e3})}))).replace("\\","");return paramstring+"&recSlice="+recSliceArrJSON.replace("\\","")+"&r="+Math.random()}return null==player.emit||player.emit.call(player,EVENTS.setRecTimes,[]),""})):-1!==player.url.indexOf(".rec")?(player._services.getLocalRecTimes({begin:obj.begin,end:obj.end}).then((list=>{player.localRecList=list,null==player.emit||player.emit.call(player,EVENTS.http.getLocalRecTimes,list||[]),null==player.emit||player.emit.call(player,EVENTS.setAllDayRecTimes,{type:"localTimes",list:list||[]}),player.recordList=list||[],null==player.emit||player.emit.call(player,EVENTS.setRecTimes,list||[])})),paramstring):void 0},__getRecTimesService=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$5(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},__getRecTimesService.apply(this,arguments)}function _getDeviceSupportQualityServicesAndGetDeviceListServices(player){var _player_logger_log,_player_logger;return player.url.indexOf(".live")>-1?(null==(_player_logger=player.logger)||null==(_player_logger_log=_player_logger.log)||_player_logger_log.call(_player_logger,"[https request] _getDeviceSupportQualityServicesAndGetDeviceListServices()"),new Promise((resolve=>{const getDeviceSupportQualityService=player.params.videoLevelList?Promise.resolve(player.params.videoLevelList):function(player){var _player_logger_log,_player_logger;return null==(_player_logger=player.logger)||null==(_player_logger_log=_player_logger.log)||_player_logger_log.call(_player_logger,"[https request] getDeviceSupportQuality()"),player._services.getDeviceSupportQuality().then((res=>(player.videoLevelList=res,player._setVideoLevelList(player.videoLevelList),null==player.emit||player.emit.call(player,EVENTS.http.getDeviceSupportQuality,res),res)))}(player);Promise.all([getDeviceSupportQualityService,player._services.getDeviceList()]).then((res=>{var _player_logger_log,_player_logger,_player_videoLevelList_,_player_videoLevelList;null==(_player_logger=player.logger)||null==(_player_logger_log=_player_logger.log)||_player_logger_log.call(_player_logger,"[https request] getDeviceList()"),null==player.emit||player.emit.call(player,EVENTS.http.getDeviceList,res[1]||[]);const currentChannelNoItem=res[1].find((item=>item.channelNo===+player.urlInfo.channelNo));currentChannelNoItem||resolve([[],[]]),player._setVideoLevelList(player.videoLevelList),null==player.emit||player.emit.call(player,EVENTS.setVideoLevelList,res[0]||[]);let currentVideoLevel={};currentVideoLevel="compatible"===(null==(_player_videoLevelList_=player.videoLevelList[0])?void 0:_player_videoLevelList_.type)?player.url.indexOf(".hd.live")>0?player.videoLevelList[1]:player.videoLevelList[0]:player.videoLevelList.find((item=>item.level==(null==currentChannelNoItem?void 0:currentChannelNoItem.videoLevel)))||{},(null==currentVideoLevel?void 0:currentVideoLevel.streamTypeIn)?(player.videoLevel=currentVideoLevel.level,player.streamTypeIn=currentVideoLevel.streamTypeIn):(null==(_player_videoLevelList=player.videoLevelList)?void 0:_player_videoLevelList.length)>0?(player.videoLevel=player.videoLevelList[0].level,player.streamTypeIn=player.videoLevelList[0].streamTypeIn,currentVideoLevel=player.videoLevelList[0]):player.logger.warn(`the current video quality(${null==currentChannelNoItem?void 0:currentChannelNoItem.videoLevel}) is not in the list!`),null==player.emit||player.emit.call(player,EVENTS.currentVideoLevel,currentVideoLevel,player.videoLevel),resolve(res)}))}))):Promise.resolve([[],[]])}function _getStreamAddressListService(player){var _player_logger;return null==(_player_logger=player.logger)||_player_logger.log("[https request] getStreamAddressList()"),player._services.getStreamAddressList().then((res=>{player.maxReloadTime=res[0],null==player.emit||player.emit.call(player,EVENTS.http.getStreamAddressList,res[1])}))}function _extends$6(){return _extends$6=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$6.apply(this,arguments)}let _recAlreadyFirstPlayed=!1;function _pluginPlay(player,wssUrl,stopTime,getWsTimeStart){const getWsTimeEnd=Date.now();return _recAlreadyFirstPlayed=!0,player.playing=!0,player.loading=!0,new Promise(((resolve,reject)=>{var _player_logger,_player_logger1;(null==(_player_logger=player.logger)||_player_logger.log("_pluginPlay()",JSON.stringify(wssUrl)),wssUrl)||(null==(_player_logger1=player.logger)||_player_logger1.error("play address error"),reject({code:-1,msg:"play address error"}));player.wsUrl=wssUrl,player._recOSDTimer&&(clearInterval(player._recOSDTimer),player._recOSDTimer=null),player._seekIntervaltimer&&(clearInterval(player._seekIntervaltimer),player._seekIntervaltimer=null);const websocketConnectUrl=wssUrl.split("?")[0].replace("/live","").replace("/playback","");let websocketStreamingParam=(-1===wssUrl.indexOf("/live")?-1!==wssUrl.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+wssUrl.split("?")[1];websocketStreamingParam=(websocketStreamingParam.replace(/&stream=\d/,"")+"&stream="+(["/cloudplayback?","/playback?"].includes(websocketStreamingParam)?1:player.streamTypeIn||1)).replace(/&&/gi,"&");const wsParams={playURL:websocketStreamingParam};if(player._gotWsUrlTime=(new Date).getTime(),player.isStoping=!1,player.jSPlugin){var _player_urlInfo,_player_jSPlugin;if(null==player.logger.log||player.logger.log.call(player.logger,"JS_Play()"),null==(_player_urlInfo=player.urlInfo)?void 0:_player_urlInfo.validateCode)null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_SetSecretKey(0,player.urlInfo.validateCode);player.jSPlugin.JS_Play(websocketConnectUrl,wsParams,0).then((()=>{if(player.isStoping&&resolve({code:1,msg:"playing is stopping"}),1===player.videoPlayState||4===player.videoPlayState){var _player__collect;player.videoPlayState=2;const now=Date.now();null==(_player__collect=player._collect)||_player__collect.report(2,{logInfo:{domain:websocketConnectUrl,loadTime:now-player.videoInitTime,loadTimeDesc:{initTime:player._initTime,stopTime:stopTime,getWsTime:getWsTimeEnd-getWsTimeStart,createWsTime:now-getWsTimeEnd}},loadTime:now-player.videoInitTime,initTime:player._initTime,getWsTime:getWsTimeEnd-getWsTimeStart,createWsTime:now-getWsTimeEnd})}player.jSPlugin&&player._FECSplitIds&&player._FECCorrectType&&player.jSPlugin.JS_FECCorrectType(player._FECCorrectType,player._FECSplitIds),player.waterMark_JSPlugin&&player.setWaterMarkFont(player.waterMark_JSPlugin),resolve({code:0,wss:websocketConnectUrl,wsParams:wsParams})})).catch((err=>{var _player_i18n,_player_jSPlugin;let msg=null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("PLAY_FAILED"),retcode=-1;if(null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.bPlay)return!1;var _player_Theme_setDisabled,_player_Theme,_player_i18n1;(null==err?void 0:err.errorCode)&&(null==(_player_Theme=player.Theme)||null==(_player_Theme_setDisabled=_player_Theme.setDisabled)||_player_Theme_setDisabled.call(_player_Theme,!0),msg=null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("39"+err.errorCode),retcode=err.errorCode);player.isCall,reject({msg:msg,code:retcode})}))}}))}function _changePlayUrl(player,options,callback=()=>{}){var _player_controls_zoomControl_setZoom,_player_controls_zoomControl,_player_controls,_player_urlInfo,_player_urlInfo1,_urlInfo_searchParams,_player_urlInfo_searchParams,_urlInfo_searchParams1,_player_urlInfo_searchParams1,_urlInfo_searchParams2,_player_urlInfo_searchParams2,_player__services,_player_controls1,_player_controls2,_player__collect,_player__collect1,_player_jSPlugin;player.playing=!0,player.loading=!0,null==(_player_controls=player.controls)||null==(_player_controls_zoomControl=_player_controls.zoomControl)||null==(_player_controls_zoomControl_setZoom=_player_controls_zoomControl.setZoom)||_player_controls_zoomControl_setZoom.call(_player_controls_zoomControl);const[newUrl,urlInfo]=function(preUrl,options,recType,spaceId){let newUrl="",tempUrlInfo=parseEzopenUrl(preUrl);options.url&&/^ezopen:\/\//.test(options.url)&&(newUrl=options.url,tempUrlInfo=parseEzopenUrl(newUrl));options.deviceSerial&&(tempUrlInfo.deviceSerial=options.deviceSerial);options.channelNo&&(tempUrlInfo.channelNo=options.channelNo);options.validCode&&(tempUrlInfo.validateCode=options.validCode);options.host&&(tempUrlInfo.hostname=options.host);const urlType=options.type||(tempUrlInfo.recType?tempUrlInfo.recType+"."+tempUrlInfo.type:tempUrlInfo.type);"live"===urlType?(tempUrlInfo.type="live",!0===options.hd?tempUrlInfo.definition="hd":!1===options.hd&&(tempUrlInfo.definition="sd"),tempUrlInfo.searchParams={},tempUrlInfo.search=""):["rec","cloud.rec","miniRec"].includes(urlType)&&(tempUrlInfo.recType="cloud.rec"===urlType?"cloud":"",tempUrlInfo.type="rec",tempUrlInfo.definition="",tempUrlInfo.searchParams=tempUrlInfo.searchParams||{},options.begin&&(tempUrlInfo.searchParams.begin=options.begin),options.end&&(tempUrlInfo.searchParams.end=options.end),"cloudRecord"===recType&&"cloud"===tempUrlInfo.recType&&(tempUrlInfo.searchParams.busType="7",spaceId&&(tempUrlInfo.searchParams.spaceId=spaceId)));return tempUrlInfo.search=Object.entries(tempUrlInfo.searchParams||{}).reduce(((acc,[key,value])=>""===value?acc:acc+=`${key}=${encodeURIComponent(value)}&`),"?").replace(/&$/,""),newUrl=`${tempUrlInfo.protocol}//${tempUrlInfo.validateCode?`${tempUrlInfo.validateCode}@`:""}${tempUrlInfo.hostname}/${tempUrlInfo.deviceSerial}/${tempUrlInfo.channelNo}${"rec"===tempUrlInfo.type&&tempUrlInfo.recType?"."+tempUrlInfo.recType:""}${"live"===tempUrlInfo.type&&"hd"===tempUrlInfo.definition?"."+tempUrlInfo.definition:""}.${tempUrlInfo.type}${tempUrlInfo.search}`,newUrl=newUrl.replace(/\?$/,""),tempUrlInfo=parseEzopenUrl(newUrl),[newUrl,tempUrlInfo]}(player.url,options,player.recType,player._spaceId);var _player_controls_ptzControl,_player_controls3,_player_Talk_updateOptions,_player_Talk;((null==urlInfo?void 0:urlInfo.origin)===(null==(_player_urlInfo=player.urlInfo)?void 0:_player_urlInfo.origin)&&(null==urlInfo?void 0:urlInfo.pathname)===(null==(_player_urlInfo1=player.urlInfo)?void 0:_player_urlInfo1.pathname)&&DateTime.formate((null==(_urlInfo_searchParams=urlInfo.searchParams)?void 0:_urlInfo_searchParams.begin)||new Date,"YYYYMMDD")===DateTime.formate((null==(_player_urlInfo_searchParams=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.begin)||new Date,"YYYYMMDD")&&(null==(_urlInfo_searchParams1=urlInfo.searchParams)?void 0:_urlInfo_searchParams1.busType)===(null==(_player_urlInfo_searchParams1=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams1.busType)&&(null==(_urlInfo_searchParams2=urlInfo.searchParams)?void 0:_urlInfo_searchParams2.spaceId)===(null==(_player_urlInfo_searchParams2=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams2.spaceId)||player.emit(EVENTS.setAllDayRecTimes,{type:"",list:[]}),player.url=newUrl,player.host=null==urlInfo?void 0:urlInfo.hostname,player.deviceSerial=urlInfo.deviceSerial,player.channelNo=urlInfo.channelNo,player.accessToken=options.accessToken||player.accessToken,player.token=options.token||player.token,null==(_player__services=player._services)||_player__services.updateOptions({accessToken:player.accessToken,token:player.token,channelNo:player.channelNo,deviceSerial:player.deviceSerial}),null==(_player_controls1=player.controls)?void 0:_player_controls1.ptzControl)&&(null==(_player_controls3=player.controls)||null==(_player_controls_ptzControl=_player_controls3.ptzControl)||_player_controls_ptzControl.updateOptions({accessToken:player.accessToken,token:player.token,channelNo:player.channelNo,deviceSerial:player.deviceSerial}));player.Talk&&(null==(_player_Talk=player.Talk)||null==(_player_Talk_updateOptions=_player_Talk.updateOptions)||_player_Talk_updateOptions.call(_player_Talk,{accessToken:player.accessToken,token:player.token,channelNo:player.channelNo,deviceSerial:player.deviceSerial}));if(null==(_player_controls2=player.controls)?void 0:_player_controls2.dateControl){var _urlInfo_searchParams3,_player_controls_dateControl,_player_controls4;const begin=(null==(_urlInfo_searchParams3=urlInfo.searchParams)?void 0:_urlInfo_searchParams3.begin)||new Date;null==(_player_controls4=player.controls)||null==(_player_controls_dateControl=_player_controls4.dateControl)||_player_controls_dateControl.setDate(new Date(DateTime.formate(begin,"YYYY-MM-DD hh:mm:ss")),!1)}if(urlInfo.deviceSerial!==player.urlInfo.deviceSerial||urlInfo.hostname!==player.urlInfo.hostname?(player._deviceSerialChangeServices(),"live"===urlInfo.type&&_getDeviceSupportQualityServicesAndGetDeviceListServices(player)):urlInfo.channelNo!==player.urlInfo.channelNo&&(_getStreamAddressListService(player),"live"===urlInfo.type&&_getDeviceSupportQualityServicesAndGetDeviceListServices(player)),player.videoInitTime=Date.now(),player.videoPlayState=4,options.url)try{let addressList=JSON.parse(localStorage.getItem("ezuikit_addressList")||"{}");addressList[player.deviceSerial+"_"+player.channelNo]||(addressList=_extends$6({},addressList,{[player.deviceSerial+"_"+player.channelNo]:[]}),localStorage.setItem("ezuikit_addressList",JSON.stringify(addressList)))}catch(error){}player.urlInfo=urlInfo;const reportUrlType="cloud"===urlInfo.recType?"cloud.rec":urlInfo.type;null==(_player__collect=player._collect)||_player__collect.updateParams({protocol:"ezopen",url:newUrl,serial:player.deviceSerial,no:player.channelNo,env:player.env.domain,type:reportUrlType});let tmpParams=Object.assign({},player.params);return null==(_player__collect1=player._collect)||_player__collect1.report(4,{logInfo:{type:reportUrlType,params:tmpParams}}),(null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.player)&&(player.jSPlugin.player.playbackRate=1,player.jSPlugin.player._playbackRate=1,player.speed=1),callback(),new Promise(((resolve,reject)=>{const changePlayUrlParams={url:newUrl};return options.token&&(changePlayUrlParams.token=options.token),options.accessToken&&(changePlayUrlParams.accessToken=options.accessToken),player.play(changePlayUrlParams).then((()=>{var _player_i18n;const props=["url","deviceSerial","channelNo","accessToken","token"].reduce(((acc,key)=>(acc[key]=player[key],acc)),{});null==player.emit||player.emit.call(player,EVENTS.changePlayUrl,{eventType:EVENTS.changePlayUrl,code:0,data:props,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("CHANGE_PLAYURL_SUCCESS")}),resolve(newUrl)})).catch((error=>{reject(error)}))}))}function _setSpeed(player,speed){let result=-1;var _player_logger,_player_logger1;if(speed===player.speed)return null==(_player_logger=player.logger)||_player_logger.warn("the speed value has not changed!"),0;speed&&(SPEED_LIST.includes(+speed)?(player.jSPlugin.JS_Speed(speed),result=1,player.speed=speed):null==(_player_logger1=player.logger)||_player_logger1.warn("current speed is not supported!"));return result}function asyncGeneratorStep$4(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$4(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$4(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$4(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _extends$5(){return _extends$5=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$5.apply(this,arguments)}function _extends$4(){return _extends$4=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$4.apply(this,arguments)}class Upload{upload(){this.onBeforeUpload(this.body);const fetchOptions={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,fetchOptions).then((response=>response.json())).then((data=>{this.onUploadComplete({body:this.body,response:data})})).catch((error=>{error.name})),fetchOptions.body&&"FormData"==fetchOptions.body.constructor.name&&"signal"in fetchOptions&&fetchOptions.signal.addEventListener("progress",(e=>{e.lengthComputable&&this.onUploadProgress(_extends$4({},this.body,{progress:e.loaded/e.total}))}))}cancel(){this.controller.abort()}constructor(options){this.url=options.url||"",this.method=options.method||"POST",this.headers=options.headers||{},this.body=options.body||{},this.onBeforeUpload=options.onBeforeUpload||function(){},this.onUploadProgress=options.onUploadProgress||function(){},this.onUploadComplete=options.onUploadComplete||function(){},this.controller=new AbortController}}function _enable3DZoom(player){var _player_i18n,_player_i18n1,_player_i18n2;if(!player.use3DZoom)return null==player.emit||player.emit.call(player,EVENTS.enable3DZoom,{eventType:EVENTS.enable3DZoom,code:-1,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("3D_ZOOM_DISABLE")}),player.emit("message",null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("3D_ZOOM_DISABLE"),"3DZoomError"),Promise.resolve({code:-1,msg:null==(_player_i18n2=player.i18n)?void 0:_player_i18n2.t("3D_ZOOM_DISABLE")});if(player.is3DZooming)return new Promise((function(resolve){var _player_i18n,_player_i18n1;null==player.emit||player.emit.call(player,EVENTS.enable3DZoom,{eventType:EVENTS.enable3DZoom,code:0,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("3D_ZOOM_ACTIVED")}),resolve({code:0,msg:null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("3D_ZOOM_ACTIVED")})}));if(player.support3DZoom){var _player_jSPlugin,_player_i18n3;player.is3DZooming=!0;let enable3DZoomRT=null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.JS_Enable3DZoom(0,(r=>{const screenWidth=player.width,screenHeight=player.height,zoomDirection=function(rect,isTrans){if(!rect||!rect.startPos||!rect.endPos)return-1;const startX=rect.startPos[0],startY=rect.startPos[1],endX=rect.endPos[0],endY=rect.endPos[1];return isTrans?endX>startX&&endY<startY?1:endX<startX&&endY>startY?0:-1:endX>startX&&endY>startY?1:endX<startX&&endY<startY?0:-1}(r,player.isCurrentFullscreen);if(zoomDirection>-1)try{const param=function(width,height,rect,maxRate=5){if(!(width&&height&&rect&&rect.startPos&&rect.endPos))return-1;const startX=rect.startPos[0],startY=rect.startPos[1],endX=rect.endPos[0],endY=rect.endPos[1],targetWidth=Math.abs(endX-startX),targetHeight=Math.abs(endY-startY),targetCenterX=parseInt((startX+endX)/2+""),targetCenterY=parseInt((startY+endY)/2+""),zoomRate=Math.round(width*height/(targetWidth*targetHeight));return{startPointX:parseInt(startX/width*256+""),startPointY:parseInt(startY/height*256+""),endPointX:parseInt(endX/width*256+""),endPointY:parseInt(endY/height*256+""),zoomRate:zoomRate>maxRate?maxRate:zoomRate,targetCenterX:targetCenterX,targetCenterY:targetCenterY,targetWidth:targetWidth,targetHeight:targetHeight}}(screenWidth,screenHeight,r,player.capacity&&player.capacity.support_zoomOut_maxTime?player.capacity.support_zoomOut_maxTime:5);if(-1===param)return;const apiUrl=player.env.domain+`/api/v3/das/device/3d/zoom?accessToken=${player.accessToken||player.token.deviceToken.video}&deviceSerial=${player.urlInfo.deviceSerial}&channelNo=${player.urlInfo.channelNo}&command=${0==zoomDirection?9:8}&zoomTimes=${param.zoomRate}&startPointX=${param.startPointX}&startPointY=${param.startPointY}&endPointX=${param.endPointX}&endPointY=${param.endPointY}&length=${parseInt(screenHeight)}&width=${parseInt(screenWidth)}&midPointX=${param.targetCenterX}&midPointY=${param.targetCenterY}&lengthX=${param.targetWidth}&lengthY=${param.targetHeight}`;fetch(apiUrl,{method:"POST"}).then((response=>response.json())).then((res=>{200!=res.code&&player.emit("message",res.msg,"3DZoomError")})).catch((error=>{var _player_i18n;player.emit("message",null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("3D_ZOOM_FAILED"),"3DZoomError")}))}catch(error){var _player_i18n;player.emit("message",null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("3D_ZOOM_FAILED"),"3DZoomError")}}));return null==player.emit||player.emit.call(player,EVENTS.enable3DZoom,{eventType:EVENTS.enable3DZoom,code:enable3DZoomRT,msg:null==(_player_i18n3=player.i18n)?void 0:_player_i18n3.t("START_3D_ZOOM")}),0===enable3DZoomRT?Promise.resolve({code:-1}):Promise.resolve({code:0})}return player.is3DZooming=!1,new Promise((function(resolve){null==player.emit||player.emit.call(player,EVENTS.enable3DZoom,{eventType:EVENTS.enable3DZoom,code:-1,msg:player.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),player.emit("message",player.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM"),"3DZoomError"),resolve({code:-1,msg:player.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")})}))}function _getFEC3DViewParam(player,param){var _player_jSPlugin,_player_jSPlugin1,_player_jSPlugin2,_player_jSPlugin3,_player__FECCorrectType,_player__FECCorrectType1,_player__FECCorrectType2,_player__FECCorrectType3,_player_jSPlugin4;return!player._FECCorrectType||((null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.isHardH264)||(null==(_player_jSPlugin1=player.jSPlugin)?void 0:_player_jSPlugin1.isHardH265))&&(null==(_player_jSPlugin2=player.jSPlugin)?void 0:_player_jSPlugin2.useHardDev)?(null==player.emit||player.emit.call(player,EVENTS.getFEC3DViewParam,{eventType:EVENTS.getFEC3DViewParam,code:-1,msg:player.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")}),Promise.resolve({code:-1,msg:player.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")})):(null==(_player_jSPlugin3=player.jSPlugin)?void 0:_player_jSPlugin3.FEC_Set3DViewParam)&&player._FECCorrectType&&(3===(null==(_player__FECCorrectType=player._FECCorrectType)?void 0:_player__FECCorrectType.place)&&1536===(null==(_player__FECCorrectType1=player._FECCorrectType)?void 0:_player__FECCorrectType1.correctType)||1===(null==(_player__FECCorrectType2=player._FECCorrectType)?void 0:_player__FECCorrectType2.place)&&2304===(null==(_player__FECCorrectType3=player._FECCorrectType)?void 0:_player__FECCorrectType3.correctType))?null==(_player_jSPlugin4=player.jSPlugin)?void 0:_player_jSPlugin4.FEC_Get3DViewParam(param).then((res=>(null==player.emit||player.emit.call(player,EVENTS.getFEC3DViewParam,{eventType:EVENTS.getFEC3DViewParam,code:0,data:res,msg:player.i18n.t("FEC.SET_FEC_PARAMS")}),{code:0,data:res}))).catch((()=>(null==player.emit||player.emit.call(player,EVENTS.getFEC3DViewParam,{eventType:EVENTS.getFEC3DViewParam,code:-1}),{code:-1}))):(null==player.emit||player.emit.call(player,EVENTS.getFEC3DViewParam,{eventType:EVENTS.getFEC3DViewParam,code:-1,msg:player.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.resolve({code:-1,msg:player.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}class Ptz{static _instanceStyle(){if(Ptz._STYLE)return;Ptz._STYLE=document.createElement("style"),Ptz._STYLE.id="ezuikit-ptz-style";const _isMobile=isMobile();Ptz._STYLE.innerHTML=`\n .ez-ptz-container {\n position: relative;\n width: 80px;\n height: 80px;\n background: rgba(255, 255, 255, 0.70);\n box-shadow: 0px 0px 33px 4px rgb(0 0 0 / 15%);\n border: 1px solid rgba(255, 255, 255, 0.70);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n user-select: none;\n }\n .ez-ptz-container .ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n top: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.top.active {\n border-bottom-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 8px solid #999999;\n position: absolute;\n display: inline-block;\n left: calc(50% - 4px);\n bottom: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom.active {\n border-top-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-left: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n right: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.right.active {\n border-left-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 4px solid transparent;\n border-bottom: 4px solid transparent;\n border-right: 8px solid #999999;\n position: absolute;\n display: inline-block;\n top: calc(50% - 4px);\n left: 2px;\n }\n\n .ez-ptz-container .ez-ptz-icon.left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.top-left.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n left: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.left-bottom.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n bottom: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.bottom-right.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top {\n width: 4px;\n height: 4px;\n border-radius: 50%;\n position: absolute;\n display: inline-block;\n top: calc(25% - 4px);\n right: 16px;\n background: #999999;\n }\n\n .ez-ptz-container .ez-ptz-icon.right-top.active {\n border-right-color: #407AFF;\n }\n\n .ez-ptz-container .ez-ptz-main.center {\n width: 23px;\n height: 23px;\n background: #407AFF;\n border-radius: 100%;\n top: calc(50% - 12.4px);\n left: calc(50% - 12.4px);\n position: absolute;\n }\n\n .ez-ptz-wrap {\n position: absolute;\n right: 0px;\n top: 0;\n width: 85px;\n height: 100%;\n padding: 0 20px;\n flex-direction: column;\n justify-content: center;\n background: rgba(0,0,0,0.9);\n box-sizing: content-box !important;\n }\n\n .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }\n\n .ez-ptzspeed-progress-line{\n height: 1px;\n background: #ffffff;\n margin: 16px 0 8px;\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-line-dot{\n width: 5px;\n height: 5px;\n border: 2px solid #ffffff;\n border-radius: 50%;\n background: #ffffff;\n margin: -3px 0;\n cursor: pointer;\n }\n\n .ez-ptzspeed-progress-line-dot.active{\n border-color: #407AFF;\n }\n\n .ez-ptzspeed-progress-points{\n display: flex;\n justify-content: space-between;\n }\n\n .ez-ptzspeed-progress-points-slow{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-mid{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzspeed-progress-points-fast{\n cursor: pointer;\n color: #ffffff;\n }\n\n .ez-ptzbtn-container{\n width: 100%;\n height:${_isMobile?"60px":"18px"};\n margin-top: 14px;\n display: ${_isMobile?"block":"flex"};\n }\n\n .ez-ptzbtn-focal,\n .ez-ptzbtn-zoom{\n width: ${_isMobile?"100%":"50%"};\n height: 20px;\n display: flex;\n border: 1px solid rgba(255,255,255,0.5);\n border-radius: 10px;\n padding-bottom: 0px;\n box-sizing: content-box;\n }\n\n .ez-ptzbtn-zoom-add,\n .ez-ptzbtn-zoom-sub,\n .ez-ptzbtn-focal-add,\n .ez-ptzbtn-focal-sub{\n width: ${_isMobile?"50%":"24px"};\n height: 20px;\n cursor: pointer;\n text-align: center;\n }\n\n .ez-ptzbtn-zoom{\n margin: ${_isMobile?"0 0 8px":"0 4px 0 0"};\n }\n\n .ez-ptzbtn-zoom-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n\n .ez-ptzbtn-focal-add{\n border-right: 1px solid rgba(255,255,255,0.5);\n }\n `,document.getElementsByTagName("head")[0].appendChild(Ptz._STYLE)}destroy(){}show(){document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`)&&(document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`).style="display: flex;box-sizing: content-box;"),this.showPtz=!0,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit(EVENTS.ptz.openPtz,{eventType:"openPtz",code:0,target:this,msg:"开启云台"})}hide(){document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`)&&(document.getElementById(`${this.jSPlugin.id}-ez-ptz-item`).style="display: none"),this.showPtz=!1,this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit(EVENTS.ptz.closePtz,{eventType:"closePtz",code:0,target:this,msg:"关闭云台"})}_handlePtzTouch(e,type){var _this_jSPlugin_eventEmitter,_this_jSPlugin;this._ptzQueue||(this._ptzQueue=Promise.resolve());var container=document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).getBoundingClientRect(),containerCenterX=container.left+41,containerCenterY=container.top+41,eventX=e.x||e.changedTouches[0].clientX,eventY=e.y||e.changedTouches[0].clientY,direction=0;let url=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",token=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,backDeg=0;function getAreaId(x,y){let rad=Math.atan2(y,x);rad<0&&(rad+=2*Math.PI);let deg=rad*(180/Math.PI)-225-12.5;return deg<0&&(deg+=360),Math.floor(deg/45)+1}const isRotate=/^rotate\(90/.test(document.getElementById(`${this.jSPlugin.id}-wrap`).style.transform),left=eventX-containerCenterX,top=eventY-containerCenterY;if(isRotate)switch(getAreaId(left,top)){case 1:direction=2,backDeg=90;break;case 2:direction=4,backDeg=135;break;case 3:direction=0,backDeg=180;break;case 4:direction=6,backDeg=225;break;case 5:direction=3,backDeg=270;break;case 6:direction=7,backDeg=315;break;case 7:direction=1,backDeg=0;break;case 8:direction=5,backDeg=45}else switch(getAreaId(left,top)){case 1:direction=0,backDeg=180;break;case 2:direction=6,backDeg=225;break;case 3:direction=3,backDeg=270;break;case 4:direction=7,backDeg=315;break;case 5:direction=1,backDeg=0;break;case 6:direction=5,backDeg=45;break;case 7:direction=2,backDeg=90;break;case 8:direction=4,backDeg=135}document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).style="start"===type?`background-image:linear-gradient(${backDeg}deg, #4277FF 0%, rgba(100,143,252,0.00) 30%)`:"","stop"===type&&(url=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",token=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video);var data=new FormData;data.append("deviceSerial",matchEzopenUrl(this.jSPlugin.url).deviceSerial),data.append("channelNo",matchEzopenUrl(this.jSPlugin.url).channelNo),data.append("speed",this.jSPlugin.ptzSpeed),data.append("direction",direction),data.append("accessToken",token),this._ptzQueue=this._ptzQueue.then((()=>fetch(url,{method:"POST",body:data}).then((response=>response.json())).then((rt=>{var _rt_result;const code=rt.code||(null==rt||null==(_rt_result=rt.result)?void 0:_rt_result.code);if("start"===type&&200!=code){var _this_pluginStatus,_this_jSPlugin,_this_jSPlugin_logger,_this_jSPlugin1;const msg=this.jSPlugin.i18n.t("38"+code)||rt.msg;null==(_this_pluginStatus=this.pluginStatus)||_this_pluginStatus.loadingSetText({text:msg,color:"red",delayClear:2e3}),null==(_this_jSPlugin1=this.jSPlugin)||null==(_this_jSPlugin_logger=_this_jSPlugin1.logger)||_this_jSPlugin_logger.error("[errors]",(null==(_this_jSPlugin=this.jSPlugin)?void 0:_this_jSPlugin.i18n.t("38"+code))+`(${code})`)}return[60002,60003,60004,60005,60006].indexOf(code)>-1&&(document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).style=`background-image:linear-gradient(${backDeg}deg, #f45656 0%, rgba(100,143,252,0.00) 30%)`),rt})).catch((err=>{})))),"stop"===type&&(this._ptzQueue=this._ptzQueue.finally((()=>{}))),null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_eventEmitter=_this_jSPlugin.eventEmitter)||_this_jSPlugin_eventEmitter.emit(EVENTS.ptz.ptzDirection,{areaId:getAreaId(left,top),direction:direction,backDeg:backDeg,isRotate:isRotate,ptzSpeed:this.jSPlugin.ptzSpeed,type:type})}_handleBtnTouch(btn,option,type){var _this_jSPlugin_logger,_this_jSPlugin,_this_jSPlugin_eventEmitter,_this_jSPlugin1;this._ptzOperation||(this._ptzOperation=Promise.resolve());let direction=8;direction="zoom"===btn?"add"===option?8:9:"add"===option?10:11;let url=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",token=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;"stop"===type&&(url=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",token=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video),null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_logger=_this_jSPlugin.logger)||_this_jSPlugin_logger.log("[Ptz]",btn,option,type),null==(_this_jSPlugin1=this.jSPlugin)||null==(_this_jSPlugin_eventEmitter=_this_jSPlugin1.eventEmitter)||_this_jSPlugin_eventEmitter.emit(EVENTS.ptz.ptzBtnClick,{btn:btn,option:option,type:type});const data=new FormData;data.append("deviceSerial",matchEzopenUrl(this.jSPlugin.url).deviceSerial),data.append("channelNo",matchEzopenUrl(this.jSPlugin.url).channelNo),data.append("speed",this.jSPlugin.ptzSpeed),data.append("direction",direction),data.append("accessToken",token),this._ptzOperation=this._ptzOperation.then((()=>fetch(url,{method:"POST",body:data}).then((response=>response.json())).then((rt=>{var _rt_result;const code=rt.code||(null==rt||null==(_rt_result=rt.result)?void 0:_rt_result.code);if("start"===type&&200!=code){var _this_jSPlugin_logger,_this_jSPlugin;const msg=6e4==code||60006==code?"zoom"===btn?this.jSPlugin.i18n.t("NOT_SUPPORT_DEVICE_ZOOM"):this.jSPlugin.i18n.t("NOT_SUPPORT_FOCUS"):rt.msg;this.pluginStatus.loadingSetText({text:msg,color:"red",delayClear:2e3}),null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_logger=_this_jSPlugin.logger)||_this_jSPlugin_logger.error("[errors]",msg)}return rt})).catch((err=>{})))),"stop"===type&&(this._ptzOperation=this._ptzOperation.finally((()=>{this._ptzOperation=null})))}constructor(jSPlugin){var _this_jSPlugin_logger;if(this.jSPlugin=jSPlugin,null==(_this_jSPlugin_logger=this.jSPlugin.logger)||_this_jSPlugin_logger.log("[Ptz]","init"),this.pluginStatus=this.jSPlugin.pluginStatus,this.showPtz=!1,document.getElementById(this.jSPlugin.id+"-ez-ptz-item"))return!1;const ptzWrap=document.createElement("div");ptzWrap.id=this.jSPlugin.id+"-ez-ptz-item",ptzWrap.className="ez-ptz-wrap",ptzWrap.style="display:none;",Ptz._instanceStyle(),ptzWrap.innerHTML=`\n <div class="ez-ptz-container" id="${this.jSPlugin.id}-ez-ptz-container" style="position: relative;width: 80px;height: 80px;background: rgba(255, 255, 255, 0.80);box-shadow: 0px 0px 33px 4px rgba(0, 0, 0, 0.15);border: 1px solid rgba(255, 255, 255, 0.80);border-radius: 100%;cursor: pointer;overflow: hidden;user-select: none;">\n <div class="ez-ptz-main center"></div>\n <div class="ez-ptz-icon top"></div>\n <div class="ez-ptz-icon top-left"></div>\n <div class="ez-ptz-icon left"></div>\n <div class="ez-ptz-icon left-bottom"></div>\n <div class="ez-ptz-icon bottom"></div>\n <div class="ez-ptz-icon bottom-right"></div>\n <div class="ez-ptz-icon right"></div>\n <div class="ez-ptz-icon right-top"></div>\n </div>\n <div class="ez-ptzspeed-container" id="${this.jSPlugin.id}-ez-ptzspeed-container" style="user-select: none;">\n <div class="ez-ptzspeed-progress" title="${this.jSPlugin.i18n.t("PTZ_SPEED")}">\n <div class="ez-ptzspeed-progress-line">\n <div class="ez-ptzspeed-progress-line-dot" id="${this.jSPlugin.id}-ptzspeed-slow-dot"></div>\n <div class="ez-ptzspeed-progress-line-dot active" id="${this.jSPlugin.id}-ptzspeed-mid-dot"></div>\n <div class="ez-ptzspeed-progress-line-dot" id="${this.jSPlugin.id}-ptzspeed-fast-dot"></div>\n </div>\n <div class="ez-ptzspeed-progress-points">\n <div class="ez-ptzspeed-progress-points-slow" id="${this.jSPlugin.id}-ptzspeed-slow">\n ${this.jSPlugin.i18n.t("PTZ_SLOW")}\n </div>\n <div class="ez-ptzspeed-progress-points-mid" id="${this.jSPlugin.id}-ptzspeed-mid">\n ${this.jSPlugin.i18n.t("PTZ_MID")}\n </div>\n <div class="ez-ptzspeed-progress-points-fast" id="${this.jSPlugin.id}-ptzspeed-fast">\n ${this.jSPlugin.i18n.t("PTZ_FAST")}\n </div>\n </div>\n </div>\n </div>\n <div class="ez-ptzbtn-container">\n <div class="ez-ptzbtn-zoom" title="${this.jSPlugin.i18n.t("DEVICE_ZOOM")}" style="user-select: none;">\n <div class="ez-ptzbtn-zoom-add" id="${this.jSPlugin.id}-ez-ptzbtn-zoom-add" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705043060101" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M563.2 198.4c179.2 0 326.4 147.2 326.4 326.4s-147.2 326.4-326.4 326.4S230.4 704 230.4 524.8s147.2-326.4 332.8-326.4z m0 64c-147.2 0-262.4 115.2-262.4 262.4s115.2 262.4 262.4 262.4 262.4-115.2 262.4-262.4S704 262.4 563.2 262.4z" p-id="8153" fill="#ffffff"></path><path d="M691.2 556.8H428.8c-19.2 0-32-12.8-32-32s12.8-32 32-32h262.4c19.2 0 32 12.8 32 32s-12.8 32-32 32z" p-id="8154" fill="#ffffff"></path><path d="M556.8 691.2c-19.2 0-32-12.8-32-32V396.8c0-19.2 12.8-32 32-32s32 12.8 32 32v262.4c0 19.2-12.8 32-32 32z" p-id="8155" fill="#ffffff"></path></svg>\n </div>\n <div class="ez-ptzbtn-zoom-sub" id="${this.jSPlugin.id}-ez-ptzbtn-zoom-sub" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705043081103" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8395" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M569.6 838.4c-172.8 0-307.2-140.8-307.2-307.2s140.8-307.2 307.2-307.2 307.2 140.8 307.2 307.2-140.8 307.2-307.2 307.2z m0-64c134.4 0 249.6-108.8 249.6-249.6S704 281.6 569.6 281.6 320 396.8 320 531.2s108.8 243.2 249.6 243.2z" p-id="8396" fill="#ffffff"></path><path d="M691.2 563.2H448c-19.2 0-32-12.8-32-32s12.8-38.4 32-38.4h249.6c19.2 0 32 12.8 32 32s-19.2 38.4-38.4 38.4z" p-id="8397" fill="#ffffff"></path></svg>\n </div>\n </div>\n <div class="ez-ptzbtn-focal" title="${this.jSPlugin.i18n.t("DEVICE_FOCUS")}" style="user-select: none;">\n <div class="ez-ptzbtn-focal-add" id="${this.jSPlugin.id}-ez-ptzbtn-focal-add" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705048602135" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5018" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M646.4 825.6H320c-44.8 0-83.2-38.4-83.2-83.2V409.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6zM320 390.4c-12.8 0-19.2 6.4-19.2 19.2v326.4c0 12.8 6.4 19.2 19.2 19.2h326.4c12.8 0 19.2-6.4 19.2-19.2V409.6c0-12.8-6.4-19.2-19.2-19.2H320z" p-id="5019" fill="#ffffff"></path><path d="M396.8 358.4V281.6c0-25.6 25.6-51.2 51.2-51.2h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H704l-6.4-268.8" p-id="5020" fill="#ffffff"></path></svg>\n </div>\n <div class="ez-ptzbtn-focal-sub" id="${this.jSPlugin.id}-ez-ptzbtn-focal-sub" style="user-select: none;">\n <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705048615893" class="icon" viewBox="0 0 1088 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5352" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><path d="M320 358.4h326.4c25.6 0 51.2 25.6 51.2 51.2v326.4c0 25.6-25.6 51.2-51.2 51.2H320c-25.6 0-51.2-25.6-51.2-51.2V409.6c0-25.6 25.6-51.2 51.2-51.2z" p-id="5353" fill="#ffffff"></path><path d="M774.4 697.6H704c-19.2 0-32-12.8-32-32s12.8-32 32-32h70.4c12.8 0 19.2-6.4 19.2-19.2V281.6c0-12.8-6.4-19.2-19.2-19.2H448c-12.8 0-19.2 6.4-19.2 19.2v70.4c0 19.2-12.8 32-32 32s-32-12.8-32-25.6V281.6c0-44.8 38.4-83.2 83.2-83.2h326.4c44.8 0 83.2 38.4 83.2 83.2v326.4c0 51.2-38.4 89.6-83.2 89.6z" p-id="5354" fill="#ffffff"></path></svg>\n </div>\n </div>\n </div>\n `,document.getElementById(`${jSPlugin.id}-wrap`).appendChild(ptzWrap),document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"start")},document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"start")},document.getElementById(`${this.jSPlugin.id}-ez-ptz-container`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handlePtzTouch(e,"stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzspeed-container`).onmouseup=e=>{var _this_jSPlugin;e.target.id&&(e.target.id.indexOf("slow")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("mid")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("fast")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.add("active")),null==(_this_jSPlugin=this.jSPlugin)||_this_jSPlugin.eventEmitter.emit(EVENTS.ptz.ptzSpeedChange,this.jSPlugin.ptzSpeed))},document.getElementById(`${this.jSPlugin.id}-ez-ptzspeed-container`).ontouchend=e=>{var _this_jSPlugin_eventEmitter,_this_jSPlugin;e.target.id&&(e.target.id.indexOf("slow")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.slow:1,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("mid")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.mid:3,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.add("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.remove("active")),e.target.id.indexOf("fast")>-1&&(this.jSPlugin.ptzSpeed=this.jSPlugin.ptzSpeedOptions?this.jSPlugin.ptzSpeedOptions.fast:7,document.getElementById(`${this.jSPlugin.id}-ptzspeed-slow-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-mid-dot`).classList.remove("active"),document.getElementById(`${this.jSPlugin.id}-ptzspeed-fast-dot`).classList.add("active")),null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_eventEmitter=_this_jSPlugin.eventEmitter)||_this_jSPlugin_eventEmitter.emit(EVENTS.ptz.ptzSpeedChange,this.jSPlugin.ptzSpeed))},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).onmousedown=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).onmouseup=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-add`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-zoom-sub`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("zoom","sub","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-add`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","add","stop")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).ontouchstart=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","start")},document.getElementById(`${this.jSPlugin.id}-ez-ptzbtn-focal-sub`).ontouchend=e=>{e.preventDefault(),e.stopPropagation(),this._handleBtnTouch("focal","sub","stop")}}}class PopupCustom{static _instanceStyle(){if(PopupCustom._STYLE)return;const ratioClient=document.documentElement.clientWidth/375||1;PopupCustom._STYLE=document.createElement("style"),PopupCustom._STYLE.innerHTML=`@keyframes slideContentUp {0% {bottom: -${366*ratioClient}px;}\n 25% {bottom: -${244*ratioClient}px;}\n 50% {bottom: -${122*ratioClient}px;}\n 100% {bottom:0;}} .open-popup{animation:slideContentUp 0.3s 1 linear; -webkit-animation: slideContentUp 0.3s 1 linear;}`,document.getElementsByTagName("head")[0].appendChild(PopupCustom._STYLE)}initPopupCustom(){document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom`)?document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom`).style.display="flex":this.randerPopup()}randerPopup(){const ratioClient=document.documentElement.clientWidth/375||1,wrapVideo=document.getElementById(`${this.jSPlugin.id}-wrap`);var objDOM=document.createElement("div");objDOM.style="display:flex;",objDOM.id=`${this.jSPlugin.id}-wrap-popup-custom`,objDOM.innerHTML=`<div id="${this.jSPlugin.id}-wrap-popup-custom-mask" style="height:100%;width:100%;position:fixed;top:0;left:0;z-index:9998;background-color: rgba(0,0,0,0.75);overflow:hidden;">\n </div>\n <div id="${this.jSPlugin.id}-wrap-popup-board" class="open-popup" style="bottom:0;height: ${this.heightPop*ratioClient}px;position:fixed;left: 0; width: 100%;background-color:#ffffff;z-index: 9999;border-radius: 16px 16px 0px 0px;">\n <div style="margin-top: ${20*ratioClient}px;padding: 0 ${15*ratioClient}px;width: 100%;display:flex;flex-direction: row;align-items: center;">\n <div id="${this.jSPlugin.id}-popup-board-close">\n <svg width="${24*ratioClient}px" height="${24*ratioClient}px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/close</title>\n <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="common/Close/Dark">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n </g>\n </g>\n </svg>\n </div>\n <div id="popup-board-title-content" style="width: ${180*ratioClient}px;font-size: ${18*ratioClient}px;margin-left: ${59*ratioClient}px;font-family: PingFangSC-Medium;color: #2C2C2C;font-weight: 500;text-align: center;"></div>\n </div>\n <div id="${this.jSPlugin.id}-popup-board-content" style="width:100%;padding: 0 ${15*ratioClient}px;height: ${(this.heightPop-48)*ratioClient}px;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;"></div>\n </div>\n `,wrapVideo.appendChild(objDOM),document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom-mask`).onclick=()=>{this.closePopupCustom()},document.getElementById(`${this.jSPlugin.id}-popup-board-close`).onclick=()=>{this.closePopupCustom()}}closePopupCustom(callBack=()=>{}){callBack();let domWrap=document.getElementById(`${this.jSPlugin.id}-wrap`),domPop=document.getElementById(`${this.jSPlugin.id}-wrap-popup-custom`);domWrap&&domPop&&domWrap.removeChild(domPop)}initPopupContent(title,dom){document.getElementById("popup-board-title-content").innerText=title||"",dom&&document.getElementById(`${this.jSPlugin.id}-popup-board-content`).appendChild(dom)}constructor(jSPlugin,heightPop){this.jSPlugin=jSPlugin,this.heightPop=heightPop||366,PopupCustom._instanceStyle(),this.initPopupCustom()}}var TimeLine=function(params){this.state={id:params.id,start:"00:00:00",end:"24:00:00",current:0,timelag:30,timeArr:[],availTimeLine:[],scrollTop:0,index:0,date:"",noTimeLineTxt:"",disabled:!1};var _this=this;this.setState=function(obj){Object.keys(obj).forEach((function(key){_this.state[key]=obj[key],"scrollTop"===key&&document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.scrollTo(0,obj[key]),"current"===key&&document.getElementById("time-line-current")&&(document.getElementById("time-line-current").innerHTML=obj[key])}))},this.setDisabled=function(value){this.setState({disabled:value}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.style.overflowY=value?"hidden":"scroll")},this.timeToSecond=function(time){const e=time.split(":");let h=Number(e[0]);const m=Number(e[1]),s=Number(e[2]);return 60*h*60+60*m+(s||0)},this.minuteToTime=function(minute){let hour=Math.floor(minute/60),m=minute%60;return(hour>9?hour:"0"+hour)+":"+(m>9?m:"0"+m)},this.timeToMinute=function(time){const e=time.split(":");return 60*Number(e[0])+Number(e[1])},this.getPlayParam=params.getPlayParam,this.checkIsAppleDevice=function(){var u=navigator.userAgent,ios=!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),iPad=u.indexOf("iPad")>-1,iPhone=u.indexOf("iPhone")>-1||u.indexOf("Mac")>-1;return!!(ios||iPad||iPhone)},this.checkIsHarmonyOS=function(){return navigator.userAgent.indexOf("ohos")>-1},this.checkIsHarmonyOS()?(document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchstart",(function(){if(_this.state.disabled)return!1;params.ontouchstart()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchmove",(function(){if(_this.state.disabled)return!1;params.ontouchmove()}),!1),document.getElementById("time-line-item")&&document.getElementById("time-line-item").parentNode.addEventListener("touchend",(function(){if(_this.state.disabled)return!1;var timer;new Promise((function(resolve,reject){let preTop=-1;timer=setInterval((()=>{var _document_getElementById_parentNode,_document_getElementById;let reactTop=null==(_document_getElementById=document.getElementById("time-line-item"))||null==(_document_getElementById_parentNode=_document_getElementById.parentNode)?void 0:_document_getElementById_parentNode.scrollTop;reactTop!==preTop?preTop=reactTop:(clearInterval(timer),resolve(reactTop))}),100)})).then((reactTop=>{_this.rectTopTotime(reactTop),_this.getPlayParam({current:_this.state.current})})),params.ontouchend()}),!1)):(document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchstart=function(){if(_this.state.disabled)return!1;params.ontouchstart()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchmove=function(){if(_this.state.disabled)return!1;params.ontouchmove()}),document.getElementById("time-line-item")&&(document.getElementById("time-line-item").parentNode.ontouchend=function(){if(_this.state.disabled)return!1;var timer;new Promise((function(resolve,reject){let preTop=-1;timer=setInterval((()=>{var _document_getElementById_parentNode,_document_getElementById;let reactTop=null==(_document_getElementById=document.getElementById("time-line-item"))||null==(_document_getElementById_parentNode=_document_getElementById.parentNode)?void 0:_document_getElementById_parentNode.scrollTop;reactTop!==preTop?preTop=reactTop:(clearInterval(timer),resolve(reactTop))}),100)})).then((reactTop=>{_this.rectTopTotime(reactTop),_this.getPlayParam({current:_this.state.current})})),params.ontouchend()})),this.matchTimeDot()};TimeLine.prototype.changeScale=function(value){this.setState({timelag:value}),this.matchTimeDot()},TimeLine.prototype.setDateLine=function(news,defaultIndex){if(news.length>0){void 0===defaultIndex&&(defaultIndex=news.length-1);const{current:current}=this.state;this.setState({availTimeLine:news,start:news[defaultIndex].st,end:news[defaultIndex].et,current:0===current?news[defaultIndex].st:current}),this.matchRecTimeDot(),this.primaryOffsetH()}else this.setState({availTimeLine:[]}),this.matchRecTimeDot()},TimeLine.prototype.matchTimeDot=function(){const{start:start,end:end,timelag:timelag,availTimeLine:availTimeLine}=this.state;var timeArr=[];let minute=this.timeToMinute(end);minute=Math.floor(minute/timelag)*timelag;for(let i=minute;i>=0;){let marginTop=0,marginBottom=0,recArr=[];i==minute&&(marginTop=70),0==i&&(marginBottom=230);let time=this.minuteToTime(i);timeArr.push({id:i,current:time,label:"a"+i,marginTop:marginTop,marginBottom:marginBottom,recArr:recArr}),i-=timelag}this.setState({timeArr:timeArr}),this.renderDateLine()},TimeLine.prototype.matchRecTimeDot=function(){const{start:start,end:end,timelag:timelag,availTimeLine:availTimeLine,timeArr:timeArr}=this.state;let len=availTimeLine.length;if(0===len)for(var j=0;j<timeArr.length;j++)timeArr[j].recArr=[];else{for(var k=0;k<timeArr.length;k++)timeArr[k].recArr=[];for(let i=0;i<len;i++){const temp=availTimeLine[i];let stminute,etminute,st=this.timeToSecond(temp.st),et=this.timeToSecond(temp.et),stAvailPercent=0,etAvailPercent=0;stminute=Math.floor(st/(60*timelag))*timelag,stAvailPercent=(st-60*stminute)/timelag,etminute=Math.floor(et/(60*timelag))*timelag,etAvailPercent=(et-60*etminute)/timelag;for(j=0;j<timeArr.length;j++)if(timeArr[j].id==stminute&&timeArr[j].id==etminute){var height=etAvailPercent-stAvailPercent,top=60-etAvailPercent;timeArr[j].recArr.push({height:height,top:top})}else timeArr[j].id==stminute?timeArr[j].recArr.push({height:60-stAvailPercent,top:0}):timeArr[j].id==etminute?timeArr[j].recArr.push({height:etAvailPercent,top:60-etAvailPercent}):timeArr[j].id>stminute&&timeArr[j].id<etminute&&timeArr[j].recArr.push({height:60,top:0})}}this.setState({timeArr:timeArr}),this.renderDateLine()},TimeLine.prototype.renderDateLine=function(){const{id:id,timeArr:timeArr}=this.state;var container=document.getElementById("time-line-item");container.innerHTML="",timeArr.forEach(((item,index)=>{var timeItemDOM=document.createElement("div");timeItemDOM.setAttribute("class","time-item"),timeItemDOM.style=`margin-top: ${item.marginTop}px; margin-bottom: ${item.marginBottom}px; border-right-color: ${item.borderColor};`,document.createElement("div").setAttribute("class","scale");var timeItemHtml='<div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale"></div><div class="scale" style="width:10px"></div>';item.recArr.forEach(((i,j)=>{timeItemHtml+=`<div class="item-unavail" style="height: ${i.height}px;background-color:#A8B9ED; top: ${i.top}px"></div>`})),timeItemHtml+=`<div id=${item.label} style="position: relative; top: 51px; left: 40%"> ${item.current}</div>`,timeItemDOM.innerHTML=timeItemHtml,container.appendChild(timeItemDOM)}))},TimeLine.prototype.primaryOffsetH=function(){const{start:start,timelag:timelag,timeArr:timeArr,current:current}=this.state,currentItem=timeArr[0].current,offsetS=this.timeToSecond(currentItem)-this.timeToSecond(0===current?start:current),offsetH=Math.ceil(offsetS/timelag)+60;this.setState({scrollTop:offsetH})},TimeLine.prototype.currentOffsetH=function(){const{current:current,timelag:timelag,timeArr:timeArr}=this.state,startItem=timeArr[0].current,offsetS=this.timeToSecond(startItem)-this.timeToSecond(current),offsetH=Math.ceil(offsetS/timelag)+60;this.setState({scrollTop:offsetH})},TimeLine.prototype.rectTopTotime=function(reactTop){let current,offsetSecond,{timelag:timelag}=this.state,index=Math.floor(reactTop/60),offsetH=reactTop-60*index;if(0==offsetH)current=this.state.timeArr[index-1].current,offsetSecond=0;else{const time=this.state.timeArr[index].current;let minute=this.timeToMinute(time);const offsetS=(60-offsetH)*timelag,offsetM=Math.floor(offsetS/60)+minute,second=60*Math.floor(offsetS/60);offsetSecond=Math.ceil(offsetS-second),current=this.minuteToTime(offsetM)}this.setState({current:current+":"+(offsetSecond>9?offsetSecond:"0"+offsetSecond),scrollTop:reactTop})},TimeLine.prototype.stepScrollTimeLine=function(time){this.setState({current:time}),this.currentOffsetH()},TimeLine.prototype.secondCountDown=function(time){const{current:current}=this.state,temp=current.split(":");let t=60*Number(temp[0])*60+60*Number(temp[1])+Number(temp[2])+1,h=Math.floor(t/3600),m=Math.floor((t-3600*h)/60),s=t-3600*h-60*m;this.setState({current:(h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)})};const MobileTimeLine=TimeLine;function format(now){10===(now+"").length&&(now*=1e3);var time=new Date(now),h=time.getHours(),m=time.getMinutes(),s=time.getSeconds();return(h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}Date.prototype.Format=function(fmt){var o={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var k in/(y+)/.test(fmt)&&(fmt=fmt.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),o)new RegExp("("+k+")").test(fmt)&&(fmt=fmt.replace(RegExp.$1,1==RegExp.$1.length?o[k]:("00"+o[k]).substr((""+o[k]).length)));return fmt};class MobileRec{static _instanceStyle(){MobileRec._STYLE||(MobileRec._STYLE=document.createElement("style"),MobileRec._STYLE.id="ezuikit-mobile-rec-style",MobileRec._STYLE.innerHTML='\n body{\n padding: 0;\n margin: 0;\n }\n .time-line-container {\n text-align: left;\n height: 300px;\n /* outline: 1px solid red; */\n /* background: gray; */\n position: relative;\n /* padding-top: 60px; */\n margin-top: 20px;\n }\n\n .time-line-container .time-line-item-container {\n display: inline-block;\n /* height: 400px; */\n width: 30%;\n /* background: indianred; */\n overflow-y: scroll;\n overflow-x: hidden;\n /* padding-top: 60px; */\n height: 300px;\n box-sizing: border-box;\n white-space: nowrap;\n position: relative;\n }\n\n .time-line-container .time-line-item-container::-webkit-scrollbar {\n width: 0px;\n /*滚动条宽度*/\n height: 0px;\n /*滚动条高度*/\n }\n\n .time-line-item .time-item {\n position: relative;\n box-sizing: border-box;\n height: 60px;\n font-size: 12px;\n color: rgb(150, 150, 150);\n border-right: 6px solid;\n border-right-color: #ddd;\n }\n\n .time-line-item .time-item .scale {\n width: 6px;\n height: 9px;\n border-bottom: 1px solid #ccc;\n float: right;\n clear: both;\n }\n\n .time-line-item .time-item .item-unavail {\n width: 6px;\n position: absolute;\n left: 100%;\n background-color: #ddd;\n }\n\n .time-line-container .current-time {\n position: absolute;\n left: 0;\n top: 40px;\n height: 29px;\n /* line-height: 58px; */\n border-bottom: 1px solid #648FFC;\n width: 60%;\n margin-left: 26%;\n }\n\n .time-line-container .current-time .current-time-bg {\n position: relative;\n top: 15px;\n width: 100px;\n height: 29px;\n line-height: 29px;\n left: -70px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .time-line-container .current-time .current-time-bg::before {\n content: \'\';\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 100%;\n background: #648FFC;\n top: 11px;\n position: absolute;\n right: 30px;\n }\n\n .date-switch-container {\n height: 40px;\n position: relative;\n text-align: center;\n margin: 20px 10px;\n }\n\n .date-switch-container .current-date {\n line-height: 40px;\n height: 22px;\n font-size: 16px;\n color: #2C2C2C;\n text-align: center;\n font-weight: bold;\n }\n\n .date-container {\n width: 40px;\n height: 40px;\n position: absolute;\n right: 0;\n top: 0;\n }\n\n .rec-type-container {\n display: flex;\n justify-content: space-between;\n }\n\n .rec-type-container .rec-type-text {\n padding: 0 15px;\n font-size: 12px;\n color: #2C2C2C;\n }\n\n .rec-type-container .rec-type-switch {\n padding: 0 20px;\n }\n\n .date-container input {\n position: absolute;\n opacity: 0;\n display: inline-block;\n width: 40px;\n height: 40px;\n z-index: 10;\n left: 0;\n }\n\n .date-container label {\n position: absolute;\n left: 0;\n top: 0;\n /* display: none; */\n z-index: 0;\n }\n\n .date-icon {\n display: inline-block;\n width: 40px;\n height: 40px;\n background: url(\'https://resource.eziot.com/group2/M00/00/6A/CtwQF2F6VieAQrU9AAABP-_Nsqo949.png\') no-repeat 100% 100%;\n }\n .select-container {\n padding: 10px;\n display: flex;\n justify-content: space-between;\n }\n\n .advice {\n height: 24px;\n width: 70px;\n display: flex;\n justify-content: space-between;\n line-height: 24px;\n background: #F8F8F8;\n border-radius: 8px;\n }\n\n .advice span {\n width: 40px;\n display: inline-block;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n\n }\n\n input[type="checkbox"]:checked+.advice span:last-child {\n box-shadow: 0px 2px 5px 0px rgb(23 45 101 / 20%);\n border-radius: 8px;\n text-align: center;\n }\n\n input[type="checkbox"]:not(:checked)+.advice span:first-child svg {\n fill: #648FFC !important;\n }\n\n input[type="checkbox"]:checked+.advice span:last-child svg {\n fill: #648FFC !important;\n }',document.getElementsByTagName("head")[0].appendChild(MobileRec._STYLE))}recInit(){this.createDom(),this.initTimeLine(),this.injectJsCss(this.jSPlugin),this.syncTimeLine(),this.bindEvent()}injectJsCss(jSPlugin){this.unInjectJsCss();const that=this,container=document.getElementById(`${jSPlugin.id}-wrap`);((filepath,callback)=>{try{if(document.querySelector(`link[href="${filepath}"]`))return}catch(error){}for(var headerLink=document.getElementsByTagName("head")[0].getElementsByTagName("link"),isReady=!1,i=0;i<headerLink.length;i++)headerLink[i].getAttribute("href")==filepath&&(isReady=!0);if(!isReady){var oJs=document.createElement("link");oJs.rel="stylesheet",oJs.type="text/css",oJs.href=filepath,oJs.onload=callback,document.getElementsByTagName("head")[0].appendChild(oJs)}})(`${jSPlugin.staticPath}/rec/datepicker.min.css`),addJs(`${jSPlugin.staticPath}/rec/jquery.min.js`,(jSPlugin=>{addJs(`${jSPlugin.staticPath}/rec/datepicker.js`,(jSPlugin=>{addJs(`${jSPlugin.staticPath}/rec/datepicker.${that.datepickerLang[jSPlugin.language]}.js`,(jSPlugin=>{let datepickerContainer=container.getElementsByClassName("datepicker-container")[0];!datepickerContainer&&$(`#${jSPlugin.id}-datepicker`).datepicker&&$(`#${jSPlugin.id}-datepicker`).datepicker({autoShow:!1,autoHide:!0,autoPick:!0,language:that.datepickerLang[jSPlugin.language],date:new Date(getQueryString("begin",jSPlugin.params.url).replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))||new Date,format:"yyyy-mm-dd",endDate:new Date,inline:!0,container:container}),datepickerContainer=container.getElementsByClassName("datepicker-container")[0],datepickerContainer&&(datepickerContainer.style.display="none",datepickerContainer.style.bottom="-314px",datepickerContainer.style.right="0px"),that.datepickerVisible=!1,$(`#${jSPlugin.id}-datepicker`).on("pick.datepicker",(e=>{let params={begin:new Date(e.date).Format("yyyyMMddhhmmss")};if(that.begin=e.date,that.end=new Date(e.date).Format("yyyy-MM-dd")+" 23:59:59",e.date>new Date||new Date(e.date).Format("yyyyMMdd")===new Date(document.getElementById(`${jSPlugin.id}-datepicker`).getAttribute("data-value")).Format("yyyyMMdd"))e.preventDefault();else{const newDate=new Date(e.date).Format("yyyy/MM/dd");document.getElementById(`${jSPlugin.id}-datepicker`)&&document.getElementById(`${jSPlugin.id}-datepicker`).setAttribute("data-value",newDate),that.date=newDate,jSPlugin.eventEmitter.emit(EVENTS.date.recStartTimeChange,{code:0,data:{time:newDate}}),jSPlugin.Theme.decoderState&&jSPlugin.Theme.decoderState.state&&(jSPlugin.Theme.decoderState.state.cloudRec?params={begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"cloud.rec"}:jSPlugin.Theme.decoderState.state.rec&&(params={begin:new Date(e.date).Format("yyyyMMddhhmmss"),type:"rec"}))}jSPlugin.changePlayUrl(params,(()=>{}),!1).then((()=>{setTimeout((()=>{const dateEle=document.getElementById("date");dateEle&&(dateEle.value=new Date(e.date).Format("yyyy-MM-dd"))}),0),that.jSPlugin.Theme.decoderState.state.sound&&that.jSPlugin.openSound(),that.syncTimeLine()})),that.changeRecSpeed(1),that.resetMobileZoomStatus(),datepickerContainer&&(datepickerContainer.style.display="none"),that.datepickerVisible=!1})),$(`#${jSPlugin.id}-datepicker`).off("click").on("click",(e=>{var _jSPlugin_eventEmitter1,_jSPlugin_eventEmitter;that.datepickerVisible?datepickerContainer&&(datepickerContainer.style.display="none",null==jSPlugin||null==(_jSPlugin_eventEmitter1=jSPlugin.eventEmitter)||_jSPlugin_eventEmitter1.emit(EVENTS.date.closeDatePanel)):datepickerContainer&&(datepickerContainer.style.display="inline",null==jSPlugin||null==(_jSPlugin_eventEmitter=jSPlugin.eventEmitter)||_jSPlugin_eventEmitter.emit(EVENTS.date.openDatePanel));that.datepickerVisible=!that.datepickerVisible})),document.getElementById("date-picker")&&document.getElementById("date-picker").addEventListener("focus",(function(e){e.target.blur()}))}),(()=>{}),jSPlugin)}),(()=>{}),jSPlugin)}),(()=>{}),jSPlugin)}createDom(){const mobileRecTitleWrap=document.createElement("div");mobileRecTitleWrap.id="date-switch-container-wrap",mobileRecTitleWrap.className="date-switch-container-wrap",mobileRecTitleWrap.style="",mobileRecTitleWrap.innerHTML=`\n <div class="date-switch-container">\n <div class="current-date" id="current-date">${this.jSPlugin.i18n.t("RECORD_TIPS")}</div>\n <div class="date-container">\n <label for="date" style="width: 40px;height: 40px;">\n <div class="date-icon"></div>\n </label>\n <div autocomplete="off" data-toggle="${this.jSPlugin.id}-datepicker" id="${this.jSPlugin.id}-datepicker" name="${this.jSPlugin.id}-datepicker" data-value="${this.date.replace(/\//g,"-")||(new Date).Format("yyyy-MM-dd")}" style="opacity:0;width:32px;height:34px;cursor:pointer;"> </div>\n </div>\n </div>\n `,insertAfter(mobileRecTitleWrap,document.getElementById(`${this.jSPlugin.id}-wrap`));const mobileRecSwitchWrap=document.createElement("div");mobileRecSwitchWrap.id="rec-type-container-wrap",mobileRecSwitchWrap.className="rec-type-container-wrap",mobileRecSwitchWrap.style="",mobileRecSwitchWrap.innerHTML=`\n <div class="rec-type-container">\n <div class="rec-type-text"><span id="recCount">${this.recList.length}</span>${this.jSPlugin.i18n.t("RECORDS")}</div>\n <div class="rec-type-switch">\n <label>\n <input type="checkbox" name="type" id="cloudType" value="1" hidden />\n <label for="cloudType" class="advice">\n <span>\n ${this.jSPlugin._isCloudRecord?'<svg width="20.000000" height="20.000000" viewBox="0 0 20 20" fill="#CCCCCC" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M14.87 7.7L16.96 6.71C17.64 6.39 18.45 6.69 18.76 7.38C18.85 7.56 18.89 7.76 18.89 7.96L18.89 12.03C18.89 12.79 18.28 13.4 17.53 13.4C17.31 13.4 17.08 13.35 16.88 13.24L14.87 12.13L14.87 7.7Z" fill="#648FFC" fill-opacity="1.000000" fill-rule="evenodd" />\n <path d="M14.87 7.7L16.96 6.71C17.64 6.39 18.45 6.69 18.76 7.38C18.85 7.56 18.89 7.76 18.89 7.96L18.89 12.03C18.89 12.79 18.28 13.4 17.53 13.4C17.31 13.4 17.08 13.35 16.88 13.24L14.87 12.13" stroke="#2C2C2C" stroke-opacity="0" stroke-width="1.250000" />\n <mask id="mask_1435_272" fill="white">\n <path d="M15.2407 6.22559C15.2407 5.08887 14.3291 4.16699 13.2046 4.16699L3.70264 4.16699C2.57812 4.16699 1.6665 5.08887 1.6665 6.22559L1.6665 13.7749C1.6665 14.9121 2.57812 15.8335 3.70264 15.8335L13.2046 15.8335C14.3291 15.8335 15.2407 14.9121 15.2407 13.7749L15.2407 6.22559ZM7.39282 7.53711C7.39282 7.19189 7.08911 6.91211 6.71411 6.91211L5.35669 6.91211L5.27759 6.91602C4.93994 6.95215 4.67798 7.21631 4.67798 7.53711C4.67798 7.88232 4.98193 8.16211 5.35669 8.16211L6.71411 8.16211L6.79321 8.15771C7.13086 8.12158 7.39282 7.85742 7.39282 7.53711Z" clip-rule="evenodd" fill="" fill-opacity="1.000000" fill-rule="evenodd" />\n </mask>\n <path d="M15.2407 6.22559C15.2407 5.08887 14.3291 4.16699 13.2046 4.16699L3.70264 4.16699C2.57812 4.16699 1.6665 5.08887 1.6665 6.22559L1.6665 13.7749C1.6665 14.9121 2.57812 15.8335 3.70264 15.8335L13.2046 15.8335C14.3291 15.8335 15.2407 14.9121 15.2407 13.7749L15.2407 6.22559ZM7.39282 7.53711C7.39282 7.19189 7.08911 6.91211 6.71411 6.91211L5.35669 6.91211L5.27759 6.91602C4.93994 6.95215 4.67798 7.21631 4.67798 7.53711C4.67798 7.88232 4.98193 8.16211 5.35669 8.16211L6.71411 8.16211L6.79321 8.15771C7.13086 8.12158 7.39282 7.85742 7.39282 7.53711Z" clip-rule="evenodd" fill="" fill-opacity="1.000000" fill-rule="evenodd" mask="url(#mask_1435_272)" />\n <path d="" fill="" fill-opacity="0.000000" fill-rule="nonzero" />\n </svg>':'<svg fill="#CCCCCC" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="2 0 20 20">\n <path d="M12.6,5c-2.3,0.1-4.3,1.4-5.3,3.3L7.2,8.6c-2.4,0.5-4.1,2.5-4.1,4.9c0,2.8,2.4,5,5.2,5h9.9\n c2.4,0,4.3-1.9,4.3-4.2l0-0.2c-0.1-2-1.6-3.5-3.5-3.9l-0.1,0l0-0.2c-0.4-2.8-3-5-6.1-5L12.6,5z"/>\n </svg>'}\n </span>\n <span>\n <svg fill="#CCCCCC" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="2 0 20 20">\n <path d="M14.3,4c0.6,0,1.2,0.2,1.7,0.7l0,0L18.3,7C18.7,7.4,19,8,19,8.6l0,0v9c0,1.3-1.1,2.3-2.4,2.3\n\tl0,0H8.4C7.1,20,6,19,6,17.7l0,0V6.3C6,5,7.1,4,8.4,4l0,0H14.3z M9.7,7.2C9.3,7.2,8.9,7.6,8.9,8l0,0v2.5l0,0.1\n\tc0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C10.4,7.5,10,7.2,9.7,7.2z M12.2,7.2c-0.4,0-0.8,0.3-0.8,0.8l0,0v2.5\n\tl0,0.1c0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C12.9,7.5,12.5,7.2,12.2,7.2z M14.7,7.2c-0.4,0-0.8,0.3-0.8,0.8l0,0\n\tv2.5l0,0.1c0,0.4,0.4,0.6,0.7,0.6c0.4,0,0.8-0.3,0.8-0.8l0,0V8l0-0.1C15.4,7.5,15,7.2,14.7,7.2z"/>\n </svg>\n </span>\n </label>\n </label>\n </div>\n </div>\n `,insertAfter(mobileRecSwitchWrap,mobileRecTitleWrap);const mobileRecWrap=document.createElement("div");mobileRecWrap.id="mobile-rec-wrap",mobileRecWrap.className="mobileRec-wrap",mobileRecWrap.style="",mobileRecWrap.innerHTML='\n <div class="time-line-container">\n <div class="current-time">\n <div class="current-time-bg" id="time-line-current">00:00:00</div>\n </div>\n <div class="time-line-item-container">\n <div class="time-line-item" id="time-line-item">\n </div>\n </div>\n </div>\n ',insertAfter(mobileRecWrap,mobileRecSwitchWrap)}initTimeLine(){var _this_jSPlugin_logger,_this_jSPlugin,_this_jSPlugin1;null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_logger=_this_jSPlugin.logger)||_this_jSPlugin_logger.log("[TimeLine] init"),this.TimeLineOBJ=new MobileTimeLine({id:"time-line-item",getPlayParam:data=>{const that=this;var st=data.current,date=new Date(this.date).Format("yyyyMMdd").substr(0,8)+(data.current?st.replace(/:/g,""):data.current.replace(/:/g,""));if("cloud.rec"===this.type||this.jSPlugin.useSeek&&this.jSPlugin.capacity&&"1"==this.jSPlugin.capacity.support_seek_playback){if(!this.isSeeking&&that.recList.length>0)if(new Date(`${this.date} ${data.current}`).valueOf()>=that.lastDate)this.jSPlugin.pluginStatus.loadingSetText({text:"seek回放未找到录像片段",color:"red",delayClear:2e3}),this.syncTimeLine();else{const{play:play}=this.jSPlugin.Theme.decoderState.state;play?this.unSyncTimeLine().then((()=>{this.isSeeking=!0,this.jSPlugin.pluginStatus.loadingStart(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),this.jSPlugin.pluginStatus.loadingSetText({text:this.jSPlugin.i18n.t("LOADING")}),this.jSPlugin.Theme.setDisabled(!0),this.jSPlugin.seek(date.substr(8,6),"235959").then((()=>{const timer=setInterval((()=>{this.jSPlugin.getOSDTime().then((OSDdate=>{new Date(1e3*OSDdate.data).Format("yyyyMMddhhmmss")>=date&&(this.isSeeking=!1,this.syncTimeLine(),clearInterval(timer),this.jSPlugin.pluginStatus.loadingStop(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.Theme.setDisabled(!1),this.jSPlugin.waterMark_JSPlugin&&that.jSPlugin.setWaterMarkFont(that.jSPlugin.waterMark_JSPlugin),that.jSPlugin.Theme.decoderState.state.sound&&that.jSPlugin.openSound())}))}),500)}))})):this.unSyncTimeLine().then((()=>{this.jSPlugin.pluginStatus.loadingStart(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),this.jSPlugin.pluginStatus.loadingSetText({text:this.jSPlugin.i18n.t("LOADING")}),this.jSPlugin.Theme.setDisabled(!0);let newUrl=this.jSPlugin.url;newUrl.indexOf("begin")>-1?newUrl=newUrl.replace(/(begin=)(\d+)/,(function(match,p1,p2){return p1+date})):newUrl+=`?begin=${date}`,this.jSPlugin.play({url:newUrl}).then((()=>{this.syncTimeLine(),this.jSPlugin.pluginStatus.loadingStop(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.Theme.setDisabled(!1),that.jSPlugin.waterMark_JSPlugin&&that.jSPlugin.setWaterMarkFont(that.jSPlugin.waterMark_JSPlugin)})).catch((err=>{}))}))}}else{const callback=()=>{setTimeout((()=>{this.disabled=!1}),this.seekFrequency)},localRecSeek=callback=>{this.disabled=!0,this.unSyncTimeLine().then((()=>{this.jSPlugin.pluginStatus.loadingStart(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!0}),this.jSPlugin.pluginStatus.loadingSetText({text:this.jSPlugin.i18n.t("LOADING")}),this.jSPlugin.Theme.setDisabled(!0);let newUrl=this.jSPlugin.url;newUrl.indexOf("begin")>-1?newUrl=newUrl.replace(/(begin=)(\d+)/,(function(match,p1,p2){return p1+date})):newUrl+=`?begin=${date}`,this.jSPlugin.play({url:newUrl,unSaveUrl:!0,showPoster:!0}).then((()=>{callback&&callback(),this.syncTimeLine(),this.jSPlugin.pluginStatus.loadingStop(this.jSPlugin.id),this.jSPlugin.pluginStatus.setPlayStatus({loading:!1}),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.Theme.setDisabled(!1),that.jSPlugin.waterMark_JSPlugin&&that.jSPlugin.setWaterMarkFont(that.jSPlugin.waterMark_JSPlugin),this.jSPlugin.Theme.decoderState.state.sound&&this.jSPlugin.openSound()})).catch((err=>{}))})),this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state&&this.jSPlugin.Theme.decoderState.state.zoom&&(this.jSPlugin.Theme.setDecoderState({zoom:!1}),this.jSPlugin.Zoom.stopZoom())};this.disabled?(this.seekTimer&&clearTimeout(this.seekTimer),this.seekTimer=setTimeout((()=>{localRecSeek(callback)}),this.seekFrequency)):localRecSeek(callback)}},ontouchstart:()=>{this.operating=!0,this.unSyncTimeLine()},ontouchmove:()=>{0==this.operating&&(this.operating=!0,this.unSyncTimeLine())},ontouchend:()=>{this.operating=!1}}),this.TimeLineOBJ.setDateLine(this.recList),null==(_this_jSPlugin1=this.jSPlugin)||_this_jSPlugin1.eventEmitter.on(EVENTS.setAllDayRecTimes,(res=>{if(Array.isArray(res.list)){const len=res.list.length;document.getElementById("recCount")&&(document.getElementById("recCount").innerHTML=len);let availArr=[];for(let i=len-1;i>=0;i--){let item=res.list[i],et=format(item.endTime),st=format(item.startTime);availArr.push({st:st,et:et})}this.TimeLineOBJ.setDateLine(availArr),res.list.length>0&&(this.recList=availArr,this.lastDate=1e3*res.list[res.list.length-1].endTime)}}))}unInjectJsCss(){p.listInstances().length<=1&&((filepath=>{for(var headerLink=document.getElementsByTagName("head")[0].getElementsByTagName("link"),i=0;i<headerLink.length;i++)if(headerLink[i].getAttribute("href")==filepath)return void document.getElementsByTagName("head")[0].removeChild(headerLink[i])})(`${this.jSPlugin.staticPath}/rec/datepicker.min.css`),removeJs(`${this.jSPlugin.staticPath}/rec/jquery.min.js`),removeJs(`${this.jSPlugin.staticPath}/rec/datepicker.js`),removeJs(`${this.jSPlugin.staticPath}/rec/datepicker.${this.datepickerLang[this.jSPlugin.language]}.js`))}destroy(){var _this_jSPlugin_logger,_this_jSPlugin;null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_logger=_this_jSPlugin.logger)||_this_jSPlugin_logger.log("[MobileRec] destroy"),this.unInjectJsCss()}syncTimeLine(){this.jSPlugin.recTimer&&clearInterval(this.jSPlugin.recTimer),window.recTimer?Array.isArray(window.recTimer[this.jSPlugin.id])&&window.recTimer[this.jSPlugin.id].map((item=>{clearInterval(item)})):window.recTimer={},window.recTimer[this.jSPlugin.id]=[];const that=this;this.TimeLineOBJ&&(this.jSPlugin.recTimer=setInterval((()=>{if(this.operating)return!1;this.jSPlugin.getOSDTime().then((res=>{res.data>0&&that.TimeLineOBJ.stepScrollTimeLine(function(now){var time=new Date(now),h=time.getHours(),m=time.getMinutes(),s=time.getSeconds();return(h>9?h:"0"+h)+":"+(m>9?m:"0"+m)+":"+(s>9?s:"0"+s)}(1e3*res.data))})).catch((err=>{}))}),500),window.recTimer[this.jSPlugin.id].push(this.jSPlugin.recTimer))}unSyncTimeLine(){const that=this;return new Promise((function(resolve,reject){that.jSPlugin.recTimer&&(clearInterval(that.jSPlugin.recTimer),that.jSPlugin.recTimer=null),window.recTimer?Array.isArray(window.recTimer[that.jSPlugin.id])&&(window.recTimer[that.jSPlugin.id].map((item=>{clearInterval(item)})),window.recTimer[that.jSPlugin.id]=[]):window.recTimer={},resolve()}))}bindEvent(){document.getElementById("cloudType").checked="rec"===this.type,document.getElementById("cloudType").addEventListener("change",(e=>{var _this_jSPlugin;e.target.checked,this.type=e.target.checked?"rec":"cloud.rec",null==(_this_jSPlugin=this.jSPlugin)||_this_jSPlugin.eventEmitter.emit(EVENTS.recTypeChange,{code:0,data:{type:this.jSPlugin._isCloudRecord&&"cloud.rec"===this.type?"cloudRecord":"rec"===this.type?"local":"cloud"}}),this.jSPlugin.changePlayUrl({type:this.type,begin:`${new Date(this.date).Format("yyyyMMdd")}000000`},(()=>{this.jSPlugin._isCloudRecord&&this.jSPlugin.Theme.changeTheme("mobileRec")})).then((()=>{this.syncTimeLine(),this.changeRecSpeed(1),this.resetMobileZoomStatus(),this.jSPlugin.Theme.decoderState.state.sound&&this.jSPlugin.openSound()})).catch((err=>{}))}))}constructor(jSPlugin,changeRecSpeed,resetMobileZoomStatus){var _jSPlugin_logger;if(null==jSPlugin||null==(_jSPlugin_logger=jSPlugin.logger)||_jSPlugin_logger.log("[MobileRec] init"),this.changeRecSpeed=changeRecSpeed,this.resetMobileZoomStatus=resetMobileZoomStatus,this.isMobile=!0,this.jSPlugin=jSPlugin,this.date=(new Date).Format("yyyy-MM-dd"),this.begin=((new Date).Format("yyyy-MM-dd")+" 00:00:00").replace(/-/g,"/"),this.end=((new Date).Format("yyyy-MM-dd")+" 23:59:59").replace(/-/g,"/"),this.initBegin=null,this.initEnd=null,this.type=matchEzopenUrl(this.jSPlugin.url).type,this.operating=!1,this.seekTimer=null,this.disabled=!1,this.seekFrequency=2e3,this.recList=[],this.isSeeking=!1,this.datepickerLang={zh:"zh-CN",en:"en-US"},this.datepickerVisible=!1,this.jSPlugin.params&&this.jSPlugin.params.seekFrequency&&(this.seekFrequency=this.jSPlugin.params.seekFrequency),MobileRec._instanceStyle(),getQueryString("begin",this.jSPlugin.url)){var begin=getQueryString("begin",this.jSPlugin.url);this.date=begin.slice(0,4)+"/"+begin.slice(4,6)+"/"+begin.slice(6,8),this.begin=this.date+` ${begin.slice(8,10)||"00"}:${begin.slice(10,12)||"00"}:${begin.slice(12,14)||"00"}`,this.end=this.date+" 23:59:59",this.initBegin=this.begin}if(getQueryString("end",this.jSPlugin.url)){var end=getQueryString("end",this.jSPlugin.url);this.end=this.date+` ${end.slice(8,10)||"23"}:${end.slice(10,12)||"59"}:${end.slice(12,14)||"59"}`,this.initEnd=this.end}this.recInit()}}function asyncGeneratorStep$3(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function __destroy(){var fn;return fn=function*(player){var _player_i18n;const instance=p.getInstance(player.id);if(instance){const _state=instance.getState();_state.sound&&player.closeSound(),_state.talk&&player.stopTalk(),_state.recordvideo&&(yield player.stopSave())}var _player_jSPlugin_player_setStreamInfoCallBackType,_player_jSPlugin_player,_player_jSPlugin;if(player._$streamInfo&&(null==(_player_jSPlugin=player.jSPlugin)||null==(_player_jSPlugin_player=_player_jSPlugin.player)||null==(_player_jSPlugin_player_setStreamInfoCallBackType=_player_jSPlugin_player.setStreamInfoCallBackType)||_player_jSPlugin_player_setStreamInfoCallBackType.call(_player_jSPlugin_player,1),player._$streamInfo.remove(),player._$streamInfo=null,player.showStreamInfo=!1,player.streamInfo={}),player._recOSDTimer&&(clearInterval(player._recOSDTimer),player._recOSDTimer=null),player._seekIntervaltimer&&(clearInterval(player._seekIntervaltimer),player._seekIntervaltimer=null),player.Talk&&"function"==typeof player.Talk.destroy&&player.Talk.destroy(),player._services)try{player._services.destroy()}catch(error){}player._collect=null;var destroyRT=player.jSPlugin.JS_DestroyWorker(0);if(p&&player.id&&p.removeInstance(player.id),p&&0===p.listInstances().length){if(Ptz._STYLE){const $ptzStyle=document.getElementById(Ptz._STYLE.id);$ptzStyle&&document.getElementsByTagName("head")[0].removeChild($ptzStyle),Ptz._STYLE=null}if(PopupCustom._STYLE){const $popupCustomStyle=document.getElementById(PopupCustom._STYLE.id);$popupCustomStyle&&document.getElementsByTagName("head")[0].removeChild($popupCustomStyle),PopupCustom._STYLE=null}if(MobileRec._STYLE){const $mobileRecStyle=document.getElementById(MobileRec._STYLE.id);$mobileRecStyle&&document.getElementsByTagName("head")[0].removeChild($mobileRecStyle),MobileRec._STYLE=null}}return null==player.emit||player.emit.call(player,EVENTS.destroy,{eventType:EVENTS.destroy,code:0,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("DESTROY")}),player.videoInfo=null,player.audioInfo=null,player.jSPlugin=null,player.eventEmitter&&(player.eventEmitter.removeAllListeners(),player.eventEmitter=null),destroyRT},__destroy=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$3(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$3(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},__destroy.apply(this,arguments)}const ignoreList=[EVENTS.getOSDTime,EVENTS.streamInfoCB,EVENTS.http.getCloudRecordTimes,EVENTS.http.getLocalRecTimes,EVENTS.http.getCloudRecTimes,EVENTS.setAllDayRecTimes,EVENTS.setRecTimes,EVENTS.talkVolumeChange];function __eventsLogger(player,events=EVENTS){Object.keys(events).forEach((key=>{"object"!=typeof events[key]?null==player||player.on(events[key],(value=>{var _player_logger;if(!ignoreList.includes(key))if("object"==typeof value&&"[object Object]"===Object.prototype.toString.call(value)||Array.isArray(value)){delete value.target;try{var _player_logger1;null==(_player_logger1=player.logger)||_player_logger1.log("[events]",events[key],JSON.stringify(value))}catch(error){}}else null==(_player_logger=player.logger)||_player_logger.log("[events]",events[key],value)})):__eventsLogger(player,events[key])}))}function asyncGeneratorStep$2(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$2(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$2(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$2(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _extends$3(){return _extends$3=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$3.apply(this,arguments)}function asyncGeneratorStep$1(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator$1(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep$1(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep$1(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))}}function _extends$2(){return _extends$2=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$2.apply(this,arguments)}let preInitParams=null;class EZUIKitPlayer extends Theme{static preInit(params){const sdkType=void 0!==params.sdkType?params.sdkType:"base";return new Promise(((resolve,reject)=>{var _params_extraParams,_urlInfo_searchParams;preInitParams={params:params};const urlInfo=parseEzopenUrl(params.url);let obj={},paramstring="";const _services=new Services({sdkType:sdkType,baseURL:params.env?params.env.domain:DOMAIN,accessToken:params.accessToken,deviceSerial:urlInfo.deviceSerial,channelNo:urlInfo.channelNo,token:params.token||{},ezopenParams:(null==(_params_extraParams=params.extraParams)?void 0:_params_extraParams.ezopenParams)||{},timeZone:null==(_urlInfo_searchParams=urlInfo.searchParams)?void 0:_urlInfo_searchParams.timeZone}),promiseList=[_services.getEzopenUrl(params.url),_services.getDeviceSupportQuality(params),_services.getDeviceList(params)];if(params.url.indexOf(".rec")>-1){var _urlInfo_searchParams1;if("rec"===urlInfo.type)obj=formatPlaybackBeginEndTimeZone(urlInfo.searchParams.begin,urlInfo.searchParams.end,null==(_urlInfo_searchParams1=urlInfo.searchParams)?void 0:_urlInfo_searchParams1.timeZone,urlInfo.searchParams.busType),preInitParams.timeZone=obj.timeZone,paramstring="&begin="+DateTime.formate(obj.originBegin,"YYYYMMDDThhmmssZ")+"&end="+DateTime.formate(obj.originEnd,"YYYYMMDDThhmmssZ")+"&timeZone="+obj.timeZone;params.isCloudRec&&-1!==params.url.indexOf(".cloud")&&"7"===urlInfo.searchParams.busType?promiseList.push(_services.getCloudRecordTimes({begin:obj.begin,end:obj.end,spaceId:urlInfo.searchParams.spaceId})):-1!==params.url.indexOf(".cloud")&&"7"!==urlInfo.searchParams.busType||"base"!==sdkType?promiseList.push(_services.getCloudTimes({begin:obj.begin,end:obj.end,url:params.url})):promiseList.push(_services.getLocalRecTimes({begin:obj.begin,end:obj.end}))}Promise.all(promiseList).then((res=>{void 0!==res[0].code&&200!=res[0].code&&reject(res[0]),preInitParams.getEzopenUrlRes=res[0],preInitParams.getDeviceSupportQualityRes=res[1],preInitParams.getDeviceListRes=res[2];const list=res[3];if(params.url.indexOf(".rec")>-1&&list)if(params.isCloudRec&&-1!==params.url.indexOf(".cloud")&&"7"===urlInfo.searchParams.busType){if(preInitParams.cloudRecordRecList=list||[],list.length){const playbackSlices1=mergeRecSliceByDownloadPath(list,["downloadPath","ownerId","iStorageVersion","spaceId","startTime","endTime","videoType","busType"],obj.originBegin,obj.originEnd);0===playbackSlices1.length&&(preInitParams.getRecTimesRes="",resolve(preInitParams));const recSliceArrJSON=JSON.stringify(playbackSlices1).replace("\\","");preInitParams.getRecTimesRes=paramstring+"&recSlice="+recSliceArrJSON.replace("\\","")+"&r="+Math.random(),resolve(preInitParams)}else preInitParams.getRecTimesRes="",resolve(preInitParams);const recSliceArrJSON=JSON.stringify(playbackSlices).replace("\\","");preInitParams.getRecTimesRes=paramstring+"&recSlice="+recSliceArrJSON.replace("\\","")+"&r="+Math.random(),resolve(preInitParams)}else preInitParams.getRecTimesRes="",resolve(preInitParams);else if(-1!==params.url.indexOf(".cloud")&&"7"!==urlInfo.searchParams.busType||"base"!==sdkType)if(preInitParams.cloudRecList=list||[],list.length){0===mergeRecSliceByDownloadPath(list,["downloadPath","ownerId","iStorageVersion","startTime","endTime","videoType"],obj.originBegin,obj.originEnd).length&&(preInitParams.getRecTimesRes="",resolve(preInitParams))}else-1!==params.url.indexOf(".rec")?(preInitParams.localRecList=list||[],preInitParams.getRecTimesRes=paramstring,resolve(preInitParams)):resolve(preInitParams);else resolve(preInitParams)})).catch((error=>{reject(error)}))}))}_init(){this.logger.log("_init()");const that=this;this.videoInitTime=Date.now(),this.videoPlayState=1;let tmpParams=Object.assign({},this.params);const getWsTimeStart=Date.now();Promise.all([this._initGetDeviceSupportQuality(),this._initEZUIKitPlayer(this.params),this._getRealUrlServices(this.params.url)]).then((res=>{if(res[2]&&this.autoplay){var _this__collect;const websocketConnectUrl=res[2].split("?")[0].replace("/live","").replace("/playback","");null==(_this__collect=this._collect)||_this__collect.report(1,{logInfo:{domain:websocketConnectUrl,params:tmpParams,preInit:null!==preInitParams}}),_pluginPlay(this,res[2],0,getWsTimeStart).then((res=>{var _this_options_volumeOptions,_this_options;0===res.code&&(this.options.muted||(null==(_this_options=this.options)||null==(_this_options_volumeOptions=_this_options.volumeOptions)?void 0:_this_options_volumeOptions.muted)||setTimeout((()=>{this.openSound()}),100));(null==preInitParams?void 0:preInitParams.cloudRecordRecList)?null==this.emit||this.emit.call(this,EVENTS.setAllDayRecTimes,{type:"cloudRecordTimes",list:preInitParams.cloudRecordRecList}):(null==preInitParams?void 0:preInitParams.cloudRecList)?null==this.emit||this.emit.call(this,EVENTS.setAllDayRecTimes,{type:"cloudRecTimes",list:preInitParams.cloudRecList}):(null==preInitParams?void 0:preInitParams.localRecList)&&(null==this.emit||this.emit.call(this,EVENTS.setAllDayRecTimes,{type:"localTimes",list:preInitParams.localRecList}))})).catch((err=>{var _this_logger,_this_i18n_t,_this_i18n;if(this.playing=!1,1===this.videoPlayState||4===this.videoPlayState){var _this__collect;this.videoPlayState=3;const now=Date.now();null==(_this__collect=this._collect)||_this__collect.report(3,{logInfo:{domain:websocketConnectUrl,loadTime:now-this.videoInitTime,err:err},errorCode:errorCodeTransform(err),loadTime:now-this.videoInitTime})}this.isInspect||this.emit("message",err&&err.msg||(null==(_this_i18n=this.i18n)||null==(_this_i18n_t=_this_i18n.t)?void 0:_this_i18n_t.call(_this_i18n,"GET_PLAYURL_FAILED")),"fetchError");null==(_this_logger=this.logger)||_this_logger.error(err)}))}})).catch((err=>{var _this_logger,_this_i18n_t,_this_i18n;if(this.playing=!1,1===that.videoPlayState||4===that.videoPlayState){var _that__collect;that.videoPlayState=3;const now=Date.now();null==(_that__collect=that._collect)||_that__collect.report(3,{logInfo:{loadTime:now-that.videoInitTime,err:err},errorCode:errorCodeTransform(err),loadTime:now-that.videoInitTime})}that.isInspect||this.emit("message",err&&err.msg||(null==(_this_i18n=this.i18n)||null==(_this_i18n_t=_this_i18n.t)?void 0:_this_i18n_t.call(_this_i18n,"GET_PLAYURL_FAILED")),"fetchError");null==(_this_logger=this.logger)||_this_logger.error(err)})).finally((()=>{this.playing&&this._deviceSerialChangeServices(),setTimeout((()=>{preInitParams=null}),5e3),that._initTime=(new Date).getTime()-that.videoInitTime})),p.createInstance(this.id,{rejection:!1,play:!1,pantile:!1,recordvideo:!1,talk:!1,expend:!1,webExpend:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}),this.initSuccessTime=(new Date).getTime(),this.Talk=new v({deviceSerial:this.urlInfo.deviceSerial,accessToken:this.params.accessToken,capacity:this.capacity,channelNo:this.params.talkChannelNo||"0",env:this.env}),this.Talk&&this.Talk.eventEmitter.on("handleTalkError",(data=>{var _this_controls;this.logger.warn("talk error:",data),this.emit("talkingChange",!1),(null==data?void 0:data.message)&&"Permission denied"===data.message?this.emit("message",that.i18n.t("TALK_PERMISSION_DENIED"),"talkError"):this.emit("message",that.i18n.t("TALK_ERROR"),"talkError"),(null==(_this_controls=this.controls)?void 0:_this_controls.volumeControl)&&(this.controls.volumeControl.disabled=!1);try{this.Talk.stopTalk()}catch(error){}this.__talk_muted__&&(null==this.openSound||this.openSound.call(this)),this.__talk_muted__=!1,this._talking=!1;const globalState=p.getGlobalState(),instance=p.getInstance(this.id);globalState.talk&&p.setGlobalState({talk:!1}),instance.getState().talk&&instance.setState({talk:!1})}))}_initEZUIKitPlayer(params){var _this_logger;return null==(_this_logger=this.logger)||_this_logger.log("_initEZUIKitPlayer()"),function(player){var _player_logger,_player_jSPlugin_player,_player_jSPlugin_player1,_player_jSPlugin_player2;null==(_player_logger=player.logger)||_player_logger.log("initDecoder()"),player.emit(EVENTS.decoderLoad);const decoderType=player.url.includes("busType=7")?"v1":player.params.decoderType;player.jSPlugin=new JsPlugin({szId:player.params.id,container:player.contentControl.$video,width:player.width,height:player.height,szBasePath:"",staticPath:player.staticPath,downloadRecord:player.downloadRecord,env:player.env,decoderType:decoderType,decodeEngine:void 0!==player.params.decodeEngine?player.params.decodeEngine:1,autoPlay:!1,dpr:player.params.dpr,url:player.params.url,debugDownloadData:player.params.debugDownloadData,disableRenderPrivateData:player.disableRenderPrivateData,logger:{level:player.params.loggerOptions.level,showTime:!!player.params.loggerOptions.showTime},streamInfoCBType:player.params.streamInfoCBType});let RunTimeInfoFlag=!1,timer=0,lag=0;const that=player;return player.jSPlugin.EventCallback={openStreamCallback:()=>{player._openStreamTime=(new Date).getTime(),RunTimeInfoFlag=!1},getStreamHeaderCallback:()=>{RunTimeInfoFlag=!1},getVideoStreamCallback:()=>{player.getVideoStreamTime=(new Date).getTime(),player.isCall},firstFrameCallback:engine=>{switch(engine){case 0:player.decodeEngine="v3-soft";break;case 1:player.decodeEngine="v3-hard";break;case 2:player.decodeEngine="v1-soft"}try{const addressList=JSON.parse(window.localStorage.getItem("ezuikit_addressList")||"{}");Array.isArray(addressList[that.deviceSerial+"_"+that.channelNo])&&(player.maxReloadTime=addressList[that.deviceSerial+"_"+that.channelNo].length)}catch(error){}player.startPlayTime&&((new Date).valueOf(),player.startPlayTime=null);const frameInfo=player.jSPlugin._JSPlayM4_GetFrameInfo(0);frameInfo.frameRate&&(player.frameDecordTime=Math.round(1e3/frameInfo.frameRate).toFixed(2)),player.displayStreamInfo(player.showStreamInfo)},appearFirstFrameCallback:()=>{var _player_posterControl;player.appearFirstFrameTime=(new Date).getTime(),document.getElementById(`${player.id}-player`)&&(document.getElementById(`${player.id}-player`).style.display="block"),"function"==typeof player.params.handleFirstFrameDisplay&&player.params.handleFirstFrameDisplay({retcode:0,id:player.params.id,type:"handleFirstFrameDisplay"}),null==player||player.emit(EVENTS.firstFrameDisplay),"function"==typeof player.params.handleSuccess&&player.params.handleSuccess({retcode:0,id:player.id,type:"handleSuccess"}),player.recType&&(player._recOSDTimer&&(clearInterval(player._recOSDTimer),player._recOSDTimer=null),player._recOSDTimer=setInterval(_async_to_generator$2((function*(){null==player.getOSDTime||player.getOSDTime.call(player)})),1e3)),player.muted||player.openSound(),player.loading=!1,null==(_player_posterControl=player.posterControl)||_player_posterControl.hide()},averageStreamSuccessCallback:()=>{player.averageStreamSuccessTime=player.initSuccessTime-player._initTime+(player._gotWsUrlTime-player._startGetWsUrlTime)+(player.appearFirstFrameTime-player._openStreamTime)},loadEventHandler:function(){},pluginErrorHandler:(iWndIndex,iErrorCode,oError)=>{if(1003===iErrorCode);else if(1!=(null==oError?void 0:oError.errorCode)){var _player_reloadCodeBalckList;const errorCallback=()=>{const now=Date.now();if(1===player.videoPlayState||2===player.videoPlayState||4===player.videoPlayState){var _that__collect;const websocketConnectUrl=player.wsUrl.split("?")[0].replace("/live","").replace("/playback","");null==(_that__collect=that._collect)||_that__collect.report(3,{domain:websocketConnectUrl,logInfo:{err:oError,loadTime:now-player.videoInitTime},errorCode:errorCodeTransform(oError),loadTime:now-player.videoInitTime})}1===player.videoPlayState||4===player.videoPlayState?player.videoPlayState=3:2===player.videoPlayState&&(player.videoPlayState=5);let msg=player.i18n.t("DISCONNECT");msg=player.i18n.t("39"+oError.errorCode),player.Theme&&player.Theme.setDecoderState({play:!1}),player.isCall||player.isInspect||player.emit("message",msg,"socketError"),"function"==typeof player.params.handleError&&player.params.handleError({msg:msg,retcode:oError.errorCode,id:player.id,type:"handleError"})};(null==(_player_reloadCodeBalckList=player.reloadCodeBalckList)?void 0:_player_reloadCodeBalckList.indexOf(oError.errorCode))>-1&&"1004"!=oError.errorCode?errorCallback():player._reload(oError).catch((res=>{-3==res.code&&"1004"!=oError.errorCode&&errorCallback()}))}},setRunTimeInfoCallBack:({pstRuntimeInfo:pstRuntimeInfo})=>{if(5===pstRuntimeInfo.nErrorCode&&(that.isInspect||player.playing&&(that.emit("message",player.i18n.t("DEVICE_ENCRYPTED"),"validateCodeError"),player.stop())),!RunTimeInfoFlag&&9!==pstRuntimeInfo.nErrorCode&&1024!==pstRuntimeInfo.nErrorCode&&352321537!==pstRuntimeInfo.nErrorCode&&262144!==pstRuntimeInfo.nErrorCode){var _player_urlInfo_searchParams;removePlayerCanvas(player.id);const code=-1,param=pstRuntimeInfo,begin=(null==(_player_urlInfo_searchParams=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.begin)||DateTime.formate(new Date,"YYYYMMDD")+"000000",setHandleError=time=>{var _player_urlInfo_searchParams;const begin=null==(_player_urlInfo_searchParams=player.urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.begin;"function"==typeof player.params.handleError&&player.params.handleError({retcode:code,data:_extends$3({},param,{time:/\d{10}/.test(time)?DateTime.formate(time,"YYYYMMDDhhmmss"):begin||DateTime.formate(new Date,"YYYYMMDD")+"000000"}),id:that.params.id,type:"handleRunTimeInfoError"})};var _player__tempSeekTime;player._tempSeekTime?setHandleError(null==(_player__tempSeekTime=player._tempSeekTime)?void 0:_player__tempSeekTime.getTime()):player.getOSDTime().then((res=>{"rec"===player.urlInfo.type&&(player._seekDate=/\d{10}/.test((null==res?void 0:res.data)+"")?DateTime.strToDate(null==res?void 0:res.data):begin?DateTime.strToDate(begin):new Date(DateTime.formate(new Date,"YYYY-MM-DD")+" 00:00:00")),setHandleError(null==res?void 0:res.data)})),setTimeout((()=>{player.stop()}),1e3)}RunTimeInfoFlag=!0},setAdditionDataCallBack:function(labelMap){"function"==typeof player.params.handleAdditionData&&player.params.handleAdditionData({retcode:0,data:labelMap,id:player.id,type:"handleAdditionData"})},stutterDetectedCallback:res=>{if(5===res.type&&(player.streamInfo.codeRate=res.codeRate+"/Kbps",player._updateStreamInfo({codeRate:player.streamInfo.codeRate})),1===res.type&&(player.streamInfo.frameLostRate=(100*res.frameLossNum/res.frameNumInterval).toFixed(2)+"%",player._updateStreamInfo({frameLostRate:player.streamInfo.frameLostRate})),2===res.type){const time=(res.runtimeInfo||res.pstRuntimeInfo||{}).nAverageDecodeTime*res.account-player.frameDecordTime*res.account;if(time>0&&(time>=150&&time<250&&(lag+=10),time>=250&&time<400&&(lag+=20),time>=400&&time<650&&(lag+=30),time>=650&&(lag+=40)),timer===player.lagRateCycle){const lagRate=parseFloat((lag/player.lagRateCycle).toFixed(2));var _player_eventEmitter;if(player.streamInfo.lagRate=lagRate+"%",player._updateStreamInfo({lagRate:player.streamInfo.lagRate}),player.autoVideoLevel)if(lagRate>15)null==(_player_eventEmitter=player.eventEmitter)||_player_eventEmitter.emit(EVENTS.autoVideoLevel,{code:1,lagRate:lagRate});else if(lagRate>1.5&&lagRate<=15){var _player_eventEmitter1;null==(_player_eventEmitter1=player.eventEmitter)||_player_eventEmitter1.emit(EVENTS.autoVideoLevel,{code:0,lagRate:lagRate})}else{var _player_eventEmitter2;null==(_player_eventEmitter2=player.eventEmitter)||_player_eventEmitter2.emit(EVENTS.autoVideoLevel,{code:2,lagRate:lagRate})}timer=0,lag=0}else timer++}}},void 0!==player.params.handleTalkSuccess&&(player.handleTalkSuccess=player.params.handleTalkSuccess),void 0!==player.params.handleTalkError&&(player.handleTalkError=player.params.handleTalkError),null==(_player_jSPlugin_player=player.jSPlugin.player)||_player_jSPlugin_player.event.on(EVENTS.streamInfoCB,(info=>{var _player_eventEmitter;const updateInfo={videoFormat:(info.data.videoFormatName+"").indexOf("5")>-1?"H265":"H264",frameRate:info.data.frameRate+"FPS",systemFormat:4==info.data.systemFormat?"RTP":2==info.data.systemFormat?"PS":3==info.data.systemFormat?"TS":"other",resolution:getResolutionCategory(info.data.height)};player.streamInfo=_extends$3({},player.streamInfo,updateInfo),player._updateStreamInfo(updateInfo),null==(_player_eventEmitter=player.eventEmitter)||_player_eventEmitter.emit(EVENTS.streamInfoCB,info.data)})),null==(_player_jSPlugin_player1=player.jSPlugin.player)||_player_jSPlugin_player1.event.on(EVENTS.videoInfo,(info=>{null==player||player.emit(EVENTS.videoInfo,info.data),player.videoInfo=info.data})),null==(_player_jSPlugin_player2=player.jSPlugin.player)||_player_jSPlugin_player2.event.on(EVENTS.audioInfo,(info=>{null==player||player.emit(EVENTS.audioInfo,info.data),player.audioInfo=info.data})),new Promise((resolve=>{var _player_jSPlugin_player;null==(_player_jSPlugin_player=player.jSPlugin.player)||_player_jSPlugin_player.event.on("initializing",(res=>{var _res_data;"function"==typeof player.params.handleInitSuccess&&player.params.handleInitSuccess({retcode:0,id:player.params.id,type:"handleInitSuccess"}),"loaded"===(null==res||null==(_res_data=res.data)?void 0:_res_data.cmd)&&(null==player||player.emit(EVENTS.decoderLoaded),resolve())}))}))}(this)}_reload(error){const that=this;return new Promise((function(resolve,reject){try{let addressList=JSON.parse(localStorage.getItem("ezuikit_addressList"));const ADDRESS_KEY=that.deviceSerial+"_"+that.channelNo;if(Array.isArray(addressList[ADDRESS_KEY])&&addressList[ADDRESS_KEY].length>0){that.maxReloadTime-=1;let firstElement=addressList[ADDRESS_KEY].shift();if(addressList[ADDRESS_KEY].push(firstElement),localStorage.setItem("ezuikit_addressList",JSON.stringify(addressList)),that.maxReloadTime>0){var _that__collect,_addressList_ADDRESS_KEY,_addressList_ADDRESS_KEY1;const websocketConnectUrl=that.wsUrl.split("?")[0].replace("/live","").replace("/playback","");if(null==(_that__collect=that._collect)||_that__collect.report(6,{logInfo:{wsUrl:that.wsUrl,domain:websocketConnectUrl,error:errorCodeTransform(error)}}),!/^wss\:\/\//.test(that.wsUrl))return void reject({code:-4,msg:"地址不可用"});if((null==(_addressList_ADDRESS_KEY=addressList[ADDRESS_KEY])?void 0:_addressList_ADDRESS_KEY[0].domain)&&(null==(_addressList_ADDRESS_KEY1=addressList[ADDRESS_KEY])?void 0:_addressList_ADDRESS_KEY1[0].port)){const domainPort=that.wsUrl.split("?")[0];that.wsUrl=that.wsUrl.replace(domainPort,domainPort.replace(/(wss:\/\/)[^\/]+/,`$1${addressList[ADDRESS_KEY][0].domain}:${addressList[ADDRESS_KEY][0].port}`))}that.url.indexOf("rec")>-1&&that._seekDate&&(that.wsUrl=that.wsUrl.replace(/&begin=\d{8}T\d{6}Z/,"&begin="+that._seekDate.Format("yyyyMMddThhmmssZ")));const getWsTimeStart=Date.now();that.stop((()=>{}),!0).then((res=>{_pluginPlay(that,that.wsUrl,0,getWsTimeStart).then((res=>{if(0===res.code){var _addressList_,_that__collect;const wsUrl=(null==(_addressList_=addressList[that.deviceSerial+"_"+that.channelNo])?void 0:_addressList_[0].domain)||"",websocketConnectUrl=that.wsUrl.split("?")[0].replace("/live","").replace("/playback","");null==(_that__collect=that._collect)||_that__collect.report(7,{logInfo:{wsUrl:wsUrl,domain:websocketConnectUrl,reloadRes:{code:1,msg:"发起重试成功"}}});p.getInstance(that.id).getState().sound&&setTimeout((()=>{that.openSound()}),2e3),resolve({code:1,msg:"发起重试成功"})}}))})).catch((stopError=>{var _addressList_,_that__collect;const wsUrl=(null==(_addressList_=addressList[that.deviceSerial+"_"+that.channelNo])?void 0:_addressList_[0].domain)||"",websocketConnectUrl=wsUrl.split("?")[0].replace("/live","").replace("/playback","");null==(_that__collect=that._collect)||_that__collect.report(8,{logInfo:{wsUrl:wsUrl,domain:websocketConnectUrl,reloadRes:{code:-1,msg:"发起重试失败",stopError:stopError}}}),reject({code:-1,msg:"发起重试失败",stopError:stopError})}))}else{var _that__collect1;null==(_that__collect1=that._collect)||_that__collect1.report(8,{logInfo:{reloadRes:{code:-2,msg:"所有备用机房地址取流失败"}}}),reject({code:-2,msg:"所有备用机房地址取流失败"}),that.emit("message",that.i18n.t("PLAY_FAILED"),"reloadError")}}else{var _that__collect2;null==(_that__collect2=that._collect)||_that__collect2.report(8,{logInfo:{reloadRes:{code:-3,msg:"无可用的备用机房地址"}}}),reject({code:-3,msg:"无可用的备用机房地址"})}}catch(error){var _that__collect3;null==(_that__collect3=that._collect)||_that__collect3.report(8,{logInfo:{reloadRes:{code:-4,msg:"备用机房地址重试中断",error:error}}}),reject({code:-4,msg:"备用机房地址重试中断"})}}))}_getRealUrlServices(url){var _this=this;return _async_to_generator((function*(){var _this_logger_log,_this_logger;null==(_this_logger=_this.logger)||null==(_this_logger_log=_this_logger.log)||_this_logger_log.call(_this_logger,"_getRealUrlServices()");const that=_this;_this.urlInfo=parseEzopenUrl(url);const isCloudRec=-1!==url.indexOf(".cloud");return _this._startGetWsUrlTime=(new Date).getTime(),new Promise(((resolve,reject)=>{_this._beforeGetRealUrlServices(url).then((res=>{let wssUrl="";if(""!==res[0]&&"string"==typeof res[0])wssUrl=res[0],"rec"===_this.urlInfo.type&&(wssUrl=wssUrl.replace(/begin=\w+/gi,"").replace(/end=\w+/gi,"").replace(/timeZone=\w+/gi,""),wssUrl+=res[1]),wssUrl=wssUrl.replace(/&&/gi,"&"),isCloudRec&&""===res[1]&&("7"===_this.urlInfo.searchParams.busType?reject({retcode:"420004",msg:that.i18n.t("NO_CLOUD_RECORD")}):reject({retcode:"420003",msg:that.i18n.t("NO_RECORD")})),wssUrl.replace(/&&/gi,"&"),resolve(that._handleRealUrl(wssUrl));else{var _res_;const addressList=JSON.parse(localStorage.getItem("ezuikit_addressList")),address=addressList&&addressList[that.deviceSerial+"_"+that.channelNo]||[];address.length>0&&address[0].wsUrl&&!["10002","10001","10031"].includes(null==(_res_=res[0])?void 0:_res_.code)?resolve(address[0].wsUrl):(_this.messageControl.hide(),reject(_extends$2({},res[0],{type:"fail"})))}})).catch((error=>{}))}))}))()}_beforeGetRealUrlServices(url){if(preInitParams&&preInitParams.getEzopenUrlRes)return url.indexOf(".rec")>-1&&void 0!==preInitParams.getRecTimesRes?Promise.resolve([preInitParams.getEzopenUrlRes,preInitParams.getRecTimesRes]):Promise.resolve([preInitParams.getEzopenUrlRes]);"rec"===this.urlInfo.type&&"cloud"===this.urlInfo.recType&&url.indexOf("busType=7")>-1&&this._spaceId&&(url=/spaceId=\d*/.test(url)?url.replace(/spaceId=\d*/,`spaceId=${this._spaceId}`):(url+"&spaceId="+this._spaceId).replace("?&","?").replace("&&","&"));let promises=[this._services.getEzopenUrl(url)];return url.indexOf(".rec")>-1&&promises.push(function(player){return __getRecTimesService.apply(this,arguments)}(this)),Promise.all(promises)}_play(options){return function(player,options){return null==player.emit||player.emit.call(player,EVENTS.play),player._playStartTime=(new Date).getTime(),"string"==typeof options&&(options={url:options}),options&&!options.unSaveUrl&&("string"==typeof options.url&&(player.url=options.url),player.urlInfo=parseEzopenUrl(player.url),player.deviceSerial=player.urlInfo.deviceSerial,player.channelNo=player.urlInfo.channelNo),player.playing=!0,player.loading=!0,player._getRecType((null==options?void 0:options.url)||player.url),new Promise(((resolve,reject)=>{var _player_jSPlugin;player.isStoping=!0,null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_Stop("string"!=typeof options&&(null==options?void 0:options.showPoster)?options.showPoster:0).then((()=>{removePlayerCanvas(player.id),player.stopTime=Date.now();const getWsTimeStart=Date.now();player._getRealUrlServices("string"!=typeof options&&(null==options?void 0:options.url)?options.url:player.url,options&&"string"!=typeof options&&!!options.url).then((wssUrl=>{_pluginPlay(player,wssUrl,player.stopTime-player._playStartTime,getWsTimeStart).then((res=>{player.muted||setTimeout((()=>{player.openSound()}),500),resolve({code:0})})).catch((err=>{reject(err)}))})).catch((err=>{var _player_i18n,_player_params_handleError,_player_params;let msg=err.msg?err.msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("PLAY_FAILED");player.playing=!1,player.isCall||player.isInspect,null==(_player_params=player.params)||null==(_player_params_handleError=_player_params.handleError)||_player_params_handleError.call(_player_params,{code:err.oError?err.oError.errorCode:err.code||-1,msg:msg,id:player.params.id,type:"handleError"}),player.emit("message",msg,"playError"),reject({code:err.oError?err.oError.errorCode:err.code||-1,msg:msg,id:player.id,type:"handleError"})}))}))}))}(this,options)}stop(callBack=()=>{},flag){return function(player,callBack=()=>{},flag){var _player_jSPlugin;return player.playing=!1,player.autoVideoLevelResume=player.autoVideoLevel,null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.JS_Stop(flag).then((()=>{null==player.emit||player.emit.call(player,EVENTS.stop,{eventType:EVENTS.stop,code:0,msg:player.i18n.t("STOP_SUCCESS")}),callBack()}))}(this,callBack,flag)}pause(bool){return function(player,bool){return player.playing=!1,new Promise(((resolve,reject)=>{var _player_jSPlugin,_player_jSPlugin1;null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_CloseSound(0),null==(_player_jSPlugin1=player.jSPlugin)||_player_jSPlugin1.JS_Pause(0,bool).then((data=>{null==player.emit||player.emit.call(player,EVENTS.pause,{eventType:EVENTS.pause,code:0,msg:player.i18n.t("PAUSE")}),resolve()})).catch((err=>{null==player.emit||player.emit.call(player,EVENTS.pause,{eventType:EVENTS.pause,code:-1,msg:err||player.i18n.t("PAUSE_FAILED")}),reject(err)}))}))}(this,bool)}_resume(dateStr){return function(player,dateStr){return new Promise(((resolve,reject)=>{var _player_jSPlugin;if(player.validateCode&&""!=player.validateCode&&(null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_SetSecretKey(0,player.validateCode)),!_recAlreadyFirstPlayed)return player.play().then((()=>{resolve({})})).catch((err=>{reject(err)}));player.jSPlugin.JS_Resume(dateStr).then((data=>{var _player_i18n;player.playing=!0,setTimeout((()=>{var _player_jSPlugin;-1!==player.url.indexOf(".rec")&&1!=player.speed&&(null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_Speed(player._speed))}),500),null==player.emit||player.emit.call(player,EVENTS.resume,{eventType:EVENTS.resume,code:0,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("RESUME")}),resolve(data)})).catch((err=>{var _player_i18n;null==player.emit||player.emit.call(player,EVENTS.resume,{eventType:EVENTS.resume,code:-1,msg:err||(null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("RESUME_FAILED"))}),reject(err)}))}))}(this,dateStr)}changeVideoLevel(level){return function(player,videoLevel){if("object"==typeof videoLevel?"auto"===videoLevel.level:"auto"===videoLevel)return player.autoVideoLevel=!0,null==player.emit||player.emit.call(player,EVENTS.currentVideoLevel,"auto",player.videoLevel),null==player.emit||player.emit.call(player,EVENTS.changeVideoLevel,{eventType:EVENTS.changeVideoLevel,code:0,data:"auto",msg:player.i18n.t("CHANGE_VIDEO_LEVEL")}),Promise.resolve({code:1,data:videoLevel});const levelItem=(player.videoLevelList||[]).find((item=>+item.level==+("object"==typeof videoLevel?videoLevel.level:videoLevel)));var _player_logger;return levelItem?(player.videoLevel=levelItem.level,player.streamTypeIn=levelItem.streamTypeIn,player.autoVideoLevel=!1,null==player||player.emit(EVENTS.currentVideoLevel,levelItem,player.videoLevel),new Promise(_async_to_generator$4((function*(resolve){let url=player.url;if("compatible"===(null==levelItem?void 0:levelItem.type))url.indexOf(".hd.live")>=0?url=url.replace(".hd.live",".live"):url.indexOf(".live")>=0&&(url=url.replace(".live",".hd.live"));else try{var _player_logger_log,_player_logger,_player__services,_player_emit;null==(_player_logger=player.logger)||null==(_player_logger_log=_player_logger.log)||_player_logger_log.call(_player_logger,"[https request] setVideoLevel()","videoLevel",JSON.stringify(videoLevel));const result=yield null==(_player__services=player._services)?void 0:_player__services.setVideoLevel(player.videoLevel);null==player||null==(_player_emit=player.emit)||_player_emit.call(player,EVENTS.http.setVideoLevel,result)}catch(error){}player.changePlayUrl({url:player.url},(()=>{}),!1).then((res=>{null==player||player.emit(EVENTS.changeVideoLevel,{eventType:EVENTS.changeVideoLevel,code:0,data:videoLevel,msg:player.i18n.t("CHANGE_VIDEO_LEVEL")}),resolve({code:0,data:videoLevel,msg:player.i18n.t("CHANGE_VIDEO_LEVEL")})})).catch((()=>{null==player||player.emit(EVENTS.changeVideoLevel,{eventType:EVENTS.changeVideoLevel,code:-1,data:videoLevel,msg:player.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")}),resolve({code:-1,data:videoLevel,msg:player.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")})}))})))):(null==player.emit||player.emit.call(player,EVENTS.changeVideoLevel,{eventType:EVENTS.changeVideoLevel,code:-2,data:videoLevel,msg:player.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+JSON.stringify(videoLevel)}),null==(_player_logger=player.logger)||_player_logger.warn("video level does not exist!"),Promise.resolve({code:-2,data:videoLevel}))}(this,level)}_setVideoLevel(level){return setVideoLevel(this,level)}reSetTheme(resetList=[]){}_changePlayUrl(options,callback=()=>{},reSetTheme=!0){return _changePlayUrl(this,options,callback)}getOSDTime(){return player=this,new Promise(((resolve,reject)=>{var _player_jSPlugin;null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_GetOSDTime(0).then((data=>{player.__noSyncOSD||(null==player||player.emit(EVENTS.getOSDTime,{eventType:EVENTS.getOSDTime,code:0,data:data,msg:player.i18n.t("GET_OSD_TIME")}),data&&data>0&&(player._seekDate=new Date(1e3*data))),resolve({code:0,retcode:0,data:data})})).catch((err=>{null==player||player.emit(EVENTS.getOSDTime,{eventType:EVENTS.getOSDTime,code:-1,msg:err||player.i18n.t("GET_OSD_TIME")}),reject({code:-1,retcode:-1,data:err})}))}));var player}capturePicture(name,callback=!1,download,cloudRecUpload=!0){return function(player,name,callback=!1,download=!0,cloudRecUpload=!0){var _player_jSPlugin;name=name||(new Date).getTime()+"";var capturePictureRT=null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.JS_CapturePicture(0,name,"JPEG",callback,!!download);return new Promise(((resolve,reject)=>{capturePictureRT.then((res=>{const result={id:player.id,code:0,data:res.data,type:"handleCapturePicture"};null==player||player.emit(EVENTS.capturePicture,{eventType:EVENTS.capturePicture,code:0,data:res.data,msg:player.i18n.t("CAPTURE_SUCCESS")}),"function"==typeof player.params.handleCapturePicture&&player.params.handleCapturePicture(result),-1!==player.url.indexOf(".cloud")&&-1!==player.url.indexOf("busType=7")&&!1!==cloudRecUpload&&fetch(player.env.domain+"/api/service/cloud/upload/url"+`?fileName=${name}&fileType=pic&expireDays=-1&urlExpireTime=1&bizType=ezuikit&accessToken=${player.accessToken||player.token.httpToken.url}`,{method:"GET"}).then((response=>response.json())).then((getUrlRes=>{if(getUrlRes.data&&getUrlRes.data[0]){let formData=new FormData;Object.keys(getUrlRes.data[0].fields).map((key=>{formData.append(key,getUrlRes.data[0].fields[key])}));let binary=atob(res.data.base64.split(",")[1]),array=[];for(let i=0;i<binary.length;i++)array.push(binary.charCodeAt(i));let blob=new Blob([new Uint8Array(array)],{type:"image/jpeg"});formData.append("file",blob,"image.jpeg");const uploader=new Upload({url:getUrlRes.data[0].url,method:"POST",body:formData,headers:{accessToken:player.accessToken||player.token.httpToken.url},onUploadComplete:r=>{var _player_logger;r.response&&r.response.meta&&200==r.response.meta.code&&(null==(_player_logger=player.logger)||_player_logger.log(`${res.data.fileName} upload to cloud storage completed`))}});uploader.upload()}else{var _player_logger;null==(_player_logger=player.logger)||_player_logger.error("Cloud recording file upload address acquisition failed",getUrlRes.meta.message)}})).catch((err=>{var _player_logger;null==(_player_logger=player.logger)||_player_logger.error("Cloud recording file upload failed: ",err)})),resolve(result)})).catch((err=>{null==player||player.emit(EVENTS.capturePicture,{eventType:EVENTS.capturePicture,code:-1,msg:err||player.i18n.t("CAPTURE_FAILED")});const result=Object.assign({id:player.id,type:"handleCapturePicture",code:-1},err);"function"==typeof player.params.handleCapturePicture&&player.params.handleCapturePicture(result),reject(result)}))}))}(this,name,callback,download,cloudRecUpload)}startSave(name,secretCode){return this.recording||!this.playing?Promise.resolve():(this.autoVideoLevelResume=this.autoVideoLevel,this.autoVideoLevel=!1,function(player,name,secretCode){var _player_jSPlugin;return player._playing?(null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.JS_StartSave(name,((url,file)=>{player.recordRes={url:url,file:file}}),secretCode||player.urlInfo.validateCode)).then((()=>{null==player.emit||player.emit.call(player,EVENTS.startSave,{eventType:EVENTS.startSave,code:0,msg:player.i18n.t("START_RECORD_SUCCESS")}),null==player.emit||player.emit.call(player,Theme.EVENTS.recordingChange,!0),p.getInstance(player.id).setState({recordvideo:!0}),player._recording=!0})).catch((()=>{null==player.emit||player.emit.call(player,EVENTS.startSave,{eventType:EVENTS.startSave,code:-1,msg:player.i18n.t("START_RECORD_FAILED")}),null==player.emit||player.emit.call(player,Theme.EVENTS.recordingChange,!1)})):Promise.resolve()}(this,name,secretCode||this.urlInfo.validateCode))}startRecord(name,secretCode){return this.startSave(name,secretCode)}stopSave(){return this.recording?(this.autoVideoLevel=this.autoVideoLevelResume,function(player){var _player_Theme_setDecoderState,_player_Theme;const instance=p.getInstance(player.id);return(null==instance?void 0:instance.getState().recordvideo)?(null==(_player_Theme=player.Theme)||null==(_player_Theme_setDecoderState=_player_Theme.setDecoderState)||_player_Theme_setDecoderState.call(_player_Theme,{recordvideo:!1}),new Promise(((resolve,reject)=>{var _player_jSPlugin;return null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.JS_StopSave().then((()=>{setTimeout((()=>{null==player||player.emit(EVENTS.stopSave,{eventType:EVENTS.stopSave,code:0,data:player.recordRes,msg:player.i18n.t("STOP_RECORD_SUCCESS")}),null==player.emit||player.emit.call(player,Theme.EVENTS.recordingChange,!1),instance.setState({recordvideo:!1}),setTimeout((()=>{player.recordRes=null}),50),player._recording=!1,resolve(_extends$5({},player.recordRes||{}))}),200)})).catch((()=>{null==player||player.emit(EVENTS.stopSave,{eventType:EVENTS.stopSave,code:-1,msg:player.i18n.t("STOP_RECORD_FAILED")}),player.recordRes=null,reject()}))}))):Promise.resolve()}(this)):Promise.resolve()}stopRecord(){return this.stopSave()}openSound(){return function(player){if(player._talking)return Promise.resolve();player.__muted=!1;const instance=p.getInstance(player.id);var openSoundRT=null==player.jSPlugin.JS_OpenSound?void 0:player.jSPlugin.JS_OpenSound.call(player.jSPlugin,0);return null==player.emit||player.emit.call(player,EVENTS.openSound,{eventType:EVENTS.openSound,code:openSoundRT,msg:player.i18n.t("OPEN_SOUND")}),p.setGlobalState({sound:!0}),instance.setState({sound:!0}),Array.isArray(p.listInstances())&&p.listInstances().map((item=>{item.state.sound&&item.id!=player.id&&p.getInstance(item.id).setState({sound:!1})})),player.muted=!1,Promise.resolve(openSoundRT)}(this)}closeSound(){return function(player){if(player._talking)return Promise.resolve();player.__muted=!0;var closeSoundRT=player.jSPlugin.JS_CloseSound(0);return null==player||player.emit(EVENTS.closeSound,{eventType:EVENTS.closeSound,code:closeSoundRT,msg:player.i18n.t("CLOSE_SOUND")}),p.getInstance(player.id).setState({sound:!1}),p.setGlobalState({sound:!1}),player.muted=!0,Promise.resolve(closeSoundRT)}(this)}enableZoom(){var player;(player=this).use3DZoom||player.zooming||(player.zooming=!0,null==player||player.emit(EVENTS.zoom.openZoom))}closeZoom(){var player;!(player=this).use3DZoom&&player.zooming&&(player.zooming=!1,null==player.emit||player.emit.call(player,EVENTS.zoom.closeZoom))}zoomAdd(scale){!function(player,scale){const zoom=player.zoom+(scale||1);!player.use3DZoom&&player.zooming&&(player.zoom=zoom)}(this,scale)}zoomSub(scale){!function(player,scale){const zoom=player.zoom-(scale||1);!player.use3DZoom&&player.zooming&&(player.zoom=zoom)}(this,scale)}enable3DZoom(){return _enable3DZoom(this)}close3DZoom(){return function(player){if(!player.use3DZoom)return new Promise((function(resolve,reject){var _player_i18n,_player_i18n1;null==player.emit||player.emit.call(player,EVENTS.close3DZoom,{eventType:EVENTS.close3DZoom,code:-1,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("3D_ZOOM_NOT_ACTIVED")}),resolve({code:-1,msg:null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("3D_ZOOM_NOT_ACTIVED")})}));if(player.is3DZooming){var _player_i18n;player.Theme&&player.Theme.setDecoderState({zoom:!1});const close3DZoomRT=player.jSPlugin.JS_Disable3DZoom(0);return player.is3DZooming=!1,null==player.emit||player.emit.call(player,EVENTS.close3DZoom,{eventType:EVENTS.close3DZoom,code:close3DZoomRT,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("CLOSE_3D_ZOOM")}),Promise.resolve({code:close3DZoomRT})}return new Promise((function(resolve,reject){var _player_i18n,_player_i18n1;null==player.emit||player.emit.call(player,EVENTS.close3DZoom,{eventType:EVENTS.close3DZoom,code:0,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("3D_ZOOM_CLOSED")}),resolve({code:0,msg:null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("3D_ZOOM_CLOSED")})}))}(this)}changeZoomType(flag){return function(player,flag){var _player_i18n;if(flag&&player.capacity&&!player.support3DZoom)return null==player.emit||player.emit.call(player,EVENTS.changeZoomType,{eventType:EVENTS.changeZoomType,code:-1,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),Promise.resolve({code:-1,msg:player.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")});if(player.is3DZooming)player.close3DZoom();else if(player.Theme&&player.Theme.decoderState.state.zoom){var _player_Zoom_stopZoom,_player_Zoom;null==(_player_Zoom=player.Zoom)||null==(_player_Zoom_stopZoom=_player_Zoom.stopZoom)||_player_Zoom_stopZoom.call(_player_Zoom)}return player.Theme&&player.Theme.setDecoderState({zoom:!1}),player.use3DZoom=flag,new Promise((resolve=>{setTimeout((()=>{var _player_i18n,_player_i18n1;const $zoomContent=document.getElementById(`${player.id}-zoom-content`);flag?$zoomContent&&($zoomContent.title=player.i18n.t("3D_ZOOM")):$zoomContent&&($zoomContent.title=player.i18n.t("ZOOM")),player.isMobile&&flag&&player.enable3DZoom(),null==player.emit||player.emit.call(player,EVENTS.changeZoomType,{eventType:EVENTS.changeZoomType,code:0,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("CHANGE_ZOOM_TYPE")}),resolve({code:0,msg:null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("CHANGE_ZOOM_TYPE")})}),500)}))}(this,flag)}reSize(width,height){this.resize(width,height)}fast(speed){return function(player,speed){if(speed)_setSpeed(player,speed);else{const index=SPEED_LIST.findIndex((item=>item===player.speed));var _player_logger;if(!(index>0&&index<=SPEED_LIST.length-1))return null==(_player_logger=player.logger)||_player_logger.warn("it is already the maximum speed!"),"function"==typeof player.params.handleError&&player.params.handleError({msg:player.i18n.t("MAX_SPEED_LIMIT"),retcode:1003,code:-1,id:player.id,type:"fast"}),Promise.resolve({code:-1,data:{speed:player.speed,msg:player.i18n.t("MAX_SPEED_LIMIT")}});_setSpeed(player,SPEED_LIST[index-1])}return new Promise((resolve=>{null==player.emit||player.emit.call(player,EVENTS.fast,{eventType:EVENTS.fast,code:0,data:player.speed,msg:player.i18n.t("SPEED")}),resolve({code:0,data:{speed:player.speed}})}))}(this,speed)}slow(speed){return function(player,speed){if(speed)_setSpeed(player,speed);else{const index=SPEED_LIST.findIndex((item=>item===player.speed));var _player_logger;if(!(index>=0&&index<SPEED_LIST.length-1))return null==(_player_logger=player.logger)||_player_logger.warn("it is already the minimum speed!"),"function"==typeof player.params.handleError&&player.params.handleError({msg:player.i18n.t("MIN_SPEED_LIMIT"),retcode:1003,code:-1,id:player.id,type:"slow"}),Promise.resolve({code:-1,data:{speed:player.speed,msg:player.i18n.t("MIN_SPEED_LIMIT")}});_setSpeed(player,SPEED_LIST[index+1])}return new Promise((resolve=>{null==player.emit||player.emit.call(player,EVENTS.slow,{eventType:EVENTS.slow,code:0,data:player.speed,msg:player.i18n.t("SPEED")}),resolve({code:0,data:{speed:player.speed}})}))}(this,speed)}seek(startTime,endTime){return function(player,startTime,endTime){var _player_jSPlugin,_player_logger2;if(player.loading=!0,startTime=startTime.replace(/T|Z|\/|-/gi,"").replace(/ /gi,"").replace(/:/gi,""),endTime=(endTime||"").replace(/T|Z|\/|-/gi,"").replace(/ /gi,"").replace(/:/gi,""),!/^(\d{14}|\d{6})$/.test(startTime)||endTime&&!/^(\d{14}|\d{6})$/.test(endTime)){var _player_i18n,_player_logger,_player_i18n1;return"function"==typeof player.params.handleError&&player.params.handleError({msg:null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("SEEK_TIMEFORMAT_ERROR"),retcode:-1,id:player.id,type:"handleError"}),null==player.emit||player.emit.call(player,EVENTS.seek,{eventType:EVENTS.seek,code:-2,msg:player.i18n.t("SEEK_TIMEFORMAT_ERROR")}),null==(_player_logger=player.logger)||_player_logger.error(null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("SEEK_TIMEFORMAT_ERROR")),Promise.resolve(!1)}if(startTime=(player.urlInfo.searchParams.begin||DateTime.formate(new Date,"YYYYMMDD")+"000000").slice(0,14-startTime.length)+startTime,endTime=endTime||startTime.replace(/\d{6}$/,"235959"),endTime=startTime.slice(0,14-endTime.length)+endTime,startTime.slice(0,8)!==endTime.slice(0,8)){var _player_i18n2,_player_logger1,_player_i18n3;return"function"==typeof player.params.handleError&&player.params.handleError({msg:null==(_player_i18n3=player.i18n)?void 0:_player_i18n3.t("SEEK_CANNOT_CROSS_DAYS"),retcode:-1,code:-1,id:player.id,type:"handleError"}),null==player.emit||player.emit.call(player,EVENTS.seek,{eventType:EVENTS.seek,code:-1,msg:player.i18n.t("SEEK_CANNOT_CROSS_DAYS")}),null==(_player_logger1=player.logger)||_player_logger1.error(null==(_player_i18n2=player.i18n)?void 0:_player_i18n2.t("SEEK_CANNOT_CROSS_DAYS")),Promise.resolve(!1)}return DateTime.strToDate(startTime).getTime()>=DateTime.strToDate(endTime).getTime()?("function"==typeof player.params.handleError&&player.params.handleError({msg:"start time is greater than the end time",retcode:-1,code:-1,id:player.id,type:"handleError"}),null==player.emit||player.emit.call(player,EVENTS.seek,{eventType:EVENTS.seek,code:-1,msg:"start time is greater than the end time"}),null==(_player_logger2=player.logger)||_player_logger2.error("start time is greater than the end time"),Promise.resolve(!1)):(null==(_player_jSPlugin=player.jSPlugin)||_player_jSPlugin.JS_Seek(0,DateTime.formate(startTime,"YYYYMMDDThhmmssZ"),DateTime.formate(endTime,"YYYYMMDDThhmmssZ")),null==player.emit||player.emit.call(player,EVENTS.seek,{eventType:EVENTS.seek,seekTime:DateTime.strToDate(startTime).getTime(),data:{begin:DateTime.strToDate(startTime).getTime(),end:DateTime.strToDate(endTime).getTime()}}),Promise.resolve(!0))}(this,startTime,endTime)}get isCurrentBrowserFullscreen(){return this.isCurrentFullscreen}startTalk(){!function(player){var _player_Talk;if(!player._playing)return;const globalState=p.getGlobalState(),instance=p.getInstance(player.id);var _player_i18n,_player_logger,_player_i18n1,_player_i18n2;if(window.__CURRENT_PLAYER_TALK_ID=player.id,globalState.talk)return null==(_player_logger=player.logger)||_player_logger.warn(null==player||null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("TALK_TALKING")),null==player||player.emit(EVENTS.startTalk,{eventType:EVENTS.startTalk,code:430005,msg:null==player||null==(_player_i18n1=player.i18n)?void 0:_player_i18n1.t("TALK_TALKING")}),null==player||player.emit("message",null==player||null==(_player_i18n2=player.i18n)?void 0:_player_i18n2.t("TALK_TALKING"),"warn"),void(null==player||player.emit(Theme.EVENTS.talkingChange,!1));null==(_player_Talk=player.Talk)||_player_Talk.startTalk((isGb=>{var _player_controls,_player_Talk_eventEmitter_once,_player_Talk_eventEmitter,_player_Talk;player.muted||isGb||(player.closeSound(),player.__talk_muted__=!0),(null==(_player_controls=player.controls)?void 0:_player_controls.volumeControl)&&(player.controls.volumeControl.disabled=!0),null==(_player_Talk=player.Talk)||null==(_player_Talk_eventEmitter=_player_Talk.eventEmitter)||null==(_player_Talk_eventEmitter_once=_player_Talk_eventEmitter.once)||_player_Talk_eventEmitter_once.call(_player_Talk_eventEmitter,"startTalk",(res=>{var _player_eventEmitter;null==player||null==(_player_eventEmitter=player.eventEmitter)||_player_eventEmitter.emit(EVENTS.startTalk,res)})),player._talking=!0,null==player||player.emit(Theme.EVENTS.talkingChange,!0),p.setGlobalState({talk:!0}),instance.setState({talk:!0})}))}(this)}stopTalk(){!function(player){var _player_Talk_stopTalk,_player_Talk,_player_controls;const globalState=p.getGlobalState(),instance=p.getInstance(player.id);window.__CURRENT_PLAYER_TALK_ID="",globalState.talk?(null==(_player_Talk=player.Talk)||null==(_player_Talk_stopTalk=_player_Talk.stopTalk)||_player_Talk_stopTalk.call(_player_Talk),null==player.emit||player.emit.call(player,EVENTS.stopTalk,{eventType:EVENTS.stopTalk,code:0,msg:"success"}),player._talking=!1,null==player||player.emit(Theme.EVENTS.talkingChange,!1),(null==(_player_controls=player.controls)?void 0:_player_controls.volumeControl)&&player._playing&&(player.controls.volumeControl.disabled=!1),player.__talk_muted__&&(null==player.openSound||player.openSound.call(player)),player.__talk_muted__=!1,globalState.talk&&p.setGlobalState({talk:!1}),instance.getState().talk&&instance.setState({talk:!1})):null==player.emit||player.emit.call(player,EVENTS.stopTalk,{eventType:EVENTS.stopTalk,code:-1,msg:"设备未发起对讲"})}(this)}setVolumeGain(value){return function(player,value){var _player_Talk;return null==(_player_Talk=player.Talk)?void 0:_player_Talk.setVolumeGain(value)}(this,value)}getMicrophonePermission(){return null==(_player_Talk=this.Talk)?void 0:_player_Talk.getMicrophonePermission();var _player_Talk}getMicrophonesList(){return null==(_player_Talk=this.Talk)||null==(_player_Talk_getMicrophonesList=_player_Talk.getMicrophonesList)?void 0:_player_Talk_getMicrophonesList.call(_player_Talk);var _player_Talk_getMicrophonesList,_player_Talk}setProfile(options){!function(player,options){var _player_Talk_setProfile,_player_Talk;null==(_player_Talk=player.Talk)||null==(_player_Talk_setProfile=_player_Talk.setProfile)||_player_Talk_setProfile.call(_player_Talk,options)}(this,options)}destroy(){var _this=this,_superprop_get_destroy=()=>super.destroy;return _async_to_generator((function*(){return preInitParams=null,function(player){__destroy.apply(this,arguments)}(_this),_superprop_get_destroy().call(_this),0}))()}getDeviceCapacity(){var player,_player_logger;(player=this).capacity={},null==(_player_logger=player.logger)||_player_logger.log("[https request] getDeviceCapacity()"),player._services.getDeviceCapacity().then((res=>{var _player_i18n_t,_player_i18n;player.capacity=res,player.support3DZoom=!1,player.capacity&&"1"==player.capacity.support_3d_position&&player.url.indexOf(".live")>-1&&(player.support3DZoom=!0,player.params.use3DZoom&&(player.use3DZoom=!0)),player.capacity&&"1"==player.capacity.support_device_auto_video_level&&(player.videoLevelList.push({level:"auto",name:"VIDEO_LEVEL_AUTO",streamTypeIn:1}),null==player.emit||player.emit.call(player,EVENTS.setVideoLevelList,player.videoLevelList),null==player.on||player.on.call(player,EVENTS.autoVideoLevel,(res=>{const index=player.videoLevelList.findIndex((item=>item.level===player.videoLevel));switch(res.code){case 0:break;case 1:const preLevel=player.videoLevelList[index-1];var _player_logger_log,_player_logger;preLevel&&"auto"!==preLevel.level&&player.videoLevelList[index].streamTypeIn===preLevel.streamTypeIn&&(null==(_player_logger=player.logger)||null==(_player_logger_log=_player_logger.log)||_player_logger_log.call(_player_logger,`卡顿比:${res.lagRate}%,降低清晰度至${preLevel.level}`),player._setVideoLevel(preLevel.level).then((()=>{var _player_emit;player.videoLevel=preLevel.level,null==player||null==(_player_emit=player.emit)||_player_emit.call(player,EVENTS.currentVideoLevel,"auto",player.videoLevel),setTimeout((()=>{const info=player.jSPlugin._JSPlayM4_GetFrameInfo(0);player._updateStreamInfo({resolution:getResolutionCategory(info.height)})}),5e3)})));break;case 2:const nextLevel=player.videoLevelList[index+1];var _player_logger_log1,_player_logger1;nextLevel&&"auto"!==nextLevel.level&&player.videoLevelList[index].streamTypeIn===nextLevel.streamTypeIn&&(null==(_player_logger1=player.logger)||null==(_player_logger_log1=_player_logger1.log)||_player_logger_log1.call(_player_logger1,`卡顿比:${res.lagRate}%,提升清晰度至${nextLevel.level}`),player._setVideoLevel(nextLevel.level).then((()=>{player.videoLevel=nextLevel.level,null==player.emit||player.emit.call(player,EVENTS.currentVideoLevel,"auto",player.videoLevel),setTimeout((()=>{const info=player.jSPlugin._JSPlayM4_GetFrameInfo(0);player._updateStreamInfo({resolution:getResolutionCategory(info.height)})}),5e3)})))}}))),null==player.emit||player.emit.call(player,EVENTS.getDeviceCapacity,{eventType:EVENTS.getDeviceCapacity,code:0,data:res,msg:null==(_player_i18n=player.i18n)||null==(_player_i18n_t=_player_i18n.t)?void 0:_player_i18n_t.call(_player_i18n,"GET_CAPACITY")})}))}getVideoLevelList(){return function(player){var _player_params_videoLevelList,_player_i18n;let videoLevelList=[];return videoLevelList=(null==(_player_params_videoLevelList=player.params.videoLevelList)?void 0:_player_params_videoLevelList.length)>=0?player.params.videoLevelList:player.videoLevelList,null==player.emit||player.emit.call(player,EVENTS.getVideoLevelList,{eventType:EVENTS.getVideoLevelList,code:0,data:videoLevelList,msg:null==(_player_i18n=player.i18n)?void 0:_player_i18n.t("GET_VIDEO_LEVEL_LIST")}),videoLevelList}(this)}getVideoLevel(){return null==(player=this)||player.emit(EVENTS.getVideoLevel,{eventType:EVENTS.getVideoLevel,code:0,data:player.videoLevel}),player.videoLevel;var player}getPtzStatus(){return(null==(_player_controls=(player=this).controls)?void 0:_player_controls.ptzControl)?(null==player.emit||player.emit.call(player,EVENTS.getPtzStatus,{eventType:EVENTS.getPtzStatus,code:0,data:player.controls.ptzControl.active,msg:player.i18n.t("GET_PTZ_STATUS")}),player.controls.ptzControl.active):(null==player.emit||player.emit.call(player,EVENTS.getPtzStatus,{eventType:EVENTS.getPtzStatus,code:-1,data:!1,msg:player.i18n.t("GET_PTZ_STATUS_FAILED")}),!1);var player,_player_controls}openPtz(){var _this_controls,player;if(null==(_this_controls=this.controls)?void 0:_this_controls.ptzControl)return(player=this).controls.ptzControl?(player.isMobile?player.isCurrentFullscreen?player.controls.ptzControl.active=!0:null==player.emit||player.emit.call(player,EVENTS.ptz.openPtz,{eventType:EVENTS.ptz.openPtz,code:-1,msg:player.i18n.t("MOBILE_HIDE_PTZ")}):player.controls.ptzControl.active=!0,{code:0}):(null==player.emit||player.emit.call(player,EVENTS.ptz.openPtz,{eventType:EVENTS.ptz.openPtz,code:-1,msg:player.i18n.t("OPTION_PTZ_FAILED")}),{code:-1,msg:player.i18n.t("OPTION_PTZ_FAILED")});this.logger.warn(this.i18n.t("OPTION_PTZ_FAILED"))}closePtz(){var _this_controls,player,_player_controls;if(null==(_this_controls=this.controls)?void 0:_this_controls.ptzControl)return(null==(_player_controls=(player=this).controls)?void 0:_player_controls.ptzControl)?(player.controls.ptzControl.active=!1,{code:0}):{code:-1,msg:player.i18n.t("OPTION_PTZ_FAILED")};this.logger.warn(this.i18n.t("OPTION_PTZ_FAILED"))}getPlayRate(){return null==this.emit||this.emit.call(this,EVENTS.getPlayRate,{eventType:EVENTS.getPlayRate,code:0,data:this.speed,target:this,msg:this.i18n.t("GET_SPEED")}),this.speed}setMirrorFlip(command){var _this_logger_log,_this_logger;return"number"!=typeof command?(null==this.emit||this.emit.call(this,EVENTS.setMirrorFlip,{eventType:EVENTS.setMirrorFlip,code:-1,target:this,msg:this.i18n.t("MIRROR_TYPE_ERROR")}),Promise.reject({code:-1,msg:this.i18n.t("MIRROR_TYPE_ERROR")})):(null==this.emit||this.emit.call(this,EVENTS.setMirrorFlip,{eventType:EVENTS.setMirrorFlip,code:0,target:this,msg:this.i18n.t("MIRROR")}),null==(_this_logger=this.logger)||null==(_this_logger_log=_this_logger.log)||_this_logger_log.call(_this_logger,"[https request] postDevicePtzMirror() command",command),this._services.postDevicePtzMirror(command))}setFECCorrectType(type,ids){return _getFEC3DViewParam(this,type)}setFEC3DViewParam(param){return function(player,param){var _player_jSPlugin,_player_jSPlugin1,_player_jSPlugin2;return!player._FECCorrectType||((null==(_player_jSPlugin=player.jSPlugin)?void 0:_player_jSPlugin.isHardH264)||(null==(_player_jSPlugin1=player.jSPlugin)?void 0:_player_jSPlugin1.isHardH265))&&(null==(_player_jSPlugin2=player.jSPlugin)?void 0:_player_jSPlugin2.useHardDev)?(null==player.emit||player.emit.call(player,EVENTS.setFEC3DViewParam,{eventType:EVENTS.setFEC3DViewParam,code:-1,msg:player.i18n.t("FEC.FEC_SUPPORT_VERSION")}),Promise.resolve({code:-1,msg:player.i18n.t("FEC.FEC_SUPPORT_VERSION")})):player.jSPlugin.FEC_Set3DViewParam&&player._FECCorrectType&&(3===player._FECCorrectType.place&&1536===player._FECCorrectType.correctType||1===player._FECCorrectType.place&&2304===player._FECCorrectType.correctType)?player.jSPlugin.FEC_Set3DViewParam(param).then((()=>(null==player.emit||player.emit.call(player,EVENTS.setFEC3DViewParam,{eventType:EVENTS.setFEC3DViewParam,code:0,msg:player.i18n.t("FEC.SET_FEC_PARAMS")}),{code:0}))).catch((()=>(null==player.emit||player.emit.call(player,EVENTS.setFEC3DViewParam,{eventType:EVENTS.setFEC3DViewParam,code:-1}),{code:-1}))):(null==player.emit||player.emit.call(player,EVENTS.setFEC3DViewParam,{eventType:EVENTS.setFEC3DViewParam,code:-1,msg:player.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.resolve({code:-1,msg:player.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}(this,param)}getFEC3DViewParam(param){return _getFEC3DViewParam(this,param)}setWaterMarkFont(options){return function(player,options){return null==player.emit||player.emit.call(player,EVENTS.setWaterMarkFont,{eventType:EVENTS.setWaterMarkFont,code:0,data:options,msg:player.i18n.t("SET_WATERMARK")}),player.waterMark_JSPlugin=options,player.jSPlugin.JS_SetWaterMarkFont(options)}(this,options)}setTimeLineClickable(clickAble){this.timeLineClickable=clickAble,this.Theme&&this.Theme.Rec&&this.Theme.Rec.timeLine&&this.Theme.Rec.timeLine.setTimeLineClickable(clickAble)}setLoggerOptions(options={}){var _this_jSPlugin_player,_this_jSPlugin;super.setLoggerOptions(options),null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_player=_this_jSPlugin.player)||_this_jSPlugin_player.setLogger({level:options.level,showTime:options.showTime})}setDisplayRegion(left,right,top,bottom){var _this_jSPlugin_player,_this_jSPlugin;null==this.emit||this.emit.call(this,EVENTS.setDisplayRegion,{left:left,right:right,top:top,bottom:bottom}),null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_player=_this_jSPlugin.player)||_this_jSPlugin_player.setDisplayRegion(left,right,top,bottom)}_initGetDeviceSupportQuality(){return this.url.indexOf(".live")>-1?new Promise((resolve=>{this._beforeInitGetDeviceSupportQuality().then((res=>{if(["0","1","2","3","4","5","6","pp","qp"].includes(this._quality+"")||this._quality<0){const videoLevelList=this.params.videoLevelList||this.videoLevelList;let item={};if("pp"===this._quality)item=videoLevelList[0];else if("qp"===this._quality)try{item=videoLevelList[videoLevelList.length-1]}catch(error){}else item=videoLevelList.find((it=>it.level===+this._quality));var _this_logger;if(item)setVideoLevel(this,item.level).then((()=>{resolve()})),this.videoLevel=item.level,this.streamTypeIn=item.streamTypeIn,null==this.emit||this.emit.call(this,EVENTS.currentVideoLevel,item,item.level);else null==(_this_logger=this.logger)||_this_logger.warn(`quality(${this._quality}) does not exist!`),resolve()}else resolve()}))})):Promise.resolve()}_beforeInitGetDeviceSupportQuality(){if(preInitParams&&preInitParams.getDeviceSupportQualityRes&&preInitParams.getDeviceListRes){var _this_videoLevelList_,_this_videoLevelList;const currentChannelNoItem=preInitParams.getDeviceListRes.find((item=>item.channelNo===+this.urlInfo.channelNo));this._setVideoLevelList(this.params.videoLevelList?this.params.videoLevelList:preInitParams.getDeviceSupportQualityRes);let currentVideoLevel={};return currentVideoLevel="compatible"===(null==(_this_videoLevelList_=this.videoLevelList[0])?void 0:_this_videoLevelList_.type)?this.url.indexOf(".hd.live")>0?this.videoLevelList[1]:this.videoLevelList[0]:this.videoLevelList.find((item=>item.level==(null==currentChannelNoItem?void 0:currentChannelNoItem.videoLevel)))||{},(null==currentVideoLevel?void 0:currentVideoLevel.streamTypeIn)?(this.videoLevel=currentVideoLevel.level,this.streamTypeIn=currentVideoLevel.streamTypeIn):(null==(_this_videoLevelList=this.videoLevelList)?void 0:_this_videoLevelList.length)>0&&(this.videoLevel=this.videoLevelList[0].level,this.streamTypeIn=this.videoLevelList[0].streamTypeIn,currentVideoLevel=this.videoLevelList[0]),Promise.resolve([[preInitParams.getDeviceSupportQualityRes,preInitParams.getDeviceListRes]])}let promises=[_getDeviceSupportQualityServicesAndGetDeviceListServices(this)];return Promise.all(promises)}_deviceSerialChangeServices(){var _this=this;return _async_to_generator((function*(){var _this__services,player,_player_logger,_player__services;return Promise.all([null==(_this__services=_this._services)?void 0:_this__services.getAppKey().then((res=>{var _res_meta,_res_data,_this_logger_log,_this_logger,_this__collect,_this__collect1;200===(null==res||null==(_res_meta=res.meta)?void 0:_res_meta.code)?(null==(_this_logger=_this.logger)||null==(_this_logger_log=_this_logger.log)||_this_logger_log.call(_this_logger,"[https response] getAppKey()",JSON.stringify(res.data)),null==(_this__collect=_this._collect)||_this__collect.updateAppKey(res.data.appKey)):null==(_this__collect1=_this._collect)||_this__collect1.updateAppKey("test");return(null==res||null==(_res_data=res.data)?void 0:_res_data.appKey)||""})),(player=_this,null==(_player_logger=player.logger)||_player_logger.log("[https request] getDeviceInfo()"),null==(_player__services=player._services)?void 0:_player__services.getDeviceInfo().then((res=>{var _player_controls_deviceControl,_player_controls;return player.deviceInfo=res,null==player.emit||player.emit.call(player,EVENTS.http.getDeviceInfo,res),null==(_player_controls=player.controls)||null==(_player_controls_deviceControl=_player_controls.deviceControl)||_player_controls_deviceControl.update(null==res?void 0:res.deviceName,null==res?void 0:res.deviceSerial,""),res}))),_this.getDeviceCapacity(),_getStreamAddressListService(_this)])}))()}supportSeek(){var _this_urlInfo,_this_capacity,_this_urlInfo1;return("cloud"===(null==(_this_urlInfo=this.urlInfo)?void 0:_this_urlInfo.recType)||this.options.useSeek&&"1"===(null==(_this_capacity=this.capacity)?void 0:_this_capacity.support_seek_playback))&&!(null==(_this_urlInfo1=this.urlInfo)?void 0:_this_urlInfo1.deviceSerial.includes(":"))}_isLive(){return this.url.indexOf(".live")>=0}_updateStreamInfo(infos){this.showStreamInfo&&Object.keys(infos).length>0&&Object.keys(infos).map((key=>{const infoDom=this.$container.querySelector(`.ezplayer-streamInfo-${key}-value`);infoDom&&(infoDom.innerHTML=infos[key])}))}displayStreamInfo(flag){this.showStreamInfo=flag;const StreamInfoClass="ezplayer-streamInfo";if(flag&&this.$container){var _this_jSPlugin_player,_this_jSPlugin;null==(_this_jSPlugin=this.jSPlugin)||null==(_this_jSPlugin_player=_this_jSPlugin.player)||_this_jSPlugin_player.setStreamInfoCallBackType(0);const streamInfoText=`\n <div class="${StreamInfoClass}-videoFormat">${this.i18n.t("videoFormat")}: <span class="${StreamInfoClass}-videoFormat-value">${this.streamInfo.videoFormat}</span></div>\n <div class="${StreamInfoClass}-frameRate">${this.i18n.t("frameRate")}: <span class="${StreamInfoClass}-frameRate-value">${this.streamInfo.frameRate}</span></div>\n <div class="${StreamInfoClass}-systemFormat">${this.i18n.t("systemFormat")}: <span class="${StreamInfoClass}-systemFormat-value">${this.streamInfo.systemFormat}</span></div>\n <div class="${StreamInfoClass}-resolution">${this.i18n.t("resolution")}: <span class="${StreamInfoClass}-resolution-value">${this.streamInfo.resolution}</span></div>\n <div class="${StreamInfoClass}-codeRate">${this.i18n.t("bitrate")}: <span class="${StreamInfoClass}-codeRate-value">${this.streamInfo.codeRate}</span></div>\n <div class="${StreamInfoClass}-frameLostRate">${this.i18n.t("frameLostRate")}: <span class="${StreamInfoClass}-frameLostRate-value">${this.streamInfo.frameLostRate}</span></div>\n <div class="${StreamInfoClass}-lagRate">${this.i18n.t("lagRate")}: <span class="${StreamInfoClass}-lagRate-value">${this.streamInfo.lagRate}</span></div>\n `;var _this_$container;if(this._$streamInfo||(this._$streamInfo=document.createElement("div"),this._$streamInfo.classList.add(`${StreamInfoClass}`),this._$streamInfo.style.cssText=`\n position: absolute;\n ${this.isMobile?"top:32px;":"top: 48px;"}\n ${this.isMobile?"font-size:12px;":"font-size:14px;"}\n right: 10px; color: #52C41A; width: 170px; background-color: rgba(0,0,0,0.6);\n user-select: none;\n pointer-events: none;\n padding: 10px;\n z-index:2;\n `),this._$streamInfo)this._$streamInfo.innerHTML=streamInfoText,null==(_this_$container=this.$container)||_this_$container.appendChild(this._$streamInfo)}else{var _this_jSPlugin_player1,_this_jSPlugin1;this._$streamInfo&&(this._$streamInfo.remove(),this._$streamInfo=null),null==(_this_jSPlugin1=this.jSPlugin)||null==(_this_jSPlugin_player1=_this_jSPlugin1.player)||_this_jSPlugin_player1.setStreamInfoCallBackType(1)}}constructor(params){var _params_videoLevelList,_params_definitionOptions_list,_params_definitionOptions,_params_definitionOptions1,_params_definitionOptions2,_params_staticPath,_params_definitionOptions3,_params_extraParams,_this_urlInfo_searchParams,_window_location,_window,_window_location1,_window1,_this_env;if(super(_extends$2({},deepmerge(DEFAULT_OPTIONS,params,{clone:!1}),(null==(_params_videoLevelList=params.videoLevelList)?void 0:_params_videoLevelList.length)||(null==params||null==(_params_definitionOptions=params.definitionOptions)||null==(_params_definitionOptions_list=_params_definitionOptions.list)?void 0:_params_definitionOptions_list.length)?{definitionOptions:{value:null==params||null==(_params_definitionOptions1=params.definitionOptions)?void 0:_params_definitionOptions1.value,list:(null==params||null==(_params_definitionOptions2=params.definitionOptions)?void 0:_params_definitionOptions2.list)||params.videoLevelList}}:{},{capturePictureOptions:_extends$2({type:0!=params.download?"download":"base64"},params.capturePictureOptions||{}),staticPath:(null==(_params_staticPath=params.staticPath)?void 0:_params_staticPath.startsWith("http"))?params.staticPath:getStaticPath(params.staticPath||"https://openstatic.ys7.com/ezuikit_js/v8.2.2/ezuikit_static"),autoPlay:deepmerge(DEFAULT_OPTIONS,params,{clone:!1}).autoplay,container:document.getElementById(params.id),type:"ezopen"})),this._services=null,this._recOSDTimer=null,this.videoInfo={},this.audioInfo={},this.urlInfo={},this._$streamInfo=null,this._handleRealUrl=realUrl=>realUrl,this.params=deepmerge(DEFAULT_OPTIONS,_extends$2({},params,{videoLevelList:(null==params||null==(_params_definitionOptions3=params.definitionOptions)?void 0:_params_definitionOptions3.list)||params.videoLevelList}),{clone:!1}),!params.id)throw new Error("id param is required!");if(!document.getElementById(params.id))throw new Error(`#${this.params.id} node does not exist`);this.i18n.appendTranslations({zh:zh_CN,en:en_US}),this.eventEmitter={on:this.on.bind(this),emit:this.emit.bind(this),off:this.off.bind(this),once:this.once.bind(this),removeAllListeners:this.removeAllListeners.bind(this)},this.params.autoplay&&(this.loading=!0),this.autoplay=this.params.autoplay,this.logger.setOptions({name:(this.params.loggerOptions.name+" #"+params.id).replace(/^ /,"")}),this.logger.log("[version]",EZUIKitPlayer.version),this.isStoping=!1,this.sdkType=void 0!==this.params.sdkType?this.params.sdkType:"base",this.talkChannelNo=params.talkChannelNo||null,__eventsLogger(this),this.emit(EVENTS.init),this.timeZone=0,this.ptzSpeed=params.ptzSpeed||2,this.download=void 0===params.download||params.download,this.downloadRecord=void 0===params.downloadRecord||params.downloadRecord,this.timeLineClickable=void 0!==params.timeLineClickable&&params.timeLineClickable,this.onTimeLineClick=void 0!==params.onTimeLineClick?params.onTimeLineClick:null,this.recordRes={},this.disableRenderPrivateData=void 0===params.disableRenderPrivateData||params.disableRenderPrivateData,this.ptzSpeedOptions={slow:1,mid:2,fast:3},window.EZUIKit[params.id]={state:{EZUIKitPlayer:{talkInit:window.EZUIKit[params.id]&&window.EZUIKit[params.id].state&&window.EZUIKit[params.id].state.EZUIKitPlayer.talkInit||!1}}},this.urlInfo=parseEzopenUrl(params.url),this._services=new Services({sdkType:this.sdkType,baseURL:this.params.env?this.params.env.domain:DOMAIN,accessToken:params.accessToken,deviceSerial:this.urlInfo.deviceSerial,channelNo:this.urlInfo.channelNo,token:params.token||{},ezopenParams:(null==(_params_extraParams=params.extraParams)?void 0:_params_extraParams.ezopenParams)||{},timeZone:null==(_this_urlInfo_searchParams=this.urlInfo.searchParams)?void 0:_this_urlInfo_searchParams.timeZone}),this.logger.log("[Services] init"),new HttpFetch(this.params.env?this.params.env.domain:null),this.id=params.id,this.isCall=params.isCall||!1,this.callTime=params.callTime||null,this.hangUpCallback=params.hangUpCallback||null,this.isNeedBellRing=!1!==params.isNeedBellRing,this.url=params.url,this.accessToken=params.accessToken,this.deviceSerial=this.urlInfo.deviceSerial,this.channelNo=this.urlInfo.channelNo,this.poster=params.poster,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.capacity=null,this.playTimer=null,this.env={domain:DOMAIN},void 0!==params.env&&(this.env=Object.assign(this.env,params.env)),this.isMobile=isMobile$1(),this.support3DZoom=!1,this.use3DZoom=!1,this.is3DZooming=!1,this.useHardDev=void 0!==params.useHardDev&&params.useHardDev,this._spaceId=getQueryString("spaceId",this.url)||this.options.spaceId,this.waterMark_JSPlugin=!1,this.useSeek=params.useSeek,this.dpr=params.dpr||1,this.decoderType=params.decoderType||"auto",this.videoLevel=1,this.streamTypeIn=1,this.autoVideoLevel=!1,this.autoVideoLevelResume=!1,this.lagRateCycle=params.lagRateCycle||30,this.showStreamInfo=void 0!==params.showStreamInfo&&params.showStreamInfo,this.streamInfo={videoFormat:"",frameRate:"0FPS",systemFormat:"",resolution:"",codeRate:"0Kbps",frameLostRate:"0%",lagRate:"0%"},this.frameDecordTime=0,this.language=params.language||"zh",this.languageList=params.languageList||["zh","en"],-1===this.languageList.indexOf(this.language)&&(this.logger.warn(`language [${this.language}] is currently not supported and has been switched to zh`),this.language="zh"),this.token=params.token||{},this.deviceInfo={},this._quality=params.quality,this.isInspect=params.isInspect||!1,this.inspectRecordingDuration=params.inspectRecordingDuration||144e5,this.inspectVideoWidth=params.inspectVideoWidth||290,this.inspectVideoHeight=params.inspectVideoHeight||170,this._FECCorrectType=null,this._FECSplitIds="",this.initSuccessTime=0,this._initTime=0,this._gotWsUrlTime=0,this._startGetWsUrlTime=0,this.appearFirstFrameTime=0,this._openStreamTime=0,this.maxReloadTime=0,this.maxAddressAccount=params.maxAddressAccount||1e3,this.reloadCodeBalckList=params.reloadCodeBalckList||[5402,5406,5411,5507,5546,9048,9049,5451,5558,6701];const isV3=!this.useHardDev&&isVersion2Available()||this.useHardDev&&!isSupHardDecAVC()&&!isSupHardDecHEVC()&&isVersion2Available()||this.useHardDev&&(isSupHardDecAVC()||isSupHardDecHEVC()||isVersion2Available());this.isV3=isV3,void 0!==params.isMobile&&(this.isMobile=params.isMobile),this._monitorReport=!1!==params.dataReport&&("https:"===(null==(_window=window)||null==(_window_location=_window.location)?void 0:_window_location.protocol)&&!function(hostname){const parts=hostname.split(".").map((function(part){return!Number.isNaN(part)}));return 4===parts.length&&parts.every(Boolean)}(null==(_window1=window)||null==(_window_location1=_window1.location)?void 0:_window_location1.hostname)),this._collect=new Collect({domain:null==(_this_env=this.env)?void 0:_this_env.domain,monitorReport:this._monitorReport,pluginVersion:this.isV3?"v3":"v1",extendsInfo:{v:"8.2.2",getDynamic:()=>{var _this_env;return{protocol:"ezopen",url:this.url,serial:this.urlInfo.deviceSerial,no:this.urlInfo.channelNo,env:null==(_this_env=this.env)?void 0:_this_env.domain,type:this.urlInfo.type}}}}),this.logger.log("[Collect] init");let addressList=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{},keys=Object.keys(addressList);keys.length>this.maxAddressAccount&&keys.map(((key,index)=>{index<keys.length&&index>keys.length-this.maxAddressAccount||delete addressList[key]}));try{const ADDRESS_KEY=this.deviceSerial+"_"+this.channelNo;addressList[ADDRESS_KEY]||(addressList=_extends$2({},addressList,{[ADDRESS_KEY]:[]}),localStorage.setItem("ezuikit_addressList",JSON.stringify(addressList))),localStorage.getItem("ezuikit_reloadAddressList")&&localStorage.removeItem("ezuikit_reloadAddressList")}catch(error){}var player;this.logger.log("[options]",JSON.stringify(this.params)),this.startPlayTime=(new Date).valueOf(),this._init(),this.play=debounce$1((options=>this._play(options)),500,!0),this.resume=debounce$1((time=>this._resume(time)),500,!0),this.changePlayUrl=debounce$1(((options,callback,reSetTheme)=>this._changePlayUrl(options,callback,reSetTheme)),500),window.addEventListener("beforeunload",(()=>{if(!this.destroyed)try{p.removeInstance(this.id),this.stop()}catch(err){}})),null==(player=this)||player.on(EVENTS.talkSuccess,(data=>{player.Theme&&!player.Theme.decoderState.state.talk&&player.id===data.id&&player.Theme.setDecoderState({talk:!0});const globalState=p.getGlobalState(),instance=p.getInstance(player.id);globalState.talk||p.setGlobalState({talk:!0}),instance.getState().talk||instance.setState({talk:!0})})),null==player||player.on(EVENTS.talkError,(()=>{var _player_Theme_setDecoderState,_player_Theme;null==(_player_Theme=player.Theme)||null==(_player_Theme_setDecoderState=_player_Theme.setDecoderState)||_player_Theme_setDecoderState.call(_player_Theme,{talk:!1});const globalState=p.getGlobalState(),instance=p.getInstance(player.id);globalState.talk&&p.setGlobalState({talk:!1}),instance.getState().talk&&instance.setState({talk:!1})})),null==player||player.on(EVENTS.stop,(()=>{player.stopSave()})),null==player||player.on(EVENTS.pause,(()=>{player.stopSave()})),function(player){var _player_Talk_eventEmitter,_player_Talk;player.on(Theme.EVENTS.changeTheme,(()=>{player.recording&&player.stopRecord()})),player.on(Theme.EVENTS.control.play,(playing=>{playing?player.recType&&player._recOSDTimer?player.resume():player.play():player.pause()})),player.on(Theme.EVENTS.control.capturePicture,(options=>{const download="download"===options.type;player.capturePicture(void 0,!1,download,options.cloudRecUpload).then((res=>{var _player_controls_capturePictureControl,_player_controls;null==(_player_controls=player.controls)||null==(_player_controls_capturePictureControl=_player_controls.capturePictureControl)||_player_controls_capturePictureControl.emit(Theme.EVENTS.control.capturePictureResult,res)}))})),player.on(Theme.EVENTS.volumechange,((_volume,muted)=>{muted!==player.__muted&&(muted?player.closeSound():player.openSound())})),player.on(Theme.EVENTS.control.recordingChange,(recording=>{recording?player.startSave():player.stopSave()})),player.on(Theme.EVENTS.control.talkingChange,(talking=>{talking?player.startTalk():player.stopTalk()})),null==(_player_Talk=player.Talk)||null==(_player_Talk_eventEmitter=_player_Talk.eventEmitter)||_player_Talk_eventEmitter.on("talkVolumeChange",(({data:data})=>{player.emit(Theme.EVENTS.talkVolumeChange,data)})),player.on(Theme.EVENTS.control.definitionChange,(value=>{player.resetControl(),player.changeVideoLevel(value)})),player.on(Theme.EVENTS.control.speedChange,(speed=>{player.fast(speed)})),player.on(Theme.EVENTS.control.recTypeChange,(type=>{var _player_urlInfo_searchParams,_player_urlInfo;player.resetControl(),player._recOSDTimer&&(clearInterval(player._recOSDTimer),player._recOSDTimer=null),player._seekIntervaltimer&&(clearInterval(player._seekIntervaltimer),player._seekIntervaltimer=null);const spaceId=(null==(_player_urlInfo=player.urlInfo)||null==(_player_urlInfo_searchParams=_player_urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.spaceId)||player.options.spaceId,newUrl=switchEzopenUrl(player.url,{type:"rec",recType:"rec"===type?"":"cloud",search:"cloudRecord"===type?"busType=7"+(spaceId?`&spaceId=${spaceId}`:""):"busType="+(spaceId?"&spaceId=":"")});player._speed=1,player.changePlayUrl({url:newUrl})})),player.on(Theme.EVENTS.control.dateChange,(date=>{const day=DateTime.formate(date,"YYYYMMDD");player.resetControl(),player._recOSDTimer&&(clearInterval(player._recOSDTimer),player._recOSDTimer=null),player._seekIntervaltimer&&(clearInterval(player._seekIntervaltimer),player._seekIntervaltimer=null);const newUrl=switchEzopenUrl(player.url,{search:`begin=${day+"000000"}&end=${day+"235959"}`});player._speed=1,player.changePlayUrl({url:newUrl})})),player.on(Theme.EVENTS.control.timeLineChange,(date=>{var _player_recordList;player.recording&&player.stopSave();let begin="";var _player_urlInfo_searchParams,_player_urlInfo,_player_urlInfo_searchParams1,_player_urlInfo1;if("string"==typeof date?begin=DateTime.formate((null==(_player_urlInfo=player.urlInfo)||null==(_player_urlInfo_searchParams=_player_urlInfo.searchParams)?void 0:_player_urlInfo_searchParams.begin)?DateTime.strToDate(null==(_player_urlInfo1=player.urlInfo)||null==(_player_urlInfo_searchParams1=_player_urlInfo1.searchParams)?void 0:_player_urlInfo_searchParams1.begin):new Date,"YYYYMMDD")+`${date.replace(/:/gi,"")}`:date instanceof Date&&(begin=DateTime.formate(date,"YYYYMMDDhhmmss")),null==(_player_recordList=player.recordList)?void 0:_player_recordList.length){const second=DateTime.strToDate(player.recordList[player.recordList.length-1].endTime).getTime();if(DateTime.strToDate(begin).getTime()>=second)return void player.logger.warn("seek time is greater than the last record end time")}if(player._recOSDTimer&&(clearInterval(player._recOSDTimer),player._recOSDTimer=null),player._seekIntervaltimer&&(clearInterval(player._seekIntervaltimer),player._seekIntervaltimer=null),player.supportSeek()&&player.playing){var _player__seekDate;player.__noSyncOSD=!0;const isGtOsd=DateTime.strToDate(begin).getTime()>(null==(_player__seekDate=player._seekDate)?void 0:_player__seekDate.getTime());player._seekDate=DateTime.strToDate(begin),player.seek(begin.substr(8,6),"235959").then((()=>{player.__noSyncOSD=!0,player._seekIntervaltimer=setInterval((()=>{player.getOSDTime().then((res=>{res.data&&(isGtOsd&&1e3*res.data>=DateTime.strToDate(begin).getTime()||!isGtOsd&&1e3*res.data-2e3>=DateTime.strToDate(begin).getTime())&&(player.loading=!1,clearInterval(player._seekIntervaltimer),player.__noSyncOSD=!1,player._seekIntervaltimer=null,player.loading=!1,player._recOSDTimer=setInterval(_async_to_generator$1((function*(){null==player.getOSDTime||player.getOSDTime.call(player)})),1e3))}))}),1e3)}))}else{const newUrl=switchEzopenUrl(player.url,{search:`begin=${begin}`});player.play({url:newUrl,unSaveUrl:!0,showPoster:!0})}})),player.on("Control.contentRerender",(info=>{var _player_jSPlugin_player_emit,_player_jSPlugin_player,_player_jSPlugin;null==(_player_jSPlugin=player.jSPlugin)||null==(_player_jSPlugin_player=_player_jSPlugin.player)||null==(_player_jSPlugin_player_emit=_player_jSPlugin_player.emit)||_player_jSPlugin_player_emit.call(_player_jSPlugin_player,"Control.contentRerender",info)}))}(this)}}EZUIKitPlayer.Talk=v,EZUIKitPlayer.provider=p,EZUIKitPlayer.LOCALES={zh:zh_CN,en:en_US},EZUIKitPlayer.EVENTS=EVENTS,EZUIKitPlayer.version="8.2.2",EZUIKitPlayer.prototype.tokenSchema={streamToken:{live:{actionType:"PREVIEW",resourceCategory:"global"},rec:{actionType:"PLAYBACK",resourceCategory:"global"},talk:{actionType:"TALK",resourceCategory:"global"}},deviceToken:{video:{action:"*",resourceCategory:"video"},global:{action:"*",resourceCategory:"global"}},httpToken:{url:{urlPattern:"/**"}}},EZUIKitPlayer.prototype.deepCheck=(schema,data,depth=1)=>{if(depth<0)return{};let result={};for(const key in schema)if(void 0!==schema[key]&&void 0===data[key])result[key]=schema[key];else if("object"==typeof schema[key]&&!Array.isArray(schema[key])){const recursiveResult=EZUIKitPlayer.prototype.deepCheck(schema[key],data[key],depth-1);Object.keys(recursiveResult).length>0&&(result[key]=recursiveResult)}return result},EZUIKitPlayer.prototype.checkToken=tokenlist=>EZUIKitPlayer.prototype.deepCheck(EZUIKitPlayer.prototype.tokenSchema,tokenlist);class EventEmitter{on(type,listener){type&&listener&&(this.events[type]=this.events[type]||[],this.events[type].push(listener))}emit(type,arg){type&&this.events[type]&&this.events[type].forEach((listener=>listener(arg)))}off(type,listener){type&&listener&&this.events[type]&&this.events[type].splice(this.events[type].indexOf(listener),1)}once(type,listener){const self=this;this.on(type,(function fn(){const args=Array.prototype.slice.call(arguments);listener.apply(null,args),self.off(type,fn)}))}removeAllListener(){this.events={}}constructor(){this.events={}}}function _extends$1(){return _extends$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends$1.apply(this,arguments)}const defaultOptions$1={list:[],pageSize:4,pageIndex:0,autoTurn:!1,autoPlay:!0,delay:1e4,loop:!1,selectScreen:0,text:"请选择播放设备",imgUrl:"",onScreenSelect:()=>{},onPageChange:()=>{}};class EZUIKitInspection{_initScreen(i){const item=this.status.list[i];if(item&&"container"in item&&item.container)return item.container;const $screen=document.createElement("div");var _this_status_screenStyle;if($screen.id=this.container.id+"-screen-"+i,$screen.style.cssText=null!=(_this_status_screenStyle=this.status.screenStyle)?_this_status_screenStyle:`\n width: ${this.status.list[i]&&this.status.list[i].width?this.status.list[i].width:600}px;\n height: ${this.status.list[i]&&this.status.list[i].height?this.status.list[i].height:400}px;\n position: relative;\n overflow: hidden;\n background-color: #000;\n background-image: url('${this.status.imgUrl}');\n background-size: 100% 100%;\n `,this.status.text){const $text=document.createElement("span");var _this_status_textStyle;$text.style.cssText=null!=(_this_status_textStyle=this.status.textStyle)?_this_status_textStyle:"\n color: #fff;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n ",$text.innerText=this.status.text,$screen.appendChild($text);const referenceNode=this.container.children[i];referenceNode?this.container.insertBefore($screen,referenceNode):this.container.appendChild($screen)}return $screen}_destroyScreen(i){const $screen=document.getElementById(`${this.container.id}-screen-${i}`);$screen&&this.container.removeChild($screen)}constructor(container,options){if(this.destroyScreen=(index,destroyAll)=>{this.screenList[index].destroy(),delete this.screenList[index],this._destroyScreen(index),!destroyAll&&this._initScreen(index)},this._emitInitPlayerResult=(code,msg)=>{const result={eventType:"initPlayer",code:code,msg:msg};this.eventEmitter.emit("initPlayer",result)},this.initPlayer=(initIndex,screenIndex,options)=>{const pageIndex=this.status.pageIndex,pageSize=this.status.pageSize,list=this.status.list;let player;if(void 0!==options){const index=void 0!==screenIndex?screenIndex:this.status.selectScreen;this.screenList[index]?(this.screenList[index].player&&this.screenList[index].player.destroy().then((()=>{this._destroyScreen(index),this._initScreen(index)})),player=new EZUIKitPlayer(options),this.screenList[index].options=options,this.screenList[index].player=player):(player=new EZUIKitPlayer(options),this.screenList.push({options:options,player:player})),this.status.list.push(options),this._emitInitPlayerResult(0,"初始化成功")}else if(list.length>0)if(void 0!==initIndex)if(initIndex>=0&&initIndex<list.length){const index=void 0!==screenIndex?screenIndex:this.status.selectScreen;this.screenList[index].player&&this.screenList[index].player.destroy().then((()=>{this._destroyScreen(index),this._initScreen(index)})),player=new EZUIKitPlayer(_extends$1({id:this.container.id+"-screen-"+index,audioOnly:!1},list[initIndex],{handleInitSuccess:()=>{this.screenSelect(this.status.selectScreen)}})),this.screenList[index].options=list[initIndex],this.screenList[index].player=player,this._emitInitPlayerResult(0,"初始化成功")}else this._emitInitPlayerResult(-1,"当前下标超出范围");else list.map(((item,index)=>{index>=pageIndex*pageSize&&index<(pageIndex+1)*pageSize&&(player=new EZUIKitPlayer(_extends$1({id:this.container.id+"-screen-"+index,audioOnly:!1},item)),this.screenList[index]={options:item,player:player})})),this._emitInitPlayerResult(0,"初始化成功");return player},this._emitPageResult=(type,code,msg)=>{const result={eventType:type,code:code,msg:msg,data:{pageSize:this.status.pageSize,pageIndex:this.status.pageIndex}};this.eventEmitter.emit(type,result),this.options.onPageChange&&this.options.onPageChange(result)},this.setList=list=>{this.status.list=list},this.getList=()=>this.status.list,this.nextPage=()=>{const{pageSize:pageSize,loop:loop,list:list}=this.status,nextPageIndex=this.status.pageIndex+1,hasNextPage=nextPageIndex*pageSize<list.length;if(hasNextPage||loop){this.status.pageIndex=hasNextPage?nextPageIndex:0;const startInd=this.status.pageIndex*pageSize,endInd=startInd+pageSize,range=list.slice(startInd,endInd);if(range.forEach(((item,index)=>{this.screenList[index].player&&this.screenList[index].player.destroy().then((()=>{this._destroyScreen(index),this._initScreen(index)})),this.status.autoPlay?(this.screenList[index].options=item,this.screenList[index].player=new EZUIKitPlayer(_extends$1({id:`${this.container.id}-screen-${index}`,audioOnly:!1},item))):delete this.screenList[index].player})),range.length<pageSize&&this.screenList.length>range.length)for(let i=range.length;i<this.screenList.length;i++)this.screenList[i].player&&this.screenList[i].player.destroy&&this.screenList[i].player.destroy(),this.screenList[i]={},this._destroyScreen(i),this._initScreen(i);this._emitPageResult("nextPage",hasNextPage?0:1,hasNextPage?"下翻页成功":"回到第一页")}else this._emitPageResult("nextPage",-1,"已到最后一页")},this.lastPage=()=>{const{pageSize:pageSize,loop:loop,list:list}=this.status;let prevPageIndex=this.status.pageIndex-1;const hasPrevPage=prevPageIndex>=0;if(!hasPrevPage&&loop){const lastPageNum=Math.floor(list.length/pageSize),isLastPageFull=list.length%pageSize==0;prevPageIndex=isLastPageFull?lastPageNum-1:lastPageNum;let startInd=prevPageIndex*pageSize,endInd=startInd+pageSize;const range=list.slice(startInd,endInd);if(!isLastPageFull)for(let i=range.length;i<this.screenList.length;i++)this.screenList[i].player&&this.screenList[i].player.destroy&&this.screenList[i].player.destroy(),this.screenList[i]={},this._destroyScreen(i),this._initScreen(i);range.forEach(((item,index)=>{this.screenList[index].player&&this.screenList[index].player.destroy().then((()=>{this._destroyScreen(index),this._initScreen(index)})),this.status.autoPlay?(this.screenList[index].options=item,this.screenList[index].player=new EZUIKitPlayer(_extends$1({id:`${this.container.id}-screen-${index}`,audioOnly:!1},item))):delete this.screenList[index].player})),this.status.pageIndex=prevPageIndex,this._emitPageResult("lastPage",1,"翻至最后一页")}else if(hasPrevPage){const startInd=prevPageIndex*pageSize,endInd=startInd+pageSize;list.slice(startInd,endInd).forEach(((item,index)=>{this.screenList[index].player&&this.screenList[index].player.destroy().then((()=>{this._destroyScreen(index),this._initScreen(index)})),this.status.autoPlay?(this.screenList[index].options=item,this.screenList[index].player=new EZUIKitPlayer(_extends$1({id:`${this.container.id}-screen-${index}`,audioOnly:!1},item))):delete this.screenList[index].player})),this.status.pageIndex=prevPageIndex,this._emitPageResult("lastPage",0,"上翻页成功")}else this._emitPageResult("lastPage",-1,"已到第一页")},this.pageTo=target=>{const pageSize=this.status.pageSize,list=this.status.list,totalPage=Math.ceil(list.length/pageSize);if(target>=0&&target<totalPage){this.status.pageIndex=target,list.slice(target*pageSize,(target+1)*pageSize).map(((item,index)=>{this.screenList[index].player&&this.screenList[index].player.destroy().then((()=>{this._destroyScreen(index),this._initScreen(index)})),this.status.autoPlay?(this.screenList[index].options=item,this.screenList[index].player=new EZUIKitPlayer(_extends$1({id:`${this.container.id}-screen-${index}`,audioOnly:!1},item))):delete this.screenList[index].player}));const result={eventType:"pageTo",code:0,msg:"跳转成功",data:{pageSize:pageSize,pageIndex:target}};this.eventEmitter.emit("pageTo",result),this.options.onPageChange&&this.options.onPageChange(pageSize,target)}else{const result={eventType:"pageTo",code:-1,msg:"目标页码超出范围",data:{pageSize:pageSize,pageIndex:this.status.pageIndex}};this.eventEmitter.emit("pageTo",result),this.options.onPageChange&&this.options.onPageChange(result)}},this.startTurn=()=>{const delay=this.status.delay;this.status.autoTurn=!0,this.turnInterval=setInterval((()=>{this.nextPage()}),delay)},this.stopTurn=()=>{this.status.autoTurn=!1,clearInterval(this.turnInterval)},this.setDelay=delay=>{this.stopTurn(),this.status.delay=delay,this.startTurn()},this.setLoop=loop=>{this.status.loop=loop,this.status.pageSize>=this.status.list.length&&(this.status.loop=!1)},this.changePageSize=size=>{const pageIndex=this.status.pageIndex,screenList=this.screenList;let availableItems=this.status.list.slice(pageIndex*size);if(size<screenList.length){for(let i=size;i<screenList.length;i++)screenList[i].player&&screenList[i].player.destroy&&screenList[i].player.destroy(),this._destroyScreen(i);this.screenList=screenList.slice(0,size)}else if(size>screenList.length)for(let i=screenList.length;i<size;i++)this._initScreen(i),availableItems[i]&&this.status.autoPlay?(this.screenList[i].options=availableItems[i],screenList[i].player=new EZUIKitPlayer(_extends$1({id:`${this.container.id}-screen-${i}`,audioOnly:!1},availableItems[i]))):screenList[i]={};this.status.pageSize=size},this.screenSelect=index=>{this.status.selectScreen=index;const screenList=this.screenList;return this.options.onScreenSelect&&this.options.onScreenSelect(index,screenList[index]),screenList[index]},this.setText=text=>{this.status.text=text},this.setBackground=url=>{this.status.imgUrl=url,this.screenList.map(((item,index)=>{const $screenDOM=document.getElementById(`${this.container.id}-screen-${index}`);$screenDOM&&($screenDOM.style.backgroundImage=`url(${url})`)}))},this.destroy=(destroyAll=!1)=>{let destroyPromise=[];this.screenList.map(((item,index)=>{item.player&&(destroyPromise.push(item.player.destroy()),delete item.player)})),Promise.all(destroyPromise).then((()=>{const $container=document.getElementById(this.container.id);if($container&&($container.innerHTML="",$container.id=this.container.id+"-destroyed"),destroyAll){const style=document.querySelector('style[innerHTML*=".screen-select"]');style&&document.head.removeChild(style),this.screenList=[]}else if(this.status.pageSize>0)for(let i=0;i<this.status.pageSize;i++)this._initScreen(i)}))},this.getScreen=target=>{const index=void 0!==target?target:this.status.selectScreen;return this.screenList[index]},this.getScreenList=()=>this.screenList,this.getDeviceList=()=>this.status.list,this.container=container,this.options=Object.assign({},defaultOptions$1,options||{}),this.status=Object.assign({},defaultOptions$1,options||{}),this.status.pageSize>=this.status.list.length&&(this.status.loop=!1),this.screenList=[],this.turnInterval=-1,this.eventEmitter=new EventEmitter,this.status.pageSize>0){const $container=document.getElementById(this.container.id);$container&&($container.innerHTML="");for(let i=0;i<this.status.pageSize;i++)this.screenList.push({}),this._initScreen(i)}this.status.autoPlay&&this.initPlayer(),this.status.autoTurn&&this.startTurn(),this.initPlayer=this.initPlayer.bind(this),this.nextPage=this.nextPage.bind(this),this.lastPage=this.lastPage.bind(this),this.startTurn=this.startTurn.bind(this),this.stopTurn=this.stopTurn.bind(this),this.setDelay=this.setDelay.bind(this),this.setLoop=this.setLoop.bind(this),this.changePageSize=this.changePageSize.bind(this),this.pageTo=this.pageTo.bind(this),this.screenSelect=this.screenSelect.bind(this),this.setText=this.setText.bind(this),this.setBackground=this.setBackground.bind(this),this.destroy=this.destroy.bind(this),this.getScreen=this.getScreen.bind(this),this.getScreenList=this.getScreenList.bind(this),this.getDeviceList=this.getDeviceList.bind(this),this.destroyScreen=this.destroyScreen.bind(this)}}function _extends(){return _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}return target},_extends.apply(this,arguments)}const defaultOptions={list:[],id:"ezuikit-inspection-player",defaultSelect:0,selectStyle:".screen-select::before { content: '';position: absolute;top: 0;left: 0;right: 0;bottom: 0;border: 2px solid red;box-sizing: border-box;z-index: 9999; pointer-events: none; }"};var id=0;function _class_private_field_loose_key(name){return"__private_"+id+++"_"+name}var oWebControl=null;function cbIntegrationCallBack(oData){oData.responseMsg.eventName}function cbConnectSuccess(){oWebControl.JS_SetWindowControlCallback({cbIntegrationCallBack:cbIntegrationCallBack}),oWebControl.JS_StartService("window",{dllPath:"./chain/cloudTransform.dll"}).then((function(){oWebControl.JS_CreateWnd("playWnd",900,500).then((function(){}))}))}function cbConnectError(){oWebControl=null}function cbConnectClose(bNormalClose){oWebControl=null}var __event=_class_private_field_loose_key("__event");class EZUIKitHD{alarmMsg(){oWebControl.JS_RequestInterface({funcName:"TransFunctionResult",arguments:encodeURI(JSON.stringify({request:{body:{alarmTypes:[10800,0,0,0,0],channelId:"066dde0465dd4abaab6afe355baf9d0b",endTime:"1621007999000",startTime:"1620921600000"},callBack:"GetAlarmMsgOrders",majorKey:"",method:"POST",storeId:"",url:"/videoplugin/message/getMessageByTypes"},response:{code:0,message:null,data:[{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620921217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920678e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919513e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919483e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919333e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918913e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918305e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917858e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917658e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917244e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917064e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916668e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916529e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916343e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916081e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915825e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915394e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915197e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914971e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914644e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914533e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914457e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914376e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914284e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913431e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912354e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912275e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912093e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091189e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911839e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091176e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911682e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091127e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911184e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910982e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910781e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910727e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910677e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910647e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910588e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910544e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091041e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091035e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910278e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910124e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909939e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909847e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909817e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909664e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909605e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909575e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090912e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909028e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908999e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908969e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908909e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090888e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908835e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090875e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090872e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908652e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908582e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908552e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908456e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090805e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907918e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907758e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907625e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907386e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907292e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907127e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906828e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906797e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906747e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906717e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906632e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906368e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906013e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905946e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905823e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905622e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905511e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905382e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905352e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905322e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905262e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905196e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090515e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904813e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090473e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209047e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904618e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904286e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904173e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904053e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904023e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903854e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903723e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903643e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903573e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903505e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209032e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090312e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902977e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090286e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090277e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902639e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902517e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902373e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090232e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902253e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902198e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902132e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090194e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090185e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901685e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901638e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090152e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901489e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901424e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901271e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901233e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900915e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900774e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900744e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090065e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090044e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900409e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900175e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900134e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900069e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900016e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899908e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899826e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899756e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899467e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899406e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899265e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899211e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089914e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089911e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089905e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898785e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898666e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898507e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898248e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898218e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898088e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089802e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089796e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089785e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089769e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089763e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16208976e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089757e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089754e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897475e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897369e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897339e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897279e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897237e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897207e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897172e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896985e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896874e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896814e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896783e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896621e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896447e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896358e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896307e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896277e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896214e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089604e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895953e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895921e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895868e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089577e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895704e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089559e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089548e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895377e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895347e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895171e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895136e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895017e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894896e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894738e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894539e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894359e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894213e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894183e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893964e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893934e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893754e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893606e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089353e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893452e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893423e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893357e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892904e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892824e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892764e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892479e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892311e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892281e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892209e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892063e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089187e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089181e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891708e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891655e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891585e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891401e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891257e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891178e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891128e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891033e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089094e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890794e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890714e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890469e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890179e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890108e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890041e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889937e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889635e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889451e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889317e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889227e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889139e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888902e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888837e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888767e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888737e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888706e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888633e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888413e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888353e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888323e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888249e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888162e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888e6},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887859e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887776e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887734e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887692e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887619e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887355e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088732e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887289e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887126e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887066e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088697e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886884e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886804e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886728e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886538e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886396e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886334e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886246e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886111e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885956e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885894e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885696e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885514e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885341e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885306e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885276e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885186e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885114e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885037e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884975e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884945e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884911e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088478e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884696e3}],success:!0}}))})}constructor(params){Object.defineProperty(this,__event,{value:_event}),this.changeModel=(num,playParams)=>{let self=this;this.switchVideo=parseInt(num),oWebControl&&oWebControl.JS_RequestInterface({funcName:"ChangeModel",arguments:encodeURI(JSON.stringify({model:num}))}).then((function(oData){0==num?self.play({deviceSerial:playParams.deviceSerial,channelNo:playParams.channelNo,validateCode:playParams.validateCode}):self.play({deviceSerial:playParams.deviceSerial,channelNo:playParams.channelNo,validateCode:playParams.validateCode,startTime:playParams.startTime,endTime:playParams.endTime})}))},this.init=initParams=>{let self=this;if(!initParams.appKey||!initParams.accessToken)return void self.showTips(!1,"请输入appkey和token");void 0!==initParams.appKey&&(this.appKey=initParams.appKey),void 0!==initParams.accessToken&&(this.accessToken=initParams.accessToken),void 0!==initParams.platformId&&(this.platformId=initParams.platformId);let argumentsPram={layout:+self.layout,userName:"",waterMark:"",waterMark:"1",iWndType:0,intelligenceEnable:1,isRecord:1,isSetPos:1,motionDetectEnable:0,playBackAlarmOverlyingEnable:0,response:{code:0,message:null,data:{appKey:initParams.appKey,ezvizToken:initParams.accessToken,videoLevel:0,logLevel:3,showMainTool:1,showSubTool:1,waterMark:"1",userName:"openteam",platformId:initParams.platformId}}};oWebControl.JS_RequestInterface({funcName:"Init",arguments:encodeURI(JSON.stringify(argumentsPram))}).then((function(oData){self.showTips(!0,"视频初始化成功!")}))},this.play=playParams=>{let self=this;if(!playParams.deviceSerial||!playParams.channelNo)return;void 0!==playParams.deviceSerial&&(this.deviceSerial=playParams.deviceSerial),void 0!==playParams.channelNo&&(this.channelNo=playParams.channelNo),void 0!==playParams.startTime&&playParams.startTime&&(this.startTime=playParams.startTime+" 00:00:00"),void 0!==playParams.endTime&&playParams.endTime&&(this.endTime=playParams.endTime+" 23:59:59"),void 0!==playParams.validateCode&&playParams.validateCode&&(this.validateCode=playParams.validateCode);let argumentsPram={response:{code:0,message:null,data:{deviceSerial:playParams.deviceSerial,channelCode:playParams.channelNo,channelNo:+playParams.channelNo,codeIsEncrypt:0,validateCode:playParams.validateCode,deviceClass:self.deviceClass,deviceType:"10222",channelId:"2222222222",channelName:"channelNameTest",storeName:"storeName",storeId:"storeid",startTime:this.startTime,endTime:this.endTime}}};"1"===self.deviceClass?(argumentsPram.response.data.channelCode=self.channelNo,argumentsPram.response.data.platformId=self.platformId):argumentsPram.response.data.channelNo=+self.channelNo,1===this.switchVideo&&(this.startTime&&(argumentsPram.response.data.startTime=this.startTime),this.endTime&&(argumentsPram.response.data.endTime=this.endTime)),oWebControl.JS_RequestInterface({funcName:0===this.switchVideo?"StartPreview":"StartPlayback",arguments:encodeURI(JSON.stringify(argumentsPram))}).then((function(oData){self.showTips(!0,"预览/回放成功!")})).catch((res=>{}))},this.showCBInfo=message=>{this.callbackMessage=this.callbackMessage+JSON.stringify(message)+"\n\n"},this.showTips=(status,message)=>{},this.hideVideo=()=>{oWebControl.JS_HideWnd()},this.showVideo=()=>{oWebControl.JS_ShowWnd()},this.GetLayout=()=>{oWebControl.JS_RequestInterface({funcName:"GetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(oData){}))},this.capturePicture=wndId=>{oWebControl.JS_RequestInterface({funcName:"CaptureJPGEx",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(oData){}))},this.stop=(wndId=-1)=>{oWebControl.JS_RequestInterface({funcName:"StopPlay",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(wndId)}}}))}).then((function(oData){}))},this.setLayout=num=>{let layout=parseInt(num);isNaN(layout)||0==layout||layout>=13||(this.layout=layout,oWebControl.JS_RequestInterface({funcName:"SetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{layout:layout}}}))}).then((function(oData){})))},this.setSoundVolumn=(wndId=-1,num)=>{oWebControl.JS_RequestInterface({funcName:"SoundVolumn",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(wndId),volumn:parseInt(num)}}}))}).then((function(oData){}))},this.testMute=()=>{var num=parseInt(prompt("请输入窗口ID"));oWebControl.JS_RequestInterface({funcName:"MuteOnOff",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:num}}}))}).then((function(oData){}))},this.testSelectWnd=()=>{var num=parseInt(prompt("请输入窗口ID"));oWebControl.JS_RequestInterface({funcName:"SelectPlayWnd",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:num}}}))}).then((function(oData){}))},this.setVideoLevel=(wndId,level)=>{oWebControl.JS_RequestInterface({funcName:"SetVideoLevel",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:1==this.switchVideo?0:parseInt(wndId),level:parseInt(level,10)}}}))}).then((function(oData){}))},this.startTalk=wndId=>{oWebControl.JS_RequestInterface({funcName:"StartTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(wndId)}}}))}).then((function(oData){}))},this.stopTalk=wndId=>{oWebControl.JS_RequestInterface({funcName:"StopTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(wndId)}}}))}).then((function(oData){}))},this.startSave=wndId=>{oWebControl.JS_RequestInterface({funcName:"StartRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(wndId)}}}))}).then((function(oData){}))},this.stopSave=wndId=>{oWebControl.JS_RequestInterface({funcName:"StopRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(wndId)}}}))}).then((function(oData){}))},this.appKey="b9a3ad6e8026410095d8252169fa430a",this.accessToken="at.2vtum8873rrcwbrv431qb6pn94dkbv23-8dw2twn355-1u3x014-wrthellzk",this.deviceSerial="C33368372",this.channelNo="1",this.validateCode="",this.deviceClass="0",this.platformId="",this.startTime="",this.endTime="",this.layout=2,this.switchVideo=0,this.tips="调用成功",this.successTip=!1,this.tipsShow=!1,oWebControl=function(id,cbConnectSuccess,cbConnectError,cbConnectClose){return new WebControl({szPluginContainer:id,iServicePortStart:14510,iServicePortEnd:14519,cbConnectSuccess:cbConnectSuccess,cbConnectError:cbConnectError,cbConnectClose:cbConnectClose})}("playWnd",cbConnectSuccess,cbConnectError,cbConnectClose),function(receiver,privateKey){if(!Object.prototype.hasOwnProperty.call(receiver,privateKey))throw new TypeError("attempted to use private field on non-instance");return receiver}(this,__event)[__event]()}}function _event(){window.onscroll=function(){null!=oWebControl&&oWebControl.JS_Resize(900,500)},window.onresize=function(){null!=oWebControl&&oWebControl.JS_Resize(900,500)},window.onunload=function(){try{oWebControl.JS_HideWnd(),null!=oWebControl&&(oWebControl.JS_DestroyWnd().then((function(){}),(function(){})),oWebControl.JS_StopService("window").then((function(){oWebControl.JS_Disconnect().then((function(){}),(function(){}))})))}catch(error){}},window.onpagehide=function(){try{oWebControl.JS_HideWnd()}catch(error){}}}window.EZUIKit={};const EZUIKit={EZUIKitPlayer:EZUIKitPlayer,EZUIKitInspection:EZUIKitInspection,EZUIKitInspectionUI:class{constructor(container,options){this.init=()=>{const oldInspection=document.getElementById(this.options.id+"-destroyed");var _oldInspection_parentNode;oldInspection&&(null==(_oldInspection_parentNode=oldInspection.parentNode)||_oldInspection_parentNode.removeChild(oldInspection));const $inspection=document.createElement("div");$inspection.id=this.options.id,$inspection.style.cssText="\n position: relative;\n overflow: hidden;\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n height: 100%;\n ",this.container.append($inspection),this.$inspection=$inspection,this.inspection=new EZUIKitInspection(this.$inspection,_extends({},this.options,{onScreenSelect:(index,item)=>{if(this.inspection){for(let i=0;i<this.inspection.screenList.length;i++){const $screen=this.$inspection.children[i];$screen&&$screen.classList.remove("screen-select")}const $screenSelect=this.$inspection.children[index];$screenSelect&&$screenSelect.classList.add("screen-select")}this.options.onScreenSelect&&this.options.onScreenSelect(index,item)}}));for(let i=0;i<this.inspection.screenList.length;i++)delegate$1(this.$inspection,"#"+this.options.id+"-screen-"+i,"click",(event=>{this.screenSelect(i)}));this.screenSelect(this.options.defaultSelect)},this.initPlayer=(initIndex,screenIndex,options)=>{this.inspection&&this.inspection.initPlayer(initIndex,screenIndex,options)},this.destroy=(destroyAll=!1)=>{this.inspection&&this.inspection.destroy(destroyAll)},this.nextPage=()=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.nextPage()},this.lastPage=()=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.lastPage()},this.startTurn=()=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.startTurn()},this.stopTurn=()=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.stopTurn()},this.setDelay=delay=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.setDelay(delay)},this.setLoop=loop=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.setLoop(loop)},this.changePageSize=size=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.changePageSize(size)},this.pageTo=index=>{var _this_inspection;null==(_this_inspection=this.inspection)||_this_inspection.pageTo(index)},this.screenSelect=index=>{var _this_inspection;if(this.inspection)return null==(_this_inspection=this.inspection)?void 0:_this_inspection.screenSelect(index)},this.setText=text=>{var _this_inspection;return null==(_this_inspection=this.inspection)?void 0:_this_inspection.setText(text)},this.setBackground=background=>{var _this_inspection;return null==(_this_inspection=this.inspection)?void 0:_this_inspection.setBackground(background)},this.getScreen=index=>{var _this_inspection;return null==(_this_inspection=this.inspection)?void 0:_this_inspection.getScreen(index)},this.getScreenList=()=>{var _this_inspection;return null==(_this_inspection=this.inspection)?void 0:_this_inspection.getScreenList()},this.destroyScreen=index=>{var _this_inspection;return null==(_this_inspection=this.inspection)?void 0:_this_inspection.destroyScreen(index)},this.getDeviceList=()=>{var _this_inspection;return null==(_this_inspection=this.inspection)?void 0:_this_inspection.getDeviceList()},this.stopAll=()=>{var _this_inspection;const list=null==(_this_inspection=this.inspection)?void 0:_this_inspection.getScreenList();if(list)for(let i=0;i<list.length;i++)list[i].player&&(list[i].options.url.indexOf("live")>0?list[i].player.stop((()=>{}),!0):list[i].player.pause())},this.playAll=()=>{var _this_inspection;const list=null==(_this_inspection=this.inspection)?void 0:_this_inspection.getScreenList();if(list)for(let i=0;i<list.length;i++)list[i].player&&(list[i].options.url.indexOf("live")>0?list[i].player.play():list[i].player.resume())},this.muteAll=()=>{var _this_inspection;const list=null==(_this_inspection=this.inspection)?void 0:_this_inspection.getScreenList();if(list)for(let i=0;i<list.length;i++)list[i].player&&list[i].player.closeSound()},this.unmuteAll=()=>{var _this_inspection;const list=null==(_this_inspection=this.inspection)?void 0:_this_inspection.getScreenList();if(list)for(let i=0;i<list.length;i++)list[i].player&&list[i].player.openSound()},this.container=container,this.options=Object.assign({},defaultOptions,options||{}),this.$inspection=document.createElement("div");const style=document.createElement("style");style.innerHTML=this.options.selectStyle,document.head.appendChild(style),this.init(),this.initPlayer=this.initPlayer.bind(this),this.nextPage=this.nextPage.bind(this),this.lastPage=this.lastPage.bind(this),this.startTurn=this.startTurn.bind(this),this.stopTurn=this.stopTurn.bind(this),this.setDelay=this.setDelay.bind(this),this.setLoop=this.setLoop.bind(this),this.changePageSize=this.changePageSize.bind(this),this.pageTo=this.pageTo.bind(this),this.screenSelect=this.screenSelect.bind(this),this.setText=this.setText.bind(this),this.setBackground=this.setBackground.bind(this),this.destroy=this.destroy.bind(this),this.getScreen=this.getScreen.bind(this),this.getScreenList=this.getScreenList.bind(this),this.destroyScreen=this.destroyScreen.bind(this),this.getDeviceList=this.getDeviceList.bind(this),this.stopAll=this.stopAll.bind(this),this.playAll=this.playAll.bind(this),this.muteAll=this.muteAll.bind(this),this.unmuteAll=this.unmuteAll.bind(this)}},EZUIKitHD:EZUIKitHD};export{EZUIKitHD,EZUIKitPlayer,EZUIKit as default};